mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 04:38:27 +01:00
Fix for gsitemap SEF URL Aliases
This commit is contained in:
parent
c889d666b9
commit
3592c5ae30
@ -36,8 +36,8 @@ class gsitemap_url // plugin-folder + '_url'
|
||||
|
||||
$config['xml'] = array(
|
||||
'alias' => 'sitemap',
|
||||
'regex' => '^sitemap\.xml$', // matched against url, and if true, redirected to 'redirect' below.
|
||||
'sef' => 'sitemap.xml', // used by e107::url(); to create a url from the db table.
|
||||
'regex' => '^{alias}\.xml$', // matched against url, and if true, redirected to 'redirect' below.
|
||||
'sef' => '{alias}.xml', // used by e107::url(); to create a url from the db table.
|
||||
'redirect' => '{e_BASE}gsitemap.php', // file-path of what to load when the regex returns true.
|
||||
|
||||
);
|
||||
@ -48,14 +48,16 @@ class gsitemap_url // plugin-folder + '_url'
|
||||
{
|
||||
foreach($item as $data )
|
||||
{
|
||||
$key = $plug.'-'.$data['sef']; // eg. news-latest
|
||||
$key = $plug.'-'.$data['sef']; // eg. news-posts
|
||||
$config[$key] = array(
|
||||
'alias' => $key,
|
||||
'regex' => '^'.$key.'-sitemap\.xml$', // matched against url, and if true, redirected to 'redirect' below.
|
||||
'sef' => $key.'-sitemap.xml', // used by e107::url(); to create a url from the db table.
|
||||
'alias' => $key.'-sitemap',
|
||||
'regex' => '^{alias}\.xml$', // matched against url, and if true, redirected to 'redirect' below.
|
||||
'sef' => '{alias}.xml', // used by e107::url(); to create a url from the db table.
|
||||
'redirect' => '{e_BASE}gsitemap.php?plug='.$plug.'&func='.$data['function'], // file-path of what to load when the regex returns true.
|
||||
|
||||
);
|
||||
|
||||
// var_dump($config);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ class news_gsitemap
|
||||
|
||||
// Viewable from my-website.com/news-latest-sitemap.xml ie. plugin-folder + function + 'sitemap.xml'
|
||||
$config[] = array(
|
||||
'name' => "Latest News Posts",
|
||||
'function' => "latestPosts",
|
||||
'sef' => 'latest', // used in URL. eg. news-latest-sitemap.xml
|
||||
'name' => "All News Posts",
|
||||
'function' => "allPosts",
|
||||
'sef' => 'posts', // used in URL. eg. news-posts-sitemap.xml @see e107_plugins/gsitemap/e_url.php L45
|
||||
);
|
||||
|
||||
return $config;
|
||||
@ -97,7 +97,7 @@ class news_gsitemap
|
||||
|
||||
|
||||
/* Custom Function for dynamic sitemap of news posts */
|
||||
public function latestPosts()
|
||||
public function allPosts()
|
||||
{
|
||||
$data = $this->getNewsPosts();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user