$thread_sql = mysql_query("SELECT threadid,title,lastpost,lastposter FROM thread WHERE visible=1 AND open=1 AND forumid!=X $forumid ORDER BY lastpost DESC $limited");