View Full Version : need help with a threadbit template mod


The Wise One
2nd February 2005, 07:29 AM
some of my users have been complaining about the tooltip popup when hovering over a thread title with the mouse. i decided to make this tooltip popup a user selectable choice since other users found it usefull.

i created a new profile field using a single selection dropdown menu with 2 options: "enable" and "disable". i also set "enable" to be default.

i then went into the threadbit template and added the necessary if conditional.

the mod works great except for one thing. even tho "enable" is set as the default option...tooltips are disabled until a user enters the usercp and disables the option, saves, and then enables the option again and saving.

any ideas why this would happen?

code is in the attachment.

MarcoH64
8th February 2005, 05:33 PM
I think you should run a query to initialize all custom profile fields. The default value will only be used when someone is editing his profile, not for all rows (users) that are already in the database.

The Wise One
8th February 2005, 06:48 PM
ok that makes sense. any idea what that query might be?

MarcoH64
8th February 2005, 07:45 PM
Something like:
UPDATE userfield set field6 = 'enable'
WHERE field6 = ''

Replace "field6" with the name of you userfield, optionally you can leave out the WHERE clause if you just want to reset it for everybody.