Jump to content

Verification icon


Kelby

Recommended Posts

1 hour ago, Kelby said:

I need to add a Verified icon in front of the name if the user verify his email.

assuming that it only needs to appear on the client area homepage, it's a ClientAreaPageHome hook....

<?php

# Email Verification Icon Hook
# Written by brian!

function email_verified_icon_hook($vars)
{
	if ($vars['clientsdetails']['email_verified']) {
		$displayTitle = $vars['displayTitle'].' <i class="fas fa-user-check fa-xs"></i>';
		return array("displayTitle" => $displayTitle);
	}
}
add_hook("ClientAreaPageHome", 1, "email_verified_icon_hook");

6AOIdpg.png

Link to comment
Share on other sites

then we need to start debugging the cause...

<?php

# Email Verification Icon Hook
# Written by brian!

function email_verified_icon_hook($vars)
{
	$clientsdetails = $vars['clientsdetails'];
	if ($clientsdetails['email_verified']) {
		$displayTitle = $vars['displayTitle'].' Verified';
		return array("displayTitle" => $displayTitle);
	}
}
add_hook("ClientAreaPageHome", 1, "email_verified_icon_hook");

L87QSBS.png

Link to comment
Share on other sites

3 minutes ago, Kelby said:

Not working

you're going to have to throw me more of a bone that that...

  1. are you on the clientarea homepage - the one with the panels?
  2. what happens if you output {$clientsdetails.email_verified} in that template.
  3. throw a {debug} in the template and get the value of $clientsdetails.email_verified - it's going to be true or false... if it's false, then they haven't verified and that explains why the hook is seemingly doing nothing.
Link to comment
Share on other sites

credit => "0.01"
taxexempt => false
latefeeoveride => false
overideduenotices => false
separateinvoices => false
disableautocc => false
emailoptout => false
marketing_emails_opt_in => true
overrideautoclose => false
allowSingleSignOn => 1
language => "english"
isOptedInToMarketingEmails => true

 

Not here!

Link to comment
Share on other sites

11 minutes ago, Kelby said:

7.8

aahh, that explains it - there was a bug/discrepancy where that value wasn't passed in v7.8 - you'll have to get it another way...

<?php

# Email Verification Icon Hook
# Written by brian!

function email_verified_icon_hook($vars)
{
	$client = Menu::context('client');
	$emailverified = $client->emailVerified;
	if ($emailverified) {
		$displayTitle = $vars['displayTitle'].' <i class="fas fa-user-check fa-xs"></i>';
		return array("displayTitle" => $displayTitle);
	}
}
add_hook("ClientAreaPageHome", 1, "email_verified_icon_hook");

the above is tested as working in v7.8.3 - and should work in every version thereafter.

Link to comment
Share on other sites

  • 2 weeks later...
3 hours ago, VirtualWorldGlobal said:

can we add an image instead of Fa Fa ?

yes - you can add anything - FA, glyphicon, image, text, animated gif, svg etc - to the output.

$displayTitle = $vars['displayTitle'].' <img src="'.$vars['BASE_PATH_IMG'].'/verified.png"></i>';

I2x1Vou.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated