本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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";
}