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

home page news is latest 25 entries tagged with "frontpage"

This commit is contained in:
Peter Cowburn
2020-06-29 16:50:50 +01:00
parent 9445ecfd59
commit 69e43607aa

View File

@@ -45,22 +45,15 @@ mirror_setcookie("LAST_NEWS", $_SERVER["REQUEST_TIME"], 60*60*24*365);
$content = "<div class='home-content'>";
$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") {
$frontpage[] = $entry;
if (count($frontpage) >= 25) {
break 2;
}
}
if ($category["term"] == "frontpage") {
$maybe = $entry;
}
}
if ($maybe) {
$frontpage[] = $maybe;
}
}
foreach($frontpage as $entry) {