diff --git a/bl-kernel/dbsite.class.php b/bl-kernel/dbsite.class.php
index c5126965..b190fdea 100644
--- a/bl-kernel/dbsite.class.php
+++ b/bl-kernel/dbsite.class.php
@@ -174,7 +174,7 @@ class dbSite extends dbJSON
}
// Returns the full domain and base url
- // For example, https://www.domain.com/bludit/
+ // For example, https://www.domain.com/bludit
public function url()
{
return $this->getField('url');
diff --git a/bl-plugins/latest_posts/languages/bg_BG.json b/bl-plugins/latest_posts/languages/bg_BG.json
deleted file mode 100644
index ab7df5e3..00000000
--- a/bl-plugins/latest_posts/languages/bg_BG.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Последни публикации",
- "description": "Показва най-новите публикации."
- },
-
- "amount-of-posts": "Брой последни публикации",
- "show-home-link": "Покажи връзка за начало"
-}
\ No newline at end of file
diff --git a/bl-plugins/latest_posts/languages/de_CH.json b/bl-plugins/latest_posts/languages/de_CH.json
deleted file mode 100644
index 19eb5ad2..00000000
--- a/bl-plugins/latest_posts/languages/de_CH.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Neueste Beiträge",
- "description": "Anzeige der neuesten Beiträge."
- },
-
- "amount-of-posts": "Anzahl der Beiträge"
-}
diff --git a/bl-plugins/latest_posts/languages/de_DE.json b/bl-plugins/latest_posts/languages/de_DE.json
deleted file mode 100644
index 19eb5ad2..00000000
--- a/bl-plugins/latest_posts/languages/de_DE.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Neueste Beiträge",
- "description": "Anzeige der neuesten Beiträge."
- },
-
- "amount-of-posts": "Anzahl der Beiträge"
-}
diff --git a/bl-plugins/latest_posts/languages/en_US.json b/bl-plugins/latest_posts/languages/en_US.json
deleted file mode 100644
index e8e19423..00000000
--- a/bl-plugins/latest_posts/languages/en_US.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Latest posts",
- "description": "Shows the latest posts published."
- },
-
- "amount-of-posts": "Amount of posts"
-}
diff --git a/bl-plugins/latest_posts/languages/es_AR.json b/bl-plugins/latest_posts/languages/es_AR.json
deleted file mode 100644
index dd620606..00000000
--- a/bl-plugins/latest_posts/languages/es_AR.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Últimas entradas",
- "description": "Muestra las últimas entradas publicadas."
- },
-
- "amount-of-posts": "Cantidad de entradas"
-}
diff --git a/bl-plugins/latest_posts/languages/es_ES.json b/bl-plugins/latest_posts/languages/es_ES.json
deleted file mode 100644
index dd620606..00000000
--- a/bl-plugins/latest_posts/languages/es_ES.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Últimas entradas",
- "description": "Muestra las últimas entradas publicadas."
- },
-
- "amount-of-posts": "Cantidad de entradas"
-}
diff --git a/bl-plugins/latest_posts/languages/es_VE.json b/bl-plugins/latest_posts/languages/es_VE.json
deleted file mode 100644
index dd620606..00000000
--- a/bl-plugins/latest_posts/languages/es_VE.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Últimas entradas",
- "description": "Muestra las últimas entradas publicadas."
- },
-
- "amount-of-posts": "Cantidad de entradas"
-}
diff --git a/bl-plugins/latest_posts/languages/ja_JP.json b/bl-plugins/latest_posts/languages/ja_JP.json
deleted file mode 100644
index 2caa3d91..00000000
--- a/bl-plugins/latest_posts/languages/ja_JP.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Latest posts",
- "description": "公開された最近の投稿を表示します。"
- },
-
- "amount-of-posts": "投稿表示数"
-}
diff --git a/bl-plugins/latest_posts/languages/nl_NL.json b/bl-plugins/latest_posts/languages/nl_NL.json
deleted file mode 100644
index 786ec80d..00000000
--- a/bl-plugins/latest_posts/languages/nl_NL.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Laatste posts",
- "description": "Laat de laatste gepubliceerde posts zien."
- },
-
- "amount-of-posts": "Amount of posts"
-}
diff --git a/bl-plugins/latest_posts/languages/ru_RU.json b/bl-plugins/latest_posts/languages/ru_RU.json
deleted file mode 100644
index 0dd33c1f..00000000
--- a/bl-plugins/latest_posts/languages/ru_RU.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Последние записи",
- "description": "Показывает последние опубликованные записи."
- },
-
- "amount-of-posts": "Количество записей"
-}
diff --git a/bl-plugins/latest_posts/languages/tr_TR.json b/bl-plugins/latest_posts/languages/tr_TR.json
deleted file mode 100644
index cb542828..00000000
--- a/bl-plugins/latest_posts/languages/tr_TR.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Son yazılar",
- "description": "En son yayınlana yazıları gösterir."
- },
-
- "amount-of-posts": "Yazı sayısı"
-}
diff --git a/bl-plugins/latest_posts/languages/uk_UA.json b/bl-plugins/latest_posts/languages/uk_UA.json
deleted file mode 100644
index 290e4946..00000000
--- a/bl-plugins/latest_posts/languages/uk_UA.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "plugin-data":
- {
- "name": "Останні публікації",
- "description": "Показує останні опубліковані публікації."
- },
-
- "amount-of-posts": "Кількість публікацій"
-}
diff --git a/bl-plugins/latest_posts/plugin.php b/bl-plugins/latest_posts/plugin.php
deleted file mode 100644
index d8dc1af5..00000000
--- a/bl-plugins/latest_posts/plugin.php
+++ /dev/null
@@ -1,59 +0,0 @@
-dbFields = array(
- 'label'=>'Latest posts',
- 'amount'=>5
- );
- }
-
- public function form()
- {
- global $Language;
-
- $html = '
';
- $html .= ''.$Language->get('Plugin label').' ';
- $html .= ' ';
- $html .= '
';
-
- $html .= '';
- $html .= ''.$Language->get('Amount of posts').' ';
- $html .= ' ';
- $html .= '
';
-
- return $html;
- }
-
- public function siteSidebar()
- {
- // This function is declared in 70.posts.php
- $posts = buildPostsForPage(0, $this->getDbField('amount'), true, false);
-
- $html = '';
-
- // Print the label if not empty.
- $label = $this->getDbField('label');
- if( !empty($label) ) {
- $html .= '
'.$label.' ';
- }
-
- $html .= '
';
- $html .= '
';
-
- foreach($posts as $Post)
- {
- $html .= '';
- $html .= ''.$Post->title().' ';
- $html .= ' ';
- }
-
- $html .= ' ';
- $html .= '
';
- $html .= '
';
-
- return $html;
- }
-}
\ No newline at end of file
diff --git a/bl-plugins/links/languages/en_US.json b/bl-plugins/links/languages/en_US.json
new file mode 100644
index 00000000..e421493a
--- /dev/null
+++ b/bl-plugins/links/languages/en_US.json
@@ -0,0 +1,7 @@
+{
+ "plugin-data":
+ {
+ "name": "Links",
+ "description": "Show a list of links."
+ }
+}
diff --git a/bl-plugins/latest_posts/metadata.json b/bl-plugins/links/metadata.json
similarity index 59%
rename from bl-plugins/latest_posts/metadata.json
rename to bl-plugins/links/metadata.json
index 8801aa07..a5c64fc0 100644
--- a/bl-plugins/latest_posts/metadata.json
+++ b/bl-plugins/links/metadata.json
@@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
- "version": "1.5.2",
- "releaseDate": "2016-05-28",
+ "version": "2.0",
+ "releaseDate": "2017-05-26",
"license": "MIT",
- "compatible": "1.5.2",
+ "compatible": "2.0",
"notes": ""
-}
+}
\ No newline at end of file
diff --git a/bl-plugins/links/plugin.php b/bl-plugins/links/plugin.php
new file mode 100644
index 00000000..070ad12d
--- /dev/null
+++ b/bl-plugins/links/plugin.php
@@ -0,0 +1,62 @@
+'https://bludit.com',
+ 'Donate'=>'https://paypal.me/bludit'
+ ));
+
+ // Fields and default values for the database of this plugin
+ $this->dbFields = array(
+ 'label'=>'Links',
+ 'jsondb'=>$jsondb
+ );
+ }
+
+ // Method called on plugin settings on the admin area
+ public function form()
+ {
+ global $Language;
+
+ $html = '';
+ $html .= ''.$Language->get('Label').' ';
+ $html .= ' ';
+ $html .= '
';
+
+ return $html;
+ }
+
+ // Method called on the sidebar of the website
+ public function siteSidebar()
+ {
+ global $Language;
+
+ // HTML for sidebar
+ $html = '';
+ $html .= '
'.$this->getValue('label').' ';
+ $html .= '
';
+ $html .= '
';
+
+ // Get the JSON DB, getValue() with the option unsanitized HTML code
+ $jsondb = $this->getValue('jsondb', false);
+ $links = json_decode($jsondb);
+
+ // By default the database of categories are alphanumeric sorted
+ foreach( $links as $name=>$url ) {
+ $html .= '';
+ $html .= '';
+ $html .= $name;
+ $html .= ' ';
+ $html .= ' ';
+ }
+
+ $html .= ' ';
+ $html .= '
';
+ $html .= '
';
+
+ return $html;
+ }
+}
\ No newline at end of file
diff --git a/bl-plugins/opengraph/metadata.json b/bl-plugins/opengraph/metadata.json
index 8801aa07..a5c64fc0 100644
--- a/bl-plugins/opengraph/metadata.json
+++ b/bl-plugins/opengraph/metadata.json
@@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
- "version": "1.5.2",
- "releaseDate": "2016-05-28",
+ "version": "2.0",
+ "releaseDate": "2017-05-26",
"license": "MIT",
- "compatible": "1.5.2",
+ "compatible": "2.0",
"notes": ""
-}
+}
\ No newline at end of file
diff --git a/bl-plugins/opengraph/plugin.php b/bl-plugins/opengraph/plugin.php
index 3c85e538..4d2e6b65 100644
--- a/bl-plugins/opengraph/plugin.php
+++ b/bl-plugins/opengraph/plugin.php
@@ -11,8 +11,7 @@ class pluginOpenGraph extends Plugin {
$images = $finder->query("//img");
- if($images->length>0)
- {
+ if($images->length>0) {
// First image from the list
$image = $images->item(0);
// Get value from attribute src
@@ -26,8 +25,10 @@ class pluginOpenGraph extends Plugin {
public function siteHead()
{
- global $Url, $Site;
- global $Post, $Page, $posts;
+ global $Url;
+ global $Site;
+ global $WHERE_AM_I;
+ global $pages;
$og = array(
'locale' =>$Site->locale(),
@@ -39,36 +40,25 @@ class pluginOpenGraph extends Plugin {
'siteName' =>$Site->title()
);
- switch($Url->whereAmI())
+ switch($WHERE_AM_I)
{
- // The user filter by post
- case 'post':
- $og['type'] = 'article';
- $og['title'] = $Post->title().' | '.$og['title'];
- $og['description'] = $Post->description();
- $og['url'] = $Post->permalink(true);
- $og['image'] = $Post->coverImage(false);
-
- $content = $Post->content();
- break;
-
// The user filter by page
case 'page':
$og['type'] = 'article';
- $og['title'] = $Page->title().' | '.$og['title'];
+ $og['title'] = $Page->title();
$og['description'] = $Page->description();
- $og['url'] = $Page->permalink(true);
- $og['image'] = $Page->coverImage(false);
+ $og['url'] = $Page->permalink($absolute=true);
+ $og['image'] = $Page->coverImage($absolute=true);
$content = $Page->content();
break;
// The user is in the homepage
default:
- // The image it's from the first post
- if(isset($posts[0])) {
- $og['image'] = $posts[0]->coverImage(false);
- $content = $posts[0]->content();
+ // The image it's from the first page
+ if(isset($pages[0]) ) {
+ $og['image'] = $pages[0]->coverImage($absolute=true);
+ $content = $pages[0]->content();
}
break;
}
@@ -81,19 +71,16 @@ class pluginOpenGraph extends Plugin {
$html .= ' '.PHP_EOL;
$html .= ' '.PHP_EOL;
- // If the post o page doesn't have a coverImage try to get an image from the HTML content
- if($og['image']===false) {
-
+ // If the page doesn't have a coverImage try to get an image from the HTML content
+ if( empty($og['image']) ) {
// Get the image from the content
- $src = $this->getImage( $content );
-
+ $src = $this->getImage($content);
if($src!==false) {
- $html .= ' '.PHP_EOL;
+ $og['image'] = DOMAIN.$src;
}
}
- else {
- $html .= ' '.PHP_EOL;
- }
+
+ $html .= ' '.PHP_EOL;
return $html;
}
diff --git a/bl-plugins/pages/languages/en_US.json b/bl-plugins/pages/languages/en_US.json
index 389c780e..012064cd 100644
--- a/bl-plugins/pages/languages/en_US.json
+++ b/bl-plugins/pages/languages/en_US.json
@@ -1,11 +1,11 @@
{
"plugin-data":
{
- "name": "Page list",
- "description": "Shows the list of pages in order."
+ "name": "Pages",
+ "description": "Shows a list of pages, you can define the amount of items and the order depends of settings."
},
- "home": "Home",
+ "home-page": "Home page",
"show-home-link": "Show home link",
- "show-children": "Show children"
+ "amount-of-items": "Amount of items"
}
diff --git a/bl-plugins/pages/metadata.json b/bl-plugins/pages/metadata.json
index 8801aa07..a5c64fc0 100644
--- a/bl-plugins/pages/metadata.json
+++ b/bl-plugins/pages/metadata.json
@@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
- "version": "1.5.2",
- "releaseDate": "2016-05-28",
+ "version": "2.0",
+ "releaseDate": "2017-05-26",
"license": "MIT",
- "compatible": "1.5.2",
+ "compatible": "2.0",
"notes": ""
-}
+}
\ No newline at end of file
diff --git a/bl-plugins/pages/plugin.php b/bl-plugins/pages/plugin.php
index 26a3cd1b..22583061 100644
--- a/bl-plugins/pages/plugin.php
+++ b/bl-plugins/pages/plugin.php
@@ -8,7 +8,7 @@ class pluginPages extends Plugin {
$this->dbFields = array(
'label'=>'Pages',
'homeLink'=>true,
- 'children'=>true
+ 'amountOfItems'=>5
);
}
@@ -23,15 +23,14 @@ class pluginPages extends Plugin {
$html .= '';
$html .= '';
- $html .= ' ';
- $html .= ' getValue('homeLink')?'checked':'').'>';
- $html .= ''.$Language->get('Show home link').' ';
+ $html .= ''.$Language->get('Amount of items').' ';
+ $html .= ' ';
$html .= '
';
$html .= '';
- $html .= ' ';
- $html .= ' getValue('children')?'checked':'').'>';
- $html .= ''.$Language->get('Show children').' ';
+ $html .= ' ';
+ $html .= ' getValue('homeLink')?'checked':'').'>';
+ $html .= ''.$Language->get('Show home link').' ';
$html .= '
';
return $html;
@@ -47,12 +46,27 @@ class pluginPages extends Plugin {
// URL base filter for categories
$filter = $Url->filters('page');
+ // Amount of pages to show
+ $amountOfItems = $this->getValue('amountOfItems');
+
+ // Slice array of pages
+ $pages = array_slice($pages, 0, $amountOfItems);
+
// HTML for sidebar
$html = '';
$html .= '
'.$this->getValue('label').' ';
$html .= '
';
$html .= '
';
+ // Show Home page link
+ if( $this->getValue('homeLink') ) {
+ $html .= '';
+ $html .= '';
+ $html .= $Language->get('Home page');
+ $html .= ' ';
+ $html .= ' ';
+ }
+
// By default the database of categories are alphanumeric sorted
foreach( $pages as $page ) {
$html .= '';