/** * 管理评论 */ public function listarticlereply() { $articlereply = new ArticleReplyModel(); // 当前页码 $page = isset($_GET['page']) ? intval($_GET['page']) : 1; // 每页显示数量 $counts = $GLOBALS['config']['admin_goods_pagecount']; //计算分页次数 $pagecount = $articlereply->getAddNum(); // 总记录数 $pages = ceil($pagecount / $counts); // 字符过滤 if (!is_integer($page) || $page < 1 || $page > $pages) { $page = 1; } // 分页显示数据 $tables = $articlereply->getAllLogs($page, $counts); // 分页字符串 $pagestr = Page::setAHtmlPage('index.php', 'index', 'listartice', $pagecount, $counts, $page); include_once VIEW_DIR . '/message_list2.html'; }
/** * 删除评论 */ public function delarticlereply() { // 接收删除ID $bid = intval($_REQUEST['bid']); $articlereply = new ArticleReplyModel(); $talk = $articlereply->getById($bid); if ($talk) { $articlereply->deleteByID($bid); $logs = new LogsModel(); // $logs->insertOne($_SESSION['adminuser']['u_name']."删除评论【".$talk['m_name']."】成功"); $this->success('index.php?c=index&a=listmessage', '删除成功..'); } else { $logs = new LogsModel(); // $logs->insertOne($_SESSION['adminuser']['u_name']."删除评论【".$talk['m_name']."】<font style='color:red'>失败</font>"); $this->error("index.php?c=index&a=listmessage", '删除失败,请联系管理员..'); } }