Jump to content

Add Image To Primary Sidebar


jawanet

Recommended Posts

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

 

Fire_Shot_Capture_5_Client_Area_Company_Name.jpg

 

Tanks very much for help.

Link to comment
Share on other sites

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.

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