Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21631/modules/mx_kb/admin Modified Files: admin_kb_art.php admin_kb_auth.php admin_kb_cat.php admin_kb_custom.php admin_kb_settings.php admin_kb_types.php mx_module_defs.php Log Message: Finalizing this module Index: admin_kb_settings.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_settings.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_kb_settings.php 2 May 2006 23:27:19 -0000 1.4 --- admin_kb_settings.php 17 Jun 2006 20:11:23 -0000 1.5 *************** *** 37,40 **** --- 37,41 ---- include( $phpbb_root_path . 'kb/kb_common.' . $phpEx ); + include( $phpbb_root_path . 'kb/includes/functions_admin.' . $phpEx ); } else *************** *** 65,68 **** --- 66,70 ---- include( $module_root_path . 'kb/kb_common.' . $phpEx ); + include( $module_root_path . 'kb/includes/functions_admin.' . $phpEx ); } *************** *** 231,234 **** --- 233,238 ---- $internal_comments_phpbb = ( !$new['internal_comments'] ) ? "checked=\"checked\"" : ""; + $comments_forum_id = $new['comments_forum_id']; + $del_topic_yes = ( $new['del_topic'] ) ? "checked=\"checked\"" : ""; $del_topic_no = ( !$new['del_topic'] ) ? "checked=\"checked\"" : ""; *************** *** 443,446 **** --- 447,454 ---- 'L_INTERNAL_COMMENTS_PHPBB' => $lang['Internal_comments_phpBB'], + 'L_FORUM_ID' => $lang['Forum_id'], + 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], + 'FORUM_LIST' => get_forums( $comments_forum_id, false, 'comments_forum_id' ), + 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], 'L_AUTOGENERATE_COMMENTS_EXPLAIN' => $lang['Autogenerate_comments_explain'], Index: admin_kb_art.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_art.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** admin_kb_art.php 7 Jun 2006 20:28:54 -0000 1.30 --- admin_kb_art.php 17 Jun 2006 20:11:23 -0000 1.31 *************** *** 68,79 **** --- 68,87 ---- { include( $module_root_path . 'language/lang_english/lang_admin.' . $phpEx ); + include( $module_root_path . 'language/lang_english/lang_main.' . $phpEx ); // Notification } else { include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); + include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); // Notification } + // + // Init + // $mx_kb->init(); + // + // Get vars/mode + // $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); $start = $mx_request_vars->request('start', MX_TYPE_INT, 0); *************** *** 116,144 **** $topic_sql = ''; - /* - $kb_comment = array(); - - // Populate the kb_comment variable - $kb_comment = $this->kb_get_data($kb_row, $userdata ); - - // Compose post header - $subject = $lang['KB_comment_prefix'] . $kb_comment['article_title']; - $message_temp = $this->kb_compose_comment( $kb_comment ); - - $kb_message = $message_temp['message']; - $kb_update_message = $message_temp['update_message']; - - 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 ); - - $topic_sql = ", topic_id = " . $topic_data['topic_id']; - } - } - */ - $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 1 " . $topic_sql . " WHERE article_id = " . $article_id; --- 124,127 ---- *************** *** 149,159 **** } - /* - $this->kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'], 'approved' ); - */ - $mx_kb->modified( true ); $mx_kb->_kb(); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . "&start=" . $start . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); --- 132,143 ---- } $mx_kb->modified( true ); $mx_kb->_kb(); + // + // Notification + // + $mx_kb->update_add_article_notify($article_id, 'approve'); + $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . "&start=" . $start . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); *************** *** 174,177 **** --- 158,166 ---- $mx_kb->_kb(); + // + // Notification + // + $mx_kb->update_add_article_notify($article_id, 'unapprove'); + $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . "&start=" . $start . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); *************** *** 194,205 **** $article_info = $db->sql_fetchrow( $result ); ! if ( $mx_kb->comments[$article_info['article_category_id']]['activated'] && !$mx_kb->comments[$article_info['article_category_id']]['internal_comments'] && $kb_config['del_topic'] && $article_info['topic_id'] ) { ! include( $module_root_path . 'kb/includes/functions_comment.' . $phpEx ); ! $mx_kb_comments = new mx_kb_comments(); ! $mx_kb_comments->init( $article_info, 'phpbb' ); ! $mx_kb_comments->post('delete', $article_info['topic_id']); } $sql = "DELETE FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; --- 183,217 ---- $article_info = $db->sql_fetchrow( $result ); ! // ! // Comments ! // ! if ( $mx_kb->comments[$article_info['article_category_id']]['activated'] && $kb_config['del_topic']) { ! if ( $mx_kb->comments[$article_info['article_category_id']]['internal_comments'] ) ! { ! $sql = "DELETE FROM " . KB_COMMENTS_TABLE . " WHERE article_id = " . $article_id; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not delete article comments data", '', __LINE__, __FILE__, $sql ); ! } ! } ! else ! { ! if ( $article_info['topic_id'] ) ! { ! include( $module_root_path . 'kb/includes/functions_comment.' . $phpEx ); ! $mx_kb_comments = new mx_kb_comments(); ! $mx_kb_comments->init( $article_info, 'phpbb' ); ! $mx_kb_comments->post('delete_all', $article_info['topic_id']); ! } ! } } + // + // Notification + // + $mx_kb->update_add_article_notify($article_id, 'delete'); + $sql = "DELETE FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; *************** *** 293,296 **** $template->pparse( 'body' ); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); - ?> \ No newline at end of file --- 305,307 ---- Index: admin_kb_types.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_types.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** admin_kb_types.php 7 Jun 2006 20:28:54 -0000 1.21 --- admin_kb_types.php 17 Jun 2006 20:11:23 -0000 1.22 *************** *** 32,35 **** --- 32,36 ---- include( $phpbb_root_path . 'kb/kb_common.' . $phpEx ); + include( $phpbb_root_path . 'kb/includes/functions_admin.' . $phpEx ); } else *************** *** 60,93 **** include( $module_root_path . 'kb/kb_common.' . $phpEx ); ! } ! ! function get_list_kb( $id, $select ) ! { ! global $db; ! ! $idfield = 'id'; ! $namefield = 'type'; ! ! $sql = "SELECT * ! FROM " . KB_TYPES_TABLE; ! ! if ( $select == 0 ) ! { ! $sql .= " WHERE $idfield <> $id"; ! } ! ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Couldn't get list of types", "", __LINE__, __FILE__, $sql ); ! } ! ! $typelist = ""; ! ! while ( $row = $db->sql_fetchrow( $result ) ) ! { ! $typelist .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\n"; ! } ! ! return( $typelist ); } --- 61,65 ---- include( $module_root_path . 'kb/kb_common.' . $phpEx ); ! include( $module_root_path . 'kb/includes/functions_admin.' . $phpEx ); } *************** *** 104,109 **** } ! // Load default header ! if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) { --- 76,82 ---- } ! // ! // Load mode ! // if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) { *************** *** 149,153 **** $message = $lang['Type_created'] . '<br /><br />' . sprintf( $lang['Click_return_type_manager'], '<a href="' . append_sid( "admin_kb_types.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); - mx_message_die( GENERAL_MESSAGE, $message ); break; --- 122,125 ---- *************** *** 174,187 **** $template->set_filenames( array( 'body' => 'admin/kb_type_edit_body.tpl' ) ); ! $template->assign_vars( array( 'L_EDIT_TITLE' => $lang['Edit_type'], ! 'L_CATEGORY' => $lang['Article_type'], ! 'L_CAT_SETTINGS' => $lang['Cat_settings'], ! 'L_CREATE' => $lang['Edit'], ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_types.$phpEx?mode=edit" ), ! 'CAT_NAME' => $type, ! 'S_HIDDEN' => '<input type="hidden" name="typeid" value="' . $type_id . '">' ) ! ); } else if ( $HTTP_POST_VARS['submit'] ) --- 146,160 ---- $template->set_filenames( array( 'body' => 'admin/kb_type_edit_body.tpl' ) ); ! $template->assign_vars( array( ! 'L_EDIT_TITLE' => $lang['Edit_type'], ! 'L_CATEGORY' => $lang['Article_type'], ! 'L_CAT_SETTINGS' => $lang['Cat_settings'], ! 'L_CREATE' => $lang['Edit'], ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_types.$phpEx?mode=edit" ), ! 'CAT_NAME' => $type, ! 'S_HIDDEN' => '<input type="hidden" name="typeid" value="' . $type_id . '">' ! )); } else if ( $HTTP_POST_VARS['submit'] ) *************** *** 204,208 **** $message = $lang['Type_edited'] . '<br /><br />' . sprintf( $lang['Click_return_type_manager'], '<a href="' . append_sid( "admin_kb_types.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); - mx_message_die( GENERAL_MESSAGE, $message ); } --- 177,180 ---- *************** *** 230,250 **** // Generate page ! $template->set_filenames( array( 'body' => 'admin/kb_cat_del_body.tpl' ) ! ); ! $template->assign_vars( array( 'L_DELETE_TITLE' => $lang['Type_delete_title'], ! 'L_DELETE_DESCRIPTION' => $lang['Type_delete_desc'], ! 'L_CAT_DELETE' => $lang['Type_delete_title'], ! 'L_CAT_NAME' => $lang['Article_type'], ! 'L_MOVE_CONTENTS' => $lang['Change_type'], ! 'L_DELETE' => $lang['Change_and_Delete'], ! 'S_HIDDEN_FIELDS' => '<input type="hidden" name="typeid" value="' . $type_id . '">', ! 'S_SELECT_TO' => get_list_kb( $type_id, 0 ), ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_types.$phpEx?mode=delete" ), ! 'CAT_NAME' => $type_name ) ! ); } else if ( $HTTP_POST_VARS['submit'] ) --- 202,222 ---- // Generate page ! $template->set_filenames( array( 'body' => 'admin/kb_cat_del_body.tpl' ) ); ! $template->assign_vars( array( ! 'L_DELETE_TITLE' => $lang['Type_delete_title'], ! 'L_DELETE_DESCRIPTION' => $lang['Type_delete_desc'], ! 'L_CAT_DELETE' => $lang['Type_delete_title'], ! 'L_CAT_NAME' => $lang['Article_type'], ! 'L_MOVE_CONTENTS' => $lang['Change_type'], ! 'L_DELETE' => $lang['Change_and_Delete'], ! 'S_HIDDEN_FIELDS' => '<input type="hidden" name="typeid" value="' . $type_id . '">', ! 'S_SELECT_TO' => get_list_kb( $type_id, 0 ), ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_types.$phpEx?mode=delete" ), ! 'CAT_NAME' => $type_name ! )); } else if ( $HTTP_POST_VARS['submit'] ) *************** *** 257,260 **** --- 229,233 ---- $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET article_type = '$new_type' WHERE article_type = '$old_type'"; + if ( !( $move_result = $db->sql_query( $sql ) ) ) { *************** *** 262,265 **** --- 235,239 ---- } } + $sql = "DELETE FROM " . KB_TYPES_TABLE . " WHERE id = $old_type"; *************** *** 270,274 **** $message = $lang['Type_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_type_manager'], '<a href="' . append_sid( "admin_kb_types.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); - mx_message_die( GENERAL_MESSAGE, $message ); } --- 244,247 ---- *************** *** 279,298 **** // Generate page ! $template->set_filenames( array( 'body' => 'admin/kb_type_body.tpl' ) ! ); ! $template->assign_vars( array( 'L_KB_TYPE_TITLE' => $lang['Types_man'], ! 'L_KB_TYPE_DESCRIPTION' => $lang['KB_types_description'], ! 'L_CREATE_TYPE' => $lang['Create_type'], ! 'L_CREATE' => $lang['Create'], ! 'L_TYPE' => $lang['Article_type'], ! 'L_ACTION' => $lang['Art_action'], ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_types.$phpEx?mode=create" ) ) ! ); ! // get categories ! $sql = "SELECT * ! FROM " . KB_TYPES_TABLE; if ( !( $cat_result = $db->sql_query( $sql ) ) ) --- 252,273 ---- // Generate page ! $template->set_filenames( array( 'body' => 'admin/kb_type_body.tpl' ) ); ! $template->assign_vars( array( ! 'L_KB_TYPE_TITLE' => $lang['Types_man'], ! 'L_KB_TYPE_DESCRIPTION' => $lang['KB_types_description'], ! 'L_CREATE_TYPE' => $lang['Create_type'], ! 'L_CREATE' => $lang['Create'], ! 'L_TYPE' => $lang['Article_type'], ! 'L_ACTION' => $lang['Art_action'], ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_types.$phpEx?mode=create" ) ! )); ! ! // ! // get types ! // ! $sql = "SELECT * FROM " . KB_TYPES_TABLE; if ( !( $cat_result = $db->sql_query( $sql ) ) ) *************** *** 315,325 **** $row_class = ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $template->assign_block_vars( 'typerow', array( 'TYPE' => $type_name, ! 'U_EDIT' => $edit, ! 'U_DELETE' => $delete, ! 'ROW_COLOR' => '#' . $row_color, ! 'ROW_CLASS' => $row_class ) ! ); $i++; } --- 290,301 ---- $row_class = ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $template->assign_block_vars( 'typerow', array( ! 'TYPE' => $type_name, ! 'U_EDIT' => $edit, ! 'U_DELETE' => $delete, ! 'ROW_COLOR' => '#' . $row_color, ! 'ROW_CLASS' => $row_class ! )); $i++; } Index: mx_module_defs.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/mx_module_defs.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mx_module_defs.php 5 Apr 2006 22:34:48 -0000 1.9 --- mx_module_defs.php 17 Jun 2006 20:11:23 -0000 1.10 *************** *** 9,12 **** --- 9,17 ---- */ + if ( !defined( 'IN_PORTAL' ) ) + { + die( "Hacking attempt" ); + } + /********************************************************************************\ | Class: mx_module_defs *************** *** 32,43 **** { global $lang; ! if (empty($type_row)) { $type_row = array(); } ! $type_row['kb_type_select'] = !empty($lang['ParType_kb_type_select']) ? $lang['ParType_kb_type_select'] : "KB phpBB Source Forums"; ! return $type_row; } --- 37,48 ---- { global $lang; ! if (empty($type_row)) { $type_row = array(); } ! $type_row['kb_type_select'] = !empty($lang['ParType_kb_type_select']) ? $lang['ParType_kb_type_select'] : "KB phpBB Source Forums"; ! return $type_row; } *************** *** 49,57 **** { global $HTTP_POST_VARS, $db, $board_config, $mx_blockcp, $mx_root_path, $phpEx; ! global $html_entities_match, $html_entities_replace; $parameter_value = $HTTP_POST_VARS[$parameter_data['parameter_name']]; $parameter_opt = ''; ! switch ( $parameter_data['parameter_type'] ) { --- 54,62 ---- { global $HTTP_POST_VARS, $db, $board_config, $mx_blockcp, $mx_root_path, $phpEx; ! global $html_entities_match, $html_entities_replace; $parameter_value = $HTTP_POST_VARS[$parameter_data['parameter_name']]; $parameter_opt = ''; ! switch ( $parameter_data['parameter_type'] ) { *************** *** 60,67 **** break; } ! return array('parameter_value' => $parameter_value, 'parameter_opt' => $parameter_opt); } ! // =================================================== // display parameter field and data in the add/edit page --- 65,72 ---- break; } ! return array('parameter_value' => $parameter_value, 'parameter_opt' => $parameter_opt); } ! // =================================================== // display parameter field and data in the add/edit page *************** *** 78,82 **** } } ! function display_edit_KB_type_select( $block_id, $parameter_id, $parameter_data ) { --- 83,87 ---- } } ! function display_edit_KB_type_select( $block_id, $parameter_id, $parameter_data ) { *************** *** 91,97 **** 'parameter' => 'admin/mx_module_parameters.tpl') ); ! // Get number of forums in db ! $sql = "SELECT * FROM " . NEWS_CAT_TABLE . " ORDER BY $cat_extract_order"; --- 96,102 ---- 'parameter' => 'admin/mx_module_parameters.tpl') ); ! // Get number of forums in db ! $sql = "SELECT * FROM " . NEWS_CAT_TABLE . " ORDER BY $cat_extract_order"; *************** *** 100,130 **** mx_message_die( GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql ); } ! $forums = $db->sql_fetchrowset( $result ); $kb_type_select_data = ( !empty( $parameter_data['parameter_value'] ) ) ? unserialize($parameter_data['parameter_value']) : array(); ! ! // // Check that some categories exist ! // $categories = array ( 0 => array ( 0 => '1', 'cat_id' => '1', 1 => 'KB', 'cat_title' => 'KB', ) ); ! if ( $total_categories = count( $categories ) ) ! { ! // // Check that some forums exist (these were queried earlier) ! // if ( $total_forums = count( $forums ) ) { ! $template->assign_block_vars( 'switch_forums_phpbb', array( 'COLSPAN' => count( $item_types_array ) + 2 ) ); ! for( $i = 0; $i < $total_categories; $i++ ) { $template->assign_block_vars( 'catrow', array( 'CAT_ID' => $categories[$i]['cat_id'], 'COLSPAN' => count( $item_types_array ) + 1, ! 'CAT_NAME' => $categories[$i]['cat_title'] ) ); ! for( $j = 0; $j < $total_forums; $j++ ) { --- 105,135 ---- mx_message_die( GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql ); } ! $forums = $db->sql_fetchrowset( $result ); $kb_type_select_data = ( !empty( $parameter_data['parameter_value'] ) ) ? unserialize($parameter_data['parameter_value']) : array(); ! ! // // Check that some categories exist ! // $categories = array ( 0 => array ( 0 => '1', 'cat_id' => '1', 1 => 'KB', 'cat_title' => 'KB', ) ); ! if ( $total_categories = count( $categories ) ) ! { ! // // Check that some forums exist (these were queried earlier) ! // if ( $total_forums = count( $forums ) ) { ! $template->assign_block_vars( 'switch_forums_phpbb', array( 'COLSPAN' => count( $item_types_array ) + 2 ) ); ! for( $i = 0; $i < $total_categories; $i++ ) { $template->assign_block_vars( 'catrow', array( 'CAT_ID' => $categories[$i]['cat_id'], 'COLSPAN' => count( $item_types_array ) + 1, ! 'CAT_NAME' => $categories[$i]['cat_title'] ) ); ! for( $j = 0; $j < $total_forums; $j++ ) { *************** *** 134,139 **** 'FORUM_NAME' => $forums[$j][$catt_name], 'FORUM_DESC' => $forums[$j][$catt_desc], ! ! 'CHECKED' => ( $kb_type_select_data[$forums[$j][$cool_array_category_id]]['forum_news'] ? 'CHECKED' : '' ) ) ); } --- 139,144 ---- 'FORUM_NAME' => $forums[$j][$catt_name], 'FORUM_DESC' => $forums[$j][$catt_desc], ! ! 'CHECKED' => ( $kb_type_select_data[$forums[$j][$cool_array_category_id]]['forum_news'] ? 'CHECKED' : '' ) ) ); } *************** *** 142,146 **** } } ! $template->assign_vars(array( 'NAME' => $lang[$parameter_data['parameter_name']], --- 147,151 ---- } } ! $template->assign_vars(array( 'NAME' => $lang[$parameter_data['parameter_name']], *************** *** 149,161 **** 'PARAMETER_TYPE' => ( !empty($lang["ParType_".$parameter_data['parameter_type']]) ) ? $lang["ParType_".$parameter_data['parameter_type']] : '', 'PARAMETER_TYPE_EXPLAIN' => ( !empty($lang["ParType_".$parameter_data['parameter_type'] . "_info"]) ) ? '<br />' . $lang["ParType_".$parameter_data['parameter_type'] . "_info"] : '', ! 'SCRIPT_PATH' => $module_root_path, 'I_ANNOUNCE' => $images['kb_folder_announce'], 'I_STICKY' => $images['kb_folder_sticky'], ! 'I_NORMAL' => $images['kb_folder'], )); ! $template->pparse('parameter'); ! } } --- 154,166 ---- 'PARAMETER_TYPE' => ( !empty($lang["ParType_".$parameter_data['parameter_type']]) ) ? $lang["ParType_".$parameter_data['parameter_type']] : '', 'PARAMETER_TYPE_EXPLAIN' => ( !empty($lang["ParType_".$parameter_data['parameter_type'] . "_info"]) ) ? '<br />' . $lang["ParType_".$parameter_data['parameter_type'] . "_info"] : '', ! 'SCRIPT_PATH' => $module_root_path, 'I_ANNOUNCE' => $images['kb_folder_announce'], 'I_STICKY' => $images['kb_folder_sticky'], ! 'I_NORMAL' => $images['kb_folder'], )); ! $template->pparse('parameter'); ! } } Index: admin_kb_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_auth.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** admin_kb_auth.php 7 Jun 2006 20:28:54 -0000 1.15 --- admin_kb_auth.php 17 Jun 2006 20:11:23 -0000 1.16 *************** *** 75,78 **** --- 75,81 ---- } + // + // Init + // $mx_kb->init(); *************** *** 85,95 **** $template->set_filenames( array( 'body' => 'admin/kb_cat_select_body.tpl' ) ); ! $template->assign_vars( array( 'L_KB_AUTH_TITLE' => $lang['KB_Auth_Title'], ! 'L_KB_AUTH_EXPLAIN' => $lang['KB_Auth_Explain'], ! 'L_SELECT_CAT' => $lang['Select_a_Category'], ! 'S_KB_ACTION' => append_sid( "admin_kb_auth.$phpEx" ), ! 'L_LOOK_UP_CAT' => $lang['Look_up_Category'], ! 'CAT_SELECT_TITLE' => $s_kb_cat_list ) ! ); include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); --- 88,99 ---- $template->set_filenames( array( 'body' => 'admin/kb_cat_select_body.tpl' ) ); ! $template->assign_vars( array( ! 'L_KB_AUTH_TITLE' => $lang['KB_Auth_Title'], ! 'L_KB_AUTH_EXPLAIN' => $lang['KB_Auth_Explain'], ! 'L_SELECT_CAT' => $lang['Select_a_Category'], ! 'S_KB_ACTION' => append_sid( "admin_kb_auth.$phpEx" ), ! 'L_LOOK_UP_CAT' => $lang['Look_up_Category'], ! 'CAT_SELECT_TITLE' => $s_kb_cat_list ! )); include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); *************** *** 101,128 **** if ( !isset( $HTTP_GET_VARS['cat_id'] ) ) { ! $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'], ! 'L_ALBUM_AUTH_EXPLAIN' => $lang['Album_Auth_Explain'], ! 'L_SUBMIT' => $lang['Submit'], ! 'L_RESET' => $lang['Reset'], ! 'L_GROUPS' => $lang['Usergroups'], ! 'L_VIEW' => $lang['View'], ! 'L_UPLOAD' => $lang['Upload'], ! 'L_RATE' => $lang['Rate'], ! 'L_COMMENT' => $lang['Comment'], ! 'L_EDIT' => $lang['Edit'], ! 'L_DELETE' => $lang['Delete'], ! // 'L_APPROVAL' => $lang['Approval'], ! // 'L_APPROVAL_EDIT' => $lang['Approval_edit'], ! 'L_IS_MODERATOR' => $lang['Is_Moderator'], ! 'S_ALBUM_ACTION' => append_sid( "admin_kb_auth.$phpEx?cat_id=$cat_id" ), ! ) ! ); // --- 105,132 ---- if ( !isset( $HTTP_GET_VARS['cat_id'] ) ) { ! $cat_id = $mx_request_vars->request('cat_id', MX_TYPE_INT, ''); $template->set_filenames( array( 'body' => 'admin/kb_cat_auth_body.tpl' ) ); ! $template->assign_vars( array( ! 'L_ALBUM_AUTH_TITLE' => $lang['Album_Auth_Title'], ! 'L_ALBUM_AUTH_EXPLAIN' => $lang['Album_Auth_Explain'], ! 'L_SUBMIT' => $lang['Submit'], ! 'L_RESET' => $lang['Reset'], ! 'L_GROUPS' => $lang['Usergroups'], ! 'L_VIEW' => $lang['View'], ! 'L_UPLOAD' => $lang['Upload'], ! 'L_RATE' => $lang['Rate'], ! 'L_COMMENT' => $lang['Comment'], ! 'L_EDIT' => $lang['Edit'], ! 'L_DELETE' => $lang['Delete'], ! // 'L_APPROVAL' => $lang['Approval'], ! // 'L_APPROVAL_EDIT' => $lang['Approval_edit'], ! 'L_IS_MODERATOR' => $lang['Is_Moderator'], ! 'S_ALBUM_ACTION' => append_sid( "admin_kb_auth.$phpEx?cat_id=$cat_id" ), ! )); // *************** *** 169,193 **** for ( $i = 0; $i < count( $groupdata ); $i++ ) { ! $template->assign_block_vars( 'grouprow', array( 'GROUP_ID' => $groupdata[$i]['group_id'], ! 'GROUP_NAME' => $groupdata[$i]['group_name'], ! ! 'VIEW_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $view_groups ) ) ? 'checked="checked"' : '', ! ! 'POST_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $post_groups ) ) ? 'checked="checked"' : '', ! ! 'RATE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $rate_groups ) ) ? 'checked="checked"' : '', ! ! 'COMMENT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $comment_groups ) ) ? 'checked="checked"' : '', ! ! 'EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $edit_groups ) ) ? 'checked="checked"' : '', ! ! 'DELETE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $delete_groups ) ) ? 'checked="checked"' : '', ! ! // 'APPROVAL_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_groups ) ) ? 'checked="checked"' : '', ! ! // 'APPROVAL_EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_edit_groups ) ) ? 'checked="checked"' : '', ! ! 'MODERATOR_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $moderator_groups ) ) ? 'checked="checked"' : '' ) ! ); } --- 173,189 ---- for ( $i = 0; $i < count( $groupdata ); $i++ ) { ! $template->assign_block_vars( 'grouprow', array( ! 'GROUP_ID' => $groupdata[$i]['group_id'], ! 'GROUP_NAME' => $groupdata[$i]['group_name'], ! 'VIEW_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $view_groups ) ) ? 'checked="checked"' : '', ! 'POST_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $post_groups ) ) ? 'checked="checked"' : '', ! 'RATE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $rate_groups ) ) ? 'checked="checked"' : '', ! 'COMMENT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $comment_groups ) ) ? 'checked="checked"' : '', ! 'EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $edit_groups ) ) ? 'checked="checked"' : '', ! 'DELETE_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $delete_groups ) ) ? 'checked="checked"' : '', ! // 'APPROVAL_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_groups ) ) ? 'checked="checked"' : '', ! // 'APPROVAL_EDIT_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $approval_edit_groups ) ) ? 'checked="checked"' : '', ! 'MODERATOR_CHECKED' => ( in_array( $groupdata[$i]['group_id'], $moderator_groups ) ) ? 'checked="checked"' : '' ! )); } *************** *** 198,202 **** else { ! $cat_id = intval( $HTTP_GET_VARS['cat_id'] ); $view_groups = @implode( ',', $HTTP_POST_VARS['view'] ); --- 194,198 ---- else { ! $cat_id = $mx_request_vars->request('cat_id', MX_TYPE_INT, ''); $view_groups = @implode( ',', $HTTP_POST_VARS['view'] ); *************** *** 208,212 **** // $approval_groups = @implode( ',', $HTTP_POST_VARS['approval'] ); // $approval_edit_groups = @implode( ',', $HTTP_POST_VARS['approval_edit'] ); - $moderator_groups = @implode( ',', $HTTP_POST_VARS['moderator'] ); --- 204,207 ---- *************** *** 224,227 **** } } - ?> \ No newline at end of file --- 219,221 ---- Index: admin_kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_cat.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** admin_kb_cat.php 7 Jun 2006 20:28:54 -0000 1.24 --- admin_kb_cat.php 17 Jun 2006 20:11:23 -0000 1.25 *************** *** 76,79 **** --- 76,82 ---- } + // + // Init + // $mx_kb->init(); *************** *** 119,122 **** --- 122,127 ---- $internal_comments_default = "checked=\"checked\""; + $comments_forum_id = '-1'; + $autogenerate_comments_yes = ""; $autogenerate_comments_no = ""; *************** *** 198,202 **** 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => get_forums( ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], --- 203,207 ---- 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => get_forums( $comments_forum_id, true, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], *************** *** 299,303 **** $cat_internal_comments = ( isset( $HTTP_POST_VARS['internal_comments'] ) ) ? intval( $HTTP_POST_VARS['internal_comments'] ) : 0; $cat_autogenerate_comments = ( isset( $HTTP_POST_VARS['autogenerate_comments'] ) ) ? intval( $HTTP_POST_VARS['autogenerate_comments'] ) : 0; ! $comments_forum_id = intval( $HTTP_POST_VARS['forum_id'] ); $cat_show_pretext = ( isset( $HTTP_POST_VARS['show_pretext'] ) ) ? intval( $HTTP_POST_VARS['show_pretext'] ) : 0; --- 304,308 ---- $cat_internal_comments = ( isset( $HTTP_POST_VARS['internal_comments'] ) ) ? intval( $HTTP_POST_VARS['internal_comments'] ) : 0; $cat_autogenerate_comments = ( isset( $HTTP_POST_VARS['autogenerate_comments'] ) ) ? intval( $HTTP_POST_VARS['autogenerate_comments'] ) : 0; ! $comments_forum_id = intval( $HTTP_POST_VARS['comments_forum_id'] ); $cat_show_pretext = ( isset( $HTTP_POST_VARS['show_pretext'] ) ) ? intval( $HTTP_POST_VARS['show_pretext'] ) : 0; *************** *** 359,363 **** $cat_name = $mx_kb->cat_rowset[$cat_id]['category_name']; $cat_desc = $mx_kb->cat_rowset[$cat_id]['category_details']; ! //$number_articles = $mx_kb->cat_rowset[$cat_id]['number_articles']; $number_articles = $mx_kb->article_in_cat($cat_id); $parent = $mx_kb->cat_rowset[$cat_id]['parent']; --- 364,368 ---- $cat_name = $mx_kb->cat_rowset[$cat_id]['category_name']; $cat_desc = $mx_kb->cat_rowset[$cat_id]['category_details']; ! $number_articles = $mx_kb->article_in_cat($cat_id); $parent = $mx_kb->cat_rowset[$cat_id]['parent']; *************** *** 458,462 **** 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => get_forums( $comments_forum_id ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], --- 463,467 ---- 'L_FORUM_ID' => $lang['Forum_id'], 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], ! 'FORUM_LIST' => get_forums( $comments_forum_id, true, 'comments_forum_id' ), 'L_AUTOGENERATE_COMMENTS' => $lang['Autogenerate_comments'], *************** *** 592,596 **** $cat_internal_comments = ( isset( $HTTP_POST_VARS['internal_comments'] ) ) ? intval( $HTTP_POST_VARS['internal_comments'] ) : 0; $cat_autogenerate_comments = ( isset( $HTTP_POST_VARS['autogenerate_comments'] ) ) ? intval( $HTTP_POST_VARS['autogenerate_comments'] ) : 0; ! $comments_forum_id = intval( $HTTP_POST_VARS['forum_id'] ); $cat_show_pretext = ( isset( $HTTP_POST_VARS['show_pretext'] ) ) ? intval( $HTTP_POST_VARS['show_pretext'] ) : 0; --- 597,601 ---- $cat_internal_comments = ( isset( $HTTP_POST_VARS['internal_comments'] ) ) ? intval( $HTTP_POST_VARS['internal_comments'] ) : 0; $cat_autogenerate_comments = ( isset( $HTTP_POST_VARS['autogenerate_comments'] ) ) ? intval( $HTTP_POST_VARS['autogenerate_comments'] ) : 0; ! $comments_forum_id = intval( $HTTP_POST_VARS['comments_forum_id'] ); $cat_show_pretext = ( isset( $HTTP_POST_VARS['show_pretext'] ) ) ? intval( $HTTP_POST_VARS['show_pretext'] ) : 0; Index: admin_kb_custom.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_custom.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** admin_kb_custom.php 7 Jun 2006 20:28:54 -0000 1.15 --- admin_kb_custom.php 17 Jun 2006 20:11:23 -0000 1.16 *************** *** 178,183 **** } ! $template->set_filenames( array( 'admin' => $template_file ) ! ); switch ( $mode ) --- 178,182 ---- } ! $template->set_filenames( array( 'admin' => $template_file ) ); switch ( $mode ) *************** *** 221,231 **** $template->assign_vars( array( ! 'L_FIELD_TITLE' => $l_title, ! 'L_FIELD_EXPLAIN' => $lang['Fieldexplain'], ! 'L_SELECT_TITLE' => $lang['Fieldselecttitle'], ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_FIELD_ACTION' => append_sid( "admin_kb_custom.$phpEx" ) ) ! ); if ( $mode == 'addfield' || $mode == 'editfield') --- 220,230 ---- $template->assign_vars( array( ! 'L_FIELD_TITLE' => $l_title, ! 'L_FIELD_EXPLAIN' => $lang['Fieldexplain'], ! 'L_SELECT_TITLE' => $lang['Fieldselecttitle'], ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, ! 'S_FIELD_ACTION' => append_sid( "admin_kb_custom.$phpEx" ) ! )); if ( $mode == 'addfield' || $mode == 'editfield') *************** *** 236,272 **** } ! $template->assign_vars( array( 'L_FIELD_NAME' => $lang['Fieldname'], ! 'L_FIELD_NAME_INFO' => $lang['Fieldnameinfo'], ! 'L_FIELD_DESC' => $lang['Fielddesc'], ! 'L_FIELD_DESC_INFO' => $lang['Fielddescinfo'], ! 'L_FIELD_DATA' => $lang['Field_data'], ! 'L_FIELD_DATA_INFO' => $lang['Field_data_info'], ! 'L_FIELD_REGEX' => $lang['Field_regex'], ! 'L_FIELD_REGEX_INFO' => sprintf( $lang['Field_regex_info'], '<a href="http://www.php.net/manual/en/function.preg-match.php" target="_blank">', '</a>' ), ! 'L_FIELD_ORDER' => $lang['Field_order'], ! //'DATA' => ( $field_type != INPUT && $field_type != TEXTAREA ) ? true : false, ! //'REGEX' => ( $field_type == INPUT || $field_type == TEXTAREA ) ? true : false, ! //'ORDER' => ( $field_id ) ? true : false, ! 'FIELD_NAME' => $data['custom_name'], ! 'FIELD_DESC' => $data['custom_description'], ! 'FIELD_DATA' => $data['data'], ! 'FIELD_REGEX' => $data['regex'], ! 'FIELD_ORDER' => $data['field_order'] ) ! ); ! if ( $field_type != INPUT && $field_type != TEXTAREA ) ! { ! $template->assign_block_vars( 'data', array() ); ! } ! if ( $field_type == INPUT || $field_type == TEXTAREA ) ! { ! $template->assign_block_vars( 'regex', array() ); ! } ! if ( $field_id ) ! { ! $template->assign_block_vars( 'order', array() ); ! } } elseif ( $mode == 'add' ) --- 235,272 ---- } ! $template->assign_vars( array( ! 'L_FIELD_NAME' => $lang['Fieldname'], ! 'L_FIELD_NAME_INFO' => $lang['Fieldnameinfo'], ! 'L_FIELD_DESC' => $lang['Fielddesc'], ! 'L_FIELD_DESC_INFO' => $lang['Fielddescinfo'], ! 'L_FIELD_DATA' => $lang['Field_data'], ! 'L_FIELD_DATA_INFO' => $lang['Field_data_info'], ! 'L_FIELD_REGEX' => $lang['Field_regex'], ! 'L_FIELD_REGEX_INFO' => sprintf( $lang['Field_regex_info'], '<a href="http://www.php.net/manual/en/function.preg-match.php" target="_blank">', '</a>' ), ! 'L_FIELD_ORDER' => $lang['Field_order'], ! //'DATA' => ( $field_type != INPUT && $field_type != TEXTAREA ) ? true : false, ! //'REGEX' => ( $field_type == INPUT || $field_type == TEXTAREA ) ? true : false, ! //'ORDER' => ( $field_id ) ? true : false, ! 'FIELD_NAME' => $data['custom_name'], ! 'FIELD_DESC' => $data['custom_description'], ! 'FIELD_DATA' => $data['data'], ! 'FIELD_REGEX' => $data['regex'], ! 'FIELD_ORDER' => $data['field_order'] ! )); ! if ( $field_type != INPUT && $field_type != TEXTAREA ) ! { ! $template->assign_block_vars( 'data', array() ); ! } ! if ( $field_type == INPUT || $field_type == TEXTAREA ) ! { ! $template->assign_block_vars( 'regex', array() ); ! } ! if ( $field_id ) ! { ! $template->assign_block_vars( 'order', array() ); ! } } elseif ( $mode == 'add' ) *************** *** 275,278 **** --- 275,279 ---- $field_type_list = '<select name="field_type">'; + foreach( $field_types as $key => $value ) { *************** *** 281,286 **** $field_type_list .= '</select>'; ! $template->assign_vars( array( 'S_SELECT_FIELD_TYPE' => $field_type_list ) ! ); } elseif ( $mode == 'edit' || $mode == 'delete' || $mode == 'select' ) --- 282,286 ---- $field_type_list .= '</select>'; ! $template->assign_vars( array( 'S_SELECT_FIELD_TYPE' => $field_type_list ) ); } elseif ( $mode == 'edit' || $mode == 'delete' || $mode == 'select' ) *************** *** 289,296 **** { $template->assign_block_vars( 'field_row', array( ! 'FIELD_ID' => $field_id, ! 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_DESC' => $field_data['custom_description'] ) ! ); } } --- 289,296 ---- { $template->assign_block_vars( 'field_row', array( ! 'FIELD_ID' => $field_id, ! 'FIELD_NAME' => $field_data['custom_name'], ! 'FIELD_DESC' => $field_data['custom_description'] ! )); } } *************** *** 299,302 **** $template->pparse( 'admin' ); include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); - ?> \ No newline at end of file --- 299,301 ---- |