本文整理匯總了PHP中GWF_User::getAvatarFilename方法的典型用法代碼示例。如果您正苦於以下問題:PHP GWF_User::getAvatarFilename方法的具體用法?PHP GWF_User::getAvatarFilename怎麽用?PHP GWF_User::getAvatarFilename使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GWF_User
的用法示例。
在下文中一共展示了GWF_User::getAvatarFilename方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: copyAvatar
private function copyAvatar($image, GWF_User $user, $pos = 1)
{
# Logo
$filename = $user->getAvatarFilename();
if (false === ($avatar = imagecreatefromstring(file_get_contents($filename)))) {
echo GWF_HTML::err('ERR_FILE_NOT_FOUND', array($filename));
return false;
}
# Resize
if (false === ($avatar2 = GWF_Image::resize($avatar, self::WIDTH, self::HEIGHT))) {
echo GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
return false;
}
$w = imagesx($avatar2);
$h = imagesy($avatar2);
$this->box_avatar->w = $w;
$this->box_avatar->h = $h;
if ($pos === 2) {
$this->box_avatar->x = $this->box_stats->getX2() + 1 - $w;
} else {
$this->box_avatar->x = $this->box_stats->x;
$this->box_stats->x += $w;
}
if (!imagecopy($image, $avatar2, $this->box_avatar->x, $this->box_avatar->y, 0, 0, $w, $h)) {
echo GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
return false;
}
imagedestroy($avatar2);
$this->box_stats->w -= $w;
return true;
}