当前位置: 首页>>代码示例>>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;未经允许,请勿转载。