|
From: Jon O. <jon...@us...> - 2005-04-09 21:41:40
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1717/modules/mx_kb/includes Modified Files: functions_kb.php functions_kb_mx.php kb_article.php kb_cat.php kb_constants.php kb_defs.php kb_footer.php kb_moderator.php kb_pages.php kb_post.php kb_stats.php Log Message: dev work is kept up in the dev forums... Index: kb_stats.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_stats.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** kb_stats.php 2 Apr 2005 20:37:03 -0000 1.7 --- kb_stats.php 9 Apr 2005 21:41:28 -0000 1.8 *************** *** 29,39 **** // Start auth check // ! $kb_is_auth = array(); ! $kb_is_auth = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); // End of auth check // ! $kb_quick_nav = get_kb_cat_list( '', 1, true, true ); if ( !$is_block ) --- 29,39 ---- // Start auth check // ! $kb_is_auth_all = array(); ! $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); // End of auth check // ! $kb_quick_nav = get_kb_cat_list( 'auth_view', 0, 0, true, $kb_is_auth_all ); if ( !$is_block ) *************** *** 75,79 **** ) ); ! $total_articles = get_kb_stats( $stats, '1', 'articlerow', $start, $kb_config['art_pagination'], $kb_is_auth ); // Stats pagination is inactivated for now ;) --- 75,79 ---- ) ); ! $total_articles = get_kb_stats( $stats, '1', 'articlerow', $start, $kb_config['art_pagination'], $kb_is_auth_all ); // Stats pagination is inactivated for now ;) Index: kb_post.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_post.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** kb_post.php 2 Apr 2005 20:37:03 -0000 1.8 --- kb_post.php 9 Apr 2005 21:41:28 -0000 1.9 *************** *** 39,44 **** mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); ! $category_id = $row['article_category_id']; } --- 39,44 ---- mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $kb_row = $db->sql_fetchrow( $result ); ! $category_id = $kb_row['article_category_id']; } *************** *** 162,170 **** mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); ! $old_approve = $row['approved']; ! $old_topic_id = $row['topic_id']; ! $old_category_id = $row['article_category_id']; $error_msg = ''; --- 162,170 ---- mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $kb_row = $db->sql_fetchrow( $result ); ! $old_approve = $kb_row['approved']; ! $old_topic_id = $kb_row['topic_id']; ! $old_category_id = $kb_row['article_category_id']; $error_msg = ''; *************** *** 214,217 **** --- 214,228 ---- mx_remove_search_post( $article_id, 'kb' ); + // Update kb_row + $sql = "SELECT * + FROM " . KB_ARTICLES_TABLE . " + WHERE article_id = $article_id"; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); + } + $kb_row = $db->sql_fetchrow( $result ); + break; *************** *** 242,246 **** } ! // Get old data first $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " --- 253,257 ---- } ! // Update kb_row $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " *************** *** 251,256 **** mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $result ); ! $article_id = $row['article_id']; break; --- 262,267 ---- mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $kb_row = $db->sql_fetchrow( $result ); ! $article_id = $kb_row['article_id']; break; *************** *** 260,264 **** // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata, $kb_post_mode); // Compose post header --- 271,275 ---- // Populate the kb_comment variable ! $kb_comment = kb_get_data($kb_row, $userdata, $kb_post_mode); // Compose post header *************** *** 284,291 **** $kb_custom_field->file_update_data( $article_id ); if ( $approve == 1 ) { - kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'] ); mx_add_search_words( 'single', $article_id, stripslashes( $article_text ), stripslashes( $article_title ), 'kb' ); --- 295,303 ---- $kb_custom_field->file_update_data( $article_id ); + $kb_notify_info = $kb_post_mode == 'add' ? 'new' : 'edited'; + kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'], $kb_notify_info ); if ( $approve == 1 ) { mx_add_search_words( 'single', $article_id, stripslashes( $article_text ), stripslashes( $article_title ), 'kb' ); *************** *** 348,361 **** } ! $row = $db->sql_fetchrow( $result ); } ! $kb_title = ( isset( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_name'] ) ) ) : $row['article_title']; ! $kb_desc = ( isset( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_desc'] ) ) ): $row['article_description']; ! $kb_text = ( isset( $HTTP_POST_VARS['message'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['message'] ) ) ) : $row['article_body']; ! $type_id = ( isset( $HTTP_POST_VARS['type_id'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['type_id'] ) ) ) : $row['article_type']; ! $bbcode_uid = ( isset( $HTTP_POST_VARS['bbcode_uid'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['bbcode_uid'] ) ) ) : $row['bbcode_uid']; ! $username = ( isset( $HTTP_POST_VARS['username'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['username'] ) ) ) : $row['username']; if ( $preview ) --- 360,373 ---- } ! $kb_row = $db->sql_fetchrow( $result ); } ! $kb_title = ( isset( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_name'] ) ) ) : $kb_row['article_title']; ! $kb_desc = ( isset( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_desc'] ) ) ): $kb_row['article_description']; ! $kb_text = ( isset( $HTTP_POST_VARS['message'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['message'] ) ) ) : $kb_row['article_body']; ! $type_id = ( isset( $HTTP_POST_VARS['type_id'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['type_id'] ) ) ) : $kb_row['article_type']; ! $bbcode_uid = ( isset( $HTTP_POST_VARS['bbcode_uid'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['bbcode_uid'] ) ) ) : $kb_row['bbcode_uid']; ! $username = ( isset( $HTTP_POST_VARS['username'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['username'] ) ) ) : $kb_row['username']; if ( $preview ) *************** *** 588,593 **** get_kb_type_list( $type_id ); ! $template->assign_block_vars( 'switch_edit', array( ! 'CAT_LIST' => get_kb_cat_list( $category_id, 1, true ) ! ) ); ?> \ No newline at end of file --- 600,608 ---- get_kb_type_list( $type_id ); ! if ( $kb_post_mode == 'edit' ) ! { ! $template->assign_block_vars( 'switch_edit', array( ! 'CAT_LIST' => get_kb_cat_list( 'auth_edit', $category_id, $category_id, true ) ! ) ); ! } ?> \ No newline at end of file Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_moderator.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** kb_moderator.php 2 Apr 2005 20:37:03 -0000 1.9 --- kb_moderator.php 9 Apr 2005 21:41:28 -0000 1.10 *************** *** 81,85 **** } ! $row = $db->sql_fetchrow( $results ); $topic_sql = ''; --- 81,85 ---- } ! $kb_row = $db->sql_fetchrow( $results ); $topic_sql = ''; *************** *** 88,92 **** // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata ); // Compose post header --- 88,92 ---- // Populate the kb_comment variable ! $kb_comment = kb_get_data($kb_row, $userdata ); // Compose post header *************** *** 99,103 **** if ( $kb_config['use_comments'] ) { ! if ( !$row['topic_id'] ) { // Post --- 99,103 ---- if ( $kb_config['use_comments'] ) { ! if ( !$kb_row['topic_id'] ) { // Post *************** *** 116,124 **** } ! $article_category_id = $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'] ); ! 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&start=$start" ) ) . '">', '</a>' ) ; --- 116,124 ---- } ! $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' ); $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&start=$start" ) ) . '">', '</a>' ) ; *************** *** 146,152 **** } ! if ( $row = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $row['article_category_id']; } --- 146,152 ---- } ! if ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $kb_row['article_category_id']; } *************** *** 196,204 **** $count_sql = array(); ! while ( $row = $db->sql_fetchrow( $result ) ) { $count_sql[] = "UPDATE " . USERS_TABLE . " ! SET user_posts = user_posts - " . $row['posts'] . " ! WHERE user_id = " . $row['poster_id']; } $db->sql_freeresult( $result ); --- 196,204 ---- $count_sql = array(); ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { $count_sql[] = "UPDATE " . USERS_TABLE . " ! SET user_posts = user_posts - " . $kb_row['posts'] . " ! WHERE user_id = " . $kb_row['poster_id']; } $db->sql_freeresult( $result ); *************** *** 225,231 **** $forum_id = array(); ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $forum_id = $row['forum_id']; } $db->sql_freeresult( $result ); --- 225,231 ---- $forum_id = array(); ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $forum_id = $kb_row['forum_id']; } $db->sql_freeresult( $result ); *************** *** 242,249 **** $ii = 0; $post_id_sql = ''; ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $post_array[$ii] = $row['post_id']; ! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $row['post_id']; $ii++; } --- 242,249 ---- $ii = 0; $post_id_sql = ''; ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $post_array[$ii] = $kb_row['post_id']; ! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $kb_row['post_id']; $ii++; } Index: kb_defs.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_defs.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_defs.php 28 Mar 2005 20:22:47 -0000 1.3 --- kb_defs.php 9 Apr 2005 21:41:28 -0000 1.4 *************** *** 19,23 **** * (at your option) any later version. */ ! // ---------------------------------------------------------------------START // This file defines specific constants for the module --- 19,28 ---- * (at your option) any later version. */ ! ! /** ! * THIS FILE IS USED ONLY WITHIN MXBB PORTAL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! * If this MOD is used for phpBB alone, do not bother with this code ;) ! */ ! // ---------------------------------------------------------------------START // This file defines specific constants for the module Index: kb_pages.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_pages.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_pages.php 28 Mar 2005 20:22:47 -0000 1.3 --- kb_pages.php 9 Apr 2005 21:41:28 -0000 1.4 *************** *** 18,133 **** */ ! // 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(); ! $sql = "SELECT col.page_id, blk.block_id, sys.parameter_value, fnc.function_file ! FROM " . COLUMN_BLOCK_TABLE . " bct, ! " . COLUMN_TABLE . " col, ! " . BLOCK_TABLE . " blk, ! " . BLOCK_SYSTEM_PARAMETER_TABLE . " sys, ! " . FUNCTION_TABLE . " fnc, ! " . PARAMETER_TABLE . " par ! WHERE col.column_id = bct.column_id ! AND blk.function_id = fnc.function_id ! AND par.function_id = fnc.function_id ! AND blk.block_id = bct.block_id ! AND blk.block_id = sys.block_id ! AND par.parameter_name = 'kb_type_select' ! ORDER BY page_id, block_id"; ! if ( !$kb_result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql ); } ! ! while ( $kb_rows = $db->sql_fetchrow( $kb_result ) ) { ! $page_id = $kb_rows['page_id']; ! $block_id = $kb_rows['block_id']; ! ! $kb_select_par = $kb_rows['parameter_value']; ! ! // Extract 'what posts to view info', the cool Array ;) ! $kb_type_select_data = array(); ! $kb_type_select_temp = $kb_select_par; ! $kb_type_select_temp = stripslashes( $kb_type_select_temp ); ! $kb_type_select_data = eval( "return " . $kb_type_select_temp . ";" ); ! $kb_config['news_mode_operate'] = true; ! ! if ( is_array($kb_type_select_data) ) ! { ! $news_setup[$page_id] = $kb_type_select_data; ! $news_mode[$page_id] = $kb_rows['function_file']; ! } ! } ! $page_to_kb = array(); ! while ( list( $page_idd, $news_setup_roww ) = each( $news_setup ) ) { ! while ( list( $cat_idd, $news_forum_roww ) = each( $news_setup_roww ) ) { ! if ( $news_forum_roww['forum_news'] == 1 ) { ! $page_to_kb[$cat_idd] = ( empty( $page_to_kb[$cat_idd] ) || $news_mode[$page_idd] == 'kb_article_reader.php' ) ? $page_idd : $page_to_kb[$cat_idd]; } } ! } - - $_SESSION['kb_setup'] = $page_to_kb; - } - - // Start initial var setup - - $cat_id = ''; - - if ( isset( $HTTP_GET_VARS['cat'] ) || isset( $HTTP_POST_VARS['cat'] ) ) - { - $cat_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval( $HTTP_GET_VARS['cat'] ) : intval( $HTTP_POST_VARS['cat'] ); - } - else if ( isset( $HTTP_GET_VARS['k'] ) || isset( $HTTP_POST_VARS['k'] ) ) - { - - $sql = ''; - $article_id = 0; ! $article_id = intval( $HTTP_GET_VARS['k'] ); ! $sql = "SELECT article_category_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = $article_id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "no info - error", '', __LINE__, __FILE__, $sql ); } ! if ( !( $row = $db->sql_fetchrow( $result ) ) ) { ! //mx_message_die( GENERAL_MESSAGE, 'article_not_exist' ); } - $cat_id = $row['article_category_id']; - - } - - if ( !empty($cat_id) ) - { - $kb_pages = $_SESSION['kb_setup'][$cat_id]; - $kb_error = false; - } - else - { - $kb_error = true; } - - // -------------------------------------------------------------------------------- - // That's all Folks! - // -------------------------------------------------------------------------------- - ?> \ No newline at end of file --- 18,191 ---- */ ! /** ! * THIS FILE IS USED ONLY WITHIN MXBB PORTAL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! * If this MOD is used for phpBB alone, do not bother with this code ;) ! */ ! ! 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; ! } ! else ! { ! $kb_error = true; } ! // Start initial var setup ! ! $cat_id = $article_id = ''; ! if ( isset( $HTTP_GET_VARS['cat'] ) || isset( $HTTP_POST_VARS['cat'] ) ) { ! $cat_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval( $HTTP_GET_VARS['cat'] ) : intval( $HTTP_POST_VARS['cat'] ); ! } ! else if ( isset( $HTTP_GET_VARS['k'] ) || isset( $HTTP_POST_VARS['k'] ) ) ! { ! $article_id = ( isset( $HTTP_GET_VARS['k'] ) ) ? intval( $HTTP_GET_VARS['k'] ) : intval( $HTTP_POST_VARS['k'] ); ! } ! } ! else ! { ! // 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(); ! ! $sql = "SELECT col.page_id, blk.block_id, sys.parameter_value, fnc.function_file ! FROM " . COLUMN_BLOCK_TABLE . " bct, ! " . COLUMN_TABLE . " col, ! " . BLOCK_TABLE . " blk, ! " . BLOCK_SYSTEM_PARAMETER_TABLE . " sys, ! " . FUNCTION_TABLE . " fnc, ! " . PARAMETER_TABLE . " par ! WHERE col.column_id = bct.column_id ! AND blk.function_id = fnc.function_id ! AND par.function_id = fnc.function_id ! AND blk.block_id = bct.block_id ! AND blk.block_id = sys.block_id ! AND par.parameter_name = 'kb_type_select' ! ORDER BY page_id, block_id"; ! ! if ( !$kb_result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql ); ! } ! ! while ( $kb_rows = $db->sql_fetchrow( $kb_result ) ) ! { ! $page_id = $kb_rows['page_id']; ! $block_id = $kb_rows['block_id']; ! ! $kb_select_par = $kb_rows['parameter_value']; ! ! // Extract 'what posts to view info', the cool Array ;) ! $kb_type_select_data = array(); ! $kb_type_select_temp = $kb_select_par; ! $kb_type_select_temp = stripslashes( $kb_type_select_temp ); ! $kb_type_select_data = eval( "return " . $kb_type_select_temp . ";" ); ! $kb_config['news_mode_operate'] = true; ! ! if ( is_array($kb_type_select_data) ) ! { ! $news_setup[$page_id] = $kb_type_select_data; ! $news_mode[$page_id] = $kb_rows['function_file']; ! } ! ! } ! ! $page_to_kb = array(); ! while ( list( $page_idd, $news_setup_roww ) = each( $news_setup ) ) ! { ! while ( list( $cat_idd, $news_forum_roww ) = each( $news_setup_roww ) ) { ! if ( $news_forum_roww['forum_news'] == 1 ) ! { ! $page_to_kb[$cat_idd] = ( empty( $page_to_kb[$cat_idd] ) || $news_mode[$page_idd] == 'kb_article_reader.php' ) ? $page_idd : $page_to_kb[$cat_idd]; ! } } + } ! ! $_SESSION['kb_setup'] = $page_to_kb; } ! // Start initial var setup ! $cat_id = $article_id = $sql = ''; ! if ( isset( $HTTP_GET_VARS['cat'] ) || isset( $HTTP_POST_VARS['cat'] ) ) { ! $cat_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval( $HTTP_GET_VARS['cat'] ) : intval( $HTTP_POST_VARS['cat'] ); } ! else if ( isset( $HTTP_GET_VARS['k'] ) || isset( $HTTP_POST_VARS['k'] ) ) { ! $article_id = ( isset( $HTTP_GET_VARS['k'] ) ) ? intval( $HTTP_GET_VARS['k'] ) : intval( $HTTP_POST_VARS['k'] ); ! ! $sql = "SELECT article_category_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = $article_id"; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, "no info - error", '', __LINE__, __FILE__, $sql ); ! } ! ! if ( !( $row = $db->sql_fetchrow( $result ) ) ) ! { ! //mx_message_die( GENERAL_MESSAGE, 'article_not_exist' ); ! } ! $cat_id = $row['article_category_id']; ! } ! ! if ( !empty($cat_id) ) ! { ! $kb_pages = $_SESSION['kb_setup'][$cat_id]; ! $kb_error = false; ! } ! else ! { ! $kb_error = true; } } ?> \ No newline at end of file Index: functions_kb_mx.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb_mx.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** functions_kb_mx.php 2 Apr 2005 20:37:02 -0000 1.2 --- functions_kb_mx.php 9 Apr 2005 21:41:28 -0000 1.3 *************** *** 415,417 **** --- 415,469 ---- } } + + if ( !function_exists(mx_do_install_upgrade) ) + { + // Generating output + + function mx_do_install_upgrade( $sql = '', $main_install = false ) + { + global $table_prefix, $mx_table_prefix, $userdata, $phpEx, $template, $lang, $db, $board_config, $HTTP_POST_VARS; + + $inst_error = false; + $n = 0; + $message = "<b>This is the result list of the SQL queries needed for the install/upgrade</b><br /><br />"; + + while ( $sql[$n] ) + { + if ( !$result = $db->sql_query( $sql[$n] ) ) + { + $message .= '<b><font color=#FF0000>[Error or Already added]</font></b> line: ' . ( $n + 1 ) . ' , ' . $sql[$n] . '<br />'; + $inst_error = true; + } + else + { + $message .= '<b><font color=#0000fF>[Added/Updated]</font></b> line: ' . ( $n + 1 ) . ' , ' . $sql[$n] . '<br />'; + } + $n++; + } + $message .= '<br /> If you get some Errors, Already Added or Updated messages, relax, this is normal when updating modules'; + + if ( $main_install ) + { + if ( !$inst_error ) + { + $message .= '-> no db errors :-)<br /><br /><b>Portal installed successfully! </b><hr><br /><br />'; + $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; + $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; + $message .= '3) Then (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; + + $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; + } + else + { + $message .= '<br /><br /><b>Portal installed successfully (with some warnings)! </b><hr><br /><br />'; + $message .= '1) Now, delete the /install and /contrib folders!!!<br /><br />'; + $message .= '2) If you haven\'t already done a db backup, now is the time ;)<br /><br />'; + $message .= '3) Now (after step 1), you HAVE to configure MX core and its modules from within the adminCP, simply \'upgrade\' MX portal Core and all modules in use!!!<br /><br />'; + + $message .= 'Click <a href=../admin/admin_mx_module.php>Here</a> to administer/upgrade the portal/modules. You will be promted for an admin username and pass. The upgrade process provide informative output...'; + } + } + return $message; + } + } ?> \ No newline at end of file Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** functions_kb.php 5 Apr 2005 20:52:30 -0000 1.28 --- functions_kb.php 9 Apr 2005 21:41:28 -0000 1.29 *************** *** 552,562 **** // email admin ! function kb_notify( $action, $message, $to_id, $from_id ) { global $lang, $board_config, $kb_config, $db, $module_root_path, $phpbb_root_path, $mx_root_path, $phpEx, $userdata; if ( $action == 2 ) // Mail { ! $email_subject = $lang['KB_title'] . ' - ' . $lang['KB_notify_subject']; $email_body = $lang['KB_notify_body'] . '\n\n\n' . $message; --- 552,581 ---- // email admin ! function kb_notify( $action, $message, $to_id, $from_id, $info = 'new' ) { global $lang, $board_config, $kb_config, $db, $module_root_path, $phpbb_root_path, $mx_root_path, $phpEx, $userdata; + switch ( $info ) + { + case 'new': + $subject_tmp = $lang['KB_notify_subject_new']; + break; + + case 'edited': + $subject_tmp = $lang['KB_notify_subject_edited']; + break; + + case 'approved': + $subject_tmp = $lang['KB_notify_subject_approved']; + break; + + case 'unapproved': + $subject_tmp = $lang['KB_notify_subject_unapproved']; + break; + } + if ( $action == 2 ) // Mail { ! $email_subject = $lang['KB_title'] . ' - ' . $subject_tmp; $email_body = $lang['KB_notify_body'] . '\n\n\n' . $message; *************** *** 566,570 **** else if ( $action == 1 ) // PM { ! $email_subject = $lang['KB_title'] . ' - ' . $lang['KB_notify_subject']; $email_body = $lang['KB_notify_body'] . '\n\n\n' . $message; --- 585,589 ---- else if ( $action == 1 ) // PM { ! $email_subject = $lang['KB_title'] . ' - ' . $subject_tmp; $email_body = $lang['KB_notify_body'] . '\n\n\n' . $message; *************** *** 596,599 **** --- 615,624 ---- $attach_sig = $userdata['user_attachsig']; + // Why send PM to yourself??? + if ( $to_id == $from_id ) + { + return; + } + //get to users info $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active *************** *** 850,864 **** } while ( $category = $db->sql_fetchrow( $result ) ) { - // Start auth check - // - $kb_is_cat_auth = array(); - $kb_is_cat_auth = kb_auth(AUTH_ALL, $category['category_id'], $userdata); - - // End of auth check - // - // Get number of articles in cat - newssuite addon $sql_num = "SELECT count(article_id) AS total --- 875,888 ---- } + // Start auth check + // + + $kb_is_auth_all = array(); + $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); + + // End of auth check while ( $category = $db->sql_fetchrow( $result ) ) { // Get number of articles in cat - newssuite addon $sql_num = "SELECT count(article_id) AS total *************** *** 893,897 **** $category = '<a href="' . $temp_url . '" class="forumlink">' . $category_name . '</a>'; // Newssuite operating mode ! if ( ns_auth_cat( $category_id ) && $kb_is_cat_auth['auth_view']) { $template->assign_block_vars( 'catrow', array( 'CATEGORY' => $category, --- 917,921 ---- $category = '<a href="' . $temp_url . '" class="forumlink">' . $category_name . '</a>'; // Newssuite operating mode ! if ( ns_auth_cat( $category_id ) && $kb_is_auth_all[$category_id]['auth_view']) { $template->assign_block_vars( 'catrow', array( 'CATEGORY' => $category, *************** *** 902,906 **** } ! $kb_quick_nav = get_kb_cat_list( '', 1, true, true ); return $template; --- 926,930 ---- } ! $kb_quick_nav = get_kb_cat_list( 'auth_view', 0, 0, true, $kb_is_auth_all ); return $template; *************** *** 909,913 **** // get sub categories for articles ! function get_kb_cat_subs( $parent ) { global $db, $template, $phpbb_root_path, $mx_root_path, $module_root_path, $phpEx, $is_block, $page_id, $kb_config; --- 933,937 ---- // get sub categories for articles ! function get_kb_cat_subs( $parent, $kb_is_auth_all = false ) { global $db, $template, $phpbb_root_path, $mx_root_path, $module_root_path, $phpEx, $is_block, $page_id, $kb_config; *************** *** 927,937 **** } if ( $category2 = $db->sql_fetchrow( $result2 ) ) { - // fix for 0.76 if ( $category2['category_name'] != '' ) { // Newssuite operating mode ! if ( ns_auth_cat( $category2['category_id'] ) ) { $template->assign_block_vars( 'switch_sub_cats', array() ); --- 951,971 ---- } + if ( !$kb_is_auth_all ) + { + // Start auth check + // + $kb_is_auth_all = array(); + $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); + + // End of auth check + // + } + if ( $category2 = $db->sql_fetchrow( $result2 ) ) { if ( $category2['category_name'] != '' ) { // Newssuite operating mode ! if ( ns_auth_cat( $category2['category_id'] ) && $kb_is_auth_all[$category2['category_id']]['auth_view'] ) { $template->assign_block_vars( 'switch_sub_cats', array() ); *************** *** 939,942 **** --- 973,977 ---- } } + while ( $category = $db->sql_fetchrow( $result ) ) { *************** *** 971,976 **** $temp_url = append_sid( this_kb_mxurl( "mode=cat&cat=$category_id" ) ); $category = '<a href="' . $temp_url . '" class="forumlink">' . $category_name . '</a>'; // Newssuite operating mode ! if ( ns_auth_cat( $category_id ) ) { $template->assign_block_vars( 'switch_sub_cats.catrow', array( 'CATEGORY' => $category, --- 1006,1012 ---- $temp_url = append_sid( this_kb_mxurl( "mode=cat&cat=$category_id" ) ); $category = '<a href="' . $temp_url . '" class="forumlink">' . $category_name . '</a>'; + // Newssuite operating mode ! if ( ns_auth_cat( $category_id ) && $kb_is_auth_all[$category_id]['auth_view'] ) { $template->assign_block_vars( 'switch_sub_cats.catrow', array( 'CATEGORY' => $category, *************** *** 1057,1061 **** } ! function get_kb_cat_subs_list( $parent, $select = 1, $selected = false, $indent ) { global $db; --- 1093,1097 ---- } ! function get_kb_cat_subs_list( $auth_type, $parent, $select = 1, $selected = false, $is_admin = false, $kb_is_auth_all, $indent ) { global $db; *************** *** 1083,1088 **** while ( $category2 = $db->sql_fetchrow( $result ) ) ! { ! if ( $parent == $category2[$idfield] && $selected ) { $status = 'selected'; --- 1119,1124 ---- while ( $category2 = $db->sql_fetchrow( $result ) ) ! { ! if ( $select == $category2[$idfield] && $selected ) { $status = 'selected'; *************** *** 1092,1098 **** $status = ''; } ! $catlist .= "<option value=\"$category2[$idfield]\" $status>" . $indent . '--»'. $category2[$namefield] . "</option>\n"; ! $temp = $indent . ' '; ! $catlist .= get_kb_cat_subs_list( $category2[$idfield], $select, $selected, $temp ); } --- 1128,1138 ---- $status = ''; } ! ! if ( ( ns_auth_cat( $category2[$idfield] ) && $kb_is_auth_all[$category2[$idfield]][$auth_type] ) || $is_admin) ! { ! $catlist .= "<option value=\"$category2[$idfield]\" $status>" . $indent . '--»'. $category2[$namefield] . "</option>\n"; ! $temp = $indent . ' '; ! $catlist .= get_kb_cat_subs_list( $auth_type, $category2[$idfield], $select, $selected, $is_admin, $kb_is_auth_all, $temp ); ! } } *************** *** 1102,1106 **** // get category list for adding and editing articles ! function get_kb_cat_list( $id = 0, $select = 1, $selected = false, $is_admin = false ) { global $db, $userdata; --- 1142,1146 ---- // get category list for adding and editing articles ! function get_kb_cat_list( $auth_type, $id = 0, $select = 1, $selected = false, $kb_is_auth_all = false, $is_admin = false ) { global $db, $userdata; *************** *** 1125,1141 **** } - // Start auth check - // - $kb_is_auth = array(); - $kb_is_auth = kb_auth(AUTH_ALL, $id, $userdata, $cat_result); - - // End of auth check - // - $catlist = ""; while ( $category = $db->sql_fetchrow( $cat_result ) ) { ! if ( $id == $category[$idfield] && $selected) { $status = 'selected'; --- 1165,1185 ---- } $catlist = ""; + + if ( !$kb_is_auth_all ) + { + // Start auth check + // + $kb_is_auth_all = array(); + $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); + + // End of auth check + // + } while ( $category = $db->sql_fetchrow( $cat_result ) ) { ! ! if ( $select == $category[$idfield] && $selected) { $status = 'selected'; *************** *** 1146,1154 **** } ! if ( $kb_is_auth['auth_post'] || $is_admin) { $catlist .= "<option value=\"$category[$idfield]\" $status>" . $category[$namefield] . "</option>\n"; ! $catlist .= get_kb_cat_subs_list( $category[$idfield], $select, $selected, ' ' ); } } --- 1190,1198 ---- } ! if ( ( ns_auth_cat( $category[$idfield] ) && $kb_is_auth_all[$category[$idfield]][$auth_type] ) || $is_admin) { $catlist .= "<option value=\"$category[$idfield]\" $status>" . $category[$namefield] . "</option>\n"; ! $catlist .= get_kb_cat_subs_list( $auth_type, $category[$idfield], $select, $selected, $is_admin, $kb_is_auth_all, ' ' ); } } *************** *** 1283,1288 **** $smilies_on = 1 ) { ! global $db, $board_config, $user_ip, $kb_config, $lang, $userdata; // initialise some variables $topic_vote = 0; $poll_title = ''; --- 1327,1333 ---- $smilies_on = 1 ) { ! global $db, $phpbb_root_path, $phpEx, $board_config, $user_ip, $kb_config, $lang, $userdata; // initialise some variables + $topic_vote = 0; $poll_title = ''; *************** *** 1445,1449 **** if ( is_numeric( $page_id ) ) { ! $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : '&' . $args ); } else --- 1490,1494 ---- if ( is_numeric( $page_id ) ) { ! $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : '&' . $args ); } else *************** *** 1487,1521 **** } - // MX add-on - // Check if user $user_id belongs to group $group_id - // ...function based on original function written by AbelaJohnB :-) - function is_group_member( $group_id = '', $user_id = '' ) - { - global $db; - global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; - - if ( $user_id == '' || $group_id == '' ) - { - message_die( GENERAL_ERROR, "no valid function call, is_group_member...", '', '', '', '' ); - } - // Check if user is member of the proper group.. - $sql = "SELECT * FROM " . USER_GROUP_TABLE . " WHERE group_id='" . $group_id . "' AND user_id='" . $user_id . "' LIMIT 1"; - - if ( !( $result = $db->sql_query( $sql ) ) ) - { - message_die( GENERAL_ERROR, "Could not query group rights information", '', '', '', '' ); - } - - if ( $db->sql_numrows( $result ) == 0 ) - { - $is_member = false; - } - else - { - $is_member = true; - } - - return $is_member; - } // Extract all post in the comments topic --- 1532,1535 ---- *************** *** 1642,1651 **** if ( $postrow[$i]['user_allowsmile'] && $user_sig != '' ) { ! $user_sig = smilies_pass( $user_sig ); } if ( $postrow[$i]['enable_smilies'] ) { ! $message = smilies_pass( $message ); } } --- 1656,1665 ---- if ( $postrow[$i]['user_allowsmile'] && $user_sig != '' ) { ! $user_sig = mx_smilies_pass( $user_sig ); } if ( $postrow[$i]['enable_smilies'] ) { ! $message = mx_smilies_pass( $message ); } } *************** *** 1689,1693 **** if ( empty( $row ) || empty( $userdata ) ) { ! die('kb_get_data - empty pars'); } --- 1703,1707 ---- if ( empty( $row ) || empty( $userdata ) ) { ! die('kb_get_data - empty pars' ); } Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_article.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** kb_article.php 2 Apr 2005 20:37:03 -0000 1.21 --- kb_article.php 9 Apr 2005 21:41:28 -0000 1.22 *************** *** 37,44 **** } ! $row = $db->sql_fetchrow( $result ); ! if ( count($row) > 0 ) { ! $article_title = $row['article_title'] ; // // Define censored word matches --- 37,45 ---- } ! $kb_row = $db->sql_fetchrow( $result ); ! ! if ( count($kb_row) > 0 ) { ! $article_title = $kb_row['article_title'] ; // // Define censored word matches *************** *** 49,60 **** obtain_word_list($orig_word, $replacement_word); ! $approved = $row['approved']; ! $article_category_id = $row['article_category_id']; // Start auth check // ! $kb_is_auth = array(); ! $kb_is_auth = kb_auth(AUTH_ALL, $article_category_id, $userdata); // End of auth check --- 50,63 ---- obtain_word_list($orig_word, $replacement_word); ! $approved = $kb_row['approved']; ! $article_category_id = $kb_row['article_category_id']; // Start auth check // ! $kb_is_auth_all = array(); ! $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); ! $kb_is_auth = $kb_is_auth_all[$article_category_id]; ! // End of auth check *************** *** 76,80 **** } ! $kb_quick_nav = get_kb_cat_list( $article_category_id, 1, true, true ); $category = get_kb_cat( $article_category_id ); --- 79,83 ---- } ! $kb_quick_nav = get_kb_cat_list( 'auth_view', $article_category_id, $article_category_id, true, $kb_is_auth_all ); $category = get_kb_cat( $article_category_id ); *************** *** 84,96 **** $category = '<a href="' . $temp_url . '" class="gensmall">' . $article_category_name . '</a>'; ! $date = create_date( $board_config['default_dateformat'], $row['article_date'], $board_config['board_timezone'] ); // author information ! $author_id = $row['article_author_id']; if ( $author_id == -1 ) { ! $author_kb_art = ( $row['username'] == '' ) ? $lang['Guest'] : $row['username']; } else --- 87,99 ---- $category = '<a href="' . $temp_url . '" class="gensmall">' . $article_category_name . '</a>'; ! $date = create_date( $board_config['default_dateformat'], $kb_row['article_date'], $board_config['board_timezone'] ); // author information ! $author_id = $kb_row['article_author_id']; if ( $author_id == -1 ) { ! $author_kb_art = ( $kb_row['username'] == '' ) ? $lang['Guest'] : $kb_row['username']; } else *************** *** 101,120 **** } ! $art_pages = explode( '[page]', stripslashes( $row['article_body'] ) ); $article = trim( $art_pages[$page_num] ); $article = str_replace( '[toc]', '', $article ); ! $kb_art_description = $row['article_description'] ; $article = article_formatting( $article ); ! $type_id = $row['article_type']; $type = get_kb_type( $type_id ); ! $topic_id = $row['topic_id']; ! $new_views = $row['views'] + 1; $views = '<b>' . $lang['Views'] . '</b> ' . $new_views; ! if ( $row['article_rating'] == 0 || $row['article_totalvotes'] == 0 ) { $rating = 0; --- 104,123 ---- } ! $art_pages = explode( '[page]', stripslashes( $kb_row['article_body'] ) ); $article = trim( $art_pages[$page_num] ); $article = str_replace( '[toc]', '', $article ); ! $kb_art_description = $kb_row['article_description'] ; $article = article_formatting( $article ); ! $type_id = $kb_row['article_type']; $type = get_kb_type( $type_id ); ! $topic_id = $kb_row['topic_id']; ! $new_views = $kb_row['views'] + 1; $views = '<b>' . $lang['Views'] . '</b> ' . $new_views; ! if ( $kb_row['article_rating'] == 0 || $kb_row['article_totalvotes'] == 0 ) { $rating = 0; *************** *** 125,130 **** else { ! $rating = round( $row['article_rating'] / $row['article_totalvotes'], 2 ); ! $rating_votes = $row['article_totalvotes']; $rating_message = $rating . '/10, ' . $rating_votes . ' ' . $lang['Votes'] ; $rate_message = '<b>' . $lang['Votes_label'] . '</b> ' . $rating_message; --- 128,133 ---- else { ! $rating = round( $kb_row['article_rating'] / $kb_row['article_totalvotes'], 2 ); ! $rating_votes = $kb_row['article_totalvotes']; $rating_message = $rating . '/10, ' . $rating_votes . ' ' . $lang['Votes'] ; $rate_message = '<b>' . $lang['Votes_label'] . '</b> ' . $rating_message; *************** *** 147,150 **** --- 150,154 ---- // + $original_highlight = ''; $highlight_match = $highlight = ''; if (isset($HTTP_GET_VARS['highlight'])) *************** *** 152,155 **** --- 156,160 ---- // Split words and phrases + $original_highlight = '&highlight='.trim(htmlspecialchars($HTTP_GET_VARS['highlight'])); $words = explode(' ', trim(htmlspecialchars($HTTP_GET_VARS['highlight']))); *************** *** 174,178 **** // Parse message ! $bbcode_uid = $row['bbcode_uid']; if ( $bbcode_on ) --- 179,183 ---- // Parse message ! $bbcode_uid = $kb_row['bbcode_uid']; if ( $bbcode_on ) *************** *** 238,244 **** if ( $print_version ) { ! $gen_simple_header = TRUE; } ! if ( !$is_block) { include( $mx_root_path . 'includes/page_header.' . $phpEx ); --- 243,251 ---- if ( $print_version ) { ! $gen_simple_header = TRUE; ! include( $phpbb_root_path . 'includes/page_header.' . $phpEx ); } ! ! if ( !$is_block && !$print_version) { include( $mx_root_path . 'includes/page_header.' . $phpEx ); *************** *** 299,305 **** { $kb_comment = array(); ! // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata ); // Compose post header --- 306,312 ---- { $kb_comment = array(); ! // Populate the kb_comment variable ! $kb_comment = kb_get_data($kb_row, $userdata ); // Compose post header *************** *** 310,314 **** $kb_update_message = $message_temp['update_message']; ! $topic_id_tmp = $row['topic_id']; // // Check if this topic exists. It could have been deleted by accident ;) If so recreate it! --- 317,321 ---- $kb_update_message = $message_temp['update_message']; ! $topic_id_tmp = $kb_row['topic_id']; // // Check if this topic exists. It could have been deleted by accident ;) If so recreate it! *************** *** 513,521 **** if ( !$print_version ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number" . $start_pag ) ); } else { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number&print=true" . $start_pag, true ) ); } $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . ' - ' . $article_toc . '</a>'; --- 520,528 ---- if ( !$print_version ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number" . $start_pag . $original_highlight ) ); } else { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number&print=true" . $start_pag . $original_highlight, true ) ); } $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . ' - ' . $article_toc . '</a>'; *************** *** 562,570 **** if ( !$print_version ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number" . $start_pag ) ); } else { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number&print=true" . $start_pag, true ) ); } $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . '</a>'; --- 569,577 ---- if ( !$print_version ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number" . $start_pag . $original_highlight) ); } else { ! $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id&page_num=$page_number&print=true" . $start_pag . $original_highlight, true ) ); } $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . '</a>'; Index: kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_cat.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** kb_cat.php 2 Apr 2005 20:37:03 -0000 1.14 --- kb_cat.php 9 Apr 2005 21:41:28 -0000 1.15 *************** *** 38,43 **** // Start auth check // ! $kb_is_auth = array(); ! $kb_is_auth = kb_auth(AUTH_ALL, $category_id, $userdata); // End of auth check --- 38,44 ---- // Start auth check // ! $kb_is_auth_all = array(); ! $kb_is_auth_all = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); ! $kb_is_auth = $kb_is_auth_all[$category_id]; // End of auth check *************** *** 60,64 **** } ! $kb_quick_nav = get_kb_cat_list( $category_id, 1, true, true ); if ( !$kb_is_auth['auth_view'] ) --- 61,65 ---- } ! $kb_quick_nav = get_kb_cat_list( 'auth_view', $category_id, $category_id, true, $kb_is_auth_all ); if ( !$kb_is_auth['auth_view'] ) *************** *** 87,90 **** --- 88,93 ---- } + // load header + include ( $module_root_path . "includes/kb_header." . $phpEx ); $kb_news_sort_par = $kb_config['news_sort_par']; *************** *** 113,118 **** break; } - // load header - include ( $module_root_path . "includes/kb_header." . $phpEx ); $template->set_filenames( array( 'body' => 'kb_cat_body.tpl' ) --- 116,119 ---- *************** *** 128,132 **** { // get sub-cats ! get_kb_cat_subs( $category_id ); $path_kb = ' '; --- 129,133 ---- { // get sub-cats ! get_kb_cat_subs( $category_id, $kb_is_auth_all ); $path_kb = ' '; |