query( "select {chatthread}.* " . "from {chatthread} " . "where userid=? order by dtmcreated DESC", array($userid), array('return_rows' => Database::RETURN_ALL_ROWS) ); } $found = threads_by_userid($userid); prepare_menu($operator); setup_pagination($found, 6); foreach ($page['pagination.items'] as $key => $item) { $page['pagination.items'][$key] = Thread::createFromDbInfo($item); } start_html_output(); require('../view/userhistory.php'); ?>