homepage.php 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149
  1. <?php
  2. $data = false;
  3. ini_set("display_errors", 1);
  4. ini_set("error_reporting", E_ALL | E_STRICT);
  5. require_once("user.php");
  6. require_once("functions.php");
  7. $USER = new User("registration_callback");
  8. // Check if connection to homepage is allowed
  9. qualifyUser(HOMEPAGEAUTHNEEDED, true);
  10. // Load Colours/Appearance
  11. foreach(loadAppearance() as $key => $value) {
  12. ${$key} = $value;
  13. }
  14. ?>
  15. <!DOCTYPE html>
  16. <html lang="en" class="no-js">
  17. <head>
  18. <meta charset="UTF-8">
  19. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  20. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  21. <meta name="msapplication-tap-highlight" content="no" />
  22. <title><?=$title;?> Homepage</title>
  23. <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
  24. <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  25. <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
  26. <script src="js/menu/modernizr.custom.js"></script>
  27. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
  28. <link rel="stylesheet" href="bower_components/fullcalendar/dist/fullcalendar.css">
  29. <link rel="stylesheet" href="css/style.css?v=<?php echo INSTALLEDVERSION; ?>">
  30. <link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  31. <link rel="stylesheet" href="bower_components/google-material-color/dist/palette.css?v=<?php echo INSTALLEDVERSION; ?>">
  32. <link rel="stylesheet" type="text/css" href="bower_components/slick/slick.css?v=<?php echo INSTALLEDVERSION; ?>">
  33. <!-- Add the slick-theme.css if you want default styling -->
  34. <!--Scripts-->
  35. <script src="bower_components/jquery/dist/jquery.min.js"></script>
  36. <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  37. <script src="bower_components/moment/min/moment.min.js"></script>
  38. <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  39. <script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  40. <script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  41. <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  42. <script src="bower_components/cta/dist/cta.min.js"></script>
  43. <script src="bower_components/fullcalendar/dist/fullcalendar.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  44. <script src="bower_components/slick/slick.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  45. <script src="js/jqueri_ui_custom/jquery-ui.min.js"></script>
  46. <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
  47. <!--Other-->
  48. <script src="js/ajax.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  49. <!--[if lt IE 9]>
  50. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  51. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  52. <![endif]-->
  53. <style>
  54. .fc-day-grid-event{
  55. cursor: pointer;
  56. }
  57. .recentItems {
  58. padding-top: 10px;
  59. margin: 5px 0;
  60. }
  61. .slick-image-tall{
  62. width: 125px;
  63. height: 180px;
  64. }
  65. .slick-image-short{
  66. width: 125px;
  67. height: 130px;
  68. margin-top: 50px;
  69. }
  70. .overlay{
  71. position: absolute;
  72. top: 0;
  73. left: 0;
  74. width: 100%;
  75. height: 100%;
  76. display: none;
  77. z-index: 0;
  78. opacity: .98;
  79. }
  80. sort {
  81. display: none;
  82. }
  83. table.fc-list-table {
  84. table-layout: auto;
  85. }.tabbable{
  86. margin-bottom: 0;
  87. }.fc-day-grid-event .fc-content {
  88. white-space: normal;
  89. }.fc-list-item {
  90. table-layout: auto;
  91. position: inherit;
  92. margin: 10px;
  93. border-radius: 4px;
  94. padding: 0 5px 0 5px;
  95. color: #fff !important;
  96. }.fc-calendar .fc-toolbar {
  97. background: <?=$topbar;?>;
  98. color: <?=$topbartext;?>;
  99. border-radius: 5px 5px 0 0;
  100. padding: 15px;
  101. }.fc-calendar .fc-toolbar .fc-right {
  102. bottom: 0px;
  103. right: 20px;
  104. }.fc-calendar .fc-toolbar .fc-right button {
  105. color: <?=$topbartext;?>;
  106. }.fc-calendar .fc-toolbar .fc-prev-button, .fc-calendar .fc-toolbar .fc-next-button {
  107. color: <?=$topbartext;?>;
  108. }.carousel-image{
  109. width: 100px !important;
  110. height: 150px !important;
  111. border-radius: 3px 0 0 3px;
  112. }.carousel-image.album{
  113. width: 150px !important;
  114. height: 150px !important;
  115. border-radius: 3px 0 0 3px;
  116. }.carousel-control.album {
  117. top: 5px !important;
  118. width: 4% !important;
  119. }.carousel-control {
  120. top: 5px !important;
  121. width: 4% !important;
  122. }.carousel-caption.album {
  123. position: absolute;
  124. right: 4%;
  125. top: 0px;
  126. left: 160px;
  127. z-index: 10;
  128. bottom: 0px;
  129. padding-top: 0px;
  130. color: #fff;
  131. text-align: left;
  132. }.carousel-caption {
  133. position: absolute;
  134. right: 4%;
  135. top: 0px;
  136. left: 110px;
  137. z-index: 10;
  138. bottom: 0px;
  139. padding-top: 0px;
  140. color: #fff;
  141. text-align: left;
  142. padding-bottom: 2px !important;
  143. overflow: hidden !important;
  144. } @media screen and (max-width: 576px) {
  145. .nzbtable {
  146. padding-left: 5px !important;
  147. padding-right: 2px !important;
  148. font-size: 10px !important;
  149. word-break: break-word !important;
  150. }
  151. .nzbtable-file-row {
  152. padding-left: 5px !important;
  153. padding-right: 2px !important;
  154. font-size: 10px !important;
  155. white-space: normal !important;
  156. word-break: break-all !important;
  157. width: 0% !important;
  158. }
  159. } .nzbtable-file-row {
  160. white-space: normal !important;
  161. word-break: break-all !important;
  162. width: 0% !important;
  163. }.nzbtable-row {
  164. white-space: normal !important;
  165. width: 0% !important;
  166. font-size: 12px; !important;
  167. }<?php customCSS(); ?>
  168. </style>
  169. </head>
  170. <body class="scroller-body" style="padding: 0px;">
  171. <div class="main-wrapper" style="position: initial;">
  172. <div id="content" class="container-fluid">
  173. <br/>
  174. <?php if (qualifyUser(HOMEPAGENOTICEAUTH) && HOMEPAGENOTICETITLE && HOMEPAGENOTICETYPE && HOMEPAGENOTICEMESSAGE && HOMEPAGENOTICELAYOUT) { echo buildHomepageNotice(HOMEPAGENOTICELAYOUT, HOMEPAGENOTICETYPE, HOMEPAGENOTICETITLE, HOMEPAGENOTICEMESSAGE); } ?>
  175. <?php if (qualifyUser(HOMEPAGECUSTOMHTML1AUTH) && HOMEPAGECUSTOMHTML1) { echo "<div>" . HOMEPAGECUSTOMHTML1 . "</div>"; } ?>
  176. <?php if(SPEEDTEST == "true"){ ?>
  177. <style type="text/css">
  178. .flash {
  179. animation: flash 0.6s linear infinite;
  180. }
  181. @keyframes flash {
  182. 0% { opacity: 0.6; }
  183. 50% { opacity: 1; }
  184. }
  185. </style>
  186. <script type="text/javascript">
  187. var w = null
  188. function runTest() {
  189. document.getElementById('startBtn').style.display = 'none'
  190. document.getElementById('testArea').style.display = ''
  191. document.getElementById('abortBtn').style.display = ''
  192. w = new Worker('bower_components/speed/speedtest_worker.min.js')
  193. var interval = setInterval(function () { w.postMessage('status') }, 100)
  194. w.onmessage = function (event) {
  195. var data = event.data.split(';')
  196. var status = Number(data[0])
  197. var dl = document.getElementById('download')
  198. var ul = document.getElementById('upload')
  199. var ping = document.getElementById('ping')
  200. var jitter = document.getElementById('jitter')
  201. dl.className = status === 1 ? 'w-name flash' : 'w-name'
  202. ping.className = status === 2 ? 'w-name flash' : 'w-name'
  203. jitter.className = ul.className = status === 3 ? 'w-name flash' : 'w-name'
  204. if (status >= 4) {
  205. clearInterval(interval)
  206. document.getElementById('abortBtn').style.display = 'none'
  207. document.getElementById('startBtn').style.display = ''
  208. w = null
  209. }
  210. if (status === 5) {
  211. document.getElementById('testArea').style.display = 'none'
  212. }
  213. dl.textContent = data[1] + " Mbit/s";
  214. $("#downloadpercent").attr("style", "width: " + data[1] + "%;");
  215. $("#uploadpercent").attr("style", "width: " + data[2] + "%;");
  216. $("#pingpercent").attr("style", "width: " + data[3] + "%;");
  217. $("#jitterpercent").attr("style", "width: " + data[5] + "%;");
  218. ul.textContent = data[2] + " Mbit/s";
  219. ping.textContent = data[3] + " ms";
  220. jitter.textContent = data[5] + " ms";
  221. }
  222. w.postMessage('start')
  223. }
  224. function abortTest() {
  225. if (w) w.postMessage('abort')
  226. }
  227. </script>
  228. <div class="row" id="testArea" style="display:none">
  229. <div class="test col-sm-3 col-lg-3">
  230. <div class="content-box ultra-widget green-bg" data-counter="">
  231. <div id="downloadpercent" class="progress-bar progress-bar-striped active w-used" style=""></div>
  232. <div class="w-content">
  233. <div class="w-icon right pull-right"><i class="mdi mdi-cloud-download"></i></div>
  234. <div class="w-descr left pull-left text-center">
  235. <span class="testName text-uppercase w-name">Download</span>
  236. <br>
  237. <span class="w-name counter" id="download" ></span>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. <div class="test col-sm-3 col-lg-3">
  243. <div class="content-box ultra-widget red-bg" data-counter="">
  244. <div id="uploadpercent" class="progress-bar progress-bar-striped active w-used" style=""></div>
  245. <div class="w-content">
  246. <div class="w-icon right pull-right"><i class="mdi mdi-cloud-upload"></i></div>
  247. <div class="w-descr left pull-left text-center">
  248. <span class="testName text-uppercase w-name">Upload</span>
  249. <br>
  250. <span class="w-name counter" id="upload" ></span>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. <div class="test col-sm-3 col-lg-3">
  256. <div class="content-box ultra-widget yellow-bg" data-counter="">
  257. <div id="pingpercent" class="progress-bar progress-bar-striped active w-used" style=""></div>
  258. <div class="w-content">
  259. <div class="w-icon right pull-right"><i class="mdi mdi-timer"></i></div>
  260. <div class="w-descr left pull-left text-center">
  261. <span class="testName text-uppercase w-name">Latency</span>
  262. <br>
  263. <span class="w-name counter" id="ping" ></span>
  264. </div>
  265. </div>
  266. </div>
  267. </div>
  268. <div class="test col-sm-3 col-lg-3">
  269. <div class="content-box ultra-widget blue-bg" data-counter="">
  270. <div id="jitterpercent" class="progress-bar progress-bar-striped active w-used" style=""></div>
  271. <div class="w-content">
  272. <div class="w-icon right pull-right"><i class="mdi mdi-pulse"></i></div>
  273. <div class="w-descr left pull-left text-center">
  274. <span class="testName text-uppercase w-name">Jitter</span>
  275. <br>
  276. <span class="w-name counter" id="jitter" ></span>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. <br/>
  282. </div>
  283. <div id="abortBtn" class="row" style="display: none" onclick="javascript:abortTest()">
  284. <div class="col-lg-12">
  285. <div class="content-box red-bg" style="cursor: pointer;">
  286. <h1 style="margin: 10px" class="text-uppercase text-center">Abort Speed Test</h1>
  287. <div class="clearfix"></div>
  288. </div>
  289. </div>
  290. </div>
  291. <div id="startBtn" class="row" onclick="javascript:runTest()">
  292. <div class="col-lg-12">
  293. <div class="content-box green-bg" style="cursor: pointer;">
  294. <h1 style="margin: 10px" class="text-uppercase text-center">Run Speed Test</h1>
  295. <div class="clearfix"></div>
  296. </div>
  297. </div>
  298. </div>
  299. <?php } ?>
  300. <?php if((PLEXSEARCH == "true" && qualifyUser(PLEXHOMEAUTH))) { ?>
  301. <div id="searchPlexRow" class="row">
  302. <div class="col-lg-12">
  303. <div class="content-box box-shadow big-box todo-list">
  304. <form id="plexSearchForm" onsubmit="return false;" autocomplete="off">
  305. <div class="">
  306. <div class="input-group">
  307. <div style="border-radius: 25px 0 0 25px; border:0" class="input-group-addon gray-bg"><i class="fa fa-search white"></i></div>
  308. <input id="searchInput" type="text" style="border-radius: 0;" autocomplete="off" name="search-title" class="form-control input-group-addon gray-bg" placeholder="Media Search">
  309. <div id="clearSearch" style="border-radius: 0 25px 25px 0;border:0; cursor: pointer;" class="input-group-addon gray-bg"><i class="fa fa-close white"></i></div>
  310. <button style="display:none" id="plexSearchForm_submit" class="btn btn-primary waves"></button>
  311. </div>
  312. </div>
  313. </form>
  314. <div id="resultshere" class="table-responsive"></div>
  315. </div>
  316. </div>
  317. </div>
  318. <?php } ?>
  319. <?php if((NZBGETURL != "" && qualifyUser(NZBGETHOMEAUTH)) || (SABNZBDURL != "" && qualifyUser(SABNZBDHOMEAUTH))) { ?>
  320. <div id="downloadClientRow" class="row">
  321. <div class="col-xs-12 col-md-12">
  322. <div class="content-box">
  323. <div class="tabbable panel with-nav-tabs panel-default">
  324. <div class="panel-heading">
  325. <div class="content-tools i-block pull-right">
  326. <a id="getDownloader" class="repeat-btn">
  327. <i class="fa fa-repeat"></i>
  328. </a>
  329. </div>
  330. <h3 class="pull-left"><?php if(NZBGETURL != ""){ echo "NZBGet "; } if(SABNZBDURL != ""){ echo "SABnzbd "; } ?></h3>
  331. <ul class="nav nav-tabs pull-right">
  332. <li class="active"><a href="#downloadQueue" data-toggle="tab" aria-expanded="true"><?php echo $language->translate("QUEUE");?></a></li>
  333. <li class=""><a href="#downloadHistory" data-toggle="tab" aria-expanded="false"><?php echo $language->translate("HISTORY");?></a></li>
  334. </ul>
  335. <div class="clearfix"></div>
  336. </div>
  337. <div class="panel-body">
  338. <div class="tab-content">
  339. <div class="tab-pane fade active in" id="downloadQueue">
  340. <div class="table-responsive" style="max-height: 300px">
  341. <table class="table table-striped progress-widget zero-m" style="max-height: 300px">
  342. <thead>
  343. <tr>
  344. <th class="col-xs-7 nzbtable-file-row"><?php echo $language->translate("FILE");?></th>
  345. <th class="col-xs-2 nzbtable"><?php echo $language->translate("STATUS");?></th>
  346. <th class="col-xs-1 nzbtable"><?php echo $language->translate("CATEGORY");?></th>
  347. <th class="col-xs-2 nzbtable"><?php echo $language->translate("PROGRESS");?></th>
  348. </tr>
  349. </thead>
  350. <tbody class="dl-queue sabnzbd"></tbody>
  351. <tbody class="dl-queue nzbget"></tbody>
  352. </table>
  353. </div>
  354. </div>
  355. <div class="tab-pane fade" id="downloadHistory">
  356. <div class="table-responsive" style="max-height: 300px">
  357. <table class="table table-striped progress-widget zero-m" style="max-height: 300px">
  358. <thead>
  359. <tr>
  360. <th class="col-xs-7 nzbtable-file-row"><?php echo $language->translate("FILE");?></th>
  361. <th class="col-xs-2 nzbtable"><?php echo $language->translate("STATUS");?></th>
  362. <th class="col-xs-1 nzbtable"><?php echo $language->translate("CATEGORY");?></th>
  363. <th class="col-xs-2 nzbtable"><?php echo $language->translate("PROGRESS");?></th>
  364. </tr>
  365. </thead>
  366. <tbody class="dl-history sabnzbd"></tbody>
  367. <tbody class="dl-history nzbget"></tbody>
  368. </table>
  369. </div>
  370. </div>
  371. </div>
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. <?php } ?>
  378. <?php if (qualifyUser(PLEXHOMEAUTH) && PLEXTOKEN) { ?>
  379. <div id="plexRowNowPlaying" class="row">
  380. <?php if(PLEXPLAYINGNOW == "true"){ echo getPlexStreams(12, PLEXSHOWNAMES, $USER->role); } ?>
  381. </div>
  382. <div id="plexRow" class="row">
  383. <div class="col-lg-12">
  384. <?php
  385. if(PLEXRECENTMOVIE == "true" || PLEXRECENTTV == "true" || PLEXRECENTMUSIC == "true"){
  386. $plexArray = array("movie" => PLEXRECENTMOVIE, "season" => PLEXRECENTTV, "album" => PLEXRECENTMUSIC);
  387. echo getPlexRecent($plexArray);
  388. }
  389. ?>
  390. <!--<script>
  391. setInterval(function() {
  392. $('<div></div>').load('ajax.php?a=plex-recent',function() {
  393. var element = $(this).find('[id]');
  394. var loadedID = element.attr('id');
  395. $('#'+loadedID).replaceWith(element);
  396. console.log('Recent updated: '+loadedID);
  397. });
  398. }, 15000);
  399. </script>-->
  400. </div>
  401. </div>
  402. <div id="plexPlaylists" class="row">
  403. <div class="col-lg-12">
  404. <?php
  405. if(PLEXPLAYLISTS == "true"){
  406. echo getPlexPlaylists($plexArray);
  407. }
  408. ?>
  409. </div>
  410. </div>
  411. <?php } ?>
  412. <?php if (qualifyUser(EMBYHOMEAUTH) && EMBYTOKEN) { ?>
  413. <div id="embyRowNowPlaying" class="row">
  414. <?php if(EMBYPLAYINGNOW == "true"){ echo getEmbyStreams(12, EMBYSHOWNAMES, $USER->role); } ?>
  415. </div>
  416. <div id="embyRow" class="row">
  417. <div class="col-lg-12">
  418. <?php
  419. if(EMBYRECENTMOVIE == "true" || EMBYRECENTTV == "true" || EMBYRECENTMUSIC == "true"){
  420. $embyArray = array("Movie" => EMBYRECENTMOVIE, "Episode" => EMBYRECENTTV, "MusicAlbum" => EMBYRECENTMUSIC, "Series" => EMBYRECENTTV);
  421. echo getEmbyRecent($embyArray);
  422. }
  423. ?>
  424. </div>
  425. </div>
  426. <?php } ?>
  427. <?php if ((SONARRURL != "" && qualifyUser(SONARRHOMEAUTH)) || (RADARRURL != "" && qualifyUser(RADARRHOMEAUTH)) || (HEADPHONESURL != "" && qualifyUser(HEADPHONESHOMEAUTH)) || (SICKRAGEURL != "" && qualifyUser(SICKRAGEHOMEAUTH))) { ?>
  428. <div id="calendarLegendRow" class="row" style="padding: 0 0 10px 0;">
  429. <div class="col-lg-12 content-form form-inline">
  430. <div class="form-group">
  431. <select class="form-control" id="imagetype_selector" style="width: auto !important; display: inline-block">
  432. <option value="all">View All</option>
  433. <?php if(RADARRURL != ""){ echo '<option value="film">Movies</option>'; }?>
  434. <?php if(SONARRURL != "" || SICKRAGEURL != ""){ echo '<option value="tv">TV Shows</option>'; }?>
  435. <?php if(HEADPHONESURL != ""){ echo '<option value="music">Music</option>'; }?>
  436. </select>
  437. <span class="label label-primary well-sm">Available</span>
  438. <span class="label label-danger well-sm">Unavailable</span>
  439. <span class="label indigo-bg well-sm">Unreleased</span>
  440. <span class="label light-blue-bg well-sm">Premier</span>
  441. </div>
  442. <!--
  443. <div class="pull-right">
  444. <div class="btn-group" role="group">
  445. <button type="button" class="btn waves btn-default btn-sm dropdown-toggle waves-effect waves-float" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">View All<span class="caret"></span></button>
  446. <ul style="right:0; left: auto" class="dropdown-menu">
  447. <li><a class="" href="javascript:void(0)">Movies</a></li>
  448. <li><a class="" href="javascript:void(0)">TV Shows</a></li>
  449. <li><a class="" href="javascript:void(0)">Music</a></li>
  450. </ul>
  451. </div>
  452. </div>-->
  453. </div>
  454. </div>
  455. <div id="calendarRow" class="row">
  456. <div class="col-lg-12">
  457. <div id="calendar" class="fc-calendar box-shadow fc fc-ltr fc-unthemed"></div>
  458. </div>
  459. </div>
  460. <?php } ?>
  461. </div>
  462. </div>
  463. <script>
  464. $('.close-btn').click(function(e){
  465. var closedBox = $(this).closest('div.content-box').remove();
  466. e.preventDefault();
  467. });
  468. $('#clearSearch').click(function(e){
  469. $('#searchInput').val("");
  470. $('#resultshere').html("");
  471. $('#searchInput').focus();
  472. e.preventDefault();
  473. });
  474. $(document).on("click", ".openTab", function(e) {
  475. var Title = $(this).attr("extraTitle");
  476. var Type = $(this).attr("extraType");
  477. var openTab = $(this).attr("openTab");
  478. var location = $(this).attr("href");
  479. if( Type === 'season' || Type === 'episode'){
  480. Type = "tv";
  481. SearchType = "show";
  482. }else if( Type === 'movie'){
  483. Type = "movie";
  484. SearchType = "movie";
  485. }
  486. if( Type === 'tv' || Type === 'movie' ){
  487. $('#calendarExtra').modal('show');
  488. var refreshBox = $('#calendarMainID');
  489. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  490. setTimeout(function(){
  491. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  492. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  493. refreshPreloader.remove();
  494. });
  495. },600);
  496. ajax_request('POST', 'tvdb-search', {
  497. name: Title,
  498. type: SearchType,
  499. }).done(function(data){
  500. if( data.trakt ) {
  501. $.ajax({
  502. type: 'GET',
  503. url: 'https://api.themoviedb.org/3/'+Type+'/'+data.trakt.tmdb+'?api_key=83cf4ee97bb728eeaf9d4a54e64356a1&append_to_response=videos,credits',
  504. cache: true,
  505. async: true,
  506. complete: function(xhr, status) {
  507. var result = $.parseJSON(xhr.responseText);
  508. if (xhr.statusText === "OK") {
  509. if( Type === "movie"){
  510. $('#calendarTitle').html(result.title);
  511. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  512. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(result.runtime)+'</span>&nbsp;');
  513. $('#calendarSummary').text(result.overview);
  514. $('#calendarTagline').text(result.tagline);
  515. $('#calendarTrailer').html(convertTrailer(result.videos)+'&nbsp;<span class="label openPlex palette-Amber-600 bg" openTab="'+openTab+'" location="'+location+'" style="width:100%;display:block;cursor:pointer;"><i style="vertical-align:sub;" class="fa fa-play white"></i><text style="vertical-align:sub;"> Watch Now on PLEX</text></span>');
  516. $('#calendarCast').html(convertCast(result.credits));
  517. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  518. $('#calendarLang').html(convertArray(result.spoken_languages, "MOVIE"));
  519. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  520. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(https://image.tmdb.org/t/p/w1000"+result.backdrop_path+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  521. $('#calendarExtra').modal('show');
  522. }else if (Type === "tv"){
  523. $('#calendarTitle').html(result.name);
  524. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  525. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(whatWasIt(result.episode_run_time))+'</span>&nbsp;');
  526. $('#calendarSummary').text(result.overview);
  527. $('#calendarTagline').text("");
  528. $('#calendarTrailer').html(convertTrailer(result.videos)+'&nbsp;<span class="label openPlex palette-Amber-600 bg" openTab="'+openTab+'" location="'+location+'" style="width:100%;display:block;cursor:pointer;"><i style="vertical-align:sub;" class="fa fa-play white"></i><text style="vertical-align:sub;"> Watch Now on PLEX</text></span>');
  529. $('#calendarCast').html(convertCast(result.credits));
  530. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  531. $('#calendarLang').html(convertArray(result.languages, "TV"));
  532. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  533. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(https://image.tmdb.org/t/p/w1000"+result.backdrop_path+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  534. $('#calendarExtra').modal('show');
  535. }
  536. }
  537. }
  538. });
  539. }
  540. });
  541. e.preventDefault();
  542. }else{
  543. if($(this).attr("openTab") === "true") {
  544. var isActive = parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']");
  545. var activeFrame = isActive.children('iframe');
  546. if(isActive.length === 1){
  547. activeFrame.attr("src", $(this).attr("href"));
  548. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  549. }else{
  550. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  551. parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']").children('iframe').attr("src", $(this).attr("href"));
  552. }
  553. e.preventDefault();
  554. }else{
  555. var source = $(this).attr("href");
  556. window.open(source, '_blank');
  557. }
  558. }
  559. });
  560. $(document).on("click", ".openPlex", function(e) {
  561. if($(this).attr("openTab") === "true") {
  562. var isActive = parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']");
  563. var activeFrame = isActive.children('iframe');
  564. if(isActive.length === 1){
  565. activeFrame.attr("src", $(this).attr("href"));
  566. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  567. }else{
  568. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  569. parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']").children('iframe').attr("src", $(this).attr("location"));
  570. }
  571. }else{
  572. var source = $(this).attr("location");
  573. window.open(source, '_blank');
  574. }
  575. });
  576. function localStorageSupport() {
  577. return (('localStorage' in window) && window['localStorage'] !== null)
  578. }
  579. $( document ).ready(function() {
  580. $('#plexSearchForm').on('submit', function () {
  581. var refreshBox = $(this).closest('div.content-box');
  582. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  583. setTimeout(function(){
  584. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  585. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  586. refreshPreloader.remove();
  587. });
  588. },1000);
  589. ajax_request('POST', 'search-plex', {
  590. searchtitle: $('#plexSearchForm [name=search-title]').val(),
  591. }).done(function(data){ $('#resultshere').html(data);});
  592. });
  593. $('.repeat-btn').click(function(){
  594. var refreshBox = $(this).closest('div.content-box');
  595. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  596. setTimeout(function(){
  597. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  598. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  599. refreshPreloader.remove();
  600. });
  601. },1500);
  602. });
  603. $(document).on('click', '.w-refresh', function(){
  604. var id = $(this).attr("link");
  605. $("div[np^='"+id+"']").toggle();
  606. });
  607. $('div[class*=recentItems-]').each(function() {
  608. var name = $(this).attr("data-name");
  609. console.log(name);
  610. $(this).slick({
  611. slidesToShow: 13,
  612. slidesToScroll: 13,
  613. infinite: true,
  614. lazyLoad: 'ondemand',
  615. prevArrow: '<a class="zero-m pull-left prev-mail btn btn-default waves waves-button btn-sm waves-effect waves-float"><i class="fa fa-angle-left"></i></a>',
  616. nextArrow: '<a class="pull-left next-mail btn btn-default waves waves-button btn-sm waves-effect waves-float"><i class="fa fa-angle-right"></i></a>',
  617. appendArrows: $('.'+name),
  618. arrows: true,
  619. responsive: [
  620. {
  621. breakpoint: 1750,
  622. settings: {
  623. slidesToShow: 12,
  624. slidesToScroll: 12,
  625. }
  626. },
  627. {
  628. breakpoint: 1600,
  629. settings: {
  630. slidesToShow: 11,
  631. slidesToScroll: 11,
  632. }
  633. },
  634. {
  635. breakpoint: 1450,
  636. settings: {
  637. slidesToShow: 10,
  638. slidesToScroll: 10,
  639. }
  640. },
  641. {
  642. breakpoint: 1300,
  643. settings: {
  644. slidesToShow: 9,
  645. slidesToScroll: 9,
  646. }
  647. },
  648. {
  649. breakpoint: 1150,
  650. settings: {
  651. slidesToShow: 8,
  652. slidesToScroll: 8,
  653. }
  654. },
  655. {
  656. breakpoint: 1000,
  657. settings: {
  658. slidesToShow: 7,
  659. slidesToScroll: 7,
  660. }
  661. },
  662. {
  663. breakpoint: 850,
  664. settings: {
  665. slidesToShow: 6,
  666. slidesToScroll: 6,
  667. }
  668. },
  669. {
  670. breakpoint: 700,
  671. settings: {
  672. slidesToShow: 5,
  673. slidesToScroll: 5,
  674. }
  675. },
  676. {
  677. breakpoint: 675,
  678. settings: {
  679. slidesToShow: 4,
  680. slidesToScroll: 4
  681. }
  682. },
  683. {
  684. breakpoint: 480,
  685. settings: {
  686. slidesToShow: 3,
  687. slidesToScroll: 3
  688. }
  689. }
  690. // You can unslick at a given breakpoint now by adding:
  691. // settings: "unslick"
  692. // instead of a settings object
  693. ]
  694. });
  695. });
  696. //RECENT ITEMS
  697. // each filter we click on
  698. $(".filter-recent-event > li").on("click", function() {
  699. /*
  700. // toggle the filter on/off
  701. $(this).data( "filter-on" , !$(this).data("filter-on") );
  702. // set all the filter strings to empty
  703. var filtersOn = "";
  704. var filtersOff = "";
  705. var allFilters = "";
  706. // loop through each filter
  707. $(".filter-recent-event > li").each(function() {
  708. // set a variable to hold the value of the filter class
  709. // and also if the filter is on/off
  710. var filter = $(this).data("filter");
  711. var isOn = $(this).data("filter-on");
  712. // add the filter to the filtersOn / filtersOff collection
  713. if( isOn ) {
  714. filtersOn += "." + filter + ", ";
  715. var title=$(this).attr('data-filter').split('-')[1];
  716. if(title == "movie"){
  717. var titleOriginal = "Movies";
  718. }else if(title == "season"){
  719. var titleOriginal = "Shows";
  720. }else if(title == "album"){
  721. var titleOriginal = "Music";
  722. }
  723. $('.js-filter-'+title).text(titleOriginal+' Active');
  724. } else {
  725. filtersOff += "." + filter + ", ";
  726. var title=$(this).attr('data-filter').split('-')[1];
  727. if(title == "movie"){
  728. var titleOriginal = "Movies";
  729. }else if(title == "season"){
  730. var titleOriginal = "Shows";
  731. }else if(title == "album"){
  732. var titleOriginal = "Music";
  733. }
  734. $('.js-filter-'+title).text(titleOriginal);
  735. }
  736. });
  737. // remove the last ", " from each filter collection.
  738. filtersOn = filtersOn.replace(/, $/, "");
  739. filtersOff = filtersOff.replace(/, $/, "");
  740. // remove all filters if none are on.
  741. if( filtersOn === "" ) {
  742. filtersOn = "*";
  743. filtersOff = "";
  744. }
  745. // combine the filters together ( on + off )
  746. allFilters = filtersOn + ":not(" + filtersOff + ")";
  747. console.log( allFilters );*/
  748. var name = $(this).attr('data-name');
  749. var filter = $(this).attr('data-filter');
  750. $('#recentContent-title').text('Recently Added '+name);
  751. // now filter the slides.
  752. if(filter !== 'item-all'){
  753. $('.recentItems-recent')
  754. .slick('slickUnfilter')
  755. .slick('slickFilter' , '.'+filter );
  756. }else{
  757. $('.recentItems-recent')
  758. .slick('slickUnfilter')
  759. }
  760. });
  761. //PLAYLIST SHIT
  762. // each filter we click on
  763. $(".filter-recent-playlist > li").on("click", function() {
  764. var name = $(this).attr('data-name');
  765. var filter = $(this).attr('data-filter');
  766. $('#playlist-title').text(name);
  767. // now filter the slides.
  768. $('.recentItems-playlists')
  769. .slick('slickUnfilter')
  770. .slick('slickFilter' , '.'+filter );
  771. });
  772. $("body").niceScroll({
  773. railpadding: {top:0,right:0,left:0,bottom:0},
  774. scrollspeed: 30,
  775. mousescrollstep: 60
  776. });
  777. $(".table-responsive").niceScroll({
  778. railpadding: {top:0,right:0,left:0,bottom:0},
  779. scrollspeed: 30,
  780. mousescrollstep: 60
  781. });
  782. <?php if((NZBGETURL != "" && qualifyUser(NZBGETHOMEAUTH)) || (SABNZBDURL != "" && qualifyUser(SABNZBDHOMEAUTH))){ ?>
  783. var queueRefresh = <?php echo DOWNLOADREFRESH; ?>;
  784. var historyRefresh = <?php echo HISTORYREFRESH; ?>; // This really doesn't need to happen that often
  785. var queueLoad = function() {
  786. <?php if(SABNZBDURL != "") { echo '$("tbody.dl-queue.sabnzbd").load("ajax.php?a=sabnzbd-update&list=queue");'; } ?>
  787. <?php if(NZBGETURL != "") { echo '$("tbody.dl-queue.nzbget").load("ajax.php?a=nzbget-update&list=listgroups");'; } ?>
  788. };
  789. var historyLoad = function() {
  790. <?php if(SABNZBDURL != "") { echo '$("tbody.dl-history.sabnzbd").load("ajax.php?a=sabnzbd-update&list=history");'; } ?>
  791. <?php if(NZBGETURL != "") { echo '$("tbody.dl-history.nzbget").load("ajax.php?a=nzbget-update&list=history");'; } ?>
  792. };
  793. // Initial Loads
  794. queueLoad();
  795. historyLoad();
  796. // Interval Loads
  797. var queueInterval = setInterval(queueLoad, queueRefresh);
  798. var historyInterval = setInterval(historyLoad, historyRefresh);
  799. // Manual Load
  800. $("#getDownloader").click(function() {
  801. queueLoad();
  802. historyLoad();
  803. });
  804. <?php } ?>
  805. });
  806. $( window ).on( "load", function() {
  807. $( "ul.filter-recent-playlist > li:first" ).trigger("click");
  808. });
  809. </script>
  810. <?php if ((SONARRURL != "" && qualifyUser(SONARRHOMEAUTH)) || (RADARRURL != "" && qualifyUser(RADARRHOMEAUTH)) || (HEADPHONESURL != "" && qualifyUser(HEADPHONESHOMEAUTH)) || (SICKRAGEURL != "" && qualifyUser(SICKRAGEHOMEAUTH))) { ?>
  811. <script>
  812. $(function () {
  813. var date = new Date();
  814. var d = date.getDate();
  815. var m = date.getMonth();
  816. var y = date.getFullYear();
  817. $('#calendar').fullCalendar({
  818. eventLimit: false,
  819. firstDay: <?php echo CALENDARSTART;?>,
  820. height: "auto",
  821. defaultView: '<?php echo CALENDARVIEW;?>',
  822. header: {
  823. left: 'prev,next,',
  824. center: 'title',
  825. right: 'today, month, basicDay,basicWeek,'
  826. },
  827. views: {
  828. basicDay: { buttonText: '<?php echo $language->translate("DAY");?>', eventLimit: false },
  829. basicWeek: { buttonText: '<?php echo $language->translate("WEEK");?>', eventLimit: false },
  830. month: { buttonText: '<?php echo $language->translate("MONTH");?>', eventLimit: false },
  831. today: { buttonText: '<?php echo $language->translate("TODAY");?>' },
  832. },
  833. //events: [ <?php //echo getCalendar(); ?> ],
  834. eventRender: function eventRender( event, element, view ) {
  835. return ['all', event.imagetype].indexOf($('#imagetype_selector').val()) >= 0
  836. },
  837. editable: false,
  838. droppable: false,
  839. timeFormat: '<?php echo CALTIMEFORMAT; ?>',
  840. });
  841. });
  842. $('#imagetype_selector').on('change',function(){
  843. $('#calendar').fullCalendar('rerenderEvents');
  844. })
  845. $.ajax({
  846. type: 'GET',
  847. url: 'ajax.php?a=get-calendar',
  848. success: function(data)
  849. {
  850. newData = $.parseJSON(data);
  851. $('#calendar').fullCalendar('removeEvents');
  852. $('#calendar').fullCalendar('addEventSource', newData);
  853. console.log('Calendar Entries Added');
  854. }
  855. });
  856. setInterval(function() {
  857. $.ajax({
  858. type: 'GET',
  859. url: 'ajax.php?a=get-calendar',
  860. success: function(data)
  861. {
  862. newData = $.parseJSON(data);
  863. $('#calendar').fullCalendar('removeEvents');
  864. $('#calendar').fullCalendar('addEventSource', newData);
  865. console.log('Calendar refreshed');
  866. }
  867. });
  868. }, 60000);
  869. </script>
  870. <?php } ?>
  871. <script>
  872. function convertTime(a){
  873. if(a){
  874. var hours = Math.trunc(a/60);
  875. var minutes = a % 60;
  876. return hours+"h "+minutes+"m";
  877. }else{
  878. return "N/A";
  879. }
  880. }
  881. function convertArray(a, type){
  882. var result = "";
  883. var count = 1;
  884. var color = "";
  885. $.each( a, function( key, value ) {
  886. if (count == 1){ color = "gray"; }else{ color = "gray"; }
  887. if(type == "MOVIE"){
  888. result += '<span class="label label-'+color+'">'+value['name']+'</span>&nbsp;';
  889. }else if(type == "TV"){
  890. result += '<span class="label label-'+color+'">'+value+'</span>&nbsp;';
  891. }
  892. count++;
  893. });
  894. return result;
  895. }
  896. function convertTrailer(a){
  897. var result = "";
  898. var count = 1;
  899. $.each( a.results, function( key, value ) {
  900. if (count == 1){
  901. result += '<span id="openTrailer" style="cursor:pointer;width: 100%;display: block;" data-key="'+value['key']+'" data-name="'+value['name']+'" data-site="'+value['site']+'" class="label label-danger"><i style="vertical-align:sub;" class="fa fa-youtube-play" aria-hidden="true"></i><text style="vertical-align:sub;"> Watch Trailer</text></span>&nbsp;';
  902. }
  903. count++;
  904. });
  905. return result;
  906. }
  907. function convertCast(a){
  908. var result = "";
  909. var count = 1;
  910. $.each( a.cast, function( key, value ) {
  911. if( value['profile_path'] ){
  912. if (count <= 6){
  913. result += '<div class="col-lg-4 col-xs-4"><div class="zero-m"><img class="pull-left" style="border-radius:10%;margin-left: auto;margin-right: auto;display: block;" height="100px" src="https://image.tmdb.org/t/p/w150'+value['profile_path']+'" alt="profile"><h5 class="text-center"><strong>'+value['name']+'</strong></h5><h6 class="text-center">'+value['character']+'</h6></div></div>';
  914. count++;
  915. }
  916. }
  917. });
  918. return result;
  919. }
  920. function whatIsIt(a){
  921. var what = Object.prototype.toString;
  922. if(what.call(a) == "[object Array]"){
  923. return a[0].fileName;
  924. }else if(what.call(a) == "[object Object]"){
  925. return a.fileName;
  926. }
  927. }
  928. function whatWasIt(a){
  929. var what = Object.prototype.toString;
  930. if(what.call(a) == "[object Array]"){
  931. return a[0];
  932. }else if(what.call(a) == "[object Object]"){
  933. return a;
  934. }
  935. }
  936. $(document).on('click', "#openTrailer", function(){
  937. var key = $(this).attr("data-key");
  938. $('#iFrameYT').html('<iframe id="calendarYoutube" class="embed-responsive-item" src="https://www.youtube.com/embed/'+key+'" allowfullscreen=""></iframe>');
  939. $('#calendarVideo').modal('show');
  940. });
  941. $(document).on('click', "a[class*=ID-]", function(){
  942. $('#calendarExtra').modal('show');
  943. var refreshBox = $('#calendarMainID');
  944. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  945. setTimeout(function(){
  946. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  947. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  948. refreshPreloader.remove();
  949. });
  950. },600);
  951. var check = $(this).attr("class");
  952. var ID = check.split("--")[1];
  953. if (~check.indexOf("tvID")){
  954. var type = "TV";
  955. ajax_request('POST', 'tvdb-get', {
  956. id: ID,
  957. }).done(function(data){
  958. if( data.trakt ) {
  959. $.ajax({
  960. type: 'GET',
  961. url: 'https://api.themoviedb.org/3/tv/'+data.trakt.tmdb+'?api_key=83cf4ee97bb728eeaf9d4a54e64356a1&append_to_response=videos,credits',
  962. cache: true,
  963. async: true,
  964. complete: function(xhr, status) {
  965. var result = $.parseJSON(xhr.responseText);
  966. if (xhr.statusText === "OK") {
  967. console.log(result);
  968. $('#calendarTitle').text(result.name);
  969. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  970. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(whatWasIt(result.episode_run_time))+'</span>&nbsp;');
  971. $('#calendarSummary').text(result.overview);
  972. $('#calendarTagline').text("");
  973. $('#calendarTrailer').html(convertTrailer(result.videos));
  974. $('#calendarCast').html(convertCast(result.credits));
  975. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  976. $('#calendarLang').html(convertArray(result.languages, "TV"));
  977. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  978. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(https://image.tmdb.org/t/p/w1000"+result.backdrop_path+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  979. $('#calendarExtra').modal('show');
  980. }
  981. }
  982. });
  983. }else{
  984. $('#calendarTitle').text(data.series.seriesName);
  985. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+data.series.siteRating+'</span>&nbsp');
  986. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(data.series.runtime)+'</span>&nbsp;');
  987. $('#calendarSummary').text(data.series.overview);
  988. $('#calendarTagline').text("");
  989. $('#calendarTrailer').html("");
  990. $('#calendarCast').html("");
  991. $('#calendarGenres').html(convertArray(data.series.genre, "TV"));
  992. $('#calendarLang').html("");
  993. $('#calendarPoster').attr("src","https://thetvdb.com/banners/_cache/"+whatIsIt(data.poster));
  994. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(ajax.php?a=show-image&image=http://thetvdb.com/banners/"+whatIsIt(data.backdrop)+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  995. $('#calendarExtra').modal('show');
  996. }
  997. });
  998. }else if (~check.indexOf("movieID")){
  999. var type = "MOVIE";
  1000. $.ajax({
  1001. type: 'GET',
  1002. url: 'https://api.themoviedb.org/3/movie/'+ID+'?api_key=83cf4ee97bb728eeaf9d4a54e64356a1&append_to_response=videos,credits',
  1003. cache: true,
  1004. async: true,
  1005. complete: function(xhr, status) {
  1006. var result = $.parseJSON(xhr.responseText);
  1007. console.log(result);
  1008. console.log(convertCast(result.credits));
  1009. if (xhr.statusText === "OK") {
  1010. $('#calendarTitle').text(result.title);
  1011. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  1012. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(result.runtime)+'</span>&nbsp;');
  1013. $('#calendarSummary').text(result.overview);
  1014. $('#calendarTagline').text(result.tagline);
  1015. $('#calendarTrailer').html(convertTrailer(result.videos));
  1016. $('#calendarCast').html(convertCast(result.credits));
  1017. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  1018. $('#calendarLang').html(convertArray(result.spoken_languages, "MOVIE"));
  1019. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  1020. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(https://image.tmdb.org/t/p/w1000"+result.backdrop_path+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  1021. $('#calendarExtra').modal('show');
  1022. }
  1023. }
  1024. });
  1025. }
  1026. });
  1027. </script>
  1028. <div id="calendarExtra" class="modal fade in" tabindex="-1" role="dialog">
  1029. <div class="modal-dialog modal-lg gray-bg" role="document">
  1030. <div id="calendarMainID" class="modal-content">
  1031. <div class="modal-content" id="calendarMain"></div>
  1032. <div style="position: inherit; padding: 15px">
  1033. <span id="calendarRuntime" class="pull-left"></span>
  1034. <span id="calendarRating" class="pull-left"></span>
  1035. <span id="calendarGenres" class="pull-right"></span>
  1036. </div>
  1037. <div class="modal-body">
  1038. <div class="row">
  1039. <div class="col-sm-4">
  1040. <img style="width:100%;border-radius: 10px;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" id="calendarPoster" src="">
  1041. </div>
  1042. <div class="col-sm-8">
  1043. <h2 id="calendarTitle" class="modal-title text-center">Modal title</h2>
  1044. <h6 id="calendarTagline" class="modal-title text-center"><em>Modal title</em></h6>
  1045. <p id="calendarSummary">Modal Summary</p>
  1046. <div class="" id="calendarCast">Modal Summary</div>
  1047. </div>
  1048. </div>
  1049. </div>
  1050. <div style="position: inherit; padding: 15px 0px 30px 0px; margin-top: -20px;">
  1051. <div class="col-sm-4">
  1052. <span id="calendarTrailer" class="pull-left" style="width:100%;display: flex;"></span>
  1053. </div>
  1054. <div class="col-sm-8">
  1055. <span id="calendarLang" class="pull-right"></span>
  1056. </div>
  1057. </div>
  1058. </div>
  1059. </div>
  1060. </div>
  1061. <div id="calendarVideo" class="modal fade in palette-Grey-900 bg" tabindex="-1" role="dialog">
  1062. <div class="modal-dialog modal-lg gray-bg" role="document">
  1063. <div id="calendarMainVideo" class="modal-content gray-bg">
  1064. <div class="">
  1065. <!-- 16:9 aspect ratio -->
  1066. <div id="iFrameYT" class="embed-responsive embed-responsive-16by9 gray-bg"></div>
  1067. </div>
  1068. </div>
  1069. </div>
  1070. </div>
  1071. </body>
  1072. </html>