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.
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.
The code:
PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
if($y&& $z) {
$category= $z;
} elseif($y) {
$category= $y;
} elseif($x) {
$category= $x;
}
$sqllasttopic= $db->query("SELECT * FROM $db_forum_topics WHERE ft_cat=".$db->quote($category)." ORDER BY ft_updated DESC LIMIT 1");
$rowlasttopic= $sqllasttopic->fetch();
$sqllastposter= $db->query("SELECT * FROM $db_users WHERE user_id=".$db->quote($rowlasttopic['ft_lastposterid'])."");