PDA

View Full Version : Members who have visited today (with last 24 hours option).


Pages : [1] 2 3

Paul M
09 Nov 2004, 23:26
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 (http://www.vbulletin.org/forum/showthread.php?p=652148).
paul41598 has created a pop-up display instead of the collapsable display, you will find the files here (http://www.vbulletin.org/forum/showthread.php?p=724321).

wrongful
10 Nov 2004, 01:57
Works nice, thanks.

AN-net
10 Nov 2004, 04:57
any screenshots?

Sweet Evil
10 Nov 2004, 09:38
Nice and simple thanks.

Paul M
10 Nov 2004, 09:38
any screenshots?added.

DutchyNL
10 Nov 2004, 12:37
Nice one thanks for your greath share ;-)

Floris
10 Nov 2004, 15:24
Database error in vBulletin 3.0.3:

Invalid SQL: SELECT userid, lastactivity, options, username,opentag,closetag
FROM vb3_user
LEFT JOIN vb3_usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastactivity > 1100037600
mysql error: Unknown table 'user' in on clause

mysql error number: 1109Oopsy?

sabret00the
10 Nov 2004, 15:34
is this available for the WOL instead of the forumhome?

RaZor Edge
10 Nov 2004, 15:40
I've just install this hack...

I have run the SQL query...

But on my forum home... it show that all my members have come online today (1898 on 1898)

What's wrong???

Paul M
10 Nov 2004, 16:17
Oopsy?Indeedy. :disappointed:

Almost certainly a table prefix problem as we don't use them, I'll confirm this for you tonight, when I have access to my dev system, and update the query.

Paul M
10 Nov 2004, 16:23
But on my forum home... it show that all my members have come online today (1898 on 1898)

What's wrong???I have no idea, what times does it show for each member when you hover over them ?

RaZor Edge
10 Nov 2004, 16:25
I have no idea, what times does it show for each member when you hover over them ?It show only the time

Ex: 11h31 (a different time for everyone)

Paul M
10 Nov 2004, 16:26
is this available for the WOL instead of the forumhome?Not from me. You could do it, but it would mean moving the code to a different place, and then copying the relevant part of the template change - virtually a whole new version really.

Paul M
10 Nov 2004, 16:29
It show only the time

Ex: 11h31 (a different time for everyone)I take it you are sure they haven't all visited ?

If so, pick a few you are sure haven't, then look at the time when you hover over them, and then check their profiles to see what the Last Active date & time is.

I'll check back later.

RaZor Edge
10 Nov 2004, 16:32
I take it you are sure they haven't all visited ?

If so, pick a few you are sure haven't, then look at the time when you hover over them, and then check their profiles to see what the Last Active date & time is.

I'll check back later.
yes... it's impossible that all my members (100% of 1899) have come today at 11:31!! :nervous:

I will look at this.

RaZor Edge
10 Nov 2004, 16:37
Ok, the time is right... but not the date!!!

Ex:

user 1: 16:32 (Home index time)
Last activity: 11/06/2003 16h32 (in profil)

user 2: 22:00 (Home index time)
Last activity: 26/03/2003 22h00 (in profil)

I've try to re-install a clean version of functions_misc.php but the problem is still there.

I've try to change the date format to the american style, don't work neither...

(I use the latest version of vbulletin)

BarHopper
10 Nov 2004, 18:20
Isnt this, like exactly the same to Garys?

taffy056
10 Nov 2004, 21:08
Nice hack installed with no problems at all

Paul M
10 Nov 2004, 21:34
Database error in vBulletin 3.0.3:

Invalid SQL: SELECT userid, lastactivity, options, username,opentag,closetag
FROM vb3_user
LEFT JOIN vb3_usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastactivity > 1100037600
mysql error: Unknown table 'user' in on clause

mysql error number: 1109Oopsy?
Floris,

I believe that replacing the four lines of the SQL query with this should work.


$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. " ");


Please let me know and I will update the instructions.

Paul M
10 Nov 2004, 21:58
Ok, the time is right... but not the date!!!

Can you try replacing the day/month/year lines of the code with these;


$nowday = vbdate('d', $now. false, false);
$nowmonth = vbdate('m', $now. false, false);
$nowyear = vbdate('Y', $now. false, false);


If that fails then temporarily add the following line above the SQL query ;

echo "Cutoff = ".$cutoff;

this will cause the forumhome to display a line at the top saying something like

Cutoff = 1100044800

post the result back here we can see what cutoff date it has calculated.

RaZor Edge
11 Nov 2004, 07:36
Can you try replacing the day/month/year lines of the code with these;


$nowday = vbdate('d', $now. false, false);
$nowmonth = vbdate('m', $now. false, false);
$nowyear = vbdate('Y', $now. false, false);


If that fails then temporarily add the following line above the SQL query ;

echo "Cutoff = ".$cutoff;

this will cause the forumhome to display a line at the top saying something like

Cutoff = 1100044800

post the result back here we can see what cutoff date it has calculated.
I've made the change you ask, here,s the results:

Cutoff = -3601

I've got the same result if i don't apply the change

:(

Tradjick
11 Nov 2004, 07:45
Is it possible to show todays visits only to admin?

Paul M
11 Nov 2004, 08:37
I've made the change you ask, here,s the results:

Cutoff = -3601

I've got the same result if i don't apply the change

:(Well that makes no sense at all, clearly the wrong value, but it's calculated using standard vB functions.

Remove the ECHO line and replace it with this ;

echo "Today = ".$nowday."/".$nowmonth."/".$nowyear." : Now = ".$now;

and post the result back.

also, what OS are you running your forum on ?


Is it possible to show todays visits only to admin?Yes, just enclose the relevant template section with an "if" conditional.

Lethal
11 Nov 2004, 18:49
isn't this the same as who was online today?

http://www.vbulletin.org/forum/showthread.php?threadid=59579

Paul M
11 Nov 2004, 21:08
isn't this the same as who was online today?

http://www.vbulletin.org/forum/showthread.php?threadid=59579No.

It is similar but simpler, read the first post.

shadiguy1
11 Nov 2004, 22:36
here is my forumhome template im not sure wher ei should put the new info because i do have other hacks installed A whos in chat stuff is in there iw ill post if someone can take a look and let me know thanks it will be unmder the lines.
--------------------------------------------------------------------------------

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">

<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
$headinclude

<body>
$header
$navbar

<!-- top statistics box -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="xtreem/category/left.gif" width="97" height="45"> </td>
<td width="100%" valign="middle" background="xtreem/category/background.gif" class="alt5" ><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumbit_$forumid')"><img id="collapseimg_forumbit_$forumid" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forumid}.gif" alt="" border="0" /></a>
<center><a><b>Statistics - Top 5</b></a>
</center>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
</td>
<td><img src="xtreem/category/right.gif" width="85" height="45"></td>
</tr></table>

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">

<tbody id="collapseobj_forumhome_statistics" style="$vbcollapse[collapseobj_forumhome_statistics]">
<tr>
<td class="thead" width="23%" align="$stylevar[left]" nowrap>Top Posters</td>
<td class="thead" width="22%" align="$stylevar[left]" nowrap>Newest Members</td>
<td class="thead" width="55%" nowrap>Newest Replies
</td>
</tr>
<tr>
<td class="alt2" width="23%" valign="top">
<table>
<tr>
<td class="smallfont" width="100%">Member:</td>
<td class="smallfont" align="right" nowrap>Posts:</td>
</tr>
$stats_posters
</table>
</td>
<td class="alt1" width="22%" valign="top">
<table>
<tr>
<td class="smallfont" width="100%" nowrap>Member:</td>
<td class="smallfont" align="right" nowrap>Posts:</td>
</tr>
$stats_members
</table>
</td>
<td class="alt2" width="55%" valign="top">
<table>
<tr>
<td class="smallfont" width="70%" nowrap>Thread:</td>
<td class="smallfont" width="30%" nowrap>Last Poster:</td>
<td class="smallfont" align="right" nowrap>Views:</td>
<td class="smallfont" align="right" nowrap>Replies:</td>


</tr>


$stats_threads
</table>
</td>
</tr>
</tbody>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="xtreem/catbottom/left.gif" width="30" height="27"></td>
<td background="xtreem/catbottom/background.gif" width="100%"></td>
<td><img src="xtreem/catbottom/right.gif" width="33" height="27"></td>
</tr>
<!-- end top statistics box -->

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th scope="row">
<!-- Marquee Banner By VINNYCUZ -->
<center>
<font size=+1 color=white>
<marquee width=100% bgcolor=#424E62 behavior=left scrollamount="6"> NEXTEL ELITE LATEST NEWS: <a href=http://www.nextelelite.com/forums/flashchat/flashchat.php>Check out the new Chat Room</a> <font color=yellow>*****</font> <font color=White>Please Subscribe to Nextel Elite if you like the site this will enable us to add more features for you.</marquee>
</font>
</center>
<!-- Marquee Banner By VINNYCUZ -->
<!-- main -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">

<if condition="$show['guest']">
<!-- guest welcome message -->
<tr>
<td class="tcat" colspan="6"><phrase 1="$vboptions[bbtitle]">$vbphrase[welcome_to_the_x]</phrase></td>
</tr>
<tr>
<td class="alt1" colspan="6">
<phrase 1="faq.php?$session[sessionurl]" 2="register.php?$session[sessionurl]">$vbphrase[first_visit_message]</phrase>
</td>
</tr>
<!-- / guest welcome message -->
</if>
</table>
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
$forumbits
</table>
<!-- /main -->
<br><br>
<!-- what's going on box -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat" colspan="2">$vbphrase[whats_going_on]</td>
</tr>
</thead>
<if condition="$show['loggedinusers']">
<!-- logged-in users -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"$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_statusicon]/forum_link.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>
<tr>
<td class="thead" colspan="2">
<a href="http://www.nextelelite.com/forums/FlashChat/flashchat.php">Who's in Chat?</a>
</td>
</tr>
<tr>
<td class="alt2"><a href="online.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/icon_chat.gif" alt="Who's in chat?" border="0" /></a></td>
<td class="alt1" width="100%">
<div class="smallfont">

$chatwho
</div>
</td>
</tr>
</tbody>

<!-- end logged-in users -->
$todayloggedinusers
</if>

<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_stats')"><img id="collapseimg_forumhome_stats" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_stats].gif" alt="" border="0" /></a>
<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>
</td>

</tr>
</tbody>
<tbody id="collapseobj_forumhome_stats" style="$vbcollapse[collapseobj_forumhome_stats]">
<tr>
<td class="alt2">&nbsp;</td>
<td class="alt1" width="100%">
<div class="smallfont">
<div>$vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div>
<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
</div>
</td>
</tr>
</tbody>
<if condition="$show['birthdays']">
<!-- today's birthdays -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_birthdays')"><img id="collapseimg_forumhome_birthdays" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_birthdays].gif" alt="" border="0" /></a>
$vbphrase[todays_birthdays]
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_birthdays" style="$vbcollapse[collapseobj_forumhome_birthdays]">
<tr>
<td class="alt2"><a href="calendar.php?$session[sessionurl]do=getday&amp;day=$today&amp;sb=1"> <img src="$stylevar[imgdir_statusicon]/birthday.gif" alt="$vbphrase[view_birthdays]" border="0" /></a></td>
<td class="alt1"><div class="smallfont">$birthdays</div></td>
</tr>
</tbody>
<!-- end today's birthdays -->
</if>
<if condition="$show['upcomingevents']">
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_events')"><img id="collapseimg_forumhome_events" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_events].gif" alt="" border="0" /></a>
<if condition="$show['todaysevents']">$vbphrase[todays_events]<else /><phrase 1="$vboptions[showevents]">$vbphrase[upcoming_events_for_the_next_x_days]</phrase></if>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_events" style="$vbcollapse[collapseobj_forumhome_events]">
<tr>
<td class="alt2"><a href="calendar.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/calendar_icon.gif" alt="$vbphrase[calendar]" border="0" /></a></td>
<td class="alt1"><div class="smallfont">$upcomingevents</div></td>
</tr>
</tbody>
</if>
<tbody>
<tr>
<td class="tfoot" align="center" colspan="6"><div class="smallfont"><strong>
<a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a>
&nbsp; &nbsp;
<a href="showgroups.php?$session[sessionurl]">$vbphrase[view_forum_leaders]</a>
</strong></div></td>
</tr>
</tbody>
</table>
<br />


<!-- end what's going on box -->

<!-- icons and login code -->
<table cellpadding="0" cellspacing="2" border="0" width="100%">
<tr valign="bottom">
<td>
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_new.gif" alt="$vbphrase[contains_new_posts]" border="0" /></td>
<td class="smallfont">&nbsp; $vbphrase[forum_contains_new_posts]</td>
</tr>
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_old.gif" alt="$vbphrase[contains_no_new_posts]" border="0" /></td>
<td class="smallfont">&nbsp; $vbphrase[forum_contains_no_new_posts]</td>
</tr>
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_old_lock.gif" alt="$vbphrase[a_closed_forum]" border="0" /></td>
<td class="smallfont">&nbsp; $vbphrase[forum_is_closed_for_posting]</td>
</tr>
</table>
</td>
<if condition="!$show['guest']">
<!-- member logout -->
<td align="$stylevar[right]"><a href="login.php?$session[sessionurl]do=logout" onclick="return log_out()"><phrase 1="$bbuserinfo[username]">$vbphrase[log_out_x]</phrase></a></td>
<!-- end member logout -->
</if>
</tr>
</table>
<!-- / icons and login code --></th>
</tr>
</table>
$footer
</body>
</html>

Paul M
12 Nov 2004, 00:02
here is my forumhome template im not sure wher ei should put the new info because i do have other hacks installed A whos in chat stuff is in there iw ill post if someone can take a look and let me know thanks it will be unmder the lines.Yes, you have hacked it about a bit.

Try modyfing it as follows ;

After ;

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

Add below;


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

shadiguy1
12 Nov 2004, 01:09
Yes, you have hacked it about a bit.

Try modyfing it as follows ;

After ;

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

Add below;


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

thankls that worked out for me much appreciated bro. anyway to get it alphabetised.?

Paul M
12 Nov 2004, 12:36
thankls that worked out for me much appreciated bro. anyway to get it alphabetised.?Yes, if you replace the WHERE line of the SQL with this ;

WHERE lastactivity > " .$cutoff. " ORDER BY username" );

It will now show them alphabetically. I have made this the default in v1.03

RWDF1
12 Nov 2004, 13:19
Nice, installed, now I can monitor who has been on, and who hasnt posted etc, I have found people are logging in to use the arcade and not post anything.

RaZor Edge
12 Nov 2004, 20:17
Well that makes no sense at all, clearly the wrong value, but it's calculated using standard vB functions.

Remove the ECHO line and replace it with this ;

echo "Today = ".$nowday."/".$nowmonth."/".$nowyear." : Now = ".$now;

and post the result back.

also, what OS are you running your forum on ?

here's the result:

Today = d/m/Y : Now = 1100290578

My host is on UNIX... I think....

Thank you for taking time to help me with this... :nervous:

Paul M
12 Nov 2004, 22:24
here's the result:

Today = d/m/Y : Now = 1100290578
Then the calls to vbdate are failing.

I have no idea why - but I notice you are using vB 3.0.1 - so maybe it's something to do with that.


There are two choices ;

1. Try and find out why the vbdate calls are failing.

or

2. Do this quick hack ;

Replace the $cutoff line with this;


$cutoff = $now - 86400;


This will show the visitors in the last 24 hours rather than since midnight.

FleaBag
13 Nov 2004, 02:46
Simplicity in it's greatest form! Just what I was looking for... Thanks. :)

jos
13 Nov 2004, 17:45
Hi,

Is there anyway to see a record of nr of visitors (non registered) who visited a community... i get everyday lots of registered and non registered visitors... i can see now with 3.0.3 a snapshot of one day, the day i am viewing, but i have no idea how many came yesterday, or the day before or a week before.

is there anyway to hack this, to get something like this on the forums index page?

thanks
jos

Paul M
13 Nov 2004, 20:52
Hi,

Is there anyway to see a record of nr of visitors (non registered) who visited a community... i get everyday lots of registered and non registered visitors... i can see now with 3.0.3 a snapshot of one day, the day i am viewing, but i have no idea how many came yesterday, or the day before or a week before.

is there anyway to hack this, to get something like this on the forums index page?

thanks
josSorry, I have not seen such a hack anywhere.

dieselpowered
15 Nov 2004, 07:51
Thanks, works like a champ!

etaslim
16 Nov 2004, 11:54
installed! works great with no problem at all

internetjunkie
17 Nov 2004, 01:25
thank you kindly

cdoyle
17 Nov 2004, 02:22
Worked great!!
Thanks

Carnage Media
17 Nov 2004, 06:44
is there a way that this can be made to open in a new window? it would have the totals for the day and keep a history but you would click on it to show all the names?

Paul M
17 Nov 2004, 09:56
is there a way that this can be made to open in a new window? it would have the totals for the day and keep a history but you would click on it to show all the names?I'm sure it could, but not by me I'm afraid, Sorry.

Viks
18 Nov 2004, 01:22
Action: Installed (thalforum.com)

Comments: Easy installation, easy to follow instructions, works as said.

Issues:
I'm running vB3.0.3 but i cud not get it to run using the following:-
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false));

INSTEAD i had to use the following:
$cutoff = $now - 86400 ; which shows users during last 24 hrs.

Suggestions:
1. If you can further modify this almost perfect mod to
- function with CMPS
- Admin's can modify to show "who was online in last XX hours"
- Instead of showing phrase "Total users that have visited today:" - it wud show who was online in last XX hrs (depending on the hack).

... specially - function with CMPS


Thanks paul.

Vik

Paul M
18 Nov 2004, 17:28
Sorry, I have no idea what CMPS is .....

Viks
18 Nov 2004, 17:40
Sorry, I have no idea what CMPS is .....

sorry about that.

vBadvanced CMPS (Content Management & Portal System)
http://www.vbadvanced.com/products.php?

Its a very popular portal system for vB and many boards use it. If only u cud assist me getting this hack working on the homepage .. or the CMPS (INDEX) page... it will be GREAT!!!
..only if...

Paul M
18 Nov 2004, 20:05
vBadvanced CMPS (Content Management & Portal System)
http://www.vbadvanced.com/products.php?

Its a very popular portal system for vB and many boards use it. If only u cud assist me getting this hack working on the homepage .. or the CMPS (INDEX) page... it will be GREAT!!!
I can't see how I would do that without installing CMPS and testing it etc, which I'm not prepared to do, sorry.

I'm curious to know why the vbdate function fails on some installations.

Pepelux71
23 Nov 2004, 03:55
install

Pepelux71
23 Nov 2004, 10:27
When no one is in the chat room it appears like this:
"Currently -1 user(s) chatting.

How can i fix it?

Paul M
23 Nov 2004, 12:07
When no one is in the chat room it appears like this:
"Currently -1 user(s) chatting.

How can i fix it?Chat Room ? Sorry but I see no connection between this and a chat room - vB has no chat built into it.

JohnBee
24 Nov 2004, 17:48
Nie hack,thank you!

One request "if at all possible" could you make it so the hidden users
are hidden in the online pane as well?

reason is, I use a custom user account for my vB news intergration hack
and I would like to hide that user name from the listing.

ex: *site news

Any help would be greatly appreciated

Paul M
24 Nov 2004, 22:02
Nie hack,thank you!

One request "if at all possible" could you make it so the hidden users
are hidden in the online pane as well?

reason is, I use a custom user account for my vB news intergration hack
and I would like to hide that user name from the listing.

ex: *site news

Any help would be greatly appreciated

Sorry - but I'm not sure I follow - are you referring to the "Currently Active Users" display ? If so, this is a native part of vB and not related to this hack.

Viks
28 Nov 2004, 02:43
I can't see how I would do that without installing CMPS and testing it etc, which I'm not prepared to do, sorry.

I'm curious to know why the vbdate function fails on some installations.

Can someone here assist me in getting this hack further moded to work in CMPS!!
come'on guys help a brother out...will appreciate it

Vik

misuse
28 Nov 2004, 04:18
Worked great for me so far. Thanks! Installed.

folkish
02 Dec 2004, 18:45
Great mod. Simple, easy to follow instructions. Installed mere minutes ago.
Thanks.

deb0
04 Dec 2004, 17:42
nice job. Installed

MotoUp
07 Dec 2004, 20:50
Excellent! Much Much easier than the other mods. Only took about 30 seconds to install. Thanks.

MovieMaster
15 Dec 2004, 21:03
Works like a champ on this v3.0.3!

H2k
16 Dec 2004, 04:07
I can't see how I would do that without installing CMPS and testing it etc, which I'm not prepared to do, sorry.

I'm curious to know why the vbdate function fails on some installations.
i have install this hack .. but there is nathing dont show me any Online list any idea about this .. it's blank.

thankyou

Roxie
16 Dec 2004, 04:48
Hi. I installed it nicely; however, when different usergroups have different color names. It shows up on who's online, but only some of the colors show up on Who was online today. Any ideas?

Roxie
16 Dec 2004, 05:14
I have figured out that it goes by the primary usergroup and not the display group. Can this be edited some kind of way?

Paul M
16 Dec 2004, 12:35
i have install this hack .. but there is nathing dont show me any Online list any idea about this .. it's blank.

thankyouMake sure you have installed it correctly, there isn't really that much in it to go wrong.

Tipi
16 Dec 2004, 19:00
Nice one! :D

pingme
16 Dec 2004, 19:52
Coooooool :D

Boots
17 Dec 2004, 17:51
excellent mod! love it!

Paul M
17 Dec 2004, 22:43
I have figured out that it goes by the primary usergroup and not the display group. Can this be edited some kind of way?I had a look at this for you and it doesn't look like it's a quick and easy change, so I'm afraid you will have to take it as is, Sorry.

TwinsX2Dad
18 Dec 2004, 03:08
This is simplicity perfected. Thank you for a nice addition.

Install clicked!

Paul M
18 Dec 2004, 12:32
My what's going on box is located underneath the navbar. I would like to put this hack on the bottom where the what's going on box used to be orginally. Where in the forumhome template would I place the code?
In your template find ;


<br />
<br />
(just under the "<!-- /main -->" line)

replace those two line breaks with ;

<br />
<!-- Todays active users -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<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>
</table>
<!-- Todays active users -->
<br />


:)

biggkay
18 Dec 2004, 20:33
Thanks...Works nicely.
/me click install.

tormodg
19 Dec 2004, 10:33
Thanks...Works nicely.
* biggkay click install.
This is a cool hack. *installs*

noppid
23 Dec 2004, 00:46
Great Job! Thanks.

ForumRelated
23 Dec 2004, 15:16
great mod. simple and easy. just how mods should be. Good job Paul.

Sia Bani
24 Dec 2004, 08:37
Where's the one that updated all the time in that it didn't reset at 12:00 AM? So it was continuous?

I've installed this, but I thought there was a slight mod so you don't see it reset and blank out at 12:00AM.

Thanks.

Paul M
24 Dec 2004, 11:30
Where's the one that updated all the time in that it didn't reset at 12:00 AM? So it was continuous?

I've installed this, but I thought there was a slight mod so you don't see it reset and blank out at 12:00AM.

Thanks.Uncomment the second $cutoff line (that refers to not having vB 3.0.3).

Sia Bani
24 Dec 2004, 11:45
Uncomment the second $cutoff line (that refers to not having vB 3.0.3).
Thanks for the reply. Anyway you could explain that a little more? I have no idea what you're talking about. I have 3.0.3 as well.

Paul M
24 Dec 2004, 13:15
Okay, there is a line in the 1.03 version that you can just uncomment, but if you installed a while ago that line won't be there;

Find the line that starts "$cutoff = " in the hack - and replace it with ;

$cutoff = $now - 86400 ;

This will make it always display visitors from the last 24 hours. :)

LCPGUY
25 Dec 2004, 23:31
Wow! This works just great and so easy to install. I thank you Paul.

I have a question though, When I run the SQL ‘ALTER TABLE user ADD INDEX (lastactivity)”

I get the following error:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1146
error desc: Table 'john_mainDB.user' doesn't exist


Any suggestions would be appreciated.

Again, thanx for a terrific hack!!!

John

Paul M
25 Dec 2004, 23:47
LCPGUY, Where are you running the query ?

Sia Bani
25 Dec 2004, 23:48
Okay, there is a line in the 1.03 version that you can just uncomment, but if you installed a while ago that line won't be there;

Find the line that starts "$cutoff = " in the hack - and replace it with ;

$cutoff = $now - 86400 ;



This will make it always display visitors from the last 24 hours. :)


I just installed this a couple days ago and I have the $now-86400 in the hack already. I hadn't changed anything, and it's already there. However, at midnight, it still resets. Do you want me to change that to just $cutoff?

Paul M
25 Dec 2004, 23:55
I just installed this a couple days ago and I have the $now-86400 in the hack already. I hadn't changed anything, and it's already there. However, at midnight, it still resets. Do you want me to change that to just $cutoff?Um.... Can you PM me the first few lines of this hack that you actually have installed please.

LCPGUY
26 Dec 2004, 19:58
LCPGUY, Where are you running the query ?

From the Admin CP, Import and Maintenance, Execute SQL Query

Paul M
26 Dec 2004, 20:26
I suggest you do it directly on the database via myphpadmin.

TMAC
31 Dec 2004, 22:58
Thank you for this hack. :)

Up the thread a way it was asked Is it possible to show todays visits only to admin?

I did not see any answer and just wanted to make sure I did not miss out on how to do this.

Thank You!

Paul M
01 Jan 2005, 01:54
Thank you for this hack. :)

Up the thread a way it was asked

I did not see any answer and just wanted to make sure I did not miss out on how to do this.

Thank You!I replied in post 23. Just enclose the template display code in an IF conditional for usergroup 6.

TNAImpact
01 Jan 2005, 23:02
Brilliant Hack.

Would it be possible to move the feature in which when you hover over the username the last time they were online comes up? Could I move that somehow?

Thanks for your time.

Paul M
01 Jan 2005, 23:11
Brilliant Hack.

Would it be possible to move the feature in which when you hover over the username the last time they were online comes up? Could I move that somehow?

Thanks for your time.Sorry, I don't understand. What do you mean by move it - move it to where ?

TNAImpact
01 Jan 2005, 23:13
Sorry, I don't understand. What do you mean by move it - move it to where ?

Move it, finito, nothing, none, basically get rid of the hover feature that shows their last visit, keeping everything else.

Paul M
01 Jan 2005, 23:19
Move it, finito, nothing, none, basically get rid of the hover feature that shows their last visit, keeping everything else.Oh right, you mean remove it completely. :)

Change ;

$whotoday .= "<a href='member.php?u=$today[userid]' title='$wrdate' >";
to ;

$whotoday .= "<a href='member.php?u=$today[userid]' >";
and don't forget to click install :)

TNAImpact
01 Jan 2005, 23:20
Thankyou for the very quick reply. :) Keep up the great work. I shall click install now. :D

Thanks again.

funkmeister
02 Jan 2005, 03:46
I have a bit of an oddity occuring!

When I have for example, 50 users who have visited so far today, certain members are only seeing 20 (example) as having visited. Guests and most other members (as far as I'm aware) are seeing the correct number of 50.

Any ideas why certain members would see different numbers than everyone else? There are no 'invisible' (*) members or special usergroups involved.

Thanks.

Paul M
02 Jan 2005, 12:51
Maybe they have different timezone settings in their profiles ?

funkmeister
03 Jan 2005, 07:01
Maybe they have different timezone settings in their profiles ?
Doh, yes indeed - that was it :)

Thanks.

cclaerhout
04 Jan 2005, 01:38
Doh, yes indeed - that was it :)

Thanks.
Do i have to change the value "$cutoff = $now - 86400 " if my forum's default time is GMT+1 ? Because at midnight, the number of users who have visited the forum doesn't init.

Great hacks anyway thanks :-)

Paul M
04 Jan 2005, 01:47
Do i have to change the value "$cutoff = $now - 86400 " if my forum's default time is GMT+1 ? Because at midnight, the number of users who have visited the forum doesn't init.

Great hacks anyway thanks :-)That piece of code will give a rolling count for the previous 24 hours and is commented out (unless you have removed the "//"). It is only there as a backup because the vbdate function was not working on some systems - allthough some people are using it by default because this is what they want to do.

cclaerhout
04 Jan 2005, 08:57
That piece of code will give a rolling count for the previous 24 hours and is commented out (unless you have removed the "//"). It is only there as a backup because the vbdate function was not working on some systems - allthough some people are using it by default because this is what they want to do.

Thanks for this explanation. I'm using Vb 3.04 and i was forced to remove the // before the code ; Otherwise all users were listed. So, if i well understand, now this hacks is "Who connected last 24 hours" :)

Paul M
04 Jan 2005, 11:42
So, if i well understand, now this hacks is "Who connected last 24 hours" :)Yep, that is how yours will be working.

Kylie
04 Jan 2005, 12:45
Thanks Paul works well, I've used some other versions but this is the easiest to see. I like the time "alt"

colcas
08 Jan 2005, 04:37
hi Paul great mod,

I have had it running perfect up to last night - I did the 3.0.5 upgrade and it doesn't show who's been on line today, just a blank box no entries

I'm new to v-bulletin - do you have any ideas what might need to be changed to get it working again

thanks in advance

Paul M
08 Jan 2005, 12:23
hi Paul great mod,

I have had it running perfect up to last night - I did the 3.0.5 upgrade and it doesn't show who's been on line today, just a blank box no entries

I'm new to v-bulletin - do you have any ideas what might need to be changed to get it working again

thanks in advanceHave you re-done the files changes after you upgraded ?

btw - you are not showing as having installed this - please click install.

colcas
09 Jan 2005, 00:14
Sorry Paul - I must have forgot to click 'Install'

I checked the new 'index.php' file and it didn't seem to have the

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

This is where I got stuck - it had that line in my 3.0.3 version index.php but doesn't seem to have it in the new 3.0.5 version

the code for the forum home template is in and shows the box for the users who visited today

but as I don't know where to mod the index.php file as it doesn't have the 'LOGGED IN USERS line

hope this clarifies it a bit

Cheers

Paul M
09 Jan 2005, 02:00
Sorry Paul - I must have forgot to click 'Install'

I checked the new 'index.php' file and it didn't seem to have the

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

This is where I got stuck - it had that line in my 3.0.3 version index.php but doesn't seem to have it in the new 3.0.5 version

Well my index.php (3.0.5) has it, at line 274. :) - Just do a text search for "LOGGED IN".

Mosaicvb
09 Jan 2005, 07:49
I just installed this mod with vb 3.0.5 and it works great. I made some changes and I am posting what I did if you want to have an option that does not require altering the index.php.

1 : create a php file called whos.online.today.php with the following and upload to the root of the forum. :

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false));
//$cutoff = $now - 86400 ; // Uncomment this line if you don't have vB 3.0.3 and all users are showing.
$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] = 1 ;
$totaltoday += 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);
}

?>


2: Go to the style manager. Open the style you want to edit.
In the common template section goto the phpinclude_start box and enter :

ob_start();
include('whos.online.today.php');
ob_end_clean();


3: Follow your instructions for replacing the code in the Forumhome template.

Done.

Works like a charm for me. Thanks for your work. I hope I don't offend you by posting what I did.

I would like to know since I dont play in vB a lot whether anything I did would open a security hole.

Paul M
09 Jan 2005, 11:43
Works like a charm for me. Thanks for your work. I hope I don't offend you by posting what I did.

I would like to know since I dont play in vB a lot whether anything I did would open a security hole.Well it's a bit of a odd thing to do, but it won't open any security holes. However, you realise that by doing this, you will run the code on every vB page you ever view, not just the forumhome page ?

samael
09 Jan 2005, 13:09
I got this error after editing the files.

Parse error: parse error, unexpected '\"', expecting ']' in /home/rpboards/public_html/forum/index.php(420) : eval()'d code on line 201

Paul M
09 Jan 2005, 15:28
That would suggest you made a mistake in the template update.

good2laugh
09 Jan 2005, 16:54
Installed and working perfectly - thanks, this was one of the easiest modifications/hacks I've used. :D

ericgtr
09 Jan 2005, 17:58
I see someone else has made a variation of this, I did also and I will share it here. Basically, I like the idea of it showing how many users are online today but not the names on my forumhome, I want that in a new page. The other modification for this does this but has never worked on my site, the numbers were different when you clicked on it. So I made it so this will work in a new page.

Create a new php page called online_today.php add all of the following code to it and save:

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'online_today'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(

);

// pre-cache templates used by all actions
$globaltemplates = array(
'online_today',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Online Today';
$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false));
//$cutoff = $now - 86400 ; // Uncomment this line if you don't have vB 3.0.3 and all users are showing.
$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] = 1 ;
$totaltoday += 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);
}

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('online_today') . '");');

?>

Upload to your vb directory


Create a new template called online_today

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions</title>
$headinclude
</head>
<body>
$header
$navbar
<!-- 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 -->
</if>
$footer
</body>
</html>


[B]NOTE: This is a change to the existing modification.

Now in your FORUMHOME template find:

<if condition="$show['loggedinusers']">
<!-- 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 -->

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


Change to:

<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>
<a href="online_today.php?$session[sessionurl]">Total users that have visited today</a>: $totaltoday
</td>
</tr>
</tbody>
<!-- Todays active users -->
</if>

Mosaicvb
09 Jan 2005, 19:17
Well it's a bit of a odd thing to do, but it won't open any security holes. However, you realise that by doing this, you will run the code on every vB page you ever view, not just the forumhome page ?


Nope I didn't. Not good.. lol

thanks for the headsup

shadiguy1
10 Jan 2005, 04:51
ERICGTR can u make this into a module for vbadvanced CMPS as i see you make alot of modules for CMPS

Viks
10 Jan 2005, 09:04
ERICGTR can u make this into a module for vbadvanced CMPS as i see you make alot of modules for CMPS

yes... do it.. do it
:nervous:

BBoo
10 Jan 2005, 10:02
Thanks Paul, just installed works perfect! :)

noppid
10 Jan 2005, 16:03
I just installed this mod with vb 3.0.5 and it works great. I made some changes and I am posting what I did if you want to have an option that does not require altering the index.php.

1 : create a php file called whos.online.today.php with the following and upload to the root of the forum. :

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false));
//$cutoff = $now - 86400 ; // Uncomment this line if you don't have vB 3.0.3 and all users are showing.
$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] = 1 ;
$totaltoday += 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);
}

?>


2: Go to the style manager. Open the style you want to edit.
In the common template section goto the phpinclude_start box and enter :

ob_start();
include('whos.online.today.php');
ob_end_clean();


3: Follow your instructions for replacing the code in the Forumhome template.

Done.

Works like a charm for me. Thanks for your work. I hope I don't offend you by posting what I did.

I would like to know since I dont play in vB a lot whether anything I did would open a security hole.


You may want to consider adding a conditional to your phpinclude_start template to only run that query when the page selected is forum home or your new WWOL page. As it is that code runs on every page loaded whether it's used or not. Just a little optimization suggestion. :)

ericgtr
10 Jan 2005, 16:16
ERICGTR can u make this into a module for vbadvanced CMPS as i see you make alot of modules for CMPS
I can probably work this out although it would make for a pretty huge box on the side.. maybe a center module of some sort. If Paul M gives his okay I will look into it for you.

shadiguy1
10 Jan 2005, 16:31
yah a nice botom ceneter block would be sweet i hope paul will give u the go ahead cause a few people were asking in the thread his hack is awsome and it woukd be sweet to have it work on the CMPS.

Paul M
10 Jan 2005, 16:54
I can probably work this out although it would make for a pretty huge box on the side.. maybe a center module of some sort. If Paul M gives his okay I will look into it for you.Sure, if you do a CMPS version I will attach it to the hack as an option (with suitable credit of course :))

ericgtr
10 Jan 2005, 22:41
Okay, here it is in a collapsable module. Upload onlinetoday.php file to your modules directory and create a new template called adv_portal_onlinetoday and copy the context of adv_portal_onlinetoday.txt into it.

Create a new module

Module Title: Total Online Today

Module Identifier: (leave blank)

File to Include: onlinetoday.php

OR Template to Include: (leave blank)

Templates Used: adv_portal_onlinetoday


Test this out, it works okay for me but for some reason whenever I create a new module it shows up on my forumhome at the bottom in a center block no matter where I tell it do display, that may just be me though.

Paul M
10 Jan 2005, 22:53
Thanks, I have updated the main post with a note pointing to your module. :)

ericgtr
10 Jan 2005, 22:56
Thanks.. I just now noticed that someone else posted a module for the other hack for this lol. Oh well, hope I didn't reinvent the wheel with this, besides your mod works on my site :)

colcas
11 Jan 2005, 00:31
Well my index.php (3.0.5) has it, at line 274. :) - Just do a text search for "LOGGED IN".


Paul - sorry m8 for not getting back to you earlier - yes it is there - and it works a treat again

it must have been me - or something to do with my set up - picking up something from a cache - or just simply 'user interface problems' :rolleyes:

Anyway - cheers for a great and easy to use hack

Hellspire
11 Jan 2005, 06:09
Good job, installed/

shadiguy1
11 Jan 2005, 16:13
eric for some reason its not showing up for me.

ericgtr
11 Jan 2005, 16:19
eric for some reason its not showing up for me.
Can you be more specific?

shadiguy1
11 Jan 2005, 17:23
i did all the stuff made the template and added the module and put the php file in the modules directory ande nothing is coming up at all on my CMPS and i did make sure that it is active.

shadiguy1
11 Jan 2005, 17:48
eric if u have aim hit me up i can let u look into my forums ADMINCP and see that i did everything hit me up on aim shadiguy1.

ericgtr
11 Jan 2005, 17:59
Okay, to be sure this is what your module setup should like like.. see screenshot.

ericgtr
11 Jan 2005, 18:11
eric if u have aim hit me up i can let u look into my forums ADMINCP and see that i did everything hit me up on aim shadiguy1.
I can't use it at work, I won't be home until about 4:30 (PST)

shadiguy1
11 Jan 2005, 18:15
here are my screen shots.

ericgtr
11 Jan 2005, 18:23
here are my screen shots.
If you want to PM me with admin access to your server I will take a look.

shadiguy1
11 Jan 2005, 18:39
pm sent with info

ericgtr
11 Jan 2005, 19:59
pm sent with info
I think I found it, I updated the onlinetoday.php re-upload it and see if it works now.

shadiguy1
11 Jan 2005, 20:48
its displaying but i think ther eis something wrong with the template part now. Please take a look.. here are screen shots.

ericgtr
11 Jan 2005, 20:54
Okay, how does it work if you try it on a side?

Here is the template again, in case I missed something in the inital post.


<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat smallfont" style="font-weight: bold;"><a style="float: $stylevar[right]" href="#" onclick="return toggle_collapse('forumhome_$mods[filename]')"><img id="collapseimg_forumhome_$mods[filename]" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomtopic].gif" width="15" height="15" border="0" alt="Collapse/Expand" /></a>$vba_options[portal_blockbullet] $mods[title]</td>
</tr>
</thead>
<tfoot style="display: none;"><tr><td></td></tr></tfoot>
<tbody id="collapseobj_forumhome_$mods[filename]">
<tr style="$vbcollapse[collapseobj_forumhome_randomtopic]">
<td class="$getbgrow">
<!-- Todays active users -->
$whotoday
<!-- Todays active users -->
</td>
</tr>
</tbody>
</table>
<br />

shadiguy1
11 Jan 2005, 20:59
only thing not showing up is actually how many have visited it showed them correctly just need to put the number on it .. Of how many actuall have visited ill show yah what it looks like as of now.

ericgtr
11 Jan 2005, 21:14
only thing not showing up is actually how many have visited it showed them correctly just need to put the number on it .. Of how many actuall have visited ill show yah what it looks like as of now.
Okay, I added that. I replaced the adv_portal_onlinetoday.txt re-upload it and you should be good.

shadiguy1
11 Jan 2005, 21:15
worked thanks for all the trouble heheh much appreciated bro,

ericgtr
11 Jan 2005, 21:19
worked thanks for all the trouble heheh much appreciated bro,
That's okay, we want it to be right if it's going to be posted :) I have so many little tweaks in my templates that sometimes it's hard to keep track of what's what which is where things got confused lol.

Twigz
11 Jan 2005, 21:32
Great work. Worked like a Charm. *InStalled*

stumparoooo
16 Jan 2005, 07:21
I'm still pretty new to vBulletin and this is my first time trying a hack, so forgive me if this is a stupid question.

I'm running version 3.05 and just tried to install it. On my forum's home page, the box shows "Total users that have visited today", but no users are showing up. It's completely blank.

I followed the directions and modified the index.php code in SmartFTP and the FORUMHOME template in the AdminCP. Do you have any idea why the box shows, but no usernames? What can I do to make it work??

Thank you in advance for your time.

Paul M
16 Jan 2005, 13:10
Are you sure you saved the modified index.php file ?

stumparoooo
16 Jan 2005, 17:36
Are you sure you saved the modified index.php file ?
Yes, the modified index.php file is saved.


The whole code was copy and pasted in the index right above "Logged In Users".


edit: My mistake--I forgot to upload it after saving it in FTP. :speechless:

Thank you for your time, though!!

It works now and I love it! :):)

sportsoutlaw
16 Jan 2005, 20:10
great addition to my forum, thanks.

Hexemer
17 Jan 2005, 23:05
Thanks, works nice! :)

MickDoneDee
20 Jan 2005, 14:40
Thanks again for the hack, Paul. Just wondering whether you could also do a companion hack to appear under this hack to show "Total users that have posted today"?

Paul M
20 Jan 2005, 20:32
Thanks again for the hack, Paul. Just wondering whether you could also do a companion hack to appear under this hack to show "Total users that have posted today"?Hmm, not something I would use, but I'll look into it for you. :)

MickDoneDee
20 Jan 2005, 20:41
Thanks, Paul. I think it would be useful to see how many people actually post when logging in. It would be extra nice if when a name is clicked a page opens containing the posts that they made "today". So that the posts for that individual are displayed like a thread. This would be more convenient than the advanced search function.

Treasure Quest
21 Jan 2005, 16:34
Hello,
I had this mod installed on my Vb 3.0.6 yesterday and its not showing any users as visiting the forum. Any suggestions as to what might be the problem?

http://www.treasurequestxlt.com/community/


Thank you,

Greg

Vevina
21 Jan 2005, 17:08
Thanks Paul, me likes :)

But when i "hover" over user names the time is not showing, it's showin as Registered User, Moderator etc :(

Can you tell me what ive done wrong or need to do to correct it please !!

Paul M
21 Jan 2005, 17:43
Hello,
I had this mod installed on my Vb 3.0.6 yesterday and its not showing any users as visiting the forum. Any suggestions as to what might be the problem?
At a guess you either haven't done the file edit to index.php, or you haven't uploaded the edited file.

BTW, you aren't showing as having it installed it. :)

Paul M
21 Jan 2005, 17:47
Thanks Paul, me likes :)

But when i "hover" over user names the time is not showing, it's showin as Registered User, Moderator etc :(

Can you tell me what ive done wrong or need to do to correct it please !!There is no way I can think of for this to happen, hell, it would need a bit of extra code if you wanted to do this.

what is your site address ?

Vevina
21 Jan 2005, 17:51
address in pm :)

Treasure Quest
21 Jan 2005, 18:28
At a guess you either haven't done the file edit to index.php, or you haven't uploaded the edited file.

BTW, you aren't showing as having it installed it. :)
Hi Paul and thanks, the code would have been uploaded because I have the box for the "Last users visited" right,
http://www.treasurequestxlt.com/community/

I'll check it again,

Greg

Paul M
21 Jan 2005, 20:33
Hi Paul and thanks, the code would have been uploaded because I have the box for the "Last users visited" right,
http://www.treasurequestxlt.com/community/No, the box display is from the template change, which you have obviously done. The code that creates the list (in index.php) is missing.

Vevina
21 Jan 2005, 21:34
ok ive just tried it again and now i'm gettin this:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/fhlinux199/r/research-complete.co.uk/user/htdocs/forums/includes/adminfunctions_template.php(3054) : eval()'d code on line 194

line 194 $styles = $DB_site->query("SELECT styleid, title, parentlist, parentid, userselect FROM " . TABLE_PREFIX . "style ORDER BY parentid");

line3054 eval('$devnull = "' . $template . '";');

Please Help !! :ermm:

Paul M
21 Jan 2005, 21:57
You appear to have broken a template - the only template used by this hack is FORUMHOME so I suggest you revert it and start again.

Paul M
22 Jan 2005, 13:53
Thanks, Paul. I think it would be useful to see how many people actually post when logging in. It would be extra nice if when a name is clicked a page opens containing the posts that they made "today". So that the posts for that individual are displayed like a thread. This would be more convenient than the advanced search function.See Members who have posted today (http://www.vbulletin.org/forum/showthread.php?t=74869) :)

kodeking
23 Jan 2005, 20:38
I love it. Simple and works

Bluetiereign
23 Jan 2005, 22:17
Got the identical error..fixed with a revert to original.


ok ive just tried it again and now i'm gettin this:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/fhlinux199/r/research-complete.co.uk/user/htdocs/forums/includes/adminfunctions_template.php(3054) : eval()'d code on line 194

line 194 $styles = $DB_site->query("SELECT styleid, title, parentlist, parentid, userselect FROM " . TABLE_PREFIX . "style ORDER BY parentid");

line3054 eval('$devnull = "' . $template . '";');

Please Help !! :ermm:

Bluetiereign
23 Jan 2005, 22:38
BTR <*installs*> :classic:

Paul M
24 Jan 2005, 00:04
Got the identical error..fixed with a revert to original.I guess you made an error somewhere. :)

chinch
27 Jan 2005, 05:06
nice job with this mod!

is there any way to have it show visitors from the last "24 hours" instead of "today".

for example my list just went from 341 members down to 5 after midnight :)

detalhe
27 Jan 2005, 15:37
I've instaled it, works great, but I'd like to know where can I modify the 'Total Users.....' phrase to another language than English ;)

Paul M
27 Jan 2005, 18:06
nice job with this mod!

is there any way to have it show visitors from the last "24 hours" instead of "today".

for example my list just went from 341 members down to 5 after midnight :)Uncomment this line ;

//$cutoff = $now - 86400 ; // Uncomment this line if you don't have vB 3.0.3 and all users are showing.

Paul M
27 Jan 2005, 18:15
I've instaled it, works great, but I'd like to know where can I modify the 'Total Users.....' phrase to another language than English ;)It's embedded in the template code, see this extract ;

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

detalhe
27 Jan 2005, 19:20
It's embedded in the template code, see this extract ;

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

Great!! Thanks ;)

chinch
27 Jan 2005, 23:51
Uncomment this line ;

//$cutoff = $now - 86400 ; // Uncomment this line if you don't have vB 3.0.3 and all users are showing.

thanks... will try that now :)

MajorFm.com
29 Jan 2005, 22:03
What about...

Where it says:
Members That Have Visited Today - Total: 75

I want:
Total That Have Visited Today - Members: 75 Guests: ??

I want to display the total guests aswell

Paul M
29 Jan 2005, 22:37
That would be very difficult to do.

Lyricsmama
01 Feb 2005, 22:00
Added and simple thx!

KanyeWest
02 Feb 2005, 03:54
thanks man :nervous:

pingme
02 Feb 2005, 07:38
Uncomment this line ;

//$cutoff = $now - 86400 ; // Uncomment this line if you don't have vB 3.0.3 and all users are showing.


Paul, I did this, but still it cuts off the users at midnight :( Can you please help in making it rolling 24hrs

Paul M
02 Feb 2005, 09:33
Paul, I did this, but still it cuts off the users at midnight :( Can you please help in making it rolling 24hrsSorry, but if you have correctly uncommented it (removed the first two slashes, not the second set) and saved it - then it is impossible for it not to work. I suggest you check your edit. :)

bigmonay2k
02 Feb 2005, 14:49
see attachment :disappointed: thank you

pingme
02 Feb 2005, 15:33
Sorry, but if you have correctly uncommented it (removed the first two slashes, not the second set) and saved it - then it is impossible for it not to work. I suggest you check your edit. :)


hehehe :D Silly me, I added two more lines as I read it "comment this line"

I will check it tonight

Thanks for quick reply Paul

Paul M
03 Feb 2005, 01:58
see attachment :disappointed: thank youA template error - check that you modified it correctly.

mystery250
03 Feb 2005, 19:22
Hmm. The who's online today, when I install this, is blank.

I am sure I installed it right, as I have used the previous versions, and they have worked glitch free....

Paul M
03 Feb 2005, 23:29
Hmm. The who's online today, when I install this, is blank.

I am sure I installed it right, as I have used the previous versions, and they have worked glitch free....Not really sure what you mean - a link may help.

Check your edits again. :)

zaon
05 Feb 2005, 07:21
Thanks, Paul!!

Works great :-)

And yes, SIMPLE is indeed way better than the other hacks I've seen that involve tampering with the database itself or requiring so many other modifications/changes. Your hack also makes for better compatibility with regular vbulletin 3.x.x releases.

So thanks again! :-)

bigmonay2k
07 Feb 2005, 05:17
A template error - check that you modified it correctly.
it only happen when members in my board have b-day(Today's Birthdays) :ermm: if there's no b-day it's fine dude..I really does not know what to do.

Paul M
07 Feb 2005, 14:03
it only happen when members in my board have b-day(Today's Birthdays) :ermm: if there's no b-day it's fine dude..I really does not know what to do.PM me a copy of your template.

ALcorn
07 Feb 2005, 15:15
Very nice hack, Paul M. Just one thing is missing for me - number of guests who have visited. Is it possible to add this info into the hack ? Thank you again.

Paul M
07 Feb 2005, 16:48
Very nice hack, Paul M. Just one thing is missing for me - number of guests who have visited. Is it possible to add this info into the hack ? Thank you again.Sorry, it's not possible.

BocaDev
08 Feb 2005, 20:15
Works great, thanks! :)

Viks
08 Feb 2005, 22:48
Oh GREAT!! this is cool, I've been looking for this.
thanks Ericgtr.
I've installed it.. however i have some minor issue. I've attached a pic...whats happenning is that
1. the FONT size of members is bigger compared to other locations..

2. On click on "membername" the url takes me to root/members instead of root/forums/member.

any suggestions how i can fix this!?

thanks

Viks
09 Feb 2005, 06:17
any suggestions how i can fix this!?

thanks

ok I fixed the problem. It was just a temeplate edit to match my font.

But Eric i got another issue! The Module shows online visitors "today" starting at midnight but Paul's original mod shows users in last 24 hours on my fourmshome.

:ermm:

I thought, it wud show the number of users on cmps page as forumshomepage which is users visited in last 24 hrs.??!?!

isnt that right??

Paul M
09 Feb 2005, 09:31
But Eric i got another issue! The Module shows online visitors "today" starting at midnight but Paul's original mod shows users in last 24 hours on my fourmshome.
Uncomment this line to switch to the rolling 24 hr's ;

//$cutoff = $now - 86400 ; // Uncomment this line if you don't have vB 3.0.3 and all users are showing.

:)

Viks
09 Feb 2005, 10:37
thanks Paul.

Pamela
10 Feb 2005, 07:03
Easy installation and great instructions. Thanks! :)

havefun
10 Feb 2005, 12:46
works fine, thx paul :)

Paul M
15 Feb 2005, 17:47
I have uploaded v1.35 today which has a very minor bugfix - this will not affect anyone who already has this working - but I think it may cure the odd case (in vb versions prior to 3.0.3) where the vbdate function would not work (and hence people switched to the rolling 24 hours display).

Trekkie
15 Feb 2005, 17:48
nice

hankster
22 Feb 2005, 16:21
You may want to consider adding a conditional to your phpinclude_start template to only run that query when the page selected is forum home or your new WWOL page. As it is that code runs on every page loaded whether it's used or not. Just a little optimization suggestion. :)

Does anyone know how this conditional could be added?

MickDoneDee
23 Feb 2005, 02:07
Try:

<if condition="THIS_SCRIPT=='index'>
ob_start();
include('whos.online.today.php');
ob_end_clean();
</if>

In case people are wondering where your quote came from it was:
http://www.vbulletin.org/forum/showpost.php?p=593061&postcount=110

zaon
23 Feb 2005, 18:28
You're saying that the code we inserted into index.php gets launched and processed all the time because a template called "phpinclude_start" (present in most templates on the board) points to code in index.php and so is referenced in showthread and other various templates on the board? So the proposed conditional tells phpinclude_start to only call the todays active users code from index.php when and if the template calling is the forum home but otherwise to ignore that code in index.php? (sorry, newbie, so a bit lost here).

MickDoneDee
23 Feb 2005, 19:31
To learn a bit more about phpinclude_start have a look at these links:

http://www.vbulletin.org/forum/showthread.php?t=71313

http://www.vbulletin.com/docs/html/main/templates_phpinclude_start

http://www.vbulletin.com/forum/showthread.php?t=128925&highlight=phpinclude_start

The reason Mosaicvb is using phpinclude_start is because he doesn't want to edit/hack his index.php file which voids the Jelsoft User Support eligability. So he created a PHP script (whos.online.today.php) that will do the same job using the phpinclude_start template to create the HTML and insert the data on the forum home page. However, since the phpinclude_start template loads with every page a conditional is used to run the whos.online.today.php file only when the index.php page is loaded.

Paul M
23 Feb 2005, 23:47
You're saying that the code we inserted into index.php gets launched and processed all the time because a template called "phpinclude_start" (present in most templates on the board) points to code in index.php ........... No.

Just to be clear and repeat what MickDoneDee is saying - this hack edits index.php, and the code only runs when you are on the forum homepage.

However, Mosaicvb decided that they didn't want to run it this way and built themselves a seperate php file with the hack code in it, and then added code to the phpinclude_start template to run his file (see here (http://www.vbulletin.org/forum/showpost.php?p=592309)). The problem being that this means it gets run on every vb Page that you view, not just the forumhome page. I do not support this method of running it.

zaon
24 Feb 2005, 08:57
oh ok, thanks Paul!!

Yeah, I run it in the default method except for uncommenting for rolling 24 hours because of international clientele ;-)

lazytown
25 Feb 2005, 02:07
Great mod. What kind of performance hit does this cause?

-V

Paul M
25 Feb 2005, 09:49
Great mod. What kind of performance hit does this cause?

-V
It adds about 0.01 seconds to the homepage.

Mosh
25 Feb 2005, 23:29
Paul,

This is nice and simple and works great, it is by far the easiest 'Last Visited' hack to install (1 php file alteration, 1 template alteration and an optional SQL query) have available atm by far, I know I have tried them all at one stage or another.

Also works without a hitch with v 3.0.7 and the optional query does speed up page load time.

Thanks for the painless install.

jd :)

smokering
27 Feb 2005, 17:42
excellent and simple to use thank you

Paul M
27 Feb 2005, 18:41
excellent and simple to use thank youThanks.

jozo1
28 Feb 2005, 06:11
great work, very simple! just take one minute to hacks this mod, thank again !

Paul M
28 Feb 2005, 11:31
Hi jozo1 - I notice that you (and smokering, and a few odd others) have not clicked the "Install this Modification" link (just above the download link).

Being new to the site I expect you are not really aware of this - but clicking on this adds you to a list of people who have the hack installed - which helps the writer see how many people have the code, and also allows you to receive any notes sent out about updates. Please could you spare 30 seconds to do this - thanks.

KanyeWest
01 Mar 2005, 20:14
paul please help im stupid i dontn o how to read it to make 24 hours help help

Paul M
01 Mar 2005, 20:27
Sorry but I don't see what else I can tell you - the hack clearly tells you to uncomment a line to switch to the rolling 24 hours - I don't see how I could make it any plainer than it already is.

eva01_
01 Mar 2005, 20:37
i think the instructions are pretty simple don't see what your problem is o_O

KanyeWest
01 Mar 2005, 21:43
Sorry but I don't see what else I can tell you - the hackclearly tells you to uncomment a line to switch to the rolling 24 hours- I don't see how I could make it any plainer than it alreadyis.
see i haev add i dont understand like most people i dont no if i shoulduncomment the line before and after and which line im sorry

do i take out this line .? please highlite in quote in ur post what line i shold take out im sorry im stupid llol

$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now, false, false), vbdate('d', $now, false, false), vbdate('Y', $now, false, false));
//$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" );

Paul M
01 Mar 2005, 21:54
I'm really not sure if this is a wind up ....

Which bit of " uncomment this line " are you finding hard to understand ?

(apart from which, only one line is commented out anyway).

and you should not be quoting the hack for all to see either.


If you really don't understand it then I suggest you either find someone to install it for you, or don't bother. I cannot help you any further.

eva01_
01 Mar 2005, 21:56
just take out the "//" in //$cutoff = $now - 86400 ;

since // means comment after

KanyeWest
01 Mar 2005, 22:10
i dont wanna piss off paul eva can u please help me out of desperasion i no im very stupid but i cant help it my aim is idenonfire or pm me pelase thanks
my site is idenonfire.com

KanyeWest
01 Mar 2005, 22:22
wow thank you eva helped me out and thanks paul for helpin me im just stupid

well thanks again works like a charm

Vampyre
02 Mar 2005, 05:30
Work like a charm!!
Thanks for the nice work, Paul M. :)

Mechanical Mind
02 Mar 2005, 18:28
* clicks install *

Worked flawlessly. I love this hack because it shows that the forums are busy, without having to up your "cookie timeout" time and lie about how many people are actually online. Like some people do, no names of course.

Great job Paul! :classic:

JAYEMULE
03 Mar 2005, 16:50
I uninstalled this mod because I could not fix it. It showed all my members been on line that day when it was not so. I liked the idea and was sure easy enough to add but I just couldn't get to work showing ONLY the actual members that visited, not the entire member list.
I will watch for new working versions.

Jaye

Paul M
03 Mar 2005, 17:20
I uninstalled this mod because I could not fix it. It showed all my members been on line that day when it was not so. I liked the idea and was sure easy enough to add but I just couldn't get to work showing ONLY the actual members that visited, not the entire member list.
I will watch for new working versions.

JayeWell 300 odd other people seem to think it works perfectly. :)

Which version number did you install (or what date did you download it). There was a small error that seemed to cause this problem on mainly pre 3.0.3 versions of vB - it was fixed on Feb 15th.

JAYEMULE
03 Mar 2005, 17:48
Well 300 odd other people seem to think it works perfectly. :)

Which version number did you install (or what date did you download it). There was a small error that seemed to cause this problem on mainly pre 3.0.3 versions of vB - it was fixed on Feb 15th.

I did not mean be speaking poorly of the mod. Not what I meant at all. I just installed it 2 days ago and got the file at same time. I read the posts here but did not see that there had been a fix so I just uninstalled it. If this is fixed that would be great. I do like this mod for sure. Should I try to do it again and see if it works out better ? You say this is all starightend out now ? I am have vb 3.7 working at this time.

Jaye

Paul M
03 Mar 2005, 18:33
So you have 3.0.7 and you downloaded it two days ago - this doesn't sound promising TBH - can you just make sure that the code you have is version 1.35 - if it is then you already have the code with what I hoped was the potential fix.

My problem is I cannot make it fail - it is the vbdate() function that fails on some servers, and I don't know why. Can you confirm what your server OS and PHP versions are ?

The rolling 24 hour version still works on these servers - just uncomment the relevant line.

JAYEMULE
03 Mar 2005, 20:32
Yes, I had version 1.35 of wh was online today. I would sure love to use this mod. I will keep watching for the fix.
Sorry forgot the rest.
I use win XP pro and the latest version of php and my sql

Paul M
03 Mar 2005, 22:32
The fix is to use the rolling 24 hours option - there will be no other fix as I have no way to reproduce the problem.

Mike54
03 Mar 2005, 23:28
I just added ericgtr's module for the CMPS and it works great. Many thanks!

Mike

AmpSul
04 Mar 2005, 03:06
worked like a charm!
(i've been running vb for less than a week and this is my first installed hack!)

keep up the good work!!!

Agent Jones
05 Mar 2005, 18:06
I have doubles of everyone, how to fix it?

Paul M
05 Mar 2005, 18:55
I have doubles of everyone, how to fix it?Link ?

sportsoutlaw
07 Mar 2005, 04:03
just upgraded from 3.0.5 to 3.0.7 and modifed the index.php.

Still works great, thanks Paul for your efforts in this little hack.

zaon
07 Mar 2005, 22:14
Love the hack.. but think I discovered one minor bug...

It DOES display special formatting/colors as assigned by usergroup so that names appear same in the 24 hr list as they do for currently active users.. BUT.. only if that formatting is from the primary user group. I have a couple members with a secondary usergroup which has the option set to override formatting, and it does override (causing name to appear in bold) in the currently active list but appears without formatting in the 24 hr list.

Is this fixable?

The one active member i have now is 'dejong' if you happen to catch him online at www.zaon.org then you can see how his formatting is special in currently active but unmodified in 24 hr list. His name should be bolded in both lists like our Moderators are (whose formatting is specified in our primary usergroup).

Took me a while to figure that one out, but seems to be what's going on here.

MickDoneDee
07 Mar 2005, 22:46
This question was also raised here: http://www.vbulletin.org/forum/showthread.php?p=582864&highlight=color#post582864

I think Paul said somewhere that it was too complicated to make colors work for Secondary usergroup. So that feature is not available for this hack.

zaon
07 Mar 2005, 22:55
Awww... gotcha.. Ok.

Paul M
08 Mar 2005, 00:24
Awww... gotcha.. Ok.
Yep, sorry, as MickDoneDee says - it would add a load of extra code - and I want this hack to be as simple as possible. :)

See http://www.vbulletin.org/forum/showpost.php?p=583390&postcount=64

wildondallas
09 Mar 2005, 10:24
Installed and works great.

wildondallas, clicked install:up:

Moncal
11 Mar 2005, 03:10
Great Hack!

Perfect in every way.

scottm
12 Mar 2005, 02:05
great and easy, thanks. :)

Jeremy_Dallas
12 Mar 2005, 05:37
I'm getting the following when I try to save my changes to the FORUMHOME template:

The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/a/l/t/altirisadmin/html/vbulletin/includes/adminfunctions_template.php(3096) : eval()'d code on line 195

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


Any Ideas?

Paul M
12 Mar 2005, 14:22
Yes, you have made an error editing the template - revert it and try again.

Antivirus
12 Mar 2005, 22:17
Great hack, and my first one I have ever installed, great instructions, went off without a hitch!

(clicked install)

hendri
13 Mar 2005, 09:47
yes... it's impossible that all my members (100% of 1899) have come today at 11:31!! :nervous:

I will look at this.
cool !!!!!!!!

Paul M
17 Mar 2005, 09:25
cool !!!!!!!!That's a very old quote in your post, I'm not quite sure why you have posted it - but there have been a few updates since then, and I believe that problem should no longer exist. :)

lefthome
17 Mar 2005, 17:56
I installed this hack and it is very nice, but I have a question. Is it possible to add a code to show, not the name or as in other hacks, guest, guest, guest, but just the total number of visitors who visited the board today?

Dalvosaber
17 Mar 2005, 18:46
How do I restrict to a certain usergroup please detail it carefully for me cos im not sure

Paul M
17 Mar 2005, 19:37
I installed this hack and it is very nice, but I have a question. Is it possible to add a code to show, not the name or as in other hacks, guest, guest, guest, but just the total number of visitors who visited the board today? It already shows the number of members who have visited. It is not possible to add the number of guests.

How do I restrict to a certain usergroup please detail it carefully for me cos im not sureI don't understand what you mean - restrict what exactly ?

eva01_
17 Mar 2005, 19:43
i believe Paul M that he wants the members online today to only show a single usergroup a the online today...maybe

lefthome
17 Mar 2005, 22:47
On my board I have installed hacks showing the total number of members that have posted today. The board also shows the total number of members who visited today, but what I want is to show the total number of visitors who visited today. I understand that current visitors are shown in the “currently active users” (members, guests and spiders) but when they leave the numbers are gone and I want to keep those without using the scripts that I’ve located here that list each visitor as; guest1, guest2, guest3, and so on. I just want to retain the total number of visitors.

Paul M
18 Mar 2005, 08:50
I understand that current visitors are shown in the “currently active users” (members, guests and spiders) but when they leave the numbers are gone and I want to keep those without using the scripts that I’ve located here that list each visitor as; guest1, guest2, guest3, and so on. I just want to retain the total number of visitors. Yes, I understood what you want, but this hack cannot do that (nor will it be changed).

lefthome
18 Mar 2005, 13:59
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.

sim tech
19 Mar 2005, 07:51
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:
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-

sim tech
20 Mar 2005, 05:42
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:



// ############### 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] = 1 ;
$totaltoday += 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 ###############



// ############# Paul Marsden - Who has posted today v1.40 ###############
$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false));
//$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] = 1 ;
$posterstoday += 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['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($posttoday, 0, strlen($posttoday)-2);
}
// ############# End of Who has posted today ###############

Paul M
26 Mar 2005, 14:51
On both mods, The string:
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.

Paul M
26 Mar 2005, 14:52
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.

Julie
28 Mar 2005, 13:53
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! :)

sim tech
28 Mar 2005, 16:56
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!

trilOByte
31 Mar 2005, 21:52
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.

Paul M
31 Mar 2005, 22:43
Not sure what you mean - but I have both installed - this is what the relevant section looks like;


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

trilOByte
31 Mar 2005, 23:08
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.