帝国cms后台实现刷新多栏目内容页

以下代码适用于帝国CMS6.6版,7.0版不同处在代码注释处已标明。
帝国cms后台 刷新内容页面功能 默认只能刷新所有或者单个栏目下的所有内容页面,但有时实际需要刷新多个栏目下的页面

找到e/admin/ChangeData.php文件

原先的栏目是单选菜单

<select name="classid" id="classid">
<option value="0">所有栏目</option>
<?=$class?>
</select>

改为:

<select name="classid[]" size="12" multiple id="classid[]" style="width:310px">
<option value="0">所有栏目</option>
<?=$class?>
</select>

并且改进了e/admin/DoRehtml.php的代码如下:

<?php
define('EmpireCMSAdmin', '1');
require ("../../class/connect.php");
require ("../../class/db_sql.php");
require ("../../class/functions.php");
$link = db_connect();
$empire = new mysqlquery();
$editor = 1;
//验证用户
$lur = is_login();
$logininid = $lur['userid'];
$loginin = $lur['username'];
$loginrnd = $lur['rnd'];
$loginlevel = $lur['groupid'];
$loginadminstyleid = $lur['adminstyleid'];
$add = $_GET;
$havehtml = (int)$add['havehtml'];
$tbname = $add['tbname'];
$count = count($tbname);

// 附加程序开始
if (!is_array($add['classid'])) { //传递非数组值时,在栏目里点击"信息"操作时使用
    $add['classid'] = array( $add['classid'] );
}
if ($add['classid'][0] == 0) {
    $add['classid'] = array(0);
}
$count1 = count($add['classid']);
for ($m = 0; $m < $count1; $m++) {
    $classid = $add[classid][$m];
// 附加程序结束
    
    //刷新所有表
    if (!$count) {
        $j = 0;
        $tsql = $empire->query("select tbname from {$dbtbpre}enewstable order by tid");  // 帝国cms7.0版 这里有个条件为:where intb=0
        while ($tr = $empire->fetch($tsql)) {
            $tbname[$j] = $tr[tbname];
            $j++;
        }
        $count = count($tbname);
    }
    esetcookie("retablenum", $count, 0, 1);
    esetcookie("rechecktablenum", 0, 0, 1);
    $url = "../ecmschtml.php?enews=ReNewsHtml&classid=$classid&from=$add[from]&retype=$add[retype]&startday=$add[startday]&endday=$add[endday]&startid=$add[startid]&endid=$add[endid]&havehtml=$havehtml&reallinfotime=" . time();
    echo "<link href='../adminstyle/" . $loginadminstyleid . "/adminstyle.css' rel='stylesheet' type='text/css'><br><center>栏目id=$classid 要刷新的表的总个数为:<font color=red>$count</font>个</center><br>";
    for ($i = 0; $i < $count; $i++) {
        $trueurl = $url . "&tbname=" . $tbname[$i];
        echo "<table width='100%' border=0 align=center cellpadding=3 cellspacing=1 class=tableborder><tr class=header><td>刷新数据表:" . $tbname[$i] . "</td></tr><tr><td bgcolor='#ffffff'><iframe frameborder=0 height=35 id='" . $tbname[$i] . "' scrolling=no  src=\"" . $trueurl . "\" width=\"100%\"></iframe></td></tr></table>";
    }
}
db_close();
$empire = null;
?>

<iframe frameborder=0 height=35 id="checkrehtml" scrolling=no src="CheckRehtml.php?first=1&from=<?php echo $add[from] ?>" width="100%"></iframe>

转载于:https://www.cnblogs.com/feixuejianxin/archive/2013/06/06/3120620.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值