Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Visitor Totals Last 24hrs Details »»
Visitor Totals Last 24hrs
Version: 1.02, by tcs tcs is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: 3.5.1 Rating:
Released: 11-12-2005 Last Update: 11-15-2005 Installs: 34
Uses Plugins Template Edits
Code Changes  
No support by the author.

ported for 3.5.x.

It's a cool hack if you like to look at your total hits in a 24hr day from both members and guests.

1 PHP Modification to includes/cleanup.php
1 Template Mod. to Forumhome
1 Product Pluggin

Instructions and XML are in the zip.

I will support this hack but should be much trouble with it. Been running it since vB 2.2 I think.

When you first install this hack it will only track from the time the last sessions cleanup was completed. After a sessions cleanup it will start over or reset to 1hr again. Then track the hours in increments for 24hrs. Then clean out the sessions table and start over again. Sessions cleanups should normally occur at midnight.

This hack works if you remove the old code in the cleanup.php and replace it with the new information in the readme.

For information cleanout2.php dose not run hourly like implied in the cron tab. It is set for 5 min after midnight. Jelsoft set it that way and not sure why it is titled a hourly cleanup in the scheduled task. In any event it is needed to reset the script for the next day.

Good luck and I will do my best to answer any questions.

Thanks to Paul M. for pointing out a bug I kept overlooking.

Show Your Support

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

Comments
  #22  
Old 11-14-2005, 05:45 AM
bspiller82's Avatar
bspiller82 bspiller82 is offline
 
Join Date: Jul 2002
Location: McHenry, Illinois
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I fix mine?

Code:
$vbulletin->db->query_write("
	DELETE FROM " . TABLE_PREFIX . "cpsession
	WHERE dateline < " . intval(TIMENOW - 3600) . "
	### Delete stale cpsessions ###
Is giving me this error
Code:
Parse error: parse error, unexpected ']' in /home/a247xtre/public_html/forums/includes/cron/cleanup.php on line 26
Reply With Quote
  #23  
Old 11-14-2005, 09:31 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by caliman
Is this mod compatible with 'who has visited today?'

https://vborg.vbsupport.ru/showthread.php?t=82769
I can't see any reason that this would intefere with my hack.
Reply With Quote
  #24  
Old 11-14-2005, 12:42 PM
caliman's Avatar
caliman caliman is offline
 
Join Date: Jan 2005
Location: California
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Paul.
Reply With Quote
  #25  
Old 11-14-2005, 12:48 PM
caliman's Avatar
caliman caliman is offline
 
Join Date: Jan 2005
Location: California
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey, mine doesn't seem to work right... if you stay on the site for a while it keeps recounting you as a member and it doesn't seem to go over 1 hour (it's been on past midnight now):

Total users last 1hrs : 13 (10 members and 3 guests)

Any ideas?
Reply With Quote
  #26  
Old 11-14-2005, 12:58 PM
lexx27's Avatar
lexx27 lexx27 is offline
 
Join Date: May 2005
Location: Athens
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have the same problem.
Reply With Quote
  #27  
Old 11-14-2005, 02:06 PM
TTG's Avatar
TTG TTG is offline
 
Join Date: May 2004
Location: Sth London
Posts: 1,042
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by caliman
Hey, mine doesn't seem to work right... if you stay on the site for a while it keeps recounting you as a member and it doesn't seem to go over 1 hour (it's been on past midnight now):

Total users last 1hrs : 13 (10 members and 3 guests)

Any ideas?
Same problem on mine !?
Reply With Quote
  #28  
Old 11-14-2005, 06:50 PM
mclark2112's Avatar
mclark2112 mclark2112 is offline
 
Join Date: Sep 2002
Location: Eastern USA
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still a problem in IE in the Dark Blue style...Map is all over the place.
Reply With Quote
  #29  
Old 11-14-2005, 08:05 PM
tcs's Avatar
tcs tcs is offline
 
Join Date: Jun 2002
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
$vbulletin->db->query_write("
	DELETE FROM " . TABLE_PREFIX . "session
	WHERE lastactivity < " . intval((TIMENOW - 86400]) . "
        ### Delete stale sessions ###
Is the code to use in cleanup.php only. Do not change what is in cleanup2.php.

I run "who was online today" and have had no issues or conflicts with them working together.

I just installed this on 3 other boards in an attempt to duplicate this problem. So far they are working fine.

Check your cleanup2.php and make sure you did not change the original code. This is the only hack I know that changes the cleanup.php you can re upload a new copy and try again to see if that fixes it.
Reply With Quote
  #30  
Old 11-14-2005, 08:33 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Typo in the install file.

Code:
$vbulletin->db->query_write("
	DELETE FROM " . TABLE_PREFIX . "session
	WHERE lastactivity < " . intval((TIMENOW - 86400]) . "
        ### Delete stale sessions ###
Should be
Code:
$vbulletin->db->query_write("
	DELETE FROM " . TABLE_PREFIX . "session
	WHERE lastactivity < " . intval((TIMENOW - 86400)) . "
        ### Delete stale sessions ###
Reply With Quote
  #31  
Old 11-14-2005, 08:47 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have NOT been able to test this fully. Or even more than making sure it has no parse errors and the numbers add up. But, here is the plugin code for this mod for those of you using my spider's on the forumhome page.

The forumhome template code needs to change as well. My target audience will know how to do that

Code:
    $datecut24 = TIMENOW - 86400;
	$numberregistered24 = 0;
	$numberguest24 = 0;
	$numberspiders24 = 0;

	$forumusers24 = $vbulletin->db->query("
		SELECT userid, lastactivity, useragent FROM " . TABLE_PREFIX . "session
		WHERE lastactivity > $datecut24
	");

	$time24 = TIMENOW ;
	while ($loggedin24 = $vbulletin->db->fetch_array($forumusers24))
	{
		$userid24 = $loggedin24['userid'];
		if (!$userid24)
		{	// Guest or spider
		  if (!empty($vbulletin->wol_spiders))
	    {
	   	   if (preg_match('#(' . $vbulletin->wol_spiders['spiderstring'] . ')#si', $loggedin24['useragent'], $agent))
	   	   {
	   	      $numberspiders24++;
	   	   }
	   	   else 
	   	   {
			      $numberguest24++;
			   }
			 }
		}
		else
		{
			$numberregistered24++;
		}
		if ($loggedin24['lastactivity'] < $time24)
		{
			$time24 = $loggedin24['lastactivity'];
		}
	}
	$time24 = TIMENOW - $time24;
	$time24 = floor($time24 / 3600) + (($time24 % 3600) ? 1 : 0);

	$numbertotal24 = $numberregistered24 + $numberguest24 +$numberspiders24;

	unset($loggedin24);
	$vbulletin->db->free_result($forumusers24);
Reply With Quote
Reply


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 03:28 PM.


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.08667 seconds
  • Memory Usage 2,316KB
  • 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
  • (6)bbcode_code
  • (2)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
  • (4)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