Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online Now
2 registered members (Zarzal, isaac), 73 guests, and 231 spiders.
Key: Admin, Global Mod, Mod
Member Spotlight
QSS Tim
QSS Tim
Oroville, CA
Posts: 98
Joined: October 2004
Show All Member Profiles 
Top Posters(30 Days)
isaac 22
Gizmo 17
TheBrit 14
Zarzal 12
SteveS 8
jorb 4
Ruben 4
Latest Photos
Test
Testing to drag photos
Comfortable Cats
Test
BSA photos
Previous Thread
Next Thread
Print Thread
Give users option to enable/disable topic preview? #242110
03/08/11 08:11 PM
03/08/11 08:11 PM
R
rivet  Offline OP
journeyman
Joined: Jun 2010
Posts: 60
Is there a way I can give users the ability to enable or disable topic preview in their edit profile page?

Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
Re: Give users option to enable/disable topic preview? [Re: rivet] #242112
03/09/11 12:04 PM
03/09/11 12:04 PM
SD  Offline
Former Developer
Joined: Apr 2007
Posts: 4,313
SoCal, USA
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 08:46 PM
03/09/11 08:46 PM
R
rivet  Offline OP
journeyman
Joined: Jun 2010
Posts: 60
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 08:07 PM
03/10/11 08:07 PM
R
rivet  Offline OP
journeyman
Joined: Jun 2010
Posts: 60
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 04:01 PM
03/12/11 04:01 PM
SD  Offline
Former Developer
Joined: Apr 2007
Posts: 4,313
SoCal, USA
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 12:39 AM
03/13/11 12:39 AM
R
rivet  Offline OP
journeyman
Joined: Jun 2010
Posts: 60
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 03:34 PM
03/13/11 03:34 PM
SD  Offline
Former Developer
Joined: Apr 2007
Posts: 4,313
SoCal, USA
No problemo

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

2c


Shout Box
Today's Birthdays
No Birthdays
Recent Topics
Calendar Function
by TheBrit. 12/17/18 10:05 PM
Speaking of Http to https, complaints from user
by PianoWorld. 12/16/18 03:40 PM
update multilanguage site problem
by Zarzal. 12/15/18 04:20 PM
Char coding utf-8 and older forums
by Zarzal. 12/15/18 03:59 PM
table issue
by TheBrit. 12/13/18 06:05 PM
Forum Statistics
Forums36
Topics35,182
Posts191,701
Members12,122
Most Online978
Jun 24th, 2007
Random Image
Powered by UBB.threads™ PHP Forum Software 7.6.2