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)

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

Alright, thanks. :)

KuraFire 04-29-2002 04:01 PM

Thanks Neo, for the idea, and thanks FireFly, for the less server-killing improvement. *hits install button*

Neo 04-29-2002 05:08 PM

Cool Firefly thanks for the insight :)

Old File :

Floris 04-29-2002 08:57 PM

Nice addition, when I install it next month, then I will add it to the board description though :) Saves me another column in the design.

Twig Deez 04-29-2002 10:48 PM

hey. groovy!

i put it in my forum description too, tho; right after the forum title.
i dunno, i'll fiddle around with the location a bit in a while.

nice work, neo/firefly! :)

Crazy Mofo 04-29-2002 10:49 PM

Uh i can't find this :(



PHP Code:

In forumhome or where it might be find #####

<td bgcolor="{tableheadbgcolor}"><smallfont color="{tableheadtextcolor}"><b>Threads</b></smallfont></td>

##### And place this under it ( you can place edit this to format your site) #####

<td bgcolor="{tableheadbgcolor}"><smallfont color="{tableheadtextcolor}"><b>Users Viewing</b></smallfont></td


Neo 04-30-2002 12:11 AM

it might also be in forumhome_forumbit_level1_nopost

Erwin 04-30-2002 12:42 AM

Quote:

Originally posted by FireFly
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.



Chen,

I tried your code in my index.php and all I see is "0" for the $browser value in all my forums. I am fairly sure I've put the code in the right place.

If you don't mind, I will PM you my index.php for your perusal, to see if everything is in the right place.

Crazy Mofo 04-30-2002 01:03 AM

Erwin which template did u put $browsers in?

N!ck 04-30-2002 01:04 AM

verify you have added the code to forumdisplay.php


All times are GMT. The time now is 07:56 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.01146 seconds
  • Memory Usage 1,740KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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