vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   # of users in forum on forumhome (https://vborg.vbsupport.ru/showthread.php?t=38012)

Neo 04-28-2002 10:00 PM

# of users in forum on forumhome
 
Ok here it is.. I have seen a few requests for it... so here it is.

Info:
What it does is show the number users in a forums on your forum home / main page.


Install Info:
2 File Adds
6 template edits


Thats it. I will post images below if you need an idea of what it looks like :)

Here is the new version of it. " Thanks Chen :bunny: "
The first file will be posted below it you need to unistall or would like to use it O__O

Neo 04-29-2002 07:50 AM

Image :cool:

Zzed 04-29-2002 08:22 AM

Very cool. :)

John 04-29-2002 08:46 AM

Nice :)

JulianD 04-29-2002 08:50 AM

Thanks for sharing neo! Nice hack!

Erwin 04-29-2002 10:06 AM

Thanks neo - I modified it so that I can show how many users are using a particular forum in the header of every page - My java chat is actually a forum on my site, and this is what I've been looking for to show who's chatting. :)

Admin 04-29-2002 11:26 AM

This adds another query for each forum you have... ouch.

Admin 04-29-2002 11:54 AM

This is how I did it, only adds one query to the index page and the query is quite fast as well.

I added this somewhere:
Code:

// Users browsing each forum
$getforumbrowsers = $DB_site->query('
        SELECT COUNT(*) AS count, inforum
        FROM user
        WHERE lastactivity>'.($ourtimenow - $cookietimeout).'
        AND lastvisit<>lastactivity
        GROUP BY inforum
');
$forumbrowsers = array();
while ($getforumbrowser = $DB_site->fetch_array($getforumbrowsers)) {
        $forumbrowsers[$getforumbrowser['inforum']] = $getforumbrowser['count'];
}

Then stuck this inside the makeforumbit() function:
Code:

                global $forumbrowsers;
                $browsers = $forumbrowsers[$forum['forumid']];
                if (intval($browsers) < 1) {
                        $browsers = 0;
                }

Then used $browsers in the template.

SWFans.net 04-29-2002 01:42 PM

Quote:

Originally posted by FireFly
I added this somewhere:
Code:

// Users browsing each forum
$getforumbrowsers = $DB_site->query('
        SELECT COUNT(*) AS count, inforum
        FROM user
        WHERE lastactivity>'.($ourtimenow - $cookietimeout).'
        AND lastvisit<>lastactivity
        GROUP BY inforum
');
$forumbrowsers = array();
while ($getforumbrowser = $DB_site->fetch_array($getforumbrowsers)) {
        $forumbrowsers[$getforumbrowser['inforum']] = $getforumbrowser['count'];
}


I tried it in several places in index.php withno luck, does it need to be in forumdisplay.php as well?

Admin 04-29-2002 01:47 PM

No, just index.php.


All times are GMT. The time now is 06:10 AM.

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.01244 seconds
  • Memory Usage 1,733KB
  • 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
  • (3)bbcode_code_printable
  • (1)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
  • (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