MyBB Community Forums

Full Version: [HELP] Url avatar member not work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
please help me sir, url avatar member not work in sidebar.

[Image: Screenshot_311215_18_15_44.png]

<tr>
<tr class="latestthreads_portal">
<td class="trow3"><a href="{$mybb->settings['bburl']}/{$thread['threadlink']}">{$thread['subject']}</a>
		<div class="float_left" style="margin: 5px 8px 0 0;"><!-- start: recentthread_avatar -->
			<img id="panel-avatar" src="{$avatar}" width="140" height="140" />
<!-- end: recentthread_avatar --></div></a><br /><span class="smalltext"><a href="">{$lastposterlink}</a> - {$lastpostdate}</span>
	</td>
    <td class="trow3">
		<div class="sbr">{$thread['replies']}</div>
	</td>
</tr>
</tr>
can you link us to a preview??
should be easyer to help instead of a image
(2015-12-31, 04:01 PM)subzr1 Wrote: [ -> ]can you link us to a preview??
should be easyer to help instead of a image

I want the latest post member avatar in the sidebar.
You can't just add {$avatar} to the template. You need to define that variable. And to do that you need to:
1. https://github.com/mybb/mybb/blob/featur...l.php#L347 - select required data in the query:
SELECT t.tid, t.fid, t.uid, t.lastpost, t.lastposteruid, t.lastposter, t.subject, t.replies, t.views, u.username, u.avatar, u.avatardimensions
2. https://github.com/mybb/mybb/blob/featur...l.php#L367 - format it:
$avatar = format_avatar($thread['avatar'], $thread['avatardimensions', '20x20']);
3. In the template use {$avatar['image']} for the src and {$avatar['width_height']} for dimensions.
(2016-01-01, 02:54 AM)Destroy666 Wrote: [ -> ]You can't just add {$avatar} to the template. You need to define that variable. And to do that you need to:
1. https://github.com/mybb/mybb/blob/featur...l.php#L347 - select required data in the query:
SELECT t.tid, t.fid, t.uid, t.lastpost, t.lastposteruid, t.lastposter, t.subject, t.replies, t.views, u.username, u.avatar, u.avatardimensions
2. https://github.com/mybb/mybb/blob/featur...l.php#L367 - format it:
$avatar = format_avatar($thread['avatar'], $thread['avatardimensions', '20x20']);
3. In the template use {$avatar['image']} for the src and {$avatar['width_height']} for dimensions.

you make me dizzy sir, I want that practical. how to bring the latest member Discussion avatar in the sidebar.