Advertisement:

Author Topic: Membergroup Colors In Posts (a solution....or quick fix)  (Read 28237 times)

SeaOfSin

  • Guest
Membergroup Colors In Posts (a solution....or quick fix)
« on: July 26, 2005, 01:09:56 PM »
Since the Membergroup Colors In Posts mod isn't being looked after at this moment until they have more time, I figured I'd try and find a solution.  This isn't an exact copy of the mod, more of a quick fix. I have tested it in 1.1b3p but not 1.05 (maybe someone can tell me if it will work?)

So here is what you need to do

open

Display.template.php and find

Code: [Select]
// Show information about the poster of this message.
echo '
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>', $message['member']['link'], '</b>
<div class="smalltext">';

// 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'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
echo '
', $message['member']['post_group'], '<br />';
echo '
', $message['member']['group_stars'], '<br />';

and replace with

Code: [Select]
// Show information about the poster of this message.
echo '
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>', $message['member']['link'], '</b>
<div class="smalltext">';

// 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'] != '' && isset($message['member']['group_color']))
{
echo '
<span style="color : ', $message['member']['group_color'] ,';"><b>', $message['member']['group'], '</b></span><br />';
}

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')

echo '
   <span style="color : ', $message['member']['post_group_color'] ,';"><b>', $message['member']['post_group'], '</b></span><br />';
echo '
', $message['member']['group_stars'], '<br />';

and it should look something like



Any problems let me know, but I haven't seen any yet :)

Sea Of Sin

Offline ernomo98

  • Jr. Member
  • **
  • Posts: 175
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #1 on: November 03, 2005, 04:56:35 PM »
don't work by 1.1rc1

Offline eohjay

  • Newbie
  • *
  • Posts: 3
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #2 on: November 05, 2005, 04:11:42 AM »
I get this:

"Template Parse Error!
There was a problem loading the /Themes/default/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme."

When trying to use it with the newest SMF version. I would really like to get this working, though, would anyone be able to give me a hand?

Offline ディン1031

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,599
  • Gender: Male
  • はるひ! :P
    • ~DIN1031
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #3 on: November 07, 2005, 01:22:04 AM »
hmmm a easier way is edit groups and change the name for the group to something like
Code: [Select]
<font color=#FF0000>Admin</font> and you've color the group XD, okay it's not automatic but it work :).

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Offline ernomo98

  • Jr. Member
  • **
  • Posts: 175
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #4 on: November 08, 2005, 03:45:19 AM »
hmmm a easier way is edit groups and change the name for the group to something like
Code: [Select]
<font color=#FF0000>Admin</font> and you've color the group XD, okay it's not automatic but it work :).

Bye
DIN1031

yes you have colour in the nickname, but not not in the posts, in each message that you write, it is your nickname, and there doesn't appear colorful.

SeaOfSin

  • Guest
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #5 on: November 29, 2005, 12:26:48 PM »
Sorry for the delay, but I've been away.  This is a copy of what I use upto 1.1b3 and works for me.

Code: [Select]
// Show information about the poster of this message.
echo '
<table width="100%" cellpadding="0" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>', $message['member']['link'], '</b>
<div class="smalltext">';

// 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'] != '' && isset($message['member']['group_color']))
{
echo '
<span style="color : ', $message['member']['group_color'] ,';"><b>', $message['member']['group'], '</b></span><br />';
}

// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')

echo '
   <span style="color : ', $message['member']['post_group_color'] ,';"><b>', $message['member']['post_group'], '</b></span><br />';
echo '
', $message['member']['group_stars'], '<br />';

I'll look into 1.1rc1 and let you know. :)

Sea Of Sin

SeaOfSin

  • Guest
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #6 on: November 29, 2005, 12:37:30 PM »
OK, there is a difference in RC1.  >:( This is what you have to do  :)

find
Code: [Select]
// 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 />';

replace with
Code: [Select]
// Show the member's primary group (like 'Administrator') if they have one.
if(isset($message['member']['group']) && $message['member']['group'] != '' && isset($message['member']['group_color']))
{
echo '
<span style="color : ', $message['member']['group_color'] ,';"><b>', $message['member']['group'], '</b></span><br />';
}

and find
Code: [Select]
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
echo '
', $message['member']['post_group'], '<br />';
echo '
', $message['member']['group_stars'], '<br />';

replace with
Code: [Select]
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')

echo '
   <span style="color : ', $message['member']['post_group_color'] ,';"><b>', $message['member']['post_group'], '</b></span><br />';
echo '
', $message['member']['group_stars'], '<br />';

:)

Sea Of Sin

Offline ernomo98

  • Jr. Member
  • **
  • Posts: 175
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #7 on: December 06, 2005, 06:30:34 AM »
I try it in the 1.1 default and don't work

Offline Elmacik

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,276
  • Gender: Male
  • = Human Draft =
    • IT Store
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #8 on: December 06, 2005, 06:44:55 AM »
Home of Elmacik

SeaOfSin

  • Guest
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #9 on: December 06, 2005, 06:34:44 PM »
Try This:

Code: [Select]
// 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 />';
replace
Code: [Select]
// Show the member's primary group (like 'Administrator') if they have one.
if(isset($message['member']['group']) && $message['member']['group'] != '' && isset($message['member']['group_color']))
{
echo '
<span style="color : ', $message['member']['group_color'] ,';"><b>', $message['member']['group'], '</b></span><br />';
}
and find
Code: [Select]
// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
echo '
', $message['member']['post_group'], '<br />';
echo '
', $message['member']['group_stars'], '<br />';

replace
Code: [Select]
// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')

echo '
   <span style="color : ', $message['member']['post_group_color'] ,';"><b>', $message['member']['post_group'], '</b></span><br />';
echo '
', $message['member']['group_stars'], '<br />';

This is tested in RC1 but should work on any template! :)

Sea Of Sin

Offline ernomo98

  • Jr. Member
  • **
  • Posts: 175
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #10 on: December 07, 2005, 06:39:35 AM »
now it's ok, thnak you very much Sea ;)

Offline Stuart

  • Full Member
  • ***
  • Posts: 421
Re: Membergroup Colors In Posts (a solution....or quick fix)
« Reply #11 on: December 27, 2005, 11:56:03 AM »
hmmm a easier way is edit groups and change the name for the group to something like
Code: [Select]
<font color=#FF0000>Admin</font> and you've color the group XD, okay it's not automatic but it work :).

Bye
DIN1031

I just used this code which works perfectly fine, thanks  ;D