Thanks alot!
I managed to get it work. This is a correct code:
PHP Code:
global $db, $vbulletin;
$favthreads = $db->query_read("
SELECT thread.threadid, thread.title, thread.postusername, thread.postuserid, thread.votenum, thread.views, thread.replycount, thread.iconid, icon.iconpath
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON (icon.iconid = thread.iconid)
");
while ($favthread = $db->fetch_array($favthreads))
{
$favo.="<a href='t$favthread[threadid].html'>$favthread[title] $favthread[iconid] $favthread[iconpath]</a><br /><br />";
}