|
From: Jon O. <jon...@us...> - 2005-05-01 16:39:52
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv651/modules/mx_kb/includes Modified Files: functions_kb.php functions_kb_field.php kb_constants.php kb_moderator.php kb_post.php kb_rate.php Log Message: additional fixes Index: kb_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_constants.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** kb_constants.php 12 Apr 2005 19:30:55 -0000 1.27 --- kb_constants.php 1 May 2005 16:39:22 -0000 1.28 *************** *** 1,125 **** ! <?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 : ! * ------------------------------------------------------------------------- ! * ! * $Id$ ! */ ! ! /** ! * 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. ! */ ! ! 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 ! // ------------------------------------------------------------------------- ! define( 'PAGE_KB', -500 ); ! define( 'KB_ARTICLES_TABLE', $mx_table_prefix . 'kb_articles' ); ! define( 'KB_CATEGORIES_TABLE', $mx_table_prefix . 'kb_categories' ); ! define( 'KB_CONFIG_TABLE', $mx_table_prefix . 'kb_config' ); ! define( 'KB_TYPES_TABLE', $mx_table_prefix . 'kb_types' ); ! define( 'KB_WORD_TABLE', $mx_table_prefix . 'kb_wordlist' ); ! define( 'KB_SEARCH_TABLE', $mx_table_prefix . 'kb_results' ); ! define( 'KB_MATCH_TABLE', $mx_table_prefix . 'kb_wordmatch' ); ! 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_main.' . $phpEx ) ) ! { ! include( $module_root_path . 'language/lang_english/lang_main.' . $phpEx ); ! $link_language = 'lang_english'; ! } ! else ! { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); ! $link_language = 'lang_' . $board_config['default_lang']; ! } ! // ********************************************************************** ! // Read theme definition ! // ********************************************************************** ! if ( file_exists( $module_root_path . "templates/" . $theme['template_name'] . "/images" ) ) ! { ! // ---------- ! $current_template_images = $module_root_path . "templates/" . $theme['template_name'] . "/images" ; ! // ---------- ! } ! else ! { ! // ---------- ! $current_template_images = $module_root_path . "templates/" . "subSilver" . "/images" ; ! // ---------- ! } ! // ********************************************************************** ! // Read image language in theme definition ! // ********************************************************************** ! if ( file_exists( "$current_template_images/$link_language/kb.gif" ) ) ! { ! // ---------- ! $images['icon_approve'] = "$current_template_images/icon_approve.gif"; ! $images['icon_unapprove'] = "$current_template_images/icon_unapprove.gif"; ! $images['kb_title'] = "$current_template_images/$link_language/kb.gif"; ! // ---------- ! } ! else ! { ! // ---------- ! $images['icon_approve'] = "$current_template_images/icon_approve.gif"; ! $images['icon_unapprove'] = "$current_template_images/icon_unapprove.gif"; ! $images['kb_title'] = "$current_template_images/lang_english/kb.gif"; ! // ---------- ! } ! ! if ( !MXBB_MODULE || MXBB_27x ) ! { ! $kb_module_version = "Knowledge Base v. 2.0.x"; ! $kb_module_author = "Haplo"; ! $kb_module_orig_author = "wGEric"; ! } ! else ! { ! $mxbb_footer_addup[] = 'mxBB Knowledge Base Module'; ! } ! ! ! ! ?> \ No newline at end of file --- 1,125 ---- ! <?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 : ! * ------------------------------------------------------------------------- ! * ! * $Id$ ! */ ! ! /** ! * 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. ! */ ! ! 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 ! // ------------------------------------------------------------------------- ! define( 'PAGE_KB', -500 ); ! define( 'KB_ARTICLES_TABLE', $mx_table_prefix . 'kb_articles' ); ! define( 'KB_CATEGORIES_TABLE', $mx_table_prefix . 'kb_categories' ); ! define( 'KB_CONFIG_TABLE', $mx_table_prefix . 'kb_config' ); ! define( 'KB_TYPES_TABLE', $mx_table_prefix . 'kb_types' ); ! define( 'KB_WORD_TABLE', $mx_table_prefix . 'kb_wordlist' ); ! define( 'KB_SEARCH_TABLE', $mx_table_prefix . 'kb_results' ); ! define( 'KB_MATCH_TABLE', $mx_table_prefix . 'kb_wordmatch' ); ! 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']; ! } ! // ********************************************************************** ! // Read theme definition ! // ********************************************************************** ! if ( file_exists( $module_root_path . "templates/" . $theme['template_name'] . "/images" ) ) ! { ! // ---------- ! $current_template_images = $module_root_path . "templates/" . $theme['template_name'] . "/images" ; ! // ---------- ! } ! else ! { ! // ---------- ! $current_template_images = $module_root_path . "templates/" . "subSilver" . "/images" ; ! // ---------- ! } ! // ********************************************************************** ! // Read image language in theme definition ! // ********************************************************************** ! if ( file_exists( "$current_template_images/$link_language/kb.gif" ) ) ! { ! // ---------- ! $images['icon_approve'] = "$current_template_images/icon_approve.gif"; ! $images['icon_unapprove'] = "$current_template_images/icon_unapprove.gif"; ! $images['kb_title'] = "$current_template_images/$link_language/kb.gif"; ! // ---------- ! } ! else ! { ! // ---------- ! $images['icon_approve'] = "$current_template_images/icon_approve.gif"; ! $images['icon_unapprove'] = "$current_template_images/icon_unapprove.gif"; ! $images['kb_title'] = "$current_template_images/lang_english/kb.gif"; ! // ---------- ! } ! ! if ( !MXBB_MODULE || MXBB_27x ) ! { ! $kb_module_version = "Knowledge Base MOD v. 2.0.x"; ! $kb_module_author = "Haplo/Jon"; ! $kb_module_orig_author = "wGEric"; ! } ! else ! { ! $mxbb_footer_addup[] = 'mxBB Knowledge Base Module'; ! } ! ! ! ! ?> \ No newline at end of file Index: kb_rate.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_rate.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** kb_rate.php 2 Apr 2005 20:37:03 -0000 1.10 --- kb_rate.php 1 May 2005 16:39:22 -0000 1.11 *************** *** 205,209 **** // Send variables to template (the associated *.tpl file) ! $template->assign_vars( array( 'S_RATE_ACTION' => append_sid( this_kb_mxurl( "mode=rate&cat=$category_id&k=$article_id" ) ), 'L_RATE' => $lang['Rate'], 'L_RERROR' => $lang['Rerror'], --- 205,209 ---- // Send variables to template (the associated *.tpl file) ! $template->assign_vars( array( 'S_RATE_ACTION' => append_sid( this_kb_mxurl( ) ), 'L_RATE' => $lang['Rate'], 'L_RERROR' => $lang['Rerror'], Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** functions_kb.php 21 Apr 2005 19:36:17 -0000 1.32 --- functions_kb.php 1 May 2005 16:39:22 -0000 1.33 *************** *** 522,539 **** // update number of articles in a category ! function update_kb_number( $id, $change ) { ! global $db; ! // update number of articles in category if article has been approve ! $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $id . "'"; if ( !( $results = $db->sql_query( $sql ) ) ) { message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } if ( $kb_cat = $db->sql_fetchrow( $results ) ) { ! $new_number = $kb_cat['number_articles'] . $change; } ! $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET number_articles = " . $new_number . " WHERE category_id = '" . $id . "'"; if ( !( $result = $db->sql_query( $sql ) ) ) --- 522,569 ---- // update number of articles in a category ! function update_kb_number( $category_id, $change = 0 ) { ! global $db, $kb_config; ! ! // Get number of articles in this category ! $sql = "SELECT count(article_id) AS total ! FROM " . KB_ARTICLES_TABLE . " ! WHERE "; ! ! // newssuite addon ! if ( $kb_config['news_operate_mode'] ) ! { ! $kb_types_list = ns_auth_item( $category_id ); ! $sql .= " article_type IN " . $kb_types_list . ' AND'; ! } ! ! $sql .= " article_category_id = '$category_id' AND approved = '1'"; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Error getting total articles', '', __LINE__, __FILE__, $sql ); ! } ! ! if ( $total = $db->sql_fetchrow( $result ) ) ! { ! // Define number of articles in this cateogry + subcats ! $total_articles = $total['total'] + $change; ! } ! ! // Get some category data ! $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $category_id . "'"; ! if ( !( $results = $db->sql_query( $sql ) ) ) { message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } + if ( $kb_cat = $db->sql_fetchrow( $results ) ) { ! $parent_id = $kb_cat['parent']; } ! ! // update number of articles in category if article has been approve ! $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET number_articles = " . $total_articles . " WHERE category_id = '" . $category_id . "'"; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 542,548 **** } ! if ( $kb_cat['parent'] != '0' ) { ! update_kb_number( $kb_cat['parent'], $change ); } --- 572,578 ---- } ! if ( $parent_id != '0' ) { ! update_kb_number( $parent_id, $total_articles ); } *************** *** 1331,1335 **** function kb_insert_post( ! $message, $subject, $forum_id, --- 1361,1365 ---- function kb_insert_post( ! $kb_message, $subject, $forum_id, *************** *** 1362,1367 **** // parse the message and the subject (belt & braces :) ! $message = addslashes(unprepare_message($message)); ! $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); $message_update_text = addslashes(unprepare_message($message_update_text)); $message_update_text = prepare_message(trim($message_update_text), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); --- 1392,1397 ---- // parse the message and the subject (belt & braces :) ! $kb_message = addslashes(unprepare_message($kb_message)); ! $kb_message = prepare_message(trim($kb_message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); $message_update_text = addslashes(unprepare_message($message_update_text)); $message_update_text = prepare_message(trim($message_update_text), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); *************** *** 1433,1441 **** case '.0.2' : case '.0.3' : ! add_search_words( $post_id, stripslashes( $message ), stripslashes( $subject ) ); break; default : ! add_search_words( '', $post_id, stripslashes( $message ), stripslashes( $subject ) ); break; } --- 1463,1471 ---- case '.0.2' : case '.0.3' : ! add_search_words( $post_id, stripslashes( $kb_message ), stripslashes( $subject ) ); break; default : ! add_search_words( '', $post_id, stripslashes( $kb_message ), stripslashes( $subject ) ); break; } *************** *** 1458,1464 **** mx_message_die( GENERAL_ERROR, "Could not obtain orig_post_id data", '', __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); ! $orig_post_id = $row[0]; $sql = "UPDATE " . TOPICS_TABLE . " SET --- 1488,1494 ---- mx_message_die( GENERAL_ERROR, "Could not obtain orig_post_id data", '', __LINE__, __FILE__, $sql ); } ! $row_tmp = $db->sql_fetchrow( $result ); ! $orig_post_id = $row_tmp['topic_first_post_id']; $sql = "UPDATE " . TOPICS_TABLE . " SET *************** *** 1471,1475 **** } ! $message_tmp = $mode == 'newtopic' ? $message : $message . '\n\n' . $message_update_text; $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET --- 1501,1505 ---- } ! $message_tmp = ( ( $mode == 'newtopic' ) ? $kb_message : $kb_message . '\n\n' . $message_update_text ); $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET Index: functions_kb_field.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb_field.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions_kb_field.php 11 Apr 2005 20:07:57 -0000 1.4 --- functions_kb_field.php 1 May 2005 16:39:22 -0000 1.5 *************** *** 252,260 **** 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'] : '' ) ); } --- 252,262 ---- function display_edit_input( $file_id, $field_id, $field_data ) { ! global $template, $_POST; ! $field_value_temp = (!empty( $this->field_data_rowset[$file_id][$field_id]['data'] )) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; ! $field_value = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $field_value_temp ; $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' => $field_value ) ); } *************** *** 263,270 **** { 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'] : '' ) ); } --- 265,274 ---- { global $template; + $field_value_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; + $field_value = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $field_value_temp ; $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' => $field_value ) ); } *************** *** 278,282 **** ); ! $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(); --- 282,287 ---- ); ! $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : array(); ! $data = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $data_temp ; $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); *************** *** 300,304 **** ); ! $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(); --- 305,310 ---- ); ! $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; ! $data = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $data_temp ; $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); *************** *** 322,326 **** ); ! $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(); --- 328,333 ---- ); ! $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); ! $data = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $data_temp ; $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); *************** *** 353,357 **** ); ! $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(); --- 360,365 ---- ); ! $data_temp = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); ! $data = !empty( $_POST['field'][$field_data['custom_id']] ) ? $_POST['field'][$field_data['custom_id']] : $data_temp ; $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); Index: kb_post.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_post.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** kb_post.php 9 Apr 2005 21:41:28 -0000 1.9 --- kb_post.php 1 May 2005 16:39:22 -0000 1.10 *************** *** 175,197 **** { $approve = 1; - - if ( $cat_switch ) - { - update_kb_number( $old_category_id, ( $old_approve == 1 ? '- 1' : '0' ) ); - update_kb_number( $category_id, '+ 1' ); - } - else - { - update_kb_number( $category_id, '+ 1' ); - } } else { $approve = 2; - - if ( $cat_switch ) - { - update_kb_number( $old_category_id, ( $old_approve == 1 ? '- 1' : '0' ) ); - } } --- 175,182 ---- *************** *** 211,215 **** mx_message_die( GENERAL_ERROR, "Could not edit article", '', __LINE__, __FILE__, $sql ); } ! mx_remove_search_post( $article_id, 'kb' ); --- 196,206 ---- mx_message_die( GENERAL_ERROR, "Could not edit article", '', __LINE__, __FILE__, $sql ); } ! ! if ( $cat_switch ) ! { ! update_kb_number( $old_category_id ); ! } ! update_kb_number( $category_id ); ! mx_remove_search_post( $article_id, 'kb' ); *************** *** 238,242 **** { $approve = 1; - update_kb_number( $category_id, '+ 1' ); } else --- 229,232 ---- *************** *** 253,256 **** --- 243,248 ---- } + update_kb_number( $category_id ); + // Update kb_row $sql = "SELECT * *************** *** 302,306 **** mx_add_search_words( 'single', $article_id, stripslashes( $article_text ), stripslashes( $article_title ), 'kb' ); - // $message = $lang['Article_submitted'] . '<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>' ); $message = $lang['Article_submitted'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf($lang['Click_return_article'], '<a href="' . append_sid(this_kb_mxurl("mode=article&k=" . $article_id)). '">', '</a>') . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); } --- 294,297 ---- Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_moderator.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** kb_moderator.php 9 Apr 2005 21:41:28 -0000 1.10 --- kb_moderator.php 1 May 2005 16:39:22 -0000 1.11 *************** *** 118,122 **** $article_category_id = $kb_row['article_category_id']; ! update_kb_number( $article_category_id, '+ 1' ); kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'], 'approved' ); mx_add_search_words( 'single', $article_id, stripslashes( $kb_row['article_body'] ), stripslashes( $kb_row['article_title'] ), 'kb' ); --- 118,122 ---- $article_category_id = $kb_row['article_category_id']; ! update_kb_number( $article_category_id ); kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'], 'approved' ); mx_add_search_words( 'single', $article_id, stripslashes( $kb_row['article_body'] ), stripslashes( $kb_row['article_title'] ), 'kb' ); *************** *** 151,155 **** } ! update_kb_number( $article_category_id, '- 1' ); mx_remove_search_post( $article_id, 'kb' ); --- 151,155 ---- } ! update_kb_number( $article_category_id ); mx_remove_search_post( $article_id, 'kb' ); *************** *** 179,183 **** if ( $article['approved'] == 1 ) { ! update_kb_number( $article_category_id, '- 1' ); } --- 179,183 ---- if ( $article['approved'] == 1 ) { ! update_kb_number( $article_category_id ); } |