Hello Developers, I want to shoot users' banners, but I don't know how. With the help of the code below, I can pull the avatars without any problems, but when I use getBannerUrl I get an error. Isn't there a getBannerUrl method? if so how can i use it?
Error:
My avatar method:
Error:
Code:
An exception occurred: [Error] Call to undefined method XF\Entity\User::getBannerUrl() in ....
My avatar method:
PHP:
function GetAvatar($UserID){
\XF::start('/hc');
$Finder = \XF::finder('XF:User');
$User = $Finder->where('user_id', $UserID)->fetchOne();
$AvatarUrl = "default";
if ($User->avatar_date || $User->gravatar) {
$AvatarUrl = \XF::app()->request()->convertToAbsoluteUri($User->getAvatarUrl('l', null, true ));
}
return $AvatarUrl;
}