DzzOffice 添加评论管理

1.登录系统后台》应用市场》评论》编辑

2.在权限管理中修改下图参数

3.创建文件dzz\comment\index.php
<?php
/*
 * @copyright   Leyun internet Technology(Shanghai)Co.,Ltd
 * @license     http://www.dzzoffice.com/licenses/license.txt
 * @package     DzzOffice
 * @link        http://www.dzzoffice.com
 * @author      zyx(zyx@dzz.cc)
 */
if (!defined('IN_DZZ')) {
    exit('Access Denied');
}
$uid=$_G['uid'];
$navtitle='评论管理';
Hook::listen('check_login');
//获取通知包含类型
$searchappid = array();
foreach(DB::fetch_all("select distinct(module) from %t where authorid = %d",array('comment',$_G['uid'])) as $v){
    $searchappid[] = $v['module'];
}
$searchcats = array();
if($searchappid){
    foreach(DB::fetch_all("select appname,identifier,appico from %t where identifier in(%n)",array('app_market',$searchappid)) as $v){
        $searchcats[] = array('identifier'=>$v['identifier'],'appname'=>$v['appname'],'appico'=>$_G['setting']['attachurl'].$v['appico']);
    }
}
if ($_GET['do'] == 'delete') {
    $icoid = isset($_GET['cid']) ? trim($_GET['cid']) : '';
    $icoids = explode(',', $icoid);
    foreach ($icoids as $icoid) {
        $return = C::t('comment') -> delete_by_cid($icoid);
    }

}else {
  $perpage = 20;
  $type = isset($_GET['type']) ? trim($_GET['type']) : '';
  $keyword = isset($_GET['keyword']) ? trim($_GET['keyword']) : '';
  $page = (isset($_GET['page'])) ? intval($_GET['page']) : 1;
  $start = ($page - 1) * $perpage;
  $gets = array(
    'mod' => 'comment',
    'keyword' => $keyword,
        'dateline' => $_GET['dateline'],
    'type' => $_GET['type']
  );
  $theurl = BASESCRIPT . "?" . url_implode($gets);
  $refer = $theurl . '&page=' . $page;
    if ($_GET['dateline'] == 'desc') {
    $order = 'ORDER BY dateline DESC';
    }else {
        $_GET['dateline'] = 'asc';
        $order = 'ORDER BY dateline ASC';
    }
  $sql = "cid!='app'";
  $foldername = array();
  $param = array();
  if ($keyword) {
    $sql .= 'and (message LIKE %s or author LIKE %s)';
    $param[] = '%' . $keyword . '%';
    $param[] = $keyword;
  }
  if ($type) {
    $sql .= ' and module=%s';
    $param[] = $type;
    if($type){
    $appidxu=C::t('app_market')->fetch_by_identifier($type);
    $navtitle=$appidxu['appname'].' - '.$navtitle;
    }
  }
  $limitsql = 'limit ' . $start . ',' . $perpage;
  if ($_G['adminid']) {
    if ($count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('comment') . " WHERE $sql", $param)) {
      $data = DB::fetch_all("SELECT * FROM " . DB::table('comment') . " WHERE $sql $order $limitsql", $param);
    }
  }else{
    if ($count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('comment') . " WHERE authorid =$uid and $sql", $param)) {
      $data = DB::fetch_all("SELECT * FROM " . DB::table('comment') . " WHERE authorid =$uid and $sql $order $limitsql", $param);
    }
  }
  $multi = multi($count, $perpage, $page, $theurl);
  $list = array();
  foreach ($data as $value) {
      $list[] = $value;
    }
    include template('list');
}
?>
4.创建dzz\comment\template\list.htm
<!--{template common/header_simple_start}-->
<link rel="stylesheet" href="static/css/checkbox.css">
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all"> 
<link href="{MOD_PATH}/images/folder.css?{VERHASH}" rel="stylesheet" media="all">
<link href="{MOD_PATH}/images/comment.css?Xqd" rel="stylesheet" media="all">
<link href="static/dzzthumb/jquery.dzzthumb.css?{VERHASH}" rel="stylesheet" media="all">
<link href="dzz/styles/icoblock/default/style.css?{VERHASH}" rel="stylesheet" media="all">
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
<script type="text/javascript" src="static/dzzthumb/jquery.dzzthumb.js?{VERHASH}"></script>
<style type="text/css">
@media (max-width: 670px) {
    html,body{
    min-width: 670px;
  overflow-x: auto;
}
}
#orgid__Menu{
    border: 1px solid #4c89fb;
    background: #fff;
    border-radius: 2px;
    color: #4c89fb;
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: normal;
}
.module-list-view .item-block.item{
    border-bottom:1px solid #eee; 
}
.module-list-view .item-block{
    background:none;
}
.module-list-view .item-block .col{
    color:#333;
}
#filem_search .iconFirstWord{
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    line-height: 16px;
    font-size: 14px;
    margin-left: 0;
}
</style>
<!--{template common/header_simple_end}-->
<!--{template common/commer_header}-->
<div class
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小胡2024

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值