Advertisement:

Custom titles.

Aloittaja pariahdog, huhtikuu 16, 2004, 11:03:03 AP

« edellinen - seuraava »

pariahdog

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.

Oldiesmann

#1
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>
Michael Eshom
Christian Metal Fans

pariahdog


Oldiesmann

Michael Eshom
Christian Metal Fans

Tristan Perry

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.... :-[

Oldiesmann

#5
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.
Michael Eshom
Christian Metal Fans

Tristan Perry

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...

Oldiesmann

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.
Michael Eshom
Christian Metal Fans

Oldiesmann

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>

Michael Eshom
Christian Metal Fans

Tristan Perry

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.... :-\

Oldiesmann

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.
Michael Eshom
Christian Metal Fans

Tristan Perry

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.

Oldiesmann

Please post line 108 of that file here...
Michael Eshom
Christian Metal Fans

scottb

Hmm would it be possible to change the color of the membergroup title?

Tristan Perry

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'])

Oldiesmann

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>';
Michael Eshom
Christian Metal Fans

Tristan Perry

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.....


Oldiesmann

I don't know what's causing that problem then...
Michael Eshom
Christian Metal Fans

Tristan Perry

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

Oldiesmann

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>';
Michael Eshom
Christian Metal Fans

Tristan Perry

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

[Unknown]

Your editor is screwing with the file.  I recommend you try something simpler like Notepad and start from a clean file.

-[Unknown]

Tristan Perry

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.....

Oldiesmann

Try it with a fresh copy of profile.template.php. It should work just fine.
Michael Eshom
Christian Metal Fans

Tristan Perry

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)


:-[   All I want is the Custom title to show (If a member has a custom title!)

Oldiesmann

Hmmm... Send me a PM with your FTP stuff and let me try it.
Michael Eshom
Christian Metal Fans

Tristan Perry

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!

Oldiesmann

Michael Eshom
Christian Metal Fans

pariahdog

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.

Tristan Perry

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>';



trenchteam

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

Stuart

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]

Stuart

#32
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?
 

Altair

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...

Advertisement: