當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonAction::error404方法代碼示例

本文整理匯總了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();
 }
開發者ID:GobYang,項目名稱:zhizhao,代碼行數:33,代碼來源:UserAction.class.php

示例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('係統繁忙,請稍後再試');
     }
 }
開發者ID:GobYang,項目名稱:zhizhao,代碼行數:20,代碼來源:MemberAction.class.php

示例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;
     }
 }
開發者ID:GobYang,項目名稱:zhizhao,代碼行數:13,代碼來源:LoginAction.class.php

示例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('采納失敗,請稍後再試');
     }
 }
開發者ID:GobYang,項目名稱:zhizhao,代碼行數:48,代碼來源:ListAction.class.php


注:本文中的CommonAction::error404方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。