當前位置: 首頁>>代碼示例>>PHP>>正文


PHP comment::insertComment方法代碼示例

本文整理匯總了PHP中comment::insertComment方法的典型用法代碼示例。如果您正苦於以下問題:PHP comment::insertComment方法的具體用法?PHP comment::insertComment怎麽用?PHP comment::insertComment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在comment的用法示例。


在下文中一共展示了comment::insertComment方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: commentAction

 public function commentAction()
 {
     if ($_POST) {
         $content = $_POST['content'];
         $uid = $_POST['UID'];
         $aid = $_POST['AID'];
         $rid = $_POST['RID'];
         $abstract = substr($content, 0, 100);
         $time = date('Y-m-d H:i:s');
         $comment = new comment();
         $comment_arr = array('UID' => $uid, 'RID' => $rid, 'AID' => $aid, 'Time' => $time, 'Ccontent' => $content, 'Cabstract' => $abstract);
         $cid = $comment->insertComment($comment_arr);
         //$this->view->cid = $cid;
         echo $cid;
         //$this->render('commented');
     }
 }
開發者ID:Zziwei,項目名稱:Microknow,代碼行數:17,代碼來源:questionController.php

示例2: sanitize_text

<?php

require "../includes/conf.inc.php";
require "../includes/functions.inc.php";
if (isset($_POST['commentText']) && !empty($_POST['commentText'])) {
    $comment['commentText'] = sanitize_text($_POST['commentText']);
    $comment['userId'] = intval($_POST['userId']);
    $comment['postId'] = intval($_POST['postId']);
    $comment = comment::insertComment($comment);
    if ($comment == false) {
        echo false;
    } else {
        $cmmtDate = ago($comment['commentDate']);
        echo '<li class="comment">
					<div class="commenterProfilePic">
						<img src="' . $website . $comment['profilePicAddr'] . '"/>
					</div>
					<div class="commentDetail">
						<a href="' . $website . 'account/profile/' . $comment['username'] . '" class="commenter">' . $comment['firstName'] . ' ' . $comment['lastName'] . '</a><br />
						<p>' . $comment['commentText'] . '</p>
						<span>' . $cmmtDate . '</span>
					</div>
					<div class="cleaner"></div>
				</li>';
    }
}
開發者ID:amriterry,項目名稱:ptn,代碼行數:26,代碼來源:comment.php

示例3: session_start

<?php 
session_start();
if (isset($_SESSION['user'])) {
    $temp = $_SESSION['user'];
} else {
    header("Location: ../views/signinPage.php?message=" . urlencode("Login again!"));
}
?>

<?php 
if ($_REQUEST['thecomment'] != "") {
    require_once "../models/comment.php";
    $rs = comment::insertComment($_REQUEST['imgId'], $temp['username'], $_REQUEST['thecomment']);
    if ($rs == false) {
        echo "Comment not Added!", PHP_EOL;
    }
}
?>
					
開發者ID:annjanu,項目名稱:PhotoShare,代碼行數:18,代碼來源:addComments.php


注:本文中的comment::insertComment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。