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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  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. <th width="80%"><strong>Torrents</strong></th>
  380. <th><strong>Size</strong></th>
  381. <th class="sign snatches">
  382. <th class="sign seeders">
  383. &uarr;
  384. </th>
  385. <th class="sign leechers">
  386. &darr;
  387. </th>
  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, $Version,
  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 .= "</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 = '&Tab;|&Tab;'; // Separator between torrent properties
  474. // Similar to Torrents::torrent_info()
  475. if ($Media) {
  476. $ExtraInfo .= '<x style="tooltip" title="Platform">'.display_str($Media).'</x>';
  477. }
  478. if ($Container) {
  479. $ExtraInfo .= $AddExtra.'<x style="tooltip" title="Format">'.display_str($Container).'</x>';
  480. }
  481. if ($Archive) {
  482. $ExtraInfo .= $AddExtra.'<x style="tooltip" title="Archive">'.display_str($Archive).'</x>';
  483. }
  484. if ($Codec) {
  485. $ExtraInfo .= $AddExtra.'<x style="tooltip" title="License">'.display_str($Codec).'</x>';
  486. }
  487. if ($Resolution) {
  488. $ExtraInfo .= $AddExtra.'<x style="tooltip" title="Scope">'.display_str($Resolution).'</x>';
  489. }
  490. /*
  491. if ($Version) {
  492. $ExtraInfo.=$AddExtra.display_str($Version);
  493. $ExtraInfo .= $AddExtra.'<x style="tooltip" title="Accession Number">'.display_str($Version).'</x>';
  494. }
  495. */
  496. if ($Censored) {
  497. $ExtraInfo .= $AddExtra.'<x style="tooltip" title="Aligned/Annotated">Yes</x>';
  498. } else {
  499. $ExtraInfo .= $AddExtra.'<x style="tooltip" title="Aligned/Annotated">No</x>';
  500. }
  501. if (!$ExtraInfo) {
  502. $ExtraInfo = $GroupName;
  503. }
  504. if ($IsLeeching) {
  505. $ExtraInfo .= $AddExtra.Format::torrent_label('Leeching', 'important_text_semi');
  506. } elseif ($IsSeeding) {
  507. $ExtraInfo .= $AddExtra.Format::torrent_label('Seeding', 'important_text_alt');
  508. } elseif ($IsSnatched) {
  509. $ExtraInfo .= $AddExtra.Format::torrent_label('Snatched', 'bold');
  510. }
  511. if ($FreeTorrent === '1') {
  512. $ExtraInfo .= $AddExtra.Format::torrent_label('Freeleech', 'important_text_alt');
  513. }
  514. if ($FreeTorrent === '2') {
  515. $ExtraInfo .= $AddExtra.Format::torrent_label('Neutral Leech', 'bold');
  516. }
  517. // Freleechizer
  518. if ($FreeLeechType === '3') {
  519. $DB->query("
  520. SELECT UNIX_TIMESTAMP(ExpiryTime)
  521. FROM shop_freeleeches
  522. WHERE TorrentID = $TorrentID");
  523. if ($DB->has_results()) {
  524. $ExpiryTime = $DB->next_record(MYSQLI_NUM, false)[0];
  525. $ExtraInfo .= " <strong>(".str_replace(['month','week','day','hour','min'], ['m','w','d','h','m'], time_diff(max($ExpiryTime, time()), 1, false)).")</strong>";
  526. }
  527. }
  528. if ($PersonalFL) {
  529. $ExtraInfo .= $AddExtra.Format::torrent_label('Personal Freeleech', 'important_text_alt');
  530. }
  531. if ($Reported) {
  532. $HtmlReportType = ucfirst($Reports[0]['Type']);
  533. $HtmlReportComment = htmlentities(htmlentities($Reports[0]['UserComment']));
  534. $ExtraInfo .= $AddExtra."<strong class='torrent_label tl_reported tooltip' title='Type: $HtmlReportType<br>Comment: $HtmlReportComment'>".Format::torrent_label('Reported', 'important_text')."</strong>";
  535. }
  536. if (!empty($BadTags)) {
  537. $ExtraInfo .= $AddExtra.Format::torrent_label('Bad Tags', 'important_text');
  538. }
  539. if (!empty($BadFolders)) {
  540. $ExtraInfo .= $AddExtra.Format::torrent_label('Bad Folders', 'important_text');
  541. }
  542. if (!empty($BadFiles)) {
  543. $ExtraInfo .= $AddExtra.Format::torrent_label('Bad File Names', 'important_text');
  544. }
  545. $TorrentDL = "torrents.php?action=download&amp;id=".$TorrentID."&amp;authkey=".$LoggedUser['AuthKey']."&amp;torrent_pass=".$LoggedUser['torrent_pass'];
  546. if (!($TorrentFileName = $Cache->get_value('torrent_file_name_'.$TorrentID))) {
  547. $TorrentFile = file_get_contents(TORRENT_STORE.$TorrentID.'.torrent');
  548. $Tor = new BencodeTorrent($TorrentFile, false, false);
  549. $TorrentFileName = $Tor->Dec['info']['name'];
  550. $Cache->cache_value('torrent_file_name_'.$TorrentID, $TorrentFileName);
  551. } ?>
  552. <tr
  553. class="torrent_row groupid_<?=$GroupID?> group_torrent<?=($IsSnatched ? ' snatched_torrent' : '')?>"
  554. style="font-weight: normal;" id="torrent<?=$TorrentID?>">
  555. <td>
  556. <span>[ <a href="<?=$TorrentDL?>" class="tooltip"
  557. title="Download"><?=($HasFile ? 'DL' : 'Missing')?></a>
  558. <?php
  559. if (Torrents::can_use_token($Torrent)) { ?>
  560. | <a
  561. href="torrents.php?action=download&amp;id=<?=$TorrentID ?>&amp;authkey=<?=$LoggedUser['AuthKey']?>&amp;torrent_pass=<?=$LoggedUser['torrent_pass']?>&amp;usetoken=1"
  562. class="tooltip" title="Use a FL Token"
  563. onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
  564. <?php } ?>
  565. | <a
  566. href="reportsv2.php?action=report&amp;id=<?=$TorrentID?>"
  567. class="tooltip" title="Report">RP</a>
  568. <?php if ($CanEdit) { ?>
  569. | <a
  570. href="torrents.php?action=edit&amp;id=<?=$TorrentID ?>"
  571. class="tooltip" title="Edit release">ED</a>
  572. <?php }
  573. if (check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) { ?>
  574. | <a
  575. href="torrents.php?action=delete&amp;torrentid=<?=$TorrentID ?>"
  576. class="tooltip" title="Remove">RM</a>
  577. <?php } ?>
  578. | <a href="torrents.php?torrentid=<?=$TorrentID ?>"
  579. class="tooltip" title="Permalink">PL</a>
  580. ]
  581. </span>
  582. <a data-toggle-target="#torrent_<?=$TorrentID?>"><?=$ExtraInfo; ?></a>
  583. </td>
  584. <td class="number_column nobr"><?=Format::get_size($Size)?>
  585. </td>
  586. <td class="number_column"><?=number_format($Snatched)?>
  587. </td>
  588. <td class="number_column"><?=number_format($Seeders)?>
  589. </td>
  590. <td class="number_column"><?=number_format($Leechers)?>
  591. </td>
  592. </tr>
  593. <tr
  594. class=" groupid_<?=$GroupID?> torrentdetails pad <?php if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) { ?>hidden<?php } ?>"
  595. id="torrent_<?=$TorrentID; ?>">
  596. <td colspan="5">
  597. <div id="release_<?=$TorrentID?>" class="no_overflow">
  598. <blockquote>
  599. Uploaded by <?php
  600. if ($Anonymous) {
  601. if (check_perms('users_mod')) { ?>
  602. <em class="tooltip"
  603. title="<?=Users::user_info($UserID)['Username']?>">Anonymous</em>
  604. <?php } else {
  605. ?><em>Anonymous</em><?php
  606. }
  607. } else {
  608. echo Users::format_username($UserID, false, false, false);
  609. } ?> <?=time_diff($TorrentTime); ?>
  610. <?php if ($Seeders === 0) {
  611. if ($LastActive && time() - strtotime($LastActive) >= 1209600) { ?>
  612. <br /><strong>Last active: <?=time_diff($LastActive); ?></strong>
  613. <?php } else { ?>
  614. <br />Last active: <?=time_diff($LastActive); ?>
  615. <?php }
  616. }
  617. if (($Seeders === 0 && $LastActive && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) || check_perms('users_mod')) { ?>
  618. <br /><a
  619. href="torrents.php?action=reseed&amp;torrentid=<?=$TorrentID?>&amp;groupid=<?=$GroupID?>"
  620. class="brackets">Request re-seed</a>
  621. <?php } ?>
  622. </blockquote>
  623. </div>
  624. <?php if (check_perms('site_moderate_requests')) { ?>
  625. <div class="linkbox">
  626. <a href="torrents.php?action=masspm&amp;id=<?=$GroupID?>&amp;torrentid=<?=$TorrentID?>"
  627. class="brackets">Mass PM snatchers</a>
  628. </div>
  629. <?php } ?>
  630. <div class="linkbox">
  631. <a href="#" class="brackets"
  632. onclick="show_peers('<?=$TorrentID?>', 0); return false;">View
  633. peer list</a>
  634. <?php if (check_perms('site_view_torrent_snatchlist')) { ?>
  635. <a href="#" class="brackets tooltip"
  636. onclick="show_downloads('<?=$TorrentID?>', 0); return false;"
  637. title="View the list of users that have clicked the &quot;DL&quot; button.">View download list</a>
  638. <a href="#" class="brackets tooltip"
  639. onclick="show_snatches('<?=$TorrentID?>', 0); return false;"
  640. title="View the list of users that have reported a snatch to the tracker.">View snatch list</a>
  641. <?php } ?>
  642. <a href="#" class="brackets"
  643. onclick="show_files('<?=$TorrentID?>'); return false;">View
  644. file list</a>
  645. <?php if ($Reported) { ?>
  646. <a href="#" class="brackets"
  647. onclick="show_reported('<?=$TorrentID?>'); return false;">View
  648. report information</a>
  649. <?php } ?>
  650. </div>
  651. <div id="peers_<?=$TorrentID?>" class="hidden"></div>
  652. <div id="downloads_<?=$TorrentID?>" class="hidden"></div>
  653. <div id="snatches_<?=$TorrentID?>" class="hidden"></div>
  654. <div id="files_<?=$TorrentID?>" class="hidden"><?=$FileTable?>
  655. </div>
  656. <?php if ($Reported) { ?>
  657. <div id="reported_<?=$TorrentID?>" class="hidden"><?=$ReportInfo?>
  658. </div>
  659. <?php
  660. }
  661. if (!empty($Description)) {
  662. echo '<blockquote class="torrent_description">'.Text::full_format($Description).'</blockquote>';
  663. }
  664. echo "\n<blockquote>"; ?>
  665. <div class="spoilerContainer hideContainer">
  666. <?php
  667. # Make a BibTeX citation
  668. # todo: Expand this and move HTTP/FTP, IPFS, Dat, etc.
  669. $EntryName = "BioTorrents.de-$TorrentID";
  670. $Today = strftime('%Y-%m-%d');
  671. # Author format handling
  672. $ArtistArray = [];
  673. foreach ($Artists as $Num => $Artist) {
  674. array_push($ArtistArray, $Artist['name']);
  675. }
  676. # Not sure if inline newlines are valid
  677. $ArtistString = (count($ArtistArray) > 3)
  678. ? implode("\n and ", $ArtistArray)
  679. : implode(' and ', $ArtistArray);
  680. # DOI number
  681. $BibtexDOI = (count($Screenshots) > 0)
  682. ? $Screenshots[0]['Image']
  683. : null;
  684. # Starting newline necessary
  685. $BibtexCitation = <<<TEX
  686. @misc{ $EntryName
  687. title = {{$GroupName}},
  688. author = {{$ArtistString}},
  689. year = {{$GroupYear}},
  690. doi = {{$BibtexDOI}},
  691. url = \href{https://biotorrents.de/torrents.php?torrentid=$TorrentID},
  692. note = {On BitTorrent; accessed $Today}
  693. }
  694. TEX;
  695. ?>
  696. <!-- todo pcs: Both tags must be on the same line -->
  697. <input type="button" class="spoilerButton" value="Show BibTeX" /><pre class="hidden">
  698. <?= $BibtexCitation ?>
  699. </pre>
  700. </div>
  701. <?php
  702. #}
  703. echo '</blockquote>';
  704. } ?>
  705. </td>
  706. </tr>
  707. <?php
  708. #}?>
  709. </table>
  710. </div>
  711. <?php
  712. $Requests = get_group_requests($GroupID);
  713. if (empty($LoggedUser['DisableRequests']) && count($Requests) > 0) {
  714. ?>
  715. <div class="box">
  716. <div class="head">
  717. <span style="font-weight: bold;">Requests (<?=number_format(count($Requests))?>)</span>
  718. <a data-toggle-target="#requests" data-toggle-replace="Hide" class="float_right brackets">Show</a>
  719. </div>
  720. <table id="requests" class="request_table hidden">
  721. <tr class="colhead">
  722. <td>Description</td>
  723. <td>Votes</td>
  724. <td>Bounty</td>
  725. </tr>
  726. <?php foreach ($Requests as $Request) {
  727. $RequestVotes = Requests::get_votes_array($Request['ID']);
  728. $RequestDesc = substr(explode('\n', Text::strip_bbcode($Request['Description']), 2)[0], 0, 70);
  729. if (strlen(explode('\n', Text::strip_bbcode($Request['Description']), 2)[0]) > 70) {
  730. $RequestDesc = substr($RequestDesc, 0, 67) . '...';
  731. } ?>
  732. <tr class="requestrows row">
  733. <td><a
  734. href="requests.php?action=view&amp;id=<?=$Request['ID']?>"><?=$RequestDesc?></a></td>
  735. <td>
  736. <span
  737. id="vote_count_<?=$Request['ID']?>"><?=count($RequestVotes['Voters'])?></span>
  738. <?php if (check_perms('site_vote')) { ?>
  739. &nbsp;&nbsp; <a
  740. href="javascript:Vote(0, <?=$Request['ID']?>)"
  741. class="brackets">+</a>
  742. <?php } ?>
  743. </td>
  744. <td><?=Format::get_size($RequestVotes['TotalBounty'])?>
  745. </td>
  746. </tr>
  747. <?php
  748. } ?>
  749. </table>
  750. </div>
  751. <?php
  752. }
  753. $Collages = $Cache->get_value("torrent_collages_$GroupID");
  754. if (!is_array($Collages)) {
  755. $DB->query("
  756. SELECT c.Name, c.NumTorrents, c.ID
  757. FROM collages AS c
  758. JOIN collages_torrents AS ct ON ct.CollageID = c.ID
  759. WHERE ct.GroupID = '$GroupID'
  760. AND Deleted = '0'
  761. AND CategoryID != '0'");
  762. $Collages = $DB->to_array();
  763. $Cache->cache_value("torrent_collages_$GroupID", $Collages, 3600 * 6);
  764. }
  765. if (count($Collages) > 0) {
  766. if (count($Collages) > MAX_COLLAGES) {
  767. // Pick some at random
  768. $Range = range(0, count($Collages) - 1);
  769. shuffle($Range);
  770. $Indices = array_slice($Range, 0, MAX_COLLAGES);
  771. $SeeAll = ' <a data-toggle-target=".collage_rows">(See all)</a>';
  772. } else {
  773. $Indices = range(0, count($Collages) - 1);
  774. $SeeAll = '';
  775. } ?>
  776. <div class="box">
  777. <table class="collage_table" id="collages">
  778. <tr class="colhead">
  779. <td width="75%"><a href="#">&uarr;</a>&nbsp;This content is in <?=number_format(count($Collages))?> collection<?=((count($Collages) > 1) ? 's' : '')?><?=$SeeAll?>
  780. </td>
  781. <td># torrents</td>
  782. </tr>
  783. <?php foreach ($Indices as $i) {
  784. list($CollageName, $CollageTorrents, $CollageID) = $Collages[$i];
  785. unset($Collages[$i]); ?>
  786. <tr>
  787. <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
  788. <td class="number_column"><?=number_format($CollageTorrents)?>
  789. </td>
  790. </tr>
  791. <?php
  792. }
  793. foreach ($Collages as $Collage) {
  794. list($CollageName, $CollageTorrents, $CollageID) = $Collage; ?>
  795. <tr class="collage_rows hidden">
  796. <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
  797. <td class="number_column"><?=number_format($CollageTorrents)?>
  798. </td>
  799. </tr>
  800. <?php
  801. } ?>
  802. </table>
  803. </div>
  804. <?php
  805. }
  806. $PersonalCollages = $Cache->get_value("torrent_collages_personal_$GroupID");
  807. if (!is_array($PersonalCollages)) {
  808. $DB->query("
  809. SELECT c.Name, c.NumTorrents, c.ID
  810. FROM collages AS c
  811. JOIN collages_torrents AS ct ON ct.CollageID = c.ID
  812. WHERE ct.GroupID = '$GroupID'
  813. AND Deleted = '0'
  814. AND CategoryID = '0'");
  815. $PersonalCollages = $DB->to_array(false, MYSQLI_NUM);
  816. $Cache->cache_value("torrent_collages_personal_$GroupID", $PersonalCollages, 3600 * 6);
  817. }
  818. if (count($PersonalCollages) > 0) {
  819. if (count($PersonalCollages) > MAX_PERS_COLLAGES) {
  820. // Pick some at random
  821. $Range = range(0, count($PersonalCollages) - 1);
  822. shuffle($Range);
  823. $Indices = array_slice($Range, 0, MAX_PERS_COLLAGES);
  824. $SeeAll = ' <a data-toggle-target=".personal_rows">(See all)</a>';
  825. } else {
  826. $Indices = range(0, count($PersonalCollages) - 1);
  827. $SeeAll = '';
  828. } ?>
  829. <table class="box collage_table" id="personal_collages">
  830. <tr class="colhead">
  831. <td width="85%"><a href="#">&uarr;</a>&nbsp;This content is in <?=number_format(count($PersonalCollages))?> personal
  832. collection<?=((count($PersonalCollages) > 1) ? 's' : '')?><?=$SeeAll?>
  833. </td>
  834. <td># torrents</td>
  835. </tr>
  836. <?php foreach ($Indices as $i) {
  837. list($CollageName, $CollageTorrents, $CollageID) = $PersonalCollages[$i];
  838. unset($PersonalCollages[$i]); ?>
  839. <tr>
  840. <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
  841. <td class="number_column"><?=number_format($CollageTorrents)?>
  842. </td>
  843. </tr>
  844. <?php
  845. }
  846. foreach ($PersonalCollages as $Collage) {
  847. list($CollageName, $CollageTorrents, $CollageID) = $Collage; ?>
  848. <tr class="personal_rows hidden">
  849. <td><a href="collages.php?id=<?=$CollageID?>"><?=$CollageName?></a></td>
  850. <td class="number_column"><?=number_format($CollageTorrents)?>
  851. </td>
  852. </tr>
  853. <?php
  854. } ?>
  855. </table>
  856. <?php
  857. }
  858. ?>
  859. <!-- Torrent group description -->
  860. <div class="box torrent_description">
  861. <div class="head"><a href="#">&uarr;</a>&nbsp;<strong><?=(!empty($ReleaseType) ? $ReleaseTypes[$ReleaseType].' info' : 'Info')?></strong>
  862. </div>
  863. <div class="body"><?php if ($WikiBody != '') {
  864. echo $WikiBody;
  865. } else {
  866. echo 'There is no information on this torrent.';
  867. } ?>
  868. </div>
  869. </div>
  870. <!-- Mirrors -->
  871. <div class="box torrent_mirrors_box <?php if (!count($Mirrors)) {
  872. echo 'dead';
  873. } ?>">
  874. <div class="head"><a href="#">&uarr;</a>&nbsp;<strong>
  875. Mirrors (<?= count($Mirrors) ?>)</strong>
  876. <?php
  877. if (count($Mirrors) > 0) {
  878. ?>
  879. <a class="float_right brackets" data-toggle-target=".torrent_mirrors" data-toggle-replace="Show">Hide</a>
  880. <?php
  881. }
  882. $DB->query("
  883. SELECT UserID
  884. FROM torrents
  885. WHERE GroupID = $GroupID");
  886. if (in_array($LoggedUser['ID'], $DB->collect('UserID')) || check_perms('torrents_edit') || check_perms('screenshots_add') || check_perms('screenshots_delete')) {
  887. ?>
  888. <a class="brackets"
  889. href="torrents.php?action=editgroup&groupid=<?=$GroupID?>#mirrors_section">Add/Remove</a>
  890. <?php
  891. }
  892. ?>
  893. </div>
  894. <div class="body torrent_mirrors">
  895. <?php if (!empty($Mirrors)) {
  896. echo '<p>Mirror links open in a new tab.</p>';
  897. } ?>
  898. <ul>
  899. <?php
  900. foreach ($Mirrors as $Mirror) {
  901. echo '<li><a href="'.$Mirror['Resource'].'" target="_blank">'.$Mirror['Resource'].'</a></li>';
  902. }
  903. ?>
  904. </ul>
  905. </div>
  906. </div>
  907. <!-- Screenshots (Publications) -->
  908. <div class="box torrent_screenshots_box <?php if (!count($Screenshots)) {
  909. echo 'dead';
  910. } ?>">
  911. <div class="head"><a href="#">&uarr;</a>&nbsp;<strong>
  912. Publications (<?= count($Screenshots) ?>)</strong>
  913. <?php
  914. if (count($Screenshots) > 0) {
  915. ?>
  916. <a class="float_right brackets" data-toggle-target=".torrent_screenshots" data-toggle-replace="Show">Hide</a>
  917. <?php
  918. }
  919. $DB->query("
  920. SELECT UserID
  921. FROM torrents
  922. WHERE GroupID = $GroupID");
  923. if (in_array($LoggedUser['ID'], $DB->collect('UserID')) || check_perms('torrents_edit') || check_perms('screenshots_add') || check_perms('screenshots_delete')) {
  924. ?>
  925. <a class="brackets"
  926. href="torrents.php?action=editgroup&groupid=<?=$GroupID?>#screenshots_section">Add/Remove</a>
  927. <?php
  928. }
  929. ?>
  930. </div>
  931. <div class="body torrent_screenshots">
  932. <?php if (!empty($Screenshots)) {
  933. echo '<p>Sci-Hub links open in a new tab.</p>';
  934. } ?>
  935. <ul>
  936. <?php
  937. foreach ($Screenshots as $Screenshot) {
  938. echo '<li><a href="https://sci-hub.'.SCI_HUB.'/'.$Screenshot['Image'].'" target="_blank">'.$Screenshot['Image'].'</a></li>';
  939. /* Image proxy integration
  940. $SSURL = ImageTools::process($Screenshot['Image']);
  941. $ThumbURL = ImageTools::process($Screenshot['Image'], 'thumb');
  942. */
  943. /* todo: Bring this back
  944. if (check_perms('users_mod')) {
  945. ?><img class='tooltip lightbox-init' title='<?=Users::format_username($Screenshot['UserID'], false, false, false)?> - <?=time_diff($Screenshot['Time'])?>' lightbox-img="<?=$SSURL?>" src="<?=$ThumbURL?>" /><?
  946. } else {
  947. ?><img class='tooltip lightbox-init' title='Added <?=time_diff($Screenshot['Time'])?>' lightbox-img="<?=$SSURL?>" src="<?=$ThumbURL?>" /><?
  948. }
  949. */
  950. }
  951. ?>
  952. </ul>
  953. </div>
  954. <script>
  955. try {
  956. $('.torrent_screenshots>img').last().raw().style.width = ($('.torrent_screenshots>img').length % 2 + 1) * 50 +
  957. '%'
  958. } catch (e) {}
  959. </script>
  960. </div>
  961. <?php
  962. // --- Comments ---
  963. $Pages = Format::get_pages($Page, $NumComments, TORRENT_COMMENTS_PER_PAGE, 9, '#comments');
  964. ?>
  965. <div id="torrent_comments">
  966. <div class="linkbox"><a name="comments"></a>
  967. <?=$Pages?>
  968. </div>
  969. <?php
  970. CommentsView::render_comments($Thread, $LastRead, "torrents.php?id=$GroupID");
  971. ?>
  972. <div class="linkbox">
  973. <?=$Pages?>
  974. </div>
  975. <?php
  976. View::parse('generic/reply/quickreply.php', array(
  977. 'InputName' => 'pageid',
  978. 'InputID' => $GroupID,
  979. 'Action' => 'comments.php?page=torrents',
  980. 'InputAction' => 'take_post',
  981. 'TextareaCols' => 65,
  982. 'SubscribeBox' => true
  983. ));
  984. ?>
  985. </div>
  986. </div>
  987. </div>
  988. <?php View::show_footer();