Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help
Author Message
oyjord
Hangin' Around


Joined: Aug 25, 2006
Posts: 44

PostPosted: Fri Apr 18, 2008 9:31 am Reply with quote

Hi all,

When a user log out of my site, it appears their handle stay in the "Online Now" section of the User Info block much, much too long. Is there any way I can make so when my users log out, then they disappear from the Online Now field?

Thanks!
Oy.
 
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Tue Apr 22, 2008 6:51 am Reply with quote

oyjord, sorry for the delay. I want to <bump> this thread for you to try and get you an answer. Unfortunately, I must leave the boards until tomorrow...

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
montego
PostPosted: Fri May 16, 2008 6:07 am Reply with quote

oyjord, I am not certain about this, but you might try messing around with the following code in mainfile.php:

=== FIND CODE ===

Code:


function online() {
    global $nsnst_const, $user, $cookie, $prefix, $db;
    if(!file_exists('includes/nukesentinel.php')) {
        $ip = $_SERVER['REMOTE_ADDR'];
    } else {
        $ip = $nsnst_const['remote_ip'];
    }
    $guest = 0;
    if (is_user($user)) {
        cookiedecode($user);
        $uname = $cookie[1];
        if (!isset($uname)) {
            $uname = $ip;
            $guest = 1;
        }
    } else {
        $uname = $ip;
        $guest = 1;
    }
    $past = time()-3600;
    $sql = 'DELETE FROM '.$prefix.'_session WHERE time < \''.$past.'\'';
    $db->sql_query($sql);
    $sql = 'SELECT time FROM '.$prefix.'_session WHERE uname=\''.$uname.'\'';
    $result = $db->sql_query($sql);
    $ctime = time();
    if (!empty($uname)) {
        $uname = substr($uname, 0,25);
        $row = $db->sql_fetchrow($result);
        if ($row) {
            $db->sql_query('UPDATE '.$prefix.'_session SET uname=\''.$uname.'\', time=\''.$ctime.'\', host_addr=\''.$ip.'\', guest=\''.$guest.'\' WHERE uname=\''.$uname.'\'');
        } else {
            $db->sql_query('INSERT INTO '.$prefix.'_session (uname, time, host_addr, guest) VALUES (\''.$uname.'\', \''.$ctime.'\', \''.$ip.'\', \''.$guest.'\')');
        }
    }
}


Take a look especially at this line here:

$past = time()-3600;

I believe changing that 3600, which is 60 minutes.

Sorry, though, don't know what other ramifications this could have as I've never tried changing it and don't have time to search through the code for where else this is used.
 
oyjord
PostPosted: Fri May 16, 2008 10:01 am Reply with quote

** I removed the extra quote - no need to quote a whole post that is right above - Wink , montego **

Thanks for the reply! No harm in trying. I'll give it a go and report back.

Oyjord.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©