mirror of
https://github.com/e107inc/e107.git
synced 2025-04-15 18:14:07 +02:00
Fix for news sitelink when alias in use.
This commit is contained in:
parent
ff9666c5f6
commit
950b3c7484
@ -25,11 +25,25 @@ class news_url // plugin-folder + '_url'
|
||||
{
|
||||
$config = array();
|
||||
|
||||
$pref = e107::pref('core','eurl_aliases'); // [en][news]
|
||||
$pref = e107::pref('core','url_aliases'); // [en][news]
|
||||
|
||||
$alias = null;
|
||||
|
||||
if(!empty($pref[e_LAN]))
|
||||
{
|
||||
foreach($pref[e_LAN] as $k=>$v)
|
||||
{
|
||||
if($v === 'news' )
|
||||
{
|
||||
$alias = $k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$config['index'] = array(
|
||||
// 'regex' => '^gallery/?$', // matched against url, and if true, redirected to 'redirect' below.
|
||||
'sef' => (!empty($pref[e_LAN]['news'])) ? $pref[e_LAN]['news'] : 'news', // used by e107::url(); to create a url from the db table.
|
||||
'sef' => (!empty($alias)) ? $alias : 'news', // used by e107::url(); to create a url from the db table.
|
||||
'redirect' => '{e_BASE}news.php', // file-path of what to load when the regex returns true.
|
||||
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user