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.

requests.php 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. <?php
  2. #declare(strict_types=1);
  3. $SphQL = new SphinxqlQuery();
  4. $SphQL->select('id, votes, bounty')->from('requests, requests_delta');
  5. $SortOrders = [
  6. 'votes' => 'votes',
  7. 'bounty' => 'bounty',
  8. 'lastvote' => 'lastvote',
  9. 'filled' => 'timefilled',
  10. 'created' => 'timeadded',
  11. 'random' => false
  12. ];
  13. if (empty($_GET['order']) || !isset($SortOrders[$_GET['order']])) {
  14. $_GET['order'] = 'created';
  15. }
  16. $OrderBy = $_GET['order'];
  17. if (!empty($_GET['sort']) && $_GET['sort'] === 'asc') {
  18. $OrderWay = 'asc';
  19. } else {
  20. $_GET['sort'] = 'desc';
  21. $OrderWay = 'desc';
  22. }
  23. $NewSort = $_GET['sort'] === 'asc' ? 'desc' : 'asc';
  24. if ($OrderBy === 'random') {
  25. $SphQL->order_by('RAND()', '');
  26. unset($_GET['page']);
  27. } else {
  28. $SphQL->order_by($SortOrders[$OrderBy], $OrderWay);
  29. }
  30. $Submitted = !empty($_GET['submit']);
  31. // Paranoia
  32. if (!empty($_GET['userid'])) {
  33. if (!is_number($_GET['userid'])) {
  34. error('User ID must be an integer');
  35. }
  36. $UserInfo = Users::user_info($_GET['userid']);
  37. if (empty($UserInfo)) {
  38. error('That user does not exist');
  39. }
  40. $Perms = Permissions::get_permissions($UserInfo['PermissionID']);
  41. $UserClass = $Perms['Class'];
  42. }
  43. $BookmarkView = false;
  44. if (empty($_GET['type'])) {
  45. $Title = 'Requests';
  46. if (empty($_GET['showall'])) {
  47. $SphQL->where('visible', 1);
  48. }
  49. } else {
  50. switch ($_GET['type']) {
  51. case 'created':
  52. if (!empty($UserInfo)) {
  53. if (!check_paranoia('requestsvoted_list', $UserInfo['Paranoia'], $Perms['Class'], $UserInfo['ID'])) {
  54. error(403);
  55. }
  56. $Title = "Requests created by $UserInfo[Username]";
  57. $SphQL->where('userid', $UserInfo['ID']);
  58. } else {
  59. $Title = 'My requests';
  60. $SphQL->where('userid', $LoggedUser['ID']);
  61. }
  62. break;
  63. case 'voted':
  64. if (!empty($UserInfo)) {
  65. if (!check_paranoia('requestsvoted_list', $UserInfo['Paranoia'], $Perms['Class'], $UserInfo['ID'])) {
  66. error(403);
  67. }
  68. $Title = "Requests voted for by $UserInfo[Username]";
  69. $SphQL->where('voter', $UserInfo['ID']);
  70. } else {
  71. $Title = 'Requests I have voted on';
  72. $SphQL->where('voter', $LoggedUser['ID']);
  73. }
  74. break;
  75. case 'filled':
  76. if (!empty($UserInfo)) {
  77. if (!check_paranoia('requestsfilled_list', $UserInfo['Paranoia'], $Perms['Class'], $UserInfo['ID'])) {
  78. error(403);
  79. }
  80. $Title = "Requests filled by $UserInfo[Username]";
  81. $SphQL->where('fillerid', $UserInfo['ID']);
  82. } else {
  83. $Title = 'Requests I have filled';
  84. $SphQL->where('fillerid', $LoggedUser['ID']);
  85. }
  86. break;
  87. case 'bookmarks':
  88. $Title = 'Your bookmarked requests';
  89. $BookmarkView = true;
  90. $SphQL->where('bookmarker', $LoggedUser['ID']);
  91. break;
  92. default:
  93. error(404);
  94. }
  95. }
  96. if ($Submitted && empty($_GET['show_filled'])) {
  97. $SphQL->where('torrentid', 0);
  98. }
  99. if (!empty($_GET['formats'])) {
  100. $FormatArray = $_GET['formats'];
  101. if (count($FormatArray) !== count($Formats)) {
  102. $FormatNameArray = [];
  103. foreach ($FormatArray as $Index => $MasterIndex) {
  104. if (isset($Formats[$MasterIndex])) {
  105. $FormatNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Formats[$MasterIndex]), '-.', ' ') . '"';
  106. }
  107. }
  108. if (count($FormatNameArray) >= 1) {
  109. if (!empty($_GET['formats_strict'])) {
  110. $SearchString = '(' . implode(' | ', $FormatNameArray) . ')';
  111. } else {
  112. $SearchString = '(any | ' . implode(' | ', $FormatNameArray) . ')';
  113. }
  114. $SphQL->where_match($SearchString, 'formatlist', false);
  115. }
  116. }
  117. }
  118. if (!empty($_GET['media'])) {
  119. $MediaArray = $_GET['media'];
  120. if (count($MediaArray) !== count($Media)) {
  121. $MediaNameArray = [];
  122. foreach ($MediaArray as $Index => $MasterIndex) {
  123. if (isset($Media[$MasterIndex])) {
  124. $MediaNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Media[$MasterIndex]), '-.', ' ') . '"';
  125. }
  126. }
  127. if (count($MediaNameArray) >= 1) {
  128. if (!empty($_GET['media_strict'])) {
  129. $SearchString = '(' . implode(' | ', $MediaNameArray) . ')';
  130. } else {
  131. $SearchString = '(any | ' . implode(' | ', $MediaNameArray) . ')';
  132. }
  133. $SphQL->where_match($SearchString, 'medialist', false);
  134. }
  135. }
  136. }
  137. if (!empty($_GET['bitrates'])) {
  138. $BitrateArray = $_GET['bitrates'];
  139. if (count($BitrateArray) !== count($Bitrates)) {
  140. $BitrateNameArray = [];
  141. foreach ($BitrateArray as $Index => $MasterIndex) {
  142. if (isset($Bitrates[$MasterIndex])) {
  143. $BitrateNameArray[$Index] = '"' . strtr(Sphinxql::sph_escape_string($Bitrates[$MasterIndex]), '-.', ' ') . '"';
  144. }
  145. }
  146. if (count($BitrateNameArray) >= 1) {
  147. if (!empty($_GET['bitrate_strict'])) {
  148. $SearchString = '(' . implode(' | ', $BitrateNameArray) . ')';
  149. } else {
  150. $SearchString = '(any | ' . implode(' | ', $BitrateNameArray) . ')';
  151. }
  152. $SphQL->where_match($SearchString, 'bitratelist', false);
  153. }
  154. }
  155. }
  156. if (!empty($_GET['search'])) {
  157. $SearchString = trim($_GET['search']);
  158. if ($SearchString !== '') {
  159. $SearchWords = array('include' => [], 'exclude' => []);
  160. $Words = explode(' ', $SearchString);
  161. foreach ($Words as $Word) {
  162. $Word = trim($Word);
  163. // Skip isolated hyphens to enable "Artist - Title" searches
  164. if ($Word === '-') {
  165. continue;
  166. }
  167. if ($Word[0] === '!' && strlen($Word) >= 2) {
  168. if (strpos($Word, '!', 1) === false) {
  169. $SearchWords['exclude'][] = $Word;
  170. } else {
  171. $SearchWords['include'][] = $Word;
  172. }
  173. } elseif ($Word !== '') {
  174. $SearchWords['include'][] = $Word;
  175. }
  176. }
  177. }
  178. }
  179. if (!isset($_GET['tags_type']) || $_GET['tags_type'] === '1') {
  180. $TagType = 1;
  181. $_GET['tags_type'] = '1';
  182. } else {
  183. $TagType = 0;
  184. $_GET['tags_type'] = '0';
  185. }
  186. if (!empty($_GET['tags'])) {
  187. $SearchTags = array('include' => [], 'exclude' => []);
  188. $Tags = explode(',', str_replace('.', '_', $_GET['tags']));
  189. foreach ($Tags as $Tag) {
  190. $Tag = trim($Tag);
  191. if ($Tag[0] === '!' && strlen($Tag) >= 2) {
  192. if (strpos($Tag, '!', 1) === false) {
  193. $SearchTags['exclude'][] = $Tag;
  194. } else {
  195. $SearchTags['include'][] = $Tag;
  196. }
  197. } elseif ($Tag !== '') {
  198. $SearchTags['include'][] = $Tag;
  199. }
  200. }
  201. $TagFilter = Tags::tag_filter_sph($SearchTags, $TagType);
  202. $TagNames = $TagFilter['input'];
  203. if (!empty($TagFilter['predicate'])) {
  204. $SphQL->where_match($TagFilter['predicate'], 'taglist', false);
  205. }
  206. } elseif (!isset($_GET['tags_type']) || $_GET['tags_type'] !== '0') {
  207. $_GET['tags_type'] = 1;
  208. } else {
  209. $_GET['tags_type'] = 0;
  210. }
  211. if (isset($SearchWords)) {
  212. $QueryParts = [];
  213. foreach ($SearchWords['include'] as $Word) {
  214. $QueryParts[] = Sphinxql::sph_escape_string($Word);
  215. }
  216. if (!empty($SearchWords['exclude'])) {
  217. foreach ($SearchWords['exclude'] as $Word) {
  218. $QueryParts[] = '!' . Sphinxql::sph_escape_string(substr($Word, 1));
  219. }
  220. }
  221. if (!empty($QueryParts)) {
  222. $SearchString = implode(' ', $QueryParts);
  223. $SphQL->where_match($SearchString, '*', false);
  224. }
  225. }
  226. if (!empty($_GET['filter_cat'])) {
  227. $CategoryArray = array_keys($_GET['filter_cat']);
  228. if (count($CategoryArray) !== count($Categories)) {
  229. foreach ($CategoryArray as $Key => $Index) {
  230. if (!isset($Categories[$Index - 1])) {
  231. unset($CategoryArray[$Key]);
  232. }
  233. }
  234. if (count($CategoryArray) >= 1) {
  235. $SphQL->where('categoryid', $CategoryArray);
  236. }
  237. }
  238. }
  239. if (!empty($_GET['releases'])) {
  240. $ReleaseArray = $_GET['releases'];
  241. if (count($ReleaseArray) !== count($ReleaseTypes)) {
  242. foreach ($ReleaseArray as $Index => $Value) {
  243. if (!isset($ReleaseTypes[$Value])) {
  244. unset($ReleaseArray[$Index]);
  245. }
  246. }
  247. if (count($ReleaseArray) >= 1) {
  248. $SphQL->where('releasetype', $ReleaseArray);
  249. }
  250. }
  251. }
  252. if (!empty($_GET['requestor'])) {
  253. if (is_number($_GET['requestor'])) {
  254. $SphQL->where('userid', $_GET['requestor']);
  255. } else {
  256. error(404);
  257. }
  258. }
  259. if (isset($_GET['year'])) {
  260. if (is_number($_GET['year']) || $_GET['year'] === '0') {
  261. $SphQL->where('year', $_GET['year']);
  262. } else {
  263. error(404);
  264. }
  265. }
  266. if (!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
  267. $Page = $_GET['page'];
  268. $Offset = ($Page - 1) * REQUESTS_PER_PAGE;
  269. $SphQL->limit($Offset, REQUESTS_PER_PAGE, $Offset + REQUESTS_PER_PAGE);
  270. } else {
  271. $Page = 1;
  272. $SphQL->limit(0, REQUESTS_PER_PAGE, REQUESTS_PER_PAGE);
  273. }
  274. $SphQLResult = $SphQL->query();
  275. $NumResults = (int)$SphQLResult->get_meta('total_found');
  276. if ($NumResults > 0) {
  277. $SphRequests = $SphQLResult->to_array('id');
  278. if ($OrderBy === 'random') {
  279. $NumResults = count($SphRequests);
  280. }
  281. if ($NumResults > REQUESTS_PER_PAGE) {
  282. if (($Page - 1) * REQUESTS_PER_PAGE > $NumResults) {
  283. $Page = 0;
  284. }
  285. $PageLinks = Format::get_pages($Page, $NumResults, REQUESTS_PER_PAGE);
  286. }
  287. }
  288. $CurrentURL = Format::get_url(array('order', 'sort', 'page'));
  289. View::show_header($Title, 'requests');
  290. ?>
  291. <div>
  292. <div class="header">
  293. <h2><?=$Title?>
  294. </h2>
  295. </div>
  296. <div class="linkbox">
  297. <?php if (!$BookmarkView) {
  298. if (check_perms('site_submit_requests')) { ?>
  299. <a href="requests.php?action=new" class="brackets">New request</a>
  300. <a href="requests.php?type=created" class="brackets">My requests</a>
  301. <?php }
  302. if (check_perms('site_vote')) { ?>
  303. <a href="requests.php?type=voted" class="brackets">Requests I've voted on</a>
  304. <?php } ?>
  305. <a href="bookmarks.php?type=requests" class="brackets">Bookmarked requests</a>
  306. <?php
  307. } else { ?>
  308. <a href="bookmarks.php?type=torrents" class="brackets">Torrents</a>
  309. <a href="bookmarks.php?type=artists" class="brackets">Artists</a>
  310. <a href="bookmarks.php?type=collages" class="brackets">Collections</a>
  311. <a href="bookmarks.php?type=requests" class="brackets">Requests</a>
  312. <?php } ?>
  313. </div>
  314. <?php if ($BookmarkView && $NumResults === 0) { ?>
  315. <div class="box pad" align="center">
  316. <h2>You have not bookmarked any requests.</h2>
  317. </div>
  318. <?php } else { ?>
  319. <form class="search_form" name="requests" action="" method="get">
  320. <?php if ($BookmarkView) { ?>
  321. <input type="hidden" name="action" value="view" />
  322. <input type="hidden" name="type" value="requests" />
  323. <?php } elseif (isset($_GET['type'])) { ?>
  324. <input type="hidden" name="type"
  325. value="<?=$_GET['type']?>" />
  326. <?php } ?>
  327. <input type="hidden" name="submit" value="true" />
  328. <?php if (!empty($_GET['userid']) && is_number($_GET['userid'])) { ?>
  329. <input type="hidden" name="userid"
  330. value="<?=$_GET['userid']?>" />
  331. <?php } ?>
  332. <div class="box pad">
  333. <table cellpadding="6" cellspacing="1" border="0" class="layout torrent_requests" width="100%">
  334. <tr id="search_terms">
  335. <td class="label">
  336. <!--Search Terms-->
  337. </td>
  338. <td>
  339. <input type="search" name="search" size="60" class="inputtext" placeholder="Search Terms" value="<?php if (isset($_GET['search'])) {
  340. echo display_str($_GET['search']);
  341. } ?>" />
  342. </td>
  343. </tr>
  344. <tr id="tagfilter">
  345. <td class="label">
  346. <!--Tags (comma-separated)-->
  347. </td>
  348. <td>
  349. <input type="search" name="tags" id="tags" size="50" class="inputtext"
  350. placeholder="Tags (comma-separated)"
  351. value="<?=!empty($TagNames) ? display_str($TagNames) : ''?>"
  352. <?php Users::has_autocomplete_enabled('other'); ?>
  353. />&nbsp;
  354. <input type="radio" name="tags_type" id="tags_type0" value="0" <?php Format::selected('tags_type', 0, 'checked')?>
  355. /><label for="tags_type0"> Any</label>&nbsp;&nbsp;
  356. <input type="radio" name="tags_type" id="tags_type1" value="1" <?php Format::selected('tags_type', 1, 'checked')?>
  357. /><label for="tags_type1"> All</label>
  358. </td>
  359. </tr>
  360. <?php /*
  361. <tr>
  362. <td class="label"><!-- Requested By --></td>
  363. <td>
  364. <input type="search" name="requester" size="60" class="inputtext" placeholder="Requested By" value="<?=display_str($_GET['requester'])?>" />
  365. </td>
  366. </tr>
  367. */ ?>
  368. <tr id="include_filled">
  369. <td class="label"><label for="include_filled_box">Include Filled</label></td>
  370. <td>
  371. <input type="checkbox" id="include_filled_box" name="show_filled" <?php if (!$Submitted || !empty($_GET['show_filled']) || (!$Submitted && !empty($_GET['type']) && $_GET['type'] === 'filled')) { ?>
  372. checked="checked"<?php } ?> />
  373. </td>
  374. </tr>
  375. <tr id="include_old">
  376. <td class="label"><label for="include_old_box">Include Old</label></td>
  377. <td>
  378. <input type="checkbox" id="include_old_box" name="showall" <?php if (!empty($_GET['showall'])) { ?>
  379. checked="checked"<?php } ?> />
  380. </td>
  381. </tr>
  382. </table>
  383. <table class="layout cat_list">
  384. <?php
  385. $x = 1;
  386. reset($Categories);
  387. foreach ($Categories as $CatKey => $CatName) {
  388. if ($x % 8 === 0 || $x === 1) {
  389. ?>
  390. <tr>
  391. <?php
  392. } ?>
  393. <td>
  394. <input type="checkbox"
  395. name="filter_cat[<?=($CatKey + 1) ?>]"
  396. id="cat_<?=($CatKey + 1) ?>" value="1"
  397. <?php if (isset($_GET['filter_cat'][$CatKey + 1])) { ?>
  398. checked="checked"<?php } ?> />
  399. <label for="cat_<?=($CatKey + 1) ?>"><?=$CatName?></label>
  400. </td>
  401. <?php if ($x % 7 === 0) { ?>
  402. </tr>
  403. <?php
  404. }
  405. $x++;
  406. }
  407. ?>
  408. </table>
  409. <table class="layout">
  410. <tr>
  411. <td colspan="2" class="center">
  412. <input type="submit" value="Search" />
  413. </td>
  414. </tr>
  415. </table>
  416. </div>
  417. </form>
  418. <?php if (isset($PageLinks)) { ?>
  419. <div class="linkbox">
  420. <?= $PageLinks?>
  421. </div>
  422. <?php } ?>
  423. <table id="request_table" class="request_table border" cellpadding="6" cellspacing="1" border="0" width="100%">
  424. <tr class="colhead_dark">
  425. <th class="small cats_col"></th>
  426. <th style="width: 38%;" class="nobr">
  427. <strong>Request Name</strong>
  428. </th>
  429. <th class="nobr">
  430. <a
  431. href="?order=votes&amp;sort=<?=($OrderBy === 'votes' ? $NewSort : 'desc')?>&amp;<?=$CurrentURL?>"><strong>Votes</strong></a>
  432. </th>
  433. <th class="nobr">
  434. <a
  435. href="?order=bounty&amp;sort=<?=($OrderBy === 'bounty' ? $NewSort : 'desc')?>&amp;<?=$CurrentURL?>"><strong>Bounty</strong></a>
  436. </th>
  437. <th class="nobr">
  438. <a
  439. href="?order=filled&amp;sort=<?=($OrderBy === 'filled' ? $NewSort : 'desc')?>&amp;<?=$CurrentURL?>"><strong>Filled</strong></a>
  440. </th>
  441. <th class="nobr">
  442. <strong>Filled by</strong>
  443. </th>
  444. <th class="nobr">
  445. <strong>Requested by</strong>
  446. </th>
  447. <th class="nobr">
  448. <a
  449. href="?order=created&amp;sort=<?=($OrderBy === 'created' ? $NewSort : 'desc')?>&amp;<?=$CurrentURL?>"><strong>Created</strong></a>
  450. </th>
  451. <th class="nobr">
  452. <a
  453. href="?order=lastvote&amp;sort=<?=($OrderBy === 'lastvote' ? $NewSort : 'desc')?>&amp;<?=$CurrentURL?>"><strong>Last
  454. vote</strong></a>
  455. </th>
  456. </tr>
  457. <?php
  458. if ($NumResults === 0) {
  459. // not viewing bookmarks but no requests found
  460. ?>
  461. <tr class="row">
  462. <td colspan="8">
  463. Nothing found!
  464. </td>
  465. </tr>
  466. <?php
  467. } elseif ($Page === 0) { ?>
  468. <tr class="row">
  469. <td colspan="8">
  470. The requested page contains no matches!
  471. </td>
  472. </tr>
  473. <?php
  474. } else {
  475. $TimeCompare = 1267643718; // Requests v2 was implemented 2010-03-03 20:15:18
  476. $Requests = Requests::get_requests(array_keys($SphRequests));
  477. foreach ($Requests as $RequestID => $Request) {
  478. $SphRequest = $SphRequests[$RequestID];
  479. $Bounty = $SphRequest['bounty'] * 1024; // Sphinx stores bounty in kB
  480. $VoteCount = $SphRequest['votes'];
  481. if ($Request['CategoryID'] === 0) {
  482. $CategoryName = 'Unknown';
  483. } else {
  484. $CategoryName = $Categories[$Request['CategoryID'] - 1];
  485. }
  486. if ($Request['TorrentID'] !== 0) {
  487. $IsFilled = true;
  488. $FillerInfo = Users::user_info($Request['FillerID']);
  489. } else {
  490. $IsFilled = false;
  491. }
  492. $Title = empty($Request['Title']) ? (empty($Request['Title2']) ? $Request['TitleJP'] : $Request['Title2']) : $Request['Title'];
  493. $ArtistForm = Requests::get_artists($RequestID);
  494. $ArtistLink = Artists::display_artists($ArtistForm, true, true);
  495. $FullName = "<a class='torrent_title' href='requests.php?action=view&amp;id=$RequestID'><span ";
  496. if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
  497. $FullName .= 'data-cover="'.ImageTools::process($Request['Image']).'" ';
  498. }
  499. $FullName .= "dir='ltr'>$Title</span></a>";
  500. $FullName .= "<br />$ArtistLink";
  501. $ExtraInfo = '';
  502. if (!empty($Request['CatalogueNumber'])) {
  503. $Label = '<br />🔑&nbsp;';
  504. $ExtraInfo .= $Label.$Request['CatalogueNumber'];
  505. }
  506. if ($ExtraInfo) {
  507. $FullName .= " $ExtraInfo";
  508. }
  509. $Tags = $Request['Tags']; ?>
  510. <tr class="request">
  511. <td class="center cats_col">
  512. <div title="<?=Format::pretty_category($Request['CategoryID'])?>"
  513. class="tooltip <?=Format::css_category($Request['CategoryID'])?>">
  514. </div>
  515. </td>
  516. <td>
  517. <div id="request_name">
  518. <?=$FullName?>
  519. </div>
  520. <div class="tags">
  521. <?php
  522. $TagList = [];
  523. foreach ($Request['Tags'] as $TagID => $TagName) {
  524. $Split = Tags::get_name_and_class($TagName);
  525. $TagList[] = '<a class="'.$Split['class'].'" href="?tags='.$TagName.($BookmarkView ? '&amp;type=requests' : '').'">'.display_str($Split['name']).'</a>';
  526. }
  527. $TagList = implode(', ', $TagList); ?>
  528. <?=$TagList?>
  529. </div>
  530. </td>
  531. <td class="nobr">
  532. <span id="vote_count_<?=$RequestID?>"><?=number_format($VoteCount)?></span>
  533. <?php if (!$IsFilled && check_perms('site_vote')) { ?>
  534. &nbsp;&nbsp; <a
  535. href="javascript:Vote(0, <?=$RequestID?>)"
  536. class="brackets"><strong>+</strong></a>
  537. <?php } ?>
  538. </td>
  539. <td class="number_column nobr">
  540. <?=Format::get_size($Bounty)?>
  541. </td>
  542. <td class="nobr">
  543. <?php if ($IsFilled) { ?>
  544. <a
  545. href="torrents.php?<?=(strtotime($Request['TimeFilled']) < $TimeCompare ? 'id=' : 'torrentid=') . $Request['TorrentID']?>"><strong><?=time_diff($Request['TimeFilled'], 1)?></strong></a>
  546. <?php } else { ?>
  547. <strong>No</strong>
  548. <?php } ?>
  549. </td>
  550. <td>
  551. <?php if ($IsFilled) {
  552. if ($Request['AnonymousFill']) { ?>
  553. <em>Anonymous</em>
  554. <?php } else { ?>
  555. <a
  556. href="user.php?id=<?=$FillerInfo['ID']?>"><?=$FillerInfo['Username']?></a>
  557. <?php }
  558. } else { ?>
  559. &ndash;
  560. <?php } ?>
  561. </td>
  562. <td>
  563. <a
  564. href="user.php?id=<?=$Request['UserID']?>"><?=Users::format_username($Request['UserID'], false, false, false)?></a>
  565. </td>
  566. <td class="nobr">
  567. <?=time_diff($Request['TimeAdded'], 1)?>
  568. </td>
  569. <td class="nobr">
  570. <?=time_diff($Request['LastVote'], 1)?>
  571. </td>
  572. </tr>
  573. <?php
  574. } // foreach
  575. } // else
  576. } // if ($BookmarkView && $NumResults < 1)
  577. ?>
  578. </table>
  579. <?php if (isset($PageLinks)) { ?>
  580. <div class="linkbox">
  581. <?=$PageLinks?>
  582. </div>
  583. <?php } ?>
  584. </div>
  585. <?php View::show_footer();