mirror of
https://github.com/e107inc/e107.git
synced 2025-07-25 00:41:52 +02:00
Fixied missing legacy route list/all
This commit is contained in:
@@ -30,7 +30,8 @@ class core_news_sef_full_url extends eUrlConfig
|
||||
'/' => array('list/items', 'allowVars' => array('page'), 'legacyQuery' => 'default.0.{page}', ),
|
||||
'Category' => array('list/items', 'allowVars' => array('page'), 'legacyQuery' => 'default.0.{page}', ),
|
||||
'Category/<name:{sefsecure}>' => array('list/category', 'allowVars' => array('page'), 'mapVars' => array('category_sef' => 'name'), 'legacyQuery' => 'list.{name}.{page}', 'parseCallback' => 'categoryIdByTitle'),
|
||||
|
||||
'All' => array('list/all', 'allowVars' => array('page'), 'legacyQuery' => 'all.0.{page}'),
|
||||
|
||||
'Short/<name:{sefsecure}>' => array('list/short', 'allowVars' => array('page'), 'mapVars' => array('category_sef' => 'name'), 'legacyQuery' => 'cat.{name}.{page}', 'parseCallback' => 'categoryIdByTitle'),
|
||||
'Short/<id:{number}>' => array('list/short', 'allowVars' => array('page'), 'mapVars' => array('category_id' => 'id'), 'legacyQuery' => 'cat.{id}.{page}'),
|
||||
'Day/<id:{number}>' => array('list/day', 'allowVars' => array('page'), 'legacyQuery' => 'day.{id}.{page}'),
|
||||
|
@@ -89,6 +89,11 @@ class core_news_sef_noid_url extends eUrlConfig
|
||||
$r[0] = '';
|
||||
if($page) $parm = array('page' => $page); // news?page=xxx
|
||||
break;
|
||||
|
||||
case 'all':
|
||||
$r[0] = 'All';
|
||||
if($page) $parm = array('page' => $page); // news/All?page=xxx
|
||||
break;
|
||||
|
||||
case 'category':
|
||||
case 'short':
|
||||
|
@@ -80,6 +80,9 @@ class core_news_sef_url extends eUrlConfig
|
||||
// 'View/<name:{sefsecure}>' => array('view/item', 'mapVars' => array('news_sef' => 'name', 'news_id' => 'id'), 'legacyQuery' => 'extend.{name}', 'parseCallback' => 'itemIdByTitle'),
|
||||
// 'View/<id:{number}>' => array('view/item', 'mapVars' => array('news_id' => 'id'), 'legacyQuery' => 'extend.{id}'),
|
||||
|
||||
## All news
|
||||
'All' => array('list/all', 'allowVars' => array('page'), 'legacyQuery' => 'all.0.{page}'),
|
||||
|
||||
## URL with ID and Title - no DB call, balanced performance!
|
||||
'Short/<id:{number}>/<name:{sefsecure}>' => array('list/short', 'allowVars' => array('page'), 'mapVars' => array('category_id' => 'id', 'category_sef' => 'name'), 'legacyQuery' => 'cat.{id}.{page}'),
|
||||
## fallback when name is not provided
|
||||
|
@@ -129,6 +129,10 @@ class core_news_url extends eUrlConfig
|
||||
if(!vartrue($params['id'])) $url .= 'default.0.'.$page;
|
||||
else $url .= 'list.'.$params['id'].'.'.$page;
|
||||
break;
|
||||
|
||||
case 'all':
|
||||
$url .= 'all.'.$params['id'].'.'.$page;
|
||||
break;
|
||||
|
||||
case 'short':
|
||||
$url .= 'cat.'.$params['id'].'.'.$page;
|
||||
|
6
news.php
6
news.php
@@ -116,6 +116,11 @@ $nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
|
||||
break;
|
||||
}
|
||||
}
|
||||
elseif($action == 'all')
|
||||
{
|
||||
$newsRoute = 'list/all';
|
||||
$newsUrlparms['id'] = $sub_action;
|
||||
}
|
||||
else $newsRoute = 'list/items';
|
||||
$newsRoute = 'news/'.$newsRoute;
|
||||
|
||||
@@ -254,6 +259,7 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag']))
|
||||
// $parms = $news_total.",".$amount.",".$newsfrom.",".e_SELF.'?'.$action.".".$category.".[FROM]";
|
||||
//
|
||||
// $text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>";
|
||||
|
||||
$amount = ($action == "all") ? NEWSALL_LIMIT : NEWSLIST_LIMIT;
|
||||
$nitems = defined('NEWS_NEXTPREV_NAVCOUNT') ? '&navcount='.NEWS_NEXTPREV_NAVCOUNT : '' ;
|
||||
$url = rawurlencode(e107::getUrl()->create($newsRoute, $newsUrlparms));
|
||||
|
Reference in New Issue
Block a user