Update of /cvsroot/mxbb/kb_076_mxaddon/root/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9026/modules/kb_076_mxaddon/root/admin Modified Files: admin_kb_art.php admin_kb_cat.php admin_kb_config.php admin_kb_types.php Added Files: admin_kb_auth.php admin_kb_custom.php Log Message: ## 2005/03/28 - Version KB MOD 2.01 ## - Name changed, since much is rewritten ;) ## - Updated with latest phpBB security patches ## - Category (PRIVATE) permissions ## - Subcategories ## - Comments phpBB forum set per category ## - Text reformatting options: img, link and linewidth controls ## - Rewritten BBcode/html handling (once more yes) ## - Custom fields added ## - wysiwyg feature (tinymce) ## - All reported bugs in dev thread fixed --- NEW FILE: admin_kb_auth.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal module * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * * $Id: admin_kb_auth.php,v 1.1 2005/03/28 20:54:53 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ if ( file_exists( './../viewtopic.php' ) ) { define( 'IN_PHPBB', 1 ); define( 'IN_PORTAL', 1 ); define( 'MXBB_MODULE', false ); if ( !empty( $setmodules ) ) { $file = basename( __FILE__ ); $module['KB_title']['Permissions'] = $file; return; } $phpbb_root_path = $module_root_path = $mx_root_path = "./../"; require( $phpbb_root_path . 'extension.inc' ); require( './pagestart.' . $phpEx ); 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 { define( 'IN_PORTAL', 1 ); if ( !empty( $setmodules ) ) { $file = basename( __FILE__ ); $module['KB_title']['Permissions'] = "modules/mx_kb/admin/" . $file; return; } $mx_root_path = '../../../'; $module_root_path = "../"; 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( $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, true ); $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 ) ); $template->pparse( 'body' ); include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } else { 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" ), ) ); // Get the list of phpBB usergroups $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " WHERE group_single_user <> " . true . " ORDER BY group_name ASC"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $groupdata[] = $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 . " WHERE category_id = '$cat_id'"; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not get Category information', '', __LINE__, __FILE__, $sql ); } $thiscat = $db->sql_fetchrow( $result ); $view_groups = @explode( ',', $thiscat['auth_view_groups'] ); $post_groups = @explode( ',', $thiscat['auth_post_groups'] ); $rate_groups = @explode( ',', $thiscat['auth_rate_groups'] ); $comment_groups = @explode( ',', $thiscat['auth_comment_groups'] ); $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'] ); 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"' : '' ) ); } $template->pparse( 'body' ); include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } else { $cat_id = intval( $HTTP_GET_VARS['cat_id'] ); $view_groups = @implode( ',', $HTTP_POST_VARS['view'] ); $post_groups = @implode( ',', $HTTP_POST_VARS['post'] ); $rate_groups = @implode( ',', $HTTP_POST_VARS['rate'] ); $comment_groups = @implode( ',', $HTTP_POST_VARS['comment'] ); $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'] ); $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET auth_view_groups = '$view_groups', auth_post_groups = '$post_groups', auth_rate_groups = '$rate_groups', auth_comment_groups = '$comment_groups', auth_edit_groups = '$edit_groups', auth_delete_groups = '$delete_groups', auth_approval_groups = '$approval_groups', auth_approval_edit_groups = '$approval_edit_groups', auth_moderator_groups = '$moderator_groups' WHERE category_id = '$cat_id'"; if ( !$result = $db->sql_query( $sql ) ) { 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>' ); mx_message_die( GENERAL_MESSAGE, $message ); } } ?> Index: admin_kb_config.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/admin/admin_kb_config.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_kb_config.php 9 Jan 2005 22:16:30 -0000 1.1 --- admin_kb_config.php 28 Mar 2005 20:54:53 -0000 1.2 *************** *** 1,9 **** <?php ! /** ! * admin_kb_config.php ! * ------------------- ! * begin : Monday, Mar 31, 2003 ! * copyright : (C) 2001 The phpBB Group ! * email : su...@ph... * * $Id$ --- 1,12 ---- <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : ! * ------------------------------------------------------------------------- * * $Id$ *************** *** 17,104 **** */ ! define( 'IN_PHPBB', 1 ); ! ! if ( !empty( $setmodules ) ) ! { ! $file = basename( __FILE__ ); ! $module['KB_title']['Configuration'] = $file . '?mode=config'; ! return; ! } ! ! // Load default header ! ! $phpbb_root_path = "./../"; ! require( $phpbb_root_path . 'extension.inc' ); ! require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'config.' . $phpEx ); ! require( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); ! include( $phpbb_root_path . 'includes/functions_admin.' . $phpEx ); ! ! function get_forums( $sel_id ) { ! global $db; ! ! $sql = "SELECT forum_id, forum_name ! FROM " . FORUMS_TABLE; ! ! if ( !$result = $db->sql_query( $sql ) ) ! { ! message_die( GENERAL_ERROR, "Couldn't get list of forums", "", __LINE__, __FILE__, $sql ); ! } ! ! $forumlist = '<select name="forum_id">'; ! ! while ( $row = $db->sql_fetchrow( $result ) ) { ! if ( $sel_id == $row['forum_id'] ) ! { ! $status = "selected"; ! } ! else ! { ! $status = ''; ! } ! $forumlist .= '<option value="' . $row['forum_id'] . '" ' . $status . '>' . $row['forum_name'] . '</option>'; ! } ! ! $forumlist .= '</select>'; ! ! return $forumlist; } ! ! function get_groups( $sel_id ) { ! global $db; ! ! $sql = "SELECT group_id, group_name ! FROM " . GROUPS_TABLE; ! ! if ( !$result = $db->sql_query( $sql ) ) ! { ! message_die( GENERAL_ERROR, "Couldn't get list of groups", "", __LINE__, __FILE__, $sql ); ! } ! ! $grouplist = '<select name="mod_group">'; ! ! while ( $row = $db->sql_fetchrow( $result ) ) { ! if ( $row['group_name'] != '' ) ! { ! if ( $sel_id == $row['group_id'] ) ! { ! $status = "selected"; ! } ! else ! { ! $status = ''; ! } ! $grouplist .= '<option value="' . $row['group_id'] . '" ' . $status . '>' . $row['group_name'] . '</option>'; ! } ! } ! ! $grouplist .= '</select>'; ! ! return $grouplist; ! } // Pull all config data --- 20,70 ---- */ ! if ( file_exists( './../viewtopic.php' ) ) { ! define( 'IN_PHPBB', 1 ); ! define( 'IN_PORTAL', 1 ); ! define( 'MXBB_MODULE', false ); ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['KB_title']['Configuration'] = $file; ! return; ! } ! ! $phpbb_root_path = $module_root_path = $mx_root_path = "./../"; ! require( $phpbb_root_path . 'extension.inc' ); ! require( './pagestart.' . $phpEx ); ! 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 { ! define( 'IN_PORTAL', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['KB_title']['Configuration'] = 'modules/mx_kb/admin/' . $file . '?mode=config'; ! return; ! } ! ! $mx_root_path = '../../../'; ! $module_root_path = "../"; ! 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( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); ! } // Pull all config data *************** *** 127,131 **** if ( !$db->sql_query( $sql ) ) { ! message_die( GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql ); } } --- 93,97 ---- if ( !$db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql ); } } *************** *** 134,153 **** if ( isset( $HTTP_POST_VARS['submit'] ) ) { ! $message = $lang['KB_config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_kb_config'], "<a href=\"" . append_sid( "admin_kb_config.$phpEx?mode=config" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . append_sid( $phpbb_root_path . "admin/index.$phpEx?pane=right" ) . "\">", "</a>" ); message_die( GENERAL_MESSAGE, $message ); } } $new_yes = ( $new['allow_new'] ) ? "checked=\"checked\"" : ""; $new_no = ( !$new['allow_new'] ) ? "checked=\"checked\"" : ""; ! $approve_new_yes = ( $new['approve_new'] ) ? "checked=\"checked\"" : ""; ! $approve_new_no = ( !$new['approve_new'] ) ? "checked=\"checked\"" : ""; ! $edit_yes = ( $new['allow_edit'] ) ? "checked=\"checked\"" : ""; ! $edit_no = ( !$new['allow_edit'] ) ? "checked=\"checked\"" : ""; ! $approve_edit_yes = ( $new['approve_edit'] ) ? "checked=\"checked\"" : ""; ! $approve_edit_no = ( !$new['approve_edit'] ) ? "checked=\"checked\"" : ""; $pretext_show = ( $new['show_pretext'] ) ? "checked=\"checked\"" : ""; --- 100,130 ---- if ( isset( $HTTP_POST_VARS['submit'] ) ) { ! $message = $lang['KB_config_updated'] . "<br /><br />" . sprintf( $lang['Click_return_kb_config'], "<a href=\"" . append_sid( "admin_kb_config.$phpEx?mode=config" ) . "\">", "</a>" ) . "<br /><br />" . sprintf( $lang['Click_return_admin_index'], "<a href=\"" . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . "\">", "</a>" ); message_die( GENERAL_MESSAGE, $message ); } } + $new_yes = ( $new['allow_new'] ) ? "checked=\"checked\"" : ""; $new_no = ( !$new['allow_new'] ) ? "checked=\"checked\"" : ""; ! $allow_html_yes = ( $new['allow_html'] ) ? "checked=\"checked\"" : ""; ! $allow_html_no = ( !$new['allow_html'] ) ? "checked=\"checked\"" : ""; ! $allow_bbcode_yes = ( $new['allow_bbcode'] ) ? "checked=\"checked\"" : ""; ! $allow_bbcode_no = ( !$new['allow_bbcode'] ) ? "checked=\"checked\"" : ""; ! $allow_smilies_yes = ( $new['allow_smilies'] ) ? "checked=\"checked\"" : ""; ! $allow_smilies_no = ( !$new['allow_smilies'] ) ? "checked=\"checked\"" : ""; ! ! $formatting_fixup_yes = ( $new['formatting_fixup'] ) ? "checked=\"checked\"" : ""; ! $formatting_fixup_no = ( !$new['formatting_fixup'] ) ? "checked=\"checked\"" : ""; ! ! $wysiwyg_yes = ( $new['wysiwyg'] ) ? "checked=\"checked\"" : ""; ! $wysiwyg_no = ( !$new['wysiwyg'] ) ? "checked=\"checked\"" : ""; ! ! $kb_allowed_html_tags = $new['allowed_html_tags']; ! ! $wysiwyg_path = $new['wysiwyg_path']; $pretext_show = ( $new['show_pretext'] ) ? "checked=\"checked\"" : ""; *************** *** 163,172 **** $admin_id = $new['admin_id']; ! $comments_yes = ( $new['comments'] ) ? "checked=\"checked\"" : ""; ! $comments_no = ( !$new['comments'] ) ? "checked=\"checked\"" : ""; ! $forums = get_forums( $new['forum_id'] ); ! ! $anon_yes = ( $new['allow_anon'] ) ? "checked=\"checked\"" : ""; ! $anon_no = ( !$new['allow_anon'] ) ? "checked=\"checked\"" : ""; $del_topic_yes = ( $new['del_topic'] ) ? "checked=\"checked\"" : ""; --- 140,145 ---- $admin_id = $new['admin_id']; ! $use_comments_yes = ( $new['use_comments'] ) ? "checked=\"checked\"" : ""; ! $use_comments_no = ( !$new['use_comments'] ) ? "checked=\"checked\"" : ""; $del_topic_yes = ( $new['del_topic'] ) ? "checked=\"checked\"" : ""; *************** *** 185,195 **** $header_banner_no = ( !$new['header_banner'] ) ? "checked=\"checked\"" : ""; ! $mod_group = get_groups( $new['mod_group'] ); ! $allow_rating_yes = ( $new['allow_rating'] ) ? "checked=\"checked\"" : ""; ! $allow_rating_no = ( !$new['allow_rating'] ) ? "checked=\"checked\"" : ""; ! $allow_anonymos_rating_yes = ( $new['allow_anonymos_rating'] ) ? "checked=\"checked\"" : ""; ! $allow_anonymos_rating_no = ( !$new['allow_anonymos_rating'] ) ? "checked=\"checked\"" : ""; $votes_check_ip_yes = ( $new['votes_check_ip'] ) ? "checked=\"checked\"" : ""; --- 158,168 ---- $header_banner_no = ( !$new['header_banner'] ) ? "checked=\"checked\"" : ""; ! //$mod_group = get_groups( $new['mod_group'] ); ! $use_ratings_yes = ( $new['use_ratings'] ) ? "checked=\"checked\"" : ""; ! $use_ratings_no = ( !$new['use_ratings'] ) ? "checked=\"checked\"" : ""; ! //$allow_anonymos_rating_yes = ( $new['allow_anonymos_rating'] ) ? "checked=\"checked\"" : ""; ! //$allow_anonymos_rating_no = ( !$new['allow_anonymos_rating'] ) ? "checked=\"checked\"" : ""; $votes_check_ip_yes = ( $new['votes_check_ip'] ) ? "checked=\"checked\"" : ""; *************** *** 200,204 **** $article_pag = $new['art_pagination']; - $comments_pag = $new['comments_pagination']; --- 173,176 ---- *************** *** 258,271 **** 'S_NEW_NO' => $new_no, - 'L_APPROVE_NEW_NAME' => $lang['Approve_new_name'], - 'L_APPROVE_NEW_EXPLAIN' => $lang['Approve_new_explain'], - 'S_APPROVE_NEW_YES' => $approve_new_yes, - 'S_APPROVE_NEW_NO' => $approve_new_no, - - 'L_EDIT_NAME' => $lang['Edit_name'], - 'L_EDIT_EXPLAIN' => $lang['Edit_explain'], - 'S_EDIT_YES' => $edit_yes, - 'S_EDIT_NO' => $edit_no, - 'L_SHOW' => $lang['Show'], 'L_HIDE' => $lang['Hide'], --- 230,233 ---- *************** *** 279,287 **** 'L_PT_BODY' => $pt_body, - 'L_APPROVE_EDIT_NAME' => $lang['Approve_edit_name'], - 'L_APPROVE_EDIT_EXPLAIN' => $lang['Approve_edit_explain'], - 'S_APPROVE_EDIT_YES' => $approve_edit_yes, - 'S_APPROVE_EDIT_NO' => $approve_edit_no, - 'L_NOTIFY_NAME' => $lang['Notify_name'], 'L_NOTIFY_EXPLAIN' => $lang['Notify_explain'], --- 241,244 ---- *************** *** 296,308 **** 'ADMIN_ID' => $admin_id, ! 'L_COMMENTS' => $lang['Allow_comments'], ! 'L_COMMENTS_EXPLAIN' => $lang['Allow_comments_explain'], ! 'S_COMMENTS_YES' => $comments_yes, ! 'S_COMMENTS_NO' => $comments_no, - 'L_FORUM_ID' => $lang['Forum_id'], - 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], - 'FORUMS' => $forums, - // Added by Haplo 'L_RATINGS_INFO' => $lang['Rating_info'], 'L_COMMENTS_INFO' => $lang['Comment_info'], --- 253,261 ---- 'ADMIN_ID' => $admin_id, ! 'L_USE_COMMENTS' => $lang['Use_comments'], ! 'L_USE_COMMENTS_EXPLAIN' => $lang['Use_comments_explain'], ! 'S_USE_COMMENTS_YES' => $use_comments_yes, ! 'S_USE_COMMENTS_NO' => $use_comments_no, 'L_RATINGS_INFO' => $lang['Rating_info'], 'L_COMMENTS_INFO' => $lang['Comment_info'], *************** *** 313,324 **** 'S_COMMENTS_SHOW_NO' => $comments_show_no, - 'L_MOD_GROUP' => $lang['Mod_group'], - 'L_MOD_GROUP_EXPLAIN' => $lang['Mod_group_explain'], - 'MOD_GROUP' => $mod_group, - 'L_BUMP_POST' => $lang['Bump_post'], 'L_BUMP_POST_EXPLAIN' => $lang['Bump_post_explain'], 'S_BUMP_POST_YES' => $bump_post_yes, 'S_BUMP_POST_NO' => $bump_post_no, 'L_STATS_LIST' => $lang['Stats_list'], --- 266,306 ---- 'S_COMMENTS_SHOW_NO' => $comments_show_no, 'L_BUMP_POST' => $lang['Bump_post'], 'L_BUMP_POST_EXPLAIN' => $lang['Bump_post_explain'], 'S_BUMP_POST_YES' => $bump_post_yes, 'S_BUMP_POST_NO' => $bump_post_no, + + 'L_FORMATTING_FIXUP' => $lang['Formatting_fixup'], + 'L_FORMATTING_FIXUP_EXPLAIN' => $lang['Formatting_fixup_explain'], + 'S_FORMATTING_FIXUP_YES' => $formatting_fixup_yes, + 'S_FORMATTING_FIXUP_NO' => $formatting_fixup_no, + + 'L_WYSIWYG' => $lang['Wysiwyg'], + 'L_WYSIWYG_EXPLAIN' => $lang['Wysiwyg_explain'], + 'S_WYSIWYG_YES' => $wysiwyg_yes, + 'S_WYSIWYG_NO' => $wysiwyg_no, + + 'L_WYSIWYG_PATH' => $lang['Wysiwyg_path'], + 'L_WYSIWYG_PATH_EXPLAIN' => $lang['Wysiwyg_path_explain'], + 'WYSIWYG_PATH' => $wysiwyg_path, + + 'L_ALLOW_HTML' => $lang['Allow_HTML'], + 'L_ALLOW_HTML_EXPLAIN' => $lang['Allow_html_explain'], + 'S_ALLOW_HTML_YES' => $allow_html_yes, + 'S_ALLOW_HTML_NO' => $allow_html_no, + + 'L_ALLOW_BBCODE' => $lang['Allow_BBCode'], + 'L_ALLOW_BBCODE_EXPLAIN' => $lang['Allow_bbcode_explain'], + 'S_ALLOW_BBCODE_YES' => $allow_bbcode_yes, + 'S_ALLOW_BBCODE_NO' => $allow_bbcode_no, + + 'L_ALLOW_SMILIES' => $lang['Allow_smilies'], + 'L_ALLOW_SMILIES_EXPLAIN' => $lang['Allow_smilies_explain'], + 'S_ALLOW_SMILIES_YES' => $allow_smilies_yes, + 'S_ALLOW_SMILIES_NO' => $allow_smilies_no, + + 'L_ALLOWED_HTML_TAGS' => $lang['Allowed_tags'], + 'L_ALLOWED_HTML_TAGS_EXPLAIN' => $lang['Allowed_tags_explain'], + 'ALLOWED_HTML_TAGS' => $kb_allowed_html_tags, 'L_STATS_LIST' => $lang['Stats_list'], *************** *** 337,349 **** 'S_ANON_NO' => $anon_no, ! 'L_ALLOW_RATING' => $lang['Allow_rating'], ! 'L_ALLOW_RATING_EXPLAIN' => $lang['Allow_rating_explain'], ! 'S_ALLOW_RATING_YES' => $allow_rating_yes, ! 'S_ALLOW_RATING_NO' => $allow_rating_no, ! ! 'L_ALLOW_ANONYMOS_RATING' => $lang['Allow_anonymos_rating'], ! 'L_ALLOW_ANONYMOS_RATING_EXPLAIN' => $lang['Allow_anonymos_rating_explain'], ! 'S_ALLOW_ANONYMOS_RATING_YES' => $allow_anonymos_rating_yes, ! 'S_ALLOW_ANONYMOS_RATING_NO' => $allow_anonymos_rating_no, 'L_VOTES_CHECK_IP' => $lang['Votes_check_ip'], --- 319,326 ---- 'S_ANON_NO' => $anon_no, ! 'L_USE_RATINGS' => $lang['Use_ratings'], ! 'L_USE_RATINGS_EXPLAIN' => $lang['Use_ratings_explain'], ! 'S_USE_RATINGS_YES' => $use_ratings_yes, ! 'S_USE_RATINGS_NO' => $use_ratings_no, 'L_VOTES_CHECK_IP' => $lang['Votes_check_ip'], *************** *** 380,385 **** $template->pparse( 'body' ); ! ! include( './page_footer_admin.' . $phpEx ); ?> \ No newline at end of file --- 357,362 ---- $template->pparse( 'body' ); ! // include('./page_footer_admin.'.$phpEx); ! include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); ?> \ No newline at end of file Index: admin_kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/admin/admin_kb_cat.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_kb_cat.php 9 Jan 2005 22:16:30 -0000 1.1 --- admin_kb_cat.php 28 Mar 2005 20:54:53 -0000 1.2 *************** *** 1,9 **** <?php ! /** ! * admin_kb_cat.php ! * ------------------- ! * begin : Monday, Mar 31, 2003 ! * copyright : (C) 2001 The phpBB Group ! * email : su...@ph... * * $Id$ --- 1,12 ---- <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : ! * ------------------------------------------------------------------------- * * $Id$ *************** *** 17,56 **** */ ! define( 'IN_PHPBB', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['KB_title']['Cat_man'] = $file; ! return; } ! // function get_list($id, $select, $selected = false) ! function get_list_kb( $id, $select, $selected = false ) { ! global $db; ! ! $idfield = 'category_id'; ! $namefield = 'category_name'; ! $sql = "SELECT * ! FROM " . KB_CATEGORIES_TABLE; ! if ( $select == 0 ) ! { ! $sql .= " WHERE $idfield <> $id"; ! } if ( !$result = $db->sql_query( $sql ) ) { ! message_die( GENERAL_ERROR, "Couldn't get list of Categories", "", __LINE__, __FILE__, $sql ); } ! $cat_list = ""; while ( $row = $db->sql_fetchrow( $result ) ) { ! if ( $selected == $row[$idfield] ) { ! $status = 'selected'; } else --- 20,93 ---- */ ! if ( file_exists( './../viewtopic.php' ) ) { ! define( 'IN_PHPBB', 1 ); ! define( 'IN_PORTAL', 1 ); ! define( 'MXBB_MODULE', false ); ! ! if ( !empty( $setmodules ) ) ! { ! $file = basename( __FILE__ ); ! $module['KB_title']['Cat_man'] = $file; ! return; ! } ! ! $phpbb_root_path = $module_root_path = $mx_root_path = "./../"; ! require( $phpbb_root_path . 'extension.inc' ); ! require( './pagestart.' . $phpEx ); ! 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 { ! define( 'IN_PORTAL', 1 ); ! ! if ( !empty( $setmodules ) ) ! { ! $file = basename( __FILE__ ); ! $module['KB_title']['Cat_man'] = 'modules/mx_kb/admin/' . $file; ! return; ! } ! ! $mx_root_path = '../../../'; ! $module_root_path = "../"; ! 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( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); ! } ! function get_forums( $sel_id = 0 ) ! { ! global $db; ! $sql = "SELECT forum_id, forum_name ! FROM " . FORUMS_TABLE; if ( !$result = $db->sql_query( $sql ) ) { ! message_die( GENERAL_ERROR, "Couldn't get list of forums", "", __LINE__, __FILE__, $sql ); } ! $forumlist = '<select name="forum_id">'; + if ( $sel_id == 0 ) + $forumlist .= '<option value="0" selected > Select a Forum !</option>'; + while ( $row = $db->sql_fetchrow( $result ) ) { ! if ( $sel_id == $row['forum_id'] ) { ! $status = "selected"; } else *************** *** 58,152 **** $status = ''; } ! $catlist .= "<option value=\"$row[$idfield]\" $status>" . $row[$namefield] . "</option>\n"; ! } ! ! return( $catlist ); ! } ! ! // get_kb_cat_subs($parent) ! // gets sub categories for a category ! ! function get_kb_cat_subs( $parent, $indent ) ! { ! global $db, $template, $phpbb_root_path, $phpbb_root_path, $phpEx, $images, $row_color, $row_class, $theme, $i, $lang; ! // $i = $i + 1; ! $sql = "SELECT * ! FROM " . KB_CATEGORIES_TABLE . " ! WHERE parent = " . $parent . " ! ORDER BY cat_order"; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! message_die( GENERAL_ERROR, "Could not obtain sub-category data", '', __LINE__, __FILE__, $sql ); } ! while ( $category2 = $db->sql_fetchrow( $result ) ) ! { ! $category_details2 = $category2['category_details']; ! $category_articles2 = $category2['number_articles']; ! ! $category_id2 = $category2['category_id']; ! $category_name2 = $category2['category_name']; ! $temp_url = append_sid( $phpbb_root_path . "kb.$phpEx?mode=cat&cat=$category_id2" ); ! $category2 = '<a href="' . $temp_url . '" class="gen">' . $category_name2 . '</a>'; ! ! $temp_url = append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=edit&cat=$category_id2" ); ! $edit2 = '<a href="' . $temp_url . '"><img src="' . $phpbb_root_path . $images['icon_edit'] . '" border="0" alt="' . $lang['Edit'] . '"></a>'; ! ! $temp_url = append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=delete&cat=$category_id2" ); ! $delete2 = '<a href="' . $temp_url . '" class="gen"><img src="' . $phpbb_root_path . $images['icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; ! ! $temp_url = append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=up&cat=$category_id2" ); ! $up2 = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_up'] . '</a>'; ! ! $temp_url = append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=down&cat=$category_id2" ); ! $down2 = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_down'] . '</a>'; ! ! $row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; ! $row_class = ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! ! $template->assign_block_vars( 'catrow.subrow', array( 'CATEGORY' => $category2, ! 'CAT_DESCRIPTION' => $category_details2, ! 'CAT_ARTICLES' => $category_articles2, ! ! 'INDENT' => $indent, ! ! 'U_EDIT' => $edit2, ! 'U_DELETE' => $delete2, ! 'U_UP' => $up2, ! 'U_DOWN' => $down2, ! ! 'ROW_COLOR' => '#' . $row_color, ! 'ROW_CLASS' => $row_class ) ! ); ! $i++; ! $sql = "SELECT category_id ! FROM " . KB_CATEGORIES_TABLE . " ! WHERE parent = " . $category_id2 . " ! ORDER BY cat_order"; ! if ( !( $result2 = $db->sql_query( $sql ) ) ) ! { ! message_die( GENERAL_ERROR, "Could not obtain sub-category data", '', __LINE__, __FILE__, $sql ); ! } ! ! $kb_cat = $db->sql_fetchrow( $result2 ); ! if ( $kb_cat['category_id'] != '' ) ! { ! $temp = $indent . '-> '; ! get_kb_cat_subs( $category_id2, $temp ); ! } ! } ! return; } - // Load default header - - $phpbb_root_path = "./../"; - require( $phpbb_root_path . 'extension.inc' ); - require( './pagestart.' . $phpEx ); - include( $phpbb_root_path . 'config.' . $phpEx ); - require( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); - include( $phpbb_root_path . 'includes/functions_admin.' . $phpEx ); if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) --- 95,106 ---- $status = ''; } ! $forumlist .= '<option value="' . $row['forum_id'] . '" ' . $status . '>' . $row['forum_name'] . '</option>'; } ! $forumlist .= '</select>'; ! return $forumlist; } if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) *************** *** 199,209 **** 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_list_kb( 0, 0, 0 ), ! 'S_ACTION' => append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=create" ), 'CAT_NAME' => $new_cat_name, 'DESC' => '', ! 'NUMBER_ARTICLES' => '0' ) ! ); } else if ( $HTTP_POST_VARS['submit'] ) --- 153,192 ---- 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_kb_cat_list( 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"', ! ) ); } else if ( $HTTP_POST_VARS['submit'] ) *************** *** 217,221 **** $cat_desc = $HTTP_POST_VARS['catdesc']; ! $parent = $HTTP_POST_VARS['parent']; $sql = "SELECT MAX(cat_order) AS cat_order --- 200,218 ---- $cat_desc = $HTTP_POST_VARS['catdesc']; ! $parent = intval( $HTTP_POST_VARS['parent'] ); ! $comments_forum_id = intval( $HTTP_POST_VARS['forum_id'] ); ! ! if ( $comments_forum_id == 0 ) ! { ! mx_message_die(GENERAL_MESSAGE , 'Select a Forum'); ! } ! $view_level = intval( $HTTP_POST_VARS['auth_view'] ); ! $post_level = intval( $HTTP_POST_VARS['auth_post'] ); ! $rate_level = intval( $HTTP_POST_VARS['auth_rate'] ); ! $comment_level = intval( $HTTP_POST_VARS['auth_comment'] ); ! $edit_level = intval( $HTTP_POST_VARS['auth_edit'] ); ! $delete_level = intval( $HTTP_POST_VARS['auth_delete'] ); ! $approval_level = intval( $HTTP_POST_VARS['auth_approval'] ); ! $approval_edit_level = intval( $HTTP_POST_VARS['auth_approval_edit'] ); $sql = "SELECT MAX(cat_order) AS cat_order *************** *** 223,243 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, 'Could not obtain next type id', '', __LINE__, __FILE__, $sql ); } if ( !( $id = $db->sql_fetchrow( $result ) ) ) { ! message_die( GENERAL_ERROR, 'Could not obtain next type id', '', __LINE__, __FILE__, $sql ); } $cat_order = $id['cat_order'] + 10; ! $sql = "INSERT INTO " . KB_CATEGORIES_TABLE . " ( category_name, category_details, number_articles, parent, cat_order)" . " VALUES ( '$cat_name', ' $cat_desc', '0', '$parent', '$cat_order')"; if ( !( $results = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not create category", '', __LINE__, __FILE__, $sql ); } ! $message = $lang['Cat_created'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_kb_cat.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $phpbb_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); message_die( GENERAL_MESSAGE, $message ); --- 220,240 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain next type id', '', __LINE__, __FILE__, $sql ); } if ( !( $id = $db->sql_fetchrow( $result ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain next type id', '', __LINE__, __FILE__, $sql ); } $cat_order = $id['cat_order'] + 10; ! $sql = "INSERT INTO " . KB_CATEGORIES_TABLE . " ( category_name, category_details, number_articles, parent, cat_order, auth_view, auth_post, auth_rate, auth_comment, auth_edit, auth_delete, auth_approval, auth_approval_edit, comments_forum_id)" . " VALUES ( '$cat_name', ' $cat_desc', '0', '$parent', '$cat_order', '$view_level', '$view_post', '$view_rate', '$comment_level', '$comment_edit', '$comment_delete', '$approval', '$approval_edit', '$comments_forum_id')"; if ( !( $results = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not create category", '', __LINE__, __FILE__, $sql ); } ! $message = $lang['Cat_created'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_kb_cat.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); message_die( GENERAL_MESSAGE, $message ); *************** *** 249,253 **** if ( !$HTTP_POST_VARS['submit'] ) { ! $cat_id = $HTTP_GET_VARS['cat']; $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = " . $cat_id; --- 246,250 ---- if ( !$HTTP_POST_VARS['submit'] ) { ! $cat_id = intval( $HTTP_GET_VARS['cat'] ); $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = " . $cat_id; *************** *** 255,259 **** if ( !( $results = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql ); } if ( $kb_cat = $db->sql_fetchrow( $results ) ) --- 252,256 ---- if ( !( $results = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql ); } if ( $kb_cat = $db->sql_fetchrow( $results ) ) *************** *** 263,266 **** --- 260,264 ---- $number_articles = $kb_cat['number_articles']; $parent = $kb_cat['parent']; + $comments_forum_id = $kb_cat['comments_forum_id']; } *************** *** 284,294 **** 'L_NONE' => $lang['None'], ! 'PARENT_LIST' => get_list_kb( $cat_id, 0, $parent ), ! 'S_ACTION' => append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=edit" ), 'CAT_NAME' => $cat_name, 'CAT_DESCRIPTION' => $cat_desc, 'NUMBER_ARTICLES' => $number_articles, 'S_HIDDEN' => '<input type="hidden" name="catid" value="' . $cat_id . '">' ) ); --- 282,363 ---- '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" ), 'CAT_NAME' => $cat_name, 'CAT_DESCRIPTION' => $cat_desc, 'NUMBER_ARTICLES' => $number_articles, + 'L_FORUM_ID' => $lang['Forum_id'], + 'L_FORUM_ID_EXPLAIN' => $lang['Forum_id_explain'], + 'FORUM_LIST' => get_forums( $comments_forum_id ), + + // Cat 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' => ( $kb_cat['auth_view'] == AUTH_ALL ) ? 'selected="selected"' : '', + 'VIEW_REG' => ( $kb_cat['auth_view'] == AUTH_REG ) ? 'selected="selected"' : '', + 'VIEW_PRIVATE' => ( $kb_cat['auth_view'] == AUTH_ACL ) ? 'selected="selected"' : '', + 'VIEW_MOD' => ( $kb_cat['auth_view'] == AUTH_MOD ) ? 'selected="selected"' : '', + 'VIEW_ADMIN' => ( $kb_cat['auth_view'] == AUTH_ADMIN ) ? 'selected="selected"' : '', + + 'UPLOAD_GUEST' => ( $kb_cat['auth_post'] == AUTH_ALL ) ? 'selected="selected"' : '', + 'UPLOAD_REG' => ( $kb_cat['auth_post'] == AUTH_REG ) ? 'selected="selected"' : '', + 'UPLOAD_PRIVATE' => ( $kb_cat['auth_post'] == AUTH_ACL ) ? 'selected="selected"' : '', + 'UPLOAD_MOD' => ( $kb_cat['auth_post'] == AUTH_MOD ) ? 'selected="selected"' : '', + 'UPLOAD_ADMIN' => ( $kb_cat['auth_post'] == AUTH_ADMIN ) ? 'selected="selected"' : '', + + 'RATE_GUEST' => ( $kb_cat['auth_rate'] == AUTH_ALL ) ? 'selected="selected"' : '', + 'RATE_REG' => ( $kb_cat['auth_rate'] == AUTH_REG ) ? 'selected="selected"' : '', + 'RATE_PRIVATE' => ( $kb_cat['auth_rate'] == AUTH_ACL ) ? 'selected="selected"' : '', + 'RATE_MOD' => ( $kb_cat['auth_rate'] == AUTH_MOD ) ? 'selected="selected"' : '', + 'RATE_ADMIN' => ( $kb_cat['auth_rate'] == AUTH_ADMIN ) ? 'selected="selected"' : '', + + 'COMMENT_GUEST' => ( $kb_cat['auth_comment'] == AUTH_ALL ) ? 'selected="selected"' : '', + 'COMMENT_REG' => ( $kb_cat['auth_comment'] == AUTH_REG ) ? 'selected="selected"' : '', + 'COMMENT_PRIVATE' => ( $kb_cat['auth_comment'] == AUTH_ACL ) ? 'selected="selected"' : '', + 'COMMENT_MOD' => ( $kb_cat['auth_comment'] == AUTH_MOD ) ? 'selected="selected"' : '', + 'COMMENT_ADMIN' => ( $kb_cat['auth_comment'] == AUTH_ADMIN ) ? 'selected="selected"' : '', + + 'EDIT_REG' => ( $kb_cat['auth_edit'] == AUTH_REG ) ? 'selected="selected"' : '', + 'EDIT_PRIVATE' => ( $kb_cat['auth_edit'] == AUTH_ACL ) ? 'selected="selected"' : '', + 'EDIT_MOD' => ( $kb_cat['auth_edit'] == AUTH_MOD ) ? 'selected="selected"' : '', + 'EDIT_ADMIN' => ( $kb_cat['auth_edit'] == AUTH_ADMIN ) ? 'selected="selected"' : '', + + 'DELETE_REG' => ( $kb_cat['auth_delete'] == AUTH_REG ) ? 'selected="selected"' : '', + 'DELETE_PRIVATE' => ( $kb_cat['auth_delete'] == AUTH_ACL ) ? 'selected="selected"' : '', + 'DELETE_MOD' => ( $kb_cat['auth_delete'] == AUTH_MOD ) ? 'selected="selected"' : '', + 'DELETE_ADMIN' => ( $kb_cat['auth_delete'] == AUTH_ADMIN ) ? 'selected="selected"' : '', + + 'APPROVAL_DISABLED' => ( $kb_cat['auth_approval'] == AUTH_ALL ) ? 'selected="selected"' : '', + 'APPROVAL_MOD' => ( $kb_cat['auth_approval'] == AUTH_MOD ) ? 'selected="selected"' : '', + 'APPROVAL_ADMIN' => ( $kb_cat['auth_approval'] == AUTH_ADMIN ) ? 'selected="selected"' : '', + + 'APPROVAL_EDIT_DISABLED' => ( $kb_cat['auth_approval_edit'] == AUTH_ALL ) ? 'selected="selected"' : '', + 'APPROVAL_EDIT_MOD' => ( $kb_cat['auth_approval_edit'] == AUTH_MOD ) ? 'selected="selected"' : '', + 'APPROVAL_EDIT_ADMIN' => ( $kb_cat['auth_approval_edit'] == AUTH_ADMIN ) ? 'selected="selected"' : '', + + 'S_GUEST' => AUTH_ALL, + 'S_USER' => AUTH_REG, + 'S_PRIVATE' => AUTH_ACL, + 'S_MOD' => AUTH_MOD, + 'S_ADMIN' => AUTH_ADMIN, + + 'S_HIDDEN' => '<input type="hidden" name="catid" value="' . $cat_id . '">' ) ); *************** *** 296,304 **** else if ( $HTTP_POST_VARS['submit'] ) { ! $cat_id = $HTTP_POST_VARS['catid']; $cat_name = trim( $HTTP_POST_VARS['catname'] ); $cat_desc = $HTTP_POST_VARS['catdesc']; ! $number_articles = $HTTP_POST_VARS['number_articles']; ! $parent = $HTTP_POST_VARS['parent']; if ( !$cat_name ) --- 365,384 ---- else if ( $HTTP_POST_VARS['submit'] ) { ! $cat_id = intval( $HTTP_POST_VARS['catid'] ); $cat_name = trim( $HTTP_POST_VARS['catname'] ); $cat_desc = $HTTP_POST_VARS['catdesc']; ! $number_articles = intval( $HTTP_POST_VARS['number_articles'] ); ! $parent = intval( $HTTP_POST_VARS['parent'] ); ! $comments_forum_id = intval( $HTTP_POST_VARS['forum_id'] ); ! ! $view_level = intval( $HTTP_POST_VARS['auth_view'] ); ! $post_level = intval( $HTTP_POST_VARS['auth_post'] ); ! $rate_level = intval( $HTTP_POST_VARS['auth_rate'] ); ! $comment_level = intval( $HTTP_POST_VARS['auth_comment'] ); ! $edit_level = intval( $HTTP_POST_VARS['auth_edit'] ); ! $delete_level = intval( $HTTP_POST_VARS['auth_delete'] ); ! $approval_level = intval( $HTTP_POST_VARS['auth_approval'] ); ! $approval_edit_level = intval( $HTTP_POST_VARS['auth_approval_edit'] ); ! if ( !$cat_name ) *************** *** 307,320 **** } ! $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET category_name = '" . $cat_name . "', category_details = '" . $cat_desc . "', number_articles = '" . $number_articles . "', parent = '" . $parent . "' WHERE category_id = " . $cat_id; if ( !( $results = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not update category", '', __LINE__, __FILE__, $sql ); } ! $message = $lang['Cat_edited'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_kb_cat.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $phpbb_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); ! message_die( GENERAL_MESSAGE, $message ); } break; --- 387,400 ---- } ! $sql = "UPDATE " . KB_CATEGORIES_TABLE . " SET category_name = '" . $cat_name . "', category_details = '" . $cat_desc . "', number_articles = '" . $number_articles . "', parent = '" . $parent . "', auth_view = '" . $view_level . "', auth_post = '" . $post_level . "', auth_rate = '" . $rate_level . "', auth_comment = '" . $comment_level . "', auth_edit = '" . $edit_level . "', auth_delete = '" . $delete_level . "', auth_approval = '" . $approval_level . "', auth_approval_edit = '" . $approval_edit_level . "', comments_forum_id = '" . $comments_forum_id . "' WHERE category_id = " . $cat_id; if ( !( $results = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not update category", '', __LINE__, __FILE__, $sql ); } ! $message = $lang['Cat_edited'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_kb_cat.$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; *************** *** 331,335 **** if ( !( $cat_result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql ); } --- 411,415 ---- if ( !( $cat_result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql ); } *************** *** 354,359 **** 'S_HIDDEN_FIELDS' => '<input type="hidden" name="catid" value="' . $cat_id . '">', ! 'S_SELECT_TO' => get_list_kb( $cat_id, 0 ), ! 'S_ACTION' => append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=delete" ), 'CAT_NAME' => $cat_name ) --- 434,439 ---- '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" ), 'CAT_NAME' => $cat_name ) *************** *** 372,376 **** if ( !( $move_result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not move articles", '', __LINE__, __FILE__, $sql ); } --- 452,456 ---- if ( !( $move_result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not move articles", '', __LINE__, __FILE__, $sql ); } *************** *** 380,384 **** if ( !( $cat_result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } --- 460,464 ---- if ( !( $cat_result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } *************** *** 393,397 **** if ( !( $oldcat_result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } --- 473,477 ---- if ( !( $oldcat_result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } *************** *** 407,411 **** if ( !( $number_result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not update articles number", '', __LINE__, __FILE__, $sql ); } } --- 487,491 ---- if ( !( $number_result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not update articles number", '', __LINE__, __FILE__, $sql ); } } *************** *** 416,420 **** if ( !( $delete__articles = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not delete articles", '', __LINE__, __FILE__, $sql ); } } --- 496,500 ---- if ( !( $delete__articles = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not delete articles", '', __LINE__, __FILE__, $sql ); } } *************** *** 424,433 **** if ( !( $delete_result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not delete category", '', __LINE__, __FILE__, $sql ); } ! $message = $lang['Cat_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_kb_cat.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $phpbb_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); ! message_die( GENERAL_MESSAGE, $message ); } break; --- 504,513 ---- if ( !( $delete_result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not delete category", '', __LINE__, __FILE__, $sql ); } ! $message = $lang['Cat_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_cat_manager'], '<a href="' . append_sid( "admin_kb_cat.$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; *************** *** 445,449 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } --- 525,529 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } *************** *** 461,465 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } --- 541,545 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } *************** *** 470,474 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } } --- 550,554 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } } *************** *** 484,488 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } --- 564,568 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not get category data", '', __LINE__, __FILE__, $sql ); } *************** *** 500,504 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } --- 580,584 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } *************** *** 509,513 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } } --- 589,593 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not update order", '', __LINE__, __FILE__, $sql ); } } *************** *** 528,532 **** 'L_ORDER' => $lang['Update_order'], ! 'S_ACTION' => append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=create" ) ) ); // get categories --- 608,612 ---- 'L_ORDER' => $lang['Update_order'], ! 'S_ACTION' => append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=create" ) ) ); // get categories *************** *** 537,541 **** if ( !( $cat_result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql ); } --- 617,621 ---- if ( !( $cat_result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql ); } *************** *** 547,563 **** $category_id = $category['category_id']; $category_name = $category['category_name']; ! $temp_url = append_sid( $phpbb_root_path . "kb.$phpEx?mode=cat&cat=$category_id" ); $category_link = '<a href="' . $temp_url . '" class="gen">' . $category_name . '</a>'; ! $temp_url = append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=edit&cat=$category_id" ); $edit = '<a href="' . $temp_url . '"><img src="' . $phpbb_root_path . $images['icon_edit'] . '" border="0" alt="' . $lang['Edit'] . '"></a>'; ! $temp_url = append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=delete&cat=$category_id" ); $delete = '<a href="' . $temp_url . '" class="gen"><img src="' . $phpbb_root_path . $images['icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; ! $temp_url = append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=up&cat=$category_id" ); $up = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_up'] . '</a>'; ! $temp_url = append_sid( $phpbb_root_path . "admin/admin_kb_cat.$phpEx?mode=down&cat=$category_id" ); $down = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_down'] . '</a>'; --- 627,643 ---- $category_id = $category['category_id']; $category_name = $category['category_name']; ! $temp_url = append_sid( $module_root_path . "kb.$phpEx?mode=cat&cat=$category_id" ); $category_link = '<a href="' . $temp_url . '" class="gen">' . $category_name . '</a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=edit&cat=$category_id" ); $edit = '<a href="' . $temp_url . '"><img src="' . $phpbb_root_path . $images['icon_edit'] . '" border="0" alt="' . $lang['Edit'] . '"></a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=delete&cat=$category_id" ); $delete = '<a href="' . $temp_url . '" class="gen"><img src="' . $phpbb_root_path . $images['icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=up&cat=$category_id" ); $up = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_up'] . '</a>'; ! $temp_url = append_sid( $module_root_path . "admin/admin_kb_cat.$phpEx?mode=down&cat=$category_id" ); $down = '<a href="' . $temp_url . '" class="gen">' . $lang['Move_down'] . '</a>'; *************** *** 579,583 **** $i++; ! get_kb_cat_subs( $category_id, '-> ' ); } break; --- 659,663 ---- $i++; ! get_kb_cat_subs_admin( $category_id, '1', '-> ' ); } break; *************** *** 585,590 **** $template->pparse( 'body' ); ! ! include( './page_footer_admin.' . $phpEx ); ?> \ No newline at end of file --- 665,670 ---- $template->pparse( 'body' ); ! // include('./page_footer_admin.'.$phpEx); ! include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); ?> \ No newline at end of file Index: admin_kb_art.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/admin/admin_kb_art.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_kb_art.php 9 Jan 2005 22:16:30 -0000 1.1 --- admin_kb_art.php 28 Mar 2005 20:54:53 -0000 1.2 *************** *** 1,9 **** <?php ! /** ! * admin_kb_art.php ! * ------------------- ! * begin : Monday, Mar 31, 2003 ! * copyright : (C) 2001 The phpBB Group ! * email : su...@ph... * * $Id$ --- 1,12 ---- <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : ! * ------------------------------------------------------------------------- * * $Id$ *************** *** 17,41 **** */ ! define( 'IN_PHPBB', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['KB_title']['Art_man'] = $file; ! return; } - - // Load default header - - $phpbb_root_path = "./../"; - require( $phpbb_root_path . 'extension.inc' ); - require( './pagestart.' . $phpEx ); - 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_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); - include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); - include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); // Pull all config data --- 20,70 ---- */ ! if ( file_exists( './../viewtopic.php' ) ) { ! define( 'IN_PHPBB', 1 ); ! define( 'IN_PORTAL', 1 ); ! define( 'MXBB_MODULE', false ); ! ! if ( !empty( $setmodules ) ) ! { ! $file = basename( __FILE__ ); ! $module['KB_title']['Art_man'] = $file; ! return; ! } ! ! $phpbb_root_path = $module_root_path = $mx_root_path = "./../"; ! require( $phpbb_root_path . 'extension.inc' ); ! require( './pagestart.' . $phpEx ); ! include( $phpbb_root_path . 'co... [truncated message content] |