Hi, wie kann ich das hier nicht nach ABC , sondern nach Dateidatum sortieren?
PHP
<?php
//////////// Currently Not working ////////////////
include ("template.php");
include ("config.ini.php");
global $version,$powered,$sitedomain, $folder,$rsspath,$datefolder,$sitetitle,$fileextention;
$list = explode("%content%", $templ);
$listtop = str_replace("%sitetitle%",$sitetitle." - News Archive",$list[0]);
echo $listtop;
?>
<table width="100%"><form action="news_archive.php" method="get" id="arch">
<td><h1> Articles and News for
<?php
if(!$dir){
echo date("My");
}
else{
echo $dir;
}
?></h1></td>
<?php
if($datefolder=="true" AND !$dir){
$loc = $rsspath.date("My")."feed/";
}
elseif($dir){
$loc = $rsspath.$dir."/";
}
else{
$loc = $rsspath;
}
?>
</form>
</table>
<ul id="linklist">
<?php
$dirpath = $loc;
$dir = opendir($dirpath);
$files = array();
while ($file = readdir($dir)) {
$localpath = $dirpath.$file;
if (is_file($localpath)) {
$key = filemtime($localpath).md5($file);
$files[$key] = $file;
}
}
sort($files);
foreach (glob($loc."*.rss*") as $file) {
$chunk = substr(chunk_split(str_replace(".htm", "", str_replace(".html", "", str_replace(".txt", "", $file))), 2, '.'), 0, -1);
$url = str_replace($rsspath,"",$file);
/* title - start */
$fcontents = implode ('', file ($url));
$fcontents = stristr($fcontents, '<title>');
$rest = substr($fcontents, 7);
$extra = stristr($fcontents, '</title>');
$titlelen = strlen($rest) - strlen($extra);
$gettitle = trim(substr($rest, 0, $titlelen));
$gettitle = str_replace($sitetitle." - ","",$gettitle);
/* title - end */
echo "[*]<a href=\"$url\">".$gettitle."</a>\n";
}
if($datefolder=="true"){
foreach (glob($rsspath."*feed") as $dirtname) {
$dirtname = str_replace($rsspath,"",$dirtname);
$sel = $sel. "<a href='news_archive.php?dir=$dirtname'>$dirtname<a> | ";
}
echo "[/list]";
echo "All Archives: ".$sel;
}
?>
<?php echo str_replace("%desc%","HausLinks.de\n",$list[1]); ?>
Alles anzeigen
THX for your help! http://www.mylol.de