Thread: Chat Modifications - Flashchat 5: Who is chatting (Add On)
View Single Post
  #9  
Old 10-31-2008, 08:28 AM
Greek76's Avatar
Greek76 Greek76 is offline
 
Join Date: Aug 2006
Location: Planet Earth
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mosh View Post
Try this instead, as I know it works:
PHP Code:
if ($show['wic'])
{
    
$lang $vbulletin->options['chatlang'];
    
$chat $vbulletin->options['chatfolder'];
    require_once(
DIR.'/'.$chat.'/temp/config.srv.php'); 
    require_once(
DIR.'/'.$chat.'/inc/langs/'.$lang.'.php'); 
    
$fcprefix $GLOBALS['fc_config']['db']['pref'];

    
$configlist $vbulletin->db->query_read_slave("
        SELECT config_id, value 
        FROM "
.$fcprefix."config_values 
        WHERE instance_id = 1 AND config_id IN (9,802)
    "
);

    
$fcc = array();
    while (
$config $vbulletin->db->fetch_array($configlist))
    {
        
$fcc[$config['config_id']] = $config['value'];
    }

    if (
THIS_SCRIPT == 'index' OR $vbulletin->options['wicao'])
    {

        
$chatlist $vbulletin->db->query_read_slave("
            SELECT connections.*,rooms.*,user.*
            FROM "
.$fcprefix."connections as connections
            LEFT JOIN "
.$fcprefix."rooms as rooms ON connections.roomid = rooms.id
            LEFT JOIN "
.TABLE_PREFIX."user as user ON connections.userid = user.userid
            WHERE connections.userid > 0 AND connections.ip != '
{$fcc[9]}
            AND connections.updated > DATE_SUB(NOW(),INTERVAL 
{$fcc[802]} SECOND) 
            ORDER BY start
        "
);

        
$i 0;
        foreach (
$GLOBALS['fc_config']['languages'][$lang]['status'] as $value
        { 
            
$i += 1
            
$status[$i] = $value
        }

        unset (
$chatters);
        
$totalchatters 0;
        
$chattersdesc $vbphrase['wic_using_flashchat'];
        while (
$chat $vbulletin->db->fetch_array($chatlist))
        {
            
$totalchatters += 1;
            
$chat['roomname'] = "In private room";
            if (
$chat['ispublic']) $chat['roomname'] = "In ".$chat['name']; 
            if (
$chat['state'] > 1$chat['roomname'] .= " (".$status[$chat['state']].")"
            
$ugroup = ($chat['displaygroupid'] > $chat['displaygroupid'] : $chat['usergroupid']);
            
$chat['opentag'] = $vbulletin->usergroupcache[$ugroup]['opentag'];
            
$chat['closetag'] = $vbulletin->usergroupcache[$ugroup]['closetag'];
            eval(
'$chatters .= "' fetch_template('Display_Chatters_User') . '" . ", ";');
        }

        if (
$chatters)
        {
            
$chatters substr($chatters0, -2);
        }
        else
        {
            
$chatters $vbphrase['wic_no_chatters'];
        }

        if (
$vbulletin->products['paulm_fci_37'])
        {
            
$fcpath 'misc.php?do=flashchat';
        }
        else
        {
            
$fcpath $vbulletin->options['chatfolder'].'/flashchat.php';
        }

        if (
$vbulletin->options['wiccol'])
        {
            
$vbcollapse['collapseimg_forumhome_chatusers'] = '_collapsed';
            
$vbcollapse['collapseobj_forumhome_chatusers'] = 'display:none;';
        }

        
$totalchatters vb_number_format($totalchatters);
        
$chattitle construct_phrase($chattersdesc,$totalchatters);

        
$pid 'paulm_wic_37';
        if (
$pemdata37['set'] == true)
        {
            
$data_wic =& $pemdata37[$pid];
        }
        else
        {
            if (
$pemdata unserialize($vbulletin->options['pemdata']))
            {
                
$pemdata['set'] = true;
                
$data_wic =& $pemdata[$pid];
            }
            else
            {
                
$data_wic = array('version' => 'N/A');
            }
         }
        if (!
$vbulletin->options['wicao'])
        {
            if (
strpos($vbulletin->templatecache['FORUMHOME'],'forumhome_wgo_pos2'))
            {    
// Use template hook if it exists.
                
eval('$template_hook[\'forumhome_wgo_pos2\'] .= "' fetch_template('Display_Chatters') . '";');
            }
            else
            {    
// Use old template injection system.
                
$stext '<!-- end logged-in users -->';
                
$rtext $vbulletin->templatecache['FORUMHOME'];
                
$itext $vbulletin->templatecache['Display_Chatters'];
                
$vbulletin->templatecache['FORUMHOME'] = str_replace($stext,$itext.$stext,$rtext);
            }
        }
    }
    else
    {
        if (
$vbulletin->options['wicall'])
        { 
            
$chatlist $vbulletin->db->query_first_slave("
                SELECT COUNT(userid) AS total
                FROM "
.$fcprefix."connections
                WHERE userid > 0 AND ip != '
{$fcc[9]}
                AND updated > DATE_SUB(NOW(),INTERVAL 
{$fcc[802]} SECOND) 
            "
);
            
$totalchatters vb_number_format($chatlist['total']);
        }
    }
    
    if (
$vbulletin->options['wicmost'])
    { 
        if (empty(
$vbulletin->maxloggedin))
        {
            if (
method_exists($vbulletin->datastore,'do_fetch'))
            { 
// Datastore extension exists, use it
                
$vbulletin->datastore->do_fetch('maxloggedin',$errors);
                if (
$errors[0])
                { 
// Fetch failed, use original datastore
                    
$vbulletin->datastore->do_db_fetch("'maxloggedin'");

                }
            }

            else
            { 
// No extension, use original datastore
                
$vbulletin->datastore->do_db_fetch("'maxloggedin'");
            }
        }

        if (
$totalchatters intval($vbulletin->maxloggedin['maxchatters']))
        {
            
$vbulletin->maxloggedin['maxchattersdate'] = TIMENOW;
            
$vbulletin->maxloggedin['maxchatters'] = $totalchatters;
            
build_datastore('maxloggedin'serialize($vbulletin->maxloggedin),1);

        }

        if (
$vbulletin->options['wicmost'])
        {
            if (
$vbulletin->options['wic24'])
            {
                
$description $vbphrase['wic_members_24'];
            }
            else
            {
                
$description $vbphrase['wic_members_day'];
            }

            
$chatmax construct_phrase
                    
$descriptionvb_number_format($vbulletin->maxloggedin['maxchatters']),
                    
vbdate$vbulletin->options['dateformat'], $vbulletin->maxloggedin['maxchattersdate'], true ),
                    
vbdate$vbulletin->options['timeformat'], $vbulletin->maxloggedin['maxchattersdate'] ) 
            );

            
$chatters $chatmax "<br />" $chatters;
        }
    }


That code worked for me. I had the same problem like the other poster. I have vbseo and vbadvanced installed aswell.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01356 seconds
  • Memory Usage 1,945KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete