Gönderen Konu: Alt Bölün ve Son iletilere avatar ekleme  (Okunma sayısı 11501 defa)

danua

  • Yönetici
  • Kıdemli Üye
  • *****
  • İleti: 312
  • Karma 65535
Alt Bölün ve Son iletilere avatar ekleme
« : 07 Temmuz 2019, 02:17:18 »
Alt Bölüm ve Son iletilere avatar ekleme

MessageIndex.template.php içerisinde alttaki kodları bularak uygun kodlarla değiştirerek alt bölüm ve son gönderilen iletilerin yanlarına avatar ekleyebilirsiniz.

MessageIndex.template.php
Bul
Kod: [Seç]
function template_main()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;

Değiştir
Kod: [Seç]
function template_main()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt,$memberContext;

Bul
Kod: [Seç]
<td class="lastpost">';

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'], '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';

echo '
</td>

Değiştir
Kod: [Seç]
<td class="lastpost">';

if (!empty($board['last_post']['id'])){
loadMemberData($board['last_post']['member']['id']);
loadMemberContext($board['last_post']['member']['id']);
if($memberContext[$board['last_post']['member']['id']]['avatar']['image'])
echo'', $memberContext[$board['last_post']['member']['id']]['avatar']['image'],'';
else
echo'<img class="avatar" src="'.$settings['images_url'].'/theme/default_avatar.png" alt="*" />';
echo '
<p> ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
<strong>', $txt['last_post'], '</strong> ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
}
echo '
</td>

Bul
Kod: [Seç]
<td class="lastpost ', $alternate_class, '">
<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
', $topic['last_post']['time'], '<br />
', $txt['by'], ' ', $topic['last_post']['member']['link'], '
</td>';

Değiştir
Kod: [Seç]
<td class="lastpost ', $alternate_class, '">';
loadMemberData($topic['last_post']['member']['id']);
loadMemberContext($topic['last_post']['member']['id']);
if($memberContext[$topic['last_post']['member']['id']]['avatar']['image'])
echo'', $memberContext[$topic['last_post']['member']['id']]['avatar']['image'],'';
else
echo'<img class="avatar" src="'.$settings['images_url'].'/default_avatar.png" alt="*" />';
echo '
<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
', $topic['last_post']['time'], '<br />
', $txt['by'], ' ', $topic['last_post']['member']['link'], '
</td>';

index.css dosyasının enaltına ekle
Kod: [Seç]
.lastpost .avatar{
float:left;
width:25px;
height:25px;
border-radius:80%;
border: 1px solid #ccc;
        overflow: hidden;
}


Linkback: Alt Bölün ve Son iletilere avatar ekleme
𐱅𐰇𐰼𐰚

Sitelerim
:::::::::::::::::::
telkaricim.com

Tags: