vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Chat Modifications - Flashchat 5: Who is chatting (Add On) (https://vborg.vbsupport.ru/showthread.php?t=194602)

Mosh 10-25-2008 10:00 PM

Flashchat 5: Who is chatting (Add On)
 
1 Attachment(s)
Please click Mark as Installed if you are using this hack.

IMPORTANT NOTICE: This hack has now been discontinued - this means that while it will remain available for download and use, there will be no further updates as this thread is no longer monitored. I am also not interested in doing paid work requests to update this hack at all.


IMPORTANT NOTICE 2: This hack only works with FlashChat 5 and later versions, and will not work with FlashChat 4.7.x.
There is version of this hack that will work with FlashChat 4.7.12, and can be downloaded here.



What Does This Hack Do?[hr]hr[/hr]
This is an add-on/enhancement to Paul M's Flashchat: Who is chatting hack.
This is the v3.8 port of my v3.7.x hack with extra 10 extra display locations, and enabling display locations per usergroup via usergroup permissions (no longer centrally, so allowing extra flexability).


What hacks need installing before installing this hack?

These hacks need to be installed in this order and working correctly, for this hack to work.
  1. Tufat's FlashChat v5.x.x
  2. Paul M's Flashchat 5 Integration for vB 3.8 v3.8.002
  3. Paul M's Members who are chatting in Flashchat 5 v3.8.002
  4. Then install this hack.

This does not change the functionality of Paul M's hack, this is just an enhancement to your installed version of Flashchat: Who is chatting.

The members on my forum requested that the Members currently using Flashchat box be moved to the top of the forums as it was a long way to scroll down to see who was chatting, at the top members could see who was chatting.

As members had to enter the chat or visit the forum homepage again to see who was chatting, I fixed it so that my members could also see who was chatting as they browsed the various forums and threads as well as on the who is online pages.

Paul M's has kindly given me permission to use some of his code in my Who is chatting add-on hacks.

Thank you Paul, for all your work on the Flashchat integration, it makes all our lives easier :)


What You Get
  1. It displays the chat list under the navbar in the following locations:
    • Forum Home
    • Forum Display
    • Show Thread
    • Who is Online
    • Members Profile pages
    • Search pages
    • Tag Search
    • Social Groups
    • Calendars
    • FAQ
    • Albums
    • User Profile
    • UserCP
    • Private Messages
    • Subscriptions
    • Members List
  2. The list view is collapsible, so you see just the number.
  3. Users who should display as coloured or bold etc are displayed correctly (based on the display usergroup)
  4. If you 'hover' over a username it will show the room they are chatting in and their status (away etc).
  5. If the chat is empty, a simple "No one is currently using the chat." message is displayed.
  6. Display the Most Ever chatters if enabled.
  7. The ability to turn it on/off is in the AdminCP Options (independent of Paul M's hack).
  8. The ability to select which locations this hack is displayed (independent of Paul M's hack).
  9. The ability to allow only certain usergroups to view the list (again, independent of Paul M's hack).
Note: This hack cannot display any bots in the chat, due to the strange way that FlashChat stores this information.


vBulletin Version Compatibility[hr]hr[/hr]
This hack can only be used with v3.8.0 and later versions.

For the unsupported v3.7.x version of this hack - check here. For the unsupported v3.6.x version of this hack - check here. For the unsupported v3.5.x version of this hack - check here.

NOTE: I will not be upgrading this hack to vBulletin v4.0.x.



Install/Uninstall Instructions[hr]hr[/hr]
The InstallInstructions.txt instructions file is included in attached .zip file.


Screenshots[hr]hr[/hr]
Show in this order:
  • Usergroup permissions
  • Who is Chatting box
  • AdminCP options


Version History[hr]hr[/hr]
v3.8.005 - Friday 20th February 2009
-- Final v3.8.x Release
-- Updated: To bring in line with Paul M's Members who are chatting in Flashchat 5 hack v3.8.002 (rev 1.6)
-- Changed: Installation Instructions (now has uninstall instructions)
-- Added: VersionHistory.txt

v3.8.004 - Thursday 27th November 2008
-- Updated: To bring in line with Paul M's Members who are chatting in Flashchat 5 hack v3.8.002 (rev 1.5)
-- Changed: Installation Instructions

v3.8.003 - Tuesday 25th November 2008
-- Changed: Usergroup permissions code in all plugins
-- Changed: Installation Instructions
-- Changed: Screenshots
-- Removed: 1 plugin (no longer needed)
-- Removed: 17 AdminCP Options (no longer needed, now set via usergroup permissions)
-- Added: 17 Phrases
-- Added: 1 bitfield file

v3.8.002 - Tuesday 18th November 2008
-- Updated: To bring in line with Paul M's Members who are chatting in Flashchat 5 hack v3.8.001
-- Changed: Install code
-- Changed: Installation Instructions

v3.8.001 - Sunday 26th October 2008
-- Initial vBulletin v3.8.x Release
-- Added: 10 new plugins (for new display locations)
-- Added: 10 AdminCP Options


Thanks[hr]hr[/hr]
Thanks go out to Paul M who gave me permission to use some of his install code.


Show Your Appreciation [hr]hr[/hr]
Although not required, if you have enjoyed the benefits of this hack, and would like show your appreciation for my efforts, then please feel free to click on the Support Developer link and donate any amount you feel is appropriate.

Bounce 10-26-2008 10:00 PM

Thanks for this,very good :)

Now...... How do I move the box to below the forums on forumhome, is this possible? lol:eek:

cherylferraro 10-27-2008 11:49 PM

Thank you for this mod, I know our users will appreciate it.

I do have one problem. The description of the mod indicates "If the chat is empty, a simple "No one is currently using the chat." message is displayed."

On the forum home page it displays correctly:

https://vborg.vbsupport.ru/

On the other pages, such as the thread display page, it looks like this:

https://vborg.vbsupport.ru/

What can I do to fix this?

Mosh 10-27-2008 11:59 PM

Quote:

Originally Posted by cherylferraro (Post 1654186)
Thank you for this mod, I know our users will appreciate it.

I do have one problem. The description of the mod indicates "If the chat is empty, a simple "No one is currently using the chat." message is displayed."

On the forum home page it displays correctly:

http://www.browncafe.com/forum/images/whochat2.png

On the other pages, such as the thread display page, it looks like this:

http://www.browncafe.com/forum/images/whochat.png

What can I do to fix this?

This is a classic sign that you have not done all 3 edits in Step 3 of the installation instructions ..... these edits need to be done to show the stats on other pages apart from the forumhome, otherwise they will be blank outside of the forumhome page.

cherylferraro 10-28-2008 02:00 AM

Thank you for your prompt response.

I did complete each of the edits on Members in Flashchat 5 (2). Perhaps I have done something wrong... If you don't mind I will post the Members in Flashchat 5 (2) that I am using.

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;
        }
    }



Mosh 10-28-2008 06:35 AM

Quote:

Originally Posted by cherylferraro (Post 1654240)
Thank you for your prompt response.

I did complete each of the edits on Members in Flashchat 5 (2). Perhaps I have done something wrong... If you don't mind I will post the Members in Flashchat 5 (2) that I am using.

Try this instead, as I know it works:
PHP Code:

REMOVED, AS HACK IS NOW ON v3.8.003 AND CODE WILL NOT WORK


cherylferraro 10-28-2008 02:48 PM

I tried using the code you provided and the display is still incorrect.

I am also using vbadvanced and vbseo on this forum, could one of those cause this problem?

Mosh 10-28-2008 09:49 PM

Quote:

Originally Posted by cherylferraro (Post 1654574)
I tried using the code you provided and the display is still incorrect.

I am also using vbadvanced and vbseo on this forum, could one of those cause this problem?

Yes, it is more than likely. People have used this with vBSEO without issue (so is probably not the culprit, but it is possible), so I would suspect that vBAdvanced is the probable case of the issue.

You may need to globalise some variables due to the fact that you have vBA installed, so check out my profile and look at the flashchat hacks that I wrote for vBA (but no longer support them) and look at the installation steps that mention Portal Output Global Variables, entering the three variables is your most likely way of getting this to work.

However, the above is only a suggestion, as I will not provide support to get this to work with vBA (or vBSEO), so if it works, then it is all good, if not, then there is nothing I can do to help further.

Greek76 10-31-2008 08:28 AM

Quote:

Originally Posted by Mosh (Post 1654320)
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.

Mosh 10-31-2008 11:47 AM

Quote:

Originally Posted by Greek76 (Post 1656490)
That code worked for me. I had the same problem like the other poster. I have vbseo and vbadvanced installed aswell.

The code I posted is just the edits in Step 3 done correctly, there are no differences from the installation instructions.

By the way, if you are using this hack, then please click Mark as Installed.


All times are GMT. The time now is 10:21 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.01444 seconds
  • Memory Usage 1,955KB
  • 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_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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