Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Members who have visited today (with last 24 hours option). Details »»
Members who have visited today (with last 24 hours option).
Version: 2.31, by Paul M Paul M is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.x Rating:
Released: 11-08-2004 Last Update: 07-23-2005 Installs: 627
 
No support by the author.

This modification is no longer available or supported.

A very simple display of all members who have visited the forum 'today' (i.e. since midnight). I looked at the existing hacks that apparently do this, and they either seemed over complicated or had a lot of problems, so I wrote my own simple version.


The main features of Version 2.xx are ;

1. It displays the list on Forum Home under the "Users online" display.

2. The list view is collapsable, so you just see the number.

3. Invisible users are only displayed to those allowed to see them (with a "*")

4. Users who should display as coloured or bold etc should be displayed correctly. (based on the display usergroup)

5. If you 'hover' over a username it will show the time they were last active.

6. The list is in member name order.


If you prefer, then there is an option to make this hack display a rolling 24 hours - un-comment the relevant line in the code.


Addons:
ericgtr has created a CMPS module for this hack, you will find the files here.
paul41598 has created a pop-up display instead of the collapsable display, you will find the files here.

Show Your Support

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

Comments
  #602  
Old 07-30-2006, 11:42 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The version for 3.6 was released last week.

https://vborg.vbsupport.ru/showthread.php?t=121883
Reply With Quote
  #603  
Old 04-17-2008, 04:27 AM
bornic bornic is offline
 
Join Date: Apr 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

error on VBulletin 3.6.9 Version
Reply With Quote
  #604  
Old 04-17-2008, 04:29 AM
bornic bornic is offline
 
Join Date: Apr 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Solve:

Code:
Step 1.

In Index.php ;

Find ;

// ### LOGGED IN USERS #################################################

And insert this code above it ;

// ############### Paul M - Who has visited today v2.31 #################

$tnow = date('YmdHis',TIMENOW - $vboptions['hourdiff']); 
$cutoff = TIMENOW - (substr($tnow,8,2)*3600 + substr($tnow,10,2)*60 + substr($tnow,12,2)); 
//$cutoff = TIMENOW - 86400 ;  // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysusers = $db->query("SELECT userid, lastactivity, options, username, user.usergroupid, displaygroupid, 
groupa.opentag as opentaga, groupa.closetag as closetaga, groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " . TABLE_PREFIX . "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE lastactivity > " .$cutoff. " ORDER BY username" ); 

$totaltoday = 0;
unset ($whotoday);
while ($today = $db->fetch_array($todaysusers))
{
	$totaltoday += 1;
	$today['opentag'] = $today['opentaga'] ;
	$today['closetag'] = $today['closetaga'] ;
	if ($today['displaygroupid']) 
	{
		$today['opentag'] = $today['opentagb'] ;
		$today['closetag'] = $today['closetagb'] ;
	}
	$today[visible] = 1 ;
	if ($today['options'] & $_USEROPTIONS['invisible']) 
	{
		$today['visible'] = 0 ;
		if (($permissions['genericpermissions'] & CANSEEHIDDEN) OR $today['userid'] == $bbuserinfo['userid'])
		{
			$today['visible'] = 2 ;
		}
	}
	if ($today['visible']) 
	{
       	$wrdate = vbdate($vboptions['timeformat'], $today['lastactivity']);
		$whotoday .= "<a href='member.php?u=$today[userid]' title='$wrdate' >";
		if ($today['visible'] == 2) 
		{
			$whotoday .= $today['opentag'].$today['username'].$today['closetag']."</a>*, ";
		}
		else 
		{
			$whotoday .= $today['opentag'].$today['username'].$today['closetag']."</a>, ";
		}
	}
}
if ($whotoday)
{
	$whotoday = substr($whotoday, 0, strlen($whotoday)-2);
}

// ############# End of Who has visited today ###############


Step 2.

In the FORUMHOME Template ;

Find;

<!-- end logged-in users -->


and add after;

<!-- Todays active users -->
<tbody>
	<tr>
		<td class="thead" colspan="2">
			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_todayusers')"><img id="collapseimg_forumhome_todayusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_todayusers].gif" alt="" border="0" /></a>
			Total users that have visited today: $totaltoday
		</td>
	</tr>
</tbody>
<tbody id="collapseobj_forumhome_todayusers" style="$vbcollapse[collapseobj_forumhome_todayusers]">
	<tr>
		<td class="alt2"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="Users online today" border="0" /></td>
		<td class="alt1" width="100%"><div class="smallfont">$whotoday</div></td>
	</tr>
</tbody>
<!-- Todays active users -->


Step 3.

This is optional, but will speed up the query if you have a large number of members;

Run the following SQL query;


ALTER TABLE user ADD INDEX (lastactivity)
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 02:01 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.10304 seconds
  • Memory Usage 2,243KB
  • Queries Executed 18 (?)
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
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)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