function run() { $this->generate_query_array(); return $this->db->DB_request_handler($this->array); } function stop() { $this->db->DB_close_mysql(); } } $ret = ""; $main = new main_page("./conf.xml", $ret); if ($ret == FALSE) { exit; } $result_list = $main->run(); /* for ($i = 0; $i < count($result_list); $i++) { $one = $result_list[$i]; echo $one["title"] . $one["content"]; } */ $main->stop(); ?> <!DOCTYPE html> <html lang = "zh-CN"> <head> <title> 我的博客</title> <meta http-equiv = "Content-Type" content= "text/html; charset=gb2312"> </head>
protected function get_self_counter() { $local = new medoo(); $db = new maindb(); $register = $db->count('p_user', '*', array('invite' => $_SESSION['userinfo']['ekey'])); $authority = $db->count('p_user', '*', array('AND' => array('invite' => $_SESSION['userinfo']['ekey'], 'auth' => 1))); $orders = $local->count('orders', '*', array('ekey' => $_SESSION['userinfo']['ekey'])); unset($db); unset($local); if ($_SESSION['userinfo']['auth'] == 1) { //主管,写入学校列表 $_SESSION['school'] = school_handler::through_area_get_school($_SESSION['userinfo']['province']); } $_SESSION['userinfo']['register'] = $register; $_SESSION['userinfo']['authority'] = $authority; $_SESSION['userinfo']['orders'] = $orders; } protected function init() { // echo $_SERVER['HTTP_REFERER'] ; session_start(); $this->get_all_data(); $this->get_self_counter(); // date_default_timezone_set('Asia/Shanghai'); $this->assign('session', $_SESSION); $this->display('main.tpl'); } } $demo = new main_page(); $demo->run();