<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

自定义DedeCMS后台图集上传图片文件名称顺序显示

时间:2020-12-15

在使用DedeCMS图集功能做图集的时候我们常常希望上传的图片能够按照图片名字的顺序进行显示,这就关联到程序改动了,修改方为打开dede/album_add.php (默认后台目录为dede,如若更改过,请自行调整),找到:

$z = new zip();
$z->ExtractAll($zipfile,$tmpzipdir);
$fm = new FileManagement();
$imgs = array();
$fm->GetMatchFiles($tmpzipdir,"jpg|png|gif",$imgs);

后面添加如下代码:

$tmpimgs = array();
foreach($imgs as $k=>$v){
preg_match_all("/\/(\d+)\./",$v,$kk);
$tmpimgs[$kk[1][0]-1] = $v;
}
ksort($tmpimgs);
$imgs = $tmpimgs;
unset($tmpimgs);

同理修改album_edit.php这个文件,在相同的代码后面添加上面的代码。这样就可以解决按图片名称进行排序了,比如我们要上传的图片名为1.jpg,2.jpg,3.jpg,4.jpg,这样上传的图片就会按照1234顺序显示。

0
首页
案例
关于
联系