X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fbriskin5%2Fstatadm.php;h=a65acef873f45527549317b3f1f9ec7907360baa;hb=9878243b4e002b50ee444cf906b9e13faba4fe01;hp=f6d40b3d7eeb292b5f4257318f09ce6558793f33;hpb=536da22ebde5fa66e0f7524e9efc0316391f1afd;p=brisk.git
diff --git a/web/briskin5/statadm.php b/web/briskin5/statadm.php
index f6d40b3..a65acef 100644
--- a/web/briskin5/statadm.php
+++ b/web/briskin5/statadm.php
@@ -123,7 +123,7 @@ function main_file($curtime)
for ($i = 0 ; $i < BIN5_PLAYERS_N ; $i++) {
// echo $p." i) ".$i."
";
$username = $ar[9+($i*2)];
- if (($item = $bdb->getitem_bylogin($username, &$id)) == FALSE) {
+ if (($item = $bdb->getitem_bylogin($username, $id)) == FALSE) {
echo "WARNING: the user [".$username."] NOT EXISTS!
";
continue;
}
@@ -335,12 +335,15 @@ function main_pgsql($curtime)
$old_score = array( 1000000000, 1000000000);
$old_gam = array( -1, -1);
$rank = array( 0, 0);
-
+
+ // TAG: POINTS_MANAGEMENT
$pla_sql = sprintf("SELECT (float4(sum(p.pts)) * 100.0 ) / float4(count(p.pts)) as score, sum(p.pts) as points, count(p.pts) as games, u.code as ucode, u.login as login
FROM %sbin5_points as p, %sbin5_games as g, %sbin5_matches as m, %susers as u
WHERE m.tcode = %d AND m.code = g.mcode AND
+ ( (u.type & (CAST (X'ff0000' as integer))) <> (CAST (X'800000' as integer)) ) AND
g.tstamp > to_timestamp(%d) AND g.tstamp <= to_timestamp(%d) AND
- p.ucode = u.code AND p.gcode = g.code
+ p.ucode = u.code AND p.gcode = g.code AND
+ p.pts != 0
GROUP BY u.code, u.login
ORDER BY (float4(sum(p.pts)) * 100.0 ) / float4(count(p.pts)) DESC,
count(p.pts) DESC",
@@ -426,7 +429,10 @@ function main()
$ctime = time();
- $curtime = ((int)($ctime / (24 * 3600))) * 24 * 3600 - (((int)substr(date("O", $ctime), 0, -2)) * 3600);
+ if (BIN5_PLAYERS_N != 5)
+ $curtime = $ctime;
+ else
+ $curtime = ((int)($ctime / (24 * 3600))) * 24 * 3600 - (((int)substr(date("O", $ctime), 0, -2)) * 3600);
if ($ret = $fun_name($curtime))
echo "Success.
\n";
else