Dedecms图集上传zip压缩包解压图片顺序不对问题的解决方法
<p><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>其实这并不是DEDECMS解压出错,而是因为DEDECMS排列图标顺序是按解压时间的前后来排列的,知道了原因,我们只要改变DEDECMS默认的排列规则就可以解决这个问题了。大家可以看到: dedecms管理后台目录:dede/album_add.php 找到这段代码:</span></p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<p class="right">
<span><u>复制代码</u></span></p>
<p>
代码如下:</p>
</div>
<p class="msgborder" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
$z = new zip(); $z->ExtractAll($zipfile,$tmpzipdir); $fm = new FileManagement(); $imgs = array(); $fm->GetMatchFiles($tmpzipdir,"jpg|png|gif",$imgs);</p>
<p>
<span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>在这个代码的后面加入如下代码</span></p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
<p class="right">
<span><u>复制代码</u></span></p>
<p>
代码如下:</p>
</div>
<p class="msgborder" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
//调整解压缩出来的数组 $tmpimgs = array(); foreach($imgs as $k=>$v){ preg_match_all("//(d+)./",$v,$kk); $tmpimgs[$kk-1] = $v; } ksort($tmpimgs); $imgs = $tmpimgs; unset($tmpimgs);</p>
頁:
[1]