vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Flashchat: Who is chatting (https://vborg.vbsupport.ru/showthread.php?t=73042)

Mr_Bob 04-24-2005 02:45 AM

Is the upgraded version supposed to work with the newly released FlashChat 4.0? If so, mine is not working :D. I logged into chat and refreshed the forum homepage to find it still said no users in chat. Is this supposed to be working with 4.0?

Paul M 04-24-2005 12:56 PM

Quote:

Originally Posted by Mr_Bob
Is the upgraded version supposed to work with the newly released FlashChat 4.0? If so, mine is not working :D. I logged into chat and refreshed the forum homepage to find it still said no users in chat. Is this supposed to be working with 4.0?

The upgrade was nothing to do with any version of Flashchat, it was an alteration to take account of the displaygroupid in vB.

However, this hack works perfectly for Flashchat 4.0.0 (beta) - I have been running this version of the chat on our forum for 2/3 weeks now, so you must have made a mistake somewhere.

Mr_Bob 04-24-2005 02:27 PM

Quote:

Originally Posted by Paul M
The upgrade was nothing to do with any version of Flashchat, it was an alteration to take account of the displaygroupid in vB.

However, this hack works perfectly for Flashchat 4.0.0 (beta) - I have been running this version of the chat on our forum for 2/3 weeks now, so you must have made a mistake somewhere.

I must, however FlashChat came out of beta on the 21. It worked well when I was working with the beta, but not now. I'll post up part of my index.php file and forumhome template

PHP Code:

}
// ############# Paul M - Flashchat - Who is in the chat v2.00 ###############

$chatlist $DB_site->query("SELECT connections.userid, connections.roomid, rooms.name, rooms.ispublic, connections.start, 
user.usergroupid, user.displaygroupid, user.options, user.username, groupa.opentag as opentaga, groupa.closetag as closetaga, 
groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " 
TABLE_PREFIX "connections as connections
LEFT JOIN " 
TABLE_PREFIX "rooms as rooms ON(connections.roomid = rooms.id)
LEFT JOIN " 
TABLE_PREFIX "user as user ON(connections.userid = user.userid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE connections.userid IS NOT NULL ORDER BY start" 
);
unset(
$chatters);
$totalchatters 0;
while (
$chat $DB_site->fetch_array($chatlist))
{
    
$totalchatters += 1;
    
$roomname "In private room";
    
$chat['opentag'] = $chat['opentaga'] ;
    
$chat['closetag'] = $chat['closetaga'] ;
    if (
$chat['displaygroupid']) 
    {
        
$chat['opentag'] = $chat['opentagb'] ;
        
$chat['closetag'] = $chat['closetagb'] ;
    }
    if (
$chat['ispublic']) { $roomname "In ".$chat['name']; }
    
$chatters .= "<a href='member.php?u=$chat[userid]' title=\"$roomname\" >";
    
$chatters .= $chat['opentag'].$chat['username'].$chat['closetag']."</a>, ";
}
if (
$chatters)
{
    
$chatters substr($chatters0strlen($chatters)-2);
}
else
{
    
$chatters "No one is currently using the chat";
}

// ############# End of Who is in the chat ###############

// ### LOGGED IN USERS #################################################
$activeusers '';
if (
$vboptions['displayloggedin'])
{
    
$datecut TIMENOW $vboptions['cookietimeout'];
    
$numbervisible 0;
    
$numberregistered 0;
    
$numberguest 0;

    
$forumusers $DB_site->query("
        SELECT
            user.username, (user.options & 
$_USEROPTIONS[invisible]) AS invisible, user.usergroupid,
            session.userid, session.inforum, session.lastactivity,
            IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
        FROM " 
TABLE_PREFIX "session AS session
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON(user.userid = session.userid)
        WHERE session.lastactivity > 
$datecut
        " 
iif($vboptions['displayloggedin'] == 1"ORDER BY username ASC") . "
    "
);

    if (
$bbuserinfo['userid'])
    {
        
// fakes the user being online for an initial page view of index.php
        
$bbuserinfo['joingroupid'] = iif($bbuserinfo['displaygroupid'], $bbuserinfo['displaygroupid'], $bbuserinfo['usergroupid']);
        
$userinfos = array
        (
            
$bbuserinfo['userid'] => array
            (
                
'userid' => $bbuserinfo['userid'],
                
'username' => $bbuserinfo['username'],
                
'invisible' => $bbuserinfo['invisible'],
                
'inforum' => 0,
                
'lastactivity' => TIMENOW,
                
'usergroupid' => $bbuserinfo['usergroupid'],
                
'displaygroupid' => $bbuserinfo['displaygroupid'],
            )
        );
    }
    else
    {
        
$userinfos = array();
    }
    
$inforum = array();

    while (
$loggedin $DB_site->fetch_array($forumusers))
    {
        
$userid $loggedin['userid'];
        if (!
$userid)
        {    
// Guest
            
$numberguest++;
            
$inforum["$loggedin[inforum]"]++;
        }
        else if (empty(
$userinfos["$userid"]) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
        {
            
$userinfos["$userid"] = $loggedin;
        }
    }

    foreach(
$userinfos AS $userid => $loggedin)
    {
        
$numberregistered++;
        if (
$userid != $bbuserinfo['userid'])
        {
            
$inforum["$loggedin[inforum]"]++;
        }
        
$loggedin['musername'] = fetch_musername($loggedin);

        if (
fetch_online_status($loggedin))
        {
            
$numbervisible++;
            eval(
'$activeusers .= ", ' fetch_template('forumhome_loggedinuser') . '";');
        }
    }

    
// memory saving
    
unset($userinfos$loggedin);

    
$activeusers substr($activeusers 2); // get rid of initial comma

    
$DB_site->free_result($loggedins);

    
$totalonline $numberregistered $numberguest;
    
$numberinvisible $numberregistered $numbervisible;

    
// ### MAX LOGGEDIN USERS ################################
    
$maxusers unserialize($datastore['maxloggedin']);
    if (
intval($maxusers['maxonline']) <= $totalonline)
    {
        
$maxusers['maxonline'] = $totalonline;
        
$maxusers['maxonlinedate'] = TIMENOW;
        
build_datastore('maxloggedin'serialize($maxusers));
    }

    
$recordusers $maxusers['maxonline'];
    
$recorddate vbdate($vboptions['dateformat'], $maxusers['maxonlinedate'], true);
    
$recordtime vbdate($vboptions['timeformat'], $maxusers['maxonlinedate']);

    
$show['loggedinusers'] = true;
}
else
{
    
$show['loggedinusers'] = false;
}

// ### GET FORUMS & MODERATOR iCACHES ########################
cache_ordered_forums(1);
if (
$vboptions['showmoderatorcolumn'])
{
    
cache_moderators();
}
else
{
    
$imodcache = array();
    
$mod = array();
}

// define max depth for forums display based on $vboptions[forumhomedepth]
define('MAXFORUMDEPTH'$vboptions['forumhomedepth']);

$forumbits construct_forum_bit($forumid); 

Also here is the portion of my forumhome template:
Code:

<!-- end logged-in users -->
<!-- who's in flashchat -->
<tbody>
        <tr>
                <td class="thead" colspan="2">
                        <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_chatusers')"><img id="collapseimg_forumhome_chatusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_chatusers].gif" alt="" border="0" /></a>
                        Members currently in the Chat: $totalchatters
                </td>
        </tr>
</tbody>
<tbody id="collapseobj_forumhome_chatusers" style="$vbcollapse[collapseobj_forumhome_chatusers]">
        <tr>
                <td class="alt2"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="Users online today" border="0" /></td>
                <td class="alt1" width="100%"><div class="smallfont">$chatters</div></td>
        </tr>
</tbody>
<!-- end who's in flashchat -->
</if>
<tbody>

Hope you can help me out, this is a great hack I won't give up on without a fight :).

Paul M 04-24-2005 03:56 PM

Quote:

Originally Posted by Mr_Bob
I must, however FlashChat came out of beta on the 21. It worked well when I was working with the beta, but not now.

Hmmm. I wasn't aware that it had been released in full - I'll grab the latest version then to see if anything has changed.

Mr_Bob 04-24-2005 04:43 PM

Quote:

Originally Posted by Paul M
Hmmm. I wasn't aware that it had been released in full - I'll grab the latest version then to see if anything has changed.

Yeah, there are now two VBCMPS files. VBCMPS2 being for 3.0.7. Also, I know commen.php and many other files changed drasticly. There were also changes to the MYSQL tables. This may be the problem.

PS: Do not install the bots:), there is a bug where if you install them with a cms you will get call to undefined member errors. This is supposed to be fixed in a later release.

Paul M 04-24-2005 10:11 PM

Well they really f**ked up from 4.0.0 beta to 4.0.1 didn't they :rolleyes: - Yes, the BOTS are a pain - I had to edit proc.php despite turning them off.

The problem with the hack seems to be down to the fact that 4.0.1 now uses it's own table prefix system with vB - as well as the vB table prefix system - and to make it worse, there is an error in the CMS2 file as well. The default prefix they use seems to be "flashchat_", but you will find it in the config.srv.php file as below ;

Code:

<?php
        $GLOBALS['fc_config']['db'] = array(
                'host' => 'localhost',
                'user' => 'sqluser',
                'pass' => 'password',
                'base' => 'database',
                'pref' => '',
//                'pref' => 'flashchat_',
        );
?>

Try the following experimental fix and let me know how it goes.


Find this in the Hack Code ;

PHP Code:

// ############# Paul M - Flashchat - Who is in the chat v2.00 ###############

$chatlist $DB_site->query("SELECT connections.userid, connections.roomid, rooms.name, rooms.ispublic, connections.start, 
user.usergroupid, user.displaygroupid, user.options, user.username, groupa.opentag as opentaga, groupa.closetag as closetaga, 
groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " 
TABLE_PREFIX "connections as connections
LEFT JOIN " 
TABLE_PREFIX "rooms as rooms ON(connections.roomid = rooms.id)
LEFT JOIN " 
TABLE_PREFIX "user as user ON(connections.userid = user.userid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE connections.userid IS NOT NULL ORDER BY start" 
); 

and replace it with this ;

PHP Code:

// ############# Paul M - Flashchat - Who is in the chat v2.05 ###############

require_once('./flashchat/inc/config.srv.php');
$fcprefix $GLOBALS['fc_config']['db']['pref'];
$chatlist $DB_site->query("SELECT connections.userid, connections.roomid, rooms.name, rooms.ispublic, connections.start, 
user.usergroupid, user.displaygroupid, user.options, user.username, groupa.opentag as opentaga, groupa.closetag as closetaga, 
groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " 
TABLE_PREFIX $fcprefix "connections as connections
LEFT JOIN " 
TABLE_PREFIX $fcprefix "rooms as rooms ON(connections.roomid = rooms.id)
LEFT JOIN " 
TABLE_PREFIX "user as user ON(connections.userid = user.userid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE connections.userid IS NOT NULL ORDER BY start" 
); 

:)

LEAD_WEIGHT 04-24-2005 11:13 PM

Can this be change to work with AMF FlashChat http://www.tufat.com/ simular but different. :ermm:
I can fiddle around with it but I am not a coder but know how to play with codes a little. :nervous:

Mr_Bob 04-24-2005 11:55 PM

Quote:

Originally Posted by Paul M
Well they really f**ked up from 4.0.0 beta to 4.0.1 didn't they :rolleyes: - Yes, the BOTS are a pain - I had to edit proc.php despite turning them off.

The problem with the hack seems to be down to the fact that 4.0.1 now uses it's own table prefix system with vB - as well as the vB table prefix system - and to make it worse, there is an error in the CMS2 file as well. The default prefix they use seems to be "flashchat_", but you will find it in the config.srv.php file as below ;

Code:

<?php
        $GLOBALS['fc_config']['db'] = array(
                'host' => 'localhost',
                'user' => 'sqluser',
                'pass' => 'password',
                'base' => 'database',
                'pref' => '',
//                'pref' => 'flashchat_',
        );
?>

Try the following experimental fix and let me know how it goes.


Find this in the Hack Code ;

PHP Code:

// ############# Paul M - Flashchat - Who is in the chat v2.00 ###############

$chatlist $DB_site->query("SELECT connections.userid, connections.roomid, rooms.name, rooms.ispublic, connections.start, 
user.usergroupid, user.displaygroupid, user.options, user.username, groupa.opentag as opentaga, groupa.closetag as closetaga, 
groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " 
TABLE_PREFIX "connections as connections
LEFT JOIN " 
TABLE_PREFIX "rooms as rooms ON(connections.roomid = rooms.id)
LEFT JOIN " 
TABLE_PREFIX "user as user ON(connections.userid = user.userid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE connections.userid IS NOT NULL ORDER BY start" 
); 

and replace it with this ;

PHP Code:

// ############# Paul M - Flashchat - Who is in the chat v2.05 ###############

require_once('./flashchat/inc/config.srv.php');
$fcprefix $GLOBALS['fc_config']['db']['pref'];
$chatlist $DB_site->query("SELECT connections.userid, connections.roomid, rooms.name, rooms.ispublic, connections.start, 
user.usergroupid, user.displaygroupid, user.options, user.username, groupa.opentag as opentaga, groupa.closetag as closetaga, 
groupb.opentag as opentagb, groupb.closetag as closetagb
FROM " 
TABLE_PREFIX $fcprefix "connections as connections
LEFT JOIN " 
TABLE_PREFIX $fcprefix "rooms as rooms ON(connections.roomid = rooms.id)
LEFT JOIN " 
TABLE_PREFIX "user as user ON(connections.userid = user.userid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupa ON(user.usergroupid = groupa.usergroupid)
LEFT JOIN " 
TABLE_PREFIX "usergroup as groupb ON(user.displaygroupid = groupb.usergroupid)
WHERE connections.userid IS NOT NULL ORDER BY start" 
); 

:)

Works great perfectly:)
However where it says
PHP Code:


require_once('./flashchat/inc/config.srv.php'); 

Should read
PHP Code:

require_once('./chat/inc/config.srv.php'); 

FlashChat 4.0.1 uses a folder called chat now instead of FlashChat. any new people that will use this hack will run into a file error if it is not changed. Either this, or it can be made a note in installation to change this variable to your directory :).
Great job Paul:)

Paul M 04-25-2005 12:15 AM

Quote:

Originally Posted by Mr_Bob
Works great perfectly:)
However where it says
PHP Code:


require_once('./flashchat/inc/config.srv.php'); 

Should read
PHP Code:

require_once('./chat/inc/config.srv.php'); 

FlashChat 4.0.1 uses a folder called chat now instead of FlashChat. any new people that will use this hack will run into a file error if it is not changed. Either this, or it can be made a note in installation to change this variable to your directory :).
Great job Paul:)

Don't you just love consistancy, why do they change things just for the sake of it. :rolleyes:

I will make a note of it, people who upgrade from 3.x.x to 4.0.1 will probably retain the flashchat folder (as I did).

Mr_Bob 04-25-2005 12:32 AM

Quote:

Originally Posted by Paul M
Don't you just love consistancy, why do they change things just for the sake of it. :rolleyes:

I will make a note of it, people who upgrade from 3.x.x to 4.0.1 will probably retain the flashchat folder (as I did).

Yup, you have to love it :p
I myself just changed the folder to the name chat. I try to keep everything as it came as much as possible :). Even with these problems some of which plain acts of negligence on the coding side my members still like 4.0.1, and that's what makes them and myself happy:). *with the exception of installation, it was iKonboard all over again*


All times are GMT. The time now is 11:04 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01359 seconds
  • Memory Usage 1,880KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (9)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete