<?php
/*********************************************
CPG Dragonfly - Flashchat Block
********************************************
CPG Dragonfly is copyright ~B � 2004 - 2005 by CPG Dev Team
http://www.dragonflycms.com
Dragonfly is released under the terms
and conditions of the GNU GPL version 2 or any later version
********************************************************/
if (!defined('CPG_NUKE')) { exit; }
global $MAIN_CFG, $prefix, $db, $bgcolor1;
echo "<script>
var newwindow;
function openchat(sURL){
newwindow=window.open(sURL,'chatroom','width=800,height=600,resizable=no,scrollbars=no,toolbar=no,status=no');
}
</script>";
$content = "";
$usercounter = 0;
// Get users in chatroom
$result = $db->sql_query("SELECT userid, roomid FROM ".$prefix."_fc_connections where userid != ''");
$usercounter = $db->sql_numrows($result);
$content .= "<b>Chat Users:</b> $usercounter<br>";
$content .= "<a href=\"javascript:openchat('chat/flashchat.php');\">Chatroom Login</a><br /><br><br>";
//$content .= '<a href="chat/flashchat.php" "_new">Chatroom Login</a><br /><br><br>';
while(list($userid, $roomid) = $db->sql_fetchrow($result)) {
$result2 = $db->sql_query("SELECT username FROM ".$prefix."_users where user_id = $userid");
$row = $db->sql_fetchrow($result2);
$username = $row['username'];
$content .= "<a href='index.php?name=Your_Account&profile=$username'>$username</a><br>";
// Clear the chatroom db of dead users
// Clear after 30 secs of no update
$db->sql_query('DELETE FROM '.$prefix."_fc_connections WHERE updated < now()-30");
}
?>
All times are GMT