$result = $db->sql_query("SELECT sid, title, counter FROM ".$prefix."_stories $queryalang".($queryalang?" AND":" WHERE")." `time`>='".(time()-30*86400)."' ORDER BY counter DESC LIMIT 0,9");