/** * */ protected function _initialize() { G('begin'); /* 读取站点配置 */ //S('config',null); $config = S('config'); if (empty($config)) { $config = config(); S('config', $config, 86400); } C($config); $bbsinfo = S('bbsinfo'); if (empty($bbsinfo)) { $bbsinfo = bbsinfo(); S('bbsinfo', $bbsinfo, 86400); } if (C('WEB_LOCK') == '1') { exit("网站暂时关闭"); } $userinfo = getuserinfo(); if (empty($userinfo)) { $userinfo = null; } $listdata = S('listdata'); if (empty($listdata)) { $listarticle = M('Article'); $listdata = $listarticle->where('status = 0')->order('view')->limit(15)->getField('id,title,review'); S('listdata', $listdata, 600); } $this->assign('listdata', $listdata); $this->assign('userinfo', $userinfo); $this->assign('bbsinfo', $bbsinfo); }
$attachs = @$_REQUEST['attachs']; $keyword = @$_REQUEST['keyword']; $type = @$_REQUEST['type']; if (!islegal($bid) || !islegal($tid) || !islegal($pid) || !islegal($fid)) { echo "<capu><info><code>-1</code><msg>未知错误,请反馈给我们。</msg></info></capu>"; exit; } $token = @$_REQUEST['token']; $ip = @$_REQUEST['ip']; $view = @$_REQUEST['view']; $con = null; if ($ip == "") { $ip = $_SERVER["REMOTE_ADDR"]; } if ($ask == "bbsinfo") { bbsinfo($con, $bid, @$_REQUEST['name']); } else { if ($ask == "login") { login($con, @$_REQUEST['username'], @$_REQUEST['password'], $ip); } else { if ($ask == "logout") { logout($con, $token, $ip); } else { if ($ask == "register") { register($con, $ip); } else { if ($ask == "boardcast") { boardcast($con, $token, $text); } else { if ($ask == "getuser") { getuser($con, $token);