欢迎光临一流素材网,免积分免费素材下载!
当前位置:首页 > 教程 > CMS教程>帝国CMS

帝国7.0 多值字段修改为 可以上传图片的形式

所属栏目:帝国CMS更新时间:2014-07-24 来源:网络 原作者:不详 发布:deepdfhy浏览:0

我们知道多值字段功能很强大,但不能上传图片确很操蛋,其实改吧改吧就可以了,只是帝国的大大们似乎不太注意这些小细节,只有靠自己来优化了。

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
<script>
function domvadd_ffff()
{
        var i;
        var str='';
        var oldi=0;
        var j=0;
        var addnum=0;
        addnum=parseInt(document.add.mvaddnum_ffff.value);
        oldi=parseInt(document.add.mveditnum_ffff.value);
        for(i=1;i<=addnum;i++)
        {
                j=i+oldi;
                str=str+'<tr><td align="center"><input type="text" name="ffff_1[]" id="ffff_1_'+j+'" value=""><a onclick="window.open(\'ecmseditor/FileMain.php?type=1&classid=<?=$classid?>&infoid=<?=$id?>&doing=1&field=ffff_1_'+j+'\',\'\',\'width=700,height=550,scrollbars=yes\');" title="选择已上传的图片"><img src="../data/images/changeimg.gif" border="0" align="absbottom"></a></td></tr>';
        }
        document.getElementById("mvadd_ffff").innerHTML="<table width='100%' border=0 cellspacing=1 cellpadding=3>"+str+"</table>";
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
                <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
        <tr><td align="center">设置1</td></tr>
      </table>
        </td>
  </tr>
  <tr>
    <td>
    <?php
    if($ecmsfirstpost==1)
    {
    ?>
                <table width='100%' border=0 cellspacing=1 cellpadding=3>
                <?php
                $editnum=3;
                for($i=1;$i<=$editnum;$i++)
                {
                ?>
                        <tr><td align="center"><input type="text" name="ffff_1[]" id="ffff_1_<?=$i?>" value=""><a onclick="window.open('ecmseditor/FileMain.php?type=1&classid=<?=$classid?>&infoid=<?=$id?>&doing=1&field=ffff_1_<?=$i?>','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片"><img src="../data/images/changeimg.gif" border="0" align="absbottom"></a></td></tr>
                <?php
                }
                ?>
                </table>
    <?php
    }
    else
    {
                $editnum=0;
                if($r['ffff'])
                {
                        $r['ffff']=stripSlashes($r['ffff']);
                        ?>
                        <table width='100%' border=0 cellspacing=1 cellpadding=3>
                        <?php
                        //录入项
                        $j=0;
                        $mvf_record=explode('||||||',$r['ffff']);
                        $mvf_count=count($mvf_record);
                        for($i=0;$i<$mvf_count;$i++)
                        {
                                $j=$i+1;
                                $mvf_field=explode("::::::",$mvf_record[$i]);
                                ?>
                                <tr><td align="center"><input type="text" name="ffff_1[]" id="ffff_1_<?=$j?>" value="<?=$mvf_field[0]?>"> <input type="hidden" name="ffff_mvid[]" id="ffff_mvid_<?=$j?>" value="<?=$j?>"><input type="checkbox" name="ffff_mvdelid[]" id="ffff_mvdelid_<?=$j?>" value="<?=$j?>">删</td></tr>
                                <?php
                        }
                        ?>
                        </table>
                        <?php
                        $editnum=$j;
                }
    }
    ?>
    </td>
  </tr>
  <tr>
    <td height="25">扩展数量: <input name="mveditnum_ffff" type="hidden" id="mveditnum_ffff" value="<?=$editnum?>">
      <input name="mvnum_ffff" type="hidden" id="mvnum_ffff" value="1">
      <input name="mvmust_ffff" type="hidden" id="mvmust_ffff" value="1">
      <input name="mvaddnum_ffff" type="text" id="mvaddnum_ffff" value="1" size="6"> <input type="button" name="Submit5" value="输出" onClick="javascript:domvadd_ffff();"></td>
  </tr>
  <tr>
    <td id="mvadd_ffff"></td>
  </tr>
</table>

上面ffff 是字段的名称


点击查看原图


标签:
收藏 0 有帮助 0 没帮助 0 打赏 0
相关教程
给个评价吧