Do panela onlone user dodałem sobie sobie tego moda Najwięcej użytkowników było ,ale on podlicza do monentu i staje na 9 userach i tak juz stoi.
Kod:
$cond = ($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'");
$result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user=".$cond."");
if (dbrows($result) != 0) {
$result = dbquery("UPDATE ".$db_prefix."online SET online_lastactive='".time()."' WHERE online_user=".$cond."");
} else {
$name = ($userdata['user_level'] != 0 ? $userdata['user_id'] : "0");
$result = dbquery("INSERT INTO ".$db_prefix."online VALUES('".$name."', '".USER_IP."', '".time()."')");
}
if (isset($_POST['login'])) {
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'");
} else if (isset($logout)) {
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_ip='".USER_IP."'");
}
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_lastactive<".(time()-60)."");
$result2 = dbquery("SELECT * FROM ".$db_prefix."najw ORDER BY naj_user DESC LIMIT 1");
$data2 = dbarray($result2);
$bylo = "".showdate('%d %B %Y %H:%M',$data2['naj_date'])."";
$ilosc_userow = $data2['naj_user'];
$wszystkich = "".number_format(dbcount("(online_user)", "online", "online_user!=''"))."";
$timme = time();
$result=dbquery("INSERT INTO ".$db_prefix."najw (naj_id, naj_user, naj_date) VALUES ('','$wszystkich', '$timme')");
$result=dbquery("DELETE FROM ".$db_prefix."najw WHERE naj_date!='".$data2['naj_date']."' ORDER BY naj_user LIMIT 1");
echo"<br><img src='".THEME."images/bullet.gif' alt=''> Najwiecej userow: ".$ilosc_userow."<BR>
Było: ".$bylo."
Co zrobic żeby on ruszył dalej i zliczał prawidłowo?
Edytowane przez Pieka dnia 17.06.2009 20:15:59
|