The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Hidden Signatures - Hide sigs like a spoiler for certain usergroups Details »» | ||||||||||||||||||||||||||
Hidden Signatures - Hide sigs like a spoiler for certain usergroups
Developer Last Online: Aug 2023
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] 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. Screenshots
Show Your Support
|
Comments |
#2
|
||||
|
||||
<i>Reserved for future use.</i>
|
#3
|
|||
|
|||
Could that be modified to hide signatures for posters with less than "x" posts? That would make it very useful for anti-spam.
|
#4
|
||||
|
||||
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! |
#5
|
|||
|
|||
Doesn't work in Firefox, Works fine in IE but not working in Firefox. Any solution please?
|
#6
|
||||
|
||||
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?
|
#7
|
|||
|
|||
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
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|