Tutorial: how to COMPLETELY integrate FlashChat into SMF so you have a cool CHAT

Started by marcnyc, October 09, 2004, 07:21:56 AM

Previous topic - Next topic

Harvester

Hello Im having problems it seems.
I was moving along well following your tutorial but then I got to this part:


Quote8. in that same folder open /smf/Themes/default/index.template.php and at the end of the file (I am assuming that you have ALREADY installed FlashChat and followed all the SMF integration instructions carefully, thus modified this file beforehand) find this bit of code:

Code:
<a href="', $GLOBALS['boardurl'], '/FlashChat/flashchat.php">


I followed the integration instructions carefully as far as I know. I mean, my chat works great and users must login with the same username and pw  they use on my forums.  BUT.... my index.template.php does not have the code you say I should find within it. I know that it will look different because of my path but I adjusted for that and still no go. I even did a search for just flashchat.php and did it in all  the index.template.php for each theme I have installed and nothing. What do I do? I just got off of tufats site and see nothing about SMF there.

Help please?

TechnoDragon

@Harvester

He is referrring to the link part of the code for a button in your theme...if you cannot find it you may not have a button (to launch FlashChat)
Don't tell me to get into shape...I have a shape...It is round!


raiwatson

Quote from: raiwatson on March 16, 2006, 03:27:27 PM
2: call_user_func(ChatRoom): First argument is expected to be a valid callback
File: /home/secureo/public_html/smf/index.php
Line: 119


This is the error message I get when I click on my chat button.  Any idea what I might have done wrong?  (I haven't moved on to the 2nd part of the tutorial - only gone through Step 8 so far.)  I'm using smf 1.0.6 with the classic theme.

http://www.secureoffsite.com/smf/index.php

I'm still having this problem!  I started over today, going step by step through the tutorial once again.  Now, when I click the chat button, it opens a beautiful page inside my forum and displays the above error message.  I tried changing "chatroom" to "chat" {i.e. call_user_func(chat)}so it would be identical to the instructions, and then I got the same lovely forum page with this error:

Unable to load chat template.

Can anyone help me?!

Also... if I can't get the chat to open inside my forum template and have to keep using it in it's own format, will the instructions in the subtutorials still work to display the name and/or number of chat users?

Any help would be appreciated.  I can tell this would be awesome if I could actually get the chat room integrated rather than using it in it's "out of the box" format, but... I have no idea what else to try.  Thanks!

snork13

Quote from: raiwatson on March 26, 2006, 07:18:36 PM
Quote from: raiwatson on March 16, 2006, 03:27:27 PM
2: call_user_func(ChatRoom): First argument is expected to be a valid callback
File: /home/secureo/public_html/smf/index.php
Line: 119


This is the error message I get when I click on my chat button.  Any idea what I might have done wrong?  (I haven't moved on to the 2nd part of the tutorial - only gone through Step 8 so far.)  I'm using smf 1.0.6 with the classic theme.

http://www.secureoffsite.com/smf/index.php

I'm still having this problem!  I started over today, going step by step through the tutorial once again.  Now, when I click the chat button, it opens a beautiful page inside my forum and displays the above error message.  I tried changing "chatroom" to "chat" {i.e. call_user_func(chat)}so it would be identical to the instructions, and then I got the same lovely forum page with this error:

Unable to load chat template.

Can anyone help me?!

Also... if I can't get the chat to open inside my forum template and have to keep using it in it's own format, will the instructions in the subtutorials still work to display the name and/or number of chat users?

Any help would be appreciated.  I can tell this would be awesome if I could actually get the chat room integrated rather than using it in it's "out of the box" format, but... I have no idea what else to try.  Thanks!

you have a test account, you have the chat.template in the theme folder, and chat.php in the source folder, and made the changes in index.php for the action?
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

raiwatson

Quoteyou have a test account, you have the chat.template in the theme folder, and chat.php in the source folder, and made the changes in index.php for the action?

I don't have a test account - I'm  not sure how to do that.
chat.php in Sources - yep
chat.template.php in themes/classic  (I use the class theme, not the default)
index.template.php also in themes/classic

The only other change I made was in index.php.  There was already a line that said this:

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

At first I added the new "chat  => array" line and left that line in; that got me the call_user_func error.  When I took the old line out and left in just the new line, I got the "Unable to load chat" error.

:'(

snork13

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

should be in index.php


not

'chat' => array('Chat.php', 'ChatRoom'), you need to follow step by step in the first post
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

TechnoDragon

Quote from: raiwatson on March 26, 2006, 07:18:36 PM
Quote from: raiwatson on March 16, 2006, 03:27:27 PM
2: call_user_func(ChatRoom): First argument is expected to be a valid callback
File: /home/secureo/public_html/smf/index.php
Line: 119


This is the error message I get when I click on my chat button.  Any idea what I might have done wrong?  (I haven't moved on to the 2nd part of the tutorial - only gone through Step 8 so far.)  I'm using smf 1.0.6 with the classic theme.

http://www.secureoffsite.com/smf/index.php

I'm still having this problem!  I started over today, going step by step through the tutorial once again.  Now, when I click the chat button, it opens a beautiful page inside my forum and displays the above error message.  I tried changing "chatroom" to "chat" {i.e. call_user_func(chat)}so it would be identical to the instructions, and then I got the same lovely forum page with this error:

Unable to load chat template.

Can anyone help me?!

Also... if I can't get the chat to open inside my forum template and have to keep using it in it's own format, will the instructions in the subtutorials still work to display the name and/or number of chat users?

Any help would be appreciated.  I can tell this would be awesome if I could actually get the chat room integrated rather than using it in it's "out of the box" format, but... I have no idea what else to try.  Thanks!

i could just send my files to you through messenger if you would like...all you would have to do is modify the urls in them to match your details.

and the change the link to FlashChat (that is what I named all of my templates...)

http://forum.technodragon.net/index.php?action=FlashChat

that is the link to see how mine works (you may have to sign up, but I don't think so...)
Don't tell me to get into shape...I have a shape...It is round!



raiwatson

Quote from: snork13 on March 26, 2006, 08:06:28 PM
'chat' => array('Chat.php', 'Chat'),

should be in index.php


not

you need to follow step by step in the first post

The instructions didn't address the possibility that a this: 'chat' => array('Chat.php', 'ChatRoom'), was already in my index.php file, so I wasn't sure at first whether the new code should replace this or be added to it.  I tried it both ways.  When I replaced it and put in ONLY the code exactly as shown in the instruction, I get the error "Unable to load chat". 

Again, the chat room works fine if I leave it linked "off site" and don't have it open inside my template pages.  When I do link it to open inside the template, the page opens up nicely, but it simply won't load the chat.

Technodragon - if you think that will help, I'd really appreciate it!  I'm pretty sure I copied everything exactly as instructed in the tutorial, so the error might be somewhere else - maybe something in my template since I'm not using the default?  I'm at a total loss, but am willing to try anything!

snork13

Quote from: raiwatson on March 27, 2006, 06:16:17 AM
Quote from: snork13 on March 26, 2006, 08:06:28 PM
'chat' => array('Chat.php', 'Chat'),

should be in index.php


not

you need to follow step by step in the first post

The instructions didn't address the possibility that a this: 'chat' => array('Chat.php', 'ChatRoom'), was already in my index.php file, so I wasn't sure at first whether the new code should replace this or be added to it.  I tried it both ways.  When I replaced it and put in ONLY the code exactly as shown in the instruction, I get the error "Unable to load chat". 

Again, the chat room works fine if I leave it linked "off site" and don't have it open inside my template pages.  When I do link it to open inside the template, the page opens up nicely, but it simply won't load the chat.

Technodragon - if you think that will help, I'd really appreciate it!  I'm pretty sure I copied everything exactly as instructed in the tutorial, so the error might be somewhere else - maybe something in my template since I'm not using the default?  I'm at a total loss, but am willing to try anything!


you should only have the one line in the index.php file :

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

the chat.template is what make it inside the forum, and the chat.php is what loads the template system.

It should take minutes to get you up and runnning, i would suggest starting fresh, using the default theme, get it to work, and then make the changes for the custom theme.

i would be happy to look at it all, but will need ftp/admin account pm me if interested

-snork
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Harvester

Quote8. in that same folder open /smf/Themes/default/index.template.php and at the end of the file (I am assuming that you have ALREADY installed FlashChat and followed all the SMF integration instructions carefully, thus modified this file beforehand) find this bit of code:

Code:
<a href="', $GLOBALS['boardurl'], '/FlashChat/flashchat.php">and change just that one bit of code (which is part of an entire line of code - you are NOT supposed to change or delete the rest of that line) it into this:

Code:
<a href="', $scripturl, '?action=chat">

I dont find that code in my index.template.php file. What is meant by
Quotefollowed all the SMF integration instructions carefully
Which integration instructions are you talking about? I followed the integration instructions that came with FlashChat completely as far as I know. What would happen if I deleted flashchat and went and reinstalled it and reintegrated it... is  that something I should consider doing??

Please help.

Thank You, Harvester

raiwatson



I wanted to publicly thank snork13 for sharing his expertise!  In a couple minutes, he got my chatroom working perfectly (after weeks of me scratching my head and kicking my computer)!

Thank you, snork - I can't tell you how much I appreciate your help!

raiwatson

One last question...  This was asked a couple times back on page 7 of this thread, but I couldn't find an answer.

I was able to add the "There are _ users in chat" where I wanted it, but I'd also like to list the chat users at the bottom of the page, under Users Online. 

Since I'm using the classic theme instead of default, the line of code I'm supposed to replace is not exactly what the instructions say.  Mine looks like this:

Quote<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'], $context['num_users_hidden'] > 0 ? ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')' : '', $context['show_who'] ? '</a>' : '', '<br />

If I replace that with the code given in Sub-tutorial #1, step 4, I get parse errors.

Does anyone know how I can replace or edit this section of code to show the users in chat without messing up my template?

Thanks (again!!)

Vinspire^

Can integrate this flashchat with an irc channel ?

trvlnman

I don't know if this is the right spot fro this or not...but I am trying to finish this integration and have looked at the directions for sub-tutorial #2 and my code is different than what is descrboed.

I have installed TP and i think there are some of those changes in the same place.

I am using the TP_Helios_Multicolor Theme for SMF 1.1 RC2

Here is the code where I think it shoud go.....

// The main content should go here.  A table is used because IE 6 just can't handle a div.
        echo '
        <table style="margin-top: 4px;" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>';
// TinyPortal integrated bars
          if($context['TPortal']['leftbar'])
          {
              echo '<td width="' ,$context['TPortal']['leftbar_width'], '" style="padding-top: 4px;" valign="top">'.$topbox.'
                 <div id="leftbarHeader"', empty($options['collapse_leftbar']) ? '' : ' style="display: none;"', ' style="padding-top: 5px; width: ' ,$context['TPortal']['leftbar_width'], 'px;">';
                 TPortal_sidebar('left');
              echo '</div>'.$botbox.'</td>';

          }

        echo '<td width="100%" align="left" valign="top" style="padding-top: 10px; padding-bottom: 10px;" id="bodyarea">';
        if($context['TPortal']['centerbar'])
                     echo '<div>' , TPortal_sidebar('center') , '</div>';

}
       

Can anyone tell me where or how i should put the code in for sub-tutorial #2??  Am I even in ther right spot?

I have tried a few times and keep getting a template parsing error.  It says that I have an unexpected $.

Here is the code I am trying to insert.

     $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 ( @$_GET['action'] != "chat" ) {
if ( $chatcount == "1" ) {
$singularplural1 = " is ";
$singularplural2 = "";
} else {
$singularplural1 = " are ";
$singularplural2 = "s";
}
echo '
Currently there ' . $singularplural1 . ' <font color="#FF0000">' . $chatcount . ' User'.$singularplural2.' in the Chat!</font><br>';
}


Do I need an additional ECHO statement?

Thanks in advance for any help.

Simplemachines Cowboy

Quote from: trvlnman on May 10, 2006, 03:07:02 PM
I am using the TP_Helios_Multicolor Theme for SMF 1.1 RC2

This tutorial is for version 1.0X of SMF.

Go here for the tutorial for the DEFAULT THEME of 1.1RC2:
http://www.simplemachines.org/community/index.php?topic=66561.0
My SMF forum: The Open Range

trvlnman


porcelainprincess

Everything works almost perfect.

I added the Who's in the Chat, it does it's job but I get this:

QuoteUsers in chat: 

I don't know where the extra characters are coming from. They are BEFORE the names of the people in the chat and are not the same color as the users in the chat. Anyone? :) Thanks!

raiwatson

I still can't find an answer to my question from a few weeks ago; can anyone help?!

Right now, I'm using Flashchat's code for a list of chat users, but if there are more than 5 people in chat, the list extends beyond the box and nobody can read it.  I'd much rather try this code this is made to work with SMF.

If anyone can help me figure out how to work Subtutorial 1, Step 4 into the Classic theme, my 597 members and I would be extremely grateful! :D

Quote from: raiwatson on April 02, 2006, 09:00:17 AM
One last question...  This was asked a couple times back on page 7 of this thread, but I couldn't find an answer.

I was able to add the "There are _ users in chat" where I wanted it, but I'd also like to list the chat users at the bottom of the page, under Users Online. 

Since I'm using the classic theme instead of default, the line of code I'm supposed to replace is not exactly what the instructions say.  Mine looks like this:

Quote<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'], $context['num_users_hidden'] > 0 ? ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')' : '', $context['show_who'] ? '</a>' : '', '<br />

If I replace that with the code given in Sub-tutorial #1, step 4, I get parse errors.

Does anyone know how I can replace or edit this section of code to show the users in chat without messing up my template?

Thanks (again!!)

^DooM^

if ($context['show_who'])
echo '
<a href="', $scripturl, '?action=who">';

    echo $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], ', ', $chatcount . ' User' . $singularplural1 . ' in Chat ' . '</a><br />';


I edited this to suit my own needs for the classic theme. I am sure you can add the variable names where needed though ;)
Never argue with an idiot, they will simply bring you down to their level and then beat you with experience

Advertisement: