"; $releasenews = 0; $frontpage = array(); foreach($NEWS_ENTRIES as $entry) { $maybe = false; foreach($entry["category"] as $category) { if ($category["term"] == "releases") { if ($releasenews++ > 5) { continue 2; } } if ($category["term"] == "frontpage") { $maybe = $entry; } } if ($maybe) { $frontpage[] = $maybe; } } foreach($frontpage as $entry) { $link = substr($entry["id"], 15); // Strip http://php.net/ $id = parse_url($entry["id"], PHP_URL_FRAGMENT); $date = date_create($entry['updated']); $date_human = date_format($date, 'd M Y'); $date_w3c = date_format($date, DATE_W3C); $content .= <<

{$entry["title"]}

{$entry["content"]}
NEWSENTRY; } $content .= '

Older News Entries

'; $content .= ""; $intro = <<

PHP is a popular general-purpose scripting language that is especially suited to web development.

Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

Download PHP

EOF; if(!empty($RELEASES[5])) { $intro .= "
    \n"; foreach ($RELEASES[5] as $version => $release) { $intro .= "
  • $version Release Notes
  • \n"; } $intro .= "
\n"; } $intro .= <<
EOF; // Write out common header site_header("Hypertext Preprocessor", array( 'current' => 'home', 'headtags' => array( '', '' ), 'link' => array( array( "rel" => "search", "type" => "application/opensearchdescription+xml", "href" => $MYSITE . "phpnetimprovedsearch.src", "title" => "Add PHP.net search" ), array( "rel" => "alternate", "type" => "application/atom+xml", "href" => $MYSITE . "releases/feed.php", "title" => "PHP Release feed" ), ), 'css' => array('home.css'), 'intro' => $intro ) ); // Print body of home page. echo $content; // Prepare announcements. if (is_array($CONF_TEASER)) { $conftype = array( 'conference' => 'Upcoming conferences', 'cfp' => 'Conferences Calling for papers', ); $announcements = ""; foreach($CONF_TEASER as $category => $entries) { if ($entries) { $announcements .= '
'; $announcements .= ' ' . $conftype[$category] .''; $announcements .= '
    '; foreach (array_slice($entries, 0, 4) as $url => $title) { $title = preg_replace("'([A-Za-z0-9])([\s\:\-\,]*?)call for(.*?)$'i", "$1", $title); $announcements .= "
  • $title
  • "; } $announcements .= '
'; $announcements .= '
'; } } } else { $announcements = ''; } $SIDEBAR = <<< SIDEBAR_DATA

Upgrading to PHP5.5

$announcements

User Group Events

Special Thanks

SIDEBAR_DATA; // Print the common footer. site_footer( array( "atom" => "/feed.atom", // Add a link to the feed at the bottom 'elephpants' => true, 'sidebar' => $SIDEBAR ) );