1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Verified Badge next to the nickname. [Help]

Discussion in 'Styling and Customization Questions' started by rafass, Sep 1, 2015.

  1. rafass

    rafass Well-Known Member

    Hello. I want to put a badge next to the nickname. Something like verified accounts in Twitter or FB:

    1.gif 2.gif

    I've been playing around in message_user_info with the conditional:
    Code:
    <xen:if is="!{$isQuickReply} AND {xen:helper ismemberof, $user, 5}">
    <div class="userInfoDot Tooltip" title="{xen:phrase verified}" data-offsetx="-11"></div>
    </xen:if>
    Where the group of "Verified Members" is the group #5

    That's working fine:

    4.gif

    But:
    1.
    How can I show the horizontal Tooltip like in member page? (but without that effect):

    5.gif

    2. How can I keep the badge always next to the username and avoid this jump when the username is long?:

    9.gif
    --
    Appreciate some help with this. :coffee:
     
    Last edited: Sep 2, 2015
  2. Amaury

    Amaury Well-Known Member

    Have a look at a template that uses a XenForo tooltip and look how it's done and then just change it accordingly for your needs.

    As an example, in the footer template:

    Code:
                    <xen:if is="{$canChangeStyle}">
                        <dt>{xen:phrase style}</dt>
                        <dd><a href="{xen:link 'misc/style', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase style_chooser}" rel="nofollow">{$visitorStyle.title}</a></dd>
                    </xen:if>
     
  3. rafass

    rafass Well-Known Member

    Ok...so, how you will show the Tooltip horizontal and without that fade effect?
    and how can I fix the jump of the badge when the username is long? [question 2]
     
    Last edited: Sep 1, 2015
  4. Amaury

    Amaury Well-Known Member

    It looks like it may be the class you're using. Not all tooltips fade like that; you can see this if you hover over the style choose, where it just pops in and out. :) Have a look at the speed options in Style Properties > Overlays and Tooltips > Settings.

    As for the jump, can you elaborate on that a bit? What do you mean by "fix the jump"?
     
  5. rafass

    rafass Well-Known Member

    Thanks for your suggestions, but honestly that does NOT solve anything specifically.
    Anyone else? :coffee:
     
    Last edited: Sep 2, 2015
  6. rafass

    rafass Well-Known Member

    Has been possible use the horizontal tooltip with text in a chooser:
    9.gif
    But I still can not do that with the badge.
    I've duplicated the same scenario in my test board, if someone want to test with the templates, just let me know.
    I'm also willing pay with Paypal. if someone find the way to do this.
    Thanks!
     
  7. rafass

    rafass Well-Known Member

    Update, This is almost done. but...
    How can I open the membercard instead the style chooser?
    9.gif
    Code:
    <a href="{xen:link 'misc/style', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger [blabla..] 
    What code I need to replace?
     
  8. katsulynx

    katsulynx Well-Known Member

    HTML:
    <a href="{xen:link members, $user}" class="avatar">
     
    RoldanLT and rafass like this.
  9. rafass

    rafass Well-Known Member

    Thanks katsulynx! everything is working absolutely perfect.
    --
    I have a problems with the follow templates (I can not show the badge there):
    Sidebar visitor panel [sidebar_visitor_panel] ? *
    Profile posts [profile_post] ?*
    Conversation Participants [conversation_recipients] ?*
    And here: [what is the name of this template?] ?*
    Screen shot 2015-09-03 at 1.51.11 PM.png
    [*] if so, I've tried many times and with different codes, but I still can not show the badge there.
     
    Last edited: Sep 3, 2015
  10. katsulynx

    katsulynx Well-Known Member

    sidebar_visitor_panel -> use $visitor instead of $user for your check
    profile_post message_simple -> $message instead of $user
    conversation_recipients -> $recipient instead of $user
    navigation_visitor_tabs -> $visitor instead of $user
     
    Last edited: Sep 3, 2015
    RoldanLT and rafass like this.
  11. rafass

    rafass Well-Known Member

    Thanks again katsulynx! YOU ROCK! (y)
    ---
    [Edit]
    This is working great so far, thanks @katsulynx for your valuable tips.
    If someone want to take a look at the result, open a conversation
    Some images:
    1.gif

    2.gif

    3.gif

    4.gif

    5.gif

    6.gif

    7.gif
    Screen shot 2015-09-03 at 11.15.19 PM.png
    Screen shot 2015-09-03 at 11.03.09 PM.png

    One addon with this customization is coming.
    All Rights Reserved.
     
    Last edited: Sep 3, 2015
  12. Snog

    Snog Well-Known Member

    Also:
    profile_post_comment -> use $comment instead of $user
     
    rafass likes this.
  13. Brad P

    Brad P Active Member

    when can we likely see this addon?
     
  14. rafass

    rafass Well-Known Member

    There are 2 options now.
    1. Show the badge almost everywhere, (except in Alerts and Feed) using only template modifications + conditionals (a simple .xml file)
    2. Show the badge absolutely everywhere with a specific addon. (including PHP files)

    First option is almost ready.
    Second option could take more time, because I still don't know how to do that. (I need the help of some developer)
    Not 100% sure what's the best option, of course I would like to show it everywhere. (but without affect the performance)(a good addon with fast queries)
    XF 1.5 - What I'm doing wrong editing /recent-activity/ ?
     
    Last edited: Sep 5, 2015
    RoldanLT likes this.
  15. Milano

    Milano Well-Known Member

    #2 for sure, it would be done without a single query, while #1 may not work with (heavily) modified styles and 3rd party add-ons.
     
  16. Snog

    Snog Well-Known Member

    I believe #2 would, at the very least, require extending a function in the alert model so the user groups are included with the data in the alert templates. I haven't looked closely at it, but there may be other parts that would also need to be extended.

    EDIT: #1 would be the accepted way to do any template changes, which would also be done in #2. If someone is running a heavily modified style they are aware that they may need to also modify any template modifications.
     
    Last edited: Sep 5, 2015
  17. Milano

    Milano Well-Known Member

    I will extend the username template helper and adds the html after the username. The user data is already available at this time.
     
    Steve F likes this.
  18. rafass

    rafass Well-Known Member

    I've created this thread in Resource and Add-on Requests:
    if someone are interested pm.
     
  19. Snog

    Snog Well-Known Member

    The way he was determining if the icon should be shown is by user group membership.

    In alerts, the $user info does not include the user groups. And therefore the user groups are not available in the helper.
    Code:
    Array ( [user_id] => 11 [username] => MTest [gender] => male [gravatar] => [avatar_date] => 1405082762 )
    Which means, in order to avoid an additional query you also need to extend a function in the alert model to pick up the user group info.

    And without looking, I believe there is a function in the alert system that moves info in the $user array to different keys. I could be wrong on that.
     
    Last edited: Sep 5, 2015
  20. katsulynx

    katsulynx Well-Known Member

    @Snog: can be easily made available by extending XenForo_DataWriter_Alert and let it store the user group ids. That'll require no additional queries.
     

Share This Page