Jump to content
WebFlake
  • 0

Avatar Border Colour Depending Of Group.


Guest rAv3nzZ

Question

Guest rAv3nzZ

I want to add a border to forum avatars with a custom border colour which depends on the group like this (admin) - 70Yhl.jpg

I would be very thankful if you help me with this!

Edited by rAv3nzZ
  • Upvote 1
Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0
Guest rAv3nzZ

Are you talking about the circle?? Do you always want the avatar in a circle?? Do you know css? Have you created and tested the css for the border??

 

Yeah, i'm talking about the circle, yes i know css and yes i have tested it.

 

The problem is getting the color depending of user group or even assigning the already made color for the border to a member group.

Edited by rAv3nzZ
Link to comment
Share on other sites

  • 0

ok in template global template > userinfpane find

		<if test="avatar:|:$author['member_id']">
			<li class='avatar'>
				<if test="canSeeProfiles:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $author ) )">
				<a itemprop="url" href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}: {$author['members_display_name']}" class='ipsUserPhotoLink'>
				</if>
				<if test="hasVariable:|:$this->settings['member_topic_avatar_max']">
					<img itemprop="image" src='{$author['pp_main_photo']}' class='ipsUserPhoto ipsUserPhoto_variable' />
				<else />
					<img itemprop="image" src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />
				</if>
				<if test="canSeeProfiles2:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $author ) )">
				</a>
				</if>
			</li>
		<else />
			<li class='avatar'>
				<img itemprop="image" src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />
			</li>
		</if>

Add the css to this < li there are 2 of them.

<li class='avatar'> 

Use an <if statement like this for each group

<if test="in_array($author['member_group_id'],array(4,6))"> new css here </if>

 

make one for all groups you want to use for new css..

Edited by Lock Down
Link to comment
Share on other sites

  • 0
Guest rAv3nzZ

ok in template global template > userinfpane find

		<if test="avatar:|:$author['member_id']">
			<li class='avatar'>
				<if test="canSeeProfiles:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $author ) )">
				<a itemprop="url" href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}: {$author['members_display_name']}" class='ipsUserPhotoLink'>
				</if>
				<if test="hasVariable:|:$this->settings['member_topic_avatar_max']">
					<img itemprop="image" src='{$author['pp_main_photo']}' class='ipsUserPhoto ipsUserPhoto_variable' />
				<else />
					<img itemprop="image" src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />
				</if>
				<if test="canSeeProfiles2:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $author ) )">
				</a>
				</if>
			</li>
		<else />
			<li class='avatar'>
				<img itemprop="image" src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />
			</li>
		</if>

Add the css to this < li there are 2 of them.

<li class='avatar'> 

Use an <if statement like this for each group

<if test="in_array($author['member_group_id'],array(4,6))"> new css here </if>

make one for all groups you want to use for new css..

 

Thank you for replying, i have added this above <li class='avatar'>

<if test="in_array($author['member_group_id'],array(4,6))"><style type="text/css">.ipsUserPhoto { border: 1px solid red; }</style></if>

The border is showing but it's working for all groups :(

Edited by rAv3nzZ
Link to comment
Share on other sites

  • 0

try this

 
<if test="in_array($author['member_group_id'],array(4,6))"><style type="text/css">.ipsUserPhoto { border: 1px solid red; }</if> 		
               <if test="avatar:|:$author['member_id']">
			<li class='avatar'>
				<if test="canSeeProfiles:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $author ) )">
				<a itemprop="url" href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}: {$author['members_display_name']}" class='ipsUserPhotoLink'>
				</if>
				<if test="hasVariable:|:$this->settings['member_topic_avatar_max']">
					<img itemprop="image" src='{$author['pp_main_photo']}' class='ipsUserPhoto ipsUserPhoto_variable' />
				<else />
					<img itemprop="image" src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />
				</if>
				<if test="canSeeProfiles2:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $author ) )">
				</a>
				</if>
			</li>
		<else />
			<li class='avatar'>
				<img itemprop="image" src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />
			</li>
		</if>
<if test="in_array($author['member_group_id'],array(4,6))"></style></if>
Edited by Lock Down
Link to comment
Share on other sites

  • 0
Guest rAv3nzZ

 

try this

 
<if test="in_array($author['member_group_id'],array(4,6))"><style type="text/css">.ipsUserPhoto { border: 1px solid red; }</if> 		
               <if test="avatar:|:$author['member_id']">
			<li class='avatar'>
				<if test="canSeeProfiles:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $author ) )">
				<a itemprop="url" href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}: {$author['members_display_name']}" class='ipsUserPhotoLink'>
				</if>
				<if test="hasVariable:|:$this->settings['member_topic_avatar_max']">
					<img itemprop="image" src='{$author['pp_main_photo']}' class='ipsUserPhoto ipsUserPhoto_variable' />
				<else />
					<img itemprop="image" src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />
				</if>
				<if test="canSeeProfiles2:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $author ) )">
				</a>
				</if>
			</li>
		<else />
			<li class='avatar'>
				<img itemprop="image" src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />
			</li>
		</if>
<if test="in_array($author['member_group_id'],array(4,6))"></style></if>

 

 

Same thing + the avatar of Administrator group is now erased.

Link to comment
Share on other sites

  • 0
Guest rAv3nzZ

Thank you a lot! Now it looks so sexy :D The thing is.. if i need to make the same effect for avatars in forum board index, i need to do the same right?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...