Files
web-discuz/source/plugin/replyfloor/admin/admin_report.php
2025-06-27 21:04:18 +08:00

151 lines
8.6 KiB
PHP

<?php
/**
* This is NOT a freeware, use is subject to license terms
* 应用名称: 贴吧楼中楼回复 9.0
* 下载地址: https://addon.dismall.com/plugins/replyfloor.html
* 应用开发者: 乘凉
* 开发者QQ: 594433766
* 更新日期: 202505310549
* 授权域名: www.shitangsweet.com
* 授权码: 2025053105b89RrI3R9n
* 未经应用程序开发者/所有者的书面许可,不得进行反向工程、反向汇编、反向编译等,不得擅自复制、修改、链接、转载、汇编、发表、出版、发展与之有关的衍生产品、作品等
*/
/**
* $author: 乘凉 $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
$op = in_array($_GET['op'], array('index','status')) ? $_GET['op'] : 'index';
if($op == 'index') {
if(!submitcheck('submit')) {
$intkeys = array('msgid');
$strkeys = array();
$randkeys = array();
$likekeys = array('username');
$results = getwheres($intkeys, $strkeys, $randkeys, $likekeys);
foreach($likekeys as $k) {
$_GET[$k] = dhtmlspecialchars($_GET[$k]);
}
$wherearr = $results['wherearr'];
$mpurl = ADMINSCRIPT."?action=$pluginurl&".implode('&', $results['urls']);
$adminscript = ADMINSCRIPT;
$searchtid = lang('plugin/'.$plugin['identifier'], 'report_tid');
echo <<<SEARCH
<form method="get" autocomplete="off" action="$adminscript" id="tb_search">
<div style="margin-top:8px;">
<table cellspacing="3" cellpadding="3">
<tr>
<th>$lang[username]</th><td><input type="text" class="txt" name="username" value="$_GET[username]"></td>
<td>
<input type="hidden" name="action" value="plugins">
<input type="hidden" name="operation" value="config">
<input type="hidden" name="do" value="$pluginid">
<input type="hidden" name="identifier" value="$plugin[identifier]">
<input type="hidden" name="pmod" value="$_GET[pmod]">
<input type="hidden" name="act" value="$act">
<input type="hidden" name="op" value="$op">
<input type="submit" name="searchsubmit" value="$lang[search]" class="btn" id="submit_searchsubmit">
</td>
</tr>
</table>
</div>
</form>
<script type="text/JavaScript">_attachEvent(document.documentElement, 'keydown', function (e) { entersubmit(e, 'searchsubmit'); });</script>
<style>
.replyfloor_content_text {word-break:break-all;}
.replyfloor_content_text img {height: 20px;}
.replyfloor_content_image {overflow: hidden;}
.replyfloor_content_image_li {float:left;width: 80px;height: 80px;margin:5px 5px 0 0;}
.replyfloor_content_image_li img {width: 80px;height: 80px;object-fit:cover;}
.replyfloor_report_text {word-break:break-all;}
.replyfloor_report_image {overflow: hidden;}
.replyfloor_report_image_li {float:left;width: 80px;height: 80px;margin:5px 5px 0 0;}
.replyfloor_report_image_li img {width: 80px;height: 80px;object-fit:cover;}
</style>
SEARCH;
$perpage = 30;
$start = ($page-1)*$perpage;
showformheader($pluginurl);
showtableheader(lang('plugin/'.$plugin['identifier'], 'report_list'));
showsubtitle(array('del', 'uid', 'username', lang('plugin/'.$plugin['identifier'], 'report_reply'), lang('plugin/'.$plugin['identifier'], 'report_message'), 'ip', lang('plugin/'.$plugin['identifier'], 'report_createtime'), lang('plugin/'.$plugin['identifier'], 'report_status'), 'operation'));
//$wheresql = !empty($wherearr) && is_array($wherearr) ? ' WHERE '.implode(' AND ', $wherearr) : '';
//$count = DB::result_first("SELECT COUNT(*) FROM %t v inner join %t t on v.`tid`= t.`tid` $wheresql", array('plugin_replyfloor_report', 'forum_thread'));
//$list = DB::fetch_all("SELECT v.* FROM %t v inner join %t t on v.`tid`= t.`tid` $wheresql order by v.createtime desc ".DB::limit($start, $perpage), array('plugin_replyfloor_report', 'forum_thread'));
$count = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_report')->count_by_search_where($wherearr);
$list = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_report')->fetch_all_by_search_where($wherearr,'order by createtime desc', $start, $perpage);
$sortoptionarray = array();
foreach ($list as $value) {
$reply = C::t('#'.$plugin['identifier'].'#'.$plugin['identifier'].'_message')->fetch_by_id($value['msgid']);
if($reply){
$reply['message'] = replyfloor_discuzcode($reply['message']);
if($setconfig['show_br']) {
$reply['message'] = nl2br($reply['message']);
}
}
$attachhtml = '';
if($reply['attachment']) {
$attachhtml = '<div class="replyfloor_content_image">';
$attachlist = explode("\t", $reply['attachment']);
foreach ($attachlist as $attach) {
$attachhtml .= '<div class="replyfloor_content_image_li"><a href="'.$attach.'" target="_blank"><img src="'.$attach.'" border="0" alt="" /></a></div>';
}
$attachhtml .= '</div>';
}
$value['images'] = $value['images'] ? unserialize($value['images']) : array();
$images = '';
if($value['images']) {
$images = '<div class="replyfloor_report_image">';
foreach ($value['images'] as $val) {
$imageurl = $_G['setting']['attachurl'].$plugin['identifier'].'/'.$val['image'].'?'.random(6);
$images .= '<div class="replyfloor_report_image_li"><a href="'.$imageurl.'" title="'.$val['name'].'" target="_blank"><img src="'.$imageurl.'" border="0" alt="" /></a></div>';
}
$images .= '</div>';
}
$value['createtime'] = dgmdate($value['createtime'], 'Y-n-j H:i');
showtablerow('', array('class="td25"', 'class="td32"', 'class="td24"', '', '', 'class="td24"', 'class="td24"', 'class="td25"', 'class="td24"'), array(
"<input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"$value[id]\">",
$value['uid'],
$value['username'],
$reply ? '<div class="replyfloor_content_text">'.$reply['message'].'</div>'.($attachhtml ? $attachhtml : '') : '/',
'<div class="replyfloor_report_text">'.$value['message'].'</div>'.($images ? $images : ''),
$value['postip'],
$value['createtime'],
"<a href=\"".ADMINSCRIPT.'?action='.$pluginurl."&op=status&id=$value[id]\" id=\"status_$value[id]\" onclick=\"ajaxget(this.href,'status_$value[id]');return false;\">".($value['status'] ? "" : "<font color='red'>").lang('plugin/'.$plugin['identifier'], 'report_status_'.$value['status']).($value['status'] ? "" : "</font>")."</a>",
$reply ? "<a href=\"".ADMINSCRIPT.'?action=plugins&operation=config&do='.$pluginid.'&identifier='.$plugin['identifier']."&pmod=admin&act=".($reply['status'] == 0 ? "message" : "recycle")."&id=$reply[id]\">".lang('plugin/'.$plugin['identifier'], 'report_reply_manage')."</a>" : ""
));
}
$multipage = multi($count, $perpage, $page, $mpurl);
showsubmit('submit', 'submit', 'select_all', '', $multipage, false);
showtablefooter();
showformfooter();
} else {
if(is_array($_GET['delete'])) {
replyfloor_deletereport($_GET['delete']);
}
cpmsg(lang('plugin/'.$plugin['identifier'], 'report_updatesucceed'), "action=$pluginurl", 'succeed');
}
} elseif($_GET['op'] == 'status') {
$report = C::t('#'.$plugin['identifier'].'#replyfloor_report')->fetch_by_id($_GET['id']);
if(!$report) {
cpmsg(lang('plugin/'.$plugin['identifier'], 'report_nonexistence'), '', 'error');
}
$report['status'] = $report['status'] ? 0 : 1;
C::t('#'.$plugin['identifier'].'#replyfloor_report')->update_by_id($_GET['id'], array('status' => $report['status']));
ajaxshowheader();
echo ($report['status'] ? "" : "<font color='red'>").lang('plugin/'.$plugin['identifier'], 'report_status_'.$report['status']).($report['status'] ? "" : "</font>");
ajaxshowfooter();
//cpmsg(lang('plugin/'.$plugin['identifier'], 'report_updatesucceed'), 'action=plugins&operation=config&do='.$pluginid.'&identifier='.$plugin['identifier'].'&pmod=report', 'succeed');
}
?>