phpbbkb-checkins Mailing List for phpBB Knowledge Base (Page 3)
Status: Alpha
Brought to you by:
markthedaemon
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(10) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(10) |
Feb
(19) |
Mar
(5) |
Apr
(1) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <so...@us...> - 2006-11-24 00:27:20
|
Revision: 21 http://svn.sourceforge.net/phpbbkb/?rev=21&view=rev Author: softphp Date: 2006-11-23 16:27:20 -0800 (Thu, 23 Nov 2006) Log Message: ----------- Oh boy! Big commit :) List of modifications: - Added extra fields in articles table - Added support for posting articles (Not tested yet) - Added a big part of preview and edit functions.php - Added more lang variables, but didn't write them all into lang_kb.php - Added if(!defined('IN_PHPBB')) blablabla to functions.php, constants.php & ucp_class.php. (Yes i should be shot for not doing it before. - Added multiple categories support (Not tested either) Modified Paths: -------------- root/kb/constants.php root/kb/functions.php root/kb/ucp_class.php root/kb.php root/kb_install.php root/language/lang_english/lang_kb.php root/templates/subSilver/kb_article_posting.tpl Modified: root/kb/constants.php =================================================================== --- root/kb/constants.php 2006-11-23 15:32:31 UTC (rev 20) +++ root/kb/constants.php 2006-11-24 00:27:20 UTC (rev 21) @@ -18,6 +18,11 @@ * ***************************************************************************/ +if (!defined('IN_PHPBB')) +{ + die('Hacking attempt'); +} + // All constants here // DB Tables define('KB_CATEGORIES_TABLE', $table_prefix . "kb_categories"); Modified: root/kb/functions.php =================================================================== --- root/kb/functions.php 2006-11-23 15:32:31 UTC (rev 20) +++ root/kb/functions.php 2006-11-24 00:27:20 UTC (rev 21) @@ -18,6 +18,11 @@ * ***************************************************************************/ +if (!defined('IN_PHPBB')) +{ + die('Hacking attempt'); +} + // This function creates the navigation line based on a few parameters function create_navigation($type = "main", $id_ary = array()) { @@ -69,4 +74,132 @@ return; } + +function get_cats_structure() +{ + global $db; + + $cats = array(); + $sql = "SELECT * + FROM " . KB_CATEGORIES_TABLE . " + WHERE cat_main = '0' + ORDER BY cat_order"; + if( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query cats.', '', __LINE__, __FILE__, $sql); + } + + $i = 0; + while($row = $db->sql_fetchrow($result)) + { + $cats[$i] = $row; + + $sql = "SELECT * + FROM " . KB_CATEGORIES_TABLE . " + WHERE cat_main = '" . $row['cat_id'] . "' + ORDER BY cat_order"; + if( !($subcat_result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query subcats.', '', __LINE__, __FILE__, $sql); + } + + $cats[$i]['subcats'] = array(); + while($row2 = $db->sql_fetchrow($subcat_result)) + { + $cats[$i]['subcats'][] = $row2; + } + $i++; + } + + return $cats; +} + +// These vars we need for making html safe +$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#'); +$html_entities_replace = array('&', '<', '>', '"'); + +// +// Prepare an article for the database +// +function prepare_article(&$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$bbcode_uid, &$article_title, &$article_desc, &$message, &$cat_id) +{ + global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path; + + // Check title + if (!empty($article_title)) + { + $article_title = htmlspecialchars(trim($article_title)); + } + else + { + $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['kb_empty_article_title'] : $lang['kb_empty_article_title']; + } + + // Check message + if(!empty($message)) + { + $bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : ''; + $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); + } + else + { + $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['kb_empty_article'] : $lang['kb_empty_article']; + } + + // Check categories + if(!empty($cat_id) && count($cat_id) > 0) + { + $cat_id = implode(",", $cat_id); + } + else + { + $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['kb_empty_cats'] : $lang['kb_empty_cats']; + + return; +} + +function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0) +{ + global $board_config, $html_entities_match, $html_entities_replace; + + // + // Clean up the message + // + $message = trim($message); + + if ($html_on) + { + // If HTML is on, we try to make it safe + // This approach is quite agressive and anything that does not look like a valid tag + // is going to get converted to HTML entities + $message = stripslashes($message); + $html_match = '#<[^\w<]*(\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#'; + $matches = array(); + + $message_split = preg_split($html_match, $message); + preg_match_all($html_match, $message, $matches); + + $message = ''; + + foreach ($message_split as $part) + { + $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2])); + $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag); + } + + $message = addslashes($message); + $message = str_replace('"', '\"', $message); + } + else + { + $message = preg_replace($html_entities_match, $html_entities_replace, $message); + } + + if($bbcode_on && $bbcode_uid != '') + { + $message = bbencode_first_pass($message, $bbcode_uid); + } + + return $message; +} ?> \ No newline at end of file Modified: root/kb/ucp_class.php =================================================================== --- root/kb/ucp_class.php 2006-11-23 15:32:31 UTC (rev 20) +++ root/kb/ucp_class.php 2006-11-24 00:27:20 UTC (rev 21) @@ -18,15 +18,18 @@ * ***************************************************************************/ +if (!defined('IN_PHPBB')) +{ + die('Hacking attempt'); +} + // This contains the entire ucp class, so it's seperated from the rest of kb.php class ucp { var $action = ""; - function __construct($action, $id=0) + function generate_page($action, $id=0, $preview=false) { - global $HTTP_POST_VARS['review']; - $this->action = $action; switch($this->action) { @@ -37,11 +40,11 @@ break; case "post_article": - $this->article_form("post", false, $HTTP_POST_VARS['review']); + $this->article_form("post", false, $preview); break; case "edit_article": - $this->article_form("edit", $id, $HTTP_POST_VARS['review']); + $this->article_form("edit", $id, $preview); break; case "delete_article": @@ -62,18 +65,174 @@ } } + function generate_page_title($action) + { + global $lang; + + $title = $lang['kb_ucp']; + + switch($action) + { + case "articles": + break; + + case "comments": + break; + + case "post_article": + $title .= ": " . $lang['kb_ucp_articlepost']; + break; + + case "edit_article": + + break; + + case "delete_article": + + break; + + case "post_comment": // Only input + break; + + case "edit_comment": + break; + + case "delete_comment": + break; + + default: + break; + } + + return $title; + } + // This is for posting articles, mostly cut out of the posting.php :) function article_form($mode, $id, $review) { - global $template, $board_config, $db, $userdata; + global $template, $board_config, $db, $userdata, $lang, $phpbb_root_path, $phpEx, $HTTP_POST_VARS; - if($mode == "post") + $error_msg = ''; + + if(!empty($HTTP_POST_VARS['post'])) { + // Add the new article + // Make all the variables :) + if ( !$board_config['allow_html'] ) + { + $html_on = 0; + } + else + { + $html_on = ( !empty($HTTP_POST_VARS['disable_html']) ) ? 0 : TRUE; + } + + if ( !$board_config['allow_bbcode'] ) + { + $bbcode_on = 0; + } + else + { + $bbcode_on = ( !empty($HTTP_POST_VARS['disable_bbcode']) ) ? 0 : TRUE; + } + + if ( !$board_config['allow_smilies'] ) + { + $smilies_on = 0; + } + else + { + $smilies_on = ( !empty($HTTP_POST_VARS['disable_smilies']) ) ? 0 : TRUE; + } + + $article_desc = ( !empty($HTTP_POST_VARS['desc']) ) ? $HTTP_POST_VARS['desc'] : ''; + $article_title = ( !empty($HTTP_POST_VARS['title']) ) ? trim($HTTP_POST_VARS['title']) : ''; + $message = ( !empty($HTTP_POST_VARS['message']) ) ? $HTTP_POST_VARS['message'] : ''; + $article_author = $userdata['user_id']; + $article_authorname = ( empty($HTTP_POST_VARS['authorname']) ) ? $userdata['username'] : $HTTP_POST_VARS['authorname']; + $bbcode_uid = ''; + $cat_id = $HTTP_POST_VARS['cats']; + $attach_sig = ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0; + + prepare_article($bbcode_on, $html_on, $smilies_on, $error_msg, $bbcode_uid, $article_title, $article_desc, $message, $cat_id); + + if ( $error_msg == '' ) + { + $current_time = time(); + + $sql = "INSERT INTO" . KB_ARTICLES_TABLE . " (article_id, cat_id, article_title, article_desc, article_author, article_authorname, article_time, article_edittime, article_hits, article_editby, article_status, enable_sig, enable_html, enable_bbode, enable_smilies, article_text) VALUES + ('', '$cat_id', '$article_title', '$article_desc', '$article_author', '$article_authorname', '$current_time', '$current_time', '0', '" . $userdata['user_id'] . "', '0', '$enable_sig', '$enable_html', '$enable_bbcode', '$enable_smilies', '$message');"; + if (!$db->sql_query($sql)) + { + message_die(GENERAL_ERROR, 'Error in adding article', '', __LINE__, __FILE__, $sql); + } + + $article_id = $db->sql_nextid(); + + $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("kb.$phpEx?pid=view_article&id=" . $article_id) . '>"'; + $message = $lang['kb_added'] . '<br /><br />' . sprintf($lang['kb_click_view_article'], '<a href="' . append_sid("kb.$phpEx?pid=view_article&id=" . $article_id) . '">', '</a>') . '<br /><br />' . sprintf($lang['kb_click_return_ucp'], '<a href="' . append_sid("kb.$phpEx?pid=ucp") . '">', '</a>'); + } + } + + $preview = ( !empty($HTTP_POST_VARS['preview']) ) ? true : false; + if($mode == "post" && !$preview) + { $article_title = ''; $article_text = ''; $article_desc = ''; $authorname = $userdata['username']; + $form_action = append_sid("kb.php?pid=ucp&action=post_article"); + $hidden_form_fields = ""; + $attach_sig = ( $userdata['user_id'] == ANONYMOUS ) ? 0 : $userdata['user_attachsig']; + + if ( !$board_config['allow_html'] ) + { + $html_on = 0; + } + else + { + $html_on = ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] ); + } + + if ( !$board_config['allow_bbcode'] ) + { + $bbcode_on = 0; + } + else + { + $bbcode_on = ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_bbcode'] : $userdata['user_allowbbcode'] ); + } + + if ( !$board_config['allow_smilies'] ) + { + $smilies_on = 0; + } + else + { + $smilies_on = ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_smilies'] : $userdata['user_allowsmile'] ); + } + + if($preview) + { + // Do funny preview stuff + } } + elseif($preview) + { + $article_title = $HTTP_POST_VARS['title']; + $article_text = $HTTP_POST_VARS['message']; + $article_desc = $HTTP_POST_VARS['desc']; + $authorname = $HTTP_POST_VARS['authorname']; + + $attach_sig = ( $HTTP_POST_VARS['enable_sig'] ) ? TRUE : 0; + + $html_on = ( $HTTP_POST_VARS['disable_html'] ) ? false : true; + $bbcode_on = ( $HTTP_POST_VARS['disable_bbcode'] ) ? false : true; + $smilies_on = ( $HTTP_POST_VARS['disable_smilies'] ) ? false : true; + + $form_action = append_sid("kb.php?pid=ucp&action=post_article"); + $hidden_form_fields = ""; + } else { $sql = "SELECT * @@ -90,12 +249,14 @@ $article_desc = $article['article_desc']; $authorname = $article['article_authorname']; - $attach_sig = ( $article['enable_sig'] && $post_info['user_sig'] != '' ) ? TRUE : 0; - $user_sig = $userdata['user_sig']; + $attach_sig = ( $article['enable_sig'] ) ? TRUE : 0; $html_on = ( $article['enable_html'] ) ? true : false; $bbcode_on = ( $article['enable_bbcode'] ) ? true : false; $smilies_on = ( $article['enable_smilies'] ) ? true : false; + + $form_action = append_sid("kb.php?pid=ucp&action=edit_article"); + $hidden_form_fields = ""; } $article_text = str_replace('<', '<', $article_text); @@ -136,6 +297,41 @@ $bbcode_status = $lang['BBCode_is_OFF']; } + // Obtain categories structure + $cats = get_cats_structure(); + + // First lets sort main cats + $s_cats = '<option value="0">-' . $lang['kb_main'] . '</option>'; + if($preview || $mode == "edit") + { + for($i = 0; $i < count($cats); $i++) + { + $s_cats .= '<option value="' . $cats[$i]['cat_id'] . '">--' . $cats[$i]['cat_title'] . '</option>'; + + // Sort subcats + for($j = 0; $j < count($cats[$i]['subcats']); $j++) + { + $s_cats .= '<option value="' . $cats[$i]['subcats'][$j]['cat_id'] . '">--' . $cats[$i]['subcats'][$j]['cat_title'] . '</option>'; + } + } + } + else + { + $var = ( $preview ) ? $HTTP_POST_VARS['cats'] : $article['cat_id']; + for($i = 0; $i < count($cats); $i++) + { + $selected = ( strstr($var, "," . $cats[$i]['cat_id'] . ",") ) ? ' selected' : ''; + $s_cats .= '<option' . $selected . ' value="' . $cats[$i]['cat_id'] . '">--' . $cats[$i]['cat_title'] . '</option>'; + + // Sort subcats + for($j = 0; $j < count($cats[$i]['subcats']); $j++) + { + $selected = ( strstr($var, "," . $cats[$i]['subcats'][$j]['cat_id'] . ",") ) ? ' selected' : ''; + $s_cats .= '<option' . $selected . ' value="' . $cats[$i]['subcats'][$j]['cat_id'] . '">--' . $cats[$i]['subcats'][$j]['cat_title'] . '</option>'; + } + } + } + // // Smilies toggle selection // @@ -149,6 +345,10 @@ $smilies_status = $lang['Smilies_are_OFF']; } + $template->set_filenames(array( + 'body' => 'kb_article_posting.tpl') + ); + // This is the template stuff we need no matter what $template->assign_vars(array( 'AUTHORNAME' => $authorname, @@ -158,14 +358,19 @@ 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'), 'SMILIES_STATUS' => $smilies_status, - 'L_SUBJECT' => $lang['Subject'], - 'L_MESSAGE_BODY' => $lang['Message_body'], + 'L_POST_ARTICLE' => $lang['kb_post_article'], + 'L_AUTHORNAME' => $lang['kb_authorname'], + 'L_ARTICLE_NAME' => $lang['kb_articlename'], + 'L_ARTICLE_DESC' => $lang['kb_articledesc'], + 'L_ARTICLE_CATS' => $lang['kb_articlecats'], + 'L_ARTICLE_BODY' => $lang['kb_articletext'], + 'L_AUTHORNAME_DESC' => $lang['kb_authorname_desc'], + 'L_ARTICLEDESC_DESC' => $lang['kb_articledesc_desc'], // Funny one eh? + 'L_ARTICLECATS_DESC' => $lang['kb_articlecats_desc'], + 'L_OPTIONS' => $lang['Options'], 'L_PREVIEW' => $lang['Preview'], - 'L_SPELLCHECK' => $lang['Spellcheck'], 'L_SUBMIT' => $lang['Submit'], - 'L_CANCEL' => $lang['Cancel'], - 'L_CONFIRM_DELETE' => $lang['Confirm_delete'], 'L_DISABLE_HTML' => $lang['Disable_HTML_post'], 'L_DISABLE_BBCODE' => $lang['Disable_BBCode_post'], 'L_DISABLE_SMILIES' => $lang['Disable_Smilies_post'], @@ -212,17 +417,12 @@ 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], 'L_STYLES_TIP' => $lang['Styles_tip'], - 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postorder=desc") : '', - 'U_REVIEW_TOPIC' => ( $mode == 'reply' ) ? append_sid("kb.$phpEx?preview=topicreview&" . POST_TOPIC_URL . "=$topic_id") : '', - 'S_HTML_CHECKED' => ( !$html_on ) ? 'checked="checked"' : '', 'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? 'checked="checked"' : '', 'S_SMILIES_CHECKED' => ( !$smilies_on ) ? 'checked="checked"' : '', 'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '', - 'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '', - 'S_TYPE_TOGGLE' => $topic_type_toggle, - 'S_TOPIC_ID' => $topic_id, - 'S_POST_ACTION' => append_sid("posting.$phpEx"), + 'S_POST_ACTION' => $form_action, + 'CATS_HTML' => $s_cats, 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields) ); } Modified: root/kb.php =================================================================== --- root/kb.php 2006-11-23 15:32:31 UTC (rev 20) +++ root/kb.php 2006-11-24 00:27:20 UTC (rev 21) @@ -338,8 +338,15 @@ case "ucp": $action = ( isset($HTTP_GET_VARS['action']) ) ? $HTTP_GET_VARS['action'] : ""; - $ucp = new ucp($action); + include($phpbb_root_path . "kb/ucp_class.$phpEx"); + $ucp = new ucp; + // Start Page output + $page_title = $ucp->generate_page_title($action); + include($phpbb_root_path . 'includes/page_header.'.$phpEx); + + $ucp->generate_page($action, $HTTP_GET_VARS['id'], $HTTP_GET_VARS['preview']); + // // Generate the page // Modified: root/kb_install.php =================================================================== --- root/kb_install.php 2006-11-23 15:32:31 UTC (rev 20) +++ root/kb_install.php 2006-11-24 00:27:20 UTC (rev 21) @@ -67,10 +67,15 @@ article_desc varchar(255) NOT NULL, article_author mediumint(8) UNSIGNED NOT NULL, article_authorname varchar(50) NOT NULL, + article_time int(20) UNSIGNED DEFAULT '0', article_edittime int(20) UNSIGNED DEFAULT '0', article_hits mediumint(8) UNSIGNED DEFAULT '0', article_editby mediumint(8) UNSIGNED DEFAULT '0', article_status smallint(1) UNSIGNED DEFAULT '0', + enable_sig smallint(1) UNSIGNED DEFAULT '0', + enable_html smallint(1) UNSIGNED DEFAULT '0', + enable_bbcode smallint(1) UNSIGNED DEFAULT '0', + enable_smilies smallint(1) UNSIGNED DEFAULT '0', article_text text, PRIMARY KEY (article_id), KEY cat_id (cat_id) Modified: root/language/lang_english/lang_kb.php =================================================================== --- root/language/lang_english/lang_kb.php 2006-11-23 15:32:31 UTC (rev 20) +++ root/language/lang_english/lang_kb.php 2006-11-24 00:27:20 UTC (rev 21) @@ -21,7 +21,11 @@ // Page titles $lang['kb_main'] = "KnowledgeBase Home"; $lang['kb_viewcat'] = "Viewing Category"; +$lang['kb_ucp'] = "KB User Control Panel"; +$lang['kb_ucp_articlepost'] = "Post new article"; +$lang['kb_ucp_articleedit'] = "Edit article"; +// Normal Page $lang['kb_categories'] = "KnowledgeBase Categories"; $lang['kb_articles'] = "Articles"; $lang['kb_subcats'] = "Subcategories"; @@ -31,4 +35,15 @@ $lang['kb_viewcat_subcats'] = "Subcategories in %s"; $lang['kb_last_action'] = "Last action"; $lang['kb_last_action_row'] = "Last action for this article was comitted by %s on the %s"; + +// Posting Page +$lang['kb_post_article'] = "Post New Article"; +$lang['kb_authorname'] = "Author Name"; +$lang['kb_authorname_desc'] = "This is the name that will be displayed, just leave your username there if you want, but you might wanted to change it."; +$lang['kb_articlename'] = "Article Name"; +$lang['kb_articledesc'] = "Article Description"; +$lang['kb_articlecats'] = "Article Categories"; +$lang['kb_articletext'] = "Article Content"; +$lang['kb_articledesc_desc'] = "Description of your article, max. 255 characters."; +$lang['kb_articlecats_desc'] = "Choose what categories your article will appear in, use ctrl + click for multiple."; ?> \ No newline at end of file Modified: root/templates/subSilver/kb_article_posting.tpl =================================================================== --- root/templates/subSilver/kb_article_posting.tpl 2006-11-23 15:32:31 UTC (rev 20) +++ root/templates/subSilver/kb_article_posting.tpl 2006-11-24 00:27:20 UTC (rev 21) @@ -247,26 +247,27 @@ <th class="thHead" colspan="2" height="25"><b>{L_POST_ARTICLE}</b></th> </tr> <tr> - <td class="row1"><span class="gen"><b>{L_AUTHORNAME}</b></span></td> - <td class="row2"><span class="genmed"><input type="text" class="post" tabindex="1" name="username" size="25" maxlength="25" value="{AUTHORNAME}" /> + <td class="row1"><span class="gen"><b>{L_AUTHORNAME}</b></span><br /><span class="gensmall">{L_AUTHORNAME_DESC}</span></td> + <td class="row2"><span class="genmed"><input name="authorname" type="text" class="post" id="authorname" tabindex="1" value="{AUTHORNAME}" size="25" maxlength="25" /> </span></td> </tr> <tr> <td class="row1" width="22%"><span class="gen"><b>{L_ARTICLE_NAME}</b></span></td> <td class="row2" width="78%"> <span class="gen"> - <input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{ARTICLE_TITLE}" /> + <input name="title" type="text" class="post" id="title" style="width:450px" tabindex="2" value="{ARTICLE_TITLE}" size="45" maxlength="60" /> </span> </td> </tr> <tr> - <td class="row1" width="22%"><span class="gen"><b>{L_ARTICLE_DESC}</b></span></td> + <td class="row1" width="22%"><span class="gen"><b>{L_ARTICLE_DESC}</b></span><br /><span class="gensmall">{L_ARTICLEDESC_DESC}</span></td> <td class="row2" width="78%"> <span class="gen"> <textarea name="desc" cols="35" rows="5" wrap="virtual" class="post" id="desc" style="width:450px" tabindex="2">{DESC}</textarea> </span> </td> </tr> <tr> - <td class="row1" width="22%"><span class="gen"><b>{L_ARTICLE_CATS}</b></span></td> - <td class="row2" width="78%"><select name="cats" size="4" multiple="multiple" id="cats">{CATS_HTML} - </select> + <td class="row1" width="22%"><span class="gen"><b>{L_ARTICLE_CATS}</b></span><br /><span class="gensmall">{L_ARTICLECATS_DESC}</span></td> + <td class="row2" width="78%"><select name="cats" size="4" multiple="multiple" id="cats"> + {CATS_HTML} + </select> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <so...@us...> - 2006-11-23 15:32:41
|
Revision: 20 http://svn.sourceforge.net/phpbbkb/?rev=20&view=rev Author: softphp Date: 2006-11-23 07:32:31 -0800 (Thu, 23 Nov 2006) Log Message: ----------- - Adding all sorts of stuff, generally navigation bar & the new ucp class... for adding an editing articles. Modified Paths: -------------- root/kb/functions.php root/kb.php root/language/lang_english/lang_kb.php root/templates/subSilver/kb_main.tpl root/templates/subSilver/kb_viewcat.tpl Added Paths: ----------- root/kb/ucp_class.php root/templates/subSilver/kb_article_posting.tpl Modified: root/kb/functions.php =================================================================== --- root/kb/functions.php 2006-11-21 19:57:07 UTC (rev 19) +++ root/kb/functions.php 2006-11-23 15:32:31 UTC (rev 20) @@ -3,9 +3,9 @@ * functions.php * ------------------- * - * copyright: phpBB KB Group - * site: http://www.phpbbknowledgebase.com - * SF Project Page: http://www.sourceforge.net/projects/phpbbkb + * copyright: phpBB KB Group + * site: http://www.phpbbknowledgebase.com + * SF Project Page: http://www.sourceforge.net/projects/phpbbkb * ***************************************************************************/ @@ -18,6 +18,55 @@ * ***************************************************************************/ -// Nothing yet! - +// This function creates the navigation line based on a few parameters +function create_navigation($type = "main", $id_ary = array()) +{ + global $db, $template, $lang, $board_config, $phpEx; + + switch($type) + { + case "ucp": + // Different kind of subcategories + break; + + case "viewcat": + // View category + // id = $cat_id::$cat_name + $navigation = '<span class="nav"> <a href="' . append_sid("kb.$phpEx") . '" class="nav">' . $lang['kb_main'] . '</a> -> <a class="nav" href="' . append_sid("kb.$phpEx?pid=view_cat&id=" . $id_ary[0]) . '">' . $id_ary[1] .'</a></span>'; + break; + + case "viewsubcat": + // View subcategory + // id = $cat_id::$cat_name::$maincat_id + $sql = "SELECT cat_title + FROM " . KB_CATEGORIES_TABLE . " + WHERE cat_id = '" . $id_ary[2] . "'"; + if( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query cat name.', '', __LINE__, __FILE__, $sql); + } + $maincat = $db->sql_fetchrow($result); + $navigation = '<span class="nav"> <a href="' . append_sid("kb.$phpEx") . '" class="nav">' . $lang['kb_main'] . '</a> -> <a class="nav" href="' . append_sid("kb.$phpEx?pid=view_cat&id=" . $id_ary[2]) . '">' . $maincat['cat_title'] .'</a> -> <a class="nav" href="' . append_sid("kb.$phpEx?pid=view_cat&id=" . $id_ary[0]) . '">' . $id_ary[1] .'</a></span>'; + break; + + case "viewarticle": + // Viewing an article + break; + + case "search": + // viewing search results or page + break; + + case "main": + default: + $navigation = '<span class="nav"> <a href="' . append_sid("kb.$phpEx") . '" class="nav">' . $lang['kb_main'] . '</a></span>'; + break; + } + + $template->assign_vars(array( + 'NAVIGATION' => $navigation) + ); + + return; +} ?> \ No newline at end of file Added: root/kb/ucp_class.php =================================================================== --- root/kb/ucp_class.php (rev 0) +++ root/kb/ucp_class.php 2006-11-23 15:32:31 UTC (rev 20) @@ -0,0 +1,230 @@ +<?php +/*************************************************************************** + * ucp_class.php + * ------------------- + * + * copyright: phpBB KB Group + * site: http://www.phpbbknowledgebase.com + * SF Project Page: http://www.sourceforge.net/projects/phpbbkb + * + ***************************************************************************/ + +/*************************************************************************** + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + +// This contains the entire ucp class, so it's seperated from the rest of kb.php +class ucp +{ + var $action = ""; + + function __construct($action, $id=0) + { + global $HTTP_POST_VARS['review']; + + $this->action = $action; + switch($this->action) + { + case "articles": + break; + + case "comments": + break; + + case "post_article": + $this->article_form("post", false, $HTTP_POST_VARS['review']); + break; + + case "edit_article": + $this->article_form("edit", $id, $HTTP_POST_VARS['review']); + break; + + case "delete_article": + $this->article_delete(); + break; + + case "post_comment": // Only input + break; + + case "edit_comment": + break; + + case "delete_comment": + break; + + default: + break; + } + } + + // This is for posting articles, mostly cut out of the posting.php :) + function article_form($mode, $id, $review) + { + global $template, $board_config, $db, $userdata; + + if($mode == "post") + { + $article_title = ''; + $article_text = ''; + $article_desc = ''; + $authorname = $userdata['username']; + } + else + { + $sql = "SELECT * + FROM " . KB_ARTICLES_TABLE . " + WHERE id = '" . $id . "'"; + if(!$result = $db->sql_query($sql)) + { + message_die(GENERAL_ERROR, 'Could not query article data.', '', __LINE__, __FILE__, $sql); + } + $article = $db->sql_fetchrow($result); + + $article_title = $article['article_title']; + $article_text = $article['article_text']; + $article_desc = $article['article_desc']; + $authorname = $article['article_authorname']; + + $attach_sig = ( $article['enable_sig'] && $post_info['user_sig'] != '' ) ? TRUE : 0; + $user_sig = $userdata['user_sig']; + + $html_on = ( $article['enable_html'] ) ? true : false; + $bbcode_on = ( $article['enable_bbcode'] ) ? true : false; + $smilies_on = ( $article['enable_smilies'] ) ? true : false; + } + + $article_text = str_replace('<', '<', $article_text); + $article_text = str_replace('>', '>', $article_text); + $article_text = str_replace('<br />', "\n", $article_text); + + // + // Signature toggle selection + // + if( $user_sig != '' ) + { + $template->assign_block_vars('switch_signature_checkbox', array()); + } + + // + // HTML toggle selection + // + if ( $board_config['allow_html'] ) + { + $html_status = $lang['HTML_is_ON']; + $template->assign_block_vars('switch_html_checkbox', array()); + } + else + { + $html_status = $lang['HTML_is_OFF']; + } + + // + // BBCode toggle selection + // + if ( $board_config['allow_bbcode'] ) + { + $bbcode_status = $lang['BBCode_is_ON']; + $template->assign_block_vars('switch_bbcode_checkbox', array()); + } + else + { + $bbcode_status = $lang['BBCode_is_OFF']; + } + + // + // Smilies toggle selection + // + if ( $board_config['allow_smilies'] ) + { + $smilies_status = $lang['Smilies_are_ON']; + $template->assign_block_vars('switch_smilies_checkbox', array()); + } + else + { + $smilies_status = $lang['Smilies_are_OFF']; + } + + // This is the template stuff we need no matter what + $template->assign_vars(array( + 'AUTHORNAME' => $authorname, + 'ARTICLE_TITLE' => $article_title, + 'ARTICLE' => $article_text, + 'HTML_STATUS' => $html_status, + 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'), + 'SMILIES_STATUS' => $smilies_status, + + 'L_SUBJECT' => $lang['Subject'], + 'L_MESSAGE_BODY' => $lang['Message_body'], + 'L_OPTIONS' => $lang['Options'], + 'L_PREVIEW' => $lang['Preview'], + 'L_SPELLCHECK' => $lang['Spellcheck'], + 'L_SUBMIT' => $lang['Submit'], + 'L_CANCEL' => $lang['Cancel'], + 'L_CONFIRM_DELETE' => $lang['Confirm_delete'], + 'L_DISABLE_HTML' => $lang['Disable_HTML_post'], + 'L_DISABLE_BBCODE' => $lang['Disable_BBCode_post'], + 'L_DISABLE_SMILIES' => $lang['Disable_Smilies_post'], + 'L_ATTACH_SIGNATURE' => $lang['Attach_signature'], + + 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], + 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], + 'L_BBCODE_U_HELP' => $lang['bbcode_u_help'], + 'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'], + 'L_BBCODE_C_HELP' => $lang['bbcode_c_help'], + 'L_BBCODE_L_HELP' => $lang['bbcode_l_help'], + 'L_BBCODE_O_HELP' => $lang['bbcode_o_help'], + 'L_BBCODE_P_HELP' => $lang['bbcode_p_help'], + 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'], + 'L_BBCODE_A_HELP' => $lang['bbcode_a_help'], + 'L_BBCODE_S_HELP' => $lang['bbcode_s_help'], + 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], + 'L_EMPTY_MESSAGE' => $lang['Empty_message'], + + 'L_FONT_COLOR' => $lang['Font_color'], + 'L_COLOR_DEFAULT' => $lang['color_default'], + 'L_COLOR_DARK_RED' => $lang['color_dark_red'], + 'L_COLOR_RED' => $lang['color_red'], + 'L_COLOR_ORANGE' => $lang['color_orange'], + 'L_COLOR_BROWN' => $lang['color_brown'], + 'L_COLOR_YELLOW' => $lang['color_yellow'], + 'L_COLOR_GREEN' => $lang['color_green'], + 'L_COLOR_OLIVE' => $lang['color_olive'], + 'L_COLOR_CYAN' => $lang['color_cyan'], + 'L_COLOR_BLUE' => $lang['color_blue'], + 'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'], + 'L_COLOR_INDIGO' => $lang['color_indigo'], + 'L_COLOR_VIOLET' => $lang['color_violet'], + 'L_COLOR_WHITE' => $lang['color_white'], + 'L_COLOR_BLACK' => $lang['color_black'], + + 'L_FONT_SIZE' => $lang['Font_size'], + 'L_FONT_TINY' => $lang['font_tiny'], + 'L_FONT_SMALL' => $lang['font_small'], + 'L_FONT_NORMAL' => $lang['font_normal'], + 'L_FONT_LARGE' => $lang['font_large'], + 'L_FONT_HUGE' => $lang['font_huge'], + + 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], + 'L_STYLES_TIP' => $lang['Styles_tip'], + + 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postorder=desc") : '', + 'U_REVIEW_TOPIC' => ( $mode == 'reply' ) ? append_sid("kb.$phpEx?preview=topicreview&" . POST_TOPIC_URL . "=$topic_id") : '', + + 'S_HTML_CHECKED' => ( !$html_on ) ? 'checked="checked"' : '', + 'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? 'checked="checked"' : '', + 'S_SMILIES_CHECKED' => ( !$smilies_on ) ? 'checked="checked"' : '', + 'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '', + 'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '', + 'S_TYPE_TOGGLE' => $topic_type_toggle, + 'S_TOPIC_ID' => $topic_id, + 'S_POST_ACTION' => append_sid("posting.$phpEx"), + 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields) + ); + } +} +?> \ No newline at end of file Modified: root/kb.php =================================================================== --- root/kb.php 2006-11-21 19:57:07 UTC (rev 19) +++ root/kb.php 2006-11-23 15:32:31 UTC (rev 20) @@ -72,6 +72,7 @@ // Start Page output $page_title = $lang['kb_main']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); + create_navigation(); $template->set_filenames(array( 'body' => 'kb_main.tpl') @@ -227,7 +228,23 @@ // Start Page output $page_title = $lang['kb_viewcat'] . ": " . $cat['cat_title']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); - + + if($cat['cat_main'] == "0") + { + create_navigation("viewcat", array( + 0 => $cat['cat_id'], + 1 => $cat['cat_title']) + ); + } + else + { + create_navigation("viewsubcat", array( + 0 => $cat_id, + 1 => $cat['cat_title'], + 2 => $cat['cat_main']) + ); + } + $template->set_filenames(array( 'body' => 'kb_viewcat.tpl') ); @@ -261,6 +278,8 @@ if( $total_articles = count($articles) ) { + $template->assign_block_vars('switch_articles', array()); + // Contains articles for($i = 0; $i < $total_articles; $i++) { @@ -294,14 +313,14 @@ $user = $db->sql_fetchrow($result); $last_action = sprintf($lang['kb_last_action_row'], "<a href=\"profile.php?mode=viewprofile&u=" . $articles[$i]['article_editby'] . "\">" . $user['username'] . "</a>", create_date($board_config['default_dateformat'], $articles[$i]['article_edittime'], $board_config['board_timezone'])); - $template->assign_block_vars('articlerow', array( + $template->assign_block_vars('switch_articles.articlerow', array( 'TOPIC_FOLDER_IMG' => $images['folder'], 'ARTICLE_TITLE' => $articles[$i]['article_title'], 'ARTICLE_DESC' => $articles[$i]['article_desc'], 'ARTICLE_AUTHOR' => $author, 'ARTICLE_HITS' => $articles[$i]['article_hits'], 'ARTICLE_LAST_ACTION' => $last_action, - 'U_VIEW_ARTICLE' => append_sid("kb.$phpEx?pid=viewarticle&id=" . $articles[$i]['article_id'])) + 'U_VIEW_ARTICLE' => append_sid("kb.$phpEx?pid=viewarticle&cid=" . $cat_id . "&id=" . $articles[$i]['article_id'])) ); } } @@ -318,6 +337,15 @@ break; case "ucp": + $action = ( isset($HTTP_GET_VARS['action']) ) ? $HTTP_GET_VARS['action'] : ""; + $ucp = new ucp($action); + + // + // Generate the page + // + $template->pparse('body'); + + include($phpbb_root_path . 'includes/page_tail.'.$phpEx); break; case "search": Modified: root/language/lang_english/lang_kb.php =================================================================== --- root/language/lang_english/lang_kb.php 2006-11-21 19:57:07 UTC (rev 19) +++ root/language/lang_english/lang_kb.php 2006-11-23 15:32:31 UTC (rev 20) @@ -20,6 +20,7 @@ // Page titles $lang['kb_main'] = "KnowledgeBase Home"; +$lang['kb_viewcat'] = "Viewing Category"; $lang['kb_categories'] = "KnowledgeBase Categories"; $lang['kb_articles'] = "Articles"; Added: root/templates/subSilver/kb_article_posting.tpl =================================================================== --- root/templates/subSilver/kb_article_posting.tpl (rev 0) +++ root/templates/subSilver/kb_article_posting.tpl 2006-11-23 15:32:31 UTC (rev 20) @@ -0,0 +1,430 @@ +<script language="JavaScript" type="text/javascript"> +<!-- +// bbCode control by +// subBlue design +// www.subBlue.com + +// Startup variables +var imageTag = false; +var theSelection = false; + +// Check for Browser & Platform for PC & IE specific bits +// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html +var clientPC = navigator.userAgent.toLowerCase(); // Get client info +var clientVer = parseInt(navigator.appVersion); // Get browser version + +var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); +var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) + && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) + && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); +var is_moz = 0; + +var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1)); +var is_mac = (clientPC.indexOf("mac")!=-1); + +// Helpline messages +b_help = "{L_BBCODE_B_HELP}"; +i_help = "{L_BBCODE_I_HELP}"; +u_help = "{L_BBCODE_U_HELP}"; +q_help = "{L_BBCODE_Q_HELP}"; +c_help = "{L_BBCODE_C_HELP}"; +l_help = "{L_BBCODE_L_HELP}"; +o_help = "{L_BBCODE_O_HELP}"; +p_help = "{L_BBCODE_P_HELP}"; +w_help = "{L_BBCODE_W_HELP}"; +a_help = "{L_BBCODE_A_HELP}"; +s_help = "{L_BBCODE_S_HELP}"; +f_help = "{L_BBCODE_F_HELP}"; + +// Define the bbCode tags +bbcode = new Array(); +bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]'); +imageTag = false; + +// Shows the help messages in the helpline window +function helpline(help) { + document.post.helpbox.value = eval(help + "_help"); +} + + +// Replacement for arrayname.length property +function getarraysize(thearray) { + for (i = 0; i < thearray.length; i++) { + if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) + return i; + } + return thearray.length; +} + +// Replacement for arrayname.push(value) not implemented in IE until version 5.5 +// Appends element to the array +function arraypush(thearray,value) { + thearray[ getarraysize(thearray) ] = value; +} + +// Replacement for arrayname.pop() not implemented in IE until version 5.5 +// Removes and returns the last element of an array +function arraypop(thearray) { + thearraysize = getarraysize(thearray); + retval = thearray[thearraysize - 1]; + delete thearray[thearraysize - 1]; + return retval; +} + + +function checkForm() { + + formErrors = false; + + if (document.post.message.value.length < 2) { + formErrors = "{L_EMPTY_MESSAGE}"; + } + + if (formErrors) { + alert(formErrors); + return false; + } else { + bbstyle(-1); + //formObj.preview.disabled = true; + //formObj.submit.disabled = true; + return true; + } +} + +function emoticon(text) { + var txtarea = document.post.message; + text = ' ' + text + ' '; + if (txtarea.createTextRange && txtarea.caretPos) { + var caretPos = txtarea.caretPos; + caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; + txtarea.focus(); + } else { + txtarea.value += text; + txtarea.focus(); + } +} + +function bbfontstyle(bbopen, bbclose) { + var txtarea = document.post.message; + + if ((clientVer >= 4) && is_ie && is_win) { + theSelection = document.selection.createRange().text; + if (!theSelection) { + txtarea.value += bbopen + bbclose; + txtarea.focus(); + return; + } + document.selection.createRange().text = bbopen + theSelection + bbclose; + txtarea.focus(); + return; + } + else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) + { + mozWrap(txtarea, bbopen, bbclose); + return; + } + else + { + txtarea.value += bbopen + bbclose; + txtarea.focus(); + } + storeCaret(txtarea); +} + + +function bbstyle(bbnumber) { + var txtarea = document.post.message; + + txtarea.focus(); + donotinsert = false; + theSelection = false; + bblast = 0; + + if (bbnumber == -1) { // Close all open tags & default button names + while (bbcode[0]) { + butnumber = arraypop(bbcode) - 1; + txtarea.value += bbtags[butnumber + 1]; + buttext = eval('document.post.addbbcode' + butnumber + '.value'); + eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); + } + imageTag = false; // All tags are closed including image tags :D + txtarea.focus(); + return; + } + + if ((clientVer >= 4) && is_ie && is_win) + { + theSelection = document.selection.createRange().text; // Get text selection + if (theSelection) { + // Add tags around selection + document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1]; + txtarea.focus(); + theSelection = ''; + return; + } + } + else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) + { + mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]); + return; + } + + // Find last occurance of an open tag the same as the one just clicked + for (i = 0; i < bbcode.length; i++) { + if (bbcode[i] == bbnumber+1) { + bblast = i; + donotinsert = true; + } + } + + if (donotinsert) { // Close all open tags up to the one just clicked & default button names + while (bbcode[bblast]) { + butnumber = arraypop(bbcode) - 1; + txtarea.value += bbtags[butnumber + 1]; + buttext = eval('document.post.addbbcode' + butnumber + '.value'); + eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); + imageTag = false; + } + txtarea.focus(); + return; + } else { // Open tags + + if (imageTag && (bbnumber != 14)) { // Close image tag before adding another + txtarea.value += bbtags[15]; + lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list + document.post.addbbcode14.value = "Img"; // Return button back to normal state + imageTag = false; + } + + // Open tag + txtarea.value += bbtags[bbnumber]; + if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag + arraypush(bbcode,bbnumber+1); + eval('document.post.addbbcode'+bbnumber+'.value += "*"'); + txtarea.focus(); + return; + } + storeCaret(txtarea); +} + +// From http://www.massless.org/mozedit/ +function mozWrap(txtarea, open, close) +{ + var selLength = txtarea.textLength; + var selStart = txtarea.selectionStart; + var selEnd = txtarea.selectionEnd; + if (selEnd == 1 || selEnd == 2) + selEnd = selLength; + + var s1 = (txtarea.value).substring(0,selStart); + var s2 = (txtarea.value).substring(selStart, selEnd) + var s3 = (txtarea.value).substring(selEnd, selLength); + txtarea.value = s1 + open + s2 + close + s3; + return; +} + +// Insert at Claret position. Code from +// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 +function storeCaret(textEl) { + if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); +} + +//--> +</script> +<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)"> + +{ARTICLE_PREVIEW_BOX} +{ERROR_BOX} + + <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> + <tr> + <td align="left">{NAVIGATION}</td> + </tr> +</table> + +<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline"> + <tr> + <th class="thHead" colspan="2" height="25"><b>{L_POST_ARTICLE}</b></th> + </tr> + <tr> + <td class="row1"><span class="gen"><b>{L_AUTHORNAME}</b></span></td> + <td class="row2"><span class="genmed"><input type="text" class="post" tabindex="1" name="username" size="25" maxlength="25" value="{AUTHORNAME}" /> + </span></td> + </tr> + <tr> + <td class="row1" width="22%"><span class="gen"><b>{L_ARTICLE_NAME}</b></span></td> + <td class="row2" width="78%"> <span class="gen"> + <input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{ARTICLE_TITLE}" /> + </span> </td> + </tr> + <tr> + <td class="row1" width="22%"><span class="gen"><b>{L_ARTICLE_DESC}</b></span></td> + <td class="row2" width="78%"> <span class="gen"> + <textarea name="desc" cols="35" rows="5" wrap="virtual" class="post" id="desc" style="width:450px" tabindex="2">{DESC}</textarea> + </span> </td> + </tr> + <tr> + <td class="row1" width="22%"><span class="gen"><b>{L_ARTICLE_CATS}</b></span></td> + <td class="row2" width="78%"><select name="cats" size="4" multiple="multiple" id="cats">{CATS_HTML} + </select> + </td> + </tr> + <tr> + <td class="row1" valign="top"> + <table width="100%" border="0" cellspacing="0" cellpadding="1"> + <tr> + <td><span class="gen"><b>{L_ARTICLE_BODY}</b></span> </td> + </tr> + <tr> + <td valign="middle" align="center"> <br /> + <table width="100" border="0" cellspacing="0" cellpadding="5"> + <tr align="center"> + <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td> + </tr> + <!-- BEGIN smilies_row --> + <tr align="center" valign="middle"> + <!-- BEGIN smilies_col --> + <td><a href="javascript:emoticon('{smilies_row.smilies_col.SMILEY_CODE}')"><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td> + <!-- END smilies_col --> + </tr> + <!-- END smilies_row --> + <!-- BEGIN switch_smilies_extra --> + <tr align="center"> + <td colspan="{S_SMILIES_COLSPAN}"><span class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td> + </tr> + <!-- END switch_smilies_extra --> + </table> + </td> + </tr> + </table> + </td> + <td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span> + <table width="450" border="0" cellspacing="0" cellpadding="2"> + <tr align="center" valign="middle"> + <td><span class="genmed"> + <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" /> + </span></td> + <td><span class="genmed"> + <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" /> + </span></td> + <td><span class="genmed"> + <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" /> + </span></td> + <td><span class="genmed"> + <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" /> + </span></td> + <td><span class="genmed"> + <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" /> + </span></td> + <td><span class="genmed"> + <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" /> + </span></td> + <td><span class="genmed"> + <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" /> + </span></td> + <td><span class="genmed"> + <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" /> + </span></td> + <td><span class="genmed"> + <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" /> + </span></td> + </tr> + <tr> + <td colspan="9"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td><span class="genmed"> {L_FONT_COLOR}: + <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')"> + <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option> + <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option> + <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option> + <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option> + <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option> + <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option> + <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option> + <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option> + <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option> + <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option> + <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option> + <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option> + <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option> + <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option> + <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option> + </select> {L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')"> + <option value="7" class="genmed">{L_FONT_TINY}</option> + <option value="9" class="genmed">{L_FONT_SMALL}</option> + <option value="12" selected class="genmed">{L_FONT_NORMAL}</option> + <option value="18" class="genmed">{L_FONT_LARGE}</option> + <option value="24" class="genmed">{L_FONT_HUGE}</option> + </select> + </span></td> + <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td> + </tr> + </table> + </td> + </tr> + <tr> + <td colspan="9"> <span class="gensmall"> + <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" /> + </span></td> + </tr> + <tr> + <td colspan="9"><span class="gen"> + <textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{ARTICLE}</textarea> + </span></td> + </tr> + </table> + </span></td> + </tr> + <tr> + <td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td> + <td class="row2"><span class="gen"> </span> + <table cellspacing="0" cellpadding="1" border="0"> + <!-- BEGIN switch_html_checkbox --> + <tr> + <td> + <input type="checkbox" name="disable_html" {S_HTML_CHECKED} /> + </td> + <td><span class="gen">{L_DISABLE_HTML}</span></td> + </tr> + <!-- END switch_html_checkbox --> + <!-- BEGIN switch_bbcode_checkbox --> + <tr> + <td> + <input type="checkbox" name="disable_bbcode" {S_BBCODE_CHECKED} /> + </td> + <td><span class="gen">{L_DISABLE_BBCODE}</span></td> + </tr> + <!-- END switch_bbcode_checkbox --> + <!-- BEGIN switch_smilies_checkbox --> + <tr> + <td> + <input type="checkbox" name="disable_smilies" {S_SMILIES_CHECKED} /> + </td> + <td><span class="gen">{L_DISABLE_SMILIES}</span></td> + </tr> + <!-- END switch_smilies_checkbox --> + <!-- BEGIN switch_signature_checkbox --> + <tr> + <td> + <input type="checkbox" name="attach_sig" {S_SIGNATURE_CHECKED} /> + </td> + <td><span class="gen">{L_ATTACH_SIGNATURE}</span></td> + </tr> + <!-- END switch_signature_checkbox --> + </table> + </td> + </tr> + {POLLBOX} + <tr> + <td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" /> <input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td> + </tr> + </table> + + <table width="100%" cellspacing="2" border="0" align="center" cellpadding="2"> + <tr> + <td align="left" valign="top">{NAVIGATION}</td> + <td align="right" valign="top"><span class="gensmall">{S_TIMEZONE}</span></td> + </tr> + </table> +</form> \ No newline at end of file Modified: root/templates/subSilver/kb_main.tpl =================================================================== --- root/templates/subSilver/kb_main.tpl 2006-11-21 19:57:07 UTC (rev 19) +++ root/templates/subSilver/kb_main.tpl 2006-11-23 15:32:31 UTC (rev 20) @@ -1,3 +1,10 @@ +<table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> + <tr> + <td align="left">{NAVIGATION}</td> + <td align="right"> </td> + </tr> +</table> + <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> <th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_CATEGORIES} </th> @@ -30,7 +37,7 @@ <table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> <tr> - <td align="left"> </td> + <td align="left">{NAVIGATION}</td> <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> </tr> </table> \ No newline at end of file Modified: root/templates/subSilver/kb_viewcat.tpl =================================================================== --- root/templates/subSilver/kb_viewcat.tpl 2006-11-21 19:57:07 UTC (rev 19) +++ root/templates/subSilver/kb_viewcat.tpl 2006-11-23 15:32:31 UTC (rev 20) @@ -1,3 +1,10 @@ +<table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> + <tr> + <td align="left">{NAVIGATION}</td> + <td align="right"> </td> + </tr> +</table> + <!-- BEGIN switch_subcats --> <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> @@ -18,8 +25,9 @@ </tr> </table> <!-- END switch_subcats --> + +<!-- BEGIN switch_articles --> <br /> -<!-- BEGIN switch_articles --> <table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline"> <tr> <th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap"> {L_ARTICLES} </th> @@ -29,12 +37,12 @@ </tr> <!-- BEGIN articlerow --> <tr> - <td class="row1" align="center" valign="middle" width="20"><img src="{articlerow.TOPIC_FOLDER_IMG}" width="19" height="18" /></td> - <td class="row1" width="100%"><span class="topictitle"><a href="{articlerow.U_VIEW_ARTICLE}" class="topictitle">{articlerow.ARTICLE_TITLE}</a></span><span class="gensmall"><br /> - {articlerow.ARTICLE_DESC}</span></td> - <td class="row3" align="center" valign="middle"><span class="name">{articlerow.ARTICLE_AUTHOR}</span></td> - <td class="row2" align="center" valign="middle"><span class="postdetails">{articlerow.ARTICLE_HITS}</span></td> - <td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{articlerow.ARTICLE_LAST_ACTION}</span></td> + <td class="row1" align="center" valign="middle" width="20"><img src="{switch_articles.articlerow.TOPIC_FOLDER_IMG}" width="19" height="18" /></td> + <td class="row1" width="100%"><span class="topictitle"><a href="{switch_articles.articlerow.U_VIEW_ARTICLE}" class="topictitle">{switch_articles.articlerow.ARTICLE_TITLE}</a></span><span class="gensmall"><br /> + {switch_articles.articlerow.ARTICLE_DESC}</span></td> + <td class="row3" align="center" valign="middle"><span class="name">{switch_articles.articlerow.ARTICLE_AUTHOR}</span></td> + <td class="row2" align="center" valign="middle"><span class="postdetails">{switch_articles.articlerow.ARTICLE_HITS}</span></td> + <td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{switch_articles.articlerow.ARTICLE_LAST_ACTION}</span></td> </tr> <!-- END articlerow --> <tr> @@ -45,7 +53,7 @@ <table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> <tr> - <td align="left"> </td> + <td align="left">{NAVIGATION}</td> <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> </tr> </table> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <so...@us...> - 2006-11-21 19:57:08
|
Revision: 19 http://svn.sourceforge.net/phpbbkb/?rev=19&view=rev Author: softphp Date: 2006-11-21 11:57:07 -0800 (Tue, 21 Nov 2006) Log Message: ----------- - Added possibility for viewing cats, updated the articles table and added a new template file. Modified Paths: -------------- root/kb.php root/kb_install.php root/language/lang_english/lang_kb.php root/templates/subSilver/kb_main.tpl Added Paths: ----------- root/templates/subSilver/kb_viewcat.tpl Modified: root/kb.php =================================================================== --- root/kb.php 2006-11-21 15:00:56 UTC (rev 18) +++ root/kb.php 2006-11-21 19:57:07 UTC (rev 19) @@ -145,6 +145,173 @@ break; case "view_cat": + $cat_id = ( isset( $HTTP_GET_VARS['id'] ) ) ? $HTTP_GET_VARS['id'] : false; + if(!$cat_id) + { + message_die(GENERAL_MESSAGE, "The chosen category doesn't exist."); + } + + // Store the main cat in a variable + $sql = "SELECT * + FROM " . KB_CATEGORIES_TABLE . " + WHERE cat_id = '" . $cat_id . "'"; + if( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query the main category', '', __LINE__, __FILE__, $sql); + } + $cat = $db->sql_fetchrow($result); + + // Let's find subcats + $sql = "SELECT c.cat_id, c.cat_main, c.cat_title, c.cat_desc, c.cat_articles, c.cat_order + FROM " . KB_CATEGORIES_TABLE . " c + WHERE c.cat_main = '$cat_id' + ORDER BY c.cat_order"; + if( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query subcategories list', '', __LINE__, __FILE__, $sql); + } + + $subcats = array(); + while($row = $db->sql_fetchrow($result)) + { + $subcats[] = $row; + } + + // Now articles, the LIKE handles multiple cats + // First handle the sorting + // default is by edit time, other options: -rating, -author, -title + if(isset($HTTP_GET_VARS['sort'])) + { + switch($HTTP_GET_VARS['sort']) + { + case "rating": + // Later + $sort = "ORDER BY article_edittime DESC"; + break; + + case "author": + // Later + $sort = "ORDER BY article_edittime DESC"; + break; + + case "title": + $sort = "ORDER BY article_title"; + break; + + case "time": + default: + $sort = "ORDER BY article_edittime DESC"; + break; + } + } + else + { + $sort = "ORDER BY article_edittime DESC"; + } + + $sql = "SELECT * + FROM " . KB_ARTICLES_TABLE . " + WHERE cat_id LIKE '$cat_id' + $sort"; + if( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query articles list', '', __LINE__, __FILE__, $sql); + } + + $articles = array(); + while($row = $db->sql_fetchrow($result)) + { + $articles[] = $row; + } + + // Start Page output + $page_title = $lang['kb_viewcat'] . ": " . $cat['cat_title']; + include($phpbb_root_path . 'includes/page_header.'.$phpEx); + + $template->set_filenames(array( + 'body' => 'kb_viewcat.tpl') + ); + + // Process the whole thing + $template->assign_vars(array( + 'L_VIEWS' => $lang['Views'], + 'L_AUTHOR' => $lang['Author'], + 'L_ARTICLES' => $lang['kb_articles'], + 'L_SUBCATS' => sprintf($lang['kb_viewcat_subcats'], $cat['cat_title']), + 'L_LAST_ACTION' => $lang['kb_last_action']) + ); + + if( $total_subcats = count($subcats) ) + { + $template->assign_block_vars('switch_subcats', array()); + + // Ok it contains subcats, let's build them. + for($i = 0; $i < $total_subcats; $i++) + { + // Ok display one cat here + $template->assign_block_vars('switch_subcats.catrow', array( + 'CAT_TITLE' => $subcats[$i]['cat_title'], + 'CAT_DESC' => $subcats[$i]['cat_desc'], + 'CAT_ARTICLES' => $subcats[$i]['cat_articles'], + 'U_VIEWCAT' => append_sid("kb.$phpEx?pid=view_cat&id=" . $subcats[$i]['cat_id']), + 'FORUM_FOLDER_IMG' => $images['forum']) // Stolen :D + ); + } + } + + if( $total_articles = count($articles) ) + { + // Contains articles + for($i = 0; $i < $total_articles; $i++) + { + if($articles[$i]['article_authorname'] == "") + { + $sql = "SELECT username + FROM " . USERS_TABLE . " + WHERE user_id = '" . $articles[$i]['article_author']; + if( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query authorname', '', __LINE__, __FILE__, $sql); + } + + $user = $db->sql_fetchrow($result); + $authorname = $user['username']; + } + else + { + $authorname = $articles[$i]['article_authorname']; + } + $author = "<a href=\"profile.php?mode=viewprofile&u=" . $articles[$i]['article_author'] . "\">$authorname</a>"; + + $sql = "SELECT username + FROM " . USERS_TABLE . " + WHERE user_id = '" . $articles[$i]['article_editby']; + if( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query last edited by\'s username.', '', __LINE__, __FILE__, $sql); + } + + $user = $db->sql_fetchrow($result); + $last_action = sprintf($lang['kb_last_action_row'], "<a href=\"profile.php?mode=viewprofile&u=" . $articles[$i]['article_editby'] . "\">" . $user['username'] . "</a>", create_date($board_config['default_dateformat'], $articles[$i]['article_edittime'], $board_config['board_timezone'])); + + $template->assign_block_vars('articlerow', array( + 'TOPIC_FOLDER_IMG' => $images['folder'], + 'ARTICLE_TITLE' => $articles[$i]['article_title'], + 'ARTICLE_DESC' => $articles[$i]['article_desc'], + 'ARTICLE_AUTHOR' => $author, + 'ARTICLE_HITS' => $articles[$i]['article_hits'], + 'ARTICLE_LAST_ACTION' => $last_action, + 'U_VIEW_ARTICLE' => append_sid("kb.$phpEx?pid=viewarticle&id=" . $articles[$i]['article_id'])) + ); + } + } + + // + // Generate the page + // + $template->pparse('body'); + + include($phpbb_root_path . 'includes/page_tail.'.$phpEx); break; case "view_article": @@ -156,6 +323,10 @@ case "search": break; + case "comment": + // For Adding, deleting and editing comments, this includes rating. + break; + default: message_die(GENERAL_MESSAGE, 'Wrong page id defined. No page shown.'); break; Modified: root/kb_install.php =================================================================== --- root/kb_install.php 2006-11-21 15:00:56 UTC (rev 18) +++ root/kb_install.php 2006-11-21 19:57:07 UTC (rev 19) @@ -64,6 +64,13 @@ article_id mediumint(8) UNSIGNED NOT NULL auto_increment, cat_id mediumint(8) UNSIGNED DEFAULT '0', article_title varchar(100) NOT NULL, + article_desc varchar(255) NOT NULL, + article_author mediumint(8) UNSIGNED NOT NULL, + article_authorname varchar(50) NOT NULL, + article_edittime int(20) UNSIGNED DEFAULT '0', + article_hits mediumint(8) UNSIGNED DEFAULT '0', + article_editby mediumint(8) UNSIGNED DEFAULT '0', + article_status smallint(1) UNSIGNED DEFAULT '0', article_text text, PRIMARY KEY (article_id), KEY cat_id (cat_id) Modified: root/language/lang_english/lang_kb.php =================================================================== --- root/language/lang_english/lang_kb.php 2006-11-21 15:00:56 UTC (rev 18) +++ root/language/lang_english/lang_kb.php 2006-11-21 19:57:07 UTC (rev 19) @@ -26,4 +26,8 @@ $lang['kb_subcats'] = "Subcategories"; $lang['kb_remove_installfile'] = "Please ensure that you remove the kb_install.php file located in your phpBB root folder. KnowledgeBase won't work before that has been done!"; $lang['No_kb_cats'] = "No knowledgebase categories has been added."; + +$lang['kb_viewcat_subcats'] = "Subcategories in %s"; +$lang['kb_last_action'] = "Last action"; +$lang['kb_last_action_row'] = "Last action for this article was comitted by %s on the %s"; ?> \ No newline at end of file Modified: root/templates/subSilver/kb_main.tpl =================================================================== --- root/templates/subSilver/kb_main.tpl 2006-11-21 15:00:56 UTC (rev 18) +++ root/templates/subSilver/kb_main.tpl 2006-11-21 19:57:07 UTC (rev 19) @@ -23,6 +23,9 @@ <td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.CAT_ARTICLES}</span></td> </tr> <!-- END catrow --> + <tr> + <td class="catBottom" align="center" valign="middle" colspan="3" height="28"> </td> + </tr> </table> <table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> Added: root/templates/subSilver/kb_viewcat.tpl =================================================================== --- root/templates/subSilver/kb_viewcat.tpl (rev 0) +++ root/templates/subSilver/kb_viewcat.tpl 2006-11-21 19:57:07 UTC (rev 19) @@ -0,0 +1,51 @@ +<!-- BEGIN switch_subcats --> +<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> + <tr> + <th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_SUBCATS} </th> + <th class="thCornerR" nowrap="nowrap"> {L_ARTICLES} </th> + </tr> + <!-- BEGIN catrow --> + <tr> + <td class="row1" align="center" valign="middle" height="50"><img src="{switch_subcats.catrow.FORUM_FOLDER_IMG}" width="46" height="25" /></td> + <td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{switch_subcats.catrow.U_VIEWCAT}" class="forumlink">{switch_subcats.catrow.CAT_TITLE}</a></span><br /> + <span class="gensmall">{switch_subcats.catrow.CAT_DESC}</span><br /> + </td> + <td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{switch_subcats.catrow.CAT_ARTICLES}</span></td> + </tr> + <!-- END catrow --> + <tr> + <td class="catBottom" align="center" valign="middle" colspan="4" height="28"> </td> + </tr> +</table> +<!-- END switch_subcats --> +<br /> +<!-- BEGIN switch_articles --> +<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline"> + <tr> + <th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap"> {L_ARTICLES} </th> + <th width="100" align="center" class="thTop" nowrap="nowrap"> {L_AUTHOR} </th> + <th width="50" align="center" class="thTop" nowrap="nowrap"> {L_VIEWS} </th> + <th align="center" class="thCornerR" nowrap="nowrap"> {L_LAST_ACTION} </th> + </tr> + <!-- BEGIN articlerow --> + <tr> + <td class="row1" align="center" valign="middle" width="20"><img src="{articlerow.TOPIC_FOLDER_IMG}" width="19" height="18" /></td> + <td class="row1" width="100%"><span class="topictitle"><a href="{articlerow.U_VIEW_ARTICLE}" class="topictitle">{articlerow.ARTICLE_TITLE}</a></span><span class="gensmall"><br /> + {articlerow.ARTICLE_DESC}</span></td> + <td class="row3" align="center" valign="middle"><span class="name">{articlerow.ARTICLE_AUTHOR}</span></td> + <td class="row2" align="center" valign="middle"><span class="postdetails">{articlerow.ARTICLE_HITS}</span></td> + <td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{articlerow.ARTICLE_LAST_ACTION}</span></td> + </tr> + <!-- END articlerow --> + <tr> + <td class="catBottom" align="center" valign="middle" colspan="4" height="28"> </td> + </tr> +</table> +<!-- END switch_articles --> + +<table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> + <tr> + <td align="left"> </td> + <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> + </tr> +</table> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <so...@us...> - 2006-11-21 15:00:57
|
Revision: 18 http://svn.sourceforge.net/phpbbkb/?rev=18&view=rev Author: softphp Date: 2006-11-21 07:00:56 -0800 (Tue, 21 Nov 2006) Log Message: ----------- - Added loads of new files. In kb.php the main site works as it is now, look at kb.softphp.dk/kb.php for example. Added Paths: ----------- root/kb/ root/kb/constants.php root/kb/functions.php root/kb.php root/language/ root/language/lang_english/ root/language/lang_english/lang_kb.php root/templates/ root/templates/subSilver/ root/templates/subSilver/kb_main.tpl Added: root/kb/constants.php =================================================================== --- root/kb/constants.php (rev 0) +++ root/kb/constants.php 2006-11-21 15:00:56 UTC (rev 18) @@ -0,0 +1,26 @@ +<?php +/*************************************************************************** + * lang_kb.php + * ------------------- + * + * copyright: phpBB KB Group + * site: http://www.phpbbknowledgebase.com + * SF Project Page: http://www.sourceforge.net/projects/phpbbkb + * + ***************************************************************************/ + +/*************************************************************************** + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + +// All constants here +// DB Tables +define('KB_CATEGORIES_TABLE', $table_prefix . "kb_categories"); +define('KB_ARTICLES_TABLE', $table_prefix . "kb_articles"); + +?> \ No newline at end of file Added: root/kb/functions.php =================================================================== --- root/kb/functions.php (rev 0) +++ root/kb/functions.php 2006-11-21 15:00:56 UTC (rev 18) @@ -0,0 +1,23 @@ +<?php +/*************************************************************************** + * functions.php + * ------------------- + * + * copyright: phpBB KB Group + * site: http://www.phpbbknowledgebase.com + * SF Project Page: http://www.sourceforge.net/projects/phpbbkb + * + ***************************************************************************/ + +/*************************************************************************** + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + +// Nothing yet! + +?> \ No newline at end of file Added: root/kb.php =================================================================== --- root/kb.php (rev 0) +++ root/kb.php 2006-11-21 15:00:56 UTC (rev 18) @@ -0,0 +1,163 @@ +<?php +/*************************************************************************** + * kb.php + * ------------------- + * + * copyright: phpBB KB Group + * site: http://www.phpbbknowledgebase.com + * SF Project Page: http://www.sourceforge.net/projects/phpbbkb + * + ***************************************************************************/ + +/*************************************************************************** + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ +define('IN_PHPBB', true); +$phpbb_root_path = './'; +include($phpbb_root_path . 'extension.inc'); +include($phpbb_root_path . 'common.' . $phpEx); +include($phpbb_root_path . 'kb/constants.' . $phpEx); // Added these two files, yes i could just add the 10-15 lines it will end with in +include($phpbb_root_path . 'kb/functions.' . $phpEx); // the existing files, but this makes it a lot easier to install/uninstall. + +// +// Start session management +// +$userdata = session_pagestart($user_ip, PAGE_INDEX); +init_userprefs($userdata); +// +// End session management +// + +// File takes care of the following action set via $pid ($HTTP_GET_VARS['pid']): +// main - views categories, with subcategories listed +// view_cat - views a category, either lists subcategories or articles contained, or both ofc. +// view_article - views an article +// ucp - My idea of this is that it should be the complete possibility for users here. If they are normal users, they can see their own +// articles and if they get approved or not. They can also view their comments, and wether they are approved or not. This should +// also include mod options for admins. Approving/disapproving comments or articles, editing them, so on... +// search - the kb search engine... +// More will come whenever i figure something out. Now i'll start coding. :D // Imladris +include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx); +$pid = ( isset($HTTP_GET_VARS['pid']) ) ? $HTTP_GET_VARS['pid'] : "main"; + +// Making sure the install file has been removed +if(file_exists($phpbb_root_path . "kb_install." . $phpEx)) +{ + message_die(GENERAL_MESSAGE, $lang['kb_remove_installfile']); +} + +switch($pid) +{ + case "main": + $sql = "SELECT c.cat_id, c.cat_main, c.cat_title, c.cat_desc, c.cat_articles, c.cat_order + FROM " . KB_CATEGORIES_TABLE . " c + WHERE c.cat_main = '0' + ORDER BY c.cat_order"; + if( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); + } + + $catrows = array(); + while ($row = $db->sql_fetchrow($result)) + { + $catrows[] = $row; + } + + // Start Page output + $page_title = $lang['kb_main']; + include($phpbb_root_path . 'includes/page_header.'.$phpEx); + + $template->set_filenames(array( + 'body' => 'kb_main.tpl') + ); + + $template->assign_vars(array( + 'L_CATEGORIES' => $lang['kb_categories'], + 'L_ARTICLES' => $lang['kb_articles']) + ); + + if($total_catrows = count($catrows)) + { + for($i = 0; $i < $total_catrows; $i++) + { + // Ok display one cat here + $template->assign_block_vars('catrow', array( + 'CAT_TITLE' => $catrows[$i]['cat_title'], + 'CAT_DESC' => $catrows[$i]['cat_desc'], + 'CAT_ARTICLES' => $catrows[$i]['cat_articles'], + 'U_VIEWCAT' => append_sid("kb.$phpEx?pid=view_cat&id=" . $catrows[$i]['cat_id']), + 'L_SUBCATS' => $lang['kb_subcats'], + 'FORUM_FOLDER_IMG' => $images['forum']) // Stolen :D + ); + + // Now let's look at subcats + $sql = "SELECT c.cat_id, c.cat_main, c.cat_title, c.cat_order + FROM " . KB_CATEGORIES_TABLE . " c + WHERE c.cat_main = '" . $catrows[$i]['cat_id'] . "' + ORDER BY c.cat_order"; + if( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not query subcategories list', '', __LINE__, __FILE__, $sql); + } + + $subcats = array(); + while ($row = $db->sql_fetchrow($result)) + { + $subcats[] = $row; + } + + if($total_subcats = count($subcats)) + { + // Contains subcats, show them + $template->assign_block_vars('catrow.switch_subcats', array()); + + for($j = 0; $j < $total_subcats; $j++) + { + // Show the subcat + $k = $j + 1; + $subcat_comma = ( isset($subcats[$k]) ) ? ", " : "."; + $template->assign_block_vars('catrow.subcatrow', array( + 'U_SUBCAT' => append_sid("kb.$phpEx?pid=view_cat&id=" . $subcats[$j]['cat_id']), + 'SUBCAT_TITLE' => $subcats[$j]['cat_title'], + 'SUBCAT_COMMA' => $subcat_comma) + ); + } + } + } + } + else + { + message_die(GENERAL_MESSAGE, $lang['No_kb_cats']); + } + + // + // Generate the page + // + $template->pparse('body'); + + include($phpbb_root_path . 'includes/page_tail.'.$phpEx); + break; + + case "view_cat": + break; + + case "view_article": + break; + + case "ucp": + break; + + case "search": + break; + + default: + message_die(GENERAL_MESSAGE, 'Wrong page id defined. No page shown.'); + break; +} +?> \ No newline at end of file Added: root/language/lang_english/lang_kb.php =================================================================== --- root/language/lang_english/lang_kb.php (rev 0) +++ root/language/lang_english/lang_kb.php 2006-11-21 15:00:56 UTC (rev 18) @@ -0,0 +1,29 @@ +<?php +/*************************************************************************** + * lang_kb.php + * ------------------- + * + * copyright: phpBB KB Group + * site: http://www.phpbbknowledgebase.com + * SF Project Page: http://www.sourceforge.net/projects/phpbbkb + * + ***************************************************************************/ + +/*************************************************************************** + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + +// Page titles +$lang['kb_main'] = "KnowledgeBase Home"; + +$lang['kb_categories'] = "KnowledgeBase Categories"; +$lang['kb_articles'] = "Articles"; +$lang['kb_subcats'] = "Subcategories"; +$lang['kb_remove_installfile'] = "Please ensure that you remove the kb_install.php file located in your phpBB root folder. KnowledgeBase won't work before that has been done!"; +$lang['No_kb_cats'] = "No knowledgebase categories has been added."; +?> \ No newline at end of file Added: root/templates/subSilver/kb_main.tpl =================================================================== --- root/templates/subSilver/kb_main.tpl (rev 0) +++ root/templates/subSilver/kb_main.tpl 2006-11-21 15:00:56 UTC (rev 18) @@ -0,0 +1,33 @@ +<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> + <tr> + <th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_CATEGORIES} </th> + <th class="thCornerR" nowrap="nowrap"> {L_ARTICLES} </th> + </tr> + <tr> + <td class="catLeft" colspan="2" height="28"><span class="cattitle"> </span></td> + <td class="rowpic" align="right"> </td> + </tr> + <!-- BEGIN catrow --> + <tr> + <td class="row1" align="center" valign="middle" height="50"><img src="{catrow.FORUM_FOLDER_IMG}" width="46" height="25" /></td> + <td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.U_VIEWCAT}" class="forumlink">{catrow.CAT_TITLE}</a><br /> + </span> <span class="genmed">{catrow.CAT_DESC}<br /> + </span><span class="gensmall"> + <!-- BEGIN switch_subcats --> + {catrow.L_SUBCATS}: + <!-- END switch_subcats --> + <!-- BEGIN subcatrow --> + <a href="{catrow.subcatrow.U_SUBCAT}" title="{catrow.subcatrow.SUBCAT_TITLE}">{catrow.subcatrow.SUBCAT_TITLE}</a>{catrow.subcatrow.SUBCAT_COMMA} + <!-- END subcatrow --> + </span></td> + <td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.CAT_ARTICLES}</span></td> + </tr> + <!-- END catrow --> +</table> + +<table width="100%" cellspacing="0" border="0" align="center" cellpadding="2"> + <tr> + <td align="left"> </td> + <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> + </tr> +</table> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <so...@us...> - 2006-11-21 14:59:33
|
Revision: 17 http://svn.sourceforge.net/phpbbkb/?rev=17&view=rev Author: softphp Date: 2006-11-21 06:59:32 -0800 (Tue, 21 Nov 2006) Log Message: ----------- - Added new fields in the database tables. Modified Paths: -------------- root/kb_install.php Modified: root/kb_install.php =================================================================== --- root/kb_install.php 2006-10-30 11:50:22 UTC (rev 16) +++ root/kb_install.php 2006-11-21 14:59:32 UTC (rev 17) @@ -51,8 +51,10 @@ $sql = array(); $sql[] = "CREATE TABLE " . $table_prefix . "kb_categories ( cat_id mediumint(8) UNSIGNED NOT NULL auto_increment, + cat_main mediumint(8) UNSIGNED DEFAULT '0', cat_title varchar(100) NOT NULL, cat_desc varchar(255) NOT NULL, + cat_articles mediumint(8) UNSIGNED DEFAULT '0', cat_order mediumint(8) UNSIGNED NOT NULL, PRIMARY KEY (cat_id), KEY cat_order (cat_order) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-10-15 18:51:26
|
Revision: 12 http://svn.sourceforge.net/phpbbkb/?rev=12&view=rev Author: markthedaemon Date: 2006-10-15 11:51:20 -0700 (Sun, 15 Oct 2006) Log Message: ----------- Few changes regarding the install file Modified Paths: -------------- root/install/kb_install.php Modified: root/install/kb_install.php =================================================================== --- root/install/kb_install.php 2006-10-15 18:36:21 UTC (rev 11) +++ root/install/kb_install.php 2006-10-15 18:51:20 UTC (rev 12) @@ -36,7 +36,7 @@ if( !$userdata['session_logged_in'] ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("login.$phpEx?redirect=kb_install.$phpEx", true)); + header($header_location . append_sid($phpbb_root_path . "login.$phpEx?redirect=kb_install.$phpEx", true)); exit; } @@ -83,7 +83,7 @@ echo 'Please be sure to delete this file now.<br />'; echo 'If you have run into any errors, please visit the '. '<a href="http://www.phpbbknowledgebase.com" target="_blank">phpBB Knowledge Base Forums</a> or the <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=415458" target="_blank">phpBB.com topic</a> and ask someone for help.</span></td></tr>'; -echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day, and thanks for using the phpBB Knowledge Base MODification!</a></span></td></table>'; +echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid($phpbb_root_path . "index.$phpEx") . '">Have a nice day, and thanks for using the phpBB Knowledge Base MODification!</a></span></td></table>'; include($phpbb_root_path . 'includes/page_tail.'.$phpEx); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-10-15 18:36:27
|
Revision: 11 http://svn.sourceforge.net/phpbbkb/?rev=11&view=rev Author: markthedaemon Date: 2006-10-15 11:36:21 -0700 (Sun, 15 Oct 2006) Log Message: ----------- Small commit outlining the start of the db schema; please note that this is almost guarenteed to change. Developers: Report what you think of this in the dev forum, and change it if you wish. Modified Paths: -------------- root/install/kb_install.php Modified: root/install/kb_install.php =================================================================== --- root/install/kb_install.php 2006-10-14 03:07:40 UTC (rev 10) +++ root/install/kb_install.php 2006-10-15 18:36:21 UTC (rev 11) @@ -36,7 +36,7 @@ if( !$userdata['session_logged_in'] ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . append_sid("login.$phpEx?redirect=phpbb_sql_generator.$phpEx", true)); + header($header_location . append_sid("login.$phpEx?redirect=kb_install.$phpEx", true)); exit; } @@ -54,7 +54,13 @@ $sql = array(); -$sql[] = "ALTER TABLE " . $table_prefix . "forums ADD cat_kb tinyint(1) unsigned default 0"; +$sql[] = "CREATE TABLE " . $table_prefix . "kb_categories ( + cat_id mediumint(8) UNSIGNED NOT NULL auto_increment, + cat_title varchar(100), + cat_order mediumint(8) UNSIGNED NOT NULL, + PRIMARY KEY (cat_id), + KEY cat_order (cat_order) +)"; for( $i = 0; $i < count($sql); $i++ ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-10-14 03:07:55
|
Revision: 10 http://svn.sourceforge.net/phpbbkb/?rev=10&view=rev Author: markthedaemon Date: 2006-10-13 20:07:40 -0700 (Fri, 13 Oct 2006) Log Message: ----------- Adding the .mod and MODX install guides. @Developers; You need to change the things under your username to reflect what you want it to say (in terms of site, email address, real name etc.). Added Paths: ----------- LICENSE.txt contrib/install.mod install.xml modx.subsilver.en.xsl Added: LICENSE.txt =================================================================== --- LICENSE.txt (rev 0) +++ LICENSE.txt 2006-10-14 03:07:40 UTC (rev 10) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program 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; either version 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Added: contrib/install.mod =================================================================== --- contrib/install.mod (rev 0) +++ contrib/install.mod 2006-10-14 03:07:40 UTC (rev 10) @@ -0,0 +1,35 @@ +############################################################## +## MOD Title: phpbb Knowledge Base +## MOD Author: MarkTheDaemon < mar...@us... > (Mark Barnes) http://www.markthedaemon.com +## MOD Author: AcousticJames < n/a > (n/a) http://www.bootlegdreams.net/ +## MOD Author: drathbun < n/a > (n/a) http://www.phpbbdoctor.com/ +## MOD Author: Peter VDD < n/a > (n/a) n/a +## MOD Author: Prince of phpBB < n/a > (n/a) n/a +## MOD Author: Sphenn < n/a > (n/a) n/a +## MOD Author: ToonArmy < n/a > (n/a) n/a +## MOD Description: This MOD aims to provide a Knowledge Base for phpBB2 +## MOD Version: 0.0.1 +## +## Installation Level: Intermediate +## Installation Time: 2 minutes +## Files To Edit: +## Included Files: +## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 +## Generator: Phpbb.ModTeam.Tools +############################################################## +## For security purposes, please check: http://www.phpbb.com/mods/ +## for the latest version of this MOD. Although MODs are checked +## before being allowed in the MODs Database there is no guarantee +## that there are no security problems within the MOD. No support +## will be given for MODs not found within the MODs Database which +## can be found at http://www.phpbb.com/mods/ +############################################################## +## Author Notes: TODO: Write author(s) notes +############################################################## +## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD +############################################################## + +# +#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ +# +# EoM Added: install.xml =================================================================== --- install.xml (rev 0) +++ install.xml 2006-10-14 03:07:40 UTC (rev 10) @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<?xml-stylesheet type="text/xsl" href="modx.subsilver.en.xsl"?> +<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD. Although MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD. No support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/--> +<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.0.xsd"> + <header> + <license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license> + <title lang="en-gb">phpbb Knowledge Base</title> + <description lang="en-gb">This MOD aims to provide a Knowledge Base for phpBB2</description> + <author-notes lang="en-gb">TODO: Write author(s) notes</author-notes> + <author-group> + <author> + <realname>Mark Barnes</realname> + <email>mar...@us...</email> + <username>MarkTheDaemon</username> + <homepage>http://www.markthedaemon.com</homepage> + <contributions /> + </author> + <author> + <username>AcousticJames</username> + <homepage>http://www.bootlegdreams.net/</homepage> + <contributions /> + </author> + <author> + <username>drathbun</username> + <homepage>http://www.phpbbdoctor.com/</homepage> + <contributions /> + </author> + <author> + <username>Peter VDD</username> + <contributions /> + </author> + <author> + <username>Prince of phpBB</username> + <contributions /> + </author> + <author> + <username>Sphenn</username> + <contributions /> + </author> + <author> + <username>ToonArmy</username> + <contributions /> + </author> + </author-group> + <mod-version> + <major>0</major> + <minor>0</minor> + <revision>1</revision> + </mod-version> + <installation> + <level>intermediate</level> + <time>126</time> + <target-version> + <target-primary>2.0</target-primary> + <target-major allow="exact">2</target-major> + <target-minor allow="exact">0</target-minor> + </target-version> + </installation> + <meta name="generator" content="Phpbb.ModTeam.Tools (c#)" /> + </header> + <action-group /> +</mod> \ No newline at end of file Added: modx.subsilver.en.xsl =================================================================== --- modx.subsilver.en.xsl (rev 0) +++ modx.subsilver.en.xsl 2006-10-14 03:07:40 UTC (rev 10) @@ -0,0 +1,771 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- MODX by the phpBB MOD Team XSL file v1.0 copyright 2005-2006 the phpBB MOD Team. + $Id: modx.subsilver.en.xsl,v 1.3 2006/05/08 22:29:29 wgeric Exp $ --> +<!DOCTYPE xsl:stylesheet[ + <!ENTITY nbsp " "> +]> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:mod="http://www.phpbb.com/mods/xml/modx-1.0.xsd"> + <xsl:output method="html" omit-xml-declaration="no" indent="yes" /> +<xsl:variable name="title" select="mod:mod/mod:header/mod:title" /> +<xsl:variable name="version"> +<xsl:for-each select="mod:mod/mod:header/mod:mod-version"> + <xsl:call-template name="give-version"> + </xsl:call-template> + </xsl:for-each> +</xsl:variable> + <xsl:template match="mod:mod"> + <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Language" content="en-GB" /> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <style> + +/* Style for a "Recommendation" */ + +/* + Copyright 1997-2003 W3C (MIT, ERCIM, Keio). All Rights Reserved. + The following software licensing rules apply: + http://www.w3.org/Consortium/Legal/copyright-software */ + +/* $Id: modx.subsilver.en.xsl,v 1.3 2006/05/08 22:29:29 wgeric Exp $ */ + +/* Updated by Jon Stanley for use in phpBB XML MOD */ + +/* Updated by David Smith to look subSilvery for phpBB */ + +html, body { + font-family: Verdana, Arial, Helvetica, sans-serif; + color: black; + background: #E5E5E5; + background-position: top left; + background-attachment: fixed; + background-repeat: no-repeat; + } +:link { color : #006699; background: transparent } +:visited { color : #006699; background: transparent } +a:active { color : #006699; background: transparent } +a:hover { text-decoration: underline; color : #DD6900; } + +a:link img, a:visited img { border-style: none } /* no border on img links */ + +a img { color: white; } /* trick to hide the border in Netscape 4 */ +@media all { /* hide the next rule from Netscape 4 */ + a img { color: inherit; } /* undo the color change above */ +} + +th, td { /* ns 4 */ + font-family: sans-serif; +} + +h1, h2, h3, h4, h5, h6 { text-align: left } +/* background should be transparent, but WebTV has a bug */ +h1, h2, h3 { color: #006699 } +h1 { font: 170% sans-serif } +h2 { font: 140% sans-serif } +h3 { font: 120% sans-serif } +h4 { font: bold 100% sans-serif } +h5 { font: italic 100% sans-serif } +h6 { font: small-caps 100% sans-serif } + +.hide { display: none } + +div.head { margin-bottom: 1em } +div.head h1 { margin-top: 2em; clear: both } +div.head table { margin-left: 2em; margin-top: 2em } + +p.copyright { font-size: small } +p.copyright small { font-size: small } + +@media screen { /* hide from IE3 */ +a[href]:hover { background: #ffa } +} + +pre { margin-left: 2em } +/* +p { + margin-top: 0.6em; + margin-bottom: 0.6em; +} +*/ +dt, dd { margin-top: 0; margin-bottom: 0 } /* opera 3.50 */ +dt { font-weight: bold } + +pre, code { font-family: monospace } /* navigator 4 requires this */ + +ul.toc { + list-style: disc; /* Mac NS has problem with 'none' */ + list-style: none; +} + +@media aural { + h1, h2, h3 { stress: 20; richness: 90 } + .hide { speak: none } + p.copyright { volume: x-soft; speech-rate: x-fast } + dt { pause-before: 20% } + pre { speak-punctuation: code } +} + +/* Additional styles */ + +div.editFile {border: 2px solid #333333; margin: 0em 0em 2em; padding: 1em 1em; background: #D1D7DC;} +div.editFile h2 { font-size: 170%; margin: 0.4em 0em; } +div.action { border: 2px solid #DD6900; padding: 1em; background: #DEE3E7; margin: 1em 0em; } +div.action p { font-weight: normal; margin-top: 0px; margin-bottom: 0px; font-size: 0.8em; } +div.action h3 { margin-top: 0px; margin-bottom: 0px; } +div.action pre { padding: 0.2em; background: #EFEFEF; border: 2px solid #006699; overflow: scroll; width: 95%; } +div.editFile pre { padding: 0.2em; background: #EFEFEF; border: 2px solid #006699; overflow: scroll; width: 95%; } + +#pageBody { background-color: #FFFFFF; border: 1px #98AAB1 solid; padding: 1em 1em;} + +hr { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;} + +strong.red { color: red; } + +</style> + +<script type="text/javascript"><![CDATA[<!--]]> +var i = 0; +var box = new Array(); +<xsl:for-each select="mod:action-group/mod:open/mod:edit"> + <xsl:for-each select="mod:find|mod:action"> + box[i] = '<xsl:value-of select="generate-id()"/>'; + i += 1; + </xsl:for-each> + <xsl:for-each select="mod:inline-edit"> + <xsl:for-each select="mod:inline-find|mod:inline-action"> + box[i] = '<xsl:value-of select="generate-id()"/>'; + i += 1; + </xsl:for-each> + </xsl:for-each> +</xsl:for-each> + +<![CDATA[ +var selectedElement = -1; +var boxes = box.length; +var pre_count = 0; + +// The following line from http://www.ryancooper.com/resources/keycode.asp +document.onkeydown = mod_doKeyPress; + +function SXBB_IsIEMac() +{ + // Any better way to detect IEMac? + var ua = String(navigator.userAgent).toLowerCase(); + if( document.all && ua.indexOf("mac") >= 0 ) + { + return true; + } + return false; +} + +function select_text(id) +{ + var o = document.getElementById(id); + if( !o ) + { + return; + } + var r, s; + if( document.selection && !SXBB_IsIEMac() ) + { + // Works on: IE5+ + // To be confirmed: IE4? / IEMac fails? + r = document.body.createTextRange(); + r.moveToElementText(o); + r.select(); + } + else if( document.createRange && (document.getSelection || window.getSelection) ) + { + // Works on: Netscape/Mozilla/Konqueror/Safari + // To be confirmed: Konqueror/Safari use window.getSelection ? + r = document.createRange(); + r.selectNodeContents(o); + s = window.getSelection ? window.getSelection() : document.getSelection(); + s.removeAllRanges(); + s.addRange(r); + } + + find_selected(id); + return o; +} + +function find_selected(id) +{ + for( x = 0; x < box.length; x++ ) + { + if ( box[x] == id ) + { + selectedElement = x; + } + } +} + +// function findPosY taken from http://www.quirksmode.org/js/findpos.html +function findPosY(obj) +{ + var curtop = 0; + if (obj.offsetParent) + { + while (obj.offsetParent) + { + curtop += obj.offsetTop + obj = obj.offsetParent; + } + } + else if (obj.y) + { + curtop += obj.y; + } + return curtop; +} + +function selectNextBox() +{ + selectedElement += 1; + if (selectedElement >= boxes) selectedElement = 0; + obj = select_text(box[selectedElement]); + window.scrollTo(0, findPosY(obj) - 100); +} + +function selectPrevBox() +{ + selectedElement -= 1; + if (selectedElement < 0) selectedElement = boxes - 1; + obj = select_text(box[selectedElement]); + window.scrollTo(0, findPosY(obj) - 100); +} + +function selectFirstBox() +{ + selectedElement = 0; + obj = select_text(box[selectedElement]); + window.scrollTo(0, findPosY(obj) - 100); +} + +function mod_doKeyPress(e) +{ + /* section from w3 schools starts here http://www.w3schools.com/jsref/jsref_onkeypress.asp */ + var keynum; + /* section from w3 schools ends here */ + + // The following line from http://www.ryancooper.com/resources/keycode.asp + if (window.event) keynum = window.event.keyCode; + else if (e) keynum = e.which; + + if (keynum == 84) selectNextBox(); + //if (keynum == 9) selectNextBox(); //tab + //if (keynum == 13) selectNextBox(); //enter/return + //if (keynum == 32) selectNextBox(); //space + if (keynum == 40) selectNextBox(); //down key + if (keynum == 38) selectPrevBox(); //up key + if (keynum == 83 || keynum == 37) + { + selectFirstBox(); + } + return false; +} +//-->]]></script> + <title>phpBB MOD » <xsl:value-of select="$title" /></title> + </head> + <body> + <div id="pageBody"> + <div id="modInfo"> + <xsl:for-each select="mod:header"> + <xsl:call-template name="give-header"></xsl:call-template> + </xsl:for-each> + <div id="modInstructions"> + <xsl:for-each select="mod:action-group"> + <xsl:call-template name="give-actions"></xsl:call-template> + </xsl:for-each> + </div> + <hr /> + <div class="endMOD"> + <h1>Save all files. End of MOD.</h1> + <p>You have finished the installation for this MOD. Upload all changed files to your website. If the installation went bad, simply restore your backed up files.</p> + </div> + </div> + </div> + <p class="copyright" style="text-align: center; font-size: 10px;">MOD UA XSLT File Copyright © 2006 The phpBB Group, this MOD is copyright to the author<xsl:if test="count(author) > 1">s</xsl:if> listed above.</p> + </body> + </html> + </xsl:template> + <xsl:template name="give-header"> + <h1>Installation instructions for '<xsl:value-of select="$title" />' Version <xsl:value-of select="$version" /></h1> + <h2>About this MOD</h2> + <dl> + <dt>Title:</dt> + <dd> + <xsl:if test="count(mod:title) > 1"> + <dl id="title"> + <xsl:for-each select="mod:title"> + <dl id="{generate-id()}"> + <dt> + <xsl:value-of select="@lang" /> + </dt> + <dd style='white-space:pre;'> + <xsl:value-of select="current()" /> + </dd> + </dl> + </xsl:for-each> + </dl> + </xsl:if> + <xsl:if test="count(mod:title) = 1"> + <xsl:value-of select="mod:title" /> + </xsl:if> + </dd> + <dt>Description:</dt> + <dd> + <xsl:if test="count(mod:description) > 1"> + <dl id="description"> + <xsl:for-each select="mod:description"> + <dl id="{generate-id()}"> + <dt> + <xsl:value-of select="@lang" /> + </dt> + <dd> + <xsl:call-template name="add-line-breaks"> + <xsl:with-param name="string"> + <xsl:value-of select="current()" /> + </xsl:with-param> + </xsl:call-template> + </dd> + </dl> + </xsl:for-each> + </dl> + </xsl:if> + <xsl:if test="count(mod:description) = 1"> + <xsl:call-template name="add-line-breaks"> + <xsl:with-param name="string"> + <xsl:value-of select="mod:description" /> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + </dd> + <dt>Version:</dt> + <dd> + <xsl:for-each select="mod:mod-version"> + <xsl:call-template name="give-version"></xsl:call-template> + </xsl:for-each> + </dd> + <xsl:for-each select="mod:installation"> + <xsl:call-template name="give-installation"></xsl:call-template> + </xsl:for-each> + </dl> + <xsl:for-each select="mod:author-group"> + <h2>Author<xsl:if test="count(mod:author) > 1">s</xsl:if></h2> + <xsl:call-template name="give-authors"></xsl:call-template> + </xsl:for-each> + <h2>Files To Edit</h2> + <xsl:for-each select="../mod:action-group"> + <xsl:call-template name="give-files-to-edit"></xsl:call-template> + </xsl:for-each> + <h2>Included Files</h2> + <xsl:if test="count(../mod:action-group/mod:copy/mod:file) = 0"> + <p>No files have been included with this MOD.</p> + </xsl:if> + <xsl:for-each select="../mod:action-group"> + <xsl:call-template name="give-files-included"></xsl:call-template> + </xsl:for-each> + <hr /> + <div id="modDisclaimer"> + <h1>Disclaimer</h1> + <p>For Security Purposes, Please Check: <a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a> for the latest version of this MOD. Downloading this MOD from other sites could cause malicious code to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered in our MOD-Database, located at: <a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a></p> + <h2>Author Notes</h2> + <xsl:if test="count(mod:author-notes) > 1"> + <dl id="author-notes"> + <xsl:for-each select="mod:author-notes"> + <dl id="{generate-id()}"> + <dt> + <xsl:value-of select="@lang" /> + </dt> + <dd> + <xsl:call-template name="add-line-breaks"> + <xsl:with-param name="string"> + <xsl:value-of select="current()" /> + </xsl:with-param> + </xsl:call-template> + </dd> + </dl> + </xsl:for-each> + </dl> + </xsl:if> + <xsl:if test="count(mod:author-notes) = 1"> + <xsl:call-template name="add-line-breaks"> + <xsl:with-param name="string"> + <xsl:value-of select="mod:author-notes" /> + </xsl:with-param> + </xsl:call-template> + </xsl:if> + <xsl:for-each select="mod:history"> + <xsl:call-template name="give-mod-history"></xsl:call-template> + </xsl:for-each> + <h3>License</h3> + <p>This MOD has been licensed under the following license:</p> + <p style='white-space:pre;'> + <xsl:value-of select="mod:license" /> + </p> + <h3>Other Notes</h3> + <p>Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD</p> + <p>This MOD was designed for phpBB<xsl:value-of select="mod:installation/mod:target-version/mod:target-primary" /> and may not function as stated on other phpBB versions. MODs for phpBB3.0 will <strong>not</strong> work on phpBB2.0 and vice versa.</p> + <xsl:if test="./mod:mod-version/mod:minor mod 2 != 0 or ./mod:mod-version/mod:major = 0"> + <p> + <strong class="red">This MOD is development quality. It is not recommended that you install it on a live forum.</strong> + </p> + </xsl:if> + </div> + <hr /> + </xsl:template> + <xsl:template name="give-authors"> + <xsl:for-each select="mod:author"> + <xsl:call-template name="give-author"></xsl:call-template> + </xsl:for-each> + </xsl:template> + <xsl:template name="give-author"> + <dl> + <dt>Username:</dt> + <dd> + <a href="http://www.phpbb.com/phpBB/profile.php?mode=viewprofile&u={mod:username}"> + <xsl:value-of select="mod:username" /> + </a> + </dd> + <xsl:if test="mod:email != 'N/A' and mod:email != 'n/a' and mod:email != ''"> + <dt>Email:</dt> + <dd> + <a href="mailto:{mod:email}"> + <xsl:value-of select="mod:email" /> + </a> + </dd> + </xsl:if> + <dt>Realname:</dt> + <dd> + <xsl:value-of select="mod:realname" /> + </dd> + <xsl:if test="mod:homepage != 'N/A' and mod:homepage != 'n/a' and mod:homepage!=''"> + <dt>WWW:</dt> + <dd> + <a href="{mod:homepage}"> + <xsl:value-of select="mod:homepage" /> + </a> + </dd> + </xsl:if> + </dl> + <br /> + </xsl:template> + <xsl:template name="give-version"><xsl:value-of select="concat(mod:major, '.', mod:minor, '.', mod:revision, mod:release)" /></xsl:template> + <xsl:template name="give-installation"> + <dt>Installation Level:</dt> + <dd> + <xsl:if test="mod:level='easy'">Easy</xsl:if> + <xsl:if test="mod:level='intermediate'">Intermediate</xsl:if> + <xsl:if test="mod:level='hard'">Hard</xsl:if> + </dd> + <dt>Installation Time:</dt> + <dd>~<xsl:value-of select="floor(mod:time div 60)" /> minutes</dd> + </xsl:template> + <xsl:template name="give-mod-history"> + <xsl:if test="count(mod:entry)>1"> + <h2>MOD History</h2> + <dl> + <xsl:for-each select="mod:entry"> + <xsl:call-template name="give-history-entry"></xsl:call-template> + </xsl:for-each> + </dl> + </xsl:if> + </xsl:template> + <xsl:template name="give-history-entry"> + <dt><xsl:value-of select="substring(mod:date,1,10)" /> - Version + <xsl:for-each select="mod:rev-version"> + <xsl:call-template name="give-version"></xsl:call-template> + </xsl:for-each></dt> + <dd> + <xsl:if test="count(mod:changelog) > 1"> + <xsl:for-each select="mod:changelog"> + <xsl:call-template name="give-history-entry-changelog"></xsl:call-template> + </xsl:for-each> + </xsl:if> + <xsl:if test="count(mod:changelog) = 1"> + <xsl:for-each select="mod:changelog"> + <xsl:call-template name="give-history-entry-changelog-single"></xsl:call-template> + </xsl:for-each> + </xsl:if> + </dd> + </xsl:template> + <xsl:template name="give-history-entry-changelog"> + <dl> + <dt> + <xsl:value-of select="@lang" /> + </dt> + <dd> + <ul> + <xsl:for-each select="mod:change"> + <li> + <xsl:value-of select="current()" /> + </li> + </xsl:for-each> + </ul> + </dd> + </dl> + </xsl:template> + <xsl:template name="give-history-entry-changelog-single"> + <ul> + <xsl:for-each select="mod:change"> + <li> + <xsl:value-of select="current()" /> + </li> + </xsl:for-each> + </ul> + </xsl:template> + <xsl:template name="give-files-to-edit"> + <ul> + <xsl:for-each select="mod:open"> + <xsl:call-template name="give-file"></xsl:call-template> + </xsl:for-each> + </ul> + </xsl:template> + <xsl:template name="give-files-included"> + <ul> + <xsl:for-each select="mod:copy"> + <xsl:call-template name="give-file-copy"></xsl:call-template> + </xsl:for-each> + </ul> + </xsl:template> + <xsl:template name="give-file"> + <li> + <xsl:value-of select="@src" /> + <xsl:if test="position()!=last()">,</xsl:if> + </li> + </xsl:template> + <xsl:template name="give-file-copy"> + <xsl:for-each select="mod:file"> + <li> + <xsl:value-of select="@from" /> + <xsl:if test="position()!=last()">,</xsl:if> + </li> + </xsl:for-each> + </xsl:template> + <xsl:template name="give-actions"> + <xsl:if test="count(mod:sql) > 0"> + <h1 onclick="select_text('sql');">SQL</h1> + </xsl:if> + <div id="sql"> + <xsl:for-each select="mod:sql"> + <xsl:call-template name="give-sql"></xsl:call-template> + </xsl:for-each> + </div> + <xsl:if test="count(mod:copy) > 0"> + <h1>File Copy</h1> + </xsl:if> + <xsl:for-each select="mod:copy"> + <xsl:call-template name="give-filez"></xsl:call-template> + </xsl:for-each> + <h1>Edits</h1> + <p>Click on the action name or in the code box to select the code. You may also hit '<em>s</em>' on your keyboard to go to the first code box and the <em>up</em> and <em>down</em> arrows to scroll through the code boxes.</p> + <xsl:for-each select="mod:open"> + <xsl:call-template name="give-fileo"></xsl:call-template> + </xsl:for-each> + <xsl:call-template name="give-manual"></xsl:call-template> + </xsl:template> + <xsl:template name="give-sql"> + <div class="action"> + <pre> + <xsl:value-of select="current()" /> + </pre> + </div> + </xsl:template> + <xsl:template name="give-manual"> + <xsl:for-each select="mod:diy-instructions"> + <div class="editFile"> + <h2 onClick="select_text('{generate-id()}')">DIY Instructions<xsl:if test="count(../mod:diy-instructions) > 1"> (<xsl:value-of select="@lang" />)</xsl:if></h2> + <p>These are manual instructions that cannot be performed automatically. You should follow these instructions carefully.</p> + <pre id="{generate-id()}"> + <xsl:value-of select="current()" /> + </pre> + </div> + </xsl:for-each> + </xsl:template> + <xsl:template name="give-fileo"> + <div class="editFile"> + <h2>Open: <xsl:value-of select="@src" /></h2> + <xsl:for-each select="mod:edit"> + <div class="action"> + <xsl:for-each select="mod:find|mod:action|mod:inline-edit|mod:comment"> + <xsl:if test="name() = 'find'"> + <h3 onClick="select_text('{generate-id()}')">Find</h3> + <p><strong>Tip:</strong> This may be a partial find and not the whole line. +<xsl:if test="@type = 'regex'"> + <br /> + <em>This find contains an advanced feature known as regular expressions, click here to learn more.</em> + </xsl:if> +</p> + <pre id="{generate-id()}"> + <xsl:value-of select="current()" /> + </pre> + </xsl:if> + <xsl:if test="name() = 'action'"> + <xsl:if test="@type = 'after-add'"> + <h3 onClick="select_text('{generate-id()}')">Add after</h3> + <p><strong>Tip:</strong> Add these lines on a new blank line after the preceding line(s) to find.</p> + </xsl:if> + <xsl:if test="@type = 'before-add'"> + <h3 onClick="select_text('{generate-id()}')">Add before</h3> + <p><strong>Tip:</strong> Add these lines on a new blank line before the preceding line(s) to find.</p> + </xsl:if> + <xsl:if test="@type = 'replace-with'"> + <h3 onClick="select_text('{generate-id()}')">Replace With</h3> + <p><strong>Tip:</strong> Replace the preceding line(s) to find with the following lines.</p> + </xsl:if> + <xsl:if test="@type = 'operation'"> + <h3 onClick="select_text('{generate-id()}')">Increment</h3> + <p><strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.</p> + </xsl:if> + <pre id="{generate-id()}"> + <xsl:value-of select="current()" /> + </pre> + </xsl:if> + <xsl:if test="name() = 'comment'"> + <dl> + <dt>Comment:<xsl:if test="count(../mod:comment) > 1"> (<xsl:value-of select="@lang" />)</xsl:if></dt> + <dd> + <xsl:call-template name="add-line-breaks"> + <xsl:with-param name="string"> + <xsl:value-of select="current()" /> + </xsl:with-param> + </xsl:call-template> + </dd> + </dl> + </xsl:if> + <xsl:if test="name() = 'inline-edit'"> + <div class="action"> + <xsl:for-each select="mod:inline-find|mod:inline-action|mod:inline-comment"> + <xsl:if test="name() = 'inline-find'"> + <h3 onClick="select_text('{generate-id()}')">In-line Find</h3> + <p><strong>Tip:</strong> This is a partial match of a line for in-line operations. +<xsl:if test="@type = 'regex'"> + <br /> + <em>This find contains an advanced feature known as regular expressions, click here to learn more.</em> + </xsl:if> +</p> + <pre id="{generate-id()}"> + <xsl:value-of select="current()" /> + </pre> + </xsl:if> + <xsl:if test="name() = 'inline-action'"> + <xsl:if test="@type = 'after-add'"> + <h3 onClick="select_text('{generate-id()}')">In-line Add after</h3> + </xsl:if> + <xsl:if test="@type = 'before-add'"> + <h3 onClick="select_text('{generate-id()}')">In-line Add before</h3> + </xsl:if> + <xsl:if test="@type = 'replace-with'"> + <h3 onClick="select_text('{generate-id()}')">In-line Replace With</h3> + </xsl:if> + <xsl:if test="@type = 'operation'"> + <h3 onClick="select_text('{generate-id()}')">In-line Increment</h3> + <p><strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.</p> + </xsl:if> + <pre id="{generate-id()}"> + <xsl:value-of select="current()" /> + </pre> + </xsl:if> + <xsl:if test="name() = 'inline-comment'"> + <p> + <strong>Comment:</strong> + <em> + <xsl:value-of select="current()" /> + </em> + </p> + </xsl:if> + </xsl:for-each> + </div> + </xsl:if> + </xsl:for-each> + </div> + </xsl:for-each> + </div> + </xsl:template> + <xsl:template name="give-filez"> + <dl> + <xsl:for-each select="mod:file"> + <dt>Copy: <xsl:value-of select="@from" /></dt> + <dd>To: <xsl:value-of select="@to" /></dd> + </xsl:for-each> + </dl> + </xsl:template> + <xsl:template name="give-sub-action-find"> + <p>Find</p> + <pre> + <xsl:value-of select="find-string" /> + </pre> + <xsl:if test="count(in-line) > 0"> + <div class="action"> + <xsl:for-each select="in-line"> + <xsl:for-each select="find-in-line|edit-in-line"> + <xsl:if test="name() = 'find-in-line'"> + <xsl:call-template name="give-sub-action-in-line-find"></xsl:call-template> + </xsl:if> + <xsl:if test="name() = 'edit-in-line'"> + <xsl:call-template name="give-sub-action-in-line-edit"></xsl:call-template> + </xsl:if> + </xsl:for-each> + </xsl:for-each> + </div> + </xsl:if> + </xsl:template> + <xsl:template name="give-sub-action-in-line-find"> + <p>In-line, Find</p> + <pre> + <xsl:value-of select="find-string-in-line" /> + </pre> + </xsl:template> + <xsl:template name="give-sub-action-edit"> + <xsl:if test="@action = 'replace'"> + <p>Replace, Add</p> + </xsl:if> + <xsl:if test="@action = 'add' and @where = 'after'"> + <p>After, Add</p> + </xsl:if> + <xsl:if test="@action = 'add' and @where = 'before'"> + <p>Before, Add</p> + </xsl:if> + <pre> + <xsl:value-of select="current()" /> + </pre> + </xsl:template> + <xsl:template name="give-sub-action-in-line-edit"> + <xsl:if test="@action = 'replace'"> + <p>In-line, Replace With</p> + </xsl:if> + <xsl:if test="@action = 'add' and @where = 'after'"> + <p>In-line, After, Add</p> + </xsl:if> + <xsl:if test="@action = 'add' and @where = 'before'"> + <p>In-line, Before, Add</p> + </xsl:if> + <xsl:if test="@action = 'operation'"> + <p>In-line, perform the following mathematical operation</p> + <xsl:variable name="oper_body" select="@operation" /> + <pre> + <xsl:value-of select="$oper_body" /> + </pre> + </xsl:if> + <pre> + <xsl:value-of select="current()" /> + </pre> + </xsl:template> + <!-- add-line-breaks borrowed from http://www.stylusstudio.com/xsllist/200103/post40180.html --> + <xsl:template name="add-line-breaks"> + <xsl:param name="string" select="." /> + <xsl:choose> + <xsl:when test="contains($string, '
')"> + <xsl:value-of select="substring-before($string, '
')" /> + <br /> + <xsl:call-template name="add-line-breaks"> + <xsl:with-param name="string" select="substring-after($string, '
')" /> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$string" /> + </xsl:otherwise> + </xsl:choose> + </xsl:template> +</xsl:stylesheet> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-10-14 02:56:39
|
Revision: 9 http://svn.sourceforge.net/phpbbkb/?rev=9&view=rev Author: markthedaemon Date: 2006-10-13 19:56:33 -0700 (Fri, 13 Oct 2006) Log Message: ----------- Added the initial commit of the install file. Obviously more queries to add to this. TODO: Change header; add queries; fix bugs. It's 4am and i've probably missed something really important out. Forgive me :P Added Paths: ----------- root/install/ root/install/kb_install.php Added: root/install/kb_install.php =================================================================== --- root/install/kb_install.php (rev 0) +++ root/install/kb_install.php 2006-10-14 02:56:33 UTC (rev 9) @@ -0,0 +1,84 @@ +<?php +/*************************************************************************** + * kb_install.php + * ------------------- + * + * copyright: phpBB KB Group + * site: http://www.phpbbknowledgebase.com + * SF Project Page: http://www.sourceforge.net/projects/phpbbkb + * + ***************************************************************************/ + +/*************************************************************************** + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + +define('IN_PHPBB', true); +$phpbb_root_path = './../'; +include($phpbb_root_path . 'extension.inc'); +include($phpbb_root_path . 'common.'.$phpEx); + +// +// Start session management +// +$userdata = session_pagestart($user_ip, PAGE_INDEX); +init_userprefs($userdata); +// +// End session management +// + + +if( !$userdata['session_logged_in'] ) +{ + $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; + header($header_location . append_sid("login.$phpEx?redirect=phpbb_sql_generator.$phpEx", true)); + exit; +} + +if( $userdata['user_level'] != ADMIN ) +{ + message_die(GENERAL_MESSAGE, 'You are not authorised to access this page'); +} + + +$page_title = 'Updating the database'; +include($phpbb_root_path . 'includes/page_header.'.$phpEx); + +echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">'; +echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">'; + + +$sql = array(); +$sql[] = "ALTER TABLE " . $table_prefix . "forums ADD cat_kb tinyint(1) unsigned default 0"; + +for( $i = 0; $i < count($sql); $i++ ) +{ + if( !$result = $db->sql_query ($sql[$i]) ) + { + $error = $db->sql_error(); + + echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />'; + } + else + { + echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />'; + } +} + + +echo '</ul></span></td></tr><tr><td class="catBottom" height="28"> </td></tr>'; + +echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. '; +echo 'Please be sure to delete this file now.<br />'; +echo 'If you have run into any errors, please visit the '. + '<a href="http://www.phpbbknowledgebase.com" target="_blank">phpBB Knowledge Base Forums</a> or the <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=415458" target="_blank">phpBB.com topic</a> and ask someone for help.</span></td></tr>'; +echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day, and thanks for using the phpBB Knowledge Base MODification!</a></span></td></table>'; + +include($phpbb_root_path . 'includes/page_tail.'.$phpEx); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-10-14 02:43:48
|
Revision: 8 http://svn.sourceforge.net/phpbbkb/?rev=8&view=rev Author: markthedaemon Date: 2006-10-13 19:43:41 -0700 (Fri, 13 Oct 2006) Log Message: ----------- Starting to add the folder structure for the MOD. Added Paths: ----------- contrib/ docs/ root/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-10-14 02:39:45
|
Revision: 7 http://svn.sourceforge.net/phpbbkb/?rev=7&view=rev Author: markthedaemon Date: 2006-10-13 19:39:39 -0700 (Fri, 13 Oct 2006) Log Message: ----------- Cleaned out our repository; getting ready for some real commits :P. Removed Paths: ------------- main/ phpBB2/ phpBB3/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-28 00:25:54
|
Revision: 6 Author: markthedaemon Date: 2006-08-27 17:25:46 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpbbkb/?rev=6&view=rev Log Message: ----------- Adding the start for a administration section for the KB Added Paths: ----------- phpBB2/root/admin/ phpBB2/root/admin/admin_kb.php Added: phpBB2/root/admin/admin_kb.php =================================================================== --- phpBB2/root/admin/admin_kb.php (rev 0) +++ phpBB2/root/admin/admin_kb.php 2006-08-28 00:25:46 UTC (rev 6) @@ -0,0 +1,42 @@ +<?php +/*************************************************************************** + * admin_kb.php + * ------------------- + * begin : Thursday, Jul 12, 2001 + * copyright : (C) 2001 phpBB Knowledge Base + * URL : http://www.phpbbknowledgebase.com + * + * $Id: admin_kb.php,v 1.0.0.0 2006/08/28 21:55:09 markthedaemon Exp $ + * + ***************************************************************************/ + +/*************************************************************************** + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ + +define('IN_PHPBB', 1); + +if( !empty($setmodules) ) +{ + $file = basename(__FILE__); + $module['Forums']['Manage'] = $file; + return; +} + +// +// Load default header +// +$phpbb_root_path = "./../"; +require($phpbb_root_path . 'extension.inc'); +require('./pagestart.' . $phpEx); +include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); + + +include('./page_footer_admin.'.$phpEx); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-07-26 21:47:22
|
Revision: 5 Author: markthedaemon Date: 2006-07-26 08:51:44 -0700 (Wed, 26 Jul 2006) ViewCVS: http://svn.sourceforge.net/phpbbkb/?rev=5&view=rev Log Message: ----------- Some of the very first code commits. Please note that a lot of this is subject to change ;) Added Paths: ----------- phpBB2/root/includes/ phpBB2/root/includes/kb_addarticle.php phpBB2/root/includes/kb_viewcategories.php phpBB2/root/kb.php Added: phpBB2/root/includes/kb_addarticle.php =================================================================== --- phpBB2/root/includes/kb_addarticle.php (rev 0) +++ phpBB2/root/includes/kb_addarticle.php 2006-07-26 15:51:44 UTC (rev 5) @@ -0,0 +1,12 @@ +<?php +/** +* +* @package: kb +* @version: $Id: index.php,v 1.1.1.1 2006/02/24 02:28:06 markthedaemon Exp $ +* @copyright: (c) 2006 phpBB Knowledge Base +* @license: http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + + +?> \ No newline at end of file Added: phpBB2/root/includes/kb_viewcategories.php =================================================================== --- phpBB2/root/includes/kb_viewcategories.php (rev 0) +++ phpBB2/root/includes/kb_viewcategories.php 2006-07-26 15:51:44 UTC (rev 5) @@ -0,0 +1,25 @@ +<?php +/** +* +* @package: kb +* @version: $Id: index.php,v 1.1.1.1 2006/02/24 02:28:06 markthedaemon Exp $ +* @copyright: (c) 2006 phpBB Knowledge Base +* @license: http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +if ( !defined('IN_PHPBB') ) +{ + die("Hacking attempt"); + exit; +} + +$sql = 'SELECT kb_category_name, kb_category_id, kb_category_desc + FROM ' . KB_CATEGORY_TABLE; + +if( !($result = $db->sql_query($sql)) ) +{ + message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); +} + +?> \ No newline at end of file Added: phpBB2/root/kb.php =================================================================== --- phpBB2/root/kb.php (rev 0) +++ phpBB2/root/kb.php 2006-07-26 15:51:44 UTC (rev 5) @@ -0,0 +1,44 @@ +<?php +/** +* +* @package: kb +* @version: $Id: index.php,v 1.1.1.1 2006/02/24 02:28:06 markthedaemon Exp $ +* @copyright: (c) 2006 phpBB Knowledge Base +* @license: http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +define('IN_PHPBB', true); +$phpbb_root_path = './'; +include($phpbb_root_path . 'extension.inc'); +include($phpbb_root_path . 'common.'.$phpEx); + +// +// Start session management +// +$userdata = session_pagestart($user_ip, PAGE_KB); +init_userprefs($userdata); +// +// End session management +// +if( isset($HTTP_GET_VARS['mode']) ) +{ + switch( $HTTP_GET_VARS['mode'] ) + { + case 'add': + include($phpbb_root_path . 'includes/kb_addarticle.'.$phpEx); + exit; + default: + include($phpbb_root_path . 'includes/kb_viewcategories.'.$phpEx); + exit; + } +} +else +{ + include($phpbb_root_path . 'includes/kb_viewcategories.'.$phpEx); + exit; +} + +redirect(append_sid("index.$phpEx", true)); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-07-24 22:11:01
|
Revision: 4 Author: markthedaemon Date: 2006-07-24 15:10:49 -0700 (Mon, 24 Jul 2006) ViewCVS: http://svn.sourceforge.net/phpbbkb/?rev=4&view=rev Log Message: ----------- Adding the main branch to the Subversion repo. Added Paths: ----------- main/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-07-24 16:26:45
|
Revision: 3 Author: markthedaemon Date: 2006-07-24 09:26:39 -0700 (Mon, 24 Jul 2006) ViewCVS: http://svn.sourceforge.net/phpbbkb/?rev=3&view=rev Log Message: ----------- Commiting a couple more folders ;P Added Paths: ----------- phpBB2/contrib/ phpBB2/root/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |