Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

Zamiana pustego zdjęcia na awatar


Amfidiusz

Rekomendowane odpowiedzi

Poniżej przedstawiam modyfikacje skina, które pozwolą na zastąpienie pustego zdjęcia awatarem użytkownika. Jest to tłumaczenie tutoriala Morrigan umieszczonego na stronie Coders Refuge, do którego zostałem upoważniony przez autorkę. Tutorial nie zamienia wszystkich zdjęć, a jedynie te, które autorka znalazła w skrypcie. Jeśli macie jakiekolwiek uwagi i komentarze, kierujcie je do niej na skrzynkę PW.

Znane błędy:

Awatary o niestandardowych wymiarach będą wyglądały dziwnie. Wszystkie grafiki, które nie są idealnie kwadratowe zostaną niepoprawnie przeskalowane. Autorka nie znalazła jeszcze sposobu, aby ominąć ten błąd.

Jeśli użytkownik korzysta z Grawatara, nie zostanie wyświetlone ani zdjęcie, ani awatar.

ACP :a::unsure: Wygląd :a: Profil ;) profileModern

Profil użytkownika:

Znajdź:

			<img class="photo" src='{$member['pp_main_photo']}' alt="{$member['members_display_name']}{$this->lang->words['users_photo']}"  />

Zamień na:

			<if test="$member['pp_main_photo'] == 'http://forums.wootflakes.com/public/style_images/spork2/profile/default_large.png' && $member['avatar'] != '' ">
{$member['avatar']}<else /><img class="photo" src='{$member['pp_main_photo']}' alt="{$member['members_display_name']}{$this->lang->words['users_photo']}" /></if>

Znajomi:

Znajdź:

<img src='{$friend['pp_thumb_photo']}' width='{$friend['pp_thumb_width']}' height='{$friend['pp_thumb_height']}' alt='{$this->lang->words['photo']}' class='photo' />

Zamień na:

                        <if test="$friend['pp_thumb_photo'] == 'http://forums.wootflakes.com/public/style_images/spork2/profile/default_thumb.png' && $friend['avatar_location'] != '' ">
<if test="$friend['avatar_type'] == 'upload'">
<img src='{$this->settings['board_url']}/uploads/{$friend['avatar_location']}' alt="{$friend['members_display_name']}{$this->lang->words['users_photo']}" width='{$friend['pp_thumb_width']}' height='{$friend['pp_thumb_width']}' class='photo' />
<else />
<img src='{$friend['avatar_location']}' alt="{$friend['members_display_name']}{$this->lang->words['users_photo']}" width='{$friend['pp_thumb_width']}' height='{$friend['pp_thumb_height']}' class='photo' />
</if>
<else /><img class="photo" src='{$friend['pp_thumb_photo']}' alt="{$friend['members_display_name']}{$this->lang->words['users_photo']}" width='{$friend['pp_thumb_width']}' height='{$friend['pp_thumb_height']}' /></if></a>

Odwiedzający profil:

Znajdź:

<img src='{$friend['pp_mini_photo']}' width='{$friend['pp_mini_width']}' height='{$friend['pp_mini_height']}' alt='{$this->lang->words['photo']}' class='photo' />

Zamień na:

<if test="$friend['pp_mini_photo'] == 'http://forums.wootflakes.com/public/style_images/spork2/profile/default_thumb.png' && $friend['avatar_location'] != '' ">

<if test="$friend['avatar_type'] == 'upload'">
<img src='{$this->settings['board_url']}/uploads/{$friend['avatar_location']}' alt="{$friend['members_display_name']}{$this->lang->words['users_photo']}" width='{$friend['pp_mini_width']}' height='{$friend['pp_mini_width']}' class='photo' />
<else />
<img src='{$friend['avatar_location']}' alt="{$friend['members_display_name']}{$this->lang->words['users_photo']}" width='{$friend['pp_mini_width']}' height='{$friend['pp_mini_height']}' class='photo' />
</if>
<else /><img src='{$friend['pp_thumb_photo']}' alt="{$friend['members_display_name']}{$this->lang->words['users_photo']}" width='{$friend['pp_mini_width']}' height='{$friend['pp_mini_height']}' class='photo' /></if>

ACP :a: :a: Wygląd :a: Główne szablony ;) globalTemplates

Ramka z ustawieniami użytkownika:

Znajdź:

						<a href="{parse url="showuser={$this->memberData['member_id']}" seotitle="{$this->memberData['members_seo_name']}" template="showuser" base="public"}" title='{$this->lang->words['your_profile']}'><img src='{$this->memberData['pp_thumb_photo']}' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" width='{$this->memberData['pp_thumb_width']}' height='{$this->memberData['pp_thumb_height']}' class='photo' /></a>

Zamień na:

			<a href="{parse url="showuser={$this->memberData['member_id']}" seotitle="{$this->memberData['members_seo_name']}" template="showuser" base="public"}" title='{$this->lang->words['your_profile']}'>

<if test="$this->memberData['pp_thumb_photo'] == 'http://forums.wootflakes.com/public/style_images/spork2/profile/default_thumb.png' && $this->memberData['avatar_location'] != '' ">

<if test="$this->memberData['avatar_type'] == 'upload'">
<img src='{$this->settings['board_url']}/uploads/{$this->memberData['avatar_location']}' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" width='{$this->memberData['pp_thumb_width']}' height='{$this->memberData['pp_thumb_width']}' class='photo' />
<else />
<img src='{$this->memberData['avatar_location']}' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" width='{$this->memberData['pp_thumb_width']}' height='{$this->memberData['pp_thumb_height']}' class='photo' />
</if>
<else /><img src='{$this->memberData['pp_thumb_photo']}' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" width='{$this->memberData['pp_thumb_width']}' height='{$this->memberData['pp_thumb_height']}' class='photo' /></if></a>

ACP :a: :a: Wygląd :a: Lista użytkowników :a: member_list_show

Znajdź:

						<a href='{parse url="showuser={$member['member_id']}" template="showuser" seotitle="{$member['members_seo_name']}" base="public"}' title='{$this->lang->words['view_profile']}'><img src='{$member['pp_thumb_photo']}' width='{$member['pp_thumb_width']}' height='{$member['pp_thumb_height']}' alt="{$member['members_display_name']}{$this->lang->words['users_photo']}" class='photo' /></a>	

Zamień na:

                        <if test="$member['pp_thumb_photo'] == 'http://forums.wootflakes.com/public/style_images/spork2/profile/default_thumb.png' && $member['avatar_location'] != '' ">
<if test="$member['avatar_type'] == 'upload'">
<img src='{$this->settings['board_url']}/uploads/{$member['avatar_location']}' alt="{$member['members_display_name']}{$this->lang->words['users_photo']}" width='{$member['pp_thumb_width']}' height='{$member['pp_thumb_width']}' class='photo' />
<else />
<img src='{$member['avatar_location']}' alt="{$member['members_display_name']}{$this->lang->words['users_photo']}" width='{$member['pp_thumb_width']}' height='{$member['pp_thumb_height']}' class='photo' />
</if>
<else /><img class="photo" src='{$member['pp_thumb_photo']}' alt="{$member['members_display_name']}{$this->lang->words['users_photo']}" width='{$member['pp_thumb_width']}' height='{$member['pp_thumb_height']}' /></if></a>

ACP :a:;) Wygląd :a: Strona główna :a: hookBoardIndexStatusUpdates

Znajdź:

<img src='{$this->memberData['pp_mini_photo']}' width='{$this->memberData['pp_mini_width']}' height='{$this->memberData['pp_mini_height']}' class='photo' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" />

Zamień na:

<if test="$this->memberData['pp_mini_photo'] == 'http://forums.wootflakes.com/public/style_images/spork2/profile/default_thumb.png' && $this->memberData['avatar_location'] != '' ">

<if test="$this->memberData['avatar_type'] == 'upload'">
<img src='{$this->settings['board_url']}/uploads/{$this->memberData['avatar_location']}' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" width='{$this->memberData['pp_mini_width']}' height='{$this->memberData['pp_mini_width']}' class='photo' />
<else />
<img src='{$this->memberData['avatar_location']}' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" width='{$this->memberData['pp_mini_width']}' height='{$this->memberData['pp_mini_height']}' class='photo' />
</if>
<else /><img src='{$this->memberData['pp_thumb_photo']}' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" width='{$this->memberData['pp_mini_width']}' height='{$this->memberData['pp_mini_height']}' class='photo' /></if>

Znajdź:

<img src='{$r['pp_mini_photo']}' width='{$r['pp_mini_width']}' height='{$r['pp_mini_height']}' class='photo' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" />

Zamień na:

<if test="$r['pp_mini_photo'] == 'http://forums.wootflakes.com/public/style_images/spork2/profile/default_thumb.png' && $r['avatar_location'] != '' ">

<if test="$r['avatar_type'] == 'upload'">
<img src='{$this->settings['board_url']}/uploads/{$r['avatar_location']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" width='{$r['pp_mini_width']}' height='{$r['pp_mini_width']}' class='photo' />
<else />
<img src='{$r['avatar_location']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" width='{$r['pp_mini_width']}' height='{$r['pp_mini_height']}' class='photo' />
</if>
<else /><img src='{$r['pp_thumb_photo']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" width='{$r['pp_mini_width']}' height='{$r['pp_mini_height']}' class='photo' /></if>

ACP :a: :a: Wygląd :a: Strona główna :a: hookTopPosters

Znajdź:

<img src='{$r['pp_thumb_photo']}' width='{$r['pp_thumb_width']}' height='{$r['pp_thumb_height']}' alt='{$this->lang->words['photo']}' class='photo' />

Zamień na:

<if test="$r['pp_thumb_photo'] == 'http://forums.wootflakes.com/public/style_images/spork2/profile/default_thumb.png' && $r['avatar_location'] != '' ">

<if test="$r['avatar_type'] == 'upload'">
<img src='{$this->settings['board_url']}/uploads/{$r['avatar_location']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" width='{$r['pp_thumb_width']}' height='{$r['pp_thumb_width']}' class='photo' />
<else />
<img src='{$r['avatar_location']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" width='{$r['pp_thumb_width']}' height='{$r['pp_thumb_height']}' class='photo' />
</if>
<else /><img src='{$r['pp_thumb_photo']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" width='{$r['pp_thumb_width']}' height='{$r['pp_thumb_height']}' class='photo' /></if>

ACP :a: :a: Wygląd :a: Strona główna :a: hookRecentBlogEntries

Znajdź:

<li class='hentry {parse striping="recent_entries"}'>

Dodaj poniżej:

<span class='left' style='margin-right: 5px;'>
<if test="$r['pp_mini_photo'] == 'http://forums.wootflakes.com/public/style_images/spork2/profile/default_thumb.png' && $r['avatar_location'] != '' ">

<if test="$r['avatar_type'] == 'upload'">
<img src='{$this->settings['board_url']}/uploads/{$r['avatar_location']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" width='{$r['pp_mini_width']}' height='{$r['pp_mini_width']}' class='photo' />
<else />
<img src='{$r['avatar_location']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" width='{$r['pp_mini_width']}' height='{$r['pp_mini_height']}' class='photo' />
</if>
<else /><img src='{$r['pp_thumb_photo']}' alt="{$r['members_display_name']}{$this->lang->words['users_photo']}" width='{$r['pp_mini_width']}' height='{$r['pp_mini_height']}' class='photo' /></if></span>

Powodzenia! :)

Jeszcze raz podkreślam, że nie jestem autorem tutoriala. Kredyt uznania należy się autorce wpisu umieszczonego na Coders Refuge.

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.