打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
添加副标题字段_添加新字段_织梦文章管理系统
1、在内容模型管理-》普通文章  里添加一个字段
副标题=====subheading==== 已经固化在发布表单中字段=====不需要分页符======单行文本
 

2、在/后台目录/templets/article_add.htm里的标题字段下面(约219行)添加如下代码:




<tr>
<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:3px;">
<tr>
<td width="90" class="bline" height='24'> 副 标 题:</td>
<td class="bline"><input type='text' name='subheading' id='subheading' style='width:388px' class='intxt' value='' /></td>
</tr>
</table><input type='hidden' name='dede_addonfields' value="subheading,text">
</td>
</tr>

 
同理在/后台目录/templets/article_edit.htm添加该字段(约218行)


<tr>
<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:3px;">
<tr>
<td width="90" class="bline" height='24'> 副 标 题:</td>
<td class="bline"><input type='text' name='subheading' id='subheading' style='width:388px' class='intxt' value='<?php echo $addRow['subheading']; ?>' /></td>
</tr>
</table><input type='hidden' name='dede_addonfields' value="subheading,text">
</td>
</tr>


3、在/后台目录/article_add.php和article_edit.php中修改如下代码,否则会保存不到数据库
注:只添加,有背景色的字段。
1)article_add.php中216行

$useip = GetIP();
$templet = empty($templet) ? '' : $templet;
$query = "INSERT INTO `{$addtable}`(aid,typeid,redirecturl,templet,userip,subheading,body{$inadd_f}) Values('$arcID','$typeid','$redirecturl','$templet','$useip','$subheading','$body'{$inadd_v})";
if(!$dsql->ExecuteNoneQuery($query))


2)article_edit.php中217行

if($addtable!='')
{
$useip = GetIP();
$templet = empty($templet) ? '' : $templet;
$iquery = "UPDATE `$addtable` SET typeid='$typeid',body='$body'{$inadd_f},subheading='$subheading',redirecturl='$redirecturl',templet='$templet',userip='$useip' WHERE aid='$id'";
if(!$dsql->ExecuteNoneQuery($iquery))
{
ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!","javascript:;");
exit();
}
}



3、在article_article.htm和article_default.htm两个前台模板文件中前台添加显示代码:

{dede:field.subheading/}





附加:
如果是系统自动生成表单字段,可在include/customfields.func.php里127行修改添加字段的样式

else
{
$dfvalue = ($ctag->GetAtt('default')!='' ? $ctag->GetAtt('default') : '');
$innertext = "<input type='text' name='$fieldname' id='$fieldname' style='width:388px' class='intxt' value='$dfvalue' />\r\n";
}
$formitem = str_replace("~name~",$ctag->GetAtt('itemname'),$formitem);
$formitem = str_replace("~form~",$innertext,$formitem);
return $formitem;




本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
织梦文件夹详解
如何用DEDECMS建站的详细新手指南 - 站长网 admin5.com
dedecms主要目录结构
php基础范例
织梦dedecms批量替换所有文章来源和作者的方法
装修网址大全,素材网址大全
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服