PageRenderTime 47ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/devices/pch_c200/skins/default/php/movieDetails.php

https://code.google.com/p/plexnmt/
PHP | 478 lines | 444 code | 25 blank | 9 comment | 57 complexity | 71767e941acd9081e0ef9b0f6f0415bd MD5 | raw file
  1. <?php
  2. $logger->info('Start=======================================movie details page=======================================Start');
  3. $logger->info('Memory Usage: ' . memory_get_usage());
  4. /*
  5. * 'destination' => 'movie',
  6. * 'page' => 'details',
  7. * 'key' => '5',
  8. */
  9. $xmlMetaData = plexGetMetadata($_GET['key']);
  10. $thumbOverlay = $homePath . '/images/movies/details/';
  11. ?>
  12. <html>
  13. <head>
  14. <link rel="StyleSheet" type="text/css" href="<?php echo $homePath . "/css/details.css.php" ?>"/>
  15. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  16. <title><?php echo $xmlMetaData->Video['title'] ?></title>
  17. <script type="text/javascript">
  18. <!--
  19. var sPlotLong = "<?php echo $xmlMetaData->Video['summary'] ?>";
  20. var sTitleLong = "<?php echo $xmlMetaData->Video['title'] ?>";
  21. var fWatch = true;
  22. var fTVplaylist= true;
  23. -->
  24. </script>
  25. <script type="text/javascript">
  26. <!--
  27. asPlotPart.push("<?php echo substr($xmlMetaData->Video['summary'], 0, 268) ?>...");
  28. -->
  29. </script>
  30. <script type="text/javascript">
  31. <!--
  32. asPlotPart.push("<?php echo substr($xmlMetaData->Video['summary'], 268) ?>");
  33. -->
  34. </script>
  35. <script type="text/javascript">
  36. <!--
  37. // series config vars
  38. var iPage = 1;
  39. var iPageMax = asPlotPart.length - 1;
  40. var iWatch = 0;
  41. var iWatchMax = asWatchbar.length - 1;
  42. var helpx = ' ';
  43. var helpy = new Array('0');
  44. var asFile = new Array('0');
  45. var imgId= ' ';
  46. var imgChangeOn = ' ';
  47. var imgChangeOff = ' ';
  48. var imgPrefix = 'pictures/gtmod/';
  49. var x = 0;
  50. var fLowlist =true;
  51. clickLeft = function ()
  52. {
  53. if (iWatchMax != 0)
  54. {
  55. imgId = 'img' + asWatchbar[iWatch];
  56. imgChangeOff = imgPrefix + imgId + 'off.png';
  57. document.getElementById(imgId).setAttribute("src",imgChangeOff);
  58. if (iWatch == 0) {iWatch = iWatchMax;}
  59. else {iWatch = iWatch - 1;}
  60. imgId = 'img' + asWatchbar[iWatch];
  61. imgChangeOn = imgPrefix + imgId + 'on.png';
  62. document.getElementById(imgId).setAttribute("src",imgChangeOn);
  63. iPage = 1;
  64. showPage();
  65. }
  66. },
  67. clickRight = function ()
  68. {
  69. if (iWatchMax != 0)
  70. {
  71. imgId = 'img' + asWatchbar[iWatch];
  72. imgChangeOff = imgPrefix + imgId + 'off.png';
  73. document.getElementById(imgId).setAttribute("src",imgChangeOff);
  74. if (iWatch == iWatchMax) {iWatch = 0;}
  75. else {iWatch = iWatch + 1;}
  76. imgId = 'img' + asWatchbar[iWatch];
  77. imgChangeOn = imgPrefix + imgId + 'on.png';
  78. document.getElementById(imgId).setAttribute("src",imgChangeOn);
  79. iPage = 1;
  80. showPage();
  81. }
  82. },
  83. showPage = function()
  84. {
  85. helpx = asWatchbar [iWatch];
  86. if (helpx == 'Plot')
  87. {
  88. iPageMax = asPlotPart.length - 1;
  89. helpy[0] = asPlotPart[iPage];
  90. asFile = sFileURL.split(",");
  91. helpy[1] = asFile[0];
  92. helpy[2] = asFile[1];
  93. }
  94. else if (helpx == 'Bonus')
  95. {
  96. iPageMax = asBonus.length - 1;
  97. helpy = asBonus[iPage].split(",");
  98. }
  99. else if (helpx == 'Extra')
  100. {
  101. iPageMax = asExtra.length - 1;
  102. helpy = asExtra[iPage].split(",");
  103. }
  104. else if (helpx == 'Trailer')
  105. {
  106. iPageMax = asTrailer.length - 1;
  107. helpy = asTrailer[iPage].split(",");
  108. }
  109. else if (helpx == 'Multi')
  110. {
  111. iPageMax = asMultiPart.length - 1;
  112. helpy = asMultiPart[iPage].split(",");
  113. }
  114. document.getElementById('play').removeAttribute('vod');
  115. document.getElementById('play').removeAttribute('zcd');
  116. if (helpy[2] == 'playlist')
  117. {
  118. var newAttribute = document.createAttribute("vod");
  119. newAttribute.nodeValue = "playlist";
  120. document.getElementById('play').setAttributeNode(newAttribute);
  121. }
  122. else if (helpy[2] == 'zcd')
  123. {
  124. var newAttribute = document.createAttribute("zcd");
  125. newAttribute.nodeValue = "2";
  126. document.getElementById('play').setAttributeNode(newAttribute);
  127. }
  128. else if (helpy[2] == 'vod')
  129. {
  130. var newAttribute = document.createAttribute("vod");
  131. newAttribute.nodeValue = "";
  132. document.getElementById('play').setAttributeNode(newAttribute);
  133. }
  134. document.getElementById('gtPlot').firstChild.nodeValue = helpy[0];
  135. document.getElementById('pages').firstChild.nodeValue = ' '+ iPage + ' / ' + iPageMax + ' ';
  136. document.getElementById('play').setAttribute("href",helpy[1]);
  137. },
  138. pageDown = function()
  139. {
  140. if (iPageMax != 1)
  141. {
  142. if (iPage == iPageMax) {iPage = 1;}
  143. else {iPage = iPage + 1;}
  144. showPage();
  145. }
  146. },
  147. pageUp = function()
  148. {
  149. if (iPageMax != 1)
  150. {
  151. if (iPage == 1)
  152. {
  153. iPage = iPageMax;
  154. }
  155. else
  156. {
  157. iPage = iPage - 1;
  158. }
  159. showPage();
  160. }
  161. },
  162. toggleWatchbar = function()
  163. {
  164. if (fWatch == false)
  165. {
  166. document.getElementById('watchbar').setAttribute("class","");
  167. fWatch = true;
  168. }
  169. else
  170. {
  171. document.getElementById('watchbar').setAttribute("class","hidden");
  172. fWatch = false;
  173. }
  174. },
  175. toggleLowlist = function()
  176. {
  177. if (fLowlist == false)
  178. {
  179. document.getElementById('lowlist').setAttribute("class","");
  180. document.styleSheets[1].cssRules[3].style.visibility='visible';
  181. document.styleSheets[1].cssRules[5].style.visibility='visible';
  182. document.styleSheets[1].cssRules[7].style.visibility='visible';
  183. fLowlist = true;
  184. }
  185. else
  186. {
  187. document.getElementById('lowlist').setAttribute("class","hidden");
  188. document.styleSheets[1].cssRules[3].style.visibility='hidden';
  189. document.styleSheets[1].cssRules[5].style.visibility='hidden';
  190. document.styleSheets[1].cssRules[7].style.visibility='hidden';
  191. fLowlist = false;
  192. }
  193. },
  194. setParams = function(destination)
  195. // pass the sort option and the now value to the help screen
  196. {
  197. var test5=decodeURIComponent(destination);
  198. location.assign(test5);
  199. }
  200. getParams = function()
  201. {
  202. var params = location.search.substring(1);
  203. var temp = params.split(',');
  204. if (temp[0] == 1)
  205. {
  206. var goback= temp[2];
  207. var destination = escape(goback)+".html?1,"+temp[1].toString()+","+temp[3].toString()+","+temp[4];
  208. var test5 = decodeURIComponent(destination);
  209. location.assign(test5);
  210. }
  211. else {
  212. //document.getElementById('backbutton').setAttribute("href","javascript:history.back();");
  213. //document.getElementById('backbutton').removeAttribute('onclick');
  214. window.history.back();
  215. }
  216. };
  217. -->
  218. </script>
  219. </head>
  220. <body id="detailPage" bgproperties="fixed" bgcolor="#000000" onloadset="play" topmargin="0" leftmargin="0" focustext="#ffffff" background="<?php echo plexGetImage($xmlMetaData->Video['art'], 1280, 720, 'backdrops/movies/') ?>">
  221. <table height="720" border="0" cellspacing="0" cellpadding="0" width="1280">
  222. <tr>
  223. <td width="1280">
  224. <table height="720" border="0" cellspacing="0" cellpadding="0" width="1280">
  225. <tr>
  226. <td width="1187" valign="top" height="340">
  227. <table border="0" cellspacing="0" cellpadding="0" width="1187">
  228. <tr>
  229. <td width="70" background="<?php echo $thumbOverlay ?>html/custom_header.png"/>
  230. <td valign="center" height="50" width="432" class="tvtt" background="<?php echo $thumbOverlay ?>html/custom_header.png"><?php echo $xmlMetaData->Video['title'] ?></td>
  231. <td align="center" valign="center" height="50" width="35" class="tvtts" background="<?php echo $thumbOverlay ?>html/custom_header.png">
  232. <img src="<?php echo plexGetImage($xmlMetaData['mediaTagPrefix'] . 'contentRating/' . $xmlMetaData->Video['contentRating'] . '?t=' . $xmlMetaData['mediaTagVersion'], 95, 35, 'movies/details/studios/') ?>"/>
  233. </td>
  234. <td align="center" valign="center" height="50" class="tvtt" background="<?php echo $thumbOverlay ?>html/custom_header.png" width="95">
  235. <img src="<?php echo plexGetImage($xmlMetaData['mediaTagPrefix'] . 'studio/' . $xmlMetaData->Video['studio'] . '?t=' . $xmlMetaData['mediaTagVersion'], 95, 35, 'movies/details/studios/') ?>"/>
  236. </td>
  237. <td align="center" valign="center" height="50" width="70" class="tvtts" background="<?php echo $thumbOverlay ?>html/custom_header.png"><?php echo $xmlMetaData->Video['year'] ?></td>
  238. <td valign="center" height="50" width="260" background="<?php echo $thumbOverlay ?>html/custom_header.png" class="rating">
  239. <img src="pictures/detail/rating_60.png"/> (<?php echo $xmlMetaData->Video['rating'] ?>/10)</td>
  240. </tr>
  241. </table>
  242. </td>
  243. <td width="93" align="left" valign="middle" rowspan="2" height="720" background="<?php echo $thumbOverlay ?>html/custom_header-right.png">
  244. <?php $playPath = $config['plex_url'] . urldecode($xmlMetaData->Video->Media->Part['key']); ?>
  245. <a class="link" href="<?php echo $playPath ?>" onkeydownset="pgdn" onkeyupset="pgup" onkeyrightset="pgdn" onkeyleftset="pgup" TVID="Play" name="play" id="play" vod="">
  246. <img src="<?php echo $thumbOverlay ?>html/1x688.png" onfocussrc="<?php echo $thumbOverlay ?>html/1x688.png"/>
  247. </a>
  248. </td>
  249. </tr>
  250. <tr>
  251. <td>
  252. <table id="lowlist" width="1187" height="300" border="0" cellspacing="0" cellpadding="0">
  253. <tr>
  254. <td width="250" height="300" valign="top" align="right" background="<?php echo $thumbOverlay ?>html/custom_tvbg-mov-l_dim.png">
  255. <table width="342" height="300" border="0" cellspacing="0" cellpadding="0">
  256. <tr>
  257. <td width="52" height="300" rowspan="3"/>
  258. <td width="310" height="332" align="center" valign="bottom">
  259. <img width="224" src="<?php echo plexGetImage($xmlMetaData->Video['thumb'], 224, 331, 'posters/movies/') ?>"/>
  260. </td>
  261. </tr>
  262. <tr>
  263. <td height="12"/>
  264. </tr>
  265. </table>
  266. </td>
  267. <td>
  268. <table height="290" border="0" cellspacing="0" cellpadding="0">
  269. <tr>
  270. <td height="75"/>
  271. </tr>
  272. <tr>
  273. <td colspan="2" height="250" valign="top" background="<?php echo $thumbOverlay ?>html/custom_tvbg-r_dim.png">
  274. <table border="0" cellspacing="0" cellpadding="0" width="845" height="300">
  275. <tr>
  276. <td height="200" width="426" valign="top">
  277. <table border="0" cellspacing="0" cellpadding="0">
  278. <tr>
  279. <td height="30" valign="center">
  280. <table id="watchbar" height="30" valign="center">
  281. <tr>
  282. <td>
  283. <img id="imgPlot" src="<?php echo $thumbOverlay ?>html/imgPloton.png" height="12"/>
  284. </td>
  285. </tr>
  286. </table>
  287. </td>
  288. </tr>
  289. <tr>
  290. <td height="135" valign="top" id="gtPlot" class="plot"><?php echo substr($xmlMetaData->Video['summary'], 0, 310) ?></td>
  291. </tr>
  292. </table>
  293. <table border="0" cellspacing="0" cellpadding="0" height="30">
  294. <tr>
  295. <td>
  296. <img src="<?php echo $thumbOverlay ?>html/1x688.png" height="30"/>
  297. </td>
  298. <td class="plot" width="40">
  299. <img src="<?php echo $thumbOverlay ?>html/duration.png" height="25"/>
  300. </td>
  301. <?php
  302. $milli = $xmlMetaData->Video->Media['duration'];
  303. $hrs = floor($milli / (1000 * 60 * 60));
  304. $min = floor(($milli % (1000 * 60 * 60)) / (1000 * 60));
  305. if ($hrs > 0) {
  306. $strTime = $hrs . 'h ' . $min . 'm';
  307. } else {
  308. $strTime = $min . 'm';
  309. }
  310. ?>
  311. <td height="30" class="gray" valign="middle" width="200"><?php echo $strTime ?></td>
  312. <td height="30" width="130"/>
  313. <td width="50" valign="top" align="right" id="pages" class="plotpage" height="12"> 1 / 2</td>
  314. </tr>
  315. </table>
  316. <table border="0" cellspacing="0" cellpadding="0" height="40">
  317. <tr>
  318. <td>
  319. <img src="<?php echo $thumbOverlay ?>html/1x688.png" height="40"/>
  320. </td>
  321. <td class="plot" width="40" height="30">
  322. <img src="<?php echo $thumbOverlay ?>html/subtitles.png"/>
  323. </td>
  324. <td class="normal">NO</td>
  325. <td width="30" align="center" class="gray"> | </td>
  326. <td class="plot" width="40">
  327. <img src="<?php echo $thumbOverlay ?>html/audio.png" height="24"/>
  328. </td>
  329. <td height="40" class="gray" valign="middle">MP3</td>
  330. </tr>
  331. </table>
  332. </td>
  333. <td valign="top">
  334. <table border="0" cellspacing="10" cellpadding="0">
  335. <tr>
  336. <td>
  337. <table border="0" cellspacing="0" cellpadding="0" width="406">
  338. <tr>
  339. <td class="gray" width="130">DIRECTED BY</td>
  340. <td width="10"/>
  341. <td width="266" class="plot"><?php echo $xmlMetaData->Video->Director['tag'] ?></td>
  342. </tr>
  343. <tr>
  344. <td height="9" colspan="3">
  345. <img src="<?php echo $thumbOverlay ?>html/hor-div-406.png"/>
  346. </td>
  347. </tr>
  348. <tr>
  349. <td valign="top" class="gray">STARRING</td>
  350. <td width="10"/>
  351. <td>
  352. <?php
  353. $i = 0;
  354. foreach ($xmlMetaData->Video->Role as $person) {
  355. $i++;
  356. echo '<table border="0" cellpadding="0" cellspacing="0">';
  357. echo '<tr>';
  358. echo '<td class="plot"><a href="?destination=' . $_GET['destination'] . '&page=wall&key=' . $_SESSION['key'] . '&category=actor&filter=' . $person['id'] . '&index=1" >' . $person['tag'] . '</a></td>';
  359. echo '</tr>';
  360. echo '</table>';
  361. if ($i == 6)
  362. break;
  363. }
  364. ?>
  365. </td>
  366. </tr>
  367. <tr>
  368. <td height="9" colspan="3">
  369. <img src="<?php echo $thumbOverlay ?>html/hor-div-406.png"/>
  370. </td>
  371. </tr>
  372. <tr>
  373. <td class="gray">GENRE</td>
  374. <td width="10"/>
  375. <td class="plot">
  376. <?php
  377. $i = 0;
  378. foreach ($xmlMetaData->Video->Genre as $Genre) {
  379. $i++;
  380. $genres = $genres . ' / ' . $Genre['tag'];
  381. if ($i == 4)
  382. break;
  383. }
  384. $genres = ltrim($genres, ' /');
  385. echo $genres;
  386. ?>
  387. </tr>
  388. <tr>
  389. <td height="9" colspan="3">
  390. <img src="<?php echo $thumbOverlay ?>html/hor-div-406.png"/>
  391. </td>
  392. </tr>
  393. <tr>
  394. <td class="gray">LIBRARY</td>
  395. <td width="10"/>
  396. <td class="plot">Movies</td>
  397. </tr>
  398. </table>
  399. </td>
  400. </tr>
  401. </table>
  402. </td>
  403. </tr>
  404. <tr>
  405. <td height="55" colspan="2" align="left">
  406. <table border="0" cellspacing="0" cellpadding="0">
  407. <tr>
  408. <td>
  409. <img src="<?php echo plexGetImage($xmlMetaData['mediaTagPrefix'] . 'videoCodec/' . $xmlMetaData->Video->Media['videoCodec'] . '?t=' . $xmlMetaData['mediaTagVersion'], 95, 35, 'movies/details/flags/') ?>"/>
  410. <img src="<?php echo plexGetImage($xmlMetaData['mediaTagPrefix'] . 'audioCodec/' . $xmlMetaData->Video->Media['audioCodec'] . '?t=' . $xmlMetaData['mediaTagVersion'], 95, 35, 'movies/details/flags/') ?>"/>
  411. <img src="<?php echo plexGetImage($xmlMetaData['mediaTagPrefix'] . 'audioChannels/' . $xmlMetaData->Video->Media['audioChannels'] . '?t=' . $xmlMetaData['mediaTagVersion'], 95, 35, 'movies/details/flags/') ?>"/>
  412. <img src="<?php echo plexGetImage($xmlMetaData['mediaTagPrefix'] . 'videoResolution/' . $xmlMetaData->Video->Media['videoResolution'] . '?t=' . $xmlMetaData['mediaTagVersion'], 95, 35, 'movies/details/flags/') ?>"/>
  413. <img src="<?php echo plexGetImage($xmlMetaData['mediaTagPrefix'] . 'videoFrameRate/' . $xmlMetaData->Video->Media['videoFrameRate'] . '?t=' . $xmlMetaData['mediaTagVersion'], 95, 35, 'movies/details/flags/') ?>"/>
  414. <img src="<?php echo plexGetImage($xmlMetaData['mediaTagPrefix'] . 'aspectRatio/' . $xmlMetaData->Video->Media['aspectRatio'] . '?t=' . $xmlMetaData['mediaTagVersion'], 95, 35, 'movies/details/flags/') ?>"/>
  415. </td>
  416. </tr>
  417. </table>
  418. </td>
  419. </tr>
  420. <tr>
  421. <td colspan="2" valign="top"/>
  422. </tr>
  423. </table>
  424. </td>
  425. </tr>
  426. </table>
  427. </td>
  428. </tr>
  429. </table>
  430. </td>
  431. </tr>
  432. </table>
  433. </td>
  434. <td valign="top" align="right"/>
  435. </tr>
  436. </table>
  437. <img src="<?php echo $thumbOverlay ?>boxes/dvd.png" id="Box_Overlay__LowList_NMT_and_PC__TV_PC"/>
  438. <img src="<?php echo $thumbOverlay ?>html/custom_tvbg-mov-r_dim-gap.png" id="tvbgmovr"/>
  439. </body>
  440. <a TVID="RED" href="#play" onclick="pageUp()"/>
  441. <a TVID="GREEN" href="#play" onclick="pageDown()"/>
  442. <a TVID="LEFT" href="#play" onclick="clickLeft()"/>
  443. <a TVID="RIGHT" href="#play" onclick="clickRight()"/>
  444. <a TVID="TAB" href="#play" onclick="toggleWatchbar()"/>
  445. <a TVID="INFO" href="#play" onclick=""/>
  446. <a TVID="HOME" href="../index.htm"/>
  447. <a TVID="PGDN" ONFOCUSLOAD="" name="pgdn" href="Being%20Human.S01E01.Episode%201.html"/>
  448. <a TVID="PGUP" ONFOCUSLOAD="" name="pgup" href="Beautiful%20Kate%20%282009%29.DvDRip.html"/>
  449. </html>
  450. <?php
  451. $logger->info('Memory Usage: ' . Memory_Usage());
  452. $logger->info('End=======================================movie details page=======================================End');
  453. ?>