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)
-   -   Miscellaneous Hacks - Enable/Disable Signature per user (https://vborg.vbsupport.ru/showthread.php?t=213069)

hoangminh 05-06-2009 10:00 PM

Enable/Disable Signature per user
 
1 Attachment(s)
This modification is a port of this from 3.5.

I don't have time to learn how to create the plugin/product package xml to add this, so just modify the template only.

Any one know how to make this become product or plugin, feel free do it!.

What it is used for?
As title, allow admin to disable or enable signature of each user.

This modification based on User Profile Field.

Step to do:

1. First, you need to create a new user profile as follow:

Profile Field type: Single-Selection Radio Buttons

Title: Enable Signature
Description: write whatever you like
Option - enter 2 values, each value seperated by Enter, notice the order of each:
Code:

Yes
No
Set Default : Yes
Order : (leave)
Required field: No
Field Editable by User: No (This option will only allow administrator to edit)
Private Field: Yes
Other field: No

Which page displays this option?: Option

Click Save, it will return to User profile field manager page

You will see new user profile field, view the name of it, for example in my board is: field17

Remember this

2. In postbit or postbit_legacy template, (this will disable/enable signature in post of target user)

Find:
PHP Code:

             $template_hook[postbit_signature_start]
        
$ad_location[ad_showthread_firstpost_sig]

        <if 
condition="$post['signature']">
        <!-- 
sig -->
            <
div>
                
__________________<br />
                
$post[signature]
            </
div>
        <!-- / 
sig -->
        </if>

        
$template_hook[postbit_signature_end

Replace with:

PHP Code:

 <if condition="$post['field17']!='No'">

        
$template_hook[postbit_signature_start]
        
$ad_location[ad_showthread_firstpost_sig]

        <if 
condition="$post['signature']">
        <!-- 
sig -->
            <
div>
                
__________________<br />
                
$post[signature]
            </
div>
        <!-- / 
sig -->
        </if>

        
$template_hook[postbit_signature_end]
</if> 

3. In memberinfo_block_aboutmetemplate, (this will disable/enable signature in member profile page)

Find:

PHP Code:

  <if condition="$prepared['signature']">
        <
li class="profilefield_category">
            
$vbphrase[signature]
            <
dl class="list_no_decoration profilefield_list"><dd id="signature">$prepared[signature]</dd></dl>
        </
li>
    </if> 

Replace with:
PHP Code:

 <if condition="$userinfo[field17]!='No'">
    <if 
condition="$prepared['signature']">
        <
li class="profilefield_category">
            
$vbphrase[signature]
            <
dl class="list_no_decoration profilefield_list"><dd id="signature">$prepared[signature]</dd></dl>
        </
li>
    </if>
</if> 

If you want this option is affected on other area (such as Private messagE), do the same as above, but because 2 templates are public, so do this is enough.

Note: changefield17 the fieldname as in your board

To enable/disable signature of any user, just enter user option and click on No.

See screenshot:All done.

I'm not online frequently, so, please try help each other if you can.

s8glive 05-07-2009 10:29 AM

great mod

s8glive 05-07-2009 10:41 AM

does not work

hoangminh 05-09-2009 06:02 AM

Quote:

Originally Posted by s8glive (Post 1806289)
does not work

Are you sure that the fieldid is correct on the code replace?

john102774 05-12-2009 10:07 PM

The fieldID is correct. It's not working for me. I have VB3.7.3

john102774 05-14-2009 04:20 AM

It's all of a sudden working now. Maybe the cookies needed to be cleared. Thanks for this Mod!

GmanDesign 09-10-2009 12:23 PM

i dont understand what files to edit the code in.

MentaL 09-11-2009 10:05 AM

Quote:

Originally Posted by GmanDesign (Post 1882525)
i dont understand what files to edit the code in.

it clearly says.

garyfinlay 09-16-2009 11:02 PM

This worked for me when I installed it a week ago. Now all of a sudden it doesn't :confused:

I'm using v3.8.4

Editing next day: This is working again without having done anything :confused::confused::confused::confused:

ChopSuey 09-16-2009 11:12 PM

Thanks im installing. Good port!


All times are GMT. The time now is 10:27 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.03529 seconds
  • Memory Usage 1,756KB
  • 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
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete