Add-On for this mod!
I am preparing for a Halloween surprise for my members and I know that my "666" theme for June 6th, 2006 really upset a lot of members and there was no way for the members to OPT-OUT of my special styles so I have worked out a simple mechanism to allow my members to OPT-OUT of special styles as shown by this script.
Step 1: Create a New User Profile Field
Title: Use Special Event Styles
Description: Do you wish to see special Holiday Website Styles.
Options:
Set Default = yes
Field Required = yes, always
Field Editable by User = yes
Private Field = no
Field Searchable on Members List = no
Show on Members List
Allow user to input their own value for this option = no
Display Page: Options: other
IMPORTANT - After you save this you need to look in the User Profile Field Managed and find the "name" of this new profile. On my site it is "field6"! the firections that follow you need to change the "YOUR-CUSOM-FIELD-ID" with YOUR field name! Make sure you don't mess this up in teh next step or you can overwrite something you don't want overwritten!
Step 2: Run a Mysql Query to update ALL values in your database!
IMPORTANT - Remember to check your PREFIX and use YOUR userprofile field!
If you mess this up, there is NO WAY TO UNDO IT so I suggest a database backup!
PHP Code:
UPDATE `PREFIXuserfield` SET
`YOUR-CUSOM-FIELD-ID` ='yes'
Step 3: Modify your plugin:
Open Plugin: [Holiday/Event/Birthday Style Manager]
Above first Line of Code Add:
PHP Code:
if ($vbulletin->userinfo['userid'] > '0' AND $vbulletin->userinfo['YOUR-CUSOM-FIELD-ID'] == 'yes'){
After LAST line Add:
Now What?
That is it, now users can go into their Options and change the value from yes to no and disable the style as shown on their birthday, holiday, or any other special day that this hack is used to redefine the style!