From 708514fc815fd36eafce785a664b81a737610b55 Mon Sep 17 00:00:00 2001 From: dignajar Date: Sun, 20 Sep 2015 18:46:50 -0300 Subject: [PATCH 1/5] Updates --- admin/themes/default/css/favicon.png | Bin 0 -> 1005 bytes admin/themes/default/index.php | 2 + kernel/boot/rules/70.pages.php | 15 ++--- kernel/boot/rules/70.posts.php | 16 ++--- kernel/dbpages.class.php | 24 ++++++-- kernel/dbposts.class.php | 85 +++++++++++++++------------ kernel/helpers/filesystem.class.php | 2 + plugins/pages/plugin.php | 45 +++++++------- themes/pure/css/blog.css | 8 ++- 9 files changed, 109 insertions(+), 88 deletions(-) create mode 100644 admin/themes/default/css/favicon.png diff --git a/admin/themes/default/css/favicon.png b/admin/themes/default/css/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..517c6c127f5793d143f271e7008b55c45bcb4c25 GIT binary patch literal 1005 zcmVPx&r%6OXR9FeUSIu^J=B^nFVvZj#AnEt?Ju^X9#8 z-g`T<`{r8{)7e}um$kmW-eWeKpU@H~^`>lxhgh~pE-x=X?d|P-U0Yi_hoM|EsR0KE z2M(*%+NRd6udm;lpPwHko0pu+o12^L?CeYp5y=TsPF-AF1jFI*ZxMj&@)9^cK7L^` znci`uX!QI2YRGlz2)6FpHE1>STJL*DWnAVYl0TTjaOW3GkRb z7K`P(*XzB<6@1J~fX>;*4MvZ&6An6#&xJc-;elFPTdPQZFG-R;7K<@-o6W|ms-V7V z^g^M8XxL5EF;9{wG!_f(v6A9o}t9WZ@Xb{C{LLInP0@KseY=3{h$eGXQV{L7D7ik^_ zMe5W0gvSha0A%7$2|$tBZnq2hKy`I>5mtxd*R>Ovn3&Mv zS2rYv1R~VkdY1$O0k*rls|!9pKF*v@&5tZ1fy2>V{alwv0wod&c6fNG3r>_w6NlIm z2xMbpBRHI{YKVf;-rlb1m>cWr>bNKx6NoK=y;1^Ggm@-G73z9>d)fK9F2c)dYikRa ztLIaQjdy^7z0&P8N@Cd?adL7}_!+7_b6JB=oFFD}sDupE8SEAE|7eKC>AJE52ny;< z?DYYOJz7bOjg7I>(^D--&PM)nvPxJ+EI!XA0N(C!IQqd}scbp`NT(Ir#<9vscX-}h z?*zW+$)hy(tN#&{Bj8T5+wvGd=pqr62xHpD#zvAJ>=EC3?lms~C>ItMeo&U(Brea* z%_;1dga37;uO^*Jr5=Vtp`V35a)pw6-^XI55Lx{0#iAoik$=$47T#pz$t z*V)UBJ?m=k00000NkvXXu0mjflz!ZO literal 0 HcmV?d00001 diff --git a/admin/themes/default/index.php b/admin/themes/default/index.php index e2c4f1f0..f09e96b9 100644 --- a/admin/themes/default/index.php +++ b/admin/themes/default/index.php @@ -8,6 +8,8 @@ <?php echo $layout['title'] ?> + + diff --git a/kernel/boot/rules/70.pages.php b/kernel/boot/rules/70.pages.php index d3ebd2bf..2e0400ce 100644 --- a/kernel/boot/rules/70.pages.php +++ b/kernel/boot/rules/70.pages.php @@ -30,26 +30,21 @@ function build_page($key) global $dbUsers; global $Parsedown; - // Page object. + // Page object, content from FILE. $Page = new Page($key); if( !$Page->isValid() ) { return false; } - // Page database. + // Page database, content from DATABASE JSON. $db = $dbPages->getDb($key); if( !$db ) { return false; } - // Foreach field from database. - foreach($db as $field=>$value) - { - // Not overwrite the value from file. - $Page->setField($field, $value, false); - - // Overwrite the value on the db. - //$dbPages->setDb($key, $field, $value); + // Foreach field from DATABASE. + foreach($db as $field=>$value) { + $Page->setField($field, $value); } // Content in raw format diff --git a/kernel/boot/rules/70.posts.php b/kernel/boot/rules/70.posts.php index fc01bf6f..62f6ff9e 100644 --- a/kernel/boot/rules/70.posts.php +++ b/kernel/boot/rules/70.posts.php @@ -34,25 +34,23 @@ function buildPost($key) global $Parsedown; global $Site; - // Post object, this get the content from the file. + // Post object, content from FILE. $Post = new Post($key); if( !$Post->isValid() ) { Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the post from file with key: '.$key); return false; } - // Page database, this get the contente from the database json. + // Post database, content from DATABASE JSON. $db = $dbPosts->getDb($key); if( !$db ) { Log::set(__METHOD__.LOG_SEP.'Error occurred when trying build the post from database with key: '.$key); return false; } - // Foreach field from database. - foreach($db as $field=>$value) - { - // Not overwrite the value from file. - $Post->setField($field, $value, false); + // Foreach field from DATABASE. + foreach($db as $field=>$value) { + $Post->setField($field, $value); } // Content in raw format @@ -119,7 +117,9 @@ function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeU // Search for changes on posts by the user. if( $Site->cliMode() ) { - $dbPosts->regenerateCli(); + if($dbPosts->regenerateCli()) { + reIndexTagsPosts(); + } } // Execute the scheduler. diff --git a/kernel/dbpages.class.php b/kernel/dbpages.class.php index 4be86e09..298349c5 100644 --- a/kernel/dbpages.class.php +++ b/kernel/dbpages.class.php @@ -372,13 +372,27 @@ class dbPages extends dbJSON // Update all fields from FILE to DATABASE. foreach($fields as $f=>$v) { - if($Page->getField($f)) { - // DEBUG: Validar/Sanitizar valores, ej: validar formato fecha - $this->db[$key][$f] = $Page->getField($f); + // If the field exists on the FILE, update it. + if($Page->getField($f)) + { + $valueFromFile = $Page->getField($f); + + if($f=='tags') { + // Generate tags array. + $this->db[$key]['tags'] = $this->generateTags($valueFromFile); + } + elseif($f=='date') { + // Validate Date from file + if(Valid::date($valueFromFile, DB_DATE_FORMAT)) { + $this->db[$key]['date'] = $valueFromFile; + } + } + else { + // Sanitize the values from file. + $this->db[$key][$f] = Sanitize::html($valueFromFile); + } } } - - // DEBUG: Update tags } // Remove old pages from db diff --git a/kernel/dbposts.class.php b/kernel/dbposts.class.php index 57d23dd4..68122961 100644 --- a/kernel/dbposts.class.php +++ b/kernel/dbposts.class.php @@ -378,13 +378,15 @@ class dbPosts extends dbJSON return $a['date']<$b['date']; } + // Return TRUE if there are new posts, FALSE otherwise. public function regenerateCli() { $db = $this->db; - $newPaths = array(); + $allPosts = array(); $fields = array(); + $currentDate = Date::current(DB_DATE_FORMAT); - // Default fields and value + // Generate default fields and values. foreach($this->dbFields as $field=>$options) { if(!$options['inFile']) { $fields[$field] = $options['value']; @@ -392,55 +394,62 @@ class dbPosts extends dbJSON } $fields['status'] = CLI_STATUS; - $fields['date'] = Date::current(DB_DATE_FORMAT); + $fields['date'] = $currentDate; - // Recovery pages from the first level of directories - //$tmpPaths = glob(PATH_POSTS.'*', GLOB_ONLYDIR); + // Recovery posts from the first level of directories $tmpPaths = Filesystem::listDirectories(PATH_POSTS); foreach($tmpPaths as $directory) { - $key = basename($directory); - - if(file_exists($directory.DS.'index.txt')) { - // The key is the directory name - $newPaths[$key] = true; - } - } - - foreach($newPaths as $key=>$value) - { - if(!isset($this->db[$key])) { - $this->db[$key] = $fields; - } - - $Post = new Post($key); - - // Update all fields from FILE to DATABASE. - foreach($fields as $f=>$v) + if(file_exists($directory.DS.'index.txt')) { - if($Post->getField($f)) { + // The key is the directory name. + $key = basename($directory); - $valueFromFile = $Post->getField($f); + // All keys posts + $allPosts[$key] = true; - // Validate values from file. - if($f=='tags') { - $valueFromFile = array_map('trim', explode(',', $valueFromFile)); - $valueFromFile = implode(',', $valueFromFile); - } - elseif($f=='date') { - if(!Valid::date($valueFromFile,DB_DATE_FORMAT)) { - $valueFromFile = Date::current(DB_DATE_FORMAT); + // Create the new entry if not exists on DATABASE. + if(!isset($this->db[$key])) { + // New entry on database + $this->db[$key] = $fields; + } + + // Create the post from FILE. + $Post = new Post($key); + + // Update all fields from FILE to DATABASE. + foreach($fields as $f=>$v) + { + // If the field exists on the FILE, update it. + if($Post->getField($f)) + { + $valueFromFile = $Post->getField($f); + + if($f=='tags') { + // Generate tags array. + $this->db[$key]['tags'] = $this->generateTags($valueFromFile); + } + elseif($f=='date') { + // Validate Date from file + if(Valid::date($valueFromFile, DB_DATE_FORMAT)) { + $this->db[$key]['date'] = $valueFromFile; + + if( $valueFromFile>$currentDate ) { + $this->db[$key]['status'] = 'scheduled'; + } + } + } + else { + // Sanitize the values from file. + $this->db[$key][$f] = Sanitize::html($valueFromFile); } } - - // Sanitize the values from file. - $this->db[$key][$f] = Sanitize::html($valueFromFile); } } } - // Remove old posts from db - foreach( array_diff_key($db, $newPaths) as $key=>$data ) { + // Remove orphan posts from db, the orphan posts are posts deleted by hand (directory deleted). + foreach( array_diff_key($db, $allPosts) as $key=>$data ) { unset($this->db[$key]); } diff --git a/kernel/helpers/filesystem.class.php b/kernel/helpers/filesystem.class.php index 3832d660..e5a3310e 100644 --- a/kernel/helpers/filesystem.class.php +++ b/kernel/helpers/filesystem.class.php @@ -3,6 +3,8 @@ class Filesystem { // NEW + + // Returns an array with the absolutes directories. public static function listDirectories($path, $regex='*') { $directories = glob($path.$regex, GLOB_ONLYDIR); diff --git a/plugins/pages/plugin.php b/plugins/pages/plugin.php index 262ad11c..a430fadf 100644 --- a/plugins/pages/plugin.php +++ b/plugins/pages/plugin.php @@ -32,49 +32,46 @@ class pluginPages extends Plugin { global $Language; global $pagesParents; global $Site, $Url; - $home = $Url->whereAmI()==='home'; $html = '
'; - // Print the label if it not empty. + // Print the label if not empty. $label = $this->getDbField('label'); if( !empty($label) ) { $html .= '

'.$label.'

'; } $html .= '
'; - - $parents = $pagesParents[NO_PARENT_CHAR]; - $html .= '
    '; + // Show home link ? if($this->getDbField('homeLink')) { - $current = ($Site->homeLink()==$home) ? ' class="active"' : ''; - $html .= ''.$Language->get('Home').''; + $html .= '
  • '; + $html .= ''.$Language->get('Home').''; + $html .= '
  • '; } + $parents = $pagesParents[NO_PARENT_CHAR]; foreach($parents as $parent) { - //if($Site->homepage()!==$parent->key()) + // Print the parent + $html .= '
  • '; + $html .= ''.$parent->title().''; + + // Check if the parent has children + if(isset($pagesParents[$parent->key()])) { - $current_parent = ($parent->slug()==$Url->slug()) ? ' class="active"' : ''; - // Print the parent - $html .= ''.$parent->title().''; + $children = $pagesParents[$parent->key()]; - // Check if the parent has children - if(isset($pagesParents[$parent->key()])) + // Print children + $html .= '
      '; + foreach($children as $child) { - $children = $pagesParents[$parent->key()]; - - // Print the children - $html .= '
        '; - foreach($children as $child) - { - $current_child = ($child->slug()==$Url->slug()) ? ' class="active"' : ''; - $html .= ''.$child->title().''; - } - $html .= '
      '; + $html .= '
    • '; + $html .= ''.$child->title().''; + $html .= '
    • '; } + $html .= '
    '; } } @@ -84,4 +81,4 @@ class pluginPages extends Plugin { return $html; } -} +} \ No newline at end of file diff --git a/themes/pure/css/blog.css b/themes/pure/css/blog.css index e08955f3..482f206b 100644 --- a/themes/pure/css/blog.css +++ b/themes/pure/css/blog.css @@ -268,9 +268,6 @@ div.plugin-content li { margin-top: 5px; } -div.plugin-content ul li.active a { - color: #2672ec; -} div.plugin-content ul { display: block; list-style-type: none; @@ -292,6 +289,11 @@ div.plugin-content ul > li > ul > li > a { color: #777; } +div.plugin-content a.active { + color: #2672ec !important; +} + + /* ------------------------ Responsive ------------------------ */ From 77ed877eb9cd349b712e506668097ebdb1b7448d Mon Sep 17 00:00:00 2001 From: hackdorte Date: Mon, 21 Sep 2015 07:00:33 -0300 Subject: [PATCH 2/5] Add pt_BR language --- languages/pt_BR.json | 159 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 languages/pt_BR.json diff --git a/languages/pt_BR.json b/languages/pt_BR.json new file mode 100644 index 00000000..9e1af774 --- /dev/null +++ b/languages/pt_BR.json @@ -0,0 +1,159 @@ +{ + "language-data": + { + "native": "Português (Brasil)", + "english-name": "Portuguese", + "last-update": "2015-09-21", + "author": "Hackdorte", + "email": "hackdorte@sapo.pt", + "website": "https://twitter.com/hackdorte" + }, + + "username": "Nome de usuário", + "password": "Senha", + "confirm-password": "Confirmar senha", + "editor": "Editor", + "dashboard": "Painel", + "role": "Cargo", + "post": "Postagem", + "posts": "Postagens", + "users": "Usuários", + "administrator": "Administrador", + "add": "Adicionar", + "cancel": "Cancelar", + "content": "Conteúdo", + "title": "Título", + "no-parent": "Sem parente", + "edit-page": "Editar página", + "edit-post": "Editar postagem", + "add-a-new-user": "Adicionar novo usuário", + "parent": "Parente", + "friendly-url": "URL amigável", + "description": "Descrição", + "posted-by": "Publicado por", + "tags": "Tags", + "position": "Posição", + "save": "Salvar", + "draft": "Rascunho", + "delete": "Deletar", + "registered": "Registrado", + "Notifications": "Notificações", + "profile": "Perfil", + "email": "Email", + "settings": "Configurações", + "general": "Geral", + "advanced": "Avançado", + "regional": "Regional", + "about": "Sobre", + "login": "Entrar", + "logout": "Sair", + "manage": "Administrar", + "themes": "Temas", + "prev-page": "Pág. anterior", + "next-page": "Pág. seguinte", + "configure-plugin": "Configurar plugin", + "confirm-delete-this-action-cannot-be-undone": "Confirmar exclusão. Esta operação não poderá ser desfeita.", + "site-title": "Título do site", + "site-slogan": "Slogan do site", + "site-description": "Descrição do site", + "footer-text": "Texto do rodapé", + "posts-per-page": "Postagens por páginas", + "site-url": "URL do site", + "writting-settings": "Configurações de escrita", + "url-filters": "Filtros para URL", + "page": "página", + "pages": "páginas", + "home": "Início", + "welcome-back": "Bem vindo(a)", + "language": "Idioma", + "website": "Website", + "timezone": "Zona horária", + "locale": "Codificação", + "new-post": "Nova postagem", + "new-page": "Nova página", + "html-and-markdown-code-supported": "Códigos HTML e Markdown são aceitos", + "manage-posts": "Gerenciar postagens", + "published-date": "Data de publicação", + "modified-date": "Data de modificação", + "empty-title": "Título vazio", + "plugins": "Plugins", + "install-plugin": "Instalar plugin", + "uninstall-plugin": "Desinstalar plugin", + "new-password": "Nova senha", + "edit-user": "Editar usuário", + "publish-now": "Publicar", + "first-name": "Nome", + "last-name": "Sobrenome", + "bludit-version": "Bludit versão", + "powered-by": "Feito com", + "recent-posts": "Postagens recentes", + "manage-pages": "Gerenciar páginas", + "advanced-options": "Opções avançadas", + "user-deleted": "Usuário Deletado", + "page-added-successfully": "Página criada com sucesso", + "post-added-successfully": "Postagem criada com sucesso ", + "the-post-has-been-deleted-successfully": "Postagem eliminada com sucesso", + "the-page-has-been-deleted-successfully": "Página deletada com sucesso", + "username-or-password-incorrect": "Nome ou senha incorretos", + "database-regenerated": "Base de dados regenerada", + "the-changes-have-been-saved": "As alterações foram salvas!", + "enable-more-features-at": "Habilitar mais funções em", + "username-already-exists": "Usuário não existe", + "username-field-is-empty": "O campo **Nome** não pode ficar vazio.", + "the-password-and-confirmation-password-do-not-match": "Ops! As senhas são diferentes.", + "user-has-been-added-successfully": "Usuário criado com sucesso", + "you-do-not-have-sufficient-permissions": "Você não tem permissão. Por favor entre em contato com o administrador do site", + "settings-advanced-writting-settings": "Configurações->Avançado->Configurações de escrita", + "new-posts-and-pages-synchronized": "Novas postagens e páginas sincronizadas.", + "you-can-choose-the-users-privilege": "Pode alterar os previlégios dos usuários. O editor só poderá gerenciar páginas e postagens.", + "email-will-not-be-publicly-displayed": "O endereço de email não é visível. Recomendado para recuperar sua senha e receber notificações.", + "use-this-field-to-name-your-site": "Utilize este campo para adicionar um título para seu site, ele aparecerá na parte superior das páginas.", + "use-this-field-to-add-a-catchy-phrase": "Utilize este campo se desejar adicionar um slogan ao nome do seu site.", + "you-can-add-a-site-description-to-provide": "Pode adicionar um descrição para promover uma biografia do seu site.", + "you-can-add-a-small-text-on-the-bottom": "Pode adicionar um pequeno texto no final da página. ex: copyright, autor, etc.", + "number-of-posts-to-show-per-page": "Número de postagens para mostrar por página.", + "the-url-of-your-site": "URL do seu site.", + "add-or-edit-description-tags-or": "Adicionar ou editar a descrição, tags e alterar URL amigável.", + "select-your-sites-language": "Selecione o idioma padrão do seu site.", + "select-a-timezone-for-a-correct": "Selecione a zona horária correta do seu país.", + "you-can-use-this-field-to-define-a-set-of": "Use este campo para o correto conjunto de idioma, país e preferências especiais.", + "you-can-modify-the-url-which-identifies": "Pode alterar a URL para facilitar a sua localização de forma legível. Em 150 caractéres.", + "this-field-can-help-describe-the-content": "Resumo do conteúdo da postagem. Em 150 caractéres.", + "write-the-tags-separeted-by-comma": "Criar tags separadas por vírgulas. ex: tag1, tag2, tag3", + "delete-the-user-and-all-its-posts": "Eliminar usuário e suas postagens", + "delete-the-user-and-associate-its-posts-to-admin-user": "Eliminar usuário e associar postagens ao administrador", + "read-more": "Ler mais", + "show-blog": "Ver blog", + "default-home-page": "página de início padrão", + "version": "Versão", + "there-are-no-drafts": "Não há rascunhos", + "create-a-new-article-for-your-blog":"Criar um novo artigo para seu blog.", + "create-a-new-page-for-your-website":"Criar nova página para seu site.", + "invite-a-friend-to-collaborate-on-your-website":"Convidar amigos para colaborar com seu site.", + "change-your-language-and-region-settings":"Modificar as configurações de idioma e região.", + "language-and-timezone":"Idioma e zona horária", + "author": "Autor", + "start-here": "Começe aqui", + "install-theme": "Instalar tema", + "first-post": "Primeira postagem", + "congratulations-you-have-successfully-installed-your-bludit": "Parabéns, você instalou **Bludit** com sucesso", + "whats-next": "Siguientes pasos", + "manage-your-bludit-from-the-admin-panel": "Gerencie seu Bludit em [painel de administração](./admin/)", + "follow-bludit-on": "Siga Bludit em", + "visit-the-support-forum": "Visite o [fórum](http://forum.bludit.com) para obter ajuda", + "read-the-documentation-for-more-information": "Leia a [documentación](http://docs.bludit.com) para mais informações", + "share-with-your-friends-and-enjoy": "Compartilhe com os seus amigos para que desfrutem também", + "the-page-has-not-been-found": "A página não foi localizada.", + "error": "Erro", + "bludit-installer": "Instalador do Bludit", + "welcome-to-the-bludit-installer": "Bem vindo(a) ao instalador do Bludit", + "complete-the-form-choose-a-password-for-the-username-admin": "Crie uma senha e informe um endereço de email para o usuário « admin »", + "password-visible-field": "Senha, este campo é visível.", + "install": "Instalar", + "the-password-field-is-empty": "Preencha o campo da senha", + "your-email-address-is-invalid":"O endereço do email é inválido", + "proceed-anyway": "Continuar assim mesmo!", + "drafts":"Rascunhos", + "ip-address-has-been-blocked":"O endereço de IP foi bloqueado.", + "try-again-in-a-few-minutes": "Volte e tente daqui uns minutinhos!" +} From 71864861fa86adc3564591c276f2988fc681862e Mon Sep 17 00:00:00 2001 From: dignajar Date: Mon, 21 Sep 2015 20:37:04 -0300 Subject: [PATCH 3/5] Updates --- kernel/boot/init.php | 3 ++ kernel/helpers/theme.class.php | 30 ++++++++++++------ kernel/page.class.php | 4 +++ kernel/post.class.php | 4 +++ themes/pure/css/blog.css | 17 +++++++--- themes/pure/index.php | 10 +++--- themes/pure/php/head.php | 57 +++++++++++++++------------------- 7 files changed, 75 insertions(+), 50 deletions(-) diff --git a/kernel/boot/init.php b/kernel/boot/init.php index 4189a0c8..d27d2090 100644 --- a/kernel/boot/init.php +++ b/kernel/boot/init.php @@ -152,10 +152,13 @@ define('HTML_PATH_THEME_JS', HTML_PATH_THEME.'js/'); define('HTML_PATH_THEME_IMG', HTML_PATH_THEME.'img/'); define('HTML_PATH_ADMIN_THEME', HTML_PATH_ROOT.'admin/themes/'.$Site->adminTheme().'/'); +define('HTML_PATH_ADMIN_THEME_JS', HTML_PATH_ADMIN_THEME.'js/'); define('HTML_PATH_ADMIN_ROOT', HTML_PATH_ROOT.'admin/'); define('HTML_PATH_UPLOADS', HTML_PATH_ROOT.'content/uploads/'); define('HTML_PATH_PLUGINS', HTML_PATH_ROOT.'plugins/'); +define('JQUERY', HTML_PATH_ADMIN_THEME_JS.'jquery.min.js'); + // PHP paths with dependency define('PATH_THEME', PATH_ROOT.'themes/'.$Site->theme().'/'); define('PATH_THEME_PHP', PATH_THEME.'php'.DS); diff --git a/kernel/helpers/theme.class.php b/kernel/helpers/theme.class.php index 58cd2297..4a61984a 100644 --- a/kernel/helpers/theme.class.php +++ b/kernel/helpers/theme.class.php @@ -4,6 +4,17 @@ class Theme { // NEW + public static function favicon($file='favicon.png', $path=HTML_PATH_THEME_IMG, $echo=true) + { + $tmp = ''.PHP_EOL; + + if($echo) { + echo $tmp; + } + + return $tmp; + } + public static function css($files, $path=HTML_PATH_THEME_CSS, $echo=true) { if(!is_array($files)) { @@ -109,6 +120,16 @@ class Theme { } } + public static function jquery($echo=true) + { + $tmp = ''.PHP_EOL; + + if($echo) { + echo $tmp; + } + + return $tmp; + } // OLD @@ -120,17 +141,8 @@ class Theme { return BLOG_URL; } - public static function jquery($path=JS_JQUERY) - { - $tmp = ''.PHP_EOL; - return $tmp; - } - public static function favicon() - { - return ''.PHP_EOL; - } public static function name() { diff --git a/kernel/page.class.php b/kernel/page.class.php index 8b4431da..7b6c5aa7 100644 --- a/kernel/page.class.php +++ b/kernel/page.class.php @@ -64,6 +64,10 @@ class Page extends fileContent return $tags; } else { + if($tags==false) { + return false; + } + // Return string with tags separeted by comma. return implode(', ', $tags); } diff --git a/kernel/post.class.php b/kernel/post.class.php index 0da32994..883eafff 100644 --- a/kernel/post.class.php +++ b/kernel/post.class.php @@ -126,6 +126,10 @@ class Post extends fileContent return $tags; } else { + if($tags==false) { + return false; + } + // Return string with tags separeted by comma. return implode(', ', $tags); } diff --git a/themes/pure/css/blog.css b/themes/pure/css/blog.css index 482f206b..df0e519a 100644 --- a/themes/pure/css/blog.css +++ b/themes/pure/css/blog.css @@ -54,6 +54,10 @@ pre, code { white-space: pre-wrap !important; } +blockquote { + border-left: 10px solid #f0f2f4; + padding-left: 10px; +} /* ------------------------ Content / Main @@ -139,15 +143,20 @@ margin: 0; .post-title a { color: #555; -border-bottom: 5px solid #ccc; display: inline-block; } .page a.read-more, .post a.read-more{ -display: block; -text-align: center; -padding: 2px 5px; + border: 1px solid #ccc; + display: inline-block; + margin-top: 10px; + padding: 2px 20px; +} + +.page a.read-more:hover, +.post a.read-more:hover{ + background: #f1f1f1; } diff --git a/themes/pure/index.php b/themes/pure/index.php index d8b93753..6a16a9b7 100644 --- a/themes/pure/index.php +++ b/themes/pure/index.php @@ -3,7 +3,7 @@ - + @@ -16,7 +16,7 @@ @@ -26,15 +26,15 @@ whereAmI()=='home') || ($Url->whereAmI()=='tag') ) { - include('php/home.php'); + include(PATH_THEME_PHP.'home.php'); } elseif($Url->whereAmI()=='post') { - include('php/post.php'); + include(PATH_THEME_PHP.'post.php'); } elseif($Url->whereAmI()=='page') { - include('php/page.php'); + include(PATH_THEME_PHP.'page.php'); } ?> diff --git a/themes/pure/php/head.php b/themes/pure/php/head.php index 7502dff7..43d6a590 100644 --- a/themes/pure/php/head.php +++ b/themes/pure/php/head.php @@ -1,13 +1,23 @@ + + + + +<?php echo $Site->title() ?> + Site title - Theme::title( $Site->title() ); - - // - Theme::description( $Site->description() ); + // Favicon from theme/img/ + Theme::favicon('favicon.png'); // if( $Url->whereAmI()=='post' ) { @@ -16,35 +26,18 @@ elseif( $Url->whereAmI()=='page' ) { Theme::keywords( $Page->tags() ); } - - // - // - // - // - Theme::css(array( - 'pure-min.css', - 'grids-responsive-min.css', - 'blog.css', - 'rainbow.github.css' - )); - - Theme::css(array( - 'http://fonts.googleapis.com/css?family=Open+Sans:400,300,600&subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,cyrillic,latin-ext' - ), ''); - - // - Theme::javascript(array( - 'rainbow.min.js' - )); ?> + + + - + \ No newline at end of file From 9d708050100dd118145288b6852284e07b90992f Mon Sep 17 00:00:00 2001 From: dignajar Date: Mon, 21 Sep 2015 23:05:54 -0300 Subject: [PATCH 4/5] Bug fixes --- kernel/dbpages.class.php | 1 + kernel/dbposts.class.php | 1 + 2 files changed, 2 insertions(+) diff --git a/kernel/dbpages.class.php b/kernel/dbpages.class.php index 298349c5..61933d7f 100644 --- a/kernel/dbpages.class.php +++ b/kernel/dbpages.class.php @@ -335,6 +335,7 @@ class dbPages extends dbJSON $fields['status'] = CLI_STATUS; $fields['date'] = Date::current(DB_DATE_FORMAT); + $fields['username'] = 'admin'; //$tmpPaths = glob(PATH_PAGES.'*', GLOB_ONLYDIR); $tmpPaths = Filesystem::listDirectories(PATH_PAGES); diff --git a/kernel/dbposts.class.php b/kernel/dbposts.class.php index 68122961..113d8dff 100644 --- a/kernel/dbposts.class.php +++ b/kernel/dbposts.class.php @@ -395,6 +395,7 @@ class dbPosts extends dbJSON $fields['status'] = CLI_STATUS; $fields['date'] = $currentDate; + $fields['username'] = 'admin'; // Recovery posts from the first level of directories $tmpPaths = Filesystem::listDirectories(PATH_POSTS); From 01803969dbab7f1a4910bf521b70a1098de67017 Mon Sep 17 00:00:00 2001 From: dignajar Date: Tue, 22 Sep 2015 19:41:10 -0300 Subject: [PATCH 5/5] Updates --- languages/en_US.json | 3 ++- plugins/pages/plugin.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/languages/en_US.json b/languages/en_US.json index 29eac24f..ddc020de 100644 --- a/languages/en_US.json +++ b/languages/en_US.json @@ -162,5 +162,6 @@ "you-can-schedule-the-post-just-select-the-date-and-time": "You can schedule the post, just select the date and time.", "scheduled": "Scheduled", "publish": "Publish", - "please-check-your-theme-configuration": "Please check your theme configuration." + "please-check-your-theme-configuration": "Please check your theme configuration.", + "plugin-label": "Plugin label" } diff --git a/plugins/pages/plugin.php b/plugins/pages/plugin.php index a430fadf..c75636f8 100644 --- a/plugins/pages/plugin.php +++ b/plugins/pages/plugin.php @@ -15,7 +15,7 @@ class pluginPages extends Plugin { global $Language; $html = '
    '; - $html .= ''; + $html .= ''; $html .= ''; $html .= '
    ';