diff --git a/features.txt b/features.txt index 5d20744c..e764b0c4 100644 --- a/features.txt +++ b/features.txt @@ -12,6 +12,7 @@ ToDO list - Implement User class - Themes - Plugins multilangueage +- Format date, for post and pages Check: - ver casos de errores, filtros url iguales, con una / diff --git a/kernel/abstract/dbjson.class.php b/kernel/abstract/dbjson.class.php index 067ff43a..b37bfb29 100644 --- a/kernel/abstract/dbjson.class.php +++ b/kernel/abstract/dbjson.class.php @@ -69,7 +69,7 @@ class dbJSON } // DEBUG, ver si sirve para la instalacion, sino borrar - public function setDb($db) + public function set($db) { $this->db = $db; diff --git a/kernel/abstract/plugin.class.php b/kernel/abstract/plugin.class.php index 7496c02e..ee8118c9 100644 --- a/kernel/abstract/plugin.class.php +++ b/kernel/abstract/plugin.class.php @@ -113,6 +113,7 @@ class Plugin { if( !empty($this->dbFields) ) { + // DEBUG: NO ME GUSTA LLAMAR A UNA CLASE $Tmp = new dbJSON($this->fileDb); $Tmp->setDb($this->dbFields); } diff --git a/kernel/boot/rules/70.build_pages.php b/kernel/boot/rules/70.build_pages.php index 15ce24e2..062abe87 100644 --- a/kernel/boot/rules/70.build_pages.php +++ b/kernel/boot/rules/70.build_pages.php @@ -70,7 +70,10 @@ function build_page($key) if( $dbUsers->userExists( $Page->username() ) ) { $user = $dbUsers->get( $Page->username() ); - $Page->setField('author', $user['firstName'].', '.$user['lastName']); + + $Page->setField('authorFirstName', $user['firstName'], false); + + $Page->setField('authorLastName', $user['lastName'], false); } return $Page; diff --git a/kernel/boot/rules/70.build_posts.php b/kernel/boot/rules/70.build_posts.php index 28599a0f..7f30b9b8 100644 --- a/kernel/boot/rules/70.build_posts.php +++ b/kernel/boot/rules/70.build_posts.php @@ -54,12 +54,14 @@ function buildPost($key) $content = $Parsedown->text( $Post->content() ); $Post->setField('content', $content, true); - // User / Author + // Parse username for the post. if( $dbUsers->userExists( $Post->username() ) ) { $user = $dbUsers->get( $Post->username() ); - $Post->setField('author', $user['firstName'].', '.$user['lastName'], false); + $Post->setField('authorFirstName', $user['firstName'], false); + + $Post->setField('authorLastName', $user['lastName'], false); } return $Post; diff --git a/kernel/boot/rules/80.plugins.php b/kernel/boot/rules/80.plugins.php index 28ba0681..259cab1e 100644 --- a/kernel/boot/rules/80.plugins.php +++ b/kernel/boot/rules/80.plugins.php @@ -62,7 +62,7 @@ function build_plugins() $database = new dbJSON($languageFilename, false); } $databaseArray = $database->get(); - $Plugin->setData( $data['plugin-data'] ); + $Plugin->setData( $databaseArray['plugin-data'] ); // Add words to language dictionary. unset($databaseArray['plugin-data']); diff --git a/kernel/page.class.php b/kernel/page.class.php index d4e90c64..4ea00382 100644 --- a/kernel/page.class.php +++ b/kernel/page.class.php @@ -181,9 +181,14 @@ class Page extends fileContent return $this->getField('username'); } - public function author() + public function authorFirstName() { - return $this->getField('author'); + return $this->getField('authorFirstName'); + } + + public function authorLastName() + { + return $this->getField('authorLastName'); } } diff --git a/kernel/post.class.php b/kernel/post.class.php index 55c0aa33..23e7120b 100644 --- a/kernel/post.class.php +++ b/kernel/post.class.php @@ -49,20 +49,25 @@ class Post extends fileContent return $this->getField('key'); } - public function username() - { - return $this->getField('username'); - } - // Returns TRUE if the post is published, FALSE otherwise. public function published() { return ($this->getField('status')==='published'); } - public function author() + public function username() { - return $this->getField('author'); + return $this->getField('username'); + } + + public function authorFirstName() + { + return $this->getField('authorFirstName'); + } + + public function authorLastName() + { + return $this->getField('authorLastName'); } public function description() diff --git a/themes/pure-clean/css/blog.css b/themes/pure-clean/css/blog.css index e6295ee0..23978436 100644 --- a/themes/pure-clean/css/blog.css +++ b/themes/pure-clean/css/blog.css @@ -36,6 +36,8 @@ .post-title a { color: #555; + border-bottom: 5px solid #ccc; + display: inline-block; } .page-content, @@ -83,11 +85,19 @@ } .post-meta { - color: #999; font-size: 90%; margin: 0; } +.post-meta span.date { + color: #999; + margin-right: 10px; +} + +.post-meta span.author { + color: #ccc; +} + .post-images { margin: 1em 0; } diff --git a/themes/pure-clean/php/home.php b/themes/pure-clean/php/home.php index f1c1147b..fd55089d 100644 --- a/themes/pure-clean/php/home.php +++ b/themes/pure-clean/php/home.php @@ -3,20 +3,39 @@
+ +
+ +

title() ?>

- + + +
-
+ +
content() ?>
+
\ No newline at end of file diff --git a/themes/pure-clean/php/page.php b/themes/pure-clean/php/page.php index 52302df8..ce7328a1 100644 --- a/themes/pure-clean/php/page.php +++ b/themes/pure-clean/php/page.php @@ -1,11 +1,36 @@ +

Page

+
-
-

- # title() ?> -

+ + + +
content() ?>
+
\ No newline at end of file diff --git a/themes/pure-clean/php/post.php b/themes/pure-clean/php/post.php index e6c3bf7a..5cf6f4c8 100644 --- a/themes/pure-clean/php/post.php +++ b/themes/pure-clean/php/post.php @@ -1,18 +1,37 @@ -

Posts

+

Post

+ +
+ +

- title() ?> + title() ?>

- + + +
-
+ +
content() ?>
+
\ No newline at end of file