UBB.Dev
Posted By: sirdude [7.2.2] - Custom Title vs Title display - 07/27/2007 3:33 AM
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
Posted By: sirdude Re: [7.2] - Custom Title vs Title display - 07/27/2007 7:09 AM
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
Posted By: blaaskaak Re: [7.2] - Custom Title vs Title display - 08/24/2007 8:56 AM
Originally Posted by sirdude
Enjoy wink

Enjoyed! cool
Posted By: blaaskaak Re: [7.2] - Custom Title vs Title display - 08/24/2007 10:17 AM
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.
Posted By: sirdude Re: [7.2] - Custom Title vs Title display - 08/24/2007 5:40 PM
if 'Pfff' a good thing ? smile

i hope laugh
Posted By: blaaskaak Re: [7.2] - Custom Title vs Title display - 08/24/2007 5:57 PM
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
Posted By: blaaskaak Re: [7.2] - Custom Title vs Title display - 08/24/2007 9:23 PM
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!
Posted By: sirdude Re: [7.2] - Custom Title vs Title display - 08/24/2007 10:58 PM
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..
Posted By: blaaskaak Re: [7.2] - Custom Title vs Title display - 08/25/2007 8:13 AM
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
Posted By: sirdude Re: [7.2] - Custom Title vs Title display - 08/25/2007 6:29 PM
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.
Posted By: ntdoc Re: [7.2] - Custom Title vs Title display - 09/01/2007 6:37 AM
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
Posted By: ntdoc Re: [7.2] - Custom Title vs Title display - 09/01/2007 8:42 AM
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
Posted By: AllenAyres [7.2.x] If Custom Title - 11/09/2007 9:09 AM
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


Description: Instructions
Attached File
IfCustomTitle.txt  (46 downloads)
Posted By: blaaskaak Re: [7.2.x] If Custom Title - 11/09/2007 10:38 AM
https://www.ubbdev.com/forums/ubbthreads.php/ubb/showflat/Number/314979#Post314979

Luckely it's build in for 7.3.
Posted By: Gizmo Re: [7.2.x] If Custom Title - 11/09/2007 10:39 AM
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
Posted By: sirdude Re: [7.2.x] If Custom Title - 11/09/2007 11:02 AM
no, it won't wink

[Linked Image]
Posted By: Gizmo Re: [7.2.x] If Custom Title - 11/09/2007 12:30 PM
wink mmmhmmm wink

[Linked Image]
Posted By: AllenAyres Re: [7.2.x] If Custom Title - 11/09/2007 5:42 PM
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
Posted By: AllenAyres Re: [7.2.x] If Custom Title - 11/09/2007 5:48 PM
btw, I had no idea it was done already, I coulda used this a month ago more than once. tipsy
Posted By: AllenAyres Re: [7.2.x] If Custom Title - 11/09/2007 10:24 PM
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
© UBB.Developers