* This file was automatically generated By Code Smith * Modifications will be overwritten when code smith is run * * PLEASE DO NOT MAKE MODIFICATIONS TO THIS FILE * Date Created 5/6/2012 * */ /// <summary> /// Implementations of slcommentbads represent a CommentBad /// /// </summary> chdir(".."); /* TODO: Add code here */ require 'config/globalconfig.php'; include_once 'class/model_commentbad.php'; $objCommentBad = new Model_CommentBad($objConnection); if ($_pgR["act"] == model_CommentBad::ACT_ADD) { if (global_common::isCLogin()) { //get user info //$c_userInfo = $_SESSION[consts::SES_C_USERINFO]; //if ($objMenu->getMenuByName($_pgR['name'])) { // echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_NAME_EXIST), array(0,1)); // return; //} $commnentID = $_pgR['CommnentID']; $commnentID = global_editor::rteSafe(html_entity_decode($commnentID, ENT_COMPAT, 'UTF-8')); $description = $_pgR['Description']; $description = global_editor::rteSafe(html_entity_decode($description, ENT_COMPAT, 'UTF-8')); $reportedBy = $_pgR['ReportedBy']; $reportedBy = global_editor::rteSafe(html_entity_decode($reportedBy, ENT_COMPAT, 'UTF-8')); $reportedDate = $_pgR['ReportedDate'];
<?php /* TODO: Add code here */ require 'config/globalconfig.php'; include_once 'class/model_comment.php'; include_once 'class/model_commentbad.php'; include_once 'class/model_articletype.php'; include_once 'class/model_article.php'; include_once 'class/model_user.php'; $objComment = new Model_Comment($objConnection); $objCommentBad = new Model_CommentBad($objConnection); $objUser = new Model_User($objConnection); $objArticle = new Model_Article($objConnection); $objArticleType = new Model_ArticleType($objConnection); if ($_pgR["act"] == model_Article::ACT_ADD || $_pgR["act"] == model_Article::ACT_UPDATE) { if (global_common::isCLogin()) { //get user info $c_userInfo = $_SESSION[global_common::SES_C_USERINFO]; $articleid = $_pgR[global_mapping::ArticleID]; $content = html_entity_decode($_pgR[global_mapping::Content], ENT_COMPAT, 'UTF-8'); $createdby = $c_userInfo[global_mapping::UserID]; $status = 1; if ($_pgR["act"] == Model_Comment::ACT_ADD) { $createdBy = $c_userInfo[global_mapping::UserID]; $resultID = $objComment->insert($articleid, $content, $createdby, $status); //echo global_common::convertToXML($arrHeader, array("rs","info"), array(0,$resultID), array(0,1)); //return; if ($resultID) { $commentHTML = $objComment->getCommentHTMLByArticle($articleid); $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode
public function getCommentBadInfo($arrCommentID, $objConnection) { //print_r($arrUserID); $objCommentBad = new Model_CommentBad($objConnection); $arrID = global_common::splitString($arrCommentID); $strQueryIN = global_common::convertToQueryIN($arrID); $whereClause = global_mapping::CommentID . ' IN (' . $strQueryIN . ')'; $arrCommentBad = $objCommentBad->getAllCommentBad(0, '*', $whereClause); //print_r($arrUserInfo); foreach ($arrCommentBad as $key => $info) { $arrCommentBad[$info[global_mapping::CommentID]] = $info; unset($arrCommentBad[$key]); } return $arrCommentBad; }