Display Additional Membergroups

Started by margarett, March 03, 2014, 11:02:35 AM

Previous topic - Next topic

Cmely

Quote from: margarett on April 20, 2014, 05:27:23 AM
Do your members have primary membergroups? There is an option to hide the post count membergroups if the user has a primary one. I don't remember which option is it out of my head, though...

Yes they have, but the option to hide post group titles (in theme settings) is correctly unchecked.

What is weird is ff I don't assign a primary membergroup to my member, it shows correctly all groups but if I assigned a primary membergroup it doesn't work.
You have a perfect example of what I'm saying here . The first member has his primary membergroup assigned and the second not.

margarett

It has to be that option... If you uninstall the mod, you have the same behavior, right?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Cmely

Quote from: margarett on April 20, 2014, 06:38:55 AM
It has to be that option... If you uninstall the mod, you have the same behavior, right?

I'm not sure it's coming from this option and I don't think it's coming from your mod.
If I uninstall the mod, I have still weird result.

If the option we're talking about is checked (so that mean we hide post group title), i get those result :
- Member which have a primary member group : Show the badge and the title of the primary member group
- Member which don't have a primary member (but have one additional group and one post count based group) : Show the badge and the title...of the post count based group.

If the option we're talking about is unchecked (so that mean we showpost group title), i get those result :
- Member which have a primary member group : Show the badge and the title of the primary member group AND the title of the post count based group.
- Member which don't have a primary member (but have one additional group and one post count based group) : Show the badge and the title...of the post count based group AND nothing else!

If you have some ideas of what I could check to clarify that, I would be very grateful if you can help me...but as I have the feeling this is not directly related to your mod, it's also perfectly ok if you don't.

I just would like to know if affecting a primary member have some importance, and if yes, what kind of importance ?
Thanks.

Cmely

...just one more thing : the post count based group title shows correctly even when the badge of this group doesn't show !!  :o :o :o

Cmely

...and if I debug (using 'print_r') exactly as you explained it above, I get no sign of post count based groups... :o

margarett

Hi.

What you have is *exactly* how SMF operates, regarding display of membergroups. To recap:

* Additional membergroups are NOT shown anywhere. They are used for permissions only and aren't displayed really anywhere.

* Primary membergroup is always shown if existent. Name and badge (if badge is defined)

* Post count membergroup depends on the primary membergroup and that setting you found:
- Not existent primary group --> name and badge (stars) of the post count group are shown
- Existent primary group --> only name of post count group is shown *if* the mentioned is unchecked. If checked, nothing is shown.

Clear now?

This is what you get with this MOD:
Array
(
    [username] => admin
    [name] => admin
    [id] => 1
..............
    [group] => Administrator
    [group_color] => #FF0000
    [group_id] => 1
    [post_group] => Newbie
    [post_group_color] =>
..............
    [additional_groups_list] => Array
        (
            [0] => 9
        )

So I don't change how SMF deals with the post count membergroups...
I don't remember anymore :P do you want to have the post count group IDs or the full info? (ie, stars and so on)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Cmely

Thank you for taking your time on my problem  :)

What I would like is to see in topics view (and in profile) :
- Primary member group stars
- Additional member group stars
and
- Post count member group stars

When I debug, by using this code :
print_r($message['member']['additional_groups_full'])

I get only that :
Array
(
    [0] => Array
        (
            [group_id] => 29
            [group_color] =>
            [group] => Founder
            [stars] => 1#founder_member.png
            [stars_img] => *
        )

    [1] => Array
        (
            [group_id] => 36
            [group_color] =>
            [group] => Featured_1
            [stars] => 1#featured_1
            [stars_img] => *
        )

)


when this member belongs to :
- Admin (primary)
- Founder (additional)
- Featured (additional)
- Member 2.0 (post count)

DSystem

Margarett, Congratulations, this mod is perfect. Tested and approved.

Suggestion for new feature or a new mod.

Option to display additional groups only in profile. To do this I removed the modifications made in the Display.template.php

Dumke

Thank you so much, i've been trying to do something like this for a while now.
and had only came across this today.

Got everything working perfectly, the way i wanted.

However, since i've installed this, none of my member-groups have colors now.
Not entirely sure what happened.




margarett

Hi.

Membergroups usually don't have colors. So you probably had some MOD to make that happen and that is probably incompatible with this one...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Dumke

Quote from: margarett on June 13, 2014, 05:18:09 AM
Hi.

Membergroups usually don't have colors. So you probably had some MOD to make that happen and that is probably incompatible with this one...

Ah, yes.
That is indeed is what is happening, this removes some calls from load that "SimpleColorizer" uses to color names.

How would someone color names in posts and profile, when using this mod?

margarett

Yup, and it should be fairly easy ;)
With this MOD installed, all relevant parameters are already there:

    [group] => Administrator
    [group_color] => #FF0000
    [group_id] => 1
    [post_group] => Newbie
    [post_group_color] => #FF00FF

So you just need to colorize your display name if "group_color" or "post_group_color" are !empty ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Dumke

Quote from: margarett on June 19, 2014, 11:44:17 AM
Yup, and it should be fairly easy ;)
With this MOD installed, all relevant parameters are already there:

    [group] => Administrator
    [group_color] => #FF0000
    [group_id] => 1
    [post_group] => Newbie
    [post_group_color] => #FF00FF

So you just need to colorize your display name if "group_color" or "post_group_color" are !empty ;)

Oh well that's all great then, but every time i attempt something like that, it doesn't apply the color, and additionally removes the font formatting.

I'm most definitely doing something really wrong.

// Show a link to the member's profile.

if (!empty($message['member']['group_color']))
echo '

<li style="color: ',$message['member']['group_color'], ';">',$message['member']['link'],'</li>';'

</h4>';

margarett

#33
You can't really style the "<li ...."
Best chance would be a span but that doesn't work (just tested it :P )

That needs to be filled in Display.php... $message['member']['link'] comes already "coloured" so you can't really bypass that in Display.template.php

I'm checking...

edit: I was wrong. I need to check...

edit2: Actually it is in Load.php :P
Find:
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>',
Replace with:
'link' => '<a ' . (empty($profile['member_group_color']) ? '' : 'style="color:' . $profile['member_group_color'] . '" ') . ' href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>',
Only works for primary group, though ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Dumke

Quote from: margarett on June 19, 2014, 01:03:16 PM
You can't really style the "<li ...."
Best chance would be a span but that doesn't work (just tested it :P )

That needs to be filled in Display.php... $message['member']['link'] comes already "coloured" so you can't really bypass that in Display.template.php

I'm checking...

edit: I was wrong. I need to check...

edit2: Actually it is in Load.php :P
Find:
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>',
Replace with:
'link' => '<a ' . (empty($profile['member_group_color']) ? '' : 'style="color:' . $profile['member_group_color'] . '" ') . ' href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>',
Only works for primary group, though ;)

I've replaced that, yet it still doesn't color my names in posts
Was there anything else i had to replace?

I removed what i had in my earlier post, since it didn't work.

margarett

No, just that... Try in default theme and uninstall your colorizer mod ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Dumke

I had the wrong 'link', it works now perfectly.


Thank you! :D

SumairAli

i want that (Admin of DeathMatch) and (Admin of Clanwar) show down on Admin of public

margarett

It shows up in topic view. In profile view it only shows where you now see it...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

SumairAli


Advertisement: