www.gusucode.com > HadSky PHP轻论坛系统源码 v2.4.2源码程序 > ytqlt_v2.4.2.0701/phpscript/del.php
<?php if (!defined('puyuetian')) exit('Not Found puyuetian!Please contact QQ632827168'); if ($_G['USER']['ID'] == 2) { header("Location:?c=login"); exit ; } if ($type != 'read' && $type != 'reply') { $_G['HTMLCODE']['TIP'] = 'GET参数错误!'; $_G['HTMLCODE']['OUTPUT'] = template('tip', true); } else { //获取此贴或回复人的id $table = strtoupper($type); $data = $_G['TABLE'][$table] -> getData($id); $uarray = array(); $uarray['id'] = $data['uid']; $postuid = Cnum($data['uid']); if (chkUserQx($_G['USER']['QUANXIAN'], 'admin') || chkUserQx($_G['USER']['QUANXIAN'], 'superman')) { $_G['TABLE'][$table] -> delData($id, 1); $_G['HTMLCODE']['TIP'] = '删除成功!操作人身份:管理员'; $isdel = true; } elseif ($_G['USER']['ID'] == $postuid && chkUserQx($_G['USER']['QUANXIAN'], 'del' . $type)) { $_G['TABLE'][$table] -> delData($id, 1); $_G['HTMLCODE']['TIP'] = '删除成功!操作人身份:用户'; $isdel = true; } else { $_G['HTMLCODE']['TIP'] = '您无权操作!'; $isdel = false; } $_G['HTMLCODE']['OUTPUT'] = template('tip', true); //用户{$_G['SET']['JIFENNAME']}变动 if ($uarray['id'] != 2) { $bdjf = "_G['SET']['POST" . strtoupper($table) . "JIFEN']"; $bdtd = "_G['SET']['POST" . strtoupper($table) . "TIANDOU']"; $_ua = $_G['TABLE']['USER'] -> getData($uarray['id']); $uarray['jifen'] = $_ua['jifen'] - Cnum($$bdjf); $uarray['tiandou'] = $_ua['tiandou'] - Cnum($$bdtd); $_G['TABLE']['USER'] -> newData($uarray); } }