query( "select unix_timestamp(dtmcreated) as created, " . "unix_timestamp(dtmmodified) as modified, threadid, remote, agentName, userName " . "from {chatthread} " . "where userid=? order by created DESC", array($userid), array('return_rows' => Database::RETURN_ALL_ROWS) ); } $found = threads_by_userid($userid); prepare_menu($operator); setup_pagination($found, 6); start_html_output(); require('../view/userhistory.php'); ?>