Parašė ramon· 2007 Spa. 22 20:10:39
#2
Taip si koda rasom i
Pridėtinius puslapius:
<?PHP
$result = dbquery("DROP TABLE IF EXISTS ".$db_prefix."daugiausiai");
$result = dbquery("CREATE TABLE ".$db_prefix."daugiausiai (
daugiausiai_id SMALLINT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
daugiausiai_user VARCHAR(50) NOT NULL DEFAULT '',
daugiausiai_date INT(10) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (daugiausiai_id)
) TYPE=MyISAM;");
$result=dbquery("INSERT INTO ".$db_prefix."daugiausiai (daugiausiai_id, daugiausiai_user, daugiausiai_date) VALUES ('','0', '2364521654')");
$result=dbquery("INSERT INTO ".$db_prefix."daugiausiai (daugiausiai_id, daugiausiai_user, daugiausiai_date) VALUES ('','0', '3652642165')");
?>
Poto i panele rasai si koda :
if ($settings['maintenance'] != "1") {
$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 (online_user, online_ip, online_lastactive) VALUES ('$name', '".USER_IP."', '".time()."')");
}
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_lastactive<".(time()-60)."");
openside($locale['010']);
$result = dbquery(
"SELECT ton.*, tu.user_id,user_name FROM ".$db_prefix."online ton
LEFT JOIN ".$db_prefix."users tu ON ton.online_user=tu.user_id"
);
$guests = 0; $members = array();
while ($data = dbarray($result)) {
if ($data['online_user'] == "0") {
$guests++;
} else {
array_push($members, array($data['user_id'], $data['user_name']));
}
}
echo "<img src='".THEME."images/bullet.gif' alt=''> ".$locale['011'].$guests."<br>\n";
if (count($members) > 0) {
$i = 1;
echo "<img src='".THEME."images/bullet.gif' alt=''> ".$locale['012'];
while (list($key, $member) = each($members)) {
echo "<a href='".BASEDIR."profile.php?lookup=".$member[0]."' class='side'>".$member[1]."</a>";
if ($i != count($members)) echo ", ";
$i++;
}
} else {
echo $locale['013']."<br>\n";
}
echo "<br><img src='".THEME."images/bullet.gif' alt=''> ".$locale['014'].number_format(dbcount("(user_id)", "users", "user_status<='1'"))."<br>\n";
if ($settings['admin_activation'] == "1") echo "<img src='".THEME."images/bullet.gif' alt=''> ".$locale['015'].dbcount("(user_id)", "users", "user_status='2'")."<br>\n";
$data = dbarray(dbquery("SELECT user_id,user_name FROM ".$db_prefix."users WHERE user_status='0' ORDER BY user_joined DESC LIMIT 0,1"));
echo "<img src='".THEME."images/bullet.gif' alt=''> ".$locale['016']."<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'>".$data['user_name']."</a>\n";
$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."daugiausiai ORDER BY daugiausiai_user DESC LIMIT 1");
$data2 = dbarray($result2);
$rdata = "".showdate('%d %B %Y %H:%M',$data2['daugiausiai_date'])."";
$nariu_skaicius = $data2['daugiausiai_user'];
$wszystkich = "".number_format(dbcount("(online_user)", "online", "online_user!=''"))."";
$timme = time();
$result=dbquery("INSERT INTO ".$db_prefix."daugiausiai (daugiausiai_id, daugiausiai_user, daugiausiai_date) VALUES ('','$viso', '$timme')");
$result=dbquery("DELETE FROM ".$db_prefix."daugiausiai WHERE daugiausiai_date!='".$data2['daugiausiai_date']."' ORDER BY daugiausiai_user LIMIT 1");
echo"<br><hr>Rekordai:<br><img src='".THEME."images/bullet.gif' alt=''> Daugiausiai zmoniu buvo: ".$nariu_skaicius."<BR>
Data: ".$rdata."
";
closeside();
}