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)
-   -   phpMyChat - # of users in CHAT (https://vborg.vbsupport.ru/showthread.php?t=37636)

jamoss 04-18-2002 10:00 PM

phpMyChat - # of users in CHAT
 
Below is a hack I modified to show the number of users in your integrated phpMyChat.

Requirements:
phpMyChat tables must be in the same database as vBulletin tables!

1. Add this code...
* If you want this to show up in your HEADER, you must add it to global.php

* If you want this to show up on the body of your home page, add it to index.php

~~~~~~~~~~~~~~~~
//CHAT USER COUNT
// Cleanup Old Users
// 240 = Wait 4 mins before deleteing inactive users

//CHAT DIRECTORY GOES HERE
$chatdir='./chat'

$DB_site->query("DELETE from c_users where u_time < ".(time() - 240)." and u_time > 0");

$numchattersa = $DB_site->query_first("SELECT count(username) AS username FROM c_users");

$numchatters = $numchattersa[username];
if ($numchatters==1) {
$membertext="member";
$istext="is";
}
else {
$membertext="members";
$istext="are";
}

$chatinfo = "&nbsp;There $istext <font color=red>$numchatters</font> $membertext in <a href=$chatdir/index.php3 >CHAT</a>";
//END CHAT USERS
~~~~~~~~~~~~~~~~

2. Add the variable $chatinfo in whatever template (spot) you want to put this phrase.

NOTES:
* It will use the correct english for all numbers - example:

There are 0 members in chat
There is 1 member in chat
There are 43 members in chat

* Example on http://www.babynames.com/boards

Cheers!
Jennifer.

Velocd 04-20-2002 12:24 AM

Sorry, but this has already been released by Mem and me sometime before, so its not needed.

Reference:
https://vborg.vbsupport.ru/showthrea...threadid=37397

jamoss 04-20-2002 12:37 AM

I said in my original message that it was a hack I **MODIFIED**

This version explains how to put it into the HEADER, it eliminates the need to create a custom template, and also puts in the correct English for all situations.

Jennifer.

Velocd 04-20-2002 03:07 PM

Don't get touchy about it, I was just saying. Its nicer to put things in templates then headers, easy to modify. ;)


All times are GMT. The time now is 11:19 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.00900 seconds
  • Memory Usage 1,717KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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