vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Who Was Online Today on forums (https://vborg.vbsupport.ru/showthread.php?t=59579)

Gary King 01-02-2004 10:00 PM

Who Was Online Today on forums
 
PLEASE CLICK THE INSTALL BUTTON IF INSTALLED! :)

What does this hack do?

It shows the users who visited your forums in the last 24 hours (or today). This hack works similiarly like the one released for vBulletin 2.

NOTE: If you want to show 'Who was online today' on a separate page from forumhome, then download instructions-newpage.txt and onlinetoday.php instead of instructions-regular.txt

Modifications
  • 1 file modification
  • 3 template modifications
  • 0 queries to run

Features
  • supports and uses phrases
  • usernames are formatted properly
  • invisible users only show to people who are supposed to see them (admins and whoever else you allowed)
  • integrated (makes it so that the Who Was Online bar is now collapseable :)

Screenshots
Look below :)

Credits: Thanks goes to Mystics, where this hack is based on his :)

Dan 01-03-2004 04:41 PM

thanks for the great hack Gary I think I'll use it on my site.

MindTrix 01-03-2004 04:48 PM

Ima go install this now because i was waiting for it :) Cheers mate

Hotte 01-03-2004 04:50 PM

why did it take so long to release? :D
was waiting for this hack :)
*install*

Gio Takahashi 01-03-2004 04:59 PM

Installing now. Good job.

Link14716 01-03-2004 05:01 PM

This is the third version of the Who Was Online Today hack for vB3 that I've seen.

sharjah 01-03-2004 05:14 PM

One of the 5 hacks I'm looking for.
Great Job!

redd 01-03-2004 05:17 PM

Can this also be set to show the total number of guests today?

Princeton 01-03-2004 05:17 PM

great job!

Link14716 01-03-2004 05:17 PM

Quote:

Originally Posted by redd
Can this also be set to show the total number of guests today?

It would be insanely inaccurate no matter how it is done.

Asterik 01-03-2004 05:18 PM

it has the exact same text *bad grammar* as Chroder's one

Princeton 01-03-2004 05:32 PM

some errors ...
this
Code:

<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userid" title="Last online at $lastactivetime">$username</a>$invisibleuser
should be
Code:

<a href="member.php?s=$session[sessionhash]&amp;action=getinfo&amp;userid=$userid" title="Last online at $lastactivetime">$username</a>$invisibleuser
I would also recommend using vb phrases (add new ones)
Also, add template names to $globaltemplates array

MGM 01-03-2004 05:33 PM

thanks Gary!!

MGM out

sabret00the 01-03-2004 05:39 PM

you gonna make one for the WOL?

Zelda-King 01-03-2004 05:44 PM

Mods and admins don't show in formatted text (bold/italic).

Princeton 01-03-2004 08:23 PM

Quote:

Originally Posted by Zelda-King
Mods and admins don't show in formatted text (bold/italic).

try (not tested)
Replace
Code:

        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'];
        }

with
Code:

$username = fetch_musername($todayuser);

Zelda-King 01-03-2004 08:38 PM

That did the trick, thanks! :)

amykhar 01-03-2004 09:07 PM

Invisible users show for all and not just admins. The fix is as follows:

Find:
PHP Code:

$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity FROM ".TABLE_PREFIX."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($vboptions['timeformat'], $todayuser[lastactivity]);
    if (
$todayuser['invisible']==1) and ($bbuserinfo['usergroupid']!=6) {
        
$numbertodayonlineinvisible++;
        continue;
    }
    if (
$todayuser['invisible']==1) { // Invisible User but show to Admin
        
$invisibleuser '*';
    } 

Replace with:
PHP Code:

$todayusers=$DB_site->query("SELECT userid,(user.options & $_USEROPTIONS[invisible]) AS invisible, username, usergroupid, lastactivity FROM ".TABLE_PREFIX."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($vboptions['timeformat'], $todayuser[lastactivity]);
    if ((
$todayuser['invisible']) and ($bbuserinfo['usergroupid']!=6)) {
        
$numbertodayonlineinvisible++;
        continue;
    }
    if ((
$todayuser['invisible']) and ($bbuserinfo['usergroupid']==6)) { // Invisible User but show to Admin
        
$invisibleuser '*';
    } 


-----------
In case my copying and pasting are screwy, what needs to be fixed is the query. It needs to check the options field in the table. invisible was a vb2 field and isn't in vb3. It also needs to change the if statements because invisible will not equal 1. It just won't equal zero.

I also moved the templates to the cache on my board, but didn't bother with the phrases. Things seem to be working ok now.

Amy

amykhar 01-03-2004 09:22 PM

Another glitch. This one in the forumhome_todayloggedinusers template.

Find:
Code:

Number of Active Users Today: $numbertodayonline</b></div>
Replace with:

Code:

Number of Active Users Today: $todayonline</b></div>

uae 01-04-2004 05:15 AM

Thanks Gary ...

Boofo 01-04-2004 07:09 AM

This is off a bit, I think. My unigue registered users shows 1 today (reason=crappy site ;)) and this hack shows 2. Also, can someone fix the most users on a single day time to follow what we have set for the board (like detailed time, etc.)?

trackpads 01-04-2004 04:10 PM

Mine too, it shows 20 but this script shows 23, not sure. Nice hack though!

himerus 01-04-2004 08:32 PM

Is it possible to run the queries from the php_include_start template? I'd like to use this, but I'd like to avoid hacking the actual PHP files. I've done a few hacks to my board that were originally file hacks, and I was able to modify them to pull the data in the php_incllude sections.

If it can be, what is the variable to control it only being called on the index....

something like:

if ($page = 'INDEX')
{
get 24 hr users
}

aidler 01-04-2004 09:02 PM

Quote:

Originally Posted by amykhar
Invisible users show for all and not just admins. The fix is as follows:

Find:
PHP Code:

$todayusers=$DB_site->query("SELECT userid, username, usergroupid, lastactivity FROM ".TABLE_PREFIX."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($vboptions['timeformat'], $todayuser[lastactivity]);
    if (
$todayuser['invisible']==1) and ($bbuserinfo['usergroupid']!=6) {
        
$numbertodayonlineinvisible++;
        continue;
    }
    if (
$todayuser['invisible']==1) { // Invisible User but show to Admin
        
$invisibleuser '*';
    } 

Replace with:
PHP Code:

$todayusers=$DB_site->query("SELECT userid,(user.options & $_USEROPTIONS[invisible]) AS invisible, username, usergroupid, lastactivity FROM ".TABLE_PREFIX."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($vboptions['timeformat'], $todayuser[lastactivity]);
    if ((
$todayuser['invisible']) and ($bbuserinfo['usergroupid']!=6)) {
        
$numbertodayonlineinvisible++;
        continue;
    }
    if ((
$todayuser['invisible']) and ($bbuserinfo['usergroupid']==6)) { // Invisible User but show to Admin
        
$invisibleuser '*';
    } 


-----------
In case my copying and pasting are screwy, what needs to be fixed is the query. It needs to check the options field in the table. invisible was a vb2 field and isn't in vb3. It also needs to change the if statements because invisible will not equal 1. It just won't equal zero.

I also moved the templates to the cache on my board, but didn't bother with the phrases. Things seem to be working ok now.

Amy

Your modification is not working. I'm getting a MySQL error.

Link14716 01-04-2004 09:04 PM

That's a whole lot of information. :rolleyes:

Boofo 01-04-2004 09:09 PM

Quote:

Originally Posted by aidler
Your modification is not working. I'm getting a MySQL error.

I am using the same mod and it works fine here. What is the error you are getting? Can you post it and maybe we can help.

ogden2k 01-04-2004 09:15 PM

Gary, have you updated your attachment so we don't have to apply all of these fixes?

Mamochka 01-04-2004 09:18 PM

Good job. Work easy and fine.

bspiller82 01-05-2004 12:19 AM

THanks. I have also been awaiting for this one as I used it in my 2.x days :)

Boofo 01-05-2004 06:51 AM

Gary, are you still suppoerting this hack? If so, you need to fix it. The recordusers keeps resetting itself daily.

monstergamer 01-05-2004 04:00 PM

to make this hack were it can collapse
also in my code i took out the
Most users ever online on a day was $todayrecordusers on $todayrecorddate.
you can take a look at www.monstergamer.net/vb/index.php

go to forumhome_todayloggedinusers

replace all with
PHP Code:

 <tbody>
<
tr>
<
td class="thead" colspan="2">
<
a style="float:$stylevar[right]href="#top" onClick="return toggle_collapse('forumhome_todayactiveusers')"><img id="collapseimg_forumhome_todayactiveusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_todayactiveusers].gif" alt="" border="0" /></a>
Users Been on Today$numbertodayonline
</td>
</
tr>
</
tbody>
<
tbody id="collapseobj_forumhome_todayactiveusers" style="$vbcollapse[collapseobj_forumhome_todayactiveusers]">
<
tr>
<
td class="alt1" colspan="6"><div class="smallfont">
<
strong><nobr>The following members have already visited the forums today:</nobr></strong><br />
        
$todayloggedinuser<br />
        </
div></td>
</
tr>
</
tbody


Gary King 01-05-2004 08:12 PM

I'll be working on the hack in a bit, so stay tooned for a new release of this hack :)

Gary King 01-05-2004 11:27 PM

Newest version has been released! I hope you guys like it ;)

By the way, phrases support will be added in a little later (hopefully within the next hour or so) I just had to release this one before I left the computer for a bit :))

Gary King 01-05-2004 11:29 PM

Quote:

Originally Posted by Boofo
This is off a bit, I think. My unigue registered users shows 1 today (reason=crappy site ;)) and this hack shows 2. Also, can someone fix the most users on a single day time to follow what we have set for the board (like detailed time, etc.)?

I think it already does follow the date / time formatting? :)

Gary King 01-05-2004 11:48 PM

Phrases support now available :D

squawell 01-06-2004 12:01 AM

nice hack~Gray!:D:D

[high]* squawell clicked install....[/high]

monstergamer 01-06-2004 02:22 AM

good work
like it better since you can collapse it now :)

Davey-UK 01-06-2004 11:54 AM

Would it be difficult to integrate this into a non-Vb page?

Gary King 01-06-2004 07:14 PM

Quote:

Originally Posted by Davey-UK
Would it be difficult to integrate this into a non-Vb page?

Non vB, or just a separate page by itself like the original hack for vB 2 was able to? (But still a part of vBulletin)?

Davey-UK 01-07-2004 02:30 AM

Just as a standalone page, such as the index page of your site instead of actually having to go to the forum to see it.


All times are GMT. The time now is 05:39 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01688 seconds
  • Memory Usage 1,874KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (5)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete