本文整理汇总了PHP中CommonAction::error404方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonAction::error404方法的具体用法?PHP CommonAction::error404怎么用?PHP CommonAction::error404使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonAction
的用法示例。
在下文中一共展示了CommonAction::error404方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: review
public function review()
{
$uid = intval($_GET['uid']);
if ($uid == '') {
parent::error404();
}
//分配根据GET传过来的uid用户的信息
$objUser = M('user');
$userMessage = $objUser->where('id=' . $uid)->field('id,username,face,introduce,point,exp')->find();
$userMessage = deep_htmlspecialchars_decode($userMessage);
if ($userMessage == '') {
parent::error404();
}
$this->assign('userMessage', $userMessage);
//分配该用户的评论
$objComment = M('comment');
import('ORG.Util.Page');
//导入分页类
$count = $objComment->where(array('comment_uid' => $uid))->count();
$page = new page($count, 20);
$page->setConfig('theme', '%upPage% %first% %prePage% %linkPage% %downPage%');
$commentList = $objComment->where(array('comment_uid' => $uid))->field('aid,time,comment')->order('time desc')->limit($page->firstRow . ',' . $page->listRows)->select();
foreach ($commentList as $k1 => $v1) {
$commentList[$k1]['url'] = '__APP__/List/detail/id/' . $v1['aid'] . '.html';
}
$commentList = deep_htmlspecialchars_decode($commentList);
$show = $page->show();
$this->assign('page', $show);
$this->assign('commentList', $commentList);
//分配Pagetitle
$this->pageTitle = $userMessage['username'] . '的个人主页_支招网';
$this->display();
}
示例2: mcStatus
public function mcStatus()
{
parent::isLogin();
//登录判断
$aid = intval($_GET['aid']);
$cid = intval($_GET['cid']);
if ($aid == '') {
parent::error404();
}
if ($cid == '') {
parent::error404();
}
$objComment = M('comment');
$result = $objComment->where(array('id' => $cid))->setField('status', '1');
if ($result) {
redirect(U(APP_NAME . '/List/detail', array('id' => $aid)));
} else {
$this->error('系统繁忙,请稍后再试');
}
}
示例3: checkUserName
public function checkUserName()
{
if (!IS_AJAX) {
parent::error404();
}
$username = $this->_post('username');
$result = M('user')->where(array('username' => $username))->getField('id');
if ($result) {
echo 1;
} else {
echo 0;
}
}
示例4: handleBest
public function handleBest()
{
$aid = intval($_GET['aid']);
//文章ID
if ($aid == '') {
parent::error404();
}
$cid = intval($_GET['cid']);
//该条评论的id
if ($cid == '') {
parent::error404();
}
$uid = intval($_GET['uid']);
//该条评论的uid
if ($uid == '') {
parent::error404();
}
$auid = intval($_GET['auid']);
//该条评论的uid
if ($auid == '') {
parent::error404();
}
$reward = intval($_GET['reward']);
if ($reward == '') {
parent::error404();
}
$objBest = M('best');
$objAsk = M('ask');
$objUser = M('user');
$data = array();
$data['aid'] = $aid;
$data['cid'] = $cid;
$data['uid'] = $uid;
$data['article_uid'] = $auid;
$data['time'] = time();
$result = $objBest->data($data)->add();
if ($result) {
$objAsk->where('id=' . $aid)->setField(array('solve' => "1"));
//设置该问题状态 为已采纳
$objUser->where(array('id' => $auid))->setDec('point', $reward);
//该篇文章的用户减分
$objUser->where(array('id' => $uid))->setInc('point', $reward);
//该条评论的用户加分
$this->success('采纳为最佳支招成功..');
} else {
$this->error('采纳失败,请稍后再试');
}
}