BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

details.php 40KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  1. <?php
  2. #declare(strict_types = 1);
  3. function compare($x, $y)
  4. {
  5. return($y['name'] < $x['name']);
  6. }
  7. define('MAX_PERS_COLLAGES', 3); // How many personal collages should be shown by default
  8. define('MAX_COLLAGES', 5); // How many normal collages should be shown by default
  9. $GroupID = ceil($_GET['id']);
  10. if (!empty($_GET['revisionid']) && is_number($_GET['revisionid'])) {
  11. $RevisionID = $_GET['revisionid'];
  12. } else {
  13. $RevisionID = 0;
  14. }
  15. include SERVER_ROOT.'/sections/torrents/functions.php';
  16. $TorrentCache = get_group_info($GroupID, true, $RevisionID);
  17. $TorrentDetails = $TorrentCache[0];
  18. $TorrentList = $TorrentCache[1];
  19. // Group details
  20. list($WikiBody, $WikiImage, $GroupID, $GroupName, $GroupTitle2, $GroupNameJP, $GroupYear,
  21. $GroupStudio, $GroupSeries, $GroupCatalogueNumber, $GroupCategoryID,
  22. $GroupTime, $TorrentTags, $TorrentTagIDs, $TorrentTagUserIDs,
  23. $Screenshots, $Mirrors, $GroupFlags) = array_values($TorrentDetails);
  24. if (!$GroupName) {
  25. if (!$GroupTitle2) {
  26. $GroupName = $GroupNameJP;
  27. } else {
  28. $GroupName = $GroupTitle2;
  29. }
  30. }
  31. # Make the main headings
  32. $DisplayName = $GroupName;
  33. $AltName = $GroupName; // Goes in the alt text of the image
  34. $Title = $GroupName; // Goes in <title>
  35. $WikiBody = Text::full_format($WikiBody);
  36. $Artists = Artists::get_artist($GroupID);
  37. if ($GroupCategoryID) {
  38. $DisplayName = '<div class="'.Format::css_category($GroupCategoryID).' group_cat"></div>'.$DisplayName;
  39. }
  40. if ($GroupYear > 0) {
  41. $Label = '<br />📅&nbsp;';
  42. $DisplayName .= $Label.$GroupYear;
  43. $AltName .= $Label.$GroupYear;
  44. }
  45. if ($GroupStudio) {
  46. $Label = '&ensp;📍&nbsp;';
  47. $DisplayName .= $Label.$GroupStudio;
  48. }
  49. if ($GroupCatalogueNumber) {
  50. $Label = '&ensp;🔑&nbsp;';
  51. $DisplayName .= $Label.$GroupCatalogueNumber;
  52. }
  53. if ($GroupTitle2 && $GroupTitle2 !== $GroupName) {
  54. $Label = '<br />🦠&nbsp;';
  55. $DisplayName .= "$Label<em>$GroupTitle2</em>";
  56. }
  57. if ($GroupNameJP && $GroupNameJP !== $GroupName) {
  58. $DisplayName .= ' '.$GroupNameJP;
  59. }
  60. if ($Artists) {
  61. # Emoji in classes/astists.class.php
  62. $Label = '&ensp;';
  63. $DisplayName .= $Label.Artists::display_artists($Artists, true);
  64. }
  65. $Tags = [];
  66. if ($TorrentTags !== '') {
  67. $TorrentTags = explode('|', $TorrentTags);
  68. $TorrentTagIDs = explode('|', $TorrentTagIDs);
  69. $TorrentTagUserIDs = explode('|', $TorrentTagUserIDs);
  70. foreach ($TorrentTags as $TagKey => $TagName) {
  71. $Tags[$TagKey]['name'] = $TagName;
  72. $Tags[$TagKey]['id'] = $TorrentTagIDs[$TagKey];
  73. $Tags[$TagKey]['userid'] = $TorrentTagUserIDs[$TagKey];
  74. $Split = Tags::get_name_and_class($TagName);
  75. $Tags[$TagKey]['display'] = $Split['name'];
  76. $Tags[$TagKey]['class'] = $Split['class'];
  77. }
  78. uasort($Tags, 'compare');
  79. }
  80. $CoverArt = $Cache->get_value("torrents_cover_art_$GroupID");
  81. if (!$CoverArt) {
  82. $DB->query("
  83. SELECT ID, Image, Summary, UserID, Time
  84. FROM cover_art
  85. WHERE GroupID = '$GroupID'
  86. ORDER BY Time ASC");
  87. $CoverArt = [];
  88. $CoverArt = $DB->to_array();
  89. if ($DB->has_results()) {
  90. $Cache->cache_value("torrents_cover_art_$GroupID", $CoverArt, 0);
  91. }
  92. }
  93. // Comments (must be loaded before View::show_header so that subscriptions and quote notifications are handled properly)
  94. list($NumComments, $Page, $Thread, $LastRead) = Comments::load('torrents', $GroupID);
  95. // Start output
  96. View::show_header(
  97. $Title,
  98. 'browse,comments,torrent,bbcode,recommend,cover_art,subscriptions,vendor/easymde.min',
  99. 'vendor/easymde.min'
  100. );
  101. ?>
  102. <div>
  103. <div class="header">
  104. <h2>
  105. <?=$DisplayName?>
  106. </h2>
  107. <div class="linkbox">
  108. <?php if (check_perms('site_edit_wiki')) { ?>
  109. <a href="torrents.php?action=editgroup&amp;groupid=<?=$GroupID?>"
  110. class="brackets">Edit group</a>
  111. <?php } ?>
  112. <a href="torrents.php?action=history&amp;groupid=<?=$GroupID?>"
  113. class="brackets">View history</a>
  114. <?php if ($RevisionID && check_perms('site_edit_wiki')) { ?>
  115. <a href="torrents.php?action=revert&amp;groupid=<?=$GroupID ?>&amp;revisionid=<?=$RevisionID ?>&amp;auth=<?=$LoggedUser['AuthKey']?>"
  116. class="brackets">Revert to this revision</a>
  117. <?php
  118. }
  119. if (Bookmarks::has_bookmarked('torrent', $GroupID)) {
  120. ?>
  121. <a href="#" id="bookmarklink_torrent_<?=$GroupID?>"
  122. class="remove_bookmark brackets"
  123. onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove
  124. bookmark</a>
  125. <?php
  126. } else { ?>
  127. <a href="#" id="bookmarklink_torrent_<?=$GroupID?>"
  128. class="add_bookmark brackets"
  129. onclick="Bookmark('torrent', <?=$GroupID?>, 'Remove bookmark'); return false;">Bookmark</a>
  130. <?php } ?>
  131. <a href="#" id="subscribelink_torrents<?=$GroupID?>"
  132. class="brackets"
  133. onclick="SubscribeComments('torrents', <?=$GroupID?>); return false;"><?=Subscriptions::has_subscribed_comments('torrents', $GroupID) !== false ? 'Unsubscribe' : 'Subscribe'?></a>
  134. <?php
  135. # Remove category-specific options to add a new format
  136. if ($Categories[$GroupCategoryID-1]) { ?>
  137. <a href="upload.php?groupid=<?=$GroupID?>" class="brackets">Add
  138. format</a>
  139. <?php
  140. }
  141. if (check_perms('site_submit_requests')) { ?>
  142. <a href="requests.php?action=new&amp;groupid=<?=$GroupID?>"
  143. class="brackets">Request format</a>
  144. <?php } ?>
  145. <a href="torrents.php?action=grouplog&amp;groupid=<?=$GroupID?>"
  146. class="brackets">View log</a>
  147. </div>
  148. </div>
  149. <?php Misc::display_recommend($GroupID, "torrent"); ?>
  150. <div class="sidebar">
  151. <div class="box box_image box_image_albumart box_albumart">
  152. <!-- .box_albumart deprecated -->
  153. <div class="head">
  154. <strong><?=(count($CoverArt) > 0 ? 'Pictures (' . (count($CoverArt) + 1) . ')' : 'Picture')?></strong>
  155. <?php
  156. if (count($CoverArt) > 0) {
  157. if (empty($LoggedUser['ShowExtraCovers'])) {
  158. for ($Index = 0; $Index <= count($CoverArt); $Index++) { ?>
  159. <span id="cover_controls_<?=($Index)?>" <?=($Index > 0 ? ' style="display: none;"' : '')?>>
  160. <?php if ($Index === count($CoverArt)) { ?>
  161. <a class="brackets prev_cover"
  162. data-gazelle-prev-cover="<?=($Index - 1)?>"
  163. href="#">Prev</a>
  164. <a class="brackets show_all_covers" href="#">Show all</a>
  165. <span class="brackets next_cover">Next</span>
  166. <?php } elseif ($Index > 0) { ?>
  167. <a class="brackets prev_cover"
  168. data-gazelle-prev-cover="<?=($Index - 1)?>"
  169. href="#">Prev</a>
  170. <a class="brackets show_all_covers" href="#">Show all</a>
  171. <a class="brackets next_cover"
  172. data-gazelle-next-cover="<?=($Index + 1)?>"
  173. href="#">Next</a>
  174. <?php } elseif ($Index === 0 && count($CoverArt) > 0) { ?>
  175. <span class="brackets prev_cover">Prev</span>
  176. <a class="brackets show_all_covers" href="#">Show all</a>
  177. <a class="brackets next_cover"
  178. data-gazelle-next-cover="<?=($Index + 1)?>"
  179. href="#">Next</a>
  180. <?php } ?>
  181. </span>
  182. <?php
  183. }
  184. } else { ?>
  185. <span>
  186. <a class="brackets show_all_covers" href="#">Hide</a>
  187. </span>
  188. <?php
  189. }
  190. }
  191. ?>
  192. </div>
  193. <?php $Index = 0; ?>
  194. <div id="covers">
  195. <div id="cover_div_<?=$Index?>">
  196. <?php if ($WikiImage !== '') { ?>
  197. <div><img width="100%" class="lightbox-init"
  198. src="<?=ImageTools::process($WikiImage, 'thumb')?>"
  199. lightbox-img="<?=ImageTools::process($WikiImage)?>"
  200. alt="<?=$AltName?>" /></div>
  201. <?php } else { ?>
  202. <div><img width="100%"
  203. src="<?=STATIC_SERVER?>common/noartwork/music.png"
  204. alt="<?=$Categories[$GroupCategoryID - 1]?>"
  205. class="brackets tooltip"
  206. title="<?=$Categories[$GroupCategoryID - 1]?>" /></div>
  207. <?php
  208. }
  209. $Index++;
  210. ?>
  211. </div>
  212. <?php
  213. foreach ($CoverArt as $Cover) {
  214. list($ImageID, $Image, $Summary, $AddedBy) = $Cover; ?>
  215. <div id="cover_div_<?=$Index?>" <?=(empty($LoggedUser['ShowExtraCovers']) ? ' style="display: none;"' : '')?>>
  216. <div>
  217. <?php
  218. if (empty($LoggedUser['ShowExtraCovers'])) {
  219. $Src = 'src="" data-gazelle-temp-src="' . ImageTools::process($Image, 'thumb') . '" lightbox-img="'.ImageTools::process($Image).'"';
  220. } else {
  221. $Src = 'src="' . ImageTools::process($Image, 'thumb') . '" lightbox-img="'.ImageTools::process($Image).'"';
  222. } ?>
  223. <img id="cover_<?=$Index?>" class="lightbox-init"
  224. width="100%" <?=$Src?> alt="<?=$Summary?>" />
  225. </div>
  226. <ul class="stats nobullet">
  227. <li>
  228. <?=$Summary?>
  229. <?=(check_perms('users_mod') ? ' added by ' . Users::format_username($AddedBy, false, false, false, false, false) : '')?>
  230. <span class="remove remove_cover_art"><a href="#"
  231. onclick="if (confirm('Do not delete useful alternative pictures. Are you sure you want to delete this picture?') === true) { ajax.get('torrents.php?action=remove_cover_art&amp;auth=<?=$LoggedUser['AuthKey']?>&amp;id=<?=$ImageID?>&amp;groupid=<?=$GroupID?>'); this.parentNode.parentNode.parentNode.style.display = 'none'; this.parentNode.parentNode.parentNode.previousElementSibling.style.display = 'none'; } else { return false; }"
  232. class="brackets tooltip" title="Remove image">X</a></span>
  233. </li>
  234. </ul>
  235. </div>
  236. <?php
  237. $Index++;
  238. } ?>
  239. </div>
  240. <?php
  241. if (check_perms('site_edit_wiki') && $WikiImage !== '') { ?>
  242. <div id="add_cover_div">
  243. <div style="padding: 10px;">
  244. <span class="additional_add_artists float_right">
  245. <a onclick="addCoverField(); return false;" href="#" class="brackets">Add alternate cover</a>
  246. </span>
  247. </div>
  248. <div class="body">
  249. <form class="add_form" name="covers" id="add_covers_form" action="torrents.php" method="post">
  250. <div id="add_cover">
  251. <input type="hidden" name="action" value="add_cover_art" />
  252. <input type="hidden" name="auth"
  253. value="<?=$LoggedUser['AuthKey']?>" />
  254. <input type="hidden" name="groupid"
  255. value="<?=$GroupID?>" />
  256. </div>
  257. </form>
  258. </div>
  259. </div>
  260. <?php } ?>
  261. </div>
  262. <div class="box box_artists">
  263. <div class="head"><strong>Author(s)</strong>
  264. <?=check_perms('torrents_edit') ? '<span class="edit_artists"><a onclick="ArtistManager(); return false;" href="#" class="brackets float_right">Edit</a></span>' : ''?>
  265. </div>
  266. <ul class="stats nobullet" id="artist_list">
  267. <?php foreach ($Artists as $Num => $Artist) { ?>
  268. <li class="artist"><?=Artists::display_artist($Artist)?>
  269. <?php if (check_perms('torrents_edit')) { ?>
  270. <span class="remove remove_artist float_right"><a href="javascript:void(0);"
  271. onclick="ajax.get('torrents.php?action=delete_alias&amp;auth=' + authkey + '&amp;groupid=<?=$GroupID?>&amp;artistid=<?=$Artist['id']?>&amp;importance=4'); this.parentNode.parentNode.style.display = 'none';"
  272. class="brackets tooltip" title="Remove artist">X</a></span>
  273. <?php } ?>
  274. </li>
  275. <?php } ?>
  276. </ul>
  277. </div>
  278. <?php
  279. if (check_perms('torrents_add_artist')) { ?>
  280. <div class="box box_addartists">
  281. <div class="head"><strong>Add Author</strong></div>
  282. <div class="body">
  283. <form class="flex_input_container" name="artists" action="torrents.php" method="post">
  284. <input type="hidden" name="action" value="add_alias" />
  285. <input type="hidden" name="auth"
  286. value="<?=$LoggedUser['AuthKey']?>" />
  287. <input type="hidden" name="groupid"
  288. value="<?=$GroupID?>" />
  289. <input type="text" id="artist" name="artistname[]" <?php Users::has_autocomplete_enabled('other'); ?>
  290. />
  291. <input type="submit" value="Add" />
  292. </form>
  293. </div>
  294. </div>
  295. <?php
  296. } ?>
  297. <div class="box box_tags">
  298. <div class="head">
  299. <strong>Tags</strong>
  300. <?php
  301. $DeletedTag = $Cache->get_value("deleted_tags_$GroupID".'_'.$LoggedUser['ID']);
  302. if (!empty($DeletedTag)) { ?>
  303. <form style="display: none;" id="undo_tag_delete_form" name="tags" action="torrents.php" method="post">
  304. <input type="hidden" name="action" value="add_tag" />
  305. <input type="hidden" name="auth"
  306. value="<?=$LoggedUser['AuthKey']?>" />
  307. <input type="hidden" name="groupid"
  308. value="<?=$GroupID?>" />
  309. <input type="hidden" name="tagname"
  310. value="<?=$DeletedTag?>" />
  311. <input type="hidden" name="undo" value="true" />
  312. </form>
  313. <a class="brackets" href="#" onclick="$('#undo_tag_delete_form').raw().submit(); return false;">Undo delete</a>
  314. <?php } ?>
  315. </div>
  316. <?php
  317. if (count($Tags) > 0) {
  318. ?>
  319. <ul class="stats nobullet">
  320. <?php
  321. foreach ($Tags as $TagKey=>$Tag) {
  322. ?>
  323. <li>
  324. <a href="torrents.php?taglist=<?=$Tag['name']?>"
  325. class="<?=display_str($Tag['class'])?>"><?=display_str($Tag['display'])?></a>
  326. <div class="edit_tags_votes float_right">
  327. <?php if (check_perms('users_warn')) { ?>
  328. <a href="user.php?id=<?=$Tag['userid']?>"
  329. title="View the profile of the user that added this tag" class="brackets tooltip view_tag_user">U</a>
  330. <?php } ?>
  331. <?php if (empty($LoggedUser['DisableTagging']) && check_perms('site_delete_tag')) { ?>
  332. <span class="remove remove_tag"><a
  333. href="torrents.php?action=delete_tag&amp;groupid=<?=$GroupID?>&amp;tagid=<?=$Tag['id']?>&amp;auth=<?=$LoggedUser['AuthKey']?>"
  334. class="brackets tooltip" title="Remove tag">X</a></span>
  335. <?php } ?>
  336. </div>
  337. </li>
  338. <?php
  339. } ?>
  340. </ul>
  341. <?php
  342. } else { // The "no tags to display" message was wrapped in <ul> tags to pad the text
  343. ?>
  344. <ul>
  345. <li>There are no tags to display</li>
  346. </ul>
  347. <?php } ?>
  348. </div>
  349. <?php
  350. if (empty($LoggedUser['DisableTagging'])) {
  351. ?>
  352. <div class="box box_addtag">
  353. <div class="head"><strong>Add Tag</strong></div>
  354. <div class="body">
  355. <form class="flex_input_container" name="tags" action="torrents.php" method="post">
  356. <input type="hidden" name="action" value="add_tag" />
  357. <input type="hidden" name="auth"
  358. value="<?=$LoggedUser['AuthKey']?>" />
  359. <input type="hidden" name="groupid"
  360. value="<?=$GroupID?>" />
  361. <input type="text" name="tagname" id="tagname" <?php Users::has_autocomplete_enabled('other'); ?>
  362. />
  363. <input type="submit" value="Add" />
  364. </form>
  365. <br />
  366. <strong><a href="rules.php?p=tag" class="brackets">View tagging rules</a></strong>
  367. </div>
  368. </div>
  369. <?php
  370. } ?>
  371. </div>
  372. <!-- Main torrent display -->
  373. <div class="main_column">
  374. <div class="box">
  375. <table
  376. class="torrent_table details<?=$GroupFlags['IsSnatched'] ? ' snatched' : ''?>"
  377. id="torrent_details">
  378. <tr class="colhead_dark">
  379. <td width="80%"><strong>Torrents</strong></td>
  380. <td><strong>Size</strong></td>
  381. <td class="sign snatches">
  382. <td class="sign seeders">
  383. &uarr;
  384. </td>
  385. <td class="sign leechers">
  386. &darr;
  387. </td>
  388. </tr>
  389. <?php
  390. function filelist($Str)
  391. {
  392. return "</td><td>".Format::get_size($Str[1])."</td></tr>";
  393. }
  394. # FreeTorrent is a string
  395. foreach ($TorrentList as $Torrent) {
  396. list($TorrentID, $Media, $Container, $Codec, $Resolution, $AudioFormat,
  397. $Censored, $Anonymous, $Archive, $FileCount, $Size, $Seeders, $Leechers,
  398. $Snatched, $FreeTorrent, $FreeLeechType, $TorrentTime, $Description, $FileList,
  399. $FilePath, $UserID, $LastActive, $InfoHash, $BadTags, $BadFolders, $BadFiles,
  400. $LastReseedRequest, $LogInDB, $HasFile, $PersonalFL, $IsSnatched, $IsSeeding, $IsLeeching
  401. ) = array_values($Torrent);
  402. $Reported = false;
  403. $Reports = Torrents::get_reports($TorrentID);
  404. $NumReports = count($Reports);
  405. if ($NumReports > 0) {
  406. $Reported = true;
  407. include(SERVER_ROOT.'/sections/reportsv2/array.php');
  408. $ReportInfo = '
  409. <table class="reportinfo_table">
  410. <tr class="colhead_dark" style="font-weight: bold;">
  411. <td>This torrent has '.$NumReports.' active '.($NumReports === 1 ? 'report' : 'reports').":</td>
  412. </tr>";
  413. foreach ($Reports as $Report) {
  414. if (check_perms('admin_reports')) {
  415. $ReporterID = $Report['ReporterID'];
  416. $Reporter = Users::user_info($ReporterID);
  417. $ReporterName = $Reporter['Username'];
  418. $ReportLinks = "<a href='user.php?id=$ReporterID'>$ReporterName</a> <a href='reportsv2.php?view=report&amp;id=$Report[ID]'>reported it</a>";
  419. } else {
  420. $ReportLinks = 'Someone reported it';
  421. }
  422. if (isset($Types[$GroupCategoryID][$Report['Type']])) {
  423. $ReportType = $Types[$GroupCategoryID][$Report['Type']];
  424. } elseif (isset($Types['master'][$Report['Type']])) {
  425. $ReportType = $Types['master'][$Report['Type']];
  426. } else {
  427. // There was a type but it wasn't an option!
  428. $ReportType = $Types['master']['other'];
  429. }
  430. $ReportInfo .= "
  431. <tr>
  432. <td>$ReportLinks ".time_diff($Report['ReportedTime'], 2, true, true).' for the reason "'.$ReportType['title'].'":
  433. <blockquote>'.Text::full_format($Report['UserComment']).'</blockquote>
  434. </td>
  435. </tr>';
  436. }
  437. $ReportInfo .= "\n\t\t</table>";
  438. }
  439. $CanEdit = (check_perms('torrents_edit') || (($UserID == $LoggedUser['ID'] && !$LoggedUser['DisableWiki']) && !($Remastered && !$RemasterYear)));
  440. $RegenLink = check_perms('users_mod') ? ' <a href="torrents.php?action=regen_filelist&amp;torrentid='.$TorrentID.'" class="brackets">Regenerate</a>' : '';
  441. $FileTable = '
  442. <table class="filelist_table">
  443. <tr class="colhead_dark">
  444. <td>
  445. <div class="filelist_title float_left">File Names' . $RegenLink . '</div>
  446. <div class="filelist_path float_right">' . ($FilePath ? "/$FilePath/" : '') . '</div>
  447. </td>
  448. <td class="nobr">
  449. <strong>Size</strong>
  450. </td>
  451. </tr>';
  452. if (substr($FileList, -3) === '}}}') { // Old style
  453. $FileListSplit = explode('|||', $FileList);
  454. foreach ($FileListSplit as $File) {
  455. $NameEnd = strrpos($File, '{{{');
  456. $Name = substr($File, 0, $NameEnd);
  457. if ($Spaces = strspn($Name, ' ')) {
  458. $Name = str_replace(' ', '&nbsp;', substr($Name, 0, $Spaces)) . substr($Name, $Spaces);
  459. }
  460. $FileSize = substr($File, $NameEnd + 3, -3);
  461. $FileTable .= sprintf("\n<tr class='row'><td>%s</td><td class='number_column nobr'>%s</td></tr>", $Name, Format::get_size($FileSize));
  462. }
  463. } else {
  464. $FileListSplit = explode("\n", $FileList);
  465. foreach ($FileListSplit as $File) {
  466. $FileInfo = Torrents::filelist_get_file($File);
  467. $FileTable .= sprintf("\n<tr class='row'><td>%s</td><td class='number_column nobr'>%s</td></tr>", $FileInfo['name'], Format::get_size($FileInfo['size']));
  468. }
  469. }
  470. $FileTable .= '
  471. </table>';
  472. $ExtraInfo = ''; // String that contains information on the torrent (e.g., format and encoding)
  473. $AddExtra = '&thinsp;|&thinsp;'; // Separator between torrent properties
  474. // Similar to Torrents::torrent_info()
  475. if ($Media) {
  476. $ExtraInfo .= display_str($Media);
  477. }
  478. if ($Container) {
  479. $ExtraInfo .= $AddExtra . display_str($Container);
  480. }
  481. if ($Archive) {
  482. $ExtraInfo .= $AddExtra . display_str($Archive);
  483. }
  484. if ($Codec) {
  485. $ExtraInfo .= $AddExtra . display_str($Codec);
  486. }
  487. if ($Resolution) {
  488. $ExtraInfo .= $AddExtra . display_str($Resolution);
  489. }
  490. /*
  491. if ($AudioFormat) {
  492. $ExtraInfo.=$AddExtra.display_str($AudioFormat);
  493. }
  494. */
  495. if ($Censored) {
  496. $ExtraInfo .= $AddExtra . display_str('Aligned');
  497. } else {
  498. $ExtraInfo .= $AddExtra . display_str('Not Aligned');
  499. }
  500. if (!$ExtraInfo) {
  501. $ExtraInfo = $GroupName;
  502. }
  503. if ($IsLeeching) {
  504. $ExtraInfo .= $AddExtra . Format::torrent_label('Leeching', 'important_text_semi');
  505. } elseif ($IsSeeding) {
  506. $ExtraInfo .= $AddExtra . Format::torrent_label('Seeding', 'important_text_alt');
  507. } elseif ($IsSnatched) {
  508. $ExtraInfo .= $AddExtra . Format::torrent_label('Snatched', 'bold');
  509. }
  510. if ($FreeTorrent === '1') {
  511. $ExtraInfo .= $AddExtra . Format::torrent_label('Freeleech', 'important_text_alt');
  512. }
  513. if ($FreeTorrent === '2') {
  514. $ExtraInfo .= $AddExtra . Format::torrent_label('Neutral Leech', 'bold');
  515. }
  516. // Freleechizer
  517. if ($FreeLeechType === '3') {
  518. $DB->query("
  519. SELECT UNIX_TIMESTAMP(ExpiryTime)
  520. FROM shop_freeleeches
  521. WHERE TorrentID = $TorrentID");
  522. if ($DB->has_results()) {
  523. $ExpiryTime = $DB->next_record(MYSQLI_NUM, false)[0];
  524. $ExtraInfo .= " <strong>(".str_replace(['month','week','day','hour','min'], ['m','w','d','h','m'], time_diff(max($ExpiryTime, time()), 1, false)).")</strong>";
  525. }
  526. }
  527. if ($PersonalFL) {
  528. $ExtraInfo .= $AddExtra . Format::torrent_label('Personal Freeleech', 'important_text_alt');
  529. }
  530. if ($Reported) {
  531. $HtmlReportType = ucfirst($Reports[0]['Type']);
  532. $HtmlReportComment = htmlentities(htmlentities($Reports[0]['UserComment']));
  533. $ExtraInfo .= $AddExtra . "<strong class='torrent_label tl_reported tooltip' title='Type: $HtmlReportType<br>Comment: $HtmlReportComment'>".Format::torrent_label('Reported', 'important_text')."</strong>";
  534. }
  535. if (!empty($BadTags)) {
  536. $ExtraInfo .= $AddExtra . Format::torrent_label('Bad Tags', 'important_text');
  537. }
  538. if (!empty($BadFolders)) {
  539. $ExtraInfo .= $AddExtra . Format::torrent_label('Bad Folders', 'important_text');
  540. }
  541. if (!empty($BadFiles)) {
  542. $ExtraInfo .= $AddExtra . Format::torrent_label('Bad File Names', 'important_text');
  543. }
  544. $TorrentDL = "torrents.php?action=download&amp;id=".$TorrentID."&amp;authkey=".$LoggedUser['AuthKey']."&amp;torrent_pass=".$LoggedUser['torrent_pass'];
  545. if (!($TorrentFileName = $Cache->get_value('torrent_file_name_'.$TorrentID))) {
  546. $TorrentFile = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');
  547. $Tor = new BencodeTorrent($TorrentFile, false, false);
  548. $TorrentFileName = $Tor->Dec['info']['name'];
  549. $Cache->cache_value('torrent_file_name_'.$TorrentID, $TorrentFileName);
  550. } ?>
  551. <tr
  552. class="torrent_row groupid_<?=$GroupID?> group_torrent<?=($IsSnatched ? ' snatched_torrent' : '')?>"
  553. style="font-weight: normal;" id="torrent<?=$TorrentID?>">
  554. <td>
  555. <span>[ <a href="<?=$TorrentDL?>" class="tooltip"
  556. title="Download"><?=($HasFile ? 'DL' : 'Missing')?></a>
  557. <?php
  558. if (Torrents::can_use_token($Torrent)) { ?>
  559. | <a
  560. href="torrents.php?action=download&amp;id=<?=$TorrentID ?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>&amp;usetoken=1"
  561. class="tooltip" title="Use a FL Token"
  562. onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
  563. <?php } ?>
  564. | <a
  565. href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>"
  566. class="tooltip" title="Report">RP</a>
  567. <?php if ($CanEdit) { ?>
  568. | <a
  569. href="torrents.php?action=edit&amp;id=<?=$TorrentID ?>"
  570. class="tooltip" title="Edit release">ED</a>
  571. <?php }
  572. if (check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?>
  573. | <a
  574. href="torrents.php?action=delete&amp;torrentid=<?=$TorrentID ?>"
  575. class="tooltip" title="Remove">RM</a>
  576. <?php } ?>
  577. | <a href="torrents.php?torrentid=<?=$TorrentID ?>"
  578. class="tooltip" title="Permalink">PL</a>
  579. ]
  580. </span>
  581. <a data-toggle-target="#torrent_<?=$TorrentID?>"><?=$ExtraInfo; ?></a>
  582. </td>
  583. <td class="number_column nobr"><?=Format::get_size($Size)?>
  584. </td>
  585. <td class="number_column"><?=number_format($Snatched)?>
  586. </td>
  587. <td class="number_column"><?=number_format($Seeders)?>
  588. </td>
  589. <td class="number_column"><?=number_format($Leechers)?>
  590. </td>
  591. </tr>
  592. <tr
  593. class=" groupid_<?=$GroupID?> torrentdetails pad <?php if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) { ?>hidden<?php } ?>"
  594. id="torrent_<?=$TorrentID; ?>">
  595. <td colspan="5">
  596. <div id="release_<?=$TorrentID?>" class="no_overflow">
  597. <blockquote>
  598. Uploaded by <?php
  599. if ($Anonymous) {
  600. if (check_perms('users_mod')) { ?>
  601. <em class="tooltip"
  602. title="<?=Users::user_info($UserID)['Username']?>">Anonymous</em>
  603. <?php } else {
  604. ?><em>Anonymous</em><?php
  605. }
  606. } else {
  607. echo Users::format_username($UserID, false, false, false);
  608. } ?> <?=time_diff($TorrentTime); ?>
  609. <?php if ($Seeders === 0) {
  610. if ($LastActive && time() - strtotime($LastActive) >= 1209600) { ?>
  611. <br /><strong>Last active: <?=time_diff($LastActive); ?></strong>
  612. <?php } else { ?>
  613. <br />Last active: <?=time_diff($LastActive); ?>
  614. <?php }
  615. }
  616. if (($Seeders === 0 && $LastActive && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) || check_perms('users_mod')) { ?>
  617. <br /><a
  618. href="torrents.php?action=reseed&amp;torrentid=<?=$TorrentID?>&amp;groupid=<?=$GroupID?>"
  619. class="brackets">Request re-seed</a>
  620. <?php } ?>
  621. </blockquote>
  622. </div>
  623. <?php if (check_perms('site_moderate_requests')) { ?>
  624. <div class="linkbox">
  625. <a href="torrents.php?action=masspm&amp;id=<?=$GroupID?>&amp;torrentid=<?=$TorrentID?>"
  626. class="brackets">Mass PM snatchers</a>
  627. </div>
  628. <?php } ?>
  629. <div class="linkbox">
  630. <a href="#" class="brackets"
  631. onclick="show_peers('<?=$TorrentID?>', 0); return false;">View
  632. peer list</a>
  633. <?php if (check_perms('site_view_torrent_snatchlist')) { ?>
  634. <a href="#" class="brackets tooltip"
  635. onclick="show_downloads('<?=$TorrentID?>', 0); return false;"
  636. title="View the list of users that have clicked the &quot;DL&quot; button.">View download list</a>
  637. <a href="#" class="brackets tooltip"
  638. onclick="show_snatches('<?=$TorrentID?>', 0); return false;"
  639. title="View the list of users that have reported a snatch to the tracker.">View snatch list</a>
  640. <?php } ?>
  641. <a href="#" class="brackets"
  642. onclick="show_files('<?=$TorrentID?>'); return false;">View
  643. file list</a>
  644. <?php if ($Reported) { ?>
  645. <a href="#" class="brackets"
  646. onclick="show_reported('<?=$TorrentID?>'); return false;">View
  647. report information</a>
  648. <?php } ?>
  649. </div>
  650. <div id="peers_<?=$TorrentID?>" class="hidden"></div>
  651. <div id="downloads_<?=$TorrentID?>" class="hidden"></div>
  652. <div id="snatches_<?=$TorrentID?>" class="hidden"></div>
  653. <div id="files_<?=$TorrentID?>" class="hidden"><?=$FileTable?>
  654. </div>
  655. <?php if ($Reported) { ?>
  656. <div id="reported_<?=$TorrentID?>" class="hidden"><?=$ReportInfo?>
  657. </div>
  658. <?php
  659. }
  660. if (!empty($Description)) {
  661. echo '<blockquote class="torrent_description">'.Text::full_format($Description).'</blockquote>';
  662. }
  663. echo "\n<blockquote>"; ?>
  664. <div class="spoilerContainer hideContainer">
  665. <?php
  666. # Make a BibTeX citation
  667. # todo: Expand this and move HTTP/FTP, IPFS, Dat, etc.
  668. $EntryName = "BioTorrents.de-$TorrentID";
  669. $Today = strftime('%Y-%m-%d');
  670. # Author format handling
  671. $ArtistArray = [];
  672. foreach ($Artists as $Num => $Artist) {
  673. array_push($ArtistArray, $Artist['name']);
  674. }
  675. # Not sure if inline newlines are valid
  676. $ArtistString = (count($ArtistArray) > 3)
  677. ? implode("\n and ", $ArtistArray)
  678. : implode(' and ', $ArtistArray);
  679. # DOI number
  680. $BibtexDOI = (count($Screenshots) > 0)
  681. ? $Screenshots[0]['Image']
  682. : null;
  683. # Starting newline necessary
  684. $BibtexCitation = <<<TEX
  685. @misc{ $EntryName
  686. title = {{$GroupName}},
  687. author = {{$ArtistString}},
  688. year = {{$GroupYear}},
  689. doi = {{$BibtexDOI}},
  690. url = \href{https://biotorrents.de/torrents.php?torrentid=$TorrentID},
  691. note = {On BitTorrent; accessed $Today}
  692. }
  693. TEX;
  694. ?>
  695. <!-- todo pcs: Both tags must be on the same line -->
  696. <input type="button" class="spoilerButton" value="Show BibTeX" /><pre class="hidden">
  697. <?= $BibtexCitation ?>
  698. </pre>
  699. </div>
  700. <?php
  701. #}
  702. echo '</blockquote>';
  703. } ?>
  704. </td>
  705. </tr>
  706. <?php
  707. #}?>
  708. </table>
  709. </div>
  710. <?php
  711. $Requests = get_group_requests($GroupID);
  712. if (empty($LoggedUser['DisableRequests']) && count($Requests) > 0) {
  713. ?>
  714. <div class="box">
  715. <div class="head">
  716. <span style="font-weight: bold;">Requests (<?=number_format(count($Requests))?>)</span>
  717. <a data-toggle-target="#requests" data-toggle-replace="Hide" class="float_right brackets">Show</a>
  718. </div>
  719. <table id="requests" class="request_table hidden">
  720. <tr class="colhead">
  721. <td>Description</td>
  722. <td>Votes</td>
  723. <td>Bounty</td>
  724. </tr>
  725. <?php foreach ($Requests as $Request) {
  726. $RequestVotes = Requests::get_votes_array($Request['ID']);
  727. $RequestDesc = substr(explode('\n', Text::strip_bbcode($Request['Description']), 2)[0], 0, 70);
  728. if (strlen(explode('\n', Text::strip_bbcode($Request['Description']), 2)[0]) > 70) {
  729. $RequestDesc = substr($RequestDesc, 0, 67) . '...';
  730. } ?>
  731. <tr class="requestrows row">
  732. <td><a
  733. href="requests.php?action=view&amp;id=<?=$Request['ID']?>"><?=$RequestDesc?></a></td>
  734. <td>
  735. <span
  736. id="vote_count_<?=$Request['ID']?>"><?=count($RequestVotes['Voters'])?></span>
  737. <?php if (check_perms('site_vote')) { ?>
  738. &nbsp;&nbsp; <a
  739. href="javascript:Vote(0, <?=$Request['ID']?>)"
  740. class="brackets">+</a>
  741. <?php } ?>
  742. </td>
  743. <td><?=Format::get_size($RequestVotes['TotalBounty'])?>
  744. </td>
  745. </tr>
  746. <?php
  747. } ?>
  748. </table>
  749. </div>
  750. <?php
  751. }
  752. $Collages = $Cache->get_value("torrent_collages_$GroupID");
  753. if (!is_array($Collages)) {
  754. $DB->query("
  755. SELECT c.Name, c.NumTorrents, c.ID
  756. FROM collages AS c
  757. JOIN collages_torrents AS ct ON ct.CollageID = c.ID
  758. WHERE ct.GroupID = '$GroupID'
  759. AND Deleted = '0'
  760. AND CategoryID != '0'");
  761. $Collages = $DB->to_array();
  762. $Cache->cache_value("torrent_collages_$GroupID", $Collages, 3600 * 6);
  763. }
  764. if (count($Collages) > 0) {
  765. if (count($Collages) > MAX_COLLAGES) {
  766. // Pick some at random
  767. $Range = range(0, count($Collages) - 1);
  768. shuffle($Range);
  769. $Indices = array_slice($Range, 0, MAX_COLLAGES);
  770. $SeeAll = ' <a data-toggle-target=".collage_rows">(See all)</a>';
  771. } else {
  772. $Indices = range(0, count($Collages) - 1);
  773. $SeeAll = '';
  774. } ?>
  775. <div class="box">
  776. <table class="collage_table" id="collages">
  777. <tr class="colhead">
  778. <td width="75%"><a href="#">&uarr;</a>&nbsp;This content is in <?=number_format(count($Collages))?> collection<?=((count($Collages) > 1) ? 's' : '')?><?=$SeeAll?>
  779. </td>
  780. <td># torrents</td>
  781. </tr>
  782. <?php foreach ($Indices as $i) {
  783. list($CollageName, $CollageTorrents, $CollageID) = $Collages[$i];
  784. unset($Collages[$i]); ?>
  785. <tr>
  786. <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
  787. <td class="number_column"><?=number_format($CollageTorrents)?>
  788. </td>
  789. </tr>
  790. <?php
  791. }
  792. foreach ($Collages as $Collage) {
  793. list($CollageName, $CollageTorrents, $CollageID) = $Collage; ?>
  794. <tr class="collage_rows hidden">
  795. <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
  796. <td class="number_column"><?=number_format($CollageTorrents)?>
  797. </td>
  798. </tr>
  799. <?php
  800. } ?>
  801. </table>
  802. </div>
  803. <?php
  804. }
  805. $PersonalCollages = $Cache->get_value("torrent_collages_personal_$GroupID");
  806. if (!is_array($PersonalCollages)) {
  807. $DB->query("
  808. SELECT c.Name, c.NumTorrents, c.ID
  809. FROM collages AS c
  810. JOIN collages_torrents AS ct ON ct.CollageID = c.ID
  811. WHERE ct.GroupID = '$GroupID'
  812. AND Deleted = '0'
  813. AND CategoryID = '0'");
  814. $PersonalCollages = $DB->to_array(false, MYSQLI_NUM);
  815. $Cache->cache_value("torrent_collages_personal_$GroupID", $PersonalCollages, 3600 * 6);
  816. }
  817. if (count($PersonalCollages) > 0) {
  818. if (count($PersonalCollages) > MAX_PERS_COLLAGES) {
  819. // Pick some at random
  820. $Range = range(0, count($PersonalCollages) - 1);
  821. shuffle($Range);
  822. $Indices = array_slice($Range, 0, MAX_PERS_COLLAGES);
  823. $SeeAll = ' <a data-toggle-target=".personal_rows">(See all)</a>';
  824. } else {
  825. $Indices = range(0, count($PersonalCollages) - 1);
  826. $SeeAll = '';
  827. } ?>
  828. <table class="box collage_table" id="personal_collages">
  829. <tr class="colhead">
  830. <td width="85%"><a href="#">&uarr;</a>&nbsp;This content is in <?=number_format(count($PersonalCollages))?> personal
  831. collection<?=((count($PersonalCollages) > 1) ? 's' : '')?><?=$SeeAll?>
  832. </td>
  833. <td># torrents</td>
  834. </tr>
  835. <?php foreach ($Indices as $i) {
  836. list($CollageName, $CollageTorrents, $CollageID) = $PersonalCollages[$i];
  837. unset($PersonalCollages[$i]); ?>
  838. <tr>
  839. <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
  840. <td class="number_column"><?=number_format($CollageTorrents)?>
  841. </td>
  842. </tr>
  843. <?php
  844. }
  845. foreach ($PersonalCollages as $Collage) {
  846. list($CollageName, $CollageTorrents, $CollageID) = $Collage; ?>
  847. <tr class="personal_rows hidden">
  848. <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
  849. <td class="number_column"><?=number_format($CollageTorrents)?>
  850. </td>
  851. </tr>
  852. <?php
  853. } ?>
  854. </table>
  855. <?php
  856. }
  857. ?>
  858. <!-- Torrent group description -->
  859. <div class="box torrent_description">
  860. <div class="head"><a href="#">&uarr;</a>&nbsp;<strong><?=(!empty($ReleaseType) ? $ReleaseTypes[$ReleaseType].' info' : 'Info')?></strong>
  861. </div>
  862. <div class="body"><?php if ($WikiBody != '') {
  863. echo $WikiBody;
  864. } else {
  865. echo 'There is no information on this torrent.';
  866. } ?>
  867. </div>
  868. </div>
  869. <!-- Mirrors -->
  870. <div class="box torrent_mirrors_box <?php if (!count($Mirrors)) {
  871. echo 'dead';
  872. } ?>">
  873. <div class="head"><a href="#">&uarr;</a>&nbsp;<strong>
  874. Mirrors (<?= count($Mirrors) ?>)</strong>
  875. <?php
  876. if (count($Mirrors) > 0) {
  877. ?>
  878. <a class="float_right brackets" data-toggle-target=".torrent_mirrors" data-toggle-replace="Show">Hide</a>
  879. <?php
  880. }
  881. $DB->query("
  882. SELECT UserID
  883. FROM torrents
  884. WHERE GroupID = $GroupID");
  885. if (in_array($LoggedUser['ID'], $DB->collect('UserID')) || check_perms('torrents_edit') || check_perms('screenshots_add') || check_perms('screenshots_delete')) {
  886. ?>
  887. <a class="brackets"
  888. href="torrents.php?action=editgroup&groupid=<?=$GroupID?>#mirrors_section">Add/Remove</a>
  889. <?php
  890. }
  891. ?>
  892. </div>
  893. <div class="body torrent_mirrors">
  894. <?php if (!empty($Mirrors)) {
  895. echo '<p>Mirror links open in a new tab.</p>';
  896. } ?>
  897. <ul>
  898. <?php
  899. foreach ($Mirrors as $Mirror) {
  900. echo '<li><a href="'.$Mirror['Resource'].'" target="_blank">'.$Mirror['Resource'].'</a></li>';
  901. }
  902. ?>
  903. </ul>
  904. </div>
  905. </div>
  906. <!-- Screenshots (Publications) -->
  907. <div class="box torrent_screenshots_box <?php if (!count($Screenshots)) {
  908. echo 'dead';
  909. } ?>">
  910. <div class="head"><a href="#">&uarr;</a>&nbsp;<strong>
  911. Publications (<?= count($Screenshots) ?>)</strong>
  912. <?php
  913. if (count($Screenshots) > 0) {
  914. ?>
  915. <a class="float_right brackets" data-toggle-target=".torrent_screenshots" data-toggle-replace="Show">Hide</a>
  916. <?php
  917. }
  918. $DB->query("
  919. SELECT UserID
  920. FROM torrents
  921. WHERE GroupID = $GroupID");
  922. if (in_array($LoggedUser['ID'], $DB->collect('UserID')) || check_perms('torrents_edit') || check_perms('screenshots_add') || check_perms('screenshots_delete')) {
  923. ?>
  924. <a class="brackets"
  925. href="torrents.php?action=editgroup&groupid=<?=$GroupID?>#screenshots_section">Add/Remove</a>
  926. <?php
  927. }
  928. ?>
  929. </div>
  930. <div class="body torrent_screenshots">
  931. <?php if (!empty($Screenshots)) {
  932. echo '<p>Sci-Hub links open in a new tab.</p>';
  933. } ?>
  934. <ul>
  935. <?php
  936. foreach ($Screenshots as $Screenshot) {
  937. echo '<li><a href="https://sci-hub.'.SCI_HUB.'/'.$Screenshot['Image'].'" target="_blank">'.$Screenshot['Image'].'</a></li>';
  938. /* Image proxy integration
  939. $SSURL = ImageTools::process($Screenshot['Image']);
  940. $ThumbURL = ImageTools::process($Screenshot['Image'], 'thumb');
  941. */
  942. /* todo: Bring this back
  943. if (check_perms('users_mod')) {
  944. ?><img class='tooltip lightbox-init' title='<?=Users::format_username($Screenshot['UserID'], false, false, false)?> - <?=time_diff($Screenshot['Time'])?>' lightbox-img="<?=$SSURL?>" src="<?=$ThumbURL?>" /><?
  945. } else {
  946. ?><img class='tooltip lightbox-init' title='Added <?=time_diff($Screenshot['Time'])?>' lightbox-img="<?=$SSURL?>" src="<?=$ThumbURL?>" /><?
  947. }
  948. */
  949. }
  950. ?>
  951. </ul>
  952. </div>
  953. <script>
  954. try {
  955. $('.torrent_screenshots>img').last().raw().style.width = ($('.torrent_screenshots>img').length % 2 + 1) * 50 +
  956. '%'
  957. } catch (e) {}
  958. </script>
  959. </div>
  960. <?php
  961. // --- Comments ---
  962. $Pages = Format::get_pages($Page, $NumComments, TORRENT_COMMENTS_PER_PAGE, 9, '#comments');
  963. ?>
  964. <div id="torrent_comments">
  965. <div class="linkbox"><a name="comments"></a>
  966. <?=$Pages?>
  967. </div>
  968. <?php
  969. CommentsView::render_comments($Thread, $LastRead, "torrents.php?id=$GroupID");
  970. ?>
  971. <div class="linkbox">
  972. <?=$Pages?>
  973. </div>
  974. <?php
  975. View::parse('generic/reply/quickreply.php', array(
  976. 'InputName' => 'pageid',
  977. 'InputID' => $GroupID,
  978. 'Action' => 'comments.php?page=torrents',
  979. 'InputAction' => 'take_post',
  980. 'TextareaCols' => 65,
  981. 'SubscribeBox' => true
  982. ));
  983. ?>
  984. </div>
  985. </div>
  986. </div>
  987. <?php View::show_footer();