Ejemplo n.º 1
0
    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>";
    }
}
$newsTypes = NewsTypes::getNewsTypes();
//所有分类
$newsInfo = NewsArticles::getNewsById($articleId);
//当前新闻
$reviews = Reviews::getReviews($articleId);
//当前新闻的所有评论
NewsArticles::addClick($articleId);
//点击量加一
$smarty->assign("reviews", $reviews);
$smarty->assign("newsInfo", $newsInfo);
$smarty->assign("newsTypes", $newsTypes);
$smarty->display("news.html");
?>