|
From: Jon O. <jon...@us...> - 2005-04-09 21:41:37
|
Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1717/modules/mx_kb/admin Modified Files: admin_kb_art.php admin_kb_auth.php admin_kb_cat.php admin_kb_config.php admin_kb_custom.php admin_kb_rebuild_search.php admin_kb_types.php kb_config.php Log Message: dev work is kept up in the dev forums... Index: admin_kb_art.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_art.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** admin_kb_art.php 5 Apr 2005 20:52:20 -0000 1.19 --- admin_kb_art.php 9 Apr 2005 21:41:27 -0000 1.20 *************** *** 43,51 **** 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 { define( 'IN_PORTAL', 1 ); if ( !empty( $setmodules ) ) --- 43,55 ---- 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 { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 56,61 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 60,68 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); *************** *** 79,86 **** else { ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $config_name = $row['config_name']; ! $config_value = $row['config_value']; $kb_config[$config_name] = $config_value; } --- 86,93 ---- 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; } *************** *** 125,129 **** mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $row = $db->sql_fetchrow( $results ); $topic_sql = ''; --- 132,136 ---- mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } ! $kb_row = $db->sql_fetchrow( $results ); $topic_sql = ''; *************** *** 132,136 **** // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata ); // Compose post header --- 139,143 ---- // Populate the kb_comment variable ! $kb_comment = kb_get_data($kb_row, $userdata ); // Compose post header *************** *** 144,148 **** if ( $kb_config['use_comments'] ) { ! if ( !$row['topic_id'] ) { // Post --- 151,155 ---- if ( $kb_config['use_comments'] ) { ! if ( !$kb_row['topic_id'] ) { // Post *************** *** 161,169 **** } ! $article_category_id = $row['article_category_id']; update_kb_number( $article_category_id, '+ 1' ); ! kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'] ); ! mx_add_search_words( 'single', $article_id, stripslashes( $row['article_body'] ), stripslashes( $row['article_title'] ), 'kb' ); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . "&start=" . $start . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); --- 168,176 ---- } ! $article_category_id = $kb_row['article_category_id']; update_kb_number( $article_category_id, '+ 1' ); ! kb_notify( $kb_config['notify'], $kb_message, $kb_config['admin_id'], $kb_comment['article_editor_id'], 'approved' ); ! mx_add_search_words( 'single', $article_id, stripslashes( $kb_row['article_body'] ), stripslashes( $kb_row['article_title'] ), 'kb' ); $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . "&start=" . $start . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); *************** *** 191,197 **** } ! if ( $row = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $row['article_category_id']; } --- 198,204 ---- } ! if ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $article_category_id = $kb_row['article_category_id']; } *************** *** 240,248 **** $count_sql = array(); ! while ( $row = $db->sql_fetchrow( $result ) ) { $count_sql[] = "UPDATE " . USERS_TABLE . " ! SET user_posts = user_posts - " . $row['posts'] . " ! WHERE user_id = " . $row['poster_id']; } $db->sql_freeresult( $result ); --- 247,255 ---- $count_sql = array(); ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { $count_sql[] = "UPDATE " . USERS_TABLE . " ! SET user_posts = user_posts - " . $kb_row['posts'] . " ! WHERE user_id = " . $kb_row['poster_id']; } $db->sql_freeresult( $result ); *************** *** 269,275 **** $forum_id = array(); ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $forum_id = $row['forum_id']; } $db->sql_freeresult( $result ); --- 276,282 ---- $forum_id = array(); ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $forum_id = $kb_row['forum_id']; } $db->sql_freeresult( $result ); *************** *** 286,293 **** $ii = 0; $post_id_sql = ''; ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $post_array[$ii] = $row['post_id']; ! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $row['post_id']; $ii++; } --- 293,300 ---- $ii = 0; $post_id_sql = ''; ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $post_array[$ii] = $kb_row['post_id']; ! $post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $kb_row['post_id']; $ii++; } Index: kb_config.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/kb_config.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** kb_config.php 18 Feb 2005 10:07:43 -0000 1.7 --- kb_config.php 9 Apr 2005 21:41:27 -0000 1.8 *************** *** 19,29 **** * (at your option) any later version. */ define( 'IN_PORTAL', true ); - $mx_root_path = '../../../'; - $module_root_path = "../"; require( $mx_root_path . 'admin/pagestart.php' ); if ( !empty( $HTTP_POST_VARS['mode'] ) || !empty( $HTTP_GET_VARS['mode'] ) ) --- 19,36 ---- * (at your option) any later version. */ + + $mx_root_path = './../../../'; + $module_root_path = "./../"; define( 'IN_PORTAL', true ); + define( 'MXBB_MODULE', true ); + define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); require( $mx_root_path . 'admin/pagestart.php' ); + if ( MXBB_27x ) + { + mx_message_die(GENERAL_MESSAGE, 'Sorry, but this feature is only available for core 2.8.+. In older versions you cannot create several instances of kb blocks.'); + } if ( !empty( $HTTP_POST_VARS['mode'] ) || !empty( $HTTP_GET_VARS['mode'] ) ) Index: admin_kb_config.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_config.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** admin_kb_config.php 2 Apr 2005 22:03:19 -0000 1.18 --- admin_kb_config.php 9 Apr 2005 21:41:27 -0000 1.19 *************** *** 48,51 **** --- 48,52 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 56,61 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 57,65 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); Index: admin_kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_cat.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** admin_kb_cat.php 2 Apr 2005 22:03:19 -0000 1.11 --- admin_kb_cat.php 9 Apr 2005 21:41:27 -0000 1.12 *************** *** 48,51 **** --- 48,52 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 56,61 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 57,65 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); *************** *** 154,158 **** 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( 0, 0, 0, true ), 'L_FORUM_ID' => $lang['Forum_id'], --- 158,162 ---- 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( '', 0, 0, 0, 0, true ), 'L_FORUM_ID' => $lang['Forum_id'], *************** *** 290,294 **** 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( $parent, 1, true, true ), 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=edit" ), --- 294,298 ---- '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" ), *************** *** 442,446 **** 'S_HIDDEN_FIELDS' => '<input type="hidden" name="catid" value="' . $cat_id . '">', ! 'S_SELECT_TO' => get_kb_cat_list( $cat_id, 0, true, true ), 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=delete" ), --- 446,450 ---- '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" ), Index: admin_kb_rebuild_search.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_rebuild_search.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_kb_rebuild_search.php 2 Apr 2005 22:03:19 -0000 1.4 --- admin_kb_rebuild_search.php 9 Apr 2005 21:41:27 -0000 1.5 *************** *** 43,46 **** --- 43,47 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 51,56 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 52,60 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); Index: admin_kb_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_auth.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** admin_kb_auth.php 2 Apr 2005 22:03:19 -0000 1.5 --- admin_kb_auth.php 9 Apr 2005 21:41:27 -0000 1.6 *************** *** 47,50 **** --- 47,51 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 55,60 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 56,64 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); *************** *** 70,74 **** if ( !isset( $HTTP_POST_VARS['submit'] ) ) { ! $s_kb_cat_list = get_kb_cat_list( 0, 0, 0, true ); $template->set_filenames( array( 'body' => 'admin/kb_cat_select_body.tpl' ) ); --- 74,78 ---- 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' ) ); *************** *** 108,113 **** 'L_EDIT' => $lang['Edit'], 'L_DELETE' => $lang['Delete'], ! 'L_APPROVAL' => $lang['Approval'], ! 'L_APPROVAL_EDIT' => $lang['Approval_edit'], 'L_IS_MODERATOR' => $lang['Is_Moderator'], --- 112,117 ---- 'L_EDIT' => $lang['Edit'], 'L_DELETE' => $lang['Delete'], ! // 'L_APPROVAL' => $lang['Approval'], ! // 'L_APPROVAL_EDIT' => $lang['Approval_edit'], 'L_IS_MODERATOR' => $lang['Is_Moderator'], *************** *** 125,131 **** } ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $groupdata[] = $row; } // Get info of this cat --- 129,135 ---- } ! while ( $kb_row = $db->sql_fetchrow( $result ) ) { ! $groupdata[] = $kb_row; } // Get info of this cat *************** *** 146,151 **** $edit_groups = @explode( ',', $thiscat['auth_edit_groups'] ); $delete_groups = @explode( ',', $thiscat['auth_delete_groups'] ); ! $approval_groups = @explode( ',', $thiscat['auth_approval_groups'] ); ! $approval_edit_groups = @explode( ',', $thiscat['auth_approval_edit_groups'] ); $moderator_groups = @explode( ',', $thiscat['auth_moderator_groups'] ); --- 150,155 ---- $edit_groups = @explode( ',', $thiscat['auth_edit_groups'] ); $delete_groups = @explode( ',', $thiscat['auth_delete_groups'] ); ! // $approval_groups = @explode( ',', $thiscat['auth_approval_groups'] ); ! // $approval_edit_groups = @explode( ',', $thiscat['auth_approval_edit_groups'] ); $moderator_groups = @explode( ',', $thiscat['auth_moderator_groups'] ); *************** *** 168,174 **** '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"' : '' ) --- 172,178 ---- '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"' : '' ) *************** *** 190,195 **** $edit_groups = @implode( ',', $HTTP_POST_VARS['edit'] ); $delete_groups = @implode( ',', $HTTP_POST_VARS['delete'] ); ! $approval_groups = @implode( ',', $HTTP_POST_VARS['approval'] ); ! $approval_edit_groups = @implode( ',', $HTTP_POST_VARS['approval_edit'] ); $moderator_groups = @implode( ',', $HTTP_POST_VARS['moderator'] ); --- 194,199 ---- $edit_groups = @implode( ',', $HTTP_POST_VARS['edit'] ); $delete_groups = @implode( ',', $HTTP_POST_VARS['delete'] ); ! // $approval_groups = @implode( ',', $HTTP_POST_VARS['approval'] ); ! // $approval_edit_groups = @implode( ',', $HTTP_POST_VARS['approval_edit'] ); $moderator_groups = @implode( ',', $HTTP_POST_VARS['moderator'] ); Index: admin_kb_types.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_types.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** admin_kb_types.php 2 Apr 2005 22:03:19 -0000 1.10 --- admin_kb_types.php 9 Apr 2005 21:41:27 -0000 1.11 *************** *** 48,51 **** --- 48,52 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 56,61 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 57,65 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); Index: admin_kb_custom.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_custom.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_kb_custom.php 2 Apr 2005 22:03:19 -0000 1.4 --- admin_kb_custom.php 9 Apr 2005 21:41:27 -0000 1.5 *************** *** 39,42 **** --- 39,43 ---- { define( 'IN_PORTAL', 1 ); + define( 'MXBB_MODULE', true ); if ( !empty( $setmodules ) ) *************** *** 47,52 **** } ! $mx_root_path = '../../../'; ! $module_root_path = "../"; require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); --- 48,56 ---- } ! $mx_root_path = './../../../'; ! $module_root_path = "./../"; ! ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); ! require( $mx_root_path . 'extension.inc' ); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); *************** *** 61,64 **** --- 65,85 ---- // =================================================== + // addslashes to vars if magic_quotes_gpc is off + // =================================================== + if ( !@function_exists( 'slash_input_data' ) ) + { + function slash_input_data( &$data ) + { + if ( is_array( $data ) ) + { + foreach ( $data as $k => $v ) + { + $data[$k] = ( is_array( $v ) ) ? slash_input_data( $v ) : addslashes( $v ); + } + } + return $data; + } + } + // =================================================== // to make it work with php version under 4.1 and other stuff // =================================================== |