Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
24h Visitors' Statistics (members and guests) Details »»
24h Visitors' Statistics (members and guests)
Version: 1.00, by Olsufr Olsufr is offline
Developer Last Online: Mar 2005 Show Printable Version Email this Page

Version: 3.0.6 Rating:
Released: 02-12-2005 Last Update: Never Installs: 28
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 04-27-2005, 08:19 AM
bmroyer bmroyer is offline
 
Join Date: Dec 2004
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
Step 3. ##################################################################

Add new phrase

Phrase Type: GLOBAL
Varname: active_users_24h
Text: Total users last {1}h
Where do I do that at? which file?
Reply With Quote
  #33  
Old 04-27-2005, 08:23 AM
ALcorn ALcorn is offline
 
Join Date: Oct 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bmroyer
Where do I do that at? which file?
Do it in phrase manager in your Admin Control Panel
Reply With Quote
  #34  
Old 04-27-2005, 08:33 AM
bmroyer bmroyer is offline
 
Join Date: Dec 2004
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks much
Reply With Quote
  #35  
Old 04-27-2005, 11:09 PM
bmroyer bmroyer is offline
 
Join Date: Dec 2004
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just had a database error, I didn't think it was caused by this mod until now. My site just came back up, and I noticed that the users within 24 hours reset and is now at 1 hour.

Here is the error i got:

Quote:
<html><head><title> Database Error</title><style type="text/css"><!--.error { font: 11px tahoma, verdana, arial, sans-serif; }--></style></head><body></table></td></tr></table></form><blockquote><p class="error">&nbsp;</p><p class="error"><b>There seems to have been a slight problem with the database.</b><br />Please try again by pressing the <a href="javascript:window.location=window.location;" >refresh</a> button in your browser.</p><p class="error">An E-Mail has been dispatched to our <a href="mailto:bmroyer@gmail.com">Technical Staff</a>, who you can also contact if the problem persists.</p><p class="error">We apologise for any inconvenience.</p></blockquote><!--Database error in vBulletin :Link-ID == false, connect failedmysql error: mysql error number: 0Date: Wednesday 27th of April 2005 04:27:45 PMScript: http://www.unknownwriters.net/index.phpReferer: IP Address: 68.83.38.219 --></body></html>
Reply With Quote
  #36  
Old 04-28-2005, 07:51 AM
ALcorn ALcorn is offline
 
Join Date: Oct 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bmroyer
I just had a database error, I didn't think it was caused by this mod until now. My site just came back up, and I noticed that the users within 24 hours reset and is now at 1 hour.
This error is not related to this mod, but I have also noticed that the 24H Visitors stats are reset when the database is out, so let's say "it's by design".
Reply With Quote
  #37  
Old 04-28-2005, 12:34 PM
bmroyer bmroyer is offline
 
Join Date: Dec 2004
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ALcorn
This error is not related to this mod, but I have also noticed that the 24H Visitors stats are reset when the database is out, so let's say "it's by design".
so then what is the problem? I had the old vbadvanced, and deleted the cms index, then replaced with the new version of the cms index..would that be why?
Reply With Quote
  #38  
Old 04-28-2005, 01:15 PM
ALcorn ALcorn is offline
 
Join Date: Oct 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bmroyer
so then what is the problem? I had the old vbadvanced, and deleted the cms index, then replaced with the new version of the cms index..would that be why?
Again, your problem is related to the connectivity to your MySQL database and not to this mod, so we could't help you in this topic. Sorry.
Reply With Quote
  #39  
Old 05-05-2005, 08:07 PM
arob42 arob42 is offline
 
Join Date: Nov 2004
Location: Dallas
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this hack be modified to report unique visits by members and guests? If not, any pointers before I go in and attempt the modification myself? Sure appreciate your help. Thanks.

--Robert
Reply With Quote
  #40  
Old 01-06-2006, 12:15 AM
DesiFlavour DesiFlavour is offline
 
Join Date: Jul 2004
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The instructions on the initial post by the author and the ones in the attached text file are different, which ones am i suppose to follow? I've followed the ones from the attached file only and the mod doesn't seem right... figures its showing simply cannot be accurate.

Help please?
Reply With Quote
  #41  
Old 03-29-2006, 11:23 AM
photongbic photongbic is offline
 
Join Date: Oct 2005
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this work with vB 3.5.4?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:23 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04978 seconds
  • Memory Usage 2,328KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (4)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete