vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   I want to hide $activeusers and $browsers from guests (https://vborg.vbsupport.ru/showthread.php?t=47813)

Figment 01-17-2003 10:52 PM

I want to hide $activeusers and $browsers from guests
 
Searched high and low and cannot find a hack that would allow me to hide active user and browsing user information from specific user groups (in particular, guests)

Does anyone know of such a thing??

TIA

Neo 01-18-2003 03:51 PM

In index.php find:

PHP Code:

      eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
    }
  }
  
$DB_site->free_result($loggedins); 

replace with:

PHP Code:

      eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
    }
  }
  
$DB_site->free_result($loggedins);
  
  if (
$bbuserinfo[userid]==0) {
    
$activeusers="";
  } 

now in forumdisplay.php fine:

PHP Code:

        }
        eval(
"\$onlineusers .= \"".gettemplate('forumdisplay_loggedinusers')."\";");
    }


and replace with:

PHP Code:

        }
        eval(
"\$onlineusers .= \"".gettemplate('forumdisplay_loggedinusers')."\";");
    }
}
  if (
$bbuserinfo[userid]==0) {
    
$browsers="";
  } 

that should do it..

Figment 01-18-2003 08:07 PM

1 Attachment(s)
Thanks for the reply.

Sorry, I obviously didn't explain very clearly. Your solution does part of what I am trying to achieve. On the forum homepage, I want to hide the entire section (see attached) from guests

Edit: Unless I did something wrong (which I have checked many times) it seems to be working so the guests can see the loggedinusers template, whilst as admin I cannot !

Silenced Soul 01-20-2003 01:08 PM

it should work, check and make sure that you didn't change on of the $bbuserinfo[userid]==0. Because if you set it to anything, such as 1 or such, then one of your members, in this case, you cannot see it whilst the guests can.

If that doesn't work, try putting:

PHP Code:

eval("\$activeusers .= \", ".gettemplate('forumhome_loggedinuser')."\";");
    }
  }
  
$DB_site->free_result($loggedins);
  
  if (
$bbuserinfo[userid]==&& $bbuserinfo[usergroupid]==1]) {
    
$activeusers="";
  } 

PHP Code:

}
        eval(
"\$onlineusers .= \"".gettemplate('forumdisplay_loggedinusers')."\";");
    }
}
  if (
$bbuserinfo[userid]==&& $bbuserinfo[usergroupid]==1) {
    
$browsers="";
  } 

that might make the fix.

Figment 01-20-2003 10:02 PM

Silenced soul.

Tried your version, got a parse error in index.php on the if...... line

Retried with Neos suggestion and the names of the logged in users and browsers are no longer visible to guests, but the forumhome_loggedinusers template is still visible (albeit without any names)

I could really do with this template not being visible to guests either, as it shows the number of members/guests online, which I would prefer them not to see.

Any more ideas?

TIA

nuno 01-21-2003 01:43 AM

index.php
find
PHP Code:

if ($displayloggedin

replace with
PHP Code:

if ($displayloggedin and $bbuserinfo[userid] >= 1

forumdisplay.php
find
PHP Code:

if ($showforumusers

replace with
PHP Code:

if ($showforumusers and $bbuserinfo[userid] >= 1

That's all folks. :D

Figment 01-21-2003 06:18 AM

Thanks Nuno, that did the trick :) :)

Thanks to you other guys for your help too


All times are GMT. The time now is 12:34 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.01072 seconds
  • Memory Usage 1,742KB
  • 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
  • (10)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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