PageRenderTime 66ms CodeModel.GetById 36ms RepoModel.GetById 1ms app.codeStats 0ms

/textpattern/setup/txpsql.php

https://bitbucket.org/Manfre/xpattern
PHP | 586 lines | 515 code | 60 blank | 11 comment | 17 complexity | 32d2b2c425c1e61b640bd318c7d099fd MD5 | raw file
Possible License(s): AGPL-1.0

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /*
  3. $HeadURL: http://textpattern.googlecode.com/svn/development/4.0/textpattern/setup/txpsql.php $
  4. $LastChangedRevision: 2893 $
  5. */
  6. if (!defined('TXP_INSTALL'))
  7. exit;
  8. @ignore_user_abort(1);
  9. @set_time_limit(0);
  10. mysql_connect($dhost,$duser,$dpass,false,$dclient_flags);
  11. mysql_select_db($ddb);
  12. $result = mysql_query("describe `".PFX."textpattern`");
  13. if ($result) die("Textpattern database table already exist. Can't run setup.");
  14. $version = mysql_get_server_info();
  15. //Use "ENGINE" if version of MySQL > (4.0.18 or 4.1.2)
  16. $tabletype = ( intval($version[0]) >= 5 || preg_match('#^4\.(0\.[2-9]|(1[89]))|(1\.[2-9])#',$version))
  17. ? " ENGINE=MyISAM "
  18. : " TYPE=MyISAM ";
  19. // On 4.1 or greater use utf8-tables
  20. if ( isset($dbcharset) && (intval($version[0]) >= 5 || preg_match('#^4\.[1-9]#',$version)))
  21. {
  22. $tabletype .= " CHARACTER SET = $dbcharset ";
  23. if ($dbcharset == 'utf8')
  24. $tabletype .= " COLLATE utf8_general_ci ";
  25. mysql_query("SET NAMES ".$dbcharset);
  26. }
  27. // Default to messy URLs if we know clean ones won't work
  28. $permlink_mode = 'section_id_title';
  29. if (is_callable('apache_get_modules'))
  30. {
  31. $modules = apache_get_modules();
  32. if (!in_array('mod_rewrite', $modules))
  33. $permlink_mode = 'messy';
  34. }
  35. else
  36. {
  37. $server_software = (@$_SERVER['SERVER_SOFTWARE'] || @$_SERVER['HTTP_HOST'])
  38. ? ( (@$_SERVER['SERVER_SOFTWARE']) ? @$_SERVER['SERVER_SOFTWARE'] : $_SERVER['HTTP_HOST'] )
  39. : '';
  40. if (!stristr($server_software, 'Apache'))
  41. $permlink_mode = 'messy';
  42. }
  43. $name = ps('name') ? ps('name') : 'anon';
  44. $create_sql = array();
  45. $create_sql[] = "CREATE TABLE `".PFX."textpattern` (
  46. `ID` int(11) NOT NULL auto_increment,
  47. `Posted` datetime NOT NULL default '0000-00-00 00:00:00',
  48. `Expires` datetime NOT NULL default '0000-00-00 00:00:00',
  49. `AuthorID` varchar(64) NOT NULL default '',
  50. `LastMod` datetime NOT NULL default '0000-00-00 00:00:00',
  51. `LastModID` varchar(64) NOT NULL default '',
  52. `Title` varchar(255) NOT NULL default '',
  53. `Title_html` varchar(255) NOT NULL default '',
  54. `Body` mediumtext NOT NULL,
  55. `Body_html` mediumtext NOT NULL,
  56. `Excerpt` text NOT NULL,
  57. `Excerpt_html` mediumtext NOT NULL,
  58. `Image` varchar(255) NOT NULL default '',
  59. `Annotate` int(2) NOT NULL default '0',
  60. `AnnotateInvite` varchar(255) NOT NULL default '',
  61. `comments_count` int(8) NOT NULL default '0',
  62. `Status` int(2) NOT NULL default '4',
  63. `textile_body` int(2) NOT NULL default '1',
  64. `textile_excerpt` int(2) NOT NULL default '1',
  65. `Section` varchar(64) NOT NULL default '',
  66. `override_form` varchar(255) NOT NULL default '',
  67. `Keywords` varchar(255) NOT NULL default '',
  68. `url_title` varchar(255) NOT NULL default '',
  69. `custom_1` varchar(255) NOT NULL default '',
  70. `custom_2` varchar(255) NOT NULL default '',
  71. `custom_3` varchar(255) NOT NULL default '',
  72. `custom_4` varchar(255) NOT NULL default '',
  73. `custom_5` varchar(255) NOT NULL default '',
  74. `custom_6` varchar(255) NOT NULL default '',
  75. `custom_7` varchar(255) NOT NULL default '',
  76. `custom_8` varchar(255) NOT NULL default '',
  77. `custom_9` varchar(255) NOT NULL default '',
  78. `custom_10` varchar(255) NOT NULL default '',
  79. `uid` varchar(32) NOT NULL default '',
  80. `feed_time` date NOT NULL default '0000-00-00',
  81. PRIMARY KEY (`ID`),
  82. KEY `Posted` (`Posted`),
  83. FULLTEXT KEY `searching` (`Title`,`Body`)
  84. ) $tabletype PACK_KEYS=1 AUTO_INCREMENT=2 ";
  85. $setup_comment_invite = doSlash( ( gTxt('setup_comment_invite')=='setup_comment_invite') ? 'Comment' : gTxt('setup_comment_invite') );
  86. $create_sql[] = "INSERT INTO `".PFX."textpattern` VALUES (1, now(), '', '".doSlash($name)."', now(), '', 'Welcome to Your Site!', '', 'h3. What do you want to do next?\n\n* Modify or even delete this article? The \"article list\":./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\":./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://textile.thresholdstate.com/. If you want to learn more about Textile, you can dig into an \"extensive manual\":http://thresholdstate.com/articles/4312/the-textile-reference-manual later.\n* Be guided through your \"Textpattern first steps\":http://textpattern.net/wiki/index.php?title=Textpattern_First_Steps by completing some basic tasks?\n* Study the \"Textpattern Semantic Model?\":http://textpattern.net/wiki/index.php?title=Textpattern_Semantic_Model\n* Add \"another user\":./textpattern/index.php?event=admin, or extend the capabilities with \"third party plugins\":./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\":./textpattern/index.php?event=article an article you assign it to a section of your site.\n** Sections use a \"page template\":./textpattern/index.php?event=page and a \"style\":./textpattern/index.php?event=css as an output scaffold.\n** Page templates use XHTML and Textpattern tags (like this: @<txp:print_a_thingy />@) to build the markup.\n** Some Textpattern tags use \"forms\":./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://textbook.textpattern.net/wiki/index.php?title=Alphabetical_Tag_Listing, their attributes and values are as well explained as sampled at the \"Textbook Wiki\":http://textbook.textpattern.net/wiki/index.php?title=TextBook_International, 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', '<h3>What do you want to do next?</h3>\n\t<p>Modify or even delete this article? The <a href=\"<txp:site_url />textpattern/index.php?event=list\">article list</a> is the place to start.</p>\n\t<p>Change this site&#8217;s name, or modify the style of the <span class=\"caps\">URL</span>s? It&#8217;s all up to your <a href=\"<txp:site_url />textpattern/index.php?event=prefs\">preferences</a>.</p>\n\t<p>Get yourself acquainted with Textile, the humane web text generator which comes with Textpattern? The basics are <a href=\"http://textile.thresholdstate.com/\">simple</a>. If you want to learn more about Textile, you can dig into an <a href=\"http://thresholdstate.com/articles/4312/the-textile-reference-manual\">extensive manual</a> later.</p>\n\t<p>Be guided through your <a href=\"http://textpattern.net/wiki/index.php?title=Textpattern_First_Steps\">Textpattern first steps</a> by completing some basic tasks?</p>\n\t<p>Study the <a href=\"http://textpattern.net/wiki/index.php?title=Textpattern_Semantic_Model\">Textpattern Semantic Model?</a></p>\n\t<p>Add <a href=\"<txp:site_url />textpattern/index.php?event=admin\">another user</a>, or extend the capabilities with <a href=\"<txp:site_url />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>?</p>\n\t<p>Dive in and learn by trial and error? Then please note:\n\t<ul>\n\t\t<li>When you <a href=\"<txp:site_url />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=\"<txp:site_url />textpattern/index.php?event=page\">page template</a> and a <a href=\"<txp:site_url />textpattern/index.php?event=css\">style</a> as an output scaffold.</li>\n\t\t<li>Page templates use <span class=\"caps\">XHTML</span> and Textpattern tags (like this: <code>&lt;txp:print_a_thingy /&gt;</code>) to build the markup.</li>\n\t\t<li>Some Textpattern tags use <a href=\"<txp:site_url />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>\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\t<p><a href=\"http://textbook.textpattern.net/wiki/index.php?title=Alphabetical_Tag_Listing\">Textpattern tags</a>, their attributes and values are as well explained as sampled at the <a href=\"http://textbook.textpattern.net/wiki/index.php?title=TextBook_International\">Textbook Wiki</a>, where you will also find valuable tips and tutorials.</p>\n\t<p>If all else fails, there&#8217;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>\n', '', '', '', 1, '".$setup_comment_invite."', 1, 4, 1, 1, 'articles', '', '', 'welcome-to-your-site', '', '', '', '', '', '', '', '', '', '', '".md5(uniqid(rand(), true))."', now())";
  87. $create_sql[] = "CREATE TABLE `".PFX."group` (
  88. `id` int(6) NOT NULL,
  89. `name` varchar(64) NOT NULL default '',
  90. PRIMARY KEY (`id`),
  91. UNIQUE KEY `name` (`name`)
  92. ) $tabletype PACK_KEYS=1";
  93. $create_sql[] = "INSERT INTO `".PFX."group` VALUES (0, 'none')";
  94. $create_sql[] = "INSERT INTO `".PFX."group` VALUES (1, 'publisher')";
  95. $create_sql[] = "INSERT INTO `".PFX."group` VALUES (2, 'managing_editor')";
  96. $create_sql[] = "INSERT INTO `".PFX."group` VALUES (3, 'copy_editor')";
  97. $create_sql[] = "INSERT INTO `".PFX."group` VALUES (4, 'staff_writer')";
  98. $create_sql[] = "INSERT INTO `".PFX."group` VALUES (5, 'freelancer')";
  99. $create_sql[] = "INSERT INTO `".PFX."group` VALUES (6, 'designer')";
  100. $create_sql[] = "CREATE TABLE `".PFX."txp_category` (
  101. `id` int(6) NOT NULL auto_increment,
  102. `name` varchar(64) NOT NULL default '',
  103. `type` varchar(64) NOT NULL default '',
  104. `parent` varchar(64) NOT NULL default '',
  105. `lft` int(6) NOT NULL default '0',
  106. `rgt` int(6) NOT NULL default '0',
  107. `title` varchar(255) NOT NULL default '',
  108. PRIMARY KEY (`id`)
  109. ) $tabletype PACK_KEYS=1 AUTO_INCREMENT=10 ";
  110. $create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (1, 'root', 'article', '', 1, 8, 'root')";
  111. $create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (2, 'root', 'link', '', 1, 4, 'root')";
  112. $create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (3, 'root', 'image', '', 1, 4, 'root')";
  113. $create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (4, 'root', 'file', '', 1, 2, 'root')";
  114. $create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (5, 'hope-for-the-future', 'article', 'root', 2, 3, 'Hope for the Future')";
  115. $create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (6, 'meaningful-labor', 'article', 'root', 4, 5, 'Meaningful Labor')";
  116. $create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (7, 'reciprocal-affection', 'article', 'root', 6, 7, 'Reciprocal Affection')";
  117. $create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (8, 'textpattern', 'link', 'root', 2, 3, 'Textpattern')";
  118. $create_sql[] = "INSERT INTO `".PFX."txp_category` VALUES (9, 'site-design', 'image', 'root', 2, 3, 'Site Design')";
  119. $create_sql[] = "CREATE TABLE `".PFX."blurb` (
  120. `id` INT NOT NULL AUTO_INCREMENT ,
  121. `name` VARCHAR( 64 ) NOT NULL ,
  122. `type` VARCHAR( 32 ) NOT NULL ,
  123. `theme` VARCHAR( 32 ) NOT NULL DEFAULT 'default',
  124. `content` TEXT NOT NULL ,
  125. `mime_type` VARCHAR( 64 ) NOT NULL DEFAULT '',
  126. PRIMARY KEY ( `id` ) ,
  127. UNIQUE `hash` ( `name` , `type` , `theme` )
  128. ) $tabletype PACK_KEYS=1";
  129. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `mime_type`, `content`) VALUES ('default', 'css', 'text/css', '".doSlash(base64_decode('LyogYmFzZQ0KLS0t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luOiAycHggMCAxNXB4IDA7DQoJZm9udC1zaXplOiAwLjdlbTsNCn0NCg0KLyogZXJyb3IgcGFnZQ0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8NCg0KLmVycm9yLXN0YXR1cyB7DQoJZm9udDogMS4zZW0gR2VvcmdpYSwgVGltZXMsIHNlcmlmOw0KfQ=='))."')";
  130. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('links', 'form', '<p><txp:link /><br />\n<txp:link_description /></p>')";
  131. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('lofi', 'form', '<h3 class=\"entry-title\"><txp:title /> <txp:permlink>#</txp:permlink></h3>\n\n<p class=\"published\"><txp:posted /></p>\n\n<div class=\"entry-content\">\n<txp:body />\n</div>\n\n<hr />\n\n')";
  132. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('single', 'form', '<h3 class=\"entry-title\"><txp:permlink><txp:title /></txp:permlink></h3>\n\t<p class=\"published\"><txp:posted /></p>\n\n<div class=\"entry-content\">\n<txp:body />\n</div>\n\n')";
  133. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('plainlinks', 'form', '<txp:linkdesctitle /><br />')";
  134. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('comments', 'form', '<txp:comment_message />\n\n<p class=\"small\">&#8212; <txp:comment_name /> &#183; <txp:comment_time /> &#183; <txp:comment_permlink>#</txp:comment_permlink></p>')";
  135. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('default', 'form', '<txp:if_individual_article>\n<h1 class=\"entry-title\"><txp:permlink><txp:title /></txp:permlink></h1>\n<txp:else />\n<h3 class=\"entry-title\"><txp:permlink><txp:title /></txp:permlink></h3>\n</txp:if_individual_article>\n\n<p class=\"published\"><txp:posted /></p>\n\n<div class=\"entry-content\">\n<txp:body />\n</div>\n\n<address class=\"vcard author\">&#8212; <span class=\"fn\"><txp:author /></span></address>\n\n<p class=\"tags\"><p class=\"tags\"><txp:list_article_cats link=\"1\" sep=\"; \" /></p></p>\n\n<txp:comments_invite wraptag=\"p\" />\n\n<div class=\"divider\"><img src=\"<txp:site_url />images/1.gif\" width=\"400\" height=\"1\" alt=\"---\" title=\"\" /></div>\n\n')";
  136. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('comment_form', 'form', '<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\">\n<tr>\n\t<td align=\"right\">\n\t\t<label for=\"name\"><txp:text item=\"comment_name\" /></label>\n\t</td>\n\n\t<td>\n\t\t<txp:comment_name_input />\n\t\t<txp:comment_remember />\n\t</td>\n</tr>\n\n<tr>\n\t<td align=\"right\">\n\t\t<label for=\"email\"><txp:text item=\"comment_email\" /></label>\n\t</td>\n\n\t<td>\n\t\t<txp:comment_email_input />\n\t</td>\n</tr>\n\n<tr>\n\t<td align=\"right\">\n\t\t<label for=\"web\"><txp:text item=\"comment_web\" /></label>\n\t</td>\n\n\t<td>\n\t\t<txp:comment_web_input />\n\t</td>\n</tr>\n\n<tr>\n\t<td align=\"right\">\n\t\t<label for=\"message\"><txp:text item=\"comment_message\" /></label>\n\t</td>\n\n\t<td>\n\t\t<txp:comment_message_input />\n\t\t<div id=\"comments-help\"><txp:comments_help /></div>\n\t</td>\n\n</tr>\n\n<tr>\n\t<td>&nbsp;</td>\n\n\t<td>\n\t\t<txp:comment_preview />\n\t\t<txp:comment_submit />\n\t</td>\n</tr>\n\n</table>')";
  137. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('noted', 'form', '<p><txp:link />. <txp:link_description /></p>')";
  138. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('popup_comments', 'form', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t<title><txp:page_title /></title>\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"<txp:css />\" />\n</head>\n<body>\n\n<div style=\"padding: 1em; width:300px;\">\n<txp:popup_comments />\n</div>\n\n</body>\n</html>')";
  139. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('files', 'form', '<txp:text item=\"file\" />: \n<txp:file_download_link>\n<txp:file_download_name /> [<txp:file_download_size format=\"auto\" decimals=\"2\" />]\n</txp:file_download_link>\n<br />\n<txp:text item=\"category\" />: <txp:file_download_category /><br />\n<txp:text item=\"download\" />: <txp:file_download_downloads />')";
  140. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('search_results', 'form', '<h3 class=\"entry-title\"><txp:permlink><txp:title /></txp:permlink></h3>\n\n<p class=\"published\"><txp:posted /></p>\n\n<p class=\"entry-summary\"><txp:search_result_excerpt /></p>\n\n<p class=\"small\"><txp:permlink><txp:permlink /></txp:permlink></p>\n\n<div class=\"divider\"><img src=\"<txp:site_url />images/1.gif\" width=\"400\" height=\"1\" alt=\"---\" title=\"\" /></div>')";
  141. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('comments_display', 'form', '<h2 id=\"<txp:text item=\"comment\" />\"><txp:comments_invite textonly=\"1\" showalways=\"1\" showcount=\"0\" /></h2>\n\n<txp:comments />\n\n<txp:if_comments_preview>\n<div id=\"cpreview\">\n<txp:comments_preview />\n</div>\n</txp:if_comments_preview>\n\n<txp:if_comments_allowed>\n<txp:comments_form isize=\"25\" msgcols=\"45\" msgrows=\"15\" />\n<txp:else />\n<p><txp:text item=\"comments_closed\" /></p>\n</txp:if_comments_allowed>')";
  142. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `content`) VALUES ('article_listing', 'form', '<txp:if_first_article><ul class=\"directory\"></txp:if_first_article>\n\n<li><span class=\"entry-title\"><txp:permlink><txp:title /></txp:permlink></span> &#183; <span class=\"published\"><txp:posted format=\"%Y-%m-%d\" /></span></li>\n\n<txp:if_last_article></ul></txp:if_last_article>')";
  143. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `mime_type`, `content`) VALUES ('default', 'page', 'text/html', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\n\t<title><txp:page_title /></title>\n\n\t<link rel=\"home\" href=\"<txp:site_url />\" />\n\n\t<txp:feed_link flavor=\"atom\" format=\"link\" label=\"Atom\" />\n\t<txp:feed_link flavor=\"rss\" format=\"link\" label=\"RSS\" />\n\n\t<txp:css format=\"link\" />\n\n\t<txp:rsd />\n</head>\n<body id=\"<txp:if_section name=\"default\">front<txp:else /><txp:section /></txp:if_section>\">\n\n<!-- accessibility -->\n<div id=\"accessibility\">\n\t<ul>\n\t\t<li><a href=\"#content\"><txp:text item=\"go_content\" /></a></li>\n\t\t<li><a href=\"#sidebar-1\"><txp:text item=\"go_nav\" /></a></li>\n\t\t<li><a href=\"#sidebar-2\"><txp:text item=\"go_search\" /></a></li>\n\t</ul>\n</div>\n\n<div id=\"container\">\n\n<!-- head -->\n\t<div id=\"head\">\n\t\t<h1 id=\"site-name\"><txp:link_to_home><txp:site_name /></txp:link_to_home></h1>\n\t\t<p id=\"site-slogan\"><txp:site_slogan /></p>\n\t</div>\n\n<!-- left -->\n\t<div id=\"sidebar-1\">\n\t\t<txp:section_list default_title=\'<txp:text item=\"home\" />\' include_default=\"1\" wraptag=\"ul\" break=\"li\">\n\t\t\t<txp:if_section name=\'<txp:section />\'>&raquo;</txp:if_section>\n\t\t\t<txp:section link=\"1\" title=\"1\" />\n\t\t\t<txp:if_section name=\'<txp:section />\'>\n\t\t\t\t<txp:article_custom section=\'<txp:section />\' wraptag=\"ul\" break=\"li\">\n\t\t\t\t\t<txp:if_article_id>&rsaquo;</txp:if_article_id>\n\t\t\t\t\t<txp:permlink><txp:title /></txp:permlink>\n\t\t\t\t</txp:article_custom>\n\t\t\t</txp:if_section>\n\t\t</txp:section_list>\n\t\t<txp:search_input wraptag=\"p\" />\n\n\t\t<p><txp:feed_link label=\"RSS\" /> / <txp:feed_link flavor=\"atom\" label=\"Atom\" /></p>\n\t</div>\n\n<!-- right -->\n\t<div id=\"sidebar-2\">\n\t\t<txp:linklist wraptag=\"p\" />\n\n\t\t<p><a href=\"http://textpattern.com/\"><img src=\"<txp:site_url />textpattern/txp_img/txp_slug105x45.gif\" width=\"105\" height=\"45\" alt=\"Textpattern\" title=\"\" /></a></p>\n\t</div>\n\n<!-- center -->\n\t<div id=\"content\">\n<txp:if_category>\n\t\t<h2><txp:category title=\"1\" /></h2>\n\n\t\t<div class=\"hfeed\">\n\t\t<txp:article form=\"article_listing\" limit=\"5\" />\n\t\t</div>\n<txp:else />\n\t<txp:if_search>\n\t\t<h2><txp:text item=\"search_results\" />: <txp:page_url type=\"q\" /></h2>\n\n\t\t<div class=\"divider\"><img src=\"<txp:site_url />images/1.gif\" width=\"400\" height=\"1\" alt=\"---\" title=\"\" /></div>\n\t</txp:if_search>\n\n\t\t<div class=\"hfeed\">\n\t\t<txp:article limit=\"5\" />\n\t\t</div>\n</txp:if_category>\n\n\t\n<txp:if_individual_article>\n\t\t<div class=\"divider\"><img src=\"<txp:site_url />images/1.gif\" width=\"400\" height=\"1\" alt=\"---\" title=\"\" /></div>\n\n\t\t<p><txp:link_to_prev>&#171; <txp:prev_title /></txp:link_to_prev> \n\t\t\t<txp:link_to_next><txp:next_title /> &#187;</txp:link_to_next></p>\n<txp:else />\n\t\t<p><txp:older>&#171; <txp:text item=\"older\" /></txp:older> \n\t\t\t<txp:newer><txp:text item=\"newer\" /> &#187;</txp:newer></p>\n</txp:if_individual_article>\n\t</div>\n\n<!-- footer -->\n\t<div id=\"foot\">&nbsp;</div>\n\n</div>\n\n</body>\n</html>')";
  144. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `mime_type`, `content`) VALUES ('archive', 'page', 'text/html', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\n\t<title><txp:page_title /></title>\n\n\t<link rel=\"home\" href=\"<txp:site_url />\" />\n\n\t<txp:feed_link flavor=\"atom\" format=\"link\" label=\"Atom\" />\n\t<txp:feed_link flavor=\"rss\" format=\"link\" label=\"RSS\" />\n\n\t<txp:css format=\"link\" />\n\n\t<txp:rsd />\n</head>\n<body id=\"<txp:section />\">\n\n<!-- accessibility -->\n<div id=\"accessibility\">\n\t<ul>\n\t\t<li><a href=\"#content\"><txp:text item=\"go_content\" /></a></li>\n\t\t<li><a href=\"#sidebar-1\"><txp:text item=\"go_nav\" /></a></li>\n\t\t<li><a href=\"#sidebar-2\"><txp:text item=\"go_search\" /></a></li>\n\t</ul>\n</div>\n\n<div id=\"container\">\n\n<!-- head -->\n\t<div id=\"head\">\n\t\t<p id=\"site-name\"><txp:link_to_home><txp:site_name /></txp:link_to_home></p>\n\t\t<p id=\"site-slogan\"><txp:site_slogan /></p>\n\t</div>\n\n<!-- left -->\n\t<div id=\"sidebar-1\">\n\t\t<txp:section_list default_title=\'<txp:text item=\"home\" />\' include_default=\"1\" wraptag=\"ul\" break=\"li\">\n\t\t\t<txp:if_section name=\'<txp:section />\'>&raquo;</txp:if_section>\n\t\t\t<txp:section link=\"1\" title=\"1\" />\n\t\t\t<txp:if_section name=\'<txp:section />\'>\n\t\t\t\t<txp:article_custom section=\'<txp:section />\' wraptag=\"ul\" break=\"li\">\n\t\t\t\t\t<txp:if_article_id>&rsaquo;</txp:if_article_id>\n\t\t\t\t\t<txp:permlink><txp:title /></txp:permlink>\n\t\t\t\t</txp:article_custom>\n\t\t\t</txp:if_section>\n\t\t</txp:section_list>\n\n\t\t<txp:search_input wraptag=\"p\" />\n\n\t\t<p><txp:feed_link label=\"RSS\" /> / <txp:feed_link flavor=\"atom\" label=\"Atom\" /></p>\n\t</div>\n\n<!-- right -->\n\t<div id=\"sidebar-2\">\n\t\t<txp:linklist wraptag=\"p\" />\n\n\t\t<p><a href=\"http://textpattern.com/\"><img src=\"<txp:site_url />textpattern/txp_img/txp_slug105x45.gif\" width=\"105\" height=\"45\" alt=\"Textpattern\" title=\"\" /></a></p>\n\t</div>\n\n<!-- center -->\n\t<div id=\"content\">\n\t\t<txp:if_article_list><h1><txp:section title=\"1\" /></h1></txp:if_article_list>\n\n\t\t<div class=\"hfeed\">\n\t\t<txp:article listform=\"article_listing\" limit=\"5\" />\n\t\t</div>\n\t\n<txp:if_individual_article>\n\t\t<div class=\"divider\"><img src=\"<txp:site_url />images/1.gif\" width=\"400\" height=\"1\" alt=\"---\" title=\"\" /></div>\n\n\t\t<p><txp:link_to_prev>&#171; <txp:prev_title /></txp:link_to_prev> \n\t\t\t<txp:link_to_next><txp:next_title /> &#187;</txp:link_to_next></p>\n<txp:else />\n\t\t<p><txp:older>&#171; <txp:text item=\"older\" /></txp:older> \n\t\t\t<txp:newer><txp:text item=\"newer\" /> &#187;</txp:newer></p>\n</txp:if_individual_article>\n\t</div>\n\n<!-- footer -->\n\t<div id=\"foot\">&nbsp;</div>\n\n</div>\n\n</body>\n</html>')";
  145. $create_sql[] = "INSERT INTO `".PFX."blurb` (`name`, `type`, `mime_type`, `content`) VALUES ('error_default', 'page', 'text/html', '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\r\n <link href=\"/lite/css/warning.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n <title>Warning!</title>\r\n</head>\r\n<body>\r\n\r\n<!-- warning -->\r\n<div id=\"warning\">\r\n <h1>Warning!</h1>\r\n <p>\r\n <txp:error_message />\r\n </p>\r\n</div>\r\n\r\n</body>\r\n</html>')";
  146. $create_sql[] = "CREATE TABLE `".PFX."txp_discuss` (
  147. `discussid` int(6) unsigned zerofill NOT NULL auto_increment,
  148. `parentid` int(8) NOT NULL default '0',
  149. `name` varchar(255) NOT NULL default '',
  150. `email` varchar(50) NOT NULL default '',
  151. `web` varchar(255) NOT NULL default '',
  152. `ip` varchar(100) NOT NULL default '',
  153. `posted` datetime NOT NULL default '0000-00-00 00:00:00',
  154. `message` text NOT NULL,
  155. `visible` tinyint(4) NOT NULL default '1',
  156. PRIMARY KEY (`discussid`),
  157. KEY `parentid` (`parentid`)
  158. ) $tabletype PACK_KEYS=1 AUTO_INCREMENT=2 ";
  159. $create_sql[] = "INSERT INTO `".PFX."txp_discuss` VALUES (000001, 1, 'Donald Swain', 'me@here.com', 'example.com', '127.0.0.1', '2005-07-22 14:11:32', '<p>I enjoy your site very much.</p>', 1)";
  160. $create_sql[] = "CREATE TABLE `".PFX."txp_discuss_ipban` (
  161. `ip` varchar(255) NOT NULL default '',
  162. `name_used` varchar(255) NOT NULL default '',
  163. `date_banned` datetime NOT NULL default '0000-00-00 00:00:00',
  164. `banned_on_message` int(8) NOT NULL default '0',
  165. PRIMARY KEY (`ip`)
  166. ) $tabletype ";
  167. $create_sql[] = "CREATE TABLE `".PFX."txp_discuss_nonce` (
  168. `issue_time` datetime NOT NULL default '0000-00-00 00:00:00',
  169. `nonce` varchar(255) NOT NULL default '',
  170. `used` tinyint(4) NOT NULL default '0',
  171. `secret` varchar(255) NOT NULL default '',
  172. PRIMARY KEY (`nonce`)
  173. ) $tabletype ";
  174. $create_sql[] = "CREATE TABLE `".PFX."txp_file` (
  175. `id` int(11) NOT NULL auto_increment,
  176. `filename` varchar(255) NOT NULL default '',
  177. `category` varchar(255) NOT NULL default '',
  178. `permissions` varchar(32) NOT NULL default '0',
  179. `description` text NOT NULL,
  180. `downloads` int(4) unsigned NOT NULL default '0',
  181. PRIMARY KEY (`id`),
  182. UNIQUE KEY `filename` (`filename`)
  183. ) $tabletype PACK_KEYS=0 AUTO_INCREMENT=1 ";
  184. $create_sql[] = "CREATE TABLE `".PFX."txp_image` (
  185. `id` int(11) NOT NULL auto_increment,
  186. `name` varchar(255) NOT NULL default '',
  187. `category` varchar(255) NOT NULL default '',
  188. `ext` varchar(20) NOT NULL default '',
  189. `w` int(8) NOT NULL default '0',
  190. `h` int(8) NOT NULL default '0',
  191. `alt` varchar(255) NOT NULL default '',
  192. `caption` text NOT NULL,
  193. `date` datetime NOT NULL default '0000-00-00 00:00:00',
  194. `author` varchar(255) NOT NULL default '',
  195. `thumbnail` int(2) NOT NULL default '0',
  196. PRIMARY KEY (`id`)
  197. ) $tabletype PACK_KEYS=0 AUTO_INCREMENT=2 ";
  198. $create_sql[] = "INSERT INTO `".PFX."txp_image` VALUES (1, 'divider.gif', 'site-design', '.gif', 400, 1, '', '', '2005-07-22 16:37:11', '".doSlash($name)."', 0)";
  199. $create_sql[] = "CREATE TABLE `".PFX."txp_lang` (
  200. `id` int(9) NOT NULL auto_increment,
  201. `lang` varchar(16) NOT NULL,
  202. `name` varchar(64) NOT NULL,
  203. `event` varchar(64) NOT NULL,
  204. `data` text,
  205. `lastmod` timestamp,
  206. PRIMARY KEY (`id`),
  207. UNIQUE KEY `lang` (`lang`,`name`),
  208. KEY `lang_2` (`lang`,`event`)
  209. ) $tabletype AUTO_INCREMENT=1 ";
  210. $create_sql[] = "CREATE TABLE `".PFX."txp_link` (
  211. `id` int(6) NOT NULL auto_increment,
  212. `date` datetime NOT NULL default '0000-00-00 00:00:00',
  213. `category` varchar(64) NOT NULL default '',
  214. `url` text NOT NULL,
  215. `linkname` varchar(255) NOT NULL default '',
  216. `linksort` varchar(128) NOT NULL default '',
  217. `description` text NOT NULL,
  218. PRIMARY KEY (`id`)
  219. ) $tabletype PACK_KEYS=1 AUTO_INCREMENT=4 ";
  220. $create_sql[] = "INSERT INTO `".PFX."txp_link` VALUES (1, '2005-07-20 12:54:26', 'textpattern', 'http://textpattern.com/', 'Textpattern', 'Textpattern', '')";
  221. $create_sql[] = "INSERT INTO `".PFX."txp_link` VALUES (2, '2005-07-20 12:54:41', 'textpattern', 'http://textpattern.net/', 'TextBook', 'TextBook', '')";
  222. $create_sql[] = "INSERT INTO `".PFX."txp_link` VALUES (3, '2005-07-20 12:55:04', 'textpattern', 'http://textpattern.org/', 'Txp Resources', 'Txp Resources', '')";
  223. $create_sql[] = "CREATE TABLE `".PFX."txp_log` (
  224. `id` int(12) NOT NULL auto_increment,
  225. `time` datetime NOT NULL default '0000-00-00 00:00:00',
  226. `host` varchar(255) NOT NULL default '',
  227. `page` varchar(255) NOT NULL default '',
  228. `refer` mediumtext NOT NULL,
  229. `status` int(11) NOT NULL default '200',
  230. `method` varchar(16) NOT NULL default 'GET',
  231. `ip` varchar(16) NOT NULL default '',
  232. PRIMARY KEY (`id`),
  233. KEY `time` (`time`)
  234. ) $tabletype AUTO_INCREMENT=77 ";
  235. $create_sql[] = "CREATE TABLE `".PFX."txp_plugin` (
  236. `name` varchar(64) NOT NULL default '',
  237. `status` int(2) NOT NULL default '1',
  238. `author` varchar(128) NOT NULL default '',
  239. `author_uri` varchar(128) NOT NULL default '',
  240. `version` varchar(10) NOT NULL default '1.0',
  241. `description` text NOT NULL,
  242. `help` text NOT NULL,
  243. `code` text NOT NULL,
  244. `code_restore` text NOT NULL,
  245. `code_md5` varchar(32) NOT NULL default '',
  246. `type` int(2) NOT NULL default '0',
  247. load_order TINYINT UNSIGNED NOT NULL DEFAULT 5,
  248. UNIQUE KEY `name` (`name`)
  249. ) $tabletype ";
  250. $create_sql[] = "CREATE TABLE `".PFX."txp_prefs` (
  251. `prefs_id` int(11) NOT NULL,
  252. `name` varchar(255) NOT NULL,
  253. `val` varchar(255) NOT NULL default '',
  254. `type` smallint(5) unsigned NOT NULL default '2',
  255. `event` varchar(12) NOT NULL default 'publish',
  256. `html` varchar(64) NOT NULL default 'text_input',
  257. `position` smallint(5) unsigned NOT NULL default '0',
  258. UNIQUE KEY `prefs_idx` (`prefs_id`,`name`),
  259. KEY `name` (`name`)
  260. ) $tabletype ";
  261. $prefs['blog_uid'] = md5(uniqid(rand(),true));
  262. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'prefs_id', '1', 2, 'publish', 'text_input', 0)";
  263. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'sitename', '".doSlash(gTxt('my_site'))."', 0, 'publish', 'text_input', 10)";
  264. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'siteurl', 'comment.local', 0, 'publish', 'text_input', 20)";
  265. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'site_slogan', '".doSlash(gTxt('my_slogan'))."', 0, 'publish', 'text_input', 30)";
  266. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'language', 'en-gb', 2, 'publish', 'languages', 40)";
  267. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'url_mode', '1', 2, 'publish', 'text_input', 0)";
  268. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'timeoffset', '0', 2, 'publish', 'text_input', 0)";
  269. $gmtoffset = sprintf("%+d", gmmktime(0,0,0) - mktime(0,0,0));
  270. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'gmtoffset', '".$gmtoffset."', 1, 'admin', 'text_input', 100)";
  271. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'publish_expired_articles', '0', 1, 'publish', 'yesnoradio', 130)";
  272. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_on_default', '0', 0, 'comments', 'yesnoradio', 140)";
  273. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_are_ol', '1', 0, 'comments', 'yesnoradio', 160)";
  274. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_default_invite', '".$setup_comment_invite."', 0, 'comments', 'text_input', 180)";
  275. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_mode', '0', 0, 'comments', 'commentmode', 200)";
  276. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_disabled_after', '42', 0, 'comments', 'weeks', 210)";
  277. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_textile', '2', 0, 'publish', 'pref_text', 110)";
  278. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_textilebar', '2', 0, 'publish', 'yesnradio', 115)";
  279. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'ping_weblogsdotcom', '0', 1, 'publish', 'yesnoradio', 160)";
  280. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'rss_how_many', '5', 1, 'feeds', 'text_input', 40)";
  281. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'logging', 'all', 0, 'publish', 'logging', 100)";
  282. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_comments', '1', 0, 'publish', 'yesnoradio', 120)";
  283. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_categories', '1', 2, 'publish', 'text_input', 0)";
  284. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_sections', '1', 2, 'publish', 'text_input', 0)";
  285. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'send_lastmod', '0', 1, 'admin', 'yesnoradio', 120)";
  286. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'path_from_root', '/', 2, 'publish', 'text_input', 0)";
  287. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'lastmod', '2005-07-23 16:24:10', 2, 'publish', 'text_input', 0)";
  288. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_dateformat', '%b %d, %I:%M %p', 0, 'comments', 'dateformats', 190)";
  289. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'dateformat', 'since', 0, 'publish', 'dateformats', 70)";
  290. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'archive_dateformat', '%b %d, %I:%M %p', 0, 'publish', 'dateformats', 80)";
  291. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_moderate', '1', 0, 'comments', 'yesnoradio', 130)";
  292. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'img_dir', 'images', 1, 'admin', 'text_input', 20)";
  293. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_disallow_images', '0', 0, 'comments', 'yesnoradio', 170)";
  294. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_sendmail', '0', 0, 'comments', 'yesnoradio', 160)";
  295. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_sendmail_spam', '0', 0, 'comments', 'yesnoradio', 161)";
  296. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'file_max_upload_size', '2000000', 1, 'admin', 'text_input', 60)";
  297. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'file_list_pageby', '25', 2, 'publish', 'text_input', 0)";
  298. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'path_to_site', '', 2, 'publish', 'text_input', 0)";
  299. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'article_list_pageby', '25', 2, 'publish', 'text_input', 0)";
  300. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'link_list_pageby', '25', 2, 'publish', 'text_input', 0)";
  301. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'image_list_pageby', '25', 2, 'publish', 'text_input', 0)";
  302. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'log_list_pageby', '25', 2, 'publish', 'text_input', 0)";
  303. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comment_list_pageby', '25', 2, 'publish', 'text_input', 0)";
  304. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'permlink_mode', '".doSlash($permlink_mode)."', 0, 'publish', 'permlinkmodes', 90)";
  305. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'is_dst', '0', 0, 'publish', 'yesnoradio', 60)";
  306. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'locale', 'en_GB.UTF-8', 2, 'publish', 'text_input', 0)";
  307. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'tempdir', '".doSlash(find_temp_dir())."', 1, 'admin', 'text_input', 0)";
  308. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'plugin_cache_dir', '', 1, 'admin', 'text_input', 100)";
  309. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'file_base_path', '".doSlash(dirname(txpath).DS.'files')."', 1, 'admin', 'text_input', 40)";
  310. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'blog_uid', '". $prefs['blog_uid'] ."', 2, 'publish', 'text_input', 0)";
  311. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'blog_mail_uid', '".doSlash(ps('email'))."', 2, 'publish', 'text_input', 0)";
  312. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'blog_time_uid', '".date("Y")."', 2, 'publish', 'text_input', 0)";
  313. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'allow_page_php_scripting', '1', 1, 'publish', 'yesnoradio', 300)";
  314. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'allow_article_php_scripting', '1', 1, 'publish', 'yesnoradio', 320)";
  315. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'allow_raw_php_scripting', '0', 1, 'publish', 'yesnoradio', 340)";
  316. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'show_article_category_count', '1', 2, 'category', 'yesnoradio', 0)";
  317. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'show_comment_count_in_feed', '1', 1, 'feeds', 'yesnoradio', 60)";
  318. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'syndicate_body_or_excerpt', '1', 1, 'feeds', 'yesnoradio', 20)";
  319. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'include_email_atom', '1', 1, 'feeds', 'yesnoradio', 80)";
  320. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comment_means_site_updated', '1', 1, 'comments', 'yesnoradio', 160)";
  321. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'never_display_email', '0', 1, 'comments', 'yesnoradio', 60)";
  322. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_require_name', '1', 1, 'comments', 'yesnoradio', 20)";
  323. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comments_require_email', '1', 1, 'comments', 'yesnoradio', 40)";
  324. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'articles_use_excerpts', '1', 1, 'publish', 'yesnoradio', 40)";
  325. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'allow_form_override', '1', 1, 'publish', 'yesnoradio', 60)";
  326. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'attach_titles_to_permalinks', '1', 1, 'publish', 'yesnoradio', 80)";
  327. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'permalink_title_format', '1', 1, 'publish', 'yesnoradio', 100)";
  328. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'expire_logs_after', '7', 1, 'publish', 'text_input', 200)";
  329. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_plugins', '1', 1, 'publish', 'yesnoradio', 260)";
  330. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_1_set', 'custom1', 1, 'custom', 'text_input', 1)";
  331. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_2_set', 'custom2', 1, 'custom', 'text_input', 2)";
  332. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_3_set', '', 1, 'custom', 'text_input', 3)";
  333. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_4_set', '', 1, 'custom', 'text_input', 4)";
  334. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_5_set', '', 1, 'custom', 'text_input', 5)";
  335. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_6_set', '', 1, 'custom', 'text_input', 6)";
  336. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_7_set', '', 1, 'custom', 'text_input', 7)";
  337. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_8_set', '', 1, 'custom', 'text_input', 8)";
  338. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_9_set', '', 1, 'custom', 'text_input', 9)";
  339. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'custom_10_set', '', 1, 'custom', 'text_input', 10)";
  340. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'ping_textpattern_com', '1', 1, 'publish', 'yesnoradio', 180)";
  341. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_dns', '1', 1, 'publish', 'yesnoradio', 220)";
  342. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'admin_side_plugins', '1', 1, 'publish', 'yesnoradio', 280)";
  343. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'comment_nofollow', '1', 1, 'comments', 'yesnoradio', 80)";
  344. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'use_mail_on_feeds_id', '0', 1, 'feeds', 'yesnoradio', 100)";
  345. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'max_url_len', '200', 1, 'publish', 'text_input', 240)";
  346. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'spam_blacklists', '', 1, 'comments', 'text_input', 140)";
  347. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'override_emailcharset', '0', 1, 'admin', 'yesnoradio', 120)";
  348. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'production_status', 'testing', 0, 'publish', 'prod_levels', 210)";
  349. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'dbupdatetime', '1122194504', 2, 'publish', 'text_input', 0)";
  350. // @todo: Change version
  351. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'version', '0.9b', 2, 'publish', 'text_input', 0)";
  352. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'enable_xmlrpc_server', 0, 1, 'admin', 'yesnoradio', 0)";
  353. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'author_list_pageby', 25, 2, 'publish', 'text_input', 0)";
  354. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'hide_login_in_email', '0', 1, 'admin', 'yesnoradio', 160)";
  355. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'hash_alg', 'sha256', 1, 'admin', 'hash_picker', 160)";
  356. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'admin_email', '', 1, 'admin', 'text_input', 160)";
  357. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'plugin_dir_name', 'plugin', 2, 'admin', 'text_input', 160)";
  358. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'adminstyle', 'reno.css', 1, 'admin', 'get_admin_styles', 161)";
  359. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'is_xpat', '1', 2, 'publish', 'yesnoradio', 0)";
  360. $create_sql[] = "INSERT INTO `".PFX."txp_prefs` VALUES (1, 'lang_server', '', 1, 'admin', 'text_input', 0)";
  361. $create_sql[] = "CREATE TABLE `".PFX."txp_section` (
  362. `name` varchar(128) NOT NULL,
  363. `page` varchar(128) NOT NULL default '',
  364. `css` varchar(128) NOT NULL default '',
  365. `is_default` int(2) NOT NULL default '0',
  366. `in_rss` int(2) NOT NULL default '1',
  367. `on_frontpage` int(2) NOT NULL default '1',
  368. `searchable` int(2) NOT NULL default '1',
  369. `title` varchar(255) NOT NULL default '',
  370. PRIMARY KEY (`name`)
  371. ) $tabletype PACK_KEYS=1";
  372. $create_sql[] = "INSERT INTO `".PFX."txp_section` VALUES ('articles', 'archive', 'default', 1, 1, 1, 1, 'Articles')";
  373. $create_sql[] = "INSERT INTO `".PFX."txp_section` VALUES ('default', 'default', 'default', 0, 1, 1, 1, 'default')";
  374. $create_sql[] = "INSERT INTO `".PFX."txp_section` VALUES ('about', 'default', 'default', 0, 0, 0, 1, 'About')";
  375. $create_sql[] = "CREATE TABLE `".PFX."txp_users` (
  376. `user_id` int(4) NOT NULL auto_increment,
  377. `name` varchar(64) NOT NULL default '',
  378. `hashtype` varchar(32) NOT NULL default 'password',
  379. `pass` varchar(128) NOT NULL default '',
  380. `RealName` varchar(64) NOT NULL default '',
  381. `email` varchar(100) NOT NULL default '',
  382. `privs` tinyint(2) NOT NULL default '1',
  383. `last_access` datetime NOT NULL default '0000-00-00 00:00:00',
  384. `nonce` varchar(64) NOT NULL default '',
  385. PRIMARY KEY (`user_id`),
  386. UNIQUE KEY `name` (`name`)
  387. ) $tabletype PACK_KEYS=1 AUTO_INCREMENT=2 ";
  388. $create_sql[] = "CREATE TABLE `".PFX."admin_log` (
  389. `log_id` int(12) NOT NULL auto_increment,
  390. `time` datetime NOT NULL default '0000-00-00 00:00:00',
  391. `event` varchar(32) NOT NULL default '',
  392. `step` varchar(32) NOT NULL default '',
  393. `ip` int(12) NOT NULL default '0',
  394. `user` varchar(64) NOT NULL default '',
  395. `message` varchar(128) NOT NULL default '',
  396. PRIMARY KEY (`log_id`),
  397. KEY `time` (`time`)
  398. ) $tabletype AUTO_INCREMENT=1 ";
  399. $create_sql[] = "CREATE TABLE `".PFX."perm` (
  400. `id` int(10) NOT NULL auto_increment,
  401. `name` varchar(64) NOT NULL default '',
  402. `desc` varchar(64) NOT NULL default '',
  403. PRIMARY KEY (`id`),
  404. KEY `name` (`name`)
  405. ) $tabletype AUTO_INCREMENT=1 ";
  406. $create_sql[] = "CREATE TABLE `".PFX."group_perm` (
  407. `group_id` int(10) NOT NULL,
  408. `perm_id` int(10) NOT NULL,
  409. PRIMARY KEY (`group_id`, `perm_id`),
  410. KEY `perm` (`perm_id`)
  411. ) $tabletype ";
  412. $create_sql[] = "CREATE TABLE `".PFX."category_map` (
  413. `id` int(11) NOT NULL auto_increment,
  414. `category_id` int(11) NOT NULL,
  415. `type` varchar(25) NOT NULL,
  416. `type_id` int(11) NOT NULL,
  417. PRIMARY KEY (`id`),
  418. UNIQUE KEY `category_id` (`category_id`,`type`,`type_id`)
  419. ) $tabletype ";
  420. $create_sql[] = "INSERT INTO `".PFX."category_map` VALUES ('1', '5', 'article', 1)";
  421. $create_sql[] = "INSERT INTO `".PFX."category_map` VALUES ('2', '6', 'article', 1)";
  422. $create_sql[] = "INSERT INTO `".PFX."category_map` VALUES ('3', '7', 'article', 1)";
  423. $perm = array(
  424. 'admin' => array('perm_admin','1,2,3,4,5,6'),
  425. 'admin.edit' => array('perm_admin_edit', '1'),
  426. 'admin.list' => array('perm_admin_list', '1,2,3'),
  427. 'article.delete.own' => array('perm_article_delete_own', '1,2,3,4'),
  428. 'article.delete' => array('perm_article_delete', '1,2'),
  429. 'article.edit' => array('perm_article_edit', '1,2,3'),
  430. 'article.edit.published' => array('perm_article_edit_published', '1,2,3'),
  431. 'article.edit.own' => array('perm_article_edit_own', '1,2,3,4,5,6'),
  432. 'article.edit.own.published' => array('perm_article_edit_own_published', '1,2,3,4'),
  433. 'article.publish' => array('perm_article_publish', '1,2,3,4'),
  434. 'article.php' => array('perm_article_php', '1,2'),
  435. 'article' => array('perm_article', '1,2,3,4,5,6'),
  436. 'list' => array('perm_list', '1,2,3,4,5,6'), //likely the same as for article.
  437. 'category' => array('perm_category', '1,2,3'),
  438. 'css' => array('perm_css', '…

Large files files are truncated, but you can click here to view the full file