News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme

Started by Simplemachines Cowboy, January 18, 2006, 10:54:47 PM

Previous topic - Next topic

Simplemachines Cowboy

#20
With this file, I found that I was getting errors in the log:
Quote3. Create a file called Chat.php with your text-only editor such as Notepad (PC) or BBEdit (Mac) and add this code inside it:

<?php
// Version: 1.1.1; Chat

if (!defined('SMF'))
die('Hacking attempt...');

function 
Chat() {
// This is gonna be needed...
loadTemplate('Chat');
$context['page_title'] = $txt['chat_1'];
}
?>



4. Save this file inside /smf/Sources

Remove this line:
$context['page_title'] = $txt['chat_1'];

And all will be fine...

Edit: the tutorial has this correction already.
My SMF forum: The Open Range

Simplemachines Cowboy

#21
Zombie,
In chat/info_embedded.php, find:
#roomList a { color: black; text-decoration: none; } #roomList a:hover { text-decoration: underline; }

Change "black" to whatever color you would like.
This will change the ROOM list only.

To change "1 user in 5 rooms." statement, find in chat/info_embedded.php:

<p class=normal><?php echo $usernumb ?> user<?php if ($usernumb != 1) echo "s" ?> in <?php echo $roomnumb ?> room<?php if ($roomnumb != 1) echo "s"?>.</p>


Change to:

<font color="red"><p class=normal><?php echo $usernumb ?> user<?php if ($usernumb != 1) echo "s" ?> in <?php echo $roomnumb ?> room<?php if ($roomnumb != 1) echo "s"?>.</p></font>


Change "red" to whatever color you would like.

To change the Displayed User Name (if someone is chatting), find in chat/info_embedded.php:

<?php

$users usersinroom($room['id']);
                                        if (
$users) { 
                                          echo 
"<ul class=\"userList\" id=\"room_".$room['id']."\">";
                                          foreach( 
$users as $user ) {
    echo "<li>".$user['login'] . "</li>";
  }
                                          echo 
"</ul>";
                                        }

?>
</li>
<?php ?>
<?php ?>
</ul>


Change to:

<font color="red">
<?php

$users usersinroom($room['id']);
                                        if (
$users) { 
                                          echo 
"<ul class=\"userList\" id=\"room_".$room['id']."\">";
                                          foreach( 
$users as $user ) {
    echo "<li>".$user['login'] . "</li>";
  }
                                          echo 
"</ul>";
                                        }

?>
</li>
<?php ?>
<?php ?>
</ul>
</font>


Replace "red" with whatever you would like.
My SMF forum: The Open Range

Zombie

<body>
<font color="white"><p class=normal><?php echo $usernumb ?> user<?php if ($usernumb != 1) echo "s" ?> in <?php echo $roomnumb ?> room<?php if ($roomnumb != 1) echo "s"?>.</p></font>
<ul id="roomList">
<?php if($roomnumb) { ?>
<?php foreach($rooms as $room) { ?>
<li><strong><a href="#" onclick="javascript:toggleUserList('room_<?php echo $room['id']?>')"><font color="blue"><?php echo $room['name']?> (<?php echo numusers($room['id']) ?>)</font></a></strong>
<font color="red">
<?php

$users usersinroom($room['id']);
                                        if (
$users) { 
                                          echo 
"<ul class=\"userList\" id=\"room_".$room['id']."\">";
                                          foreach( 
$users as $user ) {
    echo "<li>".$user['login'] . "</li>";
  }
                                          echo 
"</ul>";
                                        }

?>
</li>
<?php ?>
<?php ?>
</ul>
</font>
</body>


Thanks for heading me in the right direction.  I was able to figure out what I needed.

RBH

how would a person get this to open in an appropiate sized popup rather then loading in a whole window?

Simplemachines Cowboy

You can use this for a FlashChat popup without any browser options:


<a href="./chat/flashchat.php" target="ChatWindow" onClick="window.open('','ChatWindow','height=570,width=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');">FlashChat</a>
My SMF forum: The Open Range

RBH

#25
color me stupid, but where do i place this code? ;D

and thank you for the help

edit: i think it replaces this line maybe?

<a href="', $scripturl, '?action=chat" target="_blank">' , $txt['chat_1'] , '</a> 

inthe80s

I can't find the permissions for the flashchat.  Most of my users can see the chat fine, but members of one of the groups I had set up, don't have access to it, even though I want them to.
Running SMF since May '04.  Started with YaBB on Oct 2001.

Simplemachines Cowboy

inthe 80s,
There are several threads about this on the FlashChat forum, in the Integrations section.

Love the Moxie, btw!
My SMF forum: The Open Range

RBH

gc, its not a free software, and it's only $5!  :D

simplemachines cowboy, ok, that popup code you posted, where would i apply it? it doesn't work with the original code does it? i was wanting to keep it in the main tab, and when someone clicked the chat tab it would open in a popup. if the code you posted does that, then please forgive my ignorance and point me in the direction as to where i would place that code. thank you.

Simplemachines Cowboy

RBH, I don't have a way to test that.
My test forum is coded to use the set up that I documented earlier and I'd have to remove the integration portion to allow the chat window to open in it's own pop up, without the logo & user info at the top.

The code I posted gives you the parameters for what the pop up window should be.
If you want to do this I suggest that you start from scratch with no FlashChat & SMF integration and get the chat opening in a pop up and then add the rest.

My tutorial is designed to have the chat wrapped in the smf forum header & footer and in its own full window.

Good luck!
My SMF forum: The Open Range

RBH

thats cool.....thanks for the code. it'll give me something to toy with. :D

Simplemachines Cowboy

#31
Ok, feel like adding a little multi-person icon next to the block at the bottom that shows who is in each chat room?
This will add the same little 3-person icon that is on the left of the "Users Online" section, and make it a link to your chat that will open in a new page.

In /smf/Themes/default/boardindex.template.php, find the following code you placed earlier:

// flashchat users
echo '
<tr>
<td class="titlebg" colspan="2"><font color="#000000">FlashChat Users</font></td>
</tr>
<tr>
<td class="windowbg">&nbsp;</td>
<td class="windowbg2" width="100%"><iframe frameborder="0" height="100" src="', $GLOBALS['boardurl'], '/chat/info_embedded.php" style="width: 100%; margin: 0; padding: 0; border: 0; overflow: hidden;" scrolling="no" border="0" allowtransparency="true"></iframe></td>
</tr>';


REPLACE this line:

<td class="windowbg">&nbsp;</td>


With these two lines:

<td class="windowbg" width="20" valign="middle" align="center">
<a href="http://YOUR SITE HERE/smf/index.php?action=chat" target="_blank"><img src="http://YOUR SITE HERE/smf/Themes/default/images/icons/online.gif" alt="Users in Chat" /></a>


Remember to change "YOUR SITE HERE" to your url.
My SMF forum: The Open Range

nosferatu

Hello all. Thanks very much for this help. Can you tell me how I change/delete the chat rooms. The hollywood room doesn't make much sense but when I renamed it on install, it just added the extra room and left hollywood there as well.

Many thanks
There's a certain joy in being mad that only madmen know

Simplemachines Cowboy

you have to go into yoursite.com/smf/chat/admin/index.php

That will get you to the admin page for FlashChat.
You can delete & add rooms, and password protect them also. Plus other stuff.

All this and more is on the FlashChat site documentation, btw.
My SMF forum: The Open Range

nosferatu

Thanks Cowboy. I'd actually worked it out by visiting the chat log in area where it referred to the admin.php but thanks anyway. The other issue I have is that the users on line in the chat room is erratic. It's often blank but if I refresh several times, it gives the list. Is there a way of ensuring it displays and also for it to display in a horizontal plain rather than vertically.
Thanks
There's a certain joy in being mad that only madmen know

Simplemachines Cowboy

It is a static display - it will only call to chat/info.embedded.php if you refresh the page.
So if you are at the index and don't refresh you will never see folks going in and out of chat.

As far as the display of room names and users horizontally, I don't think you can. The info is displayed as an html LIST command <li>
and if you had it like this:

Hollywood | Tech Discussion | WoW (etc) how would you display a dozen user names in each room?

If you can figure it out, great, but its beyond my pay grade.  :D
My SMF forum: The Open Range

nosferatu

Fair comment.

The list of users in the forum is horizontal so I just thought you might be able to do the same with the list in chat.

Thanks for replying

Nosferatu
There's a certain joy in being mad that only madmen know

jiminoregon

Any ideas how one might have flashchat open on a forum page...without the html frames...kinda like the chat mods that are available?

Jim

Pictured idea below:

Glander

Hi ya Cowboy.

Great to know how to intergrate with RC2, but two questions (i'm dumber then dumb :D )

1 YOURDATABASENAME_FC_CONNECTIONS - is this something like: DBI:mysql:uswxorg_flacha:localhost","uswxorg_weerinfo","<PASSWORD HERE>"

2 After the modification, is FC using the user information from the database of the forum?

Regards,

Bert

nosferatu

Hello all. I've asked this in several different places now so please forgive me if you read it before.

I have the chat room up and running and its works extremely well. However, I've now created another member group called Executive members and, although they could access the chat room before, since becoming executive members the room is saying that they are banned. I've changed all the permissions in the admin panel of the forum to no avail. If I change them back to their previous member groups, they can access the chat room. Has anyone else come across this problem?

Any assistance would be greatly appreciated.
There's a certain joy in being mad that only madmen know

Advertisement: