How to - Multiple membergroups shown on post page...

Started by MoreBloodWine, January 03, 2008, 03:44:25 AM

Previous topic - Next topic

MoreBloodWine

See the below pic, well thats from a test forum of mine... Anyway, I made myself a member of a 2nd group called " Co. GM "... not that I need to because I'm the admin but anyway. What would I need to modify to get the 2nd group show below my name / above the administrator tag... hope this makes sense.... Thx.



Edit : What I'm after is leaving everything as it is now BUT getting the second group ( Co. GM ) to show below my username but above the ( Administrator ) tag.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


!Hachi!

NAME
newbie
administrator
i think you want this.REMEMBER I DON'T LIKE TO EDIT TEMPLATE FILES IF YOU WANT TO INSTALL MOD AFTERWARDS IT MIGHT GIVES ERROR SO TAKE BACKUP FILE FIRST.
open you theme 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'])
{
// 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 it with:
// 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 />';
// 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 />';
echo '
', $message['member']['group_stars'], '<br />';
Happy Ramadan

MoreBloodWine

Didnt do a thing as far as I could tell... Hope someone wil read this and get what it is that I am after.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


greyknight17

Are you using the default theme or a custom one? If custom one and they have their own Display.template.php, you will have to edit that one instead.

If you did and still no changes, can you tell us what you want specifically? Something like this:

Your Name
Co. GM
Administrator

If so, that code posted above should work.

DMV

I have the display additional membergroups mod, using the default theme

The dilemna is that it only display ONE group in the post/topic...

Is there a way to have it display all of a members' membergroups

Similar to the first post, but have

Name
"newbie"
Group 1
Group 2
Group 3

along with the "star image" for each particular group?
(I don't care what the order is, my main goal is just to have each membergroup shown in the users' posts)

Thanks in advance...

MoreBloodWine

#5
Quote from: greyknight17 on January 03, 2008, 05:20:24 PM
Are you using the default theme or a custom one? If custom one and they have their own Display.template.php, you will have to edit that one instead.

If you did and still no changes, can you tell us what you want specifically? Something like this:

Your Name
Co. GM
Administrator

If so, that code posted above should work.
Custom theme I edited the right files and unless I screwed up which I know I didnt it didnt work... but yes thats what I am after... everything staying as is now with the one exception that Co. GM now shows up.

Your Name
Co. GM
Administrator

BUT I want Co. GM to adhere to the color I have set in the membergroup... I used HTML around the name plate area to change the text color of Co. GM if that makes sense.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


greyknight17

DMV, I would post your question in that mod's topic to see if anyone knows how to show more than one membergroup in a user's post.

MoreBloodWine, there was a mod that displayed the membergroup color in each post, but it's outdated now. What theme are you using? Did your custom theme have the Display.template.php? Attach that file here.

MoreBloodWine

#7
Quote from: greyknight17 on January 03, 2008, 09:19:54 PM
DMV, I would post your question in that mod's topic to see if anyone knows how to show more than one membergroup in a user's post.

MoreBloodWine, there was a mod that displayed the membergroup color in each post, but it's outdated now. What theme are you using? Did your custom theme have the Display.template.php? Attach that file here.
I have a custom theme... like I said all I want it to do is what its doing now but show the Co. GM tag below my name but above the Administrator tag... so best I can figure is the code that displays the administrator tag on the post page would have to be exactly duplicated but told to grab the Co. GM group but have the code placed above the administrator code so it shows the Co. GM where I want it (above admin but below my name). Also I'd prefer to do the modifications myself... as for testing it to see if it can be done all you or anyone would have to do is copy your file make a second group asign yourself to it and go from there.

Edit:

Best I can figure this is the code that needs to be duplicated / told to grab the Co. GM group...

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


So it should look like below BUT the first set of code modified / told to grab the Co. GM group which is NOT a post based group...

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

// 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 />';
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


!Hachi!

well sorry if i misunderstood i get this on default theme as i told you codes in my post.

Note COMMANDER is post based group and admin is my primary
Happy Ramadan

MoreBloodWine

#9
Quote from: Hassan on January 03, 2008, 11:50:38 PM
well sorry if i misunderstood i get this on default theme as i told you codes in my post.

Note COMMANDER is post based group and admin is my primary
But the post based group is NOT what I want changed / moved...

Edit:

The pic below shows which group (one with the arrow pointing to it) that I want to show above the admin tag but below my name on the post page when viewing posts... so we already know that the Display.template.php is what needs to be modified...



So with that said I go back to an earlier post of mine...

Quote from: MoreBloodWine on January 03, 2008, 09:42:28 PMBest I can figure this is the code that needs to be duplicated / told to grab the Co. GM group...

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


So it should look like below BUT the first set of code modified / told to grab the Co. GM group which is NOT a post based group...

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

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

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Rumbaar

This mod has the additional membergroups display in profile
Display Additional Membergroups on Profile
I'm not sure of the code to display all the membergroup, but I assume it should be able to be adapted to work in the Display.template.php file as well.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

MoreBloodWine

#12
Quote from: Rumbaar on January 08, 2008, 05:01:22 PM
This mod has the additional membergroups display in profile
Display Additional Membergroups on Profile
I'm not sure of the code to display all the membergroup, but I assume it should be able to be adapted to work in the Display.template.php file as well.
Well, I already loked at that and I'm after the post thing only AS descibed with the secondary group showing above the primary in this case secondary being Co. GM and the primary being Administrator. I posted above what should and will work I'd assume so long as the one code can be told to grab Co. GM and not administrator.

Edit : The simplest most easiest way I see this being achieved is changing the following code / telling it to grab the Co. GM / secondary group and not the administrator / primary group... I know it can be done I just dont have the needed coding skills to do it.

// 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 />';
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Rumbaar

Well I didn't mean to actually use it, but maybe take the code used to get multiple membergroups to display and incorporate that code into your Display.template.php file.

I don't have time now, but I'll try to look at the mod code when I'm home and see if I can work something out.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

MoreBloodWine

Quote from: Rumbaar on January 08, 2008, 05:31:47 PM
Well I didn't mean to actually use it, but maybe take the code used to get multiple membergroups to display and incorporate that code into your Display.template.php file.

I don't have time now, but I'll try to look at the mod code when I'm home and see if I can work something out.
I suppose I could try to pick at it but I'd really rather someone with a more definitive answer come by so I dont have to screw anything up and worry about trying to fix it, and yes I also do backup but still. I know the below code can be modified and told to grab a different group other than the primary group (admin in my case) I just dont know what to change let alone how to change it, this goes beyond my verrrrry limited coding skills.

// 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 />';
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

I cant make heads or tails of that mod as to what I could use but I still think what I posted in my lat post will work if the code can be told to grab the Co. GM group instead of the primary admin group. So with that said (points to his post above this one...)
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Rumbaar

I've moved this to SMF Coding.

With that mod installed I tried ', $message['member']['additionalGroups2'][1] ,' to try and extract the second entry in the array for the Display.template.php.  But for some reason the array isn't populated when in the Display.template.php.  But the code is in Loads.php so it should be accessible.

Hopefully someone from the Customize team will have more of an answer.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

MoreBloodWine

Quote from: Rumbaar on January 11, 2008, 06:53:52 PM
I've moved this to SMF Coding.

With that mod installed I tried ', $message['member']['additionalGroups2'][1] ,' to try and extract the second entry in the array for the Display.template.php.  But for some reason the array isn't populated when in the Display.template.php.  But the code is in Loads.php so it should be accessible.

Hopefully someone from the Customize team will have more of an answer.
Well, yes hopefully someone with a more difinitive answer will come by. As for that mod I dont want / need it installed because I dont want the additional groups shown on profile just in / on the post page. But ya that code I took from the Display.template.php should work just fine if it can be modified / told to grab the Co. GM group which is the secondary group I placed myself in on my forum.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Bulakbol

Install Display Additional Membergroups on Profile. Then in Sources/Load.php, look for

if ($set == 'normal')
{
$select_columns = "
IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
mem.signature, mem.personalText, mem.location, mem.gender, mem.avatar, mem.ID_MEMBER, mem.memberName,


and add mem.additionalGroups, at the end after mem.memberName,

In default/Display.template.php, find

', $message['member']['group'], '<br />';

and below it, add

if(!empty($message['member']['additionalGroups2']))
foreach ($message['member']['additionalGroups2'] as $additional)
echo $additional. '<br />';


Don't forget to install the "Display Additional Membergroups on Profile" first.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Rumbaar

Ah, that is where I was failing.  Thank you JohnyB

Also if you only want the first of the secondary group, instead of all you can use ' , $message['member']['additionalGroups2'][0], '
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: