$sql = "SELECT t.*, f.name FROM ".DB::table('forum_thread')." t, ".DB::table('forum_forum')." f WHERE f.fid=t.fid $notshow $onlyshow AND t.displayorder not IN(-1,-2) AND t.closed NOT LIKE 'moved|%' AND t.replies!=0 ORDER BY t.lastpost DESC LIMIT 0, 10";