News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Display Additional Membergroups

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

Previous topic - Next topic

margarett

Link to Mod



Display Additional Membergroups

This MODification allows you to display all the membergroups a user is member of, both in topics view and in profile. You can choose whether or not to show the additional membergroups and, if you choose to show them, whether or not to show the membergroup name (in this case, only the "stars" will be shown)

Languages:
     - English

Changelog

Version 1.01 // 22-01-2014
================================================================================
! Fixed minor bug, not showing the post count group stars

Version 1.00 // 23-11-2013
================================================================================
+ First release

Legend:
--------------------------------------------------------------------------------
! Minor change or bugfix.
+ Feature addition or improvement.
- Feature or option removal.


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

Westwegoman

I installed this mod but had to fight with it due to the google member map mod. I got it to work but I get the following errors each time a thread is visited.
2: Illegal string offset 'stars_img'
Apply Filter: Only show the errors from this file
File: /community/Themes/default/Display.template.php
Line: 342


2: Illegal string offset 'group'
Apply Filter: Only show the errors from this file
File: /community/Themes/default/Display.template.php
Line: 340


The following is what is found at lines 340 and 342:
<li class="membergroup">', $temp['group'], '</li>';
echo '
<li class="membergroup">', $temp['stars_img'], '</li>';


It seems like it has something to do only with additional member groups showing up in post that I have made as there are 2 "Y's" under my groups. It doesn't happen on any other posts. Any ideas what would cause this?

margarett

Hi,

I cannot reproduce that, I don't know why you're getting that.

Try to add some debug into Display.template.php
Find:
if (!empty($message['member']['additional_groups_full'])) {
Add after
if ($context['user']['is_admin'])
{
echo '<pre>';
print_r($message['member']['additional_groups_full']);
echo '</pre>';
}


This will show only to admins the full array of additional membergroups, please paste it here. It should return something like this:
Array
(
    [0] => Array
        (
            [group_id] => 2
            [group_color] => #0000FF
            [group] => Global Moderator
            [stars] => 5#stargmod.gif
            [stars_img] => *****
        )

)
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

Westwegoman

#3
I think I narrowed it down to me messing up something in Load.php trying to get it to work with the Member Map mod.

Westwegoman

#4
I figured it out. It's when custom profile fields are shown in topic view. Any idea what would fix it?

If I delete the text from the custom profile field or deselect "show in topic view"  to keep the field from showing, the problem goes away.

Hopefully there is a solution cause this would make a great addition to our forum.

margarett

I'm sorry, I'm working abroad this week so I can only check that after the weekend, probably.

Thank you for checking and reporting ;)
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

Westwegoman

No problem. Thanks for looking into it.

margarett

#7
Just had the change to peek it. You are correct, this is a real bug. I'll fix it shortly ;)

edit: weird issue :P fixed ;)
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

Westwegoman

Just installed. Works like a charm.

Thanks!

Westwegoman

#9
Ahhh... Just noticed that I get errors in the error log when visiting profiles. It doesn't seem to error on my admin account but throws errors on some of the other accounts, but not all.

http://www.bayoustatefishing.com/community/index.php?action=profile;area=summary;u=49
Apply Filter: Only show the errors with the same message
8: Undefined index: additional_groups
Apply Filter: Only show the errors from this file
File: /Sources/Profile.php
Line: 166


Line 166:
'enabled' => $context['user']['is_admin'] || ($cur_profile['id_group'] != 1 && !in_array(1, explode(',',


EDIT: Seems like it throws the error if their primary membergroup is set to something other than "no primary membergroup". with nothing selected in additional membergroups. If I change it then the errors go away. Wierd thing is if I go back to the origional settings in the profile, the errors don't come back...

If that makes sense.

Westwegoman

Ok. I'm not sure if this makes any sense but, If I visit a profile, it throws the error the first 2 visits. For some reason it doesn't throw the error on that profile on the 3rd visit.

margarett

:o Maybe some cache related issue, dunno. What's your cache configuration?

Thanks ;)
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

Westwegoman


margarett

Actually I was looking at it and you are right. I see the issue now.

It's actually strange how this slipped. I checked this over and over. Well, I think not enough :P
Give me some minutes ;)
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

Westwegoman

Ok. Great! :) If possible, could you list the changes that you make? It would be easier for me to change them manually since I have other mods that affect the installation of this one through the package manager.

margarett

Fixed.

Changes:
In this case, Sources/Profile.php (a new operation)
Find:
'enabled' => $context['user']['is_admin'] || ($cur_profile['id_group'] != 1 && !in_array(1, explode(',', $cur_profile['additional_groups']))),
Replace with:
'enabled' => $context['user']['is_admin'] || ($cur_profile['id_group'] != 1 && !in_array(1, $cur_profile['additional_groups_list'])),
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

Westwegoman

Good deal!! No more errors.

Thanks for the mod. Love it!!

margarett

Glad it works for you.

Thank you for reporting the issues ;-)
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

Thanks for showing me this mod. It installed properly on my forum.

Infortunately, I still can't see my post count based badges. Would you have any idea on how to solve this problem ?

margarett

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

Advertisement: