在自定义页面录入页面上增加了一个字段,其中最重要的是那个图片上传功能即它:
&infoid==$id?>&filepass==$filepass?>&sinfo=1&doing=1&field=titlepic=$ecms_hashur[ehref]?>','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片">
下面是完整的代码
<td style="max-width:90%">自定义图片</td> <td height="25"><input name="conpic" type="text" id="conpic" value="<?=ehtmlspecialchars(stripSlashes($r[conpic]))?>" size="42"><a onclick="window.open('ecmseditor/FileMain.php?type=1&classid=<?=$classid?>&infoid=<?=$id?>&filepass=<?=$filepass?>&sinfo=1&doing=1&field=titlepic<?=$ecms_hashur[ehref]?>','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片"><img src="../data/images/changeimg.gif" border="0" align="absbottom" alt="帝国cms自定义页面上传图片功能如何修改" ></a></td>
window.open(' ecmseditor/.....
字母开头,打开的是相对路径,也就是接在你当前页面url后面
改成绝对路径即可
window.open(' ecmseditor/.....
字母开头,打开的是相对路径,也就是接在你当前页面url后面
改成绝对路径即可
看来是对下面这个文件的修改,不知如何改呢
<?phpdefine('EmpireCMSAdmin','1');require("../../class/connect.php");require("../../class/db_sql.php");require("../../class/functions.php");$link=db_connect();$empire=new mysqlquery();$editor=1;//验证$lur=is_login();$logininid=$lur['userid'];$loginin=$lur['username'];$loginrnd=$lur['rnd'];$loginlevel=$lur['groupid'];$loginadminstyleid=$lur['adminstyleid'];//ehash$ecms_hashur=hReturnEcmsHashStrAll();$showmod=(int)$_GET['showmod'];$type=(int)$_GET['type'];$classid=(int)$_GET['classid'];$infoid=(int)$_GET['infoid'];$filepass=(int)$_GET['filepass'];$modtype=(int)$_GET['modtype'];$sinfo=(int)$_GET['sinfo'];$doing=ehtmlspecialchars($_GET['doing']);$field=ehtmlspecialchars($_GET['field']);$tranfrom=ehtmlspecialchars($_GET['tranfrom']);$fileno=ehtmlspecialchars($_GET['fileno']);if(empty($field)){ $field="ecms";}$search="&classid=$classid&infoid=$infoid&filepass=$filepass&type=$type&modtype=$modtype&sinfo=$sinfo&doing=$doing&tranfrom=$tranfrom&field=$field&fileno=$fileno".$ecms_hashur['ehref'];$search1="&classid=$classid&infoid=$infoid&filepass=$filepass&modtype=$modtype&sinfo=$sinfo&doing=$doing&tranfrom=$tranfrom&field=$field&fileno=$fileno".$ecms_hashur['ehref'];if($showmod==1){ $filename="filep.php";}else{ $filename="file.php";}$editor=1;//风格$loginadminstyleid=(int)getcvar('loginadminstyleid',1);?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css"><title>选择文件</title><script>function ChangeShowMod(obj){ var furl,searchstr,dotype; searchstr="<?=$search1?>"; dotype=obj.type.value; if(obj.showmod.value==1) { furl="filep.php?"+searchstr+"&type="+dotype; } else { furl="file.php?"+searchstr+"&type="+dotype; } elfile.location=furl;}</script></head><body leftmargin="0" topmargin="0"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%" class="tableborder"> <tr class="header"> <td height="27"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <form name="FileMainNav" method="get" action=""> <tr> <td height="25">显示模式: <select name="showmod" id="showmod" onchange="ChangeShowMod(document.FileMainNav);"> <option value="0"<?=$showmod==0?' selected':''?>>数据库模式</option> <option value="1"<?=$showmod==1?' selected':''?>>目录模式</option> </select> 文件类型: <select name="type" id="type" onchange="ChangeShowMod(document.FileMainNav);"> <option value="1"<?=$type==1?' selected':''?>>图片</option> <option value="2"<?=$type==2?' selected':''?>>Flash文件</option> <option value="3"<?=$type==3?' selected':''?>>多媒体文件</option> <option value="0"<?=$type==0?' selected':''?>>其他附件</option> </select> </td> </tr> </form> </table> </td> </tr> <tr> <td height="100%"> <IFRAME frameBorder="0" id="elfile" name="elfile" scrolling="yes" src="<?=$filename.'?'.$search?>" style="HEIGHT:100%;VISIBILITY:inherit;WIDTH:100%;Z-INDEX:1"></IFRAME> </td> </tr></table></body></html>
路径问题,可用绝对路径或
window.open('ecmseditor
改为
window.open(../'ecmseditor
路径问题,可用绝对路径或
window.open('ecmseditor
改为
window.open(../'ecmseditor
你改成 window.open('../ecmseditor 起码不会404了吧?
至于能否上传图片,貌似不在你的问题范畴。
<input name="conpic" type="text" id="conpic" value="<?=ehtmlspecialchars(stripSlashes($r[conpic]))?>" size="42"> <a onclick="window.open(' ../ecmseditor/FileMain.php?type=1&classid=&doing=2&field=conpic&filepass=<?=$filepass?>&sinfo=1&modtype=7','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片"><img src="../data/images/changeimg.gif" border="0" align="absbottom" alt="帝国cms自定义页面上传图片功能如何修改" ></a>
你改成 window.open('../ecmseditor 起码不会404了吧?
至于能否上传图片,貌似不在你的问题范畴。
<input name="conpic" type="text" id="conpic" value="<?=ehtmlspecialchars(stripSlashes($r[conpic]))?>" size="42"> <a onclick="window.open(' ../ecmseditor/FileMain.php?type=1&classid=&doing=2&field=conpic&filepass=<?=$filepass?>&sinfo=1&modtype=7','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片"><img src="../data/images/changeimg.gif" border="0" align="absbottom" alt="帝国cms自定义页面上传图片功能如何修改" ></a>
你改成 window.open('../ecmseditor 起码不会404了吧?
至于能否上传图片,貌似不在你的问题范畴。
<input name="conpic" type="text" id="conpic" value="<?=ehtmlspecialchars(stripSlashes($r[conpic]))?>" size="42"> <a onclick="window.open(' ../ecmseditor/FileMain.php?type=1&classid=&doing=2&field=conpic&filepass=<?=$filepass?>&sinfo=1&modtype=7','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片"><img src="../data/images/changeimg.gif" border="0" align="absbottom" alt="帝国cms自定义页面上传图片功能如何修改" ></a>