Google

NukeCoder


View next topic
View previous topic
Post new topic   Reply to topic
Author Message
dutchie




Joined: Feb 25, 2008
Posts: 11

PostPosted: Tue Mar 04, 2008 5:27 am
Reply with quote

Dear Live Chat programmers/designers...

Is it possible to make a new block that displays the users currently present in the chat?
 
View user's profile Send private message
gotcha
Site Admin
Site Admin



Joined: Oct 25, 2004
Posts: 920

PostPosted: Wed Mar 05, 2008 12:11 pm
Reply with quote

I personally don't have time to do it right now, but to show who is online you just need to query the table nuke_live_online. That table will contain the usernames of all people active in the chat.
 
View user's profile Send private message Visit poster's website
dutchie




Joined: Feb 25, 2008
Posts: 11

PostPosted: Wed Mar 05, 2008 12:35 pm
Reply with quote

If I had the skill to do it myself, even with the info you provided, would I be asking for it here?!? Razz Wink
 
View user's profile Send private message
xt-wax




Joined: Jun 15, 2008
Posts: 8

PostPosted: Sun Jun 22, 2008 11:05 am
Reply with quote

Ok dutchie.. and anyone else.

I created a block to display who is in chat, how many are in chat and provide a link to your chat. You can copy the code below and create your block or download it from the downloads/addons/blocks section of my homepage : http://www.ravenuke.com

If anyone has any tweeks or addons to make to this block, please let me know and I will add them to it.

Enjoy.

Code:
<?PHP


/************************************************************************/
/* Code created by XT-Wax at www.RaveNuke.com                           */
/* Please keep all copyright info in file... Thanks                     */
/* Copyright (c) 2007 by XT-Wax                                         */
/* http://www.RaveNuke.com                                              */
/* Email suggestions and tweeks to this block: webmaster@ravenuke.com   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/* Free to use and distribute, but Copyright must stay in code. Thanks. */
/*                                                                      */
/************************************************************************/
/* Download this block and other scripts from http://ravenuke.com       */
/*                                                                      */
/* This block is designeed to work with Live Chat which can be          */
/* downloaded at http://nukecoder.com (Thanks for this awesome chat)    */
/*                                                                      */
/************************************************************************/



if ( !defined('BLOCK_FILE') ) {
    Header('Location: ../index.php');
    die();
}
 
$content = '';
global $admin, $user, $cookie, $prefix, $user_prefix, $db, $dbi, $anonymous, $name, $lang, $sql;

//Function to call number of chatters in chat room
$count = 'SELECT COUNT(username) FROM '.$prefix.'_live_online WHERE timestamp>\''.(time() - 60).'\' ORDER BY username ASC';
$count_results = $db->sql_query($count);
list($chat_user_count) = $db->sql_fetchrow($count_results);

$content .="<center>Number of Chatters:<br>("; // <--- Change "Number of Chatters:" here iF you like
$content .=$chat_user_count;
$content .=")</center>";

//Function to call current users in chat
$user_display = 'SELECT username FROM '.$prefix.'_live_online WHERE timestamp>\''.(time() - 60).'\' ORDER BY username ASC LIMIT 0,50';
$results = $db->sql_query($user_display);
$content .="<br /><center><strong>Who's Chatting:</strong><br /><br /> "; // <--- Change "Who's Chatting:" here iF you like
if ($db->sql_numrows($result)) {
   while (list($username) = $db->sql_fetchrow($result)) {
   $content .= '<div align=center>* '.$username.'</div>';
   }
   } else {
   $content .= 'No Ones Chatting';
   }
   $content .="</center>";

//Link to Live_Chat module... Change address if needed
$content .=  "<BR><center><a href='modules.php?name=Live_Chat'>JOIN CHAT NOW</a></center>"; // <---- Change "Live_Chat" to your module name IF changed name

//Please retain below info
$content .= "<BR><BR><center><font size=\"0\">Powered By</font></center>";
$content .= "<center><a href=\"http://www.RaveNuke.com/index.php\"><font size=\"0\">www.RaveNuke.com</font></a></center>";

?>



Last edited by xt-wax on Mon Jun 23, 2008 4:12 pm; edited 1 time in total 
View user's profile Send private message
dutchie




Joined: Feb 25, 2008
Posts: 11

PostPosted: Sun Jun 22, 2008 3:38 pm
Reply with quote

Thanks for that block!! I will install it tomorrow, as I'm off to bed right now!

Thanks again!
 
View user's profile Send private message
xt-wax




Joined: Jun 15, 2008
Posts: 8

PostPosted: Mon Jun 23, 2008 4:11 pm
Reply with quote

Please see this thread. Above code has been changed as well.

http://nukecoder.com/ftopicp-2607-Chat_info_block.html#2607

_________________
www.RaveNuke.com (phpnuke themes, blocks, etc)
www.SquadOnline.com (FREE Squad or not web hosting)
www.xtsquad.com (My Squad Homepage) 
View user's profile Send private message
dutchie




Joined: Feb 25, 2008
Posts: 11

PostPosted: Tue Jun 24, 2008 4:14 am
Reply with quote

Great! Thanks for the tweaks!!
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 5 Hours
Forums ©