Exemplo n.º 1
0
if ($content != NULL) {
    $result = Reviews::addReviews($articleId, $face, $content, $userName);
    if ($result > 0) {
        echo "<script type='text/javascript'>";
        echo "\talert('发表评论成功!');";
        echo "\twindow.location='news.php?articleId={$articleId}';";
        echo "</script>";
    } else {
        echo "<script type='text/javascript'>";
        echo "\talert('发表评论失败!');";
        echo "\twindow.location='news.php?articleId={$articleId}';";
        echo "</script>";
    }
}
//获得当前页面显示的新闻
$result3 = NewsArticles::getNewsById($articleId);
//所有分类
$newsTypes = NewsTypes::getNewsTypes();
//获得该新闻的所有评论
$reviews = Reviews::getReviews($articleId);
?>
<html>
  <head>
    <title>天天新闻网</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <link href="css/news.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="kindeditor/kindeditor.js"></script>
	<script type="text/javascript">
	  var editor;//编辑器对象
	  KindEditor.ready(function(e){
		  editor = e.create("[name=content]",{
Exemplo n.º 2
0
include_once 'dbio/NewsTypes.php';
include_once 'dbio/NewsArticles.php';
include_once 'dbio/Reviews.php';
//获得表单提交的数据
$articleId = $_GET["articleId"];
$face = $_POST["face"];
$content = $_POST["content"];
$userName = $_POST["userName"];
//表单提交(发表谰论)
if ($content != NULL) {
    $result = Reviews::addReviews($articleId, $userName, $content, $face);
    header("location:success.php?act=addreviews&rst={$result}&articleId={$articleId}");
}
$reviews = Reviews::getReviews($articleId);
//当前新闻所有评论
$newsInfo = NewsArticles::getNewsById($articleId);
//当前新闻
$newsTypes = NewsTypes::getNewsTypes();
//所有分类
?>
<html>
  <head>
    <title>天天新闻网</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <link href="css/news.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="kindeditor/kindeditor.js"></script>
    <script type="text/javascript">
      var editor;//编辑器对象
      //加载编辑器
      KindEditor.ready(function(e){
          //创建编辑器,返回编辑器对象