> Archiv"; include "$DOCUMENT_ROOT/header.php"; $filename = 'archiv.txt'; $array = array(); $date = array(); if (file_exists($filename)) { $fp = fopen($filename, "r"); } else { exit("Das Sendungsarchiv ist nicht verfügbar.");; } for ($i=0; !feof ($fp) && $buffer = fgets($fp, 4096); $i++) { $array[$i] = split(";", $buffer); $date = split('[.]', $array[$i][2]); $array[$i][4] = mktime(0, 0, 0, $date[1], $date[0], $date[2]); if ($array[$i][1]) $array[$i][1] = ' (' . $array[$i][1] . ')'; } fclose($fp); function cmp_date ($a, $b) { if ($a[4] == $b[4]) return 0; return ($a[4] > $b[4]) ? -1 : 1; } function cmp_sender ($a, $b) { if ($a[3] == $b[3]) return 0; return ($a[3] < $b[3]) ? -1 : 1; } function cmp_reihe ($a, $b) { $x = $a; $y = $b; $x = preg_replace("/^\W+/", "", $x); $y = preg_replace("/^\W+/", "", $y); if ($x[1] == $y[1]) return 0; return ($x[1] < $y[1]) ? -1 : 1; } function cmp_title ($a, $b) { // $x = strtolower($a); // $y = strtolower($b); // $x = preg_replace("/^\W+/", "", $x); // $y = preg_replace("/^\W+/", "", $y); // return strcmp($x, $y); if ($a[0] == $b[0]) return 0; return ($a[0] < $b[0]) ? -1 : 1; } if ($sort == "titel") usort($array, "cmp_title"); elseif ($sort == "reihe") usort($array, "cmp_reihe"); elseif ($sort == "sender") usort($array, "cmp_sender"); else usort($array, "cmp_date"); ?>

Um eine andere Sortierreihenfolge zu erhalten klicken Sie auf die jeweilige Spaltenüberschrift.

", $array[$l][0], $array[$l][3], $array[$l][1], $array[$l][2]); } ?>
Sendungstitel Sender (Reihe) Datum
%s%s%s%s