Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
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
Version: 1.00, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 4.0.x Rating:
Released: 08-22-2010 Last Update: 08-22-2010 Installs: 15
Supported Template Edits
Re-useable Code Translations  

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}
Note this is in the middle of a line, you may want to edit the line so that it's on its own line- extra lines don't matter in templates.

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 -->
That exact code will auto hide signatures of anyone with less then 10 posts.

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

File Type: txt Hidden_sigs_VB4.txt (3.7 KB, 56 views)

Screenshots

File Type: jpg ss_hiddensigvb4.jpg (102.3 KB, 0 views)
File Type: jpg ss_hiddensigvb4_2.jpg (104.2 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
mohammadxxx

Comments
  #2  
Old 08-23-2010, 01:18 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Translations:

Arabic - Thanks to Dr. osamA, Post # 4

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="اضهار التوقيع" 
                           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 = 'اخفاء التوقيع'; } else 
                           { this.parentNode.parentNode.getElementsByTagName('div')
                           [1].getElementsByTagName('div')[0].style.display = 'none'; 
                           this.innerText = ''; this.value = 'اضهار التوقيع'; }"> 
                           </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 -->
More to come?
Reply With Quote
  #3  
Old 08-23-2010, 01:28 PM
Alucard^'s Avatar
Alucard^ Alucard^ is offline
 
Join Date: Feb 2008
Location: Argentina
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice one, installed... i will test later.
Reply With Quote
  #4  
Old 08-23-2010, 11:31 PM
Dr.osamA's Avatar
Dr.osamA Dr.osamA is offline
 
Join Date: Aug 2004
Location: Syrie
Posts: 979
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent
installed + 5 stars

here is code in Arabic

just last night I was thinking about this code you saved my time man thank you

PHP 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="اضهار التوقيع" 
                           
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 = 'اخفاء التوقيع'; } else 
                           { this.parentNode.parentNode.getElementsByTagName('div')
                           [1].getElementsByTagName('div')[0].style.display = 'none'; 
                           this.innerText = ''; this.value = 'اضهار التوقيع'; }"

                           </
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 --> 
Reply With Quote
  #5  
Old 08-24-2010, 01:44 PM
sticky sticky is offline
 
Join Date: Sep 2003
Posts: 934
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This would be extremely useful for me for signatures that are not work safe.

Would there be any way to use this just for certain signatures and not all?
Reply With Quote
  #6  
Old 08-24-2010, 02:33 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah that's actually what I use it for- just make a new usergroup "Hidden Sigs" and add anyone you want too it as a secondary usergroup.

Use the condition:
<vb:if condition="is_member_of($post, X)">

Where 'X' is the usergroup id of your Hidden Sigs usergroup.
Reply With Quote
  #7  
Old 08-26-2010, 11:12 PM
sticky sticky is offline
 
Join Date: Sep 2003
Posts: 934
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
Yeah that's actually what I use it for- just make a new usergroup "Hidden Sigs" and add anyone you want too it as a secondary usergroup.

Use the condition:
<vb:if condition="is_member_of($post, X)">

Where 'X' is the usergroup id of your Hidden Sigs usergroup.
Excellent, that is a solution I will use if necessary.

Would there be any way to add in hiding by userid or for users to tag their own sigs as NWS?
Reply With Quote
  #8  
Old 08-27-2010, 01:39 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes on both accounts... to show hide sigs based on user id:

Code:
<vb:if condition="in_array($bbuserinfo['userid'], array(X, Y, Z))">
Where X, Y, Z are userids of specific users...

Now to hide sigs of users who mark theirs as not work safe, also possible but will take a bit more...

First you need to make a Custom User Profile Field...
In Admin CP go to the menu on the left and choose "Add New User Profile Field" under "User Profile Fields."

Choose "Single Selection Radio Box" from the drop down menu...

On the next screen set the following...

Title: Work Safe Sig
Description: Is you signature "Work Safe?" If "No" it will be hidden by default.
Options:
Code:
Yes
No
Field Required: Yes, at registration and...
Private/Field Searchable.../Display on... All "No"
Display Page: Options: Thread Viewing
Leave all other settings to default and hit "Save" to create the profile field.

Now for the condition use:

Code:
<vb:if condition="($vbulletin->userinfo['fieldX'] != "No")">
Where "X" is the field number of the user profile field you just created.

Note- we are using !="No" (does NOT equal "No") instead of the more intuitive =="Yes" (equals "Yes") because the vast majority of users will probably never set this field at all so it physically won't equal "Yes" for most people, but that is OK, so long as it doesn't equal "No" we want a regular sig.

I hope this is easy enough to follow- if you have a question about it let me know.

Of course you can still use AND's or OR's as needed in the if statement such as:

Code:
<vb:if condition="in_array($bbuserinfo['userid'], array(2, 3, 4)) OR ($vbulletin->userinfo['field8'] != "No")">
Will hide the sig always for user id's 2, 3, and 4 and also hide the sigs for anyone else who sets custom field 8 to "No"
Reply With Quote
  #9  
Old 08-27-2010, 05:59 AM
sticky sticky is offline
 
Join Date: Sep 2003
Posts: 934
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Damn bud, you are good!

Thank you so much for addressing my posts. Most people who do mods just tell you that isn't what theirs was designed to do so instead of working with people they work against them. You were nice enough to help, refreshing to see, and thank you.
Reply With Quote
  #10  
Old 08-27-2010, 02:50 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sticky View Post
Damn bud, you are good!

Thank you so much for addressing my posts. Most people who do mods just tell you that isn't what theirs was designed to do so instead of working with people they work against them. You were nice enough to help, refreshing to see, and thank you.
You're welcome... to me releasing a mod is only 40% of the work, supporting it is 60% or more. In a community where any mod might be a person's first one you need to be prepared to help anyone with anything, else don't bother.:up:
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05267 seconds
  • Memory Usage 2,353KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (3)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete