mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 20:21:37 +00:00
Empty commit
This commit is contained in:
parent
bf1cd3d12f
commit
da3ab149ca
@ -68,7 +68,7 @@ function search($Query='', $CachePrefix='', $CacheLength=0, $ReturnData=array(),
|
||||
send_irc('PRIVMSG '.LAB_CHAN.' :Search for "'.$Query.'" ('.str_replace("\n",'',print_r($this->Filters, true)).') failed: '.$this->GetLastError());
|
||||
}
|
||||
|
||||
$this->TotalResults = $Result['total'];
|
||||
$this->TotalResults = $Result['total_found'];
|
||||
$this->SearchTime = $Result['time'];
|
||||
|
||||
if(empty($Result['matches'])) {
|
||||
@ -136,11 +136,10 @@ function search($Query='', $CachePrefix='', $CacheLength=0, $ReturnData=array(),
|
||||
return $Matches;
|
||||
}
|
||||
|
||||
function limit($Start, $Length, $MaxMatches=SPHINX_MATCHES_START) {
|
||||
if(check_perms('site_search_many') && empty($_GET['limit_matches'])) {
|
||||
$MaxMatches = 500000;
|
||||
}
|
||||
$this->SetLimits((int)$Start, (int)$Length, $MaxMatches, 0);
|
||||
function limit($Start, $Length) {
|
||||
$Start = (int)$Start;
|
||||
$Length = (int)$Length;
|
||||
$this->SetLimits($Start, $Length, $Start+$Length);
|
||||
}
|
||||
|
||||
|
||||
|
@ -922,74 +922,83 @@ function get_pages($StartPage,$TotalRecords,$ItemsPerPage,$ShowPages=11,$Anchor=
|
||||
$ShowPages: The number of page links that are shown.
|
||||
eg. If there are 20 pages that exist, but $ShowPages is only 11, only 11 links will be shown.
|
||||
//----------------------------------------------------------------------------*/
|
||||
$StartPage=ceil($StartPage);
|
||||
if ($StartPage==0) { $StartPage=1; }
|
||||
$StartPage = ceil($StartPage);
|
||||
$TotalPages = 0;
|
||||
if ($TotalRecords>0) {
|
||||
if ($StartPage>ceil($TotalRecords/$ItemsPerPage)) { $StartPage=ceil($TotalRecords/$ItemsPerPage); }
|
||||
if ($TotalRecords > 0) {
|
||||
$StartPage = min($StartPage, ceil($TotalRecords/$ItemsPerPage));
|
||||
|
||||
$ShowPages--;
|
||||
$TotalPages=ceil($TotalRecords/$ItemsPerPage);
|
||||
$TotalPages = ceil($TotalRecords/$ItemsPerPage);
|
||||
|
||||
if ($TotalPages>$ShowPages) {
|
||||
$StartPosition=$StartPage-round($ShowPages/2);
|
||||
if ($TotalPages > $ShowPages) {
|
||||
$StartPosition = $StartPage-round($ShowPages/2);
|
||||
|
||||
if ($StartPosition<=0) {
|
||||
$StartPosition=1;
|
||||
if ($StartPosition <= 0) {
|
||||
$StartPosition = 1;
|
||||
} else {
|
||||
if ($StartPosition>=($TotalPages-$ShowPages)) {
|
||||
$StartPosition=$TotalPages-$ShowPages;
|
||||
if ($StartPosition >= ($TotalPages-$ShowPages)) {
|
||||
$StartPosition = $TotalPages-$ShowPages;
|
||||
}
|
||||
}
|
||||
|
||||
$StopPage=$ShowPages+$StartPosition;
|
||||
$StopPage = $ShowPages+$StartPosition;
|
||||
|
||||
} else {
|
||||
$StopPage=$TotalPages;
|
||||
$StartPosition=1;
|
||||
$StopPage = $TotalPages;
|
||||
$StartPosition = 1;
|
||||
}
|
||||
|
||||
if ($StartPosition<1) { $StartPosition=1; }
|
||||
$StartPosition = max($StartPosition, 1);
|
||||
|
||||
$QueryString = get_url(array('page','post'));
|
||||
if($QueryString != '') { $QueryString = '&'.$QueryString; }
|
||||
|
||||
if ($QueryString != '') {
|
||||
$QueryString = '&'.$QueryString;
|
||||
}
|
||||
|
||||
$Pages = '';
|
||||
|
||||
if ($StartPage>1) {
|
||||
$Pages.='<a href="'.$Location.'?page=1'.$QueryString.$Anchor.'"><strong><< First</strong></a> ';
|
||||
$Pages.='<a href="'.$Location.'?page='.($StartPage-1).$QueryString.$Anchor.'" class="pager_prev"><strong>< Prev</strong></a> | ';
|
||||
if ($StartPage > 1) {
|
||||
$Pages .= '<a href="'.$Location.'?page=1'.$QueryString.$Anchor.'"><strong><< First</strong></a> ';
|
||||
$Pages .= '<a href="'.$Location.'?page='.($StartPage-1).$QueryString.$Anchor.'" class="pager_prev"><strong>< Prev</strong></a> | ';
|
||||
}
|
||||
//End change
|
||||
|
||||
if (!$Mobile) {
|
||||
for ($i=$StartPosition; $i<=$StopPage; $i++) {
|
||||
for ($i = $StartPosition; $i <= $StopPage; $i++) {
|
||||
//if ($i!=$StartPage) { $Pages.='<a href="'.$Location.'?page='.$i.$QueryString.'">'; }
|
||||
if ($i!=$StartPage) { $Pages.='<a href="'.$Location.'?page='.$i.$QueryString.$Anchor.'">'; }
|
||||
$Pages.="<strong>";
|
||||
if($i*$ItemsPerPage>$TotalRecords) {
|
||||
$Pages.=((($i-1)*$ItemsPerPage)+1).'-'.($TotalRecords);
|
||||
if ($i != $StartPage) {
|
||||
$Pages .= '<a href="'.$Location.'?page='.$i.$QueryString.$Anchor.'">';
|
||||
}
|
||||
$Pages .= "<strong>";
|
||||
if($i*$ItemsPerPage > $TotalRecords) {
|
||||
$Pages .= ((($i-1)*$ItemsPerPage)+1).'-'.($TotalRecords);
|
||||
} else {
|
||||
$Pages.=((($i-1)*$ItemsPerPage)+1).'-'.($i*$ItemsPerPage);
|
||||
$Pages .= ((($i-1)*$ItemsPerPage)+1).'-'.($i*$ItemsPerPage);
|
||||
}
|
||||
|
||||
$Pages.="</strong>";
|
||||
if ($i!=$StartPage) { $Pages.='</a>'; }
|
||||
if ($i<$StopPage) { $Pages.=" | "; }
|
||||
$Pages .= "</strong>";
|
||||
if ($i != $StartPage) {
|
||||
$Pages.='</a>';
|
||||
}
|
||||
if ($i < $StopPage) {
|
||||
$Pages.=" | ";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$Pages .= $StartPage;
|
||||
}
|
||||
|
||||
if ($StartPage<$TotalPages) {
|
||||
$Pages.=' | <a href="'.$Location.'?page='.($StartPage+1).$QueryString.$Anchor.'" class="pager_next"><strong>Next ></strong></a> ';
|
||||
$Pages.='<a href="'.$Location.'?page='.$TotalPages.$QueryString.$Anchor.'"><strong> Last >></strong></a>';
|
||||
if ($StartPage && $StartPage < $TotalPages) {
|
||||
$Pages .= ' | <a href="'.$Location.'?page='.($StartPage+1).$QueryString.$Anchor.'" class="pager_next"><strong>Next ></strong></a> ';
|
||||
$Pages .= '<a href="'.$Location.'?page='.$TotalPages.$QueryString.$Anchor.'"><strong> Last >></strong></a>';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($TotalPages>1) { return $Pages; }
|
||||
|
||||
|
||||
if ($TotalPages > 1) {
|
||||
return $Pages;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function send_email($To,$Subject,$Body,$From='noreply',$ContentType='text/plain') {
|
||||
|
@ -230,17 +230,15 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_GET['page']) && is_number($_GET['page'])) {
|
||||
if(!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
|
||||
if(check_perms('site_search_many')) {
|
||||
$Page = $_GET['page'];
|
||||
} else {
|
||||
$Page = min(SPHINX_MAX_MATCHES/TORRENTS_PER_PAGE, $_GET['page']);
|
||||
}
|
||||
$MaxMatches = min(SPHINX_MAX_MATCHES, SPHINX_MATCHES_START + SPHINX_MATCHES_STEP*floor(($Page-1)*TORRENTS_PER_PAGE/SPHINX_MATCHES_STEP));
|
||||
$SS->limit(($Page-1)*TORRENTS_PER_PAGE, TORRENTS_PER_PAGE, $MaxMatches);
|
||||
$SS->limit(($Page-1)*TORRENTS_PER_PAGE, TORRENTS_PER_PAGE);
|
||||
} else {
|
||||
$Page = 1;
|
||||
$MaxMatches = SPHINX_MATCHES_START;
|
||||
$SS->limit(0, TORRENTS_PER_PAGE);
|
||||
}
|
||||
|
||||
@ -259,7 +257,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
} elseif($_GET['order_by'] == 'random') {
|
||||
$OrderBy = '@random';
|
||||
$Way = SPH_SORT_EXTENDED;
|
||||
$SS->limit(0, TORRENTS_PER_PAGE, TORRENTS_PER_PAGE);
|
||||
$SS->limit(0, TORRENTS_PER_PAGE);
|
||||
} else {
|
||||
$OrderBy = $_GET['order_by'];
|
||||
}
|
||||
@ -278,7 +276,11 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
|
||||
$SS->set_index(SPHINX_INDEX.' delta');
|
||||
$Results = $SS->search($Query, '', 0, array(), '', '');
|
||||
$TorrentCount = $SS->TotalResults;
|
||||
if(check_perms('site_search_many')) {
|
||||
$TorrentCount = $SS->TotalResults;
|
||||
} else {
|
||||
$TorrentCount = min($SS->TotalResults, SPHINX_MAX_MATCHES);
|
||||
}
|
||||
|
||||
// These ones were not found in the cache, run SQL
|
||||
if(!empty($Results['notfound'])) {
|
||||
@ -310,6 +312,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
|
||||
|
||||
if(count($Results)==0) {
|
||||
|
||||
$DB->query("SELECT
|
||||
tags.Name,
|
||||
((COUNT(tags.Name)-2)*(SUM(tt.PositiveVotes)-SUM(tt.NegativeVotes)))/(tags.Uses*0.8) AS Score
|
||||
@ -327,12 +330,12 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
GROUP BY tt.TagID
|
||||
ORDER BY Score DESC
|
||||
LIMIT 8");
|
||||
|
||||
$JsonYouMightLike = array();
|
||||
while(list($Tag)=$DB->next_record()) {
|
||||
$JsonYouMightLike[] = $Tag;
|
||||
}
|
||||
|
||||
|
||||
print
|
||||
json_encode(
|
||||
array(
|
||||
|
@ -208,10 +208,10 @@
|
||||
|
||||
if(!empty($_GET['page']) && is_number($_GET['page'])) {
|
||||
$Page = min($_GET['page'], 50000/REQUESTS_PER_PAGE);
|
||||
$SS->limit(($Page - 1) * REQUESTS_PER_PAGE, REQUESTS_PER_PAGE, 50000);
|
||||
$SS->limit(($Page - 1) * REQUESTS_PER_PAGE, REQUESTS_PER_PAGE);
|
||||
} else {
|
||||
$Page = 1;
|
||||
$SS->limit(0, REQUESTS_PER_PAGE, 50000);
|
||||
$SS->limit(0, REQUESTS_PER_PAGE);
|
||||
}
|
||||
|
||||
if(empty($_GET['order'])) {
|
||||
|
@ -204,12 +204,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_GET['page']) && is_number($_GET['page'])) {
|
||||
$Page = min($_GET['page'], 50000/REQUESTS_PER_PAGE);
|
||||
$SS->limit(($Page - 1) * REQUESTS_PER_PAGE, REQUESTS_PER_PAGE, 50000);
|
||||
if(!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
|
||||
$Page = $_GET['page'];
|
||||
$SS->limit(($Page - 1) * REQUESTS_PER_PAGE, REQUESTS_PER_PAGE);
|
||||
} else {
|
||||
$Page = 1;
|
||||
$SS->limit(0, REQUESTS_PER_PAGE, 50000);
|
||||
$SS->limit(0, REQUESTS_PER_PAGE);
|
||||
}
|
||||
|
||||
if(empty($_GET['order'])) {
|
||||
@ -267,35 +267,12 @@
|
||||
$SS->set_index('requests requests_delta');
|
||||
$SphinxResults = $SS->search($Query, '', 0, array(), '', '');
|
||||
$NumResults = $SS->TotalResults;
|
||||
//We don't use sphinxapi's default cache searcher, we use our own functions
|
||||
|
||||
if(!empty($SphinxResults['notfound'])) {
|
||||
$SQLResults = get_requests($SphinxResults['notfound']);
|
||||
if(is_array($SQLResults['notfound'])) {
|
||||
//Something wasn't found in the db, remove it from results
|
||||
reset($SQLResults['notfound']);
|
||||
foreach($SQLResults['notfound'] as $ID) {
|
||||
unset($SQLResults['matches'][$ID]);
|
||||
unset($SphinxResults['matches'][$ID]);
|
||||
}
|
||||
}
|
||||
|
||||
// Merge SQL results with memcached results
|
||||
foreach($SQLResults['matches'] as $ID => $SQLResult) {
|
||||
$SphinxResults['matches'][$ID] = $SQLResult;
|
||||
|
||||
//$Requests['matches'][$ID] = array_merge($Requests['matches'][$ID], $SQLResult);
|
||||
//We ksort because depending on the filter modes, we're given our data in an unpredictable order
|
||||
//ksort($Requests['matches'][$ID]);
|
||||
}
|
||||
if($NumResults && $NumResults < ($Page - 1) * REQUESTS_PER_PAGE + 1) {
|
||||
$PageLinks = get_pages(0, $NumResults, REQUESTS_PER_PAGE);
|
||||
} else {
|
||||
$PageLinks = get_pages($Page, $NumResults, REQUESTS_PER_PAGE);
|
||||
}
|
||||
|
||||
$PageLinks = get_pages($Page, $NumResults, REQUESTS_PER_PAGE);
|
||||
|
||||
$Requests = $SphinxResults['matches'];
|
||||
|
||||
$CurrentURL = get_url(array('order', 'sort'));
|
||||
|
||||
show_header($Title, 'requests');
|
||||
|
||||
?>
|
||||
@ -450,10 +427,12 @@
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<? if($NumResults) { ?>
|
||||
<div class="linkbox">
|
||||
<?=$PageLinks?>
|
||||
</div>
|
||||
<? } ?>
|
||||
<table id="request_table" cellpadding="6" cellspacing="1" border="0" class="border" width="100%">
|
||||
<tr class="colhead_dark">
|
||||
<td style="width: 38%;" class="nobr">
|
||||
@ -487,7 +466,39 @@
|
||||
Nothing found!
|
||||
</td>
|
||||
</tr>
|
||||
<? } elseif($NumResults < ($Page - 1) * REQUESTS_PER_PAGE + 1) { ?>
|
||||
<tr class="rowb">
|
||||
<td colspan="8">
|
||||
The requested page contains no matches!
|
||||
</td>
|
||||
</tr>
|
||||
<? } else {
|
||||
|
||||
//We don't use sphinxapi's default cache searcher, we use our own functions
|
||||
if(!empty($SphinxResults['notfound'])) {
|
||||
$SQLResults = get_requests($SphinxResults['notfound']);
|
||||
if(is_array($SQLResults['notfound'])) {
|
||||
//Something wasn't found in the db, remove it from results
|
||||
reset($SQLResults['notfound']);
|
||||
foreach($SQLResults['notfound'] as $ID) {
|
||||
unset($SQLResults['matches'][$ID]);
|
||||
unset($SphinxResults['matches'][$ID]);
|
||||
}
|
||||
}
|
||||
|
||||
// Merge SQL results with memcached results
|
||||
foreach($SQLResults['matches'] as $ID => $SQLResult) {
|
||||
$SphinxResults['matches'][$ID] = $SQLResult;
|
||||
|
||||
//$Requests['matches'][$ID] = array_merge($Requests['matches'][$ID], $SQLResult);
|
||||
//We ksort because depending on the filter modes, we're given our data in an unpredictable order
|
||||
//ksort($Requests['matches'][$ID]);
|
||||
}
|
||||
}
|
||||
|
||||
$Requests = $SphinxResults['matches'];
|
||||
|
||||
$CurrentURL = get_url(array('order', 'sort'));
|
||||
$Row = 'a';
|
||||
$TimeCompare = 1267643718; // Requests v2 was implemented 2010-03-03 20:15:18
|
||||
foreach ($Requests as $RequestID => $Request) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?
|
||||
if(!check_perms('users_mod')) { error(403); }
|
||||
if(!check_perms('users_view_email')) { error(403); }
|
||||
|
||||
show_header('Manage email blacklist');
|
||||
$DB->query("SELECT
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?
|
||||
if(!check_perms('users_mod')) { error(403); }
|
||||
if(!check_perms('users_view_email')) { error(403); }
|
||||
|
||||
authorize();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
if (!check_perms('users_mod')) { error(403);
|
||||
if (!check_perms('users_view_invites')) { error(403);
|
||||
}
|
||||
|
||||
show_header('Fishy Invites');
|
||||
|
@ -25,8 +25,10 @@
|
||||
<tr><td><a href="tools.php?action=dnu">Do not upload list</a></td></tr>
|
||||
<? } if (check_perms('site_recommend_own') || check_perms('site_manage_recommendations')) { ?>
|
||||
<tr><td><a href="tools.php?action=recommend">Vanity House additions</a></td></tr>
|
||||
<? } if (check_perms('users_mod')) { ?>
|
||||
|
||||
<? } if (check_perms('users_view_email')) { ?>
|
||||
<tr><td><a href="tools.php?action=email_blacklist">Email Blacklist</a></td></tr>
|
||||
<? } if (check_perms('users_mod')) { ?>
|
||||
<tr><td><a href="tools.php?action=tokens">Manage freeleech tokens</a></td></tr>
|
||||
<tr><td><a href="tools.php?action=official_tags">Official Tags Manager</a></td></tr>
|
||||
<tr><td><a href="tools.php?action=tag_aliases">Tag Aliases</a></td></tr>
|
||||
@ -47,6 +49,7 @@
|
||||
<tr><td><a href="tools.php?action=registration_log">Registration Log</a></td></tr>
|
||||
<? } if (check_perms('users_view_invites')) { ?>
|
||||
<tr><td><a href="tools.php?action=invite_pool">Invite Pool</a></td></tr>
|
||||
|
||||
<? } if (check_perms('site_view_flow')) { ?>
|
||||
<tr><td><a href="tools.php?action=upscale_pool">Upscale Pool</a></td></tr>
|
||||
<tr><td><a href="tools.php?action=user_flow">User Flow</a></td></tr>
|
||||
|
@ -269,18 +269,15 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
$SS->set_filter('categoryid', array_keys($_GET['filter_cat']));
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_GET['page']) && is_number($_GET['page'])) {
|
||||
if(!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
|
||||
if(check_perms('site_search_many')) {
|
||||
$Page = $_GET['page'];
|
||||
} else {
|
||||
$Page = min(SPHINX_MAX_MATCHES/TORRENTS_PER_PAGE, $_GET['page']);
|
||||
}
|
||||
$MaxMatches = min(SPHINX_MAX_MATCHES, SPHINX_MATCHES_START + SPHINX_MATCHES_STEP*floor(($Page-1)*TORRENTS_PER_PAGE/SPHINX_MATCHES_STEP));
|
||||
$SS->limit(($Page-1)*TORRENTS_PER_PAGE, TORRENTS_PER_PAGE, $MaxMatches);
|
||||
$SS->limit(($Page-1)*TORRENTS_PER_PAGE, TORRENTS_PER_PAGE);
|
||||
} else {
|
||||
$Page = 1;
|
||||
$MaxMatches = SPHINX_MATCHES_START;
|
||||
$SS->limit(0, TORRENTS_PER_PAGE);
|
||||
}
|
||||
|
||||
@ -299,7 +296,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
} elseif($_GET['order_by'] == 'random') {
|
||||
$OrderBy = '@random';
|
||||
$Way = SPH_SORT_EXTENDED;
|
||||
$SS->limit(0, TORRENTS_PER_PAGE, TORRENTS_PER_PAGE);
|
||||
$SS->limit(0, TORRENTS_PER_PAGE);
|
||||
} else {
|
||||
$OrderBy = $_GET['order_by'];
|
||||
}
|
||||
@ -318,8 +315,13 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
|
||||
$SS->set_index(SPHINX_INDEX.' delta');
|
||||
$Results = $SS->search($Query, '', 0, array(), '', '');
|
||||
$TorrentCount = $SS->TotalResults;
|
||||
if(check_perms('site_search_many')) {
|
||||
|
||||
$TorrentCount = $SS->TotalResults;
|
||||
|
||||
} else {
|
||||
$TorrentCount = min($SS->TotalResults, SPHINX_MAX_MATCHES);
|
||||
}
|
||||
/*
|
||||
// If some were fetched from memcached, get their artists
|
||||
if(!empty($Results['matches'])) { // Fetch the artists for groups
|
||||
@ -367,9 +369,6 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
|
||||
show_header('Browse Torrents','browse');
|
||||
|
||||
// List of pages
|
||||
$Pages=get_pages($Page,$TorrentCount,TORRENTS_PER_PAGE);
|
||||
|
||||
|
||||
?>
|
||||
<form name="filter" method="get" action=''>
|
||||
@ -553,12 +552,6 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<? if(check_perms('site_search_many')) { ?>
|
||||
<tr>
|
||||
<td class="label">Limited search results:</td>
|
||||
<td><input type="checkbox" value="1" name="limit_matches" <?selected('limit_matches',1,'checked')?> /></td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
</table>
|
||||
<table class="cat_list">
|
||||
<?
|
||||
@ -621,7 +614,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
</tr>
|
||||
</table>
|
||||
<div class="submit">
|
||||
<span style="float:left;"><?=number_format($TorrentCount).($TorrentCount < SPHINX_MAX_MATCHES && $TorrentCount == $MaxMatches ? '+' : '')?> Results</span>
|
||||
<span style="float:left;"><?=number_format($TorrentCount)?> Results</span>
|
||||
<input type="submit" value="Filter Torrents" />
|
||||
<input type="button" value="Reset" onclick="location.href='torrents.php<? if(isset($_GET['action']) && $_GET['action']=="advanced") { ?>?action=advanced<? } ?>'" />
|
||||
|
||||
@ -639,8 +632,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="linkbox"><?=$Pages?></div>
|
||||
<? if(count($Results)==0) {
|
||||
<? if($TorrentCount == 0) {
|
||||
$DB->query("SELECT
|
||||
tags.Name,
|
||||
((COUNT(tags.Name)-2)*(SUM(tt.PositiveVotes)-SUM(tt.NegativeVotes)))/(tags.Uses*0.8) AS Score
|
||||
@ -668,10 +660,26 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
show_footer();die();
|
||||
}
|
||||
|
||||
$Bookmarks = all_bookmarks('torrent');
|
||||
if($TorrentCount < ($Page-1)*TORRENTS_PER_PAGE+1) {
|
||||
$LastPage = ceil($TorrentCount/TORRENTS_PER_PAGE);
|
||||
$Pages = get_pages(0, $TorrentCount, TORRENTS_PER_PAGE);
|
||||
?>
|
||||
<div class="box pad" align="center">
|
||||
<h2>The requested page contains no matches.</h2>
|
||||
<p>You are requesting page <?=$Page?>, but the search returned only <?=$LastPage?> pages.</p>
|
||||
</div>
|
||||
<div class="linkbox">Go to page <?=$Pages?></div>
|
||||
<?
|
||||
show_footer();die();
|
||||
}
|
||||
|
||||
// List of pages
|
||||
$Pages = get_pages($Page, $TorrentCount, TORRENTS_PER_PAGE);
|
||||
|
||||
$Bookmarks = all_bookmarks('torrent');
|
||||
?>
|
||||
|
||||
<div class="linkbox"><?=$Pages?></div>
|
||||
|
||||
<table class="torrent_table grouping" id="torrent_table">
|
||||
<tr class="colhead">
|
||||
|
@ -18,7 +18,7 @@ function header_link($SortKey,$DefaultWay="DESC") {
|
||||
if(!is_number($UserID)) { error(0); }
|
||||
|
||||
|
||||
if(!empty($_GET['page']) && is_number($_GET['page'])) {
|
||||
if(!empty($_GET['page']) && is_number($_GET['page']) && $_GET['page'] > 0) {
|
||||
$Page = $_GET['page'];
|
||||
$Limit = ($Page-1)*TORRENTS_PER_PAGE.', '.TORRENTS_PER_PAGE;
|
||||
} else {
|
||||
|
@ -481,7 +481,7 @@ ul#userinfo_username {
|
||||
}
|
||||
|
||||
#torrents #content h2 {
|
||||
margin: 10px 0 10px 0;
|
||||
margin: 10px 0 10px 0 !important;
|
||||
}
|
||||
|
||||
#content h2:first-child {
|
||||
|
Loading…
Reference in New Issue
Block a user