The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
Hidden Signatures - Hide Sigs (spoiler) based on Post Count (anti-spam) or Usergroup Details »» | ||||||||||||||||||||||||||||
Hidden Signatures - Hide Sigs (spoiler) based on Post Count (anti-spam) or Usergroup
Developer Last Online: Aug 2023
This mod allows you to hide a user's signature by default. There will be a "Show Signature" button displayed instead of a sig... if you click on the button the real signature will show- you can then click the button again if you want to re-hide the signature.
This has been tested on VB 4.0.6 in IE / Firefox / Chrome / Safari and Opera. You can hide everyone's signature if you want but more then likely you'd want to hide signatures based on a user's post count- this could help foil would be signature-spammers by not showing their content or hiding sigs of new users you just don't trust yet. Alternatively you can hide signatures by usergroup, such as for registered users but allow sigs to show for VIP members only. Of course you can also use a combination of the above to- hide sigs for all users with less than 30 posts unless they are VIP members... This is a Template Edit. Edit your postbit or postbit_legacy template, whichever you use. Find the following code: Code:
{vb:raw post.signature} Replace the code with: Code:
<!-- Begin Hidden sig --> <vb:if condition="$post[posts] < 10"> <div style="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;"> <div style="display: none;"> {vb:raw post.signature} </div></div></div> <vb:else /> {vb:raw post.signature} </vb:if> <!-- End Hidden sig --> To change this behavior edit the "if" statement at the top of the code: <vb:if condition="$post[posts] < 10"> Change the number 10 to whatever minimum post count you want. If you want to hide sigs per usergroup change the line to: <vb:if condition="is_member_of($post, 2, 5, 7 )"> That code will hide sigs of registered users, mods, and super-mods... maybe not what you want to do but a good way to show you how to use it. If you only want one usergroup removes the commas, such as: <vb:if condition="is_member_of($post, 2)"> This will block it for only registered users. You can combine both with an "AND" or "OR" statement: <vb:if condition="is_member_of($post, 2) OR $post[posts] < 10"> This will hide sigs for all registered users or anyone with a post count less than 10 no matter what usergroup they are in. Please click Mark As Installed if you use this. Some code for this is based on this "spoiler" tag: https://vborg.vbsupport.ru/showthread.php?t=184855 Download the .txt file for a copy of the Install Instructions... Download Now
Screenshots
Show Your Support
|
Благодарность от: | ||
mohammadxxx |
Comments |
#12
|
||||
|
||||
nice work, thank you..
|
#13
|
|||
|
|||
very cool, thanks for your efforts!
|
Благодарность от: | ||
BirdOPrey5 |
#14
|
|||
|
|||
Wonderful mod!
Now, I'm trying to find a way to have this be displayed only if a signature is quite long. Any way to set a condition like "Signature Length > 500"? |
#15
|
||||
|
||||
Yes and no... It would be fairly easy to count the characters in the plugin but with BBCode you could have 1000 characters in the signature but it only displays a short 100 of them as actual text.
You could filter out the BBCode but it is more difficult. Worse is that in my experience it's images which take up a lot of room, not so much text, and there is no way to check the size of the image each time it is loaded. There was a thread somewhere here on a mod or template edit that allowed for a max signature height in pixels, and anything longer than that it would show a scrollbar so it didn't take up the whole page. Here is the link actually: https://vborg.vbsupport.ru/showthrea...68#post2085268 |
#16
|
|||
|
|||
Thanks Joe, I saw that mod the other day as well.
Would you be able to share the count to count the characters? I realize the BBCode can change what's displayed, but I'm still interested in how to do it. I don't allow graphics in the signatures, so that's not a problem. |
#17
|
||||
|
||||
In a plugin on the postbit_display_complete hook the signature text (already converted to HTML) is stored in:
Code:
$post['signature'] PHP Code:
PHP Code:
Code:
<vb:if condition="$post[posts] < 10"> Code:
<vb:if condition="$post['bigsig']"> |
#18
|
|||
|
|||
Awesome, thank you so much. I just edited the "postbit_display_complete" file (took a bit for a Newbie to find it), changed the code, and all is working perfectly!
|
Благодарность от: | ||
BirdOPrey5 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|