diff --git a/bl-kernel/boot/init.php b/bl-kernel/boot/init.php index 543bc07a..65533e42 100644 --- a/bl-kernel/boot/init.php +++ b/bl-kernel/boot/init.php @@ -245,9 +245,18 @@ define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'bl-plugins/'); define('JQUERY', HTML_PATH_ROOT.'bl-kernel/js/jquery.min.js'); +// --- Objects with dependency --- +$Language = new dbLanguage( $Site->locale() ); +$Login = new Login( $dbUsers ); +$Url->checkFilters( $Site->uriFilters() ); + +// --- Objects shortcuts --- +$L = $Language; + +// --- CONSTANTS with dependency --- + // --- PHP paths with dependency --- // This paths are absolutes for the OS -// Depreacted, use THEME_DIR and THEME_DIR_XXX define('THEME_DIR', PATH_ROOT.'bl-themes'.DS.$Site->theme().DS); define('THEME_DIR_PHP', THEME_DIR.'php'.DS); define('THEME_DIR_CSS', THEME_DIR.'css'.DS); @@ -258,7 +267,7 @@ define('THEME_DIR_LANG', THEME_DIR.'languages'.DS); // --- Absolute paths with domain --- // This paths are absolutes for the user / web browsing. define('DOMAIN', $Site->domain()); -define('DOMAIN_BASE', DOMAIN.HTML_PATH_ROOT); +define('DOMAIN_BASE', $Site->url()); define('DOMAIN_THEME', DOMAIN.HTML_PATH_THEME); define('DOMAIN_THEME_CSS', DOMAIN.HTML_PATH_THEME_CSS); define('DOMAIN_THEME_JS', DOMAIN.HTML_PATH_THEME_JS); @@ -266,16 +275,10 @@ define('DOMAIN_THEME_IMG', DOMAIN.HTML_PATH_THEME_IMG); define('DOMAIN_UPLOADS', DOMAIN.HTML_PATH_UPLOADS); define('DOMAIN_UPLOADS_PROFILES', DOMAIN.HTML_PATH_UPLOADS_PROFILES); define('DOMAIN_UPLOADS_THUMBNAILS', DOMAIN.HTML_PATH_UPLOADS_THUMBNAILS); +define('DOMAIN_TAGS', trim(DOMAIN_BASE, '/').'/'.$Url->filters('tag',$trim=true).'/'); +define('DOMAIN_CATEGORY', trim(DOMAIN_BASE, '/').'/'.$Url->filters('category',$trim=true).'/'); +define('DOMAIN_PAGE', trim(DOMAIN_BASE, '/').'/'.$Url->filters('page',$trim=true).'/'); -// --- Objects with dependency --- -$Language = new dbLanguage( $Site->locale() ); -$Login = new Login( $dbUsers ); -$Url->checkFilters( $Site->uriFilters() ); - -// --- Objects shortcuts --- -$L = $Language; - -// --- CONSTANTS with dependency --- define('ORDER_BY', $Site->orderBy()); $ADMIN_CONTROLLER = ''; diff --git a/bl-kernel/page.class.php b/bl-kernel/page.class.php index a981f007..be8d8211 100644 --- a/bl-kernel/page.class.php +++ b/bl-kernel/page.class.php @@ -152,29 +152,13 @@ class Page { public function permalink($absolute=true) { global $Url; - global $Site; - - $url = trim(DOMAIN_BASE,'/'); - $key = $this->key(); - $filter = trim($Url->filters('page'), '/'); - $htmlPath = trim(HTML_PATH_ROOT,'/'); - - if(empty($filter)) { - $tmp = $key; - } - else { - $tmp = $filter.'/'.$key; - } if($absolute) { - return $url.'/'.$tmp; + return DOMAIN_PAGE.$key; } - if(empty($htmlPath)) { - return '/'.$tmp; - } - - return '/'.$htmlPath.'/'.$tmp; + $filter = $Url->filters('page', true); + return trim(HTML_PATH_ROOT,'/').'/'.$filter.'/'.$key; } // Returns the category key @@ -319,7 +303,7 @@ class Page { } if($absolute) { - return HTML_PATH_UPLOADS.$fileName; + return DOMAIN_UPLOADS.$fileName; } return $fileName; diff --git a/bl-plugins/categories/plugin.php b/bl-plugins/categories/plugin.php index d792eff3..87972736 100644 --- a/bl-plugins/categories/plugin.php +++ b/bl-plugins/categories/plugin.php @@ -42,7 +42,7 @@ class pluginCategories extends Plugin { // By default the database of categories are alphanumeric sorted foreach( $dbCategories->db as $key=>$fields ) { $html .= '