#Gromov
Мастер
- Регистрация
- 17 Окт 2014
- Сообщения
- 2,156
- Лучшие ответы
- 0
- Репутация
- 595
1. Идем: includes/class_userprofile.php нам необходимо отредактировать этот файл.
2. В class_userprofile.php ищем:
после ставить:
3. Далее ищем:
после ставить:
4. Ищем эту строку
Перед ставить:
5. Далее нам необходимо отредактировать шаблон memberinfo_block_profilepicture заменив все на это:
2. В class_userprofile.php ищем:
PHP:
'profilepic' => 'prepare_profilepic',
PHP:
/* Аватар в профиле */
'profileavatar' => 'prepare_profileavatar',
PHP:
'profilepic',
PHP:
/* Аватар в профиле */
'profileavatar',
PHP:
function prepare_profilepic()
PHP:
/**
* Аватар в профиле
*
*/
function prepare_profileavatar()
{
if ($this->userinfo['avatarurl'] == '' OR !$this->registry->options['avatarenabled'] OR ($this->userinfo['hascustomavatar'] AND !($this->userinfo['permissions']['genericpermissions'] & $this->registry->bf_ugp_genericpermissions['canuseavatar']) AND !$this->userinfo['adminavatar']))
{
if ($this->registry->options['usefileavatar'])
{
$this->prepared['profileavatar'] = $this->registry->options['avatarurl'] . '/avatar' . $this->prepared['userid'] . '_' . $this->userinfo['avatarrevision'] . '.gif';
}
else
{
$this->prepared['profileavatar'] = 'image.php?' . $this->registry->session->vars['sessionurl'] . 'u=' . $this->prepared['userid'] . "&dateline=" . $this->userinfo["avatardateline"] ."&type=avatar";
}
if ($this->userinfo['ppwidth'] AND $this->userinfo['ppheight'])
{
$this->prepared['profilepicsize'] = ' width="' . $this->userinfo["ppwidth"] . '" height="' . $this->userinfo["ppheight"] . '" ';
}
}
else
{
$this->prepared['profileavatar'] = '';
}
}
PHP:
<vb:if condition="$prepared['profileavatar']">
<a class="avatar" href="{vb:link member, {vb:raw prepared}}" title="{vb:rawphrase xs_picture, {vb:raw prepared.username}}">
<span class="avatarcontainer"><img src="{vb:raw prepared.profileavatar}" alt="" /></span>
</a>
<vb:else />
<a class="avatar" href="{vb:link member, {vb:raw userinfo}}" title="{vb:rawphrase xs_picture, {vb:raw userinfo.username}}">
<span class="avatarcontainer"><img src="{vb:stylevar imgdir_misc}/unknown.gif" alt="" /></span>
</a>
</vb:if>