Merge remote-tracking branch 'dignajar/master'

This commit is contained in:
Alexander K 2016-05-08 09:15:43 -04:00
commit 138cc5301b
35 changed files with 443 additions and 124 deletions

View file

@ -1,6 +0,0 @@
# Bludit
Set the correct permissions on this directory.
Documentation:
- http://docs.bludit.com/en/troubleshooting/writing-test-failure-err205

View file

@ -45,6 +45,7 @@ function checkPost($args)
$sent = Email::send(array(
'from'=>$Site->emailFrom(),
'fromName'=>$Site->title(),
'to'=>$email,
'subject'=>$subject,
'message'=>$message

View file

@ -1,7 +1,88 @@
/* ----------- UIKIT HACKs FOR BLUDIT ----------- */
* {
border-radius: 2px !important;
}
.uk-navbar {
background: #EEEEEE !important;
background: #323232 !important;
border: 0 !important;
border-radius: 0 !important;
}
.uk-navbar-nav a {
border: none !important;
border-radius: none !important;
text-shadow: none !important;
color: #fff !important;
font-weight: 300 !important;
padding: 0 25px !important;
}
.uk-navbar-nav > li.uk-open > a,
.uk-navbar-nav > li:hover > a,
.uk-navbar-nav > li:focus > a,
.uk-navbar-nav > li > a:focus,
.uk-navbar-nav > li > a:hover {
background: none !important;
border-radius: 0 !important;
color: #BBBBBB !important;
box-shadow: none !important;
text-shadow: none !important;
}
.uk-nav-navbar > li > a:focus,
.uk-nav-navbar > li > a:hover {
background: none !important;
border-radius: 0 !important;
color: #888 !important;
box-shadow: none !important;
text-shadow: none !important;
}
.uk-navbar-nav > li.uk-active > a {
background: none !important;
color: #BBBBBB !important;
}
.uk-navbar-nav .uk-border-circle {
border-radius: 20px !important;
}
.uk-dropdown-navbar {
margin: 0 !important;
padding: 10px 0 !important;
position: fixed;
text-align: center;
width: 100%;
border-radius: 0 !important;
border-left: 0 !important;
border-right: 0 !important;
border-top: 0 !important;
}
.uk-dropdown-navbar li {
display: inline-block !important;
}
.uk-dropdown-navbar a {
color: #323232 !important;
}
li.bludit-logo {
color: #fff !important;
display: block;
font-size: 14px;
font-weight: 400;
height: 41px;
line-height: 40px;
margin-left: -1px;
margin-top: -1px;
margin-right: 12px;
}
.bludit-user-navbar {
text-align: right !important;
padding-right: 60px !important;
}
.uk-button {
@ -35,16 +116,7 @@ legend.first-child {
margin-top: 0px !important;
}
.uk-navbar-nav > li > a {
border: none;
height: 70px;
padding: 15px;
}
.uk-nav-navbar > li > a:hover,
.uk-nav-navbar > li > a:focus {
background: #2672ec;
}
.uk-form-label {
color: #666666;
@ -72,18 +144,6 @@ a {
color: #2672ec;
}
li.bludit-logo {
color: #848484 !important;
height: 70px;
padding: 15px;
display: block;
font-size: 14px;
font-weight: 400;
height: 35px;
line-height: 40px;
text-shadow: 0 1px 0 #fff;
}
.uk-panel-box {
background: #F9F9F9 !important;
}
@ -116,6 +176,7 @@ li.bludit-logo {
margin-bottom: 0 !important;
}
/* ----------- BLUDIT ----------- */
body {

View file

View file

View file

View file

View file

@ -1,6 +1,10 @@
/* ----------- UIKIT HACKs FOR BLUDIT ----------- */
html {
background: #f1f1f1;
background: #f3f3f3;
}
* {
border-radius: 2px !important;
}
.uk-button-primary {
@ -14,6 +18,11 @@ html {
input[type="text"],
input[type="password"] {
border-color: #FFF !important;
border-radius: 2px !important;
}
.uk-alert {
padding: 22px 0 !important;
}
/* ----------- BLUDIT ----------- */
@ -40,10 +49,10 @@ div.login-form > h2 {
}
a.login-email {
background: #f9f9f9 none repeat scroll 0 0;
border: 1px solid #eeeeee;
color: #777;
display: block;
padding: 20px;
margin: 20px 0;
padding: 0;
text-align: left;
}

View file

@ -1,2 +1,2 @@
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.26.2 | 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}

View file

@ -1,2 +1,2 @@
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.26.2 | 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}

View file

@ -1,2 +1,2 @@
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.26.2 | 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}

4
bl-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
bl-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.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.26.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-dragover{box-shadow:0 0 20px rgba(100,100,100,.3)}

View file

@ -61,12 +61,12 @@ $(document).ready(function() {
<ul class="uk-navbar-nav">
<li class="bludit-logo">BLUDIT</li>
<li <?php echo ($layout['view']=='dashboard')?'class="uk-active"':'' ?> ><a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><i class="uk-icon-object-ungroup"></i> <?php $L->p('Dashboard') ?></a></li>
<li <?php echo ($layout['view']=='new-post')?'class="uk-active"':'' ?>><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><i class="uk-icon-pencil"></i> <?php $L->p('New post') ?></a></li>
<li <?php echo ($layout['view']=='new-page')?'class="uk-active"':'' ?>><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><i class="uk-icon-file-text-o"></i> <?php $L->p('New page') ?></a></li>
<li <?php echo ($layout['view']=='dashboard')?'class="uk-active"':'' ?> ><a href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>"><?php $L->p('Dashboard') ?></a></li>
<li <?php echo ($layout['view']=='new-post')?'class="uk-active"':'' ?>><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-post' ?>"><?php $L->p('New post') ?></a></li>
<li <?php echo ($layout['view']=='new-page')?'class="uk-active"':'' ?>><a href="<?php echo HTML_PATH_ADMIN_ROOT.'new-page' ?>"><?php $L->p('New page') ?></a></li>
<li class="uk-parent" data-uk-dropdown>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><i class="uk-icon-clone"></i> <?php $L->p('Manage') ?> ▾</a>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><?php $L->p('Manage') ?> ▾</a>
<div class="uk-dropdown uk-dropdown-navbar">
<ul class="uk-nav uk-nav-navbar">
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'manage-posts' ?>"><i class="uk-icon-folder-o"></i> <?php $L->p('Posts') ?></a></li>
@ -80,27 +80,29 @@ $(document).ready(function() {
<?php if($Login->role() == 'admin') { ?>
<li class="uk-parent" data-uk-dropdown>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><i class="uk-icon-cog"></i> <?php $L->p('Settings') ?> ▾</a>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><?php $L->p('Settings') ?> ▾</a>
<div class="uk-dropdown uk-dropdown-navbar">
<ul class="uk-nav uk-nav-navbar">
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-general' ?>"><i class="uk-icon-th-large"></i> <?php $L->p('General') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-advanced' ?>"><i class="uk-icon-th"></i> <?php $L->p('Advanced') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'settings-regional' ?>"><i class="uk-icon-globe"></i> <?php $L->p('Language and timezone') ?></a></li>
<li class="uk-nav-divider"></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'plugins' ?>"><i class="uk-icon-puzzle-piece"></i> <?php $L->p('Plugins') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'themes' ?>"><i class="uk-icon-paint-brush"></i> <?php $L->p('Themes') ?></a></li>
<li class="uk-nav-divider"></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>"><?php $L->p('About') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'about' ?>"><i class="uk-icon-info"></i> <?php $L->p('About') ?></a></li>
</ul>
</div>
</li>
<?php } ?>
<li><a target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><?php $L->p('Website') ?></a></li>
</ul>
<div class="uk-navbar-flip">
<ul class="uk-navbar-nav">
<li class="uk-parent" data-uk-dropdown>
<li>
<?php
$profilePictureSrc = HTML_PATH_ADMIN_THEME_IMG.'default.png';
if(file_exists(PATH_UPLOADS_PROFILES.$Login->username().'.png')) {
@ -108,16 +110,8 @@ $(document).ready(function() {
}
?>
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>">
<img class="uk-border-circle" width="28px" src="<?php echo $profilePictureSrc ?>" alt=""> <?php echo $Login->username() ?>
<img class="uk-border-circle" width="28px" src="<?php echo $profilePictureSrc ?>" alt=""> Welcome <?php echo $Login->username() ?>
</a>
<div class="uk-dropdown uk-dropdown-navbar">
<ul class="uk-nav uk-nav-navbar">
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'edit-user/'.$Login->username() ?>"><?php $L->p('Profile') ?></a></li>
<li class="uk-nav-divider"></li>
<li><a target="_blank" href="<?php echo HTML_PATH_ROOT ?>"><?php $L->p('Website') ?></a></li>
<li><a href="<?php echo HTML_PATH_ADMIN_ROOT.'logout' ?>"><?php $L->p('Logout') ?></a></li>
</ul>
</div>
</li>
</ul>
</div>

6
bl-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
bl-kernel/admin/themes/default/js/uikit/upload.min.js vendored Normal file → Executable file
View file

@ -1,2 +1,2 @@
/*! UIkit 2.24.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.26.2 | 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});

View file

@ -31,7 +31,7 @@
<h1>BLUDIT</h1>
<?php
if(Alert::defined()) {
echo '<div class="uk-alert uk-alert-danger">'.Alert::get().'</div>';
echo '<div class="uk-alert">'.Alert::get().'</div>';
}
if( Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php') ) {
@ -45,4 +45,4 @@
<?php Theme::plugins('loginBodyEnd') ?>
</body>
</html>
</html>

View file

@ -1,3 +1,5 @@
<?php if(empty($_POST)) { ?>
<div class="login-form">
<form method="post" action="" class="uk-form" autocomplete="off">
@ -16,4 +18,6 @@
</div>
<?php } ?>
<a class="login-email" href="<?php echo HTML_PATH_ADMIN_ROOT.'login' ?>"><i class="uk-icon-chevron-left"></i> <?php $L->p('Back to login form') ?></a>

View file

@ -20,4 +20,4 @@
</div>
<a class="login-email" href="<?php echo HTML_PATH_ADMIN_ROOT.'login-email' ?>"><i class="uk-icon-envelope-o"></i> <?php $L->p('Send me a login access code') ?></a>
<a class="login-email" href="<?php echo HTML_PATH_ADMIN_ROOT.'login-email' ?>"><i class="uk-icon-envelope-o"></i> <?php $L->p('Email access code') ?></a>

View file

@ -37,17 +37,6 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
'tip'=>$L->g('the-url-of-your-site')
));
HTML::legend(array('value'=>$L->g('Command Line Mode')));
HTML::formSelect(array(
'name'=>'cliMode',
'label'=>$L->g('Cli Mode'),
'options'=>array('true'=>$L->g('Enabled'), 'false'=>$L->g('Disabled')),
'selected'=>$Site->cliMode(),
'class'=>'uk-width-1-3 uk-form-medium',
'tip'=>$L->g('enable-the-command-line-mode-if-you-add-edit')
));
HTML::legend(array('value'=>$L->g('Email account settings')));
HTML::formInputText(array(

View file

@ -82,8 +82,8 @@ define('NO_PARENT_CHAR', '3849abb4cb7abd24c2d8dac17b216f17');
// Post per page on Manage->Posts
define('POSTS_PER_PAGE_ADMIN', 10);
// Check if JSON encode and decode are enabled.
// define('JSON', function_exists('json_encode'));
// Cli mode status for new posts/pages
define('CLI_MODE', true);
// Cli mode status for new posts/pages
define('CLI_STATUS', 'published');

View file

@ -62,7 +62,11 @@ function buildPlugins()
// Load each plugin clasess
foreach($list as $pluginPath) {
include($pluginPath.DS.'plugin.php');
// Check if the directory has the plugin.php
if(file_exists($pluginPath.DS.'plugin.php')) {
include($pluginPath.DS.'plugin.php');
}
}
// Get plugins clasess loaded

View file

@ -123,7 +123,7 @@ function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeU
// ============================================================================
// Search for changes on posts by the user.
if( $Site->cliMode() ) {
if( CLI_MODE ) {
if($dbPosts->regenerateCli()) {
reIndexTagsPosts();
}

View file

@ -146,7 +146,7 @@ function buildAllPages()
// ============================================================================
// Search for changes on pages by the user.
if( $Site->cliMode() ) {
if( CLI_MODE ) {
$dbPages->regenerateCli();
}

View file

@ -9,7 +9,7 @@ class dbPosts extends dbJSON
'username'=> array('inFile'=>false, 'value'=>''),
'status'=> array('inFile'=>false, 'value'=>'draft'), // published, draft, scheduled
'tags'=> array('inFile'=>false, 'value'=>array()),
'allowComments'=> array('inFile'=>false, 'value'=>false),
'allowComments'=> array('inFile'=>false, 'value'=>0),
'date'=> array('inFile'=>false, 'value'=>''),
'coverImage'=> array('inFile'=>false, 'value'=>''),
'checksum'=> array('inFile'=>false, 'value'=>'')
@ -111,7 +111,7 @@ class dbPosts extends dbJSON
return false;
}
// If the date not valid, then set the current date.
// If the date is not valid, then set the current date.
if(!Valid::date($args['date'], DB_DATE_FORMAT)) {
$args['date'] = $currentDate;
}
@ -408,32 +408,40 @@ class dbPosts extends dbJSON
$currentDate = Date::current(DB_DATE_FORMAT);
// Generate default fields and values.
// --------------------------------------------------------------------------
foreach($this->dbFields as $field=>$options) {
if(!$options['inFile']) {
$fields[$field] = $options['value'];
}
}
$fields['status'] = CLI_STATUS;
$fields['date'] = $currentDate;
$fields['username'] = CLI_USERNAME;
$fields['status'] = CLI_STATUS;
$fields['username'] = CLI_USERNAME;
$fields['date'] = $currentDate;
// Get all posts from the first level of directories.
$tmpPaths = Filesystem::listDirectories(PATH_POSTS);
foreach($tmpPaths as $directory)
$postsDirectories = Filesystem::listDirectories(PATH_POSTS);
foreach($postsDirectories as $directory)
{
// Check if the post have the index.txt file.
// Check if the post has the index.txt file.
if(Sanitize::pathFile($directory.DS.'index.txt'))
{
// The key is the directory name.
$key = basename($directory);
Log::set('----------------');
Log::set('CliMode - Post KEY: '.$key);
// This post exists
$allPosts[$key] = true;
// Create the new entry if not exist inside the DATABASE.
if(!isset($this->db[$key])) {
if( !isset($this->db[$key]) ) {
// New entry on database with the default fields and values.
$this->db[$key] = $fields;
Log::set('CliMode - New post: '.$key);
}
// Create the post from FILE.
@ -442,12 +450,14 @@ class dbPosts extends dbJSON
// Update all fields from FILE to DATABASE.
foreach($fields as $f=>$v)
{
// If the field exists on the FILE, update it.
if($Post->getField($f))
{
$valueFromFile = $Post->getField($f);
// Get the value from FILE.
$valueFromFile = $Post->getField($f);
Log::set(__METHOD__.LOG_SEP.'Field from file: '.$f);
// If the field exists on the FILE, update it.
if( !empty($valueFromFile) )
{
Log::set('CliMode - Field to replace: '.$f);
Log::set('CliMode - value from file: '.$valueFromFile);
if($f=='tags') {
// Generate tags array.
@ -475,6 +485,7 @@ class dbPosts extends dbJSON
// Remove orphan posts from db, the orphan posts are posts deleted by hand (directory deleted).
foreach( array_diff_key($db, $allPosts) as $key=>$data ) {
unset($this->db[$key]);
Log::set('CliMode - Deleted post: '.$key);
}
// Sort posts before save.
@ -487,10 +498,11 @@ class dbPosts extends dbJSON
}
if($this->db!=$db) {
Log::set(__METHOD__.LOG_SEP.'New posts added from Cli Mode');
Log::set(__METHOD__.LOG_SEP.'There are new or deleted posts.');
return true;
}
return $this->db!=$db;
return false;
}
}

View file

@ -19,7 +19,6 @@ class dbSite extends dbJSON
'uriTag'=> array('inFile'=>false, 'value'=>'/tag/'),
'uriBlog'=> array('inFile'=>false, 'value'=>'/blog/'),
'url'=> array('inFile'=>false, 'value'=>''),
'cliMode'=> array('inFile'=>false, 'value'=>true),
'emailFrom'=> array('inFile'=>false, 'value'=>''),
'dateFormat'=> array('inFile'=>false, 'value'=>'F j, Y'),
'timeFormat'=> array('inFile'=>false, 'value'=>'g:i a'),
@ -216,12 +215,6 @@ class dbSite extends dbJSON
return $parse['scheme'].'://'.$domain;
}
// Returns TRUE if the cli mode is enabled, otherwise FALSE.
public function cliMode()
{
return $this->getField('cliMode');
}
// Returns the relative home link
public function homeLink()
{

View file

@ -5,31 +5,38 @@ class Email {
// Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.
public static function send($args)
{
// Current time in unixtimestamp
$now = time();
// Domain
$domainParse = parse_url(DOMAIN);
$headers = array();
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=utf-8';
$headers[] = 'Content-Transfer-Encoding: 8bit';
$headers[] = 'From: '.$args['from'];
$headers[] = 'From: =?UTF-8?B?'.base64_encode($args['fromName']).'?= <'.$args['from'].'>';
$headers[] = 'Reply-To: '.$args['from'];
$headers[] = 'Return-Path: '.$args['from'];
$headers[] = 'message-id: <'.$now.'webmaster@'.DOMAIN.'>';
$headers[] = 'message-id: <'.$now.'webmaster@'.$domainParse['host'].'>';
$headers[] = 'X-Mailer: PHP/'.phpversion();
$subject = '=?UTF-8?B?'.base64_encode($args['subject']).'?=';
$message = '<html>
<head>
<meta charset="UTF-8">
<title>BLUDIT</title>
</head>
<body style="background-color: #f1f1f1;">
<div style="margin: 0px auto; padding: 10px; font-size: 14px; width: 70%; max-width: 600px;">
<div style="font-size: 26px;">BLUDIT</div>
<body>
<div>
'.$args['message'].'
</div>
</body>
</html>';
return mail($args['to'], $args['subject'], $message, implode(PHP_EOL, $headers));
return mail($args['to'], $subject, $message, implode(PHP_EOL, $headers));
}
}

239
bl-languages/ar_MA.json Normal file
View file

@ -0,0 +1,239 @@
{
"language-data":
{
"native": "اللغة العربية",
"english-name": "Arabic",
"last-update": "2016-04-16",
"author": "english4ar.com",
"email": "",
"website": "english4ar.com"
},
"username": "المعرف",
"password": "كلمة السر",
"confirm-password": "تأكيد كلمة السر",
"editor": "المحرر",
"dashboard": "لوحة التحكم",
"role": "الدور",
"post": "مشاركة",
"posts": "المشاركات",
"users": "المستخدمين",
"administrator": "المدير",
"add": "أضف",
"cancel": "إلغاء",
"content": "المحتوى",
"title": "العنوان",
"no-parent": "لا ملحقات",
"edit-page": "تحرير الصفحة",
"edit-post": "تحرير المشاركة",
"add-a-new-user": "أضف مستخدم جديد",
"parent": "ملحق",
"friendly-url": "روابط محسنة",
"description": "الوصف",
"posted-by": "مشاركة من",
"tags": "علامات",
"position": "موضع",
"save": "حفظ",
"draft": "مسودة",
"delete": "حذف",
"registered": "مسجل",
"notifications": "تنبيهات",
"profile": "الملف الشخصي",
"email": "البريد الإلكتروني",
"settings": "الإعدادات",
"general": "عـام",
"advanced": "متقدم",
"regional": "إقليمي",
"about": "من نحن",
"login": "تسجيل الدخول",
"logout": "الخروج",
"manage": "إدارة",
"themes": "الحلل",
"prev-page": "الصفحة السابقة",
"next-page": "الصفحة التالية",
"configure-plugin": "إعداد الملحقة",
"confirm-delete-this-action-cannot-be-undone": "تأكيد الحذف، لا يمكن التراجع عن هذه الخطوة",
"site-title": "عنوان الموقع",
"site-slogan": "شعار الموقع",
"site-description": "وصف الموقع",
"footer-text": "نص التذبيل",
"posts-per-page": "عدد المشاركات في كل صفحة",
"site-url": "رابط الموقع",
"writting-settings": "إعدادات الكتابة",
"url-filters": "فلتر الرابط",
"page": "صفحة",
"pages": "الصفحات",
"home": "الرئيسية",
"welcome-back": "أهلا بك",
"language": "اللغة",
"website": "الموقع",
"timezone": "المنطقة الزمنية",
"locale": "المكان",
"new-post": "مشاركة جديدة",
"new-page": "صفحة جديدة",
"html-and-markdown-code-supported": "شيفرات HTML و Markdown مدعومة",
"manage-posts": "إدارة المشاركات",
"published-date": "تاريخ النشر",
"modified-date": "تاريخ التعديل",
"empty-title": "بدون عنوان",
"plugins": "الإضافات",
"install-plugin": "تثبيث الإضافة",
"uninstall-plugin": "إلغاء الإضافة",
"new-password": "كلمة سر جديد",
"edit-user": "تعديل المستخدم",
"publish-now": "أنشر الأن",
"first-name": "الإسم الأول",
"last-name": "الاسم الثاني",
"bludit-version": "Bludit إصدار",
"powered-by": "يستخدم",
"recent-posts": "المشاركات الحديثة",
"manage-pages": "إدارة الصفحات",
"advanced-options": "إعدادات متقدمة",
"user-deleted": "حذف المستخدم",
"page-added-successfully": "تم إضافة الصفحة بنجاح",
"post-added-successfully": "تم إضافة المشاركة بنجاح",
"the-post-has-been-deleted-successfully": "تم حذف المشاركة",
"the-page-has-been-deleted-successfully": "تم حذف الصفحة",
"username-or-password-incorrect": "إسم المستخدم أو كلمة السر خاطئ",
"database-regenerated": "تم تجديد قاعدة البيانات",
"the-changes-have-been-saved": "تم حفظ التعديلات",
"enable-more-features-at": "تمكين المزيد من الميزات في",
"username-already-exists": "إسم المستخدم موجود مسبقا",
"username-field-is-empty": "حقل إسم المستخدم فارغ",
"the-password-and-confirmation-password-do-not-match":"كلمتا السر لا تشبها بعضهما",
"user-has-been-added-successfully": "تم إضافة المستخدم بنجاح",
"you-do-not-have-sufficient-permissions": "لا توجد لديك الصلاحيات الكافية لدخول هذه الصفحة،إتصل بالمدير",
"settings-advanced-writting-settings": "إعدادات-> متقدمة-> إعدادات الكتابة",
"new-posts-and-pages-synchronized": "مشاركات جديدة وصفحات متزامنة.",
"you-can-choose-the-users-privilege": "يمكنك اختيار إمتياز المستخدم. دور المحرر هو كتابة الصفحات والمشاركات.",
"email-will-not-be-publicly-displayed": "البريد الالكتروني لن يتم عرضه علنا. موصى به لاستعادة كلمة السر والإخطارات.",
"use-this-field-to-name-your-site": "إستخدم هذا الحقل لكتابة عنوان موقعك،سوف يظهر في أعلى جميع صفحات موقعك",
"use-this-field-to-add-a-catchy-phrase": "أكتب عبارة جذابة حول موقعك",
"you-can-add-a-site-description-to-provide": "يمكنك إضافة وصف مختصر حول موقعك للتعريف به",
"you-can-add-a-small-text-on-the-bottom": "يمكنك إضافة نص قصير أسفل الموقع",
"number-of-posts-to-show-per-page": "عدد المشاركات المعروضة في كل صفحة.",
"the-url-of-your-site": "رابط موقعك",
"add-or-edit-description-tags-or": "إضافة أو تعديل الوصف والعلامات أو تعديل الروابط المحسنة",
"select-your-sites-language": "إختر لغة موقعك",
"select-a-timezone-for-a-correct": "إختيار التوقيت الصحيح لعرض التاريخ / الوقت على موقعك.",
"you-can-use-this-field-to-define-a-set-of": "يمكنك إستخدام هذا الحقل لتحديد مجموعة من المعايير ذات الصلة بللغة والبلد والتفضيلات الخاصة.",
"you-can-modify-the-url-which-identifies":"يمكنك تعديل الرابط الذي يحدد صفحة أو مشاركة باستخدام كلمات رئيسية قابلة للقراءة. لا تزيد عن 150 حرفا.",
"this-field-can-help-describe-the-content": "ضع وصفا مناسبا للمحتوى في بضع كلمات. لا تزيد عن 150 حرفا.",
"delete-the-user-and-all-its-posts":"حذف المستخدم وجميع مشاركاته",
"delete-the-user-and-associate-its-posts-to-admin-user": "حذف المستخدم وربط جميع مشاركاته بحساب المدير",
"read-more": "إقرأ المزيد",
"show-blog": "عرض المدونة",
"default-home-page": "الصفحة الرئيسية للموقع",
"version": "الإصدار",
"there-are-no-drafts": ".لا توجد مسودات",
"create-a-new-article-for-your-blog":".إبدأ بكتابة مقالات جديدة في مدونتك",
"create-a-new-page-for-your-website":".أنشئ صفحة جديدة في موقعك",
"invite-a-friend-to-collaborate-on-your-website":"يمكنك دعوة صديق للمساعدة في تحرير الموقع.",
"change-your-language-and-region-settings":".إختر لغتك ومنطقتك",
"language-and-timezone":"اللغة والمنطقة الزمنية",
"author": "الكاتب",
"start-here": "إبدأ من هنـا",
"install-theme": "تثبيث الحلة",
"first-post": "أول مشاركة",
"congratulations-you-have-successfully-installed-your-bludit": "بالتوفيق **Bludit**تهانينا لقد قمت نجحت في تثبيث ",
"whats-next": "ماهي الخطوة التالية",
"follow-bludit-on": "تابع جديدنا على",
"visit-the-support-forum": "[forum](https://forum.bludit.com) منتدى الدعم",
"read-the-documentation-for-more-information": "[documentation](https://docs.bludit.com) المزيد من المعلومات في الأرشيف",
"share-with-your-friends-and-enjoy": "شارك هذه التجربة مع أصدقائك",
"the-page-has-not-been-found": ".لم يتم العثور على الصفحة",
"error": "خطأ",
"bludit-installer": "Bludit مثبث",
"welcome-to-the-bludit-installer": "مرحبا بكم في Bludit مثبث",
"complete-the-form-choose-a-password-for-the-username-admin": "أكمل النموذج، إختر إسم وكلمة سر للمدير",
"password-visible-field": "كلمة السر، الحقل مرئي!",
"install": "تثبيث",
"choose-your-language": "إختر لغتك",
"next": "التالـي",
"the-password-field-is-empty": "حقل كلمة السر فارغ",
"your-email-address-is-invalid":".البريد الإلكتروني غير صحيح",
"proceed-anyway": "!تـابع",
"drafts":"المسودات",
"ip-address-has-been-blocked": "IP تم حظر.",
"try-again-in-a-few-minutes": ".أعد المحاولة بعد دقائق",
"date": "التاريخ",
"scheduled": "الجدولة",
"publish": "نشر",
"please-check-your-theme-configuration": ".المرجو التأكد من إعدادات الحلة",
"plugin-label": "تسمية الإضافة",
"enabled": "تفعيل",
"disabled": "تعطيل",
"cli-mode": "Cli وضع",
"command-line-mode": "وضع سطر الأوامر",
"enable-the-command-line-mode-if-you-add-edit": "تمكين وضع سطر الأوامر إذا قمت بإضافة، تعديل أو إزالة المشاركات والصفحات من نظام الملفات",
"configure": "إعداد",
"uninstall": "حـذف",
"change-password": "تغيير كلمة السر",
"to-schedule-the-post-just-select-the-date-and-time": "لجدولة المشاركات، فقط إختر التاريخ والتوقيت",
"write-the-tags-separated-by-commas": "أكتب العلامات ولا تنسى الفاصلة،بينهما",
"status": "الحالة",
"published": "منشور",
"scheduled-posts": "المنشورات المجدولة",
"statistics": "الإحصائيات",
"name": "الإسم",
"email-account-settings":"إعدادات بريد الحساب",
"sender-email": "بريد المرسل",
"emails-will-be-sent-from-this-address":".سوف ترسل الرسائل من هذا البريد",
"bludit-login-access-code": "BLUDIT - رمز الدخول",
"check-your-inbox-for-your-login-access-code":"راجع بريدك للحصول على رمز الدخول",
"there-was-a-problem-sending-the-email":"هناك مشكلة في إرسال البريد",
"back-to-login-form": "عودة إلى النمودج",
"send-me-a-login-access-code": "أرسل لي رمز الدخول",
"get-login-access-code": "أحصل على رمز الدخول",
"email-notification-login-access-code": "<p>هذا إشعار من موقعك الخاص {{WEBSITE_NAME}} </ P> <P> يمكنك طلب رمز تسجيل الدخول، اتبع الرابط التالي: </ P> <P> {{LINK}} </ P>",
"there-are-no-scheduled-posts": ".لا توجد أي مشاركات مجدولة",
"show-password": "أظهر كلمة السر",
"edit-or-remove-your=pages": ".تعديل أو حذف الصفحات",
"edit-or-remove-your-blogs-posts": ".تعديل أو حذف المشاركات",
"general-settings": "الإعدادات العامة",
"advanced-settings": "إعدادات متقدمة",
"manage-users": "إدارة المستخدمين",
"view-and-edit-your-profile": ".عرض وتحرير ملفك الشخصي",
"password-must-be-at-least-6-characters-long": "يجب أن لا تقل كلمة السر عن 6 حروف",
"images": "الصور",
"upload-image": "رفع الصور",
"drag-and-drop-or-click-here": "سحب وإسقاط أو اضغط هنا",
"insert-image": "إدراج صورة",
"supported-image-file-types": "أنواع ملفات الصور المدعومة",
"date-format": "صيغة التاريخ",
"time-format": "صيغة الوقت",
"chat-with-developers-and-users-on-gitter":"دردش مع المطورين من خلال هذه الصفحة [Gitter](https://gitter.im/dignajar/bludit)",
"this-is-a-brief-description-of-yourself-our-your-site":"هذا وصف موجز لنفسك أو لموقعك، لتغيير هذا النص تذهب إلى لوحة المشرف، إعدادات، والإضافات، وتعديل في إضافة About",
"profile-picture": "صورة الملف الشخصي",
"the-about-page-is-very-important": "صفحة من نحن أداة مهمة وقوية للعملاء والشركاء المحتملين. صفحة من نحن هو المصدر الأول للمعلومات حول موقعك.",
"change-this-pages-content-on-the-admin-panel": "يمكنك تغيير محتوى هذه الصفحة من لوحة الادارة",
"about-your-site-or-yourself": "نبذة عن نفسك أو موقعك",
"welcome-to-bludit": "مرحبا بك في Bludit",
"site-information": "معلومات الموقع",
"date-and-time-formats": "تنسيق التاريخ والوقت",
"activate": "تفعيل",
"deactivate": "تعطيل",
"cover-image": "صورة الغلاف",
"blog": "المدونة",
"more-images": "المزيد من الصور",
"click-here-to-cancel": ".انقر هنا إلى إلغاء",
"type-the-tag-and-press-enter": ".أكتب العلامات وإضغظ زر الإدخال",
"add": "أضـف",
"manage-your-bludit-from-the-admin-panel": "إدارة الموقع[admin area]({{ADMIN_AREA_LINK}})",
"there-are-no-images":"لا توجد صور بعد",
"click-on-the-image-for-options": "إضغط على الصورة للمزيد من خيارات.",
"set-as-cover-image": "جعلها صورة للغلاف",
"delete-image": "حذف الصورة",
"image-description": "وصف الصورة",
"social-networks-links": "روابط الشبكات الإجتماعية"
}

View file

@ -235,5 +235,7 @@
"delete-image": "Delete image",
"image-description": "Image description",
"social-networks-links": "Social networks links"
"social-networks-links": "Social networks links",
"email-access-code": "Email access code"
}

View file

@ -0,0 +1,7 @@
{
"plugin-data":
{
"name": "RSS Feed",
"description": "هذه الإضافة تساعد على توليد تغذية RSS لموقعك."
}
}

4
bl-plugins/simplemde/css/simplemde.min.css vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

18
bl-plugins/simplemde/js/simplemde.min.js vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

View file

@ -3,5 +3,9 @@
{
"name": "Список тегов",
"description": "Показывает все теги."
}
}
},
"tag-sort-order": "Сортировать по",
"tag-sort-alphabetical": "алфавиту",
"tag-sort-count": "количеству",
"tag-sort-date": "дате"
}

View file

@ -2,12 +2,12 @@
/*
* Bludit
* http://www.bludit.com
* https://www.bludit.com
* Author Diego Najar
* Bludit is opensource software licensed under the MIT license.
*/
// Check installation
// Check if Bludit is installed
if( !file_exists('bl-content/databases/site.php') )
{
header('Location:./install.php');

View file

@ -372,7 +372,6 @@ function install($adminPassword, $email, $timezone)
'uriPage'=>'/',
'uriTag'=>'/tag/',
'url'=>PROTOCOL.DOMAIN.HTML_PATH_ROOT,
'cliMode'=>false,
'emailFrom'=>'no-reply@'.DOMAIN
);