因为 最近做站一个模型里有两个字段均为图集形式的,帝国虽然有图集模块,但不能实现多个字段是图集,所以稍微改造了一下 下面效果图
效果图:
1.首先按正常步骤,在对应模型里加上相应字段 这里我习惯遵从原来图集系统起名 mobanpic, 管理字段-》修改 -》输入表单替换html代码 将我下面这段代码复制进去
注意下面代码中 把”moban”字段替换成自己对应的名称,我这里字段名为mobanpic
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | <script>
function domobanpicadd() {var i; var str=""; var oldi=0; var j=0; oldi=parseInt(document.add.mobanpicnum.value); for(i=1;i<=document.add.downmobanpicnum.value;i++) { j=i+oldi; str=str+"</p> <tr> <td width=7%> <div align=center>"+j+"</div> </td> <td width=33%> <div align=center><input name=msmallmobanpic[] type=text size=28 id=msmallmobanpic"+j+" ondblclick=SpOpenChFile(1,'msmallmobanpic"+j+"')><br><input type=file name=msmallmobanpfile[] size=15></div> </td> <td width=30%> <div align=center><input name=mbigmobanpic[] type=text size=28 id=mbigmobanpic"+j+" ondblclick=SpOpenChFile(1,'mbigmobanpic"+j+"')><br><input type=file name=mbigmobanpfile[] size=15></div> </td> <td width=30%> <div align=center><input name=mmobanpicname[] type=text></div> </td> </tr> <p>"; } document.getElementById("addmobanpicdown").innerHTML="</p> <table width='100%' border=0 cellspacing=1 cellpadding=3>"+str+"</table> <p>"; } </script> "; } $mobanpicnum=$j; $mobanpicpath=" <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tbody> <tr> <td height="25">图片地址前缀: <input id="mmobanpicurl_qz" name="mmobanpicurl_qz" type="text" /> <input name="msavemobanpic" type="checkbox" value="1" />远程保存 <input name="mcreatesmobanpic" type="checkbox" value="1" />生成缩图 <span id="setmcreatesmobanpic" style="display: none;">:<input name="mcreatesmobanpicwidth" size="4" type="text" value="<?=$public_r[spicwidth]?>" />*<input name="mcreatespicheight" size="4" type="text" value="<?=$public_r[spicheight]?>" />(宽*高)</span> <!--?php if(TranmoreIsOpen()) { ?--> <input name="Submit" type="button" value="多选上传" /> <!--?php } ?--></td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="1" cellpadding="3" align="center"> <tbody> <tr bgcolor="#DBEAF5"> <td width="7%"> <div align="center">编号</div></td> <td width="33%"> <div align="center">缩图 <span style="color: #666666;">(双击选择)</span></div></td> <td width="30%"> <div align="center">大图 <span style="color: #666666;">(双击选择)</span></div></td> <td width="30%"> <div align="center">图片说明</div></td> </tr> </tbody> </table> </td> </tr> <tr> <td id="defmobanpicid"><!--?php if($ecmsfirstpost==1) { ?--> $mobanpicnum=3;for($mppathi=1;$mppathi<=$mobanpicnum;$mppathi++) { ?> <table border="0" width="100%" cellspacing="1" cellpadding="3" align="center"><!--?php <br ?--> <tbody> <tr> <td width="7%"> <div align="center"><!--?=$mppathi? ></div> </td> <td width='33%'> <div align=center> <input name=msmallmobanpic[] type=text id='msmallmobanpic<?=$mppathi?-->' size=28 ondblclick="SpOpenChFile(1,'msmallmobanpic<!--?=$mppathi? >');"><br ?--> <input name="msmallmobanpfile[]" size="15" type="file" /></div></td> <td width="30%"> <div align="center"><input id="mbigmobanpic<?=$mppathi?>" name="mbigmobanpic[]" size="28" type="text" /> <input name="mbigmobanpfile[]" size="15" type="file" /></div></td> <td width="30%"> <div align="center"><input id="mmobanpicname<?=$mppathi?>" name="mmobanpicname[]" type="text" /></div></td> </tr> <!--?php } ?--></tbody> </table> <!--?php <br ?--> } else { $mobanpicpath=""; $mobanpicnum=0; if($r[mobanpic]) { $r[mobanpic]=stripSlashes($r[mobanpic]); //地址 $j=0; $pd_record=explode("/r/n",$r[mobanpic]); for($i=0;$i<count($pd_record);$i++) { $j=$i+1; $pd_field=explode("::::::",$pd_record[$i]); $mobanpicpath.="</td> <td width="7%"> <div align="center">".$j."</div></td> <td width="33%"> <div align="center"><input id="msmallmobanpic".$j."" name="msmallmobanpic[]" size="28" type="text" value="".$pd_field[0]."" /> <input name="msmallmobanpfile[]" size="15" type="file" /></div></td> <td width="30%"> <div align="center"><input id="mbigmobanpic".$j."" name="mbigmobanpic[]" size="28" type="text" value="".$pd_field[1]."" /> <input name="mbigmobanpfile[]" size="15" type="file" /></div></td> <td width="30%"> <div align="center"><input name="mmobanpicname[]" type="text" value="".$pd_field[2]."" /><input name="mmobanpicid[]" type="hidden" value=".$j." /><input name="mdelmobanpicid[]" type="checkbox" value=".$j." />删</div></td> </tr> </tbody> </table> ".$mobanpicpath." "; } echo $mobanpicpath; } ?> 学习交流
热门图片
猜你喜欢的新闻
新闻热点 2024-06-26 22:28:41
2024-06-26 22:26:16
2024-06-26 22:23:01
2024-06-25 19:29:23
2024-06-25 19:22:14
2024-06-25 19:19:15
疑难解答 |