vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Hide Avatars & Signatures from Guests (https://vborg.vbsupport.ru/showthread.php?t=144629)

Zieen 04-11-2007 10:00 PM

Hide Avatars & Signatures from Guests
 
I searched the forum for this template modification and failed to find a satisfactory result. The following template modifications will prevent guests (unregistered / not logged in) from seeing avatars and signatures.

Why? Some communities have avatars with NSFW (not safe for work) avatars and signatures. This adult content should not be viewed in most workplaces or by new guests not wanting such exposure. This insures that they won't run into problems until they register -- after which they were hopefully instructed to disable them in their User CP if desired.


Before starting you'll want to verify the usergroup id of Unregistered / Not Logged In. It should be one, but check in your Usergroup Manager to make sure.
Anyways...

Go to your Admin CP and open your Style Manager. Find your default style and select edit templates from the drop down menu. Expand Postbit Templates and select postbit.

Find...
PHP Code:

<if condition="$show['avatar']" 

Add before...
PHP Code:

<if condition="$bbuserinfo['usergroupid'] != 1"

Find...
PHP Code:

$vbphrase[xs_avatar]</phrase>" border="0" /></a></td></if> 

Add after...
PHP Code:

</if> 

Find...
PHP Code:

<if condition="$post['signature']"

Add before...
PHP Code:

<if condition="$bbuserinfo['usergroupid'] != 1"

Find...
PHP Code:

        <!-- / sig -->
        </if> 

Add after...
PHP Code:

</if> 

The same edits must be made in postbit_legacy.

Avatars and signatures should no longer be visible to guests. Be sure to verify that registered users can still view avatars and signatures.

I'm no expert coder and I'm a relative newbie to vBulletin, but I hope this helps someone. It helped me.

AuroraStorm 04-12-2007 02:41 AM

Can you do this with adult smilies?

rjmjr69 04-12-2007 02:41 AM

nice thank you love template edits much better than plug ins

HMBeaty 04-12-2007 02:55 AM

Just another addition, another way you could do this is by using
HTML Code:

<if condition="$show['member']">
Instead of
HTML Code:

<if condition="$bbuserinfo['usergroupid'] != 1">

Zieen 04-13-2007 02:59 AM

And that checks to see if they are a registered member? Good to know. I was having issues with a lot of misleading / outdated information elsewhere. I'll test that on my site and update the edits. Thanks.

MoB Dudditz MD 04-20-2007 02:33 AM

Very nice - something so simple that I have overlooked but needed.
Cuts loading time and saves bandwidth of visitors.TY

I believe you can go one step further by combining both conditionals.

<if condition="$show['avatar'] AND $show['member']">

<if condition="$post['signature'] AND $show['member']">

SEE BELOW
This way, you avoid the extra </if> since its not needed
and saves a few characters of code in the process.

In your postbit and postbit_legacy
FIND:
PHP Code:

<if condition="$show['avatar']"

REPLACE WITH:
PHP Code:

<if condition="$show['avatar'] AND $show['member']"

FIND:
PHP Code:

<if condition="$post['signature']"

REPLACE WITH:
PHP Code:

<if condition="$post['signature'] AND $show['member']"


HMBeaty 04-20-2007 02:39 AM

Quote:

Originally Posted by MoB Dudditz MD (Post 1231665)
I believe you can go one step further by combining both conditionals
by adding the AND after each condition.

PHP Code:

<if condition="$show['avatar'] AND $show['member']"

PHP Code:

<if condition="$post['signature'] AND $show['member']"

This way, you avoid the extra </if> since its not needed
and saves a few characters of code in the process.

Thats true as well

UncoderMom 04-26-2007 12:09 PM

Is there a way to show a phrase that says "to see signatures and avatars you must register" in the sig area?

UncoderMom 05-06-2007 10:03 PM

Quote:

Originally Posted by UncoderMom (Post 1235773)
Is there a way to show a phrase that says "to see signatures and avatars you must register" in the sig area?

??? any idea?

MoB Dudditz MD 09-09-2007 07:26 PM

You could add an <else />

Code:

<if condition="$show['avatar'] AND $show['member']">
vb content here
<else />
You must register to view Signatures.
</if>



All times are GMT. The time now is 09:47 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.02330 seconds
  • Memory Usage 1,758KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_html_printable
  • (14)bbcode_php_printable
  • (2)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