Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Simplemachines Cowboy on January 18, 2006, 10:54:47 PM

Title: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: Simplemachines Cowboy on January 18, 2006, 10:54:47 PM
As the title says, here is a tutorial for integrating FlashChat version 4.x.x and the SMF 1.1.1 DEFAULT THEME (it also works with the older RC2 & RC3).
Thanks to marcnyc for the original groundwork, mikemill for the template work, jaybachatero for quality control & ^DooM^ for the last bit. :)

First off, install FlashChat.
http://www.tufat.com/docs/flashchat/installer.html
Make sure you only upload the "chat" folder from the .zip file, and upload it to the same folder that has your SMF installation i.e. if your smf is at www.helloworld.com/smf then the chat folder should be at www.helloworld.com/smf/chat.
Make sure that you also choose the "Check here if you wish to integrate FlashChat" option so it will integrate into SMF.
DO NOT follow any of the FlashChat instructions for placing a chat button or adding a Who's Chatting Box. It's all for rc1 and older.

OK, we will assume that you have accomplished the install with no ill effects.

Right now, FlashChat will open in a new window completely ignoring the template and style and theme of SMF.
So you have a chat that recognizes your registered users because it uses the same database but it launches independently and looks completely different and is an "outsider" to the board.
Here is how you can change this.
These instructions will launch your chat inside the board's theme/template so that you still have the header of the board above the chat and the footer of the board below it.
Here is how (I assume that you installed SMF in the folder called /smf/ - if you are not just change "/smf/" with the name of your smf folder on your server.
These instructions are for the 1.1 RC2, RC3 & 1.1.1 DEFAULT THEME - no guarantees on any other theme.

1. Open smf/index.php.

2. Find this line:

'boardrecount' => array('Admin.php', 'AdminBoardRecount'),


and AFTER that code add this code (about line 220):

'chat' => array('Chat.php', 'Chat'),


3. 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');
}
?>



4. Save this file inside /smf/Sources

5. Create a file called Chat.template.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

function template_main()
{
global $context$settings$options$txt$scripturl;

echo '
<script language="JavaScript" type="text/javascript"><!--
function checkAll(onOff)
{
for (var i = 0; i < document.searchform.elements.length; i++)
{
if (document.searchform.elements[i].name.substr(0, 3) == "brd")
document.searchform.elements[i].checked = onOff;
}
}
// --></script>
<form action="'
$scripturl'?action=search2" method="post" name="searchform" id="searchform">
<table width="80%" border="0" cellspacing="0" cellpadding="3" align="center">
<tr>
<td>'
theme_linktree(), '</td>
</tr>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td>Chat</td>
</tr><tr>
<td class="windowbg">'
;

// load the chat
echo '<iframe width="100%" height="500" src="http://www.yourserver.com/smf/chat/flashchat.php"></iframe>';

echo '
</td>
</tr>
</table>
</form>'
;
}

?>



6. Save this file inside /smf/Themes/default/

7. The code above assumes that your server is called www.yourserver.com and that you have installed SMF in the root's folder "smf" and FlashChat in its subfolder "chat". You don't need the full URL, you can also (and it is recommended that you do) use "chat/flashchat.php" as your URL if you have created the "chat" folder inside the "smf" folder. Change paths according to your installation.

8. Add a "Chat" tab to the tab array:

A. In smf/Themes/default/index.template.php, between the lines "//Show the [home] button" and "// Show the [help] button", add this block of code (You can place these between any two buttons; I prefer it here):

// Show the [chat] button.
if ($context['user']['is_logged'])
echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=chat" target="_blank">' , $txt['chat_1'] , '</a> 
</td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


This will open FlashChat in a separate browser window; if you don't want that remove the target="_blank".

B. Somewhere in smf/Themes/default/languages/index.english.php, add this code:

$txt['chat_1'] = 'Chat';


C. Add Chat to the list of current actions:
In smf/Themes/default/index.template.php, find:

if ($context['current_action'] == 'search2')
$current_action = 'search';


Add this code AFTER the above:

if ($context['current_action'] == 'chat')
$current_action = 'chat';



Next, we will show you how to add some "Users in Chat" notices on your board.

1. Adding a Who's Chatting box underneath the Members Online section.

In /smf/Themes/default/boardindex.template.php, AFTER this block of code:

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))
echo '
', $txt[140], ':<br />', implode(', ', $context['list_users_online']);

echo '
<br />
', $context['show_stats'] && !$settings['show_sp1_info'] ? '<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>
<tr>
<td class="windowbg2" width="100%">
<span class="middletext">
', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</span>
</td>
</tr>';


ADD this code:


// 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>';



2. Show how many of the currently online users are actually in the chat (this will be shown in the ONLINE USERS section at the bottom of the INDEX page, right next to where it says "X visitors, X users").

In /smf/Themes/default/boardindex.template.php, & search for the comment string & echo ':

// "Users online" - in order of activity.
echo '


REPLACE BOTH THOSE LINES with this code:

// "Users online" - in order of activity.

    $chatrequest = db_query("
            SELECT COUNT(*) AS numb
            FROM  YOURDATABASENAME_fc_connections
            WHERE userid IS NOT NULL", __FILE__, __LINE__);
         list ($chatcount) = mysql_fetch_row($chatrequest);   
         mysql_free_result($chatrequest);
     
if ( $chatcount == "1" ) {
$singularplural2 = "";
} else {
$singularplural2 = "s";
}

echo '

MAKE SURE YOU CHANGE "YOURDATABASENAME_FC_CONNECTIONS" TO THE PROPER PATH!
Yes, you will place the above code in index.template.php also.

Find this line (look about 10 lines below the echo ' in the above inserted code)

', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];


REPLACE all of that with:

', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

echo ', ' . $chatcount . ' User'.$singularplural2.' in Chat';


This will make your forum's Members "Online" read something like: "0 Visitors, 4 Users, 2 Users in Chat". Please note that marcnyc's code does actually take into account the possibility that just one user is online and will adjust the sentence grammatically so that it will read "1 User in Chat", as opposed to "1 Users in Chat"

3. Add "Users in Chat" sentence in ALL pages except the chat page itself (this will add a sentence at the top of your board section, right above the HOME, HELP, SEARCH, ADMIN, PROFILE, CALENDAR, CHAT, LOG OUT navigation bar tabs).
This code will also adjust the sentence to make sure it is grammatically correct AND it will NOT show the sentence in the actual chat page because the user doesn't need to see it (he/she already has this information from the chat room) and because the user count would not be up to date, since the page was already parsed and doesn't update in real time, like the chat room does.

WARNING: the way this is implemented it will REPLACE the always visible "News" display to the left of the Quick Search text box. If you wish to have the news displayed you will need to figure out a place to put the code yourself! :)

In /smf/Themes/default/index.template.php, Find this block of code:

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
</td>';

REPLACE all of that with:

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))

echo '
<td width="90%" class="titlebg2">
<span class="mediumtext">', template_flash_chat(), '</span>
</td>';

// echo '
// <td width="90%" class="titlebg2">
// <span class="mediumtext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
// </td>';


I left the random_news_line commented out so you can replace it quickly if you would like to do so.

At the very bottom of /smf/Themes/default/index.template.php, find this line:

<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';


Directly under that line REPLACE EVERYTHING WITH THE FOLLOWING CODE:


}

function template_flash_chat()
{
$chatrequest = db_query("
            SELECT COUNT(*) AS numb
            FROM  YOURDATABASENAME_fc_connections
            WHERE userid IS NOT NULL", __FILE__, __LINE__);
        list ($chatcount) = mysql_fetch_row($chatrequest);   
        mysql_free_result($chatrequest);
if ( @$_GET['action'] != "chat" ) {
if ( $chatcount == "1" ) {
$singularplural1 = " is ";
$singularplural2 = "";
} else {
$singularplural1 = " are ";
$singularplural2 = "s";
}
return 'Currently there ' . $singularplural1 . ' <font color="red">' . $chatcount . ' User'.$singularplural2.' in FlashChat!<br/>';
}
}


?>

MAKE SURE YOU CHANGE "YOURDATABASENAME_FC_CONNECTIONS" TO THE PROPER PATH!
Yes, you also placed the above code in boardindex.template.php. That is correct.
The last line in that code is what the output is.
It also displays using a color for the font - red for the displayed number and the word User(s).

OK here is a new trick.
It changes the "Unknown Action" in the users online list (action=who)

Find this code in Sources/Who.php
// Unlisted or unknown action.

ABOVE that line add this block of code.
//show who is in the chat
elseif (isset($actions['action'])&&($actions['action']=='chat'))
{
    $data[$k] = 'Currently in the <a href="' . $scripturl . '?action=chat">Chat Room</a>';
}

That will show who is in the chat and link the words 'Chat Room' to the chat.

Make sure you have $scripturl set in the global line of Who.php's determineActions function.

Find:
function determineActions($urls)
{
global $txt, $db_prefix, $user_info, $ID_MEMBER;


And replace with:
function determineActions($urls)
{
global $txt, $db_prefix, $user_info, $scripturl, $ID_MEMBER;


That's it!

Feel free to show me how to do any of this better.

Cowboy

Edit: Dec 2006: This works fine with 1.1.1 final.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Grandnegis on January 20, 2006, 03:07:56 PM
Thanks alot man. I followed your instructions right and it looks awesome.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 20, 2006, 04:02:28 PM
Glad I could help!
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: cferd on January 20, 2006, 08:03:55 PM
Nice work.

I have SMF 1.1 RC2 Bridged to Joomla 1.07.

The chat looks better than I hoped for, but only in unwrapped mode. Would I need to modify much to get it to work with SMF wrapped? I'm currently getting a "The page cannot be found" error.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 20, 2006, 09:54:54 PM
Good question.
I use the forum and chat stand-alone.
Post your question in the Portals, Bridges, and Integrations section.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: cferd on January 21, 2006, 02:01:59 AM
Nevermind.  I just had to provide the full URL in Chat.template.php and it works great with SMF wrapped in Joomla, thanks  :D
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Zombie on January 21, 2006, 05:06:17 AM
How would I change the font color in the iframe?
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Prasad007 on January 21, 2006, 06:57:16 AM
Wow ! Thanks man!! :)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 21, 2006, 10:55:47 PM
Just add font html to it:
<td class="titlebg" colspan="2"><font color="#000000">FlashChat Users</font></td>

I didn't even notice that it wasn't the right color to match the other stuff in the info center.
Thanks for pointing that out.

ALSO -
The original iframe uses "catbg" which is the dark blue.
I changed the tutorial to use "titlebg" which blends into the info center better, and changed the font to black.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: RBH on January 22, 2006, 01:07:07 AM
after this install, i have a category bar above the chat with the word chat in it. what would i do to change this from chat to something else. even though it looks like a category bar, it isnt listed in the boards section of the admin panel.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Zombie on January 22, 2006, 02:17:15 AM
I'm talking changing the info from black to white in this bit of code.
<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>


I've tried html, changing the css but I can't get it to change.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 22, 2006, 03:30:31 PM
It's pulling the room names and users from FlashChat.
Maybe in /chat/info.embedded.php?
I am at work today but I'll look into it tomorrow or Tuesday.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 22, 2006, 03:35:50 PM
RBH, I am not exactly clear where you are talking about.
Can you specify which piece of code added that section or at the very least post a screenshot?

Thanks
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: HoTmetal on January 22, 2006, 03:40:44 PM
Quote from: cferd on January 20, 2006, 08:03:55 PM
Nice work.

I have SMF 1.1 RC2 Bridged to Joomla 1.07.

The chat looks better than I hoped for, but only in unwrapped mode. Would I need to modify much to get it to work with SMF wrapped? I'm currently getting a "The page cannot be found" error.


Why not just install it as a com in joomla?? This would solve your problem..
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: RBH on January 22, 2006, 04:17:07 PM
here is a shot of the bar directly above the flashchat. it uses my theme color and looks like a category bar running across the top of it with the name chat in it. just trying to figure out where it pulls this from so that i can change the name from chat to something else.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg.photobucket.com%2Falbums%2Fv13%2Fratherbehunting%2Ftest%2520album%2Fcatbaraboveflashchat.jpg&hash=ec2a738bfedd44a763d4732f5238b25c5450c304)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: cferd on January 22, 2006, 04:36:09 PM
Quote from: rickc on January 22, 2006, 03:40:44 PM
Why not just install it as a com in joomla?? This would solve your problem..

If I did, and I have done that on prior ocassions, it would leave me with another annoyance. I would have to depend on the Joomla cookie method, and frankly, SMF handles it better.

But aside from that, will it actually work? I mean, will FlashChat appear in an SMF theme inside of Joomla with the tip provided by Cowboy in this thread?

Oh, and p.s. Read my next post after the one you quoted  ;)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: cferd on January 22, 2006, 04:46:04 PM
RBH,

The "Chat" is not being pulled from anywhere. It's hardcoded into Chat.template.php.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: RBH on January 22, 2006, 08:41:53 PM
cferd, sweet thanks! i found it and changed the text to what i want.  :D
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 22, 2006, 10:49:41 PM
RBH, please add to the post and show what you did.

Thanks
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: RBH on January 22, 2006, 11:30:03 PM
it was pretty easy. open chat.template.php, mine was located in my themes/default, then look for

<td>Chat</td>

it's easy to find because there isn't but a few lines of code, then change "Chat" to whatever ya want.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 23, 2006, 12:41:13 AM
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.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 23, 2006, 01:42:30 AM
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.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Zombie on January 23, 2006, 03:16:16 AM
<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.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: RBH on January 23, 2006, 03:48:41 PM
how would a person get this to open in an appropiate sized popup rather then loading in a whole window?
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 23, 2006, 10:51:44 PM
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>
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: RBH on January 24, 2006, 12:12:21 AM
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> 
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: inthe80s on January 24, 2006, 11:57:32 AM
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.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 24, 2006, 02:50:57 PM
inthe 80s,
There are several threads about this on the FlashChat forum, in the Integrations section.

Love the Moxie, btw!
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: RBH on January 24, 2006, 06:13:49 PM
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.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 24, 2006, 07:09:44 PM
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!
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: RBH on January 24, 2006, 07:35:09 PM
thats cool.....thanks for the code. it'll give me something to toy with. :D
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 25, 2006, 11:26:28 PM
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.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: nosferatu on January 29, 2006, 05:30:13 AM
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
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 29, 2006, 12:50:32 PM
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.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: nosferatu on January 29, 2006, 04:09:10 PM
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
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on January 29, 2006, 04:30:46 PM
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
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: nosferatu on January 29, 2006, 06:46:51 PM
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
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.traffic-answers.com%2Fnosferatu.jpg&hash=8a0784d9fc66eeeaf0aa3633d855b00f3471dd95)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: jiminoregon on February 01, 2006, 04:04:01 PM
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:
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Glander on February 13, 2006, 05:28:09 AM
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
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: nosferatu on February 14, 2006, 12:53:48 PM
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.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on February 14, 2006, 01:09:49 PM
nosferatu,
Try this fix posted on the FlashChat forums:
http://www.tufat.com/forum/showthread.php?t=12059
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: eriktm on February 14, 2006, 01:14:10 PM
Does it works with the default themes in color variations? ::) ::)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on February 14, 2006, 01:15:40 PM
Bert,
If you installed FlashChat from the beginning in CMS mode, then it will use the SMF database. If you installed it as a stand-alone chat, then it will not (if you did this, uninstall it and re-install it - no harm done).

You have a MySQL database for your SMF forum. If you have installed FlashChat as to use that database, then there will be a bunch of new tables in your database that are used by FlashChat.

I think, from what you showed, your database path would be:

uswxorg_flacha_fc_connections
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on February 14, 2006, 01:17:51 PM
Erik™,
As long as you are using the SMF 1.1RC2 default theme, it will work. All that is changed in the color variations, is, well, the color... :D

It will work in any other theme as well, you just have to do more working figuring out where the code goes.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Glander on February 15, 2006, 03:06:49 AM
Quote from: Simplemachines Cowboy on February 14, 2006, 01:15:40 PM
Bert,
If you installed FlashChat from the beginning in CMS mode, then it will use the SMF database. If you installed it as a stand-alone chat, then it will not (if you did this, uninstall it and re-install it - no harm done).

You have a MySQL database for your SMF forum. If you have installed FlashChat as to use that database, then there will be a bunch of new tables in your database that are used by FlashChat.

I think, from what you showed, your database path would be:

uswxorg_flacha_fc_connections

Hi  Cowboy,

Thanks for the reply, but still 2 questions.
I can't find in thee list the RC2 CMS when I want to install.
What can I use for that?

And i guess I have to install FC in the mode user will normaly used name and pass?
or do I have to put it in free connection?

Thanks again.

Bert
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on February 15, 2006, 10:54:54 PM
http://www.tufat.com/docs/flashchat/integration.html
There is a choice for SMF 1.1 in the list.

I don't quite follow the 2nd question. If you install it as per the above link, that if someone is logged into your smf forum, and opens the chat, they will automatically be logged in to the chat with their smf user name.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: patsbrady on February 22, 2006, 08:50:47 AM
Quote// Show the [chat] button.
   if ($context['user']['is_logged'])
      echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=chat" target="_blank">' , $txt['chat_1'] , '</a> 
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

No matter what I do, it wont show the "Chat" next to eg Home or where I place it. It is simply just left out.

Here is what my code looks like

Quote// Show the start of the tab section.
   echo '
         <table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
            <tr>
               <td class="maintab_' , $first , '">&nbsp;</td>';

   // Show the [home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '">' , $txt[103] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
            

   // Show the [help] button.
   echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
            </td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [chat] button.
   if ($context['user']['is_logged'])
      echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=chat" target="_blank">' , $txt['chat_1'] , '</a> 
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

   // How about the [search] button?
   if ($context['allow_search'])
      echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
            </td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on February 22, 2006, 04:46:30 PM
Did you do this?
(from the first post in this thread)

B. Somewhere in smf/Themes/default/languages, add this code:
Code:

   $txt['chat_1'] = 'Chat';


C. Add Chat to the list of current actions:
In smf/Themes/default/index.template.php, find:
Code:

   if ($context['current_action'] == 'search2')
      $current_action = 'search';


Add this code AFTER the above:
Code:

   if ($context['current_action'] == 'chat')
      $current_action = 'chat';
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: patsbrady on February 23, 2006, 05:46:07 AM
Did you do this?
(from the first post in this thread)

QuoteB. Somewhere in smf/Themes/default/languages, add this code:
Code:

   $txt['chat_1'] = 'Chat';

Yes placed in index.english.php

QuoteC. Add Chat to the list of current actions:
In smf/Themes/default/index.template.php, find:
Code:

   if ($context['current_action'] == 'search2')
      $current_action = 'search';


Add this code AFTER the above:
Code:

   if ($context['current_action'] == 'chat')
      $current_action = 'chat';

Also done.

http://www.noertov.com/forum

Extra edit...

Ok, I managed to figure it out on another testsite, but the script

http://www.mysite.com/smf/index.php?action=chat brings me back to the indexpage of the forum instead of to the flashchat. Nothing happens. I have tried to figure out where it calls the script and in Chat.template.php the URL is correct as i points to flashchat.php.

Here is what it looks like

Quote<?php
// Version: 1.1 RC2; Chat

function template_main()
{
   global $context, $settings, $options, $txt, $scripturl;

   echo '
   <script language="JavaScript" type="text/javascript"><!--
      function checkAll(onOff)
      {
         for (var i = 0; i < document.searchform.elements.length; i++)
         {
            if (document.searchform.elements.name.substr(0, 3) == "brd")
               document.searchform.elements.checked = onOff;
         }
      }
   // --></script>
   <form action="', $scripturl, '?action=search2" method="post" name="searchform" id="searchform">
      <table width="80%" border="0" cellspacing="0" cellpadding="3" align="center">
         <tr>
            <td>', theme_linktree(), '</td>
         </tr>
      </table>

      <table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
         <tr class="titlebg">
            <td>Chat</td>
         </tr><tr>
            <td class="windowbg">';

               // load the chat
               echo '<iframe width="100%" height="500" src="http://www.mysite.com/smf/chat/flashchat.php"></iframe>';

   echo '
            </td>
         </tr>
      </table>
   </form>';
}

?>

Otherwise great guide
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: krustyop on February 27, 2006, 03:17:25 PM
Hi guys,
Anyone has an idea how we could hardcode info.embeded.php so that the output generated in the who's chatting block would automaticly use the color set of the theme we are using (windowbg, titlebg...)
(the X users in X rooms and the rooms names)

tks..

Dom
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: yardbird on March 03, 2006, 11:27:01 AM
OK this might sound like a small thing but it's bugging me and I'm at work trying to do all this between meetings...

I have removed the "target=_blank" so that flashchat opens in the current window. It WORKS fine, but there are scroll bars at bottom and right side of the chat "window" and you have to scroll down just a little to see the whole text entry area and when you do that you lose a little bit of the top... mostly title info, not the chat screen itself...

so is there a way to get that window to not have scroll bars?

ack... I might be answering my own question here... it doesn't happen in IE (which I DON'T use... only in Firefox and I THINK it's being caused by the extra stuff that AdBlock is adding to the content of the window.

sheeesh....

*************
update
*************

yup... this was caused by Adblock Plus extension. Disabling AdblockPlus for my site fixed it.

****** resolved *******
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: bar on March 05, 2006, 07:24:19 PM
Thanks but there seems to be a problem:

The link which reads http://www.mysite.com/smf/index.php?action=chat brings me back to the index page of the forum instead of to the flashchat.

Thanks.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on March 05, 2006, 10:24:06 PM
Then the action=chat hasn't been defined properly in your set up.
If the software can't parse action=chat, it defaults to the index.php page.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: patsbrady on March 07, 2006, 02:25:50 PM
QuoteThe link which reads http://www.mysite.com/smf/index.php?action=chat brings me back to the index page of the forum instead of to the flashchat.

Exactly the same problem as I described above - and I've followed the guide step by step several times. Look above.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: dguywill on March 08, 2006, 05:24:58 PM
Greetings,
I your documentation I am not sure I really understand what you mean by this:

QuoteMAKE SURE YOU CHANGE "YOURDATABASENAME_FC_CONNECTIONS" TO THE PROPER PATH!
Yes, you will place the above code in index.template.php also.

I have inserted that piece of code in question into BoardIndex.template.php, but it seems to be saying that I should also insert it into index.template.php.  If so where do I insert it.

Thanks,
Dee.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: houston on March 09, 2006, 12:02:09 PM
Quote from: dguywill on March 08, 2006, 05:24:58 PM
Greetings,
I your documentation I am not sure I really understand what you mean by this:

QuoteMAKE SURE YOU CHANGE "YOURDATABASENAME_FC_CONNECTIONS" TO THE PROPER PATH!
Yes, you will place the above code in index.template.php also.

I have inserted that piece of code in question into BoardIndex.template.php, but it seems to be saying that I should also insert it into index.template.php.  If so where do I insert it.

Thanks,
Dee.

When you add this code make sure that you change it to the prefex name of your database table. By default it is set to be named as smf_fc_connections. When you installed the script did you change the default prefix name? If so you need to replace smf with the prefix name you used.

As far as the rest of your question, have a look at the directions again. You need to find this code



<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';



which is right near the bottom of the index.template.php file and then replace it with the code given in the directions.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: meyersmp on March 13, 2006, 11:20:53 AM
I'm having some problems with the classic template. When I attempt to change the index.template.php file and add the following code
// Show the [chat] button.
if ($context['user']['is_logged'])
echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=chat" target="_blank">' , $txt['chat_1'] , '</a> 
</td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


No chat button appears and all buttons after this code appear at the top of the screen. I don't know php so the problem is probably staring me right in the face but without me understanding how to read it. Could someone translate for me what I need to do to fix this? I don't even see any evidence in this  code for an image file to be used as the chat button.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on March 13, 2006, 04:43:22 PM
These instructions are for the Default Theme specifically.
A lot of this will work with the classic theme but the button set-up is different.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: krustyop on April 03, 2006, 01:36:57 PM
EDIT
any idea why the who's online page still reports unknown action?

Here are a couple isues i'm wondering about,
This is not related to the fact that I use a custom theme, nor that my forum is in french,
I have the same issues in all themes/languages:

I want the chat to open inside the Iframe, that is working fine, exept for the following:


1-Linktree does not show that we are in the chat see image:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.interscene.ca%2Fimages%2Flinktree.png&hash=287123c5a73cdf777aef8e4d9f10757f0c1db764)

As a matter of fact, I have the same issue with coppermine gallerie opened in a Iframe, Linktree does not show
Any ideas?



2-The action in the who's online page of the forum reports Unknown Action as shown here
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.interscene.ca%2Fimages%2Fwho.png&hash=2f8ceae4a2ce9b470a06c8c7c5d225b1c511ecc1)

Coppermine works fine, since some code was added in coppermine file, but where should I add this code, or what should I modify for the action=chat to be reported in the Who's online section ???



Hope anyone can guide me on this one!

Dom
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on April 04, 2006, 06:27:33 PM
In all the versions of SMF that I had used it showed Unknown Action. I never bothered to find out why, 'cause I knew that it meant the user was in chat.

And the linktree I never even noticed it until you pointed it out.

I suspect they are tied together; SMF & FC aren't communicating on some level.
I'll do some playing around.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: lesmond on April 08, 2006, 09:35:31 AM
Hi, got this working fine Thanks, But (there has to be one  :o) I have it working in my helios theme but it only shows up with the text black, how do I make it white?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fhomepage.ntlworld.com%2Fles.pole99%2Fchat.jpg&hash=9b1c8ce5e663d08c46c78a9da2d26ddb06544c6c)
as you can see from this img

Thanks Les
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Xerxes on April 08, 2006, 01:35:55 PM
At least you got your working. I've been trying for a week now and I'm getting all kinds of errors  :'(
I'm still determined to fiigure it out though. My first problem was the database connection. Flashchat installed into my database as smf_fc_connections. So the database path YOURDATABASE_fc_connections did not work. I got that figured out after a couple of times. Then I get everything installed and I get an error on the index.template.php page on line 656. something about a T string. Blah blah blah. I'm new to php so it takes a while for mew to figure stuff out. If I get real stuck I'll post some code here.

Back to the grind.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on April 08, 2006, 10:26:57 PM
lesmond,
In /smf/Themes/default/boardindex.template.php, change this color:
<td class="titlebg" colspan="2"><font color="#000000">FlashChat Users</font></td>
From font color #000000 to #FFFFFF

You can also change FlashChat Users to Your board name chat users or whatever here.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: lesmond on April 09, 2006, 04:18:31 PM
Thanks Cowboy, That changed the title, but I would like the text below in white, I have circled the bit I mean

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fhomepage.ntlworld.com%2Fles.pole99%2Fchat2.jpg&hash=f47056b7fc80052a5457f4cf0d7f1819e81c6e02)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on April 09, 2006, 11:07:46 PM
lesmond,
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.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: crazee1 on April 10, 2006, 01:17:46 AM
I have performed the steps and I have a chat link at the top like I should, but when I click on it I get the following error:

Fatal error: smf_main(): Failed opening required '/home/teamente/public_html/smf/Sources/Chat.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/teamente/public_html/smf/index.php on line 348


I have created the chat.php and placed it in the sources directory as the instructions state.  Any ideas?
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: lesmond on April 10, 2006, 09:59:05 AM
Quote from: Simplemachines Cowboy on April 09, 2006, 11:07:46 PM
lesmond,
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.

Thank you that done the job  :)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: SekondeR on April 10, 2006, 02:53:26 PM
i have only one room in my chat place.
so i want to make users in chat list  as horizontal not vertical..

like this -> user1, user2 , user3

not like this :D
user1,
user2,
user3

could someone help me?
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Xerxes on April 10, 2006, 06:34:34 PM
Alright, it took a week plus but I got it working. If a n00b like me can do it anyone can. The instructions were fine and worked perfectly. I had a problem with a cut and paste that kept commenting an echo. DUH! Looks and work great now. Thanks for the directions/tutorial.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Xerxes on April 11, 2006, 07:35:23 PM
Now that I managed to get this to work, I have 2 questions.

1) Why am I getting this error in some places
Notice: Use of undefined constant chat1 - assumed 'chat1' in mydomainpath/forum/Sources/Load.php(1609) : eval()'d code on line 80

I changed chat_1 to chat1 in all the code because I see no reason for the underscore. Also, mydomainpath is the correct path.

2) At the bottom of the forum where it shows who is in the chat it has the room name and then you can see who is in the room. If I have more than 6 people in the room, the table does not expand downward to allow me to see all the users.

Thanks for any Input.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: dkaye315 on April 11, 2006, 09:59:57 PM
 ??? After following the instructions to the "T", I'm getting this error:

Parse error: parse error, expecting `','' or `';'' in .../Themes/escapes/index.template.php on line 761

752:
753: function template_flash_chat()
754: {
755: $chatrequest = db_query("
756:             SELECT COUNT(*) AS numb
757:             FROM  smf_fc_connections
758:             WHERE userid IS NOT NULL", __FILE__, __LINE__);
759:         list ($chatcount) = mysql_fetch_row($chatrequest);   
760:         mysql_free_result($chatrequest);
761: if ( @$_GET['action'] != "chat" )
762: {
763: if ( $chatcount == "1" )
764: {
765: $singularplural1 = " is ";


The template being used is identical to the default, just a color variation of it.  It appears all other modifications are okay.  Not being a PHP-pro, I'm not sure where I've erred, and am in need of some help.

Many thanks!
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Shawn Sorrell on April 18, 2006, 01:42:32 PM
dkaye315,
Not sure but I think you are missing a bracket when you did the edits.  Look close again at the replace given in instructions. I think maybe you need } on line 752 but not sure could be later down the bracket is missing. This is just from looking at the instructions.  I have not actually installed this yet.  Just reading to see what it takes. :)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on April 18, 2006, 02:08:05 PM

647 if ( @$_GET['action'] != "chat" ) {
648 if ( $chatcount == "1" ) {


Look where the brackets are in the example shown above, compared to your lines 761-764.
I suggest you go back and recopy the whole block from the example and paste it in.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: sopas24 on April 24, 2006, 02:54:05 PM
I have done all this but wen somebody try to login, apear te mensage, you`ve been banned.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: philuk on April 24, 2006, 03:28:50 PM
Will this work for smf 1.0.7? all this RC stuff version confuses me.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on April 24, 2006, 04:52:30 PM
phil,
This is for 1.1 rc2 and above. Much has changed in the jump from 1.0 to 1.1.
There is another post which has usable instructions for the 1.0 series, altho it's a bit out of date for even 1.0.7.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on April 24, 2006, 04:55:23 PM
sopas,
If you mean when you try to log into FlashChat, you get banned, you need to search on the flashchat forum for that fix.
It has something to do with the usergroups in smf. I think there was a post a couple pages up from this that talks about it also.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: sopas24 on April 24, 2006, 05:06:46 PM
Cowboy, sorry my english í am portugues, could you put here tehe link for that post, ta.nk´s
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: sopas24 on April 24, 2006, 05:14:23 PM
Another thing i can put the buton chat in apollo, justa apear the place like a "x".
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: digit on May 01, 2006, 05:05:34 AM
Quote from: Simplemachines Cowboy on April 24, 2006, 04:55:23 PM
sopas,
If you mean when you try to log into FlashChat, you get banned, you need to search on the flashchat forum for that fix.
It has something to do with the usergroups in smf. I think there was a post a couple pages up from this that talks about it also.

YES.  This is a problem.

I just upgraded to the latest version 4.5.7.

Quite a few members are reporting being banned.

It DOES have to do with groups in SMF.

I believe you can just increase the number of groups in sfmCMS2.php

here....



function getRoles($status, $additionalGroups) {

  if($status == 1 || in_array(1, $additionalGroups)) return ROLE_ADMIN;

  if($status == 2 || in_array(2, $additionalGroups)) return ROLE_MODERATOR;
  if($status == 3 || in_array(3, $additionalGroups)) return ROLE_MODERATOR;

  if($status == 0 || ($status > 3 && $status < 9 )) return ROLE_USER;
  if(in_array(0, $additionalGroups)) return ROLE_USER;

  return null;
  }



you are probably getting this error because you have more than 9 Groups???

That's my best guess anyway!!!!!!!!!!!!

I hope that's right!

(can someone please confirm???)

Thanks!

Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: jiminoregon on May 01, 2006, 10:17:43 AM
Quote from: digit on May 01, 2006, 05:05:34 AM
Quote from: Simplemachines Cowboy on April 24, 2006, 04:55:23 PM
sopas,
If you mean when you try to log into FlashChat, you get banned, you need to search on the flashchat forum for that fix.
It has something to do with the usergroups in smf. I think there was a post a couple pages up from this that talks about it also.

YES.  This is a problem.

I just upgraded to the latest version 4.5.7.

Quite a few members are reporting being banned.

It DOES have to do with groups in SMF.

I believe you can just increase the number of groups in sfmCMS2.php

here....



function getRoles($status, $additionalGroups) {

  if($status == 1 || in_array(1, $additionalGroups)) return ROLE_ADMIN;

  if($status == 2 || in_array(2, $additionalGroups)) return ROLE_MODERATOR;
  if($status == 3 || in_array(3, $additionalGroups)) return ROLE_MODERATOR;

  if($status == 0 || ($status > 3 && $status < 9 )) return ROLE_USER;
  if(in_array(0, $additionalGroups)) return ROLE_USER;

  return null;
  }



you are probably getting this error because you have more than 9 Groups???

That's my best guess anyway!!!!!!!!!!!!

I hope that's right!

(can someone please confirm???)

Thanks!




I changed 9 to 20 and that fixed it for me.

Jim
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: digit on May 01, 2006, 10:51:04 AM
surprising...  it's not working for me!!!  :(
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: jiminoregon on May 01, 2006, 10:56:54 AM
Quote from: digit on May 01, 2006, 10:51:04 AM
surprising...  it's not working for me!!!  :(

When installing did you use the SMF 1.1 CMS choice?  Are you using SMF 1.1rc1 or newer?

Jim
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: digit on May 01, 2006, 11:04:03 AM
Not quite sure what you mean by that.

I am running SMF 1.1 RC2
Flashchat 4.5.7
In my FlashChat config.php I have...

'CMSsystem' => 'smfCMS2',

what's odd is it doesn't seem to make any difference if I comment that out or not - it seems the smf user data is STILL being accessed!

I did notice that the people who were complaining about being banned belonged to groups 9 and 29...  I removed them from group 29 and all seems wel..

Definately a little confused here.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: jiminoregon on May 02, 2006, 10:58:55 PM
Quote from: crazee1 on April 10, 2006, 01:17:46 AM
I have performed the steps and I have a chat link at the top like I should, but when I click on it I get the following error:

Fatal error: smf_main(): Failed opening required '/home/teamente/public_html/smf/Sources/Chat.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/teamente/public_html/smf/index.php on line 348


I have created the chat.php and placed it in the sources directory as the instructions state.  Any ideas?

That's your problem...you created chat.php and chat.template.php...they need to be Chat.php and Chat.template.php.

Jim
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: jiminoregon on May 02, 2006, 11:02:58 PM
Quote from: digit on May 01, 2006, 11:04:03 AM
Not quite sure what you mean by that.

I am running SMF 1.1 RC2
Flashchat 4.5.7
In my FlashChat config.php I have...

'CMSsystem' => 'smfCMS2',

what's odd is it doesn't seem to make any difference if I comment that out or not - it seems the smf user data is STILL being accessed!

I did notice that the people who were complaining about being banned belonged to groups 9 and 29...  I removed them from group 29 and all seems wel..

Definately a little confused here.

Instead of changing the groups...you could have also changed the 9 to 99.

Jim
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: bar on May 03, 2006, 11:39:24 AM
Hi,

The flashchat integration worked for a few days then suddenly the following message appeared:

QuoteFatal error: Call to a member function on a non-object in D:\webs\mywebsiteaddress.com\html\forum\chat\info_embedded.php on line 34


Could someone please help. Thanks.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on May 03, 2006, 11:33:40 PM
What is line 34 in your info.embedded.php?

Post a block of code above and below that line please.

And when does this error appear?
When you open your forum?
When you click on the chat button in your forum?
Or what?
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: jiminoregon on May 04, 2006, 12:10:22 AM
Quote from: sopas24 on April 24, 2006, 05:14:23 PM
Another thing i can put the buton chat in apollo, justa apear the place like a "x".

When you press the X does it take you to the chat?  If so you just have a simple path problem.  Check the properties of the link and make sure they match where the file pic is at.

Jim
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: bar on May 04, 2006, 06:09:18 AM
Quote from: Simplemachines Cowboy on May 03, 2006, 11:33:40 PM
What is line 34 in your info.embedded.php?

Post a block of code above and below that line please.

And when does this error appear?
When you open your forum?
When you click on the chat button in your forum?
Or what?

Line 34:    $rec = $rs->next();

How do i post a block of code above and below that line?

It appears on my forum where the FlashChat Users information appears (below the Users Online section).

The chat works well when they click on the Chat Button, it appears in a new window.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: bar on May 04, 2006, 06:19:26 AM
Now it says:

QuoteFatal error: Call to a member function on a non-object in D:\webs\mywebsiteaddress.com\html\forum\chat\bot\bot_class.php on line 347

QuoteLine 347:         while(($rec = $res->next()) != null)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: jiminoregon on May 04, 2006, 11:16:17 AM
Quote from: bar on May 04, 2006, 06:09:18 AM
Quote from: Simplemachines Cowboy on May 03, 2006, 11:33:40 PM
What is line 34 in your info.embedded.php?

Post a block of code above and below that line please.

And when does this error appear?
When you open your forum?
When you click on the chat button in your forum?
Or what?

Line 34:    $rec = $rs->next();

How do i post a block of code above and below that line?

It appears on my forum where the FlashChat Users information appears (below the Users Online section).

The chat works well when they click on the Chat Button, it appears in a new window.

Just copy and paste it like this:

/**
Retrieves the number of users who are chatting in any room.
Leave the $room parameter empty to return the number of users in all room.
*/
function numusers( $room = "" )
{
   if($room) {
      $stmt = new Statement("SELECT COUNT(*) AS numb FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND roomid=?");
      $rs = $stmt->process($room);
   } else {
      $stmt = new Statement("SELECT COUNT(*) AS numb FROM {$GLOBALS['fc_config']['db']['pref']}connections,{$GLOBALS['fc_config']['db']['pref']}rooms
                       WHERE userid IS NOT NULL AND ispublic IS NOT NULL
                       AND {$GLOBALS['fc_config']['db']['pref']}connections.roomid = {$GLOBALS['fc_config']['db']['pref']}rooms.id");
      $rs = $stmt->process();
   }
   
   $rec = $rs->next();

   return $rec?$rec['numb']:0;
}

/**
Retrieves a list of the users (by login ID) who are in $room.
Leave the $room parameter empty to return a list of all users in all rooms.
*/
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: bar on May 04, 2006, 01:35:02 PM
It didnt seem to work. Still getting that error

QuoteFatal error: Call to a member function on a non-object in D:\webs\mywebsiteaddress.com\html\forum\chat\info_embedded.php on line 34
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: crazee1 on May 05, 2006, 09:32:26 AM
THANKS Jim!  That fixed it :)

Chat works now :)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on May 05, 2006, 11:55:10 PM
Bar,
Well, the smf portion is working, in that it's trying to get info from the chat file regarding users.
And your file looks right, line 34 is exactly like mine.
I would post your question for Veronica in the FlashChat forums.

Make sure you include the other error you had, the problem may have something to do with your bot settings.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on May 20, 2006, 04:35:21 PM
Quote from: krustyop on April 03, 2006, 01:36:57 PM
EDIT
any idea why the who's online page still reports unknown action?

Here are a couple isues i'm wondering about,
This is not related to the fact that I use a custom theme, nor that my forum is in french,
I have the same issues in all themes/languages:

I want the chat to open inside the Iframe, that is working fine, exept for the following:


1-Linktree does not show that we are in the chat see image:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.interscene.ca%2Fimages%2Flinktree.png&hash=287123c5a73cdf777aef8e4d9f10757f0c1db764)

As a matter of fact, I have the same issue with coppermine gallerie opened in a Iframe, Linktree does not show
Any ideas?



2-The action in the who's online page of the forum reports Unknown Action as shown here
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.interscene.ca%2Fimages%2Fwho.png&hash=2f8ceae4a2ce9b470a06c8c7c5d225b1c511ecc1)

Coppermine works fine, since some code was added in coppermine file, but where should I add this code, or what should I modify for the action=chat to be reported in the Who's online section ???



Hope anyone can guide me on this one!

Dom

Find this code in Sources/Who.php

// Unlisted or unknown action.

ABOVE that line add this block of code.

//show whos in the chat
elseif (isset($actions['action'])&&($actions['action']=='chat'))
{
    $data[$k] = 'Currently in the <a href="' . $scripturl . '?action=chat">Chat Room</a>';
}


That will show who is in the chat and link the words 'Chat Room' to the chat.

I hope this helps.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on May 20, 2006, 10:45:38 PM
^DooM^, you DA MAN!

Thanks. I will add this to the tutorial with credit to you.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on May 21, 2006, 06:25:35 PM
Hey no problem :) You did the hard part.

I have integrated this chat with 8 themes now and its all working great.

Thanks for your hard work.

By the way here is another little tip for any of you guys that have integrated the chat and find that some of your users are banned. (I had this problem..)

Find this line of code in your flashchat installation folder inc/cmses/smfCMS2.php

if($status == 0 || ($status > 3 && $status < 9 )) return ROLE_USER;
Change to
if($status == 0 || ($status > 3 && $status < 99 )) return ROLE_USER;

The reason for this is the chat works out who is admin/moderator etc by the groupid number that is stored in the smf_members table. Any ID above 3 is classed as a normal user and has no admin rights. Now for some reason whoever coded this thought 9 ID groups would be enough (It's not. I have 12 so far). Any ID above 9 is banned. If it still says they are banned get them to clear there cache.

I hope this helps someone else out there as it took me about an hour to track that down ;)

Cheers!
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on May 21, 2006, 11:10:20 PM
OK ^DooM^, riddle me this:
I am getting this error when I access action=who:

Quote8: Undefined variable: scripturl
File: /home/mydomain/public_html/forum/Sources/Who.php
Line: 324

Which is this line in Who.php:

$data[$k] = 'Currently in the <a href="' . $scripturl . '?action=chat">Chat Room</a>';

Any ideas?
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on May 22, 2006, 03:17:37 AM
Make sure you have it set in the global line of Who.php's determineActions function.

function determineActions($urls)
{
global $txt, $db_prefix, $user_info, $scripturl, $ID_MEMBER;


$scripturl is there so you do not have to hardcode your website address and is used everywhere in 1.1rc2
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on May 22, 2006, 04:22:48 PM
Ahh, I saw $scripturl in the function Who() area, and didn't see the actions one.

Added it and it works great now.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on May 22, 2006, 04:39:17 PM
Sweet. ;)

You may want to add that to your 'howto' as well. I must of added that $scripturl to the global when I integrated the arcade.

Glad its working now.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: djcrash on June 01, 2006, 04:55:51 AM
Hi cowboy,

I,m new at this what the meaning of, MAKE SURE YOU CHANGE "YOURDATABASENAME_FC_CONNECTIONS" TO THE PROPER PATH!

Is it mysql database name?

*for example : djcrash_1

or do i need to add the djcrash_FC_Connection

Sorry to trouble you, my english is limited. Thank you
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on June 01, 2006, 06:22:55 AM
dj.

When you installed SMF it adds whats called a prefix to the database table names so you can use a single database for more than one application.

If you installed SMF with default values and installed flashchat with the same prefix as SMF then 'YOURDATABASENAME_FC_CONNECTIONS' would most likely be 'smf_fc_connections'.

If you download and install phpMyAdmin you will be able to see exactly what your table names are.

HTH

-Jon.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on June 01, 2006, 11:35:28 PM
Yep,
fc_connections is the flashchat portion of the database name.
Your database has a name, and you would put it in front of fc_connections.

Like this: ***_fc_connections

Where *** is your database prefix name.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: djcrash on June 02, 2006, 03:46:55 PM
 :P Thank you guys got it.  :D
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: tosp2 on June 12, 2006, 09:38:13 PM
I recently re-installed Flashchat onto my forum and I followed the directions to get it up and running, although I had to make a few minor changes due to the fact that I use a custom theme, but now my error log is being littered with a bunch of errors and I dont know how to fix it.  Here is what I am getting:

8: Undefined index: chat
File: /home/usr/public_html/forum/Themes/igoh11rc2/BoardIndex.template.php (eval?)
Line: 614

8: Undefined index: chat
File: /home/usr/public_html/forum/Themes/igoh11rc2/Display.template.php (eval?)
Line: 614

8: Undefined index: chat
File: /home/usr/public_html/forum/Themes/default/Errors.template.php (eval?)
Line: 614

It looks like it isnt recognizing chat, but yet my chatroom works great!   Can anyone tell me how to fix these?  How do I "define" this index?  Im just not sure what code I need to add/remove/change, etc.  Thanks!
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on July 03, 2006, 08:18:15 AM
Please attach your boardindex.template to a post and I will look at it for you.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: CrayZ on July 07, 2006, 03:51:33 AM
Hello and thank you for this oportunity that you guys geaving us.

I have a simple question.

1 user in 1 room --- where I can find those words to translate them into another language.

Thank you.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: Simplemachines Cowboy on July 08, 2006, 12:19:18 AM
It's in the flashchat files.
Near the bottom of info.embedded.php.
I've colored it red below:

Quote<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>
<ul id="roomList">
<?php if($roomnumb) { ?>
      <?php foreach($rooms as $room) { ?>
            <li><strong><a href="#" onclick="javascript:toggleUserList('room_<?php echo $room['id']?>')"><?php echo $room['name']?> (<?php echo numusers($room['id']) ?>)</a></strong>
            <?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>

</body>
</html>
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: CrayZ on July 08, 2006, 12:58:48 AM
Thanks a lot Simplemachines Cowboy I could not have done that without your help.

Thanks again  :)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: unrelenting on July 20, 2006, 09:13:33 PM
I posted this in the 1.0 thread so I will repost it here since I use 1.1 RC2. It probably doesn't make any difference but just in case:

What do I need to change in the flashchat code to display users display name rather than their member name. Some people have since changed their display name and no one knows them as their original registered name.

I know you just change a variable in smf but how and where do I change it in flashchat to achieve this result?

Anyone?
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on July 21, 2006, 10:20:53 AM
in smfCMS2.php in your inc/cmses dir change this line

$this->getUserStmt   = new Statement("SELECT ID_MEMBER AS id, memberName AS login, ID_GROUP as status, gender, additionalGroups FROM {$GLOBALS['db_prefix']}members WHERE ID_MEMBER=? LIMIT 1");

to

$this->getUserStmt   = new Statement("SELECT ID_MEMBER AS id, realName AS login, realName AS realName, ID_GROUP as status, gender, additionalGroups FROM {$GLOBALS['db_prefix']}members WHERE ID_MEMBER=? LIMIT 1");

then comment out or remove this block of code in inc/classes/chatServer.php

if(isset($_SESSION['fc_users_cache'][$userid]))
{
    return $_SESSION['fc_users_cache'][$userid];
}


I am pretty sure this was all I changed on my chat system to do what you want. ( I have slept since then ;D )

Let me know how you get on.

Cheers!

Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: unrelenting on July 21, 2006, 07:41:07 PM
It worked like a dream, Doom. Thanks.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on July 21, 2006, 08:59:12 PM
My pleasure :)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: nosferatu on August 24, 2006, 12:35:53 PM
Hello all. I've installed the rc3 upgrade and very good it is. However, I had integrated FlashChat with rc2 and now that I've tried to reinstall the integration I just get a white screen (although the loading bar states that the page has loaded, the forum doesn't appear). The flashchat prog works fine in isolation but the instructions here don't seem to work. Is this upgrade compatible with FlashChat? The problem is with the index.template file as when that is edited as instructed, the white screen appears.

Many thanks

N
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on August 24, 2006, 01:51:15 PM
A white screen sounds to me like a parse error. Check your error logs and see what the error is and on what line of what file. That should help you locate the issue.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: G6™ on August 24, 2006, 01:58:10 PM
FlashChat works just as fine on my site after upgrade as before, no problems what so ever with the bridge or the integration from this thread.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: rigoli on August 27, 2006, 12:00:29 PM
Quote from: nosferatu on August 24, 2006, 12:35:53 PM
Hello all. I've installed the rc3 upgrade and very good it is. However, I had integrated FlashChat with rc2 and now that I've tried to reinstall the integration I just get a white screen (although the loading bar states that the page has loaded, the forum doesn't appear). The flashchat prog works fine in isolation but the instructions here don't seem to work. Is this upgrade compatible with FlashChat? The problem is with the index.template file as when that is edited as instructed, the white screen appears.

Many thanks

N

Hello,

I get similar error and I've already posted a thread, but I guess that nobody doesn't know what's wrong. Here's the post: http://www.simplemachines.org/community/index.php?topic=109124.0

Would be great it anyone could help us with this.

Regards
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: unrelenting on September 03, 2006, 06:59:08 PM
Quote from: rigoli on August 27, 2006, 12:00:29 PM
Quote from: nosferatu on August 24, 2006, 12:35:53 PM
Hello all. I've installed the rc3 upgrade and very good it is. However, I had integrated FlashChat with rc2 and now that I've tried to reinstall the integration I just get a white screen (although the loading bar states that the page has loaded, the forum doesn't appear). The flashchat prog works fine in isolation but the instructions here don't seem to work. Is this upgrade compatible with FlashChat? The problem is with the index.template file as when that is edited as instructed, the white screen appears.

Many thanks

N

Hello,

I get similar error and I've already posted a thread, but I guess that nobody doesn't know what's wrong. Here's the post: http://www.simplemachines.org/community/index.php?topic=109124.0

Would be great it anyone could help us with this.

Regards


It might be good to have this answer in here as it would be easy to find. Here is the reply by Thantos that corrected this problem that was created by an upgrade from 1.1 RC2 to 1.1RC3:

Quote from: Thantos on August 27, 2006, 02:22:34 PM
Ok try this:
Code (QueryString.php) Select

// Same goes for numeric keys.
foreach (array_merge(array_keys($_REQUEST), array_keys($_COOKIE), array_keys($_FILES)) as $key)
if (is_numeric($key))
die('Invalid request variable.');

Comment it out by putting /* before it and */ after it.  Like this:

/*
// Same goes for numeric keys.
foreach (array_merge(array_keys($_REQUEST), array_keys($_COOKIE), array_keys($_FILES)) as $key)
if (is_numeric($key))
die('Invalid request variable.');
*/


There is only one other spot where it'll say Invalid request variable and if it does it there you don't want to be using that mod IMO.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ivo2296 on September 24, 2006, 12:03:29 AM
Can we have a little help with the classic theme for RC3 please - like buttons and some tips about differences with the default theme.

Thank you!
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ivo2296 on September 24, 2006, 03:25:53 PM
I have managed to add chat button to the classic theme but when i try http://www.myhost.com/index.php?action=chat  comes the main page of the forum, not http://www.myhost.com/chat/flashchat.php .


I really need a little help!

Thank you!
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on September 24, 2006, 05:05:12 PM
You didn't follow the instructions properly.

Quote from: Cowboy
1. Open smf/index.php.

2. Find this line:
Code:

'boardrecount' => array('Admin.php', 'AdminBoardRecount'),


and AFTER that code add this code (about line 220):
Code:

'chat' => array('Chat.php', 'Chat'),

Remember this is for RC2 as well not RC3
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ivo2296 on September 24, 2006, 05:17:23 PM
Quote from: ^DooM^ on September 24, 2006, 05:05:12 PM
You didn't follow the instructions properly.

Quote from: Cowboy
1. Open smf/index.php.

2. Find this line:
Code:

'boardrecount' => array('Admin.php', 'AdminBoardRecount'),


and AFTER that code add this code (about line 220):
Code:

'chat' => array('Chat.php', 'Chat'),

Remember this is for RC2 as well not RC3


My ftp programm had not uploaded index.php - and that was the problem.

Thanks a lot - it works
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: CrayZ on October 02, 2006, 05:35:34 AM
Quote from: SekondeR on April 10, 2006, 02:53:26 PM
i have only one room in my chat place.
so i want to make users in chat list  as horizontal not vertical..

like this -> user1, user2 , user3

not like this :D
user1,
user2,
user3

could someone help me?

I was wondering about same thing. Since if in chat are more than, let us say 6 or 7 users then on the bbottom of your forum it will just show only 2 or 3 and the rest you have to select the users and to drag the selection with the mouse in order to see the rest, because is not a scrollbar on that place if there are to many users, so me to I want some help if possible so that window on the bottom of your forum to display the users horizontally instead of vertically

Thank you all once again
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on October 02, 2006, 06:51:18 AM
In your chat dir find info_embedded.php. Make a backup of it just in case :)

Now scroll about half way down till you see the start of the HTML.

Replace it with this.
<html>
<title>Who's in the chat?</title>
<meta http-equiv=Content-Type content="text/html;  charset=UTF-8">
<head>
<style type="text/css">
<!--

body { background-color: transparent; margin: 0; padding: 0; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; font-size: 10px;}
....normal {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
margin: 0; padding: 0;
        text-align: center;
}

#roomList { margin: 0; padding: 0; }
#roomList a { color: black; text-decoration: none; } #roomList a:hover { text-decoration: underline; }
....userList { margin-left: 7px; margin-right: 0; margin-bottom: 0; margin-top: 0;  padding: 0; }

-->
</style>
<script type="text/javascript">
function toggleUserList(id) {
   if (l = document.getElementById(id)) {
      if (l.style.display == '' || l.style.display == 'block') l.style.display = 'none';
      else l.style.display = 'block';
   }
   return false;
}

</script>
</head>
<body>

<ul id="roomList">
<?
if($roomnumb)
{
    if($usernumb <= "0")
    {
        ?><strong>There are currently no users online!</strong><?
    }
    else
    {
        foreach($rooms as $room)
        {
            $users = usersinroom($room['id']);
            if ($users)
            {
                foreach( $users as $user )
                {
                        echo( $user['login'] . ", ");
                }
            }
        }
    }
} ?>
</ul>
</body>
</html>


I hope this helps.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: CrayZ on October 03, 2006, 12:19:57 AM
Thanks for your help ^DooM^

I did exactly what you told me and the users according to your coding they appear the way  I wonted but there is a problem because is not saying any more how many users are on how many rooms and the room list was not there to. So basically was just the users separated by a coma. This is cool I really liked it but it will be way better if the room list is there and the small line that it said how many users are in how many rooms. Ex 2 users in 1 room

I hope you manage to fix it somehow because I think many users will benefit by this change.

Thanks again  :)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on October 03, 2006, 04:38:21 AM
Ahh yes sorry.

I only use the one room on my site and didn't want any room info on there just who was in the chat. I'll look at the source again for you and see about getting it the way you want it.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on October 03, 2006, 04:51:52 AM
Ok looking at the original source find this line (Around line 132)

echo "<li>".$user['login'] . "</li>";

change it to this.

echo "".$user['login'] . ", ";

I haven't tested this so let me know if it works or not.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: CrayZ on October 05, 2006, 02:30:41 AM
hmmm I think I ruined everything. I made an upgrade to my forum from 1.1 RC2 to 1.1 RC3 and now when I klick to my chat link it redirect me to the forum index. I think I have to wait for a fix for this because I don't know anything about coding. But the integrations it look fine though. When I acces my chat indirectly it recognize me as a forum user and I can log in. The only problem is that when I clik on the Chat button or to the proper link /index.php?action=chat it send me to the forum index

Sorry that I took your time but as soon as this problem be fixed somehow then I will let you know about the userlist.

Thanks again.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on October 05, 2006, 03:14:08 AM
Make sure this is in your index.php

Quote from: Cowboy
1. Open smf/index.php.

2. Find this line:
Code:

'boardrecount' => array('Admin.php', 'AdminBoardRecount'),


and AFTER that code add this code (about line 220):
Code:

'chat' => array('Chat.php', 'Chat'),
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: noahpiepenbrink on October 09, 2006, 12:23:30 AM
is it possible to install this feature on RC3? If so, is the instalation different than is described for RC2?
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: CrayZ on November 02, 2006, 11:49:41 PM
I'm using it on RC3 and is working fine. I just did same steps carefully :)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: unrelenting on November 05, 2006, 01:47:19 PM
Any of you coders know how I can add a if/then statement to this code. It is a table for my index.template.php that will show between the info section at the top and the linktree.

I have it looking the way I want it but I would like it to only show if there are 1 or more members in chat. The rest of the time it should disregard this code all together. How should that be coded?




<table cellspacing="0" cellpadding="10" border="0" align="center" width="95%" class="tborder">
<tr><td valign="top" style="background-color: #ffffff;">';

echo '

    <span class="normaltext">', template_flash_chat(), '</span>
<iframe frameborder="0" height="15" src="http://myboard/chat/info_embedded.php" style="width: 100%; margin: 0; padding: 0; border: 0; overflow: hidden;" scrolling="no" border="0" allowtransparency="true"></iframe>

    </td></tr>
</table>';
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on November 05, 2006, 03:45:13 PM
This should do what you want.

   
$chatrequest = db_query(" SELECT COUNT(*) AS numb FROM smf_fc_connections WHERE userid IS NOT NULL", __FILE__, __LINE__);
list ($chatcount) = mysql_fetch_row($chatrequest);
mysql_free_result($chatrequest);

if ( $chatcount >= "1" )
{
    echo'
        <table cellspacing="0" cellpadding="10" border="0" align="center" width="95%" class="tborder">
          <tr>
            <td valign="top" style="background-color: #ffffff;">';

    echo '
              <span class="normaltext">', template_flash_chat(), '</span>
              <iframe frameborder="0" height="15" src="http://myboard/chat/info_embedded.php" style="width: 100%; margin: 0; padding: 0; border: 0; overflow: hidden;" scrolling="no" border="0" allowtransparency="true"></iframe>
            </td>
          </tr>
        </table>';
}


Let me know if it works or not :)

Cheers!
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: unrelenting on November 05, 2006, 03:57:39 PM
Quote from: ^DooM^ on November 05, 2006, 03:45:13 PM
This should do what you want.

   
$chatrequest = db_query(" SELECT COUNT(*) AS numb FROM smf_fc_connections WHERE userid IS NOT NULL", __FILE__, __LINE__);
list ($chatcount) = mysql_fetch_row($chatrequest);
mysql_free_result($chatrequest);

if ( $chatcount >= "1" )
{
    echo'
        <table cellspacing="0" cellpadding="10" border="0" align="center" width="95%" class="tborder">
          <tr>
            <td valign="top" style="background-color: #ffffff;">';

    echo '
              <span class="normaltext">', template_flash_chat(), '</span>
              <iframe frameborder="0" height="15" src="http://myboard/chat/info_embedded.php" style="width: 100%; margin: 0; padding: 0; border: 0; overflow: hidden;" scrolling="no" border="0" allowtransparency="true"></iframe>
            </td>
          </tr>
        </table>';
}


Let me know if it works or not :)

Cheers!

;D

Man, you are good. You know your stuff.

Thanks a lot.
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: ^DooM^ on November 05, 2006, 04:14:06 PM
My Pleasure, Glad it worked ok for you :)
Title: Re: FlashChat Integration with 1.1 RC2 Default Theme
Post by: tradenet on November 19, 2006, 05:20:51 PM
Has anyone been able to do this without using iframes? ie. include("flashchat.php");
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: szinski on January 03, 2007, 03:04:58 PM
Nice instructions... and nice integration.  8)

Thanks!!  :)
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: Daniel15 on January 05, 2007, 04:28:47 AM
Hi everyone,
I've posted a mod that completely integrates FlashChat into SMF. You may download the mod at http://custom.simplemachines.org/mods/index.php?mod=611
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: 5cakids on May 14, 2007, 01:46:03 AM
ok I added the chat but it is wanting people to register? What did I do wrong? Shouldnt it reconize my members?
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: 5cakids on May 14, 2007, 02:00:41 AM
will this work with smf 1.1.2
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: ^DooM^ on October 09, 2007, 06:17:49 AM
Quote from: Daniel15 on January 05, 2007, 04:28:47 AM
Hi everyone,
I've posted a mod that completely integrates FlashChat into SMF. You may download the mod at http://custom.simplemachines.org/mods/index.php?mod=611

Great mod Daniel15,

I can confirm this mod works perfectly with 1.1.4 and FlashChat v483, One thing you may want to add though which I had to tweak is setting this line in smfCMS2.php (Seeing as you alter that file anyway)

from
if($status == 0 || ($status > 3 && $status < 9 )) return ROLE_USER;
to
if($status == 0 || ($status > 3 && $status < 99 )) return ROLE_USER;

If you have more than 9 member groups anyone in a member groupid above 9 is banned.

Thanks again for this sweet mod.
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: metallica48423 on November 13, 2007, 01:39:33 AM
Thanks for the tip, have you tried PM'ing him with that info?
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: nosferatu on December 31, 2007, 09:53:57 AM
Hello all. I've used this mod and it works really well. I've now tried to integrate FlashChat into another theme. I know there's often problems with doing that but I've managed, with a few tweaks, to get it to look right on the forum template but when I click the Chat button I get:

Unable to load the 'chat_forum' template

The action works fine with a number of other themes so I was wondering if this was something anyone had come across. I'm trying to use it with the ApolloBB theme in 1.1.4.
Thanks
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: Fiery on January 20, 2008, 09:49:41 PM
Quote from: nosferatu on December 31, 2007, 09:53:57 AM
Hello all. I've used this mod and it works really well. I've now tried to integrate FlashChat into another theme. I know there's often problems with doing that but I've managed, with a few tweaks, to get it to look right on the forum template but when I click the Chat button I get:

Unable to load the 'chat_forum' template

The action works fine with a number of other themes so I was wondering if this was something anyone had come across. I'm trying to use it with the ApolloBB theme in 1.1.4.
Thanks

Did you make the changes based on http://docs.simplemachines.org/index.php?topic=402 and http://sleepycode.com/PackageParser/index.php
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: neotan on February 05, 2008, 03:48:16 AM
Hi,

I can't get the right code for the following snippet:

( I am not a programmer but a configurator)

SMF : 1.1.4
Theme : Black Rain V2
FlashChat : 4.7.12
Flashchat mod 1.0a

a) The custom code in the mod states:

Find

// The [calendar]!
   if ($context['allow_calendar'])
      echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
            </td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


- This does not exist in for this theme instead, I have this:

// The [calendar]!
   if ($context['allow_calendar'])
      echo '<li', $current_action == 'calendar' ? ' id="active"' : '', '><a href="', $scripturl, '?action=calendar"><span>', $txt['calendar24'], '</span></a></li>';

Could some guru provide the theme-friendly Flashchat code equivalent for the following mod code:

   // FlashChat!
   global $modSettings;
   if ($context['user']['is_logged'])
      echo ($current_action == 'chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=chat"', (!empty($modSettings['fc_newWindow']) ? ' target="_blank"' : ''), '>', $txt['fc_chat'], (!empty($modSettings['fc_showUserCount']) && !empty($context['num_chat']) ? ' [<strong>' . $context['num_chat'] . ' ' . ($context['num_chat'] == 1 ? $txt['user'] : $txt['users']) . '</strong>]' : ''), '</a>
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


thanks
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: neotan on February 05, 2008, 03:52:45 AM
I bought the Desktop Skin and I would like to use this as the default PHP. So how can I force the users to use this interface instead?

http://www.jparts.info/forum/chat/flashchat.php (http://www.jparts.info/forum/chat/flashchat.php)

- I swapped amfichat.php  with flashchat.php, hoping the chat would invoke the new interface. Do I need to change any of files to force the change ?

Thanks
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: neotan on February 05, 2008, 04:30:01 AM
Another question:

Using Daniel15's mod, how can I refresh the status of the users on the front panel much faster ? Users have already logged out and it still shows their in-room status. I want to do this without refreshing the browser. Thanks !!
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: neotan on February 05, 2008, 06:03:18 AM
Quote from: neotan on February 05, 2008, 03:48:16 AM
Hi,

I can't get the right code for the following snippet:

( I am not a programmer but a configurator)

SMF : 1.1.4
Theme : Black Rain V2
FlashChat : 4.7.12
Flashchat mod 1.0a

a) The custom code in the mod states:

Find

// The [calendar]!
   if ($context['allow_calendar'])
      echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
            </td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


- This does not exist in for this theme instead, I have this:

// The [calendar]!
   if ($context['allow_calendar'])
      echo '<li', $current_action == 'calendar' ? ' id="active"' : '', '><a href="', $scripturl, '?action=calendar"><span>', $txt['calendar24'], '</span></a></li>';

Could some guru provide the theme-friendly Flashchat code equivalent for the following mod code:

   // FlashChat!
   global $modSettings;
   if ($context['user']['is_logged'])
      echo ($current_action == 'chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=chat"', (!empty($modSettings['fc_newWindow']) ? ' target="_blank"' : ''), '>', $txt['fc_chat'], (!empty($modSettings['fc_showUserCount']) && !empty($context['num_chat']) ? ' [<strong>' . $context['num_chat'] . ' ' . ($context['num_chat'] == 1 ? $txt['user'] : $txt['users']) . '</strong>]' : ''), '</a>
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


thanks



I used

    // FlashChat
   echo ' <li', $current_action == 'chat' ? ' id="active"' : '', '><a href="', $scripturl, '?action=chat" ><span>', $txt['fc_chat'] , '</span></a></li>';

- seems ok but I just want to be sure that I have not left out anything.

Thanks
Title: Re: FlashChat Integration with 1.1.1 Final, 1.1RC3 & 1.1RC2 Default Theme
Post by: Catanonia on November 28, 2008, 01:25:28 PM
I have just done this all the way upto showing users online and works great with

SWF 1.1.7 and FlashChat 4