Update of /cvsroot/mxbb/mx_kb/kb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21873/modules/mx_kb/kb/includes Modified Files: functions.php functions_admin.php functions_auth.php functions_comment.php functions_kb.php Removed Files: functions_cache.php functions_field.php Log Message: Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** functions.php 5 Jul 2006 22:48:26 -0000 1.11 --- functions.php 1 Aug 2006 21:00:37 -0000 1.12 *************** *** 96,100 **** * @param unknown_type $page_id */ ! function kb_generate_smilies( $mode, $page_id ) { global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path; --- 96,100 ---- * @param unknown_type $page_id */ ! function generate_smilies( $mode, $page_id ) { global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path; *************** *** 254,258 **** { global $kb_config, $lang, $userdata, $images, $mode; ! global $mx_kb, $HTTP_GET_VARS; global $template, $db, $theme, $gen_simple_header, $starttime, $phpEx, $board_config, $user_ip, $phpbb_root_path; global $admin_level, $level_prior, $tree, $do_gzip_compress; --- 254,258 ---- { global $kb_config, $lang, $userdata, $images, $mode; ! global $mx_kb; global $template, $db, $theme, $gen_simple_header, $starttime, $phpEx, $board_config, $user_ip, $phpbb_root_path; global $admin_level, $level_prior, $tree, $do_gzip_compress; *************** *** 263,285 **** $template->set_filenames( array( 'kb_header' => 'kb_header.tpl' ) ); ! if ( isset ( $HTTP_GET_VARS['cat'] ) ) { ! $category_id = intval ($HTTP_GET_VARS['cat'] ); ! ! if ( $mx_kb->modules[$mx_kb->module_name]->auth_user[$category_id]['auth_post'] || $mx_kb->modules[$mx_kb->module_name]->auth_user[$category_id]['auth_mod'] ) { ! $temp_url = append_sid( $mx_kb->this_mxurl( "mode=add&cat=" . $category_id ) ); ! $add_article = '<a href="' . $temp_url . '">' . $lang['Add_article'] . '</a>'; } - } - else - { - $add_article = $lang['Click_cat_to_add']; } ! $template->assign_block_vars( 'switch_add_article', array() ); ! ! $temp_url = append_sid( $mx_kb->this_mxurl( "mode=search" ) ); ! $search = '<a href="' . $temp_url . '">' . $lang['Search'] . '</a>'; if ( $kb_config['header_banner'] == 1 ) --- 263,281 ---- $template->set_filenames( array( 'kb_header' => 'kb_header.tpl' ) ); ! if ( $mode == 'cat' ) { ! if ( $mx_kb->modules[$mx_kb->module_name]->auth_user[$_REQUEST['cat']]['auth_post'] || $mx_kb->modules[$mx_kb->module_name]->auth_user[$_REQUEST['cat']]['auth_mod'] ) { ! $add_article_url = append_sid( $mx_kb->this_mxurl( "mode=add&cat=" . $_REQUEST['cat'] ) ); ! $template->assign_block_vars( 'switch_add_article', array() ); ! } ! $mcp_url = append_sid( $mx_kb->this_mxurl( "mode=mcp&cat_id={$_REQUEST['cat']}" ) ); ! if ( $mx_kb->modules[$mx_kb->module_name]->auth_user[$_REQUEST['cat']]['auth_mod'] ) ! { ! $template->assign_block_vars( 'MCP', array() ); } } ! $search_url = append_sid( $mx_kb->this_mxurl( "mode=search" ) ); if ( $kb_config['header_banner'] == 1 ) *************** *** 295,302 **** $template->assign_vars( array( 'L_KB_TITLE' => $block_title, ! 'L_ADD_ARTICLE' => $add_article, ! 'L_SEARCH_MODULE' => $search, 'SPACER_IMG' => $images['mx_spacer'], 'U_TOPRATED' => append_sid( $mx_kb->this_mxurl( "mode=stats&stats=toprated" ) ), 'L_TOPRATED' => $lang['Top_toprated'], --- 291,302 ---- $template->assign_vars( array( 'L_KB_TITLE' => $block_title, ! 'L_ADD_ARTICLE' => $lang['Add_article'], ! 'L_MCP' => $lang['MCP_title'], ! 'L_SEARCH' => $lang['Search'], 'SPACER_IMG' => $images['mx_spacer'], + 'U_ADD_ARTICLE' => $add_article_url, + 'U_MCP' => $mcp_url, + 'U_SEARCH' => $search_url, 'U_TOPRATED' => append_sid( $mx_kb->this_mxurl( "mode=stats&stats=toprated" ) ), 'L_TOPRATED' => $lang['Top_toprated'], *************** *** 307,313 **** )); if ( $kb_config['stats_list'] == 1 ) { ! $this->get_quick_stats( $category_id ); } --- 307,328 ---- )); + // + // Ratings enabled for any category ? + // + if ( !empty( $mx_kb->modules[$mx_kb->module_name]->cat_rowset ) ) + { + foreach( $mx_kb->modules[$mx_kb->module_name]->cat_rowset as $cat_id => $cat_row ) + { + if ( $mx_kb->modules[$mx_kb->module_name]->ratings[$cat_id]['activated'] ) + { + $template->assign_block_vars( 'switch_toprated', array() ); + break; + } + } + } + if ( $kb_config['stats_list'] == 1 ) { ! $this->get_quick_stats( $_REQUEST['cat'] ); } *************** *** 404,408 **** $ii++; $type_id = $type['id']; ! $type_name = $type['type']; $sql = "SELECT article_id FROM " . KB_ARTICLES_TABLE . " --- 419,423 ---- $ii++; $type_id = $type['id']; ! $type_name = isset($lang['KB_type_' . $type['type']]) ? $lang['KB_type_' . $type['type']] : $type['type']; $sql = "SELECT article_id FROM " . KB_ARTICLES_TABLE . " *************** *** 424,428 **** if ( !empty( $category_id ) && $number_count > 0 ) { ! $stats_list .= empty($stats_list) ? ':: ' . $type_name . '(' . $number_count . ') :: ' : $type_name . '(' . $number_count . ') ::' ; } } --- 439,443 ---- if ( !empty( $category_id ) && $number_count > 0 ) { ! $stats_list .= empty($stats_list) ? $type_name . '(' . $number_count . ') ' : '• ' . $type_name . '(' . $number_count . ') ' ; } } *************** *** 456,460 **** while ( $type = $db->sql_fetchrow( $type_result ) ) { ! $type_name = $type['type']; $type_id = $type['id']; --- 471,475 ---- while ( $type = $db->sql_fetchrow( $type_result ) ) { ! $type_name = isset($lang['KB_type_' . $type['type']]) ? $lang['KB_type_' . $type['type']] : $type['type']; $type_id = $type['id']; *************** *** 677,682 **** } - include_once( $mx_root_path . 'includes/mx_functions_tools.' . $phpEx ); - /** * mx_kb_notification. --- 692,695 ---- Index: functions_admin.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_admin.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** functions_admin.php 8 Jul 2006 10:21:36 -0000 1.7 --- functions_admin.php 1 Aug 2006 21:00:37 -0000 1.8 *************** *** 66,73 **** $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=edit&cat=$category_id" ); ! $edit = '<a href="' . $temp_url . '"><img src="' . $images['kb_icon_edit'] . '" border="0" alt="' . $lang['Edit'] . '"></a>'; $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=delete&cat=$category_id" ); ! $delete = '<a href="' . $temp_url . '" class="gen"><img src="' . $images['kb_icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=up&cat=$category_id" ); --- 66,73 ---- $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=edit&cat=$category_id" ); ! $edit = '<a href="' . $temp_url . '">'.$lang['Edit'].'</a>'; $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=delete&cat=$category_id" ); ! $delete = '<a href="' . $temp_url . '" class="gen">'.$lang['Delete'].'</a>'; $temp_url = append_sid( $module_root_path . "admin/admin_kb.$phpEx?action=cat_manage&mode=up&cat=$category_id" ); --- functions_cache.php DELETED --- Index: functions_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_comment.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** functions_comment.php 5 Jul 2006 22:48:26 -0000 1.8 --- functions_comment.php 1 Aug 2006 21:00:37 -0000 1.9 *************** *** 94,101 **** $this->forum_id = $mx_kb->modules[$mx_kb->module_name]->comments[$this->cat_id]['comments_forum_id']; ! $this->auth['auth_view'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_comment']; ! $this->auth['auth_post'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_comment']; ! $this->auth['auth_edit'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_comment']; ! $this->auth['auth_delete'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_comment']; $this->auth['auth_mod'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_mod']; --- 94,101 ---- $this->forum_id = $mx_kb->modules[$mx_kb->module_name]->comments[$this->cat_id]['comments_forum_id']; ! $this->auth['auth_view'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_view_comment']; ! $this->auth['auth_post'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_post_comment']; ! $this->auth['auth_edit'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_edit_comment']; ! $this->auth['auth_delete'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_delete_comment']; $this->auth['auth_mod'] = $mx_kb->modules[$mx_kb->module_name]->auth_user[$this->cat_id]['auth_mod']; *************** *** 378,382 **** // Instantiate the mx_text and mx_text_formatting classes // - include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); $mx_text = new mx_text(); $mx_text->init($html_on, $bbcode_on, $smilies_on); // Note: allowed_html_tags is altered above --- 378,381 ---- Index: functions_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_auth.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions_auth.php 7 Jun 2006 20:28:54 -0000 1.3 --- functions_auth.php 1 Aug 2006 21:00:37 -0000 1.4 *************** *** 15,18 **** --- 15,58 ---- /** + * Auth Defs. + * + */ + define('KB_AUTH_ALL', 0); // In reality only option used ;) + define('KB_AUTH_VIEW', 1); + define('KB_AUTH_EDIT', 2); + define('KB_AUTH_DELETE', 3); + define('KB_AUTH_POST', 4); + define('KB_AUTH_RATE', 5); + + define('KB_AUTH_VIEW_COMMENT', 10); + define('KB_AUTH_POST_COMMENT', 11); + define('KB_AUTH_EDIT_COMMENT', 12); + define('KB_AUTH_DELETE_COMMENT', 13); + + define('KB_AUTH_APPROVAL', 20); + define('KB_AUTH_APPROVAL_EDIT', 21); + + /** + * Auth API. + * + * $class->auth_user['auth_view']; + * $class->auth_user['auth_post']; + * $class->auth_user['auth_edit']; + * $class->auth_user['auth_delete']; + * + * $class->auth_user['auth_approval']; + * $class->auth_user['auth_approval_edit']; + * + * $class->auth_user['auth_rate']; + * + * $class->auth_user['auth_view_comment']; + * $class->auth_user['auth_post_comment']; + * $class->auth_user['auth_edit_comment']; + * $class->auth_user['auth_delete_comment']; + * + * $class->auth_user['auth_mod']; + */ + + /** * Enter description here... * *************** *** 29,36 **** * @param unknown_type $userdata * @param unknown_type $f_access - * @param unknown_type $f_access_group * @return unknown */ ! function auth( $type, $cat_id, $userdata, $f_access = '', $f_access_group = '' ) { global $db, $lang; --- 69,75 ---- * @param unknown_type $userdata * @param unknown_type $f_access * @return unknown */ ! function auth( $type, $cat_id, $userdata, $f_access = '' ) { global $db, $lang; *************** *** 38,49 **** switch ( $type ) { ! case AUTH_ALL: ! $a_sql = 'a.auth_view, a.auth_post, a.auth_rate, a.auth_comment, a.auth_edit, a.auth_delete, a.auth_approval, a.auth_approval_edit'; ! $a_sql_groups = 'a.auth_view_groups, a.auth_post_groups, a.auth_rate_groups, a.auth_comment_groups, a.auth_edit_groups, a.auth_delete_groups, a.auth_approval_groups, a.auth_approval_edit_groups'; ! $auth_fields = array( 'auth_view', 'auth_post', 'auth_rate', 'auth_comment', 'auth_edit', 'auth_delete', 'auth_approval', 'auth_approval_edit' ); ! $auth_fields_groups = array( 'auth_view_groups', 'auth_post_groups', 'auth_rate_groups', 'auth_comment_groups', 'auth_edit_groups', 'auth_delete_groups', 'auth_approval_groups', 'auth_approval_edit_groups' ); break; ! case AUTH_VIEW: $a_sql = 'a.auth_view'; $a_sql_groups = 'a.auth_view_groups'; --- 77,88 ---- switch ( $type ) { ! case KB_AUTH_ALL: ! $a_sql = 'a.auth_view, a.auth_edit, a.auth_delete, a.auth_post, a.auth_rate, a.auth_view_comment, a.auth_post_comment, a.auth_edit_comment, a.auth_delete_comment, a.auth_approval, a.auth_approval_edit'; ! $a_sql_groups = 'a.auth_view_groups, a.auth_edit_groups, a.auth_delete_groups, a.auth_post_groups, a.auth_rate_groups, a.auth_view_comment_groups, a.auth_post_comment_groups, a.auth_edit_comment_groups, a.auth_delete_comment_groups, a.auth_approval_groups, a.auth_approval_edit_groups'; ! $auth_fields = array( 'auth_view', 'auth_edit', 'auth_delete', 'auth_post', 'auth_rate', 'auth_view_comment', 'auth_post_comment', 'auth_edit_comment', 'auth_delete_comment', 'auth_approval', 'auth_approval_edit' ); ! $auth_fields_groups = array( 'auth_view_groups', 'auth_edit_groups', 'auth_delete_groups', 'auth_post_groups', 'auth_rate_groups', 'auth_view_comment_groups', 'auth_post_comment_groups', 'auth_edit_comment_groups', 'auth_delete_comment_groups', 'auth_approval_groups', 'auth_approval_edit_groups' ); break; ! case KB_AUTH_VIEW: $a_sql = 'a.auth_view'; $a_sql_groups = 'a.auth_view_groups'; *************** *** 52,56 **** break; ! case AUTH_POST: $a_sql = 'a.auth_post'; $a_sql_groups = 'a.auth_post_groups'; --- 91,109 ---- break; ! case KB_AUTH_EDIT: ! $a_sql = 'a.auth_edit'; ! $a_sql_groups = 'a.auth_edit_groups'; ! $auth_fields = array( 'auth_edit' ); ! $auth_fields_groups = array( 'auth_edit_groups' ); ! break; ! ! case KB_AUTH_DELETE: ! $a_sql = 'a.auth_delete'; ! $a_sql_groups = 'a.auth_delete_groups'; ! $auth_fields = array( 'auth_delete' ); ! $auth_fields_groups = array( 'auth_delete_groups' ); ! break; ! ! case KB_AUTH_POST: $a_sql = 'a.auth_post'; $a_sql_groups = 'a.auth_post_groups'; *************** *** 59,63 **** break; ! case AUTH_RATE: $a_sql = 'a.auth_rate'; $a_sql_groups = 'a.auth_rate_groups'; --- 112,116 ---- break; ! case KB_AUTH_RATE: $a_sql = 'a.auth_rate'; $a_sql_groups = 'a.auth_rate_groups'; *************** *** 66,91 **** break; ! case AUTH_COMMENT: ! $a_sql = 'a.auth_comment'; ! $a_sql_groups = 'a.auth_comment_groups'; ! $auth_fields = array( 'auth_comment' ); ! $auth_fields_groups = array( 'auth_comment_groups' ); break; ! case AUTH_EDIT: ! $a_sql = 'a.auth_edit'; ! $a_sql_groups = 'a.auth_edit_groups'; ! $auth_fields = array( 'auth_edit' ); ! $auth_fields_groups = array( 'auth_edit_groups' ); break; ! case AUTH_DELETE: ! $a_sql = 'a.auth_delete'; ! $a_sql_groups = 'a.auth_delete_groups'; ! $auth_fields = array( 'auth_delete' ); ! $auth_fields_groups = array( 'auth_delete_groups' ); break; ! case AUTH_APPROVAL: $a_sql = 'a.auth_approval'; $a_sql_groups = 'a.auth_approval_groups'; --- 119,151 ---- break; ! case KB_AUTH_VIEW_COMMENT: ! $a_sql = 'a.auth_view_comment'; ! $a_sql_groups = 'a.auth_view_comment_groups'; ! $auth_fields = array( 'auth_view_comment' ); ! $auth_fields_groups = array( 'auth_view_comment_groups' ); break; ! case KB_AUTH_POST_COMMENT: ! $a_sql = 'a.auth_post_comment'; ! $a_sql_groups = 'a.auth_post_comment_groups'; ! $auth_fields = array( 'auth_post_comment' ); ! $auth_fields_groups = array( 'auth_post_comment_groups' ); break; ! case KB_AUTH_EDIT_COMMENT: ! $a_sql = 'a.auth_edit_comment'; ! $a_sql_groups = 'a.auth_edit_comment_groups'; ! $auth_fields = array( 'auth_edit_comment' ); ! $auth_fields_groups = array( 'auth_edit_comment_groups' ); break; ! case KB_AUTH_DELETE_COMMENT: ! $a_sql = 'a.auth_delete_comment'; ! $a_sql_groups = 'a.auth_delete_comment_groups'; ! $auth_fields = array( 'auth_delete_comment' ); ! $auth_fields_groups = array( 'auth_delete_comment_groups' ); ! break; ! ! case KB_AUTH_APPROVAL: $a_sql = 'a.auth_approval'; $a_sql_groups = 'a.auth_approval_groups'; *************** *** 94,98 **** break; ! case AUTH_APPROVAL_EDIT: $a_sql = 'a.auth_approval_edit'; $a_sql_groups = 'a.auth_approval_edit_groups'; --- 154,158 ---- break; ! case KB_AUTH_APPROVAL_EDIT: $a_sql = 'a.auth_approval_edit'; $a_sql_groups = 'a.auth_approval_edit_groups'; *************** *** 115,119 **** $forum_match_sql = ( $cat_id != AUTH_LIST_ALL ) ? "WHERE a.category_id = $cat_id" : ''; ! $sql = "SELECT a.category_id, $a_sql FROM " . KB_CATEGORIES_TABLE . " a $forum_match_sql"; --- 175,179 ---- $forum_match_sql = ( $cat_id != AUTH_LIST_ALL ) ? "WHERE a.category_id = $cat_id" : ''; ! $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " a $forum_match_sql"; *************** *** 133,162 **** } - // - // If f_access_group has not been passed, or auth is needed to return an array of forums - // then we need to pull the auth information on the given forum (or all forums) - // - if ( empty($f_access_group) ) - { - $forum_match_sql = ( $cat_id != AUTH_LIST_ALL ) ? "WHERE a.category_id = $cat_id" : ''; - - $sql = "SELECT a.category_id, $a_sql_groups, a.auth_moderator_groups - FROM " . KB_CATEGORIES_TABLE . " a - $forum_match_sql"; - if ( !($result = $db->sql_query($sql)) ) - { - mx_message_die(GENERAL_ERROR, 'Failed obtaining forum access control lists', '', __LINE__, __FILE__, $sql); - } - - $sql_fetchrow = ( $cat_id != AUTH_LIST_ALL ) ? 'sql_fetchrow' : 'sql_fetchrowset'; - - if ( !($f_access_group = $db->$sql_fetchrow($result)) ) - { - $db->sql_freeresult($result); - return array(); - } - $db->sql_freeresult($result); - } - $auth_user = array(); for( $i = 0; $i < count( $auth_fields ); $i++ ) --- 193,196 ---- *************** *** 175,179 **** { $value = $f_access[$key]; ! $value_groups = $f_access_group[$key_groups]; switch ( $value ) --- 209,213 ---- { $value = $f_access[$key]; ! $value_groups = $f_access[$key_groups]; switch ( $value ) *************** *** 195,204 **** case AUTH_ACL: // PRIVATE ! $this->auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $value_groups ) || $is_admin : 0; $this->auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $this->auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access_group['auth_moderator_groups'] ) || $is_admin : 0; $this->auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; --- 229,238 ---- case AUTH_ACL: // PRIVATE ! $this->auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $value_groups ) || mx_is_group_member( $f_access['auth_moderator_groups'] ) || $is_admin : 0; $this->auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $this->auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access['auth_moderator_groups'] ) || $is_admin : 0; $this->auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; *************** *** 213,216 **** --- 247,255 ---- break; } + + // + // Fix for multiblocks + // + $this->auth_user[$key] = $this->ns_auth_cat($cat_id) && $this->auth_user[$key]; } else *************** *** 219,223 **** { $value = $f_access[$k][$key]; ! $value_groups = $f_access_group[$k][$key_groups]; $f_cat_id = $f_access[$k]['category_id']; --- 258,262 ---- { $value = $f_access[$k][$key]; ! $value_groups = $f_access[$k][$key_groups]; $f_cat_id = $f_access[$k]['category_id']; *************** *** 242,251 **** case AUTH_ACL: // PRIVATE ! $this->auth_user[$f_cat_id][$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $value_groups ) || $is_admin : 0; $this->auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $this->auth_user[$f_cat_id][$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access_group[$k]['auth_moderator_groups'] ) || $is_admin : 0; $this->auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Moderators']; break; --- 281,290 ---- case AUTH_ACL: // PRIVATE ! $this->auth_user[$f_cat_id][$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $value_groups ) || mx_is_group_member( $f_access[$k]['auth_moderator_groups'] ) || $is_admin : 0; $this->auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $this->auth_user[$f_cat_id][$key] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access[$k]['auth_moderator_groups'] ) || $is_admin : 0; $this->auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Moderators']; break; *************** *** 260,263 **** --- 299,308 ---- break; } + + // + // Fix for multiblocks + // + $this->auth_user[$f_cat_id][$key] = $this->ns_auth_cat($f_cat_id) && $this->auth_user[$f_cat_id][$key]; + } } *************** *** 269,273 **** if ( $cat_id != AUTH_LIST_ALL ) { ! $this->auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access_group['auth_moderator_groups'] ) || $is_admin : 0; } else --- 314,323 ---- if ( $cat_id != AUTH_LIST_ALL ) { ! $this->auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access['auth_moderator_groups'] ) || $is_admin : 0; ! ! // ! // Fix for multiblocks ! // ! $this->auth_user['auth_mod'] = $this->ns_auth_cat($cat_id) && $this->auth_user['auth_mod']; } else *************** *** 277,284 **** $f_cat_id = $f_access[$k]['category_id']; ! $this->auth_user[$f_cat_id]['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access_group[$k]['auth_moderator_groups'] ) || $is_admin : 0; } } - return $this->auth_user; } --- 327,338 ---- $f_cat_id = $f_access[$k]['category_id']; ! $this->auth_user[$f_cat_id]['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_is_group_member( $f_access[$k]['auth_moderator_groups'] ) || $is_admin : 0; ! ! // ! // Fix for multiblocks ! // ! $this->auth_user[$f_cat_id]['auth_mod'] = $this->ns_auth_cat($f_cat_id) && $this->auth_user[$f_cat_id]['auth_mod']; } } } *************** *** 298,304 **** } ! $tmp_kb = $kb_type_select_data[$cat_id] == 1; ! ! return $tmp_kb; } } --- 352,356 ---- } ! return $kb_type_select_data[$cat_id] == 1; } } Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_kb.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** functions_kb.php 8 Jul 2006 10:21:36 -0000 1.14 --- functions_kb.php 1 Aug 2006 21:00:37 -0000 1.15 *************** *** 146,180 **** $this->subcat_rowset[$cat_rowset[$i]['parent']][$cat_rowset[$i]['category_id']] = $cat_rowset[$i]; $this->total_cat++; - } ! // ! // Comments ! // Note: some settings are category dependent, but may use default config settings ! // ! $this->comments[$cat_rowset[$i]['category_id']]['activated'] = $cat_rowset[$i]['cat_allow_comments'] == -1 ? ($kb_config['use_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['cat_allow_comments'] == 1 ? true : false ); ! $this->comments[$cat_rowset[$i]['category_id']]['internal_comments'] = $cat_rowset[$i]['internal_comments'] == -1 ? ($kb_config['internal_comments'] == 1 ? true : false ) : ( $cat_rowset[$i]['internal_comments'] == 1 ? true : false ); // phpBB or internal comments [...1682 lines suppressed...] *************** *** 1819,1825 **** // Just to be safe ;o) // if ( !defined( "ENT_COMPAT" ) ) define( "ENT_COMPAT", 2 ); if ( !defined( "ENT_NOQUOTES" ) ) define( "ENT_NOQUOTES", 0 ); if ( !defined( "ENT_QUOTES" ) ) define( "ENT_QUOTES", 3 ); ! ?> \ No newline at end of file --- 2196,2203 ---- // Just to be safe ;o) // + /* if ( !defined( "ENT_COMPAT" ) ) define( "ENT_COMPAT", 2 ); if ( !defined( "ENT_NOQUOTES" ) ) define( "ENT_NOQUOTES", 0 ); if ( !defined( "ENT_QUOTES" ) ) define( "ENT_QUOTES", 3 ); ! */ ?> \ No newline at end of file --- functions_field.php DELETED --- |