Oppaitime'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 19KB

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