织梦dedecms后台新建 sys_check.php 。

<?php
require_once(dirname(__FILE__).'/config.php');
$row = $dsql->GetOne("SELECT * FROM `dede_sysconfig` WHERE aid='$id'");
$info=$row["info"];
if( $action == 'del' )
{
$id = explode("`", $id);
foreach ($id as $var)
{
$query = "delete from `dede_sysconfig` WHERE `aid` = '$var'";
$dsql->ExecuteNoneQuery($query);
}
ShowMsg("已删除变量 $info ","sys_info.php");
exit();
}
?>
dede/templets/sys_info.htm 替换为一下内容 ,53行至111行, 202行, 224行, 226行, 259行至265行 为新增内容

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "' leftmargin='8' topmargin='8'>
<div style="min-width:780px">
<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D6D6D6" align="center">
<tr>
<td height="28" background="images/tbg.gif" style="padding-left:10px;"><b>DedeCMS系统配置参数:</b></td>
</tr>
<tr>
<td height="24" bgcolor="#ffffff" align="center"><?php
$ds = file(DEDEADMIN.'/inc/configgroup.txt');
$totalGroup = count($ds);
$i = 0;
foreach($ds as $dl)
{
$dl = trim($dl);
if(empty($dl)) continue;
$dls = explode(',',$dl);
$i++;
if($i>1) echo " | <a href='javascript:ShowConfig($i,$totalGroup)'>{$dls[1]}</a> ";
else{
echo " <a href='javascript:ShowConfig($i,$totalGroup)'>{$dls[1]}</a> ";
}
}
?>
| <a href="#" onClick="ShowHide('addvar')">添加新变量</a></td>
</tr>
<tr id="addvar" style="display:none">
<td height="24" bgcolor="#ffffff" align="center"><form name="fadd" action="sys_info.php" method="post">
<input type='hidden' name='dopost' value='add'>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12%" height="26">变量名称:</td>
<td width="38%" align="left"><input name="nvarname" type="text" id="nvarname" class="npvar" style="width:80%" /></td>
<td width="12%" align="center">变量值:</td>
<td width="38%" align="left"><input name="nvarvalue" type="text" id="nvarvalue" class="npvar" style="width:80%" /></td>
</tr>
<tr>
<td width="10%" height="26">变量类型:</td>
<td colspan='3' align="left"><input name="vartype" type="radio"  value="string" class='np' checked='checked' />
文本
<input name="vartype" type="radio"  value="number" class='np' />
数字
<input type="radio" name="vartype" value="bool" class='np' />
布尔(Y/N)
<input type="radio" name="vartype" value="bstring" class='np' />
多行文本 </td>
</tr>
<tr>
<td height="26">参数说明:</td>
<td align="left"><input type="text" name="varmsg"  id="varmsg" class="npvar" style="width:80%" /></td>
<td align="center">所属组:</td>
<td align="left"><?php
echo "<select name='vargroup' class='npvar'>\r\n";
foreach($ds as $dl){
$dl = trim($dl);
if(empty($dl)) continue;
$dls = explode(',',$dl);
echo "<option value='{$dls[0]}'>{$dls[1]}</option>\r\n";
}
echo "</select>\r\n";
?>
<input type="submit" name="Submit" value="保存变量" class="np coolbg" /></td>
</tr>
</table>
</form></td>
</tr>
</table>
<table width="98%" border="0" cellpadding="0" cellspacing="0" style="margin-top:10px" bgcolor="#D6D6D6" align="center">
<tr>
<td height="28" align="right" background="images/tbg.gif" style="border:1px solid #cfcfcf;border-bottom:none;">   配置搜索:
<input type="text" name="keywds" id="keywds" />
<input name="searchBtn" type="button" value="搜索" id="searchBtn" onclick="getSearch()"/>
<span id="_searchback"></span></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" width="100%"><form action="sys_info.php" method="post" name="form1">
<input type="hidden" name="dopost" value="save">
<div id="_search"></div>
<div id="_mainsearch">
<?php
$n = 0;
if(!isset($gp)) $gp = 1;
foreach($ds as $dl)
{
$dl = trim($dl);
if(empty($dl)) continue;
$dls = explode(',',$dl);
$n++;
?>
<table width="100%" style='<?php if($n!=$gp) echo "display:none"; ?>' id="td<?php echo $n?>" border="0" cellspacing="1" cellpadding="1" bgcolor="#cfcfcf">
<tr align="center" bgcolor="#FBFCE2" height="25">
<td width="50">aid</td>
<td width="300">参数说明</td>
<td>参数值</td>
<td width="220">变量名</td>
</tr>
<?php
$dsql->SetQuery("Select * From `dede_sysconfig` where groupid='{$dls[0]}' order by aid asc");
$dsql->Execute();
$i = 1;
while($row = $dsql->GetArray())
{
if($i%2==0)
{
$bgcolor = "#F9FCEF";
}
else
{
$bgcolor = "#ffffff";
}
$i++;
?>
<tr align="center" height="25" bgcolor="<?php echo $bgcolor?>">
<td width="50"><?php if($row['aid'] <= 761){echo "!";}else{echo "<input name='id' type='checkbox' id='id' value='".$row['aid']."' class='np'>";}?></td>
<td width="300"><?php echo $row['info']; ?>: </td>
<td align="left" style="padding:3px;"><?php
if($row['type']=='bool')
{
$c1='';
$c2 = '';
$row['value']=='Y' ? $c1=" checked" : $c2=" checked";
echo "<input type='radio' class='np' name='edit___{$row['varname']}' value='Y'$c1>是 ";
echo "<input type='radio' class='np' name='edit___{$row['varname']}' value='N'$c2>否 ";
}else if($row['type']=='bstring')
{
echo "<textarea name='edit___{$row['varname']}' row='4' id='edit___{$row['varname']}' class='textarea_info' style='width:98%;height:50px'>".htmlspecialchars($row['value'])."</textarea>";
}else if($row['type']=='number')
{
echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value='{$row['value']}' style='width:30%'>";
}else
{
echo "<input type='text' name='edit___{$row['varname']}' id='edit___{$row['varname']}' value=\"".htmlspecialchars($row['value'])."\" style='width:80%'>";
}
?></td>
<td><?php echo $row['varname']?></td>
</tr>
<?php
}


?>
</table>
<?php
}
?>
</div>
<table width="100%" border="0" cellspacing="1" cellpadding="1"  style="border:1px solid #cfcfcf;border-top:none;">
<tr bgcolor="#F9FCEF">
<td height="50" colspan="3">
<table width="98%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="11%"> <a href="javascript:selAll()" class="coolbg">全选</a>
<a href="javascript:noSelAll()" class="coolbg">取消</a>
<a href="#" onClick="del()" class="coolbg">删除</a></td>
</tr>
</table>
<table width="98%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="11%"> </td>
<td width="11%"> </td>
<td width="11%"><input name="imageField" type="image" src="images/button_ok.gif" width="60" height="22" border="0" class="np"></td>
<td width="78%"><img src="images/button_reset.gif" width="60" height="22" style="cursor:pointer" onClick="document.form1.reset()"></td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table>
</div>
</body>
</html>

免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。

发表回复