![]() |
<?php
## """"" INCLUDE """""""""""""""""""""""""""""""""""""""""""" include('./config/database.php'); # Read Database-Variables ## """"" INCLUDE """""""""""""""""""""""""""""""""""""""""""" switch(false){ case($db = @mysql_connect($cfg['server'],$cfg['user'],$cfg['password'])): $mysqlERROR = mysql_error(); break; case($dat = @mysql_select_db($cfg['database'],$db)): $mysqlERROR = mysql_error(); break; } if(!$mysqlERROR) { ## """"" INCLUDE """""""""""""""""""""""""""""""""""""""""""" include('./inc/func.get_config.php'); # Read Configuration-Data ## """"" INCLUDE """""""""""""""""""""""""""""""""""""""""""" } # $sql = 'SELECT * FROM zz_user WHERE user!=\'admin\' and status=\'0\''; # -- get user currently online $sql = 'SELECT * FROM '.$cfg['userdat'].' WHERE status=0'; $result = mysql_query($sql, $db); $number = mysql_num_rows($result); //No Users Online if ($number==0) { $number= "No users in chat"; echo $number; } //Users Online else { $message = "$number users in chat:"; echo $message; echo "<p>"; for ($i=0; $i<"$number"; $i++) { $row=mysql_fetch_array($result); $id=$row[2]; echo "$id<br>"; } echo "<p>"; } mysql_free_result($result); ?> |
Thats the SQL query to pull the usernames from the chat data tables. Then I used the following code in my sidebar template to create the collapsable stat:
<!-- WHOS IN CHAT --> <tbody> <tr> <td class="thead" colspan="2"> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('who_chat')"><img id="collapseimg_who_chat" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_stats].gif" alt="" border="0" /></a> Who's in Chat? </td> </tr> </tbody> <tbody id="collapseobj_who_chat"> <tr> <td class="alt1" width="100%"><div class="smallfont">$chat_users</a></td> </tr> </tbody> <!-- /WHOS IN CHAT --> |
Finally the following code MUST be added to the phpinclude_start template:
ob_start(); require("http://Your/Chat/Path/users.php"); $chat_users = ob_get_contents(); ob_end_clean(); Should work then. |
thank you x3n0 :)
:applause: |
Hi
can someone help me please ? Did any one try to add users online to the vBindex "vbindex_customblocks" ? I added to phpinclude_start Code:
// Chat Code:
<!-- WHOS IN CHAT --> Code:
Warning: Unknown(): stream does not support seeking in /home/ukmonste/public_html/monster/global.php(395) : eval()'d code on line 10 |
Quote:
|
firstly how do you put a header and footer in,
then i need to intregrate into vb 3 RC 4,wot files do i need to edit please. Also like the feature of guest havin to register, how do i do that as well :squareeyed: Once ive done all that be Ideal for my site :rolleyes: |
Ive added the events,pretty cool, but looking at the attached images on first page it shows a events bar
any idea how i get this showing |
Quote:
i'm getting this Warning: Unknown(): stream does not support seeking in /home/virtual/site5/fst/var/www/html/forum/global.php(388) : eval()'d code on line 8 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/virtual/site5/fst/var/www/html/forum/flashchat/users.php on line 22 No users in chat Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/virtual/site5/fst/var/www/html/forum/flashchat/users.php on line 44 |
Quote:
I don't see where Chat calls global.php!! :ermm: :rolleyes: Help I want this to work I am sure you did ..... but did you change this line : require("http://Your/Chat/Path/users.php"); |
All times are GMT. The time now is 06:33 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|