帝国CMS将TAGS移到基本信息的教程
帝国cms在 新增/编辑 信息时,信息的TAGS属性隐藏于选项卡【选项设置】中,如果将TAGS放到【基本信息】选项卡中,则可以省时省力又方便管理。如图:
1、修改 e/admin/AddNews.php 文件
在此文件中查找 <td height="25" bgcolor="#FFFFFF">TAGS ,在此处上下行代码找到如下代码并删除:
<?php
if(strstr($public_r['usetags'],','.$modid.','))
{
$infotag_readonly='';
$infotag_copykeyboard=' <input type="button" name="Submit3" value="复制关键字" onclick="document.add.infotags.value=document.add.keyboard.value;">';
if(strstr($public_r['chtags'],','.$modid.','))
{
$infotag_readonly=' readonly';
$infotag_copykeyboard='';
}
?>
<tr>
<td height="25" bgcolor="#FFFFFF">TAGS :
<input name="infotags" type="text" id="infotags" value="<?=$r[infotags]?>" size="32"<?=$infotag_readonly?>>
<input type="button" name="Submit" value="选择" onClick="window.open('tags/ChangeTags.php?form=add&field=infotags<?=$ecms_hashur['ehref']?>','','width=700,height=550,scrollbars=yes');">
<?=$infotag_copykeyboard?>
<input name="oldinfotags" type="hidden" id="oldinfotags" value="<?=$r[infotags]?>">
<font color="#333333">(多个用","逗号格开)</font></td>
</tr>
<?php
}
?>
2、修改各数据表的 special.field 字段
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEAF5">
<tr>
<td height="25" bgcolor="#FFFFFF">信息属性:
<input name="checked" type="checkbox" value="1"<?=$r[checked]?' checked':''?>>
审核 推荐
<select name="isgood" id="isgood">
<option value="0">不推荐</option>
<?=$ftnr['igname']?>
</select>
头条
<select name="firsttitle" id="firsttitle">
<option value="0">非头条</option>
<?=$ftnr['ftname']?>
</select></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">关键字 :
<input name="keyboard" type="text" size="52" value="<?=stripSlashes($r[keyboard])?>">
<font color="#666666">(多个请用","隔开)</font></td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">外部链接:
<input name="titleurl" type="text" value="<?=stripSlashes($r[titleurl])?>" size="52">
<font color="#666666">(填写后信息连接地址将为此链接)</font></td>
</tr>
<?php
if (strstr($public_r['usetags'], ',' . $modid . ',')) {
$infotag_readonly = '';
$infotag_copykeyboard = ' <input type="button" name="Submit3" value="复制关键字" onclick="document.add.infotags.value=document.add.keyboard.value;">';
if (strstr($public_r['chtags'], ',' . $modid . ',')) {
$infotag_readonly = ' readonly';
$infotag_copykeyboard = '';
}
?>
<tr>
<td height="25" bgcolor="#FFFFFF">TAG信息:
<input name="infotags" type="text" id="infotags" value="<?=$r[infotags] ?>" size="52"<?=$infotag_readonly ?>>
<input type="button" name="Submit" value="选择" onClick="window.open('tags/ChangeTags.php?form=add&field=infotags<?=$ecms_hashur['ehref'] ?>','','width=700,height=550,scrollbars=yes');">
<?=$infotag_copykeyboard
?>
<input name="oldinfotags" type="hidden" id="oldinfotags" value="<?=$r[infotags] ?>">
<font color="#666666">(多个用","逗号格开)</font></td>
</tr>
<?php
}
?>
</table>
special.field 是系统默认字段,在字段的“输入表单替换html代码”中末尾,找到 </table> ,在其上插入第一步中删除的代码即可。
注意:所有需使用tag功能的数据表都需要做第二步的修改。