<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Last poster avatar plugin question</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Fri, 17 Apr 2026 06:13:54 -0000</pubDate>

		<item>
			<title>Twiebie</title>
			<description><![CDATA[<p>
	I've build a little plugin a while ago (with help from Luke), that shows the avatar from the last poster in the forums sections and topics list.</p>
<p>
	It works quite well, but when a section contains a sub forum it will display the avatar from the user in the sub forum, instead of the avatar from a more recent topic/post in the normal (parent) section.</p>
<p>
	The code:</p>
<pre class="brush:php;">
if ($y &amp;&amp; $z) {
	$category = $z;
} else if ($y) {
	$category = $y;
} else if ($x) {
	$category = $x;
}

$sqllasttopic = $db-&gt;query("SELECT * FROM $db_forum_topics WHERE ft_cat=".$db-&gt;quote($category)." ORDER BY ft_updated DESC LIMIT 1");
$rowlasttopic = $sqllasttopic-&gt;fetch();

$sqllastposter = $db-&gt;query("SELECT * FROM $db_users WHERE user_id=".$db-&gt;quote($rowlasttopic['ft_lastposterid'])."");
$rowlastposter = $sqllastposter-&gt;fetch();

$t-&gt;assign(array(
	'POSTER_AVATAR_SECTIONS' =&gt; $rowlastposter['user_avatar'],
	'POSTER_AVATAR_SECTIONS_NAME' =&gt; $rowlastposter['user_name'],
));</pre>
<p>
	I've tried some different combinations, but haven't managed to sort it out.</p>
<p>
	Can anyone else maybe shine a light on this?</p>
]]></description>
			<pubDate>Fri, 31 Aug 2012 01:33:17 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7072&d=0#post35291]]></link>
		</item>
	</channel>
</rss>