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 38KB

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