Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $cheat = rand(435, 460);
- function nbvisiteurs()
- {
- global $user, $nuked, $user_ip;
- $limite = time() + $nuked['nbc_timeout'];
- $time = time();
- $req = mysql_query("DELETE FROM " . NBCONNECTE_TABLE . " WHERE date < " . $time);
- if ($user_ip != "")
- {
- if ($user[0] != "")
- $where = "WHERE user_id='" . $user[0] . "'";
- else
- $where = "WHERE IP='" . $user_ip . "'";
- $req = mysql_query("SELECT IP FROM " . NBCONNECTE_TABLE . " " . $where);
- $query = mysql_num_rows($req);
- if ($query > 0)
- {
- if ($user[0] != "")
- $req = mysql_query("UPDATE " . NBCONNECTE_TABLE . " SET date = '" . $limite . "', type = '" . $user[1] . "', IP = '" . $user_ip . "', username = '" . $user[2] . "' WHERE user_id = '" . $user[0] . "'");
- else
- $req = mysql_query("UPDATE " . NBCONNECTE_TABLE . " SET date = '" . $limite . "', type = '" . $user[1] . "', user_id = '" . $user[0] . "', username = '" . $user[2] . "' WHERE IP = '" . $user_ip . "'");
- }
- else
- {
- $del = mysql_query("DELETE FROM " . NBCONNECTE_TABLE . " WHERE IP = '" . $user_ip . "'");
- $req = mysql_query("INSERT INTO " . NBCONNECTE_TABLE . " ( `IP` , `type` , `date` , `user_id` , `username` ) VALUES ( '" . $user_ip . "' , '" . $user[1] . "' , '" . $limite . "' , '" . $user[0] . "' , '" . $user[2] . "' )");
- }
- }
- $res = mysql_query("SELECT type FROM " . NBCONNECTE_TABLE . " WHERE type = 0");
- $count[0] = mysql_num_rows($res);
- $res = mysql_query("SELECT type FROM " . NBCONNECTE_TABLE . " WHERE type BETWEEN 1 AND 2");
- $count[1] = mysql_num_rows($res);
- $res = mysql_query("SELECT type FROM " . NBCONNECTE_TABLE . " WHERE type > 2");
- $count[2] = mysql_num_rows($res);
- $count[3] = $count[1] + $count[2];
- $count[4] = $count[0] + $count[3];
- return $count;
- }
- $nbex = nbvisiteurs();
- if ($nbex[1] > 0)
- {
- $query0 = sprintf("SELECT username FROM %s%s WHERE type BETWEEN 1 AND 2 ORDER BY date", $nuked['prefix'], _nbconnecte);
- $result0 = mysql_query($query0);
- while (list($nom) = mysql_fetch_array($result0))
- {
- $urlex1 = $titre = htmlentities($nom);
- $user_online .= "" . $nom . ", ";
- }
- }
- else
- $user_online = "";
- if ($nbex[2] > 0)
- {
- $query1 = sprintf("SELECT username FROM %s%s WHERE type > 2 ORDER BY date", $nuked['prefix'], _nbconnecte);
- $result1 = mysql_query($query1);
- while (list($name) = mysql_fetch_array($result1))
- {
- $urlex = $titre = htmlentities($name);
- $admin_online .= $name . ", ";
- }
- }else
- $admin_online = "";
- $disp = "visiteur";
- if ($nbex[0] > 1)
- $disp = "visiteurs";
- ?>
Add Comment
Please, Sign In to add comment