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>


Mum 11-20-2007 04:28 PM

Quote:

Originally Posted by MoB Dudditz MD (Post 1231665)
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']"


I tried this but doesn't work for 3.6.8 are you able to help me? All i want to do is hide the signatures unless you are logged in.

Fungsten 11-20-2007 05:40 PM

I can't see it using an admin account. Uninstalled the mods.

Mum 11-24-2007 04:38 PM

What do you mean you can't see it? Once you've made the changes, only members will see it. So you need to log out, having an admin account won't help.

Kimmi 03-10-2008 02:14 AM

Will this also stop certain usergroups from seeing the sigs.. or does some k now what code i could change to do so.?

thanks

deezelpope 03-13-2008 01:54 PM

Quote:

Originally Posted by MoB Dudditz MD (Post 1231665)
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']"


Beautiful! Thank you, this is exactly what I've been looking for!:up:

urdu 05-26-2008 09:23 AM

Hello,

if i want add more then 1 group

like Users Awaiting Email Confirmation and (COPPA) Users Awaiting Moderation

so what i do ?

urdu 05-27-2008 08:41 AM

Quote:

Originally Posted by urdu (Post 1531668)
Hello,

if i want add more then 1 group

like Users Awaiting Email Confirmation and (COPPA) Users Awaiting Moderation

so what i do ?

no body here in vb.org can help me ???

Fungsten 06-03-2008 04:51 PM

Quote:

Originally Posted by urdu (Post 1532683)
no body here in vb.org can help me ???

I'm not sure but I think if you go to where the group IDs are you can add them separated by commas.

urdu 06-03-2008 09:29 PM

Quote:

Originally Posted by Fungsten (Post 1539840)
I'm not sure but I think if you go to where the group IDs are you can add them separated by commas.

you mean like this ?

Code:

<if condition="$bbuserinfo['usergroupid'] != 1,2">
or
Code:

<if condition="$bbuserinfo['usergroupid'] != 1, 2">
or
Code:

<if condition="$bbuserinfo['usergroupid'] != 1 , 2">
========
i tryed all these one by one but not working even i got error :confused:

Fungsten 06-03-2008 09:38 PM

Quote:

Originally Posted by urdu (Post 1540041)
you mean like this ?

Code:

<if condition="$bbuserinfo['usergroupid'] != 1,2">
or
Code:

<if condition="$bbuserinfo['usergroupid'] != 1, 2">
or
Code:

<if condition="$bbuserinfo['usergroupid'] != 1 , 2">
========
i tryed all these one by one but not working even i got error :confused:

Don't know. Sorry.

Alfa1 06-07-2008 04:19 PM

Since the template has got hooks for the signature, it seems better to use a separate plugin if you only want to hide signature from guests. Hiding signatures from guests can do a lot of good for your SEO.

Why not use the hooks: postbit_signature_start and postbit_signature_end to add the code that Zieen describes above?

Quote:

Originally Posted by Fungsten (Post 1539840)
I'm not sure but I think if you go to where the group IDs are you can add them separated by commas.

<if condition="!in_array($bbuserinfo['usergroupid'], array(1, 2, 3))">

saviola8x 06-18-2008 04:26 PM

i like it.

Fungsten 06-18-2008 06:34 PM

Quote:

Originally Posted by Alfa1 (Post 1543272)
Since the template has got hooks for the signature, it seems better to use a separate plugin if you only want to hide signature from guests. Hiding signatures from guests can do a lot of good for your SEO.

Why not use the hooks: postbit_signature_start and postbit_signature_end to add the code that Zieen describes above?


<if condition="!in_array($bbuserinfo['usergroupid'], array(1, 2, 3))">

How did that work. If it didn't try "|" without the ".

baktabul 09-12-2008 09:29 AM

I want to hide ads from all members, is there any basic way ?

siliconfinance 10-25-2008 08:34 AM

search template conditionals and locate the if statement that looks like this:

<If guest>
Ad
</if>

Spada_FMC 03-04-2009 04:59 AM

I really love this easy looking mod! However, I was hoping I could just have the ability to hide images in the signature for multiple groups.

What's the best way to accomplish that?

thompson 03-04-2009 11:33 AM

thanks for that

busybeeburns 05-27-2010 06:45 AM

Quote:

Originally Posted by MoB Dudditz MD (Post 1231665)
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']"


this worked thanks!


All times are GMT. The time now is 06:44 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.01523 seconds
  • Memory Usage 1,854KB
  • 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
  • (7)bbcode_code_printable
  • (2)bbcode_html_printable
  • (26)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)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