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 .= '
  • '; - $html .= ''; + $html .= ''; $html .= $fields['name']; $html .= ' ('.count($fields['list']).')'; $html .= ''; diff --git a/bl-plugins/opengraph/plugin.php b/bl-plugins/opengraph/plugin.php index 4d2e6b65..c32d65bd 100644 --- a/bl-plugins/opengraph/plugin.php +++ b/bl-plugins/opengraph/plugin.php @@ -29,6 +29,7 @@ class pluginOpenGraph extends Plugin { global $Site; global $WHERE_AM_I; global $pages; + global $page; $og = array( 'locale' =>$Site->locale(), @@ -45,12 +46,12 @@ class pluginOpenGraph extends Plugin { // The user filter by page case 'page': $og['type'] = 'article'; - $og['title'] = $Page->title(); - $og['description'] = $Page->description(); - $og['url'] = $Page->permalink($absolute=true); - $og['image'] = $Page->coverImage($absolute=true); + $og['title'] = $page->title(); + $og['description'] = $page->description(); + $og['url'] = $page->permalink($absolute=true); + $og['image'] = $page->coverImage($absolute=true); - $content = $Page->content(); + $content = $page->content(); break; // The user is in the homepage diff --git a/bl-plugins/tags/plugin.php b/bl-plugins/tags/plugin.php index 86d6543a..ef4ced08 100644 --- a/bl-plugins/tags/plugin.php +++ b/bl-plugins/tags/plugin.php @@ -30,16 +30,15 @@ class pluginTags extends Plugin { $filter = $Url->filters('tag'); $html = '
    '; - $html .= '

    '.$this->getDbField('label').'

    '; + $html .= '

    '.$this->getDbField('label').'

    '; $html .= '
    '; $html .= '
      '; // By default the database of tags are alphanumeric sorted foreach( $dbTags->db as $key=>$fields ) { $html .= '
    • '; - $html .= ''; + $html .= ''; $html .= $fields['name']; - $html .= ' ('.count($fields['list']).')'; $html .= ''; $html .= '
    • '; } diff --git a/bl-themes/editorial/assets/css/bludit.css b/bl-themes/editorial/assets/css/bludit.css index f1413d5a..b4486f8f 100644 --- a/bl-themes/editorial/assets/css/bludit.css +++ b/bl-themes/editorial/assets/css/bludit.css @@ -2,28 +2,24 @@ /* Plugins ------------------------------------------------------------------------------ */ -div.plugin { - -} - -div.plugin h2.plugin-label { +div.plugin h2.plugin-label { border-bottom: solid 3px #f56a6a; display: inline-block; margin: 0 0 2em 0; padding: 0 0.75em 0.5em 0; } -div.plugin ul { +div.plugin ul { list-style: none; } -div.plugin ul li { +div.plugin ul li { border-top: solid 1px rgba(210, 215, 217, 0.75); margin: 0.5em 0 0 0; padding: 0.5em 0 0 0; } -div.plugin a { +div.plugin a { border-bottom: 0; color: inherit; cursor: pointer; @@ -32,6 +28,19 @@ div.plugin a { padding: 0.625em 0; } +/* Plugin Tags +------------------------------------------------------------------------------ */ + +div.plugin-tags ul li { + border: none; + display: inline-block; +} + +div.plugin-tags a { + display: inline-block; + margin: 5px; +} + /* Plugin Menu ------------------------------------------------------------------------------ */ diff --git a/install.php b/install.php index 0667af7f..3c06c754 100644 --- a/install.php +++ b/install.php @@ -451,7 +451,8 @@ function install($adminPassword, $email, $timezone) array( 'position'=>0, 'homeLink'=>true, - 'label'=>$Language->get('Pages') + 'label'=>$Language->get('Pages'), + 'amountOfItems'=>5 ), JSON_PRETTY_PRINT), LOCK_EX