homepage.php 58 KB

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