From 22dacc02179643ddd4578a34cf8693ef86791cf7 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 27 Apr 2017 12:37:01 +0200 Subject: Several changes have been made in this commit, which together with the previous commits result in version 2.0 (database update required): + Implemented [core]: A new database field has been added to all tables to define optional "arguments" for a page, post or user through the content editor. These arguments will be parsed into key->value pairs and can be used within templates to do something special. Please read the wiki of this repository for further information about this new feature. + Bugfix [core]: The function "makeSlugURL" had not convert uppercase umlauts to lowercase because "strtolower" was used instead of the multibyte equivalent "mb_strtolower". + Optimization [core]: The first regular expression within the function "makeSlugURL" has been optimized (checking for uppercase characters at this point is unnecessary because $string is only lowercase). + Optimization [all templates]: Markup for the pagination.php has been simplified (a little bit). + Optimization [admin template]: The javascript for the arrow key navigation has been outsourced to the main.js file. + Optimization [admin template]: The javascript file will now be included with the "defer" attribute. + Optimization [standard template]: Some language variables have been changed. Database update to version 2.0 (no existing data will be lost or changed): ALTER TABLE `page` ADD `argv` VARCHAR(100) NULL DEFAULT NULL AFTER `body`; ALTER TABLE `post` ADD `argv` VARCHAR(100) NULL DEFAULT NULL AFTER `body`; ALTER TABLE `user` ADD `argv` VARCHAR(100) NULL DEFAULT NULL AFTER `body`; --- admin/page/insert.php | 6 +++-- admin/page/update.php | 6 +++-- admin/post/insert.php | 4 ++- admin/post/update.php | 6 +++-- admin/user/insert.php | 4 ++- admin/user/update.php | 4 ++- core/functions.php | 8 ++++-- core/namespace/Item.php | 17 ++++++++++++ core/namespace/Page/Attribute.php | 1 + core/namespace/Post/Attribute.php | 1 + core/namespace/User/Attribute.php | 1 + database.sql | 21 ++++++++------- template/admin/html/main.php | 2 +- template/admin/html/page/form.php | 3 +++ template/admin/html/pagination.php | 51 +++++++++++++---------------------- template/admin/html/post/form.php | 3 +++ template/admin/html/user/form.php | 3 +++ template/admin/rsrc/main.js | 16 +++++++++++ template/standard/html/pagination.php | 35 +++++++++++------------- template/standard/lang/de.php | 4 +-- template/standard/lang/en.php | 2 +- 21 files changed, 122 insertions(+), 76 deletions(-) diff --git a/admin/page/insert.php b/admin/page/insert.php index fc89b20..5731b6f 100644 --- a/admin/page/insert.php +++ b/admin/page/insert.php @@ -12,12 +12,13 @@ require '../../core/application.php'; $Attribute = new Page\Attribute(); -if(HTTP::issetPOST('id', 'user', 'slug', 'name', 'body', 'time_insert', 'time_update', 'insert')) { +if(HTTP::issetPOST('id', 'user', 'slug', 'name', 'body', 'argv', 'time_insert', 'time_update', 'insert')) { $Attribute->set('id', HTTP::POST('id') ? HTTP::POST('id') : FALSE); $Attribute->set('user', HTTP::POST('user')); $Attribute->set('slug', HTTP::POST('slug') ? HTTP::POST('slug') : makeSlugURL(HTTP::POST('name'))); $Attribute->set('name', HTTP::POST('name') ? HTTP::POST('name') : NULL); - $Attribute->set('body', HTTP::POST('body') ? HTTP::POST('body') : FALSE); + $Attribute->set('body', HTTP::POST('body') ? HTTP::POST('body') : NULL); + $Attribute->set('argv', HTTP::POST('argv') ? HTTP::POST('argv') : NULL); $Attribute->set('time_insert', HTTP::POST('time_insert') ? HTTP::POST('time_insert') : date('Y-m-d H:i:s')); $Attribute->set('time_update', HTTP::POST('time_update') ? HTTP::POST('time_update') : date('Y-m-d H:i:s')); @@ -61,6 +62,7 @@ try { 'SLUG' => $Attribute->get('slug'), 'NAME' => $Attribute->get('name'), 'BODY' => $Attribute->get('body'), + 'ARGV' => $Attribute->get('argv'), 'TIME_INSERT' => $Attribute->get('time_insert'), 'TIME_UPDATE' => $Attribute->get('time_update'), ], diff --git a/admin/page/update.php b/admin/page/update.php index a5e723e..dc92073 100644 --- a/admin/page/update.php +++ b/admin/page/update.php @@ -17,11 +17,12 @@ try { $Page = Page\Factory::build(HTTP::GET('id')); $Attribute = $Page->getAttribute(); - if(HTTP::issetPOST('user', 'slug', 'name', 'body', 'time_insert', 'time_update', 'update')) { + if(HTTP::issetPOST('user', 'slug', 'name', 'body', 'argv', 'time_insert', 'time_update', 'update')) { $Attribute->set('user', HTTP::POST('user')); $Attribute->set('slug', HTTP::POST('slug') ? HTTP::POST('slug') : makeSlugURL(HTTP::POST('name'))); $Attribute->set('name', HTTP::POST('name') ? HTTP::POST('name') : NULL); - $Attribute->set('body', HTTP::POST('body') ? HTTP::POST('body') : FALSE); + $Attribute->set('body', HTTP::POST('body') ? HTTP::POST('body') : NULL); + $Attribute->set('argv', HTTP::POST('argv') ? HTTP::POST('argv') : NULL); $Attribute->set('time_insert', HTTP::POST('time_insert') ? HTTP::POST('time_insert') : date('Y-m-d H:i:s')); $Attribute->set('time_update', HTTP::POST('time_update') ? HTTP::POST('time_update') : date('Y-m-d H:i:s')); @@ -63,6 +64,7 @@ try { 'SLUG' => $Attribute->get('slug'), 'NAME' => $Attribute->get('name'), 'BODY' => $Attribute->get('body'), + 'ARGV' => $Attribute->get('argv'), 'TIME_INSERT' => $Attribute->get('time_insert'), 'TIME_UPDATE' => $Attribute->get('time_update'), ], diff --git a/admin/post/insert.php b/admin/post/insert.php index bcfb679..4587a87 100644 --- a/admin/post/insert.php +++ b/admin/post/insert.php @@ -12,12 +12,13 @@ require '../../core/application.php'; $Attribute = new Post\Attribute(); -if(HTTP::issetPOST('id', 'user', 'slug', 'name', 'body', 'time_insert', 'time_update', 'insert')) { +if(HTTP::issetPOST('id', 'user', 'slug', 'name', 'body', 'argv', 'time_insert', 'time_update', 'insert')) { $Attribute->set('id', HTTP::POST('id') ? HTTP::POST('id') : FALSE); $Attribute->set('user', HTTP::POST('user')); $Attribute->set('slug', HTTP::POST('slug') ? HTTP::POST('slug') : makeSlugURL(HTTP::POST('name'))); $Attribute->set('name', HTTP::POST('name') ? HTTP::POST('name') : NULL); $Attribute->set('body', HTTP::POST('body') ? HTTP::POST('body') : NULL); + $Attribute->set('argv', HTTP::POST('argv') ? HTTP::POST('argv') : NULL); $Attribute->set('time_insert', HTTP::POST('time_insert') ? HTTP::POST('time_insert') : date('Y-m-d H:i:s')); $Attribute->set('time_update', HTTP::POST('time_update') ? HTTP::POST('time_update') : date('Y-m-d H:i:s')); @@ -61,6 +62,7 @@ try { 'SLUG' => $Attribute->get('slug'), 'NAME' => $Attribute->get('name'), 'BODY' => $Attribute->get('body'), + 'ARGV' => $Attribute->get('argv'), 'TIME_INSERT' => $Attribute->get('time_insert'), 'TIME_UPDATE' => $Attribute->get('time_update'), ], diff --git a/admin/post/update.php b/admin/post/update.php index 109c056..7e3610f 100644 --- a/admin/post/update.php +++ b/admin/post/update.php @@ -17,11 +17,12 @@ try { $Post = Post\Factory::build(HTTP::GET('id')); $Attribute = $Post->getAttribute(); - if(HTTP::issetPOST('user', 'slug', 'name', 'body', 'time_insert', 'time_update', 'update')) { + if(HTTP::issetPOST('user', 'slug', 'name', 'body', 'argv', 'time_insert', 'time_update', 'update')) { $Attribute->set('user', HTTP::POST('user')); $Attribute->set('slug', HTTP::POST('slug') ? HTTP::POST('slug') : makeSlugURL(HTTP::POST('name'))); $Attribute->set('name', HTTP::POST('name') ? HTTP::POST('name') : NULL); - $Attribute->set('body', HTTP::POST('body') ? HTTP::POST('body') : FALSE); + $Attribute->set('body', HTTP::POST('body') ? HTTP::POST('body') : NULL); + $Attribute->set('argv', HTTP::POST('argv') ? HTTP::POST('argv') : NULL); $Attribute->set('time_insert', HTTP::POST('time_insert') ? HTTP::POST('time_insert') : date('Y-m-d H:i:s')); $Attribute->set('time_update', HTTP::POST('time_update') ? HTTP::POST('time_update') : date('Y-m-d H:i:s')); @@ -63,6 +64,7 @@ try { 'SLUG' => $Attribute->get('slug'), 'NAME' => $Attribute->get('name'), 'BODY' => $Attribute->get('body'), + 'ARGV' => $Attribute->get('argv'), 'TIME_INSERT' => $Attribute->get('time_insert'), 'TIME_UPDATE' => $Attribute->get('time_update'), ], diff --git a/admin/user/insert.php b/admin/user/insert.php index 334b1ad..81daf98 100644 --- a/admin/user/insert.php +++ b/admin/user/insert.php @@ -12,7 +12,7 @@ require '../../core/application.php'; $Attribute = new User\Attribute(); -if(HTTP::issetPOST('id', 'slug', 'username', 'password', 'fullname', 'mailaddr', 'body', 'time_insert', 'time_update', 'insert')) { +if(HTTP::issetPOST('id', 'slug', 'username', 'password', 'fullname', 'mailaddr', 'body', 'argv', 'time_insert', 'time_update', 'insert')) { $Attribute->set('id', HTTP::POST('id') ? HTTP::POST('id') : FALSE); $Attribute->set('slug', HTTP::POST('slug') ? HTTP::POST('slug') : makeSlugURL(HTTP::POST('username'))); $Attribute->set('username', HTTP::POST('username') ? HTTP::POST('username') : NULL); @@ -20,6 +20,7 @@ if(HTTP::issetPOST('id', 'slug', 'username', 'password', 'fullname', 'mailaddr', $Attribute->set('fullname', HTTP::POST('fullname') ? HTTP::POST('fullname') : NULL); $Attribute->set('mailaddr', HTTP::POST('mailaddr') ? HTTP::POST('mailaddr') : NULL); $Attribute->set('body', HTTP::POST('body') ? HTTP::POST('body') : NULL); + $Attribute->set('argv', HTTP::POST('argv') ? HTTP::POST('argv') : NULL); $Attribute->set('time_insert', HTTP::POST('time_insert') ? HTTP::POST('time_insert') : date('Y-m-d H:i:s')); $Attribute->set('time_update', HTTP::POST('time_update') ? HTTP::POST('time_update') : date('Y-m-d H:i:s')); @@ -54,6 +55,7 @@ try { 'FULLNAME' => $Attribute->get('fullname'), 'MAILADDR' => $Attribute->get('mailaddr'), 'BODY' => $Attribute->get('body'), + 'ARGV' => $Attribute->get('argv'), 'TIME_INSERT' => $Attribute->get('time_insert'), 'TIME_UPDATE' => $Attribute->get('time_update'), ], diff --git a/admin/user/update.php b/admin/user/update.php index 1e9fa75..cdacfa0 100644 --- a/admin/user/update.php +++ b/admin/user/update.php @@ -17,13 +17,14 @@ try { $User = User\Factory::build(HTTP::GET('id')); $Attribute = $User->getAttribute(); - if(HTTP::issetPOST('slug', 'username', 'password', 'fullname', 'mailaddr', 'body', 'time_insert', 'time_update', 'update')) { + if(HTTP::issetPOST('slug', 'username', 'password', 'fullname', 'mailaddr', 'body', 'argv', 'time_insert', 'time_update', 'update')) { $Attribute->set('slug', HTTP::POST('slug') ? HTTP::POST('slug') : makeSlugURL(HTTP::POST('username'))); $Attribute->set('username', HTTP::POST('username') ? HTTP::POST('username') : NULL); $Attribute->set('password', HTTP::POST('password') ? password_hash(HTTP::POST('password'), PASSWORD_BCRYPT, ['cost' => 10]) : FALSE); $Attribute->set('fullname', HTTP::POST('fullname') ? HTTP::POST('fullname') : NULL); $Attribute->set('mailaddr', HTTP::POST('mailaddr') ? HTTP::POST('mailaddr') : NULL); $Attribute->set('body', HTTP::POST('body') ? HTTP::POST('body') : NULL); + $Attribute->set('argv', HTTP::POST('argv') ? HTTP::POST('argv') : NULL); $Attribute->set('time_insert', HTTP::POST('time_insert') ? HTTP::POST('time_insert') : date('Y-m-d H:i:s')); $Attribute->set('time_update', HTTP::POST('time_update') ? HTTP::POST('time_update') : date('Y-m-d H:i:s')); @@ -57,6 +58,7 @@ try { 'FULLNAME' => $Attribute->get('fullname'), 'MAILADDR' => $Attribute->get('mailaddr'), 'BODY' => $Attribute->get('body'), + 'ARGV' => $Attribute->get('argv'), 'TIME_INSERT' => $Attribute->get('time_insert'), 'TIME_UPDATE' => $Attribute->get('time_update'), ], diff --git a/core/functions.php b/core/functions.php index c6bdb1e..2e36524 100644 --- a/core/functions.php +++ b/core/functions.php @@ -90,6 +90,7 @@ function generateItemData(Item $Item): array { 'ID' => $Item->getID(), 'URL' => $Item->getURL(), 'GUID' => $Item->getGUID(), + 'ARGV' => $Item->getArguments(), 'PREV' => FALSE, 'NEXT' => FALSE, @@ -108,6 +109,7 @@ function generateItemData(Item $Item): array { 'SLUG' => $Item->attr('slug'), 'NAME' => $Item->attr('name'), 'BODY' => $Item->attr('body'), + 'ARGV' => $Item->attr('argv'), 'TIME_INSERT' => $Item->attr('time_insert'), 'TIME_UPDATE' => $Item->attr('time_update') ] @@ -136,6 +138,7 @@ function generateUserItemData(User\Item $User): array { 'ID' => $User->getID(), 'URL' => $User->getURL(), 'GUID' => $User->getGUID(), + 'ARGV' => $User->getArguments(), 'PREV' => FALSE, 'NEXT' => FALSE, @@ -152,6 +155,7 @@ function generateUserItemData(User\Item $User): array { 'ATTR' => [ 'SLUG' => $User->attr('slug'), 'BODY' => $User->attr('body'), + 'ARGV' => $User->attr('argv'), 'USERNAME' => $User->attr('username'), 'FULLNAME' => $User->attr('fullname'), 'MAILADDR' => $User->attr('mailaddr'), @@ -323,9 +327,9 @@ function description($string, $length = 200, $replace = ' […]') { # Generate a valid slug URL part from a string #=============================================================================== function makeSlugURL($string) { - $string = strtolower($string); + $string = mb_strtolower($string); $string = str_replace(['ä', 'ö', 'ü', 'ß'], ['ae', 'oe', 'ue', 'ss'], $string); - $string = preg_replace('/[^a-zA-Z0-9\-]/', '-', $string); + $string = preg_replace('/[^a-z0-9\-]/', '-', $string); $string = preg_replace('/-+/', '-', $string); return trim($string, '-'); diff --git a/core/namespace/Item.php b/core/namespace/Item.php index f3b6ceb..426dd2a 100644 --- a/core/namespace/Item.php +++ b/core/namespace/Item.php @@ -101,6 +101,23 @@ abstract class Item implements ItemInterface { return []; } + #=============================================================================== + # Return parsed arguments + #=============================================================================== + public function getArguments(): array { + if($argv = $this->Attribute->get('argv')) { + foreach(explode('|', rtrim($argv, '|')) as $delimeter) { + $part = explode('=', $delimeter); + + if(!empty($part[0])) { + $arguments[strtoupper($part[0])] = $part[1] ?? TRUE; + } + } + } + + return $arguments ?? []; + } + #=============================================================================== # Return previous item ID #=============================================================================== diff --git a/core/namespace/Page/Attribute.php b/core/namespace/Page/Attribute.php index c12a2c8..b1c4e01 100644 --- a/core/namespace/Page/Attribute.php +++ b/core/namespace/Page/Attribute.php @@ -11,6 +11,7 @@ class Attribute extends \Attribute { protected $slug = FALSE; protected $name = FALSE; protected $body = FALSE; + protected $argv = FALSE; protected $time_insert = FALSE; protected $time_update = FALSE; diff --git a/core/namespace/Post/Attribute.php b/core/namespace/Post/Attribute.php index 6f20183..73af3a2 100644 --- a/core/namespace/Post/Attribute.php +++ b/core/namespace/Post/Attribute.php @@ -11,6 +11,7 @@ class Attribute extends \Attribute { protected $slug = FALSE; protected $name = FALSE; protected $body = FALSE; + protected $argv = FALSE; protected $time_insert = FALSE; protected $time_update = FALSE; diff --git a/core/namespace/User/Attribute.php b/core/namespace/User/Attribute.php index b161fa9..c83fdfc 100644 --- a/core/namespace/User/Attribute.php +++ b/core/namespace/User/Attribute.php @@ -13,6 +13,7 @@ class Attribute extends \Attribute { protected $fullname = FALSE; protected $mailaddr = FALSE; protected $body = FALSE; + protected $argv = FALSE; protected $time_insert = FALSE; protected $time_update = FALSE; diff --git a/database.sql b/database.sql index efcd044..d85089a 100644 --- a/database.sql +++ b/database.sql @@ -8,7 +8,8 @@ CREATE TABLE `page` ( `user` tinyint(4) NOT NULL, `slug` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `name` varchar(100) NOT NULL, - `body` text NOT NULL + `body` text NOT NULL, + `argv` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- ============================================================================= @@ -21,7 +22,8 @@ CREATE TABLE `post` ( `user` tinyint(4) NOT NULL, `slug` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, `name` varchar(100) NOT NULL, - `body` text NOT NULL + `body` text NOT NULL, + `argv` varchar(100) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; -- ============================================================================= @@ -36,18 +38,19 @@ CREATE TABLE `user` ( `password` char(64) CHARACTER SET latin1 DEFAULT NULL, `fullname` varchar(40) NOT NULL, `mailaddr` varchar(60) NOT NULL, - `body` text NOT NULL + `body` text NOT NULL, + `argv` varchar(100) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- ============================================================================= -- Insert demo page, post and user -- ============================================================================= -INSERT INTO `page` (`id`, `time_insert`, `time_update`, `user`, `slug`, `name`, `body`) VALUES -(1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1, 'example-page', 'Example Page', 'OK. You discovered that there is also a page functionality. But what is the difference between a **page** and a **post**? This is simple: There is not really much difference. But you can style posts and pages within the templates CSS completely independent from each other. For example, use **pages** for things like your imprint, your terms of use, your FAQ or other stuff. And **posts** for your main blog posts. A **page** (and also a **user**) has exactly the same functionality as already described within the [first post]({POST[1]})! 8)'); -INSERT INTO `post` (`id`, `time_insert`, `time_update`, `user`, `slug`, `name`, `body`) VALUES -(1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1, 'hello-world', 'Hello World!', 'Hello! This is the automatically generated first post on your new blog installation. You can type [Markdown](https://daringfireball.net/projects/markdown/) plaintext into the editor to format your content as you want. In this post you can see several examples to [format your content with Markdown](https://daringfireball.net/projects/markdown/syntax) and with the special features provided by this blog application. After you are familiar with the text formatting and done with the exploration of your new blog application, you can delete this post and create your own. Have fun! :)\r\n\r\n![Demo image: Computer Guy (Public Domain)]({FILE[\"image/content/computer-guy-public-domain.svg\"]})\r\n\r\n## Parsing emoticons (if `POST.EMOTICONS` is `TRUE` within your `configuration.php`)\r\n> You can insert one or more of the following emoticons into your posts by typing the emoticon as simple ASCII text. The emoticon parser will convert your ASCII emoticon to the HTML multibyte unicode equivalent. Each emoticon comes with an further explanation if you just hold your mouse over a emoticons face: \r\n> :) :( :D :P :O ;) ;( :| :X :/ 8) :S xD ^^\r\n\r\n## Dynamic internal URLs for items\r\nIf you want to link an item, please don\'t put the URL to the item hardcoded into your content! What if you want to change your site address (or the base directory) in the future? Then you have to change all links in your content. This is not cool! Thus, you can use the following code **without spaces between the braces** by knowing the ID of an item to link it dynamically:\r\n\r\n1. Example: `{ POST[1] }` \r\n{POST[1]}\r\n\r\n2. Example: `{ PAGE[1] }` \r\n{PAGE[1]}\r\n\r\n3. Example: `{ USER[1] }` \r\n{USER[1]}\r\n\r\n## Dynamic internal URLs for other resources\r\nThis also applies to any other resource that exists in the blog system and that you want to link to! You can link any other resource dynamically either relative to your base directory or relative to your resource directory for static content:\r\n\r\n* Example: `{ BASE[\"foo/bar/\"] }` \r\n{BASE[\"foo/bar/\"]}\r\n\r\n* Example: `{ FILE[\"foo/bar/\"] }` \r\n{FILE[\"foo/bar/\"]}\r\n\r\n### Anywhere …\r\nYou can use these codes anywhere in your markdown plaintext. This codes will be pre-parsed before the markdown parser gets the content. If the markdown parser begins then all codes already have been converted into the URLs.'); -INSERT INTO `user` (`id`, `time_insert`, `time_update`, `slug`, `username`, `password`, `fullname`, `mailaddr`, `body`) VALUES -(1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'change-me', 'ChangeMe', '$2y$10$jH48L1K1y9dB303aI2biN.ob0biZDuUbMxPKadi3wDqOIxj6yNT6K', 'John Doe', 'mail@example.org', 'Describe yourself.'); +INSERT INTO `page` (`id`, `time_insert`, `time_update`, `user`, `slug`, `name`, `body`, `argv`) VALUES +(1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1, 'example-page', 'Example Page', 'OK. You discovered that there is also a page functionality. But what is the difference between a **page** and a **post**? This is simple: There is not really much difference. But you can style posts and pages within the templates CSS completely independent from each other. For example, use **pages** for things like your imprint, your terms of use, your FAQ or other stuff. And **posts** for your main blog posts. A **page** (and also a **user**) has exactly the same functionality as already described within the [first post]({POST[1]})! 8)', NULL); +INSERT INTO `post` (`id`, `time_insert`, `time_update`, `user`, `slug`, `name`, `body`, `argv`) VALUES +(1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1, 'hello-world', 'Hello World!', 'Hello! This is the automatically generated first post on your new blog installation. You can type [Markdown](https://daringfireball.net/projects/markdown/) plaintext into the editor to format your content as you want. In this post you can see several examples to [format your content with Markdown](https://daringfireball.net/projects/markdown/syntax) and with the special features provided by this blog application. After you are familiar with the text formatting and done with the exploration of your new blog application, you can delete this post and create your own. Have fun! :)\r\n\r\n![Demo image: Computer Guy (Public Domain)]({FILE[\"image/content/computer-guy-public-domain.svg\"]})\r\n\r\n## Parsing emoticons (if `POST.EMOTICONS` is `TRUE` within your `configuration.php`)\r\n> You can insert one or more of the following emoticons into your posts by typing the emoticon as simple ASCII text. The emoticon parser will convert your ASCII emoticon to the HTML multibyte unicode equivalent. Each emoticon comes with an further explanation if you just hold your mouse over a emoticons face: \r\n> :) :( :D :P :O ;) ;( :| :X :/ 8) :S xD ^^\r\n\r\n## Dynamic internal URLs for items\r\nIf you want to link an item, please don\'t put the URL to the item hardcoded into your content! What if you want to change your site address (or the base directory) in the future? Then you have to change all links in your content. This is not cool! Thus, you can use the following code **without spaces between the braces** by knowing the ID of an item to link it dynamically:\r\n\r\n1. Example: `{ POST[1] }` \r\n{POST[1]}\r\n\r\n2. Example: `{ PAGE[1] }` \r\n{PAGE[1]}\r\n\r\n3. Example: `{ USER[1] }` \r\n{USER[1]}\r\n\r\n## Dynamic internal URLs for other resources\r\nThis also applies to any other resource that exists in the blog system and that you want to link to! You can link any other resource dynamically either relative to your base directory or relative to your resource directory for static content:\r\n\r\n* Example: `{ BASE[\"foo/bar/\"] }` \r\n{BASE[\"foo/bar/\"]}\r\n\r\n* Example: `{ FILE[\"foo/bar/\"] }` \r\n{FILE[\"foo/bar/\"]}\r\n\r\n### Anywhere …\r\nYou can use these codes anywhere in your markdown plaintext. This codes will be pre-parsed before the markdown parser gets the content. If the markdown parser begins then all codes already have been converted into the URLs.', NULL); +INSERT INTO `user` (`id`, `time_insert`, `time_update`, `slug`, `username`, `password`, `fullname`, `mailaddr`, `body`, `argv`) VALUES +(1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'change-me', 'ChangeMe', '$2y$10$jH48L1K1y9dB303aI2biN.ob0biZDuUbMxPKadi3wDqOIxj6yNT6K', 'John Doe', 'mail@example.org', 'Describe yourself.', NULL); -- ============================================================================= -- Add keys for tables diff --git a/template/admin/html/main.php b/template/admin/html/main.php index d2fba38..bed186e 100644 --- a/template/admin/html/main.php +++ b/template/admin/html/main.php @@ -5,7 +5,7 @@ - + <?=escapeHTML($NAME)?> | Administration diff --git a/template/admin/html/page/form.php b/template/admin/html/page/form.php index 00a9c11..7d91af9 100644 --- a/template/admin/html/page/form.php +++ b/template/admin/html/page/form.php @@ -53,6 +53,9 @@
+
+ +