News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

FlashChat Integration

Started by Tyrsson, January 05, 2007, 03:44:53 AM

Previous topic - Next topic

Col

The code that Daniel moved from BoardIndex.php to Subs.php has been changed slightly. It appears that Chat now tries connecting to the wrong BD. This appears to happen if you have anything bridged with SMF, but it might be the case that this happens if the forum is not bridged, but you are running some DB other than the one for SMF. Anyway, I think this is what's happening, but I'm no coder. I hope that is enough for someone to have look at it.

hvyhitter

#341
This Mod seriously rocks.. I have it installed and my users LOVE it..

Thanks again..

and flashchat..worth every penny!


although.. my SMF version 1.06 shoutbox is getting a PHP has encountered a Stack overflow error..

i am searching for an answer.

hvyhitter

i have tried the uninstall flashchat (shoutbox worked)
and reinstall (shoutbox stopped working)

dork313

I have it set so that you can see what users are in the chat room but my chat room only has one permanent room. So I'm wanting to see if there is a way to remove what room the users are in because it's cluttering things up?

Col

I too would like that tidying up. It would be better to list all those in each room, rather than appending which room each member is in after each and every membername.

perplexed

Quote from: Daniel15 on January 06, 2007, 09:37:58 PM
For everyone with the Googlebot and Spiders mod, you can install this mod, but you'll need to edit two files (SSI.php and BoardIndex.template.php) manually, as both the Googlebot and Spiders mod, as well as this mod, edit the file. Here's how to edit the files:
Open SSI.php, and find:

$return['num_users'] = count($return['users']) + $return['hidden'];
$return['total_users'] = $return['num_users'] + $return['guests'] + ($modSettings['ob_googlebot_count_most_online'] ? $return['num_spiders'] : 0);

Add after:

// --- Begin FlashChat integration ---
global $boarddir, $db_name;
// Get the FlashChat database config (for the prefix)
include($boarddir . '/chat/inc/config.srv.php');
// Get the proper database prefix (including database name)
$fc_prefix = is_numeric(substr($GLOBALS['fc_config']['db']['pref'], 0, 1)) ? $db_name . '.' . $GLOBALS['fc_config']['db']['pref'] : '`' . $db_name . '`.' . $GLOBALS['fc_config']['db']['pref'];
// Load all the users currently in the chat
$result = db_query("
SELECT
fc.userid, fc.state, fc.color, fc.lang, fc.roomid,
fr.name AS roomName, fr.ispublic,
mem.realName, mem.memberName, mem.showOnline, mg.onlineColor,
mg.ID_GROUP, mg.groupName
FROM {$fc_prefix}connections AS fc
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = fc.userid)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
LEFT JOIN {$fc_prefix}rooms AS fr ON (fc.roomid = fr.id)
WHERE fc.userid IS NOT NULL
ORDER BY mem.realName ASC", __FILE__, __LINE__);

$return['users_chat'] = array();
$return['list_users_chat'] = array();
$return['num_chat'] = mysql_num_rows($result);

// Loop through all users in chat
while ($row = mysql_fetch_assoc($result))
{
// Does their membergroup have a colour?
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['userid'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['userid'] . '">' . $row['realName'] . '</a>';

// Add them to the 'Users Online' list
$return['users_chat'][$row['memberName']] = array(
'id' => $row['userid'],
'username' => $row['memberName'],
'name' => $row['realName'],
'group' => $row['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $row['userid'],
'link' => $link,
'chat' => array(
'color' => $row['color'],
'lang' => $row['lang'],
'room' => array(
'id' => $row['roomid'],
'name' => $row['roomName'],
'public' => ($row['ispublic'] == 'y' ? true : false),
),
),
);
}
mysql_free_result($result);
// --- End FlashChat integration ---

Also, find:

echo '
', (empty($return['spiders']) ? '' : $return['num_spiders'] . ' ' . ($return['num_spiders'] == 1 ? $txt['ob_googlebot_spider'] : $txt['ob_googlebot_spiders']) . ', '), $return['guests'], ' ', $return['guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $return['num_users'], ' ', $return['num_users'] == 1 ? $txt['user'] : $txt['users'];

Replace with:

echo '
', (empty($return['spiders']) ? '' : $return['num_spiders'] . ' ' . ($return['num_spiders'] == 1 ? $txt['ob_googlebot_spider'] : $txt['ob_googlebot_spiders']) . ', '), $return['guests'], ' ', $return['guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $return['num_users'], ' ', $return['num_users'] == 1 ? $txt['user'] : $txt['users'], ', ', $return['num_chat'], ' ', $return['num_chat'] == 1 ? $txt['user'] : $txt['users'], ' ', $txt['fc_in_chat'];


In Themes/default/BoardIndex.template.php, find:

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

Replace with:

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'], ', ', $context['num_chat'], ' ', $context['num_chat'] == 1 ? $txt['user'] : $txt['users'], ' ', $txt['fc_in_chat'];


Also, find:

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


Add after:

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


Note that if you're using a custom theme, you'll need to edit that theme's BoardIndex.template.php file (eg. I applied the BoardIndex.template.php changes to my modified 'Apollo' [by Bloc] theme).

Do we still need to do this for 1.0 Daniel?  It said on the mod page :

Quote
NOTE: For anyone with the 'Googlebot and Spiders' mod installed, you may install this mod, but two of the edits (SSI.php and BoardIndex.template.php) will fail (due to both the Googlebot and Spiders mod and this mod editing the same code). You may continue to install this mod (it will install successfully), but please see this post for what to do after installation.
Edit: This is currently NOT up-to-date. Please check back later for updated instructions on installing this mod alongside the Googlebot mod!

I still got the two fails but things seem to be working and there are no errors in the log, so I just wondered what was necessary.  TY

Col

Hi,

For those who have reported conflicts with other mods, particularly bridged software or SSI problems, Clemennzo has posted a solution: http://www.simplemachines.org/community/index.php?topic=176062.msg1131874#msg1131874

I can report that it resolved the problem I was having (Flashchat integration 1.0 was killing my site).

4X4UK

thanks for that I will try it out and let you know, but at first glance it looks like the solution

Sakae

Is it just with me or this flash chat script is creating core.number files of 29,00 mb in my webserver?

Even if it's not caused by flash chat, does anyone knows a solution for stopping this?
http://www.tigrelog.com.br
l: simple p: machines

Col

Quote from: softcore on June 21, 2007, 09:04:15 PM
Is it just with me or this flash chat script is creating core.number files of 29,00 mb in my webserver?

Even if it's not caused by flash chat, does anyone knows a solution for stopping this?

I assume that you've installed the chatbot - a useless piece of bloaty crap! I installed it too (because I had no idea what it was), and keep meaning to remove it. I disabled the bot in the settings file because of possible problems in performance with integration to the forum. I intend to check for a proper procedure for removing the bot feature, just in case it's not as simple as dropping those huge tables.

deef

I have to do the installation manualy becausse he is giving a bunch of errors.  All solved only this error when I do the modification in the Subs.php

Parse error: parse error, unexpected T_IF, expecting ')' in /var/www/vhosts/animalsex-forum.com/httpdocs/Sources/Subs.php on line 3408

Becausse this is only for reporting I guess I have left this behind and the mod is working verry good for me.  But can someone look to my subs file ? to help me so I have the benefit off all the features.

Here is the code from 3400 till 3478

Thanks in advance and also thanks for this good modification

deef


$context['common_stats'] = array(
'total_posts' => comma_format($modSettings['totalMessages']),
'total_topics' => comma_format($modSettings['totalTopics']),
'total_members' => comma_format($modSettings['totalMembers']),
// --- Begin FlashChat Integration ---
// Only bother grabbing the data if we need it (ie. we're on the board
// index, or the information will be shown at the top of the forum).
// !!! $modSettings['fc_showUserCount'] just needs the count, not the whole query!
if (!empty($modSettings['fc_showUsers']) || !empty($modSettings['fc_showUserCount']) || (empty($context['current_action']) || $context['current_action'] == 'boardindex' || $context['current_action'] == 'forum'))
{
global $boarddir, $db_prefix;
// Get the FlashChat database config (for the prefix)
include($boarddir . '/chat/inc/config.srv.php');
// Load all the users currently in the chat
$result = db_query("
SELECT
fc.userid, fc.state, fc.color, fc.lang, fc.roomid,
fr.name AS roomName, fr.ispublic,
mem.realName, mem.memberName, mem.showOnline, mg.onlineColor,
mg.ID_GROUP, mg.groupName
FROM {$GLOBALS['fc_config']['db']['pref']}connections AS fc
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = fc.userid)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
LEFT JOIN {$GLOBALS['fc_config']['db']['pref']}rooms AS fr ON (fc.roomid = fr.id)
WHERE fc.userid IS NOT NULL
AND mem.ID_MEMBER != 0
ORDER BY mem.realName ASC", __FILE__, __LINE__);

$context['users_chat'] = array();
$context['list_users_chat'] = array();
$context['num_chat'] = mysql_num_rows($result);

// Loop through all users in chat
while ($row = mysql_fetch_assoc($result))
{
// Does their membergroup have a colour?
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['userid'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['userid'] . '">' . $row['realName'] . '</a>';

// Add them to the 'Users Online' list
$context['users_chat'][$row['memberName']] = array(
'id' => $row['userid'],
'username' => $row['memberName'],
'name' => $row['realName'],
'group' => $row['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $row['userid'],
'link' => $link,
'chat' => array(
'color' => $row['color'],
'lang' => $row['lang'],
'room' => array(
'id' => $row['roomid'],
'name' => $row['roomName'],
'public' => ($row['ispublic'] == 'y' ? true : false),
),
),
);

$context['list_users_chat'][$row['memberName']] = $link . ' (' . ($row['ispublic'] != 'y' ? $txt['fc_private_room'] : $row['roomName']) . ')';

// Groups online
if (!isset($context['online_groups'][$row['ID_GROUP']]))
$context['online_groups'][$row['ID_GROUP']] = array(
'id' => $row['ID_GROUP'],
'name' => $row['groupName'],
'color' => $row['onlineColor']
);
}
mysql_free_result($result);
}
// --- End FlashChat Integration ---
'latest_member' => $context['common_stats']['latest_member'],
);

Flying Drupalist

I am experiencing...

12.    Execute Modification    ./chat/inc/flashChatTag.php    File not found
13.    Execute Modification    ./chat/inc/cmses/smfCMS2.php    File not found

Simplemachines Cowboy

Make sure you are using the latest version of flashchat.
Older versions will fail because those files do not exist.
My SMF forum: The Open Range

dork313

Has anyone figured out how to remove what room the users are in so that it takes less space to provide all the names?

mforum

Quote from: Miraploy on June 23, 2007, 04:27:40 PM
I am experiencing...

12.    Execute Modification    ./chat/inc/flashChatTag.php    File not found
13.    Execute Modification    ./chat/inc/cmses/smfCMS2.php    File not found

I had same problem with the latest stable version of flashchat (4.7.1).
Proceed with installation and do the changes manually in those files.
Keep a copy of files in case something goes wrong.

QuoteHas anyone figured out how to remove what room the users are in so that it takes less space to provide all the names?

I could use that myself ....
Have only one room in chat anyway....  ::)

Niteblade

Quote from: Col on June 20, 2007, 11:40:41 AM
Hi,

For those who have reported conflicts with other mods, particularly bridged software or SSI problems, Clemennzo has posted a solution: http://www.simplemachines.org/community/index.php?topic=176062.msg1131874#msg1131874

I can report that it resolved the problem I was having (Flashchat integration 1.0 was killing my site).

I attempted this solution and it doesn't help me.
affiliate blog

Niteblade

Quote from: nite0859 on June 30, 2007, 11:34:13 PM
Quote from: Col on June 20, 2007, 11:40:41 AM
Hi,

For those who have reported conflicts with other mods, particularly bridged software or SSI problems, Clemennzo has posted a solution: http://www.simplemachines.org/community/index.php?topic=176062.msg1131874#msg1131874

I can report that it resolved the problem I was having (Flashchat integration 1.0 was killing my site).

I attempted this solution and it doesn't help me.

It works.

Full Code in subs.php:


// --- Begin FlashChat Integration ---
// Only bother grabbing the data if we need it (ie. we're on the board
// index, or the information will be shown at the top of the forum).
// !!! $modSettings['fc_showUserCount'] just needs the count, not the whole query!
if (!empty($modSettings['fc_showUsers']) || !empty($modSettings['fc_showUserCount']) || (empty($context['current_action']) || $context['current_action'] == 'boardindex' || $context['current_action'] == 'forum'))
{
global $boarddir, $db_prefix, $db_name;
// Get the FlashChat database config (for the prefix)
include($boarddir . '/chat/inc/config.srv.php');
// Get the proper database prefix (including database name)
$fc_prefix = is_numeric(substr($GLOBALS['fc_config']['db']['pref'], 0, 1)) ? $db_name . '.' . $GLOBALS['fc_config']['db']['pref'] : '`' . $db_name . '`.' . $GLOBALS['fc_config']['db']['pref'];
// Load all the users currently in the chat
$result = db_query("
SELECT
fc.userid, fc.state, fc.color, fc.lang, fc.roomid,
fr.name AS roomName, fr.ispublic,
mem.realName, mem.memberName, mem.showOnline, mg.onlineColor,
mg.ID_GROUP, mg.groupName
FROM {$fc_prefix}connections AS fc
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = fc.userid)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
LEFT JOIN {$fc_prefix}rooms AS fr ON (fc.roomid = fr.id)
WHERE fc.userid IS NOT NULL
AND mem.ID_MEMBER != 0
ORDER BY mem.realName ASC", __FILE__, __LINE__);

$context['users_chat'] = array();
$context['list_users_chat'] = array();
$context['num_chat'] = mysql_num_rows($result);

// Loop through all users in chat
while ($row = mysql_fetch_assoc($result))
{
// Does their membergroup have a colour?
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['userid'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['userid'] . '">' . $row['realName'] . '</a>';

// Add them to the 'Users Online' list
$context['users_chat'][$row['memberName']] = array(
'id' => $row['userid'],
'username' => $row['memberName'],
'name' => $row['realName'],
'group' => $row['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $row['userid'],
'link' => $link,
'chat' => array(
'color' => $row['color'],
'lang' => $row['lang'],
'room' => array(
'id' => $row['roomid'],
'name' => $row['roomName'],
'public' => ($row['ispublic'] == 'y' ? true : false),
),
),
);

$context['list_users_chat'][$row['memberName']] = $link . ' (' . ($row['ispublic'] != 'y' ? $txt['fc_private_room'] : $row['roomName']) . ')';

// Groups online
if (!isset($context['online_groups'][$row['ID_GROUP']]))
$context['online_groups'][$row['ID_GROUP']] = array(
'id' => $row['ID_GROUP'],
'name' => $row['groupName'],
'color' => $row['onlineColor']
);
}
mysql_free_result($result);
}
// --- End FlashChat Integration ---
affiliate blog

Chuck

Quote from: Molokaibill on January 10, 2007, 08:55:53 PM
Quote from: sciurus on January 10, 2007, 11:31:11 AM
While in chat the members Username is displayed, is it possible to change this so it shows their Displayed Name, and if so what do I need to change?

In&nbsp; /bridges/smf10.inc.php
search for "MemberName"&nbsp; (2x)
replace with "RealName"

I can't find that file??

joh87swe

Is this compatible with smf 1.1.3??

joh87swe


Advertisement: