forked from textpattern/textpattern
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtxpsql.php
More file actions
519 lines (458 loc) · 112 KB
/
Copy pathtxpsql.php
File metadata and controls
519 lines (458 loc) · 112 KB
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
<?php
/*
* Textpattern Content Management System
* http://textpattern.com
*
* Copyright (C) 2015 The Textpattern Development Team
*
* This file is part of Textpattern.
*
* Textpattern is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, version 2.
*
* Textpattern is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Textpattern. If not, see <http://www.gnu.org/licenses/>.
*/
if (!defined('TXP_INSTALL')) {
exit;
}
@ignore_user_abort(1);
@set_time_limit(0);
if (strpos($dhost, ':') === false) {
$host = $dhost;
$port = ini_get("mysqli.default_port");
} else {
list($host, $port) = explode(':', $dhost, 2);
$port = intval($port);
}
if (isset($txpcfg['socket'])) {
$socket = $txpcfg['socket'];
} else {
$socket = ini_get("mysqli.default_socket");
}
$link = mysqli_init();
mysqli_real_connect($link, $host, $duser, $dpass, $ddb, $port, $socket, $dclient_flags);
$result = mysqli_query($link, "describe `".PFX."textpattern`");
if ($result) {
die("Textpattern database table already exists. Can't run setup.");
}
$version = mysqli_get_server_info($link);
// Use "ENGINE" if version of MySQL > 4.1.2.
$tabletype = (version_compare($version, '4.1.2') >= 0) ? ' ENGINE=MyISAM ' : ' TYPE=MyISAM ';
// On 4.1 or greater use UTF-8 tables.
if (isset($dbcharset)) {
$tabletype .= " CHARACTER SET = $dbcharset ";
if ($dbcharset == 'utf8') {
$tabletype .= " COLLATE utf8_general_ci ";
}
mysqli_query($link, "SET NAMES ".$dbcharset);
}
// Default to messy URLs if we know clean ones won't work.
$permlink_mode = 'section_id_title';
if (is_callable('apache_get_modules')) {
$modules = @apache_get_modules();
if (!is_array($modules) || !in_array('mod_rewrite', $modules)) {
$permlink_mode = 'messy';
}
} else {
$server_software = (@$_SERVER['SERVER_SOFTWARE'] || @$_SERVER['HTTP_HOST'])
? ((@$_SERVER['SERVER_SOFTWARE']) ? @$_SERVER['SERVER_SOFTWARE'] : $_SERVER['HTTP_HOST'])
: '';
if (!stristr($server_software, 'Apache')) {
$permlink_mode = 'messy';
}
}
$username = (!empty($_SESSION['name'])) ? $_SESSION['name'] : 'anon';
$useremail = (!empty($_SESSION['email'])) ? $_SESSION['email'] : '';
$create_sql = array();
$create_sql[] = "CREATE TABLE `".PFX."textpattern` (
`ID` int(11) NOT NULL auto_increment,
`Posted` datetime NOT NULL default '0000-00-00 00:00:00',
`AuthorID` varchar(64) NOT NULL default '',
`LastMod` datetime NOT NULL default '0000-00-00 00:00:00',
`LastModID` varchar(64) NOT NULL default '',
`Title` varchar(255) NOT NULL default '',
`Title_html` varchar(255) NOT NULL default '',
`Body` mediumtext NOT NULL,
`Body_html` mediumtext NOT NULL,
`Excerpt` text NOT NULL,
`Excerpt_html` mediumtext NOT NULL,
`Image` varchar(255) NOT NULL default '',
`Category1` varchar(128) NOT NULL default '',
`Category2` varchar(128) NOT NULL default '',
`Annotate` int(2) NOT NULL default '0',
`AnnotateInvite` varchar(255) NOT NULL default '',
`comments_count` int(8) NOT NULL default '0',
`Status` int(2) NOT NULL default '4',
`textile_body` int(2) NOT NULL default '1',
`textile_excerpt` int(2) NOT NULL default '1',
`Section` varchar(64) NOT NULL default '',
`override_form` varchar(255) NOT NULL default '',
`Keywords` varchar(255) NOT NULL default '',
`url_title` varchar(255) NOT NULL default '',
`custom_1` varchar(255) NOT NULL default '',
`custom_2` varchar(255) NOT NULL default '',
`custom_3` varchar(255) NOT NULL default '',
`custom_4` varchar(255) NOT NULL default '',
`custom_5` varchar(255) NOT NULL default '',
`custom_6` varchar(255) NOT NULL default '',
`custom_7` varchar(255) NOT NULL default '',
`custom_8` varchar(255) NOT NULL default '',
`custom_9` varchar(255) NOT NULL default '',
`custom_10` varchar(255) NOT NULL default '',
`uid` varchar(32) NOT NULL default '',
`feed_time` date NOT NULL default '0000-00-00',
PRIMARY KEY (`ID`),
KEY `categories_idx` (`Category1`(10),`Category2`(10)),
KEY `Posted` (`Posted`),
FULLTEXT KEY `searching` (`Title`,`Body`)
) $tabletype PACK_KEYS=1 AUTO_INCREMENT=2 ";
$setup_comment_invite = doSlash((gTxt('setup_comment_invite') == 'setup_comment_invite') ? 'Comment' : gTxt('setup_comment_invite'));
$create_sql[] = "INSERT INTO `".PFX."textpattern` VALUES (1, now(), '".doSlash($username)."', now(), '', 'Welcome to your site', '', 'h3. What do you want to do next?\n\n* Modify or even delete this article? The \"article list\":siteurl/textpattern/index.php?event=list is the place to start.\n* Change this site\'s name, or modify the style of the URLs? It\'s all up to your \"preferences\":siteurl/textpattern/index.php?event=prefs.\n* Get yourself acquainted with Textile, the humane web text generator which comes with Textpattern? The basics are \"simple\":http://textpattern.com/textile-sandbox. If you want to learn more about Textile, you can dig into an \"extensive manual\":http://textpattern.com/textile-reference-manual later.\n* Be guided through your \"Textpattern first steps\":http://textpattern.com/textpattern-first-steps by completing some basic tasks?\n* Study the \"Textpattern Semantic Model?\":http://textpattern.com/textpattern-semantic-model\n* Add \"another user\":siteurl/textpattern/index.php?event=admin, or extend the capabilities with \"third party plugins\":siteurl/textpattern/index.php?event=plugin you discovered from the central plugin directory at \"Textpattern Resources\":http://textpattern.org/?\n* Dive in and learn by trial and error? Then please note:\n** When you \"write\":siteurl/textpattern/index.php?event=article an article you assign it to a section of your site.\n** Sections use a \"page template\":siteurl/textpattern/index.php?event=page and a \"style\":siteurl/textpattern/index.php?event=css as an output scaffold.\n** Page templates use HTML and Textpattern tags (like this: @<txp:article />@) to build the markup.\n** Some Textpattern tags use \"forms\":siteurl/textpattern/index.php?event=form, which are building blocks for reusable snippets of code and markup you may build and use at your discretion.\n\nThere are a host of \"Frequently Asked Questions\":http://textpattern.com/faq/ to help you get started.\n\n\"Textpattern tags\":http://textpattern.com/textpattern-tag-reference, their attributes and values are explained and sampled within the \"Textpattern User Documentation\":http://textpattern.net/, where you will also find valuable tips and tutorials.\n\nIf all else fails, there\'s a whole crowd of friendly, helpful people over at the \"Textpattern support forum\":http://forum.textpattern.com/. Come and pay a visit!\n', '\t<h3>What do you want to do next?</h3>\n\n\t<ul>\n\t\t<li>Modify or even delete this article? The <a href=\"siteurl/textpattern/index.php?event=list\">article list</a> is the place to start.</li>\n\t\t<li>Change this site\'s name, or modify the style of the <span class=\"caps\">URL</span>s? It\'s all up to your <a href=\"siteurl/textpattern/index.php?event=prefs\">preferences</a>.</li>\n\t\t<li>Get yourself acquainted with Textile, the humane web text generator which comes with Textpattern? The basics are <a href=\"http://textpattern.com/textile-sandbox\">simple</a>. If you want to learn more about Textile, you can dig into an <a href=\"http://textpattern.com/textile-reference-manual\">extensive manual</a> later.</li>\n\t\t<li>Be guided through your <a href=\"http://textpattern.com/textpattern-first-steps\">Textpattern first steps</a> by completing some basic tasks?</li>\n\t\t<li>Study the <a href=\"http://textpattern.com/textpattern-semantic-model\">Textpattern Semantic Model?</a></li>\n\t\t<li>Add <a href=\"siteurl/textpattern/index.php?event=admin\">another user</a>, or extend the capabilities with <a href=\"siteurl/textpattern/index.php?event=plugin\">third party plugins</a> you discovered from the central plugin directory at <a href=\"http://textpattern.org/\">Textpattern Resources</a>?</li>\n\t\t<li>Dive in and learn by trial and error? Then please note:\n\t<ul>\n\t\t<li>When you <a href=\"siteurl/textpattern/index.php?event=article\">write</a> an article you assign it to a section of your site.</li>\n\t\t<li>Sections use a <a href=\"siteurl/textpattern/index.php?event=page\">page template</a> and a <a href=\"siteurl/textpattern/index.php?event=css\">style</a> as an output scaffold.</li>\n\t\t<li>Page templates use <span class=\"caps\">HTML</span> and Textpattern tags (like this: <code dir=\"ltr\"><txp:article /></code>) to build the markup.</li>\n\t\t<li>Some Textpattern tags use <a href=\"siteurl/textpattern/index.php?event=form\">forms</a>, which are building blocks for reusable snippets of code and markup you may build and use at your discretion.</li>\n\t</ul></li>\n\t</ul>\n\n\t<p>There are a host of <a href=\"http://textpattern.com/faq/\">Frequently Asked Questions</a> to help you get started.</p>\n\n\t<p><a href=\"http://textpattern.com/textpattern-tag-reference\">Textpattern tags</a>, their attributes and values are explained and sampled within the <a href=\"http://textpattern.net/\">Textpattern User Documentation</a>, where you will also find valuable tips and tutorials.</p>\n\n\t<p>If all else fails, there\'s a whole crowd of friendly, helpful people over at the <a href=\"http://forum.textpattern.com/\">Textpattern support forum</a>. Come and pay a visit!</p>', 'This is a Textpattern article excerpt. Article excerpts are optional but can be used effectively to summarise an article\'s content, for example with Textpattern\'s built-in article syndication and with the @<txp:excerpt />@ tag.', '<p>This is a Textpattern article excerpt. Article excerpts are optional but can be used effectively to summarise an article\'s content, for example with Textpattern\'s built-in article syndication and with the <code><txp:excerpt /></code> tag.</p>', '', 'hope-for-the-future', 'meaningful-labor', 1, '".$setup_comment_invite."', 1, 4, 1, 1, 'articles', '', '', 'welcome-to-your-site', '', '', '', '', '', '', '', '', '', '', '".md5(uniqid(rand(), true))."', now())";
$create_sql[] = "CREATE TABLE `".PFX."txp_category` (
`id` int(6) NOT NULL auto_increment,
`name` varchar(64) NOT NULL default '',
`type` varchar(64) NOT NULL default '',
`parent` varchar(64) NOT NULL default '',
`lft` int(6) NOT NULL default '0',
`rgt` int(6) NOT NULL default '0',
`title` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) $tabletype PACK_KEYS=1";
$create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (1, 'root', 'article', '', 1, 8, 'root')";
$create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (2, 'root', 'link', '', 1, 4, 'root')";
$create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (3, 'root', 'image', '', 1, 4, 'root')";
$create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (4, 'root', 'file', '', 1, 2, 'root')";
$create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (5, 'hope-for-the-future', 'article', 'root', 2, 3, 'Hope for the future')";
$create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (6, 'meaningful-labor', 'article', 'root', 4, 5, 'Meaningful labor')";
$create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (7, 'reciprocal-affection', 'article', 'root', 6, 7, 'Reciprocal affection')";
$create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (8, 'textpattern', 'link', 'root', 2, 3, 'Textpattern')";
$create_sql[] = "CREATE TABLE `".PFX."txp_css` (
`name` varchar(255) NOT NULL,
`css` text NOT NULL,
UNIQUE KEY `name` (`name`)
) $tabletype ";
// sql:txp_css
$create_sql[] = "INSERT INTO `".PFX."txp_css`(`name`,`css`) VALUES('default', '/* ==========================================================================\n Styling and layout for all media\n ========================================================================== */\n/* HTML5 display definitions\n ========================================================================== */\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n display: block;\n}\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\naudio,\ncanvas,\nprogress,\nvideo {\n /* 1 */\n display: inline-block;\n /* 2 */\n vertical-align: baseline;\n}\n\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n */\n[hidden],\ntemplate {\n display: none;\n}\n\n/**\n * Remove tap delay in IE 10+ (and proposed for other browsers).\n */\na,\ninput,\nbutton {\n -ms-touch-action: none;\n touch-action: none;\n}\n\n/**\n * Correct `summary` not showing as clickable.\n */\nsummary {\n cursor: pointer;\n}\n\n/* Clearfix\n ========================================================================== */\n/**\n * Clearfix using the \'A new micro clearfix hack\' method.\n *\n * More info: http://nicolasgallagher.com/micro-clearfix-hack/\n */\nheader:after,\nfooter:after,\nnav ul:after,\nnav ol:after,\n.clearfix:after,\n.container:after,\n.paginator:after {\n content: \"\";\n display: table;\n clear: both;\n}\n\n/* ==========================================================================\n Styling and layout for screen media (mobile first)\n ========================================================================== */\n@media screen {\n /* Layout\n ========================================================================== */\n /**\n * 1. Always force scrollbar padding so we don\'t get \'jumping\'.\n * 2. Prevent iOS and IE text size adjust after device orientation change,\n * without disabling user zoom.\n * 3. As 2 above, for Windows Phone.\n */\n html {\n -webkit-tap-highlight-color: rgba(0, 102, 255, 0.5);\n /* 1 */\n overflow-y: scroll;\n /* 2 */\n -webkit-text-size-adjust: 100%;\n /* 3 */\n -ms-text-size-adjust: 100%;\n }\n\n /**\n * 1. Set `body` to `relative` to allow positioning of absolute elements.\n * 2. Remove default margin.\n * 3. Make sure body fills entire viewport height.\n */\n body {\n /* 1 */\n position: relative;\n /* 2 */\n margin: 0;\n /* 3 */\n min-height: 100vh;\n background: #f7f7f7;\n }\n\n /**\n * Outer wrapper for main layouts.\n *\n * Example HTML:\n *\n * <div class=\"wrapper\">\n * <div class=\"container\">\n * Content\n * </div>\n * </div>\n */\n .wrapper {\n border-top: 1px solid #cccccc;\n border-bottom: 1px solid #cccccc;\n padding: 1px 0 1em;\n background: #ffffff;\n }\n\n /**\n * Wrapper for layouts, and for site header/footer.\n *\n * Example HTML:\n *\n * <div class=\"wrapper\">\n * <div class=\"container\">\n * Content\n * </div>\n * </div>\n */\n .site-header,\n .site-footer,\n .container {\n margin: 0 auto;\n width: 88%;\n max-width: 86em;\n }\n\n /**\n * Additional styling for child content within site header.\n */\n .site-header {\n padding: 1em 0;\n }\n .site-header h1 {\n margin: 0;\n }\n .site-header h3 {\n margin: 0.5em 0 0;\n }\n\n /**\n * Additional styling for child content within site footer.\n */\n .site-footer {\n padding: 0.5em 0;\n }\n\n /**\n * Styling for articles.\n *\n * 1. Prevent really, really long words in article from breaking layout.\n */\n .article {\n margin-bottom: 2em;\n /* 1 */\n word-wrap: break-word;\n }\n\n /**\n * Styling for complementary content.\n *\n * Initially the sidebar appears under main content, it is then repositioned\n * with media queries at 2nd breakpoint.\n *\n * 1. Prevent really, really long words in article from breaking layout.\n */\n .complementary-content {\n margin: 2em -6% 0;\n border-top: 2px dashed #cccccc;\n padding: 0 6%;\n /* 1 */\n word-wrap: break-word;\n }\n\n /* Navigation\n ========================================================================== */\n /**\n * Style mobile first version of the navigation menu. Desktop version will\n * override some rules with extra styling at 1st breakpoint.\n *\n * Example HTML:\n *\n * <nav class=\"site-navigation\">\n * <ul>\n * <li class=\"active\"><a></li>\n * <li><a></li>\n * <li><a></li>\n * </ul>\n * </nav>\n */\n .site-navigation {\n background-color: #dddddd;\n }\n .site-navigation ul {\n margin: 0 auto;\n padding: 0;\n max-width: 86em;\n list-style: none;\n }\n .site-navigation li {\n -webkit-transition: box-shadow 0.2s linear;\n transition: box-shadow 0.2s linear;\n border-top: 1px solid #cccccc;\n background-color: #eeeeee;\n }\n .site-navigation li:hover {\n background-color: #f8f8f8;\n }\n .site-navigation li:active {\n -webkit-box-shadow: inset 0 0.2em 0.25em rgba(0, 0, 0, 0.15);\n box-shadow: inset 0 0.2em 0.25em rgba(0, 0, 0, 0.15);\n background-color: lightgray;\n }\n .site-navigation li.active {\n -webkit-box-shadow: none;\n box-shadow: none;\n background-color: white;\n }\n .site-navigation a {\n display: block;\n padding: 0.5em 6%;\n color: #333333;\n }\n .site-navigation a:hover, .site-navigation a:visited {\n color: #333333;\n text-decoration: none;\n }\n .site-navigation a:active {\n color: #1a1a1a;\n text-decoration: none;\n }\n\n /* Links\n ========================================================================== */\n /**\n * 1. Remove default underline style from non-hover state links.\n * 2. Interrupt the decoration line to let the shape of the text show through\n * in supported browsers.\n * 3. Specify link colour.\n * 4. Remove the grey background color from active links in IE 10.\n */\n a {\n /* 1 */\n text-decoration: none;\n /* 2 */\n text-decoration-skip: ink edges;\n /* 3 */\n color: #004cbf;\n /* 4 */\n background-color: transparent;\n }\n a:hover, a:active {\n outline: 0;\n text-decoration: underline;\n color: #0066ff;\n }\n a:focus {\n outline: thin dotted #7fb2ff;\n }\n a:visited {\n color: #00327f;\n }\n\n /**\n * Additional styling for `h1` heading links.\n */\n h1 a {\n border-radius: 0.125em;\n color: #333333;\n }\n h1 a:visited {\n color: #333333;\n }\n h1 a:hover, h1 a:active {\n text-decoration: none;\n color: #333333;\n background-color: #f7f7f7;\n }\n\n /**\n * Additional styling for child links within site header.\n */\n .site-header h1 a:hover, .site-header h1 a:active {\n background-color: #e8e8e8;\n }\n\n /**\n * Paginator (prev/next) navigation links on articles/article lists.\n *\n * Example HTML:\n *\n * <nav class=\"paginator\">\n * <a rel=\"prev\">\n * <a rel=\"next\">\n */\n .paginator {\n clear: both;\n }\n .paginator [rel=\"prev\"] {\n float: left;\n }\n .paginator [rel=\"next\"] {\n float: right;\n }\n\n /* Typography\n ========================================================================== */\n html {\n font-size: 100%;\n line-height: 1.5em;\n }\n\n /**\n * Global font and text colour.\n */\n body {\n font-family: \"PT Serif\", Georgia, serif;\n color: #333333;\n }\n\n /**\n * Sans-serif font for main navigation menu.\n */\n .site-navigation {\n font-family: sans-serif;\n font-weight: bold;\n }\n\n /**\n * Harmonise size, style and vertical margin of headings.\n */\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n clear: both;\n font-family: sans-serif;\n }\n\n h1 {\n font-size: 2.375em;\n line-height: 1.1842105em;\n margin: 0.6315789em 0;\n }\n\n h2 {\n font-size: 1.875em;\n line-height: 1.2666666em;\n margin: 0.8em 0;\n }\n\n h3 {\n font-size: 1.5em;\n line-height: 1.3333333em;\n margin: 1em 0;\n }\n\n h4 {\n font-size: 1.25em;\n line-height: 1.4em;\n margin: 1em 0;\n }\n\n h5 {\n font-size: 1.125em;\n line-height: 1.44em;\n margin: 1em 0;\n }\n\n h6 {\n font-size: 1em;\n line-height: 1.5em;\n margin: 1em 0;\n }\n\n /**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\n b,\n strong {\n font-weight: bold;\n }\n\n /**\n * Add vertical margin to addresses.\n */\n address {\n margin: 1em 0;\n }\n\n /**\n * Additional styling for blockquotes.\n */\n blockquote {\n font-size: 1.25em;\n line-height: 1.4em;\n font-style: italic;\n margin: 0.8em 0;\n text-align: center;\n }\n\n /**\n * Address styling not present in Safari and Chrome.\n */\n dfn {\n font-style: italic;\n }\n\n /**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n abbr[title],\n dfn[title] {\n border-bottom: 1px dotted;\n cursor: help;\n }\n\n /**\n * Address styling not present in IE 8/9.\n */\n mark,\n var {\n border-radius: 0.25em;\n padding: 0 0.25em;\n color: #333333;\n background: #fff9e1;\n }\n\n /**\n * Harmonise size and style of computer text.\n */\n pre,\n code,\n kbd,\n samp {\n font-size: 0.875em;\n line-height: 1.5em;\n border: 1px solid #e3e3e3;\n border-radius: 0.2857143em;\n font-family: Menlo, Consolas, Monaco, monospace;\n color: #333333;\n background-color: #f7f7f7;\n }\n\n code,\n kbd,\n samp {\n padding: 1px 0.21429em;\n }\n\n /**\n * Additional stylng for preformatted text/code.\n *\n * 1. Don\'t wrap long words.\n * 2. Contain overflow in all browsers.\n * 3. Set tab size to 4 spaces.\n */\n pre {\n /* 1 */\n word-wrap: normal;\n /* 2 */\n overflow-x: auto;\n padding: 0.5714286em 1.1428571em;\n /* 3 */\n tab-size: 4;\n }\n pre code {\n font-size: 1em;\n border: 0;\n padding: 0;\n background-color: transparent;\n }\n\n /**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n sub,\n sup.footnote,\n sup {\n font-size: 0.625em;\n line-height: 0em;\n position: relative;\n vertical-align: baseline;\n }\n\n sup {\n top: -0.5em;\n }\n\n sub {\n bottom: -0.25em;\n }\n\n /**\n * Harmonise size and style of small text.\n */\n small,\n figcaption,\n tfoot,\n .footnote {\n font-size: 0.75em;\n line-height: 1.5em;\n }\n\n figcaption,\n tfoot,\n .footnote {\n color: #888888;\n }\n\n figcaption {\n margin-top: 0.5em;\n font-style: italic;\n }\n\n /**\n * Address differences between Firefox and other browsers.\n */\n hr {\n -moz-box-sizing: content-box;\n -webkit-box-sizing: content-box;\n box-sizing: content-box;\n border: 0;\n border-bottom: 1px solid #cccccc;\n height: 0;\n }\n\n /* Support for non-latin languages (can be removed if not required)\n ========================================================================== */\n /**\n * Preferred font for Japanese language.\n */\n html[lang=\"ja-jp\"] {\n font-family: \"Hiragino Kaku Gothic Pro\", Meiryo, sans-serif;\n }\n\n /**\n * Preferred font for Korean language.\n */\n html[lang=\"ko-kr\"] {\n font-family: GulimChe, Gulim, sans-serif;\n }\n\n /**\n * Preferred font for Chinese (PRC) language.\n */\n html[lang=\"zh-cn\"] {\n font-family: SimHei, sans-serif;\n }\n\n /**\n * Preferred font for Chinese (Taiwan) language.\n */\n html[lang=\"zh-tw\"] {\n font-family: PMingLiU, sans-serif;\n }\n\n /**\n * Reduce risk of render glitches in links on RTL languages.\n */\n [dir=\"rtl\"] a {\n unicode-bidi: embed;\n }\n\n /**\n * Swap image alignment right/left positions in RTL languages.\n */\n [dir=\"rtl\"] img.align-left {\n float: right;\n margin: 1em 0 1em 1em;\n }\n [dir=\"rtl\"] img.align-right {\n float: left;\n margin: 1em 1em 1em 0;\n }\n\n /**\n * Swap table caption alignment in RTL languages.\n */\n [dir=\"rtl\"] caption {\n text-align: right;\n }\n\n /**\n * Swap table cell text alignments in RTL languages.\n */\n [dir=\"rtl\"] th,\n [dir=\"rtl\"] td {\n text-align: right;\n }\n\n /**\n * Swap menu/list padding positions in RTL languages.\n */\n [dir=\"rtl\"] menu,\n [dir=\"rtl\"] ol,\n [dir=\"rtl\"] ul {\n padding: 0 2em 0 0;\n }\n\n /**\n * Swap definition description margin positions in RTL languages.\n */\n [dir=\"rtl\"] dd {\n margin: 0 2em 0 0;\n }\n\n /**\n * Swap checkbox/radio margin positions in RTL languages.\n */\n [dir=\"rtl\"] input[type=\"checkbox\"] + label,\n [dir=\"rtl\"] input[type=\"radio\"] + label {\n margin: 0 0 0 0.5em;\n }\n [dir=\"rtl\"] input[type=\"checkbox\"] + label:last-of-type,\n [dir=\"rtl\"] input[type=\"radio\"] + label:last-of-type {\n margin: 0;\n }\n\n /**\n * Swap anchor float position on comments.\n */\n [dir=\"rtl\"] .comments h4 .comment-anchor {\n float: left;\n }\n\n /* Embedded content\n ========================================================================== */\n /**\n * Make embedded elements responsive.\n */\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n\n /**\n * Images.\n *\n * 1. Remove the gap between images and the bottom of their containers.\n * 2. Remove border when inside `a` element in IE 8-10.\n *\n * Image alignment (compatible with Textile markup syntax).\n *\n * Example HTML:\n *\n * <img class=\"align-left\">\n * <img class=\"align-right\">\n * <img class=\"align-center\">\n */\n img {\n /* 1 */\n vertical-align: middle;\n /* 2 */\n border: 0;\n }\n img.align-left {\n float: left;\n margin: 1em 1em 1em 0;\n }\n img.align-right {\n float: right;\n margin: 1em 0 1em 1em;\n }\n img.align-center {\n display: block;\n margin: 1em auto;\n }\n\n /**\n * Address margin not present in IE 8/9 and Safari.\n */\n figure {\n margin: 0;\n }\n\n /**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n audio:not([controls]) {\n display: none;\n height: 0;\n }\n\n /**\n * Correct overflow not hidden in IE 9/10/11.\n */\n svg:not(:root) {\n overflow: hidden;\n }\n\n /* Tables\n ========================================================================== */\n /**\n * Consistent tables.\n */\n table {\n margin-bottom: 1em;\n border-collapse: collapse;\n border-spacing: 0;\n width: 100%;\n }\n\n /**\n * Styling of table captions.\n */\n caption {\n font-style: italic;\n text-align: left;\n margin-bottom: 0.5em;\n }\n\n /**\n * Make table cells align top and left by default.\n */\n th,\n td {\n vertical-align: top;\n text-align: left;\n border-bottom: 1px solid #cccccc;\n padding: 0.25em;\n }\n\n /**\n * 1. Remove padding from top cells of table header.\n * 2. Thicker border at bottom of `thead`.\n */\n thead tr:first-child th,\n thead tr:first-child td {\n /* 1 */\n padding-top: 0;\n }\n thead tr:last-child th,\n thead tr:last-child td {\n /* 2 */\n border-bottom: 2px solid #cccccc;\n }\n\n /**\n * 1. Adjust padding of table footer due to smaller font size.\n * 2. Remove padding from bottom cells of table footer.\n */\n tfoot th,\n tfoot td {\n /* 1 */\n padding: 0.3333333em;\n }\n tfoot tr:last-child th,\n tfoot tr:last-child td {\n /* 2 */\n border-bottom: 0;\n padding-bottom: 0;\n }\n\n /**\n * Border at top of each new table row.\n */\n tbody tr:first-child td,\n tbody tr:first-child th {\n border-top: 1px solid #cccccc;\n }\n\n /**\n * Multi-row span vertical cell alignments.\n */\n [rowspan] {\n vertical-align: middle;\n }\n\n /* Lists\n ========================================================================== */\n /**\n * Address paddings set differently.\n */\n menu,\n ol,\n ul {\n padding: 0 0 0 2em;\n }\n\n /**\n * Remove margins from nested lists.\n */\n li > ul,\n li > ol {\n margin: 0;\n }\n\n /**\n * Address margins set differently.\n */\n dd {\n margin: 0 0 0 2em;\n }\n\n /**\n * Italicise definition terms.\n */\n dt {\n font-style: italic;\n }\n\n /**\n * Additional styling for article lists.\n *\n * Example HTML:\n *\n * <ul class=\"article-list\">\n */\n .article-list {\n list-style: none;\n margin: 0 0 2em;\n border-top: 1px solid #cccccc;\n padding: 0;\n }\n .article-list li {\n margin-bottom: 0;\n border-bottom: 1px solid #cccccc;\n }\n\n /* Forms\n ========================================================================== */\n /**\n * 1. Define consistent fieldset border, margin, and padding.\n * 2. Address width being affected by wide descendants in Chrome, Firefox.\n */\n fieldset {\n /* 1 */\n margin: 1em 0;\n border: 1px solid #cccccc;\n padding: 1px 1em;\n /* 2 */\n min-width: 0;\n }\n\n /**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren\'t caught out if they zero out fieldsets.\n */\n legend {\n /* 1 */\n border: 0;\n /* 2 */\n padding: 0;\n }\n\n /**\n * 1. Correct font properties not being inherited.\n * 2. Address margins set differently in Firefox 4+, Safari, and Chrome.\n * 3. Prevent elements from spilling out of their parent.\n */\n button,\n input,\n optgroup,\n select,\n textarea {\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n /* 1 */\n font-size: 100%;\n font-size: 1em;\n line-height: 1.375em;\n /* 2 */\n margin: 0;\n /* 3 */\n max-width: 100%;\n font-family: sans-serif;\n vertical-align: baseline;\n }\n\n /**\n * Colour for placeholder text.\n */\n input::-moz-placeholder,\n textarea::-moz-placeholder {\n color: #888888;\n }\n input:-ms-input-placeholder,\n textarea:-ms-input-placeholder {\n color: #888888;\n }\n input::-webkit-input-placeholder,\n textarea::-webkit-input-placeholder {\n color: #888888;\n }\n\n /**\n * Remove inner padding and border in Firefox 4+.\n */\n button::-moz-focus-inner,\n input::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n\n /**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n input[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n /**\n * Styling of form input fields.\n *\n * 1. Remove iOS Safari default styling.\n */\n input[type=\"color\"],\n input[type=\"date\"],\n input[type=\"datetime\"],\n input[type=\"datetime-local\"],\n input[type=\"email\"],\n input[type=\"month\"],\n input[type=\"number\"],\n input[type=\"password\"],\n input[type=\"search\"],\n input[type=\"tel\"],\n input[type=\"text\"],\n input[type=\"time\"],\n input[type=\"url\"],\n input[type=\"week\"],\n select,\n textarea {\n -webkit-transition: box-shadow 0.2s linear;\n transition: box-shadow 0.2s linear;\n /* 1 */\n -webkit-appearance: none;\n border: 1px solid #cccccc;\n border-radius: 0;\n padding: 0.5em 0.1875em;\n height: 2.5em;\n background: #ffffff;\n }\n input[type=\"color\"]:focus,\n input[type=\"date\"]:focus,\n input[type=\"datetime\"]:focus,\n input[type=\"datetime-local\"]:focus,\n input[type=\"email\"]:focus,\n input[type=\"month\"]:focus,\n input[type=\"number\"]:focus,\n input[type=\"password\"]:focus,\n input[type=\"search\"]:focus,\n input[type=\"tel\"]:focus,\n input[type=\"text\"]:focus,\n input[type=\"time\"]:focus,\n input[type=\"url\"]:focus,\n input[type=\"week\"]:focus,\n select:focus,\n textarea:focus {\n border-color: #7fb2ff;\n }\n\n /**\n * Remove padding from `color` fields.\n */\n input[type=\"color\"] {\n padding: 0;\n }\n\n /**\n * Fix the cursor style for Chrome\'s increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n input[type=\"number\"]::-webkit-inner-spin-button,\n input[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n }\n\n /**\n * 1. Remove excess padding in IE 8/9/10.\n * 2. Correct margins for inline checkbox/radio labels.\n */\n input[type=\"checkbox\"],\n input[type=\"radio\"] {\n /* 1 */\n padding: 0;\n }\n input[type=\"checkbox\"] + label,\n input[type=\"radio\"] + label {\n /* 2 */\n margin: 0 0.5em 0 0;\n }\n input[type=\"checkbox\"] + label:last-of-type,\n input[type=\"radio\"] + label:last-of-type {\n /* 2 */\n margin: 0;\n }\n\n /**\n * Inline search field in complementary content section.\n */\n .complementary-content input[type=\"search\"] {\n display: inline-block;\n width: 66%;\n }\n\n /**\n * Correct `select` style inheritance in Firefox.\n */\n select {\n text-transform: none;\n }\n\n /**\n * Override height set in a previous rule and allow auto heght.\n */\n select[size],\n select[multiple] {\n height: auto;\n }\n\n /**\n * Override height set in rule above and restrict to one line field.\n */\n select[size=\"0\"],\n select[size=\"1\"] {\n height: 2.5em;\n }\n}\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n /**\n * Address `select` alignment in Safari, Chrome, Opera.\n */\n select[size],\n select[multiple],\n select[multiple][size] {\n padding-right: 0.5em;\n background-image: none;\n }\n\n /**\n * Use indicator icon to signify the drop-down ability of `select` in Safari,\n * Chrome, Opera.\n */\n select,\n select[size=\"0\"],\n select[size=\"1\"] {\n padding-right: 1.5em;\n background: #ffffff url(\"data:image/svg+xml,<svg version=\'1.1\' baseProfile=\'full\' xmlns=\'http://www.w3.org/2000/svg\' xmlns:xlink=\'http://www.w3.org/1999/xlink\' x=\'0px\' y=\'0px\' width=\'17px\' height=\'5px\' viewBox=\'0 0 17 5\' enable-background=\'new 0 0 17 5\' xml:space=\'preserve\'><polygon fill=\'#333333\' points=\'0,0 5,5 10,0\'/></svg>\") right center no-repeat;\n background-size: 1.0625em 0.3125em;\n }\n}\n@media screen {\n /**\n * Normalise styling of `optgroup`.\n */\n optgroup {\n font-style: normal;\n font-weight: bold;\n color: #333333;\n }\n\n /**\n * 1. Remove default vertical scrollbar in IE 8/9/10/11.\n * 2. Restrict to vertical resizing to prevent layout breakage.\n * 3. Remove unwanted space below `textarea` in Safari, Chrome, Opera.\n */\n textarea {\n width: 100%;\n height: auto;\n min-height: 3em;\n /* 1 */\n overflow: auto;\n /* 2 */\n resize: vertical;\n /* 3 */\n vertical-align: top;\n }\n\n /**\n * Make sure disabled elements really are disabled and styled appropriately.\n *\n * 1. Override default iOS opacity setting.\n * 2. Re-set default cursor for disabled elements.\n */\n button[disabled],\n input[disabled],\n input[type=\"button\"][disabled],\n input[type=\"reset\"][disabled],\n input[type=\"submit\"][disabled],\n select[disabled],\n select[disabled] option,\n select[disabled] optgroup,\n textarea[disabled],\n span.disabled {\n -webkit-box-shadow: none !important;\n box-shadow: none !important;\n border-color: #e3e3e3 !important;\n color: #aaaaaa !important;\n background: #eeeeee !important;\n text-shadow: none !important;\n /* 1 */\n opacity: 1;\n /* 2 */\n cursor: default !important;\n }\n\n /**\n * Width display options for `input` fields. Height display options\n * for textareas.\n *\n * Example HTML:\n *\n * <input class=\"small\">\n * <input class=\"large\">\n */\n .small input {\n width: 25%;\n min-width: 151px;\n }\n .small textarea {\n height: 5.5em;\n }\n\n .large input {\n width: 50%;\n min-width: 302px;\n }\n .large textarea {\n height: 9.75em;\n }\n\n /**\n * Styling for required field indicators.\n *\n * Example HTML:\n *\n * <b class=\"required\" title=\"Required\">*</b>\n */\n .required {\n border: 0;\n color: #9d261d;\n }\n\n /**\n * Styling for form field validation.\n */\n input:focus:invalid,\n select:focus:invalid,\n textarea:focus:invalid {\n -webkit-box-shadow: none;\n box-shadow: none;\n border-color: #9d261d;\n }\n\n /* Buttons\n ========================================================================== */\n /**\n * 1. Address `overflow` set to `hidden` in IE 8/9/10/11.\n * 2. Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n */\n button {\n /* 1 */\n overflow: visible;\n /* 2 */\n text-transform: none;\n }\n\n /**\n * 1. Remove iOS Safari default styling.\n * 2. Improve usability and consistency of cursor style between image-type\n * `input` and others.\n */\n button,\n input[type=\"button\"],\n input[type=\"reset\"],\n input[type=\"submit\"] {\n text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);\n -moz-background-clip: padding;\n -webkit-background-clip: padding;\n background-clip: padding-box;\n background-color: #dddddd;\n background-image: url(\'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VlZWVlZSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2RkZGRkZCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==\');\n background-size: 100%;\n background-image: -webkit-linear-gradient(#eeeeee, #dddddd);\n background-image: linear-gradient(#eeeeee, #dddddd);\n -webkit-transition: box-shadow 0.2s linear;\n transition: box-shadow 0.2s linear;\n /* 1 */\n -webkit-appearance: none;\n display: inline-block;\n border: 1px solid #cccccc;\n border-radius: 0.5em;\n padding: 0.5em 0.75em;\n width: auto;\n height: 2.5em;\n font-weight: normal;\n text-align: center;\n color: #333333;\n /* 2 */\n cursor: pointer;\n }\n button:hover,\n input[type=\"button\"]:hover,\n input[type=\"reset\"]:hover,\n input[type=\"submit\"]:hover {\n background-color: #e8e8e8;\n background-image: url(\'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y4ZjhmOCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2U4ZThlOCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==\');\n background-size: 100%;\n background-image: -webkit-linear-gradient(#f8f8f8, #e8e8e8);\n background-image: linear-gradient(#f8f8f8, #e8e8e8);\n border-color: #aaaaaa;\n text-decoration: none;\n }\n button:active,\n input[type=\"button\"]:active,\n input[type=\"reset\"]:active,\n input[type=\"submit\"]:active {\n -webkit-box-shadow: inset 0 0.2em 0.25em rgba(0, 0, 0, 0.15);\n box-shadow: inset 0 0.2em 0.25em rgba(0, 0, 0, 0.15);\n background-color: #e4e4e4;\n background-image: url(\'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2QzZDNkMyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2U0ZTRlNCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==\');\n background-size: 100%;\n background-image: -webkit-linear-gradient(#d3d3d3, #e4e4e4);\n background-image: linear-gradient(#d3d3d3, #e4e4e4);\n border-color: #aaaaaa;\n color: #1a1a1a;\n text-decoration: none;\n }\n button:focus,\n input[type=\"button\"]:focus,\n input[type=\"reset\"]:focus,\n input[type=\"submit\"]:focus {\n border-color: #7fb2ff;\n }\n\n /* Comments\n ========================================================================== */\n /**\n * Styling for user comments.\n *\n * Example HTML:\n *\n * <article class=\"comments\">\n */\n .comments {\n margin-bottom: 1em;\n border-radius: 0.5em;\n padding: 1px 1em;\n background: #f7f7f7;\n word-wrap: break-word;\n }\n .comments h4 .is-author {\n font-weight: normal;\n }\n .comments h4 .comment-anchor {\n float: right;\n font-weight: normal;\n }\n\n /**\n * Additional styling for article author\'s comments.\n *\n * Example HTML:\n *\n * <article class=\"comments comments-author\">\n */\n .comments-author {\n background: #efefef;\n }\n\n /**\n * Styling for user comments preview.\n */\n #cpreview {\n margin-bottom: 2px;\n border-radius: 0.5em;\n padding: 1em;\n background-color: #fff9e1;\n }\n\n /**\n * Highlight text colour for comment errors.\n */\n .error_message li {\n color: #9d261d;\n }\n\n /**\n * Highlighting for comment form errors.\n */\n .comments_error {\n -webkit-box-shadow: 0 0 4px 2px #9d261d;\n box-shadow: 0 0 4px 2px #9d261d;\n border-color: #9d261d;\n }\n\n /* Popup comments (can be removed if you don\'t use popups)\n ========================================================================== */\n /**\n * Restrict maximum width of popup container.\n */\n #popup-page .container {\n max-width: 52em;\n }\n}\n/* ==========================================================================\n Additional layout for screen media 576px and up\n ========================================================================== */\n@media only screen and (min-width: 36em) {\n /**\n * Desktop version of the navigation menu. Overrides mobile first version.\n *\n * Example HTML:\n *\n * <nav class=\"site-navigation\">\n * <ul>\n * <li class=\"active\"><a></li>\n * <li><a></li>\n * <li><a></li>\n * </ul>\n * </nav>\n */\n .site-navigation {\n border-top: 1px solid #cccccc;\n }\n .site-navigation ul {\n width: 88%;\n }\n .site-navigation li {\n float: left;\n border-top: 0;\n border-right: 1px solid #cccccc;\n }\n .site-navigation li:first-child {\n border-left: 1px solid #cccccc;\n }\n .site-navigation a {\n padding: 0.5em 1em;\n }\n}\n/* ==========================================================================\n Additional layout for screen media 864px and up\n ========================================================================== */\n@media only screen and (min-width: 50em) {\n /**\n * Enlarge baseline text size.\n */\n html {\n font-size: 112.5%;\n }\n\n /**\n * Two-column layout.\n *\n * 1. Complementary content moves from under main content to the right\n * column and main column is reduced in width to allow this.\n * 2. Golden ratio at container maximum width.\n *\n * Example HTML:\n *\n * <main></main>\n * <aside class=\"complementary-content\"></aside>\n */\n main {\n /* 1 */\n float: left;\n /* 2 */\n width: 54%;\n }\n\n .complementary-content {\n /* 1 */\n float: right;\n margin: 2em 0;\n border: 1px solid #e3e3e3;\n border-radius: 0.5em;\n padding: 0 1em;\n width: 30%;\n background: #f7f7f7;\n }\n}\n/* ==========================================================================\n Styling and layout for print media\n ========================================================================== */\n@media print {\n /**\n * Remove unnecessary global styling from printed media.\n */\n * {\n -webkit-box-shadow: none !important;\n box-shadow: none !important;\n color: #000000 !important;\n text-shadow: none !important;\n background: transparent !important;\n }\n\n /**\n * Use a print-friendly font and size.\n */\n body {\n margin: 0.5cm;\n padding: 2em 5em;\n font-family: \"Helvetica Neue\", sans-serif;\n font-size: 8pt;\n line-height: 1.5;\n }\n\n /**\n * Visually separate header from body.\n */\n .site-header {\n border-bottom: solid 1pt #000000;\n }\n\n /**\n * Visually separate footer from body.\n */\n .site-footer {\n margin-top: 12pt;\n border-top: solid 1pt #000000;\n }\n\n /**\n * Hide unnecessary content from print.\n */\n nav,\n audio,\n video,\n form,\n #comments-form,\n .comments h4 a:last-child,\n .complementary-content,\n .paginator {\n display: none;\n }\n\n /**\n * Make sure links are not underlined.\n */\n a {\n text-decoration: none;\n }\n\n /**\n * Show long-form for abbreviations in print.\n */\n abbr[title]:after {\n content: \" (\" attr(title) \")\";\n }\n\n /**\n * Harmonise size, style and vertical margin of headings.\n */\n h1 {\n font-size: 32pt;\n line-height: 36pt;\n font-weight: normal;\n margin: 16pt 0;\n }\n\n h2 {\n font-size: 24pt;\n line-height: 28pt;\n page-break-after: avoid;\n orphans: 2;\n widows: 2;\n margin: 14pt 0;\n }\n\n h3 {\n font-size: 18pt;\n line-height: 22pt;\n page-break-after: avoid;\n orphans: 2;\n widows: 2;\n margin: 12pt 0;\n }\n\n h4 {\n font-size: 14pt;\n line-height: 18pt;\n page-break-after: avoid;\n orphans: 2;\n widows: 2;\n margin: 11pt 0;\n }\n\n h5 {\n font-size: 12pt;\n line-height: 16pt;\n page-break-after: avoid;\n orphans: 2;\n widows: 2;\n margin: 10pt 0;\n }\n\n h6 {\n font-size: 10pt;\n line-height: 14pt;\n page-break-after: avoid;\n orphans: 2;\n widows: 2;\n margin: 9pt 0;\n }\n\n /**\n * Prevent widows (single final paragraph line on next page) and orphans (single\n * first paragraph line on previous page).\n */\n p {\n orphans: 2;\n widows: 2;\n }\n\n /**\n * Harmonise size and style of small text.\n */\n footer,\n figcaption,\n tfoot,\n small,\n .footnote {\n font-size: 6pt;\n }\n\n /**\n * Simple blockquote styling.\n *\n * 1. Avoid blockquotes breaking across multiple pages.\n */\n blockquote {\n font-size: 16pt;\n border-left: 3pt solid #000000;\n padding: 0 0 0 8pt;\n /* 1 */\n page-break-inside: avoid;\n }\n\n /**\n * Simple preformatted text styling.\n */\n pre {\n margin-bottom: 8pt;\n border: solid 1pt #000000;\n padding: 8pt;\n }\n\n /**\n * Avoid user comments breaking across multiple pages.\n */\n .comments {\n page-break-inside: avoid;\n }\n\n /**\n * Use a print-friendly monospaced font and size.\n */\n pre,\n code,\n kbd,\n samp,\n var {\n font-family: \"Courier New\", Courier, monospace;\n }\n\n /**\n * Italic definitons, quotes and definition terms.\n */\n dfn,\n q,\n dt {\n font-style: italic;\n }\n\n /**\n * Images.\n *\n * 1. Ensure images are maximum possible width.\n * 2. Avoid images breaking across multiple pages.\n *\n * Image alignment (compatible with Textile markup syntax).\n *\n * Example HTML:\n *\n * <img class=\"align-left\">\n * <img class=\"align-right\">\n * <img class=\"align-center\">\n */\n img {\n /* 1 */\n max-width: 100% !important;\n /* 2 */\n page-break-inside: avoid;\n }\n img.align-left {\n float: left;\n margin: 1em 1em 1em 0;\n }\n img.align-right {\n float: right;\n margin: 1em 0 1em 1em;\n }\n img.align-center {\n display: block;\n margin: 1em auto;\n }\n\n /**\n * Ensure margin below `figure`.\n */\n figure {\n margin-bottom: 8pt;\n }\n\n /**\n * Ensure margin above `figcaption`.\n */\n figcaption {\n margin-top: 4pt;\n }\n\n /**\n * Simple bullet styling for `ul` unordered lists.\n */\n ul {\n list-style: square;\n padding: 0 0 8pt 1.8em;\n }\n\n /**\n * Simple numerical styling for `ol` ordered lists.\n */\n ol {\n list-style: decimal;\n padding: 0 0 8pt 1.8em;\n }\n\n /**\n * Normalise margins on `dl` definition lists.\n */\n dl {\n padding: 0 0 8pt 1.8em;\n }\n\n /**\n * 1. Ensure margin below `table`.\n * 2. Make `table` span entire page width.\n */\n table {\n /* 1 */\n margin-bottom: 8pt;\n /* 2 */\n width: 100%;\n }\n\n /**\n * Harmonise styling for `caption`.\n */\n caption {\n font-weight: bold;\n text-align: left;\n margin-bottom: 4pt;\n }\n\n /**\n * Display table head across multi-page tables.\n */\n thead {\n display: table-header-group;\n }\n thead th {\n border-top: 1pt solid #000000;\n }\n\n /**\n * Avoid table rows breaking across multiple pages.\n */\n tr {\n page-break-inside: avoid;\n }\n\n /**\n * Simple styling for table cells.\n */\n th,\n td {\n border-bottom: solid 1pt #000000;\n padding: 4pt 8pt;\n }\n}\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_css`(`name`,`css`) VALUES('ie8', '/* ==========================================================================\n Desktop version layout for IE 8 due to lack of media queries support\n ========================================================================== */\n/**\n * Enlarge baseline text size.\n */\nhtml {\n font-size: 112.5%;\n}\n\n/**\n * Don\'t allow site to collapse smaller than large breakpoint.\n */\n.container,\n.site-header,\n.site-footer,\n.site-navigation ul {\n min-width: 50em;\n}\n\n/**\n * Desktop version of the navigation menu. Overrides mobile first version.\n */\n.site-navigation {\n border-top: 1px solid #cccccc;\n}\n.site-navigation ul {\n width: 88%;\n}\n.site-navigation li {\n float: left;\n border-top: 0;\n border-right: 1px solid #cccccc;\n}\n.site-navigation li:first-child {\n border-left: 1px solid #cccccc;\n}\n.site-navigation a {\n padding: 0.5em 1em;\n}\n\n/**\n * Two-column layout.\n *\n * 1. Complementary content moves from under main content to the right column\n * and main column is reduced in width to allow this.\n * 2. Golden ratio at container maximum width.\n */\nmain {\n /* 1 */\n float: left;\n /* 2 */\n width: 54%;\n}\n\n.complementary-content {\n /* 1 */\n float: right;\n margin: 2em 0;\n border: 1px solid #e3e3e3;\n padding: 0 1em;\n width: 30%;\n background: #f7f7f7;\n}\n\n/**\n * Fix for responsive embedded content in IE 8.\n */\nimg,\nvideo {\n width: auto;\n}\n')";
// /sql:txp_css
$create_sql[] = "CREATE TABLE `".PFX."txp_discuss` (
`discussid` int(6) unsigned zerofill NOT NULL auto_increment,
`parentid` int(8) NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`web` varchar(255) NOT NULL default '',
`ip` varchar(100) NOT NULL default '',
`posted` datetime NOT NULL default '0000-00-00 00:00:00',
`message` text NOT NULL,
`visible` tinyint(4) NOT NULL default '1',
PRIMARY KEY (`discussid`),
KEY `parentid` (`parentid`)
) $tabletype PACK_KEYS=1 AUTO_INCREMENT=2 ";
$create_sql[] = "INSERT INTO `".PFX."txp_discuss` VALUES (000001, 1, 'Donald Swain', 'donald.swain@example.com', 'example.com', '127.0.0.1', now(), '<p>I enjoy your site very much.</p>', 1)";
$create_sql[] = "CREATE TABLE `".PFX."txp_discuss_ipban` (
`ip` varchar(255) NOT NULL default '',
`name_used` varchar(255) NOT NULL default '',
`date_banned` datetime NOT NULL default '0000-00-00 00:00:00',
`banned_on_message` int(8) NOT NULL default '0',
PRIMARY KEY (`ip`)
) $tabletype ";
$create_sql[] = "CREATE TABLE `".PFX."txp_discuss_nonce` (
`issue_time` datetime NOT NULL default '0000-00-00 00:00:00',
`nonce` varchar(255) NOT NULL default '',
`used` tinyint(4) NOT NULL default '0',
`secret` varchar(255) NOT NULL default '',
PRIMARY KEY (`nonce`)
) $tabletype ";
$create_sql[] = "CREATE TABLE `".PFX."txp_file` (
`id` int(11) NOT NULL auto_increment,
`filename` varchar(255) NOT NULL default '',
`category` varchar(255) NOT NULL default '',
`permissions` varchar(32) NOT NULL default '0',
`description` text NOT NULL,
`downloads` int(4) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `filename` (`filename`)
) $tabletype PACK_KEYS=0 AUTO_INCREMENT=1 ";
$create_sql[] = "CREATE TABLE `".PFX."txp_form` (
`name` varchar(64) NOT NULL default '',
`type` varchar(28) NOT NULL default '',
`Form` text NOT NULL,
PRIMARY KEY (`name`)
) $tabletype PACK_KEYS=1";
// sql:txp_form
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('article_listing', 'article', '<li class=\"article\" itemscope itemtype=\"http://schema.org/Article\">\n <h4 itemprop=\"name headline\">\n <a href=\"<txp:permlink />\" itemprop=\"url\">\n <txp:title />\n </a>\n </h4>\n\n <!-- if the article has an excerpt, display that -->\n <txp:if_excerpt>\n <div itemprop=\"description\">\n <txp:excerpt />\n </div>\n </txp:if_excerpt>\n\n <p class=\"footnote\">\n <txp:text item=\"posted\" />\n <time datetime=\"<txp:posted format=\"iso8601\" />\" itemprop=\"datePublished\">\n <txp:posted />\n </time>\n ·\n <txp:text item=\"author\" />\n <span itemprop=\"author\" itemscope itemtype=\"http://schema.org/Person\">\n <span itemprop=\"name\">\n <txp:author link=\"1\" this_section=\"1\" />\n </span>\n </span>\n </p>\n</li>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('comments', 'comment', '<!-- load the comment email into a variable. you will be using this below along with author email variable loaded in form: default.article.txp\n then check the comment email variable against article author email variable, and if it matches add \'comments-author\' class -->\n<txp:variable name=\"this_comment\" value=\'<txp:comment_email />\' />\n<txp:if_variable name=\"this_comment\" value=\'<txp:author_email />\'>\n <article class=\"comments comments-author\" itemscope itemtype=\"http://schema.org/Comment\">\n<txp:else />\n <article class=\"comments\" itemscope itemtype=\"http://schema.org/Comment\">\n</txp:if_variable>\n\n <h4>\n <span class=\"comment-author\" itemprop=\"author\" itemscope itemtype=\"http://schema.org/Person\">\n <span itemprop=\"name\">\n <txp:comment_name />\n </span>\n </span>\n\n <!-- ...now check the comment email variable against article author email variable, and if it matches add \'(author)\' text -->\n <txp:if_variable name=\"this_comment\" value=\'<txp:author_email />\'>\n <span class=\"is-author\">\n (<txp:text item=\"author\" />)\n </span>\n </txp:if_variable>\n\n <!-- add a permlink so people can link direct to this comment -->\n <span class=\"comment-anchor\" itemprop=\"url\">\n <txp:comment_permlink>#</txp:comment_permlink>\n </span>\n\n </h4>\n\n <!-- also add a \'since\' to show comment freshness -->\n <p class=\"footnote\">\n <time datetime=\"<txp:comment_time format=\"iso8601\" />\" itemprop=\"dateCreated\">\n <txp:comment_time />\n (<txp:comment_time format=\"since\" />)\n </time>\n </p>\n\n <div itemprop=\"text\">\n <txp:comment_message />\n </div>\n\n</article>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('comments_display', 'comment', '<!-- if there are comments, display them (note: example code below overrides the global preference setting for comments wrapping by stating\n attributes of wraptag=\"\" and break=\"\", you are instead using ol and li tags below)... -->\n<txp:if_comments>\n\n <section id=\"comments-head\">\n <h3>\n <txp:text item=\"comments\" />\n </h3>\n <ol class=\"comments-list\">\n\n <txp:comments wraptag=\"\" break=\"li\" /> <!-- links by default to form: \'comments.comment.txp\' unless you specify a different form -->\n\n <!-- if this is a comment preview, display it (but only if there is no error) -->\n <txp:if_comments_preview>\n <li>\n <p id=\"cpreview\">\n <txp:text item=\"press_preview_then_submit\" />\n </p>\n\n <!-- links by default to form: \'comments.comment.txp\' unless you specify a different form -->\n <txp:comments_preview wraptag=\"\" />\n\n </li>\n </txp:if_comments_preview>\n\n </ol>\n\n<!-- else if there are no comments yet and user is currently previewing comment, display it (but only if there is no error) -->\n<txp:else />\n\n <txp:if_comments_preview>\n <section id=\"comments-head\">\n <h3>\n <txp:text item=\"comments\" />\n </h3>\n <ol class=\"comments-list\">\n <li>\n <p id=\"cpreview\">\n <txp:text item=\"press_preview_then_submit\" />\n </p>\n\n <!-- links by default to form: \'comments.comment.txp\' unless you specify a different form -->\n <txp:comments_preview wraptag=\"\" />\n\n </li>\n </ol>\n\n<!-- else just display that there are simply no comments whatsoever :( ...but only if comments are allowed -->\n <txp:else />\n\n <txp:if_comments_allowed>\n <section id=\"comments-head\">\n <h3>\n <txp:text item=\"comments\" />\n </h3>\n <p>\n <txp:text item=\"no_comments\" />\n </p>\n\n </txp:if_comments_allowed>\n </txp:if_comments_preview>\n</txp:if_comments>\n\n<!-- next, if new comments are allowed for this article then display comment form -->\n<txp:if_comments_allowed>\n\n <section id=\"comments-form\">\n\n <!-- comment invite text is taken for the article\'s comment invitation field on the \'write\' screen -->\n <h3>\n <txp:comments_invite showcount=\"0\" textonly=\"1\" showalways=\"1\" />\n </h3>\n\n <!-- links by default to form: \'comment_form.comment.txp\' unless you specify a different form -->\n <txp:comments_form isize=\"32\" msgcols=\"64\" msgrows=\"4\" />\n\n </section>\n\n<!-- else display a comments expired message ...but only if comments had previously been allowed -->\n<txp:else />\n\n <txp:if_comments>\n <p>\n <strong>\n <txp:text item=\"comments_expired\" />\n </strong>\n </p>\n </txp:if_comments>\n\n</txp:if_comments_allowed>\n\n<!-- if a comments section was rendered above, close the tag -->\n<txp:if_comments>\n </section>\n<txp:else />\n <txp:if_comments_allowed>\n </section>\n </txp:if_comments_allowed>\n</txp:if_comments>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('comment_form', 'comment', '<p>\n <txp:text item=\"enter_comment_here\" />\n</p>\n\n<!-- if there is an error, then inform user -->\n<txp:if_comments_error>\n <txp:comments_error class=\"error_message\" wraptag=\"ol\" break=\"li\" />\n</txp:if_comments_error>\n\n<p class=\"large\">\n <label for=\"name\">\n <txp:text item=\"comment_name\" />\n <b class=\"required\" title=\"<txp:text item=\"required\" />\">*</b>\n </label>\n <br>\n <txp:comment_name_input />\n</p>\n\n<p class=\"large\">\n <label for=\"email\">\n <txp:text item=\"comment_email\" />\n <b class=\"required\" title=\"<txp:text item=\"required\" />\">*</b>\n </label>\n <br>\n <txp:comment_email_input />\n</p>\n\n<p class=\"large\">\n <label for=\"web\">\n <txp:text item=\"comment_web\" />\n </label>\n <br>\n <txp:comment_web_input />\n</p>\n\n<p>\n <txp:comment_remember />\n</p>\n\n<p class=\"small\">\n <label for=\"message\">\n <txp:text item=\"comment_message\" />\n <b class=\"required\" title=\"<txp:text item=\"required\" />\">*</b>\n </label>\n <br>\n <txp:comment_message_input />\n</p>\n\n<!-- preview and submit buttons (note: submit button will have a class of \'disabled\'\n applied until you have previewed the message at least once) -->\n<p>\n <txp:comment_preview />\n <txp:comment_submit />\n</p>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('default', 'article', '<article class=\"article\" itemscope itemtype=\"http://schema.org/Article\">\n\n <txp:if_individual_article>\n <h1 itemprop=\"name headline\">\n <txp:title />\n </h1>\n <txp:else />\n <h1 itemprop=\"name headline\">\n <a href=\"<txp:permlink />\" itemprop=\"url\">\n <txp:title />\n </a>\n </h1>\n </txp:if_individual_article>\n\n <p>\n <strong>\n <txp:text item=\"posted\" />\n </strong>\n <time datetime=\"<txp:posted format=\"iso8601\" />\" itemprop=\"datePublished\">\n <txp:posted />\n </time>\n\n <!-- only display comments count if comments posted, or if new comments allowed -->\n <txp:if_comments>\n <br>\n <strong>\n <txp:text item=\"comments\" />\n </strong>\n <a href=\"<txp:permlink />#comments-head\" title=\"<txp:text item=\"view\" />\" itemprop=\"discussionUrl\">\n <txp:comments_count />\n </a>\n <meta itemprop=\"interactionCount\" content=\"UserComments:<txp:comments_count />\">\n <txp:else />\n <txp:if_comments_allowed>\n <br>\n <strong>\n <txp:text item=\"comments\" />\n </strong>\n <a href=\"<txp:permlink />#comments-head\" title=\"<txp:text item=\"view\" />\" itemprop=\"discussionUrl\">0</a>\n <meta itemprop=\"interactionCount\" content=\"UserComments:0\">\n </txp:if_comments_allowed>\n </txp:if_comments>\n </p>\n\n <txp:if_article_image>\n <txp:images form=\"images\" />\n </txp:if_article_image>\n\n <div itemprop=\"articleBody\">\n <txp:body />\n </div>\n\n <p>\n <strong>\n <txp:text item=\"author\" />\n </strong>\n <span itemprop=\"author\" itemscope itemtype=\"http://schema.org/Person\">\n <span itemprop=\"name\">\n <txp:author link=\"1\" this_section=\"1\" />\n </span>\n </span>\n\n <!-- only display categories if they are actually set for an article, otherwise omit -->\n <txp:if_article_category>\n <br>\n <strong>\n <txp:text item=\"categories\" />\n </strong>\n <span itemprop=\"keywords\">\n <txp:if_article_category number=\"1\"><txp:category1 title=\"1\" link=\"1\" /></txp:if_article_category><txp:if_article_category number=\"2\"><txp:if_article_category number=\"1\">, </txp:if_article_category><txp:category2 title=\"1\" link=\"1\" /></txp:if_article_category>\n </span>\n </txp:if_article_category>\n </p>\n\n <!-- if this is an individual article then add the comments section via form: comments_display.article.txp -->\n <txp:if_individual_article>\n <txp:output_form form=\"comments_display\" />\n </txp:if_individual_article>\n\n</article>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('files', 'file', '<!-- set up variables to check whether a file also has a title, description, category associated with it... -->\n<txp:variable name=\"file_download_title\" value=\'<txp:file_download_name title=\"1\" />\' />\n<txp:variable name=\"file_download_description\" value=\'<txp:file_download_description />\' />\n<txp:variable name=\"file_download_category\" value=\'<txp:file_download_category />\' />\n\n<div itemscope itemtype=\"http://schema.org/DataDownloads\">\n\n <!-- ...if exists, use the file title, otherwise use file name -->\n <a href=\"<txp:file_download_link />\" itemprop=\"contentUrl\">\n <strong itemprop=\"name\">\n <txp:if_variable name=\"file_download_title\" value=\"\">\n <txp:file_download_name />\n <txp:else />\n <txp:file_download_name title=\"1\" />\n </txp:if_variable>\n </strong>\n </a>\n\n <!-- ...if exists, use the file description, otherwise omit that line -->\n <txp:if_variable name=\"file_download_description\" value=\"\">\n <txp:else />\n <div itemprop=\"description\">\n <txp:file_download_description />\n </div>\n </txp:if_variable>\n\n <div class=\"footnote\">\n\n <!-- ...if exists, use the file category, otherwise omit that line -->\n <txp:if_variable name=\"file_download_category\" value=\"\">\n <txp:else />\n <strong>\n <txp:text item=\"category\" />\n </strong>\n <span itemprop=\"keywords\">\n <txp:file_download_category title=\"1\" />\n </span>\n ·\n </txp:if_variable>\n\n <strong>\n <txp:text item=\"author\" />\n </strong>\n <span itemprop=\"author\" itemscope itemtype=\"http://schema.org/Person\">\n <span itemprop=\"name\">\n <txp:file_download_author link=\"1\" />\n </span>\n </span>\n ·\n <strong>\n <txp:text item=\"file_size\" />\n </strong>\n <span itemprop=\"contentSize\">\n <txp:file_download_size />\n </span>\n ·\n <strong>\n <txp:text item=\"last_modified\" />\n </strong>\n <time datetime=\"<txp:file_download_modified format=\"iso8601\" />\" itemprop=\"dateModified\">\n <txp:file_download_modified />\n </time>\n ·\n <strong>\n <txp:text item=\"download_count\" />\n </strong>\n <span itemprop=\"interactionCount\">\n <txp:file_download_downloads />\n </span>\n\n </div>\n\n</div>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('images', 'misc', '<!-- set up a variable to check whether an image also has a caption associated with it... -->\n<txp:variable name=\"caption\" value=\'<txp:image_info />\' />\n\n<!-- ...now use that image caption and wrap img inside a figure with figcaption tags, otherwise just use a plain img tag -->\n<txp:if_variable name=\"caption\" value=\"\">\n\n <!-- image - overriding the width and height to let the image scale to fit parent container -->\n <p itemprop=\"image\">\n <txp:image width=\"0\" height=\"0\" />\n </p>\n\n<txp:else />\n\n <figure itemprop=\"image\" itemscope itemtype=\"http://schema.org/ImageObject\">\n\n <!-- image - overriding the width and height to let the image scale to fit parent container -->\n <span itemprop=\"contentUrl\">\n <txp:image width=\"0\" height=\"0\" />\n </span>\n\n <!-- you do not need to specify the attribute type=\"caption\" as that is the default setting for <txp:image_info /> tag -->\n <figcaption itemprop=\"caption\">\n <txp:image_info />\n </figcaption>\n\n </figure>\n\n</txp:if_variable>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('plainlinks', 'link', '<!-- This is being used as an external links form, therefore rel is set to \'external\' -->\n<txp:linkdesctitle rel=\"external\" />\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('popup_comments', 'comment', '<!DOCTYPE html>\n<html lang=\"<txp:lang />\" dir=\"<txp:text item=\"lang_dir\" />\">\n\n<head>\n <meta charset=\"utf-8\">\n <title>\n <txp:page_title />\n </title>\n <meta name=\"generator\" content=\"Textpattern CMS\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <meta name=\"robots\" content=\"noindex, follow, noodp, noydir\">\n\n <!-- Google font API -->\n <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700,700italic\">\n\n <!-- CSS -->\n <txp:css format=\"link\" media=\"\" />\n <!-- ...or you can use (faster) external CSS files e.g. <link rel=\"stylesheet\" href=\"<txp:site_url />css/default.css\"> -->\n\n <!-- HTML5/Media Queries support for IE 8 (you can remove this section if you don\'t intend to support IE 8) -->\n <!--[if lt IE 9]>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <txp:css format=\"link\" media=\"\" name=\"ie8\" />\n <![endif]-->\n\n</head>\n\n<body class=\"popup-page\">\n\n <div class=\"wrapper\">\n <div class=\"container\">\n\n <!-- this form is only used if you set \'Comments mode\' to \'popup\' format in preferences -->\n <txp:popup_comments />\n\n </div> <!-- /.container -->\n </div> <!-- /.wrapper -->\n\n</body>\n</html>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('search_input', 'misc', '<section itemscope itemtype=\"http://schema.org/WebSite\">\n <h4>\n <txp:text item=\"search\" />\n </h4>\n <meta itemprop=\"url\" content=\"<txp:site_url />\">\n <form role=\"search\" method=\"get\" action=\"<txp:site_url />\" itemprop=\"potentialAction\" itemscope itemtype=\"http://schema.org/SearchAction\">\n <meta itemprop=\"target\" content=\"<txp:site_url />?q={q}\">\n <p>\n <input name=\"q\" type=\"search\" autosave=\"saved-searches\" results=\"5\" itemprop=\"query-input\"<txp:if_search> value=\"<txp:search_term />\"</txp:if_search>>\n <input type=\"submit\" value=\"<txp:text item=\"go\" />\">\n </p>\n </form>\n</section>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_form`(`name`,`type`,`Form`) VALUES('search_results', 'article', '<!-- count how many results return -->\n<txp:article pgonly=\"1\" />\n\n<txp:if_search_results>\n\n <!-- if search result count greater than 200 then display excessive results message, otherwise show search result count -->\n <txp:if_search_results max=\"200\">\n <h3>\n <txp:search_result_count />\n <txp:text item=\"matching_search_request\" />\n <q>\n <txp:search_term />\n </q>\n </h3>\n <txp:else />\n <h3>\n <txp:text item=\"too_common_search_term\" />\n <q>\n <txp:search_term />\n </q>\n </h3>\n </txp:if_search_results>\n\n<!-- if no search results, then display no search results message -->\n<txp:else />\n <h3>\n <txp:text item=\"no_search_matches\" />\n </h3>\n\n</txp:if_search_results>\n\n<!-- display resulting articles (10 per page; default setting) -->\n<txp:article class=\"article-list\" wraptag=\"ul\">\n\n <li class=\"article\" itemscope itemtype=\"http://schema.org/Article\">\n <h4 itemprop=\"name headline\">\n <a href=\"<txp:permlink />\" itemprop=\"url\">\n <txp:title />\n </a>\n </h4>\n\n <!-- if the article has an excerpt, display that, otherwise show highlighted keywords in context of article -->\n <txp:if_excerpt>\n <div itemprop=\"description\">\n <txp:excerpt />\n </div>\n <txp:else />\n <p>\n <txp:search_result_excerpt />\n </p>\n </txp:if_excerpt>\n\n <p class=\"footnote\">\n <txp:text item=\"posted\" />\n <time datetime=\"<txp:posted format=\"iso8601\" />\" itemprop=\"datePublished\">\n <txp:posted />\n </time>\n ·\n <txp:text item=\"author\" />\n <span itemprop=\"author\" itemscope itemtype=\"http://schema.org/Person\">\n <span itemprop=\"name\">\n <txp:author link=\"1\" this_section=\"1\" />\n </span>\n </span>\n </p>\n </li>\n\n</txp:article>\n\n<!-- check if there are further results and provide pagination links or disabled buttons depending on the result,\n this method is more flexible than using simple txp:older/txp:newer tags -->\n<txp:if_search_results min=\"11\">\n\n <txp:variable name=\"prev\" value=\'<txp:older />\' />\n <txp:variable name=\"next\" value=\'<txp:newer />\' />\n\n <p class=\"paginator\">\n <txp:if_variable name=\"next\" value=\"\">\n <txp:else />\n <a rel=\"prev\" href=\"<txp:newer />\" title=\"<txp:text item=\"prev\" />\">\n ← <txp:text item=\"prev\" />\n </a>\n </txp:if_variable>\n\n <txp:if_variable name=\"prev\" value=\"\">\n <txp:else />\n <a rel=\"next\" href=\"<txp:older />\" title=\"<txp:text item=\"next\" />\">\n <txp:text item=\"next\" /> →\n </a>\n </txp:if_variable>\n </p>\n\n</txp:if_search_results>\n')";
// /sql:txp_form
$create_sql[] = "CREATE TABLE `".PFX."txp_image` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`category` varchar(255) NOT NULL default '',
`ext` varchar(20) NOT NULL default '',
`w` int(8) NOT NULL default '0',
`h` int(8) NOT NULL default '0',
`alt` varchar(255) NOT NULL default '',
`caption` text NOT NULL,
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`author` varchar(255) NOT NULL default '',
`thumbnail` int(2) NOT NULL default '0',
PRIMARY KEY (`id`)
) $tabletype PACK_KEYS=0";
$create_sql[] = "CREATE TABLE `".PFX."txp_lang` (
`id` int(9) NOT NULL auto_increment,
`lang` varchar(16) NOT NULL,
`name` varchar(64) NOT NULL,
`event` varchar(64) NOT NULL,
`data` text,
`lastmod` timestamp,
PRIMARY KEY (`id`),
UNIQUE KEY `lang` (`lang`,`name`),
KEY `lang_2` (`lang`,`event`)
) $tabletype AUTO_INCREMENT=1 ";
$create_sql[] = "CREATE TABLE `".PFX."txp_link` (
`id` int(6) NOT NULL auto_increment,
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`category` varchar(64) NOT NULL default '',
`url` text NOT NULL,
`linkname` varchar(255) NOT NULL default '',
`linksort` varchar(128) NOT NULL default '',
`description` text NOT NULL,
PRIMARY KEY (`id`)
) $tabletype PACK_KEYS=1 AUTO_INCREMENT=4 ";
$create_sql[] = "INSERT INTO `".PFX."txp_link` VALUES (1, now(), 'textpattern', 'http://textpattern.com/', 'Textpattern Website', '10', '')";
$create_sql[] = "INSERT INTO `".PFX."txp_link` VALUES (2, now(), 'textpattern', 'http://textpattern.net/', 'Textpattern User Documentation', '20', '')";
$create_sql[] = "INSERT INTO `".PFX."txp_link` VALUES (3, now(), 'textpattern', 'http://textpattern.org/', 'Textpattern Resources', '30', '')";
$create_sql[] = "INSERT INTO `".PFX."txp_link` VALUES (4, now(), 'textpattern', 'http://textpattern.com/@textpattern', '@textpattern', '40', '')";
$create_sql[] = "INSERT INTO `".PFX."txp_link` VALUES (5, now(), 'textpattern', 'http://textpattern.com/+', '+Textpattern CMS', '50', '')";
$create_sql[] = "INSERT INTO `".PFX."txp_link` VALUES (6, now(), 'textpattern', 'http://textpattern.com/facebook', 'Textpattern Facebook Group', '60', '')";
$create_sql[] = "CREATE TABLE `".PFX."txp_log` (
`id` int(12) NOT NULL auto_increment,
`time` datetime NOT NULL default '0000-00-00 00:00:00',
`host` varchar(255) NOT NULL default '',
`page` varchar(255) NOT NULL default '',
`refer` mediumtext NOT NULL,
`status` int(11) NOT NULL default '200',
`method` varchar(16) NOT NULL default 'GET',
`ip` varchar(16) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `time` (`time`)
) $tabletype AUTO_INCREMENT=77 ";
$create_sql[] = "CREATE TABLE `".PFX."txp_page` (
`name` varchar(128) NOT NULL default '',
`user_html` text NOT NULL,
PRIMARY KEY (`name`)
) $tabletype PACK_KEYS=1";
// sql:txp_page
$create_sql[] = "INSERT INTO `".PFX."txp_page`(`name`,`user_html`) VALUES('archive', '<!DOCTYPE html>\n<html lang=\"<txp:lang />\" dir=\"<txp:text item=\"lang_dir\" />\">\n\n<head>\n <meta charset=\"utf-8\">\n <title>\n <txp:page_title />\n </title>\n\n <!-- Google font API -->\n <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700,700italic\">\n\n <!-- CSS -->\n <txp:css format=\"link\" media=\"\" />\n <!-- ...or you can use (faster) external CSS files e.g. <link rel=\"stylesheet\" href=\"<txp:site_url />css/default.css\"> -->\n\n <!-- specify meta description if available -->\n <txp:meta_description />\n\n <meta name=\"generator\" content=\"Textpattern CMS\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <meta name=\"robots\" content=\"index, follow, noodp, noydir\">\n\n <!-- specify canonical and author -->\n <txp:if_individual_article>\n <link rel=\"canonical\" href=\"<txp:permlink />\">\n <txp:meta_author title=\"1\" />\n <txp:else />\n <link rel=\"canonical\" href=\"<txp:section url=\"1\" />\">\n </txp:if_individual_article>\n\n <!-- content feeds -->\n <txp:feed_link flavor=\"atom\" format=\"link\" label=\"Atom\" />\n <txp:feed_link flavor=\"rss\" format=\"link\" label=\"RSS\" />\n\n <!-- HTML5/Media Queries support for IE 8 (you can remove this section if you don\'t intend to support IE 8) -->\n <!--[if lt IE 9]>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <txp:css format=\"link\" media=\"\" name=\"ie8\" />\n <![endif]-->\n</head>\n\n<txp:if_article_list>\n <body class=\"<txp:section />-page\" itemscope itemtype=\"http://schema.org/CollectionPage\">\n<txp:else />\n <body class=\"<txp:section />-page\" itemscope itemtype=\"http://schema.org/WebPage\">\n</txp:if_article_list>\n\n <!-- header -->\n <header class=\"site-header\">\n <h1>\n <txp:link_to_home>\n <txp:site_name />\n </txp:link_to_home>\n </h1>\n <h3>\n <txp:site_slogan />\n </h3>\n </header>\n\n <!-- navigation -->\n <nav class=\"site-navigation\" aria-label=\"<txp:text item=\"navigation\" />\" itemscope itemtype=\"http://schema.org/SiteNavigationElement\">\n <txp:section_list default_title=\'<txp:text item=\"home\" />\' include_default=\"1\" wraptag=\"ul\" break=\"\">\n <li<txp:if_section name=\'<txp:section />\'> class=\"active\"</txp:if_section>>\n <a itemprop=\"url\" href=\"<txp:section url=\"1\" />\">\n <txp:section title=\"1\" />\n </a>\n </li>\n </txp:section_list>\n </nav>\n\n <div class=\"wrapper\">\n <div class=\"container\">\n\n <!-- Main content -->\n <main aria-label=\"<txp:text item=\"main_content\" />\">\n\n <txp:if_article_list>\n\n <h1 itemprop=\"name\">\n <txp:section title=\"1\" />\n </h1>\n <txp:article class=\"article-list\" form=\"article_listing\" limit=\"5\" wraptag=\"ul\" />\n <!-- ...or if you want to list all articles from all sections instead, then replace txp:article with txp:article_custom -->\n\n <!-- add pagination links to foot of article listings if there are more articles available, this method\n is more flexible than using simple txp:link_to_prev/txp:link_to_next or txp:older/txp:newer tags -->\n <txp:variable name=\"more\" value=\'<txp:newer /><txp:older />\' />\n <txp:variable name=\"prev\" value=\'<txp:newer />\' />\n <txp:variable name=\"next\" value=\'<txp:older />\' />\n\n <txp:if_variable name=\"more\" value=\"\">\n <txp:else />\n <p class=\"paginator\">\n <txp:if_variable name=\"prev\" value=\"\">\n <txp:else />\n <a rel=\"prev\" href=\"<txp:newer />\" title=\"<txp:text item=\"newer\" />\">\n ← <txp:text item=\"newer\" />\n </a>\n </txp:if_variable>\n\n <txp:if_variable name=\"next\" value=\"\">\n <txp:else />\n <a rel=\"next\" href=\"<txp:older />\" title=\"<txp:text item=\"older\" />\">\n <txp:text item=\"older\" /> →\n </a>\n </txp:if_variable>\n </p>\n </txp:if_variable>\n\n <txp:else />\n\n <txp:article />\n\n <!-- add pagination links to foot of article if there are more articles available, this method\n is more flexible than using simple txp:link_to_prev/txp:link_to_next or txp:older/txp:newer tags -->\n <txp:variable name=\"more\" value=\'<txp:link_to_prev /><txp:link_to_next />\' />\n <txp:variable name=\"prev\" value=\'<txp:link_to_prev />\' />\n <txp:variable name=\"next\" value=\'<txp:link_to_next />\' />\n\n <txp:if_variable name=\"more\" value=\"\">\n <txp:else />\n <p class=\"paginator\">\n <txp:if_variable name=\"prev\" value=\"\">\n <txp:else />\n <a rel=\"prev\" href=\"<txp:link_to_prev />\" title=\"<txp:prev_title />\">\n ← <txp:text item=\"older\" />\n </a>\n </txp:if_variable>\n\n <txp:if_variable name=\"next\" value=\"\">\n <txp:else />\n <a rel=\"next\" href=\"<txp:link_to_next />\" title=\"<txp:next_title />\">\n <txp:text item=\"newer\" /> →\n </a>\n </txp:if_variable>\n </p>\n </txp:if_variable>\n\n </txp:if_article_list>\n\n </main>\n\n <!-- Complementary content -->\n <aside class=\"complementary-content\">\n\n <!-- links by default to form: \'search_input.misc.txp\' unless you specify a different form -->\n <txp:search_input />\n\n <!-- feed links, default flavor is RSS, so we don\'t need to specify a flavor on the first feed_link -->\n <p>\n <txp:feed_link class=\"feed-rss\" label=\"RSS\" />\n /\n <txp:feed_link class=\"feed-atom\" flavor=\"atom\" label=\"Atom\" />\n </p>\n\n <!-- if links exist, renders a links list -->\n <txp:variable name=\"links\" value=\'<txp:linklist limit=\"1\" />\' />\n\n <txp:if_variable name=\"links\" value=\"\">\n <txp:else />\n <section>\n <h4>\n <txp:text item=\"links\" />\n </h4>\n\n <!-- links by default to form: \'plainlinks.link.txp\' unless you specify a different form -->\n <txp:linklist wraptag=\"ul\" break=\"li\" />\n </section>\n </txp:if_variable>\n\n </aside>\n\n </div> <!-- /.container -->\n </div> <!-- /.wrapper -->\n\n <!-- footer -->\n <footer class=\"site-footer\" role=\"contentinfo\">\n <p>\n <small>\n <txp:text item=\"published_with\" />\n <a rel=\"external\" href=\"http://textpattern.com\" title=\"<txp:text item=\"go_txp_com\" />\">Textpattern CMS</a>\n </small>\n </p>\n </footer>\n\n <!-- add your own JavaScript here -->\n\n</body>\n</html>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_page`(`name`,`user_html`) VALUES('default', '<!DOCTYPE html>\n<html lang=\"<txp:lang />\" dir=\"<txp:text item=\"lang_dir\" />\">\n\n<head>\n <meta charset=\"utf-8\">\n <title>\n <txp:page_title />\n </title>\n\n <!-- Google font API -->\n <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700,700italic\">\n\n <!-- CSS -->\n <txp:css format=\"link\" media=\"\" />\n <!-- ...or you can use (faster) external CSS files e.g. <link rel=\"stylesheet\" href=\"<txp:site_url />css/default.css\"> -->\n\n <!-- specify meta description if available -->\n <txp:meta_description />\n\n <meta name=\"generator\" content=\"Textpattern CMS\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n <!-- specify robots and canonical -->\n <txp:if_search>\n <meta name=\"robots\" content=\"none\">\n <txp:else />\n <txp:if_category>\n <meta name=\"robots\" content=\"noindex, follow, noodp, noydir\">\n <txp:else />\n <txp:if_author>\n <meta name=\"robots\" content=\"noindex, follow, noodp, noydir\">\n <txp:else />\n <meta name=\"robots\" content=\"index, follow, noodp, noydir\">\n </txp:if_author>\n </txp:if_category>\n <txp:if_section name=\"\">\n <link rel=\"canonical\" href=\"<txp:site_url />\">\n <txp:else />\n <txp:if_individual_article>\n <link rel=\"canonical\" href=\"<txp:permlink />\">\n <txp:else />\n <link rel=\"canonical\" href=\"<txp:section url=\"1\" />\">\n </txp:if_individual_article>\n </txp:if_section>\n </txp:if_search>\n\n <!-- content feeds -->\n <txp:feed_link flavor=\"atom\" format=\"link\" label=\"Atom\" />\n <txp:feed_link flavor=\"rss\" format=\"link\" label=\"RSS\" />\n\n <!-- HTML5/Media Queries support for IE 8 (you can remove this section if you don\'t intend to support IE 8) -->\n <!--[if lt IE 9]>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <txp:css format=\"link\" media=\"\" name=\"ie8\" />\n <![endif]-->\n</head>\n\n<txp:if_section name=\"\">\n <txp:if_search>\n <body class=\"search-page\" itemscope itemtype=\"http://schema.org/SearchResultsPage\"\n <txp:else />\n <txp:if_category>\n <body class=\"listing-page\" itemscope itemtype=\"http://schema.org/CollectionPage\">\n <txp:else />\n <txp:if_author>\n <body class=\"listing-page\" itemscope itemtype=\"http://schema.org/CollectionPage\">\n <txp:else />\n <body class=\"front-page\" itemscope itemtype=\"http://schema.org/WebPage\">\n </txp:if_author>\n </txp:if_category>\n </txp:if_search>\n<txp:else />\n <body class=\"<txp:section />-page\" itemscope itemtype=\"http://schema.org/WebPage\">\n</txp:if_section>\n\n <!-- header -->\n <header class=\"site-header\">\n <h1>\n <txp:link_to_home>\n <txp:site_name />\n </txp:link_to_home>\n </h1>\n <h3>\n <txp:site_slogan />\n </h3>\n </header>\n\n <!-- navigation -->\n <nav class=\"site-navigation\" aria-label=\"<txp:text item=\"navigation\" />\" itemscope itemtype=\"http://schema.org/SiteNavigationElement\">\n <txp:section_list default_title=\'<txp:text item=\"home\" />\' include_default=\"1\" wraptag=\"ul\" break=\"\">\n <li<txp:if_section name=\'<txp:section />\'> class=\"active\"</txp:if_section>>\n <a itemprop=\"url\" href=\"<txp:section url=\"1\" />\">\n <txp:section title=\"1\" />\n </a>\n </li>\n </txp:section_list>\n </nav>\n\n <div class=\"wrapper\">\n <div class=\"container\">\n\n <!-- Main content -->\n <main aria-label=\"<txp:text item=\"main_content\" />\">\n\n <!-- is this the search result page? also omits the pagination links below (uses pagination format within search_results.article.txp instead) -->\n <txp:if_search>\n\n <h1 itemprop=\"name\">\n <txp:text item=\"search_results\" />\n </h1>\n <txp:output_form form=\"search_results\" />\n\n <txp:else />\n\n <!-- else is this an article category list? -->\n <txp:if_category>\n\n <h1 itemprop=\"name\">\n <txp:text item=\"category\" />\n <txp:category title=\"1\" />\n </h1>\n <txp:article form=\"article_listing\" limit=\"5\" wraptag=\"ul\" class=\"article-list\" />\n\n <txp:else />\n\n <!-- else is this an article author list? -->\n <txp:if_author>\n\n <h1 itemprop=\"name\">\n <txp:text item=\"author\" />\n <txp:author />\n </h1>\n <txp:article form=\"article_listing\" limit=\"5\" wraptag=\"ul\" class=\"article-list\" />\n\n <!-- else display articles normally -->\n <txp:else />\n\n <!-- links by default to form: \'default.article.txp\' unless you specify a different form -->\n <txp:article limit=\"5\" />\n\n </txp:if_author>\n </txp:if_category>\n\n <!-- add pagination links to foot of article listings/category listings/author listings if there are more articles available,\n this method is more flexible than using simple txp:link_to_prev/txp:link_to_next or txp:older/txp:newer tags -->\n <txp:variable name=\"more\" value=\'<txp:newer /><txp:older />\' />\n <txp:variable name=\"prev\" value=\'<txp:newer />\' />\n <txp:variable name=\"next\" value=\'<txp:older />\' />\n\n <txp:if_variable name=\"more\" value=\"\">\n <txp:else />\n <p class=\"paginator\">\n <txp:if_variable name=\"prev\" value=\"\">\n <txp:else />\n <a rel=\"prev\" href=\"<txp:newer />\" title=\"<txp:text item=\"newer\" />\">\n ← <txp:text item=\"newer\" />\n </a>\n </txp:if_variable>\n\n <txp:if_variable name=\"next\" value=\"\">\n <txp:else />\n <a rel=\"next\" href=\"<txp:older />\" title=\"<txp:text item=\"older\" />\">\n <txp:text item=\"older\" /> →\n </a>\n </txp:if_variable>\n </p>\n </txp:if_variable>\n\n </txp:if_search>\n\n </main>\n\n <!-- Complementary content -->\n <aside class=\"complementary-content\">\n\n <!-- links by default to form: \'search_input.misc.txp\' unless you specify a different form -->\n <txp:search_input />\n\n <!-- feed links, default flavor is RSS, so we don\'t need to specify a flavor on the first feed_link -->\n <p>\n <txp:feed_link class=\"feed-rss\" label=\"RSS\" />\n /\n <txp:feed_link class=\"feed-atom\" flavor=\"atom\" label=\"Atom\" />\n </p>\n\n <!-- if links exist, renders a links list -->\n <txp:variable name=\"links\" value=\'<txp:linklist limit=\"1\" />\' />\n\n <txp:if_variable name=\"links\" value=\"\">\n <txp:else />\n <section>\n <h4>\n <txp:text item=\"links\" />\n </h4>\n\n <!-- links by default to form: \'plainlinks.link.txp\' unless you specify a different form -->\n <txp:linklist wraptag=\"ul\" break=\"li\" />\n </section>\n </txp:if_variable>\n\n </aside>\n\n </div> <!-- /.container -->\n </div> <!-- /.wrapper -->\n\n <!-- footer -->\n <footer class=\"site-footer\" role=\"contentinfo\">\n <p>\n <small>\n <txp:text item=\"published_with\" />\n <a rel=\"external\" href=\"http://textpattern.com\" title=\"<txp:text item=\"go_txp_com\" />\">Textpattern CMS</a>\n </small>\n </p>\n </footer>\n\n <!-- add your own JavaScript here -->\n\n</body>\n</html>\n')";
$create_sql[] = "INSERT INTO `".PFX."txp_page`(`name`,`user_html`) VALUES('error_default', '<!DOCTYPE html>\n<html lang=\"<txp:lang />\" dir=\"<txp:text item=\"lang_dir\" />\">\n\n<head>\n <meta charset=\"utf-8\">\n <title>\n <txp:error_status />\n </title>\n\n <!-- Google font API -->\n <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700,700italic\">\n\n <!-- CSS -->\n <txp:css format=\"link\" media=\"\" />\n <!-- ...or you can use (faster) external CSS files e.g. <link rel=\"stylesheet\" href=\"<txp:site_url />css/default.css\"> -->\n\n <meta name=\"generator\" content=\"Textpattern CMS\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <meta name=\"robots\" content=\"none\">\n\n <!-- content feeds -->\n <txp:feed_link flavor=\"atom\" format=\"link\" label=\"Atom\" />\n <txp:feed_link flavor=\"rss\" format=\"link\" label=\"RSS\" />\n\n <!-- HTML5/Media Queries support for IE 8 (you can remove this section if you don\'t intend to support IE 8) -->\n <!--[if lt IE 9]>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js\"></script>\n <txp:css format=\"link\" media=\"\" name=\"ie8\" />\n <![endif]-->\n</head>\n\n<body class=\"error-page\" itemscope itemtype=\"http://schema.org/WebPage\">\n\n <!-- header -->\n <header class=\"site-header\">\n <h1>\n <txp:link_to_home>\n <txp:site_name />\n </txp:link_to_home>\n </h1>\n <h3>\n <txp:site_slogan />\n </h3>\n </header>\n\n <!-- navigation -->\n <nav class=\"site-navigation\" aria-label=\"<txp:text item=\"navigation\" />\" itemscope itemtype=\"http://schema.org/SiteNavigationElement\">\n <txp:section_list default_title=\'<txp:text item=\"home\" />\' include_default=\"1\" wraptag=\"ul\" break=\"\">\n <li<txp:if_section name=\'<txp:section />\'> class=\"active\"</txp:if_section>>\n <a itemprop=\"url\" href=\"<txp:section url=\"1\" />\">\n <txp:section title=\"1\" />\n </a>\n </li>\n </txp:section_list>\n </nav>\n\n <div class=\"wrapper\">\n <div class=\"container\">\n\n <!-- Main content -->\n <main aria-label=\"<txp:text item=\"main_content\" />\">\n <h1 class=\"error-status\">\n <txp:error_status />\n </h1>\n <p class=\"error-msg\">\n <txp:error_message />\n </p>\n </main>\n\n <!-- Complementary content -->\n <aside class=\"complementary-content\">\n\n <!-- links by default to form: \'search_input.misc.txp\' unless you specify a different form -->\n <txp:search_input />\n\n <!-- feed links, default flavor is RSS, so we don\'t need to specify a flavor on the first feed_link -->\n <p>\n <txp:feed_link class=\"feed-rss\" label=\"RSS\" />\n /\n <txp:feed_link class=\"feed-atom\" flavor=\"atom\" label=\"Atom\" />\n </p>\n\n <!-- if links exist, renders a links list -->\n <txp:variable name=\"links\" value=\'<txp:linklist limit=\"1\" />\' />\n\n <txp:if_variable name=\"links\" value=\"\">\n <txp:else />\n <section>\n <h4>\n <txp:text item=\"links\" />\n </h4>\n\n <!-- links by default to form: \'plainlinks.link.txp\' unless you specify a different form -->\n <txp:linklist wraptag=\"ul\" break=\"li\" />\n </section>\n </txp:if_variable>\n\n </aside>\n\n </div> <!-- /.container -->\n </div> <!-- /.wrapper -->\n\n <!-- footer -->\n <footer class=\"site-footer\" role=\"contentinfo\">\n <p>\n <small>\n <txp:text item=\"published_with\" />\n <a rel=\"external\" href=\"http://textpattern.com\" title=\"<txp:text item=\"go_txp_com\" />\">Textpattern CMS</a>\n </small>\n </p>\n </footer>\n\n <!-- add your own JavaScript here -->\n\n</body>\n</html>\n')";
// /sql:txp_page
$create_sql[] = "CREATE TABLE `".PFX."txp_plugin` (
`name` varchar(64) NOT NULL default '',
`status` int(2) NOT NULL default '1',
`author` varchar(128) NOT NULL default '',
`author_uri` varchar(128) NOT NULL default '',
`version` varchar(10) NOT NULL default '1.0',
`description` text NOT NULL,
`help` text NOT NULL,
`code` text NOT NULL,
`code_restore` text NOT NULL,
`code_md5` varchar(32) NOT NULL default '',
`type` int(2) NOT NULL default '0',
UNIQUE KEY `name` (`name`)
) $tabletype ";
$create_sql[] = "CREATE TABLE `".PFX."txp_prefs` (
`prefs_id` int(11) NOT NULL default '1',
`name` varchar(255) NOT NULL default '',
`val` varchar(255) NOT NULL default '',
`type` smallint(5) unsigned NOT NULL default '2',
`event` varchar(12) NOT NULL default 'publish',
`html` varchar(64) NOT NULL default 'text_input',
`position` smallint(5) unsigned NOT NULL default '0',
`user_name` varchar(64) NOT NULL default '',
UNIQUE KEY `prefs_idx` (`prefs_id`,`name`, `user_name`),
KEY `name` (`name`),
KEY `user_name` (`user_name`)
) $tabletype ";
$prefs['blog_uid'] = md5(uniqid(rand(), true));
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'prefs_id', '1', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'sitename', '".doSlash(gTxt('my_site'))."', 0, 'publish', 'text_input', 10, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'siteurl', 'comment.local', 0, 'publish', 'text_input', 20, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'site_slogan', '".doSlash(gTxt('my_slogan'))."', 0, 'publish', 'text_input', 30, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'language', 'en-gb', 2, 'publish', 'languages', 40, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'url_mode', '1', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'timeoffset', '0', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_on_default', '0', 0, 'comments', 'yesnoradio', 140, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_default_invite', '".$setup_comment_invite."', 0, 'comments', 'text_input', 180, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_mode', '0', 0, 'comments', 'commentmode', 200, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_disabled_after', '42', 0, 'comments', 'weeks', 210, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_textile', '2', 0, 'publish', 'pref_text', 110, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'ping_weblogsdotcom', '0', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'rss_how_many', '5', 1, 'admin', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'logging', 'none', 0, 'publish', 'logging', 100, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_comments', '1', 0, 'publish', 'yesnoradio', 120, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_categories', '1', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_sections', '1', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'send_lastmod', '0', 1, 'admin', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'path_from_root', '/', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'lastmod', '2005-07-23 16:24:10', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_dateformat', '%b %d, %I:%M %p', 0, 'comments', 'dateformats', 190, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'dateformat', 'since', 0, 'publish', 'dateformats', 70, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'archive_dateformat', '%b %d, %I:%M %p', 0, 'publish', 'dateformats', 80, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_moderate', '1', 0, 'comments', 'yesnoradio', 130, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'img_dir', 'images', 1, 'admin', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_disallow_images', '0', 0, 'comments', 'yesnoradio', 170, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_sendmail', '0', 0, 'comments', 'yesnoradio', 160, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'file_max_upload_size', '2000000', 1, 'admin', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'file_list_pageby', '25', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'path_to_site', '', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'article_list_pageby', '25', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'link_list_pageby', '25', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'image_list_pageby', '25', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'log_list_pageby', '25', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comment_list_pageby', '25', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'permlink_mode', '".doSlash($permlink_mode)."', 0, 'publish', 'permlinkmodes', 90, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_are_ol', '1', 0, 'comments', 'yesnoradio', 150, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'is_dst', '0', 0, 'publish', 'yesnoradio', 60, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'locale', 'en_GB.UTF-8', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'tempdir', '".doSlash(find_temp_dir())."', 1, 'admin', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'file_base_path', '".doSlash(dirname(txpath).DS.'files')."', 1, 'admin', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'blog_uid', '".$prefs['blog_uid']."', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'blog_mail_uid', '".doSlash('useremail')."', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'blog_time_uid', '2005', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'edit_raw_css_by_default', '1', 1, 'css', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'allow_page_php_scripting', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'allow_article_php_scripting', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'allow_raw_php_scripting', '0', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'textile_links', '0', 1, 'link', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'show_article_category_count', '1', 2, 'category', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'show_comment_count_in_feed', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'syndicate_body_or_excerpt', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'include_email_atom', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comment_means_site_updated', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'never_display_email', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_require_name', '1', 1, 'comments', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_require_email', '1', 1, 'comments', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'articles_use_excerpts', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'allow_form_override', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'attach_titles_to_permalinks', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'permalink_title_format', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'expire_logs_after', '7', 1, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_plugins', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_1_set', 'custom1', 1, 'custom', 'text_input', 1, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_2_set', 'custom2', 1, 'custom', 'text_input', 2, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_3_set', '', 1, 'custom', 'text_input', 3, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_4_set', '', 1, 'custom', 'text_input', 4, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_5_set', '', 1, 'custom', 'text_input', 5, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_6_set', '', 1, 'custom', 'text_input', 6, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_7_set', '', 1, 'custom', 'text_input', 7, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_8_set', '', 1, 'custom', 'text_input', 8, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_9_set', '', 1, 'custom', 'text_input', 9, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_10_set', '', 1, 'custom', 'text_input', 10, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_dns', '0', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'admin_side_plugins', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comment_nofollow', '1', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_mail_on_feeds_id', '0', 1, 'publish', 'yesnoradio', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'max_url_len', '1000', 1, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'spam_blacklists', '', 1, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'override_emailcharset', '0', 1, 'admin', 'yesnoradio', 21, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'production_status', 'testing', 0, 'publish', 'prod_levels', 210, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_auto_append', '0', 0, 'comments', 'yesnoradio', 211, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'dbupdatetime', '1122194504', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'version', '1.0rc4', 2, 'publish', 'text_input', 0, '')";
$create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'doctype', 'html5', 0, 'publish', 'doctypes', 190, '')";
$create_sql[] = "CREATE TABLE `".PFX."txp_section` (
`name` varchar(128) NOT NULL default '',
`page` varchar(128) NOT NULL default '',
`css` varchar(128) NOT NULL default '',
`is_default` int(2) NOT NULL default '0',
`in_rss` int(2) NOT NULL default '1',
`on_frontpage` int(2) NOT NULL default '1',
`searchable` int(2) NOT NULL default '1',
`title` varchar(255) NOT NULL default '',
PRIMARY KEY (`name`)
) $tabletype PACK_KEYS=1";
$create_sql[] = "INSERT INTO `".PFX."txp_section` VALUES ('articles', 'archive', 'default', 1, 1, 1, 1, 'Articles')";
$create_sql[] = "INSERT INTO `".PFX."txp_section` VALUES ('default', 'default', 'default', 0, 1, 1, 1, 'Default')";
$create_sql[] = "CREATE TABLE `".PFX."txp_users` (
`user_id` int(4) NOT NULL auto_increment,
`name` varchar(64) NOT NULL default '',
`pass` varchar(128) NOT NULL default '',
`RealName` varchar(64) NOT NULL default '',
`email` varchar(100) NOT NULL default '',
`privs` tinyint(2) NOT NULL default '1',
`last_access` datetime NOT NULL default '0000-00-00 00:00:00',
`nonce` varchar(64) NOT NULL default '',
PRIMARY KEY (`user_id`),
UNIQUE KEY `name` (`name`)
) $tabletype PACK_KEYS=1 AUTO_INCREMENT=2 ";
$GLOBALS['txp_install_successful'] = true;
$GLOBALS['txp_err_count'] = 0;
foreach ($create_sql as $query) {
$result = mysqli_query($link, $query);
if (!$result) {
$GLOBALS['txp_err_count']++;
echo "<b>".$GLOBALS['txp_err_count'].".</b> ".mysqli_error($link)."<br />\n";
echo "<!--\n $query \n-->\n";
$GLOBALS['txp_install_successful'] = false;
}
}
// Skip the RPC language fetch when testing.
if (defined('TXP_TEST')) {
return;
}
require_once txpath.'/lib/IXRClass.php';
$client = new IXR_Client('http://rpc.textpattern.com');
if (!$client->query('tups.getLanguage', $prefs['blog_uid'], LANG)) {
// If cannot install from lang file, setup the English lang.
if (!install_language_from_file(LANG)) {
$lang = 'en-gb';
include_once txpath.'/setup/en-gb.php';
if (!@$lastmod) {
$lastmod = '0000-00-00 00:00:00';
}
foreach ($en_gb_lang as $evt_name => $evt_strings) {
foreach ($evt_strings as $lang_key => $lang_val) {
$lang_val = doSlash($lang_val);
if (@$lang_val) {
mysqli_query($link, "INSERT DELAYED INTO `".PFX."txp_lang` SET lang='en-gb', name='".$lang_key."', event='".$evt_name."', data='".$lang_val."', lastmod='".$lastmod."'");
}
}
}
}
} else {
$response = $client->getResponse();
$lang_struct = unserialize($response);
foreach ($lang_struct as $item) {
foreach ($item as $name => $value) {
$item[$name] = doSlash($value);
}
mysqli_query($link, "INSERT DELAYED INTO `".PFX."txp_lang` SET lang='".LANG."', name='".$item['name']."', event='".$item['event']."', data='".$item['data']."', lastmod='".strftime('%Y%m%d%H%M%S', $item['uLastmod'])."'");
}
}
mysqli_query($link, "FLUSH TABLE `".PFX."txp_lang`");
/**
* Stub replacement for txplib_db.php/safe_escape()
*
* @ignore
*/
function safe_escape($in = '')
{
global $link;
return mysqli_real_escape_string($link, $in);
}