Support ⇒ Modules & Blocks ⇒ How To Install Tufat FlashChat 4.0.11 (with screenshots) ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

How To Install Tufat FlashChat 4.0.11 (with screenshots) Reply to topic

Go to page Previous 1, 2, 3, 4, 5, 6, 7 Next

k can I get some help with this? first:

$result2 = $db->sql_query("SELECT u.user_id, u.username, c.roomid FROM {$prefix}_fc_connections AS c INNER JOIN {$user_prefix}_users AS u ON c.userid=u.user_id AND c.roomid='{$room['id']}' ORDER BY u.username", FALSE, __FILE__, __LINE__);

user_id is now userid in fc_connections it seems. Also I don't see a username field

I messed around a little and still couldn't get anything to show- it gives no error message just screws up the page

heres the full block (with a few changes I had made for previous versions)

<?php /*********************************************************************** CPG Dragonfly(TM) CMS ********************************************************************** Copyright (C) 2004 - 2005 by CPG-Nuke Dev Team www.dragonflycms.com Dragonfly is released under the terms and conditions of the GNU GPL version 2 or any later version FlashChat Who's Chatting Block Copyright (C) 2005 by Dark Grue Block for TUFaT FlashChat 4.x that lists chat rooms and members. $Source: block-FlashChat.php $ $Revision: 0.3 $ $Author: darkgrue $ $Date: 2005/07/01 $ Notes: * FlashChat requires PHP be compilied with WDDX support, or it will choke on call to things like wddx_serialize_value(). ***********************************************************************/ if (!defined('CPG_NUKE')) { exit; } /* if (!is_active('FlashChat')) { $content = 'ERROR'; return trigger_error('FlashChat module is inactive.', E_USER_WARNING); } if (!function_exists('wddx_serialize_value')) { $content = 'ERROR'; return trigger_error('The FlashChat module requires WDDX support.', E_USER_WARNING); } */ global $db, $prefix, $user_prefix; $bid = intval($bid); // Include base FlashChat classes and globals. require_once(BASEDIR.'chat/inc/common.php'); // Purge expired connections from DB. ChatServer::purgeExpired(); // Avoid polluting the JavaScript namespace by prefixing the // function name with the Block ID. $content = "\n".'<script language="JavaScript" type="text/javascript"> <!-- Hide script from old browsers. function bid'.$bid.'_togglelist(img) { var ulReturn=img.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName("ul"); if (ulReturn[0].style.display == "none") { img.src="modules/FlashChat/images/blocks/open.gif"; ulReturn[0].style.display= "block"; } else { img.src="modules/FlashChat/images/blocks/closed.gif"; ulReturn[0].style.display= "none"; } } // End --> </script>'."\n"; // Get number of users, public rooms, and the number of public rooms. list($numusers) = $db->sql_ufetchrow("SELECT COUNT(*) FROM {$prefix}_fc_connections WHERE userid IS NOT NULL", SQL_NUM); $result = $db->sql_query("SELECT * FROM {$prefix}_fc_rooms WHERE ispublic IS NOT NULL ORDER BY ispermanent, name", FALSE, __FILE__, __LINE__); $numrooms = $db->sql_numrows($result); $content .= '<center><a href="'.getlink('Chat').'">Chat Now</a></center>'; $content .= "<center>$numusers user".(($numusers == 1) ? '' : 's') .", $numrooms public room".(($numrooms == 1) ? '' : 's') ." available</center><br />\n"; if ($numrooms > 0) { // List rooms and users $content .= "<ul style="list-style:none;margin:0;padding:0">\n"; while ($room = $db->sql_fetchrow($result, SQL_ASSOC)) { // Get array of users in this room $users = array(); $result2 = $db->sql_query("SELECT u.user_id, u.username, c.roomid FROM {$prefix}_fc_connections AS c INNER JOIN {$user_prefix}_users AS u ON c.userid=u.user_id AND c.roomid='{$room['id']}' ORDER BY u.username", FALSE, __FILE__, __LINE__); while ($row = $db->sql_fetchrow($result2, SQL_ASSOC)) { $users[] = $row; } $db->sql_freeresult($result2); $content .= " <li><table border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><img src="modules/FlashChat/images/blocks/closed.gif" onclick="bid{$bid}_togglelist(this)" style="border:0;margin:2px 3px 0 0;width:9px;height:9px;" alt="" /></td>" ."<td><b>{$room['name']}</b>&nbsp;(".count($users).")</td></tr></table>\n" ." <ul style="display:none;list-style:none;margin:0 0 2px 8px;padding:0">\n"; if (count($users)) { foreach ($users AS $user) { // Print list of active users in this room $content .= " <li><a href="".getlink('Your_Account&amp;profile='.$user['user_id'])."">{$user['username']}</a></li>\n"; } $content .= " </ul></li>\n"; } else { $content .= " <li><i>No members chatting.</i></li></ul></li>\n"; } } $content .= "</ul>\n"; } else { $content .= "<i>No public rooms available.</i>\n"; } $db->sql_freeresult($result); // Get number of users, public rooms, and the number of public rooms. $result = $db->sql_query("SELECT * FROM {$prefix}_fc_rooms WHERE ispublic IS NULL ORDER BY ispermanent, name", FALSE, __FILE__, __LINE__); $numrooms = $db->sql_numrows($result); if (is_admin()) { if ($numrooms > 0) { $content .="<hr />\n"; $content .= "<center>$numrooms private room".(($numrooms == 1) ? '' : 's') ." available</center><br />\n"; // List rooms and users $content .= "<ul style="list-style:none;margin:0;padding:0">\n"; while ($room = $db->sql_fetchrow($result, SQL_ASSOC)) { // Get array of users in this room $users = array(); $result2 = $db->sql_query("SELECT u.user_id, u.username, c.roomid FROM {$prefix}_fc_connections AS c INNER JOIN {$user_prefix}_users AS u ON c.userid=u.user_id AND c.roomid='{$room['id']}' ORDER BY u.username", FALSE, __FILE__, __LINE__); while ($row = $db->sql_fetchrow($result2, SQL_ASSOC)) { $users[] = $row; } $db->sql_freeresult($result2); $content .= " <li><table border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><img src="modules/FlashChat/images/blocks/closed.gif" onclick="bid{$bid}_togglelist(this)" style="border:0;margin:2px 3px 0 0;width:9px;height:9px;" alt="" /></td>" ."<td><b>{$room['name']}</b>&nbsp;(".count($users).")</td></tr></table>\n" ." <ul style="display:none;list-style:none;margin:0 0 2px 8px;padding:0">\n"; if (count($users)) { foreach ($users AS $user) { // Print list of active users in this room $content .= " <li><a href="".getlink('Your_Account&amp;profile='.$user['user_id'])."">{$user['username']}</a></li>\n"; } $content .= " </ul></li>\n"; } else { $content .= " <li><i>No members chatting.</i></li></ul></li>\n"; } } $content .= "</ul>\n"; } else { $content .= "<i>No private rooms available.</i>\n"; } $db->sql_freeresult($result); }

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x


ok I get it, this joins the fc_connections and _users tables, but something else isn't working and it doesn't output an error. Is there a way to debug?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x


Can you update us as to what you're doing?
Are you still trying to install flashchat and its not working at all, or are you just trying to get a block working?

I wrote a very simple block that is working with what I think is the latest version of flashchat (4.5.7).

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


hybrid wrote
Can you update us as to what you're doing?
Are you still trying to install flashchat and its not working at all, or are you just trying to get a block working?

I wrote a very simple block that is working with what I think is the latest version of flashchat (4.5.7).


I installed 4.6.0 beta and it works great with the latest CVS. I'm trying to get this block working, it worked with previous versions so I am wondering what changed. Would you be willing to share your block?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x


<?php /********************************************* CPG Dragonfly - Flashchat Block ******************************************** CPG Dragonfly is copyright  � 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; $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>"; 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>"; } ?>

Provided nothing much has changed, there is no reason it shouldnt work.
It doesnt do much but provide a list of users in the chatroom.
I also have a chatroom.js for the openchat function:
var newwindow; function openchat(sURL){ newwindow=window.open(sURL,'chatroom','width=800,height=600,resizable=no,scrollbars=no,toolbar=no,status=no'); }

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


that works perfect, thanks!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x


on line 11 $content = "";

Get an error message on this one line!

Not able to see room list, is there a line of code to add to show it, or is that related to error message of line 11?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
OS/Apache/Mysql/php/9.2.X/


What is the error message you are getting?

My block does not include a room list, as I only have one room on my site.
It would be fairly easy to add though. Check out the FlashChat tables to see where the rooms are listed, copy some parts of my block and modify them to get the room ID + descriptions and add them to the $content of the block Cool

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


I've tried this block, but it isn't working.
All I can see, is the code inside the block.

The javascript popup doesn't work either.
I've copy-and-paste the lines correctly.
As I insert ( javascript:openchat('flashchat/flashchat.php'); ) into the Main menu as a link, it gives me an error saying:

Database Error
A database error has occurred

The webmaster has been notified of the error

anyone?
Attachment: block_flashchat.jpg
Description
Filesize 17.48 KiB
Viewed 458 Time(s)
You are not allowed to view/download this attachment

It's www.beta.urchoice.nl/

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
linux/1.3.34(unix)/4.0.25-standard/4.4.1/9.0.6.1


Have you managed to fix the problem?
I have this topic on watch now, so I will know when someone replies.

Also with the javascript popup, did you create the js file with the javascript in it?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


I've just made an addition to my block, because I found that people who block popups to the website are not logged out of the chat until someone else enters.
If your chatroom is quiet like mine, it means that peoples names will show in the block for long periods, and may put others off from entering the chat when there really is someone there.
Anyway, heres my addition.
// 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");

Test Signature

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


I can confirm that the latest version of FC (4.7.7) still works ok with DF and the install is much improved on the early versions. Just one word of warning if you have your DF install in a directory you will need to change the hardcoded link in inc/cmses/cpgNukeCMS.php on line 10:
require_once($cpg_root_path . '/your_folder/config.php');

Do this before you start the install.

I can also confirm that darkgrue's block no longer works. Fortunately hybrid's does seem to be ok although I haven't fully tested it.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/2.2.4/5.0.37/5.2/9.1.2.1


Also worth noting that there is an issue with Firefox 2 and Tufat Chat.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/2.2.4/5.0.37/5.2/9.1.2.1


I made a small change to hybrid's block that opens the chat in a popup window and logs the user out automatically when the popup is closed. You can put the following code in a new file in your blocks directory and call it something like block-Chatroom.php.

<?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"); } ?>

After that go to your blocks section in the admin area and fill in the title for a new block (something like Chatroom), select "Chatroom" from the filename drop down and save the new block.

Regards,

SM

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Debian Sarge/Apache 2.0.54/PHP4.3.10-18/CPG 9.1.1


can we mod this flash chat to be a shoutbox?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
WinXP/2.0.54/4.1.12/5.0.4/9.0.8 cvs

All times are UTC
Go to page Previous 1, 2, 3, 4, 5, 6, 7 Next


Jump to: