aboutsummaryrefslogtreecommitdiffstats
path: root/core/db
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-07-22 16:10:16 +0200
committerThomas Lange <code@nerdmind.de>2021-07-22 16:10:16 +0200
commitc2cf93a2a492623eba55c1e78123cd3137cdb426 (patch)
tree71c67d54cdc1a4203d03d24701833c3a78b4bab2 /core/db
parent2a027f475847c2fee60b873be3fc55d845e68961 (diff)
downloadblog-c2cf93a2a492623eba55c1e78123cd3137cdb426.tar.gz
blog-c2cf93a2a492623eba55c1e78123cd3137cdb426.tar.xz
blog-c2cf93a2a492623eba55c1e78123cd3137cdb426.zip
Add demo category and update other demo entities
Diffstat (limited to 'core/db')
-rw-r--r--core/db/database.sql10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/db/database.sql b/core/db/database.sql
index 172fb3a..af52c50 100644
--- a/core/db/database.sql
+++ b/core/db/database.sql
@@ -100,8 +100,10 @@ ALTER TABLE `post` ADD CONSTRAINT `post_category` FOREIGN KEY (`category`)
-- Insert some demo data
-- =============================================================================
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);
+(1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'john-doe', 'ChangeMe', '$2y$10$jH48L1K1y9dB303aI2biN.ob0biZDuUbMxPKadi3wDqOIxj6yNT6K', 'John Doe', 'mail@example.org', 'Hello, I\'m John Doe! 😎\r\n\r\nA user like me can currently considered more of an *author* which can be assigned to many posts (and pages). There is no user permission system in the administration area currently, so every user with valid login credentials can do anything!', NULL);
+INSERT INTO `category` (`id`, `time_insert`, `time_update`, `parent`, `slug`, `name`, `body`, `argv`) VALUES
+(1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 'examples', 'Examples', 'This is a category. Only posts can be assigned to a category, but it is not necessary, so categories are optional. If you want to use them, you have a lot of space here to describe the content of your category, include images and other stuff like in a posts content. It is even possible to nest categories *unlimited*, but for the sake of user experience, I recommend *not* overdoing it. 😂', NULL);
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 themes 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 like you want.\r\n\r\nIn this post you can see several examples to [format your content with Markdown](https://daringfireball.net/projects/markdown/syntax) and with the *special codes* 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 one. 😃\r\n\r\n![Demo image: Computer Guy (Public Domain)]({FILE[\"image/content/computer-guy-public-domain.svg\"]})\r\n\r\n## Dynamic internal URLs for items\r\nIf you want to link an item, please do not put the URL to the item hardcoded into your content! What if you want to change your sites address (or the base directory) in the future? Then you have to change all internal links in your content. This is not cool!\r\n\r\nTherefore, you can use the following code **without spaces between the braces** by knowing the unique 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 (`/rsrc/`) for static files:\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/\"]}', NULL);
+(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**?\r\n\r\n## The difference\r\nA page is intended for \"timeless\" objects like your imprint, the privacy-policy, the about page, your FAQ\'s and similar stuff. Posts [appear in the RSS feed]({BASE_URL: \"feed/\"}), pages do not. Posts can be assigned {CATEGORY: 1, \"to a category\"}, pages cannot. Posts [can be searched]({BASE_URL: \"search/\"}) by the visitor, pages cannot. Besides this, there is not much more difference between a post and a page currently.', NULL);
+INSERT INTO `post` (`id`, `time_insert`, `time_update`, `user`, `category`, `slug`, `name`, `body`, `argv`) VALUES
+(1, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1, 1, 'hello-world', 'Hello World!', 'Welcome! This is the automatically created first post on your new blog. You can type [*Markdown*](https://daringfireball.net/projects/markdown/) into the content editor to format your content. This system uses [*Parsedown*](https://parsedown.org/) internally, a very fast *Markdown* parser/transformer library written in PHP!\r\n\r\nIn this post you can see several examples to [format your content with *Markdown*](https://daringfireball.net/projects/markdown/syntax) and especially how to use the customizable [*content functions*](https://github.com/Nerdmind/Blog/wiki/Content-functions) provided by this blogging system. After you are familiar with the text formatting and done with the exploration of your new blogging system, you can delete this post and create your own one. 😃\r\n\r\n![Demo image: Computer Guy (Public Domain)]({FILE_URL: \"image/content/computer-guy-public-domain.svg\"})\r\n\r\n## How to cross-reference items in your content?\r\nIf you want to reference another item (e.g. a post or a category) in your content, please do not put the URL to it hard coded into the editor. Consider what happens if you change your blog\'s address (or just the base directory) in the future. You would need to change all the hard coded URLs in your content which is inflexible and not cool. Therefore, you can use the following so-called *content functions* to link an item or a resource of your installation dynamically within your content.\r\n\r\n### Example\r\nReference another post:\r\n> Hello there! Check out this post: {POST: 1}\r\n\r\n### Example\r\nReference a category with customized link text:\r\n> Hello there! Check out {CATEGORY: 1, \"the demo category\"}!\r\n\r\n## How to dynamically link to other resources?\r\nYou can link any other resource (e.g. a file) which is located anywhere within your document root dynamically, either relative to your base directory (the installation directory) or relative to the `rsrc` directory where you store your files, images and other stuff. The `BASE_URL` and `FILE_URL` *content functions* will return the pure plain text URL (extended by the first argument).\r\n\r\n### Example\r\n> Hello there. Check out [the README]({BASE_URL: \"readme.md\"})!\r\n\r\n## How to format content with Markdown?\r\nTo see how this post is formatted with *Markdown*, just open this post in the editor in the administration area. 😉', NULL);