Location: PHPKode > projects > NewsP > newsbox.php
<?
$st="steuerfiles/";
$archive="archive.php";
$steuerfiles2="$steuerfiles$st";
$jetzt = time();
$file_ext = '.txt'; 
$folder = openDir($steuerfiles2);
while ($file = readDir($folder)) {
if ($file != "." && $file != "..") {
if($file != substr_count($file, $file_ext)) {
$name = explode(".",$file);
$position_des_letzten_punktes = strrpos($file, '.');
$zeit = substr($file, 0, $position_des_letzten_punktes);
if ($jetzt > $zeit) {
$input_files_akt[] = $file; // 
}}}}
closeDir($folder);
@rsort($input_files_akt);
$za=count($input_files_akt);
### S E T T I N G S   E I N L E S E N ####################
$settings = "settings";
$speicher = "$steuerfiles$settings/p_settings.txt";
$zaehlfile = fopen("$speicher","r"); 
$inhalt_zaehlfile = fgets($zaehlfile);  
fclose($zaehlfile); 
$domains = unserialize($inhalt_zaehlfile);
$a=$domains[anz_headl];
$anz_arch=$domains[anz_arch];
##############################################
$zb = 0;
if($a > $za)
{$a = $za;}
while ($zb <= $a)
{
$kaehlfile = fopen("$steuerfiles2$input_files_akt[$zb]","r"); 
	$inhalt_kaehlfile = fgets($kaehlfile);  
	fclose($kaehlfile); 
	$inhalt_akt = explode('รค',$inhalt_kaehlfile);
$tops_date[] = $inhalt_akt[0];
$tops_url[] = $inhalt_akt[2];
$tops_titel[] = $inhalt_akt[3];
$zb++;
}
$ztop=0;
while ($ztop < $a){
$datum_ag= strftime("$domains[outform_time]", $tops_date[$ztop]); 
echo "<I><A HREF=\"$nburl$tops_url[$ztop]\" class=\"head\" TARGET=\"_parent\"><I>$datum_ag $tops_titel[$ztop]</I></A></I><BR>";
$ztop++;
}
if ($anz_arch =='ja'){
echo"<A HREF=\"$nburl$archive?n=$a\" class=\"head\">[...Archive...]</A>";
}
?>
Return current item: NewsP