Dragonfly CMS v9 ⇒ Modules & Blocks :: Archives ⇒ Who's chatting block :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexModules & Blocks

Archived ⇒ Who's chatting block


I thought I saw somewhere on the board that there isn't a who's chatting block...could be wrong tho.

I have the code from a buddy of mine who does porting for phpnukeP. He wrote this himself for platinum and is running it at filthyhands.com. (Site's still up but defunct)..

If anyone's interested I have his permission to have it ported to dragonflycms.

It uses tufat's flashchat 3.x right now but should be compatible with 4.x. He's not very familiar with dragonfly and really doesn't have the time between his regular job and porting for platinummods.com.

Here's a screeny of it...

Why is it that there's always more month at the end of my money?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/1.3.33/4.0.25-standard/4.3.10/9.0.5.0


Id like to get it, I have one but i would like it to open the chat in a popup without any explorer bars. I had that block on my phpnuke site and liked it. i hope someone ports it.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Win XP Pro, Apache 2.0.54, MySQL 4.1, PHP 4.4.0, Dragonfly 9.0.6.1


so this is just a block to use with tufat flashchat? darkgrue made a sweet one for it that you can find searching for tufat flashchat i believe

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


run0 wrote
so this is just a block to use with tufat flashchat? darkgrue made a sweet one for it that you can find searching for tufat flashchat i believe


Why yes, it does rock. However, you might have a bit of difficulty finding it in a 14-page thread:

www.theclenchedfist.co...id=13.html

I've since abandoned work on it, but last time I was working on it the Dragonfly integration class included with FlashChat was abysmal. You may prefer to use mine, or at least use it as a starting point:

www.theclenchedfist.co...id=14.html

It is pitch black. You are likely to be eaten by a grue.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Ubuntu 12.04, Atom D525/Apache 2.2.22/MySQL 5.5.38/PHP 5.3.10/Dragonfly 9.4.0.0 CVS


darkgrue wrote
run0 wrote
so this is just a block to use with tufat flashchat? darkgrue made a sweet one for it that you can find searching for tufat flashchat i believe


Why yes, it does rock. However, you might have a bit of difficulty finding it in a 14-page thread:

www.theclenchedfist.co...id=13.html

I've since abandoned work on it, but last time I was working on it the Dragonfly integration class included with FlashChat was abysmal. You may prefer to use mine, or at least use it as a starting point:

www.theclenchedfist.co...id=14.html


Any chance you could add a link to the blockto open it up in a popup window without menus and stuff? the block made for phpnuke did that. i dont have the skill for it lol

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Win XP Pro, Apache 2.0.54, MySQL 4.1, PHP 4.4.0, Dragonfly 9.0.6.1


nvextreme wrote
Any chance you could add a link to the blockto open it up in a popup window without menus and stuff? the block made for phpnuke did that. i dont have the skill for it lol


Unfortunately, as I mentioned, I'm no longer working on the code for it. I don't even have FlashChat installed anymore. Sad

It wouldn't really be a block that you want, to do what your asking (it really wouldn't be a full module, either), but the changes wouldn't be a whole lot of work for a moderately skilled coder. The block would just be a static content with a linked image or text using the window.open() JavaScript function to open a new window of a specified size/shape. Then you'd move the existing module code into a skeleton module page to link to.

A true block can't call itself like what you're proposing. Well, maybe the link could use Javascript to create a new window and populate it, but I've never seen any examples of creating a browser window and putting content in it entirely from within JavaScript... Could be interesting to do it that way, assuming it's possible at all. Then everything could be done directly from the block. Could be a very elegant solution, actually.

I'm afraid I'll leave that to others, however. Kinda got enough to keep me busy as-is.

It is pitch black. You are likely to be eaten by a grue.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Ubuntu 12.04, Atom D525/Apache 2.2.22/MySQL 5.5.38/PHP 5.3.10/Dragonfly 9.4.0.0 CVS


I have created a very basic flashchat block that opens the chat in a popup window. You should be able to use parts of my block and parts of darkgrue's to get what you need.
Its also only in english, and would need to be modified slightly if your side uses multiple languages.

<?php /********************************************* CPG Dragonfly - Chatroom Block ******************************************** CPG Dragonfly is copyright  � 2004 - 2005 by CPG Dev Team http://www.dragonflycms.com ********************************************************/ 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>"; } ?>

For the popup window to work, you will also need to create a new file:
includes/javascript/chatroom.js

var newwindow; function openchat(sURL){ newwindow=window.open(sURL,'chatroom','width=800,height=600,resizable=yes,scrollbars=no,toolbar=no,status=no'); }

Next, open header.php and look for the line
'$header .= '<script type="text/javascript" src="includes/javascript/blockscript.js"></script>"

After this, add
<script type="text/javascript" src="includes/javascript/chatroom.js"></script>

You can also create a link in your Main Menu block using the following as a link
javascript:openchat('chat/flashchat.php');

At this stage, my DragonFlyCMS knowledge is quite small, but this block could be easily built on and made prettier.

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


In case anyone is still messing with this. I got Dark Grue's block to work by making a simple change, starting at line 44:
change this:
// Include base FlashChat classes and globals. require_once(BASEDIR.'chat/inc/common.php'); // Purge expired connections from DB. ChatServer::purgeExpired();

to this:
// Include base FlashChat classes and globals. //require_once(BASEDIR.'chat/inc/common.php'); // Purge expired connections from DB. //ChatServer::purgeExpired();

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Ubuntu 7.10/Apache 2.2.4 /MySQL 5.0.45/PHP 5.2.3-1/ CPGNuke 9.2.1

All times are UTC