Kelby Posted May 29, 2020 Share Posted May 29, 2020 Hello, I need to add a Verified icon in front of the name if the user verify his email. Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2020 Share Posted May 29, 2020 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"); 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 29, 2020 Author Share Posted May 29, 2020 Thank you but the hook doesn't work for me. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2020 Share Posted May 29, 2020 14 minutes ago, Kelby said: Thank you but the hook doesn't work for me. are you using an account where they have already verified the email address ? 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 29, 2020 Author Share Posted May 29, 2020 Yes. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2020 Share Posted May 29, 2020 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"); 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 29, 2020 Author Share Posted May 29, 2020 Not working 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2020 Share Posted May 29, 2020 3 minutes ago, Kelby said: Not working you're going to have to throw me more of a bone that that... are you on the clientarea homepage - the one with the panels? what happens if you output {$clientsdetails.email_verified} in that template. 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. 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 29, 2020 Author Share Posted May 29, 2020 I am in domain/clientarea.php I added {debug} to clientareahome.tpl I refreshed domain/clientarea.php In the debug console I can't find : $clientsdetails.email_verified 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2020 Share Posted May 29, 2020 6 minutes ago, Kelby said: In the debug console I can't find : $clientsdetails.email_verified it will be in the $clientsdetails array... if for whatever reason it's not there, you would have to get the value from the database. 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 29, 2020 Author Share Posted May 29, 2020 credit => "0.01"taxexempt => falselatefeeoveride => falseoverideduenotices => falseseparateinvoices => falsedisableautocc => falseemailoptout => falsemarketing_emails_opt_in => trueoverrideautoclose => falseallowSingleSignOn => 1language => "english"isOptedInToMarketingEmails => true Not here! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2020 Share Posted May 29, 2020 2 minutes ago, Kelby said: Not here! which version of WHMCS are you using ? 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 29, 2020 Author Share Posted May 29, 2020 7.8 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2020 Share Posted May 29, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 29, 2020 Author Share Posted May 29, 2020 Finally! Thank you @brian! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2020 Share Posted May 29, 2020 Just now, Kelby said: Finally! yes! I was beginning to question my own sanity. 👨⚕️ 1 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted June 7, 2020 Share Posted June 7, 2020 Hi can we add an image instead of Fa Fa ? Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 7, 2020 Share Posted June 7, 2020 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>'; 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.