zetetic
06-07-2005, 10:00 PM
This is a remake of the similar hack by nexialys. I think doing it this way is preferrable because it requires only two small file edits and a new custom profile field, with no alteration of the core database tables, template modifications or new phrases. I originally posted this solution on his thread, but I thought it might be considered a hijack. So, here's a new thread with my way of implementing his idea. :)
Step One
Go into the ACP
Select User Profile Field Manager from the left menu.
Select Add New User Profile Field
Profile Field Type --> Single-Selection Radio Buttons
Title: Display Thread Preview
Description: Select whether to display a thread preview when hovering over the title.
Options: Yes No (separated by a carriage return)
Set Default: Yes
Display Order: Leave at default
Field Required: Yes (if you want the option to appear at registration, otherwise No)
Field Editable by User: Yes
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No
Leave the Optional Input section as it is.
Which page displays this option?: Options: Thread Viewing
Click Save, make a note of the new field name! (example: field23)
Step Two
Edit forumdisplay.php (In two places!)
Find:
if ($vboptions['threadpreview'] > 0)
Replace with (Changing fieldXX to the name of the new field you created in step one!):
if (($vboptions['threadpreview'] > 0) AND ($bbuserinfo['fieldXX'] == 'Yes'))
Save and upload forumdisplay.php and that's it!
Note: Doing it this way will result in the default setting for existing users being No (an empty string, specifically), so you will have to run this query after you add this setting if you want existing users to see the hovertext by default. Don't forget to add any applicable prefix to the table name and change XX to the number of the new field you created!
UPDATE `userfield` SET `fieldXX`='Yes' WHERE `fieldXX`='';
Step One
Go into the ACP
Select User Profile Field Manager from the left menu.
Select Add New User Profile Field
Profile Field Type --> Single-Selection Radio Buttons
Title: Display Thread Preview
Description: Select whether to display a thread preview when hovering over the title.
Options: Yes No (separated by a carriage return)
Set Default: Yes
Display Order: Leave at default
Field Required: Yes (if you want the option to appear at registration, otherwise No)
Field Editable by User: Yes
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No
Leave the Optional Input section as it is.
Which page displays this option?: Options: Thread Viewing
Click Save, make a note of the new field name! (example: field23)
Step Two
Edit forumdisplay.php (In two places!)
Find:
if ($vboptions['threadpreview'] > 0)
Replace with (Changing fieldXX to the name of the new field you created in step one!):
if (($vboptions['threadpreview'] > 0) AND ($bbuserinfo['fieldXX'] == 'Yes'))
Save and upload forumdisplay.php and that's it!
Note: Doing it this way will result in the default setting for existing users being No (an empty string, specifically), so you will have to run this query after you add this setting if you want existing users to see the hovertext by default. Don't forget to add any applicable prefix to the table name and change XX to the number of the new field you created!
UPDATE `userfield` SET `fieldXX`='Yes' WHERE `fieldXX`='';