com web/php: home page news is latest 25 entries tagged with "frontpage": index.php
| From: | Peter Cowburn | Date: | Tue, 25 Aug 2020 13:52:47 +0000 |
| Subject: | com web/php: home page news is latest 25 entries tagged with "frontpage": index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-28748@lists.php.net to get a copy of this message | ||
Commit: 69e43607aa49a54c685db6891d8537e67502e1c2
Author: Peter Cowburn <salathe@php.net> Mon, 29 Jun 2020 16:50:50 +0100
Parents: 9445ecfd592c075cb593ae3b636e953e40b087b5
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=69e43607aa49a54c685db6891d8537e67502e1c2
Log:
home page news is latest 25 entries tagged with "frontpage"
Changed paths:
M index.php
Diff:
diff --git a/index.php b/index.php
index 3dc7505df..ad1977842 100644
--- a/index.php
+++ b/index.php
@@ -45,23 +45,16 @@ 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") {
- $maybe = $entry;
+ $frontpage[] = $entry;
+ if (count($frontpage) >= 25) {
+ break 2;
+ }
}
}
- if ($maybe) {
- $frontpage[] = $maybe;
- }
}
foreach($frontpage as $entry) {
$link = preg_replace('~^(http://php.net/|https://www.php.net/)~', '', $entry["id"]);