技术资讯
dede自定义图片上传不支持中文 解决方法
2012-07-22 18:41:42
青岛网站建设和青岛网站制作的时候,大家有时候会用到织梦的后台,但是dede自定义图片上传不支持中文,就是自定义图片浏览上传的时候,如果本地图片名字是中文,那么上传后,中文字符将不能保存,导致图片无法显示,网上大家的说这是dede的一个bug,因此,今天用一个别的办法解决了这个问题,并且用此方法也可以给后台文章添加页增加其他字段,方法如下:
在后台模板增加一个图片上传字段:
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)
好了,大功告成。什么?图片上传后选中,图片选择器窗口不能关闭?用这个办法吧:
![]() |
select_images.rar |
将上面这个文件覆盖这个:include\dialog\select_images.php
近期更新
- [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] 建设一个常规的公司网站建设成本大概是多少?
延伸阅读
- [2015-11-13 12:01:51] 系统化学习SEO技术的方法
- [2014-12-06 01:06:15] 新颖的网站优化原则和方法
- [2008-12-12 22:04:00] 进行Web界面原型设计的一种方法(续)
- [2013-04-24 17:08:23] dede程序模板页面的时间日期始终是1970-01-01的解决办法
- [2014-06-02 13:16:09] IIS下的404页面 提示系统找不到指定的文件 解决办法
- [2014-11-09 20:52:24] 网站关键词暴跌的原因分析与解决办法
- [2017-03-01 16:56:38] 织梦cms中解决DedeTag Engine Create File False的方法
- [2017-01-23 10:30:00] HTML5响应式图片的解决方法
- [2008-12-30 13:40:00] 设计的技术含量
- [2014-11-15 11:17:42] 如何提高网站转换率的设计方法
- [2016-03-17 11:01:56] 分享引导蜘蛛抓取文章的方法,优化SEO网络排名
- [2009-01-07 14:48:00] 用户研究方法——用户测试法

