Skocz do zawartości
Hosting webh.pl - 20%

Avatary w SB

Rekomendowane odpowiedzi

Opublikowano

Witam, pokażę prosty sposób na wyświetlanie avatarów w SB.

Wykonujemy kolejno poniższe instrukcje:

ACP :a: Wygląd :a: Look & Feel :a: Skiny i szablony :a: Nazwa Twojego Stylu :a: (Shoutbox) Główne :a:shout_row

Znajdź:

<if test="$ajax==false"><tr class='row2' id='shout-{$d['_archive']}row-{$d['s_id']}'></if>

Dodaj po:

<td align='center' valign='middle' style='width: '30; white-space: nowrap; height:100%;'>
<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']}' class='ipsUserPhotoLink left'>
   	<img src='{$this->memberData['pp_small_photo']}' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" class='ipsUserPhoto ipsUserPhoto_mini photo' />
  	</a>
</td>

Zapisz zmiany, wyczyść cache ;) .

Opublikowano

Oj, wyświetla się tylko mój avatar u wszystkich.

Opublikowano
  • Manager

Bo autor pewnie zerżnął ten poradnik z jakiejś strony i nawet nie wie, co wkleił.

<img src='{$this->memberData['pp_small_photo']}' alt="{$this->memberData['members_display_name']}{$this->lang->words['users_photo']}" class='ipsUserPhoto ipsUserPhoto_mini photo' />

Daj zawartość tego bitu skina, zobaczę, co da się zrobić.

intermedia - profesjonalne rozwiązania Invision Power Board, IC5

Opublikowano
<if test="$ajax==false"><tr class='row2' id='shout-{$d['_archive']}row-{$d['s_id']}'></if>
   <td align='right' valign='top' style='width: 1%; white-space: nowrap;'>
  	 <if test="$d['member_id'] && $this->registry->getClass('shoutboxLibrary')->moderator"><a href='#member{$d['member_id']}' onclick='return ipshoutbox.shoutAjax.modOptsLoadMember({$d['member_id']})' title='{$this->lang->words['mmenu_load_mod_opts']}'>{parse replacement="user_edit_icon"}</a> </if>
  	 <if test="$d['member_id']">
  		 {IPSMember::makeProfileLink($d['_members_display_name'], $d['member_id'], $d['members_seo_name'])}
  	 <else />

  		 <abbr title="{$d['members_display_name']}">{$d['_members_display_name']}</abbr>
  	 </if>
  	 :
   </td>
   <td valign='top' style='width: 99%;'>
  	 <span class='right shoutbox_time' title='{$d['_date']}'>({$d['s_date']})<if test="$can_edit || ($this->registry->getClass('shoutboxLibrary')->moderator && $this->registry->getClass('shoutboxLibrary')->checkModeratorPerm('edit_shouts', true))"> <a href='{parse url="app=shoutbox" seotitle="false" base="public"}#edit{$d['s_id']}' onclick='return ipshoutbox.shoutAjax.editShout({$d['s_id']})' title='{$this->lang->words['mod_opt_edit']}'>{parse replacement="edit_post_icon"}</a></if><if test="$this->registry->getClass('shoutboxLibrary')->moderator"> <a href='{parse url="app=shoutbox" seotitle="false" base="public"}#shout{$d['s_id']}' onclick='return ipshoutbox.shoutAjax.modOptsLoadShout({$d['s_id']})' title='{$this->lang->words['mmenu_load_mod_opts']}'>{parse replacement="edit_folder"}</a></if></span>
  	 <if test="$d['_ignored'] == 1">
  		 <span id='unhide_shout_{$d['s_id']}' class='shoutbox_time'>{$this->lang->words['ignored_shouter']} <a href='#shout{$d['s_id']}' onclick='return ipshoutbox.showHiddenShout({$d['s_id']})' title='{$this->lang->words['ignored_shouter_view']}'>{$this->lang->words['ignored_shouter_view']}</a></span>
  		 <span id='hidden_shout_{$d['s_id']}' style='display:none'>{$d['s_message']}</span>
  	 <else />
  		 {$d['s_message']}
  	 </if>
   </td>
<if test="$ajax==false"></tr></if>

Opublikowano

btvw.jpg

Nie działa :(

Opublikowano

Zmodyfikowałem trochę shout_row i udało mi się :)

Proszę zastąpić cały kod shout_row tym:

<if test="$ajax==false"><tr height='100%' class='row2' id='shout-{$d['_archive']}row-{$d['s_id']}'></if>
<td align='center' height='100%' width='30' valign='middle'  style=' white-space: nowrap;'>
<php>
$this->DB->build( array( 'select' => 'avatar_location, avatar_type, pp_thumb_width, pp_thumb_height, pp_thumb_photo', 'from' => 'profile_portal', 'where' => 'pp_member_id='.$d[member_id].'' ) );
$this->DB->execute();
$memberthing = $this->DB->fetch();
</php>
<if test="$memberthing['pp_thumb_photo'] == '' && $memberthing['avatar_location'] != '' ">
   	<if test="$memberthing['avatar_type'] != 'url'">
	<a href='{parse url="showuser={$d['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class="ipsUserPhotoLink"><img class="ipsUserPhoto ipsUserPhoto_mini" src='{$this->settings['board_url']}<if test="$memberthing['avatar_type'] == 'upload'">/uploads/<else />/public/style_avatars/</if>{$memberthing['avatar_location'
]}' alt="{$r['starter_name']}{$this->lang->words[
'users_photo']}" style='max-width:auto; max-height:30px;' class='photo' /></a>
   	<else />
<a href='showuser={$d['member_id']}' seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class="ipsUserPhotoLink"><img class="ipsUserPhoto ipsUserPhoto_mini" src='{$memberthing['avatar_location']}' alt="{$r['starter_name']}{$this->lang->words[
'users_photo']}" style='30px; max-height:30px;' class='photo' /></a>
   	</if>
   	<else />
   	<if test="$memberthing['pp_thumb_photo'] == ''">
 <a href='{parse url="showuser={$d['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class="ipsUserPhotoLink"><img class="ipsUserPhoto ipsUserPhoto_mini" src='{$this->settings['img_url']}/profile/default_thumb.
png' alt="{$r['starter_name']}{$this->lang->words[
'users_photo']}" style='max-width:30px; max-height:30px;' class='photo' /></a>
   	<else />
<a href='{parse url="showuser={$d['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class="ipsUserPhotoLink"><img class="ipsUserPhoto ipsUserPhoto_mini" src='{$this->settings['board_url']}/uploads/{$memberthing[
'pp_thumb_photo']}' alt="{$r['starter_name']}{$this->lang->words[
'users_photo']}" style='max-width:auto; max-height:30px;' class='photo' /></a>
   	</if>
   	</if>
</td>

<td valign='top'  height='100%'><if test="$d['member_id'] && $this->registry->getClass('shoutboxLibrary')->moderator"><a href='#member{$d['member_id']}' onclick='return ipshoutbox.shoutAjax.modOptsLoadMember({$d['member_id']})' title='{$this->lang->words['mmenu_load_mod_opts']}'>{parse replacement="user_edit_icon"}</a></if><if test="$d['member_id']">{IPSMember::makeProfileLink($d['_members_display_name'], $d['member_id'], $d['members_seo_name'])}<else /><abbr title="{$d['members_display_name']}">{$d['_members_display_name']}</abbr></if>:
<br>
<if test="$d['_ignored'] == 1"><span id='unhide_shout_{$d['s_id']}' class='shoutbox_time'>{$this->lang->words['ignored_shouter']} <a href='#shout{$d['s_id']}' onclick='return ipshoutbox.showHiddenShout({$d['s_id']})' title='{$this->lang->words['ignored_shouter_view']}'>{$this->lang->words['ignored_shouter_view']}</a></span>
<span id='hidden_shout_{$d['s_id']}' style='display:none'>{$d['s_message']}</span>
 <else />
  {$d['s_message']}
 </if>


</td>
<td align='right' height='100%' valign='top' style='width: 1%; white-space: nowrap;'>
<span  shoutbox_time' title='{$d['_date']}'>({$d['s_date']})<if test="$can_edit || ($this->registry->getClass('shoutboxLibrary')->moderator && $this->registry->getClass('shoutboxLibrary')->checkModeratorPerm('edit_shouts', true))"> <a href='{parse url="app=shoutbox" seotitle="false" base="public"}#edit{$d['s_id']}' onclick='return ipshoutbox.shoutAjax.editShout({$d['s_id']})' title='{$this->lang->words['mod_opt_edit']}'>{parse replacement="edit_post_icon"}</a></if><if test="$this->registry->getClass('shoutboxLibrary')->moderator"> <a href='{parse url="app=shoutbox" seotitle="false" base="public"}#shout{$d['s_id']}' onclick='return ipshoutbox.shoutAjax.modOptsLoadShout({$d['s_id']})' title='{$this->lang->words['mmenu_load_mod_opts']}'>{parse replacement="edit_folder"}</a></if></span>
</td>
<if test="$ajax==false"></tr></if>

Opublikowano

pvxd.jpg

Działa, ale treść shouta jest pod dwukropkiem. Jak to naprawić?

Opublikowano

Okey! Usunąłem tag <br>

Dzięki wielkie :) Z bazą sobie poradzimy ;]

Opublikowano

To wez to Dawid przerób, aby było poprawnie :D.

Opublikowano
  • Manager

Sam przerób - trudne nie jest, ale trzeba pomyśleć i nad tym posiedzieć.

Poza tym ta przeróbka mi się nie podoba (pomysł), więc ręki nie przyłożę na więcej niż porady dla tworzącego.

intermedia - profesjonalne rozwiązania Invision Power Board, IC5

Opublikowano

Zrobiłbyś to dla mniej doświadczonych. Dla Ciebie przeróbka nie jest trudna, dla innych owszem.

Opublikowano
  • Manager

Skąd wiesz, że chcę spędzać czas nad tym, a nie czymś innym? Gdybym chciał to zrobić to bym to zrobił. PaJonk się podjął jednej próby, to niech daje z drugą! :)

Dla Ciebie przeróbka nie jest trudna, dla innych owszem.

Może warto popracować nad tym by i ci 'inni' też traktowali to jako łatwą przeróbkę.

intermedia - profesjonalne rozwiązania Invision Power Board, IC5

Opublikowano

Jesteś zwojem z którego czerpiemy wiedzę:D Później będziemy potrafili Cię wyręczyć jeżeli zajdzie taka potrzeba.

Opublikowano

Daj lepiej przeróbkę kodu :D

Opublikowano

Zmodyfikowałem trochę shout_row i udało mi się :)

Proszę zastąpić cały kod shout_row tym:

<if test="$ajax==false"><tr height='100%' class='row2' id='shout-{$d['_archive']}row-{$d['s_id']}'></if>
<td align='center' height='100%' width='30' valign='middle'  style=' white-space: nowrap;'>
<php>
$this->DB->build( array( 'select' => 'avatar_location, avatar_type, pp_thumb_width, pp_thumb_height, pp_thumb_photo', 'from' => 'profile_portal', 'where' => 'pp_member_id='.$d[member_id].'' ) );
$this->DB->execute();
$memberthing = $this->DB->fetch();
</php>
<if test="$memberthing['pp_thumb_photo'] == '' && $memberthing['avatar_location'] != '' ">
   	<if test="$memberthing['avatar_type'] != 'url'">
<a href='{parse url="showuser={$d['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class="ipsUserPhotoLink"><img class="ipsUserPhoto ipsUserPhoto_mini" src='{$this->settings['board_url']}<if test="$memberthing['avatar_type'] == 'upload'">/uploads/<else />/public/style_avatars/</if>{$memberthing['avatar_location'
]}' alt="{$r['starter_name']}{$this->lang->words[
'users_photo']}" style='max-width:auto; max-height:30px;' class='photo' /></a>
   	<else />
<a href='showuser={$d['member_id']}' seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class="ipsUserPhotoLink"><img class="ipsUserPhoto ipsUserPhoto_mini" src='{$memberthing['avatar_location']}' alt="{$r['starter_name']}{$this->lang->words[
'users_photo']}" style='30px; max-height:30px;' class='photo' /></a>
   	</if>
   	<else />
   	<if test="$memberthing['pp_thumb_photo'] == ''">
 <a href='{parse url="showuser={$d['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class="ipsUserPhotoLink"><img class="ipsUserPhoto ipsUserPhoto_mini" src='{$this->settings['img_url']}/profile/default_thumb.
png' alt="{$r['starter_name']}{$this->lang->words[
'users_photo']}" style='max-width:30px; max-height:30px;' class='photo' /></a>
   	<else />
<a href='{parse url="showuser={$d['member_id']}" seotitle="{$r['members_seo_name']}" template="showuser" base="public"}' title='{$this->lang->words['view_profile']}' class="ipsUserPhotoLink"><img class="ipsUserPhoto ipsUserPhoto_mini" src='{$this->settings['board_url']}/uploads/{$memberthing[
'pp_thumb_photo']}' alt="{$r['starter_name']}{$this->lang->words[
'users_photo']}" style='max-width:auto; max-height:30px;' class='photo' /></a>
   	</if>
   	</if>
</td>

<td valign='top'  height='100%'><if test="$d['member_id'] && $this->registry->getClass('shoutboxLibrary')->moderator"><a href='#member{$d['member_id']}' onclick='return ipshoutbox.shoutAjax.modOptsLoadMember({$d['member_id']})' title='{$this->lang->words['mmenu_load_mod_opts']}'>{parse replacement="user_edit_icon"}</a></if><if test="$d['member_id']">{IPSMember::makeProfileLink($d['_members_display_name'], $d['member_id'], $d['members_seo_name'])}<else /><abbr title="{$d['members_display_name']}">{$d['_members_display_name']}</abbr></if>:
<br>
<if test="$d['_ignored'] == 1"><span id='unhide_shout_{$d['s_id']}' class='shoutbox_time'>{$this->lang->words['ignored_shouter']} <a href='#shout{$d['s_id']}' onclick='return ipshoutbox.showHiddenShout({$d['s_id']})' title='{$this->lang->words['ignored_shouter_view']}'>{$this->lang->words['ignored_shouter_view']}</a></span>
<span id='hidden_shout_{$d['s_id']}' style='display:none'>{$d['s_message']}</span>
 <else />
  {$d['s_message']}
 </if>


</td>
<td align='right' height='100%' valign='top' style='width: 1%; white-space: nowrap;'>
<span  shoutbox_time' title='{$d['_date']}'>({$d['s_date']})<if test="$can_edit || ($this->registry->getClass('shoutboxLibrary')->moderator && $this->registry->getClass('shoutboxLibrary')->checkModeratorPerm('edit_shouts', true))"> <a href='{parse url="app=shoutbox" seotitle="false" base="public"}#edit{$d['s_id']}' onclick='return ipshoutbox.shoutAjax.editShout({$d['s_id']})' title='{$this->lang->words['mod_opt_edit']}'>{parse replacement="edit_post_icon"}</a></if><if test="$this->registry->getClass('shoutboxLibrary')->moderator"> <a href='{parse url="app=shoutbox" seotitle="false" base="public"}#shout{$d['s_id']}' onclick='return ipshoutbox.shoutAjax.modOptsLoadShout({$d['s_id']})' title='{$this->lang->words['mmenu_load_mod_opts']}'>{parse replacement="edit_folder"}</a></if></span>
</td>
<if test="$ajax==false"></tr></if>

fajnie że skopiowałeś kod z cmsside z bitu shout_row i wkleiłeś go tutaj. I na dodatek podpisałeś się pod niego (że to ty go zmodyfikowałeś)

haha <bardzo śmieszne>

Opublikowano

Trzeci zobacz sobie kod cmsside sout_row, a ten ;).

Opublikowano

No ale skopiowałeś ten mój, i trochę przerobiłeś go.

  • 4 tygodnie później...
Opublikowano

W wersji 1.2.3 shoutboxa została dodana opcja

Added option to show profile photo beside each shout
Opublikowano

I spór został rozwiązany! Juuuuuuuupi!

  • 1 miesiąc temu...
Opublikowano

Witam,chciał bym zapytać jak zmienić ustawienia SB 1.2.3 by wyświetlane obrazki pokazywały się tak jak na tym forum. Bo aktualnie jest to za nickiem użytkownika a przed ":" a chciał bym od maksymalnej lewej strony, i równo od krawędzi....

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

Ostatnio przeglądający 0

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

Konto

Nawigacja

Szukaj

Szukaj

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.