1
0
mirror of https://github.com/php/web-php.git synced 2026-03-26 00:02:12 +01:00

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.
This commit is contained in:
Adam Harvey
2017-06-08 11:19:49 -07:00
parent 859307c042
commit 4c768cf0f8
2 changed files with 4 additions and 7 deletions

View File

@@ -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));

View File

@@ -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) {