diff --git a/bl-kernel/helpers/paginator.class.php b/bl-kernel/helpers/paginator.class.php
index b562c370..daf617e5 100644
--- a/bl-kernel/helpers/paginator.class.php
+++ b/bl-kernel/helpers/paginator.class.php
@@ -24,21 +24,43 @@ class Paginator {
return self::$pager[$key];
}
+ public static function urlNextPage()
+ {
+ global $Url;
+
+ $domain = trim(DOMAIN_BASE,'/');
+ $filter = trim($Url->activeFilter(), '/');
+
+ if(empty($filter)) {
+ $url = $domain.'/'.$Url->slug();
+ }
+ else {
+ $url = $domain.'/'.$filter.'/'.$Url->slug();
+ }
+
+ return $url.'?page='.self::get('nextPage');
+ }
+
+ public static function urlPrevPage()
+ {
+ global $Url;
+
+ $domain = trim(DOMAIN_BASE,'/');
+ $filter = trim($Url->activeFilter(), '/');
+
+ if(empty($filter)) {
+ $url = $domain.'/'.$Url->slug();
+ }
+ else {
+ $url = $domain.'/'.$filter.'/'.$Url->slug();
+ }
+
+ return $url.'?page='.self::get('prevPage');
+ }
+
public static function html($textPrevPage=false, $textNextPage=false, $showPageNumber=false)
{
global $Language;
- global $Url;
-
- $url = trim(DOMAIN_BASE,'/');
-
- $filter = '';
- if($Url->whereAmI()=='tag') {
- $filter = trim($Url->filters('tag'), '/');
- $url = $url.'/'.$filter.'/'.$Url->slug();
- }
- else {
- $url = $url.'/';
- }
$html = '
';
$html .= '
';
@@ -50,7 +72,7 @@ class Paginator {
}
$html .= '- ';
- $html .= ''.$textPrevPage.'';
+ $html .= ''.$textPrevPage.'';
$html .= '
';
}
@@ -65,7 +87,7 @@ class Paginator {
}
$html .= '- ';
- $html .= ''.$textNextPage.'';
+ $html .= ''.$textNextPage.'';
$html .= '
';
}
@@ -75,4 +97,4 @@ class Paginator {
return $html;
}
-}
+}
\ No newline at end of file
diff --git a/bl-kernel/url.class.php b/bl-kernel/url.class.php
index fc4428bd..daf55f26 100644
--- a/bl-kernel/url.class.php
+++ b/bl-kernel/url.class.php
@@ -9,6 +9,7 @@ class Url
private $filters; // Filters for the URI
private $notFound;
private $parameters;
+ private $activeFilter;
function __construct()
{
@@ -30,6 +31,8 @@ class Url
$this->slug = '';
$this->filters = array();
+
+ $this->activeFilter = '';
}
// Filters change for different languages
@@ -57,6 +60,7 @@ class Url
{
$this->slug = $slug;
$this->whereAmI = $filterName;
+ $this->activeFilter = $filterURI;
// If the slug is empty
if(Text::isEmpty($slug))
@@ -93,6 +97,11 @@ class Url
return $this->slug;
}
+ public function activeFilter()
+ {
+ return $this->activeFilter;
+ }
+
public function explodeSlug($delimiter="/")
{
return explode($delimiter, $this->slug);
diff --git a/bl-themes/future-imperfect/php/home.php b/bl-themes/future-imperfect/php/home.php
index d2c5a072..61ce98f2 100644
--- a/bl-themes/future-imperfect/php/home.php
+++ b/bl-themes/future-imperfect/php/home.php
@@ -65,11 +65,11 @@
diff --git a/index.php b/index.php
index 1be0dbf9..4d7df468 100644
--- a/index.php
+++ b/index.php
@@ -38,3 +38,5 @@ if($Url->whereAmI()==='admin') {
else {
require(PATH_BOOT.'site.php');
}
+
+var_dump($Url);exit;