bludit v3.15.0

This commit is contained in:
Diego Najar 2023-07-15 15:58:33 +02:00
parent 654be18345
commit 27415297e8
107 changed files with 9777 additions and 2210 deletions

View file

@ -6,7 +6,7 @@ AddDefaultCharset UTF-8
RewriteEngine on
# Base directory
#RewriteBase /
RewriteBase /
# Deny direct access to the next directories
RewriteRule ^bl-content/(databases|workspaces|pages|tmp)/.*$ - [R=404,L]

View file

@ -1,12 +1,12 @@
# [Bludit](https://www.bludit.com/)
Simple, Fast and Flexible CMS.
Bludit the Simple, Fast, and Flexible CMS.
Bludit is a web application to build your own website or blog in seconds, it's completely free and open source. Bludit uses files in JSON format to store the content, you don't need to install or configure a database. You only need a web server with PHP support.
With Bludit, you can build your own website or blog in just seconds. Its completely free, open-source, and easy to use. Bludit stores content in JSON format, eliminating the need for database installation or configuration. All you need is a web server with PHP support.
Bludit is a Flat-File CMS.
As a Flat-File CMS, Bludit offers unparalleled flexibility and speed. Plus, with support for both Markdown and HTML code, creating and managing content has never been easier.
Bludit supports Markdown and HTML code for the content.
## Resources
- [Plugins](https://plugins.bludit.com)
- [Themes](https://themes.bludit.com)
@ -27,11 +27,11 @@ Bludit supports Markdown and HTML code for the content.
## Installation
1. Download the latest version from the official page. [Bludit.com](https://www.bludit.com)
2. Extract the zip file into a directory such as `bludit`.
3. Upload the directory `bludit` to your web server or hosting.
4. Visit your domain https://example.com/bludit/
5. Follow the Bludit Installer to set up the website.
1. Download the latest version from the official page: [Bludit.com](https://www.bludit.com)
2. Extract the zip file into a directory, such as `bludit`.
3. Upload the `bludit` directory to your web server or hosting.
4. Visit your domain (e.g., https://example.com/bludit/).
5. Follow the Bludit Installer to set up your website.
## Quick installation for testing
@ -39,13 +39,14 @@ You can use PHP Built-in web server (`php -S localhost:8000`) or [Docker image](
## Support Bludit
Bludit is open source and free, but if you really like the project and is useful for your you can contribute on [Patreon](https://www.patreon.com/bePatron?c=921115&rid=2458860), also for the supporters we provide Bludit PRO. [![Bludit PRO](https://img.shields.io/badge/Bludit-PRO-blue.svg)](https://pro.bludit.com/)
Bludit is open-source and free to use, but if you find the project useful and would like to support its development, you can contribute on [Patreon](https://www.patreon.com/bePatron?c=921115&rid=2458860). As a token of our appreciation, supporters will receive Bludit PRO.
If you prefer, you can also make a one-time donation to buy us a coffee or beer. Every contribution helps us continue to improve Bludit and provide the best possible experience for our users.
Donate one time for the coffee or beer:
- [PayPal](https://www.paypal.me/bludit/10)
- BTC (Network BTC): bc1qtets5pdj73uyysjpegfh2gar4pfywra4rglcph
- ETH (Network ETH): 0x0d7D58D848aA5f175D75Ce4bC746bAC107f331b7
## License
Bludit is open source software licensed under the [MIT license](https://tldrlegal.com/license/mit-license).
Bludit is open source software licensed under the [MIT license](https://tldrlegal.com/license/mit-license).

View file

@ -1,6 +1,7 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class Plugin {
class Plugin
{
// (string) directory name, just the name
// Ex: sitemap
@ -55,10 +56,10 @@ class Plugin {
// Init empty database with default values
$this->db = $this->dbFields;
$this->filenameDb = PATH_PLUGINS_DATABASES.$this->directoryName.DS.'db.php';
$this->filenameDb = PATH_PLUGINS_DATABASES . $this->directoryName . DS . 'db.php';
// --- Metadata ---
$this->filenameMetadata = PATH_PLUGINS.$this->directoryName().DS.'metadata.json';
$this->filenameMetadata = PATH_PLUGINS . $this->directoryName() . DS . 'metadata.json';
$metadataString = file_get_contents($this->filenameMetadata);
$this->metadata = json_decode($metadataString, true);
@ -79,44 +80,44 @@ class Plugin {
public function includeCSS($filename)
{
return '<link rel="stylesheet" type="text/css" href="'.$this->domainPath().'css/'.$filename.'?version='.BLUDIT_VERSION.'">'.PHP_EOL;
return '<link rel="stylesheet" type="text/css" href="' . $this->domainPath() . 'css/' . $filename . '?version=' . BLUDIT_VERSION . '">' . PHP_EOL;
}
public function includeJS($filename)
{
return '<script charset="utf-8" src="'.$this->domainPath().'js/'.$filename.'?version='.BLUDIT_VERSION.'"></script>'.PHP_EOL;
return '<script charset="utf-8" src="' . $this->domainPath() . 'js/' . $filename . '?version=' . BLUDIT_VERSION . '"></script>' . PHP_EOL;
}
// Returns absolute URL and path of the plugin directory
// This function helps to include CSS or Javascript files with absolute URL
public function domainPath()
{
return DOMAIN_PLUGINS.$this->directoryName.'/';
return DOMAIN_PLUGINS . $this->directoryName . '/';
}
// Returns relative path of the plugin directory
// This function helps to include CSS or Javascript files with relative URL
public function htmlPath()
{
return HTML_PATH_PLUGINS.$this->directoryName.'/';
return HTML_PATH_PLUGINS . $this->directoryName . '/';
}
// Returns absolute path of the plugin directory
// This function helps to include PHP libraries or some file at server level
public function phpPath()
{
return PATH_PLUGINS.$this->directoryName.DS;
return PATH_PLUGINS . $this->directoryName . DS;
}
public function phpPathDB()
{
return PATH_PLUGINS_DATABASES.$this->directoryName.DS;
return PATH_PLUGINS_DATABASES . $this->directoryName . DS;
}
// Returns the value of the key from the metadata of the plugin, FALSE if the key doesn't exist
public function getMetadata($key)
{
if(isset($this->metadata[$key])) {
if (isset($this->metadata[$key])) {
return $this->metadata[$key];
}
@ -133,7 +134,7 @@ class Plugin {
// Returns the value of the field from the database
// (string) $field
// (boolean) $html, TRUE returns the value sanitized, FALSE unsanitized
public function getValue($field, $html=true)
public function getValue($field, $html = true)
{
if (isset($this->db[$field])) {
if ($html) {
@ -204,9 +205,9 @@ class Plugin {
{
$bluditRoot = explode('.', BLUDIT_VERSION);
$compatible = explode(',', $this->getMetadata('compatible'));
foreach( $compatible as $version ) {
foreach ($compatible as $version) {
$root = explode('.', $version);
if( $root[0]==$bluditRoot[0] && $root[1]==$bluditRoot[1] ) {
if ($root[0] == $bluditRoot[0] && $root[1] == $bluditRoot[1]) {
return true;
}
}
@ -219,7 +220,7 @@ class Plugin {
}
// Return TRUE if the installation success, otherwise FALSE.
public function install($position=1)
public function install($position = 1)
{
if ($this->installed()) {
return false;
@ -230,11 +231,11 @@ class Plugin {
mkdir($workspace, DIR_PERMISSIONS, true);
// Create plugin directory for the database
mkdir(PATH_PLUGINS_DATABASES.$this->directoryName, DIR_PERMISSIONS, true);
mkdir(PATH_PLUGINS_DATABASES . $this->directoryName, DIR_PERMISSIONS, true);
$this->dbFields['position'] = $position;
// Sanitize default values to store in the file
foreach ($this->dbFields as $key=>$value) {
foreach ($this->dbFields as $key => $value) {
$value = Sanitize::html($value);
settype($value, gettype($this->dbFields[$key]));
$this->db[$key] = $value;
@ -247,7 +248,7 @@ class Plugin {
public function uninstall()
{
// Delete database
$path = PATH_PLUGINS_DATABASES.$this->directoryName;
$path = PATH_PLUGINS_DATABASES . $this->directoryName;
Filesystem::deleteRecursive($path);
// Delete workspace
@ -266,7 +267,7 @@ class Plugin {
public function workspace()
{
return PATH_WORKSPACES.$this->directoryName.DS;
return PATH_WORKSPACES . $this->directoryName . DS;
}
public function init()
@ -284,11 +285,14 @@ class Plugin {
public function post()
{
$args = $_POST;
foreach ($this->dbFields as $field=>$value) {
foreach ($this->dbFields as $field => $value) {
if (isset($args[$field])) {
$finalValue = Sanitize::html( $args[$field] );
if ($finalValue==='false') { $finalValue = false; }
elseif ($finalValue==='true') { $finalValue = true; }
$finalValue = Sanitize::html($args[$field]);
if ($finalValue === 'false') {
$finalValue = false;
} elseif ($finalValue === 'true') {
$finalValue = true;
}
settype($finalValue, gettype($value));
$this->db[$field] = $finalValue;
}
@ -296,6 +300,11 @@ class Plugin {
return $this->save();
}
public function type()
{
return $this->getMetadata('type');
}
public function setField($field, $value)
{
$this->db[$field] = Sanitize::html($value);
@ -309,7 +318,7 @@ class Plugin {
// Returns the parameters after the URI, FALSE if the URI doesn't match with the webhook
// Example: https://www.mybludit.com/api/foo/bar
public function webhook($URI=false, $returnsAfterURI=false, $fixed=true)
public function webhook($URI = false, $returnsAfterURI = false, $fixed = true)
{
global $url;
@ -318,10 +327,10 @@ class Plugin {
}
// Check URI start with the webhook
$startString = HTML_PATH_ROOT.$URI;
$startString = HTML_PATH_ROOT . $URI;
$URI = $url->uri();
$length = mb_strlen($startString, CHARSET);
if (mb_substr($URI, 0, $length)!=$startString) {
if (mb_substr($URI, 0, $length) != $startString) {
return false;
}
@ -330,7 +339,7 @@ class Plugin {
if ($fixed) {
return false;
}
if ($afterURI[0]!='/') {
if ($afterURI[0] != '/') {
return false;
}
}
@ -339,8 +348,7 @@ class Plugin {
return $afterURI;
}
Log::set(__METHOD__.LOG_SEP.'Webhook requested.');
Log::set(__METHOD__ . LOG_SEP . 'Webhook requested.');
return true;
}
}
}

View file

@ -1,4 +1,3 @@
html {
height: 100%;
font-size: 0.9rem;
@ -18,7 +17,7 @@ body {
ICONS
*/
.fa {
padding-right: 2px;
margin-right: .5rem !important;
line-height: inherit;
}
@ -27,8 +26,8 @@ body {
*/
div.sidebar .nav-item a {
padding-left:0;
padding-right:0;
padding-left: 0;
padding-right: 0;
color: #555;
padding-top: 5px;
padding-bottom: 5px;
@ -69,6 +68,7 @@ div.sidebar .nav-item h4 {
/* for small devices */
@media (max-width: 575.98px) {
#jsmediaManagerButton,
#jscategoryButton,
#jsdescriptionButton {
@ -104,7 +104,7 @@ code {
padding: 3px 5px 2px;
margin: 0 1px;
background: #eaeaea;
background: rgba(0,0,0,.07);
background: rgba(0, 0, 0, .07);
color: #444;
}
@ -129,8 +129,8 @@ code {
*/
body.login {
background: rgb(255,255,255);
background: linear-gradient(0deg, rgba(255,255,255,1) 0%, rgba(250,250,250,1) 53%);
background: rgb(255, 255, 255);
background: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(250, 250, 250, 1) 53%);
height: 100%;
}
@ -168,7 +168,6 @@ body.login {
#hello-message {
padding: 10px 0;
color: #777;
margin-bottom: 20px;
}
@ -243,7 +242,7 @@ body.login {
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: .25rem;
transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.plugin-form textarea {
@ -301,16 +300,20 @@ td.child {
max-width: 100%;
right: 0;
}
#jseditorToolbarRight button {
font-size: 0px !important;
}
#jseditorToolbarRight button span {
font-size: 16px !important;
}
.contentTools .btn {
font-size: 0px !important;
margin-right: 5px;
}
.contentTools .btn span {
font-size: 16px !important;
}
@ -340,7 +343,7 @@ td.child {
right: 0;
bottom: 0;
left: 0;
background-color: rgba(72,72,72,0.7);
background-color: rgba(72, 72, 72, 0.7);
z-index: 10;
display: none;
}

View file

@ -1,54 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>Bludit</title>
<meta charset="<?php echo CHARSET ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="noindex,nofollow">
<title>Bludit</title>
<meta charset="<?php echo CHARSET ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="noindex,nofollow">
<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="<?php echo HTML_PATH_CORE_IMG.'favicon.png?version='.BLUDIT_VERSION ?>">
<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="<?php echo HTML_PATH_CORE_IMG . 'favicon.png?version=' . BLUDIT_VERSION ?>">
<!-- CSS -->
<?php
echo Theme::cssBootstrap();
echo Theme::css(array(
'bludit.css',
'bludit.bootstrap.css'
), DOMAIN_ADMIN_THEME_CSS);
?>
<!-- CSS -->
<?php
echo Theme::cssBootstrap();
echo Theme::css(array(
'bludit.css',
'bludit.bootstrap.css'
), DOMAIN_ADMIN_THEME_CSS);
?>
<!-- Javascript -->
<?php
echo Theme::jquery();
echo Theme::jsBootstrap();
?>
<!-- Javascript -->
<?php
echo Theme::jquery();
echo Theme::jsBootstrap();
?>
<!-- Plugins -->
<?php Theme::plugins('loginHead') ?>
<!-- Plugins -->
<?php Theme::plugins('loginHead') ?>
</head>
<body class="login">
<!-- Plugins -->
<?php Theme::plugins('loginBodyBegin') ?>
<!-- Plugins -->
<?php Theme::plugins('loginBodyBegin') ?>
<!-- Alert -->
<?php include('html/alert.php'); ?>
<!-- Alert -->
<?php include('html/alert.php'); ?>
<div class="container">
<div class="row justify-content-md-center pt-5">
<div class="col-md-4 pt-5">
<?php
if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php')) {
include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
}
?>
</div>
</div>
</div>
<div class="container">
<div class="row justify-content-md-center pt-5">
<div class="col-md-4 mt-5 p-5 shadow-sm bg-white rounded border">
<?php
if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'] . '.php')) {
include(PATH_ADMIN_VIEWS . $layout['view'] . '.php');
}
?>
</div>
</div>
</div>
<!-- Plugins -->
<?php Theme::plugins('loginBodyEnd') ?>
<!-- Plugins -->
<?php Theme::plugins('loginBodyEnd') ?>
</body>
</html>

View file

@ -4,8 +4,8 @@
<!-- Good message -->
<div>
<h2 id="hello-message" class="pt-0">
<?php
<h2 id="hello-message" class="pt-0">
<?php
$username = $login->username();
$user = new User($username);
$name = '';
@ -14,26 +14,26 @@
} elseif ($user->firstName()) {
$name = $user->firstName();
}
?>
<span class="fa fa-hand-spock-o"></span><span><?php echo $L->g('hello').' '.$name ?></span>
</h2>
<script>
$( document ).ready(function() {
$("#hello-message").fadeOut(2400, function() {
var date = new Date()
var hours = date.getHours()
if (hours > 6 && hours < 12) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-morning') ?>');
} else if (hours > 12 && hours < 18) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-afternoon') ?>');
} else if (hours > 18 && hours < 22) {
$(this).html('<span class="fa fa-moon-o"></span><?php echo $L->g('good-evening') ?>');
} else {
$(this).html('<span class="fa fa-moon-o"></span><span><?php echo $L->g('good-night') ?></span>');
}
}).fadeIn(1000);
});
</script>
?>
<span class="fa fa-hand-spock-o"></span><span><?php echo $L->g('welcome') ?></span>
</h2>
<script>
$(document).ready(function() {
$("#hello-message").fadeOut(2400, function() {
var date = new Date()
var hours = date.getHours()
if (hours > 6 && hours < 12) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-morning') . ', ' . $name ?>');
} else if (hours > 12 && hours < 18) {
$(this).html('<span class="fa fa-sun-o"></span><?php echo $L->g('good-afternoon') . ', ' . $name ?>');
} else if (hours > 18 && hours < 22) {
$(this).html('<span class="fa fa-moon-o"></span><?php echo $L->g('good-evening') . ', ' . $name ?>');
} else {
$(this).html('<span class="fa fa-moon-o"></span><span><?php echo $L->g('good-night') . ', ' . $name ?></span>');
}
}).fadeIn(1000);
});
</script>
</div>
<!-- Quick Links -->
@ -42,108 +42,70 @@
<div class="row">
<div class="col p-0">
<div class="form-group">
<select id="jsclippy" class="clippy" name="state"></select>
<select id="jsclippy" class="clippy" name="state"></select>
</div>
</div>
</div>
<script>
$(document).ready(function() {
<script>
$(document).ready(function() {
var clippy = $("#jsclippy").select2({
placeholder: "<?php $L->p('Start typing to see a list of suggestions') ?>",
allowClear: true,
width: "100%",
theme: "bootstrap4",
minimumInputLength: 2,
dropdownParent: "#jsclippyContainer",
language: {
inputTooShort: function () { return ''; }
},
ajax: {
url: HTML_PATH_ADMIN_ROOT+"ajax/clippy",
data: function (params) {
var query = { query: params.term }
return query;
},
processResults: function (data) {
return data;
}
},
templateResult: function(data) {
// console.log(data);
var html = '';
if (data.type=='menu') {
html += '<a href="'+data.url+'"><div class="search-suggestion">';
html += '<span class="fa fa-'+data.icon+'"></span>'+data.text+'</div></a>';
} else {
if (typeof data.id === 'undefined') {
return '';
var clippy = $("#jsclippy").select2({
placeholder: "<?php $L->p('Start typing to see a list of suggestions') ?>",
allowClear: true,
width: "100%",
theme: "bootstrap4",
minimumInputLength: 2,
dropdownParent: "#jsclippyContainer",
language: {
inputTooShort: function() {
return '';
}
},
ajax: {
url: HTML_PATH_ADMIN_ROOT + "ajax/clippy",
data: function(params) {
var query = {
query: params.term
}
return query;
},
processResults: function(data) {
return data;
}
},
templateResult: function(data) {
// console.log(data);
var html = '';
if (data.type == 'menu') {
html += '<a href="' + data.url + '"><div class="search-suggestion">';
html += '<span class="fa fa-' + data.icon + '"></span>' + data.text + '</div></a>';
} else {
if (typeof data.id === 'undefined') {
return '';
}
html += '<div class="search-suggestion">';
html += '<div class="search-suggestion-item">' + data.text + ' <span class="badge badge-pill badge-light">' + data.type + '</span></div>';
html += '<div class="search-suggestion-options">';
html += '<a target="_blank" href="' + DOMAIN_PAGES + data.id + '"><?php $L->p('view') ?></a>';
html += '<a class="ml-2" href="' + DOMAIN_ADMIN + 'edit-content/' + data.id + '"><?php $L->p('edit') ?></a>';
html += '</div></div>';
}
return html;
},
escapeMarkup: function(markup) {
return markup;
}
html += '<div class="search-suggestion">';
html += '<div class="search-suggestion-item">'+data.text+' <span class="badge badge-pill badge-light">'+data.type+'</span></div>';
html += '<div class="search-suggestion-options">';
html += '<a target="_blank" href="'+DOMAIN_PAGES+data.id+'"><?php $L->p('view') ?></a>';
html += '<a class="ml-2" href="'+DOMAIN_ADMIN+'edit-content/'+data.id+'"><?php $L->p('edit') ?></a>';
html += '</div></div>';
}
}).on("select2:closing", function(e) {
e.preventDefault();
}).on("select2:closed", function(e) {
clippy.select2("open");
});
clippy.select2("open");
return html;
},
escapeMarkup: function(markup) {
return markup;
}
}).on("select2:closing", function(e) {
e.preventDefault();
}).on("select2:closed", function(e) {
clippy.select2("open");
});
clippy.select2("open");
});
</script>
</div>
<div class="container border-top pt-4 mt-4">
<div class="row">
<div class="col">
<a class="quick-links text-center" target="_blank" href="https://docs.bludit.com">
<div class="fa fa-compass quick-links-icons"></div>
<div><?php $L->p('Documentation') ?></div>
</a>
</div>
<div class="col border-left border-right">
<a class="quick-links text-center" target="_blank" href="https://forum.bludit.org">
<div class="fa fa-support quick-links-icons"></div>
<div><?php $L->p('Forum support') ?></div>
</a>
</div>
<div class="col">
<a class="quick-links text-center" target="_blank" href="https://discord.gg/CFaXEdZWds">
<div class="fa fa-comments quick-links-icons"></div>
<div><?php $L->p('Chat support') ?></div>
</a>
</div>
</div>
<div class="row">
<div class="col">
<a class="quick-links text-center" target="_blank" href="https://themes.bludit.com">
<div class="fa fa-desktop quick-links-icons"></div>
<div><?php $L->p('Themes') ?></div>
</a>
</div>
<div class="col border-left border-right">
<a class="quick-links text-center" target="_blank" href="https://plugins.bludit.com">
<div class="fa fa-puzzle-piece quick-links-icons"></div>
<div><?php $L->p('Plugins') ?></div>
</a>
</div>
<div class="col">
<a class="quick-links text-center" target="_blank" href="https://github.com/bludit/bludit">
<div class="fa fa-github quick-links-icons"></div>
<div><?php $L->p('GitHub') ?></div>
</a>
</div>
</div>
});
</script>
</div>
<?php Theme::plugins('dashboard') ?>
@ -152,23 +114,25 @@
<!-- Notifications -->
<ul class="list-group list-group-striped b-0">
<li class="list-group-item pt-0"><h4 class="m-0"><?php $L->p('Notifications') ?></h4></li>
<?php
$logs = array_slice($syslog->db, 0, NOTIFICATIONS_AMOUNT);
foreach ($logs as $log) {
$phrase = $L->g($log['dictionaryKey']);
echo '<li class="list-group-item">';
echo $phrase;
if (!empty($log['notes'])) {
echo ' « <b>'.$log['notes'].'</b> »';
<li class="list-group-item pt-0">
<h4 class="m-0"><?php $L->p('Notifications') ?></h4>
</li>
<?php
$logs = array_slice($syslog->db, 0, NOTIFICATIONS_AMOUNT);
foreach ($logs as $log) {
$phrase = $L->g($log['dictionaryKey']);
echo '<li class="list-group-item">';
echo $phrase;
if (!empty($log['notes'])) {
echo ' « <b>' . $log['notes'] . '</b> »';
}
echo '<br><span class="notification-date"><small>';
echo Date::format($log['date'], DB_DATE_FORMAT, NOTIFICATIONS_DATE_FORMAT);
echo ' [ ' . $log['username'] . ' ]';
echo '</small></span>';
echo '</li>';
}
echo '<br><span class="notification-date"><small>';
echo Date::format($log['date'], DB_DATE_FORMAT, NOTIFICATIONS_DATE_FORMAT);
echo ' [ '.$log['username'] .' ]';
echo '</small></span>';
echo '</li>';
}
?>
?>
</ul>
</div>

View file

@ -1,6 +1,6 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
echo '<h1 class="text-center mb-5 mt-5 font-weight-normal" style="color: #555;">'.$site->title().'</h1>';
echo '<h1 class="text-center mb-3 mt-3 font-weight-normal" style="color: #555;">'.$site->title().'</h1>';
echo Bootstrap::formOpen(array());
@ -34,6 +34,5 @@ echo Bootstrap::formOpen(array());
echo '</form>';
echo '<p class="mt-5 text-right">'.$L->g('Powered by Bludit').((defined('BLUDIT_PRO'))?' PRO':'').'</p>'
echo '<p class="mt-3 text-right">'.$L->g('Powered by Bludit').((defined('BLUDIT_PRO'))?' PRO':'').'</p>'
?>

View file

@ -1,39 +1,39 @@
<?php
echo Bootstrap::pageTitle(array('title'=>$L->g('Plugins'), 'icon'=>'puzzle-piece'));
echo Bootstrap::pageTitle(array('title' => $L->g('Plugins'), 'icon' => 'puzzle-piece'));
echo Bootstrap::link(array(
'title'=>$L->g('Change the position of the plugins'),
'href'=>HTML_PATH_ADMIN_ROOT.'plugins-position',
'icon'=>'arrows'
'title' => $L->g('Change the position of the plugins'),
'href' => HTML_PATH_ADMIN_ROOT . 'plugins-position',
'icon' => 'arrows'
));
echo Bootstrap::formTitle(array('title'=>$L->g('Search plugins')));
echo Bootstrap::formTitle(array('title' => $L->g('Search plugins')));
?>
<input type="text" class="form-control" id="search" placeholder="<?php $L->p('Search') ?>">
<script>
$(document).ready(function() {
$("#search").on("keyup", function() {
var textToSearch = $(this).val().toLowerCase();
$(".searchItem").each( function() {
var item = $(this);
item.hide();
item.find(".searchText").each( function() {
var element = $(this).text().toLowerCase();
if (element.indexOf(textToSearch)!=-1) {
item.show();
}
$(document).ready(function() {
$("#search").on("keyup", function() {
var textToSearch = $(this).val().toLowerCase();
$(".searchItem").each(function() {
var item = $(this);
item.hide();
item.find(".searchText").each(function() {
var element = $(this).text().toLowerCase();
if (element.indexOf(textToSearch) != -1) {
item.show();
}
});
});
});
});
});
</script>
<?php
echo Bootstrap::formTitle(array('title'=>$L->g('Enabled plugins')));
echo Bootstrap::formTitle(array('title' => $L->g('Enabled plugins')));
echo '
<table class="table">
@ -42,28 +42,34 @@ echo '
// Show installed plugins
foreach ($pluginsInstalled as $plugin) {
echo '<tr id="'.$plugin->className().'" class="bg-light searchItem">';
if ($plugin->type() == 'theme') {
// Do not display theme's plugins
continue;
}
echo '<tr id="' . $plugin->className() . '" class="bg-light searchItem">';
echo '<td class="align-middle pt-3 pb-3 w-25">
<div class="searchText">'.$plugin->name().'</div>
<div class="searchText">' . $plugin->name() . '</div>
<div class="mt-1">';
if (method_exists($plugin, 'form')) {
echo '<a class="mr-3" href="'.HTML_PATH_ADMIN_ROOT.'configure-plugin/'.$plugin->className().'">'.$L->g('Settings').'</a>';
}
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$plugin->className().'">'.$L->g('Deactivate').'</a>';
echo '</div>';
if (method_exists($plugin, 'form')) {
echo '<a class="mr-3" href="' . HTML_PATH_ADMIN_ROOT . 'configure-plugin/' . $plugin->className() . '">' . $L->g('Settings') . '</a>';
}
echo '<a href="' . HTML_PATH_ADMIN_ROOT . 'uninstall-plugin/' . $plugin->className() . '">' . $L->g('Deactivate') . '</a>';
echo '</div>';
echo '</td>';
echo '<td class="searchText align-middle d-none d-sm-table-cell">';
echo $plugin->description();
echo $plugin->description();
echo '</td>';
echo '<td class="text-center align-middle d-none d-lg-table-cell">';
echo '<span>'.$plugin->version().'</span>';
echo '<span>' . $plugin->version() . '</span>';
echo '</td>';
echo '<td class="text-center align-middle d-none d-lg-table-cell">
<a target="_blank" href="'.$plugin->website().'">'.$plugin->author().'</a>
<a target="_blank" href="' . $plugin->website() . '">' . $plugin->author() . '</a>
</td>';
echo '</tr>';
@ -74,7 +80,7 @@ echo '
</table>
';
echo Bootstrap::formTitle(array('title'=>$L->g('Disabled plugins')));
echo Bootstrap::formTitle(array('title' => $L->g('Disabled plugins')));
echo '
<table class="table">
@ -84,25 +90,30 @@ echo '
// Plugins not installed
$pluginsNotInstalled = array_diff_key($plugins['all'], $pluginsInstalled);
foreach ($pluginsNotInstalled as $plugin) {
echo '<tr id="'.$plugin->className().'" class="searchItem">';
if ($plugin->type() == 'theme') {
// Do not display theme's plugins
continue;
}
echo '<tr id="' . $plugin->className() . '" class="searchItem">';
echo '<td class="align-middle pt-3 pb-3 w-25">
<div class="searchText">'.$plugin->name().'</div>
<div class="searchText">' . $plugin->name() . '</div>
<div class="mt-1">
<a href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$plugin->className().'">'.$L->g('Activate').'</a>
<a href="' . HTML_PATH_ADMIN_ROOT . 'install-plugin/' . $plugin->className() . '">' . $L->g('Activate') . '</a>
</div>
</td>';
echo '<td class="searchText align-middle d-none d-sm-table-cell">';
echo $plugin->description();
echo $plugin->description();
echo '</td>';
echo '<td class="text-center align-middle d-none d-lg-table-cell">';
echo '<span>'.$plugin->version().'</span>';
echo '<span>' . $plugin->version() . '</span>';
echo '</td>';
echo '<td class="text-center align-middle d-none d-lg-table-cell">
<a target="_blank" href="'.$plugin->website().'">'.$plugin->author().'</a>
<a target="_blank" href="' . $plugin->website() . '">' . $plugin->author() . '</a>
</td>';
echo '</tr>';
@ -111,4 +122,4 @@ foreach ($pluginsNotInstalled as $plugin) {
echo '
</tbody>
</table>
';
';

View file

@ -1,13 +1,13 @@
<?php defined('BLUDIT') or die('Bludit CMS.'); ?>
<?php echo Bootstrap::formOpen(array('id'=>'jsform', 'class'=>'tab-content')); ?>
<?php echo Bootstrap::formOpen(array('id' => 'jsform', 'class' => 'tab-content')); ?>
<div class="align-middle">
<div class="float-right mt-1">
<button type="submit" class="btn btn-primary btn-sm" name="save"><?php $L->p('Save') ?></button>
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT.'dashboard' ?>" role="button"><?php $L->p('Cancel') ?></a>
<a class="btn btn-secondary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT . 'dashboard' ?>" role="button"><?php $L->p('Cancel') ?></a>
</div>
<?php echo Bootstrap::pageTitle(array('title'=>$L->g('Settings'), 'icon'=>'cog')); ?>
<?php echo Bootstrap::pageTitle(array('title' => $L->g('Settings'), 'icon' => 'cog')); ?>
</div>
<!-- TABS -->
@ -25,103 +25,103 @@
</nav>
<?php
// Token CSRF
echo Bootstrap::formInputHidden(array(
'name'=>'tokenCSRF',
'value'=>$security->getTokenCSRF()
));
// Token CSRF
echo Bootstrap::formInputHidden(array(
'name' => 'tokenCSRF',
'value' => $security->getTokenCSRF()
));
?>
<!-- General tab -->
<div class="tab-pane fade show active" id="general" role="tabpanel" aria-labelledby="general-tab">
<!-- General tab -->
<div class="tab-pane fade show active" id="general" role="tabpanel" aria-labelledby="general-tab">
<?php
echo Bootstrap::formTitle(array('title'=>$L->g('Site')));
echo Bootstrap::formTitle(array('title' => $L->g('Site')));
echo Bootstrap::formInputText(array(
'name'=>'title',
'label'=>$L->g('Site title'),
'value'=>$site->title(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('use-this-field-to-name-your-site')
));
echo Bootstrap::formInputText(array(
'name' => 'title',
'label' => $L->g('Site title'),
'value' => $site->title(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('use-this-field-to-name-your-site')
));
echo Bootstrap::formInputText(array(
'name'=>'slogan',
'label'=>$L->g('Site slogan'),
'value'=>$site->slogan(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('use-this-field-to-add-a-catchy-phrase')
));
echo Bootstrap::formInputText(array(
'name' => 'slogan',
'label' => $L->g('Site slogan'),
'value' => $site->slogan(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('use-this-field-to-add-a-catchy-phrase')
));
echo Bootstrap::formInputText(array(
'name'=>'description',
'label'=>$L->g('Site description'),
'value'=>$site->description(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('you-can-add-a-site-description-to-provide')
));
echo Bootstrap::formInputText(array(
'name' => 'description',
'label' => $L->g('Site description'),
'value' => $site->description(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('you-can-add-a-site-description-to-provide')
));
echo Bootstrap::formInputText(array(
'name'=>'footer',
'label'=>$L->g('Footer text'),
'value'=>$site->footer(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('you-can-add-a-small-text-on-the-bottom')
));
echo Bootstrap::formInputText(array(
'name' => 'footer',
'label' => $L->g('Footer text'),
'value' => $site->footer(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('you-can-add-a-small-text-on-the-bottom')
));
?>
</div>
</div>
<!-- Advanced tab -->
<div class="tab-pane fade" id="advanced" role="tabpanel" aria-labelledby="advanced-tab">
<!-- Advanced tab -->
<div class="tab-pane fade" id="advanced" role="tabpanel" aria-labelledby="advanced-tab">
<?php
echo Bootstrap::formTitle(array('title'=>$L->g('Content')));
echo Bootstrap::formTitle(array('title' => $L->g('Content')));
echo Bootstrap::formSelect(array(
'name'=>'itemsPerPage',
'label'=>$L->g('Items per page'),
'options'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8', '-1'=>$L->g('All content')),
'selected'=>$site->itemsPerPage(),
'class'=>'',
'tip'=>$L->g('Number of items to show per page')
));
echo Bootstrap::formInputText(array(
'name' => 'itemsPerPage',
'label' => $L->g('Items per page'),
'value' => $site->itemsPerPage(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Number of items to show per page')
));
echo Bootstrap::formSelect(array(
'name'=>'orderBy',
'label'=>$L->g('Order content by'),
'options'=>array('date'=>$L->g('Date'),'position'=>$L->g('Position')),
'selected'=>$site->orderBy(),
'class'=>'',
'tip'=>$L->g('order-the-content-by-date-to-build-a-blog')
));
echo Bootstrap::formSelect(array(
'name' => 'orderBy',
'label' => $L->g('Order content by'),
'options' => array('date' => $L->g('Date'), 'position' => $L->g('Position')),
'selected' => $site->orderBy(),
'class' => '',
'tip' => $L->g('order-the-content-by-date-to-build-a-blog')
));
echo Bootstrap::formTitle(array('title'=>$L->g('Predefined pages')));
echo Bootstrap::formTitle(array('title' => $L->g('Predefined pages')));
// Homepage
try {
$options = array();
$homeKey = $site->homepage();
if (!empty($homeKey)) {
$home = new Page($homeKey);
$options = array($homeKey=>$home->title());
}
} catch (Exception $e) {
// continue
// Homepage
try {
$options = array();
$homeKey = $site->homepage();
if (!empty($homeKey)) {
$home = new Page($homeKey);
$options = array($homeKey => $home->title());
}
echo Bootstrap::formSelect(array(
'name'=>'homepage',
'label'=>$L->g('Homepage'),
'options'=>$options,
'selected'=>false,
'class'=>'',
'tip'=>$L->g('Returning page for the main page')
));
} catch (Exception $e) {
// continue
}
echo Bootstrap::formSelect(array(
'name' => 'homepage',
'label' => $L->g('Homepage'),
'options' => $options,
'selected' => false,
'class' => '',
'tip' => $L->g('Returning page for the main page')
));
?>
<script>
<script>
$(document).ready(function() {
var homepage = $("#jshomepage").select2({
placeholder: "<?php $L->p('Start typing to see a list of suggestions.') ?>",
@ -129,12 +129,14 @@
theme: "bootstrap4",
minimumInputLength: 2,
ajax: {
url: HTML_PATH_ADMIN_ROOT+"ajax/get-published",
data: function (params) {
var query = { query: params.term }
url: HTML_PATH_ADMIN_ROOT + "ajax/get-published",
data: function(params) {
var query = {
query: params.term
}
return query;
},
processResults: function (data) {
processResults: function(data) {
return data;
}
},
@ -143,31 +145,31 @@
}
});
});
</script>
</script>
<?php
// Page not found 404
try {
$options = array();
$pageNotFoundKey = $site->pageNotFound();
if (!empty($pageNotFoundKey)) {
$pageNotFound = new Page($pageNotFoundKey);
$options = array($pageNotFoundKey=>$pageNotFound->title());
}
} catch (Exception $e) {
// continue
// Page not found 404
try {
$options = array();
$pageNotFoundKey = $site->pageNotFound();
if (!empty($pageNotFoundKey)) {
$pageNotFound = new Page($pageNotFoundKey);
$options = array($pageNotFoundKey => $pageNotFound->title());
}
echo Bootstrap::formSelect(array(
'name'=>'pageNotFound',
'label'=>$L->g('Page not found'),
'options'=>$options,
'selected'=>false,
'class'=>'',
'tip'=>$L->g('Returning page when the page doesnt exist')
));
} catch (Exception $e) {
// continue
}
echo Bootstrap::formSelect(array(
'name' => 'pageNotFound',
'label' => $L->g('Page not found'),
'options' => $options,
'selected' => false,
'class' => '',
'tip' => $L->g('Returning page when the page doesnt exist')
));
?>
<script>
<script>
$(document).ready(function() {
var homepage = $("#jspageNotFound").select2({
placeholder: "<?php $L->p('Start typing to see a list of suggestions.') ?>",
@ -175,12 +177,14 @@
theme: "bootstrap4",
minimumInputLength: 2,
ajax: {
url: HTML_PATH_ADMIN_ROOT+"ajax/get-published",
data: function (params) {
var query = { query: params.term }
url: HTML_PATH_ADMIN_ROOT + "ajax/get-published",
data: function(params) {
var query = {
query: params.term
}
return query;
},
processResults: function (data) {
processResults: function(data) {
return data;
}
},
@ -189,377 +193,377 @@
}
});
});
</script>
</script>
<?php
echo Bootstrap::formTitle(array('title'=>$L->g('Email account settings')));
echo Bootstrap::formTitle(array('title' => $L->g('Email account settings')));
echo Bootstrap::formInputText(array(
'name'=>'emailFrom',
'label'=>$L->g('Sender email'),
'value'=>$site->emailFrom(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Emails will be sent from this address')
));
echo Bootstrap::formInputText(array(
'name' => 'emailFrom',
'label' => $L->g('Sender email'),
'value' => $site->emailFrom(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Emails will be sent from this address')
));
echo Bootstrap::formTitle(array('title'=>$L->g('Autosave')));
echo Bootstrap::formTitle(array('title' => $L->g('Autosave')));
echo Bootstrap::formInputText(array(
'name'=>'autosaveInterval',
'label'=>$L->g('Interval'),
'value'=>$site->autosaveInterval(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Number in minutes for every execution of autosave')
));
echo Bootstrap::formInputText(array(
'name' => 'autosaveInterval',
'label' => $L->g('Interval'),
'value' => $site->autosaveInterval(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Number in minutes for every execution of autosave')
));
echo Bootstrap::formTitle(array('title'=>$L->g('Site URL')));
echo Bootstrap::formTitle(array('title' => $L->g('Site URL')));
echo Bootstrap::formInputText(array(
'name'=>'url',
'label'=>'URL',
'value'=>$site->url(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('full-url-of-your-site'),
'placeholder'=>'https://'
));
echo Bootstrap::formInputText(array(
'name' => 'url',
'label' => 'URL',
'value' => $site->url(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('full-url-of-your-site'),
'placeholder' => 'https://'
));
echo Bootstrap::formTitle(array('title'=>$L->g('Page content')));
echo Bootstrap::formTitle(array('title' => $L->g('Page content')));
echo Bootstrap::formSelect(array(
'name'=>'markdownParser',
'label'=>$L->g('Markdown parser'),
'options'=>array('true'=>$L->g('Enabled'), 'false'=>$L->g('Disabled')),
'selected'=>($site->markdownParser()?'true':'false'),
'class'=>'',
'tip'=>$L->g('Enable the markdown parser for the content of the page.')
));
echo Bootstrap::formSelect(array(
'name' => 'markdownParser',
'label' => $L->g('Markdown parser'),
'options' => array('true' => $L->g('Enabled'), 'false' => $L->g('Disabled')),
'selected' => ($site->markdownParser() ? 'true' : 'false'),
'class' => '',
'tip' => $L->g('Enable the markdown parser for the content of the page.')
));
echo Bootstrap::formTitle(array('title'=>$L->g('URL Filters')));
echo Bootstrap::formTitle(array('title' => $L->g('URL Filters')));
echo Bootstrap::formInputText(array(
'name'=>'uriPage',
'label'=>$L->g('Pages'),
'value'=>$site->uriFilters('page'),
'class'=>'',
'placeholder'=>'',
'tip'=>DOMAIN_PAGES
));
echo Bootstrap::formInputText(array(
'name' => 'uriPage',
'label' => $L->g('Pages'),
'value' => $site->uriFilters('page'),
'class' => '',
'placeholder' => '',
'tip' => DOMAIN_PAGES
));
echo Bootstrap::formInputText(array(
'name'=>'uriTag',
'label'=>$L->g('Tags'),
'value'=>$site->uriFilters('tag'),
'class'=>'',
'placeholder'=>'',
'tip'=>DOMAIN_TAGS
));
echo Bootstrap::formInputText(array(
'name' => 'uriTag',
'label' => $L->g('Tags'),
'value' => $site->uriFilters('tag'),
'class' => '',
'placeholder' => '',
'tip' => DOMAIN_TAGS
));
echo Bootstrap::formInputText(array(
'name'=>'uriCategory',
'label'=>$L->g('Category'),
'value'=>$site->uriFilters('category'),
'class'=>'',
'placeholder'=>'',
'tip'=>DOMAIN_CATEGORIES
));
echo Bootstrap::formInputText(array(
'name' => 'uriCategory',
'label' => $L->g('Category'),
'value' => $site->uriFilters('category'),
'class' => '',
'placeholder' => '',
'tip' => DOMAIN_CATEGORIES
));
echo Bootstrap::formInputText(array(
'name'=>'uriBlog',
'label'=>$L->g('Blog'),
'value'=>$site->uriFilters('blog'),
'class'=>'',
'placeholder'=>'',
'tip'=>DOMAIN.$site->uriFilters('blog'),
'disabled'=>Text::isEmpty($site->uriFilters('blog'))
));
echo Bootstrap::formInputText(array(
'name' => 'uriBlog',
'label' => $L->g('Blog'),
'value' => $site->uriFilters('blog'),
'class' => '',
'placeholder' => '',
'tip' => DOMAIN . $site->uriFilters('blog'),
'disabled' => Text::isEmpty($site->uriFilters('blog'))
));
?>
</div>
</div>
<!-- SEO tab -->
<div class="tab-pane fade" id="seo" role="tabpanel" aria-labelledby="seo-tab">
<!-- SEO tab -->
<div class="tab-pane fade" id="seo" role="tabpanel" aria-labelledby="seo-tab">
<?php
echo Bootstrap::formTitle(array('title'=>$L->g('Extreme friendly URL')));
echo Bootstrap::formTitle(array('title' => $L->g('Extreme friendly URL')));
echo Bootstrap::formSelect(array(
'name'=>'extremeFriendly',
'label'=>$L->g('Allow Unicode'),
'options'=>array('true'=>$L->g('Enabled'), 'false'=>$L->g('Disabled')),
'selected'=>($site->extremeFriendly()?'true':'false'),
'class'=>'',
'tip'=>$L->g('Allow unicode characters in the URL and some part of the system.')
));
echo Bootstrap::formSelect(array(
'name' => 'extremeFriendly',
'label' => $L->g('Allow Unicode'),
'options' => array('true' => $L->g('Enabled'), 'false' => $L->g('Disabled')),
'selected' => ($site->extremeFriendly() ? 'true' : 'false'),
'class' => '',
'tip' => $L->g('Allow unicode characters in the URL and some part of the system.')
));
echo Bootstrap::formTitle(array('title'=>$L->g('Title formats')));
echo Bootstrap::formTitle(array('title' => $L->g('Title formats')));
echo Bootstrap::formInputText(array(
'name'=>'titleFormatHomepage',
'label'=>$L->g('Homepage'),
'value'=>$site->titleFormatHomepage(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Variables allowed').' <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
'placeholder'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'titleFormatHomepage',
'label' => $L->g('Homepage'),
'value' => $site->titleFormatHomepage(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Variables allowed') . ' <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
'placeholder' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'titleFormatPages',
'label'=>$L->g('Pages'),
'value'=>$site->titleFormatPages(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Variables allowed').' <code>{{page-title}}</code> <code>{{page-description}}</code> <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
'placeholder'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'titleFormatPages',
'label' => $L->g('Pages'),
'value' => $site->titleFormatPages(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Variables allowed') . ' <code>{{page-title}}</code> <code>{{page-description}}</code> <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
'placeholder' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'titleFormatCategory',
'label'=>$L->g('Category'),
'value'=>$site->titleFormatCategory(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Variables allowed').' <code>{{category-name}}</code> <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
'placeholder'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'titleFormatCategory',
'label' => $L->g('Category'),
'value' => $site->titleFormatCategory(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Variables allowed') . ' <code>{{category-name}}</code> <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
'placeholder' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'titleFormatTag',
'label'=>$L->g('Tag'),
'value'=>$site->titleFormatTag(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Variables allowed').' <code>{{tag-name}}</code> <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
'placeholder'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'titleFormatTag',
'label' => $L->g('Tag'),
'value' => $site->titleFormatTag(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Variables allowed') . ' <code>{{tag-name}}</code> <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
'placeholder' => ''
));
?>
</div>
</div>
<!-- Social Network tab -->
<div class="tab-pane fade" id="social" role="tabpanel" aria-labelledby="social-tab">
<!-- Social Network tab -->
<div class="tab-pane fade" id="social" role="tabpanel" aria-labelledby="social-tab">
<?php
echo Bootstrap::formInputText(array(
'name'=>'twitter',
'label'=>'Twitter',
'value'=>$site->twitter(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'twitter',
'label' => 'Twitter',
'value' => $site->twitter(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'facebook',
'label'=>'Facebook',
'value'=>$site->facebook(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'facebook',
'label' => 'Facebook',
'value' => $site->facebook(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'codepen',
'label'=>'CodePen',
'value'=>$site->codepen(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'codepen',
'label' => 'CodePen',
'value' => $site->codepen(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'instagram',
'label'=>'Instagram',
'value'=>$site->instagram(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'instagram',
'label' => 'Instagram',
'value' => $site->instagram(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'gitlab',
'label'=>'GitLab',
'value'=>$site->gitlab(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'gitlab',
'label' => 'GitLab',
'value' => $site->gitlab(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'github',
'label'=>'GitHub',
'value'=>$site->github(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'github',
'label' => 'GitHub',
'value' => $site->github(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'linkedin',
'label'=>'LinkedIn',
'value'=>$site->linkedin(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'linkedin',
'label' => 'LinkedIn',
'value' => $site->linkedin(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'xing',
'label'=>'Xing',
'value'=>$site->xing(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'xing',
'label' => 'Xing',
'value' => $site->xing(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'mastodon',
'label'=>'Mastodon',
'value'=>$site->mastodon(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'mastodon',
'label' => 'Mastodon',
'value' => $site->mastodon(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'dribbble',
'label'=>'Dribbble',
'value'=>$site->dribbble(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'dribbble',
'label' => 'Dribbble',
'value' => $site->dribbble(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
echo Bootstrap::formInputText(array(
'name'=>'vk',
'label'=>'VK',
'value'=>$site->vk(),
'class'=>'',
'placeholder'=>'',
'tip'=>''
));
echo Bootstrap::formInputText(array(
'name' => 'vk',
'label' => 'VK',
'value' => $site->vk(),
'class' => '',
'placeholder' => '',
'tip' => ''
));
?>
</div>
</div>
<!-- Images tab -->
<div class="tab-pane fade" id="images" role="tabpanel" aria-labelledby="images-tab">
<!-- Images tab -->
<div class="tab-pane fade" id="images" role="tabpanel" aria-labelledby="images-tab">
<?php
echo Bootstrap::formTitle(array('title'=>$L->g('Thumbnails')));
echo Bootstrap::formTitle(array('title' => $L->g('Thumbnails')));
echo Bootstrap::formInputText(array(
'name'=>'thumbnailWidth',
'label'=>$L->g('Width'),
'value'=>$site->thumbnailWidth(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Thumbnail width in pixels')
));
echo Bootstrap::formInputText(array(
'name' => 'thumbnailWidth',
'label' => $L->g('Width'),
'value' => $site->thumbnailWidth(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Thumbnail width in pixels')
));
echo Bootstrap::formInputText(array(
'name'=>'thumbnailHeight',
'label'=>$L->g('Height'),
'value'=>$site->thumbnailHeight(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Thumbnail height in pixels')
));
echo Bootstrap::formInputText(array(
'name' => 'thumbnailHeight',
'label' => $L->g('Height'),
'value' => $site->thumbnailHeight(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Thumbnail height in pixels')
));
echo Bootstrap::formInputText(array(
'name'=>'thumbnailQuality',
'label'=>$L->g('Quality'),
'value'=>$site->thumbnailQuality(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Thumbnail quality in percentage')
));
echo Bootstrap::formInputText(array(
'name' => 'thumbnailQuality',
'label' => $L->g('Quality'),
'value' => $site->thumbnailQuality(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Thumbnail quality in percentage')
));
?>
</div>
</div>
<!-- Timezone and language tab -->
<div class="tab-pane fade" id="language" role="tabpanel" aria-labelledby="language-tab">
<!-- Timezone and language tab -->
<div class="tab-pane fade" id="language" role="tabpanel" aria-labelledby="language-tab">
<?php
echo Bootstrap::formTitle(array('title'=>$L->g('Language and timezone')));
echo Bootstrap::formTitle(array('title' => $L->g('Language and timezone')));
echo Bootstrap::formSelect(array(
'name'=>'language',
'label'=>$L->g('Language'),
'options'=>$L->getLanguageList(),
'selected'=>$site->language(),
'class'=>'',
'tip'=>$L->g('select-your-sites-language')
));
echo Bootstrap::formSelect(array(
'name' => 'language',
'label' => $L->g('Language'),
'options' => $L->getLanguageList(),
'selected' => $site->language(),
'class' => '',
'tip' => $L->g('select-your-sites-language')
));
echo Bootstrap::formSelect(array(
'name'=>'timezone',
'label'=>$L->g('Timezone'),
'options'=>Date::timezoneList(),
'selected'=>$site->timezone(),
'class'=>'',
'tip'=>$L->g('select-a-timezone-for-a-correct')
));
echo Bootstrap::formSelect(array(
'name' => 'timezone',
'label' => $L->g('Timezone'),
'options' => Date::timezoneList(),
'selected' => $site->timezone(),
'class' => '',
'tip' => $L->g('select-a-timezone-for-a-correct')
));
echo Bootstrap::formInputText(array(
'name'=>'locale',
'label'=>$L->g('Locale'),
'value'=>$site->locale(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('with-the-locales-you-can-set-the-regional-user-interface')
));
echo Bootstrap::formInputText(array(
'name' => 'locale',
'label' => $L->g('Locale'),
'value' => $site->locale(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('with-the-locales-you-can-set-the-regional-user-interface')
));
echo Bootstrap::formTitle(array('title'=>$L->g('Date and time formats')));
echo Bootstrap::formTitle(array('title' => $L->g('Date and time formats')));
echo Bootstrap::formInputText(array(
'name'=>'dateFormat',
'label'=>$L->g('Date format'),
'value'=>$site->dateFormat(),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('Current format').': '.Date::current($site->dateFormat())
));
echo Bootstrap::formInputText(array(
'name' => 'dateFormat',
'label' => $L->g('Date format'),
'value' => $site->dateFormat(),
'class' => '',
'placeholder' => '',
'tip' => $L->g('Current format') . ': ' . Date::current($site->dateFormat())
));
?>
</div>
</div>
<!-- Custom fields -->
<div class="tab-pane fade" id="custom-fields" role="tabpanel" aria-labelledby="custom-fields-tab">
<!-- Custom fields -->
<div class="tab-pane fade" id="custom-fields" role="tabpanel" aria-labelledby="custom-fields-tab">
<?php
echo Bootstrap::formTitle(array('title'=>$L->g('Custom fields')));
echo Bootstrap::formTitle(array('title' => $L->g('Custom fields')));
echo Bootstrap::formTextarea(array(
'name'=>'customFields',
'label'=>'JSON Format',
'value'=>json_encode($site->customFields(), JSON_PRETTY_PRINT),
'class'=>'',
'placeholder'=>'',
'tip'=>$L->g('define-custom-fields-for-the-content'),
'rows'=>15
));
echo Bootstrap::formTextarea(array(
'name' => 'customFields',
'label' => 'JSON Format',
'value' => json_encode($site->customFields(), JSON_PRETTY_PRINT),
'class' => '',
'placeholder' => '',
'tip' => $L->g('define-custom-fields-for-the-content'),
'rows' => 15
));
?>
</div>
</div>
<!-- Site logo tab -->
<div class="tab-pane fade" id="logo" role="tabpanel" aria-labelledby="logo-tab">
<!-- Site logo tab -->
<div class="tab-pane fade" id="logo" role="tabpanel" aria-labelledby="logo-tab">
<?php
echo Bootstrap::formTitle(array('title'=>$L->g('Site logo')));
echo Bootstrap::formTitle(array('title' => $L->g('Site logo')));
?>
<div class="container">
<div class="row">
<div class="col-lg-4 col-sm-12 p-0 pr-2">
<div class="custom-file">
<input id="jssiteLogoInputFile" class="custom-file-input" type="file" name="inputFile">
<label for="jssiteLogoInputFile" class="custom-file-label"><?php $L->p('Upload image'); ?></label>
</div>
<button id="jsbuttonRemoveLogo" type="button" class="btn btn-primary w-100 mt-4 mb-4"><i class="fa fa-trash"></i><?php $L->p('Remove logo') ?></button>
</div>
<div class="col-lg-8 col-sm-12 p-0 text-center">
<img id="jssiteLogoPreview" class="img-fluid img-thumbnail" alt="Site logo preview" src="<?php echo ($site->logo()?DOMAIN_UPLOADS.$site->logo(false).'?version='.time():HTML_PATH_CORE_IMG.'default.svg') ?>" />
<div class="container">
<div class="row">
<div class="col-lg-4 col-sm-12 p-0 pr-2">
<div class="custom-file">
<input id="jssiteLogoInputFile" class="custom-file-input" type="file" name="inputFile">
<label for="jssiteLogoInputFile" class="custom-file-label"><?php $L->p('Upload image'); ?></label>
</div>
<button id="jsbuttonRemoveLogo" type="button" class="btn btn-primary w-100 mt-4 mb-4"><i class="fa fa-trash"></i><?php $L->p('Remove logo') ?></button>
</div>
<div class="col-lg-8 col-sm-12 p-0 text-center">
<img id="jssiteLogoPreview" class="img-fluid img-thumbnail" alt="Site logo preview" src="<?php echo ($site->logo() ? DOMAIN_UPLOADS . $site->logo(false) . '?version=' . time() : HTML_PATH_CORE_IMG . 'default.svg') ?>" />
</div>
</div>
<script>
</div>
<script>
$("#jsbuttonRemoveLogo").on("click", function() {
bluditAjax.removeLogo();
$("#jssiteLogoPreview").attr("src", "<?php echo HTML_PATH_CORE_IMG.'default.svg' ?>");
$("#jssiteLogoPreview").attr("src", "<?php echo HTML_PATH_CORE_IMG . 'default.svg' ?>");
});
$("#jssiteLogoInputFile").on("change", function() {
@ -567,22 +571,22 @@
formData.append('tokenCSRF', tokenCSRF);
formData.append('inputFile', $(this)[0].files[0]);
$.ajax({
url: HTML_PATH_ADMIN_ROOT+"ajax/logo-upload",
url: HTML_PATH_ADMIN_ROOT + "ajax/logo-upload",
type: "POST",
data: formData,
cache: false,
contentType: false,
processData: false
}).done(function(data) {
if (data.status==0) {
$("#jssiteLogoPreview").attr('src',data.absoluteURL+"?time="+Math.random());
if (data.status == 0) {
$("#jssiteLogoPreview").attr('src', data.absoluteURL + "?time=" + Math.random());
} else {
showAlert(data.message);
}
});
});
</script>
</div>
</script>
</div>
<?php echo Bootstrap::formClose(); ?>

View file

@ -1,53 +1,57 @@
<?php
echo Bootstrap::pageTitle(array('title'=>$L->g('Themes'), 'icon'=>'desktop'));
echo Bootstrap::pageTitle(array('title' => $L->g('Themes'), 'icon' => 'desktop'));
echo '
<table class="table mt-3">
<thead>
<tr>
<th class="border-bottom-0 w-25" scope="col">'.$L->g('Name').'</th>
<th class="border-bottom-0 d-none d-sm-table-cell" scope="col">'.$L->g('Description').'</th>
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">'.$L->g('Version').'</th>
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">'.$L->g('Author').'</th>
<th class="border-bottom-0 w-25" scope="col">' . $L->g('Name') . '</th>
<th class="border-bottom-0 d-none d-sm-table-cell" scope="col">' . $L->g('Description') . '</th>
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">' . $L->g('Version') . '</th>
<th class="text-center border-bottom-0 d-none d-lg-table-cell" scope="col">' . $L->g('Author') . '</th>
</tr>
</thead>
<tbody>
';
foreach ($themes as $theme) {
echo '
<tr '.($theme['dirname']==$site->theme()?'class="bg-light"':'').'>
echo '
<tr ' . ($theme['dirname'] == $site->theme() ? 'class="bg-light"' : '') . '>
<td class="align-middle pt-3 pb-3">
<div>'.$theme['name'].'</div>
<div>'.$theme['name'].($theme['dirname']==$site->theme()?'<span class="badge badge-primary ml-2">'.$L->g('Active').'</span>':'').'</div>
<div class="mt-1">
';
if ($theme['dirname']!=$site->theme()) {
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'install-theme/'.$theme['dirname'].'">'.$L->g('Activate').'</a>';
}
if ($theme['dirname'] != $site->theme()) {
echo '<a href="' . HTML_PATH_ADMIN_ROOT . 'install-theme/' . $theme['dirname'] . '">' . $L->g('Activate') . '</a>';
} else {
if (isset($theme['plugin'])) {
echo '<a href="' . HTML_PATH_ADMIN_ROOT . 'configure-plugin/' . $theme['plugin'] . '">' . $L->g('Settings') . '</a>';
}
}
echo '
echo '
</div>
</td>
';
echo '<td class="align-middle d-none d-sm-table-cell">';
echo $theme['description'];
echo '</td>';
echo '<td class="align-middle d-none d-sm-table-cell">';
echo $theme['description'];
echo '</td>';
echo '<td class="text-center align-middle d-none d-lg-table-cell">';
echo '<span>'.$theme['version'].'</span>';
echo '</td>';
echo '<td class="text-center align-middle d-none d-lg-table-cell">';
echo '<span>' . $theme['version'] . '</span>';
echo '</td>';
echo '<td class="text-center align-middle d-none d-lg-table-cell">
<a target="_blank" href="'.$theme['website'].'">'.$theme['author'].'</a>
echo '<td class="text-center align-middle d-none d-lg-table-cell">
<a target="_blank" href="' . $theme['website'] . '">' . $theme['author'] . '</a>
</td>';
echo '</tr>';
echo '</tr>';
}
echo '
</tbody>
</table>
';
';

View file

@ -1,9 +1,9 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// Bludit version
define('BLUDIT_VERSION', '3.14.1');
define('BLUDIT_VERSION', '3.15.0');
define('BLUDIT_CODENAME', 'Out Of Time');
define('BLUDIT_RELEASE_DATE', '2022-08-07');
define('BLUDIT_RELEASE_DATE', '2023-07-15');
define('BLUDIT_BUILD', '20220807');
// Change to TRUE for debugging
@ -15,7 +15,7 @@ ini_set("display_errors", 0);
// Even when display_errors is on, errors that occur during PHP's startup sequence are not displayed.
// It's strongly recommended to keep display_startup_errors off, except for debugging.
ini_set('display_startup_errors',0);
ini_set('display_startup_errors', 0);
// If disabled, error message will be solely plain text instead HTML code.
ini_set("html_errors", 0);
@ -31,47 +31,47 @@ if (DEBUG_MODE) {
// PHP paths
// PATH_ROOT and PATH_BOOT are defined in index.php
define('PATH_LANGUAGES', PATH_ROOT.'bl-languages'.DS);
define('PATH_THEMES', PATH_ROOT.'bl-themes'.DS);
define('PATH_PLUGINS', PATH_ROOT.'bl-plugins'.DS);
define('PATH_KERNEL', PATH_ROOT.'bl-kernel'.DS);
define('PATH_CONTENT', PATH_ROOT.'bl-content'.DS);
define('PATH_LANGUAGES', PATH_ROOT . 'bl-languages' . DS);
define('PATH_THEMES', PATH_ROOT . 'bl-themes' . DS);
define('PATH_PLUGINS', PATH_ROOT . 'bl-plugins' . DS);
define('PATH_KERNEL', PATH_ROOT . 'bl-kernel' . DS);
define('PATH_CONTENT', PATH_ROOT . 'bl-content' . DS);
define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
define('PATH_RULES', PATH_KERNEL.'boot'.DS.'rules'.DS);
define('PATH_HELPERS', PATH_KERNEL.'helpers'.DS);
define('PATH_AJAX', PATH_KERNEL.'ajax'.DS);
define('PATH_CORE_JS', PATH_KERNEL.'js'.DS);
define('PATH_ABSTRACT', PATH_KERNEL . 'abstract' . DS);
define('PATH_RULES', PATH_KERNEL . 'boot' . DS . 'rules' . DS);
define('PATH_HELPERS', PATH_KERNEL . 'helpers' . DS);
define('PATH_AJAX', PATH_KERNEL . 'ajax' . DS);
define('PATH_CORE_JS', PATH_KERNEL . 'js' . DS);
define('PATH_PAGES', PATH_CONTENT.'pages'.DS);
define('PATH_DATABASES', PATH_CONTENT.'databases'.DS);
define('PATH_PLUGINS_DATABASES', PATH_CONTENT.'databases'.DS.'plugins'.DS);
define('PATH_TMP', PATH_CONTENT.'tmp'.DS);
define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS);
define('PATH_WORKSPACES', PATH_CONTENT.'workspaces'.DS);
define('PATH_PAGES', PATH_CONTENT . 'pages' . DS);
define('PATH_DATABASES', PATH_CONTENT . 'databases' . DS);
define('PATH_PLUGINS_DATABASES', PATH_CONTENT . 'databases' . DS . 'plugins' . DS);
define('PATH_TMP', PATH_CONTENT . 'tmp' . DS);
define('PATH_UPLOADS', PATH_CONTENT . 'uploads' . DS);
define('PATH_WORKSPACES', PATH_CONTENT . 'workspaces' . DS);
define('PATH_UPLOADS_PAGES', PATH_UPLOADS.'pages'.DS);
define('PATH_UPLOADS_PROFILES', PATH_UPLOADS.'profiles'.DS);
define('PATH_UPLOADS_THUMBNAILS', PATH_UPLOADS.'thumbnails'.DS);
define('PATH_UPLOADS_PAGES', PATH_UPLOADS . 'pages' . DS);
define('PATH_UPLOADS_PROFILES', PATH_UPLOADS . 'profiles' . DS);
define('PATH_UPLOADS_THUMBNAILS', PATH_UPLOADS . 'thumbnails' . DS);
define('PATH_ADMIN', PATH_KERNEL.'admin'.DS);
define('PATH_ADMIN_THEMES', PATH_ADMIN.'themes'.DS);
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN.'controllers'.DS);
define('PATH_ADMIN_VIEWS', PATH_ADMIN.'views'.DS);
define('PATH_ADMIN', PATH_KERNEL . 'admin' . DS);
define('PATH_ADMIN_THEMES', PATH_ADMIN . 'themes' . DS);
define('PATH_ADMIN_CONTROLLERS', PATH_ADMIN . 'controllers' . DS);
define('PATH_ADMIN_VIEWS', PATH_ADMIN . 'views' . DS);
define('DEBUG_FILE', PATH_CONTENT.'debug.txt');
define('DEBUG_FILE', PATH_CONTENT . 'debug.txt');
// PAGES DATABASE
define('DB_PAGES', PATH_DATABASES.'pages.php');
define('DB_SITE', PATH_DATABASES.'site.php');
define('DB_CATEGORIES', PATH_DATABASES.'categories.php');
define('DB_TAGS', PATH_DATABASES.'tags.php');
define('DB_SYSLOG', PATH_DATABASES.'syslog.php');
define('DB_USERS', PATH_DATABASES.'users.php');
define('DB_SECURITY', PATH_DATABASES.'security.php');
define('DB_PAGES', PATH_DATABASES . 'pages.php');
define('DB_SITE', PATH_DATABASES . 'site.php');
define('DB_CATEGORIES', PATH_DATABASES . 'categories.php');
define('DB_TAGS', PATH_DATABASES . 'tags.php');
define('DB_SYSLOG', PATH_DATABASES . 'syslog.php');
define('DB_USERS', PATH_DATABASES . 'users.php');
define('DB_SECURITY', PATH_DATABASES . 'security.php');
// User environment variables
include(PATH_KERNEL.'boot'.DS.'variables.php');
include(PATH_KERNEL . 'boot' . DS . 'variables.php');
// Set internal character encoding
mb_internal_encoding(CHARSET);
@ -80,50 +80,50 @@ mb_internal_encoding(CHARSET);
mb_http_output(CHARSET);
// Inclde Abstract Classes
include(PATH_ABSTRACT.'dbjson.class.php');
include(PATH_ABSTRACT.'dblist.class.php');
include(PATH_ABSTRACT.'plugin.class.php');
include(PATH_ABSTRACT . 'dbjson.class.php');
include(PATH_ABSTRACT . 'dblist.class.php');
include(PATH_ABSTRACT . 'plugin.class.php');
// Inclde Classes
include(PATH_KERNEL.'pages.class.php');
include(PATH_KERNEL.'users.class.php');
include(PATH_KERNEL.'tags.class.php');
include(PATH_KERNEL.'language.class.php');
include(PATH_KERNEL.'site.class.php');
include(PATH_KERNEL.'categories.class.php');
include(PATH_KERNEL.'syslog.class.php');
include(PATH_KERNEL.'pagex.class.php');
include(PATH_KERNEL.'category.class.php');
include(PATH_KERNEL.'tag.class.php');
include(PATH_KERNEL.'user.class.php');
include(PATH_KERNEL.'url.class.php');
include(PATH_KERNEL.'login.class.php');
include(PATH_KERNEL.'parsedown.class.php');
include(PATH_KERNEL.'security.class.php');
include(PATH_KERNEL . 'pages.class.php');
include(PATH_KERNEL . 'users.class.php');
include(PATH_KERNEL . 'tags.class.php');
include(PATH_KERNEL . 'language.class.php');
include(PATH_KERNEL . 'site.class.php');
include(PATH_KERNEL . 'categories.class.php');
include(PATH_KERNEL . 'syslog.class.php');
include(PATH_KERNEL . 'pagex.class.php');
include(PATH_KERNEL . 'category.class.php');
include(PATH_KERNEL . 'tag.class.php');
include(PATH_KERNEL . 'user.class.php');
include(PATH_KERNEL . 'url.class.php');
include(PATH_KERNEL . 'login.class.php');
include(PATH_KERNEL . 'parsedown.class.php');
include(PATH_KERNEL . 'security.class.php');
// Include functions
include(PATH_KERNEL.'functions.php');
include(PATH_KERNEL . 'functions.php');
// Include Helpers Classes
include(PATH_HELPERS.'text.class.php');
include(PATH_HELPERS.'log.class.php');
include(PATH_HELPERS.'date.class.php');
include(PATH_HELPERS.'theme.class.php');
include(PATH_HELPERS.'session.class.php');
include(PATH_HELPERS.'redirect.class.php');
include(PATH_HELPERS.'sanitize.class.php');
include(PATH_HELPERS.'valid.class.php');
include(PATH_HELPERS.'email.class.php');
include(PATH_HELPERS.'filesystem.class.php');
include(PATH_HELPERS.'alert.class.php');
include(PATH_HELPERS.'paginator.class.php');
include(PATH_HELPERS.'image.class.php');
include(PATH_HELPERS.'tcp.class.php');
include(PATH_HELPERS.'dom.class.php');
include(PATH_HELPERS.'cookie.class.php');
include(PATH_HELPERS . 'text.class.php');
include(PATH_HELPERS . 'log.class.php');
include(PATH_HELPERS . 'date.class.php');
include(PATH_HELPERS . 'theme.class.php');
include(PATH_HELPERS . 'session.class.php');
include(PATH_HELPERS . 'redirect.class.php');
include(PATH_HELPERS . 'sanitize.class.php');
include(PATH_HELPERS . 'valid.class.php');
include(PATH_HELPERS . 'email.class.php');
include(PATH_HELPERS . 'filesystem.class.php');
include(PATH_HELPERS . 'alert.class.php');
include(PATH_HELPERS . 'paginator.class.php');
include(PATH_HELPERS . 'image.class.php');
include(PATH_HELPERS . 'tcp.class.php');
include(PATH_HELPERS . 'dom.class.php');
include(PATH_HELPERS . 'cookie.class.php');
if (file_exists(PATH_KERNEL.'bludit.pro.php')) {
include(PATH_KERNEL.'bludit.pro.php');
if (file_exists(PATH_KERNEL . 'bludit.pro.php')) {
include(PATH_KERNEL . 'bludit.pro.php');
}
// Objects
@ -148,43 +148,43 @@ if (!empty($_SERVER['DOCUMENT_ROOT']) && !empty($_SERVER['SCRIPT_NAME']) && empt
$base = str_replace($_SERVER['DOCUMENT_ROOT'], '', $_SERVER['SCRIPT_NAME']);
$base = dirname($base);
} elseif (empty($base)) {
$base = empty( $_SERVER['SCRIPT_NAME'] ) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$base = empty($_SERVER['SCRIPT_NAME']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$base = dirname($base);
}
if (strpos($_SERVER['REQUEST_URI'], $base)!==0) {
if (strpos($_SERVER['REQUEST_URI'], $base) !== 0) {
$base = '/';
} elseif ($base!=DS) {
} elseif ($base != DS) {
$base = trim($base, '/');
$base = '/'.$base.'/';
$base = '/' . $base . '/';
} else {
// Workaround for Windows Web Servers
$base = '/';
}
define('HTML_PATH_ROOT', $base);
define('HTML_PATH_THEMES', HTML_PATH_ROOT.'bl-themes/');
define('HTML_PATH_THEME', HTML_PATH_THEMES.$site->theme().'/');
define('HTML_PATH_THEME_CSS', HTML_PATH_THEME.'css/');
define('HTML_PATH_THEME_JS', HTML_PATH_THEME.'js/');
define('HTML_PATH_THEME_IMG', HTML_PATH_THEME.'img/');
define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT.ADMIN_URI_FILTER.'/');
define('HTML_PATH_ADMIN_THEME', HTML_PATH_ROOT.'bl-kernel/admin/themes/'.$site->adminTheme().'/');
define('HTML_PATH_ADMIN_THEME_JS', HTML_PATH_ADMIN_THEME.'js/');
define('HTML_PATH_ADMIN_THEME_CSS', HTML_PATH_ADMIN_THEME.'css/');
define('HTML_PATH_CORE_JS', HTML_PATH_ROOT.'bl-kernel/js/');
define('HTML_PATH_CORE_CSS', HTML_PATH_ROOT.'bl-kernel/css/');
define('HTML_PATH_CORE_IMG', HTML_PATH_ROOT.'bl-kernel/img/');
define('HTML_PATH_CONTENT', HTML_PATH_ROOT.'bl-content/');
define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'bl-content/uploads/');
define('HTML_PATH_UPLOADS_PAGES', HTML_PATH_UPLOADS.'pages/');
define('HTML_PATH_UPLOADS_PROFILES', HTML_PATH_UPLOADS.'profiles/');
define('HTML_PATH_UPLOADS_THUMBNAILS', HTML_PATH_UPLOADS.'thumbnails/');
define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'bl-plugins/');
define('HTML_PATH_THEMES', HTML_PATH_ROOT . 'bl-themes/');
define('HTML_PATH_THEME', HTML_PATH_THEMES . $site->theme() . '/');
define('HTML_PATH_THEME_CSS', HTML_PATH_THEME . 'css/');
define('HTML_PATH_THEME_JS', HTML_PATH_THEME . 'js/');
define('HTML_PATH_THEME_IMG', HTML_PATH_THEME . 'img/');
define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT . ADMIN_URI_FILTER . '/');
define('HTML_PATH_ADMIN_THEME', HTML_PATH_ROOT . 'bl-kernel/admin/themes/' . $site->adminTheme() . '/');
define('HTML_PATH_ADMIN_THEME_JS', HTML_PATH_ADMIN_THEME . 'js/');
define('HTML_PATH_ADMIN_THEME_CSS', HTML_PATH_ADMIN_THEME . 'css/');
define('HTML_PATH_CORE_JS', HTML_PATH_ROOT . 'bl-kernel/js/');
define('HTML_PATH_CORE_CSS', HTML_PATH_ROOT . 'bl-kernel/css/');
define('HTML_PATH_CORE_IMG', HTML_PATH_ROOT . 'bl-kernel/img/');
define('HTML_PATH_CONTENT', HTML_PATH_ROOT . 'bl-content/');
define('HTML_PATH_UPLOADS', HTML_PATH_ROOT . 'bl-content/uploads/');
define('HTML_PATH_UPLOADS_PAGES', HTML_PATH_UPLOADS . 'pages/');
define('HTML_PATH_UPLOADS_PROFILES', HTML_PATH_UPLOADS . 'profiles/');
define('HTML_PATH_UPLOADS_THUMBNAILS', HTML_PATH_UPLOADS . 'thumbnails/');
define('HTML_PATH_PLUGINS', HTML_PATH_ROOT . 'bl-plugins/');
// --- Objects with dependency ---
$language = new Language( $site->language() );
$url->checkFilters( $site->uriFilters() );
$language = new Language($site->language());
$url->checkFilters($site->uriFilters());
// --- CONSTANTS with dependency ---
@ -217,38 +217,38 @@ define('MARKDOWN_PARSER', $site->markdownParser());
// --- PHP paths with dependency ---
// This paths are absolutes for the OS
define('THEME_DIR', PATH_ROOT.'bl-themes'.DS.$site->theme().DS);
define('THEME_DIR_PHP', THEME_DIR.'php'.DS);
define('THEME_DIR_CSS', THEME_DIR.'css'.DS);
define('THEME_DIR_JS', THEME_DIR.'js'.DS);
define('THEME_DIR_IMG', THEME_DIR.'img'.DS);
define('THEME_DIR_LANG', THEME_DIR.'languages'.DS);
define('THEME_DIR', PATH_ROOT . 'bl-themes' . DS . $site->theme() . DS);
define('THEME_DIR_PHP', THEME_DIR . 'php' . DS);
define('THEME_DIR_CSS', THEME_DIR . 'css' . DS);
define('THEME_DIR_JS', THEME_DIR . 'js' . DS);
define('THEME_DIR_IMG', THEME_DIR . 'img' . DS);
define('THEME_DIR_LANG', THEME_DIR . 'languages' . DS);
// --- Absolute paths with domain ---
// This paths are absolutes for the user / web browsing.
define('DOMAIN', $site->domain());
define('DOMAIN_BASE', DOMAIN.HTML_PATH_ROOT);
define('DOMAIN_CORE_JS', DOMAIN.HTML_PATH_CORE_JS);
define('DOMAIN_CORE_CSS', DOMAIN.HTML_PATH_CORE_CSS);
define('DOMAIN_THEME', DOMAIN.HTML_PATH_THEME);
define('DOMAIN_THEME_CSS', DOMAIN.HTML_PATH_THEME_CSS);
define('DOMAIN_THEME_JS', DOMAIN.HTML_PATH_THEME_JS);
define('DOMAIN_THEME_IMG', DOMAIN.HTML_PATH_THEME_IMG);
define('DOMAIN_ADMIN_THEME', DOMAIN.HTML_PATH_ADMIN_THEME);
define('DOMAIN_ADMIN_THEME_CSS', DOMAIN.HTML_PATH_ADMIN_THEME_CSS);
define('DOMAIN_ADMIN_THEME_JS', DOMAIN.HTML_PATH_ADMIN_THEME_JS);
define('DOMAIN_UPLOADS', DOMAIN.HTML_PATH_UPLOADS);
define('DOMAIN_UPLOADS_PAGES', DOMAIN.HTML_PATH_UPLOADS_PAGES);
define('DOMAIN_UPLOADS_PROFILES', DOMAIN.HTML_PATH_UPLOADS_PROFILES);
define('DOMAIN_UPLOADS_THUMBNAILS', DOMAIN.HTML_PATH_UPLOADS_THUMBNAILS);
define('DOMAIN_PLUGINS', DOMAIN.HTML_PATH_PLUGINS);
define('DOMAIN_CONTENT', DOMAIN.HTML_PATH_CONTENT);
define('DOMAIN_BASE', DOMAIN . HTML_PATH_ROOT);
define('DOMAIN_CORE_JS', DOMAIN . HTML_PATH_CORE_JS);
define('DOMAIN_CORE_CSS', DOMAIN . HTML_PATH_CORE_CSS);
define('DOMAIN_THEME', DOMAIN . HTML_PATH_THEME);
define('DOMAIN_THEME_CSS', DOMAIN . HTML_PATH_THEME_CSS);
define('DOMAIN_THEME_JS', DOMAIN . HTML_PATH_THEME_JS);
define('DOMAIN_THEME_IMG', DOMAIN . HTML_PATH_THEME_IMG);
define('DOMAIN_ADMIN_THEME', DOMAIN . HTML_PATH_ADMIN_THEME);
define('DOMAIN_ADMIN_THEME_CSS', DOMAIN . HTML_PATH_ADMIN_THEME_CSS);
define('DOMAIN_ADMIN_THEME_JS', DOMAIN . HTML_PATH_ADMIN_THEME_JS);
define('DOMAIN_UPLOADS', DOMAIN . HTML_PATH_UPLOADS);
define('DOMAIN_UPLOADS_PAGES', DOMAIN . HTML_PATH_UPLOADS_PAGES);
define('DOMAIN_UPLOADS_PROFILES', DOMAIN . HTML_PATH_UPLOADS_PROFILES);
define('DOMAIN_UPLOADS_THUMBNAILS', DOMAIN . HTML_PATH_UPLOADS_THUMBNAILS);
define('DOMAIN_PLUGINS', DOMAIN . HTML_PATH_PLUGINS);
define('DOMAIN_CONTENT', DOMAIN . HTML_PATH_CONTENT);
define('DOMAIN_ADMIN', DOMAIN_BASE.ADMIN_URI_FILTER.'/');
define('DOMAIN_ADMIN', DOMAIN_BASE . ADMIN_URI_FILTER . '/');
define('DOMAIN_TAGS', Text::addSlashes(DOMAIN_BASE.TAG_URI_FILTER, false, true));
define('DOMAIN_CATEGORIES', Text::addSlashes(DOMAIN_BASE.CATEGORY_URI_FILTER, false, true));
define('DOMAIN_PAGES', Text::addSlashes(DOMAIN_BASE.PAGE_URI_FILTER, false, true));
define('DOMAIN_TAGS', Text::addSlashes(DOMAIN_BASE . TAG_URI_FILTER, false, true));
define('DOMAIN_CATEGORIES', Text::addSlashes(DOMAIN_BASE . CATEGORY_URI_FILTER, false, true));
define('DOMAIN_PAGES', Text::addSlashes(DOMAIN_BASE . PAGE_URI_FILTER, false, true));
$ADMIN_CONTROLLER = '';
$ADMIN_VIEW = '';

View file

@ -3,6 +3,7 @@
// ============================================================================
// Variables
// ============================================================================
$themePlugin = getPlugin($site->theme()); // Returns plugin object or False
// ============================================================================
// Functions
@ -15,20 +16,18 @@ function buildThemes()
$themes = array();
$themesPaths = Filesystem::listDirectories(PATH_THEMES);
foreach($themesPaths as $themePath)
{
foreach ($themesPaths as $themePath) {
// Check if the theme is translated.
$languageFilename = $themePath.DS.'languages'.DS.$site->language().'.json';
if( !Sanitize::pathFile($languageFilename) ) {
$languageFilename = $themePath.DS.'languages'.DS.DEFAULT_LANGUAGE_FILE;
$languageFilename = $themePath . DS . 'languages' . DS . $site->language() . '.json';
if (!Sanitize::pathFile($languageFilename)) {
$languageFilename = $themePath . DS . 'languages' . DS . DEFAULT_LANGUAGE_FILE;
}
if( Sanitize::pathFile($languageFilename) )
{
if (Sanitize::pathFile($languageFilename)) {
$database = file_get_contents($languageFilename);
$database = json_decode($database, true);
if(empty($database)) {
Log::set('99.themes.php'.LOG_SEP.'Language file error on theme '.$themePath);
if (empty($database)) {
Log::set('99.themes.php' . LOG_SEP . 'Language file error on theme ' . $themePath);
break;
}
@ -37,20 +36,19 @@ function buildThemes()
$database['dirname'] = basename($themePath);
// --- Metadata ---
$filenameMetadata = $themePath.DS.'metadata.json';
$filenameMetadata = $themePath . DS . 'metadata.json';
if( Sanitize::pathFile($filenameMetadata) )
{
if (Sanitize::pathFile($filenameMetadata)) {
$metadataString = file_get_contents($filenameMetadata);
$metadata = json_decode($metadataString, true);
$database['compatible'] = false;
if( !empty($metadata['compatible']) ) {
if (!empty($metadata['compatible'])) {
$bluditRoot = explode('.', BLUDIT_VERSION);
$compatible = explode(',', $metadata['compatible']);
foreach( $compatible as $version ) {
foreach ($compatible as $version) {
$root = explode('.', $version);
if( $root[0]==$bluditRoot[0] && $root[1]==$bluditRoot[1] ) {
if ($root[0] == $bluditRoot[0] && $root[1] == $bluditRoot[1]) {
$database['compatible'] = true;
}
}
@ -70,13 +68,12 @@ function buildThemes()
// ============================================================================
// Load the language file
$languageFilename = THEME_DIR.'languages'.DS.$site->language().'.json';
if( !Sanitize::pathFile($languageFilename) ) {
$languageFilename = THEME_DIR.'languages'.DS.DEFAULT_LANGUAGE_FILE;
$languageFilename = THEME_DIR . 'languages' . DS . $site->language() . '.json';
if (!Sanitize::pathFile($languageFilename)) {
$languageFilename = THEME_DIR . 'languages' . DS . DEFAULT_LANGUAGE_FILE;
}
if( Sanitize::pathFile($languageFilename) )
{
if (Sanitize::pathFile($languageFilename)) {
$database = file_get_contents($languageFilename);
$database = json_decode($database, true);
@ -84,7 +81,7 @@ if( Sanitize::pathFile($languageFilename) )
unset($database['theme-data']);
// Load words from the theme language
if(!empty($database)) {
if (!empty($database)) {
$L->add($database);
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -209,14 +209,14 @@ class Filesystem {
return $zip->close();
}
/*
| Returns the next filename if the filename already exist otherwise returns the original filename
|
| @path string Path
| @filename string Filename
|
| @return string
*/
/*
| Returns the next filename if the filename already exist otherwise returns the original filename
|
| @path string Path
| @filename string Filename
|
| @return string
*/
public static function nextFilename($filename, $path=PATH_UPLOADS) {
// Clean filename and get extension
$fileExtension = pathinfo($filename, PATHINFO_EXTENSION);
@ -238,30 +238,30 @@ class Filesystem {
return $tmpName;
}
/*
| Returns the filename
| Example:
| @file /home/diego/dog.jpg
| @return dog.jpg
|
| @file string Full path of the file
|
| @return string
*/
/*
| Returns the filename
| Example:
| @file /home/diego/dog.jpg
| @return dog.jpg
|
| @file string Full path of the file
|
| @return string
*/
public static function filename($file) {
return basename($file);
}
/*
| Returns the file extension
| Example:
| @file /home/diego/dog.jpg
| @return jpg
|
| @file string Full path of the file
|
| @return string
*/
| Returns the file extension
| Example:
| @file /home/diego/dog.jpg
| @return jpg
|
| @file string Full path of the file
|
| @return string
*/
public static function extension($file) {
return pathinfo($file, PATHINFO_EXTENSION);
}
@ -298,15 +298,15 @@ class Filesystem {
}
/*
| Returns the mime type of the file
| Example:
| @file /home/diego/dog.jpg
| @return image/jpeg
|
| @file [string] Full path of the file
|
| @return [string|bool] Mime type as string or FALSE if not possible to get the mime type
*/
| Returns the mime type of the file
| Example:
| @file /home/diego/dog.jpg
| @return image/jpeg
|
| @file [string] Full path of the file
|
| @return [string|bool] Mime type as string or FALSE if not possible to get the mime type
*/
public static function mimeType($file) {
if (function_exists('mime_content_type')) {
return mime_content_type($file);
@ -322,4 +322,12 @@ class Filesystem {
return false;
}
public static function symlink($from, $to) {
if (function_exists('symlink')) {
return symlink($from, $to);
} else {
return copy($from, $to);
}
}
}

View file

@ -262,6 +262,12 @@ class Theme {
return '<link rel="stylesheet" type="text/css" href="'.DOMAIN_CORE_CSS.'bootstrap.min.css?version='.BLUDIT_VERSION.'">'.PHP_EOL;
}
public static function cssBootstrapIcons()
{
// https://icons.getbootstrap.com/
return '<link rel="stylesheet" type="text/css" href="'.DOMAIN_CORE_CSS.'bootstrap-icons/bootstrap-icons.css?version='.BLUDIT_VERSION.'">'.PHP_EOL;
}
public static function cssLineAwesome()
{
return '<link rel="stylesheet" type="text/css" href="'.DOMAIN_CORE_CSS.'line-awesome/css/line-awesome-font-awesome.min.css?version='.BLUDIT_VERSION.'">'.PHP_EOL;
@ -274,5 +280,3 @@ class Theme {
}
}
?>

File diff suppressed because one or more lines are too long

View file

@ -158,7 +158,7 @@ class Pages extends dbJSON {
// Create symlink for images directory
if (Filesystem::mkdir(PATH_UPLOADS_PAGES.$row['uuid'])) {
symlink(PATH_UPLOADS_PAGES.$row['uuid'], PATH_UPLOADS_PAGES.$key);
Filesystem::symlink(PATH_UPLOADS_PAGES.$row['uuid'], PATH_UPLOADS_PAGES.$key);
}
return $key;
@ -254,7 +254,7 @@ class Pages extends dbJSON {
// Regenerate the symlink to a proper directory
unlink(PATH_UPLOADS_PAGES.$key);
symlink(PATH_UPLOADS_PAGES.$row['uuid'], PATH_UPLOADS_PAGES.$newKey);
Filesystem::symlink(PATH_UPLOADS_PAGES.$row['uuid'], PATH_UPLOADS_PAGES.$newKey);
}
// If the content was passed via arguments replace the content

View file

@ -1,54 +1,55 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
class Site extends dbJSON {
class Site extends dbJSON
{
public $dbFields = array(
'title'=> 'I am Guybrush Threepwood, mighty developer',
'slogan'=> '',
'description'=> '',
'footer'=> 'I wanna be a pirate!',
'itemsPerPage'=> 6,
'language'=> 'en',
'locale'=> 'en, en_US, en_AU, en_CA, en_GB, en_IE, en_NZ',
'timezone'=> 'America/Argentina/Buenos_Aires',
'theme'=> 'alternative',
'adminTheme'=> 'booty',
'homepage'=> '',
'pageNotFound'=> '',
'uriPage'=> '/',
'uriTag'=> '/tag/',
'uriCategory'=> '/category/',
'uriBlog'=> '/blog/',
'url'=> '',
'emailFrom'=> '',
'dateFormat'=> 'F j, Y',
'timeFormat'=> 'g:i a',
'currentBuild'=> 0,
'twitter'=> '',
'facebook'=> '',
'codepen'=> '',
'instagram'=> '',
'github'=> '',
'gitlab'=> '',
'linkedin'=> '',
'xing'=> '',
'mastodon'=> '',
'dribbble'=> '',
'vk'=> '',
'orderBy'=> 'date', // date or position
'extremeFriendly'=> true,
'autosaveInterval'=> 2, // minutes
'titleFormatHomepage'=> '{{site-slogan}} | {{site-title}}',
'titleFormatPages'=> '{{page-title}} | {{site-title}}',
'titleFormatCategory'=> '{{category-name}} | {{site-title}}',
'titleFormatTag'=> '{{tag-name}} | {{site-title}}',
'imageRestrict'=> true,
'imageRelativeToAbsolute'=> false,
'thumbnailWidth'=> 400, // px
'thumbnailHeight'=> 400, // px
'thumbnailQuality'=> 100,
'logo'=> '',
'markdownParser'=> true,
'customFields'=> '{}'
'title' => 'I am Guybrush Threepwood, mighty developer',
'slogan' => '',
'description' => '',
'footer' => 'I wanna be a pirate!',
'itemsPerPage' => 6,
'language' => 'en',
'locale' => 'en, en_US, en_AU, en_CA, en_GB, en_IE, en_NZ',
'timezone' => 'America/Argentina/Buenos_Aires',
'theme' => 'alternative',
'adminTheme' => 'booty',
'homepage' => '',
'pageNotFound' => '',
'uriPage' => '/',
'uriTag' => '/tag/',
'uriCategory' => '/category/',
'uriBlog' => '/blog/',
'url' => '',
'emailFrom' => '',
'dateFormat' => 'F j, Y',
'timeFormat' => 'g:i a',
'currentBuild' => 0,
'twitter' => '',
'facebook' => '',
'codepen' => '',
'instagram' => '',
'github' => '',
'gitlab' => '',
'linkedin' => '',
'xing' => '',
'mastodon' => '',
'dribbble' => '',
'vk' => '',
'orderBy' => 'date', // date or position
'extremeFriendly' => true,
'autosaveInterval' => 2, // minutes
'titleFormatHomepage' => '{{site-slogan}} | {{site-title}}',
'titleFormatPages' => '{{page-title}} | {{site-title}}',
'titleFormatCategory' => '{{category-name}} | {{site-title}}',
'titleFormatTag' => '{{tag-name}} | {{site-title}}',
'imageRestrict' => true,
'imageRelativeToAbsolute' => false,
'thumbnailWidth' => 400, // px
'thumbnailHeight' => 400, // px
'thumbnailQuality' => 100,
'logo' => '',
'markdownParser' => true,
'customFields' => '{}'
);
function __construct()
@ -56,10 +57,10 @@ class Site extends dbJSON {
parent::__construct(DB_SITE);
// Set timezone
$this->setTimezone( $this->timezone() );
$this->setTimezone($this->timezone());
// Set locale
$this->setLocale( $this->locale() );
$this->setLocale($this->locale());
}
// Returns an array with site configuration.
@ -71,11 +72,14 @@ class Site extends dbJSON {
public function set($args)
{
// Check values on args or set default values
foreach ($this->dbFields as $field=>$value) {
foreach ($this->dbFields as $field => $value) {
if (isset($args[$field])) {
$finalValue = Sanitize::html($args[$field]);
if ($finalValue==='false') { $finalValue = false; }
elseif ($finalValue==='true') { $finalValue = true; }
if ($finalValue === 'false') {
$finalValue = false;
} elseif ($finalValue === 'true') {
$finalValue = true;
}
settype($finalValue, gettype($value));
$this->db[$field] = $finalValue;
}
@ -85,9 +89,9 @@ class Site extends dbJSON {
// Returns an array with the URL filters
// Also, you can get the a particular filter
public function uriFilters($filter='')
public function uriFilters($filter = '')
{
$filters['admin'] = '/'.ADMIN_URI_FILTER.'/';
$filters['admin'] = '/' . ADMIN_URI_FILTER . '/';
$filters['page'] = $this->getField('uriPage');
$filters['tag'] = $this->getField('uriTag');
$filters['category'] = $this->getField('uriCategory');
@ -110,13 +114,13 @@ class Site extends dbJSON {
// DEPRECATED in v3.0, use Theme::rssUrl()
public function rss()
{
return DOMAIN_BASE.'rss.xml';
return DOMAIN_BASE . 'rss.xml';
}
// DEPRECATED in v3.0, use Theme::sitemapUrl()
public function sitemap()
{
return DOMAIN_BASE.'sitemap.xml';
return DOMAIN_BASE . 'sitemap.xml';
}
public function thumbnailWidth()
@ -292,11 +296,11 @@ class Site extends dbJSON {
// Returns the absolute URL of the site logo
// If you set $absolute=false returns only the filename
public function logo($absolute=true)
public function logo($absolute = true)
{
$logo = $this->getField('logo');
if ($absolute && $logo) {
return DOMAIN_UPLOADS.$logo;
return DOMAIN_UPLOADS . $logo;
}
return $logo;
}
@ -313,25 +317,24 @@ class Site extends dbJSON {
public function domain()
{
// If the URL field is not set, try detect the domain.
if(Text::isEmpty( $this->url() )) {
if(!empty($_SERVER['HTTPS'])) {
if (Text::isEmpty($this->url())) {
if (!empty($_SERVER['HTTPS'])) {
$protocol = 'https://';
}
else {
} else {
$protocol = 'http://';
}
$domain = trim($_SERVER['HTTP_HOST'], '/');
return $protocol.$domain;
return $protocol . $domain;
}
// Parse the domain from the field url (Settings->Advanced)
$parse = parse_url($this->url());
$domain = rtrim($parse['host'], '/');
$port = !empty($parse['port']) ? ':'.$parse['port'] : '';
$scheme = !empty($parse['scheme']) ? $parse['scheme'].'://' : 'http://';
$port = !empty($parse['port']) ? ':' . $parse['port'] : '';
$scheme = !empty($parse['scheme']) ? $parse['scheme'] . '://' : 'http://';
return $scheme.$domain.$port;
return $scheme . $domain . $port;
}
// Returns the timezone.
@ -340,17 +343,17 @@ class Site extends dbJSON {
return $this->getField('timezone');
}
public function urlPath()
{
$url = $this->getField('url');
return parse_url($url, PHP_URL_PATH);
}
public function urlPath()
{
$url = $this->getField('url');
return parse_url($url, PHP_URL_PATH);
}
public function isHTTPS()
{
$url = $this->getField('url');
return parse_url($url, PHP_URL_SCHEME) === 'https';
}
public function isHTTPS()
{
$url = $this->getField('url');
return parse_url($url, PHP_URL_SCHEME) === 'https';
}
// Returns the current build / version of Bludit.
public function currentBuild()
@ -361,7 +364,11 @@ class Site extends dbJSON {
// Returns the amount of pages per page
public function itemsPerPage()
{
return $this->getField('itemsPerPage');
$value = $this->getField('itemsPerPage');
if (($value > 0) or ($value == -1)) {
return $value;
}
return 6;
}
// Returns the current language.
@ -407,10 +414,9 @@ class Site extends dbJSON {
$localeList = explode(',', $locale);
foreach ($localeList as $locale) {
$locale = trim($locale);
if (setlocale(LC_ALL, $locale.'.UTF-8')!==false) {
if (setlocale(LC_ALL, $locale . '.UTF-8') !== false) {
return true;
}
elseif (setlocale(LC_ALL, $locale)!==false) {
} elseif (setlocale(LC_ALL, $locale) !== false) {
return true;
}
}
@ -431,5 +437,4 @@ class Site extends dbJSON {
$customFields = Sanitize::htmlDecode($this->getField('customFields'));
return json_decode($customFields, true);
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

View file

@ -183,7 +183,7 @@
"you-can-change-this-field-when-save-the-current-changes": "You can change this field when you save the current changes.",
"items-per-page": "Items per page",
"invite-a-friend-to-collaborate-on-your-site": "Invite a friend to collaborate on your site",
"number-of-items-to-show-per-page": "Number of items to show per page.",
"number-of-items-to-show-per-page": "Number of items to show per page, -1 means all items.",
"website-or-blog": "Website or Blog",
"order-content-by": "Order content by",
"edit-or-delete-content-from-your-site": "Edit or delete content from your site",

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Theme Popeye",
"description": "Das Plugin erlaubt verschiedene Einstellungen für das Theme Popeye."
},
"enable-or-disable-dark-mode": "Dunkelmodus aktivieren oder deaktivieren.",
"enable-or-disable-google-fonts": "Google Fonts aktivieren oder deaktivieren.",
"relative": "Relativ",
"absolute": "Absolut",
"change-the-date-format-for-the-main-page": "Einstellung des Datumsformats auf der Haupt- oder Blogseite.",
"show-tags": "Schlagwörter zeigen",
"show-tags-in-the-main-page-for-each-article": "Zeigt auf der Haupt- oder Blogseite die Schlagwörter der Beiträge."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Theme Popeye",
"description": "Das Plugin erlaubt verschiedene Einstellungen für das Theme Popeye."
},
"enable-or-disable-dark-mode": "Dunkelmodus aktivieren oder deaktivieren.",
"enable-or-disable-google-fonts": "Google Fonts aktivieren oder deaktivieren.",
"relative": "Relativ",
"absolute": "Absolut",
"change-the-date-format-for-the-main-page": "Einstellung des Datumsformats auf der Haupt- oder Blogseite.",
"show-tags": "Schlagwörter zeigen",
"show-tags-in-the-main-page-for-each-article": "Zeigt auf der Haupt- oder Blogseite die Schlagwörter der Beiträge."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Theme Popeye",
"description": "Das Plugin erlaubt verschiedene Einstellungen für das Theme Popeye."
},
"enable-or-disable-dark-mode": "Dunkelmodus aktivieren oder deaktivieren.",
"enable-or-disable-google-fonts": "Google Fonts aktivieren oder deaktivieren.",
"relative": "Relativ",
"absolute": "Absolut",
"change-the-date-format-for-the-main-page": "Einstellung des Datumsformats auf der Haupt- oder Blogseite.",
"show-tags": "Schlagwörter zeigen",
"show-tags-in-the-main-page-for-each-article": "Zeigt auf der Haupt- oder Blogseite die Schlagwörter der Beiträge."
}

View file

@ -0,0 +1,13 @@
{
"plugin-data": {
"name": "Alternative Theme",
"description": "This plugin provides configuration for the Alternative theme."
},
"enable-or-disable-dark-mode": "Enable or disable dark mode.",
"enable-or-disable-google-fonts": "Enable or disable Google fonts.",
"relative": "Relative",
"absolute": "Absolute",
"change-the-date-format-for-the-main-page": "Change the date format for the main page.",
"show-tags": "Show tags",
"show-tags-in-the-main-page-for-each-article": "Show tags on the main page for each article."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Popeye Theme",
"description": "Popeyeテーマの設定を行うプラグインです。"
},
"enable-or-disable-dark-mode": "ダークモードを有効または無効にします。",
"enable-or-disable-google-fonts": "Google Fontsの利用を有効または無効にします。",
"relative": "相対的",
"absolute": "絶対的",
"change-the-date-format-for-the-main-page": "メインページの日付表示形式を変更します。",
"show-tags": "タグの表示",
"show-tags-in-the-main-page-for-each-article": "メインページの各記事にタグを表示します。"
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Popeye Thema",
"description": "Met deze plugin kan het thema Popeye geconfigureerd worden."
},
"enable-or-disable-dark-mode": "Donkere modus in-/uitschakelen.",
"enable-or-disable-google-fonts": "Lettertypes van Google in-/uitschakelen.",
"relative": "Relatief",
"absolute": "Absoluut",
"change-the-date-format-for-the-main-page": "Het datumformaat voor de hoofdpagina aanpassen.",
"show-tags": "Tags tonen",
"show-tags-in-the-main-page-for-each-article": "Op de hoofdpagina voor ieder artikel de tags tonen."
}

View file

@ -0,0 +1,11 @@
{
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.15.0",
"releaseDate": "2023-07-10",
"license": "MIT",
"compatible": "3.15.0",
"notes": "",
"type": "theme"
}

View file

@ -0,0 +1,65 @@
<?php
class alternative extends Plugin
{
public function init()
{
$this->dbFields = array(
'googleFonts' => false,
'showPostInformation' => false,
'dateFormat' => 'relative'
);
}
public function form()
{
global $L;
$html = '';
$html .= '<div class="mb-3">';
$html .= '<label class="form-label" for="googleFonts">' . $L->get('Google Fonts') . '</label>';
$html .= '<select class="form-select" id="googleFonts" name="googleFonts">';
$html .= '<option value="false" ' . ($this->getValue('googleFonts') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';
$html .= '<option value="true" ' . ($this->getValue('googleFonts') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';
$html .= '</select>';
$html .= '<div class="form-text">' . $L->get('Enable or disable Google fonts.') . '</div>';
$html .= '</div>';
$html .= '<div class="mb-3">';
$html .= '<label class="form-label" for="showPostInformation">' . $L->get('Show Post Information') . '</label>';
$html .= '<select class="form-select" id="showPostInformation" name="showPostInformation">';
$html .= '<option value="false" ' . ($this->getValue('showPostInformation') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';
$html .= '<option value="true" ' . ($this->getValue('showPostInformation') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';
$html .= '</select>';
$html .= '</div>';
$html .= '<div class="mb-3">';
$html .= '<label class="form-label" for="dateFormat">' . $L->get('Date format') . '</label>';
$html .= '<select class="form-select" id="dateFormat" name="dateFormat">';
$html .= '<option value="noshow" ' . ($this->getValue('dateFormat') == 'noshow' ? 'selected' : '') . '>' . $L->get('No show') . '</option>';
$html .= '<option value="relative" ' . ($this->getValue('dateFormat') == 'relative' ? 'selected' : '') . '>' . $L->get('Relative') . '</option>';
$html .= '<option value="absolute" ' . ($this->getValue('dateFormat') == 'absolute' ? 'selected' : '') . '>' . $L->get('Absolute') . '</option>';
$html .= '</select>';
$html .= '<div class="form-text">' . $L->get('Change the date format for the main page.') . '</div>';
$html .= '</div>';
return $html;
}
public function showPostInformation()
{
return $this->getValue('showPostInformation');
}
public function googleFonts()
{
return $this->getValue('googleFonts');
}
public function dateFormat()
{
return $this->getValue('dateFormat');
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,9 +2,9 @@
"author": "EasyMDE",
"email": "",
"website": "https://easymde.tk",
"version": "2.12.0",
"releaseDate": "2020-09-29",
"version": "2.18.0",
"releaseDate": "2022-09-20",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Theme Popeye",
"description": "Das Plugin erlaubt verschiedene Einstellungen für das Theme Popeye."
},
"enable-or-disable-dark-mode": "Dunkelmodus aktivieren oder deaktivieren.",
"enable-or-disable-google-fonts": "Google Fonts aktivieren oder deaktivieren.",
"relative": "Relativ",
"absolute": "Absolut",
"change-the-date-format-for-the-main-page": "Einstellung des Datumsformats auf der Haupt- oder Blogseite.",
"show-tags": "Schlagwörter zeigen",
"show-tags-in-the-main-page-for-each-article": "Zeigt auf der Haupt- oder Blogseite die Schlagwörter der Beiträge."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Theme Popeye",
"description": "Das Plugin erlaubt verschiedene Einstellungen für das Theme Popeye."
},
"enable-or-disable-dark-mode": "Dunkelmodus aktivieren oder deaktivieren.",
"enable-or-disable-google-fonts": "Google Fonts aktivieren oder deaktivieren.",
"relative": "Relativ",
"absolute": "Absolut",
"change-the-date-format-for-the-main-page": "Einstellung des Datumsformats auf der Haupt- oder Blogseite.",
"show-tags": "Schlagwörter zeigen",
"show-tags-in-the-main-page-for-each-article": "Zeigt auf der Haupt- oder Blogseite die Schlagwörter der Beiträge."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Theme Popeye",
"description": "Das Plugin erlaubt verschiedene Einstellungen für das Theme Popeye."
},
"enable-or-disable-dark-mode": "Dunkelmodus aktivieren oder deaktivieren.",
"enable-or-disable-google-fonts": "Google Fonts aktivieren oder deaktivieren.",
"relative": "Relativ",
"absolute": "Absolut",
"change-the-date-format-for-the-main-page": "Einstellung des Datumsformats auf der Haupt- oder Blogseite.",
"show-tags": "Schlagwörter zeigen",
"show-tags-in-the-main-page-for-each-article": "Zeigt auf der Haupt- oder Blogseite die Schlagwörter der Beiträge."
}

View file

@ -0,0 +1,13 @@
{
"plugin-data": {
"name": "Popeye Theme",
"description": "This plugin provides configuration for the Popeye theme."
},
"enable-or-disable-dark-mode": "Enable or disable dark mode.",
"enable-or-disable-google-fonts": "Enable or disable Google fonts.",
"relative": "Relative",
"absolute": "Absolute",
"change-the-date-format-for-the-main-page": "Change the date format for the main page.",
"show-tags": "Show tags",
"show-tags-in-the-main-page-for-each-article": "Show tags on the main page for each article."
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Popeye Theme",
"description": "Popeyeテーマの設定を行うプラグインです。"
},
"enable-or-disable-dark-mode": "ダークモードを有効または無効にします。",
"enable-or-disable-google-fonts": "Google Fontsの利用を有効または無効にします。",
"relative": "相対的",
"absolute": "絶対的",
"change-the-date-format-for-the-main-page": "メインページの日付表示形式を変更します。",
"show-tags": "タグの表示",
"show-tags-in-the-main-page-for-each-article": "メインページの各記事にタグを表示します。"
}

View file

@ -0,0 +1,14 @@
{
"plugin-data":
{
"name": "Popeye Thema",
"description": "Met deze plugin kan het thema Popeye geconfigureerd worden."
},
"enable-or-disable-dark-mode": "Donkere modus in-/uitschakelen.",
"enable-or-disable-google-fonts": "Lettertypes van Google in-/uitschakelen.",
"relative": "Relatief",
"absolute": "Absoluut",
"change-the-date-format-for-the-main-page": "Het datumformaat voor de hoofdpagina aanpassen.",
"show-tags": "Tags tonen",
"show-tags-in-the-main-page-for-each-article": "Op de hoofdpagina voor ieder artikel de tags tonen."
}

View file

@ -0,0 +1,11 @@
{
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.15.0",
"releaseDate": "2023-07-10",
"license": "MIT",
"compatible": "3.15.0",
"notes": "",
"type": "theme"
}

View file

@ -0,0 +1,78 @@
<?php
class popeye extends Plugin
{
public function init()
{
$this->dbFields = array(
'googleFonts' => true,
'darkMode' => true,
'dateFormat' => 'relative',
'showTags' => true
);
}
public function form()
{
global $L;
$html = '<div class="mb-3">';
$html .= '<label class="form-label" for="darkMode">' . $L->get('Dark Mode') . '</label>';
$html .= '<select class="form-select" id="darkMode" name="darkMode">';
$html .= '<option value="true" ' . ($this->getValue('darkMode') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';
$html .= '<option value="false" ' . ($this->getValue('darkMode') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';
$html .= '</select>';
$html .= '<div class="form-text">' . $L->get('Enable or disable dark mode.') . '</div>';
$html .= '</div>';
$html .= '<div class="mb-3">';
$html .= '<label class="form-label" for="googleFonts">' . $L->get('Google Fonts') . '</label>';
$html .= '<select class="form-select" id="googleFonts" name="googleFonts">';
$html .= '<option value="true" ' . ($this->getValue('googleFonts') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';
$html .= '<option value="false" ' . ($this->getValue('googleFonts') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';
$html .= '</select>';
$html .= '<div class="form-text">' . $L->get('Enable or disable Google fonts.') . '</div>';
$html .= '</div>';
$html .= '<div class="mb-3">';
$html .= '<label class="form-label" for="dateFormat">' . $L->get('Date format') . '</label>';
$html .= '<select class="form-select" id="dateFormat" name="dateFormat">';
$html .= '<option value="relative" ' . ($this->getValue('dateFormat') == 'relative' ? 'selected' : '') . '>' . $L->get('Relative') . '</option>';
$html .= '<option value="absolute" ' . ($this->getValue('dateFormat') == 'absolute' ? 'selected' : '') . '>' . $L->get('Absolute') . '</option>';
$html .= '</select>';
$html .= '<div class="form-text">' . $L->get('Change the date format for the main page.') . '</div>';
$html .= '</div>';
$html .= '<div class="mb-3">';
$html .= '<label class="form-label" for="showTags">' . $L->get('Show tags') . '</label>';
$html .= '<select class="form-select" id="showTags" name="showTags">';
$html .= '<option value="true" ' . ($this->getValue('showTags') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';
$html .= '<option value="false" ' . ($this->getValue('showTags') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';
$html .= '</select>';
$html .= '<div class="form-text">' . $L->get('Show tags in the main page for each article.') . '</div>';
$html .= '</div>';
return $html;
}
public function darkMode()
{
return $this->getValue('darkMode');
}
public function googleFonts()
{
return $this->getValue('googleFonts');
}
public function dateFormat()
{
return $this->getValue('dateFormat');
}
public function showTags()
{
return $this->getValue('showTags');
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com/plugin/remote-content",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -1,12 +1,13 @@
<?php
class pluginVersion extends Plugin {
class pluginVersion extends Plugin
{
public function init()
{
$this->dbFields = array(
'showCurrentVersion'=>true,
'newVersionAlert'=>true
'showCurrentVersion' => true,
'newVersionAlert' => true
);
}
@ -14,23 +15,19 @@ class pluginVersion extends Plugin {
{
global $L;
$html = '<div class="alert alert-primary" role="alert">';
$html .= $this->description();
$html .= '</div>';
$html .= '<div>';
$html .= '<label>'.$L->get('Show current version in the sidebar').'</label>';
$html = '<div>';
$html .= '<label>' . $L->get('Show current version in the sidebar') . '</label>';
$html .= '<select name="showCurrentVersion">';
$html .= '<option value="true" '.($this->getValue('showCurrentVersion')===true?'selected':'').'>'.$L->get('Enabled').'</option>';
$html .= '<option value="false" '.($this->getValue('showCurrentVersion')===false?'selected':'').'>'.$L->get('Disabled').'</option>';
$html .= '<option value="true" ' . ($this->getValue('showCurrentVersion') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';
$html .= '<option value="false" ' . ($this->getValue('showCurrentVersion') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';
$html .= '</select>';
$html .= '</div>';
$html .= '<div>';
$html .= '<label>'.$L->get('Show alert when there is a new version in the sidebar').'</label>';
$html .= '<label>' . $L->get('Show alert when there is a new version in the sidebar') . '</label>';
$html .= '<select name="newVersionAlert">';
$html .= '<option value="true" '.($this->getValue('newVersionAlert')===true?'selected':'').'>'.$L->get('Enabled').'</option>';
$html .= '<option value="false" '.($this->getValue('newVersionAlert')===false?'selected':'').'>'.$L->get('Disabled').'</option>';
$html .= '<option value="true" ' . ($this->getValue('newVersionAlert') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';
$html .= '<option value="false" ' . ($this->getValue('newVersionAlert') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';
$html .= '</select>';
$html .= '</div>';
@ -42,10 +39,10 @@ class pluginVersion extends Plugin {
global $L;
$html = '';
if ($this->getValue('showCurrentVersion')) {
$html = '<a class="current-version" class="nav-link" href="'.HTML_PATH_ADMIN_ROOT.'about'.'"><span class="fa fa-info"></span> '.$L->get('Version').' '.(defined('BLUDIT_PRO')?'<span class="fa fa-heart" style="color: #ffc107"></span>':'').'<span class="badge badge-warning badge-pill">'.BLUDIT_VERSION.'</span></a>';
$html = '<a id="current-version" class="nav-link" href="' . HTML_PATH_ADMIN_ROOT . 'about' . '">' . $L->get('Version') . ' ' . (defined('BLUDIT_PRO') ? '<span class="bi-heart" style="color: #ffc107"></span>' : '') . '<span class="badge bg-warning rounded-pill">' . BLUDIT_VERSION . '</span></a>';
}
if ($this->getValue('newVersionAlert')) {
$html .= '<a class="new-version" style="display: none;" target="_blank" href="https://www.bludit.com"><span class="fa fa-bell" style="color: red"></span> '.$L->get('New version available').'</a>';
$html .= '<a id="new-version" style="display: none;" target="_blank" href="https://www.bludit.com">' . $L->get('New version available') . ' <span class="bi-bell" style="color: red"></span></a>';
}
return $html;
}

View file

@ -0,0 +1 @@
@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Statistik",
"description": "Zeigt die Anzahl der Seitenaufrufe und der Besucher im Dashboard."
},
"visits": "Seitenaufrufe",
"visitors": "Besucher",
"unique-visitors": "Eindeutige Besucher",
"exclude-administrators-users" : "Benutzer mit der Rolle 'Administrator' ausschliessen"
}

View file

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Statistik",
"description": "Zeigt die Anzahl der Seitenaufrufe und der Besucher im Dashboard."
},
"visits": "Seitenaufrufe",
"visitors": "Besucher",
"unique-visitors": "Eindeutige Besucher",
"exclude-administrators-users" : "Benutzer mit der Rolle 'Administrator' ausschliessen"
}

View file

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Statistik",
"description": "Zeigt die Anzahl der Seitenaufrufe und der Besucher im Dashboard."
},
"visits": "Seitenaufrufe",
"visitors": "Besucher",
"unique-visitors": "Eindeutige Besucher",
"exclude-administrators-users" : "Benutzer mit der Rolle 'Administrator' ausschliessen"
}

View file

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Visits Stats",
"description": "Shows the number of visits and unique visitors in the dashboard."
},
"visits": "Visits",
"visitors": "Visitors",
"unique-visitors": "Unique visitors",
"exclude-administrators-users" : "Exclude users with role 'Administrator'"
}

View file

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Visits Stats",
"description": "ダッシュボードに訪問者数とユニーク訪問者数を表示します。"
},
"visits": "訪問者",
"visitors": "訪問者数",
"unique-visitors": "ユニーク訪問者数",
"exclude-administrators-users" : "管理者グループのユーザーを除外する"
}

View file

@ -0,0 +1,11 @@
{
"plugin-data":
{
"name": "Bezoekersstatistieken",
"description": "Toont het aantal bezoeken en unieke bezoekers in het dashboard."
},
"visits": "Bezoeken",
"visitors": "Bezoekers",
"unique-visitors": "Unieke bezoekers",
"exclude-administrators-users" : "Gebruikers met de rol 'Beheerder' uitsluiten"
}

View file

@ -0,0 +1,10 @@
{
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.15.0",
"notes": ""
}

View file

@ -0,0 +1,187 @@
<?php
class pluginVisitsStats extends Plugin
{
private $loadOnViews = array(
'dashboard' // Load this plugin only in the Dashboard
);
public function init()
{
global $L;
$this->dbFields = array(
'label' => $L->g('Visits'),
'excludeAdmins' => false
);
}
public function adminHead()
{
if (!in_array($GLOBALS['ADMIN_VIEW'], $this->loadOnViews)) {
return false;
}
$html = $this->includeCSS('chart.min.css');
$html .= $this->includeJS('chart.bundle.min.js');
return $html;
}
public function dashboard()
{
global $L;
$label = $this->getValue('label');
$currentDate = Date::current('Y-m-d');
$visitsToday = $this->visits($currentDate);
$uniqueVisitors = $this->uniqueVisitors($currentDate);
$numberOfDays = 6;
for ($i = $numberOfDays; $i >= 0; $i--) {
$dateWithOffset = Date::currentOffset('Y-m-d', '-' . $i . ' day');
$visits[$i] = $this->visits($dateWithOffset);
$unique[$i] = $this->uniqueVisitors($dateWithOffset);
$days[$i] = Date::format($dateWithOffset, 'Y-m-d', 'D');
}
$labels = "'" . implode("','", $days) . "'";
$seriesVisits = implode(',', $visits);
$seriesVisitors = implode(',', $unique);
$labelVisits = $L->g('Visits');
$labelVisitors = $L->g('Visitors');
return <<<EOF
<div class="pluginVisitsStats mt-4 mb-4 pb-4 border-bottom">
<h3 class="m-0 p-0"><i class="bi bi-bar-chart"></i>$label</h3>
<canvas id="visits-stats"></canvas>
</div>
<script>
var ctx = document.getElementById('visits-stats');
new Chart(ctx, {
type: 'bar',
data: {
labels: [$labels],
datasets: [{
backgroundColor: 'rgb(13,110,253)',
borderColor: 'rgb(13,110,253)',
label: '$labelVisitors',
data: [$seriesVisitors]
},
{
backgroundColor: 'rgb(255, 193, 3)',
borderColor: 'rgb(255, 193, 3)',
label: '$labelVisits',
data: [$seriesVisits]
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true,
stepSize: 1
}
}]
}
}
});
</script>
EOF;
}
// Plugin form for settings
public function form()
{
global $L;
$html = '<div class="mb-3">';
$html .= '<label class="form-label" for="label">' . $L->get('Label') . '</label>';
$html .= '<input class="form-control" id="label" name="label" type="text" value="' . $this->getValue('label') . '">';
$html .= '<div class="form-text">' . $L->get('This title is almost always used in the sidebar of the site') . '</div>';
$html .= '</div>';
if (defined('BLUDIT_PRO')) {
$html .= '<div class="mb-3">';
$html .= '<label class="form-label" for="excludeAdmins">' . $L->get('Exclude administrators users') . '</label>';
$html .= '<select class="form-select" id="excludeAdmins" name="excludeAdmins">';
$html .= '<option value="true" ' . ($this->getValue('excludeAdmins') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';
$html .= '<option value="false" ' . ($this->getValue('excludeAdmins') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';
$html .= '</select>';
$html .= '</div>';
}
return $html;
}
public function siteBodyEnd()
{
$this->addVisitor();
}
// Delete old logs
public function deleteOldLogs()
{
$logs = Filesystem::listFiles($this->workspace(), '*', 'log', true);
// Keep only 7 days of logs
$remove = array_slice($logs, 7);
foreach ($remove as $log) {
Filesystem::rmfile($log);
}
}
// Returns the number of visits by date
public function visits($date)
{
$file = $this->workspace() . $date . '.log';
$handle = @fopen($file, 'rb');
if ($handle === false) {
return 0;
}
// The amount of visits are the number of lines on the file
$lines = 0;
while (!feof($handle)) {
$lines += substr_count(fread($handle, 8192), PHP_EOL);
}
@fclose($handle);
return $lines;
}
// Returns the number of unique visitors by date
public function uniqueVisitors($date)
{
$file = $this->workspace() . $date . '.log';
$lines = @file($file);
if (empty($lines)) {
return 0;
}
$tmp = array();
foreach ($lines as $line) {
$data = json_decode($line);
$hashIP = $data[0];
$tmp[$hashIP] = true;
}
return count($tmp);
}
// Add a line to the current log
// The line is a json array with the hash IP of the visitor and the time
public function addVisitor()
{
if (Cookie::get('BLUDIT-KEY') && defined('BLUDIT_PRO') && $this->getValue('excludeAdmins')) {
return false;
}
$currentTime = Date::current('Y-m-d H:i:s');
$ip = TCP::getIP();
$hashIP = md5($ip);
$line = json_encode(array($hashIP, $currentTime));
$currentDate = Date::current('Y-m-d');
$logFile = $this->workspace() . $currentDate . '.log';
return file_put_contents($logFile, $line . PHP_EOL, FILE_APPEND | LOCK_EX) !== false;
}
}

View file

@ -18,7 +18,8 @@ img {
max-width: 100%;
}
pre, code {
pre,
code {
background: #f8f8f8;
color: #333;
}
@ -56,7 +57,8 @@ tr {
border-color: inherit;
}
th, td {
th,
td {
padding: 0.5em 1em;
}
@ -66,10 +68,14 @@ h2.title {
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px 20px;
border-left: 5px solid #eee;
font-style: italic;
padding: 10px 20px;
margin: 0 0 20px 20px;
border-left: 5px solid #eee;
font-style: italic;
}
.bi {
margin-right: .5rem !important;
}
@ -111,7 +117,8 @@ header.welcome {
}
/* Home - Page */
section.home-page:nth-child(even) { /* Alternate the background color */
section.home-page:nth-child(even) {
/* Alternate the background color */
background: #FAFAFA;
}
@ -127,15 +134,17 @@ section.home-page:nth-child(even) { /* Alternate the background color */
/* VIDEO EMBED RESPONSIVE */
.video-embed {
overflow:hidden;
padding-bottom: 56.25%; /* 16:9 */
position:relative;
height:0;
overflow: hidden;
padding-bottom: 56.25%;
/* 16:9 */
position: relative;
height: 0;
}
.video-embed iframe{
left:0;
top:0;
height:100%;
width:100%;
position:absolute;
.video-embed iframe {
left: 0;
top: 0;
height: 100%;
width: 100%;
position: absolute;
}

View file

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="<?php echo Theme::lang() ?>">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
@ -17,34 +18,47 @@
<!-- Include CSS Bootstrap file from Bludit Core -->
<?php echo Theme::cssBootstrap(); ?>
<!-- Include CSS Bootstrap ICONS file from Bludit Core -->
<?php echo Theme::cssBootstrapIcons(); ?>
<!-- Include CSS Styles from this theme -->
<?php echo Theme::css('css/style.css'); ?>
<?php if ($themePlugin->googleFonts()) : ?>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:sans,bold">
<style>
body {
font-family: "Open Sans", sans-serif;
}
</style>
<?php endif; ?>
<!-- Load Bludit Plugins: Site head -->
<?php Theme::plugins('siteHead'); ?>
</head>
<body>
<!-- Load Bludit Plugins: Site Body Begin -->
<?php Theme::plugins('siteBodyBegin'); ?>
<!-- Navbar -->
<?php include(THEME_DIR_PHP.'navbar.php'); ?>
<?php include(THEME_DIR_PHP . 'navbar.php'); ?>
<!-- Content -->
<?php
// $WHERE_AM_I variable detect where the user is browsing
// If the user is watching a particular page the variable takes the value "page"
// If the user is watching the frontpage the variable takes the value "home"
if ($WHERE_AM_I == 'page') {
include(THEME_DIR_PHP.'page.php');
} else {
include(THEME_DIR_PHP.'home.php');
}
// $WHERE_AM_I variable detect where the user is browsing
// If the user is watching a particular page the variable takes the value "page"
// If the user is watching the frontpage the variable takes the value "home"
if ($WHERE_AM_I == 'page') {
include(THEME_DIR_PHP . 'page.php');
} else {
include(THEME_DIR_PHP . 'home.php');
}
?>
<!-- Footer -->
<?php include(THEME_DIR_PHP.'footer.php'); ?>
<?php include(THEME_DIR_PHP . 'footer.php'); ?>
<!-- Include Jquery file from Bludit Core -->
<?php echo Theme::jquery(); ?>
@ -56,4 +70,5 @@
<?php Theme::plugins('siteBodyEnd'); ?>
</body>
</html>
</html>

View file

@ -0,0 +1,5 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
if ($themePlugin == false) {
exit("To ensure proper functionality, the theme requires the Alternative plugin. Activate the plugin through the admin panel.");
}

View file

@ -2,9 +2,10 @@
"author": "Bludit",
"email": "",
"website": "https://themes.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-10",
"license": "MIT",
"compatible": "3.14.1",
"notes": ""
}
"compatible": "3.15",
"notes": "",
"plugin": "alternative"
}

View file

@ -5,102 +5,108 @@
<h1><?php echo $site->slogan(); ?></h1>
<!-- Site description -->
<?php if ($site->description()): ?>
<p class="lead"><?php echo $site->description(); ?></p>
<?php if ($site->description()) : ?>
<p class="lead"><?php echo $site->description(); ?></p>
<?php endif ?>
<!-- Custom search form if the plugin "search" is enabled -->
<?php if (pluginActivated('pluginSearch')): ?>
<div class="form-inline d-block">
<input id="search-input" class="form-control mr-sm-2" type="search" placeholder="<?php $language->p('Search') ?>" aria-label="Search">
<button class="btn btn-outline-primary my-2 my-sm-0" type="button" onClick="searchNow()"><?php $language->p('Search') ?></button>
<script>
function searchNow() {
var searchURL = "<?php echo Theme::siteUrl(); ?>search/";
window.open(searchURL + document.getElementById("search-input").value, "_self");
}
document.getElementById("search-input").onkeypress = function(e) {
if (!e) e = window.event;
var keyCode = e.keyCode || e.which;
if (keyCode == '13') {
searchNow();
return false;
<?php if (pluginActivated('pluginSearch')) : ?>
<div class="form-inline d-block">
<input id="search-input" class="form-control mr-sm-2" type="search" placeholder="<?php $language->p('Search') ?>" aria-label="Search">
<button class="btn btn-outline-primary my-2 my-sm-0" type="button" onClick="searchNow()"><?php $language->p('Search') ?></button>
<script>
function searchNow() {
var searchURL = "<?php echo Theme::siteUrl(); ?>search/";
window.open(searchURL + document.getElementById("search-input").value, "_self");
}
}
</script>
</div>
document.getElementById("search-input").onkeypress = function(e) {
if (!e) e = window.event;
var keyCode = e.keyCode || e.which;
if (keyCode == '13') {
searchNow();
return false;
}
}
</script>
</div>
<?php endif ?>
</div>
</header>
<?php if (empty($content)): ?>
<?php if (empty($content)) : ?>
<div class="text-center p-4">
<?php $language->p('No pages found') ?>
<?php $language->p('No pages found') ?>
</div>
<?php endif ?>
<!-- Print all the content -->
<?php foreach ($content as $page): ?>
<section class="home-page">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<!-- Load Bludit Plugins: Page Begin -->
<?php Theme::plugins('pageBegin'); ?>
<?php foreach ($content as $page) : ?>
<section class="home-page">
<div class="container">
<div class="row">
<div class="col-lg-8 mx-auto">
<!-- Load Bludit Plugins: Page Begin -->
<?php Theme::plugins('pageBegin'); ?>
<!-- Page title -->
<a class="text-dark" href="<?php echo $page->permalink(); ?>">
<h2 class="title"><?php echo $page->title(); ?></h2>
</a>
<!-- Page title -->
<a class="text-dark" href="<?php echo $page->permalink(); ?>">
<h2 class="title"><?php echo $page->title(); ?></h2>
</a>
<!-- Page description -->
<?php if ($page->description()): ?>
<p class="page-description"><?php echo $page->description(); ?></p>
<?php endif ?>
<!-- Page description -->
<?php if ($page->description()) : ?>
<p class="page-description"><?php echo $page->description(); ?></p>
<?php endif ?>
<!-- Page content until the pagebreak -->
<div>
<?php echo $page->contentBreak(); ?>
<!-- Page content until the pagebreak -->
<div>
<?php echo $page->contentBreak(); ?>
</div>
<!-- Shows "read more" button if necessary -->
<?php if ($page->readMore()) : ?>
<div class="text-right pt-3">
<a class="btn btn-primary btn-sm" href="<?php echo $page->permalink(); ?>" role="button"><?php echo $L->get('Read more'); ?></a>
</div>
<?php endif ?>
<?php if ($themePlugin->dateFormat() == 'relative') : ?>
<small class="color-blue"><?php echo $page->relativeTime() ?></small>
<?php elseif ($themePlugin->dateFormat() == 'absolute') : ?>
<small class="color-blue"><?php echo $page->date() ?></small>
<?php endif ?>
<!-- Load Bludit Plugins: Page End -->
<?php Theme::plugins('pageEnd'); ?>
</div>
<!-- Shows "read more" button if necessary -->
<?php if ($page->readMore()): ?>
<div class="text-right pt-3">
<a class="btn btn-primary btn-sm" href="<?php echo $page->permalink(); ?>" role="button"><?php echo $L->get('Read more'); ?></a>
</div>
<?php endif ?>
<!-- Load Bludit Plugins: Page End -->
<?php Theme::plugins('pageEnd'); ?>
</div>
</div>
</div>
</section>
</section>
<?php endforeach ?>
<!-- Pagination -->
<?php if (Paginator::numberOfPages()>1): ?>
<nav class="paginator">
<ul class="pagination flex-wrap justify-content-center">
<?php if (Paginator::numberOfPages() > 1) : ?>
<nav class="paginator">
<ul class="pagination flex-wrap justify-content-center">
<!-- Previous button -->
<?php if (Paginator::showPrev()): ?>
<li class="page-item mr-2">
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">&#9664; <?php echo $L->get('Previous'); ?></a>
</li>
<?php endif; ?>
<!-- Previous button -->
<?php if (Paginator::showPrev()) : ?>
<li class="page-item mr-2">
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">&#9664; <?php echo $L->get('Previous'); ?></a>
</li>
<?php endif; ?>
<!-- Home button -->
<li class="page-item <?php if (Paginator::currentPage()==1) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Theme::siteUrl() ?>"><?php echo $L->get('Home'); ?></a>
</li>
<!-- Home button -->
<li class="page-item <?php if (Paginator::currentPage() == 1) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Theme::siteUrl() ?>"><?php echo $L->get('Home'); ?></a>
</li>
<!-- Next button -->
<?php if (Paginator::showNext()): ?>
<li class="page-item ml-2">
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $L->get('Next'); ?> &#9658;</a>
</li>
<?php endif; ?>
</ul>
</nav>
<!-- Next button -->
<?php if (Paginator::showNext()) : ?>
<li class="page-item ml-2">
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $L->get('Next'); ?> &#9658;</a>
</li>
<?php endif; ?>
</ul>
</nav>
<?php endif ?>

View file

@ -8,21 +8,34 @@
<!-- Page title -->
<h1 class="title"><?php echo $page->title(); ?></h1>
<?php if (!$page->isStatic() && !$url->notFound() && $themePlugin->showPostInformation()) : ?>
<div class="form-text mb-2">
<!-- Page creation time -->
<span class="pr-3"><i class="bi bi-calendar"></i><?php echo $page->date() ?></span>
<!-- Page reading time -->
<span class="pr-3"><i class="bi bi-clock"></i><?php echo $page->readingTime() . ' ' . $L->get('minutes') . ' ' . $L->g('read') ?></span>
<!-- Page author -->
<span><i class="bi bi-person"></i><?php echo $page->user('nickname') ?></span>
</div>
<?php endif ?>
<!-- Page description -->
<?php if ($page->description()): ?>
<p class="page-description"><?php echo $page->description(); ?></p>
<?php if ($page->description()) : ?>
<p class="page-description"><?php echo $page->description(); ?></p>
<?php endif ?>
<!-- Page cover image -->
<?php if ($page->coverImage()): ?>
<div class="page-cover-image py-6 mb-4" style="background-image: url('<?php echo $page->coverImage(); ?>');">
<div style="height: 300px;"></div>
</div>
<?php if ($page->coverImage()) : ?>
<div class="page-cover-image py-6 mb-4" style="background-image: url('<?php echo $page->coverImage(); ?>');">
<div style="height: 300px;"></div>
</div>
<?php endif ?>
<!-- Page content -->
<div class="page-content">
<?php echo $page->content(); ?>
<?php echo $page->content(); ?>
</div>
<!-- Load Bludit Plugins: Page End -->

View file

@ -19,7 +19,8 @@ img {
}
pre, code {
pre,
code {
background: #f8f8f8;
color: #333;
}
@ -57,7 +58,8 @@ tr {
border-color: inherit;
}
th, td {
th,
td {
padding: 0.5em 1em;
}
@ -67,10 +69,10 @@ h2.title {
}
blockquote {
padding: 10px 20px;
margin: 0 0 20px 20px;
border-left: 5px solid #eee;
font-style: italic;
padding: 10px 20px;
margin: 0 0 20px 20px;
border-left: 5px solid #eee;
font-style: italic;
}
/* Navbar */
@ -113,3 +115,7 @@ footer {
list-style: none;
padding: 0 0 0 10px;
}
.bi {
margin-right: .5rem !important;
}

View file

@ -2,9 +2,9 @@
"author": "Bludit",
"email": "",
"website": "https://themes.bludit.com",
"version": "3.14.1",
"releaseDate": "2022-08-07",
"version": "3.15.0",
"releaseDate": "2023-07-15",
"license": "MIT",
"compatible": "3.14.1",
"compatible": "3.15.0",
"notes": ""
}
}

View file

@ -14,6 +14,9 @@
<!-- Include Bootstrap CSS file bootstrap.css -->
<?php echo Theme::cssBootstrap(); ?>
<!-- Include CSS Bootstrap ICONS file from Bludit Core -->
<?php echo Theme::cssBootstrapIcons(); ?>
<!-- Include CSS Styles from this theme -->
<?php echo Theme::css('css/style.css'); ?>

View file

@ -1,71 +1,74 @@
<?php if (empty($content)): ?>
<div class="mt-4">
<?php $language->p('No pages found') ?>
</div>
<?php if (empty($content)) : ?>
<div class="mt-4">
<?php $language->p('No pages found') ?>
</div>
<?php endif ?>
<?php foreach ($content as $page): ?>
<!-- Post -->
<div class="card my-5 border-0">
<?php foreach ($content as $page) : ?>
<!-- Post -->
<div class="card my-5 border-0">
<!-- Load Bludit Plugins: Page Begin -->
<?php Theme::plugins('pageBegin'); ?>
<!-- Load Bludit Plugins: Page Begin -->
<?php Theme::plugins('pageBegin'); ?>
<!-- Cover image -->
<?php if ($page->coverImage()): ?>
<img class="card-img-top mb-3 rounded-0" alt="Cover Image" src="<?php echo $page->coverImage(); ?>"/>
<?php endif ?>
<!-- Cover image -->
<?php if ($page->coverImage()) : ?>
<img class="card-img-top mb-3 rounded-0" alt="Cover Image" src="<?php echo $page->coverImage(); ?>" />
<?php endif ?>
<div class="card-body p-0">
<!-- Title -->
<a class="text-dark" href="<?php echo $page->permalink(); ?>">
<h2 class="title"><?php echo $page->title(); ?></h2>
</a>
<div class="card-body p-0">
<!-- Title -->
<a class="text-dark" href="<?php echo $page->permalink(); ?>">
<h2 class="title"><?php echo $page->title(); ?></h2>
</a>
<!-- Creation date -->
<h6 class="card-subtitle mb-3 text-muted"><?php echo $page->date(); ?> - <?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?></h6>
<!-- Creation date -->
<h6 class="card-subtitle mt-1 mb-4 text-muted">
<i class="bi bi-calendar"></i><?php echo $page->date(); ?>
<i class="ml-3 bi bi-clock-history"></i><?php echo $L->get('Reading time') . ': ' . $page->readingTime(); ?>
</h6>
<!-- Breaked content -->
<?php echo $page->contentBreak(); ?>
<!-- Breaked content -->
<?php echo $page->contentBreak(); ?>
<!-- "Read more" button -->
<?php if ($page->readMore()): ?>
<a href="<?php echo $page->permalink(); ?>"><?php echo $L->get('Read more'); ?></a>
<?php endif ?>
<!-- "Read more" button -->
<?php if ($page->readMore()) : ?>
<a href="<?php echo $page->permalink(); ?>"><?php echo $L->get('Read more'); ?></a>
<?php endif ?>
</div>
</div>
<!-- Load Bludit Plugins: Page End -->
<?php Theme::plugins('pageEnd'); ?>
<!-- Load Bludit Plugins: Page End -->
<?php Theme::plugins('pageEnd'); ?>
</div>
<hr>
</div>
<hr>
<?php endforeach ?>
<!-- Pagination -->
<?php if (Paginator::numberOfPages()>1): ?>
<nav class="paginator">
<ul class="pagination flex-wrap">
<?php if (Paginator::numberOfPages() > 1) : ?>
<nav class="paginator">
<ul class="pagination flex-wrap">
<!-- Previous button -->
<?php if (Paginator::showPrev()): ?>
<li class="page-item mr-2">
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">&#9664; <?php echo $L->get('Previous'); ?></a>
</li>
<?php endif; ?>
<!-- Previous button -->
<?php if (Paginator::showPrev()) : ?>
<li class="page-item mr-2">
<a class="page-link" href="<?php echo Paginator::previousPageUrl() ?>" tabindex="-1">&#9664; <?php echo $L->get('Previous'); ?></a>
</li>
<?php endif; ?>
<!-- Home button -->
<li class="page-item <?php if (Paginator::currentPage()==1) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Theme::siteUrl() ?>">Home</a>
</li>
<!-- Home button -->
<li class="page-item <?php if (Paginator::currentPage() == 1) echo 'disabled' ?>">
<a class="page-link" href="<?php echo Theme::siteUrl() ?>">Home</a>
</li>
<!-- Next button -->
<?php if (Paginator::showNext()): ?>
<li class="page-item ml-2">
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $L->get('Next'); ?> &#9658;</a>
</li>
<?php endif; ?>
<!-- Next button -->
<?php if (Paginator::showNext()) : ?>
<li class="page-item ml-2">
<a class="page-link" href="<?php echo Paginator::nextPageUrl() ?>"><?php echo $L->get('Next'); ?> &#9658;</a>
</li>
<?php endif; ?>
</ul>
</nav>
</ul>
</nav>
<?php endif ?>

113
bl-themes/popeye/css/01-style.css Executable file
View file

@ -0,0 +1,113 @@
/* COMMON */
a {
color: #495057;
text-decoration: none;
}
a:hover {
color: #0a58ca;
}
img {
max-width: 100%;
}
pre, code {
color: #f8f8f8;
background-color: #495057;
}
code {
display: inline-block;
padding: 0 0.5em;
line-height: 1.4em;
border-radius: 3px;
}
pre {
overflow-x: scroll;
padding: 1.6rem 2.2rem;
line-height: 1.5;
border-radius: 5px !important;
}
/* BOOTSTRAP */
.list-group-item {
background-color: inherit;
}
.badge {
font-size: 0.8rem;
font-weight: 400;
}
.bi {
margin-right: .5rem!important;
}
.btn:focus,
.form-control:focus,
.form-select:focus {
outline: none !important;
box-shadow: none !important;
}
/* PAGE */
section.page {
font-size: 1.1rem;
}
section.page .description {
font-style: italic;
}
section.page a {
color: #0a58ca;
}
section.page p {
margin-bottom: 1.2rem;
}
section.page h1.page-title {
font-size: 2rem;
}
section.page h2 {
font-size: 1.5rem;
}
section.page h3 {
font-size: 1.3rem;
}
section.page h4 {
font-size: 1.1rem;
}
section.page h5 {
font-size: 1rem;
}
section.page h2,
section.page h3,
section.page h4,
section.page h5 {
margin: 2rem 0 1rem 0;
}
/* VIDEO EMBED RESPONSIVE */
.video-embed {
overflow:hidden;
padding-bottom: 56.25%; /* 16:9 */
position:relative;
height:0;
}
.video-embed iframe{
left:0;
top:0;
height:100%;
width:100%;
position:absolute;
}

View file

@ -0,0 +1,20 @@
/* HELPERs */
.color-blue {
color: #0a58ca;
}
.color-light {
color: #495057;
}
.bold {
font-weight: 600;
}
.italic {
font-style: italic;
}
.bg-gray {
background-color: #ececec;
}

View file

@ -0,0 +1,50 @@
body {
background-color: #1C1C1E !important;
color: #b3b3b3 !important;
}
a {
color: #b3b3b3 !important;
}
a:hover {
color: #e2e2e2 !important
}
a.badge:hover {
color: #999 !important;
}
.form-text {
color: #989899 !important;
}
.bg-light {
background-color: #000 !important;
}
.color-blue {
color: #688bbd !important;
}
.btn-outline-primary {
color: #688bbd !important;
border-color: #688bbd !important;
}
.btn-outline-primary:hover {
background-color: #1C1C1E !important;
color: #fff !important;
}
.page-link {
color: #688bbd !important;
border-color: #688bbd !important;
background-color: #1C1C1E !important;
}
.form-control {
background-color: #1C1C1E !important;
border-color: #302F33 !important;
color: #b3b3b3 !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

87
bl-themes/popeye/index.php Executable file
View file

@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="<?php echo Theme::lang() ?>">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Bludit">
<!-- Generate <title>...</title> -->
<?php echo Theme::metaTagTitle(); ?>
<!-- Generate <meta name="description" content="..."> -->
<?php echo Theme::metaTagDescription(); ?>
<!-- Generate <link rel="icon" href="..."> -->
<?php echo Theme::favicon('img/favicon.png'); ?>
<!-- Include CSS Bootstrap file from Bludit Core -->
<?php echo Theme::cssBootstrap(); ?>
<!-- Include CSS Bootstrap ICONS file from Bludit Core -->
<?php echo Theme::cssBootstrapIcons(); ?>
<!-- Include CSS Styles -->
<?php
echo Theme::css(array(
'css/01-style.css',
'css/02-helpers.css'
));
# Apply the following CSS only for Dark Mode
if ($themePlugin->darkMode()) {
echo Theme::css(
'css/99-darkmode.css'
);
}
?>
<?php if ($themePlugin->googleFonts()) : ?>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:sans,bold">
<style>
body {
font-family: "Open Sans", sans-serif;
}
</style>
<?php endif; ?>
<!-- Execute Bludit plugins for the hook "Site head" -->
<?php Theme::plugins('siteHead'); ?>
</head>
<body>
<!-- Execute Bludit plugins for the hook "Site body begin" -->
<?php Theme::plugins('siteBodyBegin'); ?>
<!-- Navbar -->
<?php include(THEME_DIR_PHP . 'navbar.php'); ?>
<!-- Content -->
<?php
// $WHERE_AM_I variable provides where the user is browsing
// If the user is watching a particular page the variable takes the value "page"
// If the user is watching the frontpage the variable takes the value "home"
// If the user is watching a particular category the variable takes the value "category"
if ($WHERE_AM_I == 'page') {
include(THEME_DIR_PHP . 'page.php');
} else {
include(THEME_DIR_PHP . 'home.php');
}
?>
<!-- Footer -->
<?php include(THEME_DIR_PHP . 'footer.php'); ?>
<!-- Include Jquery file from Bludit Core -->
<?php echo Theme::jquery(); ?>
<!-- Include javascript Bootstrap file from Bludit Core -->
<?php echo Theme::jsBootstrap(); ?>
<!-- Execute Bludit plugins for the hook "Site body end" -->
<?php Theme::plugins('siteBodyEnd'); ?>
</body>
</html>

View file

@ -0,0 +1,5 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
if ($themePlugin == false) {
exit("To ensure proper functionality, the theme requires the Popeye plugin. Activate the plugin through the admin panel.");
}

View file

@ -0,0 +1,10 @@
{
"theme-data":
{
"name": "Popeye",
"description": ""
},
"related-pages": "Verwandte Seiten",
"minutes": "Minuten",
"read": "Lesezeit"
}

View file

@ -0,0 +1,10 @@
{
"theme-data":
{
"name": "Popeye",
"description": ""
},
"related-pages": "Verwandte Seiten",
"minutes": "Minuten",
"read": "Lesezeit"
}

View file

@ -0,0 +1,10 @@
{
"theme-data":
{
"name": "Popeye",
"description": ""
},
"related-pages": "Verwandte Seiten",
"minutes": "Minuten",
"read": "Lesezeit"
}

View file

@ -0,0 +1,10 @@
{
"theme-data":
{
"name": "Popeye",
"description": ""
},
"related-pages": "Related pages",
"minutes": "minutes",
"read": "read"
}

Some files were not shown because too many files have changed in this diff Show more