rendered paste body<?php/** * NEWS_DIR */define('NEWS_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'news/');/** * NEWS_DATE_FORMAT */define('NEWS_DATE_FORMAT', 'l, jS F Y');?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><!-- Mint script with page name override --><script type="text/javascript">// <![CDATA[var Mint_SI_DocumentTitle = 'News';// ]]></script><script src="/mint/?js" type="text/javascript"></script><!-- Mint script with page name override --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Southport web design, web development and hosting services consultancy - DannyWeb Limited</title><meta name="Keywords" content="Web design, web site design, web development, web site development, Southport, DannyWeb, ecommerce, north west, website design, website development, design consultancy, Southport web designers, marketing Southport, marketing services Southport, marketing agency Southport, graphic design, new media" /><meta name="Description" content="Southport-based web development and design consultancy providing web design. Southport agency working for clients across the UK on corporate web sites, interactive web sites and ecommerce web sites. " /><link href="css/dannyweb.css" rel="stylesheet" type="text/css" /><!-- compliance patch for microsoft browsers --><!--[if lt IE 7]><script src="ie7/ie7-standard-p.js" type="text/javascript"></script><![endif]--></head><body><div id="centre1"> <div id="centre2"> <div id="mainbox"> <div id="top"> <div id="top-left"> <div id="header"> <ul> <li> <a href="index.htm">home</a> </li> <li id="current"> <a href="news.htm">news</a></li> <li> <a href="aboutus.htm">about us</a></li> <li> <a href="services.htm">services</a></li> <li> <a href="portfolio.htm">portfolio</a></li> <li> <a href="contactus.htm">contact us</a></li> </ul> </div> </div> <div id="logo"><img src="img/logo.gif" alt="DannyWeb Limited" width="250" height="78" /> </div> </div> <div id="work2"> <h2>News </h2><?php$i = 1;foreach (list_news_entries(NEWS_DIR) as $timestamp=>$body){ ?> <div id="news<?php echo $i; ?>"> <h4><?php echo date(NEWS_DATE_FORMAT, $timestamp); ?></h4> <?php echo $body; ?> </div> <?php $i++;}?> </div><div id="footer"><p><a href="http://validator.w3.org/check/referer">Website built to W3C Web Standards</a> | © 2006 DannyWeb Limited | Design, Build, Host</p></div></div></div></div></body></html><?php/** * get list of news entries. * * @param string $directory * @return array */function list_news_entries($directory){ $news = array(); $od = opendir($directory); while (($file = readdir($od)) !== false) { if ($file !== '.' && $file !== '..') $news[filectime("$directory/$file")] = file_get_contents("$directory/$file"); } krsort($news); closedir($od); return $news;}?>