vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   ibProArcade Archive (https://vborg.vbsupport.ru/forumdisplay.php?f=174)
-   -   [HOW-TO] Show all Guests in the "Active Users List" (https://vborg.vbsupport.ru/showthread.php?t=204897)

GreasySpoon 02-10-2009 02:11 PM

[HOW-TO] Show all Guests in the "Active Users List"
 
I think there is a bug which dont't show correct the count of guests in the active users list.

To fix this bug you have to edit two files. /arcade/functions/dbclass.php and /arcade/functions/dbclass_mysqli.php

Find the following code:
PHP Code:

if(strpos($the_query"s.login_type")) {
            
$gtlocation strpos($the_query">");
            
$timestamp substr($the_query$gtlocation+110);
            
$the_query "SELECT s.userid, s.location, s.in_game, u.username, g.opentag, g.closetag, u.options 
                            FROM ibf_session as s 
                            LEFT JOIN ibf_user as u ON (u.userid = s.userid) 
                            LEFT JOIN ibf_usergroup as g ON (u.usergroupid = g.usergroupid)
                            WHERE s.lastactivity > " 
$timestamp " AND s.location LIKE '%rcade%' AND s.location NOT LIKE '%admin%'
                            GROUP BY s.userid
                            ORDER BY u.username ASC"
;
        } 

And delete the "GROUP BY s.userid" line.

Find:
PHP Code:

$invisible_bit_from_right 10;
                    
$userdata base_convert($users['options'],10,2);
                    
$invisible substr($userdata,(strlen($userdata)-$invisible_bit_from_right),1);

            
$active_list[] = array( name        => $users['member_name'],
                                    
id            => $users['member_id'],
                                    
in_game        => $users['in_game'],
                                    
suffix        => $users['suffix'],
                                    
prefix        => $users['prefix'],
                                    
login        => $users['login_type'],
                                                                    
invisible        => $invisible
                             
);

            if( 
trim($users['in_game']) != "" )
            {
                
$temp explode("|" $users['in_game']);
                
$the_games[] = $temp[0];
            } 

Replace with:
PHP Code:

if (($users['member_id'] != $active_list[intval(count($active_list) - 1)]['id']) || ($users['member_id'] == 0)){
                
$invisible_bit_from_right 10;
                
$userdata base_convert($users['options'],10,2);
                
$invisible substr($userdata,(strlen($userdata)-$invisible_bit_from_right),1);

                
$active_list[] = array( name        => $users['member_name'],
                                        
id            => $users['member_id'],
                                        
in_game        => $users['in_game'],
                                        
suffix        => $users['suffix'],
                                        
prefix        => $users['prefix'],
                                        
login        => $users['login_type'],
                                                                        
invisible        => $invisible
                                 
);

                if( 
trim($users['in_game']) != "" )
                {
                    
$temp explode("|" $users['in_game']);
                    
$the_games[] = $temp[0];
                }
            } 

Demo: At the bottom of our arcade.

Greetz

rapidphim 02-13-2009 09:22 PM

did your show the number of invisible members?

GreasySpoon 02-15-2009 05:14 PM

Sadly not. I think this is a bug in the arcade code. I will try to find a sollution.

Greetz

stangger5 02-16-2009 11:42 AM

A place to start is arcade/modules/mod_arcade..;)

Right after,,
//Gets the users active in the arcade and returns the html for it

GreasySpoon 02-16-2009 12:14 PM

Got it!

Find this code block (line 1002):
PHP Code:

else
                            {
                                
// check for Admin who can see invisible users
                                
if ($this->user['mgroup'] == 6)
                                {
                          
$names .= ($a) ? ", " "";
                                
$names .= $span_pre."<a href='./member.php?$session[sessionurl]&amp;u=".$this_user['id']."'>";
                                
$names .= $this_user['prefix'].$this_user['name'].$this_user['suffix'];
                                
$names .= "</a>*".$span_suf;
                        
$a++;
                                    }
                            } 

and replace with:
PHP Code:

else
                            {
                                
// check for Admin who can see invisible users
                                
if ($this->user['mgroup'] == 6)
                                {
                          
$names .= ($a) ? ",&nbsp;" "";
                                
$names .= $span_pre."<a href='./member.php?$session[sessionurl]&amp;u=".$this_user['id']."'>";
                                
$names .= $this_user['prefix'].$this_user['name'].$this_user['suffix'];
                                
$names .= "</a>*".$span_suf;
                        
$a++;
                                    }
                                
$anon_count++;
                            } 

You need only one line ($anon_count++; ) nearly the end of the code block.

Greetz

stangger5 02-16-2009 01:32 PM

$anon_count++; is already there...

GreasySpoon 02-16-2009 03:24 PM

Not in the "else" block. Try my code, it works.

stangger5 02-17-2009 10:59 AM

I see now,,,,Thanks !!

GreasySpoon 02-17-2009 11:08 AM

You are welcome.

Please also take a look at the bug fix in my first post. There was a bug that sometimes showed usernames twice.

Greetz

stangger5 02-17-2009 11:16 AM

I`m glad you said that..I didnt see the extra edit you made..

Thanks again !!


All times are GMT. The time now is 11:03 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.01122 seconds
  • Memory Usage 1,785KB
  • 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete