Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
2 registered (57-Vette, Chosen), 43 Guests and 14 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 03/24/10
Posts: 8
Top Posters (30 Days)
Ruben 50
DennyP 24
Gizmo 23
Dunny 15
SteveS 13
AllenAyres 12
dbremer 10
SD 10
drkknght00 9
doug 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Topic Options
#242110 - 03/08/11 08:11 PM Give users option to enable/disable topic preview?
rivet Offline
journeyman
Registered: 06/21/10
Posts: 60
Is there a way I can give users the ability to enable or disable topic preview in their edit profile page?
Top
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."
#242112 - 03/09/11 12:04 PM Re: Give users option to enable/disable topic preview? [Re: rivet]
SD Offline
Registered: 04/19/07
Posts: 4056
Loc: 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
_________________________

Threads tutorials . Threads & Wordpress experts . UBB resume

If I you, click this link as to why
Top
#242124 - 03/09/11 08:46 PM Re: Give users option to enable/disable topic preview? [Re: rivet]
rivet Offline
journeyman
Registered: 06/21/10
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...
Top
#242137 - 03/10/11 08:07 PM Re: Give users option to enable/disable topic preview? [Re: rivet]
rivet Offline
journeyman
Registered: 06/21/10
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?
Top
#242168 - 03/12/11 04:01 PM Re: Give users option to enable/disable topic preview? [Re: rivet]
SD Offline
Registered: 04/19/07
Posts: 4056
Loc: 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 )



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:
_________________________

Threads tutorials . Threads & Wordpress experts . UBB resume

If I you, click this link as to why
Top
#242174 - 03/13/11 12:39 AM Re: Give users option to enable/disable topic preview? [Re: rivet]
rivet Offline
journeyman
Registered: 06/21/10
Posts: 60
You're tha man. Thank you very much!!! Or as we say here locally, "Salamat Po"
Top
#242181 - 03/13/11 04:34 PM Re: Give users option to enable/disable topic preview? [Re: rivet]
SD Offline
Registered: 04/19/07
Posts: 4056
Loc: SoCal, USA
No problemo

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

:2c:
_________________________

Threads tutorials . Threads & Wordpress experts . UBB resume

If I you, click this link as to why
Top



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Temporary Password email not being received
by
05/24/12 10:02 PM
Ability to "like" individual posts (not Facebook "likes)
by doug
05/23/12 09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
New Posts Corrupted? Can someone help?
by PianoWorld
05/19/12 09:41 AM
Forum Stats
10492 Members
36 Forums
33842 Topics
181709 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image