cvs: phpweb /include layout.inc

From: Date: Sat, 29 Dec 2007 14:45:09 +0000
Subject: cvs: phpweb /include layout.inc
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-752@lists.php.net to get a copy of this message
bjori Sat Dec 29 14:45:09 2007 UTC Modified files: /phpweb/include layout.inc Log: Add the possibility to only print specific year http://cvs.php.net/viewvc.cgi/phpweb/include/layout.inc?r1=1.270&r2=1.271&diff_format=u Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.270 phpweb/include/layout.inc:1.271 --- phpweb/include/layout.inc:1.270 Sat Dec 1 18:31:28 2007 +++ phpweb/include/layout.inc Sat Dec 29 14:45:09 2007 @@ -1,5 +1,5 @@ <?php -/* $Id: layout.inc,v 1.270 2007/12/01 18:31:28 bjori Exp $ */ +/* $Id: layout.inc,v 1.271 2007/12/29 14:45:09 bjori Exp $ */ // Set the static content root differently on php.net $_SERVER['STATIC_ROOT'] = ($MYSITE == 'http://www.php.net/') ? @@ -609,8 +609,11 @@ } // Print news -function print_news($news) { +function print_news($news, $year = false) { foreach($news as $item) { + if ($year && $year != date("Y", strtotime($item["date"]))) { + continue; + } $image = ""; if($item["image"]) { $image = news_image($item["image"]["link"], $item["image"]["image"], $item["image"]["title"]);

« previous php.webmaster (#752) next »