Jump to content
Дизайн и модификация Invision Community IPBSkinsBETA
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Denis479

No avatar(Установка дефолтного аватара)

Recommended Posts

К сожалению, ответа на этот вопрос через поиск не нашел... Помогите пожалуйста, как поставить дефолтный аватар, если пользователь еще не загрузил свой?

  • Upvote 1

Share this post


Link to post

Прошу прощения, что создал тему.

Уже сам нашел.

 

Если кому пригодится, то вот:

 

Отображение аватара в зависимости от пола

Вам необходимо загрузить три аватара в папку с изображениями вашего стиля.

 

defaultav.gif - стандартный аватар, будет отображаться когда пользователь не указал пол.

 

femaleav.gif - будет отображаться когда пользователь выбрал пол женщина.

 

maleav.gif - будет отображаться когда пользователь выбрал пол мужчина.

 

Переходим в Админцентр --> Look & Feel --> Управление стилями и шаблонами --> Управление шаблонами --> Глобальные --> userInfoPane, находим:

 

<if test="avatar:|:$author['member_id'] AND $author['avatar']">
                       <li class='avatar'><a href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}">{$author['avatar']}</a></li>
               <else />
                       <li class='avatar'>{$author['avatar']}</li>
               </if>

 

Меняем на:

 

<if test="avatar:|:$author['member_id'] AND !$author['avatar']">
                               <if test="gender:|:$author['field_5'] == 'f'">
                                               <li class='avatar'><a href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}"><img src="{style_images_url}/femaleav.gif"></a></li>
                               </if>
                               <if test="gender:|:$author['field_5'] == 'm'">
                                               <li class='avatar'><a href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}"><img src="{style_images_url}/maleav.gif"></a></li>
                               </if>
                               <if test="gender:|:$author['field_5'] != ''">
                                       <li class='avatar'><a href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}"><img src="{style_images_url}/defaultav.gif"></a></li>
                               </if>
               </if>
               <if test="avatar:|:$author['member_id'] AND $author['avatar']">
                       <li class='avatar'><a href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}">{$author['avatar']}</a></li>

               <else />
                       <li class='avatar'>{$author['avatar']}</li>
               </if>

 

Установка аватара по умолчанию

Нужный нам аватар закидываем в public/style_avatars/. Открываем /admin/sources/base/core.php и в нем находим:

 

else if( ipsRegistry::$settings['allow_gravatars'] )
               {
                       /* Try a gravatar, if all else fails */
                       $av_hash  = md5( $member['email'] );
                       $s              = $lowestSize ? "&s={$lowestSize}" : '';
                       $blank_av = urlencode(ipsRegistry::$settings['avatars_url'] . '/blank_avatar.gif' ); 

                       return "<img src='http://www.gravatar.com/avatar/{$av_hash}?d={$blank_av}{$s}' alt='' />";
               }

 

/blank_avatar.gif - заменить на своё название.

 

Это сообщение было вынесено в статью

  • Upvote 3

Share this post


Link to post

У меня на всех бесплатных скинах дефолтные аватары.

А с 3.0 это проделать помог Wildraid (я сама никак условие из-за граватара составить не могла).

 

 

Зы.

С полом – интересное решение...

Share this post


Link to post

Небольшой оффтопик, но может быть кому-то интересно.

 

Identicon Avatars.

Для пользователей, которые не выбрали аватор - хук который генерирует свой "уникальный" аватор.

  • Upvote 1

Share this post


Link to post

А если пользователь будет свой загружать аватар он заменится на его или же будет использован по полу или дефолтный?

Share this post


Link to post

А если пользователь будет свой загружать аватар

То будет показан пользовательский аватар.

Share this post


Link to post

Ребят делал по инструкции, не получается с аватарками.. Вообще как будто ничего не делал. Версия IPB 3.1.4

http://stalin-server.ru/forum314/

Share this post


Link to post

Ребят, ко себе ставил по этой инструкции, отпишитесь плиз

Share this post


Link to post

Здесь должна быть ссылка на сайт автора, а не на файлообменник.Tested and working fine

 

Description

 

A quick hook to set a default avatar for members who have yet to select one. Allows you to define a different default avatar when using the Gravatar service as well, instead of using the standard 1x1 blank_avatar.gif image. You can define the specific image to use, basing it either on a specific URL or by pointing to the avatar folders on your site, or by pointing to your skin's image folders to allow for specific default avatars for specific skins.

 

 

Step 1: Import the Hook File

 

Log in to your IP.Board Admin CP and visit the System tab -> Applications & Modules -> Manage Hooks page. In the 'Install a New Hook' section, browse to the XML file included with these instructions and click Open.

 

 

Step 2: ACP Setup

 

Still inside the Admin CP, visit the System tab -> Tools & Settings -> System Settings page, and click on the Members tab. Visit the section called User Profiles, and look for the setting called 'Default Avatar Image'. Set that to the image file you want to use, paying attention to the Quick Tags it gives you access to if you'd like to set it to use either your skin images folder or your avatar folder to pull the image from. Click the Update Settings button when complete.

Edited by Fisana

Share this post


Link to post

Дайте ссылку на сайт автора, а не на файлообменник.

Автор кто?

Share this post


Link to post

Здесь должна быть ссылка на сайт автора, а не на народ.

Устанавливал на 3.1.4, всё работает!

Edited by Fisana

Share this post


Link to post

На сайты автров модов ссылки давайте, а не на депозит и не народ!

И имена авторов называйте.

 

Тему закрываю, а то еще кто-нибудь добрый придет и напихает ссылок на варезники.

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...