Hall of Famer |
08-27-2011 11:36 PM |
Well I am offering one possible solution, not sure if it works since I have never encountered this glitch myself on demo site(makes sense though, there is usually only me on demo site).
Go to your inc/functions.php file and find this:
PHP Code:
if($isloggedin != "yes")
{
$loggedinname = "Visitor";
}
$result = runquery("SELECT * FROM ".$GLOBALS['prefix']."online WHERE `session` = '".$session."'");
$count = mysql_num_rows($result);
if($count == 0)
{
runquery("INSERT INTO ".$GLOBALS['prefix']."online VALUES('$loggedinname', '$session', '$time')");
}
Replace with:
PHP Code:
$result = runquery("SELECT * FROM {$GLOBALS['prefix']}online WHERE `session` = '{$session}'");
$count = mysql_num_rows($result);
$result2 = runquery("SELECT * FROM {$GLOBALS['prefix']}online WHERE `username` = '{$loggedinname}'");
$count2 = mysql_num_rows($result2);
if($isloggedin != "yes")
{
$loggedinname = "Visitor";
}
if($count == 0 and $count2 == 0)
{
runquery("INSERT INTO {$GLOBALS['prefix']}online VALUES('$loggedinname', '$session', '$time')");
}
This way it should fix the problem of same user appearing more than once from who's online page. Again I cant tested this myself with only me on demo site, so run it on your active site with members and see if it works. It will not be included in Mys v1.2.3, so Id recommend you to upgrade before fixing this.
|