Alt Bölüm ve Son iletilere avatar eklemeMessageIndex.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
function template_main()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
Değiştir
function template_main()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt,$memberContext;
Bul
<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
<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
<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
<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
.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