X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2Fbriskin5%2FObj%2Fplacing.phh;h=f0688999911c44998cd442f7c95169369b8ae2e1;hb=abe1151407fb084089a8dfa12ea081b95630a1fd;hp=cd2a87137f29e6127ff8f2b71726c190d902e2eb;hpb=1721ff2bb2e90719658b2687874b1fbdfc1dcff5;p=brisk.git diff --git a/web/briskin5/Obj/placing.phh b/web/briskin5/Obj/placing.phh index cd2a871..f068899 100644 --- a/web/briskin5/Obj/placing.phh +++ b/web/briskin5/Obj/placing.phh @@ -2,7 +2,7 @@ /* * brisk - placing.phh * - * Copyright (C) 2009 Matteo Nastasi + * Copyright (C) 2009-2011 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -20,20 +20,21 @@ * not, write to the Free Software Foundation, Inc, 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. * - * $Id$ - * */ - +define(TOP_NUM, 10); define(TRI_LIMIT, (90 * 24 * 60 * 60)); -define(TRI_FEW_GAMES, 60); +define(TRI_MIN_GAMES, 70); +define(TRI_MAX_GAMES, 140); define(MON_LIMIT, (30 * 24 * 60 * 60)); -define(MON_FEW_GAMES, 20); +define(MON_MIN_GAMES, 35); +define(MON_MAX_GAMES, 70); define(WEE_LIMIT, (7 * 24 * 60 * 60)); -define(WEE_FEW_GAMES, 10); +define(WEE_MIN_GAMES, 10); +define(WEE_MAX_GAMES, 35); class Ptsgam { @@ -48,7 +49,7 @@ class Ptsgam { $this->gam = $gam; } - function &clone() + function &myclone() { $ret = new Ptsgam($this->username, $this->pts, $this->gam); @@ -96,21 +97,44 @@ function ptsgam_cmp($a, $b) function placings_show(&$user) { - $ret = sprintf("
Settimanale (non meno di %d partite) %s | ", WEE_FEW_GAMES, placing_show($user, "wee_hi") );
- $ret .= sprintf("Settimanale (meno di %d partite) %s |
Mensile (non meno di %d partite) %s | ", MON_FEW_GAMES, placing_show($user, "mon_hi") );
- $ret .= sprintf("Mensile (meno di %d partite) %s |
Settimanale dal %s al %s (non meno di %d partite) %s | ", $tmwee[1], $tm[1], WEE_MAX_GAMES, placing_show($user, "wee_hi") );
+ $ret .= sprintf("Settimanale dal %s al %s (meno di %d partite, più di %d) %s |
Trimestrale (non meno di %d partite) %s | ", TRI_FEW_GAMES, placing_show($user, "tri_hi"));
- $ret .= sprintf("Trimestrale (meno di %d partite) %s |
Mensile dal %s al %s (non meno di %d partite) %s | ", $tmmon[1], $tm[1], MON_MAX_GAMES, placing_show($user, "mon_hi") );
+ $ret .= sprintf("Mensile dal %s al %s (meno di %d partite, più di %d) %s |
Trimestrale dal %s al %s (non meno di %d partite) %s | ", $tmtri[1], $tm[1], TRI_MAX_GAMES, placing_show($user, "tri_hi"));
+ $ret .= sprintf("Trimestrale dal %s al %s (meno di %d partite, più di %d) %s |
Pos. | Utente | Score | (Punti/Partite) | "); + + $old_normpts = 1000000000; + $old_gam = -1; for ($i = 0 ; !feof($fp) ; $i++) { $bf = fgets($fp, 4096); $ar = csplitter($bf, '|'); @@ -130,17 +157,22 @@ function placing_show(&$user, $suff) if ($pg->username == "") continue; - if ($i < 5) { + if ($pg->normpts() == $old_normpts && $pg->gam == $old_gam) + $i--; + + if ($i < TOP_NUM) { $ret .= sprintf("
---|---|---|---|
%d | %s%s%s | %s | (%d/%d) |
. . . . . . . . . . | |||
%d | %s%s%s | %s | (%d/%d) |