aboutsummaryrefslogtreecommitdiffstats
path: root/en/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'en/index.php')
-rwxr-xr-xen/index.php33
1 files changed, 23 insertions, 10 deletions
diff --git a/en/index.php b/en/index.php
index 3015df71b..f663be13a 100755
--- a/en/index.php
+++ b/en/index.php
@@ -230,21 +230,34 @@ $dictionary = read_translation_file($locale, array('index', 'news', 'common_foot
<div>
<?php
include '../lib/news.php';
- $prefix = '<span style="font-weight: bold;">';
- $prefix .= sprintf(_r('Latest news from our <a href="%s">blog</a>:'), _r('https://blog.mageia.org/en/'));
- $prefix .= '</span> ';
$loc_planet_url = _r('https://planet.mageia.org/en/');
- $loc_blog_url = _r('https://blog.mageia.org/en/');
- $fresh_blog_post_titles = prepare_fresh_blog_post_titles('https://planet.mageia.org/en/', 'https://blog.mageia.org/en/', $loc_planet_url, $loc_blog_url, 1, 1);
+ $loc_blog_url = _r('https://blog.mageia.org/en/');
+ $eng_planet_url = 'https://planet.mageia.org/en/';
+ $eng_blog_url = 'https://blog.mageia.org/en/';
+ $fresh_blog_post_titles = prepare_fresh_blog_post_titles($eng_planet_url, $eng_blog_url, $loc_planet_url, $loc_blog_url, 1, 1);
$fresh_loc_posts = $fresh_blog_post_titles[1];
$num_fresh_loc_posts = $fresh_blog_post_titles[2];
$fresh_eng_posts = $fresh_blog_post_titles[4];
+ $first_source = $fresh_blog_post_titles[5];
$num_fresh_eng_posts = count($fresh_eng_posts);
- if(0 != $num_fresh_loc_posts) {
- show_feed($locale, null, '', '', 0, null, true, $prefix, $fresh_loc_posts);
- }
- if(0 != $num_fresh_eng_posts) {
- show_feed($locale, null, '', '', 0, null, true, $prefix, $fresh_eng_posts);
+ if (0 < $num_fresh_loc_posts || 0 < $num_fresh_eng_posts) {
+ $prefix = '<span style="font-weight: bold;">';
+ if ($first_source == 1) {
+ $prefix .= sprintf(_r('Latest news from our <a href="%s">localized planet</a>:'), $loc_planet_url);
+ } else if ($first_source == 2) {
+ $prefix .= sprintf(_r('Latest news from our <a href="%s">localized blog</a>:'), $loc_blog_url);
+ } else if ($first_source == 3) {
+ $prefix .= sprintf(_r('Latest news from our <a href="%s">English planet</a>:'), $eng_planet_url);
+ } else if ($first_source == 4) {
+ $prefix .= sprintf(_r('Latest news from our <a href="%s">English blog</a>:'), $eng_blog_url);
+ }
+ $prefix .= '</span> ';
+
+ if (0 < $num_fresh_loc_posts) {
+ show_feed($locale, null, '', '', 0, null, true, $prefix, $fresh_loc_posts);
+ } else if (0 < $num_fresh_eng_posts) {
+ show_feed($locale, null, '', '', 0, null, true, $prefix, $fresh_eng_posts);
+ }
}
?>
</div>