homepage.php 57 KB

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