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

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