fix announce.php seeder&leecher count directly

This commit is contained in:
xiaomlove
2022-04-25 14:52:59 +08:00
parent da2f19b88f
commit e0d0d219b1
4 changed files with 35 additions and 15 deletions

View File

@@ -33,13 +33,6 @@ function get_langfile_path($script_name ="", $target = false, $lang_folder = "")
return "lang/" . ($target == false ? $lang_folder : "_target") ."/lang_". ( $script_name == "" ? substr(strrchr($_SERVER['SCRIPT_NAME'],'/'),1) : $script_name);
}
function get_row_count($table, $suffix = "")
{
$r = sql_query("SELECT COUNT(*) FROM $table $suffix") or sqlerr(__FILE__, __LINE__);
$a = mysql_fetch_row($r);
return $a[0];
}
function get_row_sum($table, $field, $suffix = "")
{
$r = sql_query("SELECT SUM($field) FROM $table $suffix") or sqlerr(__FILE__, __LINE__);
@@ -1736,7 +1729,7 @@ function get_ip_location($ip)
* @since 1.7.4
*/
$arr = get_ip_location_from_geoip($ip);
$result = array($arr["name"], $lang_functions['text_user_ip'] . ": " . trim($ip, ','));
$result = array($arr["name"] ?? $lang_functions['text_unknown'], $lang_functions['text_user_ip'] . ": " . trim($ip, ','));
return $locations[$ip] = $result;
$cacheKey = "location_$ip";