Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online Now
0 registered members (), 64 guests, and 257 spiders.
Key: Admin, Global Mod, Mod
Member Spotlight
Posts: 249
Joined: October 2007
Show All Member Profiles 
Top Posters(30 Days)
isaac 13
Ruben 5
Morgan 4
M4TT 4
fidel 1
Gizmo 1
Latest Photos
Trees
Retreats
Rooms
Big stuff
Test
Previous Thread
Next Thread
Print Thread
Give users option to enable/disable topic preview? #242110 03/08/11 09:11 PM
Joined: Jun 2010
Posts: 58
rivet Offline OP
journeyman
Is there a way I can give users the ability to enable or disable topic preview in their edit profile page?

Express Hosting
Re: Give users option to enable/disable topic preview? [Re: rivet] #242112 03/09/11 01:04 PM
Joined: Apr 2007
Posts: 3,945
SD Offline
Former Developer
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

Re: Give users option to enable/disable topic preview? [Re: rivet] #242124 03/09/11 09:46 PM
Joined: Jun 2010
Posts: 58
rivet Offline OP
journeyman
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...

Re: Give users option to enable/disable topic preview? [Re: rivet] #242137 03/10/11 09:07 PM
Joined: Jun 2010
Posts: 58
rivet Offline OP
journeyman
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?

Re: Give users option to enable/disable topic preview? [Re: rivet] #242168 03/12/11 05:01 PM
Joined: Apr 2007
Posts: 3,945
SD Offline
Former Developer
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]

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

Re: Give users option to enable/disable topic preview? [Re: rivet] #242174 03/13/11 01:39 AM
Joined: Jun 2010
Posts: 58
rivet Offline OP
journeyman
You're tha man. Thank you very much!!! Or as we say here locally, "Salamat Po"

Re: Give users option to enable/disable topic preview? [Re: rivet] #242181 03/13/11 04:34 PM
Joined: Apr 2007
Posts: 3,945
SD Offline
Former Developer
No problemo

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

2c


ShoutChat Box
Today's Birthdays
Charlie Heidal
Recent Topics
Geo Targeting Display of Custom Islands?
by PianoWorld - 04/15/19 01:08 PM
How-To Guides and Technical Articles
by Morgan - 04/06/19 08:46 AM
i am not a robot.
by Anonymous - 03/29/19 07:18 PM
What directory are avatar images saved in?
by CyberChild - 03/29/19 12:57 PM
EU Data Protection Notice
by M4TT - 03/27/19 09:23 PM
Forum Statistics
Forums35
Topics35,271
Posts192,337
Members12,157
Most Online978
Jun 24th, 2007
Random Image
Powered by UBB.threads™ PHP Forum Software 7.7.2
(Snapshot build 20190420)