@squawell: yes right, every variabole appearing in the template has to be before that eval!
@boofo:
it would slow down the query but i think this should do the trick:
PHP Code:
$post7day = $DB_site->query_first("
SELECT DISTINCT(post.userid), COUNT(postid) AS posts, user.username
FROM post
LEFT JOIN user USING(userid)
LEFT JOIN thread USING(threadid)
WHERE post.userid > 0 AND post.dateline>=$d AND thread.forumid=xx
GROUP BY post.userid
ORDER BY posts DESC
LIMIT 1
");