|
From: Jon O. <jon...@us...> - 2005-11-03 12:13:52
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29593/modules/mx_kb Modified Files: kb.php Log Message: i am rewriting this module... Index: kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** kb.php 24 Oct 2005 20:15:33 -0000 1.24 --- kb.php 3 Nov 2005 12:13:34 -0000 1.25 *************** *** 34,51 **** // Start session management - $userdata = session_pagestart( $user_ip, PAGE_KB ); init_userprefs( $userdata ); - // End session management - - include( $phpbb_root_path . 'includes/functions_post.' . $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_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); - include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } else // --------------------------------------------------------------------------------- mxBB Module MODE --- 34,40 ---- *************** *** 61,68 **** // Start session management - $userdata = session_pagestart( $user_ip, PAGE_INDEX ); mx_init_userprefs( $userdata ); - // End session management --- 50,55 ---- *************** *** 119,123 **** // ! // Read Block Settings // $title = !empty( $mx_block->block_info['block_title'] ) ? $mx_block->block_info['block_title'] : $lang['KB_title']; --- 106,110 ---- // ! // Read Block Settings (default mode) // $title = !empty( $mx_block->block_info['block_title'] ) ? $mx_block->block_info['block_title'] : $lang['KB_title']; *************** *** 125,143 **** $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); $is_block = true; global $images; } ! // Extract 'what posts to view info', the cool Array ;) ! $kb_type_select_var = $mx_block->get_parameters( 'kb_type_select' ); ! $kb_type_select_data = ( !empty( $kb_type_select_var ) ) ? unserialize( $kb_type_select_var ) : array(); ! ! include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); ! include( $module_root_path . 'includes/kb_constants.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); ! include_once( $module_root_path . 'includes/functions_kb_mx.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); } --- 112,126 ---- $block_size = ( isset( $block_size ) && !empty( $block_size ) ? $block_size : '100%' ); + // + // Extract 'what posts to view info', the cool Array ;) + // + $kb_type_select_var = $mx_block->get_parameters( 'kb_type_select' ); + $kb_type_select_data = ( !empty( $kb_type_select_var ) ) ? unserialize( $kb_type_select_var ) : array(); + $is_block = true; global $images; } ! } *************** *** 146,158 **** // ------------------------------------------------------------------------------------------------------------------------- ! // Start KB SCRIPT ! ! // Instanciate custom fields ! $kb_custom_field = new kb_custom_field(); ! $kb_custom_field->init(); $show_new = true; ! // page number if ( isset( $HTTP_POST_VARS['page_num'] ) || isset( $HTTP_GET_VARS['page_num'] ) ) --- 129,143 ---- // ------------------------------------------------------------------------------------------------------------------------- ! // =================================================== ! // Include the common file ! // =================================================== ! include_once( $module_root_path . 'kb/kb_common.' . $phpEx ); $show_new = true; ! // =================================================== ! // Get action variable other wise set it to the main ! // =================================================== ! $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, 'main'); if ( isset( $HTTP_POST_VARS['page_num'] ) || isset( $HTTP_GET_VARS['page_num'] ) ) *************** *** 176,198 **** } ! // 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_config_row = $db->sql_fetchrow( $result ) ) ! { ! $config_name = $kb_config_row['config_name']; ! $config_value = $kb_config_row['config_value']; ! $kb_config[$config_name] = $config_value; ! } ! } ! // options $kb_wysiwyg = false; if ( $kb_config['wysiwyg'] ) // Html Textblock --- 161,167 ---- } ! // // options + // $kb_wysiwyg = false; if ( $kb_config['wysiwyg'] ) // Html Textblock *************** *** 214,320 **** } - if ( MXBB_MODULE ) - { - // Newssuite operation mode? - //------------------------------------------------------------------------- - $total_blockk = count( $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['blocks'] ); - - $kb_config['news_operate_mode'] = ''; - for( $blockk = 0; $blockk < $total_blockk; $blockk++ ) - { - if ( $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_source_switch']['parameter_value'] == 'kb' && $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_mode_operate']['parameter_value'] == 'Source' ) - { - $newssuite_select_par = $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_type_select']['parameter_value']; - // Extract 'what posts to view info', the cool Array ;) - $news_type_select_data = array(); - $news_type_select_temp = $newssuite_select_par; - $news_type_select_temp = stripslashes( $news_type_select_temp ); - $news_type_select_data = eval( "return " . $news_type_select_temp . ";" ); - $kb_config['news_operate_mode'] = true; - } - else - { - $kb_config['news_operate_mode'] = ''; - } - } - // ------------------------------------------------------------------------- - } - $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; ! // mode ! 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']; ! $mode = ( htmlspecialchars( $mode ) != 'cat' || intval ($HTTP_GET_VARS['cat'] ) != 0 ) ? htmlspecialchars( $mode ) : ''; ! } ! ! if ( isset( $HTTP_POST_VARS['stats'] ) || isset( $HTTP_GET_VARS['stats'] ) ) { ! $stats = ( isset( $HTTP_POST_VARS['stats'] ) ) ? $HTTP_POST_VARS['stats'] : $HTTP_GET_VARS['stats']; ! $stats = htmlspecialchars( $stats ); } ! $reader_mode = false; ! if ( $mode == 'article' ) ! { ! include( $module_root_path . 'includes/kb_article.' . $phpEx ); ! } ! else if ( $mode == 'cat' ) ! { ! include( $module_root_path . 'includes/kb_cat.' . $phpEx ); ! } ! else if ( $mode == 'add' ) ! { ! include( $module_root_path . 'includes/kb_post.' . $phpEx ); ! } ! else if ( $mode == 'search' ) ! { ! include( $module_root_path . 'includes/kb_search.' . $phpEx ); ! } ! else if ( $mode == 'edit' ) ! { ! include( $module_root_path . 'includes/kb_post.' . $phpEx ); ! } ! else if ( $mode == 'rate' ) ! { ! include( $module_root_path . 'includes/kb_rate.' . $phpEx ); ! } ! else if ( $mode == 'stats' ) ! { ! include( $module_root_path . 'includes/kb_stats.' . $phpEx ); ! } ! else if ( $mode == 'moderate' ) { ! include( $module_root_path . 'includes/kb_moderator.' . $phpEx ); } ! else ! { ! // DEFAULT ACTION ! $page_title = $lang['KB_title']; ! if ( !$is_block ) ! { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! } ! // load header ! include ( $module_root_path . "includes/kb_header." . $phpEx ); ! ! $template->set_filenames( array( 'body' => 'kb_index_body.tpl' ) ! ); ! ! $template->assign_vars( array( 'L_CATEGORY' => $lang['Category'], ! 'L_ARTICLES' => $lang['Articles'] ) ! ); ! get_kb_cat_index(); } ! $template->pparse( 'body' ); ! // load footer if ( !$print_version ) { ! include ( $module_root_path . "includes/kb_footer." . $phpEx ); } --- 183,239 ---- } $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; + $reader_mode = false; ! // =================================================== ! // if the database disabled give them a nice message ! // =================================================== ! if ( intval( $kb_config['disable'] ) ) { ! // mx_message_die( GENERAL_MESSAGE, $lang['pafiledb_disable'] ); } ! // =================================================== ! // an array of all expected actions ! // =================================================== ! $actions = array( ! 'article' => 'article', ! 'cat' => 'cat', ! 'add' => 'post', ! 'search' => 'search', ! 'edit' => 'post', ! 'rate' => 'rate', ! 'stats' => 'stats', ! 'moderate' => 'moderator', ! 'main' => 'main' ); ! ! // =================================================== ! // Lets Build the page ! // =================================================== ! if ( !$is_block && !$print_version) { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); } ! ! $mx_kb->module( $actions[$mode] ); ! $mx_kb->modules[$actions[$mode]]->main( $mode ); ! // ! // load module header ! // ! if ( !$print_version ) ! { ! kb_page_header( $page_title ); } ! $template->pparse( 'body' ); ! // ! // load module footer ! // if ( !$print_version ) { ! kb_page_footer(); } *************** *** 323,326 **** include( $mx_root_path . 'includes/page_tail.' . $phpEx ); } - ?> \ No newline at end of file --- 242,244 ---- |