How To Install Tufat FlashChat 4.0.11 (with screenshots)
| Author |
Message |
run0


Joined: Jun 28, 2004 Posts: 1559
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Fri Jun 09, 2006 5:42 am |
|
k can I get some help with this? first:
PHP:
$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:
<?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> (".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&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> (".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&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);
}
_________________

run0's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x |
|
| Back to top |
|
 |
run0


Joined: Jun 28, 2004 Posts: 1559
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Thu Jun 15, 2006 6:56 pm |
|
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?
_________________

run0's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x |
|
| Back to top |
|
 |
hybrid


Joined: Apr 19, 2006 Posts: 99 Location: Sydney, Australia
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Fri Jun 16, 2006 8:47 am |
|
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).
hybrid's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
 |
|
| Back to top |
|
 |
run0


Joined: Jun 28, 2004 Posts: 1559
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Fri Jun 16, 2006 10:41 pm |
|
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?
_________________

run0's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x |
|
| Back to top |
|
 |
hybrid


Joined: Apr 19, 2006 Posts: 99 Location: Sydney, Australia
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Sat Jun 17, 2006 11:04 am |
|
Code:
<?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:
Code:
var newwindow;
function openchat(sURL){
newwindow=window.open(sURL,'chatroom','width=800,height=600,resizable=no,scrollbars=no,toolbar=no,status=no');
}
hybrid's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
 |
|
| Back to top |
|
 |
run0


Joined: Jun 28, 2004 Posts: 1559
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Sat Jun 17, 2006 6:02 pm |
|
that works perfect, thanks!
_________________

run0's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/1.3.33 (Unix)/4.0.22-standard/4.3.9/DF 9.x |
|
| Back to top |
|
 |
earth


Joined: Mar 01, 2006 Posts: 268
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Wed Jun 21, 2006 9:51 pm |
|
on line 11
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?
earth's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) OS/Apache/Mysql/php/9.2.X/ |
|
| Back to top |
|
 |
hybrid


Joined: Apr 19, 2006 Posts: 99 Location: Sydney, Australia
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Wed Jun 28, 2006 5:59 am |
|
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
hybrid's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
 |
|
| Back to top |
|
 |
lauwmang


Joined: Apr 04, 2006 Posts: 40
|
Post subject: Tufat FlashChat 4.6.1. Posted: Wed Jul 05, 2006 12:22 am |
|
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?
_________________ It's www.beta.urchoice.nl/
lauwmang's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) linux/1.3.34(unix)/4.0.25-standard/4.4.1/9.0.6.1 |
|
| Back to top |
|
 |
hybrid


Joined: Apr 19, 2006 Posts: 99 Location: Sydney, Australia
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Wed Sep 06, 2006 8:52 am |
|
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?
hybrid's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
 |
|
| Back to top |
|
 |
hybrid


Joined: Apr 19, 2006 Posts: 99 Location: Sydney, Australia
|
|
| Back to top |
|
 |
BadCO


Joined: Sep 29, 2004 Posts: 115
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Fri Dec 22, 2006 8:22 pm |
|
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:
Code:
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.
BadCO's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/2.2.4/5.0.37/5.2/9.1.2.1 |
|
| Back to top |
|
 |
BadCO


Joined: Sep 29, 2004 Posts: 115
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Fri Dec 22, 2006 9:03 pm |
|
Also worth noting that there is an issue with Firefox 2 and Tufat Chat.
BadCO's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Linux/2.2.4/5.0.37/5.2/9.1.2.1 |
|
| Back to top |
|
 |
speedman


Joined: Aug 09, 2004 Posts: 19
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Mon Feb 19, 2007 8:45 pm |
|
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.
Code:
<?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
speedman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) Debian Sarge/Apache 2.0.54/PHP4.3.10-18/CPG 9.1.1 |
|
| Back to top |
|
 |
gaban


Joined: Apr 26, 2005 Posts: 84 Location: Kuala Lumpur
|
Post subject: Re: How To Install Tufat FlashChat 4.0.11 (with screenshots) Posted: Tue Feb 20, 2007 4:26 am |
|
can we mod this flash chat to be a shoutbox?
gaban's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS) WinXP/2.0.54/4.1.12/5.0.4/9.0.8 cvs |
|
| Back to top |
|
 |
|
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
|

|
User Info ![Show/hide content [x]](themes/dragonfly/images/minus.png)
 Welcome Anonymous
Last CVS commits ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Languages ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Community ![Show/hide content [x]](themes/dragonfly/images/minus.png)
 Support for DragonflyCMS in a other languages:
• Deutsch
• Español
X-links ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Preview theme ![Show/hide content [x]](themes/dragonfly/images/minus.png)
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.
|