|
From: Jon O. <jon...@us...> - 2005-04-21 19:36:41
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17718/modules/mx_kb/includes Modified Files: functions_kb.php kb_pages.php Log Message: final fix before 2.0.2 release Index: kb_pages.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_pages.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** kb_pages.php 9 Apr 2005 21:41:28 -0000 1.4 --- kb_pages.php 21 Apr 2005 19:36:32 -0000 1.5 *************** *** 25,66 **** if ( MXBB_27x ) ! { ! $sql = "SELECT * FROM " . FUNCTION_TABLE . " WHERE function_file = 'kb.php' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not query Activity Mod module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $function_id = $row['function_id']; ! $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE function_id = '$function_id' LIMIT 1"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not query kb.php module information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $search_item = $row['block_id']; ! ! // Generate page_blocks data ! $sql = "SELECT pag.page_id ! FROM " . COLUMN_BLOCK_TABLE . " bct, ! " . PAGE_TABLE . " pag, ! " . COLUMN_TABLE . " col ! WHERE pag.page_id = col.page_id ! AND bct.column_id = col.column_id ! AND bct.block_id = '" . $search_item . "' ! ORDER BY pag.page_id"; ! ! if ( !$p_result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Could not query column list", "", __LINE__, __FILE__, $sql ); } ! $p_row = $db->sql_fetchrow( $p_result ); ! $return_key = $p_row['page_id']; ! ! if ( !empty( $return_key ) ) { ! $kb_pages = $return_key; $kb_error = false; } --- 25,40 ---- if ( MXBB_27x ) ! { ! $page_id = get_page_id( 'kb_article_reader.php', true ); ! ! if ( !$page_id ) { ! $page_id = get_page_id( 'kb.php', true ); } ! if ( !empty( $page_id ) ) { ! $kb_pages = $page_id; $kb_error = false; } *************** *** 69,76 **** $kb_error = true; } - // Start initial var setup $cat_id = $article_id = ''; if ( isset( $HTTP_GET_VARS['cat'] ) || isset( $HTTP_POST_VARS['cat'] ) ) { --- 43,50 ---- $kb_error = true; } // Start initial var setup $cat_id = $article_id = ''; + if ( isset( $HTTP_GET_VARS['cat'] ) || isset( $HTTP_POST_VARS['cat'] ) ) { Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** functions_kb.php 20 Apr 2005 20:48:23 -0000 1.31 --- functions_kb.php 21 Apr 2005 19:36:17 -0000 1.32 *************** *** 905,911 **** --- 905,916 ---- mx_message_die( GENERAL_ERROR, 'Error getting total articles', '', __LINE__, __FILE__, $sql ); } + if ( $total = $db->sql_fetchrow( $result_num ) ) { $category_articles = $total['total']; + } + else + { + $category_articles = $category['number_articles']; } } *************** *** 941,944 **** --- 946,950 ---- { global $db, $template, $phpbb_root_path, $mx_root_path, $module_root_path, $phpEx, $is_block, $page_id, $kb_config; + $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " *************** *** 981,1002 **** while ( $category = $db->sql_fetchrow( $result ) ) { ! // Get number of articles in cat - newssuite addon ! $sql_num = "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['category_id'] ); ! $sql_num .= " article_type IN " . $kb_types_list . ' AND'; ! } ! $sql_num .= " article_category_id = " . $category['category_id']; ! if ( !( $result_num = $db->sql_query( $sql_num ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Error getting total articles', '', __LINE__, __FILE__, $sql ); ! } ! if ( $total = $db->sql_fetchrow( $result_num ) ) ! { ! $category_articles = $total['total']; } else --- 987,1018 ---- while ( $category = $db->sql_fetchrow( $result ) ) { ! if ( MXBB_MODULE && !MXBB_27x ) ! { ! // Get number of articles in cat - newssuite addon ! $sql_num = "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['category_id'] ); ! $sql_num .= " article_type IN " . $kb_types_list . ' AND'; ! } ! $sql_num .= " article_category_id = " . $category['category_id']; ! ! if ( !( $result_num = $db->sql_query( $sql_num ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Error getting total articles', '', __LINE__, __FILE__, $sql ); ! } ! ! if ( $total = $db->sql_fetchrow( $result_num ) ) ! { ! $category_articles = $total['total']; ! } ! else ! { ! $category_articles = $category['number_articles']; ! } } else |