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

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