Mod that displays Member Groups for users under their names / Avatars on posts

Started by GJSchaller, March 06, 2008, 11:08:13 PM

Previous topic - Next topic

GJSchaller

It was not in the globals for display.template.php - I just added it, still no luck.
Geoffrey J. Schaller
Knight Realms - Technical Officer
http://www.knightrealms.com/

GJSchaller

It doesn't seem to be possible to attach the display template - would it be bad form to post the contents for review?
Geoffrey J. Schaller
Knight Realms - Technical Officer
http://www.knightrealms.com/

Eliana Tamerin

Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!


Matthew Schenker

Good Morning,
I'm looking for the same kind of thing in my forum -- need to display primary and additional membergroups.  I'm following this discussion, but I'm a little unclear.  Has the problem been solved?

Another questions: why are additional membergroups not displayed by default in SMF?

Matthew

GJSchaller

It has not been resolved - I've been working with ccbtimewiz to get it, but have not been successful.  The last we talked, he was going to work with some other developers to make it an installable package, but there has been no word on it yet.

I can see it not being a default because not everyone will want member groups displayed.  For a while, we did *not* want groups displayed because we didn't want the identity of a certain group getting out (basically, inspectors that people would behave differently around), so that makes total sense.  As an option, it's fine.
Geoffrey J. Schaller
Knight Realms - Technical Officer
http://www.knightrealms.com/

Matthew Schenker

GJSchaller,
OK, on one hand I'm glad to know that it's not just a problem with my own forum.

On the other hand, what's the purpose is of having membergroups if they can't be displayed?  I don't get it.

In my forum, several members have a primary membergroup.  A lot of those members also donate to the forum.  I'd really like to designate those who are donating to the forum, along with their primary membergroup.  It seems I have to make a choice -- either display them as donors or as their primary membergroup.

Matt

GJSchaller

Membergroups are primarily for security / access reasons.  I use them to control who can see which boards, and edit things on specific boards.  Listing them is secondary, but desirable.

(Keep in mind I'm not an SMF dev or even a coder, just a regular guy!)
Geoffrey J. Schaller
Knight Realms - Technical Officer
http://www.knightrealms.com/

Acans

i would also like to see this mod happen, but you also able to select your primary membergroups and if youra  member of 2 other membergroups choose witch one is A and the other B
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Bulakbol

Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Acans

nope, it didnt work, has the person with the code lyoko picture fixed or something (sorry, i couldnt remember your name, your pictures attracted me)
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

Eliana Tamerin

No, it hasn't been resolved yet.

It's probably because $user_info['groups'] has to be "unraveled" first in order to be used. This was the case when I tried to use it on my own site in a template file. Since $user_info is typically more for source files, this would make sense.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Acans

"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

meliDSO

I would absolutely love to see this come into fruition.  I've been looking everywhere for a mod like this, and so far the closest I've gotten is having the additional groups shown in the profile.  Has anyone had any further luck with it?

GJSchaller

Nothing I have seen, although I'd love to see it, too.

Maybe something for 2.0?
Geoffrey J. Schaller
Knight Realms - Technical Officer
http://www.knightrealms.com/

ccbtimewiz

Been a while, mate. I've learned much more than what I showed you.

You still looking for the solution for this? In the past I was comparing an array stance with a variable string which isn't really a good thing to do.

Would you like me to show you how to do it correctly?

GJSchaller

Yes, please!  If you can post it here, that would be fantastic, since a lot of people want to know how.

I can also catch you by google chat when I see you on next.
Geoffrey J. Schaller
Knight Realms - Technical Officer
http://www.knightrealms.com/

ccbtimewiz

Well alright then.

Look at this post > http://www.simplemachines.org/community/index.php?topic=254435.0

Depending on how many groups you have, you'd do something like:

global $user_info;
if( in_array(1$user_info['groups'] ) ) { echo '<img src="http://yoursite.com/adminbanner" alt="*" />'; }
if( 
in_array(2$user_info['groups'] ) ) { echo '<img src="http://yoursite.com/glomodbanner" alt="*" />'; }
if( 
in_array(3$user_info['groups'] ) ) { echo '<img src="http://yoursite.com/modbanner" alt="*" />'; }
if( 
in_array(4$user_info['groups'] ) ) { echo '<img src="http://yoursite.com/rankonebanner" alt="*" />'; }


And you'd continue the pattern. There is another way to do this via database-- but I'm afraid that would take a lot more effort then just using conditional php statements on the template.

Acans

"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more


Advertisement: