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


PHP Comment::getComment方法代码示例

本文整理汇总了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()]);
 }
开发者ID:sedvis,项目名称:mysql-nd,代码行数:4,代码来源:CommentRep.php

示例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;
 }
开发者ID:Wooddu,项目名称:MMNZ,代码行数:5,代码来源:commentDao.php

示例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;
}
开发者ID:business-expert,项目名称:prnsc,代码行数:22,代码来源:comment.php

示例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;
     }
 }
开发者ID:khaledkhalil94,项目名称:SH.A,代码行数:14,代码来源:Post.php

示例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;
    }
开发者ID:khaledkhalil94,项目名称:SH.A,代码行数:72,代码来源:View.php

示例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;
开发者ID:khaledkhalil94,项目名称:SH.A,代码行数:31,代码来源:_comment.php

示例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));
 }
开发者ID:FMagnoux,项目名称:Catalogue,代码行数:5,代码来源:CommentManager.php

示例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">
开发者ID:khaledkhalil94,项目名称:SH.A,代码行数:31,代码来源:report.php

示例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 {
开发者ID:khaledkhalil94,项目名称:SH.A,代码行数:31,代码来源:question_user.php

示例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);
 }
开发者ID:shibuya246,项目名称:Hotaru-Plugins,代码行数:12,代码来源:Hotaru.php

示例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') {
开发者ID:MaitreyaBuddha,项目名称:worklist,代码行数:67,代码来源:Job.php


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