Previous Thread
Next Thread
Print Thread
Rate Thread
[7.2.2] - Custom Title vs Title display
#314979 07/26/2007 8:33 PM
Joined: Nov 2003
Posts: 482
sirdude Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Nov 2003
Posts: 482
Simple modification that checks if a user has a Custom Title defined. If they do, then the Custom Title replaces the post based Title. (thanks to the pishmeister, who no one knows yet for this)

If they don't have a Custom Title, then the post based Title will be displayed.

Also does a small tweak to not include extra
when the Rating system is turned off or the user doesn't have a rating. Right now it slams in a
regardless. This saves some vertical space.

Ok.. here goes.

Open: /templates/default/post_side.tpl

Find:
Code
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
<br />
{/if}
{$postrow[post].Title}
<br />
{$postrow[post].Rating}
<br />
Replace with:
Code
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
{else}
{$postrow[post].Title}
{/if}
<br />
{if $postrow[post].Rating}
{$postrow[post].Rating}
<br />
{/if}
done!

Open: /templates/default/post_top.tpl

Find:
Code
<span class="small">
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
<br />
{/if}
{$postrow[post].Title}
</span>
Replace with:
Code
<span class="small">
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
{else}
{$postrow[post].Title}
{/if}
</span>
Done!

Open: /templates/default/post_comments.tpl

Find:
Code
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
<br />
{/if}
{$postrow[post].Title}
<br />
{$postrow[post].Rating}
<br />
Replace with:
Code
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
{else}
{$postrow[post].Title}
{/if}
<br />
{if $postrow[post].Rating}
{$postrow[post].Rating}
<br />
{/if}
Done!

Upload your files!

Enjoy wink

Sponsored Links
Re: [7.2] - Custom Title vs Title display
sirdude #314985 07/27/2007 12:09 AM
Joined: Nov 2003
Posts: 482
sirdude Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Nov 2003
Posts: 482
if you want to go further and also color the title or custom title according to the username's color, you can do the following.

open: /scripts/showflat.inc.php

find:
PHP Code
	 $postrow[$i]['Title']	= $Title;
$postrow[$i]['CustomTitle'] = $CustomTitle;
add above:
PHP Code
	 // SD - Mod (color, based upon user color or admin/mod color
if ($Color) {
$Title = "<span style="color:$Color;">$Title</span>";
if (
$CustomTitle) {
$CustomTitle = "<span style="color:$Color;">$CustomTitle</span>";
}
}

if ((
$PostStatus == "Administrator") && (!$Color)) {
$Title = "<span class="adminname">$Title</span>";
if (
$CustomTitle) {
$CustomTitle = "<span class="adminname">$CustomTitle</span>";
}
}
elseif ((
$PostStatus == "Moderator") && (!$Color)) {
$Title = "<span class="modname">$Title</span>";
if (
$CustomTitle) {
$CustomTitle = "<span class="modname">$CustomTitle</span>";
}
}


Done!

Upload this puppy

Enjoy wink

Re: [7.2] - Custom Title vs Title display
sirdude #315389 08/24/2007 1:56 AM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
Originally Posted by sirdude
Enjoy wink

Enjoyed! cool

Re: [7.2] - Custom Title vs Title display
blaaskaak #315390 08/24/2007 3:17 AM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
Pfff, just moved all custom titles we had in our post title fields that were imported over from 6.5.x. Removed the hacks that allowed me to edit the post title instead of the custom title.

Re: [7.2] - Custom Title vs Title display
blaaskaak #315399 08/24/2007 10:40 AM
Joined: Nov 2003
Posts: 482
sirdude Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Nov 2003
Posts: 482
if 'Pfff' a good thing ? smile

i hope laugh

Sponsored Links
Re: [7.2] - Custom Title vs Title display
sirdude #315400 08/24/2007 10:57 AM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
Originally Posted by sirdude
if 'Pfff' a good thing ? smile

Pfff is the best smile That's from being tired from lots of work smile

But it saves in the long run having everything cleaned up again smile

Re: [7.2] - Custom Title vs Title display
blaaskaak #315403 08/24/2007 2:23 PM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
Originally Posted by blaaskaak
Enjoyed! cool

Enjoy it even more?

/scripts/online.inc.php

find:

Code

if ($CustomTitle) {
$Title = "$CustomTitle<br />$Title";
}

replace with:

Code

if ($CustomTitle) {
$Title = $CustomTitle;
}

/scripts/showprofile.inc.php

find:

Code

$smarty_data = array(
"profileuser" => $profileuser,
"Fakeemail" => $Fakeemail,
"Picture" => $Picture,
"width" => $width,
"height" => $height,
"User" => $User,
"Title" => "$Title<br />  $CustomTitle",

replace with:

Code

if ($CustomTitle) { $title=$CustomTitle; };
$smarty_data = array(
"profileuser" => $profileuser,
"Fakeemail" => $Fakeemail,
"Picture" => $Picture,
"width" => $width,
"height" => $height,
"User" => $User,
"Title" => $Title,

this will take of who's online and the userprofile screen!

Last edited by blaaskaak; 08/24/2007 2:41 PM.
Re: [7.2] - Custom Title vs Title display
blaaskaak #315404 08/24/2007 3:58 PM
Joined: Nov 2003
Posts: 482
sirdude Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Nov 2003
Posts: 482
hehe and just to be totally complete.. viewmessage too ! laugh

i just didn't post them here..

blaaskaak.. ty!! smile

if you haven't posted the viewmessage (both script + template) thingie, i will do it later on today..

Re: [7.2] - Custom Title vs Title display
sirdude #315410 08/25/2007 1:13 AM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329
Originally Posted by sirdude
hehe and just to be totally complete.. viewmessage too ! laugh

That one already looks ok. It uses the post_side and post_top templates if I'm correct.

Quote
if you haven't posted the viewmessage (both script + template) thingie, i will do it later on today..

Don't worry, just concentrate on the naked chat suggestions I made smile

Re: [7.2] - Custom Title vs Title display
blaaskaak #315415 08/25/2007 11:29 AM
Joined: Nov 2003
Posts: 482
sirdude Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Nov 2003
Posts: 482
hrm. you have a point.. i was stuck back in 7.0.2 days with the templates. good catch..

ok.. i will be working on the unclothed messaging system this weekend. i'll see what i get added.

Sponsored Links
Re: [7.2] - Custom Title vs Title display
sirdude #315506 08/31/2007 11:37 PM
Joined: Dec 2006
Posts: 16
Newbie
Offline
Newbie
Joined: Dec 2006
Posts: 16
Please see this post. I would like it to operate a bit differently myself.

http://www.ubbcentral.com/forums/ubbthreads.php/ubb/showflat/Number/195926

Re: [7.2] - Custom Title vs Title display
ntdoc #315507 09/01/2007 1:42 AM
Joined: Dec 2006
Posts: 16
Newbie
Offline
Newbie
Joined: Dec 2006
Posts: 16
Okay just want to say Thanks guys.

This mod by SirDude and blaaskaak works just fine on my site. I'm happy with it.

The issue appears to be that if you want BOTH Default and Custom titles to show then this mod won't work for you. For me I just want the one Default to show and it works great.

Currently the code in 7.2.2 is less than adequate for me and I had to keep manually updating the database each day to fix it.

Doing these fixes as shown by SirDude and blaaskaak will restore it back to they way it used to work in 6.x (at least as I recall it working)

Thanks again guys rockon

[7.2.x] If Custom Title
#316279 11/09/2007 2:09 AM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Modification Name: If Custom Title [beta]

Author(s): Allen Ayres

Description: If you have a custom title, this displays it instead of the member title.

Requirements: UBB.Threads 7.2.x (may work with other 7 series)

Demo: None yet

Notes: I may have missed some spots, but I think this covers most smile

Attached Files
IfCustomTitle.txt (4.17 KB, 46 downloads)
Instructions
SHA1: 8d4905bd6afcb68b74d4f512c795fe27aaf0d85f

- Allen wavey
- What Drives You?
Re: [7.2.x] If Custom Title
AllenAyres #316282 11/09/2007 3:38 AM
Joined: Feb 2007
Posts: 329
Yarp™
Offline
Yarp™
Joined: Feb 2007
Posts: 329

Last edited by blaaskaak; 11/09/2007 3:39 AM.
Re: [7.2.x] If Custom Title
AllenAyres #316283 11/09/2007 3:39 AM
Joined: Jan 2000
Posts: 5,805
Likes: 9
UBB.Dev / UBB.Wiki Owner
Time Lord
Online Tapedshut
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,805
Likes: 9
Looks good allen, but I could have sworn someone else posted this before...

BTW, this will likely throw out "undefined index" errors, you should read up on isset


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.Sitemaps
Re: [7.2.x] If Custom Title
Gizmo #316285 11/09/2007 4:02 AM
Joined: Nov 2003
Posts: 482
sirdude Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Nov 2003
Posts: 482
no, it won't wink

[Linked Image]

Re: [7.2.x] If Custom Title
sirdude #316286 11/09/2007 5:30 AM
Joined: Jan 2000
Posts: 5,805
Likes: 9
UBB.Dev / UBB.Wiki Owner
Time Lord
Online Tapedshut
UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,805
Likes: 9
wink mmmhmmm wink

[Linked Image]


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.Sitemaps
Re: [7.2.x] If Custom Title
Gizmo #316290 11/09/2007 10:42 AM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Originally Posted by Gizmo
Looks good allen, but I could have sworn someone else posted this before...

BTW, this will likely throw out "undefined index" errors, you should read up on isset


?

I'm calling variables already in place, shouldn't be any errors tipsy


- Allen wavey
- What Drives You?
Re: [7.2.x] If Custom Title
AllenAyres #316291 11/09/2007 10:48 AM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
btw, I had no idea it was done already, I coulda used this a month ago more than once. tipsy


- Allen wavey
- What Drives You?
Re: [7.2.x] If Custom Title
AllenAyres #316295 11/09/2007 3:24 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
Offline
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Originally Posted by AllenAyres
Modification Name: If Custom Title [beta]

Author(s): Allen Ayres

Description: If you have a custom title, this displays it instead of the member title.

Requirements: UBB.Threads 7.2.x (may work with other 7 series)

Demo: None yet

Notes: I may have missed some spots, but I think this covers most smile


Merged here... you might consider collecting the pieces in the topic and combining for a text file instruction, would help those trying to install it once wink


- Allen wavey
- What Drives You?

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,542
Posts293,771
Members13,837
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online 292
Topics Created 0
Posts Made 2
Users Online 3
Birthdays 25
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,805
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 9
isaac 8
driv 2
Morgan 1
Top Likes Received
isaac 38
Gizmo 9
Brett 7
Morgan 2
Top Likes Received (30 Days)
isaac 4
Gizmo 1
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2020 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Snapshot build 20200524.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.060s Queries: 56 (0.017s) Memory: 3.4340 MB (Peak: 3.7194 MB) Data Comp: Zlib Server Time: 2020-05-26 06:48:01 UTC
Valid HTML 5 and Valid CSS