Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Custom Usergroup Image
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
Custom Usergroup Image
Requirement: Template Conditionals or PHP in Templates / Complex Templates plugin.

A simple way to use a custom usergroup image for a specified user in a usergroup using Template Conditional.

This is a bit similar to this post: http://mybbhacks.zingaburga.com/showthread.php?tid=807
But we will use usergroup image for this.

Let's say that we have a developer usergroup. There are four users in this usergroup, and one of them is a lead developer (in this example, the uid of the user is 2. Modify it as our needs). And we want the lead developer has a special usergroup image without creating an additional usergroup for this user only.

1. Postbit
postbit_groupimage template:

HTML Code
<if $post['uid'] == 2 then>
<img src="images/groupimages/english/lead-developer.gif" alt="Lead Developer" title="Lead Developer" />
<else>
<img src="{$usergroup['image']}" alt="{$usergroup['title']}" title="{$usergroup['title']}" />
</if>


2. Profile
member_profile_groupimage template:

HTML Code
1
2
3
4
5
6
<if $memprofile['uid'] == 2 then>
<img src="images/groupimages/english/lead-developer.gif" alt="Lead Developer" title="Lead Developer" />
<else>
<img src="{$displaygroup['image']}" alt="{$usertitle}" title="{$usertitle}" />
</if>
<br />


3. Memberlist
memberlist_user_groupimage template:

HTML Code
<if $user['uid'] == 2 then>
<img src="images/groupimages/english/lead-developer.gif" alt="Lead Developer" title="Lead Developer" />
<else>
<img src="{$usergroup['image']}" alt="{$usergroup['title']}" title="{$usergroup['title']}" />
</if>


Now, the lead developer has a custom usergroup image, and other user and/or developer use their default usergroup image (we need to specify it in usergroup edit settings).
Modify it as our needs.


04-19-2011 02:22 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Custom Usergroup Image - RateU - 04-19-2011 02:22 AM

 Standard Tools
Forum Jump: