vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Show Thread Enhancements - Hidden Signatures - Hide sigs like a spoiler for certain usergroups (https://vborg.vbsupport.ru/showthread.php?t=243082)

BirdOPrey5 05-21-2010 10:00 PM

Hidden Signatures - Hide sigs like a spoiler for certain usergroups
 
1 Attachment(s)
This is a template modification to enable hidden signatures for certain usergroups. I had several users who would always 'push the line' with what I consider acceptable signatures. While many users enjoyed their sigs, others surfing from work or in some cases home, did not. Rather then disable sigs for these users altogether I embarked on a means to hide their sigs by default. The inspiration, and some code came from this "Spoiler" BB Code:
https://vborg.vbsupport.ru/showthread.php?t=184855

Live Demo Here. (No registration necessary.)

You must know the Usergroup ID numbers for the usergroups you want to hide. The sample code hides the sigs of registered users, mods, admins, and super-mods, probably NOT what you want to do.

Users with hidden sigs can have the usergroup as their primary or additional usergroup. I strongly suggest you make a new usergroup based off of registered users called "Hide Sigs" then simply check the box for this usergroup in the user profile for every user you want to activate this for.

In your postbit and/or postbit_legacy template make the following change:
Find (about halfway down the window in 3.8.x)

Code:

$post[signature]
Replace with:
Code:

<!-- Begin Hidden sig -->
<if condition="is_member_of($post, 2, 5, 6, 7 )">
                          <div style="margin:20px; margin-top:5px">
                          <div class="smallfont" style="margin-bottom:2px">
                          <input type="button" value="Show Signature"
                          style="font- size:10px;margin:0px;padding:0px;"
                          onClick="if (this.parentNode.parentNode.getElementsByTagName
                          ('div')[1].getElementsByTagName('div')[0].style.display != '')
                          { this.parentNode.parentNode.getElementsByTagName(
                          'div')[1].getElementsByTagName('div')[0].style.display = '';
                          this.innerText = ''; this.value = 'Hide Signature'; } else
                          { this.parentNode.parentNode.getElementsByTagName('div')
                          [1].getElementsByTagName('div')[0].style.display = 'none';
                          this.innerText = ''; this.value = 'Show Signature'; }">
                          </div> <div style="margin: 0px; padding: 6px; border:
                          1px inset;"> <div style="display: none;">
                            $post[signature]
                            </div></div></div>
<else />
  $post[signature]
</if>
<!-- End Hidden sig -->


Note: You MUST Change the line : <if condition="is_member_of($post, 2, 5, 6, 7 )">
2,5,6,7 is the usergroups registered users, mods, admins, and super mods.
I suggest making a new usergroup just for hidden sigs, for me my line is:
<if condition="is_member_of($post, 23 )">
It is very unlikely your "Hide Sigs" usergroup number will be 23.

If you want to hide sigs for all users by default then change the line to:
<if condition="1">

And that's it. If you use more then 1 style then be sure to make the change to postbit or postbit_legacy in each. Another option is to make a copy of your default style and use the code above to hide all sigs by default and let your users know the hidden sigs style is available for those who may prefer it.

This has been tested on the latest versions of IE, Firefox, Chrome, and Safari.
On Chrome and Safari the box "Show Signature" does not change to "Hide Signature" when pressed, but it works perfectly fine to show and re-hide the sig.

See screenshots in attachments.

Please click install if you use this.

BirdOPrey5 05-22-2010 01:24 AM

<i>Reserved for future use.</i>

Zylantex 08-23-2010 07:25 AM

Could that be modified to hide signatures for posters with less than "x" posts? That would make it very useful for anti-spam.

BirdOPrey5 08-23-2010 11:52 AM

Yes I believe so...

Change the first line "if" statement to:

<if condition="$post[posts] < 5">

Change 5 to however many posts you want before the sig shows...
great idea!

PAKIDIL 04-05-2014 08:42 PM

Doesn't work in Firefox, Works fine in IE but not working in Firefox. Any solution please?

BirdOPrey5 04-06-2014 10:25 AM

Are you sure you have javascript enabled on firefox because it works for me... what version of FF and OS are you using? Link to a thread where it isn't working?

PAKIDIL 04-08-2014 06:51 AM

I have to rechecked with my friend as as soon as I put this code in postbit, all usergroup signatures disappears atleast in my computer. I have to check with others and will let you know thanks


All times are GMT. The time now is 09:17 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.00997 seconds
  • Memory Usage 1,731KB
  • 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
  • (2)bbcode_code_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