mzonas

Topic: [mod release] Last 24 hours visited users

Title: Last 24 hours visited users
Description: Lists all users who have visited the forum last 24 hours.
Author: mzonas (mzonas1989@gmail.com)
Admin Notes: I didn't copy anyone's work. I just made it by myself as I didn't see any other mod like this.
Installation:

open footer.php

-----[FIND]-----
        // If there are registered users logged in, list them
        if (count($users) > 0)
            echo "\t\t\t".'<p>'.implode(', ', $users).'</p>'."\n";

?>
        </div>
<?php

    }

-----[ADD, AFTER]-----
        // 24 last visitors
        $query_time = time() - 86400;
        $query = array(
            'SELECT' => 'u.id, u.username',
            'FROM' => 'users AS u',
            'WHERE' => 'u.last_visit >= \'$query_time\' AND u.id > 1',
            'ORDER BY' => 'u.username'
        );

        $result = $db->query_build($query, true) or error(__FILE__, __LINE__);
        $num_users_last24 = 0;
        $users24 = array();

            while ($pun_last24_users = $db->fetch_assoc($result))
            {
                if ($pun_last24_users['id'] > 1)
                    $users24[] = '<a href="'.pun_link($pun_url['user'], $pun_last24_users['id']).'">'.htmlspecialchars($pun_last24_users['username']).'</a>';
                    ++$num_users_last24;
            }

?>
            <div id="onlinelist">
                <h3><?php printf($lang_index['Online24'], $num_users_last24) ?></h3>

<?php

            if ($num_users_last24 > 0)
                echo "\t\t\t".'<p>'.implode(', ', $users24).'</p>'."\n";

?>

        </div>

open lang/English/index.php

-----[FIND]-----
'Online'                =>    '<strong>Online</strong> ( Guests: <strong>%s</strong> | Registered users: <strong>%s</strong> )',    // As in "Online: User A, User B etc."

-----[ADD, AFTER]-----
'Online24'              =>  '%s users have visited the forums last 24 hours: ',

All you have to do now is to save your files and upload to your server. Enjoy wink

驕傲立陶宛語!

kierownik

Re: [mod release] Last 24 hours visited users

Why not make an extensions of it hmm

Kierownik's FluxBB Extensions

mzonas

Re: [mod release] Last 24 hours visited users

well, don't know how to do it mad, anyway, I think if you use a several extentions, they could not be friendly with others ... that's why it's better to have manually installed mod.

驕傲立陶宛語!

elbekko

Re: [mod release] Last 24 hours visited users

Are you serious?
The whole point of extensions is that you don't have to modify the source code. You can disable them if they clash, and tell the developers.

mzonas

Re: [mod release] Last 24 hours visited users

hmm ... I have got to read about them ... learn how to make then ... smile

驕傲立陶宛語!

HOLLYWOOD

Re: [mod release] Last 24 hours visited users

Any chance of a release of this for RC?

http://img229.imageshack.us/img229/7513/vistakq6.gif

lie2815

Re: [mod release] Last 24 hours visited users

I wrote a little tutorial here:
http://lie2815.heliohost.org/?article=3

FluxHosting - host your free FluxBB forum!

Anatoly

Re: [mod release] Last 24 hours visited users

lie2815 wrote:

I wrote a little tutorial here:
http://lie2815.heliohost.org/?article=3

Nice tutorial, though you may update it adding hook priorities and extension dependencies.

PS: "01. How to create a simple extension" moved down under all other blocks possibly because of "Code:" block being too wide (FF3 @ 1680x1050).

Carpe diem

mrse0

Re: [mod release] Last 24 hours visited users

hey please make an extension of this!

Leeds and Reading Festival 2008 - My Carling Weekend 2008 Website. Uses PunBB!

Anatoly

Re: [mod release] Last 24 hours visited users

mrse0 wrote:

hey please make an extension of this!

It is already in development: pun_stat.
Will be done in a week or so.

Carpe diem

mrse0

Re: [mod release] Last 24 hours visited users

awesome

Leeds and Reading Festival 2008 - My Carling Weekend 2008 Website. Uses PunBB!