summaryrefslogtreecommitdiffstats
path: root/Templates.md
blob: d58e6b129413bda3c70450ef88ede3a0270b771b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
**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
	    └── […]

## Global `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

## Main 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)

**If you are on a page, post or user site:**  
* `$TYPE`: Contains either `PAGE`, `POST` or `USER` as string value.

**If `$TYPE` is `PAGE`:**  
* `$PAGE`: [See reference for `@PAGE`]
* `$USER`: [See reference for `@USER`]

**If `$TYPE` is `POST`:**  
* `$POST`: [See reference for `@POST`]
* `$USER`: [See reference for `@USER`]

**If `$TYPE` is `USER`:**  
* `$USER`: [See reference for `@USER`]

## Home 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
* `$PAGINATION['HTML']`: Contains the pagination template with the list navigation

## Page List 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
* `$PAGINATION['THIS']`: Contains the current site number of the list navigation
* `$PAGINATION['LAST']`: Contains the last site number of the list navigation
* `$PAGINATION['HTML']`: Contains the pagination template with the list navigation

## Post List 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
* `$PAGINATION['THIS']`: Contains the current site number of the list navigation
* `$PAGINATION['LAST']`: Contains the last site number of the list navigation
* `$PAGINATION['HTML']`: Contains the pagination template with the list navigation

## User List Template `html/user/list.php`
Overview template which contains the site navigation and a list of user items to be displayed.

* `$LIST['USERS']`: Contains a list of user items for the current site
* `$PAGINATION['THIS']`: Contains the current site number of the list navigation
* `$PAGINATION['LAST']`: Contains the last site number of the list navigation
* `$PAGINATION['HTML']`: Contains the pagination template with the list navigation

## Page Item Template `html/page/item.php`
Represents a single page to display within the list template.

* `$PAGE`: [See reference for `@PAGE`]
* `$USER`: [See reference for `@USER`]

## Post Item Template `html/post/item.php`
Represents a single post to display within the list template.

* `$POST`: [See reference for `@POST`]
* `$USER`: [See reference for `@USER`]

## User Item Template `html/user/item.php`
Represents a single user to display within the list template.

* `$USER`: [See reference for `@USER`]

## Page Main 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

## Post Main 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

## User Main 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

## Search Request Template `html/search/main.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

## Search Result 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

## Pagination Template `html/pagination.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

## Feed Template `html/feed/main.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)

## Feed Item Template [page] `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`]

## Feed Item Template [post] `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`]

## 403 Template `html/403.php`
Default template for error page 403 Forbidden.

*[no variables]*

## 404 Template `html/404.php`
Default template for error page 404 Not Found.

*[no variables]*

## References to reduce duplicate text

### `@PAGE`
* `$PAGE['URL']`: Contains the complete URL to the page content
* `$PAGE['GUID']`: Contains a pseudo-guid of the page
* `$PAGE['ARGV']`: Contains the arguments parsed as key->value array
* `$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']['ID']`: Raw attribute data from database column `id`
* `$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']['ARGV']`: Raw attribute data from database column `argv`
* `$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['URL']`: Contains the complete URL to the post content
* `$POST['GUID']`: Contains a pseudo-guid of the post
* `$POST['ARGV']`: Contains the arguments parsed as key->value array
* `$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']['ID']`: Raw attribute data from database column `id`
* `$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']['ARGV']`: Raw attribute data from database column `argv`
* `$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['URL']`: Contains the complete URL to the user
* `$USER['GUID']`: Contains a pseudo-guid of the user content
* `$USER['ARGV']`: Contains the arguments parsed as key->value array
* `$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']['ID']`: Raw attribute data from database column `id`
* `$USER['ATTR']['SLUG']`**{!}**: Raw attribute data from database column `slug`
* `$USER['ATTR']['BODY']`**{!}**: Raw attribute data from database column `body`
* `$USER['ATTR']['ARGV']`: Raw attribute data from database column `argv`
* `$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`