The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
Hack Name: Who was online today
Hack Version: 1.0.2 For vB Version:: 2.x Originally Created by: genial @ Skats Board (Contact) Documentation, Translation, a few changes and posted by: Mystics Description: This Hack adds something like the "Currently Active Users:"-Feature of vBulletin. The difference is, instead of showing the users, who are currently online, it shows all Users, who were online on a day and it also displays "Most users ever online on a day". Summary of the Features:
Files to edit: index.php Templates to edit: forumhome New Templates: forumhome_todayloggedinusers, forumhome_todayloggedinuser I have attached the Install Instructions in a Text File. The Instruction is in English and in German. I will attach a Screenshot in a Reply to this Thread! Post any Questions into this Thread! Updates in 1.0.1: Inserted the two new templates into the template precaching (first step) Updates in 1.0.2: Fixed a little Bug with the "Most users ever online on a day"-Count (Replace '$maxusers[2] = $todayonline;' with '$maxusers[2] = $numbertodayonline;' in index.php) Info: You can find an other version of this Hack here. In this other version the usernames of the members, who were already online today, are not shown on the Forum-Mainpage; the names are shown in an extra File (like online.php), onlinetoday.php (Screenshot). So, depending on which version of the Hack you prefer, you have to download this: Version with usernames on the main Site of the Forum or this: Version with usernames on extra site (onlinetoday.php) Regards, Mystics Show Your Support
|
Comments |
#442
|
|||
|
|||
After changing the function from 'mktime' to 'gmmktime' I checked through results for different timezones , all showed correctly from -12 to +5.5 any timezone after +5.5 showed nil members .... which isn't correct. It was if the hack was compensating for the servers timezone offset.
I then had to change a little more from the hack to get it to display the correct number of members from -12 to +12 timezones. I have no idea how correct these changes are to the hack but they do work on my forum (at the moment) when prior to these changes I wasn't seeing any members displayed. The other part of the hack I changed was deleting the "$timeoffset" and replacing it with a "0" : Changed: WHERE lastactivity > " . (mktime(0,0,0,date("m"),date("d"),date("Y")) + (($bbuserinfo['timezoneoffset']-$timeoffset)*3600)) . " To: WHERE lastactivity > " . (gmmktime(0,0,0,date("m"),date("d"),date("Y")) + (($bbuserinfo['timezoneoffset']-0)*3600)) . " I am still testing these changes, they may be a complete red herring but so far so good. |
#443
|
|||
|
|||
24 hours have gone by and the 'hack' is working without problems. I'm still seeing 'members names' who have already visited the board today and corrected if I log in from a different time zone
Its working so well that I've added back the "Number of Active Users Today" |
#444
|
|||
|
|||
Rand, I've been following your time adjustment system with interest, kinda hoping others would report in on how well it works before I try it myself. Is it still working well for you? Does it affect the timestamp on user's posts? For example, my webhost is on the west cost (-8 from GMT) so I have the time adjusted in my Admin CP to -8. Then, I'm on the east coast so I have to adjust my personal time zone in my Control Panel to -5 and somehow that all spits out the correct time on the board when I log in.
If I make the changes you've mentioned (to correct the Visited Today statistics) will it affect the time on the board itself? Will I have to change that -8 in the admin Control Panel, or the -5 in my user control panel? Will I have to ask my members to adjust their timezones? It's so confusing! lol! |
#445
|
|||
|
|||
Hi Emmy,
No problems so far with the little changes to the hack. We just moved our site from NY to Dallas and changed timezones in the process. I just changed the vB offset from -5 to -6 and everything still worked. Post times are still correct for GMT. No changes needed for 'user cp'. I dont know how relevant the fact is that our site uses GMT as its timezone, all I can say is that the hack now works perfectly for our site |
#446
|
|||
|
|||
Thanks for the reply Rand. I've made the changes and I'll let you know how it goes for my site. Right away my "visted today" jumped from 33 to 74 (which is I assume, the difference between members who visited since 6am this morning and members who visited in the last 24 hours). I need to let it run for a day or two to get a sense of what it's doing and how it's working.
Thanks for the help! |
#447
|
||||
|
||||
aww i got a lil problem
there are people online but the users online is not listing them below |
#448
|
|||
|
|||
Great Hack, Mystics... And great suggestions, Rand M...
The one thing that confuses me a bit is that when I am logged into my forum (and my user time is adjusted for Pacific S.T.,), then it shows 71 members at the moment. However, when I log out, the time becomes GMT time on my board, and it shows 43 members... (but it shows 71 as the max users online in one day). Should the users who have logged on in the past 24 hours be the same number, whether you are logged on or not? I know that I am dragging an old thread out of the dark, but one of my VB boards still runs with 2.3.4, because I have many hacked and archive add-ons that I want to keep because they are serving me well. I feel like the solution to the timezone consistency issue is in these lines of code: Quote:
Thanks, Khashyar |
#449
|
|||
|
|||
I think I figured it out...
To use GMT to decide who logged in the past day, wether you are logged in or logged out: replace Rand M's code: Quote:
Quote:
I just wonder if it will set itself back to zero when it reaches midnight GMT or not? I'll have to wait and see... Khashyar |
#450
|
|||
|
|||
I really like this hack, it's one my very favourates. But I have a question that I need an answer to please. I installed this on vBulletin 2.3.7 and it is working fine.
But there is a section in the mod readme file which says search for this in you index.php file: Code:
if ((int)$maxusers[0] <= $totalonline) { $time = time(); $maxloggedin = "$totalonline " . $time; $DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'"); $maxusers[0] = $totalonline; $maxusers[1] = $time; } Code:
// today online hack begin
if ((int)$maxusers[0] <= $totalonline) {
$time = time();
$maxloggedin = "$totalonline " . $time . " " . $maxusers[2] . " " . $maxusers[3];
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
$maxusers[0] = $totalonline;
$maxusers[1] = $time;
}
$todayloggedinusers = "";
$numbertodayonline = 0;
$numbertodayonlineinvisible = 0;
$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity, invisible FROM user
WHERE lastactivity > " . (mktime(0,0,0,date("m"),date("d"),date("Y")) + (($bbuserinfo['timezoneoffset']-$timeoffset)*3600)) . "
ORDER BY username");
while ($todayuser=$DB_site->fetch_array($todayusers)) {
$numbertodayonline++;
$invisibleuser = '';
$userid = $todayuser['userid'];
$lastactivetime = vbdate($timeformat, $todayuser[lastactivity]);
if ($todayuser['invisible']==1 and $bbuserinfo['usergroupid']!=6) {
$numbertodayonlineinvisible++;
continue;
}
if ($todayuser['invisible'] == 1) { // Invisible User but show to Admin
$invisibleuser = '*';
}
if ($todayuser['usergroupid'] == 6 and $highlightadmin) {
$username = "<b><i>$todayuser[username]</i></b>";
} else if (($mod["$userid"] or $todayuser['usergroupid'] == 5) and $highlightadmin) {
$username = "<b>$todayuser[username]</b>";
} else {
$username = $todayuser['username'];
}
if (!$todayloggedinuser) {
eval("\$todayloggedinuser = \"".gettemplate('forumhome_todayloggedinuser')."\";");
} else {
eval("\$todayloggedinuser .= \", ".gettemplate('forumhome_todayloggedinuser')."\";");
}
}
$DB_site->free_result($todayusers);
if ($bbuserinfo[usergroupid] == 6) {
$todayonline = $numbertodayonline;
} else {
$todayonline = $numbertodayonline - $numbertodayonlineinvisible;
}
if ((int)$maxusers[2] <= $numbertodayonline) {
$time = time();
$maxloggedin = $maxusers[0] . " " . $maxusers[1] . " $numbertodayonline " . $time;
$DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'");
$maxusers[2] = $numbertodayonline;
$maxusers[3] = $time;
}
$todayrecordusers = $maxusers[2];
$todayrecorddate = vbdate($dateformat,$maxusers[3]);
eval("\$todayloggedinusers = \"".gettemplate('forumhome_todayloggedinusers')."\";");
//today online hack end
But the code in my index.php file looks like this instead: Code:
if (($maxusers[0] <= $totalonline AND $maxusers[0] > 0) OR sizeof($maxusers) == 1) { $time = time(); $maxloggedin = intval($totalonline) . ' ' . $time; $DB_site->query("UPDATE template SET template='$maxloggedin' WHERE title='maxloggedin'"); $maxusers[0] = $totalonline; $maxusers[1] = $time; } If I should have made some changes can you please post the whole code corrected that I need to use instead. Because I'm not a coder to do it myself. thanks! |
#451
|
|||
|
|||
Actually I dont have forumhome_loggedinuser,forumhome_loggedinusers in my index.php, I cant find it either with "find" help.. so where do i pu/change it to the forumhome_todayloggedinuser,forumhome_todayloggedi nusers,forumhome_loggedinuser, forumhome_loggedinusers ?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|