'localhost', 'user'=>'brantx', 'password'=>'qwerasdf', 'default_db'=>'cn_b24_b2core' ); u = load('m/user')->check(); $var = load('m/elem')->setting(); } } function display($view,$param = array()) { $param['al_content'] = view($view,$param,TRUE); $temp = alpa('default_template'); header("Content-type: text/html; charset=utf-8"); view('data/template_'.$temp,$param); } } /* 显示面包屑 */ function al_breadcrumb() { global $rel_id; $id = $rel_id ? $rel_id : 0; $dir = alpa('dir'); $c = '首页 » '; while($id != 0) { $d = $dir[$id]; $c .= ' '.$d['title'].' » '; $id = $d['rel_id']; } return $c; } function alpa( $key , $page_size = 10 , $layout_name = 'list_layout' ) { $key = trim($key); $page_size = $page_size+0; //变量 global $var; if(array_key_exists($key , $var))return $var[$key]; if( $key == 'LAST' ) return alpa_list( '', $num , $layout_name ); $p = load('m/elem')->gname($key); //链接 if ( $p['mod'] == 'link' ) { $links = unserialize($p['elem_info']); $out = ''; $i = 0; foreach($links as $l ) { $class = ''; if(!$i++) $class=' class="first" '; if($_SERVER['REQUEST_URI'] == $l['link'] ) $class=' class="current" '; $out.= '
  • '; } return $out; } //页面 if( $p['mod'] == 'dir') { $pid = $p['id']; $condition = $pid?" and rel_id = '$pid'":''; $condition .= " and `mod` ='page' order by order_by desc, post_time desc "; return alpa_list($condition, $page_size , $layout_name ); } return "
    警告: $key 不存在
    "; } function alpa_list( $condition , $page_size = 10 , $layout_name ) { $page_size = $page_size > 0 ? $page_size:10; $list = load('m/elem')->get($condition , 0 , $page_size ); $al_list = array(); foreach($list as $l){ $l['page'] = BASE.'page/'.($l['elem_name']?$l['elem_name']:$l['id']).'/'; $linfo = unserialize($l['elem_info']); $al_list[] = array_merge($l,$linfo); } $lo = load('m/elem')->gname($layout_name); $layout = isset($lo['id']) && is_file(APP.'v/data/layout_'.$lo['id'].'.php')?'data/layout_'.$lo['id']:'data/layout_list_default'; $param = array('records' => $al_list); return view( $layout , $param , TRUE ); } function alpa_muti( $elem , $num , $layout_name ) { $condition = " and rel_id in (select id from elem where elem_name = '$elem' ) and `mod` = 'page') order by post_time desc"; return alpa_list($condition, $num , $layout_name ); } install(); exit; } load('c/page')->view(); } private function install() { global $db_config; if(is_array($db_config))redirect("/"); if(isset($_POST['host'])){ $db = new db($_POST); $sql = file_get_contents(APP.'install.sql'); $db->muti_query($sql); $base_dir = rtrim($_POST['base_dir'],'/').'/'; $seed = randstr(); file_put_contents(APP.'config_user.php','\''.$_POST['host'].'\', \'user\'=>\''.$_POST['user'].'\', \'password\'=>\''.$_POST['password'].'\', \'default_db\'=>\''.$_POST['default_db'].'\' );'); redirect($_POST['base_dir'],'安装成功'); } else { header("Content-type: text/html; charset=utf-8"); $base = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']); view("app/home/install",array('base'=>$base)); } } } 页面不存在
    404 错误,页面不存在