本文整理汇总了PHP中Comment::getComment方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::getComment方法的具体用法?PHP Comment::getComment怎么用?PHP Comment::getComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Comment
的用法示例。
在下文中一共展示了Comment::getComment方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save(Comment $comment)
{
DB::db()->query('INSERT INTO comments (`theme_id`, `date`, `comment`, `author`) VALUES(?, ?, ?, ?)', [$comment->getThemeId(), $comment->getDate(), $comment->getComment(), $comment->getAuthor()]);
}
示例2: getParams
private function getParams(Comment $comment)
{
$params = array(':comment_id' => $comment->getComment_id(), ':comment' => $comment->getComment(), ':user_id' => $comment->getUser_id(), ':item_id' => $comment->getItem_id());
return $params;
}
示例3: Comment
<?php
$model = $_REQUEST['model'];
$action = $_REQUEST['action'];
include_once MODELS_ADMIN . "/" . $model . "_model.php";
switch (strtoupper($action)) {
case 'VIEW':
$objComment = new Comment();
$datum = $objComment->getComment($_REQUEST['id']);
break;
case 'UPDATE':
if (isset($_REQUEST['btn_submit']) && $_REQUEST['btn_submit'] == 'Update') {
$objComment = new Comment();
$objComment->setComment($_REQUEST);
$objComm->redirect('index.php?model=' . $model);
}
break;
default:
$objComment = new Comment();
$data = $objComment->getAllComment();
break;
}
示例4: PorQ
public static function PorQ($id)
{
$QNA = new QNA();
$post = new self();
if (is_object($QNA->get_question($id))) {
return "q";
} elseif (is_array($post->get_post($id, true))) {
return "p";
} elseif (is_array(Comment::getComment($id))) {
return "c";
} else {
return false;
}
}
示例5: renderComment
public static function renderComment($id)
{
$comment = (object) Comment::getComment($id);
ob_start();
?>
<div class="ui minimal comments">
<div class="ui comment padded segment" id="<?php
echo $comment->id;
?>
" comment-id="<?php
echo $comment->id;
?>
">
<div class="content">
<div class="ui grid">
<div class="two wide column cmt_avatar">
<a href="/user/<?php
echo $comment->uid;
?>
/">
<img class="" src="<?php
echo $comment->img_path;
?>
">
</a>
</div>
<div class="fourteen wide column user-details">
<?php
echo Self::user($comment->uid, true, 'author');
?>
<div class="metadata">
<a class="time" href="question.php?id=<?php
echo $comment->id;
?>
">
<span id="commentDate">A few seconds ago</span>
</a>
</div>
<div class="text">
<h4><?php
echo $comment->content;
?>
</h4>
</div>
<div class="comment-points">
<a class="comment-vote-btn">
<i class="thumbs up circular icon"></i>
</a>
<span class="comment-votes-count"></span>
</div>
</div>
</div>
<div title="Actions" class="ui pointing dropdown" id="comment-actions">
<i class="ellipsis link big horizontal icon"></i>
<div class="menu">
<div class="item" id="edit">
<a class="edit">Edit</a>
</div>
<div class="item" id="del">
<a class="delete">Delete</a>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
$comment = ob_get_contents();
ob_end_clean();
return $comment;
}
示例6: die
$post = QNA::get_question($PostID);
if (!is_object($post)) {
die(json_encode(['status' => false, 'id' => $PostID, 'err' => 'Post was not found.']));
}
$report = QNA::report($PostID, $content, $user_id);
if ($report === true) {
die(json_encode(['status' => true, 'id' => $PostID]));
} else {
if ($report[1] == 1062) {
die(json_encode(['status' => false, 'id' => $PostID, 'err' => 1062]));
} else {
die(json_encode(['status' => false, 'id' => $PostID, 'err' => $report[2]]));
}
}
} else {
$comment = Comment::getComment($PostID);
if (!is_array($comment)) {
die(json_encode(['status' => false, 'id' => $PostID, 'err' => 'Comment was not found.']));
}
$report = QNA::report($PostID, $content, $user_id);
if ($report === true) {
die(json_encode(['status' => true, 'id' => $PostID]));
} else {
if ($report[1] == 1062) {
die(json_encode(['status' => false, 'id' => $PostID, 'err' => 1062]));
} else {
die(json_encode(['status' => false, 'id' => $PostID, 'err' => $report[2]]));
}
}
}
break;
示例7: insertion
public function insertion(Comment $uncommentaire)
{
$requete = $this->_db->prepare('insert into commentaire(profile_id,comment,note,article_id,active)values(:profile,:comment ,:note , :produit , :active)');
$requete->execute(array(':profile' => $_SESSION['id'], ':comment' => $uncommentaire->getComment(), ':note' => $uncommentaire->getNote(), ':produit' => $uncommentaire->getArticleid(), ':active' => self::$active));
}
示例8: QNA
$id = $_POST['id'];
Admin::removeReport($id);
echo "1";
exit;
}
$id = $_GET['id'];
$type = Post::PorQ($id);
if (!$type) {
Redirect::redirectTo('404');
}
if ($type == 'q') {
$QNA = new QNA();
$post = $QNA->get_question($id);
$reps = QNA::get_reports($id);
} else {
$post = (object) Comment::getComment($id);
$reps = Comment::get_reports($id);
}
$sec = "staff";
include ROOT_PATH . 'inc/head.php';
?>
<body>
<div class="main" id="admincp">
<div class="ui container section rep_mng">
<?php
if ($type == 'q') {
?>
<div class="question report">
<div class="ui segment">
<div class="ui items">
示例9: sanitize_id
<?php
// The view for the users
$pageTitle = "Stories";
$id = sanitize_id($_GET['id']) ?: null;
$QNA = new QNA();
if (!($q = $QNA->get_question($id))) {
// if the id is not in the questions database, try to find it in the comment database.
if ($q = Comment::getComment($id)) {
$q = $q['post_id'];
if ($q == $id) {
Redirect::redirectTo('404');
}
Redirect::redirectTo(BASE_URL . "questions/question.php?id={$q}#{$id}");
} else {
Redirect::redirectTo('404');
}
}
if ($q->status != 1 && !($session->adminCheck() || $session->userCheck($q->uid))) {
Redirect::redirectTo('404');
}
$user = new User($q->uid);
$user = $user->user;
$self = $q->uid === USER_ID;
$voted = QNA::has_voted($id, USER_ID);
$votes_count = QNA::get_votes($id) ?: "0";
$post_date = $q->created;
$post_modified_date = $q->last_modified;
if ($q->last_modified > $q->created) {
$edited = " (edited <span class='datetime' title=\"{$post_modified_date}\">{$post_modified_date}</span>)";
} else {
示例10: getComment
/**
* Get comment from database
*
* @param int $comment_id
* @return array|false
*/
function getComment($comment_id = 0)
{
require_once LIBS . 'Comment.php';
$comment = new Comment();
return $comment->getComment($this, $comment_id);
}
示例11: view
//.........这里部分代码省略.........
$worklist_id = (int) $_REQUEST['worklist_id'];
$user_id = (int) $_REQUEST['user_id'];
$comment = $_REQUEST['comment'];
$rt = $this->addComment($worklist_id, $user_id, $comment, $parent_comment);
// Send journal notification
if ($workitem->getStatus() != 'Draft') {
$related = $this->getRelated($comment);
$journal_message .= '@' . $_SESSION['nickname'] . ' posted a comment on #' . $worklist_id . $related;
$options = array('type' => 'comment', 'workitem' => $workitem, 'recipients' => array('creator', 'runner', 'mechanic', 'followers'), 'emails' => $rt['correspondent']);
$data = array('who' => $_SESSION['nickname'], 'comment' => $comment, 'related' => $related, 'comment-id' => $rt['id']);
Notification::workitemNotify($options, $data, false);
Notification::workitemNotifyHipchat($options, $data);
// workitem mentions
$matches = array();
if (preg_match_all('/@(\\w+)/', $comment, $matches, PREG_SET_ORDER)) {
foreach ($matches as $mention) {
// validate the username actually exists
if ($recipient = User::find($mention[1])) {
// exclude creator, designer, developer and followers
if ($recipient->getId() != $workitem->getRunnerId() && $recipient->getId() != $workitem->getMechanicId() && $recipient->getId() != $workitem->getCreatorId() && !$workitem->isUserFollowing($recipient->getId())) {
$emailTemplate = 'workitem-mention';
$comment_url = WORKLIST_URL . $workitem->getId() . '#comment-' . $rt['id'];
$data = array('job_id' => $workitem->getId(), 'summary' => $workitem->getSummary(), 'author' => $_SESSION['nickname'], 'text' => $comment, 'link' => '<a href="' . $comment_url . '">See the comment</a>');
$senderEmail = 'Worklist - ' . $_SESSION['nickname'] . ' <contact@worklist.net> ';
Utils::sendTemplateEmail($recipient->getUsername(), $emailTemplate, $data, $senderEmail);
}
}
}
}
}
Utils::systemNotification($journal_message);
$comment = new Comment();
$comment->findCommentById((int) $rt['id']);
$result = array('success' => true, 'id' => $rt['id'], 'comment' => str_replace(array('\\n\\r', '\\r\\n', '\\n', '\\r'), '<br/>', Utils::linkify($comment->getComment())), 'avatar' => $comment->getUser()->getAvatar(), 'nickname' => $comment->getUser()->getNickname(), 'userid' => $comment->getUser()->getId(), 'date' => Utils::relativeTime(strtotime($comment->getDate()) - strtotime(Model::now())));
ob_start();
$json = json_encode($result);
} else {
$json = json_encode(array('success' => false));
}
$this->view = null;
echo $json;
ob_end_flush();
exit;
}
if ($action == 'status-switch') {
$status = $_REQUEST['quick-status'];
$status_error = '';
if ($status == 'Done' && $workitem->getProjectId() == 0) {
$status_error = "No project associated with workitem. Could not set to DONE.";
} else {
if ($this->changeStatus($workitem, $status, $user)) {
if ($workitem->save() == false) {
$status_error = "Error in save workitem process. Could not change the status.";
} else {
if ($status == 'Merged') {
$workitem->addFeesToCompletedJob();
}
if ($status != 'Draft') {
$new_update_message = "Status set to *{$status}*. ";
$notifyEmpty = false;
$status_change = '-' . ucfirst(strtolower($status));
if ($status == 'QA Ready') {
Notification::workitemNotify(array('type' => 'new_qa', 'workitem' => $workitem, 'status_change' => $status_change, 'job_changes' => $job_changes, 'recipients' => array($workitem->getRunnerId(), 'creator', 'mechanic', 'followers')), array('changes' => $new_update_message));
$notifyEmpty = true;
}
if ($status == 'Code Review') {