Ak chceš opačné poradie, skús takto:
// get images
function getItems($path, $valid, $list) {
global $cfg;
global $l;
$path = str_replace('//','/', $path); // remove double slash in path if any
$retstr = '';
if ($handle = @opendir($path)) {
$files = array();
$files_time = array();
$valids = implode('|', $valid);
while (($file = readdir($handle)) !== false) {
if (is_file($path . $file) && eregi('\.(' . $valids . ')$', $file, $matches)) {
$files[$path . $file] = $matches[0];
$files_time[$path . $file] = -(filectime($path . $file));
}
}
closedir($handle);
array_multisort($files_time, $files);
unset($files_time);
$dfmt = "d.m.Y H:i:s";
foreach ($files as $filename => $ext) {
$size = @getimagesize($path . basename($filename));
if( $size === false ) {
continue;
}
$fsize = filesize($path . basename($filename));
$modified = date($dfmt, filemtime($path . basename($filename)));
$created = date($dfmt, filectime($path . basename($filename)));
$ctype = iType($size[2]);
if ($list == true || $list == 1) {
$retstr .= '<li class="cimgup" ifile="' . basename($filename) . '" iwidth="' . htmlentities($size[0], ENT_QUOTES) . '" iheight="' . htmlentities($size[1], ENT_QUOTES) . '" itype="' . htmlentities($size[2] . '|' . $ctype, ENT_QUOTES) . '" imdate="' . htmlentities($modified, ENT_QUOTES) . '" icdate="' . htmlentities($created, ENT_QUOTES) . '" isize="' .filesize_h($fsize,2) . '">' . htmlentities(basename($filename), ENT_QUOTES,$l->getCharset()) . '</li>' . "\n";
} else {
$src = 'phpThumb/phpThumb.php?src=' . absPath(str_replace($cfg['root_dir'],'', $path)) . basename($filename) . '&w=48&h=48&far=1&bg=ffffff&f=jpg';
$retstr .= '<li class="cimgup" ifile="' . basename($filename) . '" iwidth="' . htmlentities($size[0], ENT_QUOTES) . '" iheight="' . htmlentities($size[1], ENT_QUOTES) . '" itype="' . htmlentities($size[2] . '|' . $ctype, ENT_QUOTES) . '" imdate="' . htmlentities($modified, ENT_QUOTES) . '" icdate="' . htmlentities($created, ENT_QUOTES) . '" isize="' .filesize_h($fsize,2) . '">' . '<img src="' . $src . '" width="48" height="48" alt="' . basename($filename) . '; ' . htmlentities($size[0], ENT_QUOTES) . ' x ' . htmlentities($size[1], ENT_QUOTES) . 'px;' . '" title="' . basename($filename) . '; ' . htmlentities($size[0], ENT_QUOTES) . ' x ' . htmlentities($size[1], ENT_QUOTES) . 'px;' . '"/>' . '</li>' . "\n";
}
}
return $retstr;
}
echo $l->m('er_036');
return false;
}
Celkem upraveno 2×. Poslední úprava pa3k v 26.01.2010 21:58.