Prevent the merging of non-music groups

Include empty values in cache debug table

Clear cache when replying to staff pm

Internal cache is useless in get_artists and get_groups
This commit is contained in:
What.CD 2011-05-24 08:00:09 +00:00
parent 90c9f0dffc
commit fb4810d625
2 changed files with 15 additions and 5 deletions

View File

@ -38,12 +38,20 @@
list($AvailableBounty) = $DB->next_record(); list($AvailableBounty) = $DB->next_record();
$DB->query("SELECT SUM(Snatched), COUNT(ID) FROM torrents"); $DB->query("SELECT SUM(Snatched), COUNT(ID) FROM torrents");
list($TotalSnatches, $TotalTorrents) = $DB->next_record(); // This is the total number of snatches for torrents that still exist list($TotalSnatches, $TotalTorrents) = $DB->next_record(); // This is the total number of snatches for torrents that still exist
$DB->query("SELECT COUNT(uid) FROM xbt_snatched"); $DB->query("SELECT COUNT(uid) FROM xbt_snatched");
list($TotalOverallSnatches) = $DB->next_record(); list($TotalOverallSnatches) = $DB->next_record();
$DB->query("SELECT COUNT(fid) FROM xbt_files_users WHERE remaining=0");
list($TotalSeeders) = $DB->next_record(); if(($PeerStats = $Cache->get_value('stats_peers')) === false) {
$DB->query("SELECT COUNT(fid) FROM xbt_files_users"); $DB->query("SELECT COUNT(fid) FROM xbt_files_users WHERE remaining=0");
list($TotalPeers) = $DB->next_record(); list($TotalSeeders) = $DB->next_record();
$DB->query("SELECT COUNT(fid) FROM xbt_files_users WHERE remaining>0");
list($TotalLeechers) = $DB->next_record();
} else {
list($TotalLeechers,$TotalSeeders) = $PeerStats;
}
$TotalPeers = $TotalLeechers + $TotalSeeders;
$DB->query("SELECT COUNT(ID) FROM users_main WHERE(SELECT COUNT(uid) FROM xbt_files_users WHERE uid=users_main.ID)>0"); $DB->query("SELECT COUNT(ID) FROM users_main WHERE(SELECT COUNT(uid) FROM xbt_files_users WHERE uid=users_main.ID)>0");
list($TotalPeerUsers) = $DB->next_record(); list($TotalPeerUsers) = $DB->next_record();
$Cache->cache_value('new_economic_stats', $Cache->cache_value('new_economic_stats',

View File

@ -107,7 +107,9 @@ function ShowIPs(rowname) {
} }
?> ?>
<tr class="rowa"> <tr class="rowa">
<td><?=$IP?> (<?=get_cc($IP)?>)<br /><?=get_host($IP)?> <td>
<?=$IP?> (<?=get_cc($IP)?>) <br />
<?=get_host($IP)?>
<?=($HasDupe ? <?=($HasDupe ?
'<a href="#" onclick="ShowIPs('.$Index.'); return false;">('.count($UserIDs).')</a>' '<a href="#" onclick="ShowIPs('.$Index.'); return false;">('.count($UserIDs).')</a>'
: '(0)')?></td> : '(0)')?></td>