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)

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.


All times are GMT. The time now is 12:21 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.01476 seconds
  • Memory Usage 1,757KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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