帝国cms自带的图片集字段与下载字段如何创建?
时间:2024年03月06日
/来源:网络
/编辑:佚名
在新闻表里面,直接创建字段!
图片集字段:
输入表单替换html代码为:
复制代码
<script>
function dopicadd()
{var i;
var str="";
var oldi=0;
var j=0;
oldi=parseInt(document.add.morepicnum.value);
for(i=1;i<=document.add.downmorepicnum.value;i++)
{
j=i+oldi;
str=str+"<tr><td width=7%><div align=center>"+j+"</div></td><td width=33%><div align=center><input name=msmallpic[] type=text size=28 id=msmallpic"+j+" ondblclick=SpOpenChFile(1,'msmallpic"+j+"')><br><input type=file name=msmallpfile[] size=15></div></td><td width=30%><div align=center><input name=mbigpic[] type=text size=28 id=mbigpic"+j+" ondblclick=SpOpenChFile(1,'mbigpic"+j+"')><br><input type=file name=mbigpfile[] size=15></div></td><td width=30%><div align=center><input name=mpicname[] type=text></div></td></tr>";
}
document.getElementById("addpicdown").innerHTML="<table width='100%' border=0 cellspacing=1 cellpadding=3>"+str+"</table>";
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">
图片地址前缀:
<input name="mpicurl_qz" type="text" id="mpicurl_qz">
<input type="checkbox" name="msavepic" value="1">远程保存 <input type="checkbox" name="mcreatespic" value="1" onclick="if(this.checked){setmcreatespic.style.display='';}else{setmcreatespic.style.display='none';}">生成缩图
<span id="setmcreatespic" style="display:none">:<input type=text name="mcreatespicwidth" size=4 value="<?=$public_r[spicwidth]?>">*<input type=text name="mcreatespicheight" size=4 value="<?=$public_r[spicheight]?>">(宽*高)</span>
<?php
if(TranmoreIsOpen())
{
?>
<input type="button" name="Submit" value="多选上传" onclick="window.open('ecmseditor/tranmore/tranmore.php?type=1&classid=<?=$classid?>&filepass=<?=$filepass?>&infoid=<?=$id?>&modtype=0&sinfo=1&ecmsdo=ecmstmmorepic&tranfrom=2<?=$ecms_hashur['ehref']?>&oldmorepicnum='+document.add.morepicnum.value,'ecmstmpage','width=700,height=550,scrollbars=yes');">
<?php
}
?>
</td>
</tr>
<tr>
<td><table width="100%" border=0 align=center cellpadding=3 cellspacing=1>
<tr bgcolor="#DBEAF5">
<td width="7%"><div align=center>编号</div></td>
<td width="33%"><div align=center>缩图 <font color="#666666">(双击选择)</font></div></td>
<td width="30%"><div align=center>大图 <font color="#666666">(双击选择)</font></div></td>
<td width="30%"><div align=center>图片说明</div></td>
</tr>
</table></td>
</tr>
<tr>
<td id=defmorepicid>
<?php
if($ecmsfirstpost==1)
{
?>
<table width='100%' border=0 align=center cellpadding=3 cellspacing=1>
<?php
$morepicnum=3;
for($mppathi=1;$mppathi<=$morepicnum;$mppathi++)
{
?>
<tr>
<td width='7%'><div align=center><?=$mppathi?></div></td>
<td width='33%'><div align=center>
<input name=msmallpic[] type=text id='msmallpic<?=$mppathi?>' size=28 ondblclick="SpOpenChFile(1,'msmallpic<?=$mppathi?>');">
<br><input type=file name=msmallpfile[] size=15>
</div></td>
<td width='30%'><div align=center>
<input name=mbigpic[] type=text id='mbigpic<?=$mppathi?>' size=28 ondblclick="SpOpenChFile(1,'mbigpic<?=$mppathi?>');">
<br><input type=file name=mbigpfile[] size=15>
</div></td>
<td width='30%'><div align=center>
<input name=mpicname[] type=text id='mpicname<?=$mppathi?>'>
</div></td>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
$morepicpath="";
$morepicnum=0;
if($r[morepic])
{
$r[morepic]=stripSlashes($r[morepic]);
//地址
$j=0;
$pd_record=explode("\r\n",$r[morepic]);
for($i=0;$i<count($pd_record);$i++)
{
$j=$i+1;
$pd_field=explode("::::::",$pd_record[$i]);
$morepicpath.="<tr>
<td width='7%'><div align=center>".$j."</div></td>
<td width='33%'><div align=center>
<input name=msmallpic[] type=text value='".$pd_field[0]."' size=28 id=msmallpic".$j." ondblclick=\"SpOpenChFile(1,'msmallpic".$j."');\">
<br><input type=file name=msmallpfile[] size=15>
</div></td>
<td width='30%'><div align=center>
<input name=mbigpic[] type=text value='".$pd_field[1]."' size=28 id=mbigpic".$j." ondblclick=\"SpOpenChFile(1,'mbigpic".$j."');\">
<br><input type=file name=mbigpfile[] size=15>
</div></td>
<td width='30%'><div align=center>
<input name=mpicname[] type=text value='".$pd_field[2]."'><input type=hidden name=mpicid[] value=".$j."><input type=checkbox name=mdelpicid[] value=".$j.">删
</div></td>
</tr>";
}
$morepicnum=$j;
$morepicpath="<table width='100%' border=0 cellspacing=1 cellpadding=3>".$morepicpath."</table>";
}
echo $morepicpath;
}
?>
</td>
</tr>
<tr>
<td height="25">地址扩展数量: <input name="morepicnum" type="hidden" id="morepicnum" value="<?=$morepicnum?>">
<input name="downmorepicnum" type="text" value="1" size="6"> <input type="button" name="Submit5" value="输出地址" onclick="javascript:dopicadd();"></td>
</tr>
<tr>
<td id=addpicdown></td>
</tr>
</table>
投稿表单替换html代码为:
<script>
function dopicadd()
{var i;
var str="";
var oldi=0;
var j=0;
oldi=parseInt(document.add.morepicnum.value);
for(i=1;i<=document.add.downmorepicnum.value;i++)
{
j=i+oldi;
str=str+"<tr><td width=7%><div align=center>"+j+"</div></td><td width=33%><div align=center><input name=msmallpic[] type=text size=28 id=msmallpic"+j+"></div></td><td width=30%><div align=center><input name=mbigpic[] type=text size=28 id=mbigpic"+j+"></div></td><td width=30%><div align=center><input name=mpicname[] type=text></div></td></tr>";
}
document.getElementById("addpicdown").innerHTML="<table width='100%' border=0 cellspacing=1 cellpadding=3>"+str+"</table>";
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">
图片地址前缀:
<input name="mpicurl_qz" type="text" id="mpicurl_qz" size="32">
</td>
</tr>
<tr>
<td><table width=100% border=0 align=center cellpadding=3 cellspacing=1>
<tr bgcolor='#DBEAF5'>
<td width=7%><div align=center>编号</div></td>
<td width=33%><div align=center>缩图</div></td>
<td width=30%><div align=center>大图</div></td>
<td width=30%><div align=center>图片说明</div></td>
</tr>
</table></td>
</tr>
<tr>
<td id=defmorepicid>
<?php
if($ecmsfirstpost==1)
{
?>
<table width='100%' border=0 align=center cellpadding=3 cellspacing=1>
<?php
$morepicnum=3;
for($mppathi=1;$mppathi<=$morepicnum;$mppathi++)
{
?>
<tr>
<td width='7%'><div align=center><?=$mppathi?></div></td>
<td width='33%'><div align=center>
<input name=msmallpic[] type=text id=msmallpic[] size=28>
</div></td>
<td width='30%'><div align=center>
<input name=mbigpic[] type=text id=mbigpic[] size=28>
</div></td>
<td width='30%'><div align=center>
<input name=mpicname[] type=text id=mpicname[]>
</div></td>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
$morepicpath="";
$morepicnum=0;
if($r[morepic])
{
$r[morepic]=stripSlashes($r[morepic]);
//地址
$j=0;
$pd_record=explode("\r\n",$r[morepic]);
for($i=0;$i<count($pd_record);$i++)
{
$j=$i+1;
$pd_field=explode("::::::",$pd_record[$i]);
$morepicpath.="<tr>
<td width='7%'><div align=center>".$j."</div></td>
<td width='33%'><div align=center>
<input name=msmallpic[] type=text value='".$pd_field[0]."' size=28>
</div></td>
<td width='30%'><div align=center>
<input name=mbigpic[] type=text value='".$pd_field[1]."' size=28>
</div></td>
<td width='30%'><div align=center>
<input name=mpicname[] type=text value='".$pd_field[2]."'><input type=hidden name=mpicid[] value=".$j."><input type=checkbox name=mdelpicid[] value=".$j.">删
</div></td></tr>";
}
$morepicnum=$j;
$morepicpath="<table width='100%' border=0 cellspacing=1 cellpadding=3>".$morepicpath."</table>";
}
echo $morepicpath;
}
?>
</td>
</tr>
<tr>
<td height="25">地址扩展数量: <input name="morepicnum" type="hidden" id="morepicnum" value="<?=$morepicnum?>">
<input name="downmorepicnum" type="text" value="1" size="6"> <input type="button" name="Submit5" value="输出地址" onclick="javascript:dopicadd();"></td>
</tr>
<tr>
<td id=addpicdown></td>
</tr>
</table>
其余内容则不变!
字段名设置为:morepic,字段的输入表单显示元素为单行文本框
下载字段
字段名设置为:downpath,字段的输入表单显示元素为单行文本框。
输入表单替换html代码为:
复制代码
<script>
function doadd()
{var i;
var str="";
var oldi=0;
var j=0;
oldi=parseInt(document.add.editnum.value);
for(i=1;i<=document.add.downnum.value;i++)
{
j=i+oldi;
str=str+"<tr><td width=7%> <div align=center>"+j+"</div></td><td width=19%><div align=left><input name=downname[] type=text id=downname[] value=下载地址"+j+" size=17></div></td><td width=40%><input name=downpath[] type=text size=36 id=downpath"+j+" ondblclick=SpOpenChFile(0,'downpath"+j+"')><select name=thedownqz[]><option value=''>--地址前缀--</option><?=$newdownqz?></select></td><td width=21%><div align=center><select name=downuser[] id=select><option value=0>游客</option><?=$ygroup?></select></div></td><td width=13%><div align=center><input name=fen[] type=text id=fen[] value=0 size=6></div></td></tr>";
}
document.getElementById("adddown").innerHTML="<table width='100%' border=0 cellspacing=1 cellpadding=3>"+str+"</table>";
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">下载地址前缀 :
<input name="downurl_qz" type="text" size="32">
<select name="changeurl_qz" onchange="document.add.downurl_qz.value=document.add.changeurl_qz.value">
<option value="" selected>选择前缀</option>
<?=$downurlqz?>
</select>
</td>
</tr>
<tr>
<td height="25">选择/上传附件:
<input name="changedown_url" id="changedown_url" type="text" size="32">
<input type="button" name="Submit" value="选择" onclick="window.open('ecmseditor/FileMain.php?type=0&classid=<?=$classid?>&infoid=<?=$id?>&filepass=<?=$filepass?>&sinfo=1&doing=1&field=changedown_url<?=$ecms_hashur[ehref]?>','','width=700,height=550,scrollbars=yes');">
<input type="button" name="Submit" value="复制" onclick="document.getElementById('changedown_url').focus();document.getElementById('changedown_url').select();clipboardData.setData('text',document.getElementById('changedown_url').value);"></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
<tr>
<td width="7%"> <div align="center">编号</div></td>
<td width="19%"><div align="left">下载名称</div></td>
<td width="40%">下载地址 <font color="#666666">(双击选择)</font></td>
<td width="21%"> <div align="center">权限</div></td>
<td width="13%"> <div align="center">点数</div></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<?php
if($ecmsfirstpost==1)
{
?>
<table width='100%' border=0 cellspacing=1 cellpadding=3>
<?php
$editnum=3;
for($pathi=1;$pathi<=$editnum;$pathi++)
{
?>
<tr>
<td width='7%'> <div align=center><?=$pathi?></div></td>
<td width='19%'> <div align=left>
<input name=downname[] type=text value='下载地址<?=$pathi?>' size=17>
</div></td>
<td width='40%'>
<input name=downpath[] type=text size=36 id='downpath<?=$pathi?>' ondblclick="SpOpenChFile(0,'downpath<?=$pathi?>');">
<select name=thedownqz[]><option value=''>--地址前缀--</option><?=$newdownqz?></select>
</td>
<td width='21%'><div align=center>
<select name=downuser[]>
<option value=0>游客</option>
<?=$ygroup?>
</select>
</div></td>
<td width='13%'> <div align=center>
<input name=fen[] type=text value=0 size=6>
</div></td>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
$editnum=0;
$downloadpath="";
if($r[downpath])
{
$r[downpath]=stripSlashes($r[downpath]);
//下载地址
$j=0;
$d_record=explode("\r\n",$r[downpath]);
for($i=0;$i<count($d_record);$i++)
{
$j=$i+1;
$d_field=explode("::::::",$d_record[$i]);
//权限
$tgroup=str_replace(" value=".$d_field[2].">"," value=".$d_field[2]." selected>",$ygroup);
//地址前缀
$tnewdownqz=str_replace(" value='".$d_field[4]."'>"," value='".$d_field[4]."' selected>",$newdownqz);
$downloadpath.="<tr><td width='7%'><div align=center>".$j."</div></td><td width='19%'><div align=left><input name=downname[] type=text id=downname[] value='".$d_field[0]."' size=17></div></td><td width='40%'><input name=downpath[] type=text id=downpath".$j." value='".$d_field[1]."' size=36 ondblclick=\"SpOpenChFile(0,'downpath".$j."');\"><select name=thedownqz[]><option value=''>--地址前缀--</option>".$tnewdownqz."</select><input type=hidden name=pathid[] value=".$j."><input type=checkbox name=delpathid[] value=".$j.">删</td><td width='21%'><div align=center><select name=downuser[] id=select><option value=0>游客</option>".$tgroup."</select></div></td><td width='13%'><div align=center><input name=fen[] type=text id=fen[] value='".$d_field[3]."' size=6></div></td></tr>";
}
$editnum=$j;
$downloadpath="<table width='100%' border=0 cellspacing=1 cellpadding=3>".$downloadpath."</table>";
}
echo $downloadpath;
}
?>
</td>
</tr>
<tr>
<td height="25">下载地址扩展数量: <input name="editnum" type="hidden" id="editnum" value="<?=$editnum?>">
<input name="downnum" type="text" id="downnum" value="1" size="6"> <input type="button" name="Submit5" value="输出地址" onclick="javascript:doadd();"></td>
</tr>
<tr>
<td id=adddown></td>
</tr>
</table>
图片集字段:
输入表单替换html代码为:
复制代码
<script>
function dopicadd()
{var i;
var str="";
var oldi=0;
var j=0;
oldi=parseInt(document.add.morepicnum.value);
for(i=1;i<=document.add.downmorepicnum.value;i++)
{
j=i+oldi;
str=str+"<tr><td width=7%><div align=center>"+j+"</div></td><td width=33%><div align=center><input name=msmallpic[] type=text size=28 id=msmallpic"+j+" ondblclick=SpOpenChFile(1,'msmallpic"+j+"')><br><input type=file name=msmallpfile[] size=15></div></td><td width=30%><div align=center><input name=mbigpic[] type=text size=28 id=mbigpic"+j+" ondblclick=SpOpenChFile(1,'mbigpic"+j+"')><br><input type=file name=mbigpfile[] size=15></div></td><td width=30%><div align=center><input name=mpicname[] type=text></div></td></tr>";
}
document.getElementById("addpicdown").innerHTML="<table width='100%' border=0 cellspacing=1 cellpadding=3>"+str+"</table>";
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">
图片地址前缀:
<input name="mpicurl_qz" type="text" id="mpicurl_qz">
<input type="checkbox" name="msavepic" value="1">远程保存 <input type="checkbox" name="mcreatespic" value="1" onclick="if(this.checked){setmcreatespic.style.display='';}else{setmcreatespic.style.display='none';}">生成缩图
<span id="setmcreatespic" style="display:none">:<input type=text name="mcreatespicwidth" size=4 value="<?=$public_r[spicwidth]?>">*<input type=text name="mcreatespicheight" size=4 value="<?=$public_r[spicheight]?>">(宽*高)</span>
<?php
if(TranmoreIsOpen())
{
?>
<input type="button" name="Submit" value="多选上传" onclick="window.open('ecmseditor/tranmore/tranmore.php?type=1&classid=<?=$classid?>&filepass=<?=$filepass?>&infoid=<?=$id?>&modtype=0&sinfo=1&ecmsdo=ecmstmmorepic&tranfrom=2<?=$ecms_hashur['ehref']?>&oldmorepicnum='+document.add.morepicnum.value,'ecmstmpage','width=700,height=550,scrollbars=yes');">
<?php
}
?>
</td>
</tr>
<tr>
<td><table width="100%" border=0 align=center cellpadding=3 cellspacing=1>
<tr bgcolor="#DBEAF5">
<td width="7%"><div align=center>编号</div></td>
<td width="33%"><div align=center>缩图 <font color="#666666">(双击选择)</font></div></td>
<td width="30%"><div align=center>大图 <font color="#666666">(双击选择)</font></div></td>
<td width="30%"><div align=center>图片说明</div></td>
</tr>
</table></td>
</tr>
<tr>
<td id=defmorepicid>
<?php
if($ecmsfirstpost==1)
{
?>
<table width='100%' border=0 align=center cellpadding=3 cellspacing=1>
<?php
$morepicnum=3;
for($mppathi=1;$mppathi<=$morepicnum;$mppathi++)
{
?>
<tr>
<td width='7%'><div align=center><?=$mppathi?></div></td>
<td width='33%'><div align=center>
<input name=msmallpic[] type=text id='msmallpic<?=$mppathi?>' size=28 ondblclick="SpOpenChFile(1,'msmallpic<?=$mppathi?>');">
<br><input type=file name=msmallpfile[] size=15>
</div></td>
<td width='30%'><div align=center>
<input name=mbigpic[] type=text id='mbigpic<?=$mppathi?>' size=28 ondblclick="SpOpenChFile(1,'mbigpic<?=$mppathi?>');">
<br><input type=file name=mbigpfile[] size=15>
</div></td>
<td width='30%'><div align=center>
<input name=mpicname[] type=text id='mpicname<?=$mppathi?>'>
</div></td>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
$morepicpath="";
$morepicnum=0;
if($r[morepic])
{
$r[morepic]=stripSlashes($r[morepic]);
//地址
$j=0;
$pd_record=explode("\r\n",$r[morepic]);
for($i=0;$i<count($pd_record);$i++)
{
$j=$i+1;
$pd_field=explode("::::::",$pd_record[$i]);
$morepicpath.="<tr>
<td width='7%'><div align=center>".$j."</div></td>
<td width='33%'><div align=center>
<input name=msmallpic[] type=text value='".$pd_field[0]."' size=28 id=msmallpic".$j." ondblclick=\"SpOpenChFile(1,'msmallpic".$j."');\">
<br><input type=file name=msmallpfile[] size=15>
</div></td>
<td width='30%'><div align=center>
<input name=mbigpic[] type=text value='".$pd_field[1]."' size=28 id=mbigpic".$j." ondblclick=\"SpOpenChFile(1,'mbigpic".$j."');\">
<br><input type=file name=mbigpfile[] size=15>
</div></td>
<td width='30%'><div align=center>
<input name=mpicname[] type=text value='".$pd_field[2]."'><input type=hidden name=mpicid[] value=".$j."><input type=checkbox name=mdelpicid[] value=".$j.">删
</div></td>
</tr>";
}
$morepicnum=$j;
$morepicpath="<table width='100%' border=0 cellspacing=1 cellpadding=3>".$morepicpath."</table>";
}
echo $morepicpath;
}
?>
</td>
</tr>
<tr>
<td height="25">地址扩展数量: <input name="morepicnum" type="hidden" id="morepicnum" value="<?=$morepicnum?>">
<input name="downmorepicnum" type="text" value="1" size="6"> <input type="button" name="Submit5" value="输出地址" onclick="javascript:dopicadd();"></td>
</tr>
<tr>
<td id=addpicdown></td>
</tr>
</table>
投稿表单替换html代码为:
<script>
function dopicadd()
{var i;
var str="";
var oldi=0;
var j=0;
oldi=parseInt(document.add.morepicnum.value);
for(i=1;i<=document.add.downmorepicnum.value;i++)
{
j=i+oldi;
str=str+"<tr><td width=7%><div align=center>"+j+"</div></td><td width=33%><div align=center><input name=msmallpic[] type=text size=28 id=msmallpic"+j+"></div></td><td width=30%><div align=center><input name=mbigpic[] type=text size=28 id=mbigpic"+j+"></div></td><td width=30%><div align=center><input name=mpicname[] type=text></div></td></tr>";
}
document.getElementById("addpicdown").innerHTML="<table width='100%' border=0 cellspacing=1 cellpadding=3>"+str+"</table>";
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">
图片地址前缀:
<input name="mpicurl_qz" type="text" id="mpicurl_qz" size="32">
</td>
</tr>
<tr>
<td><table width=100% border=0 align=center cellpadding=3 cellspacing=1>
<tr bgcolor='#DBEAF5'>
<td width=7%><div align=center>编号</div></td>
<td width=33%><div align=center>缩图</div></td>
<td width=30%><div align=center>大图</div></td>
<td width=30%><div align=center>图片说明</div></td>
</tr>
</table></td>
</tr>
<tr>
<td id=defmorepicid>
<?php
if($ecmsfirstpost==1)
{
?>
<table width='100%' border=0 align=center cellpadding=3 cellspacing=1>
<?php
$morepicnum=3;
for($mppathi=1;$mppathi<=$morepicnum;$mppathi++)
{
?>
<tr>
<td width='7%'><div align=center><?=$mppathi?></div></td>
<td width='33%'><div align=center>
<input name=msmallpic[] type=text id=msmallpic[] size=28>
</div></td>
<td width='30%'><div align=center>
<input name=mbigpic[] type=text id=mbigpic[] size=28>
</div></td>
<td width='30%'><div align=center>
<input name=mpicname[] type=text id=mpicname[]>
</div></td>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
$morepicpath="";
$morepicnum=0;
if($r[morepic])
{
$r[morepic]=stripSlashes($r[morepic]);
//地址
$j=0;
$pd_record=explode("\r\n",$r[morepic]);
for($i=0;$i<count($pd_record);$i++)
{
$j=$i+1;
$pd_field=explode("::::::",$pd_record[$i]);
$morepicpath.="<tr>
<td width='7%'><div align=center>".$j."</div></td>
<td width='33%'><div align=center>
<input name=msmallpic[] type=text value='".$pd_field[0]."' size=28>
</div></td>
<td width='30%'><div align=center>
<input name=mbigpic[] type=text value='".$pd_field[1]."' size=28>
</div></td>
<td width='30%'><div align=center>
<input name=mpicname[] type=text value='".$pd_field[2]."'><input type=hidden name=mpicid[] value=".$j."><input type=checkbox name=mdelpicid[] value=".$j.">删
</div></td></tr>";
}
$morepicnum=$j;
$morepicpath="<table width='100%' border=0 cellspacing=1 cellpadding=3>".$morepicpath."</table>";
}
echo $morepicpath;
}
?>
</td>
</tr>
<tr>
<td height="25">地址扩展数量: <input name="morepicnum" type="hidden" id="morepicnum" value="<?=$morepicnum?>">
<input name="downmorepicnum" type="text" value="1" size="6"> <input type="button" name="Submit5" value="输出地址" onclick="javascript:dopicadd();"></td>
</tr>
<tr>
<td id=addpicdown></td>
</tr>
</table>
其余内容则不变!
字段名设置为:morepic,字段的输入表单显示元素为单行文本框
下载字段
字段名设置为:downpath,字段的输入表单显示元素为单行文本框。
输入表单替换html代码为:
复制代码
<script>
function doadd()
{var i;
var str="";
var oldi=0;
var j=0;
oldi=parseInt(document.add.editnum.value);
for(i=1;i<=document.add.downnum.value;i++)
{
j=i+oldi;
str=str+"<tr><td width=7%> <div align=center>"+j+"</div></td><td width=19%><div align=left><input name=downname[] type=text id=downname[] value=下载地址"+j+" size=17></div></td><td width=40%><input name=downpath[] type=text size=36 id=downpath"+j+" ondblclick=SpOpenChFile(0,'downpath"+j+"')><select name=thedownqz[]><option value=''>--地址前缀--</option><?=$newdownqz?></select></td><td width=21%><div align=center><select name=downuser[] id=select><option value=0>游客</option><?=$ygroup?></select></div></td><td width=13%><div align=center><input name=fen[] type=text id=fen[] value=0 size=6></div></td></tr>";
}
document.getElementById("adddown").innerHTML="<table width='100%' border=0 cellspacing=1 cellpadding=3>"+str+"</table>";
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">下载地址前缀 :
<input name="downurl_qz" type="text" size="32">
<select name="changeurl_qz" onchange="document.add.downurl_qz.value=document.add.changeurl_qz.value">
<option value="" selected>选择前缀</option>
<?=$downurlqz?>
</select>
</td>
</tr>
<tr>
<td height="25">选择/上传附件:
<input name="changedown_url" id="changedown_url" type="text" size="32">
<input type="button" name="Submit" value="选择" onclick="window.open('ecmseditor/FileMain.php?type=0&classid=<?=$classid?>&infoid=<?=$id?>&filepass=<?=$filepass?>&sinfo=1&doing=1&field=changedown_url<?=$ecms_hashur[ehref]?>','','width=700,height=550,scrollbars=yes');">
<input type="button" name="Submit" value="复制" onclick="document.getElementById('changedown_url').focus();document.getElementById('changedown_url').select();clipboardData.setData('text',document.getElementById('changedown_url').value);"></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
<tr>
<td width="7%"> <div align="center">编号</div></td>
<td width="19%"><div align="left">下载名称</div></td>
<td width="40%">下载地址 <font color="#666666">(双击选择)</font></td>
<td width="21%"> <div align="center">权限</div></td>
<td width="13%"> <div align="center">点数</div></td>
</tr>
</table></td>
</tr>
<tr>
<td>
<?php
if($ecmsfirstpost==1)
{
?>
<table width='100%' border=0 cellspacing=1 cellpadding=3>
<?php
$editnum=3;
for($pathi=1;$pathi<=$editnum;$pathi++)
{
?>
<tr>
<td width='7%'> <div align=center><?=$pathi?></div></td>
<td width='19%'> <div align=left>
<input name=downname[] type=text value='下载地址<?=$pathi?>' size=17>
</div></td>
<td width='40%'>
<input name=downpath[] type=text size=36 id='downpath<?=$pathi?>' ondblclick="SpOpenChFile(0,'downpath<?=$pathi?>');">
<select name=thedownqz[]><option value=''>--地址前缀--</option><?=$newdownqz?></select>
</td>
<td width='21%'><div align=center>
<select name=downuser[]>
<option value=0>游客</option>
<?=$ygroup?>
</select>
</div></td>
<td width='13%'> <div align=center>
<input name=fen[] type=text value=0 size=6>
</div></td>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
$editnum=0;
$downloadpath="";
if($r[downpath])
{
$r[downpath]=stripSlashes($r[downpath]);
//下载地址
$j=0;
$d_record=explode("\r\n",$r[downpath]);
for($i=0;$i<count($d_record);$i++)
{
$j=$i+1;
$d_field=explode("::::::",$d_record[$i]);
//权限
$tgroup=str_replace(" value=".$d_field[2].">"," value=".$d_field[2]." selected>",$ygroup);
//地址前缀
$tnewdownqz=str_replace(" value='".$d_field[4]."'>"," value='".$d_field[4]."' selected>",$newdownqz);
$downloadpath.="<tr><td width='7%'><div align=center>".$j."</div></td><td width='19%'><div align=left><input name=downname[] type=text id=downname[] value='".$d_field[0]."' size=17></div></td><td width='40%'><input name=downpath[] type=text id=downpath".$j." value='".$d_field[1]."' size=36 ondblclick=\"SpOpenChFile(0,'downpath".$j."');\"><select name=thedownqz[]><option value=''>--地址前缀--</option>".$tnewdownqz."</select><input type=hidden name=pathid[] value=".$j."><input type=checkbox name=delpathid[] value=".$j.">删</td><td width='21%'><div align=center><select name=downuser[] id=select><option value=0>游客</option>".$tgroup."</select></div></td><td width='13%'><div align=center><input name=fen[] type=text id=fen[] value='".$d_field[3]."' size=6></div></td></tr>";
}
$editnum=$j;
$downloadpath="<table width='100%' border=0 cellspacing=1 cellpadding=3>".$downloadpath."</table>";
}
echo $downloadpath;
}
?>
</td>
</tr>
<tr>
<td height="25">下载地址扩展数量: <input name="editnum" type="hidden" id="editnum" value="<?=$editnum?>">
<input name="downnum" type="text" id="downnum" value="1" size="6"> <input type="button" name="Submit5" value="输出地址" onclick="javascript:doadd();"></td>
</tr>
<tr>
<td id=adddown></td>
</tr>
</table>
新闻资讯 更多
- 【帝国cms教程】帝国CMS模板变量$GLOBALS[navclassid]用法分析04-03
- 【帝国cms教程】鲜为人知帝国CMS内容页调用上一篇和下一篇的精华方法汇总04-03
- 【帝国cms教程】怎么快速找出帝国CMS数据库配置文件路径及迁移网站后修改技巧!04-03
- 【帝国cms教程】帝国CMS模板$GLOBALS[navclassid]用法详解04-03
- 【帝国cms教程】帝国cms 7.5版列表页分页样式修改笔记04-02
- 【帝国cms教程】解决帝国CMS搜索页面模板不支持灵动标签和万能标签的方法04-02
- 【帝国cms教程】帝国CMS只备份栏目和模板的方法04-02
- 【帝国cms教程】帝国CMS怎样删除清空数据库记录?04-02
热门文章
- 178Moban源码谈谈免费源码与收费源码的区别
- 2帝国CMS忘记后台登陆用户名、密码、认证码的解决方法
- 3帝国CMS(EmpireCMS) v7.5后台任意代码执行漏洞及具体修复方法
- 4帝国CMS和WordPress 哪个好?哪个适合建站?
- 5如何解决Discuz的密码错误次数过多请15分钟后登陆的问题
- 6帝国cms灵动标签取得内容和栏目链接地址
- 7emlog pro 注册码“开心”教程(如果有一天,emlog官方版 或者 emlog免费版 跑路了,那用户怎么办?)
- 8织梦CMS在nginx下设置伪静态方法(附nginx伪静态规则)
- 9帝国cms后台登录出现”您还未登录”怎么解决?
- 10帝国cms7.5忘记登录密码 和忘记登录认证码以及多次登录 失败被锁定解决办法