homepage.php 58 KB

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