vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vBChat v2.3 (https://vborg.vbsupport.ru/showthread.php?t=71049)

sv1cec 02-16-2005 06:10 PM

Quote:

Originally Posted by ambrosious
Thanks, but I am having trouble with getting this to work in the What's Going On Box on my forums home page. Is there anyone who has this working that would like to share the code with me? (Now, if you just answered my question with the code above, then I apologize for being a total noob with this, could you instruct me how to make it work?)

Thanks!

The code above, will collect the names of users in vBChat, the names are collected in the variable $invBChat, while the variable $chatusers tells you how many users are in vBChat.

Now in order to show the user names in your Forum Home, "What's going on" box, you should edit your FORUMHOME template, and add the code I supplied a few posts back. In that template, find:

HTML Code:

<div style="white-space: nowrap"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div>
                                <div>$activeusers</div>
                        </div>
                </td>
        </tr>
</tbody>
<!-- end logged-in users -->

Right below that, add:

HTML Code:

<!-- Start vBChat Users -->
<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>
                        <a href='vBChat.php?$session[sessionurl]'>Users Currently Inside vBChat</a>
                </td>
        </tr>
</tbody>
<tbody id="collapseobj_forumhome_chatusers" style="$vbcollapse[collapseobj_forumhome_chatusers]">
        <tr>
                <td class="alt2"><a href="vBChat.php?$session[sessionurl]"><img src="$stylevar[imgdir_statusicon]/forum_link.gif" alt="vBChat" border="0" /></a></td>
                <td class="alt1" width="100%">
                        <div class="smallfont">
                        {$invBChat}
                        </div>
                </td>
        </tr>
</tbody>
<!-- End vBChat Users -->

This is how I have it in my system and it works fine.

Rgds

ambrosious 02-16-2005 11:09 PM

I almost have it running, see if this makes sense:

The edit for index.php looks like this:

PHP Code:

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;
        }
    }
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
REPLACE WITH:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    
// Get the users in vBChat
    
$vbchat_users = 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;
        }

        if(
preg_match("/vBChat.php/",$loggedin['location']) && $loggedin['userid']){
        
$vbchat_users[$loggedin['userid']] = $loggedin;
        }

    }

    
// Configure Peeps In vBChat
    
$invBChat "";

    if(
is_array($vbchat_users)){
        foreach(
$vbchat_users as $invbc){
            if(
$invBChat == ""){
            
$extra "";
            } else {
            
$extra ", ";
            }

        
// Get Username Style
        
$invbc['musername'] = fetch_musername($invbc);

        
$invBChat .= "{$extra}<a href='member.php?{$session['sessionurl']}&u={$invbc['userid']}'>{$invbc['musername']}</a>";
        }
    }

    if(
$invBChat == ""){
    
$invBChat "<i>No one is currently inside vBChat</i>"

But, my index.php has this instead:

PHP Code:

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

So I have no idea what to do here. It seems to work up until this point. I am still not showing whos in chat, although the box is there. If I replace what I have with the recommeded file changes then I lose "Who's Online" except for myself.

If you can help out, I'll be forever in your debt.

TNAImpact 02-17-2005 01:21 AM

Installed within minutes. Works like a charm, the page re-loading can get a little annoying, other than that I'm very impressed. :) Keep it up.

sv1cec 02-17-2005 05:03 AM

In your index.php find:

PHP Code:

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

Replace that with:

PHP Code:

$vbchat_users = array();
$chatusers=0;
while (
$loggedin $DB_site->fetch_array($forumusers))
        {
                
$userid $loggedin['userid'];
                if (!
$userid)
                {        
// Guest
                        
$numberguest++;
                        
$inforum["$loggedin[inforum]"]++;
                }
                else if (empty(
$userinfos["$userid"]['lastactivity']) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
                {
                        
$userinfos["$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') . '";');
                        }
                        if(
preg_match("/vBChat.php/",$loggedin['location']) && $loggedin['userid']){
                        
$vbchat_users[$loggedin['userid']] = $loggedin;
                }
        } 
// Configure Peeps In vBChat
    
$invBChat "";

    if(
is_array($vbchat_users)){
        foreach(
$vbchat_users as $invbc){
            if(
$invBChat == ""){
            
$extra "";
            } else {
            
$extra ", ";
            }

        
// Get Username Style
        
$invbc['musername'] = fetch_musername($invbc);

        
$invBChat .= "{$extra}<a href='member.php?{$session['sessionurl']}&u={$invbc['userid']}'>{$invbc['musername']}</a>";
        
$chatusers $chatusers+1;
        }
    }

    if(
$invBChat == ""){
    
$invBChat "<i>No one is currently inside vBChat</i>";
    } 

See if this works.

Rgds

illusions 02-17-2005 09:57 AM

:( I followed the instructions clearly, even had my vbchat installed correctly... but when i try to upload my forum I recieve the following error msg...

Parse error: parse error, unexpected T_VARIABLE in /home/illusion/public_html/forums/index.php on line 298

can anyone tell me where i have gone wrong? would appreciate your input.

savageracer 02-17-2005 02:00 PM

my vbchat works great with the default style on the board.. If a user is in another of the styles all they get is a blank page.. www.savageracer.com/forum/index.php

I added all the mods to each of the templates.. Any help would be greatly apreciated

savageracer 02-17-2005 02:17 PM

I just looked and the templates.. Custom Templates is only in my default style. How do I add these to all the styles in the forum

Thanks
RICH

Chrissicom 02-17-2005 06:52 PM

I did the required changes in functions_online.php but it still says Unknown Location in Who is Online... might the reason be that I also have v3 Arcade installed?

ambrosious 02-19-2005 07:36 PM

Quote:

Originally Posted by sv1cec
In your index.php find:

PHP Code:

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

Replace that with:

PHP Code:

$vbchat_users = array();
$chatusers=0;
while (
$loggedin $DB_site->fetch_array($forumusers))
        {
                
$userid $loggedin['userid'];
                if (!
$userid)
                {        
// Guest
                        
$numberguest++;
                        
$inforum["$loggedin[inforum]"]++;
                }
                else if (empty(
$userinfos["$userid"]['lastactivity']) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
                {
                        
$userinfos["$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') . '";');
                        }
                        if(
preg_match("/vBChat.php/",$loggedin['location']) && $loggedin['userid']){
                        
$vbchat_users[$loggedin['userid']] = $loggedin;
                }
        } 
// Configure Peeps In vBChat
    
$invBChat "";

    if(
is_array($vbchat_users)){
        foreach(
$vbchat_users as $invbc){
            if(
$invBChat == ""){
            
$extra "";
            } else {
            
$extra ", ";
            }

        
// Get Username Style
        
$invbc['musername'] = fetch_musername($invbc);

        
$invBChat .= "{$extra}<a href='member.php?{$session['sessionurl']}&u={$invbc['userid']}'>{$invbc['musername']}</a>";
        
$chatusers $chatusers+1;
        }
    }

    if(
$invBChat == ""){
    
$invBChat "<i>No one is currently inside vBChat</i>";
    } 

See if this works.

Rgds


I put the above in and got a parse error, unexpected else on a line way down. If you dont mind, would you look to see what is wrong with this code? Have I mucked it up?

PHP Code:

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


Thanks for all your help on this so far!

Code3Services 02-20-2005 02:13 AM

Quick question, everything regarding vBChat is running slowly, such as sending a message in the chat rooms, or modifying personal settings. Any suggestions on how to speed things up?

Thanks!


All times are GMT. The time now is 12:50 PM.

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.04439 seconds
  • Memory Usage 1,937KB
  • 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
  • (2)bbcode_html_printable
  • (7)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)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