Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jun 2010
Posts: 58
R
journeyman
journeyman
R Offline
Joined: Jun 2010
Posts: 58
Is there a way I can give users the ability to enable or disable topic preview in their edit profile page?

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yah, with a small modification

1. add a custom field ( there are 5 available )
2. modify scripts/postlist.inc.php to check that field and show / not shop tooltip

smile

Joined: Jun 2010
Posts: 58
R
journeyman
journeyman
R Offline
Joined: Jun 2010
Posts: 58
This is a far as I've gotten:

Code
				<label for="CUSTOM_FIELD_1">Post Preview (0 = hide 1 = show)</label>
				<br />
				<input type="text" name="CUSTOM_FIELD_1" id="CUSTOM_FIELD_1" value="1" class="form-input" /><br /><br />

But it's not working correctly...

Joined: Jun 2010
Posts: 58
R
journeyman
journeyman
R Offline
Joined: Jun 2010
Posts: 58
I have gotten the option to appear in My Stuff/Edit Profile, but could you tell me how to modify the postlist.inc.php to refer to that custom function tooltip, so it actually works?

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
1. You don't need to modify a template at all.
2. Just go into Registration settings / Registration screen and set the Custom field prompt ( example picture below )

[Linked Image from sirdude.com]

I set it to hide and that really just HIDES it only @ registration, but because I fill it in, then it will always now show when they edit their PROFILE.

Then the only modification to do is in scripts/postlist.inc.php

On line 43 ( approx ), add the extra field to the list of fields to retrieve for each user:

"user_fields" => "t2.USER_TOPIC_VIEW_TYPE, t2.USER_TOPICS_PER_PAGE, t2.USER_POSTS_PER_TOPIC,USER_EXTRA_FIELD_1",

Then around line 837 you will see:
PHP Code

// Gotta clean out the [ and ], as they are keys to the .js parser. Also need to fix graemlin links
$postrow[$z]['tooltip'] = "";
if ($config['TOOLTIP_LENGTH'] && $config['TOOLTIP_LENGTH'] > 0) { 

change that to this:
PHP Code

// Gotta clean out the [ and ], as they are keys to the .js parser. Also need to fix graemlin links
$postrow[$z]['tooltip'] = "";
if ($config['TOOLTIP_LENGTH'] && $config['TOOLTIP_LENGTH'] > 0 && $user['USER_EXTRA_FIELD_1'] == '1') { 

this will allow the user to edit their profile and put 1 to enable the tooltip or 0 to not have it.

Then you make the board to always show it by default, but allow users to turn it off in their profile

2c

Joined: Jun 2010
Posts: 58
R
journeyman
journeyman
R Offline
Joined: Jun 2010
Posts: 58
You're tha man. Thank you very much!!! Or as we say here locally, "Salamat Po"

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
No problemo

I posted a more detailed explanation over on my blog Clicky Poo for anyone interested

2c


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
After server reboot
by Morgan - 09/02/2026 8:27 AM
Email Settings
by Outdoorking - 05/13/2026 2:44 AM
Who's Online Now
1 members (1 invisible), 304 guests, and 96 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)