The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
4 posters

    Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Wed 10 Feb - 23:08

    Hello all! I'd like to give certain groups of staff members a tiny 25x25 px badge in the bottom right corner on the inside of their avatars to show that they're staff members so I can get rid of the rank banner system on my website! I'd like the code to work on both the forum profiles and in blog comments! My forum version is PunBB. 

    Thanks in advance! Wink

    Edit: @SLGray and @Ange Tuteur I summon you. Razz
    Sir Chivasâ„¢
    Sir Chivasâ„¢
    Helper
    Helper


    Male Posts : 6980
    Reputation : 457
    Language : EN, FR, ES
    Location : || CSS || HTML || Graphics Designs || Support ||

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Sir Chivasâ„¢ Fri 12 Feb - 21:49

    Hi,

    Would something like this help out?
    https://help.forumotion.com/t57595-add-an-image-to-the-rank-name-customizing-ranks

    Regards,
    Sir Chivas.
    Take Notes
    Take Notes
    Helper
    Helper


    Male Posts : 2337
    Reputation : 324
    Language : English
    Location : Forumountain

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Take Notes Fri 12 Feb - 23:11

    So you want something similar to this?
    Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup? Badge110
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Sat 13 Feb - 20:25

    @Forumedic Yes! We'd use a much better image than that though and we'd prefer the badge to be smaller and actually be fully inside the avatar's border. Wink

    Gave your post an upvote. Wink
    Take Notes
    Take Notes
    Helper
    Helper


    Male Posts : 2337
    Reputation : 324
    Language : English
    Location : Forumountain

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Take Notes Mon 15 Feb - 2:30

    I'm glad I could clear up what you want. Unfortunately, I do not have the necessary skills nor knowledge to further assist you, but, maybe @Ange Tuteur could help assist you on this.
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Mon 15 Feb - 19:38

    @Forumedic Thanks, and no worries! Wink

    @Ange Tuteur Could you please assist us? Wink

    Thanks in advance! Very Happy
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Mon 15 Feb - 20:00

    It should be possible, however, it would only work in the topics due to some limitations of the forum profile. Although there's always some way.. Think

    What's the URL of the forum you want this applied to ?
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Mon 15 Feb - 23:43

    Thanks! The forum url is http://www.WiiWareWave.com king


    Last edited by Rukiafan on Mon 15 Feb - 23:47; edited 2 times in total (Reason for editing : Autocorrect mishap...>_>)
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Wed 17 Feb - 19:25

    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Thu 18 Feb - 11:48

    Sorry for the delay. Add this script to Modules > JS codes management :

    Placement : In the topics
    Code:
    $(function() {
      $('.user:has(a span[style="color:#B697C7"])').find('.user-basic-info > a:first-child').append('<img src="http://2img.net/i/fa/m/gender_female.gif" class="ava-rank"/>');
    });

    Change the following based on the group :
    1. The group color : #B697C7
    2. The image : https://2img.net/i/fa/m/gender_female.gif

    Lastly add this CSS to your stylesheet :
    Code:
    .user-basic-info > a:first-child {
      position:relative;
    }

    .ava-rank {
      position:absolute;
      right:0;
      bottom:0;
    }
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Thu 18 Feb - 20:05

    @Ange Tuteur It worked, but the image is slightly too far to the right. I wanted the badge within the avatar's frame. Wink
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Thu 18 Feb - 20:33

    It may be related to the problem I mentioned in your other topic. Try pasting the minified CSS instead :
    Code:
    .user-basic-info>a:first-child{position:relative}.ava-rank{position:absolute;right:0;bottom:0}
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Thu 18 Feb - 20:59

    @Ange Tuteur Now the staff badge is covering the entire avatar...:/

    Edit: Also can it be made to show up in blog comments as well? I don't care about anywhere other than the current area it show's up in and blog comments. Thanks in advance. Wink

    @Forumedic @SLGray any advice on the resizing issue? Wink


    Last edited by Rukiafan on Thu 18 Feb - 22:30; edited 4 times in total (Reason for editing : Added info.)
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Fri 19 Feb - 15:14

    Oooh I didn't think of that, in the mean time change the CSS to this :
    Code:
    .user-basic-info>a:first-child{position:relative}.ava-rank{position:absolute;right:0;bottom:0;width:auto;height:auto}

    I'll take a look at the blog comments soon. thumleft
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Fri 19 Feb - 16:46

    @Ange Tuteur It's still not resizing the badge...:/
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Fri 19 Feb - 16:55

    Hmm.. try this instead :
    Code:
    .user-basic-info>a:first-child{position:relative}.ava-rank{position:absolute;right:0;bottom:0;width:auto !important;height:auto !important}
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Fri 19 Feb - 18:58

    @Ange Tuteur Sorry was feeding my cats and eating breakfast, I'll try the new code now! Wink

    Edit: Now the badge doesn't appear at all...what the fronk is going on?! scratch

    Edit again: Could it be an issue caused by the circular avatar code? They both use the same forum variable. Wink


    Last edited by Rukiafan on Fri 19 Feb - 19:09; edited 3 times in total (Reason for editing : Added info...)
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Fri 19 Feb - 20:45

    Yes, the overflow is the problem. Add this to your CSS :
    Code:
    .user-basic-info>a:first-child{overflow:visible!important}
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Fri 19 Feb - 20:58

    @Ange Tuteur It worked, but now the badge is too far to the right and is too low as well. xD

    Also one more thing, after the blog issue is solved how would I go about adding different badges to our various staff types? We have Administrators, Moderators, and content providers for our blogs that we'd like to have different badges for and get rid of our rank system for normal members and the banner ranks so our forums look less cluttered. Wink
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Sat 20 Feb - 1:22

    1. The image is to the absolute corner of the avatar, however, the circular container doesn't make it seem like it is. You can reposition the icon by editing this part in the CSS I gave you previously :
    Code:
    right:0;bottom:0;
    You'll most likely want to modify "right" to something like
    Code:
    right:50px;


    2. I'll reiterate on how to do that when I rework it for the blog comments. Wink
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Sat 20 Feb - 1:26

    @Ange Tuteur Thanks so much! I look forward to it! Very Happy
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Mon 22 Feb - 17:32

    Okay, firstly add this CSS to your stylesheet :
    Code:
    .blog_comment-avatar {position:relative;overflow:visible}
    .blog_comment-avatar .ava-rank {width:auto!important;height:auto!important}

    Then replace your current script with this one :
    Code:
    $(function() {
      addGroupLogo('#66163C', 'http://2img.net/i/fa/m/gender_female.gif');
      addGroupLogo('#369E99', 'http://2img.net/i/fa/m/gender_female.gif');
      addGroupLogo('#B697C7', 'http://2img.net/i/fa/m/gender_female.gif');

      /* -- FUNCTION -- */
      function addGroupLogo(color, image) {
        $('.user:has(a span[style="color:' + color + '"])').find('.user-basic-info > a:first-child').append('<img src="' + image + '" class="ava-rank"/>');
        $('a span[style="color:' + color + '"]', '#blog_comments').closest('.posthead').find('.blog_comment-avatar').append('<img src="' + image + '" class="ava-rank"/>');
      };
    });

    That should work for both posts and blog comments. Now to add an icon for different groups all you need to do is edit the current script, and copy and paste this declaration before
    Code:
    /* -- FUNCTION -- */
    :
    Code:
    addGroupLogo('COLOR', 'IMAGE');

    Replace COLOR with the color of the group and IMAGE with the image you want associated with the group. You can copy and paste this as much as you want. As you'll see, I already added 3 group colors as an example, you can edit this as you wish. If you have any questions let me know.
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Mon 22 Feb - 19:30

    @Ange Tuteur That worked to add multiple user groups, but the position of the badge is unchanged and the badges aren't appearing in blog comments...:/
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Tue 23 Feb - 15:59

    It seems the overflow is still hidden on the blog comments. Replace the CSS I gave you with this :
    Code:
    .blog_comment-avatar {position:relative;overflow:visible!important}
    .blog_comment-avatar .ava-rank {width:auto!important;height:auto!important}

    To change the position of the badge, modify the previous CSS rule I gave you. This one :
    Code:
    .ava-rank{position:absolute;right:0;bottom:0}

    Edit the bottom and right values to change the positioning of the badge. To something like this for example :
    Code:
    .ava-rank{position:absolute;right:10px;bottom:10px}
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Tue 23 Feb - 19:32

    @Ange Tuteur Now the badge is massive and underneath the avatar, I did have to change your code a bit as it left me with an uneven number of {} brackets which completely broke my CSS until I changed the code a bit. :/
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Wed 24 Feb - 18:48

    Add this CSS rule to your stylesheet :
    Code:
    .ava-rank{width:auto !important;height:auto !important}
    It'll reset the width and height properties.
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Wed 24 Feb - 19:36

    @Ange Tuteur Drat...now the size issue is fixed but it's now too far to the left and below the avatar... This code is a tricky little bugger isn't it? scratch
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Thu 25 Feb - 11:19

    Did you remove the rule that modifies the positioning, or edit it ?
    Code:
    .ava-rank{position:absolute;right:10px;bottom:10px}
    Rukiafan
    Rukiafan
    Forumember


    Posts : 329
    Reputation : 9
    Language : English

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Rukiafan Thu 25 Feb - 19:37

    @Ange Tuteur Lmao! I have both of them added to the CSS! Embarassed

    Should I edit the old code or delete it completely and keep the new code? Wink
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    In progress Re: Adding A badge On The Bottom-Right Corner of The Avatar For Members of A Specific Usergroup?

    Post by Ange Tuteur Fri 4 Mar - 0:02

    Add it back in because I don't see the specified properties when inspecting the image element. Think

      Current date/time is Sun 22 Sep - 19:25