Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: pariahdog - huhtikuu 16, 2004, 11:03:03 AP

Otsikko: Custom titles.
Kirjoitti: pariahdog - huhtikuu 16, 2004, 11:03:03 AP
Is it possible to use BBCode in the custom titles? I would really like to be able to edit size and color.

also, is there a way to replace the membergroup title with a custom title? thanks a lot.
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 16, 2004, 12:56:29 IP
Yes, you could do both.

To add UBBC functionality to the custom title:

In Themes/classic/Display.template.php

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


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


In Themes/default/Display.template.php

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


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


In Themes/default/Profile.template.php

Search for
if (!empty($modSettings['titlesEnable']) && $context['member']['title'] != '')
{
echo '
<tr>
<td><b>', $txt['title1'], ': </b></td>
<td>', $context['member']['title'], '</td>
</tr>';
}


Replace with
if (!empty($modSettings['titlesEnable']) && $context['member']['title'] != '')
{
echo '
<tr>
<td><b>', $txt['title1'], ': </b></td>
<td>', doUBBC($context['member']['title']), '</td>
</tr>';
}


Now, to replace the membergroup title with the custome title (not sure why you'd wanna do this, though):

In Themes/classic/Display.template.php

Search for:
// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
', $message['member']['group'], '<br />';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
echo '
', $message['member']['post_group'], '<br />
', $message['member']['group_stars'], '<br />';


Replace with:
// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
', $message['member']['group'], '<br />';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
echo '
', $message['member']['group_stars'], '<br />';


In Themes/default/Display.template.php:

Search for
// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
', $message['member']['group'], '<br />';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
echo '
', $message['member']['post_group'], '<br />
', $message['member']['group_stars'], '<br />';


Replace with
// Show the member's primary group (like 'Administrator') if they have one.
if (isset($message['member']['group']) && $message['member']['group'] != '')
echo '
', $message['member']['group'], '<br />';

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
echo '
', $message['member']['group_stars'], '<br />';


In Themes/default/Profile.template.php

Search for
<td><b>', $txt[87], ': </b></td>
<td>', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</td>


Replace with
<td><b>', $txt[87], ': </b></td>
<td>', (!empty($context['member']['group']) ? $context['member']['group'] : ''), '</td>
Otsikko: Re: Custom titles.
Kirjoitti: pariahdog - huhtikuu 16, 2004, 09:27:04 IP
Thank you so much.
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 17, 2004, 09:08:02 IP
No problem. :)
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 20, 2004, 12:53:47 IP
Hmm....I tried the 2nd thing (If a member has a custom title, it replaces their member group) although I just got a parse error and it didn't work......I followed everything correctly.... :-[
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 20, 2004, 01:43:18 IP
I changed one minor thing. I don't think it should have caused a parse error, but it might have. If you get a parse error again, please post the error message here. It's much easier to help that way.
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 20, 2004, 01:58:01 IP
LainaaParse error: parse error in /home/yxdvfheq/public_html/forums/Themes/default/Profile.template.php on line 525



When I view someones profile and then I get:

LainaaUnable to load the 'X' template.

When I try to edit something of a members...
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 20, 2004, 02:17:46 IP
Ok... Well, try this.

In the last step, change the '' to "" and see what happens. I haven't actually tested this, but I think it will work.
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 20, 2004, 02:25:04 IP
Actually, I just realized something. I'm making this more complicated than it needs to be. I'm basically saying "If $context['member']['group'] isn't empty, display it, otherwise display nothing". But, if it's empty, that's the same as nothing.. So, change that last step to

Find:
<td><b>', $txt[87], ': </b></td>
<td>', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</td>


Replace:
<td><b>', $txt[87], ': </b></td>
<td>', $context['member']['group'], '</td>

Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 20, 2004, 02:27:38 IP
Lainaus käyttäjältä: Oldiesmann - huhtikuu 20, 2004, 02:17:46 IP
Ok... Well, try this.

In the last step, change the '' to "" and see what happens. I haven't actually tested this, but I think it will work.

Thanks but still:

LainaaParse error: parse error in /home/yxdvfheq/public_html/forums/Themes/default/Profile.template.php on line 525



In profile.... :-\
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 20, 2004, 02:32:59 IP
Find:

<td><b>', $txt[87], ': </b></td>
<td>', (!empty($context['member']['group']) ? $context['member']['group'] : ""), '</td>


Replace:
<td><b>', $txt[87], ': </b></td>
<td>', $context['member']['group'], '</td>


That should fix it.
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 20, 2004, 02:35:14 IP
Lainaus käyttäjältä: Oldiesmann - huhtikuu 20, 2004, 02:32:59 IP
Find:

<td><b>', $txt[87], ': </b></td>
<td>', (!empty($context['member']['group']) ? $context['member']['group'] : ""), '</td>


Replace:
<td><b>', $txt[87], ': </b></td>
<td>', $context['member']['group'], '</td>


That should fix it.

Thanks but:

LainaaParse error: parse error, expecting `','' or `';'' in /home/yxdvfheq/public_html/forums/Themes/default/Profile.template.php on line 108



LainaaAn Error Has Occurred!
Unable to load the 'summary' template. 

And the custom title and the member group shows.... :-[

   Sorry for all of this, if it's not possible then that's okay.
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 20, 2004, 02:36:42 IP
Please post line 108 of that file here...
Otsikko: Re: Custom titles.
Kirjoitti: scottb - huhtikuu 20, 2004, 02:38:19 IP
Hmm would it be possible to change the color of the membergroup title?
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 20, 2004, 02:38:22 IP
Lainaus käyttäjältä: Oldiesmann - huhtikuu 20, 2004, 02:36:42 IP
Please post line 108 of that file here...

Um....

Lainaaif ($user_info['is_admin'])
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 20, 2004, 02:41:33 IP
Look at the lines above that. Including the code changes I just told you about, you should see this:

</tr><tr>
<td><b>', $txt[87], ': </b></td>
<td>', $context['member']['group'], '</td>
</tr>';
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 20, 2004, 02:44:29 IP
Lainaus käyttäjältä: Oldiesmann - huhtikuu 20, 2004, 02:41:33 IP
Look at the lines above that. Including the code changes I just told you about, you should see this:

</tr><tr>
<td><b>', $txt[87], ': </b></td>
<td>', $context['member']['group'], '</td>
</tr>';


Yeah I see that.....

Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 20, 2004, 02:45:29 IP
I don't know what's causing that problem then...
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 20, 2004, 02:47:22 IP
Lainaus käyttäjältä: Oldiesmann - huhtikuu 20, 2004, 02:45:29 IP
I don't know what's causing that problem then...

This is the file I have with the changes you said, if it helps:

http://myweb.tiscali.co.uk/gamersplace/Profile.template.php
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 20, 2004, 03:01:44 IP
That helps a lot. Here's your problem right here...

</tr><tr>
<td><b>', $txt[87], ': </b></td>
<td>', $context['member']['group'], '</td>


That should be
</tr><tr>
<td><b>', $txt[87], ': </b></td>
<td>', $context['member']['group'], '</td>
</tr>';
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 20, 2004, 04:01:14 IP
Lainaus käyttäjältä: Oldiesmann - huhtikuu 20, 2004, 03:01:44 IP
That helps a lot. Here's your problem right here...

</tr><tr>
<td><b>', $txt[87], ': </b></td>
<td>', $context['member']['group'], '</td>


That should be
</tr><tr>
<td><b>', $txt[87], ': </b></td>
<td>', $context['member']['group'], '</td>
</tr>';



Thanks but....
LainaaParse error: parse error in /home/yxdvfheq/public_html/forums/Themes/default/Profile.template.php on line 525
In profile

And line 525 is:

if ($context['user']['is_owner'] &amp;amp;amp;amp;&amp;amp;amp;amp; $context['require_password'])

:-[ Sorry about all this
Otsikko: Re: Custom titles.
Kirjoitti: [Unknown] - huhtikuu 20, 2004, 04:22:06 IP
Your editor is screwing with the file.  I recommend you try something simpler like Notepad and start from a clean file.

-[Unknown]
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 21, 2004, 11:57:48 AP
I tried it with notepad, no parse errors but nothing happened, custom title didn't show over the member groups and UBBC code didn't work.....
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 21, 2004, 12:07:19 IP
Try it with a fresh copy of profile.template.php. It should work just fine.
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 21, 2004, 12:31:27 IP
Lainaus käyttäjältä: Oldiesmann - huhtikuu 21, 2004, 12:07:19 IP
Try it with a fresh copy of profile.template.php. It should work just fine.

Just tried it as you said, no parse errors shown but nothing happened. I still got:

Craftworld Shas'O     (Custom Title)
Shas'ui                   (Member Group)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fforums.tauonline.org%2F%2FThemes%2Fclassic%2Fimages%2Fstar1.gif&hash=208851da61d35990802b35a739a4a5223aa30361)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fforums.tauonline.org%2F%2FThemes%2Fclassic%2Fimages%2Fstar1.gif&hash=208851da61d35990802b35a739a4a5223aa30361)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fforums.tauonline.org%2F%2FThemes%2Fclassic%2Fimages%2Fstar1.gif&hash=208851da61d35990802b35a739a4a5223aa30361)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fforums.tauonline.org%2F%2FThemes%2Fclassic%2Fimages%2Fstar1.gif&hash=208851da61d35990802b35a739a4a5223aa30361)(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fforums.tauonline.org%2F%2FThemes%2Fclassic%2Fimages%2Fstar1.gif&hash=208851da61d35990802b35a739a4a5223aa30361)

:-[   All I want is the Custom title to show (If a member has a custom title!)
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 21, 2004, 12:36:44 IP
Hmmm... Send me a PM with your FTP stuff and let me try it.
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - huhtikuu 21, 2004, 12:39:30 IP
Lainaus käyttäjältä: Oldiesmann - huhtikuu 21, 2004, 12:36:44 IP
Hmmm... Send me a PM with your FTP stuff and let me try it.

Okay I'll do that now.

Oh yeah, I have restored the old Display.template and Profile.template files and so none of the changes I made are there!
Otsikko: Re: Custom titles.
Kirjoitti: Oldiesmann - huhtikuu 21, 2004, 12:41:26 IP
Ok.
Otsikko: Re: Custom titles.
Kirjoitti: pariahdog - toukokuu 04, 2004, 10:32:58 IP
Right, I think he and I were looking for the same thing. I wanted the custom title to replace a user's Member group so that it would not show the title AND membergroup. However; I still wanted to be able to see all of the other poster's member group info... Maybe I'm not making any sense.
Otsikko: Re: Custom titles.
Kirjoitti: Tristan Perry - toukokuu 06, 2004, 02:38:33 IP
Lainaus käyttäjältä: pariahdog - toukokuu 04, 2004, 10:32:58 IP
Right, I think he and I were looking for the same thing. I wanted the custom title to replace a user's Member group so that it would not show the title AND membergroup. However; I still wanted to be able to see all of the other poster's member group info... Maybe I'm not making any sense.

I'm not sure about the last bit, but this is what Olidesmann did, and it's working fine:

In Display.index.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 />';

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

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
echo '
', $message['member']['post_group'], '<br />
', $message['member']['group_stars'], '<br />';


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



// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
if(!$message['member']['title'])
{
echo '
', $message['member']['post_group'], '<br />
', $message['member']['group_stars'], '<br />';
}





In Profile.template.php:

Find

echo '
<tr>
<td><b>', $txt['title1'], ': </b></td>
<td>', $context['member']['title'], '</td>
</tr>';


Replace

echo '
<tr>
<td><b>', $txt['title1'], ': </b></td>
<td>', doUBBC($context['member']['title']), '</td>
</tr>';


Otsikko: Re: Custom titles.
Kirjoitti: trenchteam - elokuu 30, 2005, 08:49:27 IP
I want to add this to the PM's because the BBC coding show up in there? How can I do this? everything else is GREAT! ;D
Otsikko: Re: Custom titles.
Kirjoitti: Stuart - maaliskuu 24, 2007, 04:54:03 IP
Lainaus käyttäjältä: Oldiesmann - huhtikuu 16, 2004, 12:56:29 IP
Yes, you could do both.
To add UBBC functionality to the custom title:

In Themes/default/Display.template.php

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


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


In Themes/default/Profile.template.php

Search for
if (!empty($modSettings['titlesEnable']) && $context['member']['title'] != '')
{
echo '
<tr>
<td><b>', $txt['title1'], ': </b></td>
<td>', $context['member']['title'], '</td>
</tr>';
}


Replace with
if (!empty($modSettings['titlesEnable']) && $context['member']['title'] != '')
{
echo '
<tr>
<td><b>', $txt['title1'], ': </b></td>
<td>', doUBBC($context['member']['title']), '</td>
</tr>';
}

I must be doing something wrong as I can change the colour now and it appears correct in the profile but I cannot see it next to the posts. It gives me Custum Title XXX[/ color]  ???[/ color]
Otsikko: Re: Custom titles.
Kirjoitti: Stuart - maaliskuu 24, 2007, 04:59:21 IP
Oooops, I'm so sorry! I just realised I have to change Display.template.php in my current theme  :-[

Nevertheless, how do I change this so it appears correctly in my Instant Messages too? 
Otsikko: Re: Custom titles.
Kirjoitti: Altair - helmikuu 09, 2008, 01:01:24 IP
Lainaus käyttäjältä: Stuart - maaliskuu 24, 2007, 04:59:21 IP

Nevertheless, how do I change this so it appears correctly in my Instant Messages too? 

I didn't want to start a new thread so I figured I would use this one. Hope that is OK. I wish to know the same thing...