技术资讯
dede后台文章添加页手动增加字段
2012-08-21 23:19:29
dede除了通过后台内容模型增加自定义字段外,还可以根据需要,对文章添加页进行字段的添加,这样的最大好处就是能够自由编辑文章添加页的版式,因为dede自带的那个模型添加字段只能往下罗列累加,导致dede文章添加页巨长,可以在青岛网站建设中使用,例图:
方法如下:
如何在后台模板增加一个图片上传字段:
1、在dede/templets/archives_add.htm,增加修改字段代码:
图片:<input type='text' name='pica3' id='pica3' style='width:300px' class='text' /> <input name='pica3_bt' type='button' class='inputbut' value='浏览...' onClick="SelectImage('form1.pica3','big')" />
2、在dede/archives_add.php增加字段的代码pica3:
//保存到主表
$query = "INSERT INTO `dede_archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,pica3,
color,writer,source,litpic,pubdate,senddate,mid,notpost,description,keywords,filename,dutyadmin,weight)
VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money','$title','$shorttitle','$pica3',
3、在dede/templets/archives_edit.htm,增加修改字段代码pica3,:
图片:<input type='text' name='pica3' id='pica3' style='width:300px' class='text' value="<?php echo $arcRow["pica3"]?>" /> <input name='pica3_bt' type='button' class='inputbut' value='浏览...' onClick="SelectImage('form1.pica3','big')" />
4、在dede/archives_edit.php增加字段的代码pica3,:
//对保存的内容进行处理
$pubdate = GetMkTime($pubdate);
$sortrank = AddDay($pubdate,$sortup);
$ismake = $ishtml==0 ? -1 : 0;
$title = cn_substrR($title,$cfg_title_maxlen);
$shorttitle = cn_substrR($shorttitle,36);
$pica3 = cn_substrR($pica3,250);
$color = cn_substrR($color,7);
$writer = cn_substrR($writer,20);
$source = cn_substrR($source,30);
$description = cn_substrR($description,$cfg_auot_description);
$keywords = trim(cn_substrR($keywords,60));
$filename = trim(cn_substrR($filename,40));
$isremote = (empty($isremote)? 0 : $isremote);
$serviterm=empty($serviterm)? "" : $serviterm;
if(!TestPurview('a_Check,a_AccCheck,a_MyCheck'))
5、在数据库添加对应字段pica3,:
dede_archives增加一个字段pica3 varchar(250)
6、其他注意事项:
如果添加图片时候,选中,图片选择器窗口不能自动关闭,就用该文件替换:
http://www.leadto.com.cn/uploads/allimg/120823/select_images.rar
近期更新
- [2023-07-26 14:17:28] 为品牌赋能,海外官网品牌数字化
- [2023-05-06 10:32:26] 青岛网站建设公司,品牌网站定制,一站式网站服务——力图数字科技
- [2023-04-27 13:47:54] 品牌定制网站建设——从满足预期到走向超预期
- [2023-04-11 09:17:49] H5页面设计开发——移动端传播利器
- [2022-11-16 10:11:43] windows2012程序在哪
- [2022-04-14 11:01:47] 力图数字科技配套网站服务支持
- [2021-05-18 10:14:11] 青岛网站建设的流程
- [2021-04-29 10:14:38] 企业定制化官网建设项目
- [2021-03-05 10:34:45] 移动互联时代房地产行业的微信小程序解决方案
- [2021-01-22 17:29:38] 微信小程序有哪些优势?为什么要开发微信小程序?
- [2021-01-08 17:28:04] 网站建设最容易忽略的人性化设计
- [2020-12-16 16:55:32] 建设一个常规的公司网站建设成本大概是多少?
延伸阅读
- [2012-05-28 23:30:48] 网页设计的原则
- [2011-11-15 00:12:46] 如何使蜘蛛逆向爬行索引
- [2015-02-11 14:25:24] 必学四点让你的网页设计精彩起来
- [2015-01-01 21:12:41] 如今虚拟外链对我们的作用有多大?
- [2016-02-29 13:33:31] 织梦读取服务器年份日期
- [2014-01-03 10:08:13] 青岛网站建设布局对网站优化的影响与分析
- [2012-03-03 15:58:05] DEDE栏目名称长度 修改
- [2015-04-08 22:16:46] 如何定时任务备份mysql多个数据库
- [2015-03-20 09:07:39] 网站被降权后的表现及处理方案?
- [2011-10-24 11:57:02] 为什么要将网站地图链接放在robots.txt?
- [2016-09-16 15:21:00] 网页设计流行趋势解读
- [2012-12-05 12:16:06] 网站建设功能上的简单与复杂

