|
From: Jon O. <jon...@us...> - 2005-03-28 20:23:04
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20851/modules/mx_kb/includes Modified Files: functions_kb.php kb_article.php kb_constants.php kb_defs.php kb_header.php kb_moderator.php kb_pages.php kb_post.php kb_stats.php Added Files: functions_kb_field.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support - adding custom fields - making it compatible with phpBB mod Index: kb_stats.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_stats.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_stats.php 1 Feb 2005 20:45:44 -0000 1.3 --- kb_stats.php 28 Mar 2005 20:22:47 -0000 1.4 *************** *** 37,67 **** include( $mx_root_path . 'includes/page_header.' . $phpEx ); } // load header include ( $module_root_path . "includes/kb_header." . $phpEx ); ! $template->set_filenames( array( 'body' => 'kb_stats_body.tpl' ) ! ); ! // if ( !$category_name ) ! // { ! // $message = $lang['Category_not_exsist'] . '<br /><br />' . sprintf($lang['Click_return_kb'], '<a href="' . append_sid(this_kb_mxurl()) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid($mx_root_path . "index.$phpEx") . '">', '</a>'); - // mx_message_die(GENERAL_MESSAGE, $message); - // } - // else - // { - // get sub-cats - // get_kb_cat_subs($category_id); if ( $stats == 'toprated' ) { $path_kb = $lang['Top_toprated']; ! }elseif ( $stats == 'latest' ) { $path_kb = $lang['Top_latest']; ! }elseif ( $stats == 'mostpopular' ) { $path_kb = $lang['Top_most_popular']; } ! // $path_kb_array = array(); ! // get_kb_nav($category_id); $template->assign_vars( array( 'L_CATEGORY_NAME' => $category_name, 'L_ARTICLE' => $lang['Article'], --- 37,59 ---- include( $mx_root_path . 'includes/page_header.' . $phpEx ); } + // load header include ( $module_root_path . "includes/kb_header." . $phpEx ); ! $template->set_filenames( array( 'body' => 'kb_stats_body.tpl' ) ); if ( $stats == 'toprated' ) { $path_kb = $lang['Top_toprated']; ! } ! elseif ( $stats == 'latest' ) { $path_kb = $lang['Top_latest']; ! } ! elseif ( $stats == 'mostpopular' ) { $path_kb = $lang['Top_most_popular']; } ! $template->assign_vars( array( 'L_CATEGORY_NAME' => $category_name, 'L_ARTICLE' => $lang['Article'], *************** *** 73,87 **** 'L_VIEWS' => $lang['Views'], 'L_VOTES' => $lang['Votes'], - 'L_CATEGORY' => $lang['Category_sub'], 'L_ARTICLES' => $lang['Articles'], - 'PATH' => '» ' . $path_kb, ! ! 'U_CAT' => append_sid( this_kb_mxurl( 'mode=cat&cat=' . $category_id ) ) ) ! ); get_kb_stats( $stats, '1', 'articlerow', $kb_is_auth ); - // } ?> \ No newline at end of file --- 65,75 ---- 'L_VIEWS' => $lang['Views'], 'L_VOTES' => $lang['Votes'], 'L_CATEGORY' => $lang['Category_sub'], 'L_ARTICLES' => $lang['Articles'], 'PATH' => '» ' . $path_kb, ! 'U_CAT' => append_sid( this_kb_mxurl( 'mode=cat&cat=' . $category_id ) ) ! ) ); get_kb_stats( $stats, '1', 'articlerow', $kb_is_auth ); ?> \ No newline at end of file Index: kb_header.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_header.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** kb_header.php 26 Mar 2005 22:52:36 -0000 1.13 --- kb_header.php 28 Mar 2005 20:22:47 -0000 1.14 *************** *** 28,63 **** define( 'ALLOW_ANON', 1 ); - // Pull all config data - - $sql = "SELECT * - FROM " . KB_CONFIG_TABLE; - if ( !$result = $db->sql_query( $sql ) ) - { - message_die( CRITICAL_ERROR, "Could not query config information in kb_config", "", __LINE__, __FILE__, $sql ); - } - else - { - while ( $row_tmp = $db->sql_fetchrow( $result ) ) - { - $config_name = $row_tmp['config_name']; - $config_value = $row_tmp['config_value']; - $kb_config[$config_name] = $config_value; - } - } - - // $dirname = $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.'.$phpEx; - // include($dirname); - // Parse and show the overall header. ! $template->set_filenames( array( 'kb_header' => 'kb_header.tpl' ) ! ); ! if ( $HTTP_GET_VARS['cat'] ) { if ( $kb_config['allow_new'] == 1 && ( $kb_is_auth['auth_post'] || $kb_is_auth['auth_mod'] ) ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=add&cat=" . $HTTP_GET_VARS['cat'] ) ); $add_article = '<a href="' . $temp_url . '">' . $lang['Add_article'] . '</a>'; } --- 28,41 ---- define( 'ALLOW_ANON', 1 ); // Parse and show the overall header. ! $template->set_filenames( array( 'kb_header' => 'kb_header.tpl' ) ); ! if ( isset ( $HTTP_GET_VARS['cat'] ) ) { if ( $kb_config['allow_new'] == 1 && ( $kb_is_auth['auth_post'] || $kb_is_auth['auth_mod'] ) ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=add&cat=" . intval ($HTTP_GET_VARS['cat'] ) ) ); $add_article = '<a href="' . $temp_url . '">' . $lang['Add_article'] . '</a>'; } *************** *** 77,86 **** { $temp_url = append_sid( this_kb_mxurl() ); ! $block_title = '<th class="thTop"><a href="' . $temp_url . '"><img src="' . $images['kb_title'] . '" width="285" height="45" border="0" alt="' . $title . '"></a></th>'; } else { ! // $block_title = '<th class="thHead"> ' . $title . '</th>'; ! $block_title = ''; } --- 55,63 ---- { $temp_url = append_sid( this_kb_mxurl() ); ! $block_title = '<td align="center"><a href="' . $temp_url . '"><img src="' . $images['kb_title'] . '" width="285" height="45" border="0" alt="' . $title . '"></a></td>'; } else { ! $block_title = MXBB_MODULE ? '<th class="thHead"> ' . $title . '</th>' : '<td align="center"><b>' . $lang['KB_title'] . '</b></td>'; } *************** *** 102,106 **** if ( $kb_config['stats_list'] == 1 ) { ! get_quick_stats( $HTTP_GET_VARS['cat'] ); } --- 79,83 ---- if ( $kb_config['stats_list'] == 1 ) { ! get_quick_stats( intval( $HTTP_GET_VARS['cat'] ) ); } Index: kb_defs.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_defs.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** kb_defs.php 9 Jan 2005 21:40:38 -0000 1.2 --- kb_defs.php 28 Mar 2005 20:22:47 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- // ------------------------------------------------------------------------- // KB MODE ------------------------------------------------------------------------------------------- + define( 'NEWS_CAT_TABLE', $mx_table_prefix . 'kb_categories' ); define( 'KB_ARTICLES_TABLE', $mx_table_prefix . 'kb_articles' ); *************** *** 29,37 **** define( 'KB_TYPES_TABLE', $mx_table_prefix . 'kb_types' ); - // get type list for adding and editing articles - - // function get_kb_types() - // { - // global $db, $template; $sql = "SELECT * FROM " . KB_TYPES_TABLE; --- 30,33 ---- *************** *** 52,59 **** $item_types_name_array[] = $type['type']; } - // return array($item_types_array, $item_types_id_array, $item_types_name_array); - // } - $cat_extract_order = 'parent, cat_order'; $cool_array_category_id = 'category_id'; --- 48,53 ---- $item_types_name_array[] = $type['type']; } + $cat_extract_order = 'parent, cat_order'; $cool_array_category_id = 'category_id'; *************** *** 81,113 **** $item_types_all = 'forum_news'; - // $temp_list = get_kb_types(); - // $item_types_array = $temp_list[0]; - // $item_types_id_array = $temp_list[1]; - // $item_types_name_array = $temp_list[2]; - - // get type list for adding and editing articles - // function get_kb_types() - // { - // global $db, $template; - $sql = "SELECT * - FROM " . KB_TYPES_TABLE; - - if ( !( $type_result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, "Could not obtain types information", '', __LINE__, __FILE__, $sql ); - } - - $item_types_array = array(); - $item_types_id_array = array(); - $item_types_name_array = array(); - - while ( $type = $db->sql_fetchrow( $type_result ) ) - { - $item_types_array[] = 'type_' . $type['id']; - $item_types_id_array[] = $type['id']; - $item_types_name_array[] = $type['type']; - } - // return array($item_types_array, $item_types_id_array, $item_types_name_array); - // } ?> \ No newline at end of file --- 75,78 ---- Index: kb_pages.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_pages.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** kb_pages.php 18 Feb 2005 10:07:44 -0000 1.2 --- kb_pages.php 28 Mar 2005 20:22:47 -0000 1.3 *************** *** 1,13 **** <?php ! /** ! * kb_pages.php ! * --------------- ! * begin : June, 2004 ! * copyright : phpMiX (c) 2004 ! * contact : http://www.phpmix.com ! * module : mx_forum ! * file contents : Common definitions for the module. * ! * editor settings : TabSize = 4 */ --- 1,12 ---- <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com * ! * description : ! * ------------------------------------------------------------------------- */ *************** *** 19,28 **** */ - // Set the numbers to the Portal Page IDs where you place each Block. - // If you do not want a phpBB Script to act as a Portal Block, use 0. - // Note: This piece of code snippet is somewhat ugly and needs cleaning up...still it works... ! if ( empty( $_SESSION['kb_setup'] ) || 1==1) { $news_setup = array(); --- 18,28 ---- */ // Note: This piece of code snippet is somewhat ugly and needs cleaning up...still it works... + // What it does? + // Well if given a direct kb article link, it finds on what portal page the kb block is located. + // Since we can have different kb blocks on different portal pages displaying different kb categories/articles, this check is needed ;) + // Oh, do not blame markus for this code ;) ! if ( empty( $_SESSION['kb_setup'] ) ) { $news_setup = array(); *************** *** 86,91 **** } - // echo('xxxxx' . var_export($_SESSION['kb_setup']) . '<br>'); - // Start initial var setup --- 86,89 ---- Index: kb_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_constants.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** kb_constants.php 6 Mar 2005 01:12:29 -0000 1.21 --- kb_constants.php 28 Mar 2005 20:22:47 -0000 1.22 *************** *** 19,24 **** * (at your option) any later version. */ ! ! // ---------------------------------------------------------------------START // This file defines specific constants for the module --- 19,40 ---- * (at your option) any later version. */ ! ! if ( !MXBB_MODULE ) ! { ! $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://'; ! $server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])); ! $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : ''; ! $script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path'])); ! $script_name = ($script_name == '') ? $script_name : '/' . $script_name; ! ! define( 'PORTAL_URL', $server_protocol . $server_name . $server_port . $script_name . '/' ); ! define( 'PHPBB_URL', PORTAL_URL ); ! ! $reader_mode = false; ! $kb_config['news_operate_mode'] = false; ! $mx_table_prefix = $table_prefix; ! $is_block = false; ! } ! // ---------------------------------------------------------------------START // This file defines specific constants for the module *************** *** 34,48 **** define( 'KB_VOTES_TABLE', $mx_table_prefix . 'kb_votes' ); // ********************************************************************** // Read language definition // ********************************************************************** ! if ( !file_exists( $mx_root_path . 'modules/mx_kb/language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ) ) { ! include( $mx_root_path . 'modules/mx_kb/language/lang_english/lang_kb.' . $phpEx ); $link_language = 'lang_english'; } else { ! include( $mx_root_path . 'modules/mx_kb/language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ); $link_language = 'lang_' . $board_config['default_lang']; } --- 50,75 ---- define( 'KB_VOTES_TABLE', $mx_table_prefix . 'kb_votes' ); + define( 'KB_CUSTOM_TABLE', $mx_table_prefix . 'kb_custom' ); + define( 'KB_CUSTOM_DATA_TABLE', $mx_table_prefix . 'kb_customdata' ); + + // Field Types + define( 'INPUT', 0 ); + define( 'TEXTAREA', 1 ); + define( 'RADIO', 2 ); + define( 'SELECT', 3 ); + define( 'SELECT_MULTIPLE', 4 ); + define( 'CHECKBOX', 5 ); + // ********************************************************************** // Read language definition // ********************************************************************** ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ) ) { ! include( $module_root_path . 'language/lang_english/lang_kb.' . $phpEx ); $link_language = 'lang_english'; } else { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ); $link_language = 'lang_' . $board_config['default_lang']; } *************** *** 82,86 **** } ! $mxbb_footer_addup[] = 'mxBB Knowledge Base Module'; --- 109,124 ---- } ! if ( !MXBB_MODULE ) ! { ! $kb_module_version = "Knowledge Base v. 2.0"; ! $kb_module_author = "Haplo"; ! $kb_module_orig_author = "wGEric"; ! } ! else ! { ! $mxbb_footer_addup[] = 'mxBB Knowledge Base Module'; ! } ! ! Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_article.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** kb_article.php 26 Mar 2005 22:52:36 -0000 1.14 --- kb_article.php 28 Mar 2005 20:22:47 -0000 1.15 *************** *** 41,45 **** if ( count($row) > 0 ) { ! $article_title = stripslashes( $row['article_title'] ); // --- 41,45 ---- if ( count($row) > 0 ) { ! $article_title = $row['article_title'] ; // *************** *** 104,108 **** $article = trim( $art_pages[$page_num] ); $article = str_replace( '[toc]', '', $article ); ! $kb_art_description = stripslashes( $row['article_description'] ); $article = article_formatting( $article ); --- 104,109 ---- $article = trim( $art_pages[$page_num] ); $article = str_replace( '[toc]', '', $article ); ! ! $kb_art_description = $row['article_description'] ; $article = article_formatting( $article ); *************** *** 302,306 **** // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " --- 303,307 ---- // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_editor_id'], $userdata['article_editor'], $userdata['article_editor_sig'], $kb_comment['topic_id'], $kb_update_message ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " *************** *** 416,419 **** --- 417,421 ---- // article pages table of contents + $kb_custom_field->display_data( $article_id ); if ( count( $art_pages ) > 1 ) Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** functions_kb.php 26 Mar 2005 22:52:35 -0000 1.19 --- functions_kb.php 28 Mar 2005 20:22:46 -0000 1.20 *************** *** 258,262 **** { $i++; ! $article_description = stripslashes( $article['article_description'] ); $article_cat = $article['article_category_id']; $article_approved = $article['approved']; --- 258,262 ---- { $i++; ! $article_description = $article['article_description'] ; $article_cat = $article['article_category_id']; $article_approved = $article['approved']; *************** *** 283,287 **** $views = $article['views']; ! $article_title = stripslashes( $article['article_title'] ); $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id" ) ); $article = '<a href="' . $temp_url . '" class="gen">' . $article_title . '</a>'; --- 283,287 ---- $views = $article['views']; ! $article_title = $article['article_title']; $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id" ) ); $article = '<a href="' . $temp_url . '" class="gen">' . $article_title . '</a>'; *************** *** 479,486 **** $category_name = $category['category_name']; if ( $approved_yesno == 2 ) { // approve ! $temp_url = append_sid( PORTAL_URL . $module_root_path . "admin/admin_kb_art.$phpEx?mode=approve&a=$article_id" ); $approve = '<a href="' . $temp_url . '"><img src="' . PORTAL_URL . $images['icon_approve'] . '" border="0" alt="' . $lang['Approve'] . '"></a>'; } --- 479,488 ---- $category_name = $category['category_name']; + $kb_path_tmp = MXBB_MODULE ? PORTAL_URL . $module_root_path : $phpbb_root_path; + if ( $approved_yesno == 2 ) { // approve ! $temp_url = append_sid( $kb_path_tmp . "admin/admin_kb_art.$phpEx?mode=approve&a=$article_id" ); $approve = '<a href="' . $temp_url . '"><img src="' . PORTAL_URL . $images['icon_approve'] . '" border="0" alt="' . $lang['Approve'] . '"></a>'; } *************** *** 488,495 **** { // unapprove ! $temp_url = append_sid( PORTAL_URL . $module_root_path . "admin/admin_kb_art.$phpEx?mode=unapprove&a=$article_id" ); $unapprove = '<a href="' . $temp_url . '"><img src="' . PORTAL_URL . $images['icon_unapprove'] . '" border="0" alt="' . $lang['Un_approve'] . '"></a>'; } ! $temp_url = append_sid( PORTAL_URL . $module_root_path . "admin/admin_kb_art.$phpEx?mode=delete&a=$article_id" ); $delete = '<a href="' . $temp_url . '"><img src="' . $phpbb_root_path . $images['icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; $approve_pm_view .= "<tr><td>$category_name</td><td>$approve ' ' $delete ' ' $unapprove</td></tr>"; // the action table --- 490,497 ---- { // unapprove ! $temp_url = append_sid( $kb_path_tmp . "admin/admin_kb_art.$phpEx?mode=unapprove&a=$article_id" ); $unapprove = '<a href="' . $temp_url . '"><img src="' . PORTAL_URL . $images['icon_unapprove'] . '" border="0" alt="' . $lang['Un_approve'] . '"></a>'; } ! $temp_url = append_sid( $kb_path_tmp . "admin/admin_kb_art.$phpEx?mode=delete&a=$article_id" ); $delete = '<a href="' . $temp_url . '"><img src="' . $phpbb_root_path . $images['icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; $approve_pm_view .= "<tr><td>$category_name</td><td>$approve ' ' $delete ' ' $unapprove</td></tr>"; // the action table *************** *** 503,507 **** $new_article .= $articlebody; // the extended Pm body $new_article .= '<p>' . $approve_pm_view; // the extended Pm body ! $new_article .= '<br><a href=' . PORTAL_URL . $module_root_path . 'admin/admin_kb_art.' . $phpEx . '>KB Admin page</a><br>'; // the extended Pm body $new_article = addslashes( $new_article ); --- 505,509 ---- $new_article .= $articlebody; // the extended Pm body $new_article .= '<p>' . $approve_pm_view; // the extended Pm body ! $new_article .= '<br><a href=' . $kb_path_tmp . 'admin/admin_kb_art.' . $phpEx . '>KB Admin page</a><br>'; // the extended Pm body $new_article = addslashes( $new_article ); *************** *** 1272,1280 **** message_die( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_subject = '$subject', bbcode_uid = '$bbcode_uid', ! post_text = '$message' WHERE post_id = '$orig_post_id'"; --- 1274,1284 ---- message_die( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } + + $message_tmp = $message . '\n\n' . $message_update_text; $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_subject = '$subject', bbcode_uid = '$bbcode_uid', ! post_text = '$message_tmp' WHERE post_id = '$orig_post_id'"; *************** *** 1297,1300 **** --- 1301,1310 ---- global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; + if ( !MXBB_MODULE ) + { + $mxurl = $phpbb_root_path . 'kb.' . $phpEx . ( $args == '' ? '' : '?' . $args ); + return $mxurl; + } + if ( $force_standalone_mode || !$is_block ) { *************** *** 1323,1326 **** --- 1333,1342 ---- global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; + if ( !MXBB_MODULE ) + { + $mxurl = $phpbb_root_path . 'kb_search.' . $phpEx . ( $args == '' ? '' : '?' . $args ); + return $mxurl; + } + if ( $force_standalone_mode || !$is_block ) { *************** *** 1680,1684 **** global $db; ! $kb_author_data = get_kb_author( $kb_comment['article_author_id'], true ); $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $row['article_category_id'] . "'"; --- 1696,1700 ---- global $db; ! $kb_author_data = get_kb_author( $row['article_author_id'], true ); $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $row['article_category_id'] . "'"; *************** *** 1718,1722 **** function kb_compose_comment( $kb_comment ) { ! global $lang, $kb_comment, $phpEx; $search = array ( "'&(quot|#34);'i", // Replace HTML entities --- 1734,1738 ---- function kb_compose_comment( $kb_comment ) { ! global $lang, $kb_comment, $phpEx, $kb_custom_field; $search = array ( "'&(quot|#34);'i", // Replace HTML entities *************** *** 1737,1746 **** $message = "[b]" . $lang['Article_title'] . ":[/b] " . preg_replace( $search, $replace, $kb_comment['article_title'] ) . "\n"; $message .= "[b]" . $lang['Author'] . ":[/b] " . $kb_comment['article_author'] . "\n"; ! $message .= "[b]" . $lang['Article_description'] . ":[/b] " . preg_replace( $search, $replace, $kb_comment['article_desc'] ) . "\n\n"; $message .= "[b]" . $lang['Category'] . ":[/b] " . $kb_comment['category_name'] . "\n"; ! $message .= "[b]" . $lang['Article_type'] . ":[/b] " . $kb_comment['article_type'] . "\n\n"; - $message .= "[b][url=" . $temp_url . "]" . $lang['Read_full_article'] . "[/url][/b]"; $message_update_text = "[i]" . $lang['Edited_Article_info'] . $kb_comment['article_editor'] . "[/i]" . "\n\n"; --- 1753,1766 ---- $message = "[b]" . $lang['Article_title'] . ":[/b] " . preg_replace( $search, $replace, $kb_comment['article_title'] ) . "\n"; $message .= "[b]" . $lang['Author'] . ":[/b] " . $kb_comment['article_author'] . "\n"; ! $message .= "[b]" . $lang['Article_description'] . ":[/b] [i]" . preg_replace( $search, $replace, $kb_comment['article_desc'] ) . "[/i]\n\n"; $message .= "[b]" . $lang['Category'] . ":[/b] " . $kb_comment['category_name'] . "\n"; ! $message .= "[b]" . $lang['Article_type'] . ":[/b] " . $kb_comment['article_type'] . "\n"; ! ! $message .= $kb_custom_field->add_comment( $kb_comment['article_id'] ); ! ! $message .= "\n\n[b][url=" . $temp_url . "]" . $lang['Read_full_article'] . "[/url][/b]"; ! $message_update_text = "[i]" . $lang['Edited_Article_info'] . $kb_comment['article_editor'] . "[/i]" . "\n\n"; *************** *** 1815,1818 **** --- 1835,1843 ---- global $news_type_select_data, $kb_type_select_data, $kb_config; + if ( !MXBB_MODULE ) + { + return true; + } + $tmp_kb = $kb_type_select_data[$cat_id]['forum_news'] == 1; $tmp_news = true; *************** *** 1829,1832 **** --- 1854,1863 ---- { global $news_type_select_data, $kb_config; + + if ( !MXBB_MODULE ) + { + return true; + } + $item_types_array = kb_get_types(); $validated_types = array(); --- NEW FILE: functions_kb_field.php --- <?php /** * functions_field.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: functions_kb_field.php,v 1.1 2005/03/28 20:22:47 jonohlsson 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. */ // PLEASE DON'T TAKE THIS CLASS AND USE IT, I WILL KEEP MY EYES ON IT // I KNOW SOME PEOPLE MAY TAKE IT AND USE IT TO DO CUSTOM FIELD FOR PROFILE // BUT I AM PLANNING TO MAKE THIS FEATURE VERY SOON /* - orig if ( !defined('IN_PHPBB') ) { die("Hacking attempt"); } */ // MX if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } class kb_custom_field { var $field_rowset = array(); var $field_data_rowset = array(); // =================================================== // prepare data // =================================================== function init() { global $db; $sql = "SELECT * FROM " . KB_CUSTOM_TABLE . " ORDER BY field_order ASC"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt Query Custom field', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $this->field_rowset[$row['custom_id']] = $row; } unset( $row ); $db->sql_freeresult( $result ); $sql = "SELECT * FROM " . KB_CUSTOM_DATA_TABLE; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt Query Custom field', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $this->field_data_rowset[$row['customdata_file']][$row['customdata_custom']] = $row; } unset( $row ); $db->sql_freeresult( $result ); } // =================================================== // check if there is a data in the database // =================================================== function field_data_exist() { if ( !empty( $this->field_data_rowset ) ) { return true; } return false; } function field_exist() { if ( !empty( $this->field_rowset ) ) { return true; } return false; } // =================================================== // display data in the comment // =================================================== function add_comment( $file_id ) { global $template; if ( $this->field_data_exist() ) { if ( isset( $this->field_data_rowset[$file_id] ) ) { $message = ''; foreach( $this->field_data_rowset[$file_id] as $field_id => $data ) { if ( !empty( $data['data'] ) ) { switch ( $this->field_rowset[$field_id]['field_type'] ) { case INPUT: case TEXTAREA: case RADIO: case SELECT: $field_data = $data['data']; break; case SELECT_MULTIPLE: case CHECKBOX: $field_data = @implode( ', ', unserialize( $data['data'] ) ); break; } $message .= "\n" . "[b]" . $this->field_rowset[$field_id]['custom_name'] . ":[/b] " . $field_data . "\n"; } else { global $db; $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete custom data', '', __LINE__, __FILE__, $sql ); } } } return $message; } else { return false; } } else { return false; } } // =================================================== // display data in the file page // =================================================== function display_data( $file_id ) { global $template; if ( $this->field_data_exist() ) { if ( isset( $this->field_data_rowset[$file_id] ) ) { foreach( $this->field_data_rowset[$file_id] as $field_id => $data ) { if ( !empty( $data['data'] ) ) { switch ( $this->field_rowset[$field_id]['field_type'] ) { case INPUT: case TEXTAREA: case RADIO: case SELECT: $field_data = $data['data']; break; case SELECT_MULTIPLE: case CHECKBOX: $field_data = @implode( ', ', unserialize( $data['data'] ) ); break; } $template->assign_block_vars( 'custom_field', array( 'CUSTOM_NAME' => $this->field_rowset[$field_id]['custom_name'], 'DATA' => $field_data ) ); } else { global $db; $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete custom data', '', __LINE__, __FILE__, $sql ); } } } } else { return false; } } else { return false; } } // =================================================== // display custom field and data in the add/edit page // =================================================== function display_edit( $file_id = false ) { global $template; $return = false; if ( $this->field_exist() ) { foreach( $this->field_rowset as $field_id => $field_data ) { switch ( $field_data['field_type'] ) { case INPUT: $this->display_edit_input( $file_id, $field_id, $field_data ); break; case TEXTAREA: $this->display_edit_textarea( $file_id, $field_id, $field_data ); break; case RADIO: $this->display_edit_radio( $file_id, $field_id, $field_data ); break; case SELECT: $this->display_edit_select( $file_id, $field_id, $field_data ); break; case SELECT_MULTIPLE: $this->display_edit_select_multiple( $file_id, $field_id, $field_data ); break; case CHECKBOX: $this->display_edit_checkbox( $file_id, $field_id, $field_data ); break; } $return = true; } } return $return; } function display_edit_input( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'input', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'], 'FIELD_VALUE' => ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : '' ) ); } function display_edit_textarea( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'textarea', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'], 'FIELD_VALUE' => ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : '' ) ); } function display_edit_radio( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'radio', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : array(); $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $template->assign_block_vars( 'radio.row', array( 'FIELD_VALUE' => $value, 'FIELD_SELECTED' => ( $data == $value ) ? ' checked="checked"' : '' ) ); } } } function display_edit_select( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'select', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $template->assign_block_vars( 'select.row', array( 'FIELD_VALUE' => $value, 'FIELD_SELECTED' => ( $data == $value ) ? ' selected="selected"' : '' ) ); } } } function display_edit_select_multiple( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'select_multiple', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $selected = ''; foreach( $data as $field_value ) { if ( $field_value == $value ) { $selected = ' selected="selected"'; break; } } $template->assign_block_vars( 'select_multiple.row', array( 'FIELD_VALUE' => $value, 'FIELD_SELECTED' => $selected ) ); } } } function display_edit_checkbox( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'checkbox', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $checked = ''; foreach( $data as $field_value ) { if ( $field_value == $value ) { $checked = ' checked'; break; } } $template->assign_block_vars( 'checkbox.row', array( 'FIELD_VALUE' => $value, 'FIELD_CHECKED' => $checked ) ); } } } function update_add_field( $field_type, $field_id = false ) { global $db, $db, $_POST, $lang; $field_name = ( isset( $_POST['field_name'] ) ) ? htmlspecialchars( $_POST['field_name'] ) : ''; $field_desc = ( isset( $_POST['field_desc'] ) ) ? htmlspecialchars( $_POST['field_desc'] ) : ''; $regex = ( isset( $_POST['regex'] ) ) ? $_POST['regex'] : ''; $data = ( isset( $_POST['data'] ) ) ? $_POST['data'] : ''; $field_order = ( isset( $_POST['field_order'] ) ) ? $_POST['field_order'] : ''; if ( $field_id ) { $field_order = ( isset( $_POST['field_order'] ) ) ? intval( $_POST['field_order'] ) : ''; } if ( !empty( $data ) ) { $data = explode( "\n", htmlspecialchars( trim( $data ) ) ); foreach( $data as $key => $value ) { $data[$key] = trim( $value ); } $data = addslashes( serialize( $data ) ); } if ( empty( $field_name ) ) { mx_message_die( GENERAL_ERROR, $lang['Missing_field'] ); } if ( ( ( $field_type != INPUT && $field_type != TEXTAREA ) && empty( $data ) ) ) { mx_message_die( GENERAL_ERROR, $lang['Missing_field'] ); } if ( !$field_id ) { $sql = "INSERT INTO " . KB_CUSTOM_TABLE . " (custom_name, custom_description, data, regex, field_type) VALUES('" . $field_name . "', '" . $field_desc . "', '" . $data . "', '" . $regex . "', '" . $field_type . "')"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not add the new fields', '', __LINE__, __FILE__, $sql ); } $field_id = $db->sql_nextid(); $sql = "UPDATE " . KB_CUSTOM_TABLE . " SET field_order = '$field_id' WHERE custom_id = $field_id"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not set the order for the giving field', '', __LINE__, __FILE__, $sql ); } } else { $sql = "UPDATE " . KB_CUSTOM_TABLE . " SET custom_name = '$field_name', custom_description = '$field_desc', data = '$data', regex = '$regex', field_order='$field_order' WHERE custom_id = $field_id"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not update information for the giving field', '', __LINE__, __FILE__, $sql ); } } } function delete_field( $field_id ) { global $db; $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_custom = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete custom data', '', __LINE__, __FILE__, $sql ); } $sql = "DELETE FROM " . KB_CUSTOM_TABLE . " WHERE custom_id = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete the selected field', '', __LINE__, __FILE__, $sql ); } } function get_field_data( $field_id ) { $return_array = $this->field_rowset[$field_id]; $return_array['data'] = implode( "\n", unserialize( stripslashes( $return_array['data'] ) ) ); return $return_array; } // =================================================== // file data in custom field operations // =================================================== function file_update_data( $file_id ) { global $_POST, $db; $field = ( isset( $_POST['field'] ) ) ? $_POST['field'] : ''; if ( !empty( $field ) ) { foreach( $field as $field_id => $field_data ) { if ( !empty( $this->field_rowset[$field_id]['regex'] ) ) { if ( !preg_match( '#' . $this->field_rowset[$field_id]['regex'] . '#siU', $field_data ) ) { $field_data = ''; } } switch ( $this->field_rowset[$field_id]['field_type'] ) { case INPUT: case TEXTAREA: case RADIO: case SELECT: $data = htmlspecialchars( $field_data ); break; case SELECT_MULTIPLE: case CHECKBOX: $data = addslashes( serialize( $field_data ) ); break; } $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; if ( !$db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete data from custom data table', '', __LINE__, __FILE__, $sql ); } if ( !empty( $data ) ) { $sql = "INSERT INTO " . KB_CUSTOM_DATA_TABLE . " (customdata_file, customdata_custom, data) VALUES('$file_id', '$field_id', '$data')"; if ( !$db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not add additional data', '', __LINE__, __FILE__, $sql ); } } } } } } ?> Index: kb_post.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_post.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_post.php 26 Mar 2005 22:52:36 -0000 1.1 --- kb_post.php 28 Mar 2005 20:22:47 -0000 1.2 *************** *** 131,135 **** // Get old data first ! $sql = "SELECT article_category_id, approved, topic_id FROM " . KB_ARTICLES_TABLE . " WHERE article_id = $article_id"; --- 131,135 ---- // Get old data first ! $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = $article_id"; *************** *** 195,199 **** } ! mx_remove_search_words( $article_id, 'kb' ); break; --- 195,199 ---- } ! mx_remove_search_post( $article_id, 'kb' ); break; *************** *** 225,228 **** --- 225,240 ---- } + // Get old data first + $sql = "SELECT * + FROM " . KB_ARTICLES_TABLE . " + WHERE article_date = $date"; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); + } + $row = $db->sql_fetchrow( $result ); + $article_id = $row['article_id']; + break; } *************** *** 249,253 **** // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " --- 261,265 ---- // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_editor_id'], $kb_comment['article_editor'], $kb_comment['article_editor_sig'], $kb_comment['topic_id'], $kb_update_message ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " *************** *** 260,263 **** --- 272,277 ---- } + $kb_custom_field->file_update_data( $article_id ); + if ( $approve == 1 ) { *************** *** 442,445 **** --- 456,463 ---- } + if ( $bbcode_on ) + { + $template->assign_block_vars( "switch_bbcodes", array() ); + } // load header include ( $module_root_path . "includes/kb_header." . $phpEx ); *************** *** 454,457 **** --- 472,483 ---- $kb_action_url = $kb_post_mode == 'add' ? this_kb_mxurl( 'mode=add' ) : this_kb_mxurl( 'mode=edit' ); + $custom_data = $kb_post_mode == 'add' ? $kb_custom_field->display_edit() : $kb_custom_field->display_edit( $article_id ); + + if ( $custom_data ) + { + $template->assign_block_vars( 'custom_data_fields', array( + 'L_ADDTIONAL_FIELD' => $lang['Addtional_field'] + ) ); + } $template->assign_vars( array( *************** *** 472,476 **** 'L_SUBMIT' => $lang['Submit'], 'L_PREVIEW' => $lang['Preview'], ! 'L_SELECT' => $lang['Select'], 'L_NAME' => $lang['Username'], --- 498,502 ---- 'L_SUBMIT' => $lang['Submit'], 'L_PREVIEW' => $lang['Preview'], ! 'L_SELECT_TYPE' => $lang['Select'], 'L_NAME' => $lang['Username'], *************** *** 540,544 **** 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], ! 'L_STYLES_TIP' => $lang['Styles_tip'] ) ); --- 566,571 ---- 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], ! 'L_STYLES_TIP' => $lang['Styles_tip'] ! ) ); *************** *** 548,551 **** 'CAT_LIST' => get_kb_cat_list( $category_id, 1, true ) ) ); - ?> \ No newline at end of file --- 575,577 ---- Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_moderator.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** kb_moderator.php 26 Mar 2005 22:52:36 -0000 1.5 --- kb_moderator.php 28 Mar 2005 20:22:47 -0000 1.6 *************** *** 28,34 **** $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval ( $HTTP_GET_VARS['cat']) : intval ( $HTTP_POST_VARS['cat'] ); - $page_id = ( isset( $HTTP_GET_VARS['page'] ) ) ? intval ( $HTTP_GET_VARS['page']) : intval ( $HTTP_POST_VARS['page'] ); - $ref_stats = ( isset( $HTTP_GET_VARS['ref'] ) ) ? true : 0; --- 28,32 ---- *************** *** 41,45 **** // ! if ( !$kb_is_auth['auth_mod'] ) { $message = $lang['No_add'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); --- 39,43 ---- // ! if ( !($kb_is_auth['auth_mod'] && $userdata['session_logged_in']) ) { $message = $lang['No_add'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); *************** *** 103,107 **** // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $topic_sql = ", topic_id = " . $topic_data['topic_id']; --- 101,105 ---- // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_editor_id'], $kb_comment['article_editor'], $kb_comment['article_editor_sig'], $kb_comment['topic_id'], $kb_update_message ); $topic_sql = ", topic_id = " . $topic_data['topic_id']; *************** *** 122,126 **** mx_add_search_words( 'single', $article_id, stripslashes( $row['article_body'] ), stripslashes( $row['article_title'] ), 'kb' ); ! $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx?page=$page_id&mode=cat&cat=$category_id" ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); --- 120,124 ---- mx_add_search_words( 'single', $article_id, stripslashes( $row['article_body'] ), stripslashes( $row['article_title'] ), 'kb' ); ! $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id" ) ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); *************** *** 152,158 **** update_kb_number( $article_category_id, '- 1' ); ! mx_remove_search_words( $article_id, 'kb' ); ! $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx?page=$page_id&mode=cat&cat=$category_id" ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); --- 150,156 ---- update_kb_number( $article_category_id, '- 1' ); ! mx_remove_search_post( $article_id, 'kb' ); ! $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id") ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); *************** *** 312,318 **** } ! mx_remove_search_words( $article_id, 'kb' ); ! $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx?page=$page_id&mode=cat&cat=$category_id" ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); --- 310,316 ---- } ! mx_remove_search_post( $article_id, 'kb' ); ! $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl("page=$page_id&mode=cat&cat=$category_id") ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); |