Location: PHPKode > projects > crelab > creblog/index.php
<?php
include("config.php");
function getNewsList(){
	
   $fileList = array();
   
	if ($handle = opendir("news")) {

		while ($file = readdir($handle))  {
		    if (!is_dir($file)) {
		       $fileList[] = $file;
      	}
		}
	}	
	
	rsort($fileList);
	
	return $fileList;
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
   <title><?php echo $title ?></title>
   <?php echo $choosenStyle ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body><br><br>
  <div id="main">
    <div id="caption"><?php echo $title ?><br> <div id="caption2"><?php echo $subtitle ?></div></div>
    <table width="100%">
    
    <?php
    
      $list = getNewsList();
      foreach ($list as $value) {
      	$newsData = file("news/".$value);
      	$newsTitle  = $newsData[0];
         $submitDate = $newsData[1];	
		 $newsName = $newsData[3];
		 $newsLinkPfad = $newsData[4];
		 $newsLinkText = $newsData[5];
         unset ($newsData['0']);
         unset ($newsData['1']);
		 unset ($newsData['3']);
      	 unset ($newsData['4']);
		 unset ($newsData['5']);
		 
         $newsContent = "";
         foreach ($newsData as $value) {
    	       $newsContent .= $value;
         }
      	
      	echo "<tr><th align='left'><div class='headline'>$newsTitle</div></th><th align='right'><div class='date'></div></th></tr>";
      	echo "<tr><td colspan='2'><div class='content'>".$newsContent."<br><div class='contentlink'> $writtenon $submitDate $writtenby $newsName | Link: <a href='$newsLinkPfad'>$newsLinkText</a></div></div><br></td></tr>";
      }
    ?>
    </table>
	 <div id="source">simple blogging system by <a href="http://crelab.de">crelab.de</a></div>
  </div>
</body>   
Return current item: crelab