diff options
author | filip <filip.komar@gmail.com> | 2018-04-28 15:16:43 +0200 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2018-04-28 15:16:43 +0200 |
commit | 293678e2649784a383549b4f72987c30ae04fed4 (patch) | |
tree | 0895cc9bed83897e87449b2a1b0375eaecca9972 /en/index.php | |
parent | 3057be07aa38970f060a41a5a125e9ae0a286021 (diff) | |
download | www-293678e2649784a383549b4f72987c30ae04fed4.tar www-293678e2649784a383549b4f72987c30ae04fed4.tar.gz www-293678e2649784a383549b4f72987c30ae04fed4.tar.bz2 www-293678e2649784a383549b4f72987c30ae04fed4.tar.xz www-293678e2649784a383549b4f72987c30ae04fed4.zip |
proper blog/planet source description
+ remove description if neither works
Diffstat (limited to 'en/index.php')
-rwxr-xr-x | en/index.php | 33 |
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> |