Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: souljaa on May 24, 2007, 03:49:29 PM

Title: Custom Title -- Need help
Post by: souljaa on May 24, 2007, 03:49:29 PM
Hey guys! Anyways, I have my own forum (www.gfxpros.ej.am) and I was wondering if it was possible to make a username's Custom Title Bold or Italic or in Color?? Or if there's any MOD for that??
Thanks a lot!
Really appreciate the help!
Souljaa
Title: Re: Custom Title -- Need help
Post by: metallica48423 on May 24, 2007, 03:53:40 PM
in Display.template.php:

Find:

// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
', $message['member']['title'], '<br />';


Make it:

// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
<b>', $message['member']['title'], '</b><br />';
Title: Re: Custom Title -- Need help
Post by: metallica48423 on May 24, 2007, 03:54:52 PM
replace <b> with <i> and </b> with </i> for italic

for colors, <span style="color: colorname;" where <b> is and </span> where </b> is
Title: Re: Custom Title -- Need help
Post by: souljaa on May 24, 2007, 03:55:33 PM
Hey BlackMage! Thanks! But is it possible for just one specific user?

Thanks alot!
Souljaa
Title: Re: Custom Title -- Need help
Post by: codenaught on May 25, 2007, 05:54:33 PM
You can do something like this:

// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
if($message['member']['id'] == 1)
echo ' <b>', $message['member']['title'], '</b><br />';
else
echo '
', $message['member']['title'], '<br />';


Changing the 1 in that code with the member id you want to do this for.
Title: Re: Custom Title -- Need help
Post by: souljaa on May 25, 2007, 08:21:05 PM
Quote from: akabugeyes on May 25, 2007, 05:54:33 PM
You can do something like this:

// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
if($message['member']['id'] == 1)
echo ' <b>', $message['member']['title'], '</b><br />';
else
echo '
', $message['member']['title'], '<br />';


Changing the 1 in that code with the member id you want to do this for.

In the display.template.php?
Title: Re: Custom Title -- Need help
Post by: codenaught on May 25, 2007, 11:43:41 PM
Yes, you would be replacing this original code in Display.template.php:


// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
echo '
', $message['member']['title'], '<br />';
Title: Re: Custom Title -- Need help
Post by: souljaa on July 09, 2007, 02:19:03 PM
Sorry to bring this back up! But what if I want to do the same, but for a username? And each one is specific, and different for each member?
Thanks!
- Souljaa
Title: Re: Custom Title -- Need help
Post by: metallica48423 on July 09, 2007, 04:16:33 PM
buggy's code is already user specific.

// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
if($message['member']['id'] == 1)
echo ' <b>', $message['member']['title'], '</b><br />';
else
echo '
', $message['member']['title'], '<br />';


see the:
if($message['member']['id'] == 1)?

To add more, just add another

if($message['member']['id'] == 1)
echo ' <b>', $message['member']['title'], '</b><br />';


above the else but after the other code.  example:


// Show the member's custom title, if they have one.
if (isset($message['member']['title']) && $message['member']['title'] != '')
if($message['member']['id'] == 1)
echo ' <b>', $message['member']['title'], '</b><br />';
        if($message['member']['id'] == 2)
echo ' <b>', $message['member']['title'], '</b><br />';
if($message['member']['id'] == 3)
echo ' <b>', $message['member']['title'], '</b><br />';
               
                else
echo '
', $message['member']['title'], '<br />';
Title: Re: Custom Title -- Need help
Post by: souljaa on July 11, 2007, 11:42:50 AM
Thanks Metallica, but I was wondering if it was possible to put codes of colours? Like #FF00FF for more colours? I tried it, doesn't work, is there a way I could?
Title: Re: Custom Title -- Need help
Post by: RAdams on July 11, 2007, 01:18:33 PM
Quote from: souljaa on July 11, 2007, 11:42:50 AM
Thanks Metallica, but I was wondering if it was possible to put codes of colours? Like #FF00FF for more colours? I tried it, doesn't work, is there a way I could?

echo ' <b><font color="#FFFFFF">', $message['member']['title'], '</font></b><br />';
Title: Re: Custom Title -- Need help
Post by: metallica48423 on July 11, 2007, 02:15:17 PM
you could do as said, but <font> is deprecated.  While it will work it will not validate if you run your site through an html validator.

Use <span style="color: #FFFFFF">', $message['member']['title'], '</span> instead.

where #FFFFFF is the hex code of that color (if you need help with hex codes, check google :)).
Title: Re: Custom Title -- Need help
Post by: souljaa on July 12, 2007, 12:51:41 AM
Thanks! Works perfect!!!!! :).
Title: Re: Custom Title -- Need help
Post by: souljaa on July 12, 2007, 02:19:07 PM
Is there a way to make it possible to see the colour when we go check our profile?
Thanks!!
- Souljaa
PS: Sorry for all the trouble :P
Title: Re: Custom Title -- Need help
Post by: souljaa on January 09, 2010, 11:41:13 PM
Hey guys! Really sorry to bring this topic back, but I was just wondering, I wanted to use this again, for my new forum and I was wondering, I did exactly as said, but every time I put the code in, the Custom Title just dissapears completely. Is there any change I have to make? Doesn't seem to work. Tried it several times.
Thank you
Souljaa
Title: Re: Custom Title -- Need help
Post by: JimM on January 22, 2010, 09:19:35 PM
Are you still using 1.1.x?  The code posted may not work if you have upgraded to 2.0 or changed themes.  Also you may want to try different colors, in case you are changing it to the color of the background.