diff --git a/e107_core/url/news/sef_full_url.php b/e107_core/url/news/sef_full_url.php index 8dc03dfec..00df439f5 100644 --- a/e107_core/url/news/sef_full_url.php +++ b/e107_core/url/news/sef_full_url.php @@ -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/' => 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/' => array('list/short', 'allowVars' => array('page'), 'mapVars' => array('category_sef' => 'name'), 'legacyQuery' => 'cat.{name}.{page}', 'parseCallback' => 'categoryIdByTitle'), 'Short/' => array('list/short', 'allowVars' => array('page'), 'mapVars' => array('category_id' => 'id'), 'legacyQuery' => 'cat.{id}.{page}'), 'Day/' => array('list/day', 'allowVars' => array('page'), 'legacyQuery' => 'day.{id}.{page}'), diff --git a/e107_core/url/news/sef_noid_url.php b/e107_core/url/news/sef_noid_url.php index b7c7bea06..274634623 100644 --- a/e107_core/url/news/sef_noid_url.php +++ b/e107_core/url/news/sef_noid_url.php @@ -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': diff --git a/e107_core/url/news/sef_url.php b/e107_core/url/news/sef_url.php index 9cb5249dd..7f30f7b82 100644 --- a/e107_core/url/news/sef_url.php +++ b/e107_core/url/news/sef_url.php @@ -80,6 +80,9 @@ class core_news_sef_url extends eUrlConfig // 'View/' => array('view/item', 'mapVars' => array('news_sef' => 'name', 'news_id' => 'id'), 'legacyQuery' => 'extend.{name}', 'parseCallback' => 'itemIdByTitle'), // 'View/' => 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//' => array('list/short', 'allowVars' => array('page'), 'mapVars' => array('category_id' => 'id', 'category_sef' => 'name'), 'legacyQuery' => 'cat.{id}.{page}'), ## fallback when name is not provided diff --git a/e107_core/url/news/url.php b/e107_core/url/news/url.php index ce1ab05ba..0563a3064 100644 --- a/e107_core/url/news/url.php +++ b/e107_core/url/news/url.php @@ -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; diff --git a/news.php b/news.php index 33108e216..da7b7ae42 100644 --- a/news.php +++ b/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 .= "
".$tp->parseTemplate("{NEXTPREV={$parms}}")."
"; + $amount = ($action == "all") ? NEWSALL_LIMIT : NEWSLIST_LIMIT; $nitems = defined('NEWS_NEXTPREV_NAVCOUNT') ? '&navcount='.NEWS_NEXTPREV_NAVCOUNT : '' ; $url = rawurlencode(e107::getUrl()->create($newsRoute, $newsUrlparms));