Absolute url, and more constanst for themes and plugins
This commit is contained in:
parent
85f863f586
commit
4a7daf45a2
|
@ -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 = '';
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -42,7 +42,7 @@ class pluginCategories extends Plugin {
|
|||
// By default the database of categories are alphanumeric sorted
|
||||
foreach( $dbCategories->db as $key=>$fields ) {
|
||||
$html .= '<li>';
|
||||
$html .= '<a href="'.DOMAIN_BASE.$filter.'/'.$key.'">';
|
||||
$html .= '<a href="'.DOMAIN_CATEGORY.$key.'">';
|
||||
$html .= $fields['name'];
|
||||
$html .= ' ('.count($fields['list']).')';
|
||||
$html .= '</a>';
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -30,16 +30,15 @@ class pluginTags extends Plugin {
|
|||
$filter = $Url->filters('tag');
|
||||
|
||||
$html = '<div class="plugin plugin-tags">';
|
||||
$html .= '<h2>'.$this->getDbField('label').'</h2>';
|
||||
$html .= '<h2 class="plugin-label">'.$this->getDbField('label').'</h2>';
|
||||
$html .= '<div class="plugin-content">';
|
||||
$html .= '<ul>';
|
||||
|
||||
// By default the database of tags are alphanumeric sorted
|
||||
foreach( $dbTags->db as $key=>$fields ) {
|
||||
$html .= '<li>';
|
||||
$html .= '<a href="'.DOMAIN_BASE.$filter.'/'.$key.'">';
|
||||
$html .= '<a href="'.DOMAIN_TAGS.$key.'">';
|
||||
$html .= $fields['name'];
|
||||
$html .= ' ('.count($fields['list']).')';
|
||||
$html .= '</a>';
|
||||
$html .= '</li>';
|
||||
}
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
/* Plugins
|
||||
------------------------------------------------------------------------------ */
|
||||
|
||||
div.plugin {
|
||||
|
||||
}
|
||||
|
||||
div.plugin h2.plugin-label {
|
||||
border-bottom: solid 3px #f56a6a;
|
||||
display: inline-block;
|
||||
|
@ -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
|
||||
------------------------------------------------------------------------------ */
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue