Commit: 4c768cf0f8df39e052dae7b8821e48ccbf48a6ef Author: Adam Harvey <[email protected]> Thu, 8 Jun 2017 11:19:49 -0700 Parents: 859307c042a8219f996a4f5fbfd3f15943939388 Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=4c768cf0f8df39e052dae7b8821e48ccbf48a6ef Log: Update the 2017 archive to always show everything. This also removes the $vevent appendix in print_news(), whereby we walked every category even if we'd already found our match to set $vevent, then didn't use it again because it wasn't needed in the new design. That should fix global warming. Changed paths: M archive/2017.php M include/layout.inc Diff: diff --git a/archive/2017.php b/archive/2017.php index bc548dc..b33cf45 100644 --- a/archive/2017.php +++ b/archive/2017.php @@ -18,7 +18,7 @@ site_header("News Archive - 2017"); <?php -print_news($NEWS_ENTRIES, array("conferences", "cfp", "frontpage", "nofrontpage"), 500, 2017); +print_news($NEWS_ENTRIES, null, 500, 2017); /* %s/<a href="\(.*\)"><img src="\/images\/news\/\(.*\)" alt="\(.*\)" width.*><\/a>/<?php news_image("\1", "\2", "\3"); ?>/g */ site_footer(array('elephpants' => true, 'sidebar' => $SIDEBAR_DATA)); diff --git a/include/layout.inc b/include/layout.inc index 3602781..e6ffbb0 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -406,18 +406,15 @@ function print_news($news, $dog, $max = 5, $onlyyear = null, $return = false) { $count = 0; $news = $news ? $news : array(); // default to empty array (if no news) foreach($news as $item) { - $vevent = ""; $ok = false; // Only print entries in the provided s/dog/cat/ egory - // If its a conference, use the hCalendar container + // If $dog is null, everything matches foreach($item["category"] as $category) { - if (in_array($category["term"], (array)$dog)) { + if (is_null($dog) || in_array($category["term"], (array)$dog)) { $ok = true; ++$count; - } - if ($category["term"] === "conferences" || $category["term"] === "cfp") { - $vevent = " vevent"; + break; } } if ($count > $max) { -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
