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


PHP Comment::setTitle方法代码示例

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


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

示例1: DisplayComments

function DisplayComments($input)
{
    global $wgUser, $wgTitle, $wgOut, $wgVoteDirectory;
    $wgOut->addScript("<script type=\"text/javascript\" src=\"extensions/Comments/Comment.js\"></script>\n");
    require_once 'CommentClass.php';
    require_once "{$wgVoteDirectory}/VoteClass.php";
    getValue($scorecard, $input, "Scorecard");
    getValue($allow, $input, "Allow");
    getValue($voting, $input, "Voting");
    getValue($title, $input, "title");
    getValue($userRating, $input, "userrating");
    $Comment = new Comment($wgTitle->mArticleID);
    $Comment->setUser($wgUser->mName, $wgUser->mId);
    $Comment->setAllow($allow);
    $Comment->setVoting($voting);
    $Comment->setTitle($title);
    $Comment->setBool("ShowScorecard", $scorecard);
    $Comment->setBool("ShowUserRating", $userRating);
    if ($_POST['commentid']) {
        $Comment->setCommentID($_POST['commentid']);
        $Comment->delete();
    }
    $output = $Comment->displayOrderForm();
    if ($Comment->ShowScoreCard == 1) {
        $output .= "<div id=\"scorecard\"></div>";
    }
    $output .= "<div id=\"allcomments\">" . $Comment->display() . "</div>";
    $output .= $Comment->diplayForm();
    if ($Comment->ShowScoreCard == 1) {
        $output .= $Comment->displayCommentScorecard($scorecard);
    }
    return $output;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:33,代码来源:Comment.php

示例2: addComment

 /**
  * Adds a new comment to an article
  *     
  * @param int $articleId
  * @param string $commentTitle
  * @param string $commentText
  * @return Comment
  */
 public function addComment($articleId, $commentTitle, $commentText)
 {
     $comment = new Comment();
     $comment->setTitle($commentTitle);
     $comment->setText($commentText);
     $this->entityManager->persist($comment);
     $comment->setArticle($this->find($articleId));
     $this->entityManager->flush();
     return $comment;
 }
开发者ID:rehoutm,项目名称:Zend_Db-vs.-Doctrine-2,代码行数:18,代码来源:ArticleFacade.php

示例3: execute

 /**
  * Save changes to comment.
  * @return int the comment ID
  */
 function execute()
 {
     $journal =& Request::getJournal();
     $enableComments = $journal->getSetting('enableComments');
     $commentDao =& DAORegistry::getDAO('CommentDAO');
     $comment = $this->comment;
     if (!isset($comment)) {
         $comment = new Comment();
     }
     $user =& Request::getUser();
     $comment->setTitle($this->getData('title'));
     $comment->setBody($this->getData('body'));
     if (($enableComments == COMMENTS_ANONYMOUS || $enableComments == COMMENTS_UNAUTHENTICATED) && (Request::getUserVar('anonymous') || $user == null)) {
         $comment->setPosterName($this->getData('posterName'));
         $comment->setPosterEmail($this->getData('posterEmail'));
         $comment->setUser(null);
     } else {
         $comment->setPosterName($user->getFullName());
         $comment->setPosterEmail($user->getEmail());
         $comment->setUser($user);
     }
     $comment->setParentCommentId($this->parentId);
     if (isset($this->comment)) {
         $commentDao->updateComment($comment);
     } else {
         $comment->setSubmissionId($this->articleId);
         $comment->setChildCommentCount(0);
         $commentDao->insertComment($comment);
         $this->commentId = $comment->getId();
     }
     return $this->commentId;
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:36,代码来源:CommentForm.inc.php

示例4: Comment

 /**
  * Creates and returns a submission comment object from a row
  * @param $row array
  * @return Comment object
  */
 function &_returnCommentFromRow($row, $childLevels = 0)
 {
     $userDao =& DAORegistry::getDAO('UserDAO');
     $comment = new Comment();
     $comment->setId($row['comment_id']);
     $comment->setSubmissionId($row['submission_id']);
     $comment->setUser($userDao->getUser($row['user_id']), true);
     $comment->setPosterIP($row['poster_ip']);
     $comment->setPosterName($row['poster_name']);
     $comment->setPosterEmail($row['poster_email']);
     $comment->setTitle($row['title']);
     $comment->setBody($row['body']);
     $comment->setDatePosted($this->datetimeFromDB($row['date_posted']));
     $comment->setDateModified($this->datetimeFromDB($row['date_modified']));
     $comment->setParentCommentId($row['parent_comment_id']);
     $comment->setChildCommentCount($row['num_children']);
     if (!HookRegistry::call('CommentDAO::_returnCommentFromRow', array(&$comment, &$row, &$childLevels))) {
         if ($childLevels > 0) {
             $comment->setChildren($this->getCommentsByParentId($row['comment_id'], $childLevels - 1));
         } else {
             if ($childLevels == SUBMISSION_COMMENT_RECURSE_ALL) {
                 $comment->setChildren($this->getCommentsByParentId($row['comment_id'], SUBMISSION_COMMENT_RECURSE_ALL));
             }
         }
     }
     return $comment;
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:32,代码来源:CommentDAO.inc.php

示例5: handleComment

 protected function handleComment(&$username, &$password, &$articleId, &$title, &$body)
 {
     $userDAO = DAORegistry::getDAO('UserDAO');
     $user = $userDAO->getUserByCredentials($username, $password);
     if ($user == null) {
         return 'ERROR_CREDENTIALS';
     }
     if ($title == null || $title == '' || $body == null || $body == '' || $articleId == null || $articleId == '') {
         return 'ERROR_PARAMS';
     }
     if (DAORegistry::getDAO('PublishedArticleDAO')->getPublishedArticleByArticleId($articleId) == null) {
         return 'ERROR_NO_ARTICLE';
     }
     $commentDao =& DAORegistry::getDAO('CommentDAO');
     $comment = new Comment();
     $comment->setSubmissionId($articleId);
     $comment->setBody($body);
     $comment->setTitle($title);
     $comment->setUser($user);
     $comment->setChildCommentCount(0);
     $comment->setPosterName($user->getFullName());
     $comment->setPosterEmail($user->getEmail());
     $result = $commentDao->insertComment($comment);
     echo (int) $result;
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:25,代码来源:iPhoneGatewayPlugin.inc.php

示例6: execute

 /**
  * Save changes to comment.
  * @return int the comment ID
  */
 function execute()
 {
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     $enableComments = $conference->getSetting('enableComments');
     $commentsRequireRegistration = $conference->getSetting('commentsRequireRegistration');
     $commentsAllowAnonymous = $conference->getSetting('commentsAllowAnonymous');
     $commentDao =& DAORegistry::getDAO('CommentDAO');
     $comment = $this->comment;
     if (!isset($comment)) {
         $comment = new Comment();
     }
     $user =& Request::getUser();
     $comment->setTitle($this->getData('title'));
     $comment->setBody($this->getData('body'));
     if (($commentsAllowAnonymous || !$commentsRequireRegistration) && (Request::getUserVar('anonymous') || $user == null)) {
         $comment->setPosterName($this->getData('posterName'));
         $comment->setPosterEmail($this->getData('posterEmail'));
         $comment->setUser(null);
     } else {
         $comment->setPosterName($user->getFullName());
         $comment->setPosterEmail($user->getEmail());
         $comment->setUser($user);
     }
     $comment->setParentCommentId($this->parentId);
     if (isset($this->comment)) {
         $commentDao->updateComment($comment);
     } else {
         $comment->setPaperId($this->paperId);
         $comment->setChildCommentCount(0);
         $commentDao->insertComment($comment);
         $this->commentId = $comment->getId();
     }
     return $this->commentId;
 }
开发者ID:jalperin,项目名称:ocs,代码行数:39,代码来源:CommentForm.inc.php

示例7: Comment

<?php

include 'control/ArticleControls.php';
include_once 'business/Comment.php';
$comment = new Comment();
$control = new ArticleControls();
$comment->setTitle($_POST['title']);
$comment->setContent($_POST['content']);
$comment->setUser_name($_POST['name']);
$comment->setNews_id($_POST['id']);
$comment->setIp($_POST['ip']);
if ($control->addComment($comment)) {
    header("location:../news.php?art_id=" . $_POST['id']);
} else {
    echo "La requête n'a pu être exécutée";
}
开发者ID:laiello,项目名称:site-web-php,代码行数:16,代码来源:addComment.php


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