帝国cms自定义页面上传图片功能如何修改

WBOY
Release: 2016-06-23 13:39:38
Original
2045 people have browsed it

在自定义页面录入页面上增加了一个字段,其中最重要的是那个图片上传功能即它:
&infoid==$id?>&filepass==$filepass?>&sinfo=1&doing=1&field=titlepic=$ecms_hashur[ehref]?>','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片">帝国cms自定义页面上传图片功能如何修改

下面是完整的代码

<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>
Copy after login

但是上面加完后,点击时出现404页面,然后比较正确的发现是多了个template,并且地址栏接受的一些参数也不对,不知怎么改才对呢


回复讨论(解决方案)

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"    style="max-width:90%" 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>
Copy after login

路径问题,可用绝对路径或
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>  
Copy after login
Copy after login
Copy after login

你改成 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>  
Copy after login
Copy after login
Copy after login


你的意思只要不是404就是我的问题就解决了,对不

你改成 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>  
Copy after login
Copy after login
Copy after login



嗯,经实验,正确,加分,只要是对的,我就加,谁烦那些傻逼和装逼讲大道理的人了!
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template