Topic: A challenge to someone who knows SQL
you know on forums.php and viewforum.php it says:
"last bost by <username>"
well I want to have it as "last post by <avatar><username>"
so it shows the user's avatar (if they have one) next to their username in forums.php and viewforum.php
I think it would really liven up the page a lot. (i am going to use phpThumb to generate small (around 40x40 pixels) versions of avatars when people upload them)
So the username of the last poster in any given forum is stored in the column last_poster in forums table.
So to get the avatar all I need is the last_poster's ID. To do this I think I need to LEFT JOIN with the users table on username like this:
LEFT JOIN forums ON users.username = forums.last_poster
But beyond that I am having difficulty.
I came up with this that doesn't really work:
SELECT users.id FROM users LEFT JOIN forums ON users.username = forums.last_poster
basically I am a little stuck at how to approach the query...any thoughts?
p.s.
As for the generating mini versions of avatars on the fly...I should be able to figure this one out on my own...I will post instructions once I have it working.
see my hack to integrate punbb with wordpress comment system.
Illustration Community