PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
oyjord
Hangin' Around


Joined: Aug 25, 2006
Posts: 44

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

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: 7458
Location: Arizona

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

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...
View user's profile Send private message Visit poster's website
montego
Site Admin


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

PostPosted: Fri May 16, 2008 6:07 am Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website
oyjord
Hangin' Around


Joined: Aug 25, 2006
Posts: 44

PostPosted: Fri May 16, 2008 10:01 am Reply with quote Back to top

** 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.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum