Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Daniele La Pira 2016-01-09 10:08:13 +01:00
commit 33f6d622f9
75 changed files with 1318 additions and 482 deletions

View File

@ -38,3 +38,4 @@ if($Url->whereAmI()==='admin') {
else { else {
require(PATH_BOOT.'site.php'); require(PATH_BOOT.'site.php');
} }

View File

@ -24,6 +24,7 @@ define('PATH_CONTENT', PATH_ROOT.'content'.DS);
define('PATH_POSTS', PATH_CONTENT.'posts'.DS); define('PATH_POSTS', PATH_CONTENT.'posts'.DS);
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS); define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
define('PATH_UPLOADS_PROFILES', PATH_UPLOADS.'profiles'.DS); define('PATH_UPLOADS_PROFILES', PATH_UPLOADS.'profiles'.DS);
define('PATH_UPLOADS_THUMBNAILS',PATH_UPLOADS.'thumbnails'.DS);
define('PATH_PAGES', PATH_CONTENT.'pages'.DS); define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS); define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.DS); define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.DS);
@ -60,7 +61,7 @@ if(!defined('JSON_PRETTY_PRINT')) {
define('JSON', function_exists('json_encode')); define('JSON', function_exists('json_encode'));
// Database format date // Database format date
define('DB_DATE_FORMAT', 'Y-m-d H:i'); define('DB_DATE_FORMAT', 'Y-m-d H:i:s');
// Charset, default UTF-8. // Charset, default UTF-8.
define('CHARSET', 'UTF-8'); define('CHARSET', 'UTF-8');
@ -244,9 +245,9 @@ function install($adminPassword, $email, $timezoneOffset)
error_log($errorText, 0); error_log($errorText, 0);
} }
if(!mkdir(PATH_PLUGINS_DATABASES.'tinymce', $dirpermissions, true)) if(!mkdir(PATH_PLUGINS_DATABASES.'simplemde', $dirpermissions, true))
{ {
$errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'tinymce'; $errorText = 'Error when trying to created the directory=>'.PATH_PLUGINS_DATABASES.'simplemde';
error_log($errorText, 0); error_log($errorText, 0);
} }
@ -268,6 +269,12 @@ function install($adminPassword, $email, $timezoneOffset)
error_log($errorText, 0); error_log($errorText, 0);
} }
if(!mkdir(PATH_UPLOADS_THUMBNAILS, $dirpermissions, true))
{
$errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS_THUMBNAILS;
error_log($errorText, 0);
}
// ============================================================================ // ============================================================================
// Create files // Create files
// ============================================================================ // ============================================================================
@ -409,14 +416,14 @@ function install($adminPassword, $email, $timezoneOffset)
LOCK_EX LOCK_EX
); );
// File plugins/tinymce/db.php // File plugins/simplemde/db.php
file_put_contents( file_put_contents(
PATH_PLUGINS_DATABASES.'tinymce'.DS.'db.php', PATH_PLUGINS_DATABASES.'simplemde'.DS.'db.php',
$dataHead.json_encode( $dataHead.json_encode(
array( array(
'position'=>0, 'position'=>0,
'plugins'=>'autoresize, fullscreen, pagebreak, link, textcolor, code', 'tabSize'=>4,
'toolbar'=>'bold italic underline strikethrough | alignleft aligncenter alignright | bullist numlist | styleselect | link forecolor backcolor removeformat | pagebreak code fullscreen' 'toolbar'=>'"bold", "italic", "heading", "|", "quote", "unordered-list", "|", "link", "image", "code", "horizontal-rule", "|", "preview", "side-by-side", "fullscreen", "guide"'
), ),
JSON_PRETTY_PRINT), JSON_PRETTY_PRINT),
LOCK_EX LOCK_EX

View File

@ -1,5 +1,9 @@
<?php defined('BLUDIT') or die('Bludit CMS.'); <?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
// ============================================================================ // ============================================================================
// Functions // Functions
// ============================================================================ // ============================================================================
@ -13,11 +17,17 @@ function editPage($args)
$args['parent'] = NO_PARENT_CHAR; $args['parent'] = NO_PARENT_CHAR;
} }
// Edit the page. // Add the page, if the $key is FALSE the creation of the post failure.
if( $dbPages->edit($args) ) $key = $dbPages->edit($args);
if($key)
{ {
$dbPages->regenerateCli(); $dbPages->regenerateCli();
// Call the plugins after page created.
Theme::plugins('afterPageModify');
// Alert the user
Alert::set($Language->g('The changes have been saved')); Alert::set($Language->g('The changes have been saved'));
Redirect::page('admin', 'edit-page/'.$args['slug']); Redirect::page('admin', 'edit-page/'.$args['slug']);
} }
@ -34,6 +44,9 @@ function deletePage($key)
if( $dbPages->delete($key) ) if( $dbPages->delete($key) )
{ {
// Call the plugins after post created.
Theme::plugins('afterPageDelete');
Alert::set($Language->g('The page has been deleted successfully')); Alert::set($Language->g('The page has been deleted successfully'));
Redirect::page('admin', 'manage-pages'); Redirect::page('admin', 'manage-pages');
} }

View File

@ -13,12 +13,18 @@ function editPost($args)
global $dbPosts; global $dbPosts;
global $Language; global $Language;
// Edit the post. // Add the page, if the $key is FALSE the creation of the post failure.
if( $dbPosts->edit($args) ) $key = $dbPosts->edit($args);
if($key)
{ {
// Reindex tags, this function is in 70.posts.php // Reindex tags, this function is in 70.posts.php
reIndexTagsPosts(); reIndexTagsPosts();
// Call the plugins after post created.
Theme::plugins('afterPostModify');
// Alert the user
Alert::set($Language->g('The changes have been saved')); Alert::set($Language->g('The changes have been saved'));
Redirect::page('admin', 'edit-post/'.$args['slug']); Redirect::page('admin', 'edit-post/'.$args['slug']);
} }
@ -40,6 +46,9 @@ function deletePost($key)
// Reindex tags, this function is in 70.posts.php // Reindex tags, this function is in 70.posts.php
reIndexTagsPosts(); reIndexTagsPosts();
// Call the plugins after post created.
Theme::plugins('afterPostDelete');
Alert::set($Language->g('The post has been deleted successfully')); Alert::set($Language->g('The post has been deleted successfully'));
Redirect::page('admin', 'manage-posts'); Redirect::page('admin', 'manage-posts');
} }

View File

@ -85,11 +85,9 @@ if($Login->role()!=='admin') {
$layout['parameters'] = $Login->username(); $layout['parameters'] = $Login->username();
} }
$_user = $dbUsers->getDb($layout['parameters']); $_User = $dbUsers->getUser($layout['parameters']);
// If the user doesn't exist, redirect to the users list. // If the user doesn't exist, redirect to the users list.
if($_user===false) { if($_User===false) {
Redirect::page('admin', 'users'); Redirect::page('admin', 'users');
} }
$_user['username'] = $layout['parameters'];

View File

@ -13,9 +13,15 @@ function addPage($args)
global $dbPages; global $dbPages;
global $Language; global $Language;
// Add the page. // Add the page, if the $key is FALSE the creation of the post failure.
if( $dbPages->add($args) ) $key = $dbPages->add($args);
if($key)
{ {
// Call the plugins after page created.
Theme::plugins('afterPageCreate');
// Alert the user
Alert::set($Language->g('Page added successfully')); Alert::set($Language->g('Page added successfully'));
Redirect::page('admin', 'manage-pages'); Redirect::page('admin', 'manage-pages');
} }

View File

@ -13,12 +13,18 @@ function addPost($args)
global $dbPosts; global $dbPosts;
global $Language; global $Language;
// Add the page. // Add the page, if the $key is FALSE the creation of the post failure.
if( $dbPosts->add($args) ) $key = $dbPosts->add($args);
if($key)
{ {
// Reindex tags, this function is in 70.posts.php // Reindex tags, this function is in 70.posts.php
reIndexTagsPosts(); reIndexTagsPosts();
// Call the plugins after post created.
Theme::plugins('afterPostCreate');
// Alert for the user
Alert::set($Language->g('Post added successfully')); Alert::set($Language->g('Post added successfully'));
Redirect::page('admin', 'manage-posts'); Redirect::page('admin', 'manage-posts');
} }

View File

@ -41,7 +41,8 @@ legend.first-child {
padding: 15px; padding: 15px;
} }
.uk-nav-navbar > li > a:hover { .uk-nav-navbar > li > a:hover,
.uk-nav-navbar > li > a:focus {
background: #2672ec; background: #2672ec;
} }
@ -102,11 +103,19 @@ li.bludit-logo {
} }
.uk-thumbnail { .uk-thumbnail {
margin: 2px 4px !important; margin: 2px 3px !important;
max-width: 30% !important; max-width: 30% !important;
padding: 0 !important; padding: 0 !important;
} }
.uk-progress-bar {
background: #2672ec !important;
}
.uk-placeholder {
margin-bottom: 0 !important;
}
/* ----------- BLUDIT ----------- */ /* ----------- BLUDIT ----------- */
#logo { #logo {
@ -163,20 +172,33 @@ button.delete-button:hover {
background: rgba(187, 48, 48, 0.91); background: rgba(187, 48, 48, 0.91);
} }
/* ----------- FORM ----------- */
.sidebar .uk-form-label {
font-size: 0.9em;
text-transform: uppercase;
}
/* ----------- BLUDIT IMAGES V8 ----------- */ /* ----------- BLUDIT IMAGES V8 ----------- */
#bludit-images-v8 { #bludit-images-v8 {
} }
#bludit-images-v8 img.uk-thumbnail { #bludit-images-v8 .bludit-thumbnail {
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
display: inline-block;
height: auto;
margin: 2px;
padding: 0;
width: 15% !important; width: 15% !important;
} }
#bludit-images-v8-upload { #bludit-images-v8-upload {
width: 100%; width: 100%;
padding: 0; padding: 0;
margin-bottom: 15px !important;
} }
#bludit-images-v8-drag-drop { #bludit-images-v8-drag-drop {
@ -185,11 +207,13 @@ button.delete-button:hover {
#bludit-images-v8-progressbar { #bludit-images-v8-progressbar {
display: none; display: none;
margin: 20px;
} }
#bludit-images-v8-thumbnails { #bludit-images-v8-thumbnails {
height: 350px; max-height: 350px;
overflow: auto; overflow: auto;
font-size: 0;
} }
/* ----------- BLUDIT QUICK IMAGES ----------- */ /* ----------- BLUDIT QUICK IMAGES ----------- */
@ -211,6 +235,21 @@ button.delete-button:hover {
font-size: 0.9em; font-size: 0.9em;
} }
#bludit-quick-images-thumbnails {
font-size: 0;
}
#bludit-quick-images .bludit-thumbnail {
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
display: inline-block;
height: auto;
margin: 2px;
padding: 0;
width: 31% !important;
}
/* ----------- BLUDIT COVER IMAGE ----------- */ /* ----------- BLUDIT COVER IMAGE ----------- */
#bludit-cover-image { #bludit-cover-image {
@ -246,6 +285,24 @@ button.delete-button:hover {
#cover-image-progressbar { #cover-image-progressbar {
display: none; display: none;
left: 5%;
position: relative;
top: 33%;
width: 90%;
}
/* ----------- BLUDIT PROFILE PICTURE ----------- */
#bludit-profile-picture-drag-drop {
width: 100%;
padding: 15px 0;
}
#bludit-profile-picture-progressbar {
display: none;
margin: 15px 0 0;
width: 100%;
} }
/* ----------- LOGIN FORM ----------- */ /* ----------- LOGIN FORM ----------- */

BIN
kernel/admin/themes/default/css/fonts/FontAwesome.otf Normal file → Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

2
kernel/admin/themes/default/css/uikit/form-file.almost-flat.min.css vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ /*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-form-file{display:inline-block;vertical-align:middle;position:relative;overflow:hidden}.uk-form-file input[type=file]{position:absolute;top:0;z-index:1;width:100%;opacity:0;cursor:pointer;left:0;font-size:500px} .uk-form-file{display:inline-block;vertical-align:middle;position:relative;overflow:hidden}.uk-form-file input[type=file]{position:absolute;top:0;z-index:1;width:100%;opacity:0;cursor:pointer;left:0;font-size:500px}

View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ /*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-placeholder{margin-bottom:15px;padding:15px;border:1px dashed #ddd;background:#fafafa;color:#444}*+.uk-placeholder{margin-top:15px}.uk-placeholder>:last-child{margin-bottom:0}.uk-placeholder-large{padding-top:80px;padding-bottom:80px} .uk-placeholder{margin-bottom:15px;padding:15px;border:1px dashed #ddd;background:#fafafa;color:#444}*+.uk-placeholder{margin-top:15px}.uk-placeholder>:last-child{margin-bottom:0}.uk-placeholder-large{padding-top:80px;padding-bottom:80px}

2
kernel/admin/themes/default/css/uikit/progress.almost-flat.min.css vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ /*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#f5f5f5;overflow:hidden;line-height:20px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);border-radius:4px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#00a8e6;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center;box-shadow:inset 0 0 5px rgba(0,0,0,.05);text-shadow:0 -1px 0 rgba(0,0,0,.1)}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#8cc14c}.uk-progress-warning .uk-progress-bar{background-color:#faa732}.uk-progress-danger .uk-progress-bar{background-color:#da314b}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}.uk-progress-mini,.uk-progress-small{border-radius:500px} .uk-progress{box-sizing:border-box;height:20px;margin-bottom:15px;background:#f5f5f5;overflow:hidden;line-height:20px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);border-radius:4px}*+.uk-progress{margin-top:15px}.uk-progress-bar{width:0;height:100%;background:#00a8e6;float:left;-webkit-transition:width .6s ease;transition:width .6s ease;font-size:12px;color:#fff;text-align:center;box-shadow:inset 0 0 5px rgba(0,0,0,.05);text-shadow:0 -1px 0 rgba(0,0,0,.1)}.uk-progress-mini{height:6px}.uk-progress-small{height:12px}.uk-progress-success .uk-progress-bar{background-color:#8cc14c}.uk-progress-warning .uk-progress-bar{background-color:#faa732}.uk-progress-danger .uk-progress-bar{background-color:#da314b}.uk-progress-striped .uk-progress-bar{background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:30px 30px}.uk-progress-striped.uk-active .uk-progress-bar{-webkit-animation:uk-progress-bar-stripes 2s linear infinite;animation:uk-progress-bar-stripes 2s linear infinite}@-webkit-keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}@keyframes uk-progress-bar-stripes{0%{background-position:0 0}100%{background-position:30px 0}}.uk-progress-mini,.uk-progress-small{border-radius:500px}

4
kernel/admin/themes/default/css/uikit/uikit.almost-flat.min.css vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

2
kernel/admin/themes/default/css/uikit/upload.almost-flat.min.css vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ /*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-dragover{box-shadow:0 0 20px rgba(100,100,100,.3)} .uk-dragover{box-shadow:0 0 20px rgba(100,100,100,.3)}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -102,9 +102,9 @@ $(document).ready(function() {
<ul class="uk-navbar-nav"> <ul class="uk-navbar-nav">
<li class="uk-parent" data-uk-dropdown> <li class="uk-parent" data-uk-dropdown>
<?php <?php
$profilePictureSrc = HTML_PATH_ADMIN_THEME_IMG.'default.jpg'; $profilePictureSrc = HTML_PATH_ADMIN_THEME_IMG.'default.png';
if(file_exists(PATH_UPLOADS_PROFILES.$Login->username().'.jpg')) { if(file_exists(PATH_UPLOADS_PROFILES.$Login->username().'.png')) {
$profilePictureSrc = HTML_PATH_UPLOADS_PROFILES.$Login->username().'.jpg'; $profilePictureSrc = HTML_PATH_UPLOADS_PROFILES.$Login->username().'.png';
} }
?> ?>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>"> <a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>">

View File

@ -130,12 +130,11 @@ class HTML {
public static function bluditQuickImages() public static function bluditQuickImages()
{ {
global $L;
$html = '<!-- BLUDIT QUICK IMAGES -->'; $html = '<!-- BLUDIT QUICK IMAGES -->';
$html .= ' $html .= '
<div id="bludit-quick-images"> <div id="bludit-quick-images">
<h4 class="label">Images</h4>
<div id="bludit-quick-images-thumbnails"> <div id="bludit-quick-images-thumbnails">
'; ';
@ -143,35 +142,68 @@ $thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true);
array_splice($thumbnailList, THUMBNAILS_AMOUNT); array_splice($thumbnailList, THUMBNAILS_AMOUNT);
foreach($thumbnailList as $file) { foreach($thumbnailList as $file) {
$filename = basename($file); $filename = basename($file);
$html .= '<img class="bludit-thumbnail uk-thumbnail" data-filename="'.$filename.'" src="'.HTML_PATH_UPLOADS_THUMBNAILS.$filename.'" alt="Thumbnail">'; $html .= '<img class="bludit-thumbnail" data-filename="'.$filename.'" src="'.HTML_PATH_UPLOADS_THUMBNAILS.$filename.'" alt="Thumbnail">';
} }
$html .= ' $html .= '
</div> </div>
';
<a data-uk-modal href="#bludit-images-v8" class="moreImages uk-button">More images</a> if(empty($thumbnailList)) {
$html .= '<div class="empty-images uk-block uk-text-center uk-block-muted">There are no images, upload someone to make your site more cheerful.</div>';
}
$html .= '
<a data-uk-modal href="#bludit-images-v8" class="moreImages uk-button">'.$L->g('More images').'</a>
</div> </div>
'; ';
echo $html; $script = '
<script>
// Add thumbnail to Quick Images
function addQuickImages(filename)
{
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS + filename;
// Remove element if there are more than 6 thumbnails
if ($("#bludit-quick-images-thumbnails > img").length > 5) {
$("img:last-child", "#bludit-quick-images-thumbnails").remove();
} }
public static function bluditCoverImage() // Add the new thumbnail to Quick images
$("#bludit-quick-images-thumbnails").prepend("<img class=\"bludit-thumbnail\" data-filename=\""+filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">");
}
</script>
';
echo $html.$script;
}
public static function bluditCoverImage($coverImage="")
{ {
global $L; global $L;
$style = '';
if(!empty($coverImage)) {
$style = 'background-image: url('.HTML_PATH_UPLOADS_THUMBNAILS.$coverImage.')';
}
$html = '<!-- BLUDIT COVER IMAGE -->'; $html = '<!-- BLUDIT COVER IMAGE -->';
$html .= ' $html .= '
<div id="bludit-cover-image"> <div id="bludit-cover-image">
<div id="cover-image-thumbnail" class="uk-form-file uk-placeholder uk-text-center"> <div id="cover-image-thumbnail" class="uk-form-file uk-placeholder uk-text-center" style="'.$style.'">
<div id="cover-image-upload"> <input type="hidden" name="coverImage" id="cover-image-upload-filename" value="'.$coverImage.'">
<div id="cover-image-upload" '.( empty($coverImage)?'':'style="display: none;"' ).'>
<div><i class="uk-icon-picture-o"></i> '.$L->g('Cover image').'</div> <div><i class="uk-icon-picture-o"></i> '.$L->g('Cover image').'</div>
<div>'.$L->g('Drag and drop or click here').'<input id="cover-image-file-select" type="file"></div> <div style="font-size:0.8em;">'.$L->g('Drag and drop or click here').'<input id="cover-image-file-select" type="file"></div>
</div> </div>
<div id="cover-image-delete"> <div id="cover-image-delete" '.( empty($coverImage)?'':'style="display: block;"' ).'>
<div><i class="uk-icon-trash-o"></i></div> <div><i class="uk-icon-trash-o"></i></div>
</div> </div>
@ -185,10 +217,23 @@ $html .= '
$script = ' $script = '
<script> <script>
function addCoverImage(filename)
{
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS + filename;
// Cover image background
$("#cover-image-thumbnail").attr("style","background-image: url("+imageSrc+")");
// Form attribute
$("#cover-image-upload-filename").attr("value", filename);
}
$(document).ready(function() { $(document).ready(function() {
$("#cover-image-delete").on("click", function() { $("#cover-image-delete").on("click", function() {
$("#cover-image-thumbnail").attr("style",""); $("#cover-image-thumbnail").attr("style","");
$("#cover-image-upload-filename").attr("value","");
$("#cover-image-delete").hide(); $("#cover-image-delete").hide();
$("#cover-image-upload").show(); $("#cover-image-upload").show();
}); });
@ -202,7 +247,7 @@ $(document).ready(function() {
loadstart: function() { loadstart: function() {
$("#cover-image-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%"); $("#cover-image-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%");
$("#cover-image-progressbar").hide(); $("#cover-image-progressbar").show();
$("#cover-image-delete").hide(); $("#cover-image-delete").hide();
$("#cover-image-upload").hide(); $("#cover-image-upload").hide();
}, },
@ -215,13 +260,17 @@ $(document).ready(function() {
allcomplete: function(response) { allcomplete: function(response) {
$("#cover-image-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%"); $("#cover-image-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%");
$("#cover-image-progressbar").hide(); $("#cover-image-progressbar").hide();
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS+response.filename;
$("#cover-image-thumbnail").attr("style","background-image: url("+imageSrc+")");
$("#cover-image-delete").show(); $("#cover-image-delete").show();
$(".empty-images").hide();
$("img:last-child", "#bludit-quick-images-thumbnails").remove(); // Add Cover Image
$("#bludit-quick-images-thumbnails").prepend("<img class=\"bludit-thumbnail uk-thumbnail\" data-filename=\""+response.filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">"); addCoverImage(response.filename);
// Add thumbnail to Quick Images
addQuickImages(response.filename);
// Add thumbnail to Bludit Images V8
addBluditImagev8(response.filename);
}, },
notallowed: function(file, settings) { notallowed: function(file, settings) {
@ -251,7 +300,7 @@ $html .= '
<div id="bludit-images-v8-drag-drop"> <div id="bludit-images-v8-drag-drop">
<div><i class="uk-icon-picture-o"></i> '.$L->g('Upload image').'</div> <div><i class="uk-icon-picture-o"></i> '.$L->g('Upload image').'</div>
<div>'.$L->g('Drag and drop or click here').'<input id="bludit-images-v8-file-select" type="file"></div> <div style="font-size:0.8em;">'.$L->g('Drag and drop or click here').'<input id="bludit-images-v8-file-select" type="file"></div>
</div> </div>
<div id="bludit-images-v8-progressbar" class="uk-progress"> <div id="bludit-images-v8-progressbar" class="uk-progress">
@ -263,17 +312,23 @@ $html .= '
<div id="bludit-images-v8-thumbnails"> <div id="bludit-images-v8-thumbnails">
'; ';
$thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true); $thumbnailList = Filesystem::listFiles(PATH_UPLOADS_THUMBNAILS,'*','*',true);
foreach($thumbnailList as $file) { foreach($thumbnailList as $file) {
$filename = basename($file); $filename = basename($file);
$html .= '<img class="bludit-thumbnail uk-thumbnail" src="'.HTML_PATH_UPLOADS_THUMBNAILS.$filename.'" data-filename="'.$filename.'" alt="Thumbnail">'; $html .= '<img class="bludit-thumbnail" src="'.HTML_PATH_UPLOADS_THUMBNAILS.$filename.'" data-filename="'.$filename.'" alt="Thumbnail">';
} }
$html .= ' $html .= '
</div> </div>
';
if(empty($thumbnailList)) {
$html .= '<div class="empty-images uk-block uk-text-center uk-block-muted">There are no images, upload someone to make your site more cheerful.</div>';
}
$html .= '
<div class="uk-modal-footer"> <div class="uk-modal-footer">
Double click on the image to add it or <a href="" class="uk-modal-close">click here to cancel</a> '.$L->g('Double click on the image to add it').' <a href="" class="uk-modal-close">'.$L->g('Click here to cancel').'</a>
</div> </div>
</div> </div>
@ -282,6 +337,16 @@ $html .= '
$script = ' $script = '
<script> <script>
// Add thumbnail to Bludit Images v8
function addBluditImagev8(filename)
{
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS + filename;
// Add the new thumbnail to Bludit Images v8
$("#bludit-images-v8-thumbnails").prepend("<img class=\"bludit-thumbnail\" data-filename=\""+filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">");
}
$(document).ready(function() { $(document).ready(function() {
// Add border when select an thumbnail // Add border when select an thumbnail
@ -310,6 +375,8 @@ $(document).ready(function() {
loadstart: function() { loadstart: function() {
$("#bludit-images-v8-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%"); $("#bludit-images-v8-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%");
$("#bludit-images-v8-drag-drop").hide();
$("#bludit-images-v8-progressbar").show();
}, },
progress: function(percent) { progress: function(percent) {
@ -320,14 +387,14 @@ $(document).ready(function() {
allcomplete: function(response) { allcomplete: function(response) {
$("#bludit-images-v8-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%"); $("#bludit-images-v8-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%");
$("#bludit-images-v8-progressbar").hide(); $("#bludit-images-v8-progressbar").hide();
$("#bludit-images-v8-drag-drop").show();
$(".empty-images").hide();
// Images V8 Thumbnails // Add thumbnail to Bludit Images V8
var imageSrc = HTML_PATH_UPLOADS_THUMBNAILS+response.filename; addBluditImagev8(response.filename);
$("#bludit-images-v8-thumbnails").prepend("<img class=\"bludit-thumbnail uk-thumbnail\" data-filename=\""+response.filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">");
// Quick images Thumbnails // Add thumbnail to Quick Images
$("img:last-child", "#bludit-quick-images-thumbnails").remove(); addQuickImages(response.filename);
$("#bludit-quick-images-thumbnails").prepend("<img class=\"bludit-thumbnail uk-thumbnail\" data-filename=\""+response.filename+"\" src=\""+imageSrc+"\" alt=\"Thumbnail\">");
}, },
notallowed: function(file, settings) { notallowed: function(file, settings) {
@ -343,130 +410,65 @@ $(document).ready(function() {
echo $html.$script; echo $html.$script;
} }
public static function uploader()
{
global $L;
$html = '
<div id="upload-drop" class="uk-placeholder uk-text-center">
<i class="uk-icon-cloud-upload uk-icon-medium uk-text-muted uk-margin-small-right"></i>'.$L->g('Upload Image').'<br><a class="uk-form-file">'.$L->g('Drag and drop or click here').'<input id="upload-select" type="file"></a>
</div>
<div id="progressbar" class="uk-progress uk-hidden">
<div class="uk-progress-bar" style="width: 0%;">0%</div>
</div>
';
$html .= '<select id="jsimageList" class="uk-width-1-1" size="10">';
$imagesList = Filesystem::listFiles(PATH_UPLOADS,'*','*',true);
foreach($imagesList as $file) {
$html .= '<option value="">'.basename($file).'</option>';
}
$html .= '</select>';
$html .= '
<div class="uk-form-row uk-margin-top">
<button id="jsaddImage" class="uk-button uk-button-primary" type="button"><i class="uk-icon-angle-double-left"></i> '.$L->g('Insert Image').'</button>
</div>
';
$html .= '
<script>
$(document).ready(function() {
$("#jsaddImage").on("click", function() {
var filename = $("#jsimageList option:selected").text();
if(!filename.trim()) {
return false;
}
var textareaValue = $("#jscontent").val();
$("#jscontent").val(textareaValue + "<img src=\""+filename+"\" alt=\"\">" + "\n");
});
$(function()
{
var progressbar = $("#progressbar");
var bar = progressbar.find(".uk-progress-bar");
var settings =
{
type: "json",
action: "'.HTML_PATH_ADMIN_ROOT.'ajax/uploader",
allow : "*.(jpg|jpeg|gif|png)",
loadstart: function() {
bar.css("width", "0%").text("0%");
progressbar.removeClass("uk-hidden");
},
progress: function(percent) {
percent = Math.ceil(percent);
bar.css("width", percent+"%").text(percent+"%");
},
allcomplete: function(response) {
bar.css("width", "100%").text("100%");
setTimeout(function() { progressbar.addClass("uk-hidden"); }, 250);
$("#jsimageList").prepend("<option value=\'"+response.filename+"\' selected=\'selected\'>"+response.filename+"</option>");
},
notallowed: function(file, settings) {
alert("'.$L->g('Supported image file types').' "+settings.allow);
}
};
var select = UIkit.uploadSelect($("#upload-select"), settings);
var drop = UIkit.uploadDrop($("#upload-drop"), settings);
});
});
</script>';
echo $html;
}
public static function profileUploader($username) public static function profileUploader($username)
{ {
global $L; global $L;
$html = ' $html = '<!-- BLUDIT PROFILE UPLOADER -->';
<div id="jsprogressBar" class="uk-progress uk-hidden">
$html .= '
<div id="bludit-profile-picture">
<div id="bludit-profile-picture-image">';
if(file_exists(PATH_UPLOADS_PROFILES.$username.'.png')) {
$html .= '<img class="uk-border-rounded" src="'.HTML_PATH_UPLOADS_PROFILES.$username.'.png" alt="Profile picture">';
}
else {
$html .= '<div class="uk-block uk-border-rounded uk-block-muted uk-block-large">'.$L->g('Profile picture').'</div>';
}
$html .= '
</div>
<div id="bludit-profile-picture-progressbar" class="uk-progress">
<div class="uk-progress-bar" style="width: 0%;">0%</div> <div class="uk-progress-bar" style="width: 0%;">0%</div>
</div> </div>
<div id="upload-drop" class="uk-placeholder uk-text-center"> <div id="bludit-profile-picture-drag-drop" class="uk-form-file uk-placeholder uk-text-center">
<i class="uk-icon-cloud-upload uk-margin-small-right"></i>'.$L->g('Upload Image').'<br><a class="uk-form-file">'.$L->g('Drag and drop or click here').'<input id="upload-select" type="file"></a> <div>'.$L->g('Upload image').'</div>
<div style="font-size:0.8em;">'.$L->g('Drag and drop or click here').'<input id="bludit-profile-picture-file-select" type="file"></div>
</div> </div>
';
$html .= ' </div>
<script> ';
$(document).ready(function() {
$script = '
<script>
$(document).ready(function() {
$(function()
{
var progressbar = $("#jsprogressBar");
var bar = progressbar.find(".uk-progress-bar");
var settings = var settings =
{ {
type: "json", type: "json",
action: "'.HTML_PATH_ADMIN_ROOT.'ajax/uploader", action: HTML_PATH_ADMIN_ROOT+"ajax/uploader",
allow : "*.(jpg|jpeg|gif|png)", allow : "*.(jpg|jpeg|gif|png)",
params: {"type":"profilePicture", "username":"'.$username.'"}, params: {"type":"profilePicture", "username":"'.$username.'"},
loadstart: function() { loadstart: function() {
bar.css("width", "0%").text("0%"); $("#bludit-profile-picture-progressbar").find(".uk-progress-bar").css("width", "0%").text("0%");
progressbar.removeClass("uk-hidden"); $("#bludit-profile-picture-progressbar").show();
}, },
progress: function(percent) { progress: function(percent) {
percent = Math.ceil(percent); percent = Math.ceil(percent);
bar.css("width", percent+"%").text(percent+"%"); $("#bludit-profile-picture-progressbar").find(".uk-progress-bar").css("width", percent+"%").text(percent+"%");
}, },
allcomplete: function(response) { allcomplete: function(response) {
bar.css("width", "100%").text("100%"); $("#bludit-profile-picture-progressbar").find(".uk-progress-bar").css("width", "100%").text("100%");
progressbar.addClass("uk-hidden"); $("#bludit-profile-picture-progressbar").hide();
$("#jsprofilePicture").html("<img class=\"uk-border-rounded\" src=\"'.HTML_PATH_UPLOADS_PROFILES.$username.'.jpg\">");
$("#bludit-profile-picture-image").html("<img class=\"uk-border-rounded\" src=\"'.HTML_PATH_UPLOADS_PROFILES.$username.'.png?time='.time().'\">");
}, },
notallowed: function(file, settings) { notallowed: function(file, settings) {
@ -474,14 +476,14 @@ $(document).ready(function() {
} }
}; };
var select = UIkit.uploadSelect($("#upload-select"), settings); UIkit.uploadSelect($("#bludit-profile-picture-file-select"), settings);
var drop = UIkit.uploadDrop($("#upload-drop"), settings); UIkit.uploadDrop($("#bludit-profile-picture-drag-drop"), settings);
});
}); });
</script>'; </script>
';
echo $html; echo $html.$script;
} }
} }

6
kernel/admin/themes/default/js/uikit/uikit.min.js vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

2
kernel/admin/themes/default/js/uikit/upload.min.js vendored Normal file → Executable file
View File

@ -1,2 +1,2 @@
/*! UIkit 2.24.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ /*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
!function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,i=0;r=t[i];i++)o.append(n.param,r);for(var l in n.params)o.append(l,n.params[l]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),"json"==n.type&&a.setRequestHeader("Accept","application/json"),a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var i,l=0;i=o[l];l++)if(!n(a.allow,i.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(i,a),void 0;var s=a.complete;if(a.single){var d=o.length,f=0,p=!0;a.beforeAll(o),a.complete=function(e,t){f+=1,s(e,t),a.filelimit&&f>=a.filelimit&&(p=!1),p&&d>f?r([o[f]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){s(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.dataTransfer&&n.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.dataTransfer.files]),t(n.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),e.support.ajaxupload&&e.$.event.props.push("dataTransfer"),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t}); !function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,i=0;r=t[i];i++)o.append(n.param,r);for(var l in n.params)o.append(l,n.params[l]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),"json"==n.type&&a.setRequestHeader("Accept","application/json"),a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var i,l=0;i=o[l];l++)if(!n(a.allow,i.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(i,a),void 0;var s=a.complete;if(a.single){var d=o.length,f=0,p=!0;a.beforeAll(o),a.complete=function(e,t){f+=1,s(e,t),a.filelimit&&f>=a.filelimit&&(p=!1),p&&d>f?r([o[f]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){s(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.dataTransfer&&n.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.dataTransfer.files]),t(n.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),e.support.ajaxupload&&e.$.event.props.push("dataTransfer"),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t});

View File

@ -91,7 +91,9 @@ echo '<div class="sidebar uk-width-large-2-10">';
echo '<li>'; echo '<li>';
// --- BLUDIT COVER IMAGE --- // --- BLUDIT COVER IMAGE ---
HTML::bluditCoverImage(); echo '<hr>';
HTML::bluditCoverImage($_Page->coverImage(false));
echo '<hr>';
// --- BLUDIT QUICK IMAGES --- // --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages(); HTML::bluditQuickImages();
@ -104,6 +106,16 @@ echo '<div class="sidebar uk-width-large-2-10">';
// ---- ADVANCED TAB ---- // ---- ADVANCED TAB ----
echo '<li>'; echo '<li>';
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>($_Page->draft()?'draft':'published'),
'tip'=>''
));
// If the page is parent then doesn't can have a parent. // If the page is parent then doesn't can have a parent.
if(count($_Page->children())===0) if(count($_Page->children())===0)
{ {
@ -123,16 +135,6 @@ if(count($_Page->children())===0)
)); ));
} }
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>($_Page->draft()?'draft':'published'),
'tip'=>''
));
// Position input // Position input
HTML::formInputText(array( HTML::formInputText(array(
'name'=>'position', 'name'=>'position',

View File

@ -85,7 +85,9 @@ echo '<div class="sidebar uk-width-large-2-10">';
echo '<li>'; echo '<li>';
// --- BLUDIT COVER IMAGE --- // --- BLUDIT COVER IMAGE ---
HTML::bluditCoverImage(); echo '<hr>';
HTML::bluditCoverImage($_Post->coverImage(false));
echo '<hr>';
// --- BLUDIT QUICK IMAGES --- // --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages(); HTML::bluditQuickImages();
@ -98,15 +100,6 @@ echo '<div class="sidebar uk-width-large-2-10">';
// ---- ADVANCED TAB ---- // ---- ADVANCED TAB ----
echo '<li>'; echo '<li>';
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>$_Post->dateRaw(),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Status input // Status input
HTML::formSelect(array( HTML::formSelect(array(
'name'=>'status', 'name'=>'status',
@ -117,6 +110,15 @@ echo '<div class="sidebar uk-width-large-2-10">';
'tip'=>'' 'tip'=>''
)); ));
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>$_Post->dateRaw(),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Slug input // Slug input
HTML::formInputText(array( HTML::formInputText(array(
'name'=>'slug', 'name'=>'slug',

View File

@ -16,7 +16,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
// Security token // Security token
HTML::formInputHidden(array( HTML::formInputHidden(array(
'name'=>'username', 'name'=>'username',
'value'=>$_user['username'] 'value'=>$_User->username()
)); ));
HTML::legend(array('value'=>$L->g('Profile'), 'class'=>'first-child')); HTML::legend(array('value'=>$L->g('Profile'), 'class'=>'first-child'));
@ -24,7 +24,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
HTML::formInputText(array( HTML::formInputText(array(
'name'=>'usernameDisable', 'name'=>'usernameDisable',
'label'=>$L->g('Username'), 'label'=>$L->g('Username'),
'value'=>$_user['username'], 'value'=>$_User->username(),
'class'=>'uk-width-1-2 uk-form-medium', 'class'=>'uk-width-1-2 uk-form-medium',
'disabled'=>true, 'disabled'=>true,
'tip'=>'' 'tip'=>''
@ -33,7 +33,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
HTML::formInputText(array( HTML::formInputText(array(
'name'=>'firstName', 'name'=>'firstName',
'label'=>$L->g('First name'), 'label'=>$L->g('First name'),
'value'=>$_user['firstName'], 'value'=>$_User->firstName(),
'class'=>'uk-width-1-2 uk-form-medium', 'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>'' 'tip'=>''
)); ));
@ -41,7 +41,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
HTML::formInputText(array( HTML::formInputText(array(
'name'=>'lastName', 'name'=>'lastName',
'label'=>$L->g('Last name'), 'label'=>$L->g('Last name'),
'value'=>$_user['lastName'], 'value'=>$_User->lastName(),
'class'=>'uk-width-1-2 uk-form-medium', 'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>'' 'tip'=>''
)); ));
@ -49,7 +49,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
echo '<div class="uk-form-row"> echo '<div class="uk-form-row">
<label class="uk-form-label">Password</label> <label class="uk-form-label">Password</label>
<div class="uk-form-controls"> <div class="uk-form-controls">
<a href="'.HTML_PATH_ADMIN_ROOT.'user-password/'.$_user['username'].'">'.$L->g('Change password').'</a> <a href="'.HTML_PATH_ADMIN_ROOT.'user-password/'.$_User->username().'">'.$L->g('Change password').'</a>
</div> </div>
</div>'; </div>';
@ -59,7 +59,7 @@ if($Login->role()==='admin') {
'name'=>'role', 'name'=>'role',
'label'=>$L->g('Role'), 'label'=>$L->g('Role'),
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')), 'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
'selected'=>$_user['role'], 'selected'=>$_User->role(),
'tip'=>'' 'tip'=>''
)); ));
@ -67,17 +67,41 @@ if($Login->role()==='admin') {
HTML::formInputText(array( HTML::formInputText(array(
'name'=>'email', 'name'=>'email',
'label'=>$L->g('Email'), 'label'=>$L->g('Email'),
'value'=>$_user['email'], 'value'=>$_User->email(),
'class'=>'uk-width-1-2 uk-form-medium', 'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>$L->g('email-will-not-be-publicly-displayed') 'tip'=>$L->g('email-will-not-be-publicly-displayed')
)); ));
HTML::legend(array('value'=>$L->g('Social network'))); HTML::legend(array('value'=>'Social networks'));
HTML::formInputText(array( HTML::formInputText(array(
'name'=>'twitterUsername', 'name'=>'twitterUsername',
'label'=>$L->g('Twitter username'), 'label'=>'Twitter username',
'value'=>$_user['twitterUsername'], 'value'=>$_User->twitterUsername(),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
HTML::formInputText(array(
'name'=>'facebookUsername',
'label'=>'Facebook username',
'value'=>$_User->facebookUsername(),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
HTML::formInputText(array(
'name'=>'googleUsername',
'label'=>'Google username',
'value'=>$_User->googleUsername(),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
HTML::formInputText(array(
'name'=>'instagramUsername',
'label'=>'Instagram username',
'value'=>$_User->instagramUsername(),
'class'=>'uk-width-1-2 uk-form-medium', 'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>'' 'tip'=>''
)); ));
@ -89,7 +113,7 @@ if($Login->role()==='admin') {
</div> </div>
</div>'; </div>';
if( ($Login->role()==='admin') && ($_user['username']!='admin') ) { if( ($Login->role()==='admin') && ($_User->username()!='admin') ) {
HTML::legend(array('value'=>$L->g('Delete'))); HTML::legend(array('value'=>$L->g('Delete')));
@ -105,18 +129,10 @@ if( ($Login->role()==='admin') && ($_user['username']!='admin') ) {
HTML::formClose(); HTML::formClose();
echo '</div>'; echo '</div>';
echo '<div class="uk-width-3-10" style="margin-top: 50px; text-align: center;">'; echo '<div class="uk-width-3-10" style="margin-top: 50px; text-align: center;">';
echo '<div id="jsprofilePicture">'; HTML::profileUploader($_User->username());
if(file_exists(PATH_UPLOADS_PROFILES.$_user['username'].'.jpg')) {
echo '<img class="uk-border-rounded" src="'.HTML_PATH_UPLOADS_PROFILES.$_user['username'].'.jpg" alt="">';
}
else {
echo '<div class="uk-block uk-border-rounded uk-block-muted uk-block-large">'.$L->g('Profile picture').'</div>';
}
echo '</div>';
HTML::profileUploader($_user['username']);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';

View File

@ -78,7 +78,9 @@ echo '<div class="sidebar uk-width-large-2-10">';
echo '<li>'; echo '<li>';
// --- BLUDIT COVER IMAGE --- // --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage(); HTML::bluditCoverImage();
echo '<hr>';
// --- BLUDIT QUICK IMAGES --- // --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages(); HTML::bluditQuickImages();
@ -91,6 +93,16 @@ echo '<div class="sidebar uk-width-large-2-10">';
// ---- ADVANCED TAB ---- // ---- ADVANCED TAB ----
echo '<li>'; echo '<li>';
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>'published',
'tip'=>''
));
// Parent input // Parent input
$options = array(); $options = array();
$options[NO_PARENT_CHAR] = '('.$Language->g('No parent').')'; $options[NO_PARENT_CHAR] = '('.$Language->g('No parent').')';
@ -105,16 +117,6 @@ echo '<div class="sidebar uk-width-large-2-10">';
'tip'=>'' 'tip'=>''
)); ));
// Status input
HTML::formSelect(array(
'name'=>'status',
'label'=>$L->g('Status'),
'class'=>'uk-width-1-1 uk-form-medium',
'options'=>array('published'=>$L->g('Published'), 'draft'=>$L->g('Draft')),
'selected'=>'published',
'tip'=>''
));
// Position input // Position input
HTML::formInputText(array( HTML::formInputText(array(
'name'=>'position', 'name'=>'position',

View File

@ -78,7 +78,9 @@ echo '<div class="sidebar uk-width-large-2-10">';
echo '<li>'; echo '<li>';
// --- BLUDIT COVER IMAGE --- // --- BLUDIT COVER IMAGE ---
echo '<hr>';
HTML::bluditCoverImage(); HTML::bluditCoverImage();
echo '<hr>';
// --- BLUDIT QUICK IMAGES --- // --- BLUDIT QUICK IMAGES ---
HTML::bluditQuickImages(); HTML::bluditQuickImages();
@ -91,15 +93,6 @@ echo '<div class="sidebar uk-width-large-2-10">';
// ---- ADVANCED TAB ---- // ---- ADVANCED TAB ----
echo '<li>'; echo '<li>';
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>Date::current(DB_DATE_FORMAT),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Status input // Status input
HTML::formSelect(array( HTML::formSelect(array(
'name'=>'status', 'name'=>'status',
@ -110,6 +103,15 @@ echo '<div class="sidebar uk-width-large-2-10">';
'tip'=>'' 'tip'=>''
)); ));
// Date input
HTML::formInputText(array(
'name'=>'date',
'value'=>Date::current(DB_DATE_FORMAT),
'class'=>'uk-width-1-1 uk-form-large',
'tip'=>$L->g('To schedule the post just select the date and time'),
'label'=>$L->g('Date')
));
// Slug input // Slug input
HTML::formInputText(array( HTML::formInputText(array(
'name'=>'slug', 'name'=>'slug',

View File

@ -84,6 +84,14 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
'tip'=>'' 'tip'=>''
)); ));
HTML::formInputText(array(
'name'=>'uriBlog',
'label'=>$L->g('Blog'),
'value'=>$Site->uriFilters('blog'),
'class'=>'uk-width-1-2 uk-form-medium',
'tip'=>''
));
echo '<div class="uk-form-row"> echo '<div class="uk-form-row">
<div class="uk-form-controls"> <div class="uk-form-controls">
<button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button> <button type="submit" class="uk-button uk-button-primary">'.$L->g('Save').'</button>

View File

@ -38,10 +38,10 @@ if($type=='profilePicture')
{ {
// Resize and crop profile image. // Resize and crop profile image.
$username = Sanitize::html($_POST['username']); $username = Sanitize::html($_POST['username']);
$tmpName = $username.'.jpg'; $tmpName = $username.'.png';
$Image = new Image(); $Image = new Image();
$Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, '200', '200', 'crop'); $Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, '400', '400', 'crop');
$Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, 100, true); $Image->saveImage(PATH_UPLOADS_PROFILES.$tmpName, 100, false, true);
} }
// --- OTHERS --- // --- OTHERS ---
else { else {

View File

@ -40,9 +40,9 @@ if( $layout['slug']==='ajax' )
else else
{ {
// Boot rules // Boot rules
include(PATH_RULES.'60.plugins.php');
include(PATH_RULES.'70.posts.php'); include(PATH_RULES.'70.posts.php');
include(PATH_RULES.'70.pages.php'); include(PATH_RULES.'71.pages.php');
include(PATH_RULES.'80.plugins.php');
include(PATH_RULES.'99.header.php'); include(PATH_RULES.'99.header.php');
include(PATH_RULES.'99.paginator.php'); include(PATH_RULES.'99.paginator.php');
include(PATH_RULES.'99.themes.php'); include(PATH_RULES.'99.themes.php');

View File

@ -61,7 +61,6 @@ define('ALERT_STATUS_FAIL', 1);
// Salt length // Salt length
define('THUMBNAILS_WIDTH', 400); define('THUMBNAILS_WIDTH', 400);
define('THUMBNAILS_HEIGHT', 400); define('THUMBNAILS_HEIGHT', 400);
define('THUMBNAILS_AMOUNT', 6); define('THUMBNAILS_AMOUNT', 6);
// Salt length // Salt length
@ -82,9 +81,12 @@ define('JSON', function_exists('json_encode'));
// TRUE if new posts hand-made set published, or FALSE for draft. // TRUE if new posts hand-made set published, or FALSE for draft.
define('CLI_STATUS', 'published'); define('CLI_STATUS', 'published');
// Database format date // Database date format
define('DB_DATE_FORMAT', 'Y-m-d H:i:s'); define('DB_DATE_FORMAT', 'Y-m-d H:i:s');
// Sitemap date format
define('SITEMAP_DATE_FORMAT', 'Y-m-d');
// Date format for Dashboard schedule posts // Date format for Dashboard schedule posts
define('SCHEDULED_DATE_FORMAT', 'd M - h:i a'); define('SCHEDULED_DATE_FORMAT', 'd M - h:i a');
@ -123,12 +125,14 @@ include(PATH_KERNEL.'dblanguage.class.php');
include(PATH_KERNEL.'dbsite.class.php'); include(PATH_KERNEL.'dbsite.class.php');
include(PATH_KERNEL.'post.class.php'); include(PATH_KERNEL.'post.class.php');
include(PATH_KERNEL.'page.class.php'); include(PATH_KERNEL.'page.class.php');
include(PATH_KERNEL.'user.class.php');
include(PATH_KERNEL.'url.class.php'); include(PATH_KERNEL.'url.class.php');
include(PATH_KERNEL.'login.class.php'); include(PATH_KERNEL.'login.class.php');
include(PATH_KERNEL.'parsedown.class.php'); include(PATH_KERNEL.'parsedown.class.php');
include(PATH_KERNEL.'parsedownextra.class.php'); include(PATH_KERNEL.'parsedownextra.class.php');
include(PATH_KERNEL.'security.class.php'); include(PATH_KERNEL.'security.class.php');
// Include Helpers Classes // Include Helpers Classes
include(PATH_HELPERS.'text.class.php'); include(PATH_HELPERS.'text.class.php');
include(PATH_HELPERS.'log.class.php'); include(PATH_HELPERS.'log.class.php');

View File

@ -24,6 +24,15 @@ $plugins = array(
'beforeAdminLoad'=>array(), 'beforeAdminLoad'=>array(),
'afterAdminLoad'=>array(), 'afterAdminLoad'=>array(),
'beforeRulesLoad'=>array(),
'afterPostCreate'=>array(),
'afterPostModify'=>array(),
'afterPostDelete'=>array(),
'afterPageCreate'=>array(),
'afterPageModify'=>array(),
'afterPageDelete'=>array(),
'loginHead'=>array(), 'loginHead'=>array(),
'loginBodyBegin'=>array(), 'loginBodyBegin'=>array(),
'loginBodyEnd'=>array(), 'loginBodyEnd'=>array(),

View File

@ -4,6 +4,8 @@
// Variables // Variables
// ============================================================================ // ============================================================================
// Array with all posts specified by a filter.
// Filter by page number, by tag, etc.
$posts = array(); $posts = array();
// ============================================================================ // ============================================================================
@ -42,7 +44,7 @@ function buildPost($key)
} }
// Post database, content from DATABASE JSON. // Post database, content from DATABASE JSON.
$db = $dbPosts->getDb($key); $db = $dbPosts->getPostDB($key);
if( !$db ) { if( !$db ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the post from database with key: '.$key); Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the post from database with key: '.$key);
return false; return false;
@ -75,14 +77,9 @@ function buildPost($key)
$postDateFormated = $Post->dateRaw( $Site->dateFormat() ); $postDateFormated = $Post->dateRaw( $Site->dateFormat() );
$Post->setField('date', $postDateFormated, true); $Post->setField('date', $postDateFormated, true);
// Parse username for the post. // User object
if( $dbUsers->userExists( $Post->username() ) ) $username = $Post->username();
{ $Post->setField('user', $dbUsers->getUser($username));
$user = $dbUsers->getDb( $Post->username() );
$Post->setField('authorFirstName', $user['firstName'], false);
$Post->setField('authorLastName', $user['lastName'], false);
}
return $Post; return $Post;
} }
@ -91,9 +88,10 @@ function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeU
{ {
global $dbPosts; global $dbPosts;
global $dbTags; global $dbTags;
global $posts;
global $Url; global $Url;
$posts = array();
if($tagKey) { if($tagKey) {
// Get the keys list from tags database, this database is optimized for this case. // Get the keys list from tags database, this database is optimized for this case.
$list = $dbTags->getList($pageNumber, $amount, $tagKey); $list = $dbTags->getList($pageNumber, $amount, $tagKey);
@ -116,6 +114,8 @@ function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeU
array_push($posts, $Post); array_push($posts, $Post);
} }
} }
return $posts;
} }
// ============================================================================ // ============================================================================
@ -140,11 +140,13 @@ if( ($Url->whereAmI()==='post') && ($Url->notFound()===false) )
{ {
$Post = buildPost( $Url->slug() ); $Post = buildPost( $Url->slug() );
// The post doesn't exist.
if($Post===false) if($Post===false)
{ {
$Url->setNotFound(true); $Url->setNotFound(true);
unset($Post); unset($Post);
} }
// The post is not published yet.
elseif( !$Post->published() ) elseif( !$Post->published() )
{ {
$Url->setNotFound(true); $Url->setNotFound(true);
@ -159,17 +161,17 @@ if( ($Url->whereAmI()==='post') && ($Url->notFound()===false) )
// Build posts by specific tag. // Build posts by specific tag.
elseif( ($Url->whereAmI()==='tag') && ($Url->notFound()===false) ) elseif( ($Url->whereAmI()==='tag') && ($Url->notFound()===false) )
{ {
buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true, $Url->slug()); $posts = buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true, $Url->slug());
} }
// Build posts for homepage or admin area. // Build posts for homepage or admin area.
else else
{ {
// Posts for admin area. // Posts for admin area.
if($Url->whereAmI()==='admin') { if($Url->whereAmI()==='admin') {
buildPostsForPage($Url->pageNumber(), POSTS_PER_PAGE_ADMIN, false); $posts = buildPostsForPage($Url->pageNumber(), POSTS_PER_PAGE_ADMIN, false);
} }
// Posts for homepage // Posts for home and blog filter.
else { elseif( ( ($Url->whereAmI()==='home') || ($Url->whereAmI()==='blog') ) && ($Url->notFound()===false) ) {
buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true); $posts = buildPostsForPage($Url->pageNumber(), $Site->postsPerPage(), true);
} }
} }

View File

@ -23,7 +23,7 @@ function sortPages($a, $b)
return ($a->position() < $b->position()) ? -1 : 1; return ($a->position() < $b->position()) ? -1 : 1;
} }
function build_page($key) function buildPage($key)
{ {
global $dbPages; global $dbPages;
global $dbUsers; global $dbUsers;
@ -38,7 +38,7 @@ function build_page($key)
} }
// Page database, content from DATABASE JSON. // Page database, content from DATABASE JSON.
$db = $dbPages->getDb($key); $db = $dbPages->getPageDB($key);
if( !$db ) { if( !$db ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the page from database with key: '.$key); Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the page from database with key: '.$key);
return false; return false;
@ -66,31 +66,28 @@ function build_page($key)
$pageDateFormated = $Page->dateRaw( $Site->dateFormat() ); $pageDateFormated = $Page->dateRaw( $Site->dateFormat() );
$Page->setField('date', $pageDateFormated, true); $Page->setField('date', $pageDateFormated, true);
// Parse username for the page. // User object
if( $dbUsers->userExists( $Page->username() ) ) $username = $Page->username();
{ $Page->setField('user', $dbUsers->getUser($username));
$user = $dbUsers->getDb( $Page->username() );
$Page->setField('authorFirstName', $user['firstName'], false);
$Page->setField('authorLastName', $user['lastName'], false);
}
return $Page; return $Page;
} }
function build_all_pages() function buildAllPages()
{ {
global $pages;
global $pagesParents; global $pagesParents;
global $dbPages; global $dbPages;
$list = $dbPages->getAll(); $list = $dbPages->getDB();
// Clean pages array.
$pages = array();
unset($list['error']); unset($list['error']);
foreach($list as $key=>$db) foreach($list as $key=>$db)
{ {
$Page = build_page($key); $Page = buildPage($key);
if($Page!==false) if($Page!==false)
{ {
@ -135,6 +132,8 @@ function build_all_pages()
} }
$pagesParents = array(NO_PARENT_CHAR=>$parents) + $tmpPageWithParent; $pagesParents = array(NO_PARENT_CHAR=>$parents) + $tmpPageWithParent;
return $pages;
} }
// ============================================================================ // ============================================================================
@ -146,16 +145,18 @@ if( $Site->cliMode() ) {
$dbPages->regenerateCli(); $dbPages->regenerateCli();
} }
// Filter by page, then build it // Build specific page.
if( ($Url->whereAmI()==='page') && ($Url->notFound()===false) ) if( ($Url->whereAmI()==='page') && ($Url->notFound()===false) )
{ {
$Page = build_page( $Url->slug() ); $Page = buildPage( $Url->slug() );
// The page doesn't exist.
if($Page===false) if($Page===false)
{ {
$Url->setNotFound(true); $Url->setNotFound(true);
unset($Page); unset($Page);
} }
// The page is not published yet.
elseif( !$Page->published() ) elseif( !$Page->published() )
{ {
$Url->setNotFound(true); $Url->setNotFound(true);
@ -163,14 +164,15 @@ if( ($Url->whereAmI()==='page') && ($Url->notFound()===false) )
} }
} }
// Default homepage // Homepage
if($Url->notFound()===false) if( ($Url->whereAmI()==='home') && ($Url->notFound()===false) )
{ {
if( Text::isNotEmpty($Site->homepage()) && ($Url->whereAmI()==='home') ) // The user defined as homepage a particular page.
if( Text::isNotEmpty( $Site->homepage() ) )
{ {
$Url->setWhereAmI('page'); $Url->setWhereAmI('page');
$Page = build_page( $Site->homepage() ); $Page = buildPage( $Site->homepage() );
if($Page===false) { if($Page===false) {
$Url->setWhereAmI('home'); $Url->setWhereAmI('home');
@ -185,4 +187,4 @@ if($Url->notFound())
} }
// Build all pages // Build all pages
build_all_pages(); $pages = buildAllPages();

View File

@ -1,9 +1,14 @@
<?php defined('BLUDIT') or die('Bludit CMS.'); <?php defined('BLUDIT') or die('Bludit CMS.');
// Boot rules // Load plugins rules
include(PATH_RULES.'60.plugins.php');
// Plugins before rules loaded, except plugins rules
Theme::plugins('beforeRulesLoad');
// Load rules
include(PATH_RULES.'70.posts.php'); include(PATH_RULES.'70.posts.php');
include(PATH_RULES.'70.pages.php'); include(PATH_RULES.'71.pages.php');
include(PATH_RULES.'80.plugins.php');
include(PATH_RULES.'99.header.php'); include(PATH_RULES.'99.header.php');
include(PATH_RULES.'99.paginator.php'); include(PATH_RULES.'99.paginator.php');
include(PATH_RULES.'99.themes.php'); include(PATH_RULES.'99.themes.php');

View File

@ -12,7 +12,8 @@ class dbPages extends dbJSON
'tags'=> array('inFile'=>false, 'value'=>array()), 'tags'=> array('inFile'=>false, 'value'=>array()),
'status'=> array('inFile'=>false, 'value'=>'draft'), 'status'=> array('inFile'=>false, 'value'=>'draft'),
'date'=> array('inFile'=>false, 'value'=>''), 'date'=> array('inFile'=>false, 'value'=>''),
'position'=> array('inFile'=>false, 'value'=>0) 'position'=> array('inFile'=>false, 'value'=>0),
'coverImage'=> array('inFile'=>false, 'value'=>''),
); );
function __construct() function __construct()
@ -94,7 +95,7 @@ class dbPages extends dbJSON
return false; return false;
} }
return true; return $key;
} }
public function edit($args) public function edit($args)
@ -182,7 +183,7 @@ class dbPages extends dbJSON
return false; return false;
} }
return true; return $newKey;
} }
public function delete($key) public function delete($key)
@ -214,7 +215,7 @@ class dbPages extends dbJSON
} }
// Return an array with the database for a page, FALSE otherwise. // Return an array with the database for a page, FALSE otherwise.
public function getDb($key) public function getPageDB($key)
{ {
if($this->pageExists($key)) { if($this->pageExists($key)) {
return $this->db[$key]; return $this->db[$key];
@ -287,8 +288,8 @@ class dbPages extends dbJSON
return $newKey; return $newKey;
} }
// Return an array with all databases. // Returns the database
public function getAll() public function getDB()
{ {
return $this->db; return $this->db;
} }

View File

@ -10,7 +10,8 @@ class dbPosts extends dbJSON
'status'=> array('inFile'=>false, 'value'=>'draft'), // published, draft, scheduled 'status'=> array('inFile'=>false, 'value'=>'draft'), // published, draft, scheduled
'tags'=> array('inFile'=>false, 'value'=>array()), 'tags'=> array('inFile'=>false, 'value'=>array()),
'allowComments'=> array('inFile'=>false, 'value'=>false), 'allowComments'=> array('inFile'=>false, 'value'=>false),
'date'=> array('inFile'=>false, 'value'=>'') 'date'=> array('inFile'=>false, 'value'=>''),
'coverImage'=> array('inFile'=>false, 'value'=>''),
); );
private $numberPosts = array( private $numberPosts = array(
@ -34,8 +35,14 @@ class dbPosts extends dbJSON
return $this->numberPosts['published']; return $this->numberPosts['published'];
} }
// Returns the database
public function getDB()
{
return $this->db;
}
// Return an array with the post's database, FALSE otherwise. // Return an array with the post's database, FALSE otherwise.
public function getDb($key) public function getPostDB($key)
{ {
if($this->postExists($key)) { if($this->postExists($key)) {
return $this->db[$key]; return $this->db[$key];
@ -44,7 +51,7 @@ class dbPosts extends dbJSON
return false; return false;
} }
public function setDb($key, $field, $value) public function setPostDb($key, $field, $value)
{ {
if($this->postExists($key)) { if($this->postExists($key)) {
$this->db[$key][$field] = $value; $this->db[$key][$field] = $value;
@ -175,7 +182,7 @@ class dbPosts extends dbJSON
return false; return false;
} }
return true; return $key;
} }
public function edit($args) public function edit($args)

View File

@ -17,6 +17,7 @@ class dbSite extends dbJSON
'uriPage'=> array('inFile'=>false, 'value'=>'/'), 'uriPage'=> array('inFile'=>false, 'value'=>'/'),
'uriPost'=> array('inFile'=>false, 'value'=>'/post/'), 'uriPost'=> array('inFile'=>false, 'value'=>'/post/'),
'uriTag'=> array('inFile'=>false, 'value'=>'/tag/'), 'uriTag'=> array('inFile'=>false, 'value'=>'/tag/'),
'uriBlog'=> array('inFile'=>false, 'value'=>'/blog/'),
'url'=> array('inFile'=>false, 'value'=>''), 'url'=> array('inFile'=>false, 'value'=>''),
'cliMode'=> array('inFile'=>false, 'value'=>true), 'cliMode'=> array('inFile'=>false, 'value'=>true),
'emailFrom'=> array('inFile'=>false, 'value'=>''), 'emailFrom'=> array('inFile'=>false, 'value'=>''),
@ -67,6 +68,7 @@ class dbSite extends dbJSON
$filters['post'] = $this->getField('uriPost'); $filters['post'] = $this->getField('uriPost');
$filters['page'] = $this->getField('uriPage'); $filters['page'] = $this->getField('uriPage');
$filters['tag'] = $this->getField('uriTag'); $filters['tag'] = $this->getField('uriTag');
$filters['blog'] = $this->getField('uriBlog');
if(empty($filter)) { if(empty($filter)) {
return $filters; return $filters;
@ -93,6 +95,12 @@ class dbSite extends dbJSON
return $this->url().ltrim($filter, '/'); return $this->url().ltrim($filter, '/');
} }
public function urlBlog()
{
$filter = $this->getField('uriBlog');
return $this->url().ltrim($filter, '/');
}
// Returns the site title. // Returns the site title.
public function title() public function title()
{ {

View File

@ -18,6 +18,16 @@ class dbTags extends dbJSON
parent::__construct(PATH_DATABASES.'tags.php'); parent::__construct(PATH_DATABASES.'tags.php');
} }
// Returns an array with all tags names
public function getAll()
{
$tmp = array();
foreach($this->db['postsIndex'] as $tagSlug=>$tagInfo) {
$tmp[$tagSlug] = $tagInfo['name'];
}
return $tmp;
}
// Returns an array with a list of posts keys, filtered by a page number and a tag key. // Returns an array with a list of posts keys, filtered by a page number and a tag key.
public function getList($pageNumber, $postPerPage, $tagKey) public function getList($pageNumber, $postPerPage, $tagKey)
{ {

View File

@ -24,6 +24,24 @@ class dbUsers extends dbJSON
parent::__construct(PATH_DATABASES.'users.php'); parent::__construct(PATH_DATABASES.'users.php');
} }
public function getUser($username)
{
$User = new User();
if($this->userExists($username))
{
$User->setField('username', $username);
foreach($this->db[$username] as $key=>$value) {
$User->setField($key, $value);
}
return $User;
}
return false;
}
public function getAll() public function getAll()
{ {
return $this->db; return $this->db;

View File

@ -19,7 +19,7 @@ class Image {
$this->resizeImage($newWidth, $newHeight, $option); $this->resizeImage($newWidth, $newHeight, $option);
} }
public function saveImage($savePath, $imageQuality="100", $forceJPG=false) public function saveImage($savePath, $imageQuality="100", $forceJPG=false, $forcePNG=false)
{ {
$extension = strtolower(pathinfo($savePath, PATHINFO_EXTENSION)); $extension = strtolower(pathinfo($savePath, PATHINFO_EXTENSION));
@ -28,21 +28,25 @@ class Image {
$path_complete = $filename.'.'.$extension; $path_complete = $filename.'.'.$extension;
if($forceJPG) { if($forcePNG) {
imagejpeg($this->imageResized, $filename.'.jpg', $imageQuality); $extension = 'png';
} }
else elseif($forceJPG) {
{ $extension = 'jpg';
}
switch($extension) switch($extension)
{ {
case 'jpg': case 'jpg':
case 'jpeg': case 'jpeg':
// Checking for JPG support
if (imagetypes() & IMG_JPG) { if (imagetypes() & IMG_JPG) {
imagejpeg($this->imageResized, $path_complete, $imageQuality); imagejpeg($this->imageResized, $path_complete, $imageQuality);
} }
break; break;
case 'gif': case 'gif':
// Checking for GIF support
if (imagetypes() & IMG_GIF) { if (imagetypes() & IMG_GIF) {
imagegif($this->imageResized, $path_complete); imagegif($this->imageResized, $path_complete);
} }
@ -55,16 +59,16 @@ class Image {
// *** Invert quality setting as 0 is best, not 9 // *** Invert quality setting as 0 is best, not 9
$invertScaleQuality = 9 - $scaleQuality; $invertScaleQuality = 9 - $scaleQuality;
// Checking for PNG support
if (imagetypes() & IMG_PNG) { if (imagetypes() & IMG_PNG) {
imagepng($this->imageResized, $path_complete, $invertScaleQuality); imagepng($this->imageResized, $path_complete, $invertScaleQuality);
} }
break; break;
default: default:
// *** No extension - No save. // Fail extension detection
break; break;
} }
}
imagedestroy($this->imageResized); imagedestroy($this->imageResized);
} }

View File

@ -131,103 +131,6 @@ class Theme {
return $tmp; return $tmp;
} }
// OLD
public static function url($relative = true)
{
if($relative)
return HTML_PATH_ROOT;
else
return BLOG_URL;
}
public static function name()
{
global $settings;
return $settings['name'];
}
public static function slogan()
{
global $settings;
return $settings['slogan'];
}
public static function footer()
{
global $settings;
return $settings['footer'];
}
public static function language()
{
global $settings;
$lang = explode("_",$settings['locale']);
return $lang[0];
}
public static function locale()
{
global $settings;
return $settings['locale'];
}
public static function meta_tags()
{
global $layout;
global $seo;
// The validator W3C doesn't support???
//$meta = '<meta charset="UTF-8">'.PHP_EOL;
$meta = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'.PHP_EOL;
if(!empty($layout['title']))
$meta .= '<title>'.$layout['title'].'</title>'.PHP_EOL;
if(!empty($layout['description']))
$meta .= '<meta name="description" content="'.$layout['description'].'">'.PHP_EOL;
if(!empty($layout['generator']))
$meta .= '<meta name="generator" content="'.$layout['generator'].'">'.PHP_EOL;
if(!empty($layout['keywords']))
$meta .= '<meta name="keywords" content="'.$layout['keywords'].'">'.PHP_EOL;
if(!empty($layout['author']))
{
if(filter_var($layout['author'], FILTER_VALIDATE_URL))
$meta .= '<link rel="author" href="'.$layout['author'].'">'.PHP_EOL;
else
$meta .= '<meta name="author" content="'.$layout['author'].'">'.PHP_EOL;
}
if(!empty($layout['canonical']))
$meta .= '<link rel="canonical" href="'.$layout['canonical'].'">'.PHP_EOL;
if(!empty($layout['robots']))
$meta .= '<meta name="robots" content="'.$layout['robots'].'">'.PHP_EOL;
if(!empty($seo['google_code']))
$meta .= '<meta name="google-site-verification" content="'.$seo['google_code'].'">'.PHP_EOL;
if(!empty($seo['bing_code']))
$meta .= '<meta name="msvalidate.01" content="'.$seo['bing_code'].'">'.PHP_EOL;
$meta .= '<link rel="alternate" type="application/atom+xml" title="ATOM Feed" href="'.$layout['feed'].'">'.PHP_EOL;
return $meta;
}
} }
?> ?>

View File

@ -111,6 +111,21 @@ class Page extends fileContent
return $this->getField('key'); return $this->getField('key');
} }
public function coverImage($absolute=true)
{
$fileName = $this->getField('coverImage');
if(empty($fileName)) {
return false;
}
if($absolute) {
return HTML_PATH_UPLOADS.$fileName;
}
return $fileName;
}
// Returns TRUE if the page is published, FALSE otherwise. // Returns TRUE if the page is published, FALSE otherwise.
public function published() public function published()
{ {
@ -187,16 +202,32 @@ class Page extends fileContent
return $tmp; return $tmp;
} }
// Returns the user object if $field is false, otherwise returns the field's value.
public function user($field=false)
{
// Get the user object.
$User = $this->getField('user');
if($field) {
return $User->getField($field);
}
return $User;
}
// DEPRECATED
public function username() public function username()
{ {
return $this->getField('username'); return $this->getField('username');
} }
// DEPRECATED
public function authorFirstName() public function authorFirstName()
{ {
return $this->getField('authorFirstName'); return $this->getField('authorFirstName');
} }
// DEPRECATED
public function authorLastName() public function authorLastName()
{ {
return $this->getField('authorLastName'); return $this->getField('authorLastName');

View File

@ -78,9 +78,19 @@ class Post extends fileContent
return ($this->getField('status')=='draft'); return ($this->getField('status')=='draft');
} }
public function username() public function coverImage($absolute=true)
{ {
return $this->getField('username'); $fileName = $this->getField('coverImage');
if(empty($fileName)) {
return false;
}
if($absolute) {
return HTML_PATH_UPLOADS.$fileName;
}
return $fileName;
} }
public function profilePicture() public function profilePicture()
@ -88,11 +98,32 @@ class Post extends fileContent
return HTML_PATH_UPLOADS_PROFILES.$this->username().'.jpg'; return HTML_PATH_UPLOADS_PROFILES.$this->username().'.jpg';
} }
// Returns the user object if $field is false, otherwise returns the field's value.
public function user($field=false)
{
// Get the user object.
$User = $this->getField('user');
if($field) {
return $User->getField($field);
}
return $User;
}
// DEPRECATED
public function username()
{
return $this->getField('username');
}
// DEPRECATED
public function authorFirstName() public function authorFirstName()
{ {
return $this->getField('authorFirstName'); return $this->getField('authorFirstName');
} }
// DEPRECATED
public function authorLastName() public function authorLastName()
{ {
return $this->getField('authorLastName'); return $this->getField('authorLastName');
@ -104,7 +135,7 @@ class Post extends fileContent
} }
// Returns the post date according to locale settings and format settings. // Returns the post date according to locale settings and format settings.
public function date($format=false) public function date()
{ {
return $this->getField('date'); return $this->getField('date');
} }

View File

@ -67,6 +67,12 @@ class Url
break; break;
} }
if($filterURI===$filters['blog'])
{
$this->whereAmI = 'blog';
break;
}
if($filterURI===$adminFilter['admin']) if($filterURI===$adminFilter['admin'])
{ {
$this->whereAmI = 'admin'; $this->whereAmI = 'admin';

95
kernel/user.class.php Normal file
View File

@ -0,0 +1,95 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class User
{
public $db;
public function setField($field, $value)
{
$this->db[$field] = $value;
return true;
}
public function getField($field)
{
if(isset($this->db[$field])) {
return $this->db[$field];
}
return false;
}
// Returns username
public function username()
{
return $this->getField('username');
}
public function firstName()
{
return $this->getField('firstName');
}
public function lastName()
{
return $this->getField('lastName');
}
public function role()
{
return $this->getField('role');
}
public function password()
{
return $this->getField('password');
}
public function salt()
{
return $this->getField('salt');
}
public function email()
{
return $this->getField('email');
}
public function registered()
{
return $this->getField('registered');
}
public function twitterUsername()
{
return $this->getField('twitterUsername');
}
public function facebookUsername()
{
return $this->getField('facebookUsername');
}
public function googleUsername()
{
return $this->getField('googleUsername');
}
public function instagramUsername()
{
return $this->getField('instagramUsername');
}
public function profilePicture($absolute=true)
{
$filename = $this->getField('username').'.png';
if($absolute) {
return HTML_PATH_UPLOADS_PROFILES.$filename;
}
return $filename;
}
}

View File

@ -77,7 +77,7 @@
"published-date": "Дата на побликуване", "published-date": "Дата на побликуване",
"modified-date": "Промяна на дата", "modified-date": "Промяна на дата",
"empty-title": "Без заглавие", "empty-title": "Без заглавие",
"plugins": "Плъгини", "plugins": "Компоненти",
"install-plugin": "Добави", "install-plugin": "Добави",
"uninstall-plugin": "Премахни", "uninstall-plugin": "Премахни",
"new-password": "Нова парола", "new-password": "Нова парола",
@ -164,7 +164,7 @@
"scheduled": "Планирано", "scheduled": "Планирано",
"publish": "Публикувай", "publish": "Публикувай",
"please-check-your-theme-configuration": "Моля, проверете конфигурацията на вашата тема.", "please-check-your-theme-configuration": "Моля, проверете конфигурацията на вашата тема.",
"plugin-label": "Заглавие плъгин", "plugin-label": "Заглавие на компонент",
"enabled": "Разреши", "enabled": "Разреши",
"disabled": "Забрани", "disabled": "Забрани",
"cli-mode": "Режим CLI", "cli-mode": "Режим CLI",
@ -218,6 +218,8 @@
"site-information": "Информация за сайта", "site-information": "Информация за сайта",
"date-and-time-formats": "Формат дата и час", "date-and-time-formats": "Формат дата и час",
"activate": "Активиране", "activate": "Активиране",
"deactivate": "Деактивиране" "deactivate": "Деактивиране",
"cover-image": "Обложка"
} }

220
languages/de_CH.json Normal file
View File

@ -0,0 +1,220 @@
{
"language-data":
{
"native": "Deutsch (Schweiz)",
"english-name": "German",
"last-update": "2016-01-05",
"author": "Clickwork",
"email": "egoetschel@clickwork.ch",
"website": "https://www.clickwork.ch"
},
"username": "Benutzername",
"password": "Passwort",
"confirm-password": "Passwort wiederholen",
"editor": "Editor",
"dashboard": "Dashboard",
"role": "Rolle",
"post": "Beitrag",
"posts": "Beiträge",
"users": "Benutzer",
"administrator": "Administrator",
"add": "Hinzufügen",
"cancel": "Abbrechen",
"content": "Inhalt",
"title": "Titel",
"no-parent": "Keine übergeordnete Seite",
"edit-page": "Seite bearbeiten",
"edit-post": "Beitrag bearbeiten",
"add-a-new-user": "Neuer Benutzer",
"parent": "Übergeordnete Seite",
"friendly-url": "Pretty URL",
"description": "Beschreibung",
"posted-by": "Veröffentlicht von",
"tags": "Schlagwörter",
"position": "Position",
"save": "Speichern",
"draft": "Entwurf",
"delete": "Löschen",
"registered": "Hinzugefügt",
"Notifications": "Benachrichtigungen",
"profile": "Profil",
"email": "E-Mail",
"settings": "Einstellungen",
"general": "Allgemein",
"advanced": "Erweitert",
"regional": "Lokalisierung",
"about": "Über",
"login": "Anmelden",
"logout": "Abmelden",
"manage": "Verwaltung",
"themes": "Themes",
"prev-page": "Vorhergehende Seite",
"next-page": "Nächste Seite",
"configure-plugin": "Plugin konfigurieren",
"confirm-delete-this-action-cannot-be-undone": "Bestätige das Löschen, dieser Vorgang kann nicht rückgängig gemacht werden.",
"site-title": "Titel der Webseite",
"site-slogan": "Untertitel",
"site-description": "Informationen zur Website",
"footer-text": "Footer-Text",
"posts-per-page": "Beiträge pro Seite",
"site-url": "URL der Website",
"writting-settings": "Beitrags- und Seiteneinstellungen",
"url-filters": "URL-Erweiterungen",
"page": "Seite",
"pages": "Seiten",
"home": "Hauptseite",
"welcome-back": "Willkommen",
"language": "Sprache",
"website": "Zur Website",
"timezone": "Zeitzone",
"locale": "Lokalisierung",
"new-post": "Neuer Beitrag",
"html-and-markdown-code-supported": "HTML und Markdown werden unterstützt",
"new-page": "Neue Seite",
"manage-posts": "Beiträge verwalten",
"published-date": "Veröffentlicht",
"modified-date": "Letzte Änderung",
"empty-title": "Kein Titel",
"plugins": "Plugins",
"install-plugin": "Plugin aktivieren",
"uninstall-plugin": "Plugin deaktivieren",
"new-password": "Neues Passwort",
"edit-user": "Benutzer bearbeiten",
"publish-now": "Veröffentlichen",
"first-name": "Vorname",
"last-name": "Nachname",
"bludit-version": "Bludit Version",
"powered-by": "Diese Website wurde eingerichtet mit",
"recent-posts": "Neueste Beiträge",
"manage-pages": "Seiten verwalten",
"advanced-options": "Erweiterte Einstellungen",
"user-deleted": "Der Benutzer wurde gelöscht.",
"page-added-successfully": "Die Seite wurde veröffentlicht.",
"post-added-successfully": "Der Beitrag wurde veröffentlicht.",
"the-post-has-been-deleted-successfully": "Der Beitrag wurde gelöscht.",
"the-page-has-been-deleted-successfully": "Die Seite wurde gelöscht.",
"username-or-password-incorrect": "Der Benutzername oder das Passwort stimmt nicht.",
"database-regenerated": "Die Datenbank wurde neu aufgebaut.",
"the-changes-have-been-saved": "Die Änderungen wurden gespeichert.",
"enable-more-features-at": "Zusätzlich Felder können aktiviert werden unter",
"username-already-exists": "Diesen Benutzernamen gibt es bereits.",
"username-field-is-empty": "Es muss ein Benutzername eingegeben werden.",
"the-password-and-confirmation-password-do-not-match":"Die eingegebenen Passwörter stimmen nicht überein.",
"user-has-been-added-successfully": "Der Benutzer wurde hinzugefügt.",
"you-do-not-have-sufficient-permissions": "Du bist nicht berechtigt, die Seite aufzurufen.",
"settings-advanced-writting-settings": "Einstellungen > Erweitert > Beitrags- und Seiteneinstellungen",
"new-posts-and-pages-synchronized": "Neue Beiträge und Seiten wurden synchronisiert.",
"you-can-choose-the-users-privilege": "Rechte des Benutzers. Ein Editor kann nur Seiten anlegen und Beiträge schreiben.",
"email-will-not-be-publicly-displayed": "Die E-Mail wird nicht öffentlich gezeigt. Sie wird für die Wiederherstellung des Passworts und Benachrichtigungen verwendet.",
"use-this-field-to-name-your-site": "Name der Website, wie er auf jeder Seite angezeigt wird.",
"use-this-field-to-add-a-catchy-phrase": "Untertitel oder Slogan der Website.",
"you-can-add-a-site-description-to-provide": "Kurze Beschreibung der Website für Suchmaschinen.",
"you-can-add-a-small-text-on-the-bottom": "Text im Fussbereich jeder Seite. Beispielsweise: Copyright-Hinweis, Eigentümer der Website usw.",
"number-of-posts-to-show-per-page": "Anzahl der Beiträge, die auf einer Seite gezeigt werden.",
"the-url-of-your-site": "URL der Website.",
"add-or-edit-description-tags-or": "Beschreibungen, Schlagwörter und Pretty URL hinzufügen oder ändern.",
"select-your-sites-language": "Sprache der Website.",
"select-a-timezone-for-a-correct": "Zeitzone für die richtige Anzeige des Datums und der Zeit auf der Website.",
"you-can-use-this-field-to-define-a-set-of": "Parameter mit Bezug auf die verwendete Sprache und das Land. Beispielsweise: de_DE, de_CH usw.",
"you-can-modify-the-url-which-identifies":"Der URL kann selbst angepasst werden. Möglich sind bis zu 150 Zeichen.",
"this-field-can-help-describe-the-content": "Kurze Inhaltsbeschreibung. Möglich sind bis zu 150 Zeichen.",
"write-the-tags-separated-by-comma": "Schlagwörter getrennt durch Kommas. Beispielsweise: Schlagwort1, Schlagwort2, Schlagwort3",
"delete-the-user-and-all-its-posts":"Benutzer und alle seine Beiträge löschen",
"delete-the-user-and-associate-its-posts-to-admin-user": "Benutzer löschen und seine Beiträge dem Administrator zuordnen",
"read-more": "Weiterlesen",
"show-blog": "Blog zeigen",
"default-home-page": "Hauptseite",
"version": "Version",
"there-are-no-drafts": "Es sind keine Entwürfe vorhanden.",
"create-a-new-article-for-your-blog": "Einen neuen Beitrag schreiben.",
"create-a-new-page-for-your-website": "Eine neue Seite anlegen.",
"invite-a-friend-to-collaborate-on-your-website": "Einen neuen Benutzer hinzufügen.",
"change-your-language-and-region-settings": "Sprache ändern und Lokalisierung einstellen.",
"language-and-timezone": "Sprache und Zeitzone",
"author": "Autor",
"start-here": "Direktzugriff",
"install-theme": "Theme aktivieren",
"first-post": "Erster Beitrag",
"congratulations-you-have-successfully-installed-your-bludit": "Gratulation, du hast **Bludit** erfolgreich installiert!",
"whats-next": "Und so geht es weiter:",
"manage-your-bludit-from-the-admin-panel": "Verwalte Bludit im [Administrationsbereich](./admin/).",
"follow-bludit-on": "Folge Bludit bei",
"visit-the-support-forum": "Besuche das [Forum](http://forum.bludit.com), um Hilfe zu erhalten.",
"read-the-documentation-for-more-information": "Lies die [Dokumentation](http://docs.bludit.com) und das [Bludit-Tutorial](https://bludit-tutorial.ch) für weitere Informationen.",
"share-with-your-friends-and-enjoy": "Erzähle deinen Freunden von Bludit und habe Spass daran.",
"the-page-has-not-been-found": "Die Seite wurde nicht gefunden.",
"error": "Fehler",
"bludit-installer": "Bludit-Installer",
"welcome-to-the-bludit-installer": "Willkommen beim Bludit-Installer!",
"complete-the-form-choose-a-password-for-the-username-admin": "Bitte ein Passwort für den Benutzer \"admin\" wählen<br>und eine E-Mail-Adresse eingeben.",
"password-visible-field": "Das Passwort wird in Klartext angezeigt!",
"install": "Installieren",
"choose-your-language": "Sprache wählen",
"next": "Weiter",
"the-password-field-is-empty": "Das Passwort-Feld ist leer.",
"your-email-address-is-invalid": "Die E-Mail-Adresse scheint ungültig zu sein.",
"proceed-anyway": "Trotzdem fortfahren...",
"drafts": "Entwürfe",
"ip-address-has-been-blocked": "Die IP-Adresse wurde blockiert.",
"try-again-in-a-few-minutes": "Bitte versuche es in einigen Minuten noch einmal.",
"date": "Datum und Zeit",
"you-can-schedule-the-post-just-select-the-date-and-time": "Um den Beitrag zu einem späteren Zeitpunkt zu veröffentlichen, wähle ein Datum und die Zeit aus.",
"scheduled": "Veröffentlichung geplant.",
"publish": "Veröffentlichen",
"please-check-your-theme-configuration": "Bitte die Einstellungen des Themes prüfen.",
"plugin-label": "Titel auf der Website",
"enabled": "Aktiviert",
"disabled": "Deaktiviert",
"cli-mode": "CLI-Modus",
"command-line-mode": "Kommandozeilen-Modus",
"enable-the-command-line-mode-if-you-add-edit": "Verwende den Kommandozeilen-Modus, wenn du Beiträge und Seiten im Dateisystem hinzufügen, ändern oder löschen möchtest.",
"configure": "Konfiguration",
"uninstall": "Deinstallieren",
"change-password": "Neues Passwort",
"to-schedule-the-post-just-select-the-date-and-time": "Um einen Beitrag zu einem bestimmten Zeitpunkt zu veröffentlichen, Datum und Zeit wählen.",
"write-the-tags-separated-by-commas": "Schlagwörter durch Kommas getrennt.",
"status": "Status",
"published": "Veröffentlicht",
"scheduled-posts": "Veröffentlichung planen",
"statistics": "Statistiken",
"name": "Name",
"email-account-settings":"E-Mail-Adresse",
"sender-email": "Absender",
"emails-will-be-sent-from-this-address":"E-Mails werden mit dieser E-Mail-Adresse als Absender verschickt.",
"bludit-login-access-code": "BLUDIT - Zugangscode",
"check-your-inbox-for-your-login-access-code":"Der Zugangscode wurde dir geschickt.",
"there-was-a-problem-sending-the-email":"Es besteht ein Pronlem mit dem Verschicken dieser E-Mail.",
"back-to-login-form": "Zurück zum Login",
"send-me-a-login-access-code": "Zugangscode zuschicken",
"get-login-access-code": "Zugangscode schicken",
"email-notification-login-access-code": "<p>Du hast einen Zugangscode für die Website {{WEBSITE_NAME}} angefordert.</p><p>Bitte klicke folgenden Link an oder kopiere ihn, um ihn in der Adresszeile des Browsers einzugeben:</p><p>{{LINK}}</p>",
"there-are-no-scheduled-posts": "Es sind keine geplanten Beiträge vorhanden.",
"show-password": "Passwort zeigen",
"edit-or-remove-your=pages": "Seiten bearbeiten oder löschen.",
"edit-or-remove-your-blogs-posts": "Beiträge bearbeiten oder löschen.",
"general-settings": "Allgemein",
"advanced-settings": "Erweitert",
"manage-users": "Benutzerverwaltung",
"view-and-edit-your-profile": "Profil anschauen und bearbeiten.",
"password-must-be-at-least-6-characters-long": "Das Passwort muss mindestens 6 Zeichen lang sein",
"images": "Bilder",
"upload-image": "Bild hochladen",
"drag-and-drop-or-click-here": "Drag and Drop oder klicke hier",
"insert-image": "Bild einfügen",
"supported-image-file-types": "Unterstützte Datei-Formate",
"date-format": "Datumsformat",
"time-format": "Zeitformat",
"chat-with-developers-and-users-on-gitter":"Chatte mit Entwicklern und Benutzern bei [Gitter](https://gitter.im/dignajar/bludit)",
"this-is-a-brief-description-of-yourself-our-your-site":"Dies ist eine kurze Beschreibung, wer du bist, oder deiner Website. Um diesen Text zu ändern, gehe im Admin-Panel zu den Einstellungen und konfiguriere unter \"Plugins\" das Plugin \"Über\".",
"profile-picture": "Profil-Bild",
"the-about-page-is-very-important": "Die Seite \"Über\" ist wichtig und wirkungsvoll beispielsweise für zukünfige Kunden und Partner. Für alle, die wissen möchten, wer hinter der Website steht, ist die \"Über\"-Seite die erste Informationsquelle.",
"change-this-pages-content-on-the-admin-panel": "Der Inhalt dieser Seite kann im Admin-Panel unter \"Verwaltung\" > \"Seiten\" geändert werden.",
"about-your-site-or-yourself": "Über dich oder deine Website",
"welcome-to-bludit": "Willkommen bei Bludit",
"site-information": "Angaben zur Website",
"date-and-time-formats": "Datum und Zeit",
"activate": "Aktivieren",
"deactivate": "Deaktivieren",
"cover-image": "Hauptbild"
}

View File

@ -3,7 +3,7 @@
{ {
"native": "Deutsch (Deutschland)", "native": "Deutsch (Deutschland)",
"english-name": "German", "english-name": "German",
"last-update": "2015-12-15", "last-update": "2016-01-05",
"author": "Clickwork", "author": "Clickwork",
"email": "egoetschel@clickwork.ch", "email": "egoetschel@clickwork.ch",
"website": "https://www.clickwork.ch" "website": "https://www.clickwork.ch"
@ -142,7 +142,7 @@
"follow-bludit-on": "Folge Bludit bei", "follow-bludit-on": "Folge Bludit bei",
"visit-the-support-forum": "Besuche das [Forum](http://forum.bludit.com), um Hilfe zu erhalten.", "visit-the-support-forum": "Besuche das [Forum](http://forum.bludit.com), um Hilfe zu erhalten.",
"read-the-documentation-for-more-information": "Lies die [Dokumentation](http://docs.bludit.com) und das [Bludit-Tutorial](https://bludit-tutorial.ch) für weitere Informationen.", "read-the-documentation-for-more-information": "Lies die [Dokumentation](http://docs.bludit.com) und das [Bludit-Tutorial](https://bludit-tutorial.ch) für weitere Informationen.",
"share-with-your-friends-and-enjoy": "Erzähle deinen Freunden von Bludit und habe Spass daran.", "share-with-your-friends-and-enjoy": "Erzähle deinen Freunden von Bludit und habe Spaß daran.",
"the-page-has-not-been-found": "Die Seite wurde nicht gefunden.", "the-page-has-not-been-found": "Die Seite wurde nicht gefunden.",
"error": "Fehler", "error": "Fehler",
"bludit-installer": "Bludit-Installer", "bludit-installer": "Bludit-Installer",
@ -184,7 +184,7 @@
"emails-will-be-sent-from-this-address":"E-Mails werden mit dieser E-Mail-Adresse als Absender verschickt.", "emails-will-be-sent-from-this-address":"E-Mails werden mit dieser E-Mail-Adresse als Absender verschickt.",
"bludit-login-access-code": "BLUDIT - Zugangscode", "bludit-login-access-code": "BLUDIT - Zugangscode",
"check-your-inbox-for-your-login-access-code":"Der Zugangscode wurde dir geschickt.", "check-your-inbox-for-your-login-access-code":"Der Zugangscode wurde dir geschickt.",
"there-was-a-problem-sending-the-email":"Es besteht ein Pronlem mit dem Verschicken dieser E-Mail.", "there-was-a-problem-sending-the-email":"Es besteht ein Problem mit dem Verschicken dieser E-Mail.",
"back-to-login-form": "Zurück zum Login", "back-to-login-form": "Zurück zum Login",
"send-me-a-login-access-code": "Zugangscode zuschicken", "send-me-a-login-access-code": "Zugangscode zuschicken",
"get-login-access-code": "Zugangscode schicken", "get-login-access-code": "Zugangscode schicken",
@ -215,5 +215,6 @@
"site-information": "Angaben zur Website", "site-information": "Angaben zur Website",
"date-and-time-formats": "Datum und Zeit", "date-and-time-formats": "Datum und Zeit",
"activate": "Aktivieren", "activate": "Aktivieren",
"deactivate": "Deaktivieren" "deactivate": "Deaktivieren",
"cover-image": "Hauptbild"
} }

View File

@ -220,5 +220,9 @@
"activate": "Activate", "activate": "Activate",
"deactivate": "Deactivate", "deactivate": "Deactivate",
"cover-image": "Cover image" "cover-image": "Cover image",
"blog": "Blog",
"more-images": "More images",
"double-click-on-the-image-to-add-it": "Double click on the image to add it.",
"click-here-to-cancel": "Click here to cancel."
} }

View File

@ -3,7 +3,7 @@
{ {
"native": "Italiano (Italia)", "native": "Italiano (Italia)",
"english-name": "Italian", "english-name": "Italian",
"last-update": "2015-12-22", "last-update": "2015-12-30",
"author": "Daniele La Pira", "author": "Daniele La Pira",
"email": "daniele.lapira@gmail.com", "email": "daniele.lapira@gmail.com",
"website": "https://github.com/danielelapira" "website": "https://github.com/danielelapira"
@ -98,7 +98,7 @@
"database-regenerated": "Database rigenerato", "database-regenerated": "Database rigenerato",
"the-changes-have-been-saved": "Le modifiche sono state salvate", "the-changes-have-been-saved": "Le modifiche sono state salvate",
"enable-more-features-at": "Abilita altre funzioni a", "enable-more-features-at": "Abilita altre funzioni a",
"username-already-exists": "Il nome utente esiste già", "username-already-exists": "Nome utente già esistente",
"username-field-is-empty": "Campo nome utente vuoto", "username-field-is-empty": "Campo nome utente vuoto",
"the-password-and-confirmation-password-do-not-match":"Le password non corrispondono", "the-password-and-confirmation-password-do-not-match":"Le password non corrispondono",
"user-has-been-added-successfully": "Utente aggiunto con successo", "user-has-been-added-successfully": "Utente aggiunto con successo",
@ -109,7 +109,7 @@
"email-will-not-be-publicly-displayed": "L'indirizzo Email non sarà visibile. Raccomandato per il recupero della password e per ricevere notifiche.", "email-will-not-be-publicly-displayed": "L'indirizzo Email non sarà visibile. Raccomandato per il recupero della password e per ricevere notifiche.",
"use-this-field-to-name-your-site": "Usa questo campo per dare un nome al tuo sito. Apparirà nella parte superiore in ogni pagina del tuo sito.", "use-this-field-to-name-your-site": "Usa questo campo per dare un nome al tuo sito. Apparirà nella parte superiore in ogni pagina del tuo sito.",
"use-this-field-to-add-a-catchy-phrase": "Usa questo campo per aggiungere uno slogan al tuo sito.", "use-this-field-to-add-a-catchy-phrase": "Usa questo campo per aggiungere uno slogan al tuo sito.",
"you-can-add-a-site-description-to-provide": "Puoi aggiungere una descrizione del tuo sito e una breve biografia.", "you-can-add-a-site-description-to-provide": "Puoi aggiungere una descrizione del tuo sito e una tua breve biografia.",
"you-can-add-a-small-text-on-the-bottom": "Puoi aggiungere un breve testo in fondo ad ogni pagina. Ad es. copyright, autore, date, ecc.", "you-can-add-a-small-text-on-the-bottom": "Puoi aggiungere un breve testo in fondo ad ogni pagina. Ad es. copyright, autore, date, ecc.",
"number-of-posts-to-show-per-page": "Numero di articoli da mostrare per pagina.", "number-of-posts-to-show-per-page": "Numero di articoli da mostrare per pagina.",
"the-url-of-your-site": "Indirizzo URL del tuo sito.", "the-url-of-your-site": "Indirizzo URL del tuo sito.",
@ -183,7 +183,7 @@
"email-account-settings":"Impostazioni dell'account email", "email-account-settings":"Impostazioni dell'account email",
"sender-email": "Mittente email", "sender-email": "Mittente email",
"emails-will-be-sent-from-this-address":"Le emails saranno inviate da questo indirizzo.", "emails-will-be-sent-from-this-address":"Le emails saranno inviate da questo indirizzo.",
"bludit-login-access-code": "BLUDIT - Login access code", "bludit-login-access-code": "BLUDIT - Codice di accesso",
"check-your-inbox-for-your-login-access-code":"Controlla la tua posta in ingresso per il codice di accesso", "check-your-inbox-for-your-login-access-code":"Controlla la tua posta in ingresso per il codice di accesso",
"there-was-a-problem-sending-the-email":"C'è stato un problema nell'invio dell' email", "there-was-a-problem-sending-the-email":"C'è stato un problema nell'invio dell' email",
"back-to-login-form": "Torna indietro alla pagina di accesso", "back-to-login-form": "Torna indietro alla pagina di accesso",
@ -193,7 +193,7 @@
"there-are-no-scheduled-posts": "Non ci sono articoli programmati.", "there-are-no-scheduled-posts": "Non ci sono articoli programmati.",
"show-password": "Mostra password", "show-password": "Mostra password",
"edit-or-remove-your=pages": "Modifica o elimina pagine.", "edit-or-remove-your=pages": "Modifica o elimina pagine.",
"edit-or-remove-your-blogs-posts": "Modifica o elimina gli articoli del tuo blog.", "edit-or-remove-your-blogs-posts": "Modifica o elimina articoli del blog.",
"general-settings": "Impostazioni generali", "general-settings": "Impostazioni generali",
"advanced-settings": "Impostazioni avanzate", "advanced-settings": "Impostazioni avanzate",
"manage-users": "Gestisci utenti", "manage-users": "Gestisci utenti",
@ -205,18 +205,20 @@
"drag-and-drop-or-click-here": "Trascina e rilascia oppure clicca quì", "drag-and-drop-or-click-here": "Trascina e rilascia oppure clicca quì",
"insert-image": "Inserisci immagine", "insert-image": "Inserisci immagine",
"supported-image-file-types": "Formati file immagine supportati", "supported-image-file-types": "Formati file immagine supportati",
"date-format": "Formato data", "date-format": "Formato data",
"time-format": "Formato ora", "time-format": "Formato ora",
"chat-with-developers-and-users-on-gitter":"Chatta con gli sviluppatori e gli utenti su [Gitter](https://gitter.im/dignajar/bludit)", "chat-with-developers-and-users-on-gitter":"Chatta con gli sviluppatori e gli utenti su [Gitter](https://gitter.im/dignajar/bludit)",
"this-is-a-brief-description-of-yourself-our-your-site":"Questa è una breve descrizione del tuo sito. Per cambiare il testo vai nel pannello di amministrazione, impostazioni, plugins e configura il plugin about.", "this-is-a-brief-description-of-yourself-our-your-site":"Questa è una breve descrizione del tuo sito. Per cambiare il testo vai nel pannello di amministrazione, impostazioni, plugins e configura il plugin about.",
"profile-picture": "Foto del profilo", "profile-picture": "Foto del profilo",
"the-about-page-is-very-important": "La pagina << about >> è molto utile. Fornisce ai tuoi visitatori importanti informazioni sul sito. Uno strumento efficace per acquisire potenziali clienti e partners.", "the-about-page-is-very-important": "La pagina << about >> è molto utile. Fornisce ai visitatori importanti informazioni sul sito ed il suo autore. Uno strumento efficace per acquisire potenziali clienti e partners.",
"change-this-pages-content-on-the-admin-panel": "Cambia il contenuto di questa pagina sul pannello di amministrazione, Amministra -> Pagine e Clicca sulla pagina << about >> per modificare.", "change-this-pages-content-on-the-admin-panel": "Cambia il contenuto di questa pagina sul pannello di amministrazione, Amministra -> Pagine e Clicca sulla pagina << about >> per modificare.",
"about-your-site-or-yourself": "A proposito di te e del tuo sito.", "about-your-site-or-yourself": "A proposito di te e del tuo sito.",
"welcome-to-bludit": "Benvenuti su Bludit" "welcome-to-bludit": "Benvenuti su Bludit",
"site-information": "Informazioni sul sito", "site-information": "Informazioni sul sito",
"date-and-time-formats": "Formati data e ora", "date-and-time-formats": "Formati data e ora",
"activate": "Attiva", "activate": "Attiva",
"deactivate": "Disattiva" "deactivate": "Disattiva",
"cover-image": "Immagine di copertina"
} }

View File

@ -42,7 +42,7 @@
"email": "Email", "email": "Email",
"settings": "Instellingen", "settings": "Instellingen",
"general": "Algemeen", "general": "Algemeen",
"Advanced": "Geadvanceerd", "advanced": "Geadvanceerd",
"regional": "Taal/Tijd/Locatie", "regional": "Taal/Tijd/Locatie",
"about": "Over", "about": "Over",
"login": "Aanmelden", "login": "Aanmelden",

View File

@ -218,5 +218,7 @@
"site-information": "Информация о сайте", "site-information": "Информация о сайте",
"date-and-time-formats": "Форматы даты и времени", "date-and-time-formats": "Форматы даты и времени",
"activate": "Активировать", "activate": "Активировать",
"deactivate": "Деактивировать" "deactivate": "Деактивировать",
"cover-image": "Обложка"
} }

View File

@ -218,5 +218,7 @@
"site-information": "Site bilgisi", "site-information": "Site bilgisi",
"date-and-time-formats": "Tarih ve saat formatları", "date-and-time-formats": "Tarih ve saat formatları",
"activate": "Aktifleştir", "activate": "Aktifleştir",
"deactivate": "Deaktive et" "deactivate": "Deaktive et",
"cover-image": "Kapak resmi"
} }

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Über",
"description": "Kurzer Text über die Website oder zu dir."
}
}

View File

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Disqus",
"description": "Disqus ist eine Kommentar-Plattform für Websites. Um das Plugin verwenden zu können, muss ein Konto bei Disqus.com eingerichtet werden."
},
"disqus-shortname": "Disqus shortname",
"enable-disqus-on-pages": "Disqus auf Seiten verwenden",
"enable-disqus-on-posts": "Disqus bei Beiträgen verwenden",
"enable-disqus-on-default-home-page": "Disqus auf der Hauptseite verwenden"
}

View File

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Google-Tools",
"description": "Dieses Plugin erzeugt den Meta-Tag, um deine Website mit den Google Webmasters Tools zu verbinden, und den Code für das JavaScript, der benötigt wird, um Google Analytics verwenden zu können."
},
"google-webmasters-tools": "Google Webmasters Tools",
"google-analytics-tracking-id": "Google Analytics ID",
"complete-this-field-with-the-google-site-verification": "Gib hier den Google Analytics-Tracking-Code ein, um zu bestätigen, dass die Website Dir gehört.",
"complete-this-field-with-the-tracking-id": "Gib hier die Tracking ID ein."
}

View File

@ -0,0 +1,15 @@
{
"plugin-data":
{
"name": "Latest posts",
"description": "Shows the latest posts published.",
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "1.0",
"releaseDate": "2016-01-08"
},
"amount-of-posts": "Amount of posts",
"show-home-link": "Show home link"
}

View File

@ -0,0 +1,59 @@
<?php
class pluginLatestPosts extends Plugin {
public function init()
{
$this->dbFields = array(
'label'=>'Latest posts',
'amount'=>5
);
}
public function form()
{
global $Language;
$html = '<div>';
$html .= '<label>'.$Language->get('Plugin label').'</label>';
$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>'.$Language->get('Amount of posts').'</label>';
$html .= '<input name="amount" id="jsamount" type="text" value="'.$this->getDbField('amount').'">';
$html .= '</div>';
return $html;
}
public function siteSidebar()
{
// This function is declared in 70.posts.php
$posts = buildPostsForPage(0, $this->getDbField('amount'), true, false);
$html = '<div class="plugin plugin-latest-posts">';
// Print the label if not empty.
$label = $this->getDbField('label');
if( !empty($label) ) {
$html .= '<h2 class="plugin-title">'.$label.'</h2>';
}
$html .= '<div class="plugin-content">';
$html .= '<ul>';
foreach($posts as $Post)
{
$html .= '<li>';
$html .= '<a href="'.$Post->permalink().'">'.$Post->title().'</a>';
$html .= '</li>';
}
$html .= '</ul>';
$html .= '</div>';
$html .= '</div>';
return $html;
}
}

View File

@ -0,0 +1,10 @@
{
"plugin-data":
{
"name": "Wartungsmodus",
"description": "Wartungsmodus für die Website mit Zugang zum Admin-Bereich."
},
"enable-maintence-mode": "Aktivierung des Wartungsmodus",
"message": "Auf der Website angezeigter Hinweis"
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Open Graph",
"description": "Plugin zur Verwendung des Open Graph Protocols."
}
}

View File

@ -2,17 +2,22 @@
class pluginOpenGraph extends Plugin { class pluginOpenGraph extends Plugin {
// Returns the first image that is in the content
private function getImage($content) private function getImage($content)
{ {
$dom = new DOMDocument(); $dom = new DOMDocument();
$dom->loadHTML('<meta http-equiv="content-type" content="text/html; charset=utf-8">'.$content); $dom->loadHTML('<meta http-equiv="content-type" content="text/html; charset=utf-8">'.$content);
$finder = new DomXPath($dom); $finder = new DomXPath($dom);
/* DEPRECATED
$images = $finder->query("//img[contains(@class, 'bludit-img-opengraph')]"); $images = $finder->query("//img[contains(@class, 'bludit-img-opengraph')]");
if($images->length==0) { if($images->length==0) {
$images = $finder->query("//img"); $images = $finder->query("//img");
} }
*/
$images = $finder->query("//img");
if($images->length>0) if($images->length>0)
{ {
@ -49,6 +54,7 @@ class pluginOpenGraph extends Plugin {
$og['title'] = $Post->title().' | '.$og['title']; $og['title'] = $Post->title().' | '.$og['title'];
$og['description'] = $Post->description(); $og['description'] = $Post->description();
$og['url'] = $Post->permalink(true); $og['url'] = $Post->permalink(true);
$og['image'] = $Post->coverImage(false);
$content = $Post->content(); $content = $Post->content();
break; break;
@ -58,12 +64,16 @@ class pluginOpenGraph extends Plugin {
$og['title'] = $Page->title().' | '.$og['title']; $og['title'] = $Page->title().' | '.$og['title'];
$og['description'] = $Page->description(); $og['description'] = $Page->description();
$og['url'] = $Page->permalink(true); $og['url'] = $Page->permalink(true);
$og['image'] = $Page->coverImage(false);
$content = $Page->content(); $content = $Page->content();
break; break;
default: default:
$content = isset($posts[0])?$posts[0]->content():''; if(isset($posts[0])) {
$og['image'] = $posts[0]->coverImage(false);
$content = $posts[0]->content();
}
break; break;
} }
@ -75,11 +85,21 @@ class pluginOpenGraph extends Plugin {
$html .= '<meta property="og:url" content="'.$og['url'].'">'.PHP_EOL; $html .= '<meta property="og:url" content="'.$og['url'].'">'.PHP_EOL;
$html .= '<meta property="og:siteName" content="'.$og['siteName'].'">'.PHP_EOL; $html .= '<meta property="og:siteName" content="'.$og['siteName'].'">'.PHP_EOL;
$domain = trim($Site->domain(),'/');
$urlImage = $domain.HTML_PATH_UPLOADS;
// If the post o page doesn't have a coverImage try to get it from the content
if($og['image']===false)
{
// Get the image from the content // Get the image from the content
$src = $this->getImage( $content ); $src = $this->getImage( $content );
if($src!==false) { if($src!==false) {
$og['image'] = $Site->domain().$src; $html .= '<meta property="og:image" content="'.$urlImage.$og['image'].'">'.PHP_EOL;
$html .= '<meta property="og:image" content="'.$og['image'].'">'.PHP_EOL; }
}
else
{
$html .= '<meta property="og:image" content="'.$urlImage.$og['image'].'">'.PHP_EOL;
} }
return $html; return $html;

View File

@ -0,0 +1,10 @@
{
"plugin-data":
{
"name": "Menü aller Seiten",
"description": "Anzeige eines Menüs aller Seiten in der Seitenleiste (bei Themes mit Seitenleiste)."
},
"home": "Hauptseite",
"show-home-link": "Hauptseite zeigen"
}

View File

@ -1,8 +1,8 @@
{ {
"plugin-data": "plugin-data":
{ {
"name": "Anzeige aller Seiten", "name": "Menü aller Seiten",
"description": "Anzeige aller Seiten in der Seitenleiste (bei Themes mit Seitenleiste)." "description": "Anzeige eines Menüs aller Seiten in der Seitenleiste (bei Themes mit Seitenleiste)."
}, },
"home": "Hauptseite", "home": "Hauptseite",

View File

@ -0,0 +1,9 @@
{
"plugin-data":
{
"name": "SimpleMDE",
"description": "Ein einfacher und schöner JavaScript-Editor für die Verwendung von Markdown von @WesCossick. Von Diego Najar für Bludit angpasst."
},
"toolbar": "Werkzeugleiste",
"tab-size": "Abstände der Tabstopps"
}

View File

@ -0,0 +1,12 @@
{
"plugin-data":
{
"name": "Sitemap",
"description": "This plugin generate a file sitemap.xml where you can list the web pages of your site to tell to search engines about the organization of your site content.",
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-plugins",
"version": "1.0",
"releaseDate": "2016-01-07"
}
}

151
plugins/sitemap/plugin.php Normal file
View File

@ -0,0 +1,151 @@
<?php
class pluginSitemap extends Plugin {
public function init()
{
$this->dbFields = array(
'label'=>'Tags'
);
}
private function createXML()
{
global $Site;
global $dbPages;
global $dbPosts;
global $Url;
$doc = new DOMDocument('1.0', 'UTF-8');
// Friendly XML code
$doc->formatOutput = true;
// Create urlset element
$urlset = $doc->createElement('urlset');
$attribute = $doc->createAttribute('xmlns');
$attribute->value = 'http://www.sitemaps.org/schemas/sitemap/0.9';
$urlset->appendChild($attribute);
// --- Base URL ---
// Create url, loc and lastmod elements
$url = $doc->createElement('url');
$loc = $doc->createElement('loc', $Site->url());
$lastmod = $doc->createElement('lastmod', '');
// Append loc and lastmod -> url
$url->appendChild($loc);
$url->appendChild($lastmod);
// Append url -> urlset
$urlset->appendChild($url);
// --- Pages and Posts ---
$all = array();
$url = trim($Site->url(),'/');
// --- Pages ---
$filter = trim($Url->filters('page'),'/');
$pages = $dbPages->getDB();
unset($pages['error']);
foreach($pages as $key=>$db)
{
$permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key;
$date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT);
array_push($all, array('permalink'=>$permalink, 'date'=>$date));
}
// --- Posts ---
$filter = rtrim($Url->filters('post'),'/');
$posts = $dbPosts->getDB();
foreach($posts as $key=>$db)
{
$permalink = empty($filter) ? $url.'/'.$key : $url.'/'.$filter.'/'.$key;
$date = Date::format($db['date'], DB_DATE_FORMAT, SITEMAP_DATE_FORMAT);
array_push($all, array('permalink'=>$permalink, 'date'=>$date));
}
// Generate the XML for posts and pages
foreach($all as $db)
{
// Create url, loc and lastmod elements
$url = $doc->createElement('url');
$loc = $doc->createElement('loc', $db['permalink']);
$lastmod = $doc->createElement('lastmod', $db['date']);
// Append loc and lastmod -> url
$url->appendChild($loc);
$url->appendChild($lastmod);
// Append url -> urlset
$urlset->appendChild($url);
}
// Append urlset -> XML
$doc->appendChild($urlset);
$doc->save(PATH_PLUGINS_DATABASES.$this->directoryName.DS.'sitemap.xml');
}
public function install($position = 0)
{
parent::install($position);
$this->createXML();
}
public function afterPostCreate()
{
$this->createXML();
}
public function afterPageCreate()
{
$this->createXML();
}
public function afterPostModify()
{
$this->createXML();
}
public function afterPageModify()
{
$this->createXML();
}
public function afterPostDelete()
{
$this->createXML();
}
public function afterPageDelete()
{
$this->createXML();
}
public function beforeRulesLoad()
{
global $Url;
if( $Url->uri() === HTML_PATH_ROOT.'sitemap.xml' )
{
// Send XML header
header('Content-type: text/xml');
// New DOM document
$doc = new DOMDocument();
// Load XML
$doc->load(PATH_PLUGINS_DATABASES.$this->directoryName.DS.'sitemap.xml');
// Print the XML
echo $doc->saveXML();
// Stop Bludit running
exit;
}
}
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "Anzeige aller Schlagwörter",
"description": "Anzeige aller Schlagwörter in der Seitenleiste (bei Themes mit Seitenleiste)."
}
}

View File

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "TinyMCE",
"description": "TinyMCE ist ein einfacher HTML-Editor mit zahlreichen Plugins und Konfigurationsmöglichkeiten."
}
}

View File

@ -2,6 +2,6 @@
"plugin-data": "plugin-data":
{ {
"name": "TinyMCE", "name": "TinyMCE",
"description": "TinyMCE ist ein einfacher HTML-Editor mit zahlreichen Plugins Und Anpassungsmöglichkeiten." "description": "TinyMCE ist ein einfacher HTML-Editor mit zahlreichen Plugins und Konfigurationsmöglichkeiten."
} }
} }

View File

@ -24,7 +24,7 @@
<!-- Content --> <!-- Content -->
<?php <?php
if( ($Url->whereAmI()=='home') || ($Url->whereAmI()=='tag') ) if( ($Url->whereAmI()=='home') || ($Url->whereAmI()=='tag') || ($Url->whereAmI()=='blog') )
{ {
include(PATH_THEME_PHP.'home.php'); include(PATH_THEME_PHP.'home.php');
} }

View File

@ -1,4 +1,4 @@
<h1 class="subhead"><?php echo $Language->get('Recent posts') ?></h1> <div class="subhead"><?php echo $Language->get('Recent posts') ?></div>
<?php foreach ($posts as $Post): ?> <?php foreach ($posts as $Post): ?>
@ -11,9 +11,9 @@
<header class="post-header"> <header class="post-header">
<!-- Post title --> <!-- Post title -->
<h2 class="post-title"> <h1 class="post-title">
<a href="<?php echo $Post->permalink() ?>"><?php echo $Post->title() ?></a> <a href="<?php echo $Post->permalink() ?>"><?php echo $Post->title() ?></a>
</h2> </h1>
<!-- Post date and author --> <!-- Post date and author -->
<div class="post-meta"> <div class="post-meta">
@ -22,11 +22,11 @@
<?php <?php
echo $Language->get('Posted By').' '; echo $Language->get('Posted By').' ';
if( Text::isNotEmpty($Post->authorFirstName()) || Text::isNotEmpty($Post->authorLastName()) ) { if( Text::isNotEmpty($Post->user('firstName')) || Text::isNotEmpty($Post->user('lastName')) ) {
echo $Post->authorFirstName().' '.$Post->authorLastName(); echo $Post->user('firstName').' '.$Post->user('lastName');
} }
else { else {
echo $Post->username(); echo $Post->user('username');
} }
?> ?>
</span> </span>

View File

@ -1,4 +1,4 @@
<h1 class="subhead"><?php echo $Language->get('Page') ?></h1> <div class="subhead"><?php echo $Language->get('Page') ?></div>
<section class="page"> <section class="page">
@ -9,9 +9,9 @@
<header class="page-header"> <header class="page-header">
<!-- page title --> <!-- page title -->
<h2 class="page-title"> <h1 class="page-title">
<a href="<?php echo $Page->permalink() ?>"><?php echo $Page->title() ?></a> <a href="<?php echo $Page->permalink() ?>"><?php echo $Page->title() ?></a>
</h2> </h1>
</header> </header>

View File

@ -1,4 +1,4 @@
<h1 class="subhead"><?php echo $Language->get('Post') ?></h1> <div class="subhead"><?php echo $Language->get('Post') ?></div>
<section class="post"> <section class="post">
@ -9,9 +9,9 @@
<header class="post-header"> <header class="post-header">
<!-- Post title --> <!-- Post title -->
<h2 class="post-title"> <h1 class="post-title">
<a href="<?php echo $Post->permalink() ?>"><?php echo $Post->title() ?></a> <a href="<?php echo $Post->permalink() ?>"><?php echo $Post->title() ?></a>
</h2> </h1>
<!-- Post date and author --> <!-- Post date and author -->
<div class="post-meta"> <div class="post-meta">