Ok peeps, as we already know 90% of the time the who's where system is inaccurate so i remade it, verry simple mod but effective, let me know what you think.
Open backend/functions.php
Find and remove:
Hope it helps :angry:
Open backend/functions.php
Find and remove:
$where = where ($_SERVER["SCRIPT_FILENAME"], $row["id"], 0);
SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $row["id"]);Then find(or similar if you have changed it):function where ($scriptname = "index", $userid, $update=1){
if (!is_valid_id($userid))
die;
if (preg_match("/account-details/i", $scriptname))
$where = "Browsing Account Details...";
elseif (preg_match("/account/i", $scriptname))
$where = "Browsing User Control Panel...";
elseif (preg_match("/forums/i", $scriptname))
$where = "Browsing Forums...";
elseif (preg_match("/index/i", $scriptname))
$where = "Browsing Homepage...";
else
$where = "Unknown Location...";
if ($update) {
$query = sprintf("UPDATE users SET page=".sqlesc($where)." WHERE id ='%s'", mysql_real_escape_string($userid));
$result = SQL_Query_exec($query);
}
return $where;
}
Replace with:
function where ($where, $userid, $update=1){
if (!is_valid_id($userid))
die;
if(empty($where))
$where = "Unknown Location...";
if ($update)
SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);
if (!$update){
return $where;
}else{
return;
}
}
Now find:
if (!$CURUSER)
guestadd();
Replace with:
if ($CURUSER){
where($title, $CURUSER['id']);
}else{
guestadd();
}
Its as easy as that, for people using <2.07 replace:
SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);
With
mysql_query("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $userid);Hope it helps :angry:
