vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Number of Guests browsing current forum (https://vborg.vbsupport.ru/showthread.php?t=38092)

yasunari 04-30-2002 11:07 PM

Number of Guests browsing current forum
 
Anyone have a idea how to make it?
I have try to make it by self, but no luck with it :(

Scott MacVicar 05-01-2002 02:25 PM

Well its not exactly possible as their is a column called inforum on the user table so when a user enters a forum this column is updated in the table.

Guests don't have entires in the user table so they wont show up.

open forumdisplay.php
look for

PHP Code:

$datecut $ourtimenow $cookietimeout

below it put

PHP Code:

$guestsnum $DB_site->query_first("SELECT COUNT(*) AS total FROM session WHERE LOCATE('forumid=$foruminfo[forumid]', location)>0 AND LOCATE('forumdisplay.php', location)>0 AND userid=0 AND lastactivity > $datecut"); 

use $guestnum[total] in the forumdisplay template

Zzed 05-01-2002 04:07 PM

I released this hack a few days ago: https://vborg.vbsupport.ru/showthrea...threadid=38005 ;)

Scott MacVicar 05-01-2002 04:47 PM

thats not the number of guests, that just the number of users that have user accounts.

I believe that yasunari wanted the number of actual unregistered users browsing the forums.

Admin 05-01-2002 04:51 PM

That code will only work for people who are browsing forumdisplay.php though, it won't catch guests that read actual threads or something. That will require adding an inforum field to the session table (and removing it from the user table) to keep track of everyone.

Zzed 05-01-2002 04:56 PM

/me feels very silly right now...

Scott MacVicar 05-01-2002 04:58 PM

good point chen, i might try changing of the session table to hold inforum and see how much trouble it causes editing it, I don't expect much though.

Just changing the query at bottom of forumdisplay.php to join the user table based on the session table inforum.

Admin 05-01-2002 05:00 PM

I'd say remove the field from the user table altogether and just use the session table. You only need to edit updateuserforum() function to chagne the shut down query, and forumdisplay.php to grab the data from the session table... but you'll probably need two queries since you want to group first by userid then by IP address, I think.

yasunari 05-02-2002 02:32 AM

Yes PPN is right, I need to show the total Guests on each Forums..

I have try PPN's method,it only show the total Guest on the forumdisplay.php,but not the thread err...

*waiting for the new method.. thanks*

RetroDreams 05-24-2003 12:51 AM

Has anyone released this? I'm also interested in this hack.


All times are GMT. The time now is 01:42 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.01022 seconds
  • Memory Usage 1,725KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete