jawanet Posted October 17, 2016 Share Posted October 17, 2016 Hi I want to ask how to add an conatnt/image to the primary sidebar <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) { } }); This is the code that I want to add <div class="panel-body"> <div class="custom-gravatar"> <img src="{gravatar email="$clientemail" size="140"}" height="100" width="100"> </div> </div> my scenario Tanks very much for help. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted October 17, 2016 Share Posted October 17, 2016 check this ActionHook https://forum.whmcs.com/showthread.php?106891-Display-Credit-Balance-In-Six-Template 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 17, 2016 Share Posted October 17, 2016 probably the code contained within the thread below is more suitable... you should just need to add your code to it to tweak the output variable. https://forum.whmcs.com/showthread.php?111614-how-can-i-hide-some-fields&p=457799#post457799 0 Quote Link to comment Share on other sites More sharing options...
jawanet Posted October 17, 2016 Author Share Posted October 17, 2016 (edited) check this ActionHook https://forum.whmcs.com/showthread.php?106891-Display-Credit-Balance-In-Six-Template Works perfectly, your code has helped me. Tanks very much sentq - - - Updated - - - Edited October 17, 2016 by jawanet 0 Quote Link to comment Share on other sites More sharing options...
jawanet Posted October 17, 2016 Author Share Posted October 17, 2016 Hi Can you help with error Fatal error: Call to a member function trigger_error() on null in \whmcs\includes\hooks\gravatar.php on line 25 function smarty_function_gravatar($params, &$smarty) { // check for email adress if(!isset($params['email']) && !isset($params['default'])) { $smarty->trigger_error("gravatar: neither 'email' nor 'default' attribute passed"); return; } $email = (isset($params['email']) ? trim(strtolower($params['email'])) : ''); $rating = (isset($params['rating']) ? $params['rating'] : 'R'); $url = "https://www.gravatar.com/avatar/".md5($email) . "?r=".$rating; if(isset($params['default'])) $url .= "&d=".urlencode($params['default']); if(isset($params['size'])) $url .= "&s=".$params['size']; if(isset($params['assign'])) { $smarty->assign($params['assign'], $url); return; } return $url; } add_hook("ClientAreaPrimarySidebar",1,"smarty_function_gravatar"); Error in // check for email adress if(!isset($params['email']) && !isset($params['default'])) { $smarty->trigger_error("gravatar: neither 'email' nor 'default' attribute passed"); return; } On viewticket no problem. 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.