homepage.php 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106
  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. $(".swal-legend").click(function () {
  443. swal({
  444. title: "Calendar Legend",
  445. 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>',
  446. html: true,
  447. confirmButtonColor: "#63A8EB"
  448. });
  449. });
  450. $('.close-btn').click(function(e){
  451. var closedBox = $(this).closest('div.content-box').remove();
  452. e.preventDefault();
  453. });
  454. $('#clearSearch').click(function(e){
  455. $('#searchInput').val("");
  456. $('#resultshere').html("");
  457. $('#searchInput').focus();
  458. e.preventDefault();
  459. });
  460. $(document).on("click", ".openTab", function(e) {
  461. var Title = $(this).attr("extraTitle");
  462. var Type = $(this).attr("extraType");
  463. var openTab = $(this).attr("openTab");
  464. var location = $(this).attr("href");
  465. if( Type === 'season' || Type === 'episode' || Type === 'show'){
  466. Type = "tv";
  467. SearchType = "show";
  468. }else if( Type === 'movie'){
  469. Type = "movie";
  470. SearchType = "movie";
  471. }
  472. if( Type === 'tv' || Type === 'movie' ){
  473. $('#calendarExtra').modal('show');
  474. var refreshBox = $('#calendarMainID');
  475. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  476. setTimeout(function(){
  477. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  478. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  479. refreshPreloader.remove();
  480. });
  481. },600);
  482. ajax_request('POST', 'tvdb-search', {
  483. name: Title,
  484. type: SearchType,
  485. }).done(function(data){
  486. if( data.trakt ) {
  487. $.ajax({
  488. type: 'GET',
  489. url: 'https://api.themoviedb.org/3/'+Type+'/'+data.trakt.tmdb+'?api_key=83cf4ee97bb728eeaf9d4a54e64356a1&append_to_response=videos,credits',
  490. cache: true,
  491. async: true,
  492. complete: function(xhr, status) {
  493. var result = $.parseJSON(xhr.responseText);
  494. if (xhr.statusText === "OK") {
  495. if( Type === "movie"){
  496. $('#calendarTitle').html(result.title);
  497. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  498. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(result.runtime)+'</span>&nbsp;');
  499. $('#calendarSummary').text(result.overview);
  500. $('#calendarTagline').text(result.tagline);
  501. $('#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>');
  502. $('#calendarCast').html(convertCast(result.credits));
  503. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  504. $('#calendarLang').html(convertArray(result.spoken_languages, "MOVIE"));
  505. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  506. $('#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;");
  507. $('#calendarExtra').modal('show');
  508. }else if (Type === "tv"){
  509. $('#calendarTitle').html(result.name);
  510. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  511. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(whatWasIt(result.episode_run_time))+'</span>&nbsp;');
  512. $('#calendarSummary').text(result.overview);
  513. $('#calendarTagline').text("");
  514. $('#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>');
  515. $('#calendarCast').html(convertCast(result.credits));
  516. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  517. $('#calendarLang').html(convertArray(result.languages, "TV"));
  518. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  519. $('#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;");
  520. $('#calendarExtra').modal('show');
  521. }
  522. }
  523. }
  524. });
  525. }
  526. });
  527. e.preventDefault();
  528. }else{
  529. if($(this).attr("openTab") === "true") {
  530. var isActive = parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']");
  531. var activeFrame = isActive.children('iframe');
  532. if(isActive.length === 1){
  533. activeFrame.attr("src", $(this).attr("href"));
  534. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  535. }else{
  536. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  537. parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']").children('iframe').attr("src", $(this).attr("href"));
  538. }
  539. e.preventDefault();
  540. }else{
  541. var source = $(this).attr("href");
  542. window.open(source, '_blank');
  543. }
  544. }
  545. });
  546. $(document).on("click", ".openPlex", function(e) {
  547. if($(this).attr("openTab") === "true") {
  548. var isActive = parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']");
  549. var activeFrame = isActive.children('iframe');
  550. if(isActive.length === 1){
  551. activeFrame.attr("src", $(this).attr("location"));
  552. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  553. }else{
  554. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  555. parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']").children('iframe').attr("src", $(this).attr("location"));
  556. }
  557. }else{
  558. var source = $(this).attr("location");
  559. window.open(source, '_blank');
  560. }
  561. });
  562. function localStorageSupport() {
  563. return (('localStorage' in window) && window['localStorage'] !== null)
  564. }
  565. $( document ).ready(function() {
  566. $('#plexSearchForm').on('submit', function () {
  567. var refreshBox = $(this).closest('div.content-box');
  568. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  569. setTimeout(function(){
  570. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  571. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  572. refreshPreloader.remove();
  573. });
  574. },1000);
  575. ajax_request('POST', 'search-plex', {
  576. searchtitle: $('#plexSearchForm [name=search-title]').val(),
  577. }).done(function(data){ $('#resultshere').html(data);});
  578. });
  579. $('.repeat-btn').click(function(){
  580. var refreshBox = $(this).closest('div.content-box');
  581. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  582. setTimeout(function(){
  583. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  584. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  585. refreshPreloader.remove();
  586. });
  587. },1500);
  588. });
  589. $(document).on('click', '.w-refresh', function(){
  590. var id = $(this).attr("link");
  591. $("div[np^='"+id+"']").toggle();
  592. });
  593. $('div[class*=recentItems-]').each(function() {
  594. var name = $(this).attr("data-name");
  595. console.log(name);
  596. $(this).slick({
  597. slidesToShow: 13,
  598. slidesToScroll: 13,
  599. infinite: true,
  600. lazyLoad: 'ondemand',
  601. 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>',
  602. 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>',
  603. appendArrows: $('.'+name),
  604. arrows: true,
  605. responsive: [
  606. {
  607. breakpoint: 1750,
  608. settings: {
  609. slidesToShow: 12,
  610. slidesToScroll: 12,
  611. }
  612. },
  613. {
  614. breakpoint: 1600,
  615. settings: {
  616. slidesToShow: 11,
  617. slidesToScroll: 11,
  618. }
  619. },
  620. {
  621. breakpoint: 1450,
  622. settings: {
  623. slidesToShow: 10,
  624. slidesToScroll: 10,
  625. }
  626. },
  627. {
  628. breakpoint: 1300,
  629. settings: {
  630. slidesToShow: 9,
  631. slidesToScroll: 9,
  632. }
  633. },
  634. {
  635. breakpoint: 1150,
  636. settings: {
  637. slidesToShow: 8,
  638. slidesToScroll: 8,
  639. }
  640. },
  641. {
  642. breakpoint: 1000,
  643. settings: {
  644. slidesToShow: 7,
  645. slidesToScroll: 7,
  646. }
  647. },
  648. {
  649. breakpoint: 850,
  650. settings: {
  651. slidesToShow: 6,
  652. slidesToScroll: 6,
  653. }
  654. },
  655. {
  656. breakpoint: 700,
  657. settings: {
  658. slidesToShow: 5,
  659. slidesToScroll: 5,
  660. }
  661. },
  662. {
  663. breakpoint: 675,
  664. settings: {
  665. slidesToShow: 4,
  666. slidesToScroll: 4
  667. }
  668. },
  669. {
  670. breakpoint: 480,
  671. settings: {
  672. slidesToShow: 3,
  673. slidesToScroll: 3
  674. }
  675. }
  676. // You can unslick at a given breakpoint now by adding:
  677. // settings: "unslick"
  678. // instead of a settings object
  679. ]
  680. });
  681. });
  682. //RECENT ITEMS
  683. // each filter we click on
  684. $(".filter-recent-event > li").on("click", function() {
  685. var name = $(this).attr('data-name');
  686. var filter = $(this).attr('data-filter');
  687. $('#recentContent-title').text('Recently Added '+name);
  688. // now filter the slides.
  689. if(filter !== 'item-all'){
  690. $('.recentItems-recent')
  691. .slick('slickUnfilter')
  692. .slick('slickFilter' , '.'+filter );
  693. }else{
  694. $('.recentItems-recent')
  695. .slick('slickUnfilter')
  696. }
  697. });
  698. //PLAYLIST SHIT
  699. // each filter we click on
  700. $(".filter-recent-playlist > li").on("click", function() {
  701. var name = $(this).attr('data-name');
  702. var filter = $(this).attr('data-filter');
  703. $('#playlist-title').text(name);
  704. // now filter the slides.
  705. $('.recentItems-playlists')
  706. .slick('slickUnfilter')
  707. .slick('slickFilter' , '.'+filter );
  708. });
  709. /*$("body").niceScroll({
  710. railpadding: {top:0,right:0,left:0,bottom:0},
  711. scrollspeed: 30,
  712. mousescrollstep: 60
  713. });*/
  714. $("body").niceScroll({
  715. //cursorwidth: "12px"
  716. scrollspeed: 30,
  717. mousescrollstep: 60
  718. });
  719. $(".table-responsive").niceScroll({
  720. railpadding: {top:0,right:0,left:0,bottom:0},
  721. scrollspeed: 30,
  722. mousescrollstep: 60
  723. });
  724. $(".playlist-listing").niceScroll({
  725. railpadding: {top:0,right:0,left:0,bottom:0},
  726. scrollspeed: 30,
  727. mousescrollstep: 60
  728. });
  729. <?php if((NZBGETURL != "" && qualifyUser(NZBGETHOMEAUTH)) || (SABNZBDURL != "" && qualifyUser(SABNZBDHOMEAUTH))){ ?>
  730. var queueRefresh = <?php echo DOWNLOADREFRESH; ?>;
  731. var historyRefresh = <?php echo HISTORYREFRESH; ?>; // This really doesn't need to happen that often
  732. var queueLoad = function() {
  733. <?php if(SABNZBDURL != "") { echo '$("tbody.dl-queue.sabnzbd").load("ajax.php?a=sabnzbd-update&list=queue");'; } ?>
  734. <?php if(NZBGETURL != "") { echo '$("tbody.dl-queue.nzbget").load("ajax.php?a=nzbget-update&list=listgroups");'; } ?>
  735. };
  736. var historyLoad = function() {
  737. <?php if(SABNZBDURL != "") { echo '$("tbody.dl-history.sabnzbd").load("ajax.php?a=sabnzbd-update&list=history");'; } ?>
  738. <?php if(NZBGETURL != "") { echo '$("tbody.dl-history.nzbget").load("ajax.php?a=nzbget-update&list=history");'; } ?>
  739. };
  740. // Initial Loads
  741. queueLoad();
  742. historyLoad();
  743. // Interval Loads
  744. var queueInterval = setInterval(queueLoad, queueRefresh);
  745. var historyInterval = setInterval(historyLoad, historyRefresh);
  746. // Manual Load
  747. $("#getDownloader").click(function() {
  748. queueLoad();
  749. historyLoad();
  750. });
  751. <?php } ?>
  752. });
  753. $( window ).on( "load", function() {
  754. $( "ul.filter-recent-playlist > li:first" ).trigger("click");
  755. });
  756. </script>
  757. <?php if ((SONARRURL != "" && qualifyUser(SONARRHOMEAUTH)) || (RADARRURL != "" && qualifyUser(RADARRHOMEAUTH)) || (HEADPHONESURL != "" && qualifyUser(HEADPHONESHOMEAUTH)) || (SICKRAGEURL != "" && qualifyUser(SICKRAGEHOMEAUTH))) { ?>
  758. <script>
  759. $(function () {
  760. var date = new Date();
  761. var d = date.getDate();
  762. var m = date.getMonth();
  763. var y = date.getFullYear();
  764. $('#calendar').fullCalendar({
  765. eventLimit: false,
  766. firstDay: <?php echo CALENDARSTART;?>,
  767. height: "auto",
  768. defaultView: '<?php echo CALENDARVIEW;?>',
  769. header: {
  770. left: 'prev,next,',
  771. center: 'title',
  772. right: 'today, month, basicDay,basicWeek,'
  773. },
  774. views: {
  775. basicDay: { buttonText: '<?php echo $language->translate("DAY");?>', eventLimit: false },
  776. basicWeek: { buttonText: '<?php echo $language->translate("WEEK");?>', eventLimit: false },
  777. month: { buttonText: '<?php echo $language->translate("MONTH");?>', eventLimit: false },
  778. today: { buttonText: '<?php echo $language->translate("TODAY");?>' },
  779. },
  780. //events: [ <?php //echo getCalendar(); ?> ],
  781. eventRender: function eventRender( event, element, view ) {
  782. //return ['all', event.imagetype].indexOf($('#imagetype_selector').val()) >= 0
  783. if (typeof filter !== 'undefined') {
  784. if(filter === "all"){
  785. return event.imagetype === event.imagetype;
  786. }else if(filter !== "all"){
  787. return filter === event.imagetype;
  788. }
  789. if(filter === null){
  790. return event.imagetype === event.imagetype;
  791. }
  792. }else {
  793. return event.imagetype === event.imagetype;
  794. }
  795. },
  796. editable: false,
  797. droppable: false,
  798. timeFormat: '<?php echo CALTIMEFORMAT; ?>',
  799. });
  800. });
  801. $(document).on('click', ".calendarOption", function(){
  802. window.filter = $(this).attr("calendarOption");
  803. if(filter ==="all"){
  804. title = "View All";
  805. }else if(filter ==="tv"){
  806. title = "TV Shows";
  807. }else if(filter ==="film"){
  808. title = "Movies";
  809. }else if(filter ==="music"){
  810. title = "Music";
  811. }
  812. console.log("Calendar Filter: "+title);
  813. $('#calendar').fullCalendar('rerenderEvents');
  814. $('#calendarSelected').html(title+"&nbsp;<span class=\"caret\"></span>");
  815. });
  816. $.ajax({
  817. type: 'GET',
  818. url: 'ajax.php?a=get-calendar',
  819. success: function(data)
  820. {
  821. newData = $.parseJSON(data);
  822. $('#calendar').fullCalendar('removeEvents');
  823. $('#calendar').fullCalendar('addEventSource', newData);
  824. console.log('Calendar Entries Added');
  825. }
  826. });
  827. setInterval(function() {
  828. $.ajax({
  829. type: 'GET',
  830. url: 'ajax.php?a=get-calendar',
  831. success: function(data)
  832. {
  833. newData = $.parseJSON(data);
  834. $('#calendar').fullCalendar('removeEvents');
  835. $('#calendar').fullCalendar('addEventSource', newData);
  836. console.log('Calendar refreshed');
  837. }
  838. });
  839. }, 60000);
  840. </script>
  841. <?php } ?>
  842. <script>
  843. function convertTime(a){
  844. if(a){
  845. var hours = Math.trunc(a/60);
  846. var minutes = a % 60;
  847. return hours+"h "+minutes+"m";
  848. }else{
  849. return "N/A";
  850. }
  851. }
  852. function convertArray(a, type){
  853. var result = "";
  854. var count = 1;
  855. var color = "";
  856. $.each( a, function( key, value ) {
  857. if (count == 1){ color = "gray"; }else{ color = "gray"; }
  858. if(type == "MOVIE"){
  859. result += '<span class="label label-'+color+'">'+value['name']+'</span>&nbsp;';
  860. }else if(type == "TV"){
  861. result += '<span class="label label-'+color+'">'+value+'</span>&nbsp;';
  862. }
  863. count++;
  864. });
  865. return result;
  866. }
  867. function convertTrailer(a){
  868. var result = "";
  869. var count = 1;
  870. $.each( a.results, function( key, value ) {
  871. if (count == 1){
  872. 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;';
  873. }
  874. count++;
  875. });
  876. return result;
  877. }
  878. function convertCast(a){
  879. var result = "";
  880. var count = 1;
  881. $.each( a.cast, function( key, value ) {
  882. if( value['profile_path'] ){
  883. if (count <= 6){
  884. 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>';
  885. count++;
  886. }
  887. }
  888. });
  889. return result;
  890. }
  891. function whatIsIt(a){
  892. var what = Object.prototype.toString;
  893. if(what.call(a) == "[object Array]"){
  894. return a[0].fileName;
  895. }else if(what.call(a) == "[object Object]"){
  896. return a.fileName;
  897. }
  898. }
  899. function whatWasIt(a){
  900. var what = Object.prototype.toString;
  901. if(what.call(a) == "[object Array]"){
  902. return a[0];
  903. }else if(what.call(a) == "[object Object]"){
  904. return a;
  905. }
  906. }
  907. $(document).on('click', "#openTrailer", function(){
  908. var key = $(this).attr("data-key");
  909. $('#iFrameYT').html('<iframe id="calendarYoutube" class="embed-responsive-item" src="https://www.youtube.com/embed/'+key+'" allowfullscreen=""></iframe>');
  910. $('#calendarVideo').modal('show');
  911. });
  912. $(document).on('click', "a[class*=ID-]", function(){
  913. $('#calendarExtra').modal('show');
  914. var refreshBox = $('#calendarMainID');
  915. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  916. setTimeout(function(){
  917. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  918. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  919. refreshPreloader.remove();
  920. });
  921. },600);
  922. var check = $(this).attr("class");
  923. var ID = check.split("--")[1];
  924. if (~check.indexOf("tvID")){
  925. var type = "TV";
  926. ajax_request('POST', 'tvdb-get', {
  927. id: ID,
  928. }).done(function(data){
  929. if( data.trakt ) {
  930. $.ajax({
  931. type: 'GET',
  932. url: 'https://api.themoviedb.org/3/tv/'+data.trakt.tmdb+'?api_key=83cf4ee97bb728eeaf9d4a54e64356a1&append_to_response=videos,credits',
  933. cache: true,
  934. async: true,
  935. complete: function(xhr, status) {
  936. var result = $.parseJSON(xhr.responseText);
  937. if (xhr.statusText === "OK") {
  938. console.log(result);
  939. $('#calendarTitle').text(result.name);
  940. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  941. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(whatWasIt(result.episode_run_time))+'</span>&nbsp;');
  942. $('#calendarSummary').text(result.overview);
  943. $('#calendarTagline').text("");
  944. $('#calendarTrailer').html(convertTrailer(result.videos));
  945. $('#calendarCast').html(convertCast(result.credits));
  946. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  947. $('#calendarLang').html(convertArray(result.languages, "TV"));
  948. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  949. $('#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;");
  950. $('#calendarExtra').modal('show');
  951. }
  952. }
  953. });
  954. }else{
  955. $('#calendarTitle').text(data.series.seriesName);
  956. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+data.series.siteRating+'</span>&nbsp');
  957. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(data.series.runtime)+'</span>&nbsp;');
  958. $('#calendarSummary').text(data.series.overview);
  959. $('#calendarTagline').text("");
  960. $('#calendarTrailer').html("");
  961. $('#calendarCast').html("");
  962. $('#calendarGenres').html(convertArray(data.series.genre, "TV"));
  963. $('#calendarLang').html("");
  964. $('#calendarPoster').attr("src","https://thetvdb.com/banners/_cache/"+whatIsIt(data.poster));
  965. $('#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;");
  966. $('#calendarExtra').modal('show');
  967. }
  968. });
  969. }else if (~check.indexOf("movieID")){
  970. var type = "MOVIE";
  971. $.ajax({
  972. type: 'GET',
  973. url: 'https://api.themoviedb.org/3/movie/'+ID+'?api_key=83cf4ee97bb728eeaf9d4a54e64356a1&append_to_response=videos,credits',
  974. cache: true,
  975. async: true,
  976. complete: function(xhr, status) {
  977. var result = $.parseJSON(xhr.responseText);
  978. console.log(result);
  979. console.log(convertCast(result.credits));
  980. if (xhr.statusText === "OK") {
  981. $('#calendarTitle').text(result.title);
  982. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  983. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(result.runtime)+'</span>&nbsp;');
  984. $('#calendarSummary').text(result.overview);
  985. $('#calendarTagline').text(result.tagline);
  986. $('#calendarTrailer').html(convertTrailer(result.videos));
  987. $('#calendarCast').html(convertCast(result.credits));
  988. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  989. $('#calendarLang').html(convertArray(result.spoken_languages, "MOVIE"));
  990. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  991. $('#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;");
  992. $('#calendarExtra').modal('show');
  993. }
  994. }
  995. });
  996. }
  997. });
  998. </script>
  999. <div id="calendarExtra" class="modal fade in" tabindex="-1" role="dialog">
  1000. <div class="modal-dialog modal-lg gray-bg" role="document">
  1001. <div id="calendarMainID" class="modal-content">
  1002. <div class="modal-content" id="calendarMain"></div>
  1003. <div style="position: inherit; padding: 15px">
  1004. <span id="calendarRuntime" class="pull-left"></span>
  1005. <span id="calendarRating" class="pull-left"></span>
  1006. <span id="calendarGenres" class="pull-right"></span>
  1007. </div>
  1008. <div class="modal-body">
  1009. <div class="row">
  1010. <div class="col-sm-4">
  1011. <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="">
  1012. </div>
  1013. <div class="col-sm-8">
  1014. <h2 id="calendarTitle" class="modal-title text-center">Modal title</h2>
  1015. <h6 id="calendarTagline" class="modal-title text-center"><em>Modal title</em></h6>
  1016. <p id="calendarSummary">Modal Summary</p>
  1017. <div class="" id="calendarCast">Modal Summary</div>
  1018. </div>
  1019. </div>
  1020. </div>
  1021. <div style="position: inherit; padding: 15px 0px 30px 0px; margin-top: -20px;">
  1022. <div class="col-sm-4">
  1023. <span id="calendarTrailer" class="pull-left" style="width:100%;display: flex;"></span>
  1024. </div>
  1025. <div class="col-sm-8">
  1026. <span id="calendarLang" class="pull-right"></span>
  1027. </div>
  1028. </div>
  1029. </div>
  1030. </div>
  1031. </div>
  1032. <div id="calendarVideo" class="modal fade in palette-Grey-900 bg" tabindex="-1" role="dialog">
  1033. <div class="modal-dialog modal-lg gray-bg" role="document">
  1034. <div id="calendarMainVideo" class="modal-content gray-bg">
  1035. <div class="">
  1036. <!-- 16:9 aspect ratio -->
  1037. <div id="iFrameYT" class="embed-responsive embed-responsive-16by9 gray-bg"></div>
  1038. </div>
  1039. </div>
  1040. </div>
  1041. </div>
  1042. </body>
  1043. </html>