projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
point import function added to admin page
[brisk.git]
/
web
/
briskin5
/
statadm.php
diff --git
a/web/briskin5/statadm.php
b/web/briskin5/statadm.php
index
abe0042
..
96b79cd
100644
(file)
--- a/
web/briskin5/statadm.php
+++ b/
web/briskin5/statadm.php
@@
-2,7
+2,7
@@
/*
* brisk - statadm.php
*
/*
* brisk - statadm.php
*
- * Copyright (C) 2009 Matteo Nastasi
+ * Copyright (C) 2009
-2011
Matteo Nastasi
* mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
* mailto: nastasi@alternativeoutput.it
* matteo.nastasi@milug.org
* web: http://www.alternativeoutput.it
@@
-20,8
+20,6
@@
* not, write to the Free Software Foundation, Inc, 59 Temple Place -
* Suite 330, Boston, MA 02111-1307, USA.
*
* not, write to the Free Software Foundation, Inc, 59 Temple Place -
* Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id$
- *
*/
/*
*/
/*
@@
-35,6
+33,10
@@
TODO:
*/
*/
+$G_base = "../";
+
+ini_set("max_execution_time", "240");
+
require_once("../Obj/brisk.phh");
require_once("../Obj/auth.phh");
require_once("Obj/briskin5.phh");
require_once("../Obj/brisk.phh");
require_once("../Obj/auth.phh");
require_once("Obj/briskin5.phh");
@@
-47,6
+49,8
@@
function main()
$mon = array();
$wee = array();
$mon = array();
$wee = array();
+ echo "inizio<br>";
+ flush();
if ($pazz != $G_alarm_passwd)
exit;
if ($pazz != $G_alarm_passwd)
exit;
@@
-54,11
+58,20
@@
function main()
echo "Open data file error";
exit;
}
echo "Open data file error";
exit;
}
-
- $userdb = new LoginDB();
+ echo "prima<br>";
+
+ if (($fp_start = @fopen(LEGAL_PATH."/points.start", 'r')) != FALSE) {
+ $skip = intval(fgets($fp_start));
+ if ($skip > 0)
+ fseek($fp, $skip, SEEK_SET);
+ fclose($fp_start);
+ }
+
+ $bdb = new BriskDB();
+ $bdb->users_load();
- for ($i = 0 ; $i < $
user
db->count() ; $i++) {
- $login = $
user
db->getlogin_byidx($i);
+ for ($i = 0 ; $i < $
b
db->count() ; $i++) {
+ $login = $
b
db->getlogin_byidx($i);
$tri[$i] = new Ptsgam($login);
$mon[$i] = new Ptsgam($login);
$wee[$i] = new Ptsgam($login);
$tri[$i] = new Ptsgam($login);
$mon[$i] = new Ptsgam($login);
$wee[$i] = new Ptsgam($login);
@@
-84,24
+97,46
@@
function main()
continue;
// echo $p++."<br>";
// if to much old points, continue
continue;
// echo $p++."<br>";
// if to much old points, continue
- if ($ar[0] < $curtime - TRI_LIMIT)
+ if ($ar[0] < $curtime - TRI_LIMIT) {
+ if (($fp_start = @fopen(LEGAL_PATH."/points.start", 'w')) != FALSE) {
+ $curpos = ftell($fp);
+ fwrite($fp_start, sprintf("%d\n", $curpos));
+ fclose($fp_start);
+ }
+
continue;
continue;
+ }
// echo $p++." ".BRISKIN5_PLAYERS_N."<br>";
// echo $p++." ".BRISKIN5_PLAYERS_N."<br>";
+ $found = FALSE;
+ $mult = 1;
+ for ($i = 0 ; $i < BRISKIN5_PLAYERS_N ; $i++) {
+ for ($e = $i + 1 ; $e < BRISKIN5_PLAYERS_N ; $e++) {
+ if ($ar[10+($i*2)] == $ar[10+($e*2)]) {
+ $mult = abs($ar[10+($i*2)]);
+ $found = TRUE;
+ }
+ }
+ if ($found)
+ break;
+ }
+
+ if ($mult == 0)
+ continue;
for ($i = 0 ; $i < BRISKIN5_PLAYERS_N ; $i++) {
// echo $p." i) ".$i."<br>";
$username = $ar[9+($i*2)];
for ($i = 0 ; $i < BRISKIN5_PLAYERS_N ; $i++) {
// echo $p." i) ".$i."<br>";
$username = $ar[9+($i*2)];
- if (($item = $
user
db->getitem_bylogin($username, &$id)) == FALSE) {
+ if (($item = $
b
db->getitem_bylogin($username, &$id)) == FALSE) {
echo "WARNING: the user [".$username."] NOT EXISTS!<br>";
continue;
}
echo "WARNING: the user [".$username."] NOT EXISTS!<br>";
continue;
}
- // echo $item->login." id)".$id." ".$ar[10+($i*2)]."<br>";
- $tri[$id]->add($ar[10+($i*2)]);
+ // echo $item->login." id)".$id." ".$ar[10+($i*2)]."
mult: ".$mult."
<br>";
+ $tri[$id]->add($ar[10+($i*2)]
/ $mult
);
if ($ar[0] >= $curtime - MON_LIMIT)
if ($ar[0] >= $curtime - MON_LIMIT)
- $mon[$id]->add($ar[10+($i*2)]);
+ $mon[$id]->add($ar[10+($i*2)]
/ $mult
);
if ($ar[0] >= $curtime - WEE_LIMIT)
if ($ar[0] >= $curtime - WEE_LIMIT)
- $wee[$id]->add($ar[10+($i*2)]);
+ $wee[$id]->add($ar[10+($i*2)]
/ $mult
);
}
// $p++; echo $p++."<br>";
}
}
// $p++; echo $p++."<br>";
}