Back to vBulletin 3.0 Add-Ons

24h Visitors' Statistics (members and guests)
Mod Version: 1.00, by Olsufr

This modification is in the archives.
vB Version: 3.0.6 Rating: (1 vote - 5.00 average) Installs: 28
Released: 13 Feb 2005 Last Update: Never Downloads: 30
Not Supported  

A very simple display of statistics of all visitors (members and guests) who have visited the forum last 24 hours.

It displays the statistics on Forum Home in the section of "Users online":

example: " Total users last 24h: 2692 (members : 741, guests : 1951) "

There is no additional SQL query.

----------------------------------

Installation (there is in attached file)

Step 1

In index.php

Find:

PHP Code:
    $show['loggedinusers'] = true;
}
else
{
    
$show['loggedinusers'] = false;

And insert this code before it:

PHP Code:
    // ############# Oleg Subel - 24h visitors' statistics ###############

    
$datecut24 TIMENOW 86400;
    
$numberregistered24 0;
    
$numberguest24 0;

    
$forumusers24 $DB_site->query("
        SELECT userid, lastactivity FROM " 
TABLE_PREFIX "session
        WHERE lastactivity > 
$datecut24
    "
);

    
$time24 TIMENOW ;
    while (
$loggedin24 $DB_site->fetch_array($forumusers24))
    {
        
$userid24 $loggedin24['userid'];
        if (!
$userid24)
        {    
// Guest
            
$numberguest24++;
        }
        else
        {
            
$numberregistered24++;
        }
        if (
$loggedin24['lastactivity'] < $time24)
        {
            
$time24 $loggedin24['lastactivity'];
        }
    }
    
$time24 TIMENOW $time24;
    
$time24 floor($time24 3600) + (($time24 3600) ? 0);

    
$numbertotal24 $numberregistered24 $numberguest24;

    
// memory saving
    
unset($loggedin24);
    
$DB_site->free_result($forumusers24);
    
// ############# End of 24h visitors' statistics ############### 
Step 2

In includes/cron/cleanup.php
and in includes/cron/cleanup2.php

Find:

PHP Code:
$DB_site->query("
    ### Delete stale sessions ###
    DELETE FROM " 
TABLE_PREFIX "session
    WHERE lastactivity < " 
intval(TIMENOW $vboptions['cookietimeout'])
); 
And replace with this code:

PHP Code:
$DB_site->query("
    ### Delete stale sessions ###
    DELETE FROM " 
TABLE_PREFIX "session
    WHERE lastactivity < " 
intval(TIMENOW 86400)
); 
// modified by Oleg S.for 24h visitors' statistics 
Step 3

Add new phrase

Phrase Type: GLOBAL
Varname: active_users_24h
Text:
Code:
Total users last {1}h
Step 4

FORUMHOME template modification

Find:

Code:
			<a href="online.php?$session[sessionurl]">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
		</td>
and replace with:

Code:
			<a href="online.php?$session[sessionurl]">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
			&nbsp;&nbsp;&nbsp;&nbsp;<phrase 1="$time24">$vbphrase[active_users_24h]</phrase>: $numbertotal24 (<phrase 1="$numberregistered24" 2="$numberguest24">$vbphrase[x_members_and_y_guests]</phrase>)
		</td>
END

Download

This modification is archived and cannot be downloaded.

Screenshots

 

Similar Mods

Mini Mods Scare your members and visitors! ^^ vBulletin 3.6 Template Modifications
Adsense, different sizes for visitors to members vBulletin 3.6 Template Modifications
Adsense, different sizes for visitors to members – under last post vBulletin 3.5 Template Modifications

vblts.ru supports vBulletin®, 2022-2024