当前位置: 首页>>代码示例>>PHP>>正文


PHP comment::getCIDsbyAID方法代码示例

本文整理汇总了PHP中comment::getCIDsbyAID方法的典型用法代码示例。如果您正苦于以下问题:PHP comment::getCIDsbyAID方法的具体用法?PHP comment::getCIDsbyAID怎么用?PHP comment::getCIDsbyAID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在comment的用法示例。


在下文中一共展示了comment::getCIDsbyAID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: questionAction

 public function questionAction()
 {
     //封装header
     $auth = Zend_Auth::getinstance();
     #获取auth用户实例
     $auth->getIdentity();
     #取得当前用户信息
     $email = $auth->getIdentity();
     $quser = new user();
     $qquestion = new question();
     $qanswer = new answer();
     $qcomment = new comment();
     $qask = new ask();
     $likec = new likeC();
     $likea = new likeA();
     $followq = new followQ();
     $user = $quser->getAllbyEmail($email);
     $header = array("UID" => $user[0]["UID"], "image" => $user[0]["image"]);
     $qtag = new tag();
     $QID = $this->getRequest()->getParam("QID");
     $tag = $qtag->getTagbyQID($QID);
     $Q = $qquestion->getAllbyQID($QID);
     $qtitle = $Q["qtitle"];
     $qtime = $qask->getAskTimebyQID($QID);
     $qcontent = $Q["Qcontent"];
     $answernum = $qanswer->getAnswernumbyQID($QID);
     $AIDs = $qanswer->getAIDsbyQID($QID);
     $ans_val[0][0] = 0;
     $comment[0][0] = 0;
     $answer[0][0] = 0;
     $com_val[0][0] = 0;
     for ($i = 0; $i < $answernum; $i++) {
         //第i个回答
         $AID = $AIDs[$i];
         $AUID = $qanswer->getUIDbyAID($AID);
         $auser = $quser->getAllbyUID($AUID);
         $Anickname = $auser["nickname"];
         $anow = $qanswer->getAllbyAID($AID);
         $acontent = $anow["AContent"];
         //print_r($anow);
         //print_r($acontent);
         $unow = $quser->getAllbyUID($AUID);
         $image = $unow["image"];
         $atime = $qanswer->getTimebyAID($AID);
         $ans_val[$i] = $atime;
         $commentnum = $qcomment->getCommentnumbyAID($AID);
         $CIDs = $qcomment->getCIDsbyAID($AID);
         $likeNum = $likea->getLikenumbyAID($AID);
         $comment = array();
         $com_val = array();
         for ($j = 0; $j < $commentnum; $j++) {
             //第j个评论
             $CID = $CIDs[$j];
             $CUID = $qcomment->getUIDbyCID($CID);
             $RUID = $qcomment->getRIDbyCID($CID);
             $ccontent = $qcomment->getContentbyCID($CID);
             $ctime = $qcomment->getTimebyCID($CID);
             $com_val[$j] = $ctime;
             $user = new user();
             $tmp = $user->getAllbyUID($CUID);
             $comment[$j] = array("CID" => $CID, "CUID" => $CUID, "RUID" => $RUID, "nickname" => $tmp['nickname'], "content" => $ccontent, "time" => $ctime);
         }
         if ($commentnum > 0) {
             array_multisort($com_val, SORT_DESC, $comment);
         }
         $answer[$i] = array("AID" => $AID, "AUID" => $AUID, "content" => $acontent, "image" => $image, "time" => $atime, "comment" => $comment, "commentnum" => $commentnum, "time" => $atime, "Anickname" => $Anickname, "likeNum" => $likeNum);
     }
     array_multisort($ans_val, SORT_DESC, $answer);
     $iscollect = false;
     //session_start();
     if (isset($_SESSION['user'])) {
         $loginuser = $_SESSION['user'];
     } else {
         $loginuser = array('UID' => -1);
     }
     $UID = $loginuser['UID'];
     $carr = $followq->getQIDsbyUID($UID);
     for ($i = 0; $i < count($carr); $i++) {
         if ($QID == $carr[$i]) {
             $iscollect = true;
             break;
         }
     }
     $question = array("QID" => $QID, "content" => $qcontent, "tag" => $tag, "answernum" => $answernum, "answer" => $answer, "title" => $qtitle, "time" => $qtime, "iscollect" => $iscollect);
     //HotQlist
     $hquestion = $qanswer->getMostAnsweredQID(1, 6);
     for ($i = 0; $i < count($hquestion); $i++) {
         $qq = $qquestion->getAllbyQID($hquestion[$i]);
         $HotQlist[$i]["QID"] = $qq["QID"];
         $HotQlist[$i]["title"] = $qq["qtitle"];
         $HotQlist[$i]["follownum"] = $followq->getFollownumbyQID($qq["QID"]);
         $HotQlist[$i]["answernum"] = $qanswer->getAnswernumbyQID($qq["QID"]);
     }
     //print_r($question["answer"][1]);
     //print_r($question["answer"][1]["comment"]);
     $this->view->hotQlist = $HotQlist;
     $this->view->question = $question;
     $this->view->header = $header;
     $this->render('qdetail');
 }
开发者ID:Zziwei,项目名称:Microknow,代码行数:100,代码来源:IndexController.php

示例2: questionAction

 public function questionAction()
 {
     //封装header
     $auth = Zend_Auth::getinstance();
     #获取当前用户实例
     $UID = $auth->getIdentity();
     #取得当前用户信息
     if ($auth->hasIdentity() == false) {
         $this->render('index');
     }
     $quser = new user();
     $qquestion = new question();
     $qanswer = new answer();
     $qcomment = new comment();
     $user = $quser->getAllbyUID($UID);
     $header = array("UID" => $user["UID"], "image" => $user["image"]);
     $qtag = new tag();
     $tag = $qtag->getAllTags();
     $URL = index / question;
     //
     $QID = $this->getRequest()->getParam("QID");
     $Q = $qquestion->getAllbyQID($QID);
     $content = $Q["Qcontent"];
     $tag = $qtag->getTagbyQID($QID);
     $answernum = $qanswer->getAnswernumbyQID($QID);
     $AIDs = $qanswer->getAIDsbyQID($QID);
     for ($i = 0; $i < $answernum; $i++) {
         //第i个回答
         $AID = $AIDs[$i];
         $AUID = $qanswer->getUIDbyAID($AID);
         $anow = $qanswer->getAllbyAID($AID);
         $content = $anow["Acontent"];
         $unow = $quser->getAllbyUID($AUID);
         $image = $unow["image"];
         $time = $qanswer->getTimebyAID($AID);
         $ans_val[$i] = $time;
         $commentnum = $qcomment->getCommentnumbyAID($AID);
         $CIDs = $qcomment->getCIDsbyAID($AID);
         for ($j = 0; $j < $commentnum; $j++) {
             //第j个评论
             $CID = $CIDs[$j];
             $CUID = $qcomment->getUIDbyCID($CID);
             $RUID = $qcomment->getRIDbyCID($CID);
             $content = $qcomment->getContentbyCID($CID);
             $time = $qcomment->getTimebyCID($CID);
             $com_val[$j] = $time;
             $comment[$j] = array("CID" => $CID, "CUID" => $CUID, "RUID" => $RUID, "content" => $content, "time" => $time);
         }
         array_multisort($com_val, SORT_DESC, $comment);
         $answer[$i] = array("AID" => $AID, "AUID" => $AUID, "content" => $content, "image" => $image, "time" => $time, "commentnum" => $commentnum, "time" => $time);
     }
     array_multisort($ans_val, SORT_DESC, $answer);
     $question = array("QID" => $QID, "content" => $content, "tag" => $tag, "answernum" => $answernum, "answer" => $answer);
 }
开发者ID:Zziwei,项目名称:Microknow,代码行数:54,代码来源:IndexController1.php


注:本文中的comment::getCIDsbyAID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。