//NEWEST THREADS
$query = $db->query("SELECT t.tid, t.subject, t.icon, t.dateline, t.threadsolved, u.uid, u.username, u.usergroup, u.displaygroup, i.* FROM ".$db->table_prefix."threads t LEFT JOIN ".$db->table_prefix."users u ON u.uid=t.uid LEFT JOIN ".$db->table_prefix."icons i ON i.iid=t.icon WHERE ".$fidnot." ORDER BY t.dateline DESC LIMIT ".$limit);
if($db->num_rows($query) > 0)
{
$num = 0;
while($thread = $db->fetch_array($query))
{
$icon = "";
if($thread['icon'] != 0)
$icon = "<img src=\"".$thread['path']."\" alt=\"".$thread['name']."\" style=\"vertical-align:middle;\" height=\"12\" width=\"12\" /> ";
$solved_icon = "";
if ($thread['threadsolved'] !=0)
$solved_icon = "<img src=\"{$theme['imgdir']}/solved.png\" alt=\"solved\" style=\"vertical-align:middle;\" height=\"12\" width=\"12\" /> ";
$lines .= $solved_icon." ".$icon."<a href=\"".get_thread_link($thread['tid'])."\">".$thread['subject']."</a> (".$lang->asoi_by." ";
$lines .= build_profile_link(format_name($thread['username'], $thread['usergroup'], $thread['displaygroup']), $thread['uid']);
$lines .= " ".$lang->asoi_on." <em>".my_date($mybb->settings['dateformat'], $thread['dateline'])." ".my_date($mybb->settings['timeformat'], $thread['dateline'])."</em>)<br />\n";
$num++;
}
}