Hello folks, this is my attempt to give something back to the community.
I am running SMF 1.0 RC1 and I wanted to have a chat in my board. I have tried about 3 or 4 scripts and I must say I couldn't deal with how slow Java chats are and how imprecisely those applets render on different browsers. I am a supporter of PHP's power and if that means I have to accept some Flash (Flash ain't that bad and is much muuuuch faster than java), I'll gladly do it as long as the chat has the features I wanted, first and foremost integration with SMF in terms of user database.
The chat that does that is FlashChat which you can buy at a honest and fair price (finally somebody understood you can't charge houndreds!) from http://www.tufat.com
I bought my software and installed the chat. I will not explain how to install it in SMF because the package contains pretty detailed instructions on how to do that (except the SMF integration instructions forget to tell you that you have to CHMOD 777 the appdata/appTime.txt file and forgets to provide you with the chat gif button that you'll be able to request to the software dude via email or download from somewhere else).
Once you install the chat you can further graphically enhance it and make it similar to your board by using styles and themes. Documentation is included (even if not excellent).
This said, here come my two cents:
What I did NOT like about this chat is the fact that it would 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. I hope you know what I mean. Basically you have your chat but above it you have that piece of SMF that you see in every single SMF page except the help pages. And same below.
Here is how (I assume that you installed SMF in the folder called /smf/ and that you are using the default theme - if you are not just change "/smf/" with the name of your smf folder on your server and change "default" with the name of your theme's folder inside the /Themes/ directory of yoru SMF installation):
1. open /smf/index.php
2. find this line:
'boardrecount' => array('Admin.php', 'AdminBoardRecount'),
and after that code add this code:
'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
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.0 RC1; 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="450" src="http://www.yourserver.com/smf/FlashChat/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 "FlashChat". You don't need the full URL, you can also (and it is recommended that you do) use "FlashChat/flashchat.php" as your URL if you have created the "FlashChat" folder inside the "smf" folder. Change paths according to your installation. [#NOTE: please read note below]
8. 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:
<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:
<a href="', $scripturl, '?action=chat">
#NOTE: I have resorted to using iframe because I could not get include or require to work but if some PHP genius out there can explain me why I wouldn't be able to include("http://www.yourserver.com/smf/FlashChat/flashchat.php"); or to require("http://www.yourserver.com/smf/FlashChat/flashchat.php"); I'd be very thankful for that and I'd recommend using this option as opposed to the iframe thing that doesn't work on some browsers like older Netscapes...
UPDATE (October 14th 2004) - "Users in Chat":
Ok, here is an update on how to COMPLETELY and TOTALLY integrate FlashChat into an SMF template. Thanks to AxeCrazy who provided me with the core code to do this.
Please note that in this tutorial update it is assumed that your MySQL's table prefix is "smf_" as in every case of a fresh installation of SMF. If you have upgraded your forum from a YaBB SE installation your table prefix will most likely be "yabbse_", therefore you will have to change every instance of smf_fc_connections with yabbse_fc_connections. This said let's rock'n'roll!
Ths tutorial addition will show you two things:
A. how to 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)
B. how to add a text at the top of the page (under the navigation menu with all the buttons) that says how many users are in the chat
In both cases I implemented a few easy but neat tricks that will avoid that text to be shown when you are in the chat page and that will make sure the sentece is grammatically correct, in terms of singular and plural.
SUB-TUTORIAL #1: INDEX PAGE "Users in Chat" integration (the number of users in the chat will appear in the ONLINE USERS section, right next to where it says "X visitors, X users").
1. Open smf/Themes/default/BoardIndex.template.php
2. search for the comment string:
// "Users online" - in order of activity
3. right after that line, before the following echo statement, add this code:
$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" ) {
$singularplural2 = "";
} else {
$singularplural2 = "s";
}
4. a few lines below you'll see a long line (part of the above mentioned echo statement) that should look like this:
<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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), '</a><br />
5. replace that line with this one:
<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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), ', ' . $chatcount . ' User'.$singularplural2.' in Chat</a><br />
6. You are done. This will make your forum's index page bottom read something like: "0 Visitors, 4 Users, 2 Users in Chat". Please note that my 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", which we all know is wrong, don't we? ;)
SUB-TUTORIAL #2: 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 below the INDEX, HELP, SEARCH, ADMIN, PROFILE, CALENDAR, CHAT, LOG OUT navigation bar buttons). My code will adjust the sentence to make sure it is grammatically correct AND it will NOT show the sentence in the actual chat page becase 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.
1. Open smf/Themes/default/index.template.php
2. search for the comment string:
// The main content should go here
3. right after that line there is a two line echo statement that opens the tags <table>, <tr> and <td>.
4. Right after those two lines add this code:
$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>';
}
If for some reason you want the line to appear ONLY if there actually IS somebody in the Chat, then you can use instead of the code above this code:
$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";
}
if ( $chatcount != 0 )
echo 'Currently there ' . $singularplural1 . ' <font color="#FF0000">' . $chatcount . ' User'.$singularplural2.' in the Chat!</font><br>';
}
5. You are done. This will make all your forum's pages read something like this at the top: "Currently there are 2 Users in the Chat!". Please note that my 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 "Currently there is 1 User in the Chat!", as opposed to "Currently there are 1 Users in the Chat!", which we all know is wrong, don't we? ;)
In addition to that, as I was explaining above, it does NOT show the line in the actual INTEGRATED chat page because the user count would not be up to date with what is happening in real time inside the chat room.
I hope this will help everybody and make your forum/chat experience even more enjoyable!
Thanks for taking the time to write up this tutorial. When I get a chance I'll give it a go. :)
You are very welcome, like I said I want to give something back to this community who has always helped me with my YaBBGold/YaBBSE/SMFBeta/SMF1.0 issues.
Now I just wish somebody would figure out how to tell visitors/users on the board how many are in the chat PLUS I wish the SMF people finally came out with their CMS integration...
Hey, this is cool! This is the best looking chatroom I've ever seen! Very smooth and efficient.
Does it consume a lot of bandwidth?
This questions should be addressed to the manufacturer of the sw. I am just a user like you ;-)
Thanks for the tutorial marcnyc, I also added video and audio plugins to the chat. ;)
Where did you do that? Can I see it?
Did anybody figure out how to check how many users are in the chat and display it in the forum's index page?
Marc,
Thanks alot for your write up. I have since purchased and installed the product with no problems whatsoever. Although when I did email Daniela bout the chat_icon.gif, he said it was already included.
I'll have to check on that when I get home.
Thanks again!
I didn't see the icon anywhere but if you can find it good for you. I didn't even need it because I am using the Aquamania theme and luckily Andrea had provided a chat icon with that theme already! Andrea rocks...
Quote from: babylonking on October 13, 2004, 02:19:46 PM
Quote from: marcnyc on October 13, 2004, 09:11:42 AM
Where did you do that? Can I see it?
Did anybody figure out how to check how many users are in the chat and display it in the forum's index page?
Login with
username= fb3
password= fb3
http://www.babylonking.net/forum/
After you login click the chat button. :)
That's just great. Your site constantly amazes me (i'm registered as ChillyP, btw)!
You even have icons depicting each user? Nice touch man.
It's nice to see my tutorial implemented for real for the first time ;-) I am excited ;-P
I should check out the plug ins, I didn't even know there were plug ins for FlashChat.
Nice theme by the way, what is it?
i also included the flashchat now.
It rocks.
http://www.kolonisten.nl/yabbse
working on the user counter
let me know how it goes on the user counter... I haven't had time to get to it yet, but a hint is here:
I noticed that there is a user counter in the php page that you access if you go to the root of your FlashChat folder (basically if you access it bypassing the forum). In the top right corner of the PHP log in page of the FlashChat files there is a link that takes you to a counter so I guess we could start from there and use that code... anyway, if you figure it out please post it and let me know...
Babylonking, where did you find those plug ins? I didn't find them on the tufat site...
well got it working.
in the index.template.php find the part where you put in the chat button.
just before that add.
Quote$request = db_query("
SELECT COUNT(*) AS numb
FROM yabbse_fc_connections
WHERE userid IS NOT NULL", __FILE__, __LINE__);
list ($count) = mysql_fetch_row($request);
mysql_free_result($request);
the yabbse_fc_connections should be replaced by your $prefix_fc_connections
next i replace the alt "Chat"in the button with alt="' . $count . ' users in chat".
Works great.
kinda quick and dirty, but ok
Quote from: marcnyc on October 13, 2004, 06:46:37 PM
let me know how it goes on the user counter... I haven't had time to get to it yet, but a hint is here:
I noticed that there is a user counter in the php page that you access if you go to the root of your FlashChat folder (basically if you access it bypassing the forum). In the top right corner of the PHP log in page of the FlashChat files there is a link that takes you to a counter so I guess we could start from there and use that code... anyway, if you figure it out please post it and let me know...
Babylonking, where did you find those plug ins? I didn't find them on the tufat site...
It's paid add-on, here is the link http://www.virtualjam.net/addonhosting.htm
About the who's chatting i use this code
<?php @include('http://www.babylonking.net/forum/FlashChat/info.php'); ?>
used that before, but that gave a somwhat bulky overview.
I just wanted a quick indicator, but it is more or less the same code ;)
Has anyone seen resource issues with this script yet?
Regards,
Jason
Quote from: AxeCrazy on October 13, 2004, 07:24:34 PM
well got it working.
in the index.template.php find the part where you put in the chat button.
just before that add.
Quote$request = db_query("
SELECT COUNT(*) AS numb
FROM yabbse_fc_connections
WHERE userid IS NOT NULL", __FILE__, __LINE__);
list ($count) = mysql_fetch_row($request);
mysql_free_result($request);
the yabbse_fc_connections should be replaced by your $prefix_fc_connections
next i replace the alt "Chat"in the button with alt="' . $count . ' users in chat".
Works great.
kinda quick and dirty, but ok
Hi AxeCrazy, I have tested and implemented your code. I have added some tweaks in order to make it grammatically-compliant and in order to have it appear in the index page (and if you choose to) in all the pages of the forum, at the top. Please look at the initial post of this topic (my tutorial) as I have updated the tutorial and added all of these information and explained how to implement these two changes. I have chosen to rename the variables $chatrequest and $chatcount, simply because request and count are pretty common words and I wanted to avoid possible conflicts, as I am not familiar with the internal structure of SMF and they might have already been used/reserved in other instances
Quote from: babylonking on October 13, 2004, 07:37:57 PM
It's paid add-on, here is the link http://www.virtualjam.net/addonhosting.htm
About the who's chatting i use this code <?php @include('http://www.babylonking.net/forum/FlashChat/info.php'); ?>
Hey Babylonking, just three questions:
1 how do you create those news in your website's index?
2 is that shoutbox the one readily available in the MODS section?
3 it's a nice theme, did you do it yourself or what?
Quote from: charlottezweb on October 14, 2004, 08:20:02 AM
Has anyone seen resource issues with this script yet?
Regards,
Jason
Unfortunately I don't know how resource intensive it is. I haven't had any issues, to answer your questions, but I have 12Gb monthly bandwidth transfer available. You might want to address these questions to the manufacturer or install some bandwidth profiler script on your server to monitor it. If you have any hard facts data please post them as I am curious about this as well.
I'm worried about server loads, not really bandwidth. Either way, I've emailed the author -- we'll see what he says. :)
-Jason
Quote from: marcnyc on October 14, 2004, 09:16:41 AM
Quote from: babylonking on October 13, 2004, 07:37:57 PM
It's paid add-on, here is the link http://www.virtualjam.net/addonhosting.htm
About the who's chatting i use this code <?php @include('http://www.babylonking.net/forum/FlashChat/info.php'); ?>
Hey Babylonking, just three questions:
1 how do you create those news in your website's index?
2 is that shoutbox the one readily available in the MODS section?
3 it's a nice theme, did you do it yourself or what?
1- it's cute news script, you can get it from this link http://cutephp.com/
2- Yes it's the same shoutbox, i added manualy.
3- Yes i designed for bbk forum only.
Quote from: marcnyc on October 14, 2004, 09:10:51 AM
Quote from: AxeCrazy on October 13, 2004, 07:24:34 PM
well got it working.
in the index.template.php find the part where you put in the chat button.
just before that add.
Quote$request = db_query("
SELECT COUNT(*) AS numb
FROM yabbse_fc_connections
WHERE userid IS NOT NULL", __FILE__, __LINE__);
list ($count) = mysql_fetch_row($request);
mysql_free_result($request);
the yabbse_fc_connections should be replaced by your $prefix_fc_connections
next i replace the alt "Chat"in the button with alt="' . $count . ' users in chat".
Works great.
kinda quick and dirty, but ok
Hi AxeCrazy, I have tested and implemented your code. I have added some tweaks in order to make it grammatically-compliant and in order to have it appear in the index page (and if you choose to) in all the pages of the forum, at the top. Please look at the initial post of this topic (my tutorial) as I have updated the tutorial and added all of these information and explained how to implement these two changes. I have chosen to rename the variables $chatrequest and $chatcount, simply because request and count are pretty common words and I wanted to avoid possible conflicts, as I am not familiar with the internal structure of SMF and they might have already been used/reserved in other instances
Nice i really like the line to appear ONLY if there actually IS somebody in the Chat.
good work marcnyc :)
You are welcome BBKing. I am glad you like it.
Is CutePHP integrated with your forum and sharing the same database?
Quote from: marcnyc on October 14, 2004, 01:16:24 PM
You are welcome BBKing. I am glad you like it.
Is CutePHP integrated with your forum and sharing the same database?
No, main index news is different than the forum news :)
Hey Marc,
I was able to apply the first part of your post with no issues, and it worked flawlessly.
Now, for the latest 2 that you put up (in regards to showing the number of users in chat), I am not seeing any changes. Any thoughts?
Thanks!
I need more info. Did you do everything and got no errors? Were you able to follow all instructions? Does the board show any errors? Are you aware of the fact that if you used the second code option you will NOT see anything until you actuall have one user in the chat and you ALSO view another page at the same time (a page that is NOT the chat page)? Are you on RC1?
I found out what I did. I happened to morono-size it :)
Great Tip/Trick yet again!!!
Thanks!
I don't know what you mean by morono-size it but I am glad you got it working
Hi marcnyc,
Thank you for taking time to write up this nice instruction. I just read through and notice it does not take care the part that Flashchat and SMF share the same user login interface, and authentication. Or is it really in there and I did not see that?
Thanks,
Dennis
Dennis to avoid redundancy I have not posted the instructions that are already inside the package distributed by the software manufacturer. Once you have installed the chat and followed his instructions your chat's backend will be integrated. My additional integration is only on the graphical side.
There is no documentation provided with the package for integrating it with smf, though if you look at the one for IPB and do the same (obviously uncommenting the line for SMF not IPB) it will work.
ok the first part went without any probelms at all, but when I add the users online the page wont load at all it just imes out. The line of code you posted is in a different ocntext than what I have on my template this is what I have.
<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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), '</a><br />
Thanks in advance for any help
Anything that needs to be changed in RC2?
Nope.
Well i get a parse error in my index.template :(
Worked fine for me, what was the error?
line 634:
?>
So puzzled!!
ahh fixed it, didnt like the { after echo... maybe just my template!
Is there a way to make the chat room show the users visible name rather then their log in?
No idea, have only had a quick glance at it thus far, I imagine you just need to edit the cmssmf or whatever it's called file to select the realname rather than username.
Great stuff for sure though, and only a few quid :)
Quote from: Ben_S on October 16, 2004, 09:01:49 AM
There is no documentation provided with the package for integrating it with smf, though if you look at the one for IPB and do the same (obviously uncommenting the line for SMF not IPB) it will work.
Actually there is, but for some strange reason it is in one of the subfolders. I too first thought there wasn't but then I found it. Just look in ALL subfolders and you'll find it, I promise!
Quote from: James Woodcock on October 17, 2004, 01:45:28 PM
Is there a way to make the chat room show the users visible name rather then their log in?
I think this would be a great alteration, anyone figued out how to do it yet? Im guessing it is done via the smf cms mod?
Ahhh Steve my programmer has done it, if you want it to display the visible name instead of the user name ie: James Woodcock instead of GlideM then:
In file >>> FlashChat\inc\cmses\smfCMS.php
Find:
function SMFCMS() {
$this->loginStmt = new Statement("SELECT ID_MEMBER as id, memberName AS login, passwd, is_activated from {$GLOBALS['db_prefix']}members WHERE memberName=? AND passwd=?");
$this->getUserStmt = new Statement("SELECT ID_MEMBER AS id, memberName AS login, ID_GROUP as status FROM {$GLOBALS['db_prefix']}members WHERE ID_MEMBER=?");
$this->getUsersStmt = new Statement("SELECT ID_MEMBER as id, memberName as login FROM {$GLOBALS['db_prefix']}members");
Replace:
function SMFCMS() {
$this->loginStmt = new Statement("SELECT ID_MEMBER as id, memberName AS login, passwd, is_activated from {$GLOBALS['db_prefix']}members WHERE memberName=? AND passwd=?");
$this->getUserStmt = new Statement("SELECT ID_MEMBER AS id, realName AS login, ID_GROUP as status FROM {$GLOBALS['db_prefix']}members WHERE ID_MEMBER=?");
$this->getUsersStmt = new Statement("SELECT ID_MEMBER as id, realName as login FROM {$GLOBALS['db_prefix']}members");
Best chat integration! Thanks!!
you're welcome ;-)
Quote from: marcnyc on October 20, 2004, 08:26:24 PM
you're welcome ;-)
Integration went smoothly. This chatroom is the bomb. Thanks for the tutorial!
Awesome to hear this, ESPECIALLY when it comes from a supposingly talented and php-experienced charter member that I am sure could have come up with it too easier than I did with my limited knowledge
It doewsnt allow äö etc in nicknames. How can i fix that?
I am sorry, I can't answer this. You'll have to take this on up with the developer.
Ok. In firefox that iframe shows scrollbars in both ways. I cant get rid of those.
Idea, if user is chatting action=chat , that would be nice if it shows in whosonline list. Anyone want make mod for this?
Add to Modifications.finnish.php:
$txt['whoall_chat'] = 'Chatting!';
Off hand... I think that should work ;).
-[Unknown]
Nope, didnt work :)
I like this chat more than any flashchat http://123flashchat.com/
Quote from: babylonking on October 21, 2004, 07:15:32 PM
I like this chat more than any flashchat http://123flashchat.com/
Looks ok, well if you have deep pockets.
Quote from: Owdy on October 21, 2004, 01:04:04 PM
It doewsnt allow äö etc in nicknames. How can i fix that?
smfcms.php
find:
function getUserProfile($userid) {
if ($userid == SPY_USERID) $rv = NULL;
elseif ($user = $this->getUser($userid)) {
$rv = $GLOBALS['boardurl'] . "/index.php?action=profile;u=".$userid;
}
return $rv;
}
function getUser($userid) {
$rv = NULL;
if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {
$rec['roles'] = $this->getRoles($rec['status']);
$rv = $rec;
}
return $rv;
}
replace:
function getUserProfile($userid) {
if ($userid == SPY_USERID) $rv = NULL;
elseif ($user = $this->getUser($userid)) {
$rv = $GLOBALS['boardurl'] . "/index.php?action=profile;u=".$userid;
}
return $rv;
}
function latin12utf8( $latin1 ) {
// translates these characters from latin-1/iso 8859-1 to UTF-8/Unicode
$replacements = array( 'å' => 'Ã¥',
'ä' => 'ä',
'æ' => 'æ',
'ö' => 'ö',
'ø' => 'ø',
'Å' => 'Ã...',
'Ä' => 'Ã,,',
'Æ' => 'Æ',
'Ö' => 'Ö',
'Ø' => 'Ø',
'é' => 'é',
'è' => 'è',
'ê' => 'ê',
'â' => 'â',
'ü' => 'ü',
'ß' => 'ß');
return strtr($latin1, $replacements);
}
function getUser($userid) {
$rv = NULL;
if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {
$rec['roles'] = $this->getRoles($rec['status']);
$rec['login'] = $this->latin12utf8( $rec['login'] );
$rv = $rec;
}
return $rv;
}
Thanks Owdy.
Now, if somebody still found the way to get rooms only for certain groups... rooms behind passwords or so. I have understood that this would not be possible - yet.
Its not my code, but welcome ;)
';
$chatrequest = db_query("
SELECT COUNT(*) AS numb
FROM 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 = " on ";
$singularplural2 = "jäsen";
} else {
$singularplural1 = " on";
$singularplural2 = "jäsentä";
}
if (!$context['user']['is_guest'])
echo ' <font size="-2" >' . $chatcount . ' '.$singularplural2.' chattäilemässä.</font><br>
';
I use that so guests cant see that notise. How to change that so it wont sho nothing if chat is empty?
You forgot to read the addition I made, right after the code you copied, you simply have to put the echo statement inside an if statement that checks whether the variable $chatcount is different than zero.
Basically your last three lines of code:
if (!$context['user']['is_guest'])
echo ' <font size="-2" >' . $chatcount . ' '.$singularplural2.' chattäilemässä.</font><br>
';
have to be replaced with these ones:
if (!$context['user']['is_guest'] || $chatcount != 0 )
echo ' <font size="-2" >' . $chatcount . ' '.$singularplural2.' chattäilemässä.</font><br>
';
I have simply added "|| $chatcount != 0" which means "or if $chatcount is different than zero".
Hope this helps.
It wont work. Guest see that notise.
Do you know how to get rid og those scrollbars in Firefox? I mean from that ifarme?
Are you saying it doesn't work?
I am assuming your code (to hide the notice to guests) works because I didn't test it.
IF your code works then I don't see why checking for the value $chatcount wouldn't work (I had tested this and it does work).
This:
if (!$context['user']['is_guest'] )
echo ' <font size="-2" >' . $chatcount . ' '.$singularplural2.' chattäilemässä.</font><br>
';
is assumed to hide the notice to guests. Right? Does it work?
If it works and you want to hide the notice to guests AND registered-users in case the chat is empty then you have to use:
if (!$context['user']['is_guest'] || $chatcount != 0 )
echo ' <font size="-2" >' . $chatcount . ' '.$singularplural2.' chattäilemässä.</font><br>
';
I dont want guests to see that at all. Not if theres users or not. :)
Then the problem is in your code, not in mine.
Sorry but I don't have time to test your code now (i have a deadline on another project) but you'll just have to find which one is the variable/array to check if a user is a user or a guest.
One of the developers that is familiar with the internal structure of SMF should be able to tell you off hand.
Quote from: marcnyc on October 23, 2004, 03:35:23 PM
Then the problem is in your code, not in mine.
Exactly ;)
Any idea how to ad page title without modifying sources?
great chat thx
will be very useful look not only number of user but name of user in chat will be possible ?
This would be cool ad on in this mod http://tufat.com/phpBB2/viewtopic.php?p=10449#10449
somebody is able to explain how do this ?
all solved thanx
If you figured it out please post the solution so everybody can benefit from it or PM me the solution and I will add it to my tutorial.
i only solved the chat as u wrote not more...
there is only one problem number of users in chat is always the same and not change
where is the problem ?
if you followed the instructions I doubt the number can always be the same... Make sure you are not viewing cached pages (clear your cache)
How to ad list of users who are in chat
In /FlashChat/info.php, find:
<html>
<title>Who's in the chat?</title>
<head>
<style type="text/css">
<!--
.normal {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
}
A {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #0000FF;
}
A:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FF0000;
}
-->
</style>
</head>
<body>
<center>
<p class=normal>There are <?=numusers()?> users in <?=$roomnumb?> rooms.</p>
<?php if($roomnumb) { ?>
<table border="1" cellpadding="1" class="normal">
<tr>
<th>ID</th>
<th>Name</th>
<th>Count</th>
<th>Users</th>
</tr>
<?php foreach($rooms as $room) { ?>
<tr>
<td><?=$room['id']?></td>
<td><?=$room['name']?></td>
<td><?=numusers($room['id'])?></td>
<td><?php
$users = usersinroom($room['id']);
foreach( $users as $user ) {
echo $user['login'] . "<br>";
}
?> </td>
</tr>
<?php } ?>
</table>
<?php } ?>
<p><a href="javascript:window.close()">Close</a></p>
<center>
</body>
</html>
Replace:
<span style="font-size:xx-small;color:#0232a1">
<?php
$users = usersinroom($room['id']);
foreach( $users as $user ) {
echo $user['login'] . ",";
}
?></span>
then ad this in index.template.php:
<td colspan="2">
';
if ($context['user']['is_logged'])
echo '
<font size="-2">Users in chat:</font> ';
if ($context['user']['is_logged'])
{
readfile("http://www.example.com/FlashChat/info.php");
}
echo '
</td>
With this code only logged users see that list. Code may be crappy (PHP N00b here), but it works.
work perfectly thanx
look: http://www.forumzoneru.18.com1.ru/index.php
I am having troubles with the integration :( The Chat worked fine when I tested it before integration, but when I un comment the include SMF line(common.php), it does not work at all. It will start loading (the white page with the %'s) and then a screen with the backgrtound shows up like before it shows the chat rooms and stuff. but it just sits there. . .
is that 'only' cms line what is uncommented?
Read and follow those instructions: ;)
SimpleMachines.txt
***********************************************
SIMPLE MACHINES FORUM INTEGRATION FOR FLASHCHAT
***********************************************
This file describes the steps required to integrate FlashChat into a Simple Machines (henceforth referred as SMF) installation. The normal installation procedure, as described in the FlashChat readme.txt file, does NOT apply in this case.
YOU MUST FOLLOW THESE STEPS PRECISELY!
STEP 1:
Open the "common.php" file within the "inc" folder of your FlashChat distribution, and make sure that "smfCMS.php" is the ONLY uncommented line relating to CMS integration. I recommend that you use TextPad (www.textpad.com) as your plain text editor - NOT Windows Notepad or WordPad.
Thus, the common.php file will have something similar to this:
//include_once(INC_DIR . 'cmses/statelessCMS.php');
//include_once(INC_DIR . 'cmses/defaultCMS.php');
//include_once(INC_DIR . 'cmses/phpNukeModCMS.php');//module version
//include_once(INC_DIR . 'cmses/phpNukeCMS.php');//stand-alone version
//include_once(INC_DIR . 'cmses/postNukeModCMS.php');//module version
//include_once(INC_DIR . 'cmses/postNukeCMS.php');//stand-alone version
//include_once(INC_DIR . 'cmses/xoopsCMS.php');
//include_once(INC_DIR . 'cmses/phpBB2CMS.php');
//include_once(INC_DIR . 'cmses/geeklogCMS.php');
//include_once(INC_DIR . 'cmses/vbulletinCMS.php');
//include_once(INC_DIR . 'cmses/xmbCMS.php');
//include_once(INC_DIR . 'cmses/mamboCMS.php');
//include_once(INC_DIR . 'cmses/e107CMS.php');
//include_once(INC_DIR . 'cmses/ipbCMS.php');
//include_once(INC_DIR . 'cmses/moodleCMS.php');
include_once(INC_DIR . 'cmses/smfCMS.php');
//include_once(INC_DIR . 'cmses/lunabyteCMS.php');
//include_once(INC_DIR . 'cmses/fusionCMS.php');
//include_once(INC_DIR . 'cmses/wowCMS.php');
//include_once(INC_DIR . 'cmses/azdgCMS.php');
//---
//include_once(INC_DIR . 'cmses/defaultUsrExtCMS.php');
//---
Thus, "//" appears before all the CMS references EXCEPT for the smfCMS.php reference. Double slashes are how programmers "comment-out" a line, thus deactivating it.
STEP 2:
On your web server, create a new folder called "FlashChat" as a sub-folder of the SMF directory (the directory that contains SMF's index.php file). Copy all of the files in the "chat" folder from your FlashChat download to the newly created FlashChat directory.
In other words, you should now have a folder called "FlashChat" which resides in the SMF directory, and within the "FlashChat" directory you have the actual FlashChat files... for example:
.../upload/FlashChat/index.php
.../upload/FlashChat/install.php
.../upload/FlashChat/inc/
.../upload/FlashChat/sql/
.../upload/FlashChat/templates/
...etc for other files in the "chat" folder of your FlashChat distribution.
CHMOD the /FlashChat/inc/config.srv.php file to a world-writable format, like 777. This will ensure that the FlashChat installer can write configuration data to the config.srv.php file. If you are unsure of how to do this, please contact your website administrator. You may change this file's permissions to a read-only format after installation. CHMOD 777 the appdata/appTime.txt file too.
STEP 3:
Using your web browser, open the ./FlashChat/install.php file, and accept the provided values. These values will probably look familiar to you since they should draw from your current SMF configuration. If the values do not look familiar, then go back to steps 1-3 and make sure that you have done those steps correctly.
If the values are correct, submit the form to create database tables that are required for FlashChat.
STEP 4:
Go back to the the SMF folder on your web server
Go to 'Themes/default' directory.
Open index.template.php, and find the following text:
else
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>';
Replace it with:
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>';
}
Be very careful that you paste this text correctly, since this is a very easy place to introduce PHP syntax errors, which could make your SMF setup to stop running. Be sure to get both of the curly braces, too! { and }
STEP 5:
Go to the 'Themes/default/images' directory, and upload the provided 'chat_icon.gif' file (this is in the FlashChat distribution, and has been designed to looks like other icons in the SMF default template).
Note: Steps 4 and 5 apply ONLY to the 'default' theme. The procedure for other themes should be very similar. The chat_icon.gif file has only been created for the default template, so you may need to use an image editor like Photoshop to create the 'chat' icon for other templates.
STEP 6:
Close all instances of your web browser.
Then, restart your browser, and open the SMF main page - upon logging in, you'll see the FlashChat link in the button bar, next to the "Profile" button. Logging in as a standard SMF user will now auto-login to FlashChat, and logging into SMF as an admin or moderator will auto-login to FlashChat as a chat moderator.
If you notice any errors in these steps, or have any suggestions for improvement, please post a message on the TUFaT.com support forum, located at http://www.tufat.com
Thank you for using FlashChat!
Quote from: mytos on October 31, 2004, 02:51:54 PM
Hi look in your demo and see a nice webcam / voice funktion how to add enable this ?
/Mytos
I belive BBK isnt using this chat ap anymore: http://www.simplemachines.org/community/index.php?topic=17856.msg151716#msg151716
http://www.raclan.org/forums
I have followed those instructions /FlashChat/flashchat.php does not work alot with http://www.raclan.org/forums/index.php?action=chat
//include_once(INC_DIR . 'cmses/statelessCMS.php');
//include_once(INC_DIR . 'cmses/defaultCMS.php');
//include_once(INC_DIR . 'cmses/phpNukeModCMS.php');//module version
//include_once(INC_DIR . 'cmses/phpNukeCMS.php');//stand-alone version
//include_once(INC_DIR . 'cmses/postNukeModCMS.php');//module version
//include_once(INC_DIR . 'cmses/postNukeCMS.php');//stand-alone version
//include_once(INC_DIR . 'cmses/xoopsCMS.php');
//include_once(INC_DIR . 'cmses/phpBB2CMS.php');
//include_once(INC_DIR . 'cmses/geeklogCMS.php');
//include_once(INC_DIR . 'cmses/vbulletinCMS.php');
//include_once(INC_DIR . 'cmses/xmbCMS.php');
//include_once(INC_DIR . 'cmses/mamboCMS.php');
//include_once(INC_DIR . 'cmses/e107CMS.php');
//include_once(INC_DIR . 'cmses/ipbCMS.php');
//include_once(INC_DIR . 'cmses/moodleCMS.php');
include_once(INC_DIR . 'cmses/smfCMS.php');
//include_once(INC_DIR . 'cmses/lunabyteCMS.php');
//include_once(INC_DIR . 'cmses/fusionCMS.php');
//include_once(INC_DIR . 'cmses/wowCMS.php');
//include_once(INC_DIR . 'cmses/azdgCMS.php');
//---
//include_once(INC_DIR . 'cmses/defaultUsrExtCMS.php');
//---
is my CMS Section :S
I am going to try and install it again.
Maybe you should ask from there: http://tufat.com/phpBB2/
I tried the installer2.php since I had common.php and all the already edited like it said. in step 3 the values for the mysql were not already set. so I tried the installer2.php and it worked :) This is a gr8 tutorial.
Quote from: Owdy on October 31, 2004, 12:27:21 PM
How to ad list of users who are in chat
In /FlashChat/info.php, find:
<html>
<title>Who's in the chat?</title>
<head>
<style type="text/css">
<!--
.normal {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
}
A {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #0000FF;
}
A:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FF0000;
}
-->
</style>
</head>
<body>
<center>
<p class=normal>There are <?=numusers()?> users in <?=$roomnumb?> rooms.</p>
<?php if($roomnumb) { ?>
<table border="1" cellpadding="1" class="normal">
<tr>
<th>ID</th>
<th>Name</th>
<th>Count</th>
<th>Users</th>
</tr>
<?php foreach($rooms as $room) { ?>
<tr>
<td><?=$room['id']?></td>
<td><?=$room['name']?></td>
<td><?=numusers($room['id'])?></td>
<td><?php
$users = usersinroom($room['id']);
foreach( $users as $user ) {
echo $user['login'] . "<br>";
}
?> </td>
</tr>
<?php } ?>
</table>
<?php } ?>
<p><a href="javascript:window.close()">Close</a></p>
<center>
</body>
</html>
Replace:
<span style="font-size:xx-small;color:#0232a1">
<?php
$users = usersinroom($room['id']);
foreach( $users as $user ) {
echo $user['login'] . ",";
}
?></span>
then ad this in index.template.php:
<td colspan="2">
';
if ($context['user']['is_logged'])
echo '
<font size="-2">Users in chat:</font> ';
if ($context['user']['is_logged'])
{
readfile("http://www.example.com/FlashChat/info.php");
}
echo '
</td>
With this code only logged users see that list. Code may be crappy (PHP N00b here), but it works.
hmmm...well when i go and make the change to index.template.php, I get the following error on my website:
---------
Parse error: parse error, unexpected '<' in /home/dgreek/detroitgreeks.com/html/forum/Sources/Load.php(1098) : eval()'d code on line 522
Warning: Cannot add header information - headers already sent by (output started at /home/dgreek/detroitgreeks.com/html/index.php:3) in /home/dgreek/detroitgreeks.com/html/forum/Sources/Load.php on line 1120
Warning: Cannot add header information - headers already sent by (output started at /home/dgreek/detroitgreeks.com/html/index.php:3) in /home/dgreek/detroitgreeks.com/html/forum/Sources/Load.php on line 1121
Warning: Cannot add header information - headers already sent by (output started at /home/dgreek/detroitgreeks.com/html/index.php:3) in /home/dgreek/detroitgreeks.com/html/forum/Sources/Load.php on line 1122
Template Parse Error!
There was a problem loading the /Themes/default/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.
You may want to try to refresh this page or use the default theme.
----
Any thoughts?
Its in wrong place then. Try put this only
readfile("http://www.example.com/FlashChat/info.php");
Quote from: Owdy on October 31, 2004, 12:27:21 PM
How to ad list of users who are in chat
In /FlashChat/info.php, find:
<html>
<title>Who's in the chat?</title>
<head>
<style type="text/css">
<!--
.normal {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
}
A {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #0000FF;
}
A:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FF0000;
}
-->
</style>
</head>
<body>
<center>
<p class=normal>There are <?=numusers()?> users in <?=$roomnumb?> rooms.</p>
<?php if($roomnumb) { ?>
<table border="1" cellpadding="1" class="normal">
<tr>
<th>ID</th>
<th>Name</th>
<th>Count</th>
<th>Users</th>
</tr>
<?php foreach($rooms as $room) { ?>
<tr>
<td><?=$room['id']?></td>
<td><?=$room['name']?></td>
<td><?=numusers($room['id'])?></td>
<td><?php
$users = usersinroom($room['id']);
foreach( $users as $user ) {
echo $user['login'] . "<br>";
}
?> </td>
</tr>
<?php } ?>
</table>
<?php } ?>
<p><a href="javascript:window.close()">Close</a></p>
<center>
</body>
</html>
Replace:
<span style="font-size:xx-small;color:#0232a1">
<?php
$users = usersinroom($room['id']);
foreach( $users as $user ) {
echo $user['login'] . ",";
}
?></span>
then ad this in index.template.php:
<td colspan="2">
';
if ($context['user']['is_logged'])
echo '
<font size="-2">Users in chat:</font> ';
if ($context['user']['is_logged'])
{
readfile("http://www.example.com/FlashChat/info.php");
}
echo '
</td>
With this code only logged users see that list. Code may be crappy (PHP N00b here), but it works.
this method work perfectly
I see where I went wrong originally...I forgot to add the 'forum' subdirectory (where I have installed FlashChat). But even now I'm still getting this:
--------
Template Parse Error!
There was a problem loading the /Themes/default/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.
You may want to try to refresh this page or use the default theme.
--------
>:( >:( What am I doing wrong??
I'm having the same problem when I edit the template file. It gets a parse error.
I have made several changes to my boardindex.template.php to add a chat stats area to the main stats section of my board. It works perfect until I try to add users online then the page wont load.
This is my code to get the chat stats area in the stats area
// Chat Stats
$chatrequest = db_query("
SELECT COUNT(*) AS numb
FROM dsnewfor_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'
<tr>
<td class="catbg" colspan="2">', $txt['chatStats'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<img src="', $settings['images_url'], '/chatIcon.gif" alt="', $txt['chatAlt'], '" border="0" /></a>
</td>
<td class="windowbg2" width="100%">
Currently there ' . $singularplural1 . ' <font color="#FF0000">' . $chatcount . ' User'.$singularplural2.' in the Chat!</font><br>';
}
Can someone help?
Thanks
I got it working :)
Here is my code maybe this will help others that are using the classic template
// Chat Stats
$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'
<tr>
<td class="catbg" colspan="2">', $txt['chatStats'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=chat">
<img src="', $settings['images_url'], '/chatIcon.gif" alt="', $txt['chatAlt'], '" border="0" /></a>
</td>
<td class="windowbg2" width="100%">
Currently there ' . $singularplural1 . ' <font color="#FF0000">' . $chatcount . ' User'.$singularplural2.' in the Chat!</font><br>';
if ($context['user']['is_logged'])
echo '
<font size="-2">Users in chat:</font> ';
if ($context['user']['is_logged'])
{
readfile("http://www.mysite.com/yabbse/Flashchat/info.php");
}
}
Quote from: marcnyc on October 09, 2004, 07:21:56 AM
I couldn't deal with how slow Java chats are
what java chat server (own deamon) is slower as a flash chat with php mysql as backend?
mediman
This isn't the right forum of course, but anyone had any luck with skinning this? I've followed their instructions and everything loads great for me, but regular users seem to be loading a different gradient set and colors. I've verified both files appear correct. Just thought I'd see if anyone else had similar experiences...
Regards,
Jason
Quote from: Owdy on October 21, 2004, 01:04:04 PM
It doewsnt allow äö etc in nicknames. How can i fix that?
I had the same problem when I bought it and installed it yesterday. It wont allow ø,æ and å in usernames, just shows gibberish there. But there is a solution posted on the FlashChat board - with some modifications though:
Open up
FlashChat/inc/cmses/smfCMS.php and add the things in red : (mind you , these are my needs..look below for a list of more special charachters.)
function getUser($userid) {
$rv = NULL;
if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {
$rec['roles'] = $this->getRoles($rec['status']);
$rec['login'] = str_replace('å', 'Ã¥', $rec['login']);
$rec['login'] = str_replace('ø', 'ø', $rec['login']);
$rec['login'] = str_replace('æ', 'æ', $rec['login']);
$rec['login'] = str_replace('Å', 'Ã...', $rec['login']);
$rec['login'] = str_replace('Ø', 'Ø', $rec['login']);
$rec['login'] = str_replace('Æ', 'Æ', $rec['login']);
$rv = $rec;
}
return $rv;
}Here are more charachters...
'å' => 'Ã¥',
'ä' => 'ä',
'æ' => 'æ',
'ö' => 'ö',
'ø' => 'ø',
'Å' => 'Ã...',
'Ä' => 'Ã,,',
'Æ' => 'Æ',
'Ö' => 'Ö',
'Ø' => 'Ø',
'é' => 'é',
'è' => 'è',
'ü' => 'ü',
'ß' => 'ß',
'ù' => 'ù',
'ì' => 'ì',
'à' => 'Ã ',
'ò' => 'ò');
Does anyone know if it is possible to turn off the chat login and allow members that are logged into the forum just go back and forth between forum and chat without having to log in everytime. I understand that is the way it is supposed to work, but every time I press the chat link and after it loads it says "Incorrect user name or password"
Thank you,
Brian
If you have followed the instructions to integrate with SMF, it should login automatically - even if you type in the direct adress. It reads the cookie just like SMF.
Bloc,
Here is what I mean about my code being deferant from the example.
The example says to find this:
<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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' .
$txt['hidden'] . ')'), '</a><br />
But my file has this
'<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 />
<span class="smalltext">';
What do I do with this?
: '', $context['show_who'] ? '</a>' : '', '<br />
<span class="smalltext">';
Thank you for your help.
Brian
Um, I am guessing you want to put in number of users on the chat.... whats the chunk of code for that?
the last bit of code you have trouble with - the context['show_who'] - is that the FlashChat code or some other mod?
I am not sure, I do not really have any mods exceot for one that Unknown gave me for searching members by location. I guess I can always remove it and see what if anything changes.
Brian
Dont do that. I just wondered what it was. The code for showing users in the chat can be added without replacing that whole section. :)
Bloc, I still need help. The problem with my autologin was apparently my browser or something else with my laptop. My desktop worked just fine. However I can not get the code above to work. I have tried adding several differant ways and I always get a parse error. Could you look at it anf give me some ideas as to what to change.
Thank you,
Brian
Sure. But I need to see your files first. I am not sure what you have done or not done.
After doing all the work...
I must say: really really great! 8)
Thanx a lot for this nice implementation.
My fresh experience on some problems:
I use it with the classic-theme and SMF beta 5.The chat-logo in index.template.phpthe incorrect tutorial on trufat.com http://www.easterpig.com/demo/flashchat/integration/smf.html cost me the most time. i had to remove a "{" and change the arrangement, because otherwise i had problems with the seperators, so my end of the skript looks like this:
// Otherwise, they might want to [logout]...
else
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>', $context['menu_separator'];
echo '<a href="', $scripturl, '?action=chat">',
($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
. '/' . $context['user']['language'] . '/chat_icon.gif" alt="' . $txt[108]
. '" style="margin: 2px 0;" border="0" />' : $txt[108]),'</a>';
}
?>
and added a
, $context['menu_separator']
after
<a href="', $scripturl, '?action=register">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/register.gif" alt="' . $txt[97] . '" border="0" />' : $txt[97]), '</a>'
.
And now i have the same problems like bbayliss with the SUB-TUTORIAL #1
Quote from: bbayliss on November 21, 2004, 04:47:17 AM
Bloc,
Here is what I mean about my code being deferant from the example.
The example says to find this:
<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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' .
$txt['hidden'] . ')'), '</a><br />
But my file has this
'<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 />
<span class="smalltext">';
What do I do with this?
: '', $context['show_who'] ? '</a>' : '', '<br />
<span class="smalltext">';
Thank you for your help.
Brian
I've not enough experience with PHP, so i did not make it, to get the
, ' . $chatcount . ' User'.$singularplural2.' in Chat
in the right place between it.
Would be great if u can help
Anyway the Chat.template is a brilliant idea!
greets frm germany
garfield
How can i ad title tag in that chat/template?
just followed the tutorial of marcnyc to the letter and it works perfectly - just a doubt though - when I log out of the chat window up pops a login dialog box on top of the main chat window. If i try to close this popup nothing happens.
To shut both this popup and close the main chat window (which shows as a big blank grey rectangle ) I have to hit any nav button - for example Home .
Is this normal or have I missed something?
Thanks
/Mexie
Quote from: charlottezweb on November 17, 2004, 10:03:55 PM
This isn't the right forum of course, but anyone had any luck with skinning this? I've followed their instructions and everything loads great for me, but regular users seem to be loading a different gradient set and colors. I've verified both files appear correct. Just thought I'd see if anyone else had similar experiences...
Regards,
Jason
Jason,
You can't give the users an option to have anything else but the default.
It took me a while, but I've got it down on my site. The only color I can't figure out is where the user names are listed. The box itself is one color, but the background for every line that has a username is changed to an electric blue.
Check it out if you want...you'll need a forum account though...and excue the mess on the homepage...renovations still ;)
Quote from: Owdy on December 05, 2004, 01:04:39 PM
How can i ad title tag in that chat/template?
Owdy this stumped me at first, I have been trying to do it since I added the page. I just made a link that made a new window with javascript to the flashchat file isntead, but after I found out how to add the title. (I kept the popup instead though)
Here is how I did it:
Open Sources/Chat.phpFind:function Chat() {
Add After:(on a new line)global $context;
$context['page_title'] = 'Chat';
Quote from: marcnyc on October 09, 2004, 07:21:56 AM
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.0 RC1; 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="450" src="http://www.yourserver.com/smf/FlashChat/flashchat.php"></iframe>';
echo '
</td>
</tr>
</table>
</form>';
}
?>
6. save this file inside /smf/Themes/default/
There is lots of unnessessery (like search form and JS) stuff. This is enough:
<?php
// Chat template
function template_main()
{
global $context, $settings, $options, $txt, $scripturl;
echo '
<table width="80%" border="0" cellspacing="0" cellpadding="3" >
<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="450" src="http://www.yourserver.com/smf/FlashChat/flashchat.php"></iframe>';
echo '
</td>
</tr>
</table>
';
}
?>
I want to put up who is in the chat with the names linking to the smf profile on my homepage (not smf page). Can someone help me out? I am currently just including the info.php file. Thanks.
How to download?
I need Flash Chat!
Quote from: ThaiAnime on January 01, 2005, 01:25:58 AM
How to download?
I need Flash Chat!
ThaiAnime,
You can find it at http://www.tufat.com/
Does anyone know how I could put the chat link in the menu bar of MKportal?
This is what I have in index_template.php (as per step 8 of marcnyc's tutorial):
<a href="', $scripturl, '?action=chat">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/chat_icon.gif" alt="FlashChat" border="0" />' : "FlashChat"),'</a>';
And this is what MKportal uses to link to it's own Chat module:
$row_link .= $Skin->row_link("$this->images/atb_chat.gif", "href='$this->siteurl/index.php?ind=chat' target='_new'", $this->lang['chat']);
btw the integration and Users in Chat worked beautifully :)
href='$this->siteurl/index.php?ind=chat' target='_new'
Change that to be whatever the URL to your forum is + ?action=chat... ie.
href='http://www.simplemachines.org/community/index.php?action=chat' target='_new'
-[Unknown]
That worked... nearly. The chat was inside the portal, but the whole thing opened in a new window. I tried changing target='_new' to target='_parent' and it worked!
Thanks very much for your help [Unknown].
btw SMF is absolutely wonderful :)
I just found this thread after painstakingly trying and failing to use the Integrated Chat Mod. I'm sure it's a good Mod, I had lots of problems with it for some reason.
Anyway, I just wanted to say Wow! and Thank you! to marcnyc for the heads up on FlashChat and writing out how to embed it into your SMF forum. I got it all up and running on my forum in less that a half hour.
I haven't added the "users chatting" stat yet but everything else worked like a charm!
Now I just hope this program doesn't eat bandwidth and use up lots of resources! :P
It seems to be light on bandwidth, but very heavy on resources.
Quote from: DLD on November 13, 2004, 12:11:20 AM
// Chat Stats
$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'
<tr>
<td class="catbg" colspan="2">', $txt['chatStats'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=chat">
<img src="', $settings['images_url'], '/chatIcon.gif" alt="', $txt['chatAlt'], '" border="0" /></a>
</td>
<td class="windowbg2" width="100%">
Currently there ' . $singularplural1 . ' <font color="#FF0000">' . $chatcount . ' User'.$singularplural2.' in the Chat!</font><br>';
if ($context['user']['is_logged'])
echo '
<font size="-2">Users in chat:</font> ';
if ($context['user']['is_logged'])
{
readfile("http://www.mysite.com/yabbse/Flashchat/info.php");
}
}
How can i add this to ssi?
how can i let guest join the chat???
FlasChat has own support forum. Maybe you should ask there?
http://tufat.com/phpBB2/index.php
Nice one people, all the help here installed it no problem....
Some people have commented about getting logged out if they leave it open for a while (30 minutes or so)
I've checked the config and it seems to be set to 24hrs (24 x 60 x 60) ???
oh well minor worry
Quote from: LiL_J on January 10, 2005, 10:59:47 PM
how can i let guest join the chat???
This what i am trying to have in my integrated chat, I hope the next chat version will allow guest to chat.
QuoteIt seems to be light on bandwidth, but very heavy on resources.
How heavy is "VERY HEAVY"??
I have this chat mod, but haven't installed it on my live server because my host doesn't allow chat's[ except the ones you can install via cpanel/fantastico] for this reason.
nice going!
just a question though.... is there a possibility to make it so that if a user is in chat (but not active on the boards for 15 min...etc) that they still appear online on the message boards who's online area?
the reason is that if a user is idle on the board, they are dropped from the who's online list, but they are still active in chat.
Also, would it be possible that when you click the who's online (and it displays what the user is doing) that it could display "User is chatting" or something like that?
thanks,
†B†V†
This is awsome...
I used to use Goosemoose's chat mod before converting to SMF. But I think I'll try this out. Maybe by using this I can figure out to intergrate my flash movie episodes into flash.
:P
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>
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.
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]
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
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.
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]
No, trying to include http://example.com/FlashChat/flashchat.php
Quote from: Owdy on January 31, 2005, 03:09:19 PM
No, trying to include http://example.com/FlashChat/flashchat.php
And let me guess, it's including Load.php, isn't it? It mustn't.
-[Unknown]
http://www.simplemachines.org/community/index.php?topic=17856.msg146453#msg146453
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?
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?
check the buttons margin size and make sure all buttons use the same margin size . style="margin: 2px 0;"
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†
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
i make it today...
wonderful...
i translated to italian the phrases for users... ;)
very nice...
You are very welcome! ;-)
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
<?php @include('http://www.whatever.net/forum/FlashChat/info.php'); ?>
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
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>
:)
Quote from: jay_nasty on February 19, 2005, 07:30:36 PM
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
I get the exact same error...
-Xarcell
I got it to work, instead of adding it all, I just added
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>';
right under "else"
-Xarcell
Ok, I got the chat working, but then I took the next step and tried to get it "within" the forums using the info from the tutorial. For some reason teh page won't load. I checked my chat.template to make sure the url us correct. It is because I can direct link to it. the action=chat seem to be working just fine, I just get a 404 error within the iframe.
What else could it be?
-Xarcell
It works and works well. I just redid the chat.template file and bling, it appeared.
I also tried something else. I posted that iframe in the "static page mod".
Looks a tad cleaner....
-Xarcell
Pheasant Plucker and Owdy (or anybody who can do PHP better than I :) ):
I used PP's "Who's Online" tip a few posts up, and it's working great...but is there a way to preface the list of names with "Who's Chatting:"?? All I'm getting now is a list of names without any sort of info about what it means...I'm sure it's an easy fix but I'm not handy enough with coding to figure it out, so any help would be much appreciated...
You can include Flash chats info.php in SMF's Boardindex.template.php
Ahhh, I figured out how to do what I wanted. Very easy indeed. Thanks!
How could I integrate FlashChat ONTO the index of my forum? Like, I want the FlashChat on top, then the forum boards below. Any ideas?
Maybe some weird frames bubblegum thingy?
there's a problem with this...
(someone on the flashchat forums asked, essentially the same thing. They wanted to use the flashchat as an enhanced shoutbox)
SMF, as standard, reloads the whole page each time a new page is called. I have not yet seen it run in an iframe environent.
If you just icnlude the flashchat window in a frame above the SMF forum, then each time someone goes to a page in SMF, they will be logged out and logged back in to flashchat.
Flashchat is a CHAT program... not a shoutbox.
if you want a shotubox, install the SMF shoutbox mod... there are even ways to take the entries from the shoutbox and import then into flashchat...
Serious, frames. Top frame flash chat, bottom frame smf. But remember, frames are devils work! :P
So no? ;_;
No, yes.
I need a little help. I installed both of the user displays, the one that shows the number of users and the one that shows the users name. The only problem I have is that on some of my pages it shows the users on the same line as the link tree. Here is the code I have
echo '
Currently there ' . $singularplural1 . ' <font color="#FF0000">' . $chatcount . ' User'.$singularplural2.' in the Chat </font>';
include ('http://www.mopartruckworld.com/forum/chat/info.php');
}
Can I put a <br> in there some where? I tried many, many times but since I don't know php I didn't know where to put it. I don't even know if I can use that. I just need a way to show this info on its own line on my forum. Thanks!!
Jeff
well, you could try putting a <br /> at the start of the echo statement...
Hi marcnyc,
works just greatly smooth. I really like the message about the users currently in chat in the header. Is it possible to add a line for "users currently logged into the board" ?
Thanks a lot for the great tutorial again,
Davy-D
thanks heaps for that marcnyc, came in very handy you're a legend.
Davy-D,
The alreeady exists in the info center at the bottom of the main screen.... if you want to put it elsewhere on your screen, then open BoardIndex.template.php and copy the code for it inti index.template.php, right near where you added your chatting code.
Kindred,
thanks for that hint. I managed to edit the line as I wanted. The only problem is that I also want to make "not-logged-in" people to see how many people are signed in, chatting, and reviewing the index site.
Guest access is disabled though. The original hack from marcnyc showed the number also on the login site, my personal hack doesnt show any other number. What is the reason ?
UPDATE:
Okay, in the index page, I have now "Chatters online" and "Users in Forum" (by querying the DB table smf_log_online for the amount). But I want to list the guests which are not logged in due to restricted rights as well. How can I differentiate them ? Asked differently: why in the index page, the array $context is empty ?
UPDATE2:
Okay okay, I am stupid - but sometimes learning quickly ;). I managed to differentiate now the 2 items by matching the SQL query one time for "not-user-id-0" and one time "user-id-0". Thanks a lot for all help, thanks for this nice community forum and last but not least for SMF and mySQL.
cu,
Davy
Quote from: DLD on November 13, 2004, 12:11:20 AM
I got it working :)
Here is my code maybe this will help others that are using the classic template
// Chat Stats
$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'
<tr>
<td class="catbg" colspan="2">', $txt['chatStats'], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=chat">
<img src="', $settings['images_url'], '/chatIcon.gif" alt="', $txt['chatAlt'], '" border="0" /></a>
</td>
<td class="windowbg2" width="100%">
Currently there ' . $singularplural1 . ' <font color="#FF0000">' . $chatcount . ' User'.$singularplural2.' in the Chat!</font><br>';
if ($context['user']['is_logged'])
echo '
<font size="-2">Users in chat:</font> ';
if ($context['user']['is_logged'])
{
readfile("http://www.mysite.com/yabbse/Flashchat/info.php");
}
}
Ok this is what I used to get mine working without the parse error. Now the page displays, but I got a new error. Any help?
2: readfile(): URL file-access is disabled in the server configuration
File: /home/.abigaildryer/xarcell/veoclan.com/forum/Themes/classic/BoardIndex.template.php (eval?)
Line: 366
Flash Chat is one of the greatest chat rooms you can get :D They have a very easy one step intergration for SMF on their site.
Open index.template.php, and find the following text:
else
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>';
Replace it with:
else {
echo '<a href="', $GLOBALS['boardurl'], '/chat/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>';
}
Then, save your changes and upload the file to your server. If you use other templates besides the default template, you may have to repeat this step for each template that you use.
FlashChat comes with a small GIF file called "chat_icon.gif". Upload this file from the FlashChat root folder to the default template's "images" folder, as shown below. If you get a broken image icon after uploading this, please check the "src=..." path in the template code (above) to ensure that you have the correct path set.
Now, on the Simple Machines homepage, the new FlashChat icon will appear. Clicking on this link will open FlashChat in a new window (because of target="_blank" in the HTML that was added).
This should link to the "flashchat.php" file of FlashChat. When FlashChat loads, you should be automatically logged into the chatroom using your Simple Machines username. If you are an administrator of Simple Machines, then you will be logged into FlashChat as a moderator, which means that you can ban and boot other users.
I took me about 10 mins to intergrate it! ;D Versions I did it on: SMF 1.0.5 and FlashChat 4.1.2
The link is: http://www.tufat.com/docs/flashchat/smf.html and http://www.tufat.com/docs/flashchat/integration.html
is it possible to "limit" the possibility of chat just for members who post more the 50 messages in the forum ?
Thank you.
Quote from: charlottezweb on October 14, 2004, 09:19:33 AM
I'm worried about server loads, not really bandwidth. Either way, I've emailed the author -- we'll see what he says. :)
-Jason
Me too. Is it possible to
make a restriction. For exemple with catégories poster, or allow the chat for members who already post more than 100 reply ...
I've also installed this great chat engine.
Is it possbile to show the user's alias in FlashChat. Right now it show the user's login ID.
Anyone?
Here is a chat icon I made to use with my SMFone template. Feel free to use it if you want.
Does this program work in 1.1 Beta 4? Anything special I need to do before I install this in beta 4?
Cheers
RJ
yes, this works with 1.1 b4...
and Jinx... I have no idea why your system would do this... mine uses the display name from SMF.
Ok got it to work just fine. If only I could get a CHAT button for the YABB SE Theme...
Cheers
RJ
Quote from: Owdy on October 23, 2004, 01:38:12 PM
Quote from: Owdy on October 21, 2004, 01:04:04 PM
It doewsnt allow äö etc in nicknames. How can i fix that?
smfcms.php
find:
function getUserProfile($userid) {
if ($userid == SPY_USERID) $rv = NULL;
elseif ($user = $this->getUser($userid)) {
$rv = $GLOBALS['boardurl'] . "/index.php?action=profile;u=".$userid;
}
return $rv;
}
function getUser($userid) {
$rv = NULL;
if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {
$rec['roles'] = $this->getRoles($rec['status']);
$rv = $rec;
}
return $rv;
}
replace:
function getUserProfile($userid) {
if ($userid == SPY_USERID) $rv = NULL;
elseif ($user = $this->getUser($userid)) {
$rv = $GLOBALS['boardurl'] . "/index.php?action=profile;u=".$userid;
}
return $rv;
}
function latin12utf8( $latin1 ) {
// translates these characters from latin-1/iso 8859-1 to UTF-8/Unicode
$replacements = array( 'å' => 'Ã¥',
'ä' => 'ä',
'æ' => 'æ',
'ö' => 'ö',
'ø' => 'ø',
'Å' => 'Ã...',
'Ä' => 'Ã,,',
'Æ' => 'Æ',
'Ö' => 'Ö',
'Ø' => 'Ø',
'é' => 'é',
'è' => 'è',
'ê' => 'ê',
'â' => 'â',
'ü' => 'ü',
'ß' => 'ß');
return strtr($latin1, $replacements);
}
function getUser($userid) {
$rv = NULL;
if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {
$rec['roles'] = $this->getRoles($rec['status']);
$rec['login'] = $this->latin12utf8( $rec['login'] );
$rv = $rec;
}
return $rv;
}
That's ok, but is there the same solution for info.phpQuote<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
/**
If this file is not in the FlashChat root folder, then change this
path to the location of the inc/common.php file.
*/
include_once('inc/common.php');
ChatServer::purgeExpired();
/**
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 userid <> ? AND roomid=?");
$rs = $stmt->process(SPY_USERID, $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 userid <> ? AND ispublic IS NOT NULL
AND {$GLOBALS['fc_config']['db']['pref']}connections.roomid = {$GLOBALS['fc_config']['db']['pref']}rooms.id");
$rs = $stmt->process(SPY_USERID);
}
$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.
*/
function usersinroom( $room = "" )
{
$cms = $GLOBALS['fc_config']['cms'];
$list = array();
if($room) {
$stmt = new Statement("SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND userid <> ? AND roomid=?");
$rs = $stmt->process(SPY_USERID, $room);
} else {
$stmt = new Statement("SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND userid <> ?");
$rs = $stmt->process(SPY_USERID);
}
while($rec = $rs->next())
{
$usr = $cms->getUser($rec['userid']);
if($usr == null && $GLOBALS['fc_config']['enableBots']) $usr = $GLOBALS['fc_config']['bot']->getUser($rec['userid']);
$list[] = array_merge($usr, $rec);
}
return $list;
}
/**
Retrieves a list of all available rooms, as an array.
*/
function roomlist()
{
$list = array();
// populate $list with the names of all available rooms
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE ispublic IS NOT NULL order by ispermanent");
$rs = $stmt->process();
while($rec = $rs->next()) $list[] = $rec;
//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);
?>
<span style="font-size:xx-small;color:#0232a1">
<?php
$users = usersinroom($room['id']);
foreach( $users as $user ) {
echo $user['login'] . ",";
}
?></span>
Thanks very much for taking the time to post this tutorial, marcnyc. I installed FlashChat on my site and it works well!
I had just two small problems - one fixed, one not. I didn't like the way the "who's in the chat" box at the bottom of the page was formatted. Besides being different from the SMF forum list, displaying the names vertically is kind of a dumb use of space. So I edited info_embedded.php, and now it looks just like the SMF forum list - much better! I'll append my code below in case anyone is interested. I made changes throughout the file, but the file isn't that long.
The other problem I had is that FlashChat insists on defaulting to white text - regardless of what color my theme says it should be. You have to change the color to something else and then exit for it to stop being white. Since I chose a light background for my theme (to match the rest of my site), white doesn't show up too well. The problem is in both the userlist and the chat text (which use the same color). Since I've never programmed Flash, it would take me a long time to find this bug so I haven't even tried to look. Does anyone know what the problem is? I have Flash (just bought an upgrade to Macromedia Studio 8 ).
One other thing... Does anyone have any idea what the "skins" do? When I change them, I see no difference. The "Select color scheme" works and my theme controls that (except for the white text problem), but I don't see what the skins do. It's not documented, and I can't tell looking at the code, either.
Here's my modified info_embedded.php:
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
/**
If this file is not in the FlashChat root folder, then change this
path to the location of the inc/common.php file.
*/
include_once('inc/common.php');
ChatServer::purgeExpired();
/**
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.
*/
function usersinroom( $room = "" )
{
$cms = $GLOBALS['fc_config']['cms'];
$list = array();
if($room) {
$stmt = new Statement("SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND roomid=?");
$rs = $stmt->process($room);
} else {
$stmt = new Statement("SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL");
$rs = $stmt->process();
}
while($rec = $rs->next()) $list[] = array_merge($cms->getUser($rec['userid']), $rec);
return $list;
}
/**
Retrieves a list of all available rooms, as an array.
*/
function roomlist()
{
$list = array();
// populate $list with the names of all available rooms
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE ispublic IS NOT NULL order by ispermanent");
$rs = $stmt->process();
while($rec = $rs->next()) $list[] = $rec;
//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);
$usernumb = numusers();
?>
<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;}
...normalCenter {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
margin: 0; padding: 0;
text-align: center;
}
...normal {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
margin: 0; padding: 0;
text-align: left;
}
#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>
<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>
<div id="roomList"> <?php
if ($roomnumb)
{
echo '<br />';
foreach($rooms as $room)
{ ?>
<strong><a href="#" onclick="javascript:toggleUserList('room_<?php echo $room['id']?>')"><?php echo $room['name']?> (<?php echo numusers($room['id']) ?>)</a></strong>
<br /><?php
$users = usersinroom($room['id']);
if ($users)
{
echo '<div class="userList" id="room_'.$room['id'].'">';
$times_through = 0;
foreach( $users as $user )
{
$comma = ($times_through++ == 0) ? '' : ', ';
echo $comma, $user['login'];
} ?>
</div> <?php
}
}
} ?>
</div>
</body>
</html>
the white-text issue should be solved in 4.3.3... if not, the solution (described over on the flashchat forum) is to change all of the default text colour values in the setup files for your default theme to something other than #000000. Setting them to #000001 works just peachy.
Skins modify the look of the screen... at least they do on my site...
Quote from: Kindred on October 11, 2005, 04:13:04 PM
the white-text issue should be solved in 4.3.3... if not, the solution (described over on the flashchat forum) is to change all of the default text colour values in the setup files for your default theme to something other than #000000. Setting them to #000001 works just peachy.
You know, I tried that when I was playing around with it, trying to get it to work, and at first I thought that fixed it. At least it was fixed when I was "chatting" with myself from two different computers. But twice now when chatting with someone else they came up "white". I'll go back to #000001 - can't hurt. And I'll take a look in the FlashChat forum. Do you know when 4.3.3 is supposed to be released?
Quote from: Kindred on October 11, 2005, 04:13:04 PM
Skins modify the look of the screen... at least they do on my site...
Really? What part of the screen changes, and in what way? Do you have before and after screenshots you can post?
I've wondered if it's a Mac thing. Are you using a Mac?
I changed every instance of 0x000000 in my theme to 0x000001, and I also watched more closely to see what happened when I changed the skins. The style and color of the controls change (buttons, tabs). I'm so relieved I can finally see it doing something!
Quote from: Mr. Jinx on September 13, 2005, 03:26:39 PM
I've also installed this great chat engine.
Is it possbile to show the user's alias in FlashChat. Right now it show the user's login ID.
Anyone?
It's possible but not without screwing up the bots.
Quote from: permutations on October 11, 2005, 04:24:25 PM
I've wondered if it's a Mac thing. Are you using a Mac?
FlashChat renders just fine in Safari and Camino.
Quote from: Elijah Bliss on October 11, 2005, 04:47:21 PM
Quote from: Mr. Jinx on September 13, 2005, 03:26:39 PM
I've also installed this great chat engine.
Is it possbile to show the user's alias in FlashChat. Right now it show the user's login ID.
Anyone?
It's possible but not without screwing up the bots.
The fix for the name bug was posted earlier in this thread here (http://www.simplemachines.org/community/index.php?topic=27137.msg150666#msg150666). It's a small error in the smfCMF files (smfCMF.php and smfCMF2.php).
I discovered that 4.3.3 has already been released. I downloaded it and I'm installing it now.
Quote from: permutations on October 11, 2005, 05:13:43 PM
Quote from: Elijah Bliss on October 11, 2005, 04:47:21 PM
Quote from: Mr. Jinx on September 13, 2005, 03:26:39 PM
I've also installed this great chat engine.
Is it possbile to show the user's alias in FlashChat. Right now it show the user's login ID.
Anyone?
It's possible but not without screwing up the bots.
The fix for the name bug was posted earlier in this thread here (http://www.simplemachines.org/community/index.php?topic=27137.msg150666#msg150666). It's a small error in the smfCMF files (smfCMF.php and smfCMF2.php).
I discovered that 4.3.3 has already been released. I downloaded it and I'm installing it now.
Cool, thanks, I'll try this out.
Quote from: James Woodcock on October 19, 2004, 05:27:14 AM
Ahhh Steve my programmer has done it, if you want it to display the visible name instead of the user name ie: James Woodcock instead of GlideM then:
In file >>> FlashChat\inc\cmses\smfCMS.php
Find:
function SMFCMS() {
$this->loginStmt = new Statement("SELECT ID_MEMBER as id, memberName AS login, passwd, is_activated from {$GLOBALS['db_prefix']}members WHERE memberName=? AND passwd=?");
$this->getUserStmt = new Statement("SELECT ID_MEMBER AS id, memberName AS login, ID_GROUP as status FROM {$GLOBALS['db_prefix']}members WHERE ID_MEMBER=?");
$this->getUsersStmt = new Statement("SELECT ID_MEMBER as id, memberName as login FROM {$GLOBALS['db_prefix']}members");
Replace:
function SMFCMS() {
$this->loginStmt = new Statement("SELECT ID_MEMBER as id, memberName AS login, passwd, is_activated from {$GLOBALS['db_prefix']}members WHERE memberName=? AND passwd=?");
$this->getUserStmt = new Statement("SELECT ID_MEMBER AS id, realName AS login, ID_GROUP as status FROM {$GLOBALS['db_prefix']}members WHERE ID_MEMBER=?");
$this->getUsersStmt = new Statement("SELECT ID_MEMBER as id, realName as login FROM {$GLOBALS['db_prefix']}members");
Works like a charm.
I had an idea. It'd be cool if a member could invite another member into chat. Basically they'd hit a "chat now" button on the person's profile or next to their username on the board and if that member was online, it'd popup a window saying "john doe would like to chat, do you accept?" and if they accept it would take them to the chat. I'm guessing a variable could be set that when the member refreshes a page it would check to see if it was set to yes or no and if yet, bring up the window asking to chat. Sorry if I'm not making sense, kind of hard to explain. You guys follow me? I guess it'd be a way to use chat as a live IM system.
well, that is something beyond the scope of SMF... and actually, beyond the scope of FlashChat.
You would have to modify the Flash file in FlashChat, as well as some of the php functions and templates...
You'd also have to install a javascript-alert function in SMF and add a continual and regular refresh... Which would be annoying for users who are trying to read things in the forum and would also increase bandwidth usage 10-fold.
Honestly, if you want IM, use an IM.
Quote from: Kindred on October 20, 2005, 01:00:28 PM
well, that is something beyond the scope of SMF... and actually, beyond the scope of FlashChat.
You would have to modify the Flash file in FlashChat, as well as some of the php functions and templates...
You'd also have to install a javascript-alert function in SMF and add a continual and regular refresh... Which would be annoying for users who are trying to read things in the forum and would also increase bandwidth usage 10-fold.
Honestly, if you want IM, use an IM.
I disagree, you would not have to have a refresh. SMF already uses this type of thing to alert members of new messages (if they chose to get alerts in their profile settings). Of course I'd have to modify some files but I don't see it being as hard as you make it out to be.
the new messages note only pops up when you refresh or go to a new page....
So, if I am sitting online reading a message for 20 minutes, I do not get a notice of my new PM until I go to another page within the site or click refresh...
Quote from: Kindred on October 20, 2005, 05:09:34 PM
the new messages note only pops up when you refresh or go to a new page....
So, if I am sitting online reading a message for 20 minutes, I do not get a notice of my new PM until I go to another page within the site or click refresh...
Yeah, that would be true. A drawback I guess.
Hi. Thanks. Tutorial cool.
I have a problem.
I am trying to integrate smf user hidden with flashchat spy_user. It does not work.
Could you say me like i do it?
Sorry my bad English. THANKS! ;)
My code is:
$this->loginStmt = new Statement("SELECT ID_MEMBER as id, memberName AS login, passwd, is_activated from {$GLOBALS['db_prefix']}members WHERE memberName=? AND passwd=?");
$this->getUserStmt = new Statement("SELECT ID_MEMBER AS id, realName AS login, ID_GROUP as status, showOnline as espia FROM {$GLOBALS['db_prefix']}members WHERE ID_MEMBER=?");
$this->getUsersStmt = new Statement("SELECT ID_MEMBER as id, realName as login FROM {$GLOBALS['db_prefix']}members");
$this->userid = NULL;
if (isset($_COOKIE[$GLOBALS['cookiename']])) {
$cookieData = unserialize((get_magic_quotes_gpc() ? stripslashes($_COOKIE[$GLOBALS['cookiename']]) : $_COOKIE[$GLOBALS['cookiename']])) ;
$this->userid = $cookieData[0];
}
}
function isLoggedIn() {
return $this->userid;
}
function getRoles($status) {
$rv = NULL;
if ($status == 1 || $status == 9 || $status == 11) {
if ($espia == 1)
$rv = ROLE_SPY;
else
$rv = ROLE_ADMIN; }
else
$rv = ROLE_USER;
return $rv;
}
function getUserProfile($userid) {
if ($espia == 1) $rv = NULL;
elseif ($user = $this->getUser($userid)) {
$rv = $GLOBALS['boardurl'] . "/index.php?action=profile;u=".$userid;
}
return $rv;
}
function getUser($userid) {
$rv = NULL;
if(($rs = $this->getUserStmt->process($userid)) && ($rec = $rs->next())) {
$rec['roles'] = $this->getRoles($rec['status']);
$rv = $rec;
}
return $rv;
}
once you add a CMS in Flashchat, you lose the ability to log in as a guest or spy...
But I believe to ROLE_SPY is active.
I enter hidde but I cannot to write in chat. Or hidde or other rule, but both I cannot ability with "showOnline".
I will try it.
Thanks kindred!
The SPY login can never type any messages in chat. The purpose is that it's a spy... watching but not responding
I posted over at Flashchat but will do it here to.
QuoteI have SMF 1.1RC1 and FlashChat 4.4.2
Everything works fine, very nice! But I want it to open the chat in a new window but without all the address and toolbars at the top. I also want the chat to be smaller when it pops up. I was thinking something like a box about 6 inches wide x 6 inches high.
Any help is greatly appreciated.
Getting this error when I edit the the boardindex.template.php file
QuoteParse error: parse error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/BoardIndex.template.php on line 412
403:
404: if ($context['show_who'])
405: echo '
406: <a href="', $scripturl, '?action=who">';
407:
408: echo (empty($context['spiders']) ? '' : $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['ob_googlebot_spider'] : $txt['ob_googlebot_spiders']) . ', '), $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), ', ' . $chatcount . ' User'.$singularplural2.' in Chat</a><br />
409:
410:
411: // Handle hidden users and buddies.
412: if (!empty($context['num_users_hidden']) || ($context['show_buddies'] && !empty($context[
Where do I need to put the suggested corrections
Thanks
A small tip if you plan on installing the chat program.
Install it into the root of your forum and when running the install script chose to integrate it into an existing cms. There is an option for smf 1.1 choose that one and continue. Then edit the default index.template.php with the integration tutorial here.http://www.tufat.com/docs/flashchat/smf.html (http://www.tufat.com/docs/flashchat/smf.html)
Once that is done follow the tutorial give in the first post of this thread. Although I am getting a parse error in the Boardindex.template.php file that has yet to be rectified.
Hope that helps
Hey Houston,
Did you do the "SUB-TUTORIAL #2: add "Users in Chat" sentence in ALL pages" part?
I had no trouble (once I found exactly where to put it) with the board index, but the second part puts the notice all the way up at the top and breaks my XHTML compatibility. It really screws with IE. It's supposed to go down by the search & home etc. buttons.
http://www.theopenrange.net/forum/index.php
OK I had closer look at the boardindex.template.php file in 1.1 rc1.
The tutorial given in the first post of this thread says to look for this code
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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), '</a><br />
This is what is in the 1.1 rc1 file that is not quite the same.
Quote<a href="', $scripturl, '?action=who">';
echo (empty($context['spiders']) ? '' : $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['ob_googlebot_spider'] : $txt['ob_googlebot_spiders']) . ', '), $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];
// 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 ')';
It seems to be calling the same information but in a different way. So where do I input this code.
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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), ', ' . $chatcount . ' User'.$singularplural2.' in Chat</a><br />
as suggested in the tutorial.
Thanks
One other ? The chat image lays right beside the logout image with no spacing in between. How would I change that so there is a few pixels between the two images.
Thanks
:D :) :-\ :o :( :'( EEEEKKKKK!!
reading that tutorial is gona make me faint!
Its JUST what I need but I am PHP illiterate :'(
Isnt there any files I can just download and add to my server to make this work? I already purchased Flash Chat along with the cool integrated MP3 Player
HELP
FlashChat website gives exact info to integrate it into SMF.
Is tufat.com down? I cannot access it!
Quote from: houston on November 18, 2005, 04:35:55 PM
OK I had closer look at the boardindex.template.php file in 1.1 rc1.
The tutorial given in the first post of this thread says to look for this code
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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), '</a><br />
..................
Thanks
Yes, I am having problems integrating "Whos online block" as well. The block at the bottom looks empty :(
same with me i'm use SMF 1.1 RC1 too :-*
i have checked my file on the index.template.php and i cannot find this line at all ??
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:
Copy to clipboardCode:
<a href="', $scripturl, '?action=chat">
Quote from: nightdreamer on January 11, 2006, 08:51:56 PM
i have checked my file on the index.template.php and i cannot find this line at all ??
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:
Copy to clipboardCode:
<a href="', $scripturl, '?action=chat">
find:
// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="', $scripturl, '?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/calendar.gif" alt="' . $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' : $txt['calendar24']), '</a>', $context['menu_separator'];
after add:
if ($context['user']['is_logged'])
echo '
<a href="', $scripturl, '?action=chat">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/chat.gif" alt="Chat" style="margin: 2px 0;" border="0" />' : 'Chat'), '</a>', $context['menu_separator'];
Quote from: rendi on December 29, 2005, 11:41:44 PM
same with me i'm use SMF 1.1 RC1 too :-*
the tutorial need to be updated for 1.1, but it will work...basic...add another tr, and td for he flash chat..i'll see if i can write something tom..i'm so busy
I have entered the line as stated and uploaded the chat gif to the image file.. The chat icon is not being displayed on the Bar my Flashchat is in a Different folder than the recommended folder as i downloaded flashchat before i downloaded the blog program.
can you see my chatblog and tell me where im going wrong please..
I would be very greatful
http://www.nightdreamer2000.com/smf_1-0-5_install/index.php
Boardindex.template.php 1.1rc1 default template
Make sure you replace "YOUR DATABASE _fc_connections HERE" with your correct mysql path.
// "Users online" - in order of activity.
$chatrequest = db_query("
SELECT COUNT(*) AS numb
FROM YOUR DATABASE _fc_connections HERE
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 '
<tr>
<td class="catbg" colspan="2">', $txt[158], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<img src="', $settings['images_url'], '/icons/online.gif" alt="', $txt[158], '" border="0" />', $context['show_who'] ? '</a>' : '', '
</td>
<td class="windowbg2" width="100%">';
if ($context['show_who'])
echo '
<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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), ', ' . $chatcount . ' User'.$singularplural2.' in Chat</a><br />';
echo '
<div 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']);
echo '
<br />', $context['show_stats'] && !$settings['show_sp1_info'] ? '
<a href="' . $scripturl . '?action=stats">' . $txt['smf223'] . '</a>' : '', '
</div>
</td>
</tr>';
// flashchat users
echo '
<tr>
<td class="catbg" colspan="2">Flashchat Users</td>
</tr>
<tr>
<td class="windowbg"> </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" allowtransparency="true"></iframe></td>
</tr>';
// If they are logged in, but SP1 style information is off... show a personal message bar.
if ($context['user']['is_logged'] && !$settings['show_sp1_info'])
{
echo '
<tr>
<td class="catbg" colspan="2">', $txt[159], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
', $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<img src="', $settings['images_url'], '/message_sm.gif" alt="', $txt[159], '" border="0" />', $context['allow_pm'] ? '</a>' : '', '
</td>
<td class="windowbg2" valign="top">
<b><a href="', $scripturl, '?action=pm">', $txt[159], '</a></b>
<div class="smalltext">
', $txt[660], ' ', $context['user']['messages'], ' ', $context['user']['messages'] == 1 ? $txt[471] : $txt[153], '.... ', $txt[661], ' <a href="', $scripturl, '?action=pm">', $txt[662], '</a> ', $txt[663], '
</div>
</td>
</tr>';
}
// Show the login bar. (it's only true if they are logged out anyway.)
Index.template.php 1.1 rc1 default template
THe first part will put the users in flashchat above the buttons and aligned left, with the search bar on the same level but aligned right.
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>
<td align="left">', template_flash_chat(), '</td>
<td align="right">
<form action="', $scripturl, '?action=search2" method="post" style="margin: 0;">
<div style="margin-top: 7px;">
<b>', $txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />
<input type="submit" name="submit" value="', $txt[182], '" style="width: 8ex;" />
<a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a>
<input type="hidden" name="advanced" value="0" />';
// If we're on a certain board, limit it to this board ;).
Make sure you replace "YOUR DATABASE _fc_connections HERE" with your correct mysql path.
// Otherwise, they might want to [logout]...
else {
echo '<a href="', $scripturl, '?action=chat" target="_blank">',
($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
. '/chat.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>';
}
}
function template_flash_chat()
{
// Flashchat Users
$chatrequest = db_query("
SELECT COUNT(*) AS numb
FROM YOUR DATABASE _fc_connections HERE
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="#FF0000">' . $chatcount . ' User'.$singularplural2.' in the Chat!</font><br/>';
}
}
?>
Is this compatible with rc2?
I am trying my Hardest to get the Flaschat working Via the Fourm Boar Chat icon My flashchat is in a Serperate folder to SMF.. and i keep getting this Error....
2: smf_main(/home/content/n/i/g/nightdreamer/html/smf_1-0-5_install/Sources/Chat.php): failed to open stream: No such file or directory
File: /home/content/n/i/g/nightdreamer/html/smf_1-0-5_install/index.php
Line: 318
Also do i need to alter the Following......
'chat' => array('Chat.php', 'Chat'),
and also This section...
<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="450" src="http://www.nightdreamer2000.com/chat/flashchat.php"></iframe>';
I would be very Greatful if you could help me as i dont really want to start Deleting a Folder just to upload it to the SMF or Vice versa
No, what I posted is for 1.1 rc1.
I will have a new tutorial for rc2 shortly.
I can't figure out how to show "users in chat" with SMF 1.0.5. Any ideas?
I want this integration but I'll wait for your 1.1 RC2 tutorial. ;) wink*
Here is mine if it's of any help:
Steps 1-7 are the same as of the 1st post.
Step 8: In you language files in index.yourlanguage.php at the end (before php closing bracket "?>") add the following line:
$txt['chat_but'] = 'Chat In Your language';
Step 9: Find this code:
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
After it add this one:
// chat code by UzForum.Com
if ($context['user']['is_logged'])
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=chat">' , $txt['chat_but'] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
It adds a link in the top menu. However there is a glitch - on the home page both Home & Chat are highlighted as active (other pages are normal), i didn't have a time to see what's wrong. It works though...
You are close:
You still have action=='home' in your code. Change it to 'chat'
// Show the [chat] button.
if ($context['user']['is_logged'])
echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=chat">' , $txt['chat_1'] , '</a>
</td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
And don't forget to add chat to the action menu
Find in index.template.php
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
As you can see it has a list of the actions in the menu. What we are going to do is add , 'chat' after 'pm'. Each action in the array is separated by a comma and enclosed in single quotes (').
It should look like this.
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'chat')))
My respect :), I am not a coder though. I thought that "action" thing tells on "Whos online" who's doing what & where, so i wasn't sure. Now we need to integrate that thingy in the bottom showing users in the chat. ;).
Here is the complete tutorial for RC2 and the default theme:
http://www.simplemachines.org/community/index.php?topic=66561.0
Plese let me know if you come across any errors!
Quote from: Owdy on October 31, 2004, 12:27:21 PM
How to ad list of users who are in chat
In /FlashChat/info.php, find:
<html>
<title>Who's in the chat?</title>
<head>
<style type="text/css">
<!--
.normal {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
}
A {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #0000FF;
}
A:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FF0000;
}
-->
</style>
</head>
<body>
<center>
<p class=normal>There are <?=numusers()?> users in <?=$roomnumb?> rooms.</p>
<?php if($roomnumb) { ?>
<table border="1" cellpadding="1" class="normal">
<tr>
<th>ID</th>
<th>Name</th>
<th>Count</th>
<th>Users</th>
</tr>
<?php foreach($rooms as $room) { ?>
<tr>
<td><?=$room['id']?></td>
<td><?=$room['name']?></td>
<td><?=numusers($room['id'])?></td>
<td><?php
$users = usersinroom($room['id']);
foreach( $users as $user ) {
echo $user['login'] . "<br>";
}
?> </td>
</tr>
<?php } ?>
</table>
<?php } ?>
<p><a href="javascript:window.close()">Close</a></p>
<center>
</body>
</html>
Replace:
<span style="font-size:xx-small;color:#0232a1">
<?php
$users = usersinroom($room['id']);
foreach( $users as $user ) {
echo $user['login'] . ",";
}
?></span>
then ad this in index.template.php:
<td colspan="2">
';
if ($context['user']['is_logged'])
echo '
<font size="-2">Users in chat:</font> ';
if ($context['user']['is_logged'])
{
readfile("http://www.example.com/FlashChat/info.php");
}
echo '
</td>
With this code only logged users see that list. Code may be crappy (PHP N00b here), but it works.
I know this is a dumb, simple question, but I can't figure it out. Is there a way to have a title in front of the displayed names, such as "Who's in Chat"?
Thanks...Jim
The pic is what the display shows now:
Greetings,
I have been working on integrating FlashChat and SMF 1.1 R1 using the following guide:
http://www.simplemachines.org/community/index.php?topic=27137.0
However, on part 4 I am unable to find this line of code:
<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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), '</a><br />
which should be replaced by:
<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'], (empty($context['num_users_hidden']) ? '' : ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')'), ', ' . $chatcount . ' User'.$singularplural2.' in Chat</a><br />
Can anyone help me with this problem please.
Thanks in advance,
Dee.
In addition to my previous post, I am getting the following error when I click on the chat button:
Fatal error: smf_main() [function.require]: Failed opening required '/home/sierrale/public_html/forum/Sources/Chat.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sierrale/public_html/forum/index.php on line 337
Any help will be greatly appreciated.
Thanks,
Dee.
Problems with 1.0.6
Some users seems to be banned, but others, not.
Search for this on the flashchat forum.
The answer is there; several other smf users found it.
http://www.tufat.com/forum/index.php
Hi! how can I made "Currently there are 1 Users in the Chat!" this to show on my board (SMF 1.0.6) in default templates? Thanks
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
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?
@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)
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!
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?
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.
:'(
'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
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...)
Mine works beautifully :)
http://www.cricketvoice.com/cricketforum2
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!
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
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
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!
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!!)
Can integrate this flashchat with an irc channel ?
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.
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
Thanks.....looking there right now.....
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!
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!!)
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 ;)
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?
it is in inc/cmses/cmsSMF2.php
There was some membername or screenname thingy.
PS. Djafarich, sanmisan?
Also guys, you that iframe window showing "Who's chatting". Please advise a code to make it list users horisontally, like "Total online today", rather than unordered list (ul li). If also colour them accordingly and link to their profiles... ummm. :)
what about flashchat for smf 1.1 rc3 ?? is there any guide??
Quote from: contreras on October 13, 2006, 01:28:36 AM
what about flashchat for smf 1.1 rc3 ?? is there any guide??
It seems that there is some "doc" on Tufats.com by Geno but I can't find it!
With one of my IBP sites I have managed to get the Flashchat inside by using this
<html>
<center>
<head>
<title>TITLE</title>
<meta name="generator" content="">
</head>
<body bgcolor="Black" text="white" link="blue" vlink="purple" alink="red">
<p><iframe name="ifrm1" src="http://www.yoursite/forum/chat/flashchat.php" width="800" height="600px" frameborder="1"></iframe></p>
</body>
</html></center>
How do I go about inserting this into a new page (HTML or PHP?) so that when the page is accessed it shows flashchat in an "Iframe"?
Limo2005
Quote from: unrelenting on July 20, 2006, 09:07:09 PM
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?
I know you already did this unrelenting but for those that also want to do this check out my post here.
http://www.simplemachines.org/community/index.php?topic=66561.msg652222#msg652222
Has anyone updated this hack for SMF 1.1.1 ?
Looks like it would be a nice addition for us.
http://www.simplemachines.org/community/index.php?topic=66561.0
I did this first for RC2, but I just did all of the same bits in several 1.1.1 forums last week.
All information is the same.
Quote from: Simplemachines Cowboy on December 31, 2006, 10:56:20 PM
http://www.simplemachines.org/community/index.php?topic=66561.0
I did this first for RC2, but I just did all of the same bits in several 1.1.1 forums last week.
All information is the same.
Ok, thanks... I'll go over the 17 pages of stuff again and try to see where I went wrong. :'(
The important stuff is on the first page, first post.
The rest is some further tweaks to the displayed information.
Quote from: Simplemachines Cowboy on January 04, 2007, 01:26:42 PM
The important stuff is on the first page, first post.
The rest is some further tweaks to the displayed information.
Ok thanks pal.
I'm trying to figure out how to get my remember "forever" logon to remember anything at all looool. Then I'll get back to making the chat nicer.
Pacman
Hi everyone,
I've created a mod which allows you to completely integrate FlashChat into SMF (no iframe needed). You may find it at http://custom.simplemachines.org/mods/index.php?mod=611 :)
Quote from: Daniel15 on January 05, 2007, 04:31:27 AM
Hi everyone,
I've created a mod which allows you to completely integrate FlashChat into SMF (no iframe needed). You may find it at http://custom.simplemachines.org/mods/index.php?mod=611 :)
That's fantastic Daniel15... I'm planning to set that up once I get my mail bug and "remember forever" password option working.
I don't want to add any other problems until these things are working correctly.
Good job though and thanks for the heads up!
Pacman
can anybody help me center the code that shows user in chat at the top of all pages ?
Thanks
Great stuff ;)
You can try this (not tested):
In index.template.php, FIND:
echo '
<td width="90%" class="titlebg2">
<span class="mediumtext">', template_flash_chat(), '</span>
</td>';
Replace with:
echo '
<td width="90%" class="titlebg2" align="center">
<span class="mediumtext">', template_flash_chat(), '</span>
</td>';
thanks but actually i am talking about this bit of code that i added from the first post of this topic. Its in my index.template.php. It tells how many users are using the chat.. my site is danish so i translated some of the code :)
Can you help me center the output from this code please :)
// 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>';
$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 = "";
$singularplural2 = "";
} else {
$singularplural1 = "";
$singularplural2 = "mer";
}
if ( $chatcount != 0 )
echo 'Lige nu er der ' . $singularplural1 . ' <font color="#FF0000">' . $chatcount . ' Medlem'.$singularplural2.' inde på chatten!</font>';
}
Let me make sure, you want the output of that statement to be centered?
So that will make that section look like this:
Users Online
2 Guests, 10 Users 2 Users in Chat
(with the user list here, all the way to the right edge----------------------------------------------------)
And I should verify, what version of SMF are you using?
This particular hack is written for the old version 1.0.
If you are using 1.1 then you need to follow these directions, which are slightly different:
http://www.simplemachines.org/community/index.php?topic=66561.0
Okey so i didnt put in enough information..
i am using smf 1.1 RC3 with TP installed
I would kindly ask you help
on this picture you can see how it looks now
http://www.shockwavenews.net/11.jpg
on this picture you can see what i am asking for.. to get the text centered.. just like my menu is centered..
http://www.shockwavenews.net/12.jpg
Can you help ??
OK, try this (Not tested):
Find:
// 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>';
Replace with:
// 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" align="center"><tr>';
already tried that.. did not work :(
But thanks for trying to help :)
Quote from: bluevoodu on January 16, 2005, 12:35:01 PM
nice going!
just a question though.... is there a possibility to make it so that if a user is in chat (but not active on the boards for 15 min...etc) that they still appear online on the message boards who's online area?
the reason is that if a user is idle on the board, they are dropped from the who's online list, but they are still active in chat.
Also, would it be possible that when you click the who's online (and it displays what the user is doing) that it could display "User is chatting" or something like that?
thanks,
†B†V†
and my problem is just like your'...can You help me?
If anybody know why in IE (not firefox) user can't log out from the chat. I mean..they can but on the forum it says thet they are still logged on ??? They're logged off...what can I do ??
I have FlashChat 4.7.7 , SMF 1.1.2 and, of course, flashchat mod is installed !!
Thank you very !! any help is wellcome !!
Tomislav
I have same problem... 1 user always appers to be logged in.. but he really isnt.. its not a big problem but still would be nice to quick fix it somehow :)
I installed the chat and user integration works perfectly fine but I have a layout problem for the numbers of users chatting.
The instructions said to paste the code snippet right after the //main content but the n. of users chatting appears on top of the page (http://celtic-hearts.com/forum/index.php), outside the Board Index
My index.template.php main content looks like this:
// 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>';}
$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="#FFFFFF">' . $chatcount . ' User'.$singularplural2.' in the Chat!</font><br>';
}
function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '</td>
</tr></table><br />';
Any suggestions?
And does anyone know how to have the number of users in chat in the key stats section (under 'latest member')?
Quote from: Knat on February 19, 2007, 02:28:10 AM
I have same problem... 1 user always appers to be logged in.. but he really isnt.. its not a big problem but still would be nice to quick fix it somehow :)
copy dologout.php from chat/inc folder to your main SMF folder.. Leave a copy in the main chat Folder, this leaves a logout for when folks come in another way.
You need to Edit the copy in the SMF folder as shown in below
<?php
require_once('/inc/common.php');
$msg = 'Logging out from the chat...';
like this
<?php
require_once('/home/blahh/soanso/www/SMF/Chat/inc/common.php');
$msg = 'Logging out from the chat...';
There is one more line down a little ways which is the spacer.gif do the same with it if you want. I'm not php savy so that might be a sloppy way to do it.
I don't know if I'm asking in the right place, but I hope someone can help...
When the global moderator on my forum tries to access the chat room, he gets told that he's "banned," and is then automatically logged out of the forum as well!
Here's a screenshot of what he sees:
http://img406.imageshack.us/img406/5893/bannedzi2.jpg
According to the FlashChat control panel, nobody is banned from the chat room, and he certainly hasn't been banned from the forum. So what's going on, and how can I fix it?
Many thanks in advance...
This is a known issue with FLASHCHAT.
I don't remember the exact fix, but if you go search the FlashChat forum you will find the fix.
It has something to do with having more than the default number of groups in SMF - FlashChat doesn't recognize the group so you will need to add the group to FlashChat.
Edit:
I knew I had the post saved! Try this:
http://www.simplemachines.org/community/index.php?topic=66561.msg585301#msg585301
Fantastic, thanks a lot Cowboy! :D
Quote from: Daniel15 on January 05, 2007, 04:31:27 AM
Hi everyone,
I've created a mod which allows you to completely integrate FlashChat into SMF (no iframe needed). You may find it at http://custom.simplemachines.org/mods/index.php?mod=611 :)
Wow!! This is very nice. I have it running on our test board, and it looks GREAT! Thank you Daniel15 !!!
One problem, when I go to ?action=chat its in an iframe like it should except im logged out everytime I try to access it. Any ideas?
Quote from: brianjw on August 08, 2007, 04:09:28 PM
One problem, when I go to ?action=chat its in an iframe like it should except im logged out everytime I try to access it. Any ideas?
I had that problem before and I had to reinstall flashchat to get it fixed.
I saw a fleeting reference to this error and only an obscure reference to a possible cause but I have integrated Flash Chat using the instructions on the site but I keep getting the following error.
QuoteFatal error: Cannot redeclare reloadsettings() (previously declared in /home/yvonneh/public_html/travian/forum/Sources/Load.php:140) in /home/yvonneh/public_html/travian/forum/Sources/Load.php on line 138
Could someone please clue me in on how to fix this?
cheers,
Brad
you seem to have installed a mod (specifically the reloadsettings function) twice...
Okay, the only mods I have installed are the Flashchat integration mod? Where would I correct this error?
Cheers,
Brad
you would remove the duplicate function(s) from load.php
I can only find reloadsettings() once in load.php?
Brad
The best place to get better support on this is probably the mod topic - for the mod you stated, "Flashchat Integration"
Quote from: [Unknown] on January 31, 2005, 02:54:58 PM
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]
FIX:
In chat/inc/cmses/smfCMS2.php, find:
code:
include($smf_root_path . 'Settings.php');
include($smf_root_path . 'Sources/Load.php');
include($smf_root_path . 'Sources/Subs-Auth.php');
include($smf_root_path . 'Sources/LogInOut.php');
replace with:
require_once($smf_root_path . 'Settings.php');
require_once($smf_root_path . 'Sources/Load.php');
require_once($smf_root_path . 'Sources/Subs-Auth.php');
require_once($smf_root_path . 'Sources/LogInOut.php');
fix for what?
my system works just fine with the SMFCMS2 file exactly as supplied by flashchat
Quote from: Kindred on November 04, 2007, 08:36:51 AM
fix for what?
my system works just fine with the SMFCMS2 file exactly as supplied by flashchat
He's replying to a 2 year old post so maybe he has a 2 year old version of the software.
but those lines in SMFCMS2 still read include (by default) rather than require_once...
Mind you, require_once won't HURT anything...
Got excited and bought the Desktop Skin for Flashchat as well . Anyone tried to use that instead? How can I point it to this new interface ?
Thanks !
i maneged to intergate it in to smf 2.0 beta 3 public default Theme
as for the button this is moved to /sources/subs.php
this is just to tell you that it works in the new beta ;D
greetings Dyrome
Yep I rewrote the mod and modified the flash chat bridge files to work with my SMF 2.0 forum.
For anyone that likes the Classic theme, here's a button that matches the style of the other Classic menu buttons, instead of the one that Tufat supplies. Save the GIF and upload it to Themes/classic/images/english/
If you've already used their menu GIF, then rename this to chat_icon.gif when you save it and overwrite the other one.
Ive been doing a bit of searching on Flash Based chats, just so you know that on a shared server, and that at least 90% of us the best you can hope for is somewhere between 20 and 50 users at any one time (before your host gets in touch with you).
If you are looking at something that can expand beyond that you have to move over to something that's not hosted on your server e.g. IRC.
Having said that FlashChat is a real charm, pity about the shortcomings on numbers.
The integration went like a dream ;) Thanks! :D
BUT, I got one problem with the chat, hope someone can help me.. .
This is with the AJAX CHAT skin for FlashChat
1) IF the users is ALREADY logged into SMF, the chat will show nickname "null" and "Welcome USER_LABEL", and auto login to chat (no login box)
2) IF the user is NOT logged into SMF, the chat will show a login box, and after providing the login, the chat will show CORRECT nickname and welcome message....
Anyone know how to fix ?? :)
thanks
I am sure that this is in the wrong thread, but I haven't been able to find where anyone asked this question before. My flashchat is working perfect with SMF 1.1.5, although I am looking for a way to be able to lock the chat and only allow access at certain times. This is a forum that I built for some people at work, and they don't want people to just stay in chat all day and never post in any topics.
Also is there any way to save the chat content to a thread, so that all this information stays current and up to date? Thanks for the help in advance.
Well, you are right. This is not the correct place to be posting this. Since Tufat is the people who made flash chat, it would be better if you posted this question at their forums; http://forum.tufat.com/
SMF doesn't change anything about flash chat other than integration and adding an iframe to it on your website. Tufat, like I said before changes Flash Chat and built flash chat so it's better there.
Brian
that very concept has already been discussed and code included over on tufat
Sorry about that guys. Thought maybe that there was something in the code that could be edited in order to do this. I will look over at tufat again.
:) There is.
Look for a post by me over on tufat. I know I posted code to modify flashchat to do exactly that... but it was probably over a year ago
Quote from: Kindred on August 16, 2008, 12:58:14 PM
:) There is.
Look for a post by me over on tufat. I know I posted code to modify flashchat to do exactly that... but it was probably over a year ago
Thanks for the advice. I will look for this.
Does anyone have a screenshot of this installed on a default theme?
Hi guys.... firstly apologies for dragging up an old thread but surely its better then creating a whole new thread??
Im experiencing the log out window bug.... I've copying the dologout.php file to the forum directory and edited the inc/common.php to chat/inc/common.php etc and it comes up with an Internal Server Error...
anything i can try ive been searching around the forum all evening so thought i'd post... im carrying on looking about but if some could possibly help i'd appriciate it...
Running SMF 1.1.10
thank you!!!!
HI guys.... no matter what i did in regards to copying the dologout file, copying it over etc and editing the path to the common.php etc... it all failed - producing an internal server error...
so i went experimenting and seems the error lies in the js.php file!!!
Originally it was this
window.open("<?php echo $GLOBALS['fc_config']['base']?>dologout.php?id=" + connid, "logout", "width=" + width + ",height=" + height + ",left=" + wleft + ",top=" + wtop + ",location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
but editing to this
window.open("<?php echo $GLOBALS['fc_config']['base']?>/(sitefoldername)/forum/chat/dologout.php?id=" + connid, "logout", "width=" + width + ",height=" + height + ",left=" + wleft + ",top=" + wtop + ",location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
obviously changing the (sitefoldername) to the name of the folder on your server which contains the main site etc
worked a treat for me..... hope it helps others!!!
Edit***
Also change this a few lines down... from
img.src = "<?php echo $GLOBALS['fc_config']['base']?>dologout.php?seed=<?php echo time()?>&id=" + connid;
to
img.src = "<?php echo $GLOBALS['fc_config']['base']?>/(sitefoldername)/forum/chat/dologout.php?seed=<?php echo time()?>&id=" + connid;
And then in the config.php file you can change the 'showLogoutWindow' to false - and then you don't get any window appear when you leave the forum via home or anything etc but it still logs you out!!!
Again hope this helps people!!!
ive recently put a proper domain to the forum now and was gettin the non logging out issue again so i had to change where ive put (sitefoldername) i changed that to the domain address ie.
http://www.domain.co.uk/forum/chat/dologout.php?id=
for both lines.... and this is now working again!
You probably didn't need to do this as their are mods for intergration Flashchat 4.7 into SMF 1.1 and 2.0 RC1.2 on the Mod site.
Quote from: α¢αηѕ on November 02, 2009, 04:35:15 AM
You probably didn't need to do this as their are mods for intergration Flashchat 4.7 into SMF 1.1 and 2.0 RC1.2 on the Mod site.
i was using the FC mod actually and the error still happened!
i posted the code edits here as there was a post of someone having the same issue i had... so thought it would be helpful to offer a possible solution!
please read posts before you make comment! you would have seen the issue i was having regardless of mod or no mod and then posted a solution!
surely its better to provide more information then many may need in the event in the future the same error happens and users can search for thier error and see my post with a solution? Yes?
:P
so does FlashChat work with SMF 2.0 RC2?
it does i know that now
but how can i get the button on the screen?
anyone know
http://custom.simplemachines.org/mods/index.php?mod=611
HOWEVER, it hasn't been updated for 2.0RC2 yet, The Mod author is working on it :)
I am so lost right now :(
I have my Flash chat purchases, and extracted the 2 files that were not even added in the MOD package from my FChat download.
I have added and added, and added this one over and over again, but when i Install the MOD, this just keeps popping up.
12. Execute Modification ./chat/inc/flashChatTag.php Test failed
I go with the Install anyways, and when i click my home page, I get this.
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 261900 bytes) in /home/hcf/public_html/Sources/Subs.php on line 3446
And when I click the chat button from anywhere otherthan the Home Page, I get this.
FlashChat does not appear to be installed!
I've tried the mod support topic, but it seems dead.
did you install flashchat in the /home/hcf/public_html/chat folder, before you tried to install this mod?
Are you using the correct version of flashchat (I believe this mod only works with 4.7.x)
Sorry for bumping this post, is there already a way found for integrating it with SMF 2.0 RC3 ?
Thanks.
can der be an integration with 1.1.13?
I have been able to install this chat and integrate it, no problem. I didn't go as far as adding a tab/button because I don't want the chat to be available to all members, so if they want to access the chat, they would have to type the address.
Is there a way to enable it by permission based on membergroups, if I only wanted admin, global moderators and moderators to have access, or only supporting members?
Is there a way this could be done?
I'm running SMF RC5.0 with Outline theme by Dzinerstudio and the following mods:
1. SMFShop
2. Aeva ~ Auto-Embed Video & Audio
3. Welcome Topic Mod 2.1
4. Ad Managment
5. Sitemap
6. SimplePortal
7. Users Online Today
8. Contact Page
9. Share This Topic
10. Tidy Child Boards
11. Referrals System
12. LMGTFY BBcode
13. Last Active On MemberList
Is there a mod for 2.0 final?
Quote from: marcnyc on October 09, 2004, 07:21:56 AM
Hello folks, this is my attempt to give something back to the community.
I hope this will help everybody and make your forum/chat experience even more enjoyable!
Awesome. Thanks for typing out such a detailed cookbook.
I had a hard time setting up flashchat myself too. I'm running SMF 2.0.2 and Flashchat 6.0.8
So time has moved on since your version.
Just thought if anyone is interested, I have the tested installable Flashchat 6.0.8 placed on my server. This is the free version without source code. However if you just download the 6.0.8 straight off the author's webpage, it won't function properly (it will install but won't run). It has a bug. Specifically the bug is that you can install the whole flashchat program, but when you come to run it, it will freeze at a blue screen. It will say something like loading chatroom but never actually finishes loading.
I have injected the bug fixed into the install package. You should be able to just download it and install without problem.
http://www.gpland.org/dropbox/ForMica.Modified_Flashchat_6.0.8_bundle_Ready_to_install_Patch_already_injected.zip
OR from here:
http://efshare.com/?s=53Q9JT
Code: 53Q9JT
(Let me know if neither place is downloadable, I have a copy with me I can upload for people who need it).
I'll leave it there for a few months. Depending on how desperate I'm for disk space, may erase it later this year. Feel free to take a look at Flashchat 6.0.8 working fine on my forum (just go to http://www.gpland.org) and click on Flashchat up the top. You will see a pop up window with a functioning flashchat.
If by the time you read this post, the file has already been removed from my server, that's ok too. You can still find the original 6.0.8 from the author's website. Install that (with its bug). Then look for a post titled "CMS fixes for v6.0.8" posted by the user called Pavel on the "$5 Script Archive Community Forum". The link for his article is here:
http://forum.tufat.com/showthread.php?s=85ac2017cc51d7ddd161aef9d943b200&t=65648
He attached two bug fix files to his original post (dated 6/2/2010). The two files are SMF.rar and ipb.rar
Just apply his bug fix and your flashchat should work. It's a matter of unrar and put files in appropriate places (overwrite some of the bugged files).
Note, this is specifically a bug fix for freezing blue screen refusing to enter into chatroom. I heard people suffered from all sorts of other difficulties. I didn't have any issues other than blue screen freeze. So if your problem is the same, then this bug fix is your solution.
An alternative to consider is something called 123flashchat (http://www.123flashchat.com/). It looks like a Chinese copycat version of the $5 Flashchat, except the imitate version is much better (and much more expensive too. Looking at around $200 for a basic set up). The company that sells 123flashchat is happy to set up their product on your forum if you pay them. By the way I am not affiliated with 123flashchat. Just found their chat program pretty interesting.
Hi there sorry for bumping an old post but I believe John Wayne may be able to help me here as the flash chat forums are down .
John Wayne is there any chance you still have the patches and would be kind enough to share them I have bought the 6.0.8 flash chat and would love to be able to get it working on smf 2.0.7 and believe these patches would do the trick thanks
Quote from: thewebmann on February 08, 2014, 11:01:43 AM
Hi there sorry for bumping an old post but I believe John Wayne may be able to help me here as the flash chat forums are down .
John Wayne is there any chance you still have the patches and would be kind enough to share them I have bought the 6.0.8 flash chat and would love to be able to get it working on smf 2.0.7 and believe these patches would do the trick thanks
hi there,
the file you are looking for i still have but it's just hidden somewhere amongst my millions of other files. For the time being this is what I found:
https://mega.co.nz/#!xFwnFBIa!fS3nuhp9BXj87yOpuSaHGEgDi-MtEgUwmA9vCdOE30c
These are basically patches to get it to work. The one I shared before was better packaged so you just need to install and not worry about following any instructions. The link I provide to you this time are the patches not yet applied, so you need to just follow the steps and do it yourself. But the files are all there. It should be enough to solve your problem. Let us know how you go!
Good luck.
Thank you kind sir much appreciated it was actually the patches I was after as I think your pre-patched was the free version either way I am extremely greatful to you :)P
Demo ? :-/
Quote from: thewebmann on February 08, 2014, 01:18:43 PM
Thank you kind sir much appreciated it was actually the patches I was after as I think your pre-patched was the free version either way I am extremely greatful to you :)P
That's great thewebmann, I'm glad you got what you needed!