<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>


<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>

		<title lang="en"><![CDATA[Knowledge Base]]></title>

		<description lang="en"><![CDATA[Adds a Knowledge Base to your Forum.]]></description>

		<author-group>

			<author>
				<realname><![CDATA[Tobias Schäfer]]></realname>
				<email><![CDATA[tobi.schaefer@gmail.com]]></email>
				<username><![CDATA[tas2580]]></username>
				<homepage><![CDATA[http://tas2580.de]]></homepage>

			</author>

		</author-group>
		<mod-version>0.2.9</mod-version>
		<installation>
			<level>intermediate</level>
			<time>700</time>
			<target-version>3.0.4</target-version>
		</installation>
		<history>

			<entry>
				<date>2007-11-6</date>
				<rev-version>0.1.0</rev-version>
				<changelog lang="en">

					<change><![CDATA[First relase]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2007-11-7</date>
				<rev-version>0.1.1</rev-version>
				<changelog lang="en">

					<change><![CDATA[Fixed some Bugs in language file]]></change>

					<change><![CDATA[Fixed a security hole]]></change>

					<change><![CDATA[Optimized SQL-Querrys]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2007-11-7</date>
				<rev-version>0.1.2</rev-version>
				<changelog lang="en">

					<change><![CDATA[Added permissions]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2007-11-9</date>
				<rev-version>0.1.3</rev-version>
				<changelog lang="en">

					<change><![CDATA[Fixed bug in kbposting.php with preview]]></change>

					<change><![CDATA[moved index forn kb.php to /artikel/index.php]]></change>

					<change><![CDATA[Added english language]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2007-11-13</date>
				<rev-version>0.1.4</rev-version>
				<changelog lang="en">

					<change><![CDATA[Fixed bug with smilies]]></change>

					<change><![CDATA[Fixed Bug with disable bbcode]]></change>

					<change><![CDATA[Optimized code]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2007-11-14</date>
				<rev-version>0.1.5</rev-version>
				<changelog lang="en">

					<change><![CDATA[Added missing language variables in english languagefile]]></change>

					<change><![CDATA[You can give a custom filename for every article]]></change>

					<change><![CDATA[Renamed /artikel/ in /knowledge/ because of more international]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2007-11-15</date>
				<rev-version>0.1.6</rev-version>
				<changelog lang="en">

					<change><![CDATA[Added a page for subcategories witch lists all articles in the subcategorie]]></change>

					<change><![CDATA[Added config in ACP]]></change>

					<change><![CDATA[Bether english translation (thanks to RedTrinity)]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-3-8</date>
				<rev-version>0.1.7</rev-version>
				<changelog lang="en">

					<change><![CDATA[Added a history for eatch article]]></change>

					<change><![CDATA[Added types for articles]]></change>

					<change><![CDATA[Optimized the selectbox for categories]]></change>

					<change><![CDATA[Changed the way to create or edit a subcategorie in ACP]]></change>

					<change><![CDATA[Added infos like author, release date, last change date and views in the article]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-3-9</date>
				<rev-version>0.2.0</rev-version>
				<changelog lang="en">

					<change><![CDATA[Made categories moveable]]></change>

					<change><![CDATA[Added reason for edits]]></change>

					<change><![CDATA[Added highlight function for search]]></change>

					<change><![CDATA[Optimized search and added advanced search]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-3-12</date>
				<rev-version>0.2.1</rev-version>
				<changelog lang="en">

					<change><![CDATA[Fixed some bugs]]></change>

					<change><![CDATA[Optimized code]]></change>

					<change><![CDATA[Added images for subcategorie]]></change>

					<change><![CDATA[Added alternative index]]></change>

					<change><![CDATA[Added template for subsilver2]]></change>

					<change><![CDATA[Added option to delete entrys in log]]></change>

					<change><![CDATA[Added option to give a article no type]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-3-13</date>
				<rev-version>0.2.1</rev-version>
				<changelog lang="en">

					<change><![CDATA[Fixed some bugs]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-3-18</date>
				<rev-version>0.2.2</rev-version>
				<changelog lang="en">

					<change><![CDATA[Fixed some bugs]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-3-25</date>
				<rev-version>0.2.3</rev-version>
				<changelog lang="en">

					<change><![CDATA[Fixed some bugs]]></change>

					<change><![CDATA[Optimized Code]]></change>

					<change><![CDATA[Post topic in forum when activating article]]></change>

					<change><![CDATA[New premission to delete article log]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-3-31</date>
				<rev-version>0.2.4</rev-version>
				<changelog lang="en">

					<change><![CDATA[Fixed some bugs]]></change>

					<change><![CDATA[Optimized Code]]></change>

					<change><![CDATA[Optimized SQL]]></change>

					<change><![CDATA[New vaiable for username in KB posts]]></change>

					<change><![CDATA[BB code for categorie description]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-4-1</date>
				<rev-version>0.2.5</rev-version>
				<changelog lang="en">

					<change><![CDATA[Added unlimited subcategories]]></change>

					<change><![CDATA[Fixed some bugs]]></change>

					<change><![CDATA[Cache SQL for types and categories]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-4-2</date>
				<rev-version>0.2.6</rev-version>
				<changelog lang="en">

					<change><![CDATA[Update KB post when updating article]]></change>

					<change><![CDATA[Fixed some bugs]]></change>

					<change><![CDATA[disable article types]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-7-8</date>
				<rev-version>2.0.8</rev-version>
				<changelog lang="en">

					<change><![CDATA[Fixed some bugs]]></change>

				</changelog>
			</entry>

			<entry>
				<date>2008-8-25</date>
				<rev-version>0.2.9</rev-version>
				<changelog lang="en">

					<change><![CDATA[ModX v1.2.0]]></change>

					<change><![CDATA[Added MCP]]></change>

					<change><![CDATA[Added sort articles]]></change>

					<change><![CDATA[Added ACP rights]]></change>

					<change><![CDATA[Added article reporting]]></change>

					<change><![CDATA[Fixed some bugs]]></change>

				</changelog>
			</entry>

		</history>







	</header>
	<action-group>

		<copy>

			<file from="root/adm/style/acp_kb_categories.html" to="adm/style/acp_kb_categories.html" />

			<file from="root/adm/style/acp_kb_config.html" to="adm/style/acp_kb_config.html" />

			<file from="root/adm/style/acp_kb_types.html" to="adm/style/acp_kb_types.html" />

			<file from="root/knowledge/index.php" to="knowledge/index.php" />

			<file from="root/knowledge/kb_categorie.php" to="knowledge/kb_categorie.php" />

			<file from="root/knowledge/kb_common.php" to="knowledge/kb_common.php" />

			<file from="root/knowledge/kb_show.php" to="knowledge/kb_show.php" />

			<file from="root/knowledge/kbposting.php" to="knowledge/kbposting.php" />

			<file from="root/knowledge/kb-search.php" to="knowledge/kb-search.php" />

			<file from="root/includes/acp/info/acp_kb.php" to="includes/acp/info/acp_kb.php" />

			<file from="root/includes/acp/acp_kb.php" to="includes/acp/acp_kb.php" />

			<file from="root/includes/functions_kb.php" to="includes/functions_kb.php" />

			<file from="root/language/en/mods/kb.php" to="language/en/mods/kb.php" />

			<file from="root/language/en/mods/permissions_kb.php" to="language/en/mods/permissions_kb.php" />

			<file from="root/language/en/mods/info_acp_kb.php" to="language/en/mods/info_acp_kb.php" />

			<file from="root/styles/prosilver/template/kb/kb_show.html" to="styles/prosilver/template/kb/kb_show.html" />

			<file from="root/styles/prosilver/template/kb/kb_categorie.html" to="styles/prosilver/template/kb/kb_categorie.html" />

			<file from="root/styles/prosilver/template/kb/kb_index.html" to="styles/prosilver/template/kb/kb_index.html" />

			<file from="root/styles/prosilver/template/kb/kb_index_clasic.html" to="styles/prosilver/template/kb/kb_index_clasic.html" />

			<file from="root/styles/prosilver/template/kb/kb_index_modern.html" to="styles/prosilver/template/kb/kb_index_modern.html" />

			<file from="root/styles/prosilver/template/kb/kb_log.html" to="styles/prosilver/template/kb/kb_log.html" />

			<file from="root/styles/prosilver/template/kb/kb_mcp.html" to="styles/prosilver/template/kb/kb_mcp.html" />

			<file from="root/styles/prosilver/template/kb/kb_posting.html" to="styles/prosilver/template/kb/kb_posting.html" />

			<file from="root/styles/prosilver/template/kb/kb_print.html" to="styles/prosilver/template/kb/kb_print.html" />

			<file from="root/styles/prosilver/template/kb/kb_search.html" to="styles/prosilver/template/kb/kb_search.html" />

			<file from="root/styles/prosilver/template/kb/kb_searchform.html" to="styles/prosilver/template/kb/kb_searchform.html" />

			<file from="root/includes/mcp/info/mcp_kb.php" to="includes/mcp/info/mcp_kb.php" />

			<file from="root/includes/mcp/mcp_kb.php" to="includes/mcp/mcp_kb.php" />

		</copy>

		<sql dbms="mysql_40"><![CDATA[CREATE TABLE `phpbb_kb_article` (
	`article_id` int(11) NOT NULL auto_increment,
	`cat_id` mediumint(8) NOT NULL default '0',
	`type_id` mediumint(8) NOT NULL,
	`hits` int(11) NOT NULL default '0',
	`titel` varchar(255) NOT NULL default '',
	`description` text NOT NULL,
	`article` longtext NOT NULL,
	`user_id` mediumint(8) NOT NULL default '0',
	`last_edit_user` mediumint(8) NOT NULL,
	`activ` tinyint(1) NOT NULL default '0',
	`bbcode_uid` varchar(8) binary NOT NULL,
	`bbcode_bitfield` varchar(255) NOT NULL default '',
	`bbcode_options` varchar(255) NOT NULL default '',
	`enable_magic_url` tinyint(1) NOT NULL default '0',
	`enable_smilies` tinyint(1) NOT NULL default '0',
	`enable_bbcode` tinyint(1) NOT NULL default '0',
	`post_time` varchar(14) NOT NULL,
	`page_uri` varchar(255) NOT NULL default '',
	`last_change` varchar(14) NOT NULL,
	`post_id` mediumint(8) NOT NULL default '0',
	 PRIMARY KEY  (`article_id`)
) TYPE=MyISAM  AUTO_INCREMENT=1 ;]]></sql>

		<sql dbms="mysql_40"><![CDATA[CREATE TABLE `phpbb_kb_categorie` (
	`cat_id` mediumint(8) NOT NULL auto_increment,
	`right_id` mediumint(8) NOT NULL,
	`left_id` mediumint(8) NOT NULL,
	`parent_id` mediumint(8) NOT NULL default '0',	
	`cat_mode` tinyint(1) NOT NULL,
	`cat_parents` text NULL,
	`show_edits` tinyint(1) NOT NULL,
	`post_forum` mediumint(8) default NULL,
	`cat_title` varchar(255) binary NOT NULL,
	`description` text NOT NULL,
	`bbcode_uid` varchar(8) binary NOT NULL,
	`bbcode_bitfield` varchar(255) binary NOT NULL,
	`bbcode_options` mediumint(4) NOT NULL,
	`image` varchar(255) binary NOT NULL,
	PRIMARY KEY  (`cat_id`)
) TYPE=MyISAM  AUTO_INCREMENT=1 ;]]></sql>

		<sql dbms="mysql_40"><![CDATA[CREATE TABLE `phpbb_kb_config` (
	`config_name` varchar(100) binary NOT NULL,
	`config_value` mediumtext NOT NULL,
	`config_type` tinyint(1) NOT NULL default '1'
) TYPE=MyISAM;]]></sql>

		<sql dbms="mysql_40"><![CDATA[INSERT INTO `phpbb_kb_config` (`config_name`, `config_value`, `config_type`) VALUES
	('kb_title', '', 1),
	('kb_description', '', 1),
	('post_subject', '', 1),
	('post_message','', 1),
	('index_topics', '3', 0),
	('topic_type', '0', 0),
	('post_user', '2', 0),
	('kb_mode', '1', 0),
	('cache_time', '3600', 0),
	('activ_types', '1', 0),
	('show_post_edit', '1', 0),
	('update_post', '1', 0);]]></sql>

		<sql dbms="mysql_40"><![CDATA[CREATE TABLE `phpbb_kb_changelog` (
	`log_id` MEDIUMINT(8) NOT NULL auto_increment,
	`article_id` MEDIUMINT(8) NOT NULL,
	`time` varchar(14) binary NOT NULL,
	`user_id` MEDIUMINT(8) NOT NULL,
	`reason` MEDIUMTEXT NULL,
	PRIMARY KEY  (`log_id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;]]></sql>

		<sql dbms="mysql_40"><![CDATA[CREATE TABLE `phpbb_kb_types` (
	`type_id` MEDIUMINT(8) NOT NULL auto_increment,
	`name` varchar(255) binary NOT NULL,
	PRIMARY KEY  (`type_id`)
) TYPE=MyISAM  AUTO_INCREMENT=1 ;]]></sql>

		<sql dbms="mysql_40"><![CDATA[INSERT INTO `phpbb_acl_options` (`auth_option`, `is_global`, `is_local`, `founder_only`) VALUES
	('u_add_kb', 1, 0, 0),
	('u_edit_kb', 1, 0, 0),
	('u_del_kb', 1, 0, 0),
	('u_print_kb', 1, 0, 0),
	('u_attache_kb', 1, 0, 0),
	('u_report_kb', 1, 0, 0),
	
	('m_log_kb', 1, 0, 0),
	('m_log_kb_delete', 1, 0, 0),
	('m_report_kb', 1, 0, 0),
	('m_activate_kb', 1, 0, 0),
	('m_edit_kb', 1, 0, 0),
	('m_del_kb', 1, 0, 0),
	
	('a_config_kb', 1, 0, 0),
	('a_categorie_kb', 1, 0, 0),
	('a_types_kb', 1, 0, 0);]]></sql>

		<open src="includes/constants.php">

			<edit>

				<find><![CDATA[// Additional tables]]></find>

				<action type="after-add"><![CDATA[define('KB_ARTICLE_TABLE',		$table_prefix . 'kb_article');
define('KB_CATEGORIE_TABLE',	$table_prefix . 'kb_categorie');
define('KB_CONFIG_TABLE',		$table_prefix . 'kb_config');
define('KB_LOG_TABLE',			$table_prefix . 'kb_changelog');
define('KB_TYPES_TABLE',		$table_prefix . 'kb_types');
define('KB_REPORTS_TABLE',		$table_prefix . 'kb_reports');
define('KB_FOLDER',				'knowledge');]]></action>

			</edit>

		</open>

		<open src="includes/functions.php">

			<edit>

				<find><![CDATA['U_SEARCH'				=> append_sid("{$phpbb_root_path}search.$phpEx"),]]></find>

				<action type="after-add"><![CDATA['U_KB'			=> append_sid("{$phpbb_root_path}" . KB_FOLDER . '/'),]]></action>

			</edit>

		</open>

		<open src="language/en/common.php">

			<edit>

				<find><![CDATA['YOU_NO_NEW_PM'		=> 'No new private messages are waiting for you.',]]></find>

				<action type="after-add"><![CDATA['KNOWLEDGE_BASE'		=> 'Knowledge Base',]]></action>

			</edit>

		</open>

		<open src="viewonline.php">

			<edit>

				<find><![CDATA[$location_url = append_sid("{$phpbb_root_path}faq.$phpEx");
									break;]]></find>

				<action type="after-add"><![CDATA[case KB_FOLDER . '/index':
			$location = $user->lang['KNOWLEDGE_BASE'];
			$location_url = append_sid("{$phpbb_root_path}" . KB_FOLDER . '/');
		break;]]></action>

			</edit>

		</open>

		<open src="styles/prosilver/template/overall_header.html">

			<edit>

				<find><![CDATA[<ul class="linklist rightside">]]></find>

				<action type="after-add"><![CDATA[<li class="icon-kb"><a href="{U_KB}" title="{L_KB}" accesskey="k">{L_KB}</a></li>]]></action>

			</edit>

		</open>

		<open src="styles/prosilver/theme/buttons.css">

			<edit>

				<find><![CDATA[.icon-bookmark, .icon-bump, .icon-subscribe, .icon-unsubscribe, .icon-pages, .icon-search]]></find>

				<inline-edit>

					<inline-find><![CDATA[]]></inline-find>

					<inline-action type="after-add"><![CDATA[]]></inline-action>

				</inline-edit>

			</edit>

		</open>

		<open src="styles/prosilver/theme/colours.css">

			<edit>

				<find><![CDATA[.icon-search					{ background-image: url("{T_THEME_PATH}/images/icon_search.gif"); }]]></find>

				<action type="after-add"><![CDATA[.icon-kb				{ background-image: url("{T_THEME_PATH}/images/icon_kb.gif"); }]]></action>

			</edit>

		</open>

		<open src="download/file.php">

			<edit>

				<find><![CDATA[if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach']))]]></find>

				<action type="replace-with"><![CDATA[// Begin Knowledge Base
//if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach']))
if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] == 1 && !$config['allow_pm_attach']))
// End Knowledge Base]]></action>

			</edit>

			<edit>

				<find><![CDATA[if (!$attachment['in_message'])]]></find>

				<action type="replace-with"><![CDATA[// Begin Knowledge Base
	//if (!$attachment['in_message'])
	if (!$attachment['in_message'] || $attachment['in_message'] == 2)
	// End Knowledge Base]]></action>

			</edit>

		</open>

		<diy-instructions lang="en"><![CDATA[Install ACP module (&quot;Konfiguration [acp_kb]&quot;)]]></diy-instructions>

		<diy-instructions lang="en"><![CDATA[Install ACP module (&quot;Kategorien [acp_kb]&quot;)]]></diy-instructions>

		<diy-instructions lang="en"><![CDATA[Install ACP module (&quot;Artikeltypen [acp_kb]&quot;)]]></diy-instructions>

		<diy-instructions lang="en"><![CDATA[Install MCP module (&quot;Uebersicht [mcp_kb]&quot;)]]></diy-instructions>

		<diy-instructions lang="en"><![CDATA[Install MCP module (&quot;Artikel freischalten [mcp_kb]&quot;)]]></diy-instructions>

		<diy-instructions lang="en"><![CDATA[Install MCP module (&quot;Gemeldete Artikel [mcp_kb]&quot;)]]></diy-instructions>

		<diy-instructions lang="en"><![CDATA[Clear Cache
Set premissions]]></diy-instructions>

	</action-group>
</mod>