PDA

View Full Version : Hide Avatars & Signatures from Guests


Zieen
04-11-2007, 10:00 PM
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...
<if condition="$show['avatar']"
Add before...
<if condition="$bbuserinfo['usergroupid'] != 1">

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

Find...
<if condition="$post['signature']">
Add before...
<if condition="$bbuserinfo['usergroupid'] != 1">

Find...
<!-- / sig -->
</if>
Add after...
</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
<if condition="$show['member']">
Instead of
<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:
<if condition="$show['avatar']">
REPLACE WITH:
<if condition="$show['avatar'] AND $show['member']">

FIND:
<if condition="$post['signature']">
REPLACE WITH:
<if condition="$post['signature'] AND $show['member']">

HMBeaty
04-20-2007, 02:39 AM
I believe you can go one step further by combining both conditionals
by adding the AND after each condition.


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



<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
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 />


<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
In your postbit and postbit_legacy
FIND:
<if condition="$show['avatar']">
REPLACE WITH:
<if condition="$show['avatar'] AND $show['member']">

FIND:
<if condition="$post['signature']">
REPLACE WITH:
<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
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:
<if condition="$show['avatar']">
REPLACE WITH:
<if condition="$show['avatar'] AND $show['member']">

FIND:
<if condition="$post['signature']">
REPLACE WITH:
<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
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
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
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 ?

<if condition="$bbuserinfo['usergroupid'] != 1,2">
or
<if condition="$bbuserinfo['usergroupid'] != 1, 2">
or
<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
you mean like this ?

<if condition="$bbuserinfo['usergroupid'] != 1,2">
or
<if condition="$bbuserinfo['usergroupid'] != 1, 2">
or
<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?

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
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
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:
<if condition="$show['avatar']">
REPLACE WITH:
<if condition="$show['avatar'] AND $show['member']">

FIND:
<if condition="$post['signature']">
REPLACE WITH:
<if condition="$post['signature'] AND $show['member']">this worked thanks!