PDA

View Full Version : Miscellaneous Hacks - Enable/Disable Signature per user


hoangminh
07 May 2009, 12:06
This modification is a port of this from 3.5 (http://www.vbulletin.org/forum/showthread.php?p=841450#post841450).

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:

$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:

<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:

<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:
<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:
Create Profile Field (http://www.vbulletin.org/forum/attachment.php?attachmentid=38908&d=1133846967)
Disable/Enable User's Signature (http://www.vbulletin.org/forum/attachment.php?attachmentid=38907&d=1133846967)All done.

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

s8glive
07 May 2009, 12:29
great mod

s8glive
07 May 2009, 12:41
does not work

hoangminh
09 May 2009, 08:02
does not work
Are you sure that the fieldid is correct on the code replace?

john102774
13 May 2009, 00:07
The fieldID is correct. It's not working for me. I have VB3.7.3

john102774
14 May 2009, 06:20
It's all of a sudden working now. Maybe the cookies needed to be cleared. Thanks for this Mod!

GmanDesign
10 Sep 2009, 14:23
i dont understand what files to edit the code in.

MentaL
11 Sep 2009, 12:05
i dont understand what files to edit the code in.

it clearly says.

garyfinlay
17 Sep 2009, 01:02
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
17 Sep 2009, 01:12
Thanks im installing. Good port!

Dingo14
20 Sep 2009, 03:55
can't get it work in v3.8.3 when i disable sig it still shows for user

ETDC
28 Sep 2010, 16:35
Is there anything more up to date than this?

Bulent Tekcan
03 Mar 2012, 13:16
Any way to vb 4.1.x ?