count_peer() support custom field

This commit is contained in:
xiaomlove
2022-04-20 02:44:28 +08:00
parent 41ea4fd2a1
commit 7a79673669
3 changed files with 7 additions and 7 deletions

View File

@@ -2553,12 +2553,12 @@ else {
//// check every 60 seconds //////////////////
$activeseed = $Cache->get_value('user_'.$CURUSER["id"].'_active_seed_count');
if ($activeseed == ""){
$activeseed = count_peer(sprintf("userid = %s and seeder = 'yes'", $CURUSER['id']));
$activeseed = count_peer(sprintf("userid = %s and seeder = 'yes'", $CURUSER['id']), 'torrent');
$Cache->cache_value('user_'.$CURUSER["id"].'_active_seed_count', $activeseed, 60);
}
$activeleech = $Cache->get_value('user_'.$CURUSER["id"].'_active_leech_count');
if ($activeleech == ""){
$activeleech = count_peer(sprintf("userid = %s and seeder = 'no'", $CURUSER['id']));
$activeleech = count_peer(sprintf("userid = %s and seeder = 'no'", $CURUSER['id']), 'torrent');
$Cache->cache_value('user_'.$CURUSER["id"].'_active_leech_count', $activeleech, 60);
}
$unread = $Cache->get_value('user_'.$CURUSER["id"].'_unread_message_count');