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

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:
Rich (BB 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:
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>
 
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"?
 
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!
 
Update, This is almost done. but...
How can I open the membercard instead the style chooser?
9.gif
Rich (BB code):
<a href="{xen:link 'misc/style', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger [blabla..]
What code I need to replace?
 
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.webp
[*] if so, I've tried many times and with different codes, but I still can not show the badge there.
 
Last edited:
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:
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.webp
Screen shot 2015-09-03 at 11.03.09 PM.webp

One addon with this customization is coming.
All Rights Reserved.
 
Last edited:
when can we likely see this addon?
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:
  • Like
Reactions: rdn
#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.
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:
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.

I will extend the username template helper and adds the html after the username. The user data is already available at this time.
 
I've created this thread in Resource and Add-on Requests:
Hello.
I need a developer to make this addon to me. (asap)(if possible):

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

If you're interested, please open a conversation with me and please give me price and estimated time.
I can share all the template editions and explain what I did until now, also I can provide access to my test board to make tests. everything is ready there.

Thanks!
if someone are interested pm.
 
I will extend the username template helper and adds the html after the username. The user data is already available at this time.
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:
Back
Top Bottom