Skip to content

Commit

Permalink
WEB: Fix showing translated news
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Nov 23, 2015
1 parent 5fdcb35 commit c56a00a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/Models/NewsModel.php
Expand Up @@ -67,9 +67,8 @@ static public function getOneByDate($date, $processContent = false) {
throw new ErrorException(self::INVALID_DATE);
}
global $lang;
if (!is_file(($fname = DIR_NEWS . "$lang/{$date}.xml"))
if (!is_file(($fname = DIR_NEWS . "/$lang/{$date}.xml"))
|| !is_readable($fname) || !($data = @file_get_contents($fname))) {

if (!is_file(($fname = DIR_NEWS . "/{$date}.xml"))
|| !is_readable($fname) || !($data = @file_get_contents($fname))) {
throw new ErrorException(self::FILE_NOT_FOUND);
Expand All @@ -88,10 +87,11 @@ static public function getAllByDate($date, $processContent = false) {
throw new ErrorException(self::FILE_NOT_FOUND);
}
natsort($files);
global $lang;
$files = array_reverse($files);
$news = array();
foreach ($files as $filename) {
if (!is_file(($fname = DIR_NEWS . "$lang/" . basename($file)))
if (!is_file(($fname = DIR_NEWS . "/$lang/" . basename($filename)))
|| !is_readable($fname) || !($data = @file_get_contents($fname))) {
if (($data = @file_get_contents($filename))) {
$news[] = new News($data, $filename, $processContent);
Expand Down

0 comments on commit c56a00a

Please sign in to comment.