|
From: Jon O. <jon...@us...> - 2005-11-03 12:13:53
|
Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29593/modules/mx_kb/admin Modified Files: admin_kb_art.php admin_kb_auth.php admin_kb_cat.php admin_kb_custom.php admin_kb_rebuild_search.php admin_kb_types.php mx_module_defs.php Removed Files: admin_kb_config.php Log Message: i am rewriting this module... Index: admin_kb_art.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_art.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** admin_kb_art.php 24 Oct 2005 20:15:32 -0000 1.25 --- admin_kb_art.php 3 Nov 2005 12:13:33 -0000 1.26 *************** *** 30,34 **** if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['3_Art_man'] = $file; --- 30,34 ---- if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['3_Art_man'] = $file; *************** *** 39,51 **** include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); - include( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb_auth.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); - include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); } else --- 39,47 ---- include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); + + include( $phpbb_root_path . 'kb/kb_common.' . $phpEx ); } else *************** *** 59,63 **** $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); --- 55,59 ---- $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); *************** *** 73,108 **** require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); - include( $module_root_path . 'includes/kb_constants.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_mx.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } ! // Pull all config data ! $sql = "SELECT * ! FROM " . KB_CONFIG_TABLE; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( CRITICAL_ERROR, "Could not query config information in kb_config", "", __LINE__, __FILE__, $sql ); ! } ! else ! { ! while ( $kb_row = $db->sql_fetchrow( $result ) ) ! { ! $config_name = $kb_row['config_name']; ! $config_value = $kb_row['config_value']; ! $kb_config[$config_name] = $config_value; ! } ! } ! if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) ! { ! $mode = ( isset( $HTTP_POST_VARS['mode'] ) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! } ! else { if ( $approve ) --- 69,84 ---- require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include( $module_root_path . 'kb/kb_common.' . $phpEx ); } ! $mx_kb->init(); ! $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); ! $start = $mx_request_vars->request('start', MX_TYPE_INT, 0); ! $article_id = $mx_request_vars->get('a', MX_TYPE_INT, 0); ! if( empty( $mode ) ) { if ( $approve ) *************** *** 124,130 **** } - $start = ( isset( $HTTP_GET_VARS['start'] ) ) ? intval( $HTTP_GET_VARS['start'] ) : 0; - $article_id = intval( $HTTP_GET_VARS['a'] ); - switch ( $mode ) { --- 100,103 ---- *************** *** 144,151 **** $kb_comment = array(); // Populate the kb_comment variable ! $kb_comment = kb_get_data($kb_row, $userdata ); // Compose post header $subject = $lang['KB_comment_prefix'] . $kb_comment['article_title']; $message_temp = kb_compose_comment( $kb_comment ); --- 117,128 ---- $kb_comment = array(); + // // Populate the kb_comment variable ! // ! $kb_comment = $mx_kb->kb_get_data($kb_row, $userdata ); + // // Compose post header + // $subject = $lang['KB_comment_prefix'] . $kb_comment['article_title']; $message_temp = kb_compose_comment( $kb_comment ); *************** *** 154,163 **** --- 131,144 ---- $kb_update_message = $message_temp['update_message']; + // // Insert comment, if not already present + // if ( $kb_config['use_comments'] ) { if ( !$kb_row['topic_id'] ) { + // // Post + // $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_editor_id'], $kb_comment['article_editor'], $kb_comment['article_editor_sig'], $kb_comment['topic_id'], $kb_update_message ); *************** *** 383,398 **** default: // Generate page ! $template->set_filenames( array( 'body' => 'admin/kb_art_body.tpl' ) ); // edited articles ! get_kb_articles( '', 2, 'editrow', $start ); // need to be approved ! get_kb_articles( '', 0, 'notrow', $start ); // Articles that are approved ! $total_articles = get_kb_articles( '', 1, 'approverow', $start, $kb_config['art_pagination'] ); // Pagination $sql_pag = "SELECT count(article_id) AS total FROM " . KB_ARTICLES_TABLE . " --- 364,390 ---- default: + // // Generate page ! // $template->set_filenames( array( 'body' => 'admin/kb_art_body.tpl' ) ); + // // edited articles ! // ! $mx_kb->get_kb_articles( '', 2, 'editrow', $start ); ! ! // // need to be approved ! // ! $mx_kb->get_kb_articles( '', 0, 'notrow', $start ); ! ! // // Articles that are approved ! // ! $total_articles = $mx_kb->get_kb_articles( '', 1, 'approverow', $start, $kb_config['art_pagination'] ); + // // Pagination + // $sql_pag = "SELECT count(article_id) AS total FROM " . KB_ARTICLES_TABLE . " *************** *** 434,446 **** 'L_KB_ART_DESCRIPTION' => $lang['KB_art_description'] ) ); - - - - break; } $template->pparse( 'body' ); - include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); --- 426,434 ---- 'L_KB_ART_DESCRIPTION' => $lang['KB_art_description'] ) ); break; } + include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse( 'body' ); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); Index: admin_kb_rebuild_search.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_rebuild_search.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** admin_kb_rebuild_search.php 1 Oct 2005 14:13:46 -0000 1.10 --- admin_kb_rebuild_search.php 3 Nov 2005 12:13:33 -0000 1.11 *************** *** 33,37 **** if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['7_Optimize_tables'] = $file; --- 33,37 ---- if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['7_Optimize_tables'] = $file; *************** *** 42,51 **** include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_auth.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } else --- 42,48 ---- include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include( $phpbb_root_path . 'kb/kb_common.' . $phpEx ); } else *************** *** 59,63 **** $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); --- 56,60 ---- $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); *************** *** 73,83 **** require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); - include( $module_root_path . 'includes/kb_constants.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_mx.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } --- 70,76 ---- require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include( $module_root_path . 'kb/kb_common.' . $phpEx ); } *************** *** 190,199 **** } $template->pparse ('body'); - - // - // Page Footer - // - // include('./page_footer_admin.'.$phpEx); include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); --- 183,188 ---- } + include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse ('body'); include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); Index: admin_kb_types.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_types.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** admin_kb_types.php 24 Oct 2005 20:15:32 -0000 1.16 --- admin_kb_types.php 3 Nov 2005 12:13:33 -0000 1.17 *************** *** 30,34 **** if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['5_Types_man'] = $file; --- 30,34 ---- if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['5_Types_man'] = $file; *************** *** 39,48 **** include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_auth.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } else --- 39,45 ---- include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include( $phpbb_root_path . 'kb/kb_common.' . $phpEx ); } else *************** *** 56,60 **** $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); --- 53,57 ---- $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); *************** *** 70,80 **** require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); - include( $module_root_path . 'includes/kb_constants.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_mx.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } --- 67,73 ---- require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include( $module_root_path . 'kb/kb_common.' . $phpEx ); } *************** *** 332,337 **** } $template->pparse( 'body' ); - // include('./page_footer_admin.'.$phpEx); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); --- 325,330 ---- } + include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse( 'body' ); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); Index: mx_module_defs.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/mx_module_defs.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mx_module_defs.php 24 Oct 2005 20:15:32 -0000 1.6 --- mx_module_defs.php 3 Nov 2005 12:13:33 -0000 1.7 *************** *** 94,100 **** $module_root_path = $mx_root_path . $mx_blockcp->module_root_path; ! include_once( $module_root_path . "includes/functions_kb.$phpEx" ); ! include_once( $module_root_path . "includes/kb_constants.$phpEx" ); ! include_once( $module_root_path . "includes/kb_defs.$phpEx" ); $template->set_filenames(array( --- 94,100 ---- $module_root_path = $mx_root_path . $mx_blockcp->module_root_path; ! //include_once( $module_root_path . "kb/includes/functions_kb.$phpEx" ); ! include_once( $module_root_path . "kb/includes/kb_constants.$phpEx" ); ! include_once( $module_root_path . "kb/includes/kb_defs.$phpEx" ); $template->set_filenames(array( Index: admin_kb_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_auth.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** admin_kb_auth.php 1 Oct 2005 14:13:46 -0000 1.10 --- admin_kb_auth.php 3 Nov 2005 12:13:33 -0000 1.11 *************** *** 30,34 **** if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['4_Permissions'] = $file; --- 30,34 ---- if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['4_Permissions'] = $file; *************** *** 39,48 **** include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_auth.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } else --- 39,46 ---- include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); ! include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include( $phpbb_root_path . 'kb/kb_common.' . $phpEx ); ! } else *************** *** 56,60 **** $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); --- 54,58 ---- $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); *************** *** 70,87 **** require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); - include( $module_root_path . 'includes/kb_constants.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_mx.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } if ( !isset( $HTTP_POST_VARS['submit'] ) ) { ! $s_kb_cat_list = get_kb_cat_list( '', 0, 0, 0, 0, true ); ! $template->set_filenames( array( 'body' => 'admin/kb_cat_select_body.tpl' ) ! ); $template->assign_vars( array( 'L_KB_AUTH_TITLE' => $lang['KB_Auth_Title'], --- 68,85 ---- require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include( $module_root_path . 'kb/kb_common.' . $phpEx ); } + $mx_kb->init(); + + // + // Start adminCP + // if ( !isset( $HTTP_POST_VARS['submit'] ) ) { ! $s_kb_cat_list = $mx_kb->get_kb_cat_list( '', 0, 0, 0, 0, true ); ! $template->set_filenames( array( 'body' => 'admin/kb_cat_select_body.tpl' ) ); $template->assign_vars( array( 'L_KB_AUTH_TITLE' => $lang['KB_Auth_Title'], *************** *** 93,98 **** ); $template->pparse( 'body' ); - include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } --- 91,96 ---- ); + include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse( 'body' ); include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } *************** *** 103,108 **** $cat_id = intval( $HTTP_POST_VARS['cat_id'] ); ! $template->set_filenames( array( 'body' => 'admin/kb_cat_auth_body.tpl' ) ! ); $template->assign_vars( array( 'L_ALBUM_AUTH_TITLE' => $lang['Album_Auth_Title'], --- 101,105 ---- $cat_id = intval( $HTTP_POST_VARS['cat_id'] ); ! $template->set_filenames( array( 'body' => 'admin/kb_cat_auth_body.tpl' ) ); $template->assign_vars( array( 'L_ALBUM_AUTH_TITLE' => $lang['Album_Auth_Title'], *************** *** 126,130 **** --- 123,130 ---- ) ); + + // // Get the list of phpBB usergroups + // $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " *************** *** 140,144 **** --- 140,147 ---- $groupdata[] = $kb_row; } + + // // Get info of this cat + // $sql = "SELECT category_id, category_name, 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, auth_moderator_groups FROM " . KB_CATEGORIES_TABLE . " *************** *** 187,192 **** } $template->pparse( 'body' ); - include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } --- 190,195 ---- } + include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse( 'body' ); include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } *************** *** 213,216 **** --- 216,220 ---- mx_message_die( GENERAL_ERROR, 'Could not update KB config table', '', __LINE__, __FILE__, $sql ); } + $message = $lang['KB_Auth_successfully'] . '<br /><br />' . sprintf( $lang['Click_return_KB_auth'], '<a href="' . append_sid( "admin_kb_auth.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); --- admin_kb_config.php DELETED --- Index: admin_kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_cat.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** admin_kb_cat.php 24 Oct 2005 20:15:32 -0000 1.18 --- admin_kb_cat.php 3 Nov 2005 12:13:33 -0000 1.19 *************** *** 30,34 **** if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['2_Cat_man'] = $file; --- 30,34 ---- if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['2_Cat_man'] = $file; *************** *** 39,48 **** include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); - include( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb_auth.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } else --- 39,45 ---- include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); + + include( $phpbb_root_path . 'kb/kb_common.' . $phpEx ); } else *************** *** 56,60 **** $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); --- 53,57 ---- $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); *************** *** 70,80 **** require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); - include( $module_root_path . 'includes/kb_constants.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_mx.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } --- 67,73 ---- require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include( $module_root_path . 'kb/kb_common.' . $phpEx ); } *************** *** 94,98 **** if ( $sel_id == 0 ) ! $forumlist .= '<option value="0" selected > Select a Forum !</option>'; while ( $row = $db->sql_fetchrow( $result ) ) --- 87,93 ---- if ( $sel_id == 0 ) ! { ! $forumlist .= '<option value="0" selected > Select a Forum !</option>'; ! } while ( $row = $db->sql_fetchrow( $result ) ) *************** *** 114,123 **** } ! if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) ! { ! $mode = ( isset( $HTTP_POST_VARS['mode'] ) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! } ! else { if ( $create ) --- 109,117 ---- } + $mx_kb->init(); ! $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); ! ! if ( empty($mode) ) { if ( $create ) *************** *** 147,209 **** $new_cat_name = stripslashes( $HTTP_POST_VARS['new_cat_name'] ); // Generate page ! ! $template->set_filenames( array( 'body' => 'admin/kb_cat_edit_body.tpl' ) ! ); $template->assign_block_vars( 'switch_cat', array() ); ! $template->assign_vars( array( 'L_EDIT_TITLE' => $lang['Create_cat'], ! 'L_EDIT_DESCRIPTION' => $lang['Create_description'], ! 'L_CATEGORY' => $lang['Category'], ! 'L_DESCRIPTION' => $lang['Article_description'], ! 'L_NUMBER_ARTICLES' => $lang['Articles'], ! 'L_CAT_SETTINGS' => $lang['Cat_settings'], ! 'L_CREATE' => $lang['Create'], ! 'L_PARENT' => $lang['Parent'], ! 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( '', 0, 0, 0, 0, true ), ! 'L_FORUM_ID' => $lang['Forum_id'], ! 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => get_forums( ), ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=create" ), ! 'CAT_NAME' => $new_cat_name, ! 'DESC' => '', ! 'NUMBER_ARTICLES' => '0', ! // Category permissions ! 'L_CAT_PERMISSIONS' => $lang['Category_Permissions'], ! 'L_VIEW_LEVEL' => $lang['View_level'], ! 'L_UPLOAD_LEVEL' => $lang['Upload_level'], ! 'L_RATE_LEVEL' => $lang['Rate_level'], ! 'L_COMMENT_LEVEL' => $lang['Comment_level'], ! 'L_EDIT_LEVEL' => $lang['Edit_level'], ! 'L_DELETE_LEVEL' => $lang['Delete_level'], ! 'L_APPROVAL_LEVEL' => $lang['Approval_level'], ! 'L_APPROVAL_EDIT_LEVEL' => $lang['Approval_edit_level'], ! 'L_GUEST' => $lang['Forum_ALL'], ! 'L_REG' => $lang['Forum_REG'], ! 'L_PRIVATE' => $lang['Forum_PRIVATE'], ! 'L_MOD' => $lang['Forum_MOD'], ! 'L_ADMIN' => $lang['Forum_ADMIN'], ! 'L_DISABLED' => $lang['Disabled'], ! 'VIEW_GUEST' => 'selected="selected"', ! 'UPLOAD_REG' => 'selected="selected"', ! 'RATE_REG' => 'selected="selected"', ! 'COMMENT_REG' => 'selected="selected"', ! 'EDIT_REG' => 'selected="selected"', ! 'DELETE_MOD' => 'selected="selected"', ! 'APPROVAL_DISABLED' => 'selected="selected"', ! 'S_GUEST' => AUTH_ALL, ! 'S_USER' => AUTH_REG, ! 'S_PRIVATE' => AUTH_ACL, ! 'S_MOD' => AUTH_MOD, ! 'S_ADMIN' => AUTH_ADMIN ! ) ); } else if ( $HTTP_POST_VARS['submit'] ) --- 141,204 ---- $new_cat_name = stripslashes( $HTTP_POST_VARS['new_cat_name'] ); + // // Generate page ! // ! $template->set_filenames( array( 'body' => 'admin/kb_cat_edit_body.tpl' ) ); $template->assign_block_vars( 'switch_cat', array() ); ! $template->assign_vars( array( ! 'L_EDIT_TITLE' => $lang['Create_cat'], ! 'L_EDIT_DESCRIPTION' => $lang['Create_description'], ! 'L_CATEGORY' => $lang['Category'], ! 'L_DESCRIPTION' => $lang['Article_description'], ! 'L_NUMBER_ARTICLES' => $lang['Articles'], ! 'L_CAT_SETTINGS' => $lang['Cat_settings'], ! 'L_CREATE' => $lang['Create'], ! 'L_PARENT' => $lang['Parent'], ! 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => $mx_kb->get_kb_cat_list( '', 0, 0, 0, 0, true ), ! 'L_FORUM_ID' => $lang['Forum_id'], ! 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => get_forums( ), ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=create" ), ! 'CAT_NAME' => $new_cat_name, ! 'DESC' => '', ! 'NUMBER_ARTICLES' => '0', ! // Category permissions ! 'L_CAT_PERMISSIONS' => $lang['Category_Permissions'], ! 'L_VIEW_LEVEL' => $lang['View_level'], ! 'L_UPLOAD_LEVEL' => $lang['Upload_level'], ! 'L_RATE_LEVEL' => $lang['Rate_level'], ! 'L_COMMENT_LEVEL' => $lang['Comment_level'], ! 'L_EDIT_LEVEL' => $lang['Edit_level'], ! 'L_DELETE_LEVEL' => $lang['Delete_level'], ! 'L_APPROVAL_LEVEL' => $lang['Approval_level'], ! 'L_APPROVAL_EDIT_LEVEL' => $lang['Approval_edit_level'], ! 'L_GUEST' => $lang['Forum_ALL'], ! 'L_REG' => $lang['Forum_REG'], ! 'L_PRIVATE' => $lang['Forum_PRIVATE'], ! 'L_MOD' => $lang['Forum_MOD'], ! 'L_ADMIN' => $lang['Forum_ADMIN'], ! 'L_DISABLED' => $lang['Disabled'], ! 'VIEW_GUEST' => 'selected="selected"', ! 'UPLOAD_REG' => 'selected="selected"', ! 'RATE_REG' => 'selected="selected"', ! 'COMMENT_REG' => 'selected="selected"', ! 'EDIT_REG' => 'selected="selected"', ! 'DELETE_MOD' => 'selected="selected"', ! 'APPROVAL_DISABLED' => 'selected="selected"', ! 'S_GUEST' => AUTH_ALL, ! 'S_USER' => AUTH_REG, ! 'S_PRIVATE' => AUTH_ACL, ! 'S_MOD' => AUTH_MOD, ! 'S_ADMIN' => AUTH_ADMIN ! )); } else if ( $HTTP_POST_VARS['submit'] ) *************** *** 224,227 **** --- 219,223 ---- mx_message_die(GENERAL_MESSAGE , 'Select a Forum'); } + $view_level = intval( $HTTP_POST_VARS['auth_view'] ); $post_level = intval( $HTTP_POST_VARS['auth_post'] ); *************** *** 235,238 **** --- 231,235 ---- $sql = "SELECT MAX(cat_order) AS cat_order FROM " . KB_CATEGORIES_TABLE . " WHERE parent = $parent"; + if ( !( $result = $db->sql_query( $sql ) ) ) { *************** *** 244,247 **** --- 241,245 ---- mx_message_die( GENERAL_ERROR, 'Could not obtain next type id', '', __LINE__, __FILE__, $sql ); } + $cat_order = $id['cat_order'] + 10; *************** *** 272,275 **** --- 270,274 ---- mx_message_die( GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql ); } + if ( $kb_cat = $db->sql_fetchrow( $results ) ) { *************** *** 281,288 **** } // Generate page ! ! $template->set_filenames( array( 'body' => 'admin/kb_cat_edit_body.tpl' ) ! ); $template->assign_block_vars( 'switch_cat', array() ); --- 280,287 ---- } + // // Generate page ! // ! $template->set_filenames( array( 'body' => 'admin/kb_cat_edit_body.tpl' ) ); $template->assign_block_vars( 'switch_cat', array() ); *************** *** 300,304 **** 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( '', $parent, $parent, true, 0, true ), 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=edit" ), --- 299,303 ---- 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => $mx_kb->get_kb_cat_list( '', $parent, $parent, true, 0, true ), 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=edit" ), *************** *** 377,381 **** 'S_ADMIN' => AUTH_ADMIN, - 'S_HIDDEN' => '<input type="hidden" name="catid" value="' . $cat_id . '">' ) ); --- 376,379 ---- *************** *** 399,403 **** $approval_edit_level = intval( $HTTP_POST_VARS['auth_approval_edit'] ); - if ( !$cat_name ) { --- 397,400 ---- *************** *** 437,460 **** } // Generate page ! ! $template->set_filenames( array( 'body' => 'admin/kb_cat_del_body.tpl' ) ! ); ! $template->assign_vars( array( 'L_DELETE_TITLE' => $lang['Cat_delete_title'], ! 'L_DELETE_DESCRIPTION' => $lang['Cat_delete_desc'], ! 'L_CAT_DELETE' => $lang['Cat_delete_title'], ! 'L_DELETE_ARTICLES' => $lang['Delete_all_articles'], ! 'L_CAT_NAME' => $lang['Article_category'], ! 'L_MOVE_CONTENTS' => $lang['Move_contents'], ! 'L_DELETE' => $lang['Move_and_Delete'], ! 'S_HIDDEN_FIELDS' => '<input type="hidden" name="catid" value="' . $cat_id . '">', ! 'S_SELECT_TO' => get_kb_cat_list( '', $cat_id, 0, true, 0, true ), ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=delete" ), ! 'CAT_NAME' => $cat_name ) ! ); } else if ( $HTTP_POST_VARS['submit'] ) --- 434,458 ---- } + // // Generate page ! // ! $template->set_filenames( array( 'body' => 'admin/kb_cat_del_body.tpl' ) ); ! $template->assign_vars( array( ! 'L_DELETE_TITLE' => $lang['Cat_delete_title'], ! 'L_DELETE_DESCRIPTION' => $lang['Cat_delete_desc'], ! 'L_CAT_DELETE' => $lang['Cat_delete_title'], ! 'L_DELETE_ARTICLES' => $lang['Delete_all_articles'], ! 'L_CAT_NAME' => $lang['Article_category'], ! 'L_MOVE_CONTENTS' => $lang['Move_contents'], ! 'L_DELETE' => $lang['Move_and_Delete'], ! 'S_HIDDEN_FIELDS' => '<input type="hidden" name="catid" value="' . $cat_id . '">', ! 'S_SELECT_TO' => $mx_kb->get_kb_cat_list( '', $cat_id, 0, true, 0, true ), ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=delete" ), ! 'CAT_NAME' => $cat_name ) ! ); } else if ( $HTTP_POST_VARS['submit'] ) *************** *** 628,632 **** --- 626,633 ---- 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=create" ) ) ); + + // // get categories + // $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " *************** *** 665,687 **** $template->assign_block_vars( 'catrow', array( 'CATEGORY' => $category_link, ! 'CAT_DESCRIPTION' => $category_details, ! 'CAT_ARTICLES' => $category_articles, ! 'U_EDIT' => $edit, ! 'U_DELETE' => $delete, ! 'U_UP' => $up, ! 'U_DOWN' => $down, ! 'ROW_COLOR' => '#' . $row_color, ! 'ROW_CLASS' => $row_class ) ! ); $i++; $ss++; ! $ss = get_kb_cat_subs_admin( $category_id, '1', ' ', $ss ); } break; } $template->pparse( 'body' ); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); --- 666,689 ---- $template->assign_block_vars( 'catrow', array( 'CATEGORY' => $category_link, ! 'CAT_DESCRIPTION' => $category_details, ! 'CAT_ARTICLES' => $category_articles, ! 'U_EDIT' => $edit, ! 'U_DELETE' => $delete, ! 'U_UP' => $up, ! 'U_DOWN' => $down, ! 'ROW_COLOR' => '#' . $row_color, ! 'ROW_CLASS' => $row_class ! )); $i++; $ss++; ! $ss = $mx_kb->get_kb_cat_subs_admin( $category_id, '1', ' ', $ss ); } break; } + include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse( 'body' ); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); Index: admin_kb_custom.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_custom.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** admin_kb_custom.php 1 Oct 2005 14:13:46 -0000 1.10 --- admin_kb_custom.php 3 Nov 2005 12:13:33 -0000 1.11 *************** *** 30,34 **** if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['6_Custom_Field'] = $file; --- 30,34 ---- if ( !empty( $setmodules ) ) { ! include_once( $phpbb_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); $module['KB_title']['6_Custom_Field'] = $file; *************** *** 39,48 **** include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); - include( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb_auth.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } else --- 39,45 ---- include( $phpbb_root_path . 'config.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_admin.'.$phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); + + include( $phpbb_root_path . 'kb/kb_common.' . $phpEx ); } else *************** *** 56,60 **** $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); --- 53,57 ---- $module_root_path = './../modules/mx_kb/'; require_once( $mx_root_path . 'extension.inc' ); ! include_once( $module_root_path . 'kb/includes/kb_constants.' . $phpEx ); $file = basename( __FILE__ ); *************** *** 70,80 **** require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); - include( $module_root_path . 'includes/kb_constants.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); - include( $module_root_path . 'includes/functions_kb_mx.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } --- 67,73 ---- require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! ! include( $module_root_path . 'kb/kb_common.' . $phpEx ); } *************** *** 300,306 **** } $template->pparse( 'admin' ); - - // MX Module include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); --- 293,298 ---- } + include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse( 'admin' ); include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); |