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

huijaa

Can you make a normal php-code in Chat.template.php in stead of

iframe width="100%" height="450" src="http://www.yourserver.com/smf/FlashChat/flashchat.php"></iframe>
Dovenforum Nederland -- a forum for deaf people in the Netherlands --

meester fox

I THINK this would go here. I'm not sure, though.

I read the guide for intergrating flash chat into your site entirely. the first bit worked like a charm. the second bit didn't.  the second bit, which allows you to display how many users are in your chat, causes a premature end of script when i enter it into the file.  I've tried cheating with the flashchat info file.  even added it into the index template.  (stupid variable was already declared)

so anyway, i'm annoyed. I can still do a php include statement from the info.php file, but i can't put it in the forum where i want it, only before or after the <?php  ?> of the script.  Which WORKS, i'll give it that. but I want it to be in a better place.  And include refuses to work while inside the code of the board index.

So... perhaps someone could enlighten me. 
Qdork is my SMF/mkportal website. Nothing amazing. A few mods, iTunes giveaways, and decent members.

[Unknown]

Can you give a few lines around how you're trying to enter the include?  I'll give you a few examples:

Wrong:
<some html>
include('hello.php');
</more html>


Also wrong:
<some html>
<?php include('hello.php'); ?>
</more html>


Correct:
<some html>';
include('hello.php');
echo '</more html>


-[Unknown]

Owdy

If i use include in chat.template.php, i get:

Fatal error: Cannot redeclare reloadsettings() (previously declared in /www/asiakkaat/public_html/foorumi/Sources/Load.php:96) in /www/asiakkaat/public_html/foorumi/Sources/Load.php on line 94
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

meester fox

yeah... i know. that's part of the problem.  the include works fine, so long as it's before the actual code for the site.  But as part of it, it won't work. 

I wouldn't mind using the way the first post of this topic describes, but it gives me errors.
Qdork is my SMF/mkportal website. Nothing amazing. A few mods, iTunes giveaways, and decent members.

[Unknown]

Quote from: Owdy on January 31, 2005, 12:32:19 PM
If i use include in chat.template.php, i get:

Fatal error: Cannot redeclare reloadsettings() (previously declared in /www/asiakkaat/public_html/foorumi/Sources/Load.php:96) in /www/asiakkaat/public_html/foorumi/Sources/Load.php on line 94

Are you... trying to include Load.php :P?  SSI.php?

-[Unknown]

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

[Unknown]


Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

huijaa

When i changed a cookiename in SMF, the auto-login don't work anymore, but when i changed previous name, it again works.

Any idea?
Dovenforum Nederland -- a forum for deaf people in the Netherlands --

twinklewitch

I've installed FlashChat and all works fantastic. I also added a button on top of the forum, just like the read me file told me to. However...the logout and chat button now both are showing up a bit off. They both are placed a little higher then the rest of the icons, and they are attached to each other, without a small space.

It's nothing much, but since I don't really like playing around with codes cause i'm scared I'll ruin the entire thing, I was wondering if anyone has a suggestion for me.

This is the code I had to add:

else {
     echo '<a href="', $GLOBALS['boardurl'], '/FlashChat/flashchat.php">',
     ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
     . '/chat_icon.gif" alt="FlashChat" style="margin: 2px 0;"
     border="0" />' : "FlashChat"),'</a>';

    echo '<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'],
    '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
    . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108]
    . '" style="margin: 2px 0;" border="0" />' : $txt[108]),'</a>';
}


Anything in there that needs a little change so that both buttons show up just fine again?

babylonking

check the buttons margin size and make sure all buttons use the same margin size . style="margin: 2px 0;"

bluevoodu

just a question, hows come there is always 1 user in the stats for the chat (in the stats at the bottom of the forum) UNLESS I login and log back out?

†B†V†
We want you to join:
Chicken Dinner Gaming Community

jay_nasty

anytime i replace the code like described in the tutorial

else {
     echo '<a href="', $GLOBALS['boardurl'], '/FlashChat/flashchat.php">',
     ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
     . '/chat_icon.gif" alt="FlashChat" style="margin: 2px 0;"
     border="0" />' : "FlashChat"),'</a>';

    echo '<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'],
    '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
    . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108]
    . '" style="margin: 2px 0;" border="0" />' : $txt[108]),'</a>';
}

in my /themes/curve/index.template


nothing happens!

when i edit my

/themes/default/index.
#

i get

Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.


my actual theme is curve and i dont wont to change it


can anyone help me

i tried everything

Raffoz

i make it today...
wonderful...
i translated to italian the phrases for users... ;)

very nice...
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)


bluevoodu

cool stuff here!  Just wanted to say thanks again.. but I did have a question.

How can we list WHO is in the chat in addition to the "how many users"
It would be cool to have a user list of who is in there.... at the bottom where there is the # of people in the chat.

Thanks,
BV
We want you to join:
Chicken Dinner Gaming Community

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

pheasant_plucker

I modified the info.php file to list the names of who is in chat along the top of my forum page.

Go into your flashchat folder and edit info.php
find the code
//result will be an array of arrays like ('id' => <room id>, 'updated' = <timestamp>, 'created' => <timestamp>, 'name' => <room name>, 'ispublic' => <public flag>, 'ispermanent' => <autoclose flag>)
return $list;
}


$rooms = roomlist();
$roomnumb = sizeof($rooms);
?>


Delete everything after it and replace with

<html>
<title>Who's in the chat?</title>

<body>


<?php if($roomnumb) { ?>

<?php foreach($rooms as $room) { ?>

<?php

$users 
usersinroom($room['id']);

foreach( 
$users as $user ) {
echo 
$user['login']. ", ";
}
?>


<? } ?>
<? } ?>
</body>
</html>



Now edit your index.template.php file and after


// The main content should go here.  A table is used because IE 6 just can't handle a div.

echo '

<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>

<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">';



add the line

include('http://www.rcmodelflyers.co.uk/4um/FlashChat/info.php');   

Gerry

Owdy

Nice! How about popup window with:

<html>
<title>Who's in the chat?</title>

<body>


<?php if($roomnumb) { ?>

<?php foreach($rooms as $room) { ?>
<p class=normal>There are <?=numusers()?> users in  chat:
<?php

$users 
usersinroom($room['id']);

foreach( 
$users as $user ) {
echo 
$user['login']. ", ";
}
?>
</p>
<p align="center"><a href="javascript:window.close()">Close window</a></p>
<? } ?>
<? } ?>
</body>
</html>


Ad this in index.template.php
<a href="#" onMouseOver="window.status=\'Who is in the chat??\'; return true;" onMouseOut="window.status=\'\'; return true;" OnClick="window.open (\'http://example.com/FlashChat/info.php\',\'popup\',\'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,fullscreen=0,top=20,left=20,height=250,width=350\'); return false;">Who is in the chat?</a>
:)
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Advertisement: