Bug fixes, index.md compatibility

This commit is contained in:
dignajar 2016-07-25 20:40:51 -03:00
parent 2de4144254
commit 44274331d8
4 changed files with 25 additions and 27 deletions

View File

@ -91,7 +91,7 @@ define('NO_PARENT_CHAR', '3849abb4cb7abd24c2d8dac17b216f17');
define('POSTS_PER_PAGE_ADMIN', 10);
// Cli mode status for new posts/pages
define('CLI_MODE', TRUE);
define('CLI_MODE', FALSE);
// Cli mode status for new posts/pages
define('CLI_STATUS', 'published');
@ -100,7 +100,7 @@ define('CLI_STATUS', 'published');
define('CLI_USERNAME', 'admin');
// Filename for posts and pages
define('FILENAME', 'index.txt');
define('FILENAME', 'index.md');
// Database date format
define('DB_DATE_FORMAT', 'Y-m-d H:i:s');
@ -123,17 +123,11 @@ define('EXTREME_FRIENDLY_URL', false);
// Directory permissions
define('DIR_PERMISSIONS', 0755);
// Multibyte string extension loaded.
define('MB_STRING', extension_loaded('mbstring'));
// Set internal character encoding.
mb_internal_encoding(CHARSET);
if(MB_STRING)
{
// Set internal character encoding.
mb_internal_encoding(CHARSET);
// Set HTTP output character encoding.
mb_http_output(CHARSET);
}
// Set HTTP output character encoding.
mb_http_output(CHARSET);
// Inclde Abstract Classes
include(PATH_ABSTRACT.'dbjson.class.php');

View File

@ -84,7 +84,7 @@ class dbPages extends dbJSON
// Make the index.txt and save the file.
$data = implode("\n", $dataForFile);
if( file_put_contents(PATH_PAGES.$key.FILENAME, $data) === false ) {
if( file_put_contents(PATH_PAGES.$key.DS.FILENAME, $data) === false ) {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to put the content in the file index.txt');
return false;
}

View File

@ -43,7 +43,7 @@ class pluginPages extends Plugin {
}
$html .= '<div class="plugin-content">';
$html .= '<ul>';
$html .= '<ul class="parents">';
// Show home link ?
if($this->getDbField('homeLink')) {
@ -59,8 +59,8 @@ class pluginPages extends Plugin {
if( $parent->published() )
{
// Print the parent
$html .= '<li>';
$html .= '<a class="parent '.( ($parent->key()==$Url->slug())?' active':'').'" href="'.$parent->permalink().'">'.$parent->title().'</a>';
$html .= '<li class="parent">';
$html .= '<a class="parent'.( ($parent->key()==$Url->slug())?' active':'').'" href="'.$parent->permalink().'">'.$parent->title().'</a>';
// Check if the parent has children
if(isset($pagesParents[$parent->key()]))

View File

@ -41,7 +41,7 @@ define('PATH_ABSTRACT', PATH_KERNEL.'abstract'.DS);
define('CHECK_SYMBOLIC_LINKS', TRUE);
// Filename for posts and pages
define('FILENAME', 'index.txt');
define('FILENAME', 'index.md');
// Domain and protocol
define('DOMAIN', $_SERVER['HTTP_HOST']);
@ -92,17 +92,11 @@ define('DB_DATE_FORMAT', 'Y-m-d H:i:s');
// Charset, default UTF-8.
define('CHARSET', 'UTF-8');
// Multibyte string extension loaded.
define('MB_STRING', extension_loaded('mbstring'));
// Set internal character encoding.
mb_internal_encoding(CHARSET);
if(MB_STRING)
{
// Set internal character encoding.
mb_internal_encoding(CHARSET);
// Set HTTP output character encoding.
mb_http_output(CHARSET);
}
// Set HTTP output character encoding.
mb_http_output(CHARSET);
// --- PHP Classes ---
@ -226,6 +220,16 @@ function checkSystem()
array_push($stdOut, $tmp);
}
if(!in_array('mbstring', $phpModules))
{
$errorText = 'PHP module Multibyte String (mbstring) is not installed. (ERR_206)';
error_log($errorText, 0);
$tmp['title'] = 'PHP module';
$tmp['errorText'] = $errorText;
array_push($stdOut, $tmp);
}
// Try to create the directory content
@mkdir(PATH_CONTENT, $dirpermissions, true);