EllisLab text mark
Advanced Search
     
Forum member group under Avatar
Posted: 12 January 2009 06:47 PM   [ Ignore ]
Avatar
Joined: 2007-03-30
38 posts

Hi. I ran into a bit of a problem. I’m trying to get each user’s member group to sit under their avatar each thread. I figured I’d just add the line {member_group}, but {member_group} works the same way as it does in regular EE templates, rather than the way it works in the theme_member class.

Is there any way for me to get the {member_group} to function in $theme_threads->thread_rows() the same way it does in the theme_member class?

Thanks for the help!

Ben.

 
Posted: 12 January 2009 07:13 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2004-05-15
29075 posts

When you try {member_group} in your template, what do you get? I think you actually might have to run your forums through EE’s main template parser, too. Also, what version and build of EE are you on?

 
Posted: 12 January 2009 07:24 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-03-30
38 posts

I’m already running it through the main template parser I believe. When I use it in $theme_threads, I get a “1” which I assume is it doing the behavior it’s supposed to in the standard EE templates (it’s showing MY member group).

Thanks for the prompt assistance.

 
Posted: 13 January 2009 12:04 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2002-04-29
26055 posts

Ben, did you receive enough information to resolve this issue?

 
Posted: 13 January 2009 01:40 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2007-03-30
38 posts

Nope, as of right now I still can’t figure out a way to get it to behave like it’s under the theme_member class.

I’m on 1.6.6 - Build:  20081212

Thanks.

 
Posted: 13 January 2009 04:46 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2004-05-14
20504 posts

Ben, you’d probably be best to use some PHP to get this accomplished; you could also post a feature request for a proper variable for this.

In any case, I’m going to move this up to How To as it is not available out of the box.

 
Posted: 14 January 2009 12:28 PM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2007-03-30
38 posts

So, that wasn’t so hard.

I made a plugin that grabs the member group from the individual’s name. In combination with the {author} tag, it works perfectly in the forum.

In case anyone else runs into this: PI.Get_Member_Group

Thanks so much for the help!

Ben.

 
Posted: 18 February 2009 07:47 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2008-02-01
27 posts
Ben Johnson - 14 January 2009 05:28 PM

So, that wasn’t so hard.

I made a plugin that grabs the member group from the individual’s name. In combination with the {author} tag, it works perfectly in the forum.

In case anyone else runs into this: PI.Get_Member_Group

Thanks so much for the help!

Ben.

Hi Ben

This looks just what I am after. How do I install it, though? I added it to the plugins folder and it’s now appearing in the plugin manager.

So when I go to the Thread Rows template, what do I replace {rank_title} with? I have tried {exp:get_member_group} but no joy. In your example you include a member name - but of course, I can’t write one member name as the code to appear under the name of every member.

Am I meant to call the plugin somewhere in the template? Confused!

Any help would be appreciated smile

 
Posted: 19 February 2009 08:42 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2007-03-30
38 posts

First, in order for this to work you need to be loading the forum through EE templates as described here.

In the “Thread Rows” template, I changed:

<td class="tableCellOne valigntop" style="width:130px;">
    <
div class="{rank_class}">{rank_title}</div>
    
{if avatar}<div class="itempad"><img src="{path:avatars}" width="{avatar_width}" height="{avatar_height}" border="0" alt="Avatar" /></div>{/if}
</td

to:

<td class="tableCellOne valigntop" style="width:130px;">
    <
div class="{rank_class}">{exp:get_member_group name="{author}"}</div>
    
{if avatar}<div class="itempad"><img src="{path:avatars}" width="{avatar_width}" height="{avatar_height}" border="0" alt="Avatar" /></div>{/if}
</td

If the plugin is installed, it should properly use the {author} tag to grab the name and display it.

Does this work for you?

Ben. wink

 
Posted: 07 January 2010 02:08 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2008-04-14
70 posts

Hey, Ben!

Thanks for the great plugin -it would do exactly what I’m looking for.  I believe it’s not compatible with 2.0… is there anyway that you can update this, or tell me how to?

I rebuilt my forums so it looks a little different, but I changed this:

<div id="forum-post-left-group"><p>{rank_title}</p></div

to this:

<div id="forum-post-left-group"><p>{exp:get_member_group name="{author}"}</p></div

...which is how I believe it’s supposed to be formatted.  Oh, I am running the forums through the regular templates, too.

Here is the error message I get:

Fatal errorCall to a member function fetch_param() on a non-object in /www/eh11744/public_html/world/expressionengine/third_party/get_member_group/pi.get_member_group.php on line 24 

Thank you!
-John

 
Posted: 14 January 2010 08:36 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2007-03-30
38 posts

Unfortunately this isn’t 2.0 compatible yet. I’m planning on doing it, but I don’t have a production 2.0 site that needs it, so it just hasn’t entered the schedule. You should be able to do the something similar with the query module but I’d have to take a close look at the 2.0 database structure to figure it out. I’ll try to take a look at it this weekend.

 
Posted: 07 February 2013 02:10 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Joined: 2013-01-15
2 posts
Ben Johnson - 14 January 2010 08:36 PM

Unfortunately this isn’t 2.0 compatible yet.

Have you had a chance to make a 2.0 version?