Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Template Modifications

Reply
 
Thread Tools
Hide Avatars & Signatures from Guests Details »»
Hide Avatars & Signatures from Guests
Version: 1.00, by Zieen Zieen is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Version: 3.6.5 Rating:
Released: 04-11-2007 Last Update: Never Installs: 38
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-12-2007, 02:41 AM
AuroraStorm's Avatar
AuroraStorm AuroraStorm is offline
 
Join Date: Nov 2006
Location: ATHell
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you do this with adult smilies?
Reply With Quote
  #3  
Old 04-12-2007, 02:41 AM
rjmjr69's Avatar
rjmjr69 rjmjr69 is offline
 
Join Date: Jan 2007
Location: Southie
Posts: 876
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice thank you love template edits much better than plug ins
Reply With Quote
  #4  
Old 04-12-2007, 02:55 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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">
Reply With Quote
  #5  
Old 04-13-2007, 02:59 AM
Zieen's Avatar
Zieen Zieen is offline
 
Join Date: Oct 2006
Location: Iowa, USA
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 04-20-2007, 02:33 AM
MoB Dudditz MD MoB Dudditz MD is offline
 
Join Date: Dec 2006
Location: IL
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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']"
Reply With Quote
  #7  
Old 04-20-2007, 02:39 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MoB Dudditz MD View Post
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
Reply With Quote
  #8  
Old 04-26-2007, 12:09 PM
UncoderMom UncoderMom is offline
 
Join Date: May 2006
Location: My office chair!
Posts: 567
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to show a phrase that says "to see signatures and avatars you must register" in the sig area?
Reply With Quote
  #9  
Old 05-06-2007, 10:03 PM
UncoderMom UncoderMom is offline
 
Join Date: May 2006
Location: My office chair!
Posts: 567
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UncoderMom View Post
Is there a way to show a phrase that says "to see signatures and avatars you must register" in the sig area?
??? any idea?
Reply With Quote
  #10  
Old 09-09-2007, 07:26 PM
MoB Dudditz MD MoB Dudditz MD is offline
 
Join Date: Dec 2006
Location: IL
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could add an <else />

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:03 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04812 seconds
  • Memory Usage 2,312KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_html
  • (14)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete