Skip to content

Commit

Permalink
Additional fix for change set 5838daf
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Jan 13, 2017
1 parent d10e868 commit e052eba
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
30 changes: 16 additions & 14 deletions public_html/admin/syndication.php
Expand Up @@ -33,7 +33,6 @@
/**
* Content syndication administration page: Here you can create, edit, and
* delete feeds in various formats for Geeklog and its plugins.
*/

/**
Expand Down Expand Up @@ -132,8 +131,7 @@ function find_feedFormats()
global $_CONF;

// Import the feed handling classes:
require_once $_CONF['path_system']
. '/classes/syndication/parserfactory.class.php';
require_once $_CONF['path_system'] . '/classes/syndication/parserfactory.class.php';

$factory = new FeedParserFactory ();
$formats = $factory->getFeedTypes();
Expand Down Expand Up @@ -170,15 +168,17 @@ function listfeeds()
$defsort_arr = array('field' => 'title', 'direction' => 'asc');

$menu_arr = array(
array('url' => $_CONF['site_admin_url'] . '/syndication.php?mode=edit',
'text' => $LANG_ADMIN['create_new']),
array('url' => $_CONF['site_admin_url'],
'text' => $LANG_ADMIN['admin_home']),
array(
'url' => $_CONF['site_admin_url'] . '/syndication.php?mode=edit',
'text' => $LANG_ADMIN['create_new'],
),
array(
'url' => $_CONF['site_admin_url'],
'text' => $LANG_ADMIN['admin_home'],
),
);

$retval .= COM_startBlock($LANG33[10], '',
COM_getBlockTemplate('_admin_block', 'header'));

$retval .= COM_startBlock($LANG33[10], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu(
$menu_arr,
$LANG33[13],
Expand All @@ -190,10 +190,12 @@ function listfeeds()
'form_url' => $_CONF['site_admin_url'] . '/syndication.php',
);

$query_arr = array('table' => 'syndication',
'sql' => "SELECT *,UNIX_TIMESTAMP(updated) AS date FROM {$_TABLES['syndication']} WHERE 1=1",
'query_fields' => array('title', 'filename'),
'default_filter' => '');
$query_arr = array(
'table' => 'syndication',
'sql' => "SELECT *,UNIX_TIMESTAMP(updated) AS date FROM {$_TABLES['syndication']} WHERE 1=1",
'query_fields' => array('title', 'filename'),
'default_filter' => '',
);

// this is a dummy variable so we know the form has been used if all feeds
// should be disabled in order to disable the last one.
Expand Down
6 changes: 3 additions & 3 deletions system/lib-admin.php
Expand Up @@ -1231,7 +1231,7 @@ function ADMIN_getListField_syndication($fieldName, $fieldValue, $A, $icon_arr,

case 'updated':
if ($A['is_enabled'] == 1) {
$retval = strftime($_CONF['daytime'], $A['date']);
list($retval,) = COM_getUserDateTimeFormat($A['date'], 'daytime');
} else {
$retval = $LANG_ADMIN['na'];
}
Expand Down Expand Up @@ -1259,8 +1259,8 @@ function ADMIN_getListField_syndication($fieldName, $fieldValue, $A, $icon_arr,
break;

case 'filename':
$url = SYND_getFeedUrl();
$retval = COM_createLink($A['filename'], $url . $A['filename']);
$url = SYND_getFeedUrl($A['filename']);
$retval = COM_createLink(basename($A['filename']), $url);
break;

default:
Expand Down
7 changes: 4 additions & 3 deletions system/lib-syndication.php
Expand Up @@ -632,9 +632,10 @@ function SYND_getFeedUrl($feedFile = '')
global $_CONF;

$feedPath = SYND_getFeedPath();
$url = substr_replace($feedPath, $_CONF['site_url'], 0, strlen($_CONF['path_html']) - 1);
$url = str_replace($url, DIRECTORY_SEPARATOR, '/'); // Need to do this for file will contain wrong backslash
$url .= $feedFile;
$feedPath = str_replace(DIRECTORY_SEPARATOR, '/', $feedPath);
$pathHtml = str_replace(DIRECTORY_SEPARATOR, '/', $_CONF['path_html']);
$relPath = str_replace($pathHtml, '', $feedPath);
$url = $_CONF['site_url'] . '/' . $relPath . basename($feedFile);

return $url;
}
Expand Down

0 comments on commit e052eba

Please sign in to comment.