Author Topic: Adding FlashChat support to your theme  (Read 39680 times)

Offline Daniel15

Adding FlashChat support to your theme
« on: May 05, 2007, 11:50:46 PM »
Note that by default, the FlashChat mod is only installed on the default theme. To install this on your custom theme (so it shows the users in the chat under Users Online, and at the top of the page), you'll need to edit some files.

In Themes/[theme name]/BoardIndex.template.php, find:
Code: [Select]
echo '
', $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 with:
Code: [Select]
echo '
', $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'], ', ', $context['num_chat'], ' ', $context['num_chat'] == 1 ? $txt['user'] : $txt['users'], ' ', $txt['fc_in_chat'];

Find:
Code: [Select]
if (!empty($context['users_online']))
echo '
', $txt[140], ':<br />', implode(', ', $context['list_users_online']);

Add after:
Code: [Select]
// --- Begin FlashChat integration ---
// If there's users in the chat
if (!empty($context['users_chat']))
echo '
<br />
', $txt['fc_users_online'], ':<br />', implode(', ', $context['list_users_chat']);
// --- End FlashChat integration ---

Also, open Themes/[theme name]/index.template.php, and find:
Code: [Select]
// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
Add after:
Code: [Select]
// --- Begin FlashChat Integration ---
// Do we need to display a list of the users in the chat?
// Are there users online?
if (!empty($modSettings['fc_showUsers']) && !empty($context['users_chat']))
echo '
', $txt['fc_users_online'], ': ', implode(', ', $context['list_users_chat']), '<br />';
// --- End FlashChat Integration ---

Note that this will not add the Chat button to the menu bar. If you need help on that, please ask :)

Offline LyriC

Re: Adding FlashChat support to your theme
« Reply #1 on: May 22, 2007, 05:05:59 AM »
hello
nice work but i have a little problem
in the forum under admin in the protocol ther are
a lot of errors

Undefined index: fc_users_online
Datei: /home/wgc/public_html/forum/Themes/helios/BoardIndex.template.php (main sub template - eval?)
Zeile: 440

and

Undefined index: fc_in_chat
Datei: /home/wgc/public_html/forum/Themes/helios/BoardIndex.template.php (main sub template - eval?)
Zeile: 407

the errors are always repeatet

in the code i post you my BoardIndex.template.php from line 400 to line 450.

Code: [Select]
               </td>
                <td class="windowbg2" width="100%">';

        if ($context['show_who'])
                echo '
                        <a href="', $scripturl, '?action=who">';
echo '
', $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'], ', ', $context['num_chat'], ' ', $context['num_chat'] == 1 ? $txt['user'] : $txt['users'], ' ', $txt['fc_in_chat'];

        // Handle hidden users and buddies.
        if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context['show_buddies'])))
        {
                echo ' (';

                // Show the number of buddies online?
                if ($context['show_buddies'])
                        echo $context['num_buddies'], ' ', $context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies'];

                // How about hidden users?
                if (!empty($context['num_users_hidden']))
                        echo $context['show_buddies'] ? ', ' : '', $context['num_users_hidden'] . ' ' . $txt['hidden'];

                echo ')';
        }

        if ($context['show_who'])
                echo '</a>';

        echo '
                        <span class="smalltext">';

        // 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']);
// --- Begin FlashChat integration ---
// If there's users in the chat
if (!empty($context['users_chat']))
echo '
<br />
', $txt['fc_users_online'], '--><br />', implode(', ', $context['list_users_chat']);
// --- End FlashChat integration ---                               
        echo '
                        <br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
                        <a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
                        </span>
                        <hr /><span class="smalltext">
                        Most users online today: '.$modSettings['mostOnlineToday'].' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        Most users online ever: <b>'.$modSettings['mostOnline'].'</b> ( '.timeformat($modSettings['mostDate']).'  )

                        </span>

i hope you can help me please
thx cya
LyriC
« Last Edit: May 22, 2007, 05:09:13 AM by LyriC »

Offline Daniel15

Re: Adding FlashChat support to your theme
« Reply #2 on: May 26, 2007, 11:16:24 AM »
Are you using version 1.0 of the FlashChat integration mod? This requires version 1.0.

Offline LyriC

Re: Adding FlashChat support to your theme
« Reply #3 on: May 28, 2007, 03:43:48 AM »
yes i am using 1.0 mod

Offline kruna

Re: Adding FlashChat support to your theme
« Reply #4 on: June 21, 2007, 01:44:09 PM »
Hi Daniel15,

first of all, thanks a lot for the great mod!!

"Note that this will not add the Chat button to the menu bar. If you need help on that, please ask :)" (Sorry, somehow inserting quotes didnt work)

Well, actually evrything worked very fine, just need to add the Chat button on the menu bar and dont know how to do that...

Can you please help me?

I am using the famouspadexx-theme, please take a look at www.clickyshop.com/foro

Thank you very much in advance.

Regards,
kruna

Offline kruna

Re: Adding FlashChat support to your theme
« Reply #5 on: June 22, 2007, 02:49:17 AM »
Hi daniel,

sorry never mind..i found it out already...(hope i made it right   as I have no idea about coding, was just a copy/paste thing)...

I have another problem though, but will post it in another thread.

Great work you are doing...hats off!!

Regards,
Kruna

Offline clarkkent93

Re: Adding FlashChat support to your theme
« Reply #6 on: July 02, 2007, 03:38:55 AM »
Note that by default, the FlashChat mod is only installed on the default theme. To install this on your custom theme (so it shows the users in the chat under Users Online, and at the top of the page), you'll need to edit some files.

In Themes/[theme name]/BoardIndex.template.php, find:
Code: [Select]
echo '
', $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 with:
Code: [Select]
echo '
', $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'], ', ', $context['num_chat'], ' ', $context['num_chat'] == 1 ? $txt['user'] : $txt['users'], ' ', $txt['fc_in_chat'];

Find:
Code: [Select]
if (!empty($context['users_online']))
echo '
', $txt[140], ':<br />', implode(', ', $context['list_users_online']);

Add after:
Code: [Select]
// --- Begin FlashChat integration ---
// If there's users in the chat
if (!empty($context['users_chat']))
echo '
<br />
', $txt['fc_users_online'], ':<br />', implode(', ', $context['list_users_chat']);
// --- End FlashChat integration ---

Also, open Themes/[theme name]/index.template.php, and find:
Code: [Select]
// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
Add after:
Code: [Select]
// --- Begin FlashChat Integration ---
// Do we need to display a list of the users in the chat?
// Are there users online?
if (!empty($modSettings['fc_showUsers']) && !empty($context['users_chat']))
echo '
', $txt['fc_users_online'], ': ', implode(', ', $context['list_users_chat']), '<br />';
// --- End FlashChat Integration ---

Note that this will not add the Chat button to the menu bar. If you need help on that, please ask :)


I tried to add the last bit of code in my theme but couldn't find the statement that reads:
Code: [Select]
// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}

I'm using the MeshTP theme.  I'll also need help creating the button if you don't mind helping out.

Thanks.

Offline aLyas

Re: Adding FlashChat support to your theme
« Reply #7 on: July 03, 2007, 04:31:10 AM »
Quote
Note that this will not add the Chat button to the menu bar. If you need help on that, please ask :)

here Im asking :)
http://mangaz.freehostia.com/forum/  is my forum related to the website  www.mangaaz.fr.nf
and I wondere If you can help me in adding a boutton to the menu barre
choukrane (thx)
« Last Edit: July 03, 2007, 04:33:02 AM by aLyas »

Offline assasinkilla

Re: Adding FlashChat support to your theme
« Reply #8 on: July 28, 2007, 05:31:53 PM »
No offence, but... Really bad support, havent replied her yet... Msg from july 3

Offline Raptor

Re: Adding FlashChat support to your theme
« Reply #9 on: August 06, 2007, 10:50:38 AM »
Hello,

I have added the Flash chat mod to my SMF and the flash chat is working.

However I can not seem to add the Flash chat Button to my theme. I am using the Heavy Metal theme and it seems to add buttons different them all the post I see here. Can you help please and tell me the code to add to the Heavy Metal theme to get the Flashchat button.

Thank you

Offline cmcmom

Re: Adding FlashChat support to your theme
« Reply #10 on: August 11, 2007, 07:56:55 AM »
I am  using the Bright  Forest theme....here is the download:   http://custom.simplemachines.org/themes/?lemma=336


Please help me with the CHAT BUTTON

is there a way to see if the integration code given works without the TAB?



Offline Daniel15

Re: Adding FlashChat support to your theme
« Reply #11 on: August 11, 2007, 11:57:44 AM »
Quote
is there a way to see if the integration code given works without the TAB?

Sure, go to index.php?action=chat.

Quote
No offence, but... Really bad support, havent replied her yet... Msg from july 3

I can't visit this forum that often... School is more important for me. I'm a 17-year-old student, and need to focus a lot of my effort on school work ;).

For everyone that requested a button, please provide a link to the theme you're using! :)

Quote
I am  using the Bright  Forest theme....here is the download:   http://custom.simplemachines.org/themes/?lemma=336

In Themes/<your theme>/index.template.php, find:
Code: [Select]
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
Add after:
Code: [Select]
if ($context['current_action'] == 'chat')
$current_action = 'chat';

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

Add after:
Code: [Select]
// FlashChat
echo '
<li', $current_action == 'chat' ? ' id="actief"' : '', '><a href="', $scripturl, '?action=chat"', (!empty($GLOBALS['modSettings']['fc_newWindow']) ? ' target="_blank"' : ''), '>', $txt['fc_chat'], (!empty($GLOBALS['modSettings']['fc_showUserCount']) && !empty($context['num_chat']) ? ' [<strong>' . $context['num_chat'] . ' ' . ($context['num_chat'] == 1 ? $txt['user'] : $txt['users']) . '</strong>]' : ''), '</a></li>';

Offline Lily Flor

Re: Adding FlashChat support to your theme
« Reply #12 on: August 12, 2007, 01:33:44 PM »
Hi I need help with the buttom too, please please... please!! help!!  :'(
I have the girlyman theme install
www.planetacandy.com/Candy

thanks!!! Thanks!! thanks!!! a million!!

Lily Flor

Offline Northboun

Re: Adding FlashChat support to your theme
« Reply #13 on: August 14, 2007, 03:37:50 AM »
I am in need of a chat button for helios_multi11final theme (http://custom.simplemachines.org/themes/index.php?lemma=1) if possible  O0

Thanks for any help.

Offline assasinkilla

Re: Adding FlashChat support to your theme
« Reply #14 on: August 16, 2007, 11:00:28 AM »
I also need to add the button im using modified aa new damage