DEDECMS模板让模型里的图片字段支持当地上传的方法

时间:2021-10-02 00:31来源:未知作者:未知点击:

导读:
扫描关注公众号
-->DEDE让模型里的图片字段支持当地上传成效
DEDE让模型里的图片字段支持当地上传成效
修改课程
1、打开 dedejsmain.js 找到
function SeePicNew
{
中间代码...
}
把这整个函数改成
function SeePicNew{var formname = formname ? formname : 'save';var picname = picname ? picname : 'picname';var picvalue = picvalue ? picvalue : 'picname';var imgdid = imgdid ? imgdid : 'divpicview';var newobj = null;if return ;vImg = $Obj;picnameObj = document.getElementById;nFrame = $Nav=='IE' ? eval : $Obj;nForm = f.form;if nForm.detachEvent;else nForm.removeEventListener;if var picname = 'litpic';nForm.action = 'archives_do.php?litpic='+picname+'&picname='+picvalue+'&divpicview='+imgdid;nForm.target = frname;nForm.dopost.value = 'uploadLitpic';nForm.submit;picnameObj.value = '';newobj = $Obj;if{newobj = document.createElement;newobj.id = 'uploadwait';newobj.style.position = 'absolute';newobj.className = 'uploadwait';newobj.style.width = 120;newobj.style.height = 20;newobj.style.TOP = hpos;newobj.style.left = 100;newobj.style.display = 'block';document.body.appendChild;newobj.innerHTML = '<img src="images/loadinglit.gif" width="16" height="16" alit="" />上传中...';}newobj.style.display = 'block';nForm.action = acname;nForm.dopost.value = formname;nForm.target = '';}2、打开 dedearchives_do.php 找到else if{

中间代码省略...
}
整个改成
else if{$fname = $_GET['litpic'] ? $_GET['litpic'] : 'litpic';$upfile = AdminUpload;if{$msg = "<script language='javascript'>parent.document.getElementById.style.display = 'none';alert;</script>";}else if{$msg = "<script language='javascript'>parent.document.getElementById.style.display = 'none';alert;</script>";}else if{$msg = "<script language='javascript'>parent.document.getElementById.style.display = 'none';alert;</script>";}else{ if && $cfg_uplitpic_cut=='N') { $msg = "<script language='javascript'>parent.document.getElementById.style.display = 'none';parent.document.getElementById.value = '{$upfile}';if){parent.document.getElementById.style.width = '150px';parent.document.getElementById.innerHTML = "<img src='{$upfile}?n' width='150' />";}</script>"; } else { $msg = "<script language='javascript'>parent.document.getElementById.style.display = 'none';window.open;</script>"; }}echo $msg;exit;}

3、打开 includecustomfields.func.php 找到
$innertext = "<input type='text' name='$fieldname' id='$fieldname' style='width:300px' /> <input name='".$fieldname."_bt' type='button' value='浏览...' onClick="SelectImage" />rn";
改成
$innertext = "<input name='{$fieldname}' type='text' id='{$fieldname}' style='width:300px' value='' /><input type='button' value='
当地上传
' style='width:70px;cursor:pointer;' /><iframe name='upmy{$fieldname}fra' id='upmy{$fieldname}fra' src='' width='200' height='200' style='display:none'></iframe><span><input name='my{$fieldname}' type='file' id='my{$fieldname}' onChange="SeePicNew;" size='1' class='np coolbg' style='cursor:pointer;height:20px;margin-left:-20px;opacity:0;width:85px;'/></span> <input name='".$fieldname."_bt' type='button' value='
浏览
...' onClick="SelectImageN" /> <div id='divmy{$fieldname}view' style='display:inline-block;vertical-align:middle'></div>rn";
继续找到
$innertext = "<input type='text' name='$fieldname' value='$fvalue' id='$fieldname' style='width:300px' class='text' /> <input name='".$fieldname."_bt' type='button' value='浏览...' onClick="SelectImage" />rn";
有2处,都改成
$imgstr = ? '' : "<img src='{$fvalue}' width='150'>";
$innertext = "<input type='text' name='$fieldname' value='$fvalue' id='$fieldname' style='width:300px' class='text' /><input type='button' value='当地上传' style='width:70px;cursor:pointer;' /><iframe name='upmy{$fieldname}fra' id='upmy{$fieldname}fra' src='' width='200' height='200' style='display:none'></iframe><span><input name='my{$fieldname}' type='file' id='my{$fieldname}' onChange="SeePicNew;" size='1' class='np coolbg' style='cursor:pointer;height:20px;margin-left:-20px;opacity:0;width:85px;'/></span> <input name='".$fieldname."_bt' type='button' value='浏览...' onClick="SelectImage" /> <div id='divmy{$fieldname}view' style='display:inline-block;vertical-align:middle'>{$imgstr}</div>rn";
完结。
相关文章
推荐文章

热门标签

织梦技巧 织梦学院

源码之家 - 免费提供最新网站源码下载!

Copyright © 2002-2021 源码之家 (http://www.yxny6.com) 网站地图 TAG标签 备案号:

声明: 本站文章均来自互联网,不代表本站观点 如有异议 请与本站联系 本站为非赢利性网站