diff options
author | Thomas Lange <code@nerdmind.de> | 2017-02-24 21:05:00 +0100 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2017-02-24 21:05:00 +0100 |
commit | b256462d3380000421da046c71115629e7a76e29 (patch) | |
tree | e764eb3e7a04c39c6e8660482a6c4b9894ea00ef | |
parent | 8a09f7d09f14cab9ad1d813f92b11a2fa2fe3876 (diff) | |
download | wiki-b256462d3380000421da046c71115629e7a76e29.tar.gz wiki-b256462d3380000421da046c71115629e7a76e29.tar.xz wiki-b256462d3380000421da046c71115629e7a76e29.zip |
Initial commit.
-rw-r--r-- | Configuration.md | 108 | ||||
-rw-r--r-- | Database.md | 37 | ||||
-rw-r--r-- | Home.md | 1 | ||||
-rw-r--r-- | Templates.md | 215 |
4 files changed, 360 insertions, 1 deletions
diff --git a/Configuration.md b/Configuration.md new file mode 100644 index 0000000..a4f617f --- /dev/null +++ b/Configuration.md @@ -0,0 +1,108 @@ +# Configuration settings +This document describes the available configuration settings from the `configuration.php` file in more detail. + +## Language configuration +This is the core language which will be used. A corresponding language file **must exists** within `core/language/`. Currently are only `en` and `de` supported. If you are a translator, please only use the original `en` language file for your translation and open a pull request on GitHub or send your language file via email to `code@nerdmind.de`! + +* `CORE.LANGUAGE`: [string: `'en'`] + +## ETag configuration +If this parameter is set to `TRUE`, the system will generate an `ETag` header which includes the timestamps of the last published items and sends them to the client. The client will cache this header and sends them with each further request in the request header. If the ETag header is not modified (which means that no new items was published), the application exit and returns the `304 Not Modified` response header. + +* `CORE.SEND_304`: [boolean: `TRUE`|`FALSE`] + +## Blog informations +Meta informations about your custom blog installation. Note that `BLOGMETA.LANG` is not the system language! It is the language in which **your content** is written and is useful for the `lang` attribute on the `<html>` tag within the template. It depends on the template whether this variable is used or not. + +* `BLOGMETA.NAME`: [string: `'My Techblog'`] +* `BLOGMETA.DESC`: [string: `'[a creative description]'`] +* `BLOGMETA.HOME`: [string: `'Welcome'`] +* `BLOGMETA.MAIL`: [string: `'webmaster@example.org'`] +* `BLOGMETA.LANG`: [string: `'en'`] + +## Database +Database and hostname with login credentials to authenticate to the MySQL server. + +* `DATABASE.HOSTNAME`: [string: `'localhost'`] +* `DATABASE.BASENAME`: [string: `'niceblog'`] +* `DATABASE.USERNAME`: [string: `'john_doe'`] +* `DATABASE.PASSWORD`: [string: `'#passwd#'`] + +## Backend +Settings for administration area. A corresponding language file **must exists** within the template directory defined by `ADMIN.TEMPLATE`! + +* `ADMIN.TEMPLATE`: [string: `'admin'`] +* `ADMIN.LANGUAGE`: [string: `'en'`] + +## Template +Template directory and language (from `template/{template_name}/lang/`) to use. + +* `TEMPLATE.NAME`: [string: `'standard'`] +* `TEMPLATE.LANG`: [string: `'en'`] + +## Paths +Protocol, hostname and base directory for your installation. + +* `PATHINFO.PROT`: [string: `'https://'`] +* `PATHINFO.HOST`: [string: `'example.org'`] +* `PATHINFO.BASE`: [string: `'sub/directory/'`] + +## List size +Number of items to display per-site on overview sites. + +* `PAGE.LIST_SIZE`: [integer: `10`] +* `POST.LIST_SIZE`: [integer: `10`] +* `USER.LIST_SIZE`: [integer: `10`] + +## Feed size +Number of items to display within the RSS feed. + +* `PAGE.FEED_SIZE`: [integer: `25`] +* `POST.FEED_SIZE`: [integer: `25`] + +## Slug URLs +Enable or disable the use of slug URLs for page items. If disabled, the unique primary item ID is used instead. + +* `PAGE.SLUG_URLS`: [boolean: `TRUE`|`FALSE`] +* `POST.SLUG_URLS`: [boolean: `TRUE`|`FALSE`] +* `USER.SLUG_URLS`: [boolean: `TRUE`|`FALSE`] + +## Directories +Base directory relative to your root directory where page items should be linked. If you change one of these default values, you also have to change your `.htaccess` as well. + +* `PAGE.DIRECTORY`: [string: `'page/'`] +* `POST.DIRECTORY`: [string: `'post/'`] +* `USER.DIRECTORY`: [string: `'user/'`] + +## Emoticons +Enable or disable parsing of emoticons for the body of the item. + +* `PAGE.EMOTICONS`: [boolean: `TRUE`|`FALSE`] +* `POST.EMOTICONS`: [boolean: `TRUE`|`FALSE`] +* `USER.EMOTICONS`: [boolean: `TRUE`|`FALSE`] + +## `<meta>` description +Number of characters from the items content to display within the `<meta>` description. + +* `PAGE.DESCRIPTION_SIZE`: [integer: `200`] +* `POST.DESCRIPTION_SIZE`: [integer: `200`] +* `USER.DESCRIPTION_SIZE`: [integer: `200`] + +## List sort +The `ORDER BY` clause for item sorting on item overview sites. You can use each column from the database table to sort and you also can combine multiple columns together. See the MySQL documentation for `ORDER BY` for more information. + +* `PAGE.LIST_SORT`: [string: `'time_insert DESC'`] +* `POST.LIST_SORT`: [string: `'time_insert DESC'`] +* `USER.LIST_SORT`: [string: `'time_insert DESC'`] + +## Feed sort +The `ORDER BY` clause for item sorting within the RSS feed. You can use each column from the database table to sort and you also can combine multiple columns together. See the MySQL documentation for `ORDER BY` for more information. + +* `PAGE.FEED_SORT`: [string: `'time_insert DESC'`] +* `POST.FEED_SORT`: [string: `'time_insert DESC'`] + +## Feed `<guid>` hash +Item attributes (database columns) to use to generate the `<guid>` value for the RSS feed items. + +* `PAGE.FEED_GUID`: [array: `['id', 'time_insert']`] +* `POST.FEED_GUID`: [array: `['id', 'time_insert']`]
\ No newline at end of file diff --git a/Database.md b/Database.md new file mode 100644 index 0000000..3b20dfb --- /dev/null +++ b/Database.md @@ -0,0 +1,37 @@ +# Documentation: Database structure + +## Table `page` [`InnoDB`] +In this table are all created page objects stored and will be removed if the admin deletes them. + +* Column `id`: Contains the unique primary ID to identify a page +* Column `time_insert`: Contains the time stamp (Format: `YYYY-MM-DD HH:II:SS`) when the page was created +* Column `time_update`: Contains the time stamp (Format: `YYYY-MM-DD HH:II:SS`) when the page was updated +* Column `user`: Contains the user ID of the user who created this page (`user.id`) +* Column `slug`: Contains the slug part of the pages absolute URL +* Column `name`: Contains the name of the page +* Column `body`: Contains the body of the page in the markdown format + +## Table `post` [`MyISAM`] +In this table are all created post objects stored and will be removed if the admin deletes them. +The table type is `MyISAM` because the fulltext search doesn't work with `InnoDB` in MySQL < `5.6`. + +* Column `id`: Contains the unique primary ID to identify a post +* Column `time_insert`: Contains the time stamp (Format: `YYYY-MM-DD HH:II:SS`) when the post was created +* Column `time_update`: Contains the time stamp (Format: `YYYY-MM-DD HH:II:SS`) when the post was updated +* Column `user`: Contains the user ID of the user who created this post (`user.id`) +* Column `slug`: Contains the slug part of the posts absolute URL +* Column `name`: Contains the name of the post +* Column `body`: Contains the body of the post in the markdown format + +## Table `user` [`InnoDB`] +In this table are all created user objects stored and will be removed if the admin deletes them. + +* Column `id`: Contains the unique primary ID to identify a user +* Column `time_insert`: Contains the time stamp (Format: `YYYY-MM-DD HH:II:SS`) when the user was created +* Column `time_update`: Contains the time stamp (Format: `YYYY-MM-DD HH:II:SS`) when the user was updated +* Column `slug`: Contains the slug part of the users absolute URL +* Column `username`: Contains the username of the user +* Column `password`: Contains the `bcrypt` hashed password of the user +* Column `fullname`: Contains the full name of the user +* Column `mailaddr`: Contains the contact email address of the user +* Column `body`: Contains the body of the user in the markdown format
\ No newline at end of file diff --git a/Home.md b/Home.md deleted file mode 100644 index 491a3a7..0000000 --- a/Home.md +++ /dev/null @@ -1 +0,0 @@ -Welcome to the Blog wiki! diff --git a/Templates.md b/Templates.md new file mode 100644 index 0000000..c066e7c --- /dev/null +++ b/Templates.md @@ -0,0 +1,215 @@ +# Documentation: Templates +**WARNING:** Parameters marked with **{!}** must be escaped from HTML markup if you display them! + + ├── html + │ ├── 403.php + │ ├── 404.php + │ ├── feed + │ │ ├── item_page.php + │ │ ├── item_post.php + │ │ └── main.php + │ ├── home.php + │ ├── main.php + │ ├── page + │ │ ├── item.php + │ │ ├── list.php + │ │ └── main.php + │ ├── pagination.php + │ ├── post + │ │ ├── item.php + │ │ ├── list.php + │ │ └── main.php + │ ├── search + │ │ ├── main.php + │ │ └── result.php + │ └── user + │ ├── item.php + │ ├── list.php + │ └── main.php + ├── lang + │ ├── de.php + │ └── en.php + │ └── […] + └── rsrc + └── […] + +## Template `html/*` +The following variables are available in **each** other template file: + +* `$BLOGMETA['NAME']`**{!}**: Global available: The name of the blog +* `$BLOGMETA['DESC']`**{!}**: Global available: The description of the blog +* `$BLOGMETA['HOME']`**{!}**: Global available: The name of the start page of the blog +* `$BLOGMETA['MAIL']`: Global available: The email address of the contact person +* `$BLOGMETA['LANG']`: Global available: The two-letter language code for the content + +## Template `html/feed/index.php` +Basic framework of the RSS feed in XML which contains a list of page and post items: + +* `$FEED['TYPE']`: Contains a string if a feed for a specific item group is requested (either `post` or `page`) +* `$FEED['LIST']['POSTS']`: Contains a list of post items (or is empty when the "pages-only" feed is requested) +* `$FEED['LIST']['PAGES']`: Contains a list of page items (or is empty when the "posts-only" feed is requested) + +## Template `html/feed/item_page.php` +Represents a single page to display within the feed template. + +* `$PAGE`: [See reference for `@PAGE`] +* `$USER`: [See reference for `@USER`] + +## Template `html/feed/item_post.php` +Represents a single post to display within the feed template. + +* `$POST`: [See reference for `@POST`] +* `$USER`: [See reference for `@USER`] + +## Template `html/page/item.php` +Represents a single page to display within the list template. + +## Template `html/page/list.php` +Overview template which contains the site navigation and a list of page items to be displayed. + +* `$LIST['PAGES']`: Contains a list of page items for the current site +* `$PAGEINATION['THIS']`: Contains the current site number of the list navigation +* `$PAGEINATION['LAST']`: Contains the last site number of the list navigation +* `$PAGEINATION['HTML']`: Contains the pageination template with the list navigation + +* `$PAGE`: [See reference for `@PAGE`] + +## Template `html/page/main.php` +Main template for a single page. + +* `$PAGE`: [See reference for `@PAGE`] +* `$USER`: [See reference for `@USER`] +* `$PAGE['PREV']`: Same data structure as `$PAGE` but with the data from the previous page +* `$PAGE['NEXT']`: Same data structure as `$PAGE` but with the data from the next page + +## Template `html/post/item.php` +Represents a single post to display within the list template. + +## Template `html/post/list.php` +Overview template which contains the site navigation and a list of post items to be displayed. + +* `$LIST['POSTS']`: Contains a list of post items for the current site +* `$PAGEINATION['THIS']`: Contains the current site number of the list navigation +* `$PAGEINATION['LAST']`: Contains the last site number of the list navigation +* `$PAGEINATION['HTML']`: Contains the pageination template with the list navigation + +* `$POST`: [See reference for `@POST`] + +## Template `html/post/main.php` +Main template for a single post. + +* `$POST`: [See reference for `@POST`] +* `$USER`: [See reference for `@USER`] +* `$POST['PREV']`: Same data structure as `$POST` but with the data from the previous post +* `$POST['NEXT']`: Same data structure as `$POST` but with the data from the next post + +## Template `html/search/index.php` +Search template without results and with the formular. + +* `$SEARCH['TEXT']`**{!}**: Contains the full search string +* `$SEARCH['INFO']`**{!}**: Contains a list of information messages +* `$FORM['SELECT']['D']`: Contains the selected day or is empty +* `$FORM['SELECT']['M']`: Contains the selected month or is empty +* `$FORM['SELECT']['Y']`: Contains the selected year or is empty +* `$FORM['OPTIONS']['D']`: Contains a list of possible days to select +* `$FORM['OPTIONS']['M']`: Contains a list of possible months to select +* `$FORM['OPTIONS']['Y']`: Contains a list of possible years to select + +## Template `html/search/result.php` +Result template with a list of posts and the formular to repeat the search. + +* `$SEARCH['TEXT']`**{!}**: Contains the full search string +* `$SEARCH['INFO']`**{!}**: Contains a list of information messages +* `$RESULT['LIST']`: Contains a list of post items as result +* `$FORM['SELECT']['D']`: Contains the selected day or is empty +* `$FORM['SELECT']['M']`: Contains the selected month or is empty +* `$FORM['SELECT']['Y']`: Contains the selected year or is empty +* `$FORM['OPTIONS']['D']`: Contains a list of possible days to select +* `$FORM['OPTIONS']['M']`: Contains a list of possible months to select +* `$FORM['OPTIONS']['Y']`: Contains a list of possible years to select + +## Template `html/user/main.php` +Main template for a single user. + +* `$USER`: [See reference for `@USER`] +* `$USER['PREV']`: Same data structure as `$USER` but with the data from the previous user +* `$USER['NEXT']`: Same data structure as `$USER` but with the data from the next user +* `$COUNT['POST']`: Contains the number of posts published by the user +* `$COUNT['PAGE']`: Contains the number of pages published by the user + +## Template `html/403.php` +Default template for error page 403 Forbidden. + +*[no variables]* + +## Template `html/404.php` +Default template for error page 404 Not Found. + +*[no variables]* + +## Template `html/home.php` +This is the default startpage template which contains a list with the last posts. + +* `$LIST['POSTS']`: Contains a list of post items for the home site +* `$PAGEINATION['HTML']`: Contains the pageination template with the list navigation + +## Template `html/main.php` +Basic framework of the HTML document which contains the main content: + +* `$HEAD['NAME']`**{!}**: Contains the document name for the `<title>` tag or something else +* `$HEAD['DESC']`**{!}**: Contains the document description for `<meta` tags or something else +* `$HEAD['PERM']`: Contains the canonical URL for this document +* `$HEAD['OG_IMAGES']`: Contains a list of image URLs for the document +* `$HTML`: Contains the documents main body (other templates) + +## Template `html/pageination.php` +Contains the site navigation for post, page and user list (and for the home template) + +* `$THIS`: Contains the current site number of the list navigation +* `$LAST`: Contains the last site number of the list navigation +* `$HREF`: Contains the URL for a specific site number + +## References to reduce duplicate text + +### `@PAGE` +* `$PAGE['ID']`: Contains the unique ID of the page +* `$PAGE['URL']`: Contains the complete URL to the page content +* `$PAGE['GUID']`: Contains a pseudo-guid of the page +* `$PAGE['FILE']['LIST']`: List of extracted image URLs from the body +* `$PAGE['BODY']['TEXT']`: Pre-parsed content of the page body +* `$PAGE['BODY']['HTML']`: HTML parsed content of the page body +* `$PAGE['ATTR']['USER']`: Raw attribute data from database column `user` +* `$PAGE['ATTR']['SLUG']`**{!}**: Raw attribute data from database column `slug` +* `$PAGE['ATTR']['NAME']`**{!}**: Raw attribute data from database column `name` +* `$PAGE['ATTR']['BODY']`**{!}**: Raw attribute data from database column `body` +* `$PAGE['ATTR']['TIME_INSERT']`: Raw attribute data from database column `time_insert` +* `$PAGE['ATTR']['TIME_UPDATE']`: Raw attribute data from database column `time_update` + +### `@POST` +* `$POST['ID']`: Contains the unique ID of the post +* `$POST['URL']`: Contains the complete URL to the post content +* `$POST['GUID']`: Contains a pseudo-guid of the post +* `$POST['FILE']['LIST']`: List of extracted image URLs from the body" +* `$POST['BODY']['TEXT']`: Pre-parsed content of the post body +* `$POST['BODY']['HTML']`: HTML parsed content of the post body +* `$POST['ATTR']['USER']`: Raw attribute data from database column `user` +* `$POST['ATTR']['SLUG']`**{!}**: Raw attribute data from database column `slug` +* `$POST['ATTR']['NAME']`**{!}**: Raw attribute data from database column `name` +* `$POST['ATTR']['BODY']`**{!}**: Raw attribute data from database column `body` +* `$POST['ATTR']['TIME_INSERT']`: Raw attribute data from database column `time_insert` +* `$POST['ATTR']['TIME_UPDATE']`: Raw attribute data from database column `time_update` + +### `@USER` +* `$USER['ID']`: Contains the unique ID of the user +* `$USER['URL']`: Contains the complete URL to the user +* `$USER['GUID']`: Contains a pseudo-guid of the user content +* `$USER['FILE']['LIST']`: List of extracted image URLs from the body +* `$USER['BODY']['TEXT']`: Pre-parsed content of the user body +* `$USER['BODY']['HTML']`: HTML parsed content of the user body +* `$USER['ATTR']['SLUG']`**{!}**: Raw attribute data from database column `slug` +* `$USER['ATTR']['BODY']`**{!}**: Raw attribute data from database column `body` +* `$USER['ATTR']['USERNAME']`**{!}**: Raw attribute data from database column `username` +* `$USER['ATTR']['FULLNAME']`**{!}**: Raw attribute data from database column `fullname` +* `$USER['ATTR']['MAILADDR']`**{!}**: Raw attribute data from database column `mailaddr` +* `$USER['ATTR']['TIME_INSERT']`: Raw attribute data from database column `time_insert` +* `$USER['ATTR']['TIME_UPDATE']`: Raw attribute data from database column `time_update`
\ No newline at end of file |