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
  #242  
Old 03-18-2005, 11:59 AM
lefthome's Avatar
lefthome lefthome is offline
 
Join Date: Feb 2005
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
Yes, I understood what you want, but this hack cannot do that (nor will it be changed).
Thanks anyway. Like I said the hack is very nice.
Reply With Quote
  #243  
Old 03-19-2005, 05:51 AM
sim tech sim tech is offline
 
Join Date: Jan 2005
Location: Georgia
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed nicely on 3.0.7... took about 3 minutes.

I noticed in my index.php I had also installed the:
"Members who have posted today" hack... you must be the same "Paul" that created that impressive one as well? My users loved that one, so I'm sure they'll be just as impressed with this latest one.

One question though (and I apologize for this) but I am a php noob and I've tried several things & all failed:

On both mods, The string:
PHP Code:
WHERE lastactivity " .$cutoff. " ORDER BY username" ); 
What the heck is the correct word to use (in place of username) if I want the names to be sorted by what time they logged in, instead of alphabetically?

Thanks-
Reply With Quote
  #244  
Old 03-20-2005, 03:42 AM
sim tech sim tech is offline
 
Join Date: Jan 2005
Location: Georgia
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I may have a clue as to what the one poster was talking about as far as it not working.

Maybe he has both of your mods just like me. I found that if the
Total members that have posted today
and the
Total users that have visited today

had both of their time set to reset at midnight (not rolling 24 hours) then one of them would not work, typically the Total users that have visited today one. ( Is this because of where it's placed in reference to the other?

So I changed one to show the rolling 24 hours, and the other was just on regular time, and they both started working.

At least that's how it appeared on this end.
:alien:

PHP Code:

// ############### Paul M - Who has visited today v1.40 #################

require_once('./includes/functions_misc.php');
$now TIMENOW intval($vboptions['hourdif']);
//$cutoff = vbmktime(0, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
$cutoff $now 86400 ;  // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysusers $DB_site->query("SELECT userid, lastactivity, options, username, opentag, closetag
FROM " 
TABLE_PREFIX "user as user
LEFT JOIN " 
TABLE_PREFIX "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastactivity > " 
.$cutoff" ORDER BY username" ); 

$totaltoday 0;
while (
$today $DB_site->fetch_array($todaysusers))
{
    
$today[visible] = ;
    
$totaltoday += 1;
    if (
$today[options] & $_USEROPTIONS[invisible]) 
    {
        
$today[visible] = ;
        if ((
$permissions['genericpermissions'] & CANSEEHIDDEN) OR $today['userid'] == $bbuserinfo['userid'])
        {
            
$today[visible] = ;
        }
    }
    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($whotoday0strlen($whotoday)-2);
}

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



// ############# Paul Marsden - Who has posted today v1.40 ###############
$now TIMENOW ;
require_once(
'./includes/functions_misc.php');
$cutoff vbmktime(000vbdate('m'$nowfalsefalse), vbdate('d'$nowfalsefalse), vbdate('Y'$nowfalsefalse));
//$cutoff = $now - 86400 ;  // Uncomment this line if you want a rolling last 24 hours.
$todaysposters $DB_site->query("SELECT userid, lastpost, options, username, opentag, closetag
FROM " 
TABLE_PREFIX "user as user
LEFT JOIN " 
TABLE_PREFIX "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastpost > " 
.$cutoff" ORDER BY username" ); 

unset (
$posttoday);
$posterstoday 0;
while (
$today $DB_site->fetch_array($todaysposters))
{
    
$today[visible] = ;
    
$posterstoday += 1;
    if (
$today[options] & $_USEROPTIONS[invisible]) 
    {
        
$today[visible] = ;
        if ((
$permissions['genericpermissions'] & CANSEEHIDDEN) OR $today['userid'] == $bbuserinfo['userid'])
        {
            
$today[visible] = ;
        }
    }
    if (
$today[visible]) 
    {
               
$wrdate vbdate($vboptions['timeformat'], $today['lastpost']);
        
$posttoday .= "<a href='search.php?do=finduser&u=$today[userid]' title='$wrdate' >";
        if (
$today[visible] == 2
        {
            
$posttoday .= $today['opentag'].$today[username].$today['closetag']."</a>*, ";
        }
        else 
        {
            
$posttoday .= $today['opentag'].$today[username].$today['closetag']."</a>, ";
        }
    }
}
if (
$posttoday)
{
    
$posttoday substr($posttoday0strlen($posttoday)-2);
}
// ############# End of Who has posted today ############### 
Reply With Quote
  #245  
Old 03-26-2005, 12:51 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

Quote:
Originally Posted by sim tech
On both mods, The string:
PHP Code:
WHERE lastactivity " .$cutoff. " ORDER BY username" ); 
What the heck is the correct word to use (in place of username) if I want the names to be sorted by what time they logged in, instead of alphabetically?

Thanks-
You need to use 'lastvisit' - however, you also need to add this field to the SELECT statement before it will work.
Reply With Quote
  #246  
Old 03-26-2005, 12:52 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

Quote:
Originally Posted by sim tech
Maybe he has both of your mods just like me. I found that if the
Total members that have posted today
and the
Total users that have visited today

had both of their time set to reset at midnight (not rolling 24 hours) then one of them would not work, typically the Total users that have visited today one. ( Is this because of where it's placed in reference to the other?

So I changed one to show the rolling 24 hours, and the other was just on regular time, and they both started working.

At least that's how it appeared on this end.
There is no reason both should not work, they do here. I did make a small change to the way the midnight cutoff is calculated a while back - you need v1.40 of the 'last visited' and v1.50 of the 'last posted' to pickup this change.
Reply With Quote
  #247  
Old 03-28-2005, 11:53 AM
Julie's Avatar
Julie Julie is offline
 
Join Date: Mar 2005
Location: Oslo, Norway
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hm, I didn't reply to this one!

Lol, just have to say I did one NEWBIE'ish thing on this one... I couldn't understand why it didn't work, but.. lol, I had forgotten to upload the index.php ... *bangs head in keyboard*

But, great hack! Works like a charm (as soon as you upload the index.php :P) Thanks!
Reply With Quote
  #248  
Old 03-28-2005, 02:56 PM
sim tech sim tech is offline
 
Join Date: Jan 2005
Location: Georgia
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
You need to use 'lastvisit' - however, you also need to add this field to the SELECT statement before it will work.

Thank you sir. The SELECT part is what I got burned on!
Reply With Quote
  #249  
Old 03-31-2005, 07:52 PM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Paul, great hack - quick question though. I also have (had) your who's in chat for flashchat installed, but intstalling this munged the if conditional in the forumhome template. Any idea how to amend the template to allow both to work?

Thanks.
Reply With Quote
  #250  
Old 03-31-2005, 08:43 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

Not sure what you mean - but I have both installed - this is what the relevant section looks like;

Code:
<if condition="$show['loggedinusers']">

<!-- 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 -->

<!-- who's in flashchat -->
<tbody>
	<tr>
		<td class="thead" colspan="2">
			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_chatusers')"><img id="collapseimg_forumhome_chatusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_chatusers].gif" alt="" border="0" /></a>
			Members currently in the Chat: $totalchatters
		</td>
	</tr>
</tbody>
<tbody id="collapseobj_forumhome_chatusers" style="$vbcollapse[collapseobj_forumhome_chatusers]">
	<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">$chatters</div></td>
	</tr>
</tbody>
<!-- end who's in flashchat -->

<!-- logged-in users -->
<tbody>
	<tr>
		<td class="thead" colspan="2">
			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a>
			<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>
	</tr>
</tbody>
<tbody id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]">
	<tr>
		<td class="alt2"><a href="online.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="$vbphrase[view_whos_online]" border="0" /></a></td>
		<td class="alt1" width="100%">
			<div class="smallfont">
				<div style="white-space: nowrap"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div>
				<div>$activeusers</div>
			</div>
		</td>
	</tr>
</tbody>
<!-- end logged-in users -->
HTH.
Reply With Quote
  #251  
Old 03-31-2005, 09:08 PM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My own fault, I have a stray closing tag for a conditional and couldn't see what was going on. Thanks for your help. Both additions are great.

/me clicks install.
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 09:45 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.11778 seconds
  • Memory Usage 2,377KB
  • 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
  • (1)bbcode_code
  • (3)bbcode_php
  • (4)bbcode_quote
  • (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
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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