From 6d4cbd76020cf926132f53abe63404c948a65d50 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Mon, 9 May 2016 12:28:51 +0000 Subject: [PATCH] #simeox Fix EN locale (environment setting problem), disable infinite news loop and prevent untranslated/empty news items from appearing. @0h30 --- framework/application/Simeox/News.php | 4 +++- index.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/application/Simeox/News.php b/framework/application/Simeox/News.php index b5f20ea..cd1c758 100644 --- a/framework/application/Simeox/News.php +++ b/framework/application/Simeox/News.php @@ -7,7 +7,7 @@ class Simeox_News { public static function getNews($page = 1, $perPage = 3) { //###TEMPORARY! Produce endless stream of data for testing infinite scroll - $page = ($page > 1) ? 1 : $page; + //$page = ($page > 1) ? 1 : $page; //fb('Fetching page #'. $page); @@ -24,6 +24,8 @@ class Simeox_News { foreach ($news_result as $n) { + if (empty($n->headline)) continue; // Skip untranslated / empty articles + $date = new CubeIT_Date($n->date, CubeIT_Date::MYSQL); $news[] = array( diff --git a/index.php b/index.php index 73a995e..bda1522 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ $start = microtime(true); ini_set('log_errors', '1'); ini_set('error_log', dirname(__FILE__) . '/log/php_error.log'); -if ($_SERVER['HTTP_HOST'] == 'simeox.dev.cubedesigners.com') { +if (strpos($_SERVER['HTTP_HOST'], 'dev.cubedesigners.com') !== false) { define('APPLICATION_ENV', 'testing'); } else if ($_SERVER['HTTP_HOST'] == 'www.') { define('APPLICATION_ENV', 'production'); -- 2.39.5