View Full Version : Usergroup Badge in memberinfo
RichieBoy67
11-17-2014, 02:40 PM
I am looking for a simple plug that will add a usergroup badge in the member info template that is separate from the avatar and profile, etc.
For example, giving all VIP users a big badge that shows up in the memberinfo template using postbit_legacy.
Thanks,
Rich
PS - I am sure I can write the conditionals and image code but I need help with the plug in part.
i know I can probably use the ranks system but I am looking for something I can customize a bit more.
Black Snow
11-17-2014, 03:12 PM
Is the plugin/mod for only 1 usergroup?
RichieBoy67
11-17-2014, 03:26 PM
Good question, It would be good to be able to add more but I think I have to think on this a little more.
Thanks for reply
ozzy47
11-17-2014, 11:47 PM
Richie, why not just add something like this to your template.
<vb:if condition="is_member_of($post, X)"><img src="PATH/TO/IMAGE.EXT" alt="$post[username] is VIP member" /></vb:if>
X is the usergroup and PATH/TO/IMAGE.EXT is where you would set the image
Black Snow
11-19-2014, 02:41 PM
Richie, why not just add something like this to your template.
<vb:if condition="is_member_of($post, X)"><img src="PATH/TO/IMAGE.EXT" alt="$post[username] is VIP member" /></vb:if>
X is the usergroup and PATH/TO/IMAGE.EXT is where you would set the image
Would it not be:
<vb:if condition="is_member_of($bbuserinfo, X)"><img src="PATH/TO/IMAGE.EXT" alt="$post[username] is VIP member" /></vb:if>
As "$post" is to find out if the poster is in a certain usergroup.
But, if you use either of them, will it not only be the person browsing the forum that will see/not see the badge because if someone is in the VIP group, and someone not VIP is browsing their page, they will not see the badge....
ozzy47
11-20-2014, 12:00 AM
No, the way I wrote it, it will show up in the posters postbit if they are a member of X.
And any user looking at a post from anyone in X will see the image. :)
So if I am a member of Y, and you are a member of X, when I look at one of your posts, I will see the image, as will you or anyone else.
RichieBoy67
11-20-2014, 10:27 AM
Sorry, Have been busy.
Yeah, I already use the conditionals but was looking to do a plug in to make it easier for clients.
I have a couple things intended that do not really work in the standard system such as placement and perhaps more variable for ranking badges but for now I am looking for mainly the plug in that will place the badges in the memberinfo template but for now just the plug in.
I am trying to learn better how to do this with the plug in system. I really need to learn how to write these plug ins. I have a very hard time with getting them to work with custom themes.
Thanks guys for the help and everything,
Rich
ozzy47
11-20-2014, 10:47 AM
By memberinfo you mean in the postbit correct?
Black Snow
11-20-2014, 11:37 AM
By memberinfo you mean in the postbit correct?
I think he means in the members profile in the "About me" section. Hence why I mentioned about using a different conditional the $post.
ozzy47
11-20-2014, 11:44 AM
Well in the op, he also mentions postbit_legacy, so that is why I asked for clarification. :)
RichieBoy67
11-20-2014, 12:18 PM
I meant member info when displayed vertically with postbit legacy.
Thanks guys
ozzy47
11-20-2014, 12:21 PM
That's what I thought. :)
If there happens to be a template hook where you want the badge, then it's pretty simple to move what you have from the template to a plugin that sets that hook. If there's no hook then it's a little more complicated because you'd need to do a replacement on the template cache. Edit: No one mentioned that they were working on it. If someone is, then you can ignore my comments :).
ozzy47
11-20-2014, 03:03 PM
I might do something for him once I finish my current mod. :)
RichieBoy67
11-20-2014, 03:09 PM
I can always count on my good friends here at Vbulletin. You guys are the best!
Simon Lloyd
11-21-2014, 03:44 PM
Isn't this hook available there?
$template_hook[postbit_userinfo_right_after_posts]
--------------- Added 1416592164 at 1416592164 ---------------
Sorry posted that accidentally, it was meant to have added:
$template_hook[postbit_userinfo_right_after_posts].= "<br /><tr><td>YOUR PIC CODE or condition</td></tr>";Of course you'll need to add any class to that containers but i'm guessing that should do the trick :)
ozzy47
11-21-2014, 09:53 PM
Right, so it would be something like this, using the hook, postbit_display_complete.
$template_hook[postbit_userinfo_right_after_posts].= "<br /><tr><td><vb:if condition=\"is_member_of($post, X)\"><img src=\"PATH/TO/IMAGE.EXT\" alt=\"$post[username] is VIP member\" /></vb:if></td></tr>";
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.