[Phpbbkb-checkins] SF.net SVN: phpbbkb: [67] main/trunk
Status: Alpha
Brought to you by:
markthedaemon
From: <mar...@us...> - 2007-03-18 13:32:08
|
Revision: 67 http://svn.sourceforge.net/phpbbkb/?rev=67&view=rev Author: markthedaemon Date: 2007-03-17 07:00:52 -0700 (Sat, 17 Mar 2007) Log Message: ----------- Committing a kb_config table which will allow kb configuration entries to be stored in it. Works a lot like phpbb_config. It has the same table layout with the code being "borrowed" ;) that allows us to use $kb_config['value'], again like the $board_config['value'] system. Modified Paths: -------------- main/trunk/common.php main/trunk/includes/constants.php main/trunk/install/kb_install.php Modified: main/trunk/common.php =================================================================== --- main/trunk/common.php 2007-03-07 20:20:58 UTC (rev 66) +++ main/trunk/common.php 2007-03-17 14:00:52 UTC (rev 67) @@ -220,6 +220,19 @@ $board_config[$row['config_name']] = $row['config_value']; } +// Shamelessly stolen from above for the KB configuration :P. +$sql = "SELECT * + FROM " . KB_CONFIG_TABLE; +if( !($result = $db->sql_query($sql)) ) +{ + message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql); +} + +while ( $row = $db->sql_fetchrow($result) ) +{ + $kb_config[$row['config_name']] = $row['config_value']; +} + if (file_exists('install') || file_exists('contrib')) { message_die(GENERAL_MESSAGE, 'Please_remove_install_contrib'); Modified: main/trunk/includes/constants.php =================================================================== --- main/trunk/includes/constants.php 2007-03-07 20:20:58 UTC (rev 66) +++ main/trunk/includes/constants.php 2007-03-17 14:00:52 UTC (rev 67) @@ -188,6 +188,7 @@ define('KB_ARTICLES_TABLE', $table_prefix . "kb_articles"); define('KB_ARTICLECATS_TABLE', $table_prefix . "kb_articlecats"); // For Multiple cats define('KB_AUTH_ACCESS', $table_prefix . "kb_auth_access"); +define('KB_CONFIG_TABLE', $table_prefix . "kb_config"); // Article Status define('KB_STATUS_NOT_ASSIGNED', 0); Modified: main/trunk/install/kb_install.php =================================================================== --- main/trunk/install/kb_install.php 2007-03-07 20:20:58 UTC (rev 66) +++ main/trunk/install/kb_install.php 2007-03-17 14:00:52 UTC (rev 67) @@ -95,6 +95,12 @@ KEY cat_id (cat_id) )"; +$sql[] = "CREATE TABLE " . $table_prefix . "kb_config ( + config_name varchar(255) NOT NULL, + config_value varchar(255) NOT NULL, + PRIMARY KEY (config_name) +);" + $sql[] = "INSERT INTO " . $table_prefix . "kb_categories (cat_id, cat_main, cat_title, cat_desc, cat_articles, cat_order) VALUES ('', '0', 'Example Category 1', 'Example description for category 1','0', '1');"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |