You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(95) |
Apr
(270) |
May
(111) |
Jun
|
Jul
|
Aug
(64) |
Sep
(130) |
Oct
(319) |
Nov
(17) |
Dec
(191) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(53) |
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(387) |
Jul
(102) |
Aug
(247) |
Sep
(120) |
Oct
(1) |
Nov
(8) |
Dec
(21) |
| 2007 |
Jan
(38) |
Feb
(36) |
Mar
|
Apr
(32) |
May
(135) |
Jun
(523) |
Jul
(192) |
Aug
(103) |
Sep
(533) |
Oct
(77) |
Nov
(23) |
Dec
(203) |
| 2008 |
Jan
(312) |
Feb
(1193) |
Mar
(404) |
Apr
(67) |
May
(62) |
Jun
(497) |
Jul
(297) |
Aug
(110) |
Sep
(335) |
Oct
(256) |
Nov
(50) |
Dec
(118) |
| 2009 |
Jan
(67) |
Feb
(10) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(10) |
Jul
(61) |
Aug
|
Sep
(16) |
Oct
(45) |
Nov
(12) |
Dec
(14) |
| 2010 |
Jan
(30) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(7) |
Aug
(7) |
Sep
(5) |
Oct
(5) |
Nov
|
Dec
|
| 2011 |
Jan
(7) |
Feb
(3) |
Mar
(89) |
Apr
(11) |
May
(5) |
Jun
|
Jul
(8) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(89) |
| 2012 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(42) |
Nov
(1) |
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(19) |
Apr
(90) |
May
(38) |
Jun
(235) |
Jul
(38) |
Aug
(10) |
Sep
|
Oct
(29) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
(52) |
Jun
|
Jul
(7) |
Aug
|
Sep
(17) |
Oct
|
Nov
|
Dec
|
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] |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:55:09
|
Update of /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9026/modules/kb_076_mxaddon/root/templates/subSilver/admin Modified Files: kb_cat_edit_body.tpl kb_config.tpl kb_config_body.tpl Added Files: kb_cat_auth_body.tpl kb_cat_select_body.tpl kb_field_add.tpl kb_select.tpl kb_select_field_delete.tpl kb_select_field_edit.tpl kb_select_field_type.tpl kb_type_edit_body.tpl 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 Index: kb_cat_edit_body.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/admin/kb_cat_edit_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_cat_edit_body.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_cat_edit_body.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 26,29 **** --- 26,33 ---- </select> </tr> + <tr> + <td class="row1" width="50%">{L_FORUM_ID}<br /><span class="gensmall">{L_FORUM_ID_EXPLAIN}</span></td> + <td class="row2" width="50%">{FORUM_LIST}</td> + </tr> <!-- BEGIN switch_edit_category --> <tr> *************** *** 33,36 **** --- 37,76 ---- <!-- END switch_edit_category --> <!-- END switch_cat --> + + <tr> + <th class="thHead" height="25" nowrap="nowrap" colspan="2">{L_CAT_PERMISSIONS}</th> + </tr> + <tr> + <td class="row1"><span class="gen">{L_VIEW_LEVEL}:</span></td> + <td class="row2"><select name="auth_view"><option {VIEW_GUEST} value="{S_GUEST}">{L_GUEST}</option><option {VIEW_REG} value="{S_USER}">{L_REG}</option><option {VIEW_PRIVATE} value="{S_PRIVATE}">{L_PRIVATE}</option><option {VIEW_MOD} value="{S_MOD}">{L_MOD}</option><option {VIEW_ADMIN} value="{S_ADMIN}">{L_ADMIN}</option></select></td> + </tr> + <tr> + <td class="row1"><span class="gen">{L_UPLOAD_LEVEL}:</span></td> + <td class="row2"><select name="auth_post"><option {UPLOAD_GUEST} value="{S_GUEST}">{L_GUEST}</option><option {UPLOAD_REG} value="{S_USER}">{L_REG}</option><option {UPLOAD_PRIVATE} value="{S_PRIVATE}">{L_PRIVATE}</option><option {UPLOAD_MOD} value="{S_MOD}">{L_MOD}</option><option {UPLOAD_ADMIN} value="{S_ADMIN}">{L_ADMIN}</option></select></td> + </tr> + <tr> + <td class="row1"><span class="gen">{L_RATE_LEVEL}:</span></td> + <td class="row2"><select name="auth_rate"><option {RATE_GUEST} value="{S_GUEST}">{L_GUEST}</option><option {RATE_REG} value="{S_USER}">{L_REG}</option><option {RATE_PRIVATE} value="{S_PRIVATE}">{L_PRIVATE}</option><option {RATE_MOD} value="{S_MOD}">{L_MOD}</option><option {RATE_ADMIN} value="{S_ADMIN}">{L_ADMIN}</option></select></td> + </tr> + <tr> + <td class="row1"><span class="gen">{L_COMMENT_LEVEL}:</span></td> + <td class="row2"><span class="gen"><select name="auth_comment"><option {COMMENT_GUEST} value="{S_GUEST}">{L_GUEST}</option><option {COMMENT_REG} value="{S_USER}">{L_REG}</option><option {COMMENT_PRIVATE} value="{S_PRIVATE}">{L_PRIVATE}</option><option {COMMENT_MOD} value="{S_MOD}">{L_MOD}</option><option {COMMENT_ADMIN} value="{S_ADMIN}">{L_ADMIN}</option></select></span></td> + </tr> + <tr> + <td class="row1"><span class="gen">{L_EDIT_LEVEL}:</span></td> + <td class="row2"><select name="auth_edit"><option {EDIT_REG} value="{S_USER}">{L_REG}</option><option {EDIT_PRIVATE} value="{S_PRIVATE}">{L_PRIVATE}</option><option {EDIT_MOD} value="{S_MOD}">{L_MOD}</option><option {EDIT_ADMIN} value="{S_ADMIN}">{L_ADMIN}</option></select></td> + </tr> + <tr> + <td class="row1"><span class="gen">{L_DELETE_LEVEL}:</span></td> + <td class="row2"><select name="auth_delete"><option {DELETE_REG} value="{S_USER}">{L_REG}</option><option {DELETE_PRIVATE} value="{S_PRIVATE}">{L_PRIVATE}</option><option {DELETE_MOD} value="{S_MOD}">{L_MOD}</option><option {DELETE_ADMIN} value="{S_ADMIN}">{L_ADMIN}</option></select></td> + </tr> + <tr> + <td class="row1"><span class="gen">{L_APPROVAL_LEVEL}:</span></td> + <td class="row2"><select name="auth_approval"><option {APPROVAL_DISABLED} value="{S_USER}">{L_DISABLED}</option><option {APPROVAL_MOD} value="{S_MOD}">{L_MOD}</option><option {APPROVAL_ADMIN} value="{S_ADMIN}">{L_ADMIN}</option></select></td> + </tr> + <tr> + <td class="row1"><span class="gen">{L_APPROVAL_EDIT_LEVEL}:</span></td> + <td class="row2"><select name="auth_approval_edit"><option {APPROVAL_DISABLED} value="{S_USER}">{L_DISABLED}</option><option {APPROVAL_MOD} value="{S_MOD}">{L_MOD}</option><option {APPROVAL_ADMIN} value="{S_ADMIN}">{L_ADMIN}</option></select></td> + </tr> <tr> <td class="catBottom" colspan="2" align="center">{S_HIDDEN}<input type="submit" name="submit" value="{L_CREATE}" class="mainoption" /></td> Index: kb_config_body.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/admin/kb_config_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_config_body.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_config_body.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 14,33 **** </tr> <tr> - <td class="row1" width="50%">{L_APPROVE_NEW_NAME}<br /><span class="gensmall">{L_APPROVE_NEW_EXPLAIN}</span></td> - <td class="row2" width="50%"><input type="radio" name="approve_new" value="1" {S_APPROVE_NEW_YES} /> {L_YES} <input type="radio" name="approve_new" value="0" {S_APPROVE_NEW_NO} /> {L_NO}</td> - </tr> - <tr> - <td class="row1" width="50%">{L_EDIT_NAME}<br /><span class="gensmall">{L_EDIT_EXPLAIN}</span></td> - <td class="row2" width="50%"><input type="radio" name="allow_edit" value="1" {S_EDIT_YES} /> {L_YES} <input type="radio" name="allow_edit" value="0" {S_EDIT_NO} /> {L_NO}</td> - </tr> - <tr> - <td class="row1" width="50%">{L_APPROVE_EDIT_NAME}<br /><span class="gensmall">{L_APPROVE_EDIT_EXPLAIN}</span></td> - <td class="row2" width="50%"><input type="radio" name="approve_edit" value="1" {S_APPROVE_EDIT_YES} /> {L_YES} <input type="radio" name="approve_edit" value="0" {S_APPROVE_EDIT_NO} /> {L_NO}</td> - </tr> - <tr> - <td class="row1" width="50%">{L_ANON_NAME}<br /><span class="gensmall">{L_ANON_EXPLAIN}</span></td> - <td class="row2" width="50%"><input type="radio" name="allow_anon" value="1" {S_ANON_YES} /> {L_YES} <input type="radio" name="allow_anon" value="0" {S_ANON_NO} /> {L_NO}</td> - </tr> - <tr> <td class="row1" width="50%">{L_NOTIFY_NAME}<br /><span class="gensmall">{L_NOTIFY_EXPLAIN}</span></td> <td class="row2" width="50%"><input type="radio" name="notify" value="0" {S_NOTIFY_NONE} />{L_NONE} <input type="radio" name="notify" value="2" {S_NOTIFY_EMAIL} />{L_EMAIL} <input type="radio" name="notify" value="1" {S_NOTIFY_PM} />{L_PM}</td> --- 14,17 ---- *************** *** 38,45 **** </tr> <tr> - <td class="row1" width="50%">{L_MOD_GROUP}<br /><span class="gensmall">{L_MOD_GROUP_EXPLAIN}</span></td> - <td class="row2" width="50%">{MOD_GROUP}</td> - </tr> - <tr> <td class="row1" width="50%">{L_HEADER_BANNER}<br /><span class="gensmall">{L_HEADER_BANNER_EXPLAIN}</span></td> <td class="row2" width="50%"><input type="radio" name="header_banner" value="1" {S_HEADER_BANNER_YES} /> {L_YES} <input type="radio" name="header_banner" value="0" {S_HEADER_BANNER_NO} /> {L_NO}</td> --- 22,25 ---- *************** *** 58,75 **** </tr> <tr> ! <td class="row1" width="50%"><span class="gen">{L_NEWS_SORT}</span></td> <td class="row2" width="50%">{NEWS_SORT} </td> </tr> <tr> ! <td class="row1" width="50%"><span class="gen">{L_NEWS_SORT_PAR}</span></td> <td class="row2" width="50%">{NEWS_SORT_PAR} </td> </tr> <tr> <th class="thHead" colspan="2">{L_COMMENTS_INFO}</th> </tr> <tr> ! <td class="row1" width="50%">{L_COMMENTS}<br /><span class="gensmall">{L_COMMENTS_EXPLAIN}</span></td> ! <td class="row2" width="50%"><input type="radio" name="comments" value="1" {S_COMMENTS_YES} /> {L_YES} <input type="radio" name="comments" value="0" {S_COMMENTS_NO} /> {L_NO}</td> </tr> <tr> <td class="row1" width="50%">{L_COMMENTS_SHOW}<br /><span class="gensmall">{L_COMMENTS_SHOW_EXPLAIN}</span></td> --- 38,85 ---- </tr> <tr> ! <td class="row1" width="50%">{L_NEWS_SORT}</td> <td class="row2" width="50%">{NEWS_SORT} </td> </tr> <tr> ! <td class="row1" width="50%">{L_NEWS_SORT_PAR}</td> <td class="row2" width="50%">{NEWS_SORT_PAR} </td> </tr> <tr> + <td class="row1" width="50%">{L_WYSIWYG}<br /><span class="gensmall">{L_WYSIWYG_EXPLAIN}</span></td> + <td class="row2" width="50%"><input type="radio" name="wysiwyg" value="1" {S_WYSIWYG_YES} /> {L_YES} <input type="radio" name="wysiwyg" value="0" {S_WYSIWYG_NO} /> {L_NO}</td> + </tr> + <tr> + <td class="row1" width="50%">{L_WYSIWYG_PATH}<br /><span class="gensmall">{L_WYSIWYG_PATH_EXPLAIN}</span></td> + <td class="row2" width="50%"><input text="text" name="wysiwyg_path" value="{WYSIWYG_PATH}" size="20" maxlength="50" /></td> + </tr> + <tr> + <td class="row1" width="50%">{L_ALLOW_HTML}<br /><span class="gensmall">{L_ALLOW_HTML_EXPLAIN}</span></td> + <td class="row2" width="50%"><input class="radio" type="radio" name="allow_html" value="1" {S_ALLOW_HTML_YES} /> {L_YES} <input type="radio" name="allow_html" value="0" {S_ALLOW_HTML_NO} /> {L_NO}</td> + </tr> + <tr> + <td class="row1" width="50%">{L_ALLOWED_HTML_TAGS}<br /><span class="gensmall">{L_ALLOWED_HTML_TAGS_EXPLAIN}</span></td> + <td class="row2" width="50%"><input text="text" name="allowed_html_tags" value="{ALLOWED_HTML_TAGS}" size="15" maxlength="50" /></td> + </tr> + <tr> + <td class="row1" width="50%">{L_ALLOW_BBCODE}<br /><span class="gensmall">{L_ALLOW_BBCODE_EXPLAIN}</span></td> + <td class="row2" width="50%"><input type="radio" name="allow_bbcode" value="1" {S_ALLOW_BBCODE_YES} /> {L_YES} <input type="radio" name="allow_bbcode" value="0" {S_ALLOW_BBCODE_NO} /> {L_NO}</td> + </tr> + <tr> + <td class="row1" width="50%">{L_ALLOW_SMILIES}<br /><span class="gensmall">{L_ALLOW_SMILIES_EXPLAIN}</span></td> + <td class="row2" width="50%"><input type="radio" name="allow_smilies" value="1" {S_ALLOW_SMILIES_YES} /> {L_YES} <input type="radio" name="allow_smilies" value="0" {S_ALLOW_SMILIES_NO} /> {L_NO}</td> + </tr> + <tr> + <td class="row1" width="50%">{L_FORMATTING_FIXUP}<br /><span class="gensmall">{L_FORMATTING_FIXUP_EXPLAIN}</span></td> + <td class="row2" width="50%"><input type="radio" name="formatting_fixup" value="1" {S_FORMATTING_FIXUP_YES} /> {L_YES} <input type="radio" name="formatting_fixup" value="0" {S_FORMATTING_FIXUP_NO} /> {L_NO}</td> + </tr> + <tr> <th class="thHead" colspan="2">{L_COMMENTS_INFO}</th> </tr> + <tr> ! <td class="row1" width="50%">{L_USE_COMMENTS}<br /><span class="gensmall">{L_USE_COMMENTS_EXPLAIN}</span></td> ! <td class="row2" width="50%"><input type="radio" name="use_comments" value="1" {S_USE_COMMENTS_YES} /> {L_YES} <input type="radio" name="use_comments" value="0" {S_USE_COMMENTS_NO} /> {L_NO}</td> </tr> + <tr> <td class="row1" width="50%">{L_COMMENTS_SHOW}<br /><span class="gensmall">{L_COMMENTS_SHOW_EXPLAIN}</span></td> *************** *** 81,88 **** </tr> <tr> - <td class="row1" width="50%">{L_FORUM_ID}<br /><span class="gensmall">{L_FORUM_ID_EXPLAIN}</span></td> - <td class="row2" width="50%">{FORUMS}</td> - </tr> - <tr> <td class="row1" width="50%">{L_DEL_TOPIC}<br /><span class="gensmall">{L_DEL_TOPIC_EXPLAIN}</span></td> <td class="row2" width="50%"><input type="radio" name="del_topic" value="1" {S_DEL_TOPIC_YES} /> {L_YES} <input type="radio" name="del_topic" value="0" {S_DEL_TOPIC_NO} /> {L_NO}</td> --- 91,94 ---- *************** *** 91,101 **** <th class="thHead" colspan="2">{L_RATINGS_INFO}</th> </tr> <tr> ! <td class="row1" width="50%">{L_ALLOW_RATING}<br /><span class="gensmall">{L_ALLOW_RATING_EXPLAIN}</span></td> ! <td class="row2" width="50%"><input type="radio" name="allow_rating" value="1" {S_ALLOW_RATING_YES} /> {L_YES} <input type="radio" name="allow_rating" value="0" {S_ALLOW_RATING_NO} /> {L_NO}</td> ! </tr> ! <tr> ! <td class="row1" width="50%">{L_ALLOW_ANONYMOS_RATING}<br /><span class="gensmall">{L_ALLOW_ANONYMOS_RATING_EXPLAIN}</span></td> ! <td class="row2" width="50%"><input type="radio" name="allow_anonymos_rating" value="1" {S_ALLOW_ANONYMOS_RATING_YES} /> {L_YES} <input type="radio" name="allow_anonymos_rating" value="0" {S_ALLOW_ANONYMOS_RATING_NO} /> {L_NO}</td> </tr> <tr> --- 97,104 ---- <th class="thHead" colspan="2">{L_RATINGS_INFO}</th> </tr> + <tr> ! <td class="row1" width="50%">{L_USE_RATINGS}<br /><span class="gensmall">{L_USE_RATINGS_EXPLAIN}</span></td> ! <td class="row2" width="50%"><input type="radio" name="use_ratings" value="1" {S_USE_RATINGS_YES} /> {L_YES} <input type="radio" name="use_ratings" value="0" {S_USE_RATINGS_NO} /> {L_NO}</td> </tr> <tr> --- NEW FILE: kb_cat_auth_body.tpl --- <h1>{L_ALBUM_AUTH_TITLE}</h1> <p>{L_ALBUM_AUTH_EXPLAIN}</p> <form action="{S_ALBUM_ACTION}" method="post"> <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> <th class="thCornerL" height="25" nowrap="nowrap">{L_GROUPS}</th> <th class="thTop" nowrap="nowrap">{L_VIEW}</th> <th class="thTop" nowrap="nowrap">{L_UPLOAD}</th> <th class="thTop" nowrap="nowrap">{L_RATE}</th> <th class="thTop" nowrap="nowrap">{L_COMMENT}</th> <th class="thTop" nowrap="nowrap">{L_EDIT}</th> <th class="thTop" nowrap="nowrap">{L_DELETE}</th> <th class="thTop" nowrap="nowrap">{L_APPROVAL}</th> <th class="thTop" nowrap="nowrap">{L_APPROVAL_EDIT}</th> <th class="thCornerR" nowrap="nowrap">{L_IS_MODERATOR}</th> </tr> <!-- BEGIN grouprow --> <tr> <td class="row1" align="center" height="28"><span class="gen">{grouprow.GROUP_NAME}</span></td> <td class="row2" align="center"> <input name="view[]" type="checkbox" {grouprow.VIEW_CHECKED} value="{grouprow.GROUP_ID}" /> </td> <td class="row2" align="center"> <input name="post[]" type="checkbox" {grouprow.POST_CHECKED} value="{grouprow.GROUP_ID}" /> </td> <td class="row2" align="center"> <input name="rate[]" type="checkbox" {grouprow.RATE_CHECKED} value="{grouprow.GROUP_ID}" /> </td> <td class="row2" align="center"> <input name="comment[]" type="checkbox" {grouprow.COMMENT_CHECKED} value="{grouprow.GROUP_ID}" /> </td> <td class="row2" align="center"> <input name="edit[]" type="checkbox" {grouprow.EDIT_CHECKED} value="{grouprow.GROUP_ID}" /> </td> <td class="row2" align="center"> <input name="delete[]" type="checkbox" {grouprow.DELETE_CHECKED} value="{grouprow.GROUP_ID}" /> </td> <td class="row2" align="center"> <input name="approval[]" type="checkbox" {grouprow.APPROVAL_CHECKED} value="{grouprow.GROUP_ID}" /> </td> <td class="row2" align="center"> <input name="approval_edit[]" type="checkbox" {grouprow.APPROVAL_EDIT_CHECKED} value="{grouprow.GROUP_ID}" /> </td> <td class="row2" align="center"> <input name="moderator[]" type="checkbox" {grouprow.MODERATOR_CHECKED} value="{grouprow.GROUP_ID}" /> </td> </tr> <!-- END grouprow --> <tr> <td class="catBottom" height="25" align="center" colspan="10"><input type="reset" value="{L_RESET}" class="liteoption" /> <input name="submit" type="submit" value="{L_SUBMIT}" class="mainoption" /></td> </tr> </table> </form> <br /> --- NEW FILE: kb_select_field_type.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th colspan="2" class="thHead">{L_FIELD_TITLE}</th> </tr> <tr> <td class="row1" align="center"> {S_SELECT_FIELD_TYPE} </td> </tr> <tr> <td align="center" class="cat" colspan="2"> {S_HIDDEN_FIELDS}<input class="liteoption" type="submit" value="{L_FIELD_TITLE}" name="submit"> </td> </tr> </table> </form> Index: kb_config.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/admin/kb_config.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_config.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_config.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 13,16 **** --- 13,17 ---- <td class="row2" width="50%"><input type="radio" name="allow_new" value="1" {S_NEW_YES} /> {L_YES} <input type="radio" name="allow_new" value="0" {S_NEW_NO} /> {L_NO}</td> </tr> + <!-- <tr> <td class="row1" width="50%">{L_APPROVE_NEW_NAME}<br /><span class="gensmall">{L_APPROVE_NEW_EXPLAIN}</span></td> *************** *** 29,32 **** --- 30,34 ---- <td class="row2" width="50%"><input type="radio" name="allow_anon" value="1" {S_ANON_YES} /> {L_YES} <input type="radio" name="allow_anon" value="0" {S_ANON_NO} /> {L_NO}</td> </tr> + --> <tr> <td class="row1" width="50%">{L_NOTIFY_NAME}<br /><span class="gensmall">{L_NOTIFY_EXPLAIN}</span></td> *************** *** 37,44 **** --- 39,48 ---- <td class="row2" width="50%"><input class="post" type="text" name="admin_id" value="{ADMIN_ID}" size="5" maxlength="4" /></td> </tr> + <!-- <tr> <td class="row1" width="50%">{L_COMMENTS}<br /><span class="gensmall">{L_COMMENTS_EXPLAIN}</span></td> <td class="row2" width="50%"><input type="radio" name="comments" value="1" {S_COMMENTS_YES} /> {L_YES} <input type="radio" name="comments" value="0" {S_COMMENTS_NO} /> {L_NO}</td> </tr> + --> <tr> <td class="row1" width="50%">{L_FORUM_ID}<br /><span class="gensmall">{L_FORUM_ID_EXPLAIN}</span></td> --- NEW FILE: kb_type_edit_body.tpl --- <h1>{L_EDIT_TITLE}</h1> <p>{L_EDIT_DESCRIPTION}</p> <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> <form action="{S_ACTION}" method="post"> <tr> <th class="thHead" colspan="2">{L_CAT_SETTINGS}</th> </tr> <tr> <td class="row1">{L_CATEGORY}</td> <td class="row2"><input class="post" type="text" size="25" name="catname" value="{CAT_NAME}" class="post" /></td> </tr> <!-- BEGIN switch_cat --> <tr> <td class="row1">{L_DESCRIPTION}</td> <td class="row2"><textarea rows="5" cols="45" wrap="virtual" name="catdesc" class="post">{CAT_DESCRIPTION}</textarea></td> </tr> <tr> <td class="row1">{L_PARENT}</td> <td class="row2"> <select name="parent"> <option value="0">{L_NONE}</otpion> {PARENT_LIST} </select> </tr> <tr> <td class="row1" width="50%">{L_FORUM_ID}<br /><span class="gensmall">{L_FORUM_ID_EXPLAIN}</span></td> <td class="row2" width="50%">{FORUM_LIST}</td> </tr> <!-- BEGIN switch_edit_category --> <tr> <td class="row1">{L_NUMBER_ARTICLES}</td> <td class="row2"><input class="post" type="text" size="4" maxlength="3" name="number_articles" value="{NUMBER_ARTICLES}" class="post" /></td> </tr> <!-- END switch_edit_category --> <!-- END switch_cat --> <tr> <td class="catBottom" colspan="2" align="center">{S_HIDDEN}<input type="submit" name="submit" value="{L_CREATE}" class="mainoption" /></td> </tr> </table> </form> <br clear="all" /> --- NEW FILE: kb_select_field_edit.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th colspan="2" class="thHead">{L_FIELD_TITLE}</th> </tr> <!-- BEGIN field_row --> <tr> <td width="3%" class="row1" align="center" valign="middle"><input type="radio" name="field_id" value="{field_row.FIELD_ID}" /></td> <td width="97%" class="row1"><b>{field_row.FIELD_NAME}</b><br /><span class="gensmall">{field_row.FIELD_DESC}</span></td></tr> <!-- END field_row --> <td align="center" class="cat" colspan="2"> {S_HIDDEN_FIELDS}<input class="liteoption" type="submit" value="{L_FIELD_TITLE}" name="submit"> </td> </tr> </table> </form> --- NEW FILE: kb_field_add.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <!-- IF ERROR neq '' --> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <td class="row2" align="center">{ERROR}</td> </tr> </table> <br /> <!-- ENDIF --> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th colspan="2" class="thHead">{L_FIELD_TITLE}</th> </tr> <tr> <td width="50%" class="row1">{L_FIELD_NAME}<br><span class="gensmall">{L_FIELD_NAME_INFO}</span></td> <td class="row2"><input type="text" class="post" size="50" name="field_name" value="{FIELD_NAME}" /></td> </tr> <tr> <td class="row1">{L_FIELD_DESC}<br><span class="gensmall">{L_FIELD_DESC_INFO}</span></td> <td class="row2"><input type="text" class="post" size="50" name="field_desc" value="{FIELD_DESC}" /></td> </tr> <!-- IF DATA --> <tr> <td class="row1">{L_FIELD_DATA}<br><span class="gensmall">{L_FIELD_DATA_INFO}</span></td> <td class="row2"><textarea rows="6" name="data" cols="32">{FIELD_DATA}</textarea></td> </tr> <!-- ENDIF --> <!-- IF REGEX --> <tr> <td class="row1">{L_FIELD_REGEX}<br><span class="gensmall">{L_FIELD_REGEX_INFO}</span></td> <td class="row2"><input type="text" class="post" size="50" name="regex" value="{FIELD_REGEX}" /></td> </tr> <!-- ENDIF --> <!-- IF ORDER --> <tr> <td width="50%" class="row1">{L_FIELD_ORDER}</td> <td class="row2"><input type="text" class="post" size="6" name="field_order" value="{FIELD_ORDER}" /></td> </tr> <!-- ENDIF --> <tr> <td align="center" class="cat" colspan="2"> {S_HIDDEN_FIELDS}<input class="liteoption" type="submit" value="{L_FIELD_TITLE}" name="submit"> </td> </tr> </table> </form> --- NEW FILE: kb_select.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th class="thHead">{L_SELECT_TITLE}</b></th> </tr> <tr> <td align="center" class="row1" > <input class="liteoption" type="submit" value="add" name="mode"> <input class="liteoption" type="submit" value="edit" name="mode"> <input class="liteoption" type="submit" value="delete" name="mode"></td> </tr> <tr> <th class="thHead">{L_FIELD_TITLE}</b></th> </tr> <!-- BEGIN field_row --> <tr> <td width="97%" class="row1" align="center"><b>{field_row.FIELD_NAME}</b><br><span class="gensmall">{field_row.FIELD_DESC}</span></td> </tr> <!-- END field_row --> </table> </form> --- NEW FILE: kb_select_field_delete.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th colspan="2" class="thHead">{L_FIELD_TITLE}</b></th> </tr> <!-- BEGIN field_row --> <tr> <td width="3%" class="row1" align="center" valign="middle"><input type="checkbox" name="field_ids[{field_row.FIELD_ID}]" value="yes"></td> <td width="97%" class="row1"><b>{field_row.FIELD_NAME}</b><br><span class="gensmall">{field_row.FIELD_DESC}</span></td> </tr> <!-- END field_row --> <tr> <td align="center" class="cat" colspan="2">{S_HIDDEN_FIELDS}<input class="liteoption" type="submit" value="{L_FIELD_TITLE}" name="submit"></td> </tr> </table> </form> --- NEW FILE: kb_cat_select_body.tpl --- <h1>{L_KB_AUTH_TITLE}</h1> <p>{L_KB_AUTH_EXPLAIN}</p> <form action="{S_KB_ACTION}" method="post"> <table width="50%" align="center" cellpadding="3" cellspacing="1" border="0" class="forumline"> <tr> <th class="thHead" colspan="2" height="28">{L_SELECT_CAT}</th> </tr> <tr> <td class="row1" height="25"><select name="cat_id">{CAT_SELECT_TITLE}</select></td> <td class="row1" width="100%" align="center"><input name="submit" type="submit" value="{L_LOOK_UP_CAT}" class="liteoption" /> </td> </tr> </table> </form> <br /> |
Update of /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9026/modules/kb_076_mxaddon/root/templates/subSilver Modified Files: kb_article_body.tpl kb_article_body_print.tpl kb_cat_body.tpl kb_footer.tpl kb_header.tpl kb_index_body.tpl kb_rate_body.tpl kb_search_body.tpl kb_search_results.tpl kb_stats_body.tpl Added Files: kb_post_body.tpl kb_post_pretext.tpl kb_post_preview.tpl Removed Files: kb_add_body.tpl kb_add_pretext.tpl kb_add_preview.tpl 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 Index: kb_header.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_header.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_header.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_header.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 1,5 **** ! <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> ! <td align="center" width="100%" valign="middle"><span class="maintitle">{L_KB_TITLE}</span> </td> </tr> <tr> --- 1,5 ---- ! <table width="100%" cellspacing="0" cellpadding="2" border="0"> <tr> ! {L_KB_TITLE} </tr> <tr> *************** *** 16,22 **** <tr valign="top"> <td width="100%"> ! <table width="100%" cellspacing="1" cellpadding="3" border="0" class="forumline" style="margin-top: 21px;"> <tr> ! <th class="thHead" colspan="2"> {switch_quick_stats.L_QUICK_STATS} </td> </tr> <tr><td class="row2" width = "100%" align="center"><span class="gen"> --- 16,22 ---- <tr valign="top"> <td width="100%"> ! <table width="100%" cellspacing="0" cellpadding="4" border="0" class="forumline" > <tr> ! <th class="thTop" colspan="2"> {switch_quick_stats.L_QUICK_STATS} </td> </tr> <tr><td class="row2" width = "100%" align="center"><span class="gen"> --- NEW FILE: kb_post_pretext.tpl --- <br clear="all" /> <table class="forumline" width="100%" cellspacing="0" cellpadding="4" border="0"> <tr> <th height="25" class="thHead">{PRETEXT_HEADER}</th> </tr> <tr> <td class="row1"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <span class="postbody">{PRETEXT_BODY}</span> </td> </tr> </table></td> </tr> <tr> <td class="spaceRow" height="1"><img src="templates/subSilver/images/spacer.gif" width="1" height="1" /></td> </tr> </table> <br clear="all" /> Index: kb_search_results.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_search_results.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_search_results.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_search_results.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 8,12 **** <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> ! <td align="left"><span class="nav"><a href="{U_PORTAL}" class="nav">{L_PORTAL}</a></span></td> </tr> </table> --- 8,12 ---- <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> ! <td align="left"><span class="nav"><a href="{U_KB}" class="nav">{L_KB}</a></span></td> </tr> </table> *************** *** 39,45 **** </table> ! <table width="100%" cellspacing="2" border="0" align="center"> ! <tr> ! <td valign="top" align="right">{JUMPBOX}</td> ! </tr> ! </table> --- 39,41 ---- </table> ! Index: kb_article_body.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_article_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_article_body.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_article_body.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 2,6 **** <tr> <td align="left" class="nav"> ! <a href="{U_PORTAL}" class="nav">{L_PORTAL}</a> -> <a href="{U_KB}" class="nav">{L_KB}</a> {PATH} </td> <td align="right" class="nav"> --- 2,6 ---- <tr> <td align="left" class="nav"> ! <a href="{U_KB}" class="nav">{L_KB}</a> {PATH} </td> <td align="right" class="nav"> *************** *** 10,36 **** </table> ! <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline"> <tr> <th class="thHead" nowrap="nowrap"> {ARTICLE_TITLE} </th> </tr> <tr> ! <td class="row2"> ! <span class="gen"><b>{L_ARTICLE_DESCRIPTION}</b></span> <span class="gen">{ARTICLE_DESCRIPTION}</span><br /> ! <span class="gen"><b>{L_ARTICLE_AUTHOR}</b></span> <span class="gen">{ARTICLE_AUTHOR}</span> ! <span class="gen"><b>{L_ARTICLE_DATE}</b></span> <span class="gen">{ARTICLE_DATE}</span> ! <span class="gen"><b>{L_ARTICLE_TYPE}</b></span> <span class="gen">{ARTICLE_TYPE}</span><br /> ! <span class="gen"><b>{L_ARTICLE_KEYWORDS}</b></span> <span class="gen">{ARTICLE_KEYWORDS}</span><br /> ! <span class="gen"><b>{L_ARTICLE_CATEGORY}</b></span> <span class="gen">{ARTICLE_CATEGORY}</span><br /> <!-- BEGIN switch_comments --> ! <span class="gen">{COMMENTS}</span><br /> <!-- END switch_comments --> - <span class="gen">{VIEWS}</span> <!-- BEGIN switch_ratings --> ! <span class="gen">{RATINGS} {RATE_IMG}</span><br /> <!-- END switch_ratings --> <hr></td> </tr> <tr> ! <td class="row1" wrap="wrap"><span class="maintitle">{ARTICLE_TITLE}</span><span class="postbody"><br />{ARTICLE_DESCRIPTION}</span></td> </tr> <!-- BEGIN switch_toc --> --- 10,48 ---- </table> ! <table width="100%" cellpadding="4" cellspacing="0" border="0" class="forumline"> ! <!-- <tr> <th class="thHead" nowrap="nowrap"> {ARTICLE_TITLE} </th> </tr> + --> <tr> ! <td class="row2"><hr> ! <span class="gensmall"><b>{L_ARTICLE_AUTHOR}</b></span> <span class="gen">{ARTICLE_AUTHOR}</span> ! <span class="gensmall"><b>{L_ARTICLE_DATE}</b></span> <span class="gen">{ARTICLE_DATE}</span> ! <span class="gensmall">{VIEWS}<br /></span> ! <span class="gensmall"><b>{L_ARTICLE_DESCRIPTION}</b></span> <span class="gen">{ARTICLE_DESCRIPTION}<br /></span> ! <span class="gensmall"><b>{L_ARTICLE_KEYWORDS}</b></span> <span class="gen">{ARTICLE_KEYWORDS}</span> ! <span class="gensmall"><b>{L_ARTICLE_CATEGORY}</b></span> <span class="gen">{ARTICLE_CATEGORY}</span> ! <span class="gensmall"><b>{L_ARTICLE_TYPE}</b></span> <span class="gen">{ARTICLE_TYPE}</span> ! ! <!-- BEGIN custom_field --> ! <span class="gensmall"><br /><b>{custom_field.CUSTOM_NAME}</b> </span> <span class="gen">{custom_field.DATA} </span> ! <!-- END custom_field --> ! <hr> <!-- BEGIN switch_comments --> ! <span class="gensmall">{COMMENTS} </span> <span class="gen">{COMMENTS_IMG}<br /></span> <!-- END switch_comments --> <!-- BEGIN switch_ratings --> ! <span class="gensmall">{RATINGS} </span> <span class="gen">{RATE_IMG}</span> <!-- END switch_ratings --> + + + <hr></td> </tr> + <tr> ! <td class="row1" wrap="wrap"> ! <span class="maintitle"style="font-size: 9pt;">{ARTICLE_TITLE}</span> </tr> <!-- BEGIN switch_toc --> *************** *** 44,50 **** </tr> <!-- END switch_toc --> - <tr> - <td class="spaceRow" height="1"><img src="templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td> - </tr> <tr> <td class="row1" wrap="wrap"><span class="postbody">{ARTICLE_TEXT}</span></td> --- 56,59 ---- *************** *** 66,72 **** <!-- BEGIN switch_comments_show --> <br /> ! <table width="100%" cellpadding="4" cellspacing="1" border="0" align="center" class="forumline"> <tr> ! <th class="thHead"> {L_COMMENTS} </th> </tr> <!-- END switch_comments_show --> --- 75,81 ---- <!-- BEGIN switch_comments_show --> <br /> ! <table width="100%" cellpadding="4" cellspacing="0" border="0" align="center" class="forumline"> <tr> ! <th class="thTop"> {L_COMMENTS} </th> </tr> <!-- END switch_comments_show --> *************** *** 92,95 **** --- 101,105 ---- <!-- BEGIN switch_comments_show --> </table> + <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> *************** *** 102,114 **** <table width="100%" cellspacing="2" border="0" align="center"> <tr> ! <td> <!-- BEGIN switch_comments --> ! <span class="gensmall">{COMMENTS}</span><br /> <!-- END switch_comments --> <!-- BEGIN switch_ratings --> ! <span class="gensmall">{RATINGS} {RATE_IMG}</span><br /> <!-- END switch_ratings --> </td> ! <td valign="top" align="right"><br />{JUMPBOX}</td> </tr> </table> --- 112,124 ---- <table width="100%" cellspacing="2" border="0" align="center"> <tr> ! <td valign="top" align="left"> <!-- BEGIN switch_comments --> ! <span class="gensmall">{COMMENTS} {COMMENTS_IMG}</span><br /> <!-- END switch_comments --> <!-- BEGIN switch_ratings --> ! <span class="gensmall">{RATINGS}{RATE_IMG}</span> <!-- END switch_ratings --> </td> ! <td valign="top" align="right"><span class="gensmall">{S_AUTH_LIST}</span></td> </tr> </table> Index: kb_search_body.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_search_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_search_body.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_search_body.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 2,6 **** <form action="{S_SEARCH_ACTION}" method="POST"><table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> ! <td align="left"><span class="nav"><a href="{U_PORTAL}" class="nav">{L_PORTAL}</a></span></td> </tr> </table> --- 2,6 ---- <form action="{S_SEARCH_ACTION}" method="POST"><table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> ! <td align="left"><span class="nav"><a href="{U_KB}" class="nav">{L_KB}</a></span></td> </tr> </table> *************** *** 25,31 **** </table></form> ! <table width="100%" border="0"> ! <tr> ! <td align="right" valign="top">{JUMPBOX}</td> ! </tr> ! </table> --- 25,27 ---- </table></form> ! --- NEW FILE: kb_post_preview.tpl --- <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> <th height="25" class="thHead">{L_PREVIEW}</th> </tr> <tr> <td class="row1"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <span class="postbody">{PREVIEW_MESSAGE}</span> </td> </tr> </table></td> </tr> <tr> <td class="spaceRow" height="1"><img src="templates/subSilver/images/spacer.gif" width="1" height="1" /></td> </tr> </table> <br clear="all" /> Index: kb_footer.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_footer.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_footer.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_footer.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 1,7 **** <div align="center"><span class="copyright"><br /> ! Powered by Knowledge Base, {L_MODULE_ORIG_AUTHOR} ©2002 <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=200195" target="_phpbb" class="copyright">PHPBB.com MOD</a><br /> This script ({L_MODULE_VERSION}) is modified by <a href="http://www.mx-system.com/" target="_phpbb" class="copyright">{L_MODULE_AUTHOR}</a><br /> </span></div> ! ! <br /> </table> \ No newline at end of file --- 1,7 ---- + <!-- <div align="center"><span class="copyright"><br /> ! Powered by Knowledge Base, {L_MODULE_ORIG_AUTHOR} ©2002 <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=89202" target="_phpbb" class="copyright">PHPBB.com MOD</a><br /> This script ({L_MODULE_VERSION}) is modified by <a href="http://www.mx-system.com/" target="_phpbb" class="copyright">{L_MODULE_AUTHOR}</a><br /> </span></div> ! --> </table> \ No newline at end of file Index: kb_article_body_print.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_article_body_print.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_article_body_print.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_article_body_print.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 15,36 **** <table align ="center" width="80%" cellpadding="4" cellspacing="1" border="0" class="forumline"> <tr> - <td class="maintitle" nowrap="nowrap">{ARTICLE_TITLE} <br /><hr></td> - </tr> - <tr> <td class="row2"> ! <span class="gen"><b>{L_ARTICLE_DESCRIPTION}</b></span> <span class="gen">{ARTICLE_DESCRIPTION}</span><br /> ! <span class="gen"><b>{L_ARTICLE_AUTHOR}</b></span> <span class="gen">{ARTICLE_AUTHOR}</span> ! <span class="gen"><b>{L_ARTICLE_DATE}</b></span> <span class="gen">{ARTICLE_DATE}</span> ! <span class="gen"><b>{L_ARTICLE_TYPE}</b></span> <span class="gen">{ARTICLE_TYPE}</span><br /> ! <span class="gen"><b>{L_ARTICLE_KEYWORDS}</b></span> <span class="gen">{ARTICLE_KEYWORDS}</span><br /> ! <span class="gen"><b>{L_ARTICLE_CATEGORY}</b></span> <span class="gen">{ARTICLE_CATEGORY}</span><br /> <!-- BEGIN switch_comments --> ! <span class="gen">{COMMENTS}</span><br /> <!-- END switch_comments --> - <span class="gen">{VIEWS}</span> <!-- BEGIN switch_ratings --> ! <span class="gen">{RATINGS} {RATE_IMG}</span><br /> <!-- END switch_ratings --> ! <hr></td> <!-- BEGIN switch_toc --> <tr> --- 15,37 ---- <table align ="center" width="80%" cellpadding="4" cellspacing="1" border="0" class="forumline"> <tr> <td class="row2"> ! <span class="gensmall"><b>{L_ARTICLE_AUTHOR}</b></span> <span class="gensmall">{ARTICLE_AUTHOR}</span> ! <span class="gensmall"><b>{L_ARTICLE_DATE}</b></span> <span class="gensmall">{ARTICLE_DATE}</span> ! <span class="gensmall">{VIEWS}</span><br /> ! ! <span class="gensmall"><b>{L_ARTICLE_KEYWORDS}</b></span> <span class="gensmall">{ARTICLE_KEYWORDS}</span><br /> ! <span class="gensmall"><b>{L_ARTICLE_DESCRIPTION}</b> </span><span class="gensmall">{ARTICLE_DESCRIPTION}</span> ! ! <!-- BEGIN custom_field --> ! <span class="gensmall"><br /><b>{custom_field.CUSTOM_NAME}</b> </span> <span class="gen">{custom_field.DATA} </span> ! <!-- END custom_field --> ! <br /> <!-- BEGIN switch_comments --> ! <span class="gensmall"><br />{COMMENTS}</span> <!-- END switch_comments --> <!-- BEGIN switch_ratings --> ! <span class="gensmall"><br />{RATINGS}</span> <!-- END switch_ratings --> ! </td> <!-- BEGIN switch_toc --> <tr> *************** *** 44,48 **** <!-- END switch_toc --> <tr> ! <td class="spaceRow" height="1"><img src="templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td> </tr> <tr> --- 45,49 ---- <!-- END switch_toc --> <tr> ! <td class="maintitle" nowrap="nowrap"><br />{ARTICLE_TITLE} <br /><hr></td> </tr> <tr> *************** *** 64,68 **** <table align ="center" width="80%" cellpadding="4" cellspacing="1" border="0" class="forumline"> <tr> ! <td class="maintitle">{L_COMMENTS} </td> </tr> <!-- END switch_comments_show --> --- 65,69 ---- <table align ="center" width="80%" cellpadding="4" cellspacing="1" border="0" class="forumline"> <tr> ! <td class="cattitle">{L_COMMENTS} </td> </tr> <!-- END switch_comments_show --> Index: kb_index_body.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_index_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_index_body.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_index_body.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 1,8 **** <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> ! <td align="left" class="nav"><a href="{U_PORTAL}" class="nav">{L_PORTAL}</a> -> <a href="{U_KB}" class="nav">{L_KB}</a></td> </tr> </table> ! <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_CATEGORY} </th> --- 1,8 ---- <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> ! <td align="left" class="nav"><a href="{U_KB}" class="nav">{L_KB}</a></td> </tr> </table> ! <table width="100%" cellpadding="4" cellspacing="0" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_CATEGORY} </th> *************** *** 19,25 **** </tr> </table> ! <table width="100%" cellspacing="2" border="0" align="center"> ! <tr> ! <td valign="top" align="right"><br />{JUMPBOX}</td> ! </tr> ! </table> --- 19,21 ---- </tr> </table> ! Index: kb_stats_body.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_stats_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_stats_body.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_stats_body.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 2,6 **** <tr> <td align="left" class="nav"> ! <a href="{U_PORTAL}" class="nav">{L_PORTAL}</a> -> <a href="{U_KB}" class="nav">{L_KB}</a> {PATH} </td> </tr> --- 2,6 ---- <tr> <td align="left" class="nav"> ! <a href="{U_KB}" class="nav">{L_KB}</a> {PATH} </td> </tr> *************** *** 8,12 **** <!-- BEGIN switch_sub_cats --> ! <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_CATEGORY} </th> --- 8,12 ---- <!-- BEGIN switch_sub_cats --> ! <table width="100%" cellpadding="4" cellspacing="0" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_CATEGORY} </th> *************** *** 25,29 **** <br /> <!-- END switch_sub_cats --> ! <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_ARTICLE} </th> --- 25,29 ---- <br /> <!-- END switch_sub_cats --> ! <table width="100%" cellpadding="4" cellspacing="0" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_ARTICLE} </th> *************** *** 36,46 **** <!-- BEGIN articlerow --> <tr> ! <td class="row1" height="50">{articlerow.ARTICLE}<br /><span class="genmed">{articlerow.ARTICLE_DESCRIPTION} <br />{articlerow.U_APPROVE} {articlerow.U_DELETE}</span></td> ! <td class="row1" align="center" valign="middle"> <span class="genmed">{articlerow.CATEGORY}</span> </td> ! <td class="row1" align="center" valign="middle"> <span class="genmed">{articlerow.ARTICLE_TYPE}</span> </td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ARTICLE_AUTHOR}</span></td> ! <td class="row1" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{articlerow.ARTICLE_DATE}</span></td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ART_VIEWS}</span></td> </tr> <!-- END articlerow --> <!-- BEGIN no_articles --> --- 36,50 ---- <!-- BEGIN articlerow --> <tr> ! <td class="row2" align="left" valign="middle">{articlerow.ARTICLE}</td> ! <td class="row2" align="center" valign="middle"> <span class="genmed">{articlerow.CATEGORY}</span> </td> ! <td class="row2" align="center" valign="middle"> <span class="genmed">{articlerow.ARTICLE_TYPE}</span> </td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ARTICLE_AUTHOR}</span></td> ! <td class="row2" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{articlerow.ARTICLE_DATE}</span></td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ART_VIEWS}</span></td> </tr> + <tr> + <td class="row1" align="left" colspan="4"><span class="genmed">{articlerow.ARTICLE_DESCRIPTION}</span></td> + <td class="row1" align="right" colspan="2" >{articlerow.U_APPROVE} {articlerow.U_DELETE}</td> + </tr> <!-- END articlerow --> <!-- BEGIN no_articles --> *************** *** 53,59 **** </tr> </table> ! <table width="100%" cellspacing="2" border="0" align="center"> ! <tr> ! <td valign="top" align="right"><br />{JUMPBOX}</td> ! </tr> ! </table> --- 57,59 ---- </tr> </table> ! Index: kb_cat_body.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_cat_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_cat_body.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_cat_body.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 2,6 **** <tr> <td align="left" class="nav"> ! <a href="{U_PORTAL}" class="nav">{L_PORTAL}</a> -> <a href="{U_KB}" class="nav">{L_KB}</a> {PATH} </td> </tr> --- 2,6 ---- <tr> <td align="left" class="nav"> ! <a href="{U_KB}" class="nav">{L_KB}</a> {PATH} </td> </tr> *************** *** 8,12 **** <!-- BEGIN switch_sub_cats --> ! <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_CATEGORY} </th> --- 8,12 ---- <!-- BEGIN switch_sub_cats --> ! <table width="100%" cellpadding="4" cellspacing="0" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_CATEGORY} </th> *************** *** 25,29 **** <br /> <!-- END switch_sub_cats --> ! <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_ARTICLE} </th> --- 25,29 ---- <br /> <!-- END switch_sub_cats --> ! <table width="100%" cellpadding="4" cellspacing="0" border="0" class="forumline"> <tr> <th class="thCornerL" nowrap="nowrap"> {L_ARTICLE} </th> *************** *** 35,44 **** <!-- BEGIN articlerow --> <tr> ! <td class="row1" height="50">{articlerow.ARTICLE}<br /><span class="genmed">{articlerow.ARTICLE_DESCRIPTION} <br />{articlerow.U_APPROVE} {articlerow.U_DELETE}</span></td> ! <td class="row1" align="center" valign="middle"> <span class="genmed">{articlerow.ARTICLE_TYPE}</span> </td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ARTICLE_AUTHOR}</span></td> ! <td class="row1" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{articlerow.ARTICLE_DATE}</span></td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ART_VIEWS}</span></td> </tr> <!-- END articlerow --> <!-- BEGIN no_articles --> --- 35,48 ---- <!-- BEGIN articlerow --> <tr> ! <td class="row2" align="left" valign="middle">{articlerow.ARTICLE}</td> ! <td class="row2" align="center" valign="middle"> <span class="genmed">{articlerow.ARTICLE_TYPE}</span> </td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ARTICLE_AUTHOR}</span></td> ! <td class="row2" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{articlerow.ARTICLE_DATE}</span></td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ART_VIEWS}</span></td> </tr> + <tr> + <td class="row1" align="left" colspan="3"><span class="genmed">{articlerow.ARTICLE_DESCRIPTION}</span></td> + <td class="row1" align="right" colspan="2" >{articlerow.U_APPROVE} {articlerow.U_DELETE}</td> + </tr> <!-- END articlerow --> <!-- BEGIN no_articles --> *************** *** 51,63 **** </tr> </table> ! <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> ! <td><span class="nav">{PAGE_NUMBER}</span></td> ! <td align="right"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span></td> ! </tr> ! </table> ! <table width="100%" cellspacing="2" border="0" align="center"> ! <tr> ! <td valign="top" align="right"><br />{JUMPBOX}</td> </tr> </table> --- 55,65 ---- </tr> </table> ! ! <table width="100%" cellspacing="2" cellpadding="0" border="0"> <tr> ! <td valign="top" align="left" ><span class="nav">{PAGE_NUMBER}</span></td> ! <td valign="top" align="left" ><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span></td> ! <td valign="top" align="right" ><span class="gensmall">{S_AUTH_LIST}</span></td> </tr> </table> + Index: kb_rate_body.tpl =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/templates/subSilver/kb_rate_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_rate_body.tpl 9 Jan 2005 22:16:31 -0000 1.1 --- kb_rate_body.tpl 28 Mar 2005 20:54:55 -0000 1.2 *************** *** 1,7 **** {LOCBAR} <!-- BEGIN ip_check --> ! <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> ! <th class="thHead" colspan="2">{L_RATE}</th> </tr> <tr> --- 1,8 ---- {LOCBAR} + <br /> <!-- BEGIN ip_check --> ! <table width="100%" cellpadding="4" cellspacing="0" class="forumline"> <tr> ! <th class="thHead" colspan="2"> {L_RATE}</th> </tr> <tr> *************** *** 14,20 **** <!-- BEGIN do_rate --> ! <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> ! <th class="thHead" colspan="2">{L_RATE}</th> </tr> <tr> --- 15,21 ---- <!-- BEGIN do_rate --> ! <table width="100%" cellpadding="4" cellspacing="0" class="forumline"> <tr> ! <th class="thHead" colspan="2"> {L_RATE}</th> </tr> <tr> *************** *** 24,33 **** <tr> <td class="catBottom" colspan="2"> <!-- END do_rate --> <!-- BEGIN rate --> ! <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> ! <th colspan="2" class="thHead">{L_RATE}</th> </tr> <tr> --- 25,35 ---- <tr> <td class="catBottom" colspan="2"> + <!-- END do_rate --> <!-- BEGIN rate --> ! <table width="100%" cellpadding="4" cellspacing="0" class="forumline"> <tr> ! <th colspan="2" class="thHead"> {L_RATE}</th> </tr> <tr> *************** *** 58,59 **** --- 60,65 ---- </table> </form> + + </td> + </tr> + </table> \ No newline at end of file --- kb_add_preview.tpl DELETED --- --- kb_add_pretext.tpl DELETED --- --- NEW FILE: kb_post_body.tpl --- <script language="JavaScript" type="text/javascript"> <!-- // bbCode control by // subBlue design // www.subBlue.com // Startup variables var imageTag = false; var theSelection = false; // Check for Browser & Platform for PC & IE specific bits // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html var clientPC = navigator.userAgent.toLowerCase(); // Get client info var clientVer = parseInt(navigator.appVersion); // Get browser version var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); var is_moz = 0; var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1)); var is_mac = (clientPC.indexOf("mac")!=-1); // Helpline messages b_help = "{L_BBCODE_B_HELP}"; i_help = "{L_BBCODE_I_HELP}"; u_help = "{L_BBCODE_U_HELP}"; q_help = "{L_BBCODE_Q_HELP}"; c_help = "{L_BBCODE_C_HELP}"; l_help = "{L_BBCODE_L_HELP}"; o_help = "{L_BBCODE_O_HELP}"; p_help = "{L_BBCODE_P_HELP}"; w_help = "{L_BBCODE_W_HELP}"; a_help = "{L_BBCODE_A_HELP}"; s_help = "{L_BBCODE_S_HELP}"; f_help = "{L_BBCODE_F_HELP}"; // Define the bbCode tags bbcode = new Array(); bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]'); imageTag = false; // Shows the help messages in the helpline window function helpline(help) { document.post.helpbox.value = eval(help + "_help"); } // Replacement for arrayname.length property function getarraysize(thearray) { for (i = 0; i < thearray.length; i++) { if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) return i; } return thearray.length; } // Replacement for arrayname.push(value) not implemented in IE until version 5.5 // Appends element to the array function arraypush(thearray,value) { thearray[ getarraysize(thearray) ] = value; } // Replacement for arrayname.pop() not implemented in IE until version 5.5 // Removes and returns the last element of an array function arraypop(thearray) { thearraysize = getarraysize(thearray); retval = thearray[thearraysize - 1]; delete thearray[thearraysize - 1]; return retval; } function checkForm() { formErrors = false; if (document.post.article_name.value.length < 2) { formErrors = "{L_EMPTY_ARTICLE_NAME}\r"; } if (document.post.article_desc.value.length < 2) { formErrors = "{L_EMPTY_ARTICLE_DESC}\r"; } if (document.post.message.value.length < 2) { formErrors = "{L_EMPTY_MESSAGE}\r"; } if (document.post.type_id.value=='select_one') { formErrors = "{L_EMPTY_TYPE}\r"; } if (formErrors) { alert(formErrors); return false; } else { bbstyle(-1); //formObj.preview.disabled = true; //formObj.submit.disabled = true; return true; } } function emoticon(text) { var txtarea = document.post.message; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } function bbfontstyle(bbopen, bbclose) { var txtarea = document.post.message; if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; if (!theSelection) { txtarea.value += bbopen + bbclose; txtarea.focus(); return; } document.selection.createRange().text = bbopen + theSelection + bbclose; txtarea.focus(); return; } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) { mozWrap(txtarea, bbopen, bbclose); return; } else { txtarea.value += bbopen + bbclose; txtarea.focus(); } storeCaret(txtarea); } function bbstyle(bbnumber) { var txtarea = document.post.message; donotinsert = false; theSelection = false; bblast = 0; if (bbnumber == -1) { // Close all open tags & default button names while (bbcode[0]) { butnumber = arraypop(bbcode) - 1; txtarea.value += bbtags[butnumber + 1]; buttext = eval('document.post.addbbcode' + butnumber + '.value'); eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); } imageTag = false; // All tags are closed including image tags :D txtarea.focus(); return; } if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; // Get text selection if (theSelection) { // Add tags around selection document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1]; txtarea.focus(); theSelection = ''; return; } } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) { mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]); return; } // Find last occurance of an open tag the same as the one just clicked for (i = 0; i < bbcode.length; i++) { if (bbcode[i] == bbnumber+1) { bblast = i; donotinsert = true; } } if (donotinsert) { // Close all open tags up to the one just clicked & default button names while (bbcode[bblast]) { butnumber = arraypop(bbcode) - 1; txtarea.value += bbtags[butnumber + 1]; buttext = eval('document.post.addbbcode' + butnumber + '.value'); eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); imageTag = false; } txtarea.focus(); return; } else { // Open tags if (imageTag && (bbnumber != 14)) { // Close image tag before adding another txtarea.value += bbtags[15]; lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list document.post.addbbcode14.value = "Img"; // Return button back to normal state imageTag = false; } // Open tag txtarea.value += bbtags[bbnumber]; if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag arraypush(bbcode,bbnumber+1); eval('document.post.addbbcode'+bbnumber+'.value += "*"'); txtarea.focus(); return; } storeCaret(txtarea); } // From http://www.massless.org/mozedit/ function mozWrap(txtarea, open, close) { var selLength = txtarea.textLength; var selStart = txtarea.selectionStart; var selEnd = txtarea.selectionEnd; if (selEnd == 1 || selEnd == 2) selEnd = selLength; var s1 = (txtarea.value).substring(0,selStart); var s2 = (txtarea.value).substring(selStart, selEnd) var s3 = (txtarea.value).substring(selEnd, selLength); txtarea.value = s1 + open + s2 + close + s3; return; } // Insert at Claret position. Code from // http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 function storeCaret(textEl) { if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); } //--> </script> <!-- BEGIN tinyMCE --> <script language="javascript" type="text/javascript" src="modules/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script language="javascript" type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", theme_advanced_toolbar_location : "top", plugins : "table", theme_advanced_buttons3_add_before : "tablecontrols, separator" }); </script> <!-- END tinyMCE --> <form method="post" action="{S_ACTION}" onsubmit="return checkForm(this)" name="post"> {KB_PRETEXT_BOX} {KB_PREVIEW_BOX} <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> <td align="left" class="nav"><a href="{U_KB}" class="nav">{L_KB}</a></td> </tr> </table> <table border="0" cellpadding="4" cellspacing="0" align="center" width="100%" class="forumline"> <tr> <th class="thHead" colspan="2" height="25"><b>{L_ADD_ARTICLE}</b></th> </tr> <!-- BEGIN switch_name --> <tr> <td class="row1"><span class="gen"><b><nobr>{L_NAME}</nobr></b></span></td> <td class="row2"> <span class="gen"> <input type="text" name="username" size="45" maxlength="100" style="width:450px" class="post" value="{USERNAME}" /></span></td> </tr> <!-- END switch_name --> <tr> <td class="row1"><span class="gen"><b><nobr>{L_ARTICLE_TITLE}</nobr></b></span></td> <td class="row2"> <span class="gen"> <input type="text" name="article_name" size="45" maxlength="100" style="width:450px" class="post" value="{ARTICLE_TITLE}" /></span></td> </tr> <tr> <td class="row1"><span class="gen"><b>{L_ARTICLE_DESCRIPTION}</b></span></td> <td class="row2"> <span class="gen"> <input type="text" name="article_desc" size="45" maxlength="255" style="width:450px" class="post" value="{ARTICLE_DESC}" /></span></td> </tr> <!-- BEGIN custom_data_fields --> <tr> <td class="cat" colspan="2" align="center"><span class="cattitle">{custom_data_fields.L_ADDTIONAL_FIELD}</span></td> </tr> <!-- END custom_data_fields --> <!-- BEGIN input --> <tr> <td class="row1"><span class="genmed">{input.FIELD_NAME}</span><br><span class="gensmall">{input.FIELD_DESCRIPTION}</span></td> <td class="row2"> <input type="text" class="post" size="50" name="field[{input.FIELD_ID}]" value="{input.FIELD_VALUE}" /> </td> </tr> <!-- END input --> <!-- SPILT --> <!-- BEGIN textarea --> <tr> <td class="row1"><span class="genmed">{textarea.FIELD_NAME}</span><br><span class="gensmall">{textarea.FIELD_DESCRIPTION}</span></td> <td class="row2"> <textarea rows="6" class="post" name="field[{textarea.FIELD_ID}]" cols="32">{textarea.FIELD_VALUE}</textarea> </td> </tr> <!-- END textarea --> <!-- SPILT --> <!-- BEGIN radio --> <tr> <td class="row1"><span class="genmed">{radio.FIELD_NAME}</span><br><span class="gensmall">{radio.FIELD_DESCRIPTION}</span></td> <td class="row2"> <!-- BEGIN row --> <input type="radio" name="field[{radio.FIELD_ID}]" value="{radio.row.FIELD_VALUE}" {radio.row.FIELD_SELECTED} /><span class="gensmall">{radio.row.FIELD_VALUE}</span> <!-- END row --> </td> </tr> <!-- END radio --> <!-- SPILT --> <!-- BEGIN select --> <tr> <td class="row1"><span class="genmed">{select.FIELD_NAME}</span><br><span class="gensmall">{select.FIELD_DESCRIPTION}</span></td> <td class="row2"> <select name="field[{select.FIELD_ID}]" class="post"> <!-- BEGIN row --> <option value="{select.row.FIELD_VALUE}"{radio.row.FIELD_SELECTED}>{select.row.FIELD_VALUE}</option> <!-- END row --> </select> </td> </tr> <!-- END select --> <!-- SPILT --> <!-- BEGIN select_multiple --> <tr> <td class="row1"><span class="genmed">{select_multiple.FIELD_NAME}</span><br><span class="gensmall">{select_multiple.FIELD_DESCRIPTION}</span></td> <td class="row2"> <select name="field[{select_multiple.FIELD_ID}][]" multiple="multiple" size="4" class="post"> <!-- BEGIN row --> <option value="{select_multiple.row.FIELD_VALUE}"{select_multiple.row.FIELD_SELECTED}>{select_multiple.row.FIELD_VALUE}</option> <!-- END row --> </select> </td> </tr> <!-- END select_multiple --> <!-- SPILT --> <!-- BEGIN checkbox --> <tr> <td class="row1"><span class="genmed">{checkbox.FIELD_NAME}</span><br><span class="gensmall">{checkbox.FIELD_DESCRIPTION}</span></td> <td class="row2"> <!-- BEGIN row --> <input type="checkbox" name="field[{checkbox.FIELD_ID}][{checkbox.row.FIELD_VALUE}]" value="{checkbox.row.FIELD_VALUE}" {checkbox.row.FIELD_CHECKED}><span class="gensmall">{checkbox.row.FIELD_VALUE}</span> <!-- END row --> </td> </tr> <!-- END checkbox --> <tr> <td class="row1" valign="top"><span class="gen"><b><nobr>{L_ARTICLE_TEXT}</nobr></b><br /><br /> <table width="100" border="0" cellspacing="0" cellpadding="5" align="center"> <tr align="center"> <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td> </tr> <!-- BEGIN smilies_row --> <tr align="center" valign="middle"> <!-- BEGIN smilies_col --> <td><a href="javascript:emoticon('{smilies_row.smilies_col.SMILEY_CODE}')"><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td> <!-- END smilies_col --> </tr> <!-- END smilies_row --> <!-- BEGIN switch_smilies_extra --> <tr align="center"> <td colspan="{S_SMILIES_COLSPAN}"><span class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td> </tr> <!-- END switch_smilies_extra --> </table> <br /><br /><span class="gen"><b><nobr>{L_OPTIONS}</nobr></b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span><br /><br /> </td> <td class="row2" valign="top"><span class="gen"> <table width="450" border="0" cellspacing="0" cellpadding="2"> <!-- BEGIN switch_bbcodes --> <tr align="center" valign="middle"> <td><span class="genmed"> <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" /> </span></td> </tr> <tr> <td colspan="9"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><span class="genmed"> {L_FONT_COLOR}: <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')"> <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option> <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option> <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option> <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option> <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option> <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option> <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option> <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option> <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option> <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option> <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option> <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option> <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option> <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option> <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option> </select> {L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')"> <option value="7" class="genmed">{L_FONT_TINY}</option> <option value="9" class="genmed">{L_FONT_SMALL}</option> <option value="12" selected class="genmed">{L_FONT_NORMAL}</option> <option value="18" class="genmed">{L_FONT_LARGE}</option> <option value="24" class="genmed">{L_FONT_HUGE}</option> </select> </span> </td> <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td> </tr> </table> </td> </tr> <tr> <td colspan="9"> <span class="gensmall"> <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" /> </span> </td> </tr> <!-- END switch_bbcodes --> <tr> <td colspan="9"><span class="gen"><textarea name="message" rows="30" cols="35" wrap="virtual" style="width:450px" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{ARTICLE_BODY}</textarea></span> <!-- BEGIN formatting --> <br /><span class="gen"><b><nobr>{L_FORMATTING}</nobr></b></span><hr><span class="gensmall"><b>{L_PAGES}</b><br />{L_PAGES_EXPLAIN}<br /><b>{L_TOC}</b><br />{L_TOC_EXPLAIN}<br /><b>{L_ABSTRACT}</b><br />{L_ABSTRACT_EXPLAIN}<br /><hr><b>{L_TITLE_FORMAT}</b><br />{L_TITLE_FORMAT_EXPLAIN}<br /><b>{L_SUBTITLE_FORMAT}</b><br />{L_SUBTITLE_FORMAT_EXPLAIN}<br /><b>{L_SUBSUBTITLE_FORMAT}</b><br />{L_SUBSUBTITLE_FORMAT_EXPLAIN}</span><br /><br /> <!-- END formatting --> </td> </tr> </table> </span></td> </tr> <tr> <td class="row1" valign="top"><span class="gen"><b><nobr>{L_ARTICLE_TYPE}</nobr></b></span></td> <td class="row2"><span class="gen"> <select name="type_id"> <option value="select_one">{L_SELECT_TYPE}</option> <!-- BEGIN types --> {types.TYPE} <!-- END types --> </select> </span> </td> </tr> <!-- BEGIN switch_edit --> <tr> <td class="row1"><span class="gen"><b>{L_ARTICLE_CATEGORY}</b></span></td> <td class="row2"> <select name="category_id"> {switch_edit.CAT_LIST} </select> </td> </tr> <!-- END switch_edit --> <tr> <td class="catBottom" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" name="preview" value="{L_PREVIEW}" class="mainoption"> <input type="submit" name="article_submit" class="mainoption" value="{L_SUBMIT}" /></td> </tr> </table> </form> --- kb_add_body.tpl DELETED --- |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:55:03
|
Update of /cvsroot/mxbb/kb_076_mxaddon/root/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9026/modules/kb_076_mxaddon/root/includes Modified Files: functions_kb.php kb_article.php kb_cat.php kb_constants.php kb_footer.php kb_header.php kb_moderator.php kb_rate.php kb_stats.php Added Files: functions_kb_auth.php functions_kb_field.php functions_kb_mx.php kb_post.php Removed Files: kb_add.php kb_edit.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 Index: kb_stats.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_stats.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_stats.php 9 Jan 2005 22:16:31 -0000 1.1 --- kb_stats.php 28 Mar 2005 20:54:53 -0000 1.2 *************** *** 1,9 **** <?php ! /** ! * kb_cat.php ! * ------------------- ! * begin : Sunday, 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,60 **** */ ! if ( !defined( 'IN_PHPBB' ) ) { die( "Hacking attempt" ); } ! // $category_id = $HTTP_GET_VARS['cat']; ! // $category = get_kb_cat($category_id); ! // $category_name = $category['category_name']; ! // $page_title = $category_name; if ( !$is_block ) { ! include( $phpbb_root_path . 'includes/page_header.' . $phpEx ); } ! // make_jumpbox($phpbb_root_path .'viewforum.'.$phpEx, $category_id); // load header ! include ( $phpbb_root_path . "includes/kb_header." . $phpEx ); ! $template->set_filenames( array( 'body' => 'kb_stats_body.tpl' ) ! ); ! // if ( !$category_name ) ! // { ! // $message = $lang['Category_not_exsist'] . '<br /><br />' . sprintf($lang['Click_return_kb'], '<a href="' . append_sid(this_kb_mxurl()) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid($phpbb_root_path . "index.$phpEx") . '">', '</a>'); - // message_die(GENERAL_MESSAGE, $message); - // } - // else - // { - // get sub-cats - // get_kb_cat_subs($category_id); if ( $stats == 'toprated' ) { $path_kb = $lang['Top_toprated']; ! }elseif ( $stats == 'latest' ) { $path_kb = $lang['Top_latest']; ! }elseif ( $stats == 'mostpopular' ) { $path_kb = $lang['Top_most_popular']; } ! // $path_kb_array = array(); ! // get_kb_nav($category_id); $template->assign_vars( array( 'L_CATEGORY_NAME' => $category_name, 'L_ARTICLE' => $lang['Article'], --- 20,59 ---- */ ! if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } ! ! // Start auth check ! // ! $kb_is_auth = array(); ! $kb_is_auth = kb_auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); ! ! // End of auth check ! // ! if ( !$is_block ) { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); } ! // load header ! include ( $module_root_path . "includes/kb_header." . $phpEx ); ! $template->set_filenames( array( 'body' => 'kb_stats_body.tpl' ) ); if ( $stats == 'toprated' ) { $path_kb = $lang['Top_toprated']; ! } ! elseif ( $stats == 'latest' ) { $path_kb = $lang['Top_latest']; ! } ! elseif ( $stats == 'mostpopular' ) { $path_kb = $lang['Top_most_popular']; } ! $template->assign_vars( array( 'L_CATEGORY_NAME' => $category_name, 'L_ARTICLE' => $lang['Article'], *************** *** 66,80 **** 'L_VIEWS' => $lang['Views'], 'L_VOTES' => $lang['Votes'], - 'L_CATEGORY' => $lang['Category_sub'], 'L_ARTICLES' => $lang['Articles'], ! 'PATH' => '-> ' . $path_kb, ! ! 'U_CAT' => append_sid( this_kb_mxurl( 'mode=cat&cat=' . $category_id ) ) ) ! ); ! ! get_kb_stats( $stats, '1', 'articlerow' ); ! // } ?> \ No newline at end of file --- 65,75 ---- 'L_VIEWS' => $lang['Views'], 'L_VOTES' => $lang['Votes'], 'L_CATEGORY' => $lang['Category_sub'], 'L_ARTICLES' => $lang['Articles'], + 'PATH' => '» ' . $path_kb, + 'U_CAT' => append_sid( this_kb_mxurl( 'mode=cat&cat=' . $category_id ) ) + ) ); ! get_kb_stats( $stats, '1', 'articlerow', $kb_is_auth ); ?> \ No newline at end of file Index: kb_header.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_header.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_header.php 9 Jan 2005 22:16:31 -0000 1.1 --- kb_header.php 28 Mar 2005 20:54:53 -0000 1.2 *************** *** 1,9 **** <?php ! /** ! * kb_header.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,21 **** */ ! if ( !defined( 'IN_PHPBB' ) ) { die( "Hacking attempt" ); --- 20,24 ---- */ ! if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); *************** *** 25,69 **** define( 'ALLOW_ANON', 1 ); ! // Pull all config data ! $sql = "SELECT * ! FROM " . KB_CONFIG_TABLE; ! if ( !$result = $db->sql_query( $sql ) ) { ! message_die( CRITICAL_ERROR, "Could not query config information in kb_config", "", __LINE__, __FILE__, $sql ); } else { ! while ( $row = $db->sql_fetchrow( $result ) ) ! { ! $config_name = $row['config_name']; ! $config_value = $row['config_value']; ! $kb_config[$config_name] = $config_value; ! } } - // $dirname = $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.'.$phpEx; - // include($dirname); - - // Parse and show the overall header. - - $template->set_filenames( array( 'kb_header' => 'kb_header.tpl' ) - ); ! if ( ( $kb_config['allow_new'] == ALLOW_NEW && $userdata['session_logged_in'] && $show_new ) || ( $kb_config['allow_new'] == ALLOW_NEW && $kb_config['allow_anon'] == ALLOW_ANON && $show_new ) || $is_admin && $show_new ) ! { ! if ( $HTTP_GET_VARS['cat'] ) ! { ! $temp_url = append_sid( this_kb_mxurl( "mode=add&cat=" . $HTTP_GET_VARS['cat'] ) ); ! $add_article = '<a href="' . $temp_url . '">' . $lang['Add_article'] . '</a>'; ! } ! else ! { ! $add_article = $lang['Click_cat_to_add']; ! } - $template->assign_block_vars( 'switch_add_article', array() ); - } ! $temp_url = append_sid( $phpbb_root_path . "kb_search.php" ); $search = '<a href="' . $temp_url . '">' . $lang['Search'] . '</a>'; --- 28,53 ---- define( 'ALLOW_ANON', 1 ); ! // Parse and show the overall header. ! $template->set_filenames( array( 'kb_header' => 'kb_header.tpl' ) ); ! ! if ( isset ( $HTTP_GET_VARS['cat'] ) ) { ! ! if ( $kb_config['allow_new'] == 1 && ( $kb_is_auth['auth_post'] || $kb_is_auth['auth_mod'] ) ) ! { ! $temp_url = append_sid( this_kb_mxurl( "mode=add&cat=" . intval ($HTTP_GET_VARS['cat'] ) ) ); ! $add_article = '<a href="' . $temp_url . '">' . $lang['Add_article'] . '</a>'; ! } } else { ! $add_article = $lang['Click_cat_to_add']; } ! $template->assign_block_vars( 'switch_add_article', array() ); ! $temp_url = append_sid( this_kb_mxurl_search ('', true) ); $search = '<a href="' . $temp_url . '">' . $lang['Search'] . '</a>'; *************** *** 71,84 **** { $temp_url = append_sid( this_kb_mxurl() ); ! $title = '<a href="' . $temp_url . '"><img src="' . $images['kb_title'] . '" width="285" height="45" border="0" alt="' . $lang['KB_title'] . '"></a>'; } else { ! $title = $lang['KB_title']; } ! $template->assign_vars( array( 'U_PORTAL' => $phpbb_root_path, 'L_PORTAL' => "<<", ! 'L_KB_TITLE' => $title, 'L_ADD_ARTICLE' => $add_article, 'L_SEARCH' => $search, --- 55,68 ---- { $temp_url = append_sid( this_kb_mxurl() ); ! $block_title = '<td align="center"><a href="' . $temp_url . '"><img src="' . $images['kb_title'] . '" width="285" height="45" border="0" alt="' . $title . '"></a></td>'; } else { ! $block_title = MXBB_MODULE ? '<th class="thHead"> ' . $title . '</th>' : '<td align="center"><b>' . $lang['KB_title'] . '</b></td>'; } ! $template->assign_vars( array( 'U_PORTAL' => $mx_root_path, 'L_PORTAL' => "<<", ! 'L_KB_TITLE' => $block_title, 'L_ADD_ARTICLE' => $add_article, 'L_SEARCH' => $search, *************** *** 95,99 **** if ( $kb_config['stats_list'] == 1 ) { ! get_quick_stats(); } --- 79,83 ---- if ( $kb_config['stats_list'] == 1 ) { ! get_quick_stats( intval( $HTTP_GET_VARS['cat'] ) ); } Index: kb_constants.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_constants.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_constants.php 9 Jan 2005 22:16:31 -0000 1.1 --- kb_constants.php 28 Mar 2005 20:54:53 -0000 1.2 *************** *** 1,37 **** <?php ! /** ! * kb_constants.php ! * ------------------- ! * begin : April, 2003 ! * copyright : (C) 2002 MX-System ! * email : su...@mx... ! * description : define constants ! * Author : Haplo (jon...@ho...) ! * credit : Roman Malarev (romutis), MarcMoris * * $Id$ */ // ---------------------------------------------------------------------START // This file defines specific constants for the module // ------------------------------------------------------------------------- ! define( 'KB_ARTICLES_TABLE', $table_prefix . 'kb_articles' ); ! define( 'KB_CATEGORIES_TABLE', $table_prefix . 'kb_categories' ); ! define( 'KB_CONFIG_TABLE', $table_prefix . 'kb_config' ); ! define( 'KB_TYPES_TABLE', $table_prefix . 'kb_types' ); ! define( 'KB_WORD_TABLE', $table_prefix . 'kb_wordlist' ); ! define( 'KB_SEARCH_TABLE', $table_prefix . 'kb_results' ); ! define( 'KB_MATCH_TABLE', $table_prefix . 'kb_wordmatch' ); ! define( 'KB_VOTES_TABLE', $table_prefix . 'kb_votes' ); // ********************************************************************** // Read language definition // ********************************************************************** ! if ( !file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ) ) { ! include( $phpbb_root_path . 'language/lang_english/lang_kb.' . $phpEx ); $link_language = 'lang_english'; } else { ! include( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ); $link_language = 'lang_' . $board_config['default_lang']; } --- 1,75 ---- <?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$ */ + + /** + * 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 ( !MXBB_MODULE ) + { + $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://'; + $server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])); + $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : ''; + $script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path'])); + $script_name = ($script_name == '') ? $script_name : '/' . $script_name; + + define( 'PORTAL_URL', $server_protocol . $server_name . $server_port . $script_name . '/' ); + define( 'PHPBB_URL', PORTAL_URL ); + + $reader_mode = false; + $kb_config['news_operate_mode'] = false; + $mx_table_prefix = $table_prefix; + $is_block = false; + } + // ---------------------------------------------------------------------START // This file defines specific constants for the module // ------------------------------------------------------------------------- ! define( 'PAGE_KB', -500 ); ! define( 'KB_ARTICLES_TABLE', $mx_table_prefix . 'kb_articles' ); ! define( 'KB_CATEGORIES_TABLE', $mx_table_prefix . 'kb_categories' ); ! define( 'KB_CONFIG_TABLE', $mx_table_prefix . 'kb_config' ); ! define( 'KB_TYPES_TABLE', $mx_table_prefix . 'kb_types' ); ! define( 'KB_WORD_TABLE', $mx_table_prefix . 'kb_wordlist' ); ! define( 'KB_SEARCH_TABLE', $mx_table_prefix . 'kb_results' ); ! define( 'KB_MATCH_TABLE', $mx_table_prefix . 'kb_wordmatch' ); ! define( 'KB_VOTES_TABLE', $mx_table_prefix . 'kb_votes' ); ! ! define( 'KB_CUSTOM_TABLE', $mx_table_prefix . 'kb_custom' ); ! define( 'KB_CUSTOM_DATA_TABLE', $mx_table_prefix . 'kb_customdata' ); ! ! // Field Types ! define( 'INPUT', 0 ); ! define( 'TEXTAREA', 1 ); ! define( 'RADIO', 2 ); ! define( 'SELECT', 3 ); ! define( 'SELECT_MULTIPLE', 4 ); ! define( 'CHECKBOX', 5 ); ! // ********************************************************************** // Read language definition // ********************************************************************** ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ) ) { ! include( $module_root_path . 'language/lang_english/lang_kb.' . $phpEx ); $link_language = 'lang_english'; } else { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ); $link_language = 'lang_' . $board_config['default_lang']; } *************** *** 39,47 **** // Read theme definition // ********************************************************************** ! if ( file_exists( $phpbb_root_path . "templates/" . $theme['template_name'] . "/images" ) ) { // ---------- ! // $current_template_images = $module_root_path . "templates/".$theme['template_name']."/images" ; ! $current_template_images = $phpbb_root_path . "templates/" . $theme['template_name'] . "/images" ; // ---------- } --- 77,84 ---- // Read theme definition // ********************************************************************** ! if ( file_exists( $module_root_path . "templates/" . $theme['template_name'] . "/images" ) ) { // ---------- ! $current_template_images = $module_root_path . "templates/" . $theme['template_name'] . "/images" ; // ---------- } *************** *** 49,54 **** { // ---------- ! // $current_template_images = $module_root_path . "templates/"."subSilver"."/images" ; ! $current_template_images = $phpbb_root_path . 'templates/subSilver/images' ; // ---------- } --- 86,90 ---- { // ---------- ! $current_template_images = $module_root_path . "templates/" . "subSilver" . "/images" ; // ---------- } *************** *** 73,79 **** } ! $kb_module_version = "Knowledge Base - MX Addon v. 1.03e"; ! $kb_module_author = "Haplo"; ! $kb_module_orig_author = "wGEric"; ?> \ No newline at end of file --- 109,125 ---- } ! if ( !MXBB_MODULE ) ! { ! $kb_module_version = "Knowledge Base v. 2.0"; ! $kb_module_author = "Haplo"; ! $kb_module_orig_author = "wGEric"; ! } ! else ! { ! $mxbb_footer_addup[] = 'mxBB Knowledge Base Module'; ! } ! ! ! ?> \ No newline at end of file --- NEW FILE: functions_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 : * */ /** * 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 ( !defined( 'IN_PORTAL' ) ) { die( 'Hacking attempt' ); } function kb_auth( $type, $cat_id, $userdata, $f_access = '', $f_access_group = '' ) { global $db, $lang; switch ( $type ) { case AUTH_ALL: $a_sql = 'a.auth_view, a.auth_post, a.auth_rate, a.auth_comment, a.auth_edit, a.auth_delete, a.auth_approval, a.auth_approval_edit'; $a_sql_groups = 'a.auth_view_groups, a.auth_post_groups, a.auth_rate_groups, a.auth_comment_groups, a.auth_edit_groups, a.auth_delete_groups, a.auth_approval_groups, a.auth_approval_edit_groups'; $auth_fields = array( 'auth_view', 'auth_post', 'auth_rate', 'auth_comment', 'auth_edit', 'auth_delete', 'auth_approval', 'auth_approval_edit' ); $auth_fields_groups = array( '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' ); break; case AUTH_VIEW: $a_sql = 'a.auth_view'; $a_sql_groups = 'a.auth_view_groups'; $auth_fields = array( 'auth_view' ); $auth_fields_groups = array( 'auth_view_groups' ); break; case AUTH_POST: $a_sql = 'a.auth_post'; $a_sql_groups = 'a.auth_post_groups'; $auth_fields = array( 'auth_post' ); $auth_fields_groups = array( 'auth_post_groups' ); break; case AUTH_RATE: $a_sql = 'a.auth_rate'; $a_sql_groups = 'a.auth_rate_groups'; $auth_fields = array( 'auth_rate' ); $auth_fields_groups = array( 'auth_rate_groups' ); break; case AUTH_COMMENT: $a_sql = 'a.auth_comment'; $a_sql_groups = 'a.auth_comment_groups'; $auth_fields = array( 'auth_comment' ); $auth_fields_groups = array( 'auth_comment_groups' ); break; case AUTH_EDIT: $a_sql = 'a.auth_edit'; $a_sql_groups = 'a.auth_edit_groups'; $auth_fields = array( 'auth_edit' ); $auth_fields_groups = array( 'auth_edit_groups' ); break; case AUTH_DELETE: $a_sql = 'a.auth_delete'; $a_sql_groups = 'a.auth_delete_groups'; $auth_fields = array( 'auth_delete' ); $auth_fields_groups = array( 'auth_delete_groups' ); break; case AUTH_APPROVAL: $a_sql = 'a.auth_approval'; $a_sql_groups = 'a.auth_approval_groups'; $auth_fields = array( 'auth_approval' ); $auth_fields_groups = array( 'auth_approval_groups' ); break; case AUTH_APPROVAL_EDIT: $a_sql = 'a.auth_approval_edit'; $a_sql_groups = 'a.auth_approval_edit_groups'; $auth_fields = array( 'auth_approval_edit' ); $auth_fields_groups = array( 'auth_approval_edit_groups' ); break; default: break; } $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? true : 0; // // If f_access has not been passed, or auth is needed to return an array of forums // then we need to pull the auth information on the given forum (or all forums) // if ( empty($f_access) ) { $forum_match_sql = ( $cat_id != AUTH_LIST_ALL ) ? "WHERE a.category_id = $cat_id" : ''; $sql = "SELECT a.category_id, $a_sql FROM " . KB_CATEGORIES_TABLE . " a $forum_match_sql"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Failed obtaining forum access control lists', '', __LINE__, __FILE__, $sql); } $sql_fetchrow = ( $cat_id != AUTH_LIST_ALL ) ? 'sql_fetchrow' : 'sql_fetchrowset'; if ( !($f_access = $db->$sql_fetchrow($result)) ) { $db->sql_freeresult($result); return array(); } $db->sql_freeresult($result); } // // If f_access_group has not been passed, or auth is needed to return an array of forums // then we need to pull the auth information on the given forum (or all forums) // if ( empty($f_access_group) ) { $forum_match_sql = ( $cat_id != AUTH_LIST_ALL ) ? "WHERE a.category_id = $cat_id" : ''; $sql = "SELECT a.category_id, $a_sql_groups, a.auth_moderator_groups FROM " . KB_CATEGORIES_TABLE . " a $forum_match_sql"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Failed obtaining forum access control lists', '', __LINE__, __FILE__, $sql); } $sql_fetchrow = ( $cat_id != AUTH_LIST_ALL ) ? 'sql_fetchrow' : 'sql_fetchrowset'; if ( !($f_access_group = $db->$sql_fetchrow($result)) ) { $db->sql_freeresult($result); return array(); } $db->sql_freeresult($result); } $auth_user = array(); for( $i = 0; $i < count( $auth_fields ); $i++ ) { $key = $auth_fields[$i]; $key_groups = $auth_fields_groups[$i]; // If the user is logged on and the module type is either ALL or REG then the user has access // If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions // to do whatever it is they want to do ... to do this we pull relevant information for the // user (and any groups they belong to) // Now we compare the users access level against the modules. We assume here that a moderator // and admin automatically have access to an ACL module, similarly we assume admins meet an // auth requirement of MOD if ( $cat_id != AUTH_LIST_ALL ) { $value = $f_access[$key]; $value_groups = $f_access_group[$key_groups]; switch ( $value ) { case AUTH_ALL: $auth_user[$key] = true; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? true : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? true : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_ACL: // PRIVATE $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group_cache( $value_groups ) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group_cache( $f_access_group['auth_moderator_groups'] ) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; case AUTH_ADMIN: $auth_user[$key] = $is_admin; $auth_user[$key . '_type'] = $lang['Auth_Administrators']; break; default: $auth_user[$key] = 0; break; } } else { for($k = 0; $k < count($f_access); $k++) { $value = $f_access[$k][$key]; $value_groups = $f_access_group[$k][$key_groups]; $f_cat_id = $f_access[$k]['category_id']; switch ( $value ) { case AUTH_ALL: $auth_user[$f_cat_id][$key] = true; $auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: $auth_user[$f_cat_id][$key] = ( $userdata['session_logged_in'] ) ? true : 0; $auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: $auth_user[$f_cat_id][$key] = ( ! $userdata['session_logged_in'] ) ? true : 0; $auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_ACL: // PRIVATE $auth_user[$f_cat_id][$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group_cache( $value_groups ) || $is_admin : 0; $auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: $auth_user[$f_cat_id][$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group_cache( $f_access_group[$k]['auth_moderator_groups'] ) || $is_admin : 0; $auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Moderators']; break; case AUTH_ADMIN: $auth_user[$f_cat_id][$key] = $is_admin; $auth_user[$f_cat_id][$key . '_type'] = $lang['Auth_Administrators']; break; default: $auth_user[$f_cat_id][$key] = 0; break; } } } } // // Is user a moderator? // if ( $cat_id != AUTH_LIST_ALL ) { $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_auth_group_cache( $f_access_group['auth_moderator_groups'] ) || $is_admin : 0; } else { for($k = 0; $k < count($f_access); $k++) { $f_cat_id = $f_access[$k]['category_id']; $auth_user[$f_cat_id]['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_auth_group_cache( $f_access_group[$k]['auth_moderator_groups'] ) || $is_admin : 0; } } //die(var_export($auth_user)); return $auth_user; } ?> --- NEW FILE: functions_kb_field.php --- <?php /** * functions_field.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: functions_kb_field.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. */ // PLEASE DON'T TAKE THIS CLASS AND USE IT, I WILL KEEP MY EYES ON IT // I KNOW SOME PEOPLE MAY TAKE IT AND USE IT TO DO CUSTOM FIELD FOR PROFILE // BUT I AM PLANNING TO MAKE THIS FEATURE VERY SOON /* - orig if ( !defined('IN_PHPBB') ) { die("Hacking attempt"); } */ // MX if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } class kb_custom_field { var $field_rowset = array(); var $field_data_rowset = array(); // =================================================== // prepare data // =================================================== function init() { global $db; $sql = "SELECT * FROM " . KB_CUSTOM_TABLE . " ORDER BY field_order ASC"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt Query Custom field', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $this->field_rowset[$row['custom_id']] = $row; } unset( $row ); $db->sql_freeresult( $result ); $sql = "SELECT * FROM " . KB_CUSTOM_DATA_TABLE; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt Query Custom field', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $this->field_data_rowset[$row['customdata_file']][$row['customdata_custom']] = $row; } unset( $row ); $db->sql_freeresult( $result ); } // =================================================== // check if there is a data in the database // =================================================== function field_data_exist() { if ( !empty( $this->field_data_rowset ) ) { return true; } return false; } function field_exist() { if ( !empty( $this->field_rowset ) ) { return true; } return false; } // =================================================== // display data in the comment // =================================================== function add_comment( $file_id ) { global $template; if ( $this->field_data_exist() ) { if ( isset( $this->field_data_rowset[$file_id] ) ) { $message = ''; foreach( $this->field_data_rowset[$file_id] as $field_id => $data ) { if ( !empty( $data['data'] ) ) { switch ( $this->field_rowset[$field_id]['field_type'] ) { case INPUT: case TEXTAREA: case RADIO: case SELECT: $field_data = $data['data']; break; case SELECT_MULTIPLE: case CHECKBOX: $field_data = @implode( ', ', unserialize( $data['data'] ) ); break; } $message .= "\n" . "[b]" . $this->field_rowset[$field_id]['custom_name'] . ":[/b] " . $field_data . "\n"; } else { global $db; $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete custom data', '', __LINE__, __FILE__, $sql ); } } } return $message; } else { return false; } } else { return false; } } // =================================================== // display data in the file page // =================================================== function display_data( $file_id ) { global $template; if ( $this->field_data_exist() ) { if ( isset( $this->field_data_rowset[$file_id] ) ) { foreach( $this->field_data_rowset[$file_id] as $field_id => $data ) { if ( !empty( $data['data'] ) ) { switch ( $this->field_rowset[$field_id]['field_type'] ) { case INPUT: case TEXTAREA: case RADIO: case SELECT: $field_data = $data['data']; break; case SELECT_MULTIPLE: case CHECKBOX: $field_data = @implode( ', ', unserialize( $data['data'] ) ); break; } $template->assign_block_vars( 'custom_field', array( 'CUSTOM_NAME' => $this->field_rowset[$field_id]['custom_name'], 'DATA' => $field_data ) ); } else { global $db; $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete custom data', '', __LINE__, __FILE__, $sql ); } } } } else { return false; } } else { return false; } } // =================================================== // display custom field and data in the add/edit page // =================================================== function display_edit( $file_id = false ) { global $template; $return = false; if ( $this->field_exist() ) { foreach( $this->field_rowset as $field_id => $field_data ) { switch ( $field_data['field_type'] ) { case INPUT: $this->display_edit_input( $file_id, $field_id, $field_data ); break; case TEXTAREA: $this->display_edit_textarea( $file_id, $field_id, $field_data ); break; case RADIO: $this->display_edit_radio( $file_id, $field_id, $field_data ); break; case SELECT: $this->display_edit_select( $file_id, $field_id, $field_data ); break; case SELECT_MULTIPLE: $this->display_edit_select_multiple( $file_id, $field_id, $field_data ); break; case CHECKBOX: $this->display_edit_checkbox( $file_id, $field_id, $field_data ); break; } $return = true; } } return $return; } function display_edit_input( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'input', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'], 'FIELD_VALUE' => ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : '' ) ); } function display_edit_textarea( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'textarea', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'], 'FIELD_VALUE' => ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : '' ) ); } function display_edit_radio( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'radio', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : array(); $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $template->assign_block_vars( 'radio.row', array( 'FIELD_VALUE' => $value, 'FIELD_SELECTED' => ( $data == $value ) ? ' checked="checked"' : '' ) ); } } } function display_edit_select( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'select', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $template->assign_block_vars( 'select.row', array( 'FIELD_VALUE' => $value, 'FIELD_SELECTED' => ( $data == $value ) ? ' selected="selected"' : '' ) ); } } } function display_edit_select_multiple( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'select_multiple', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $selected = ''; foreach( $data as $field_value ) { if ( $field_value == $value ) { $selected = ' selected="selected"'; break; } } $template->assign_block_vars( 'select_multiple.row', array( 'FIELD_VALUE' => $value, 'FIELD_SELECTED' => $selected ) ); } } } function display_edit_checkbox( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'checkbox', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $checked = ''; foreach( $data as $field_value ) { if ( $field_value == $value ) { $checked = ' checked'; break; } } $template->assign_block_vars( 'checkbox.row', array( 'FIELD_VALUE' => $value, 'FIELD_CHECKED' => $checked ) ); } } } function update_add_field( $field_type, $field_id = false ) { global $db, $db, $_POST, $lang; $field_name = ( isset( $_POST['field_name'] ) ) ? htmlspecialchars( $_POST['field_name'] ) : ''; $field_desc = ( isset( $_POST['field_desc'] ) ) ? htmlspecialchars( $_POST['field_desc'] ) : ''; $regex = ( isset( $_POST['regex'] ) ) ? $_POST['regex'] : ''; $data = ( isset( $_POST['data'] ) ) ? $_POST['data'] : ''; $field_order = ( isset( $_POST['field_order'] ) ) ? $_POST['field_order'] : ''; if ( $field_id ) { $field_order = ( isset( $_POST['field_order'] ) ) ? intval( $_POST['field_order'] ) : ''; } if ( !empty( $data ) ) { $data = explode( "\n", htmlspecialchars( trim( $data ) ) ); foreach( $data as $key => $value ) { $data[$key] = trim( $value ); } $data = addslashes( serialize( $data ) ); } if ( empty( $field_name ) ) { mx_message_die( GENERAL_ERROR, $lang['Missing_field'] ); } if ( ( ( $field_type != INPUT && $field_type != TEXTAREA ) && empty( $data ) ) ) { mx_message_die( GENERAL_ERROR, $lang['Missing_field'] ); } if ( !$field_id ) { $sql = "INSERT INTO " . KB_CUSTOM_TABLE . " (custom_name, custom_description, data, regex, field_type) VALUES('" . $field_name . "', '" . $field_desc . "', '" . $data . "', '" . $regex . "', '" . $field_type . "')"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not add the new fields', '', __LINE__, __FILE__, $sql ); } $field_id = $db->sql_nextid(); $sql = "UPDATE " . KB_CUSTOM_TABLE . " SET field_order = '$field_id' WHERE custom_id = $field_id"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not set the order for the giving field', '', __LINE__, __FILE__, $sql ); } } else { $sql = "UPDATE " . KB_CUSTOM_TABLE . " SET custom_name = '$field_name', custom_description = '$field_desc', data = '$data', regex = '$regex', field_order='$field_order' WHERE custom_id = $field_id"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not update information for the giving field', '', __LINE__, __FILE__, $sql ); } } } function delete_field( $field_id ) { global $db; $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_custom = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete custom data', '', __LINE__, __FILE__, $sql ); } $sql = "DELETE FROM " . KB_CUSTOM_TABLE . " WHERE custom_id = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete the selected field', '', __LINE__, __FILE__, $sql ); } } function get_field_data( $field_id ) { $return_array = $this->field_rowset[$field_id]; $return_array['data'] = implode( "\n", unserialize( stripslashes( $return_array['data'] ) ) ); return $return_array; } // =================================================== // file data in custom field operations // =================================================== function file_update_data( $file_id ) { global $_POST, $db; $field = ( isset( $_POST['field'] ) ) ? $_POST['field'] : ''; if ( !empty( $field ) ) { foreach( $field as $field_id => $field_data ) { if ( !empty( $this->field_rowset[$field_id]['regex'] ) ) { if ( !preg_match( '#' . $this->field_rowset[$field_id]['regex'] . '#siU', $field_data ) ) { $field_data = ''; } } switch ( $this->field_rowset[$field_id]['field_type'] ) { case INPUT: case TEXTAREA: case RADIO: case SELECT: $data = htmlspecialchars( $field_data ); break; case SELECT_MULTIPLE: case CHECKBOX: $data = addslashes( serialize( $field_data ) ); break; } $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; if ( !$db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete data from custom data table', '', __LINE__, __FILE__, $sql ); } if ( !empty( $data ) ) { $sql = "INSERT INTO " . KB_CUSTOM_DATA_TABLE . " (customdata_file, customdata_custom, data) VALUES('$file_id', '$field_id', '$data')"; if ( !$db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not add additional data', '', __LINE__, __FILE__, $sql ); } } } } } } ?> Index: kb_footer.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_footer.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_footer.php 9 Jan 2005 22:16:31 -0000 1.1 --- kb_footer.php 28 Mar 2005 20:54:53 -0000 1.2 *************** *** 1,9 **** <?php ! /** ! * kb_footer.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,21 **** */ ! if ( !defined( 'IN_PHPBB' ) ) { die( "Hacking attempt" ); --- 20,24 ---- */ ! if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/includes/kb_moderator.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_moderator.php 9 Jan 2005 22:16:31 -0000 1.1 --- kb_moderator.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,37 **** */ // MX ! if ( !defined( 'IN_PHPBB' ) ) { die( "Hacking attempt" ); } - if ( !$is_admin ) - { - $message = $lang['No_add'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); - message_die( GENERAL_MESSAGE, $message ); - } - include( $phpbb_root_path . 'includes/functions_admin.' . $phpEx ); ! $category_id = $HTTP_GET_VARS['cat']; ! $page_id = $HTTP_GET_VARS['page']; $ref_stats = ( isset( $HTTP_GET_VARS['ref'] ) ) ? true : 0; if ( isset( $HTTP_POST_VARS['action'] ) || isset( $HTTP_GET_VARS['action'] ) ) { --- 20,48 ---- */ // MX ! if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } include( $phpbb_root_path . 'includes/functions_admin.' . $phpEx ); ! $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval ( $HTTP_GET_VARS['cat']) : intval ( $HTTP_POST_VARS['cat'] ); ! $page_id = ( isset( $HTTP_GET_VARS['page'] ) ) ? intval ( $HTTP_GET_VARS['page']) : intval ( $HTTP_POST_VARS['page'] ); $ref_stats = ( isset( $HTTP_GET_VARS['ref'] ) ) ? true : 0; + // Start auth check + // + $kb_is_auth = array(); + $kb_is_auth = kb_auth(AUTH_ALL, $category_id, $userdata); + + // End of auth check + // + + if ( !($kb_is_auth['auth_mod'] && $userdata['session_logged_in']) ) + { + $message = $lang['No_add'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); + mx_message_die( GENERAL_MESSAGE, $message ); + } + if ( isset( $HTTP_POST_VARS['action'] ) || isset( $HTTP_GET_VARS['action'] ) ) { *************** *** 58,74 **** } switch ( $action ) { case 'approve': - $article_id = $HTTP_GET_VARS['a']; - $topic_sql = ''; ! if ( $kb_config['comments'] ) { $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; if ( !( $results = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } --- 69,85 ---- } + $article_id = intval ( $HTTP_GET_VARS['a'] ); + switch ( $action ) { case 'approve': $topic_sql = ''; ! if ( $kb_is_auth['auth_comment'] && $kb_config['use_comments'] ) { $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; if ( !( $results = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } *************** *** 77,122 **** if ( !$row['topic_id'] ) { ! // choose a user ! $user_id = $kb_config['admin_id']; ! // initialise the userdata ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = $user_id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! message_die( CRITICAL_ERROR, 'Could not obtain lastvisit data from user table', '', __LINE__, __FILE__, $sql ); ! } ! $user = $db->sql_fetchrow( $result ); ! init_userprefs( $user ); ! ! $kb_cat = get_kb_cat( $row['article_category_id'] ); ! $type = get_kb_type( $row['article_type'] ); ! $author = get_kb_author( $row['article_author_id'] ); ! ! $search = array ( "'&(quot|#34);'i", // Replace HTML entities ! "'&(amp|#38);'i", ! "'&(lt|#60);'i", ! "'&(gt|#62);'i" ! ); ! $replace = array ( "\"", ! "&", ! "<", ! ">" ! ); ! ! $temp_url = "http://" . $board_config['server_name'] . $board_config['script_path'] . "kb." . $phpEx . "?mode=article&k=" . $article_id; ! $message = "[b]" . $lang['Category'] . ":[/b] " . $kb_cat['category_name'] . "\n"; ! $message .= "[b]" . $lang['Article_type'] . ":[/b] " . $type . "\n\n"; ! $message .= "[b]" . $lang['Article_title'] . ":[/b] " . preg_replace( $search, $replace, $row['article_title'] ) . "\n"; ! $message .= "[b]" . $lang['Author'] . ":[/b] " . $author . "\n"; ! $message .= "[b]" . $lang['Article_description'] . ":[/b] " . preg_replace( $search, $replace, $row['article_description'] ) . "\n\n"; ! $message .= "[b][url=" . $temp_url . "]" . $lang['Read_full_article'] . "[/url][/b]"; ! ! $subject = '[ KB ] ' . $row['article_title']; ! ! $subject = str_replace( "'", "\'" , $subject ); ! $message = str_replace( "'", "\'" , $message ); ! ! $forum_id = $kb_config['forum_id']; ! ! $topic_data = insert_post( $message, $subject, $forum_id, $user['user_id'], $user['username'], $user['user_attachsig'] ); $topic_sql = ", topic_id = " . $topic_data['topic_id']; } --- 88,106 ---- if ( !$row['topic_id'] ) { ! $kb_comment = array(); ! ! // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata); ! ! // Compose post header ! $subject = $lang['KB_comment_prefix'] . $kb_comment['article_title']; ! $message_temp = kb_compose_comment( $kb_comment ); ! ! $kb_message = $message_temp['message']; ! $kb_update_message = $message_temp['update_message']; ! ! // 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']; } *************** *** 128,162 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not update article data", '', __LINE__, __FILE__, $sql ); ! } ! ! $sql = "SELECT article_category_id, article_body ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! message_die( GENERAL_ERROR, "Could not obtain article category", '', __LINE__, __FILE__, $sql ); } ! if ( $article = $db->sql_fetchrow( $result ) ) ! { ! $article_category_id = $article['article_category_id']; ! $body = $article['article_body']; ! } update_kb_number( $article_category_id, '+ 1' ); ! add_kb_words( $article_id, $body ); ! ! $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $phpbb_root_path . "kb.$phpEx?mode=cat&cat=$article_category_id" ) . '">', '</a>' ) ; ! message_die( GENERAL_MESSAGE, $message ); break; case 'unapprove': - $article_id = $HTTP_GET_VARS['a']; - $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 0 WHERE article_id = " . $article_id; --- 112,130 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not update article data", '', __LINE__, __FILE__, $sql ); } ! $article_category_id = $row['article_category_id']; update_kb_number( $article_category_id, '+ 1' ); + 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( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id" ) ) . '">', '</a>' ) ; ! mx_message_die( GENERAL_MESSAGE, $message ); break; case 'unapprove': $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 0 WHERE article_id = " . $article_id; *************** *** 164,168 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not update article data", '', __LINE__, __FILE__, $sql ); } --- 132,136 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not update article data", '', __LINE__, __FILE__, $sql ); } *************** *** 173,177 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not obtain article category", '', __LINE__, __FILE__, $sql ); } --- 141,145 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not obtain article category", '', __LINE__, __FILE__, $sql ); } *************** *** 182,189 **** update_kb_number( $article_category_id, '- 1' ); ! $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $phpbb_root_path . "kb.$phpEx?mode=cat&cat=$article_category_id" ) . '">', '</a>' ) ; ! message_die( GENERAL_MESSAGE, $message ); break; --- 150,158 ---- update_kb_number( $article_category_id, '- 1' ); + mx_remove_search_post( $article_id, 'kb' ); ! $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id") ) . '">', '</a>' ) ; ! mx_message_die( GENERAL_MESSAGE, $message ); break; *************** *** 192,204 **** if ( $HTTP_GET_VARS['c'] == "yes" ) { - $article_id = $HTTP_GET_VARS['a']; - $sql = "SELECT article_category_id, approved, topic_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not obtain article category", '', __LINE__, __FILE__, $sql ); } --- 161,171 ---- if ( $HTTP_GET_VARS['c'] == "yes" ) { $sql = "SELECT article_category_id, approved, topic_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not obtain article category", '', __LINE__, __FILE__, $sql ); } *************** *** 213,217 **** } ! if ( $kb_config['del_topic'] && $article['topic_id'] ) { $topic = $article['topic_id']; --- 180,184 ---- } ! if ( $kb_config['del_topic'] && $kb_is_auth['auth_delete'] && $article['topic_id'] ) { $topic = $article['topic_id']; *************** *** 223,227 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, 'Could not get poster id information', '', __LINE__, __FILE__, $sql ); } --- 190,194 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not get poster id information', '', __LINE__, __FILE__, $sql ); } *************** *** 241,245 **** if ( !$db->sql_query( $count_sql[$i] ) ) { ! message_die( GENERAL_ERROR, 'Could not update user post count information', '', __LINE__, __FILE__, $sql ); } } --- 208,212 ---- if ( !$db->sql_query( $count_sql[$i] ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not update user post count information', '', __LINE__, __FILE__, $sql ); } } *************** *** 252,256 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, 'Could not get forum id information', '', __LINE__, __FILE__, $sql ); } --- 219,223 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not get forum id information', '', __LINE__, __FILE__, $sql ); } *************** *** 267,271 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql ); } --- 234,238 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql ); } *************** *** 289,293 **** if ( !$db->sql_query( $sql, BEGIN_TRANSACTION ) ) { ! message_die( GENERAL_ERROR, 'Could not delete topics', '', __LINE__, __FILE__, $sql ); } --- 256,260 ---- if ( !$db->sql_query( $sql, BEGIN_TRANSACTION ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not delete topics', '', __LINE__, __FILE__, $sql ); } *************** *** 299,303 **** if ( !$db->sql_query( $sql ) ) { ! message_die( GENERAL_ERROR, 'Could not delete posts', '', __LINE__, __FILE__, $sql ); } --- 266,270 ---- if ( !$db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not delete posts', '', __LINE__, __FILE__, $sql ); } *************** *** 309,313 **** if ( !$db->sql_query( $sql ) ) { ! message_die( GENERAL_ERROR, 'Could not delete posts text', '', __LINE__, __FILE__, $sql ); } } --- 276,280 ---- if ( !$db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not delete posts text', '', __LINE__, __FILE__, $sql ); } } *************** *** 321,325 **** if ( !$db->sql_query( $sql, END_TRANSACTION ) ) { ! message_die( GENERAL_ERROR, 'Could not delete watched post list', '', __LINE__, __FILE__, $sql ); } if ( !empty( $forum_id ) ) --- 288,292 ---- if ( !$db->sql_query( $sql, END_TRANSACTION ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not delete watched post list', '', __LINE__, __FILE__, $sql ); } if ( !empty( $forum_id ) ) *************** *** 333,337 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not delete article data", '', __LINE__, __FILE__, $sql ); } --- 300,304 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not delete article data", '', __LINE__, __FILE__, $sql ); } *************** *** 340,349 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, "Could not delete article wordmatch data", '', __LINE__, __FILE__, $sql ); } ! $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $phpbb_root_path . "kb.$phpEx?mode=cat&cat=$article_category_id" ) . '">', '</a>' ) ; ! message_die( GENERAL_MESSAGE, $message ); } else --- 307,318 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, "Could not delete article wordmatch data", '', __LINE__, __FILE__, $sql ); } ! mx_remove_search_post( $article_id, 'kb' ); ! $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl("page=$page_id&mode=cat&cat=$category_id") ) . '">', '</a>' ) ; ! ! mx_message_die( GENERAL_MESSAGE, $message ); } else *************** *** 351,357 **** $category_id = ( $ref_stats ? 1 : $category_id ); ! $message = $lang['Confirm_art_delete'] . '<br /><br />' . sprintf( $lang['Confirm_art_delete_yes'], '<a href="' . append_sid( $phpbb_root_path . "kb.$phpEx?mode=moderate&action=delete&page=$page_id&cat=$article_category_id&c=yes&a=" . $HTTP_GET_VARS['a'] ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Confirm_art_delete_no'], '<a href="' . append_sid( $phpbb_root_path . "kb.$phpEx?mode=cat&cat=$category_id" ) . '">', '</a>' ); ! ! message_die( GENERAL_MESSAGE, $message ); } break; --- 320,325 ---- $category_id = ( $ref_stats ? 1 : $category_id ); ! $message = $lang['Confirm_art_delete'] . '<br /><br />' . sprintf( $lang['Confirm_art_delete_yes'], '<a href="' . append_sid( this_kb_mxurl( "mode=moderate&action=delete&page=$page_id&cat=$category_id&c=yes&a=" . $article_id ) ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Confirm_art_delete_no'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx?page=$page_id&mode=cat&cat=$category_id" ) . '">', '</a>' ); ! mx_message_die( GENERAL_MESSAGE, $message ); } break; --- NEW FILE: kb_post.php --- <?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: kb_post.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 ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval ( $HTTP_GET_VARS['cat'] ) : intval ( ... [truncated message content] |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:55:03
|
Update of /cvsroot/mxbb/kb_076_mxaddon/root/language/lang_english In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9026/modules/kb_076_mxaddon/root/language/lang_english Modified Files: lang_kb.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 Index: lang_kb.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/language/lang_english/lang_kb.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lang_kb.php 9 Jan 2005 22:16:31 -0000 1.1 --- lang_kb.php 28 Mar 2005 20:54:54 -0000 1.2 *************** *** 114,124 **** $lang['Del_topic'] = 'Delete Topic'; $lang['Del_topic_explain'] = 'When you delete an article, do you want its comments topic to be deleted also?'; ! $lang['Allow_comments'] = 'Allow comments'; ! $lang['Allow_comments_explain'] = 'Allow users to add comments to your articles'; $lang['Forum_id'] = 'Forum ID'; $lang['Forum_id_explain'] = 'This is the forum that the article\'s comments will be kept'; $lang['Allow_rating'] = 'Allow ratings'; ! $lang['Allow_rating_explain'] = 'Allow users to add ratings to your articles'; $lang['Allow_anonymos_rating'] = 'Allow anonymos ratings'; --- 114,145 ---- $lang['Del_topic'] = 'Delete Topic'; $lang['Del_topic_explain'] = 'When you delete an article, do you want its comments topic to be deleted also?'; ! ! $lang['Use_comments'] = 'Comments'; ! $lang['Use_comments_explain'] = 'Enable comments for articles, to be inserted in the phpbb forum'; ! $lang['Use_ratings'] = 'Ratings'; ! $lang['Use_ratings_explain'] = 'Enable ratings for articles'; ! $lang['Forum_id'] = 'Forum ID'; $lang['Forum_id_explain'] = 'This is the forum that the article\'s comments will be kept'; + + // + // Permissions + // + $lang['KB_Auth_Title'] = 'KB Permissions'; + $lang['KB_Auth_Explain'] = 'Here you can choose which usergroup(s) can be the moderators for each kb category or just has the private access'; + $lang['Select_a_Category'] = 'Select a Category'; + $lang['Look_up_Category'] = 'Look up Category'; + $lang['KB_Auth_successfully'] = 'Auth has been updated successfully'; + $lang['Click_return_KB_auth'] = 'Click %sHere%s to return to the KB Permissions'; + + $lang['Upload'] = 'Upload'; + $lang['Rate'] = 'Rate'; + $lang['Comment'] = 'Comment'; + $lang['Approval'] = 'Approval'; + $lang['Approval_edit'] = 'Approval Edit'; + $lang['Allow_rating'] = 'Allow ratings'; ! $lang['Allow_rating_explain'] = 'Users are allowed to rate articles.'; $lang['Allow_anonymos_rating'] = 'Allow anonymos ratings'; *************** *** 130,134 **** $lang['Email_body'] = 'An article has been submitted to your Knowledge Base.<br />\nRead the article and then approve or delete the article.<br />\nArticle is included below:<br />\n'; ! //Added by Haplo $lang['Comments_show'] = 'Display article comments.'; $lang['Comments_show_explain'] = '- also displays comments in the article page'; --- 151,183 ---- $lang['Email_body'] = 'An article has been submitted to your Knowledge Base.<br />\nRead the article and then approve or delete the article.<br />\nArticle is included below:<br />\n'; ! $lang['Category_Permissions'] = 'Category Permissions'; ! $lang['Category_Title'] = 'Category Title'; ! $lang['Category_Desc'] = 'Category Description'; ! $lang['View_level'] = 'View Level'; ! $lang['Upload_level'] = 'Upload Level'; ! $lang['Rate_level'] = 'Rate Level'; ! $lang['Comment_level'] = 'Comment Level'; ! $lang['Edit_level'] = ' Edit Level'; ! $lang['Delete_level'] = 'Delete Level'; ! $lang['Approval_level'] = 'Approval Level'; ! $lang['Approval_edit_level'] = 'Approval Edit Level'; ! ! $lang['KB_Rules_post_can'] = 'You <b>can</b> post new articles in this category'; ! $lang['KB_Rules_post_cannot'] = 'You <b>cannot</b> post new articles in this category'; ! $lang['KB_Rules_comment_can'] = 'You <b>can</b> comment articles in this category'; ! $lang['KB_Rules_comment_cannot'] = 'You <b>cannot</b> comment articles in this category'; ! $lang['KB_Rules_edit_can'] = 'You <b>can</b> edit your articles in this category'; ! $lang['KB_Rules_edit_cannot'] = 'You <b>cannot</b> edit your articles in this category'; ! $lang['KB_Rules_delete_can'] = 'You <b>can</b> delete your articles in this category'; ! $lang['KB_Rules_delete_cannot'] = 'You <b>cannot</b> delete your articles in this category'; ! $lang['KB_Rules_rate_can'] = 'You <b>can</b> rate articles in this category'; ! $lang['KB_Rules_rate_cannot'] = 'You <b>cannot</b> rate articles in this category'; ! $lang['KB_Rules_approval_can'] = 'Articles <b>need no</b> approval in this category'; ! $lang['KB_Rules_approval_cannot'] = 'Articles <b>need</b> approval in this category'; ! $lang['KB_Rules_approval_edit_can'] = 'Article edits <b>need no</b> approval in this category'; ! $lang['KB_Rules_approval_edit_cannot'] = 'Article edits <b>need</b> approval in this category'; ! $lang['KB_Rules_moderate'] = 'You <b>can</b> %smoderate this category%s'; // %s replaced by a href links, do not remove! ! $lang['KB_Rules_moderate_can'] = 'You <b>can</b> moderate this category'; // %s replaced by a href links, do not remove! ! $lang['Comments_show'] = 'Display article comments.'; $lang['Comments_show_explain'] = '- also displays comments in the article page'; *************** *** 172,177 **** --- 221,230 ---- $lang['Pre_text_body'] = 'Article Submission Instructions Body'; $lang['Pre_text_explain'] = 'This is text instructions displayed to users at the top of the submission forum.'; + $lang['Show'] = 'Show'; $lang['Hide'] = 'Hide'; + + $lang['Empty_fields'] ='Please fill out all parts of the form.'; + $lang['Empty_fields_return'] ='Click %sHere%s to return to the form.'; $lang['Empty_category'] ='You must choose a category'; $lang['Empty_type']='You must choose a type'; *************** *** 180,184 **** $lang['Read_full_article'] = '>>Read Full Article'; ! $lang['Comments'] = 'Viewer Comments'; $lang['No_add'] = 'You can\'t add a new article'; --- 233,237 ---- $lang['Read_full_article'] = '>>Read Full Article'; ! $lang['Comments'] = 'Comments'; $lang['No_add'] = 'You can\'t add a new article'; *************** *** 191,197 **** // added ! $lang['Edited_Article_info'] = 'Article updated...'; $lang['No_Articles'] = 'This category is empty!'; ! $lang['Not_authorized'] = 'You are not authorized to do this...'; $lang['TOC'] = 'Contents'; --- 244,250 ---- // added ! $lang['Edited_Article_info'] = 'Article updated by '; $lang['No_Articles'] = 'This category is empty!'; ! $lang['Not_authorized'] = 'Sorry, you are not authorized!'; $lang['TOC'] = 'Contents'; *************** *** 199,202 **** --- 252,256 ---- $lang['Votes_label'] = 'Rating '; $lang['Votes'] = 'vote(s)'; + $lang['No_votes'] = 'No votes'; $lang['Rate'] = 'Rate Article'; $lang['ADD_RATING'] = '[Rate Article]'; *************** *** 258,265 **** $lang['News_update_error'] = "Couldn't update KB block configuration.<br /><br />This mod is designed for MySQL so please contact the author if you have troubles. If you can offer a translation of the SQL into other database formats, please send them to:<br />"; ! // kb $lang['Cat_all'] = "All"; ?> \ No newline at end of file --- 312,388 ---- $lang['News_update_error'] = "Couldn't update KB block configuration.<br /><br />This mod is designed for MySQL so please contact the author if you have troubles. If you can offer a translation of the SQL into other database formats, please send them to:<br />"; + // Custom Field + $lang['Fieldselecttitle'] = 'Select what to do'; + $lang['Afield'] = 'Custom Field: Add'; + $lang['Efield'] = 'Custom Field: Edit'; + $lang['Dfield'] = 'Custom Field: Delete'; + $lang['Mfieldtitle'] = 'Custom Fields'; + $lang['Afieldtitle'] = 'Add Field'; + $lang['Efieldtitle'] = 'Edit Field'; + $lang['Dfieldtitle'] = 'Delete Field'; + $lang['Fieldexplain'] = 'You can use the custom fields management section to add, edit, and delete custom fields. You can use custom fields to add more information about an article.'; + $lang['Fieldname'] = 'Field Name'; + $lang['Fieldnameinfo'] = 'This is the name of the field, for example \'File Size\''; + $lang['Fielddesc'] = 'Field Description'; + $lang['Fielddescinfo'] = 'This is a description of the field, for example \'File Size in Megabytes\''; + $lang['Fieldadded'] = 'The custom field has been successfully added'; + $lang['Fieldedited'] = 'The custom field you selected has been successfully edited'; + $lang['Dfielderror'] = 'You didn\'t select any fields to delete'; + $lang['Fieldsdel'] = 'The custom fields you selected have been successfully deleted'; ! $lang['Field_data'] = 'Options'; ! $lang['Field_data_info'] = 'Enter the options that the user can choose from. Separate each option with a new-line (carriage return).'; ! $lang['Field_regex'] = 'Regular Expression'; ! $lang['Field_regex_info'] = 'You may require the input field to match a regular expression %s(PCRE)%s.'; ! $lang['Field_order'] = 'Display Order'; ! ! //Fields Types ! ! $lang['Field_Input'] = 'Single-Line Text Box'; ! $lang['Field_Textarea'] = 'Multiple-Line Text Box'; ! $lang['Field_Radio'] = 'Single-Selection Radio Buttons'; ! $lang['Field_Select'] = 'Single-Selection Menu'; ! $lang['Field_Select_multiple'] = 'Multiple-Selection Menu'; ! $lang['Field_Checkbox'] = 'Multiple-Selection Checkbox'; ! ! $lang['Click_return'] = 'Click %sHere%s to return to the previous page'; ! ! // added $lang['Cat_all'] = "All"; + $lang['L_Pages'] = "Pages"; + $lang['L_Pages_explain'] = "Use the '[pages]' command to split the article into pages"; + $lang['L_Toc'] = "Table of contents (TOC)"; + $lang['L_Toc_explain'] = "Use the '[toc]' command to add entry in the TOC"; + $lang['L_Abstract'] = "Abstract"; + $lang['L_Abstract_explain'] = "Use the '[abstract]...[/abstract]' environment to insert an abstract"; + + $lang['L_Title_Format'] = "Title"; + $lang['L_Title_Format_explain'] = "Use the '[title]...[/title]' environment to insert a main title"; + + $lang['L_Subtitle_Format'] = "Subtitle"; + $lang['L_Subtitle_Format_explain'] = "Use the '[subtitle]...[/subtitle]' environment to insert a subtitle"; + + $lang['L_Subsubtitle_Format'] = "Subsubtitle"; + $lang['L_Subsubtitle_Format'] = "Use the '[subsubtitle]...[/subsubtitle]' environment to insert a small header"; + + $lang['L_Options'] = "Options:"; + $lang['L_Formatting'] = "Formatting:"; + + $lang['Default_article_id'] = "Set default article, for the article viewer"; + + // Added for v. 2.0 + $lang['KB_comment_prefix'] = '[ KB ] '; + + $lang['Wysiwyg'] = 'Use wysiwyg editor'; + $lang['Wysiwyg_explain'] = 'If enabled, the standard bbcode/html/smilies input dialog is replaced by a wysiwyg editor.'; + + $lang['Wysiwyg_path'] = 'Path to wysiwyg software'; + $lang['Wysiwyg_path_explain'] = 'This is the path (from mxBB root) to the wysiwyg software folder, eg \'modules/\' if you have uploaded for example tinemce in modules/tinymce.'; + + $lang['Formatting_fixup'] = 'Fixup formatting'; + $lang['Formatting_fixup_explain'] = 'I enabled, the article text is reformatted: wordwrapping, url truncates, img resizing, some bbcode reformatting etc'; + + $lang['Addtional_field'] = 'More information (optional)'; ?> \ No newline at end of file |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:55:03
|
Update of /cvsroot/mxbb/kb_076_mxaddon/root In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9026/modules/kb_076_mxaddon/root Modified Files: kb.php kb_search.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 Index: kb_search.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/kb_search.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_search.php 9 Jan 2005 22:16:31 -0000 1.1 --- kb_search.php 28 Mar 2005 20:54:54 -0000 1.2 *************** *** 16,21 **** * (at your option) any later version. */ define( 'IN_PHPBB', true ); ! $phpbb_root_path = './'; include( $phpbb_root_path . 'extension.inc' ); include( $phpbb_root_path . 'common.' . $phpEx ); --- 16,28 ---- * (at your option) any later version. */ + + define( 'MXBB_MODULE', false ); // Switch for making this run as a phpBB mod or mxBB module + define( 'IN_PHPBB', true ); ! define( 'IN_PORTAL', true ); ! ! // when run as a phpBB mod these paths are identical ! $phpbb_root_path = $module_root_path = $mx_root_path = './'; ! include( $phpbb_root_path . 'extension.inc' ); include( $phpbb_root_path . 'common.' . $phpEx ); *************** *** 32,35 **** --- 39,45 ---- include( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_kb.' . $phpEx ); + include( $phpbb_root_path . 'includes/functions_kb_auth.' . $phpEx ); + include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); + include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); *************** *** 62,65 **** --- 72,80 ---- $search_id = ( isset( $HTTP_GET_VARS['search_id'] ) ) ? $HTTP_GET_VARS['search_id'] : ''; + if ( $search_id ) + { + $mode = 'results'; + } + $show_results = ( isset( $HTTP_POST_VARS['show_results'] ) ) ? $HTTP_POST_VARS['show_results'] : 'posts'; *************** *** 99,108 **** case "results": // Cycle through options ... ! if ( $search_keywords != '' ) ! { ! if ( $search_keywords != '' ) { $stopword_array = @file( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_stopwords.txt' ); $synonym_array = @file( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_synonyms.txt' ); --- 114,125 ---- case "results": + $store_vars = array('search_results', 'total_match_count', 'split_search', 'sort_by', 'sort_dir', 'show_results', 'return_chars'); + // Cycle through options ... ! if ( $search_id == '' || $search_keywords != '' ) { + + $stopword_array = @file( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_stopwords.txt' ); $synonym_array = @file( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_synonyms.txt' ); *************** *** 162,166 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, 'Could not obtain matched articles list', '', __LINE__, __FILE__, $sql ); } --- 179,183 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain matched articles list', '', __LINE__, __FILE__, $sql ); } *************** *** 215,269 **** unset( $result_list ); $total_match_count = count( $search_ids ); ! } ! ! // Store new result data ! ! $search_results = implode( ', ', $search_ids ); ! $per_page = $board_config['topics_per_page']; ! ! // Combine both results and search data (apart from original query) ! // so we can serialize it and place it in the DB ! ! $store_search_data = array(); ! // Limit the character length (and with this the results displayed at all following pages) to prevent ! // truncated result arrays. Normally, search results above 12000 are affected. ! // - to include or not to include ! /* ! $max_result_length = 60000; ! if (strlen($search_results) > $max_result_length) { ! $search_results = substr($search_results, 0, $max_result_length); ! $search_results = substr($search_results, 0, strrpos($search_results, ',')); ! $total_match_count = count(explode(', ', $search_results)); ! } ! */ ! ! for( $i = 0; $i < count( $store_vars ); $i++ ) ! { ! $store_search_data[$store_vars[$i]] = $$store_vars[$i]; ! } ! ! $result_array = serialize( $store_search_data ); ! unset( $store_search_data ); ! ! mt_srand ( ( double ) microtime() * 1000000 ); ! $search_id = mt_rand(); ! ! $sql = "UPDATE " . KB_SEARCH_TABLE . " ! SET search_id = $search_id, search_array = '" . str_replace( "\'", "''", $result_array ) . "' ! WHERE session_id = '" . $userdata['session_id'] . "'"; ! if ( !( $result = $db->sql_query( $sql ) ) || !$db->sql_affectedrows() ) ! { ! $sql = "INSERT INTO " . KB_SEARCH_TABLE . " (search_id, session_id, search_array) ! VALUES($search_id, '" . $userdata['session_id'] . "', '" . str_replace( "\'", "''", $result_array ) . "')"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, 'Could not insert search results', '', __LINE__, __FILE__, $sql ); } } else { ! if ( intval( $search_id ) ) { $sql = "SELECT search_array --- 232,288 ---- unset( $result_list ); $total_match_count = count( $search_ids ); ! ! // Store new result data ! ! $search_results = implode( ', ', $search_ids ); ! $per_page = $board_config['topics_per_page']; ! ! // Combine both results and search data (apart from original query) ! // so we can serialize it and place it in the DB ! ! $store_search_data = array(); ! ! // Limit the character length (and with this the results displayed at all following pages) to prevent ! // truncated result arrays. Normally, search results above 12000 are affected. ! // - to include or not to include ! /* ! $max_result_length = 60000; ! if (strlen($search_results) > $max_result_length) ! { ! $search_results = substr($search_results, 0, $max_result_length); ! $search_results = substr($search_results, 0, strrpos($search_results, ',')); ! $total_match_count = count(explode(', ', $search_results)); ! } ! */ ! ! for( $i = 0; $i < count( $store_vars ); $i++ ) { ! $store_search_data[$store_vars[$i]] = $$store_vars[$i]; ! } ! ! $result_array = serialize( $store_search_data ); ! unset( $store_search_data ); ! ! mt_srand ( ( double ) microtime() * 1000000 ); ! $search_id = mt_rand(); ! ! $sql = "UPDATE " . KB_SEARCH_TABLE . " ! SET search_id = $search_id, search_array = '" . str_replace( "\'", "''", $result_array ) . "' ! WHERE session_id = '" . $userdata['session_id'] . "'"; ! if ( !( $result = $db->sql_query( $sql ) ) || !$db->sql_affectedrows() ) { ! $sql = "INSERT INTO " . KB_SEARCH_TABLE . " (search_id, session_id, search_array) ! VALUES($search_id, '" . $userdata['session_id'] . "', '" . str_replace( "\'", "''", $result_array ) . "')"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, 'Could not insert search results', '', __LINE__, __FILE__, $sql ); ! } } } else { ! $search_id = intval($search_id); ! if ( $search_id ) { $sql = "SELECT search_array *************** *** 273,279 **** if ( !( $result = $db->sql_query( $sql ) ) ) { ! message_die( GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql ); } ! if ( $row = $db->sql_fetchrow( $result ) ) { --- 292,298 ---- if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql ); } ! if ( $row = $db->sql_fetchrow( $result ) ) { *************** *** 302,306 **** if ( !$result = $db->sql_query( $sql ) ) { ! message_die( GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql ); } --- 321,325 ---- if ( !$result = $db->sql_query( $sql ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql ); } *************** *** 322,337 **** // Output header ! $page_title = $lang['Search']; if ( !$is_block ) { ! include( $phpbb_root_path . 'includes/page_header.' . $phpEx ); } ! include ( $phpbb_root_path . "includes/kb_header." . $phpEx ); $template->set_filenames( array( 'body' => 'kb_search_results.tpl' ) ); ! make_jumpbox( $phpbb_root_path . 'viewforum.' . $phpEx ); $l_search_matches = ( $total_match_count == 1 ) ? sprintf( $lang['Found_search_match'], $total_match_count ) : sprintf( $lang['Found_search_matches'], $total_match_count ); --- 341,356 ---- // Output header ! $page_title = $lang['KB_title'] . ' - ' . $lang['Search']; if ( !$is_block ) { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); } ! // include ( $module_root_path . "includes/kb_header." . $phpEx ); $template->set_filenames( array( 'body' => 'kb_search_results.tpl' ) ); ! $l_search_matches = ( $total_match_count == 1 ) ? sprintf( $lang['Found_search_match'], $total_match_count ) : sprintf( $lang['Found_search_matches'], $total_match_count ); *************** *** 369,373 **** for( $i = 0; $i < count( $searchset ); $i++ ) { ! $article_url = append_sid( this_kb_mxurl( "mode=article&k=" . $searchset[$i]['article_id'] . "&highlight=$highlight_active" ) ); $post_date = create_date( $board_config['default_dateformat'], $searchset[$i]['article_date'], $board_config['board_timezone'] ); --- 388,392 ---- for( $i = 0; $i < count( $searchset ); $i++ ) { ! $article_url = append_sid( this_kb_mxurl( "mode=article&k=" . $searchset[$i]['article_id'] . "&highlight=$highlight_active", true ) ); $post_date = create_date( $board_config['default_dateformat'], $searchset[$i]['article_date'], $board_config['board_timezone'] ); *************** *** 378,382 **** $kb_cat = get_kb_cat( $searchset[$i]['article_category_id'] ); ! $temp_url = append_sid( this_kb_mxurl( 'mode=cat&cat=' . $searchset[$i]['article_category_id'] ) ); $category = '<a href="' . $temp_url . '" class="name">' . $kb_cat['category_name'] . '</a>'; --- 397,401 ---- $kb_cat = get_kb_cat( $searchset[$i]['article_category_id'] ); ! $temp_url = append_sid( this_kb_mxurl( 'mode=cat&cat=' . $searchset[$i]['article_category_id'], true ) ); $category = '<a href="' . $temp_url . '" class="name">' . $kb_cat['category_name'] . '</a>'; *************** *** 404,410 **** ); } ! } ! $base_url = this_kb_mxurl_search( "search_id=$search_id" ); $template->assign_vars( array( 'PAGINATION' => generate_pagination( $base_url, $total_match_count, $per_page, $start ), --- 423,429 ---- ); } ! ! $base_url = this_kb_mxurl_search( "search_id=$search_id", true ); $template->assign_vars( array( 'PAGINATION' => generate_pagination( $base_url, $total_match_count, $per_page, $start ), *************** *** 424,438 **** // Output the basic page ! $page_title = $lang['Search']; if ( !$is_block ) { ! include( $phpbb_root_path . 'includes/page_header.' . $phpEx ); } ! include ( $phpbb_root_path . "includes/kb_header." . $phpEx ); $template->set_filenames( array( 'body' => 'kb_search_body.tpl' ) ); ! make_jumpbox( $phpbb_root_path . 'viewforum.' . $phpEx ); $template->assign_vars( array( 'L_SEARCH_QUERY' => $lang['Search_query'], --- 443,457 ---- // Output the basic page ! $page_title = $lang['KB_title'] . ' - ' . $lang['Search']; if ( !$is_block ) { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); } ! //include ( $module_root_path . "includes/kb_header." . $phpEx ); $template->set_filenames( array( 'body' => 'kb_search_body.tpl' ) ); ! $template->assign_vars( array( 'L_SEARCH_QUERY' => $lang['Search_query'], *************** *** 442,446 **** 'L_SEARCH_ALL_TERMS' => $lang['Search_for_all'], ! 'S_SEARCH_ACTION' => append_sid( this_kb_mxurl_search( "mode=results" ) ), 'S_HIDDEN_FIELDS' => '', 'S_SEARCH' => $lang['Search'] ) --- 461,465 ---- 'L_SEARCH_ALL_TERMS' => $lang['Search_for_all'], ! 'S_SEARCH_ACTION' => append_sid( this_kb_mxurl_search( "mode=results", true ) ), 'S_HIDDEN_FIELDS' => '', 'S_SEARCH' => $lang['Search'] ) *************** *** 452,456 **** $template->pparse( 'body' ); // load footer ! include ( $phpbb_root_path . "includes/kb_footer." . $phpEx ); if ( !$is_block ) --- 471,475 ---- $template->pparse( 'body' ); // load footer ! //include ( $module_root_path . "includes/kb_footer." . $phpEx ); if ( !$is_block ) *************** *** 459,461 **** } ! ?> --- 478,480 ---- } ! ?> \ No newline at end of file Index: kb.php =================================================================== RCS file: /cvsroot/mxbb/kb_076_mxaddon/root/kb.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb.php 9 Jan 2005 22:16:31 -0000 1.1 --- kb.php 28 Mar 2005 20:54:54 -0000 1.2 *************** *** 19,25 **** * (at your option) any later version. */ define( 'IN_PHPBB', true ); ! $phpbb_root_path = './'; include( $phpbb_root_path . 'extension.inc' ); include( $phpbb_root_path . 'common.' . $phpEx ); --- 19,31 ---- * (at your option) any later version. */ + define( 'MXBB_MODULE', false ); // Switch for making this run as a phpBB mod or mxBB module + define( 'IN_PHPBB', true ); ! define( 'IN_PORTAL', true ); ! ! // when run as a phpBB mod these paths are identical ! $phpbb_root_path = $module_root_path = $mx_root_path = './'; ! include( $phpbb_root_path . 'extension.inc' ); include( $phpbb_root_path . 'common.' . $phpEx ); *************** *** 37,69 **** 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_search.' . $phpEx ); $show_new = true; - // options - if ( !$board_config['allow_html'] ) - { - $html_on = 0; - } - else - { - $html_on = ( $submit || $refresh ) ? ( ( !empty( $HTTP_POST_VARS['disable_html'] ) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] ); - } - if ( !$board_config['allow_bbcode'] ) - { - $bbcode_on = 0; - } - else - { - $bbcode_on = ( $submit || $refresh ) ? ( ( !empty( $HTTP_POST_VARS['disable_bbcode'] ) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_bbcode'] : $userdata['user_allowbbcode'] ); - } - if ( !$board_config['allow_smilies'] ) - { - $smilies_on = 0; - } - else - { - $smilies_on = ( $submit || $refresh ) ? ( ( !empty( $HTTP_POST_VARS['disable_smilies'] ) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_smilies'] : $userdata['user_allowsmile'] ); - } // page number --- 43,57 ---- include( $phpbb_root_path . 'includes/kb_constants.' . $phpEx ); include( $phpbb_root_path . 'includes/functions_kb.' . $phpEx ); + include( $phpbb_root_path . 'includes/functions_kb_auth.' . $phpEx ); + include( $phpbb_root_path . 'includes/functions_kb_field.' . $phpEx ); + include( $phpbb_root_path . 'includes/functions_kb_mx.' . $phpEx ); include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); + // Instanciate custom fields + $kb_custom_field = new kb_custom_field(); + $kb_custom_field->init(); + $show_new = true; // page number *************** *** 82,85 **** --- 70,74 ---- { $print_version = ( isset( $HTTP_POST_VARS['print'] ) ) ? $HTTP_POST_VARS['print'] : $HTTP_GET_VARS['print']; + $print_version = htmlspecialchars( $print_version ); } else *************** *** 106,119 **** } ! $is_admin = ( ( $userdata['user_level'] == ADMIN || is_group_member( $kb_config['mod_group'], $userdata['user_id'] ) ) && $userdata['session_logged_in'] ) ? true : 0; ! // DEBUG ! // if (is_group_member($kb_config['mod_group'], $userdata['user_id'])) ! // { ! // message_die(GENERAL_ERROR, "you're group moderator...."."mod_group:".$kb_config['mod_group']. ", user_id:".$userdata['user_id'] , '', '', '', ''); ! // } ! // else ! // { ! // message_die(GENERAL_ERROR, "you're not group moderator..."."mod_group:".$kb_config['mod_group'] . ", user_id".$userdata['user_id'] , '', '', '', ''); ! // } // mode --- 95,146 ---- } ! // options ! $kb_wysiwyg = false; ! if ( $kb_config['wysiwyg'] ) // Html Textblock ! { ! if ( file_exists( $mx_root_path . 'modules/tinymce/jscripts/tiny_mce/blank.htm' ) ) ! { ! $bbcode_on = false; ! $html_on = true; ! $smilies_on = false; ! $kb_wysiwyg = true; ! } ! } ! ! if ( !$kb_wysiwyg ) ! { ! $bbcode_on = $kb_config['allow_bbcode'] ? true : false; ! $html_on = $kb_config['allow_html'] ? true : false; ! $smilies_on = $kb_config['allow_smilies'] ? true : false; ! } ! ! if ( MXBB_MODULE ) ! { ! // Newssuite operation mode? ! //------------------------------------------------------------------------- ! $total_blockk = count( $HTTP_SESSION_VARS['mx_pages']['page_' . $page_id]['blocks'] ); ! ! $kb_config['news_operate_mode'] = ''; ! for( $blockk = 0; $blockk < $total_blockk; $blockk++ ) ! { ! if ( $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_source_switch']['parameter_value'] == 'kb' && $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_mode_operate']['parameter_value'] == 'Source' ) ! { ! $newssuite_select_par = $HTTP_SESSION_VARS['block_' . $block_rows[$blockk]['block_id']]['news_type_select']['parameter_value']; ! // Extract 'what posts to view info', the cool Array ;) ! $news_type_select_data = array(); ! $news_type_select_temp = $newssuite_select_par; ! $news_type_select_temp = stripslashes( $news_type_select_temp ); ! $news_type_select_data = eval( "return " . $news_type_select_temp . ";" ); ! $kb_config['news_operate_mode'] = true; ! } ! else ! { ! $kb_config['news_operate_mode'] = ''; ! } ! } ! // ------------------------------------------------------------------------- ! } ! ! $is_admin = ( ( $userdata['user_level'] == ADMIN ) && $userdata['session_logged_in'] ) ? true : 0; // mode *************** *** 131,161 **** } if ( $mode == 'article' ) { ! include( $phpbb_root_path . 'includes/kb_article.' . $phpEx ); } else if ( $mode == 'cat' ) { ! include( $phpbb_root_path . 'includes/kb_cat.' . $phpEx ); } else if ( $mode == 'add' ) { ! include( $phpbb_root_path . 'includes/kb_add.' . $phpEx ); } else if ( $mode == 'search' ) { ! include( $phpbb_root_path . 'includes/kb_search.' . $phpEx ); } else if ( $mode == 'edit' ) { ! include( $phpbb_root_path . 'includes/kb_edit.' . $phpEx ); } else if ( $mode == 'rate' ) { ! include( $phpbb_root_path . 'includes/kb_rate.' . $phpEx ); } else if ( $mode == 'stats' ) { ! include( $phpbb_root_path . 'includes/kb_stats.' . $phpEx ); } else if ( $mode == 'moderate' ) --- 158,190 ---- } + $reader_mode = false; + if ( $mode == 'article' ) { ! include( $module_root_path . 'includes/kb_article.' . $phpEx ); } else if ( $mode == 'cat' ) { ! include( $module_root_path . 'includes/kb_cat.' . $phpEx ); } else if ( $mode == 'add' ) { ! include( $module_root_path . 'includes/kb_post.' . $phpEx ); } else if ( $mode == 'search' ) { ! include( $module_root_path . 'includes/kb_search.' . $phpEx ); } else if ( $mode == 'edit' ) { ! include( $module_root_path . 'includes/kb_post.' . $phpEx ); } else if ( $mode == 'rate' ) { ! include( $module_root_path . 'includes/kb_rate.' . $phpEx ); } else if ( $mode == 'stats' ) { ! include( $module_root_path . 'includes/kb_stats.' . $phpEx ); } else if ( $mode == 'moderate' ) *************** *** 169,177 **** if ( !$is_block ) { ! include( $phpbb_root_path . 'includes/page_header.' . $phpEx ); } ! make_jumpbox( $phpbb_root_path . 'viewforum.' . $phpEx, '' ); // load header ! include ( $phpbb_root_path . "includes/kb_header." . $phpEx ); $template->set_filenames( array( 'body' => 'kb_index_body.tpl' ) --- 198,206 ---- if ( !$is_block ) { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); } ! // load header ! include ( $module_root_path . "includes/kb_header." . $phpEx ); $template->set_filenames( array( 'body' => 'kb_index_body.tpl' ) *************** *** 186,196 **** $template->pparse( 'body' ); // load footer ! include ( $phpbb_root_path . "includes/kb_footer." . $phpEx ); if ( !$is_block && !$print_version ) { ! include( $phpbb_root_path . 'includes/page_tail.' . $phpEx ); } ! ?> \ No newline at end of file --- 215,226 ---- $template->pparse( 'body' ); + // load footer ! include ( $module_root_path . "includes/kb_footer." . $phpEx ); if ( !$is_block && !$print_version ) { ! include( $mx_root_path . 'includes/page_tail.' . $phpEx ); } ! ?> |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:28:30
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24472/includes Removed Files: kb_add.php kb_edit.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support - adding custom fields - making it compatible with phpBB mod --- kb_edit.php DELETED --- --- kb_add.php DELETED --- |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:23:31
|
Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20851/modules/mx_kb/admin Modified Files: admin_kb_art.php admin_kb_auth.php admin_kb_cat.php admin_kb_config.php admin_kb_types.php Added Files: admin_kb_custom.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support - adding custom fields - making it compatible with phpBB mod Index: admin_kb_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_auth.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_kb_auth.php 4 Feb 2005 23:44:30 -0000 1.1 --- admin_kb_auth.php 28 Mar 2005 20:22:44 -0000 1.2 *************** *** 19,47 **** */ ! define( 'IN_PORTAL', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $filename = basename( __FILE__ ); ! $module['KB_title']['Permissions'] = "modules/mx_kb/admin/" . $filename; ! return; } - - - // Let's set the root dir for phpBB - - $module_root_path = '../'; - $mx_root_path = '../../../'; - require( $mx_root_path . 'extension.inc' ); - require( $mx_root_path . 'admin/pagestart.' . $phpEx ); - require( $module_root_path . 'includes/kb_constants.' . $phpEx ); - require( $module_root_path . 'includes/functions_kb.' . $phpEx ); - require( $module_root_path . 'includes/functions_kb_auth.' . $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' ) --- 19,72 ---- */ ! 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' ) Index: admin_kb_config.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_config.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** admin_kb_config.php 26 Mar 2005 22:52:35 -0000 1.14 --- admin_kb_config.php 28 Mar 2005 20:22:45 -0000 1.15 *************** *** 20,48 **** */ ! define( 'IN_PORTAL', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['KB_title']['Configuration'] = 'modules/mx_kb/admin/' . $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); - include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); - */ - $mx_root_path = '../../../'; - $module_root_path = "../"; - require( $mx_root_path . 'extension.inc' ); - require( $mx_root_path . '/admin/pagestart.' . $phpEx ); - require( $module_root_path . 'includes/kb_constants.' . $phpEx ); - - include_once( $mx_root_path . 'admin/page_header_admin.' . $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']['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 Index: admin_kb_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_cat.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** admin_kb_cat.php 17 Mar 2005 12:37:24 -0000 1.7 --- admin_kb_cat.php 28 Mar 2005 20:22:44 -0000 1.8 *************** *** 20,51 **** */ ! define( 'IN_PORTAL', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['KB_title']['Cat_man'] = 'modules/mx_kb/admin/' . $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); - */ - $mx_root_path = '../../../'; - $module_root_path = "../"; - require( $mx_root_path . 'extension.inc' ); - require( $mx_root_path . '/admin/pagestart.' . $phpEx ); - require( $module_root_path . 'includes/kb_constants.' . $phpEx ); - require( $module_root_path . 'includes/functions_kb.' . $phpEx ); - require( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); - - include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); function get_forums( $sel_id = 0 ) --- 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']['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 ) *************** *** 169,176 **** 'DELETE_MOD' => 'selected="selected"', 'APPROVAL_DISABLED' => 'selected="selected"', ! ! ! ) ! ); } else if ( $HTTP_POST_VARS['submit'] ) --- 188,192 ---- 'DELETE_MOD' => 'selected="selected"', 'APPROVAL_DISABLED' => 'selected="selected"', ! ) ); } else if ( $HTTP_POST_VARS['submit'] ) Index: admin_kb_art.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_art.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** admin_kb_art.php 26 Mar 2005 22:52:35 -0000 1.13 --- admin_kb_art.php 28 Mar 2005 20:22:43 -0000 1.14 *************** *** 20,41 **** */ ! define( 'IN_PORTAL', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['KB_title']['Art_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 ); - require( $module_root_path . 'includes/kb_constants.' . $phpEx ); - // include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); - include( $module_root_path . 'includes/functions_kb.' . $phpEx ); - include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); - include_once( $mx_root_path . 'admin/page_header_admin.' . $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 . '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']['Art_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 ); } // Pull all config data *************** *** 114,118 **** // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $topic_sql = ", topic_id = " . $topic_data['topic_id']; --- 143,147 ---- // 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']; *************** *** 163,167 **** update_kb_number( $article_category_id, '- 1' ); ! mx_remove_search_words( $article_id, 'kb' ); $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); --- 192,196 ---- update_kb_number( $article_category_id, '- 1' ); ! mx_remove_search_post( $article_id, 'kb' ); $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); *************** *** 322,326 **** } ! mx_remove_search_words( $article_id, 'kb' ); $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); --- 351,355 ---- } ! mx_remove_search_post( $article_id, 'kb' ); $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( $mx_root_path . "admin/index.$phpEx?pane=right" ) . '">', '</a>' ); Index: admin_kb_types.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_types.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin_kb_types.php 17 Mar 2005 12:37:24 -0000 1.6 --- admin_kb_types.php 28 Mar 2005 20:22:45 -0000 1.7 *************** *** 20,32 **** */ ! define( 'IN_PORTAL', 1 ); ! ! if ( !empty( $setmodules ) ) { ! $file = basename( __FILE__ ); ! $module['KB_title']['Types_man'] = 'modules/mx_kb/admin/' . $file; ! return; } ! function get_list_kb( $id, $select ) { --- 20,71 ---- */ ! 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']['Types_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']['Types_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_list_kb( $id, $select ) { *************** *** 61,79 **** // 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); - */ - $mx_root_path = '../../../'; - $module_root_path = "../"; - require( $mx_root_path . 'extension.inc' ); - require( $mx_root_path . '/admin/pagestart.' . $phpEx ); - require( $module_root_path . 'includes/kb_constants.' . $phpEx ); - - include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); - if ( isset( $HTTP_POST_VARS['mode'] ) || isset( $HTTP_GET_VARS['mode'] ) ) { --- 100,103 ---- *************** *** 142,147 **** // Generate page ! $template->set_filenames( array( 'body' => 'admin/kb_cat_edit_body.tpl' ) ! ); $template->assign_vars( array( 'L_EDIT_TITLE' => $lang['Edit_type'], --- 166,170 ---- // Generate page ! $template->set_filenames( array( 'body' => 'admin/kb_type_edit_body.tpl' ) ); $template->assign_vars( array( 'L_EDIT_TITLE' => $lang['Edit_type'], --- NEW FILE: admin_kb_custom.php --- <?php /** * pafiledb mx module * ------------------- * copyright : (C) 2002 MX-System * begin : oct 23, 2003 * email : jon...@ho... * based on code by Mohd Basri, and pafilDB * * $Id: admin_kb_custom.php,v 1.1 2005/03/28 20:22:45 jonohlsson Exp $ */ 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']['Custom Field'] = $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']['Custom Field'] = "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 ); } // =================================================== // to make it work with php version under 4.1 and other stuff // =================================================== if ( @phpversion() < '4.1' ) { $_GET = &$HTTP_GET_VARS; $_POST = &$HTTP_POST_VARS; $_COOKIE = &$HTTP_COOKIE_VARS; $_SERVER = &$HTTP_SERVER_VARS; $_ENV = &$HTTP_ENV_VARS; $_FILES = &$HTTP_POST_FILES; $_SESSION = &$HTTP_SESSION_VARS; } if ( !isset( $_REQUEST ) ) { $_REQUEST = array_merge( $_GET, $_POST, $_COOKIE ); } if ( !get_magic_quotes_gpc() ) { $_GET = slash_input_data( $_GET ); $_POST = slash_input_data( $_POST ); $_COOKIE = slash_input_data( $_COOKIE ); $_REQUEST = slash_input_data( $_REQUEST ); } $kb_custom_field = new kb_custom_field(); $kb_custom_field->init(); $mode = ( isset( $_REQUEST['mode'] ) ) ? htmlspecialchars( $_REQUEST['mode'] ) : 'select'; $field_id = ( isset( $_REQUEST['field_id'] ) ) ? intval( $_REQUEST['field_id'] ) : 0; $field_type = ( isset( $_REQUEST['field_type'] ) ) ? intval( $_REQUEST['field_type'] ) : $kb_custom_field->field_rowset[$field_id]['field_type']; $field_ids = ( isset( $_REQUEST['field_ids'] ) ) ? $_REQUEST['field_ids'] : ''; $submit = ( isset( $_POST['submit'] ) ) ? true : false; switch ( $mode ) { case 'addfield': $template_file = 'admin/kb_field_add.tpl'; break; case 'editfield': $template_file = 'admin/kb_field_add.tpl'; break; case 'edit': $template_file = 'admin/kb_select_field_edit.tpl'; break; case 'add': $template_file = 'admin/kb_select_field_type.tpl'; break; case 'delete': $template_file = 'admin/kb_select_field_delete.tpl'; break; case 'select': $template_file = 'admin/kb_select.tpl'; break; } if ( $submit ) { if ( $mode == 'do_add' && !$field_id ) { $kb_custom_field->update_add_field( $field_type ); $message = $lang['Fieldadded'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( 'admin_kb_custom.' . $phpEx ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( 'index.' . $phpEx . '?pane=right' ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } elseif ( $mode == 'do_add' && $field_id ) { $kb_custom_field->update_add_field( $field_type, $field_id ); $message = $lang['Fieldedited'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( 'admin_kb_custom.' . $phpEx ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( 'index.' . $phpEx . '?pane=right' ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } elseif ( $mode == 'do_delete' ) { foreach( $field_ids as $key => $value ) { $kb_custom_field->delete_field( $key ); } $message = $lang['Fieldsdel'] . '<br /><br />' . sprintf( $lang['Click_return'], '<a href="' . append_sid( 'admin_kb_custom.' . $phpEx ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_admin_index'], '<a href="' . append_sid( 'index.' . $phpEx . '?pane=right' ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } } $template->set_filenames( array( 'admin' => $template_file ) ); switch ( $mode ) { case 'add': case 'addfield': $l_title = $lang['Afieldtitle']; break; case 'edit': $l_title = $lang['Efieldtitle']; break; case 'editfield': $l_title = $lang['Efieldtitle']; break; case 'delete': $l_title = $lang['Dfieldtitle']; break; case 'select': $l_title = $lang['Mfieldtitle']; break; } if ( $mode == 'add' ) { $s_hidden_fields = '<input type="hidden" name="mode" value="addfield">'; } elseif ( $mode == 'addfield' || $mode == 'editfield') { $s_hidden_fields = '<input type="hidden" name="field_type" value="' . $field_type . '">'; $s_hidden_fields .= '<input type="hidden" name="field_id" value="' . $field_id . '">'; $s_hidden_fields .= '<input type="hidden" name="mode" value="do_add">'; } elseif ( $mode == 'edit' ) { $s_hidden_fields = '<input type="hidden" name="mode" value="editfield">'; } elseif ( $mode == 'delete' ) { $s_hidden_fields = '<input type="hidden" name="mode" value="do_delete">'; } $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') { if ( $field_id ) { $data = $kb_custom_field->get_field_data( $field_id ); } $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'] ) ); } elseif ( $mode == 'add' ) { $field_types = array( INPUT => $lang['Field_Input'], TEXTAREA => $lang['Field_Textarea'], RADIO => $lang['Field_Radio'], SELECT => $lang['Field_Select'], SELECT_MULTIPLE => $lang['Field_Select_multiple'], CHECKBOX => $lang['Field_Checkbox'] ); $field_type_list = '<select name="field_type">'; foreach( $field_types as $key => $value ) { $field_type_list .= '<option value="' . $key . '">' . $value . '</option>'; } $field_type_list .= '</select>'; $template->assign_vars( array( 'S_SELECT_FIELD_TYPE' => $field_type_list ) ); } elseif ( $mode == 'edit' || $mode == 'delete' || $mode == 'select' ) { foreach( $kb_custom_field->field_rowset as $field_id => $field_data ) { $template->assign_block_vars( 'field_row', array( 'FIELD_ID' => $field_id, 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_DESC' => $field_data['custom_description'] ) ); } } $template->pparse( 'admin' ); //$pafiledb->_pafiledb(); //$cache->unload(); /* Original include('./page_footer_admin.'.$phpEx); */ // MX Module include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); ?> |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:23:25
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20851/modules/mx_kb Modified Files: db_install.php db_upgrade.php kb.php kb_article_reader.php kb_search.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support - adding custom fields - making it compatible with phpBB mod Index: kb_search.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb_search.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** kb_search.php 11 Feb 2005 22:10:29 -0000 1.10 --- kb_search.php 28 Mar 2005 20:22:46 -0000 1.11 *************** *** 473,477 **** $template->pparse( 'body' ); // load footer ! include ( $module_root_path . "includes/kb_footer." . $phpEx ); if ( !$is_block ) --- 473,477 ---- $template->pparse( 'body' ); // load footer ! //include ( $module_root_path . "includes/kb_footer." . $phpEx ); if ( !$is_block ) Index: kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** kb.php 26 Mar 2005 22:52:35 -0000 1.14 --- kb.php 28 Mar 2005 20:22:45 -0000 1.15 *************** *** 130,135 **** --- 130,140 ---- include_once( $module_root_path . 'includes/functions_kb.' . $phpEx ); include_once( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); + include_once( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); + // Instanciate custom fields + $kb_custom_field = new kb_custom_field(); + $kb_custom_field->init(); + $show_new = true; Index: kb_article_reader.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb_article_reader.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_article_reader.php 6 Mar 2005 01:12:29 -0000 1.3 --- kb_article_reader.php 28 Mar 2005 20:22:46 -0000 1.4 *************** *** 50,54 **** else { - // Read block Configuration --- 50,53 ---- *************** *** 73,80 **** --- 72,85 ---- include_once( $module_root_path . 'includes/functions_kb.' . $phpEx ); include_once( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); + include_once( $module_root_path . 'includes/functions_kb_field.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); // echo(var_export($_SESSION['newssuite_'.$page_id]['testar'])); + // Instanciate custom fields + $kb_custom_field = new kb_custom_field(); + $kb_custom_field->init(); + $show_new = true; + // options if ( !$board_config['allow_html'] ) Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/db_install.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** db_install.php 26 Mar 2005 22:52:35 -0000 1.22 --- db_install.php 28 Mar 2005 20:22:45 -0000 1.23 *************** *** 80,89 **** "CREATE TABLE " . $mx_table_prefix . "kb_categories ( ! category_id mediumint(8) unsigned NOT NULL auto_increment, ! category_name VARCHAR(255) binary NOT NULL, ! category_details VARCHAR(255) binary NOT NULL, ! number_articles mediumint(8) unsigned NOT NULL, ! parent mediumint(8) unsigned, ! cat_order mediumint(8) unsigned NOT NULL, auth_view tinyint(3) NOT NULL DEFAULT '0', auth_post tinyint(3) NOT NULL DEFAULT '0', --- 80,89 ---- "CREATE TABLE " . $mx_table_prefix . "kb_categories ( ! category_id mediumint(8) unsigned NOT NULL auto_increment, ! category_name VARCHAR(255) binary NOT NULL, ! category_details VARCHAR(255) binary NOT NULL, ! number_articles mediumint(8) unsigned NOT NULL, ! parent mediumint(8) unsigned, ! cat_order mediumint(8) unsigned NOT NULL, auth_view tinyint(3) NOT NULL DEFAULT '0', auth_post tinyint(3) NOT NULL DEFAULT '0', *************** *** 104,109 **** auth_moderator_groups varchar(255), comments_forum_id tinyint(3) NOT NULL DEFAULT '-1', ! ! KEY category_id (category_id) )", --- 104,108 ---- auth_moderator_groups varchar(255), comments_forum_id tinyint(3) NOT NULL DEFAULT '-1', ! KEY category_id (category_id) )", *************** *** 188,192 **** --- 187,212 ---- KEY post_id (article_id), KEY word_id (word_id) + )", + + // -------------------------------------------------------- + // Table structure for table `phpbb_pa_custom` + "CREATE TABLE " . $mx_table_prefix . "kb_custom ( + custom_id int(50) NOT NULL auto_increment, + custom_name text NOT NULL, + custom_description text NOT NULL, + data text NOT NULL, + field_order int(20) NOT NULL default '0', + field_type tinyint(2) NOT NULL default '0', + regex varchar(255) NOT NULL default '', + PRIMARY KEY (custom_id) + )", + // -------------------------------------------------------- + // Table structure for table `phpbb_pa_customdata` + "CREATE TABLE " . $mx_table_prefix . "kb_customdata ( + customdata_file int(50) NOT NULL default '0', + customdata_custom int(50) NOT NULL default '0', + data text NOT NULL )" + ); Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/db_upgrade.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** db_upgrade.php 26 Mar 2005 22:52:35 -0000 1.15 --- db_upgrade.php 28 Mar 2005 20:22:45 -0000 1.16 *************** *** 61,64 **** --- 61,65 ---- $upgrade_108 = 0; $upgrade_109 = 0; + $upgrade_200 = 0; $message = "<b>Upgrading!</b><br/><br/>"; *************** *** 107,111 **** } // validate before 1.09 ! if ( !$result = $db->sql_query( "SELECT cat_view_level from " . $mx_table_prefix . "kb_categories" ) ) { $upgrade_109 = 1; --- 108,112 ---- } // validate before 1.09 ! if ( !$result = $db->sql_query( "SELECT auth_edit_groups from " . $mx_table_prefix . "kb_categories" ) ) { $upgrade_109 = 1; *************** *** 121,125 **** { $upgrade_200 = 1; ! $message .= "<b>Validating v. 2.00...ok</b><br/><br/>"; } else --- 122,126 ---- { $upgrade_200 = 1; ! $message .= "<b>Upgrading to v. 2.00...ok</b><br/><br/>"; } else *************** *** 250,253 **** --- 251,274 ---- $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allow_smilies', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allowed_html_tags', 'b,i,u,a')"; + + // -------------------------------------------------------- + // Table structure for table `phpbb_pa_custom` + $sql[] = "CREATE TABLE " . $mx_table_prefix . "kb_custom ( + custom_id int(50) NOT NULL auto_increment, + custom_name text NOT NULL, + custom_description text NOT NULL, + data text NOT NULL, + field_order int(20) NOT NULL default '0', + field_type tinyint(2) NOT NULL default '0', + regex varchar(255) NOT NULL default '', + PRIMARY KEY (custom_id) + )"; + // -------------------------------------------------------- + // Table structure for table `phpbb_pa_customdata` + $sql[] = "CREATE TABLE " . $mx_table_prefix . "kb_customdata ( + customdata_file int(50) NOT NULL default '0', + customdata_custom int(50) NOT NULL default '0', + data text NOT NULL + )"; } else |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:23:04
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20851/modules/mx_kb/includes Modified Files: functions_kb.php kb_article.php kb_constants.php kb_defs.php kb_header.php kb_moderator.php kb_pages.php kb_post.php kb_stats.php Added Files: functions_kb_field.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support - adding custom fields - making it compatible with phpBB mod Index: kb_stats.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_stats.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_stats.php 1 Feb 2005 20:45:44 -0000 1.3 --- kb_stats.php 28 Mar 2005 20:22:47 -0000 1.4 *************** *** 37,67 **** include( $mx_root_path . 'includes/page_header.' . $phpEx ); } // load header include ( $module_root_path . "includes/kb_header." . $phpEx ); ! $template->set_filenames( array( 'body' => 'kb_stats_body.tpl' ) ! ); ! // if ( !$category_name ) ! // { ! // $message = $lang['Category_not_exsist'] . '<br /><br />' . sprintf($lang['Click_return_kb'], '<a href="' . append_sid(this_kb_mxurl()) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid($mx_root_path . "index.$phpEx") . '">', '</a>'); - // mx_message_die(GENERAL_MESSAGE, $message); - // } - // else - // { - // get sub-cats - // get_kb_cat_subs($category_id); if ( $stats == 'toprated' ) { $path_kb = $lang['Top_toprated']; ! }elseif ( $stats == 'latest' ) { $path_kb = $lang['Top_latest']; ! }elseif ( $stats == 'mostpopular' ) { $path_kb = $lang['Top_most_popular']; } ! // $path_kb_array = array(); ! // get_kb_nav($category_id); $template->assign_vars( array( 'L_CATEGORY_NAME' => $category_name, 'L_ARTICLE' => $lang['Article'], --- 37,59 ---- include( $mx_root_path . 'includes/page_header.' . $phpEx ); } + // load header include ( $module_root_path . "includes/kb_header." . $phpEx ); ! $template->set_filenames( array( 'body' => 'kb_stats_body.tpl' ) ); if ( $stats == 'toprated' ) { $path_kb = $lang['Top_toprated']; ! } ! elseif ( $stats == 'latest' ) { $path_kb = $lang['Top_latest']; ! } ! elseif ( $stats == 'mostpopular' ) { $path_kb = $lang['Top_most_popular']; } ! $template->assign_vars( array( 'L_CATEGORY_NAME' => $category_name, 'L_ARTICLE' => $lang['Article'], *************** *** 73,87 **** 'L_VIEWS' => $lang['Views'], 'L_VOTES' => $lang['Votes'], - 'L_CATEGORY' => $lang['Category_sub'], 'L_ARTICLES' => $lang['Articles'], - 'PATH' => '» ' . $path_kb, ! ! 'U_CAT' => append_sid( this_kb_mxurl( 'mode=cat&cat=' . $category_id ) ) ) ! ); get_kb_stats( $stats, '1', 'articlerow', $kb_is_auth ); - // } ?> \ No newline at end of file --- 65,75 ---- 'L_VIEWS' => $lang['Views'], 'L_VOTES' => $lang['Votes'], 'L_CATEGORY' => $lang['Category_sub'], 'L_ARTICLES' => $lang['Articles'], 'PATH' => '» ' . $path_kb, ! 'U_CAT' => append_sid( this_kb_mxurl( 'mode=cat&cat=' . $category_id ) ) ! ) ); get_kb_stats( $stats, '1', 'articlerow', $kb_is_auth ); ?> \ No newline at end of file Index: kb_header.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_header.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** kb_header.php 26 Mar 2005 22:52:36 -0000 1.13 --- kb_header.php 28 Mar 2005 20:22:47 -0000 1.14 *************** *** 28,63 **** define( 'ALLOW_ANON', 1 ); - // Pull all config data - - $sql = "SELECT * - FROM " . KB_CONFIG_TABLE; - if ( !$result = $db->sql_query( $sql ) ) - { - message_die( CRITICAL_ERROR, "Could not query config information in kb_config", "", __LINE__, __FILE__, $sql ); - } - else - { - while ( $row_tmp = $db->sql_fetchrow( $result ) ) - { - $config_name = $row_tmp['config_name']; - $config_value = $row_tmp['config_value']; - $kb_config[$config_name] = $config_value; - } - } - - // $dirname = $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.'.$phpEx; - // include($dirname); - // Parse and show the overall header. ! $template->set_filenames( array( 'kb_header' => 'kb_header.tpl' ) ! ); ! if ( $HTTP_GET_VARS['cat'] ) { if ( $kb_config['allow_new'] == 1 && ( $kb_is_auth['auth_post'] || $kb_is_auth['auth_mod'] ) ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=add&cat=" . $HTTP_GET_VARS['cat'] ) ); $add_article = '<a href="' . $temp_url . '">' . $lang['Add_article'] . '</a>'; } --- 28,41 ---- define( 'ALLOW_ANON', 1 ); // Parse and show the overall header. ! $template->set_filenames( array( 'kb_header' => 'kb_header.tpl' ) ); ! if ( isset ( $HTTP_GET_VARS['cat'] ) ) { if ( $kb_config['allow_new'] == 1 && ( $kb_is_auth['auth_post'] || $kb_is_auth['auth_mod'] ) ) { ! $temp_url = append_sid( this_kb_mxurl( "mode=add&cat=" . intval ($HTTP_GET_VARS['cat'] ) ) ); $add_article = '<a href="' . $temp_url . '">' . $lang['Add_article'] . '</a>'; } *************** *** 77,86 **** { $temp_url = append_sid( this_kb_mxurl() ); ! $block_title = '<th class="thTop"><a href="' . $temp_url . '"><img src="' . $images['kb_title'] . '" width="285" height="45" border="0" alt="' . $title . '"></a></th>'; } else { ! // $block_title = '<th class="thHead"> ' . $title . '</th>'; ! $block_title = ''; } --- 55,63 ---- { $temp_url = append_sid( this_kb_mxurl() ); ! $block_title = '<td align="center"><a href="' . $temp_url . '"><img src="' . $images['kb_title'] . '" width="285" height="45" border="0" alt="' . $title . '"></a></td>'; } else { ! $block_title = MXBB_MODULE ? '<th class="thHead"> ' . $title . '</th>' : '<td align="center"><b>' . $lang['KB_title'] . '</b></td>'; } *************** *** 102,106 **** if ( $kb_config['stats_list'] == 1 ) { ! get_quick_stats( $HTTP_GET_VARS['cat'] ); } --- 79,83 ---- if ( $kb_config['stats_list'] == 1 ) { ! get_quick_stats( intval( $HTTP_GET_VARS['cat'] ) ); } Index: kb_defs.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_defs.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** kb_defs.php 9 Jan 2005 21:40:38 -0000 1.2 --- kb_defs.php 28 Mar 2005 20:22:47 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- // ------------------------------------------------------------------------- // KB MODE ------------------------------------------------------------------------------------------- + define( 'NEWS_CAT_TABLE', $mx_table_prefix . 'kb_categories' ); define( 'KB_ARTICLES_TABLE', $mx_table_prefix . 'kb_articles' ); *************** *** 29,37 **** define( 'KB_TYPES_TABLE', $mx_table_prefix . 'kb_types' ); - // get type list for adding and editing articles - - // function get_kb_types() - // { - // global $db, $template; $sql = "SELECT * FROM " . KB_TYPES_TABLE; --- 30,33 ---- *************** *** 52,59 **** $item_types_name_array[] = $type['type']; } - // return array($item_types_array, $item_types_id_array, $item_types_name_array); - // } - $cat_extract_order = 'parent, cat_order'; $cool_array_category_id = 'category_id'; --- 48,53 ---- $item_types_name_array[] = $type['type']; } + $cat_extract_order = 'parent, cat_order'; $cool_array_category_id = 'category_id'; *************** *** 81,113 **** $item_types_all = 'forum_news'; - // $temp_list = get_kb_types(); - // $item_types_array = $temp_list[0]; - // $item_types_id_array = $temp_list[1]; - // $item_types_name_array = $temp_list[2]; - - // get type list for adding and editing articles - // function get_kb_types() - // { - // global $db, $template; - $sql = "SELECT * - FROM " . KB_TYPES_TABLE; - - if ( !( $type_result = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, "Could not obtain types information", '', __LINE__, __FILE__, $sql ); - } - - $item_types_array = array(); - $item_types_id_array = array(); - $item_types_name_array = array(); - - while ( $type = $db->sql_fetchrow( $type_result ) ) - { - $item_types_array[] = 'type_' . $type['id']; - $item_types_id_array[] = $type['id']; - $item_types_name_array[] = $type['type']; - } - // return array($item_types_array, $item_types_id_array, $item_types_name_array); - // } ?> \ No newline at end of file --- 75,78 ---- Index: kb_pages.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_pages.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** kb_pages.php 18 Feb 2005 10:07:44 -0000 1.2 --- kb_pages.php 28 Mar 2005 20:22:47 -0000 1.3 *************** *** 1,13 **** <?php ! /** ! * kb_pages.php ! * --------------- ! * begin : June, 2004 ! * copyright : phpMiX (c) 2004 ! * contact : http://www.phpmix.com ! * module : mx_forum ! * file contents : Common definitions for the module. * ! * editor settings : TabSize = 4 */ --- 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 : ! * ------------------------------------------------------------------------- */ *************** *** 19,28 **** */ - // Set the numbers to the Portal Page IDs where you place each Block. - // If you do not want a phpBB Script to act as a Portal Block, use 0. - // Note: This piece of code snippet is somewhat ugly and needs cleaning up...still it works... ! if ( empty( $_SESSION['kb_setup'] ) || 1==1) { $news_setup = array(); --- 18,28 ---- */ // Note: This piece of code snippet is somewhat ugly and needs cleaning up...still it works... + // What it does? + // Well if given a direct kb article link, it finds on what portal page the kb block is located. + // Since we can have different kb blocks on different portal pages displaying different kb categories/articles, this check is needed ;) + // Oh, do not blame markus for this code ;) ! if ( empty( $_SESSION['kb_setup'] ) ) { $news_setup = array(); *************** *** 86,91 **** } - // echo('xxxxx' . var_export($_SESSION['kb_setup']) . '<br>'); - // Start initial var setup --- 86,89 ---- Index: kb_constants.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_constants.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** kb_constants.php 6 Mar 2005 01:12:29 -0000 1.21 --- kb_constants.php 28 Mar 2005 20:22:47 -0000 1.22 *************** *** 19,24 **** * (at your option) any later version. */ ! ! // ---------------------------------------------------------------------START // This file defines specific constants for the module --- 19,40 ---- * (at your option) any later version. */ ! ! if ( !MXBB_MODULE ) ! { ! $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://'; ! $server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name'])); ! $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : ''; ! $script_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path'])); ! $script_name = ($script_name == '') ? $script_name : '/' . $script_name; ! ! define( 'PORTAL_URL', $server_protocol . $server_name . $server_port . $script_name . '/' ); ! define( 'PHPBB_URL', PORTAL_URL ); ! ! $reader_mode = false; ! $kb_config['news_operate_mode'] = false; ! $mx_table_prefix = $table_prefix; ! $is_block = false; ! } ! // ---------------------------------------------------------------------START // This file defines specific constants for the module *************** *** 34,48 **** define( 'KB_VOTES_TABLE', $mx_table_prefix . 'kb_votes' ); // ********************************************************************** // Read language definition // ********************************************************************** ! if ( !file_exists( $mx_root_path . 'modules/mx_kb/language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ) ) { ! include( $mx_root_path . 'modules/mx_kb/language/lang_english/lang_kb.' . $phpEx ); $link_language = 'lang_english'; } else { ! include( $mx_root_path . 'modules/mx_kb/language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ); $link_language = 'lang_' . $board_config['default_lang']; } --- 50,75 ---- define( 'KB_VOTES_TABLE', $mx_table_prefix . 'kb_votes' ); + define( 'KB_CUSTOM_TABLE', $mx_table_prefix . 'kb_custom' ); + define( 'KB_CUSTOM_DATA_TABLE', $mx_table_prefix . 'kb_customdata' ); + + // Field Types + define( 'INPUT', 0 ); + define( 'TEXTAREA', 1 ); + define( 'RADIO', 2 ); + define( 'SELECT', 3 ); + define( 'SELECT_MULTIPLE', 4 ); + define( 'CHECKBOX', 5 ); + // ********************************************************************** // Read language definition // ********************************************************************** ! if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ) ) { ! include( $module_root_path . 'language/lang_english/lang_kb.' . $phpEx ); $link_language = 'lang_english'; } else { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.' . $phpEx ); $link_language = 'lang_' . $board_config['default_lang']; } *************** *** 82,86 **** } ! $mxbb_footer_addup[] = 'mxBB Knowledge Base Module'; --- 109,124 ---- } ! if ( !MXBB_MODULE ) ! { ! $kb_module_version = "Knowledge Base v. 2.0"; ! $kb_module_author = "Haplo"; ! $kb_module_orig_author = "wGEric"; ! } ! else ! { ! $mxbb_footer_addup[] = 'mxBB Knowledge Base Module'; ! } ! ! Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_article.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** kb_article.php 26 Mar 2005 22:52:36 -0000 1.14 --- kb_article.php 28 Mar 2005 20:22:47 -0000 1.15 *************** *** 41,45 **** if ( count($row) > 0 ) { ! $article_title = stripslashes( $row['article_title'] ); // --- 41,45 ---- if ( count($row) > 0 ) { ! $article_title = $row['article_title'] ; // *************** *** 104,108 **** $article = trim( $art_pages[$page_num] ); $article = str_replace( '[toc]', '', $article ); ! $kb_art_description = stripslashes( $row['article_description'] ); $article = article_formatting( $article ); --- 104,109 ---- $article = trim( $art_pages[$page_num] ); $article = str_replace( '[toc]', '', $article ); ! ! $kb_art_description = $row['article_description'] ; $article = article_formatting( $article ); *************** *** 302,306 **** // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " --- 303,307 ---- // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_editor_id'], $userdata['article_editor'], $userdata['article_editor_sig'], $kb_comment['topic_id'], $kb_update_message ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " *************** *** 416,419 **** --- 417,421 ---- // article pages table of contents + $kb_custom_field->display_data( $article_id ); if ( count( $art_pages ) > 1 ) Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** functions_kb.php 26 Mar 2005 22:52:35 -0000 1.19 --- functions_kb.php 28 Mar 2005 20:22:46 -0000 1.20 *************** *** 258,262 **** { $i++; ! $article_description = stripslashes( $article['article_description'] ); $article_cat = $article['article_category_id']; $article_approved = $article['approved']; --- 258,262 ---- { $i++; ! $article_description = $article['article_description'] ; $article_cat = $article['article_category_id']; $article_approved = $article['approved']; *************** *** 283,287 **** $views = $article['views']; ! $article_title = stripslashes( $article['article_title'] ); $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id" ) ); $article = '<a href="' . $temp_url . '" class="gen">' . $article_title . '</a>'; --- 283,287 ---- $views = $article['views']; ! $article_title = $article['article_title']; $temp_url = append_sid( this_kb_mxurl( "mode=article&k=$article_id" ) ); $article = '<a href="' . $temp_url . '" class="gen">' . $article_title . '</a>'; *************** *** 479,486 **** $category_name = $category['category_name']; if ( $approved_yesno == 2 ) { // approve ! $temp_url = append_sid( PORTAL_URL . $module_root_path . "admin/admin_kb_art.$phpEx?mode=approve&a=$article_id" ); $approve = '<a href="' . $temp_url . '"><img src="' . PORTAL_URL . $images['icon_approve'] . '" border="0" alt="' . $lang['Approve'] . '"></a>'; } --- 479,488 ---- $category_name = $category['category_name']; + $kb_path_tmp = MXBB_MODULE ? PORTAL_URL . $module_root_path : $phpbb_root_path; + if ( $approved_yesno == 2 ) { // approve ! $temp_url = append_sid( $kb_path_tmp . "admin/admin_kb_art.$phpEx?mode=approve&a=$article_id" ); $approve = '<a href="' . $temp_url . '"><img src="' . PORTAL_URL . $images['icon_approve'] . '" border="0" alt="' . $lang['Approve'] . '"></a>'; } *************** *** 488,495 **** { // unapprove ! $temp_url = append_sid( PORTAL_URL . $module_root_path . "admin/admin_kb_art.$phpEx?mode=unapprove&a=$article_id" ); $unapprove = '<a href="' . $temp_url . '"><img src="' . PORTAL_URL . $images['icon_unapprove'] . '" border="0" alt="' . $lang['Un_approve'] . '"></a>'; } ! $temp_url = append_sid( PORTAL_URL . $module_root_path . "admin/admin_kb_art.$phpEx?mode=delete&a=$article_id" ); $delete = '<a href="' . $temp_url . '"><img src="' . $phpbb_root_path . $images['icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; $approve_pm_view .= "<tr><td>$category_name</td><td>$approve ' ' $delete ' ' $unapprove</td></tr>"; // the action table --- 490,497 ---- { // unapprove ! $temp_url = append_sid( $kb_path_tmp . "admin/admin_kb_art.$phpEx?mode=unapprove&a=$article_id" ); $unapprove = '<a href="' . $temp_url . '"><img src="' . PORTAL_URL . $images['icon_unapprove'] . '" border="0" alt="' . $lang['Un_approve'] . '"></a>'; } ! $temp_url = append_sid( $kb_path_tmp . "admin/admin_kb_art.$phpEx?mode=delete&a=$article_id" ); $delete = '<a href="' . $temp_url . '"><img src="' . $phpbb_root_path . $images['icon_delpost'] . '" border="0" alt="' . $lang['Delete'] . '"></a>'; $approve_pm_view .= "<tr><td>$category_name</td><td>$approve ' ' $delete ' ' $unapprove</td></tr>"; // the action table *************** *** 503,507 **** $new_article .= $articlebody; // the extended Pm body $new_article .= '<p>' . $approve_pm_view; // the extended Pm body ! $new_article .= '<br><a href=' . PORTAL_URL . $module_root_path . 'admin/admin_kb_art.' . $phpEx . '>KB Admin page</a><br>'; // the extended Pm body $new_article = addslashes( $new_article ); --- 505,509 ---- $new_article .= $articlebody; // the extended Pm body $new_article .= '<p>' . $approve_pm_view; // the extended Pm body ! $new_article .= '<br><a href=' . $kb_path_tmp . 'admin/admin_kb_art.' . $phpEx . '>KB Admin page</a><br>'; // the extended Pm body $new_article = addslashes( $new_article ); *************** *** 1272,1280 **** message_die( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_subject = '$subject', bbcode_uid = '$bbcode_uid', ! post_text = '$message' WHERE post_id = '$orig_post_id'"; --- 1274,1284 ---- message_die( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } + + $message_tmp = $message . '\n\n' . $message_update_text; $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_subject = '$subject', bbcode_uid = '$bbcode_uid', ! post_text = '$message_tmp' WHERE post_id = '$orig_post_id'"; *************** *** 1297,1300 **** --- 1301,1310 ---- global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; + if ( !MXBB_MODULE ) + { + $mxurl = $phpbb_root_path . 'kb.' . $phpEx . ( $args == '' ? '' : '?' . $args ); + return $mxurl; + } + if ( $force_standalone_mode || !$is_block ) { *************** *** 1323,1326 **** --- 1333,1342 ---- global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; + if ( !MXBB_MODULE ) + { + $mxurl = $phpbb_root_path . 'kb_search.' . $phpEx . ( $args == '' ? '' : '?' . $args ); + return $mxurl; + } + if ( $force_standalone_mode || !$is_block ) { *************** *** 1680,1684 **** global $db; ! $kb_author_data = get_kb_author( $kb_comment['article_author_id'], true ); $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $row['article_category_id'] . "'"; --- 1696,1700 ---- global $db; ! $kb_author_data = get_kb_author( $row['article_author_id'], true ); $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $row['article_category_id'] . "'"; *************** *** 1718,1722 **** function kb_compose_comment( $kb_comment ) { ! global $lang, $kb_comment, $phpEx; $search = array ( "'&(quot|#34);'i", // Replace HTML entities --- 1734,1738 ---- function kb_compose_comment( $kb_comment ) { ! global $lang, $kb_comment, $phpEx, $kb_custom_field; $search = array ( "'&(quot|#34);'i", // Replace HTML entities *************** *** 1737,1746 **** $message = "[b]" . $lang['Article_title'] . ":[/b] " . preg_replace( $search, $replace, $kb_comment['article_title'] ) . "\n"; $message .= "[b]" . $lang['Author'] . ":[/b] " . $kb_comment['article_author'] . "\n"; ! $message .= "[b]" . $lang['Article_description'] . ":[/b] " . preg_replace( $search, $replace, $kb_comment['article_desc'] ) . "\n\n"; $message .= "[b]" . $lang['Category'] . ":[/b] " . $kb_comment['category_name'] . "\n"; ! $message .= "[b]" . $lang['Article_type'] . ":[/b] " . $kb_comment['article_type'] . "\n\n"; - $message .= "[b][url=" . $temp_url . "]" . $lang['Read_full_article'] . "[/url][/b]"; $message_update_text = "[i]" . $lang['Edited_Article_info'] . $kb_comment['article_editor'] . "[/i]" . "\n\n"; --- 1753,1766 ---- $message = "[b]" . $lang['Article_title'] . ":[/b] " . preg_replace( $search, $replace, $kb_comment['article_title'] ) . "\n"; $message .= "[b]" . $lang['Author'] . ":[/b] " . $kb_comment['article_author'] . "\n"; ! $message .= "[b]" . $lang['Article_description'] . ":[/b] [i]" . preg_replace( $search, $replace, $kb_comment['article_desc'] ) . "[/i]\n\n"; $message .= "[b]" . $lang['Category'] . ":[/b] " . $kb_comment['category_name'] . "\n"; ! $message .= "[b]" . $lang['Article_type'] . ":[/b] " . $kb_comment['article_type'] . "\n"; ! ! $message .= $kb_custom_field->add_comment( $kb_comment['article_id'] ); ! ! $message .= "\n\n[b][url=" . $temp_url . "]" . $lang['Read_full_article'] . "[/url][/b]"; ! $message_update_text = "[i]" . $lang['Edited_Article_info'] . $kb_comment['article_editor'] . "[/i]" . "\n\n"; *************** *** 1815,1818 **** --- 1835,1843 ---- global $news_type_select_data, $kb_type_select_data, $kb_config; + if ( !MXBB_MODULE ) + { + return true; + } + $tmp_kb = $kb_type_select_data[$cat_id]['forum_news'] == 1; $tmp_news = true; *************** *** 1829,1832 **** --- 1854,1863 ---- { global $news_type_select_data, $kb_config; + + if ( !MXBB_MODULE ) + { + return true; + } + $item_types_array = kb_get_types(); $validated_types = array(); --- NEW FILE: functions_kb_field.php --- <?php /** * functions_field.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: functions_kb_field.php,v 1.1 2005/03/28 20:22:47 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. */ // PLEASE DON'T TAKE THIS CLASS AND USE IT, I WILL KEEP MY EYES ON IT // I KNOW SOME PEOPLE MAY TAKE IT AND USE IT TO DO CUSTOM FIELD FOR PROFILE // BUT I AM PLANNING TO MAKE THIS FEATURE VERY SOON /* - orig if ( !defined('IN_PHPBB') ) { die("Hacking attempt"); } */ // MX if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } class kb_custom_field { var $field_rowset = array(); var $field_data_rowset = array(); // =================================================== // prepare data // =================================================== function init() { global $db; $sql = "SELECT * FROM " . KB_CUSTOM_TABLE . " ORDER BY field_order ASC"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt Query Custom field', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $this->field_rowset[$row['custom_id']] = $row; } unset( $row ); $db->sql_freeresult( $result ); $sql = "SELECT * FROM " . KB_CUSTOM_DATA_TABLE; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Couldnt Query Custom field', '', __LINE__, __FILE__, $sql ); } while ( $row = $db->sql_fetchrow( $result ) ) { $this->field_data_rowset[$row['customdata_file']][$row['customdata_custom']] = $row; } unset( $row ); $db->sql_freeresult( $result ); } // =================================================== // check if there is a data in the database // =================================================== function field_data_exist() { if ( !empty( $this->field_data_rowset ) ) { return true; } return false; } function field_exist() { if ( !empty( $this->field_rowset ) ) { return true; } return false; } // =================================================== // display data in the comment // =================================================== function add_comment( $file_id ) { global $template; if ( $this->field_data_exist() ) { if ( isset( $this->field_data_rowset[$file_id] ) ) { $message = ''; foreach( $this->field_data_rowset[$file_id] as $field_id => $data ) { if ( !empty( $data['data'] ) ) { switch ( $this->field_rowset[$field_id]['field_type'] ) { case INPUT: case TEXTAREA: case RADIO: case SELECT: $field_data = $data['data']; break; case SELECT_MULTIPLE: case CHECKBOX: $field_data = @implode( ', ', unserialize( $data['data'] ) ); break; } $message .= "\n" . "[b]" . $this->field_rowset[$field_id]['custom_name'] . ":[/b] " . $field_data . "\n"; } else { global $db; $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete custom data', '', __LINE__, __FILE__, $sql ); } } } return $message; } else { return false; } } else { return false; } } // =================================================== // display data in the file page // =================================================== function display_data( $file_id ) { global $template; if ( $this->field_data_exist() ) { if ( isset( $this->field_data_rowset[$file_id] ) ) { foreach( $this->field_data_rowset[$file_id] as $field_id => $data ) { if ( !empty( $data['data'] ) ) { switch ( $this->field_rowset[$field_id]['field_type'] ) { case INPUT: case TEXTAREA: case RADIO: case SELECT: $field_data = $data['data']; break; case SELECT_MULTIPLE: case CHECKBOX: $field_data = @implode( ', ', unserialize( $data['data'] ) ); break; } $template->assign_block_vars( 'custom_field', array( 'CUSTOM_NAME' => $this->field_rowset[$field_id]['custom_name'], 'DATA' => $field_data ) ); } else { global $db; $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete custom data', '', __LINE__, __FILE__, $sql ); } } } } else { return false; } } else { return false; } } // =================================================== // display custom field and data in the add/edit page // =================================================== function display_edit( $file_id = false ) { global $template; $return = false; if ( $this->field_exist() ) { foreach( $this->field_rowset as $field_id => $field_data ) { switch ( $field_data['field_type'] ) { case INPUT: $this->display_edit_input( $file_id, $field_id, $field_data ); break; case TEXTAREA: $this->display_edit_textarea( $file_id, $field_id, $field_data ); break; case RADIO: $this->display_edit_radio( $file_id, $field_id, $field_data ); break; case SELECT: $this->display_edit_select( $file_id, $field_id, $field_data ); break; case SELECT_MULTIPLE: $this->display_edit_select_multiple( $file_id, $field_id, $field_data ); break; case CHECKBOX: $this->display_edit_checkbox( $file_id, $field_id, $field_data ); break; } $return = true; } } return $return; } function display_edit_input( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'input', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'], 'FIELD_VALUE' => ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : '' ) ); } function display_edit_textarea( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'textarea', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'], 'FIELD_VALUE' => ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : '' ) ); } function display_edit_radio( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'radio', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : array(); $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $template->assign_block_vars( 'radio.row', array( 'FIELD_VALUE' => $value, 'FIELD_SELECTED' => ( $data == $value ) ? ' checked="checked"' : '' ) ); } } } function display_edit_select( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'select', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? $this->field_data_rowset[$file_id][$field_id]['data'] : ''; $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $template->assign_block_vars( 'select.row', array( 'FIELD_VALUE' => $value, 'FIELD_SELECTED' => ( $data == $value ) ? ' selected="selected"' : '' ) ); } } } function display_edit_select_multiple( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'select_multiple', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $selected = ''; foreach( $data as $field_value ) { if ( $field_value == $value ) { $selected = ' selected="selected"'; break; } } $template->assign_block_vars( 'select_multiple.row', array( 'FIELD_VALUE' => $value, 'FIELD_SELECTED' => $selected ) ); } } } function display_edit_checkbox( $file_id, $field_id, $field_data ) { global $template; $template->assign_block_vars( 'checkbox', array( 'FIELD_NAME' => $field_data['custom_name'], 'FIELD_ID' => $field_data['custom_id'], 'FIELD_DESCRIPTION' => $field_data['custom_description'] ) ); $data = ( !empty( $this->field_data_rowset[$file_id][$field_id]['data'] ) ) ? unserialize( $this->field_data_rowset[$file_id][$field_id]['data'] ) : array(); $field_datas = ( !empty( $field_data['data'] ) ) ? unserialize( stripslashes( $field_data['data'] ) ) : array(); if ( !empty( $field_datas ) ) { foreach( $field_datas as $key => $value ) { $checked = ''; foreach( $data as $field_value ) { if ( $field_value == $value ) { $checked = ' checked'; break; } } $template->assign_block_vars( 'checkbox.row', array( 'FIELD_VALUE' => $value, 'FIELD_CHECKED' => $checked ) ); } } } function update_add_field( $field_type, $field_id = false ) { global $db, $db, $_POST, $lang; $field_name = ( isset( $_POST['field_name'] ) ) ? htmlspecialchars( $_POST['field_name'] ) : ''; $field_desc = ( isset( $_POST['field_desc'] ) ) ? htmlspecialchars( $_POST['field_desc'] ) : ''; $regex = ( isset( $_POST['regex'] ) ) ? $_POST['regex'] : ''; $data = ( isset( $_POST['data'] ) ) ? $_POST['data'] : ''; $field_order = ( isset( $_POST['field_order'] ) ) ? $_POST['field_order'] : ''; if ( $field_id ) { $field_order = ( isset( $_POST['field_order'] ) ) ? intval( $_POST['field_order'] ) : ''; } if ( !empty( $data ) ) { $data = explode( "\n", htmlspecialchars( trim( $data ) ) ); foreach( $data as $key => $value ) { $data[$key] = trim( $value ); } $data = addslashes( serialize( $data ) ); } if ( empty( $field_name ) ) { mx_message_die( GENERAL_ERROR, $lang['Missing_field'] ); } if ( ( ( $field_type != INPUT && $field_type != TEXTAREA ) && empty( $data ) ) ) { mx_message_die( GENERAL_ERROR, $lang['Missing_field'] ); } if ( !$field_id ) { $sql = "INSERT INTO " . KB_CUSTOM_TABLE . " (custom_name, custom_description, data, regex, field_type) VALUES('" . $field_name . "', '" . $field_desc . "', '" . $data . "', '" . $regex . "', '" . $field_type . "')"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not add the new fields', '', __LINE__, __FILE__, $sql ); } $field_id = $db->sql_nextid(); $sql = "UPDATE " . KB_CUSTOM_TABLE . " SET field_order = '$field_id' WHERE custom_id = $field_id"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not set the order for the giving field', '', __LINE__, __FILE__, $sql ); } } else { $sql = "UPDATE " . KB_CUSTOM_TABLE . " SET custom_name = '$field_name', custom_description = '$field_desc', data = '$data', regex = '$regex', field_order='$field_order' WHERE custom_id = $field_id"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not update information for the giving field', '', __LINE__, __FILE__, $sql ); } } } function delete_field( $field_id ) { global $db; $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_custom = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete custom data', '', __LINE__, __FILE__, $sql ); } $sql = "DELETE FROM " . KB_CUSTOM_TABLE . " WHERE custom_id = '$field_id'"; if ( !( $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete the selected field', '', __LINE__, __FILE__, $sql ); } } function get_field_data( $field_id ) { $return_array = $this->field_rowset[$field_id]; $return_array['data'] = implode( "\n", unserialize( stripslashes( $return_array['data'] ) ) ); return $return_array; } // =================================================== // file data in custom field operations // =================================================== function file_update_data( $file_id ) { global $_POST, $db; $field = ( isset( $_POST['field'] ) ) ? $_POST['field'] : ''; if ( !empty( $field ) ) { foreach( $field as $field_id => $field_data ) { if ( !empty( $this->field_rowset[$field_id]['regex'] ) ) { if ( !preg_match( '#' . $this->field_rowset[$field_id]['regex'] . '#siU', $field_data ) ) { $field_data = ''; } } switch ( $this->field_rowset[$field_id]['field_type'] ) { case INPUT: case TEXTAREA: case RADIO: case SELECT: $data = htmlspecialchars( $field_data ); break; case SELECT_MULTIPLE: case CHECKBOX: $data = addslashes( serialize( $field_data ) ); break; } $sql = "DELETE FROM " . KB_CUSTOM_DATA_TABLE . " WHERE customdata_file = '$file_id' AND customdata_custom = '$field_id'"; if ( !$db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not delete data from custom data table', '', __LINE__, __FILE__, $sql ); } if ( !empty( $data ) ) { $sql = "INSERT INTO " . KB_CUSTOM_DATA_TABLE . " (customdata_file, customdata_custom, data) VALUES('$file_id', '$field_id', '$data')"; if ( !$db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, 'Could not add additional data', '', __LINE__, __FILE__, $sql ); } } } } } } ?> Index: kb_post.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_post.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_post.php 26 Mar 2005 22:52:36 -0000 1.1 --- kb_post.php 28 Mar 2005 20:22:47 -0000 1.2 *************** *** 131,135 **** // Get old data first ! $sql = "SELECT article_category_id, approved, topic_id FROM " . KB_ARTICLES_TABLE . " WHERE article_id = $article_id"; --- 131,135 ---- // Get old data first ! $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = $article_id"; *************** *** 195,199 **** } ! mx_remove_search_words( $article_id, 'kb' ); break; --- 195,199 ---- } ! mx_remove_search_post( $article_id, 'kb' ); break; *************** *** 225,228 **** --- 225,240 ---- } + // Get old data first + $sql = "SELECT * + FROM " . KB_ARTICLES_TABLE . " + WHERE article_date = $date"; + + if ( !( $result = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); + } + $row = $db->sql_fetchrow( $result ); + $article_id = $row['article_id']; + break; } *************** *** 249,253 **** // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " --- 261,265 ---- // 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 ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " *************** *** 260,263 **** --- 272,277 ---- } + $kb_custom_field->file_update_data( $article_id ); + if ( $approve == 1 ) { *************** *** 442,445 **** --- 456,463 ---- } + if ( $bbcode_on ) + { + $template->assign_block_vars( "switch_bbcodes", array() ); + } // load header include ( $module_root_path . "includes/kb_header." . $phpEx ); *************** *** 454,457 **** --- 472,483 ---- $kb_action_url = $kb_post_mode == 'add' ? this_kb_mxurl( 'mode=add' ) : this_kb_mxurl( 'mode=edit' ); + $custom_data = $kb_post_mode == 'add' ? $kb_custom_field->display_edit() : $kb_custom_field->display_edit( $article_id ); + + if ( $custom_data ) + { + $template->assign_block_vars( 'custom_data_fields', array( + 'L_ADDTIONAL_FIELD' => $lang['Addtional_field'] + ) ); + } $template->assign_vars( array( *************** *** 472,476 **** 'L_SUBMIT' => $lang['Submit'], 'L_PREVIEW' => $lang['Preview'], ! 'L_SELECT' => $lang['Select'], 'L_NAME' => $lang['Username'], --- 498,502 ---- 'L_SUBMIT' => $lang['Submit'], 'L_PREVIEW' => $lang['Preview'], ! 'L_SELECT_TYPE' => $lang['Select'], 'L_NAME' => $lang['Username'], *************** *** 540,544 **** 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], ! 'L_STYLES_TIP' => $lang['Styles_tip'] ) ); --- 566,571 ---- 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], ! 'L_STYLES_TIP' => $lang['Styles_tip'] ! ) ); *************** *** 548,551 **** 'CAT_LIST' => get_kb_cat_list( $category_id, 1, true ) ) ); - ?> \ No newline at end of file --- 575,577 ---- Index: kb_moderator.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_moderator.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** kb_moderator.php 26 Mar 2005 22:52:36 -0000 1.5 --- kb_moderator.php 28 Mar 2005 20:22:47 -0000 1.6 *************** *** 28,34 **** $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval ( $HTTP_GET_VARS['cat']) : intval ( $HTTP_POST_VARS['cat'] ); - $page_id = ( isset( $HTTP_GET_VARS['page'] ) ) ? intval ( $HTTP_GET_VARS['page']) : intval ( $HTTP_POST_VARS['page'] ); - $ref_stats = ( isset( $HTTP_GET_VARS['ref'] ) ) ? true : 0; --- 28,32 ---- *************** *** 41,45 **** // ! if ( !$kb_is_auth['auth_mod'] ) { $message = $lang['No_add'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); --- 39,43 ---- // ! if ( !($kb_is_auth['auth_mod'] && $userdata['session_logged_in']) ) { $message = $lang['No_add'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); *************** *** 103,107 **** // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $topic_sql = ", topic_id = " . $topic_data['topic_id']; --- 101,105 ---- // 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']; *************** *** 122,126 **** 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( $mx_root_path . "index.$phpEx?page=$page_id&mode=cat&cat=$category_id" ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); --- 120,124 ---- 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( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id" ) ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); *************** *** 152,158 **** update_kb_number( $article_category_id, '- 1' ); ! mx_remove_search_words( $article_id, 'kb' ); ! $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx?page=$page_id&mode=cat&cat=$category_id" ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); --- 150,156 ---- update_kb_number( $article_category_id, '- 1' ); ! mx_remove_search_post( $article_id, 'kb' ); ! $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl( "page=$page_id&mode=cat&cat=$category_id") ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); *************** *** 312,318 **** } ! mx_remove_search_words( $article_id, 'kb' ); ! $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx?page=$page_id&mode=cat&cat=$category_id" ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); --- 310,316 ---- } ! mx_remove_search_post( $article_id, 'kb' ); ! $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( this_kb_mxurl("page=$page_id&mode=cat&cat=$category_id") ) . '">', '</a>' ) ; mx_message_die( GENERAL_MESSAGE, $message ); |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:23:04
|
Update of /cvsroot/mxbb/mx_kb/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20851/modules/mx_kb/templates/subSilver Modified Files: kb_article_body.tpl kb_article_body_print.tpl kb_cat_body.tpl kb_post_body.tpl kb_stats_body.tpl Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support - adding custom fields - making it compatible with phpBB mod Index: kb_cat_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_kb/templates/subSilver/kb_cat_body.tpl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** kb_cat_body.tpl 1 Feb 2005 20:45:59 -0000 1.7 --- kb_cat_body.tpl 28 Mar 2005 20:22:49 -0000 1.8 *************** *** 35,44 **** <!-- BEGIN articlerow --> <tr> ! <td class="row1" height="50">{articlerow.ARTICLE}<br /><span class="genmed">{articlerow.ARTICLE_DESCRIPTION} <br />{articlerow.U_APPROVE} {articlerow.U_DELETE}</span></td> ! <td class="row1" align="center" valign="middle"> <span class="genmed">{articlerow.ARTICLE_TYPE}</span> </td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ARTICLE_AUTHOR}</span></td> ! <td class="row1" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{articlerow.ARTICLE_DATE}</span></td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ART_VIEWS}</span></td> </tr> <!-- END articlerow --> <!-- BEGIN no_articles --> --- 35,48 ---- <!-- BEGIN articlerow --> <tr> ! <td class="row2" align="left" valign="middle">{articlerow.ARTICLE}</td> ! <td class="row2" align="center" valign="middle"> <span class="genmed">{articlerow.ARTICLE_TYPE}</span> </td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ARTICLE_AUTHOR}</span></td> ! <td class="row2" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{articlerow.ARTICLE_DATE}</span></td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ART_VIEWS}</span></td> </tr> + <tr> + <td class="row1" align="left" colspan="3"><span class="genmed">{articlerow.ARTICLE_DESCRIPTION}</span></td> + <td class="row1" align="right" colspan="2" >{articlerow.U_APPROVE} {articlerow.U_DELETE}</td> + </tr> <!-- END articlerow --> <!-- BEGIN no_articles --> *************** *** 56,60 **** <td valign="top" align="left" ><span class="nav">{PAGE_NUMBER}</span></td> <td valign="top" align="left" ><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span></td> ! <td valign="top" align="right" >{S_AUTH_LIST}</td> </tr> </table> --- 60,64 ---- <td valign="top" align="left" ><span class="nav">{PAGE_NUMBER}</span></td> <td valign="top" align="left" ><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span></td> ! <td valign="top" align="right" ><span class="gensmall">{S_AUTH_LIST}</span></td> </tr> </table> Index: kb_stats_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_kb/templates/subSilver/kb_stats_body.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** kb_stats_body.tpl 1 Feb 2005 20:46:01 -0000 1.3 --- kb_stats_body.tpl 28 Mar 2005 20:22:49 -0000 1.4 *************** *** 36,46 **** <!-- BEGIN articlerow --> <tr> ! <td class="row1" height="50">{articlerow.ARTICLE}<br /><span class="genmed">{articlerow.ARTICLE_DESCRIPTION} <br />{articlerow.U_APPROVE} {articlerow.U_DELETE}</span></td> ! <td class="row1" align="center" valign="middle"> <span class="genmed">{articlerow.CATEGORY}</span> </td> ! <td class="row1" align="center" valign="middle"> <span class="genmed">{articlerow.ARTICLE_TYPE}</span> </td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ARTICLE_AUTHOR}</span></td> ! <td class="row1" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{articlerow.ARTICLE_DATE}</span></td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ART_VIEWS}</span></td> </tr> <!-- END articlerow --> <!-- BEGIN no_articles --> --- 36,50 ---- <!-- BEGIN articlerow --> <tr> ! <td class="row2" align="left" valign="middle">{articlerow.ARTICLE}</td> ! <td class="row2" align="center" valign="middle"> <span class="genmed">{articlerow.CATEGORY}</span> </td> ! <td class="row2" align="center" valign="middle"> <span class="genmed">{articlerow.ARTICLE_TYPE}</span> </td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ARTICLE_AUTHOR}</span></td> ! <td class="row2" align="center" valign="middle" nowrap="nowrap"><span class="gensmall">{articlerow.ARTICLE_DATE}</span></td> <td class="row2" align="center" valign="middle"><span class="genmed">{articlerow.ART_VIEWS}</span></td> </tr> + <tr> + <td class="row1" align="left" colspan="4"><span class="genmed">{articlerow.ARTICLE_DESCRIPTION}</span></td> + <td class="row1" align="right" colspan="2" >{articlerow.U_APPROVE} {articlerow.U_DELETE}</td> + </tr> <!-- END articlerow --> <!-- BEGIN no_articles --> Index: kb_article_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_kb/templates/subSilver/kb_article_body.tpl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** kb_article_body.tpl 1 Feb 2005 20:45:58 -0000 1.10 --- kb_article_body.tpl 28 Mar 2005 20:22:48 -0000 1.11 *************** *** 18,37 **** <tr> <td class="row2"><hr> ! <span class="gen"><b>{L_ARTICLE_AUTHOR}</b></span> <span class="gen">{ARTICLE_AUTHOR}</span> ! <span class="gen"><b>{L_ARTICLE_DATE}</b></span> <span class="gen">{ARTICLE_DATE}</span> ! <span class="gen">{VIEWS}<br /></span> ! <span class="gen"><b>{L_ARTICLE_DESCRIPTION}</b></span> <span class="gen">{ARTICLE_DESCRIPTION}<br /></span> ! <span class="gen"><b>{L_ARTICLE_KEYWORDS}</b></span> <span class="gen">{ARTICLE_KEYWORDS}</span> ! <span class="gen"><b>{L_ARTICLE_CATEGORY}</b></span> <span class="gen">{ARTICLE_CATEGORY}</span> ! <span class="gen"><b>{L_ARTICLE_TYPE}</b></span> <span class="gen">{ARTICLE_TYPE}<br /></span> ! <!-- BEGIN switch_comments --> ! <span class="gen"><br />{COMMENTS} {COMMENTS_IMG}</span> <!-- END switch_comments --> <!-- BEGIN switch_ratings --> ! <span class="gen"><br />{RATINGS} {RATE_IMG}</span> <!-- END switch_ratings --> <hr></td> </tr> <tr> <td class="row1" wrap="wrap"> --- 18,45 ---- <tr> <td class="row2"><hr> ! <span class="gensmall"><b>{L_ARTICLE_AUTHOR}</b></span> <span class="gen">{ARTICLE_AUTHOR}</span> ! <span class="gensmall"><b>{L_ARTICLE_DATE}</b></span> <span class="gen">{ARTICLE_DATE}</span> ! <span class="gensmall">{VIEWS}<br /></span> ! <span class="gensmall"><b>{L_ARTICLE_DESCRIPTION}</b></span> <span class="gen">{ARTICLE_DESCRIPTION}<br /></span> ! <span class="gensmall"><b>{L_ARTICLE_KEYWORDS}</b></span> <span class="gen">{ARTICLE_KEYWORDS}</span> ! <span class="gensmall"><b>{L_ARTICLE_CATEGORY}</b></span> <span class="gen">{ARTICLE_CATEGORY}</span> ! <span class="gensmall"><b>{L_ARTICLE_TYPE}</b></span> <span class="gen">{ARTICLE_TYPE}</span> ! ! <!-- BEGIN custom_field --> ! <span class="gensmall"><br /><b>{custom_field.CUSTOM_NAME}</b> </span> <span class="gen">{custom_field.DATA} </span> ! <!-- END custom_field --> ! <hr> <!-- BEGIN switch_comments --> ! <span class="gensmall">{COMMENTS} </span> <span class="gen">{COMMENTS_IMG}<br /></span> <!-- END switch_comments --> <!-- BEGIN switch_ratings --> ! <span class="gensmall">{RATINGS} </span> <span class="gen">{RATE_IMG}</span> <!-- END switch_ratings --> + + + <hr></td> </tr> + <tr> <td class="row1" wrap="wrap"> *************** *** 112,116 **** <!-- END switch_ratings --> </td> ! <td valign="top" align="right">{S_AUTH_LIST}</td> </tr> </table> --- 120,124 ---- <!-- END switch_ratings --> </td> ! <td valign="top" align="right"><span class="gensmall">{S_AUTH_LIST}</span></td> </tr> </table> Index: kb_article_body_print.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_kb/templates/subSilver/kb_article_body_print.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** kb_article_body_print.tpl 9 Jan 2005 21:40:39 -0000 1.2 --- kb_article_body_print.tpl 28 Mar 2005 20:22:49 -0000 1.3 *************** *** 19,30 **** <span class="gensmall"><b>{L_ARTICLE_DATE}</b></span> <span class="gensmall">{ARTICLE_DATE}</span> <span class="gensmall">{VIEWS}</span><br /> <span class="gensmall"><b>{L_ARTICLE_KEYWORDS}</b></span> <span class="gensmall">{ARTICLE_KEYWORDS}</span><br /> ! <span class="gensmall"><b>{L_ARTICLE_DESCRIPTION}</b> </span><span class="gensmall">{ARTICLE_DESCRIPTION}</span><br /> ! <!-- BEGIN switch_comments --> ! <span class="gensmall">{COMMENTS}</span><br /> <!-- END switch_comments --> <!-- BEGIN switch_ratings --> ! <span class="gensmall">{RATINGS}</span><br /> <!-- END switch_ratings --> </td> --- 19,35 ---- <span class="gensmall"><b>{L_ARTICLE_DATE}</b></span> <span class="gensmall">{ARTICLE_DATE}</span> <span class="gensmall">{VIEWS}</span><br /> + <span class="gensmall"><b>{L_ARTICLE_KEYWORDS}</b></span> <span class="gensmall">{ARTICLE_KEYWORDS}</span><br /> ! <span class="gensmall"><b>{L_ARTICLE_DESCRIPTION}</b> </span><span class="gensmall">{ARTICLE_DESCRIPTION}</span> ! ! <!-- BEGIN custom_field --> ! <span class="gensmall"><br /><b>{custom_field.CUSTOM_NAME}</b> </span> <span class="gen">{custom_field.DATA} </span> ! <!-- END custom_field --> ! <br /> <!-- BEGIN switch_comments --> ! <span class="gensmall"><br />{COMMENTS}</span> <!-- END switch_comments --> <!-- BEGIN switch_ratings --> ! <span class="gensmall"><br />{RATINGS}</span> <!-- END switch_ratings --> </td> Index: kb_post_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_kb/templates/subSilver/kb_post_body.tpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** kb_post_body.tpl 26 Mar 2005 22:52:38 -0000 1.1 --- kb_post_body.tpl 28 Mar 2005 20:22:49 -0000 1.2 *************** *** 284,287 **** --- 284,358 ---- <input type="text" name="article_desc" size="45" maxlength="255" style="width:450px" class="post" value="{ARTICLE_DESC}" /></span></td> </tr> + <!-- BEGIN custom_data_fields --> + <tr> + <td class="cat" colspan="2" align="center"><span class="cattitle">{custom_data_fields.L_ADDTIONAL_FIELD}</span></td> + </tr> + <!-- END custom_data_fields --> + + <!-- BEGIN input --> + <tr> + <td class="row1"><span class="genmed">{input.FIELD_NAME}</span><br><span class="gensmall">{input.FIELD_DESCRIPTION}</span></td> + <td class="row2"> + <input type="text" class="post" size="50" name="field[{input.FIELD_ID}]" value="{input.FIELD_VALUE}" /> + </td> + </tr> + <!-- END input --> + <!-- SPILT --> + <!-- BEGIN textarea --> + <tr> + <td class="row1"><span class="genmed">{textarea.FIELD_NAME}</span><br><span class="gensmall">{textarea.FIELD_DESCRIPTION}</span></td> + <td class="row2"> + <textarea rows="6" class="post" name="field[{textarea.FIELD_ID}]" cols="32">{textarea.FIELD_VALUE}</textarea> + </td> + </tr> + <!-- END textarea --> + <!-- SPILT --> + <!-- BEGIN radio --> + <tr> + <td class="row1"><span class="genmed">{radio.FIELD_NAME}</span><br><span class="gensmall">{radio.FIELD_DESCRIPTION}</span></td> + <td class="row2"> + <!-- BEGIN row --> + <input type="radio" name="field[{radio.FIELD_ID}]" value="{radio.row.FIELD_VALUE}" {radio.row.FIELD_SELECTED} /><span class="gensmall">{radio.row.FIELD_VALUE}</span> + <!-- END row --> + </td> + </tr> + <!-- END radio --> + <!-- SPILT --> + <!-- BEGIN select --> + <tr> + <td class="row1"><span class="genmed">{select.FIELD_NAME}</span><br><span class="gensmall">{select.FIELD_DESCRIPTION}</span></td> + <td class="row2"> + <select name="field[{select.FIELD_ID}]" class="post"> + <!-- BEGIN row --> + <option value="{select.row.FIELD_VALUE}"{radio.row.FIELD_SELECTED}>{select.row.FIELD_VALUE}</option> + <!-- END row --> + </select> + </td> + </tr> + <!-- END select --> + <!-- SPILT --> + <!-- BEGIN select_multiple --> + <tr> + <td class="row1"><span class="genmed">{select_multiple.FIELD_NAME}</span><br><span class="gensmall">{select_multiple.FIELD_DESCRIPTION}</span></td> + <td class="row2"> + <select name="field[{select_multiple.FIELD_ID}][]" multiple="multiple" size="4" class="post"> + <!-- BEGIN row --> + <option value="{select_multiple.row.FIELD_VALUE}"{select_multiple.row.FIELD_SELECTED}>{select_multiple.row.FIELD_VALUE}</option> + <!-- END row --> + </select> + </td> + </tr> + <!-- END select_multiple --> + <!-- SPILT --> + <!-- BEGIN checkbox --> + <tr> + <td class="row1"><span class="genmed">{checkbox.FIELD_NAME}</span><br><span class="gensmall">{checkbox.FIELD_DESCRIPTION}</span></td> + <td class="row2"> + <!-- BEGIN row --> + <input type="checkbox" name="field[{checkbox.FIELD_ID}][{checkbox.row.FIELD_VALUE}]" value="{checkbox.row.FIELD_VALUE}" {checkbox.row.FIELD_CHECKED}><span class="gensmall">{checkbox.row.FIELD_VALUE}</span> + <!-- END row --> + </td> + </tr> + <!-- END checkbox --> <tr> <td class="row1" valign="top"><span class="gen"><b><nobr>{L_ARTICLE_TEXT}</nobr></b><br /><br /> *************** *** 305,314 **** <br /><br /><span class="gen"><b><nobr>{L_OPTIONS}</nobr></b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span><br /><br /> </td> ! <td class="row2"> ! <table width="450" border="0" cellspacing="0" cellpadding="2"> ! <tr> ! <td> ! <table width="450" border="0" cellspacing="0" cellpadding="2"> ! <tr align="center" valign="middle"> <td><span class="genmed"> <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" /> --- 376,383 ---- <br /><br /><span class="gen"><b><nobr>{L_OPTIONS}</nobr></b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span><br /><br /> </td> ! <td class="row2" valign="top"><span class="gen"> ! <table width="450" border="0" cellspacing="0" cellpadding="2"> ! <!-- BEGIN switch_bbcodes --> ! <tr align="center" valign="middle"> <td><span class="genmed"> <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" /> *************** *** 338,347 **** <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" /> </span></td> ! </tr> ! <tr> <td colspan="9"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> ! <tr> ! <td><span class="genmed"> {L_FONT_COLOR}: <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')"> <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option> --- 407,416 ---- <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" /> </span></td> ! </tr> ! <tr> <td colspan="9"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> ! <tr> ! <td><span class="genmed"> {L_FONT_COLOR}: <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')"> <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option> *************** *** 367,385 **** <option value="24" class="genmed">{L_FONT_HUGE}</option> </select> ! </span></td> ! <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td> ! </tr> ! </table> ! </td> </tr> ! </table> <tr> ! <td colspan="9"> <span class="gensmall"> <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" /> ! </span></td> </tr> <tr> ! <td><span class="gen"><textarea name="message" rows="30" cols="35" wrap="virtual" style="width:450px" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{ARTICLE_BODY}</textarea></span> <!-- BEGIN formatting --> <br /><span class="gen"><b><nobr>{L_FORMATTING}</nobr></b></span><hr><span class="gensmall"><b>{L_PAGES}</b><br />{L_PAGES_EXPLAIN}<br /><b>{L_TOC}</b><br />{L_TOC_EXPLAIN}<br /><b>{L_ABSTRACT}</b><br />{L_ABSTRACT_EXPLAIN}<br /><hr><b>{L_TITLE_FORMAT}</b><br />{L_TITLE_FORMAT_EXPLAIN}<br /><b>{L_SUBTITLE_FORMAT}</b><br />{L_SUBTITLE_FORMAT_EXPLAIN}<br /><b>{L_SUBSUBTITLE_FORMAT}</b><br />{L_SUBSUBTITLE_FORMAT_EXPLAIN}</span><br /><br /> --- 436,457 ---- <option value="24" class="genmed">{L_FONT_HUGE}</option> </select> ! </span> ! </td> ! <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td> ! </tr> ! </table> ! </td> </tr> ! <tr> ! <td colspan="9"> <span class="gensmall"> <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" /> ! </span> ! </td> </tr> + <!-- END switch_bbcodes --> <tr> ! <td colspan="9"><span class="gen"><textarea name="message" rows="30" cols="35" wrap="virtual" style="width:450px" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{ARTICLE_BODY}</textarea></span> <!-- BEGIN formatting --> <br /><span class="gen"><b><nobr>{L_FORMATTING}</nobr></b></span><hr><span class="gensmall"><b>{L_PAGES}</b><br />{L_PAGES_EXPLAIN}<br /><b>{L_TOC}</b><br />{L_TOC_EXPLAIN}<br /><b>{L_ABSTRACT}</b><br />{L_ABSTRACT_EXPLAIN}<br /><hr><b>{L_TITLE_FORMAT}</b><br />{L_TITLE_FORMAT_EXPLAIN}<br /><b>{L_SUBTITLE_FORMAT}</b><br />{L_SUBTITLE_FORMAT_EXPLAIN}<br /><b>{L_SUBSUBTITLE_FORMAT}</b><br />{L_SUBSUBTITLE_FORMAT_EXPLAIN}</span><br /><br /> *************** *** 387,399 **** </td> </tr> ! </table> ! </td> ! </td> </tr> <tr> <td class="row1" valign="top"><span class="gen"><b><nobr>{L_ARTICLE_TYPE}</nobr></b></span></td> <td class="row2"><span class="gen"> <select name="type_id"> ! <option value="select_one">{L_SELECT}</option> <!-- BEGIN types --> {types.TYPE} --- 459,472 ---- </td> </tr> ! ! </table> ! </span></td> </tr> + <tr> <td class="row1" valign="top"><span class="gen"><b><nobr>{L_ARTICLE_TYPE}</nobr></b></span></td> <td class="row2"><span class="gen"> <select name="type_id"> ! <option value="select_one">{L_SELECT_TYPE}</option> <!-- BEGIN types --> {types.TYPE} |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:23:02
|
Update of /cvsroot/mxbb/mx_kb/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20851/modules/mx_kb/templates/subSilver/admin Modified Files: kb_config_body.tpl Added Files: kb_field_add.tpl kb_select.tpl kb_select_field_delete.tpl kb_select_field_edit.tpl kb_select_field_type.tpl kb_type_edit_body.tpl Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support - adding custom fields - making it compatible with phpBB mod --- NEW FILE: kb_field_add.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <!-- IF ERROR neq '' --> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <td class="row2" align="center">{ERROR}</td> </tr> </table> <br /> <!-- ENDIF --> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th colspan="2" class="thHead">{L_FIELD_TITLE}</th> </tr> <tr> <td width="50%" class="row1">{L_FIELD_NAME}<br><span class="gensmall">{L_FIELD_NAME_INFO}</span></td> <td class="row2"><input type="text" class="post" size="50" name="field_name" value="{FIELD_NAME}" /></td> </tr> <tr> <td class="row1">{L_FIELD_DESC}<br><span class="gensmall">{L_FIELD_DESC_INFO}</span></td> <td class="row2"><input type="text" class="post" size="50" name="field_desc" value="{FIELD_DESC}" /></td> </tr> <!-- IF DATA --> <tr> <td class="row1">{L_FIELD_DATA}<br><span class="gensmall">{L_FIELD_DATA_INFO}</span></td> <td class="row2"><textarea rows="6" name="data" cols="32">{FIELD_DATA}</textarea></td> </tr> <!-- ENDIF --> <!-- IF REGEX --> <tr> <td class="row1">{L_FIELD_REGEX}<br><span class="gensmall">{L_FIELD_REGEX_INFO}</span></td> <td class="row2"><input type="text" class="post" size="50" name="regex" value="{FIELD_REGEX}" /></td> </tr> <!-- ENDIF --> <!-- IF ORDER --> <tr> <td width="50%" class="row1">{L_FIELD_ORDER}</td> <td class="row2"><input type="text" class="post" size="6" name="field_order" value="{FIELD_ORDER}" /></td> </tr> <!-- ENDIF --> <tr> <td align="center" class="cat" colspan="2"> {S_HIDDEN_FIELDS}<input class="liteoption" type="submit" value="{L_FIELD_TITLE}" name="submit"> </td> </tr> </table> </form> Index: kb_config_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_kb/templates/subSilver/admin/kb_config_body.tpl,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** kb_config_body.tpl 26 Mar 2005 22:52:37 -0000 1.9 --- kb_config_body.tpl 28 Mar 2005 20:22:48 -0000 1.10 *************** *** 13,34 **** <td class="row2" width="50%"><input type="radio" name="allow_new" value="1" {S_NEW_YES} /> {L_YES} <input type="radio" name="allow_new" value="0" {S_NEW_NO} /> {L_NO}</td> </tr> - <!-- - <tr> - <td class="row1" width="50%">{L_APPROVE_NEW_NAME}<br /><span class="gensmall">{L_APPROVE_NEW_EXPLAIN}</span></td> - <td class="row2" width="50%"><input type="radio" name="approve_new" value="1" {S_APPROVE_NEW_YES} /> {L_YES} <input type="radio" name="approve_new" value="0" {S_APPROVE_NEW_NO} /> {L_NO}</td> - </tr> - <tr> - <td class="row1" width="50%">{L_EDIT_NAME}<br /><span class="gensmall">{L_EDIT_EXPLAIN}</span></td> - <td class="row2" width="50%"><input type="radio" name="allow_edit" value="1" {S_EDIT_YES} /> {L_YES} <input type="radio" name="allow_edit" value="0" {S_EDIT_NO} /> {L_NO}</td> - </tr> - <tr> - <td class="row1" width="50%">{L_APPROVE_EDIT_NAME}<br /><span class="gensmall">{L_APPROVE_EDIT_EXPLAIN}</span></td> - <td class="row2" width="50%"><input type="radio" name="approve_edit" value="1" {S_APPROVE_EDIT_YES} /> {L_YES} <input type="radio" name="approve_edit" value="0" {S_APPROVE_EDIT_NO} /> {L_NO}</td> - </tr> - <tr> - <td class="row1" width="50%">{L_ANON_NAME}<br /><span class="gensmall">{L_ANON_EXPLAIN}</span></td> - <td class="row2" width="50%"><input type="radio" name="allow_anon" value="1" {S_ANON_YES} /> {L_YES} <input type="radio" name="allow_anon" value="0" {S_ANON_NO} /> {L_NO}</td> - </tr> - --> <tr> <td class="row1" width="50%">{L_NOTIFY_NAME}<br /><span class="gensmall">{L_NOTIFY_EXPLAIN}</span></td> --- 13,16 ---- *************** *** 39,48 **** <td class="row2" width="50%"><input class="post" type="text" name="admin_id" value="{ADMIN_ID}" size="5" maxlength="4" /></td> </tr> - <!-- - <tr> - <td class="row1" width="50%">{L_MOD_GROUP}<br /><span class="gensmall">{L_MOD_GROUP_EXPLAIN}</span></td> - <td class="row2" width="50%">{MOD_GROUP}</td> - </tr> - --> <tr> <td class="row1" width="50%">{L_HEADER_BANNER}<br /><span class="gensmall">{L_HEADER_BANNER_EXPLAIN}</span></td> --- 21,24 ---- *************** *** 62,70 **** </tr> <tr> ! <td class="row1" width="50%"><span class="gen">{L_NEWS_SORT}</span></td> <td class="row2" width="50%">{NEWS_SORT} </td> </tr> <tr> ! <td class="row1" width="50%"><span class="gen">{L_NEWS_SORT_PAR}</span></td> <td class="row2" width="50%">{NEWS_SORT_PAR} </td> </tr> --- 38,46 ---- </tr> <tr> ! <td class="row1" width="50%">{L_NEWS_SORT}</td> <td class="row2" width="50%">{NEWS_SORT} </td> </tr> <tr> ! <td class="row1" width="50%">{L_NEWS_SORT_PAR}</td> <td class="row2" width="50%">{NEWS_SORT_PAR} </td> </tr> *************** *** 79,83 **** <tr> <td class="row1" width="50%">{L_ALLOW_HTML}<br /><span class="gensmall">{L_ALLOW_HTML_EXPLAIN}</span></td> ! <td class="row2" width="50%"><input class="post" type="radio" name="allow_html" value="1" {S_ALLOW_HTML_YES} /> {L_YES} <input type="radio" name="allow_html" value="0" {S_ALLOW_HTML_NO} /> {L_NO}</td> </tr> <tr> --- 55,59 ---- <tr> <td class="row1" width="50%">{L_ALLOW_HTML}<br /><span class="gensmall">{L_ALLOW_HTML_EXPLAIN}</span></td> ! <td class="row2" width="50%"><input class="radio" type="radio" name="allow_html" value="1" {S_ALLOW_HTML_YES} /> {L_YES} <input type="radio" name="allow_html" value="0" {S_ALLOW_HTML_NO} /> {L_NO}</td> </tr> <tr> *************** *** 114,123 **** <td class="row2" width="50%"><input type="radio" name="bump_post" value="1" {S_BUMP_POST_YES} /> {L_YES} <input type="radio" name="bump_post" value="0" {S_BUMP_POST_NO} /> {L_NO}</td> </tr> - <!-- - <tr> - <td class="row1" width="50%">{L_FORUM_ID}<br /><span class="gensmall">{L_FORUM_ID_EXPLAIN}</span></td> - <td class="row2" width="50%">{FORUMS}</td> - </tr> - --> <tr> <td class="row1" width="50%">{L_DEL_TOPIC}<br /><span class="gensmall">{L_DEL_TOPIC_EXPLAIN}</span></td> --- 90,93 ---- *************** *** 132,141 **** <td class="row2" width="50%"><input type="radio" name="use_ratings" value="1" {S_USE_RATINGS_YES} /> {L_YES} <input type="radio" name="use_ratings" value="0" {S_USE_RATINGS_NO} /> {L_NO}</td> </tr> - <!-- - <tr> - <td class="row1" width="50%">{L_ALLOW_ANONYMOS_RATING}<br /><span class="gensmall">{L_ALLOW_ANONYMOS_RATING_EXPLAIN}</span></td> - <td class="row2" width="50%"><input type="radio" name="allow_anonymos_rating" value="1" {S_ALLOW_ANONYMOS_RATING_YES} /> {L_YES} <input type="radio" name="allow_anonymos_rating" value="0" {S_ALLOW_ANONYMOS_RATING_NO} /> {L_NO}</td> - </tr> - --> <tr> <td class="row1" width="50%">{L_VOTES_CHECK_IP}<br /><span class="gensmall">{L_VOTES_CHECK_IP_EXPLAIN}</span></td> --- 102,105 ---- --- NEW FILE: kb_select_field_edit.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th colspan="2" class="thHead">{L_FIELD_TITLE}</th> </tr> <!-- BEGIN field_row --> <tr> <td width="3%" class="row1" align="center" valign="middle"><input type="radio" name="field_id" value="{field_row.FIELD_ID}" /></td> <td width="97%" class="row1"><b>{field_row.FIELD_NAME}</b><br /><span class="gensmall">{field_row.FIELD_DESC}</span></td></tr> <!-- END field_row --> <td align="center" class="cat" colspan="2"> {S_HIDDEN_FIELDS}<input class="liteoption" type="submit" value="{L_FIELD_TITLE}" name="submit"> </td> </tr> </table> </form> --- NEW FILE: kb_select.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th class="thHead">{L_SELECT_TITLE}</b></th> </tr> <tr> <td align="center" class="row1" > <input class="liteoption" type="submit" value="add" name="mode"> <input class="liteoption" type="submit" value="edit" name="mode"> <input class="liteoption" type="submit" value="delete" name="mode"></td> </tr> <tr> <th class="thHead">{L_FIELD_TITLE}</b></th> </tr> <!-- BEGIN field_row --> <tr> <td width="97%" class="row1" align="center"><b>{field_row.FIELD_NAME}</b><br><span class="gensmall">{field_row.FIELD_DESC}</span></td> </tr> <!-- END field_row --> </table> </form> --- NEW FILE: kb_select_field_delete.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th colspan="2" class="thHead">{L_FIELD_TITLE}</b></th> </tr> <!-- BEGIN field_row --> <tr> <td width="3%" class="row1" align="center" valign="middle"><input type="checkbox" name="field_ids[{field_row.FIELD_ID}]" value="yes"></td> <td width="97%" class="row1"><b>{field_row.FIELD_NAME}</b><br><span class="gensmall">{field_row.FIELD_DESC}</span></td> </tr> <!-- END field_row --> <tr> <td align="center" class="cat" colspan="2">{S_HIDDEN_FIELDS}<input class="liteoption" type="submit" value="{L_FIELD_TITLE}" name="submit"></td> </tr> </table> </form> --- NEW FILE: kb_select_field_type.tpl --- <h1>{L_FIELD_TITLE}</h1> <p>{L_FIELD_EXPLAIN}</p> <form action="{S_FIELD_ACTION}" method="post"> <table width="100%" cellpadding="3" cellspacing="1" class="forumline"> <tr> <th colspan="2" class="thHead">{L_FIELD_TITLE}</th> </tr> <tr> <td class="row1" align="center"> {S_SELECT_FIELD_TYPE} </td> </tr> <tr> <td align="center" class="cat" colspan="2"> {S_HIDDEN_FIELDS}<input class="liteoption" type="submit" value="{L_FIELD_TITLE}" name="submit"> </td> </tr> </table> </form> --- NEW FILE: kb_type_edit_body.tpl --- <h1>{L_EDIT_TITLE}</h1> <p>{L_EDIT_DESCRIPTION}</p> <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> <form action="{S_ACTION}" method="post"> <tr> <th class="thHead" colspan="2">{L_CAT_SETTINGS}</th> </tr> <tr> <td class="row1">{L_CATEGORY}</td> <td class="row2"><input class="post" type="text" size="25" name="catname" value="{CAT_NAME}" class="post" /></td> </tr> <!-- BEGIN switch_cat --> <tr> <td class="row1">{L_DESCRIPTION}</td> <td class="row2"><textarea rows="5" cols="45" wrap="virtual" name="catdesc" class="post">{CAT_DESCRIPTION}</textarea></td> </tr> <tr> <td class="row1">{L_PARENT}</td> <td class="row2"> <select name="parent"> <option value="0">{L_NONE}</otpion> {PARENT_LIST} </select> </tr> <tr> <td class="row1" width="50%">{L_FORUM_ID}<br /><span class="gensmall">{L_FORUM_ID_EXPLAIN}</span></td> <td class="row2" width="50%">{FORUM_LIST}</td> </tr> <!-- BEGIN switch_edit_category --> <tr> <td class="row1">{L_NUMBER_ARTICLES}</td> <td class="row2"><input class="post" type="text" size="4" maxlength="3" name="number_articles" value="{NUMBER_ARTICLES}" class="post" /></td> </tr> <!-- END switch_edit_category --> <!-- END switch_cat --> <tr> <td class="catBottom" colspan="2" align="center">{S_HIDDEN}<input type="submit" name="submit" value="{L_CREATE}" class="mainoption" /></td> </tr> </table> </form> <br clear="all" /> |
|
From: Jon O. <jon...@us...> - 2005-03-28 20:23:01
|
Update of /cvsroot/mxbb/mx_kb/language/lang_english In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20851/modules/mx_kb/language/lang_english Modified Files: lang_kb.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support - adding custom fields - making it compatible with phpBB mod Index: lang_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/language/lang_english/lang_kb.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** lang_kb.php 26 Mar 2005 22:52:36 -0000 1.14 --- lang_kb.php 28 Mar 2005 20:22:48 -0000 1.15 *************** *** 123,126 **** --- 123,127 ---- $lang['Forum_id_explain'] = 'This is the forum that the article\'s comments will be kept'; + // // Permissions *************** *** 139,143 **** $lang['Approval_edit'] = 'Approval Edit'; ! $lang['Allow_anonymos_rating'] = 'Allow anonymos ratings'; --- 140,145 ---- $lang['Approval_edit'] = 'Approval Edit'; ! $lang['Allow_rating'] = 'Allow ratings'; ! $lang['Allow_rating_explain'] = 'Users are allowed to rate articles.'; $lang['Allow_anonymos_rating'] = 'Allow anonymos ratings'; *************** *** 178,182 **** $lang['KB_Rules_moderate_can'] = 'You <b>can</b> moderate this category'; // %s replaced by a href links, do not remove! - //Added by Haplo $lang['Comments_show'] = 'Display article comments.'; $lang['Comments_show_explain'] = '- also displays comments in the article page'; --- 180,183 ---- *************** *** 311,316 **** $lang['News_update_error'] = "Couldn't update KB block configuration.<br /><br />This mod is designed for MySQL so please contact the author if you have troubles. If you can offer a translation of the SQL into other database formats, please send them to:<br />"; ! // kb $lang['Cat_all'] = "All"; --- 312,352 ---- $lang['News_update_error'] = "Couldn't update KB block configuration.<br /><br />This mod is designed for MySQL so please contact the author if you have troubles. If you can offer a translation of the SQL into other database formats, please send them to:<br />"; + // Custom Field + $lang['Fieldselecttitle'] = 'Select what to do'; + $lang['Afield'] = 'Custom Field: Add'; + $lang['Efield'] = 'Custom Field: Edit'; + $lang['Dfield'] = 'Custom Field: Delete'; + $lang['Mfieldtitle'] = 'Custom Fields'; + $lang['Afieldtitle'] = 'Add Field'; + $lang['Efieldtitle'] = 'Edit Field'; + $lang['Dfieldtitle'] = 'Delete Field'; + $lang['Fieldexplain'] = 'You can use the custom fields management section to add, edit, and delete custom fields. You can use custom fields to add more information about an article.'; + $lang['Fieldname'] = 'Field Name'; + $lang['Fieldnameinfo'] = 'This is the name of the field, for example \'File Size\''; + $lang['Fielddesc'] = 'Field Description'; + $lang['Fielddescinfo'] = 'This is a description of the field, for example \'File Size in Megabytes\''; + $lang['Fieldadded'] = 'The custom field has been successfully added'; + $lang['Fieldedited'] = 'The custom field you selected has been successfully edited'; + $lang['Dfielderror'] = 'You didn\'t select any fields to delete'; + $lang['Fieldsdel'] = 'The custom fields you selected have been successfully deleted'; + + $lang['Field_data'] = 'Options'; + $lang['Field_data_info'] = 'Enter the options that the user can choose from. Separate each option with a new-line (carriage return).'; + $lang['Field_regex'] = 'Regular Expression'; + $lang['Field_regex_info'] = 'You may require the input field to match a regular expression %s(PCRE)%s.'; + $lang['Field_order'] = 'Display Order'; ! //Fields Types ! ! $lang['Field_Input'] = 'Single-Line Text Box'; ! $lang['Field_Textarea'] = 'Multiple-Line Text Box'; ! $lang['Field_Radio'] = 'Single-Selection Radio Buttons'; ! $lang['Field_Select'] = 'Single-Selection Menu'; ! $lang['Field_Select_multiple'] = 'Multiple-Selection Menu'; ! $lang['Field_Checkbox'] = 'Multiple-Selection Checkbox'; ! ! $lang['Click_return'] = 'Click %sHere%s to return to the previous page'; ! ! // added $lang['Cat_all'] = "All"; *************** *** 336,339 **** --- 372,376 ---- $lang['Default_article_id'] = "Set default article, for the article viewer"; + // Added for v. 2.0 $lang['KB_comment_prefix'] = '[ KB ] '; *************** *** 347,350 **** --- 384,388 ---- $lang['Formatting_fixup_explain'] = 'I enabled, the article text is reformatted: wordwrapping, url truncates, img resizing, some bbcode reformatting etc'; + $lang['Addtional_field'] = 'More information (optional)'; ?> \ No newline at end of file |
|
From: Jon O. <jon...@us...> - 2005-03-26 22:54:30
|
Update of /cvsroot/mxbb/mx_kb/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26213/modules/mx_kb/templates/subSilver Removed Files: kb_add_body.tpl kb_add_pretext.tpl kb_add_preview.tpl Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support --- kb_add_preview.tpl DELETED --- --- kb_add_pretext.tpl DELETED --- --- kb_add_body.tpl DELETED --- |
|
From: Jon O. <jon...@us...> - 2005-03-26 22:53:15
|
Update of /cvsroot/mxbb/mx_kb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25039/modules/mx_kb Modified Files: db_install.php db_upgrade.php kb.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support Index: kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** kb.php 17 Mar 2005 12:37:24 -0000 1.13 --- kb.php 26 Mar 2005 22:52:35 -0000 1.14 *************** *** 131,161 **** include_once( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! // echo(var_export($_SESSION['newssuite_'.$page_id]['testar'])); $show_new = true; - // options - if ( !$board_config['allow_html'] ) - { - $html_on = 0; - } - else - { - $html_on = ( $submit || $refresh ) ? ( ( !empty( $HTTP_POST_VARS['disable_html'] ) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] ); - } - if ( !$board_config['allow_bbcode'] ) - { - $bbcode_on = 0; - } - else - { - $bbcode_on = ( $submit || $refresh ) ? ( ( !empty( $HTTP_POST_VARS['disable_bbcode'] ) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_bbcode'] : $userdata['user_allowbbcode'] ); - } - if ( !$board_config['allow_smilies'] ) - { - $smilies_on = 0; - } - else - { - $smilies_on = ( $submit || $refresh ) ? ( ( !empty( $HTTP_POST_VARS['disable_smilies'] ) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_smilies'] : $userdata['user_allowsmile'] ); - } // page number --- 131,136 ---- include_once( $module_root_path . 'includes/functions_kb_auth.' . $phpEx ); include_once( $phpbb_root_path . 'includes/functions_search.' . $phpEx ); ! $show_new = true; // page number *************** *** 198,201 **** --- 173,197 ---- } } + + // options + $kb_wysiwyg = false; + if ( $kb_config['wysiwyg'] ) // Html Textblock + { + if ( file_exists( $mx_root_path . 'modules/tinymce/jscripts/tiny_mce/blank.htm' ) ) + { + $bbcode_on = false; + $html_on = true; + $smilies_on = false; + $kb_wysiwyg = true; + } + } + + if ( !$kb_wysiwyg ) + { + $bbcode_on = $kb_config['allow_bbcode'] ? true : false; + $html_on = $kb_config['allow_html'] ? true : false; + $smilies_on = $kb_config['allow_smilies'] ? true : false; + } + // Newssuite operation mode? //------------------------------------------------------------------------- *************** *** 250,254 **** else if ( $mode == 'add' ) { ! include( $module_root_path . 'includes/kb_add.' . $phpEx ); } else if ( $mode == 'search' ) --- 246,250 ---- else if ( $mode == 'add' ) { ! include( $module_root_path . 'includes/kb_post.' . $phpEx ); } else if ( $mode == 'search' ) *************** *** 258,262 **** else if ( $mode == 'edit' ) { ! include( $module_root_path . 'includes/kb_edit.' . $phpEx ); } else if ( $mode == 'rate' ) --- 254,258 ---- else if ( $mode == 'edit' ) { ! include( $module_root_path . 'includes/kb_post.' . $phpEx ); } else if ( $mode == 'rate' ) Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/db_install.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** db_install.php 6 Mar 2005 01:12:29 -0000 1.21 --- db_install.php 26 Mar 2005 22:52:35 -0000 1.22 *************** *** 145,148 **** --- 145,154 ---- "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('news_sort', 'Alphabetic')", "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('news_sort_par', 'ASC')", + // kb 2.0 + "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('wysiwyg', '0')", + "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allow_html', '1')", + "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allow_bbcode', '1')", + "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allow_smilies', '1')", + "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allowed_html_tags', 'b,i,u,a')", "CREATE TABLE " . $mx_table_prefix . "kb_types ( Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/db_upgrade.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** db_upgrade.php 18 Mar 2005 21:03:12 -0000 1.14 --- db_upgrade.php 26 Mar 2005 22:52:35 -0000 1.15 *************** *** 116,119 **** --- 116,132 ---- $message .= "<b>Validating v. 1.09...ok</b><br/><br/>"; } + // validate before 2.00 + $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "kb_config WHERE config_name = 'wysiwyg'" ); + if ( $db->sql_numrows( $result ) == 0 ) + { + $upgrade_200 = 1; + $message .= "<b>Validating v. 2.00...ok</b><br/><br/>"; + } + else + { + $message .= "<b>Validating v. 2.00...ok</b><br/><br/>"; + } + + // ------------------------------------------------------------------------------------------------------ if ( $upgrade_105 == 1 ) *************** *** 229,232 **** --- 242,254 ---- WHERE config_name = 'allow_rating'"; } + + if ( $upgrade_200 == 1 ) + { + $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('wysiwyg', '0')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allow_html', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allow_bbcode', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allow_smilies', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "kb_config VALUES ('allowed_html_tags', 'b,i,u,a')"; + } else { |
|
From: Jon O. <jon...@us...> - 2005-03-26 22:53:14
|
Update of /cvsroot/mxbb/mx_kb/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25039/modules/mx_kb/admin Modified Files: admin_kb_art.php admin_kb_config.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support Index: admin_kb_art.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_art.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** admin_kb_art.php 17 Mar 2005 12:37:24 -0000 1.12 --- admin_kb_art.php 26 Mar 2005 22:52:35 -0000 1.13 *************** *** 81,152 **** } switch ( $mode ) { case 'approve': ! ! $article_id = intval( $HTTP_GET_VARS['a'] ); ! $topic_sql = ''; if ( $kb_config['use_comments'] ) { - $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; - if ( !( $results = $db->sql_query( $sql ) ) ) - { - mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); - } - - $row = $db->sql_fetchrow( $results ); - if ( !$row['topic_id'] ) { ! // choose a user ! $user_id = $row['article_author_id']; ! // initialise the userdata ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = $user_id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( CRITICAL_ERROR, 'Could not obtain lastvisit data from user table', '', __LINE__, __FILE__, $sql ); ! } ! $user = $db->sql_fetchrow( $result ); ! init_userprefs( $user ); ! ! $kb_cat = get_kb_cat( $row['article_category_id'] ); ! $type = get_kb_type( $row['article_type'] ); ! $author = get_kb_author( $row['article_author_id'] ); ! ! $sql = "SELECT comments_forum_id FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $row['article_category_id'] . "'"; ! if ( !( $results = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not get comments_forum_id", '', __LINE__, __FILE__, $sql ); ! } ! $cat_row = $db->sql_fetchrow( $results ); ! $forum_id = $cat_row['comments_forum_id']; - $search = array ( "'&(quot|#34);'i", // Replace HTML entities - "'&(amp|#38);'i", - "'&(lt|#60);'i", - "'&(gt|#62);'i" - ); - $replace = array ( "\"", - "&", - "<", - ">" - ); - - $temp_url = PORTAL_URL . "modules/mx_kb/kb." . $phpEx . "?mode=article&k=" . $article_id; - $message = "[b]" . $lang['Category'] . ":[/b] " . $kb_cat['category_name'] . "\n"; - $message .= "[b]" . $lang['Article_type'] . ":[/b] " . $type . "\n\n"; - $message .= "[b]" . $lang['Article_title'] . ":[/b] " . preg_replace( $search, $replace, $row['article_title'] ) . "\n"; - $message .= "[b]" . $lang['Author'] . ":[/b] " . $author . "\n"; - $message .= "[b]" . $lang['Article_description'] . ":[/b] " . preg_replace( $search, $replace, $row['article_description'] ) . "\n\n"; - $message .= "[b][url=" . $temp_url . "]" . $lang['Read_full_article'] . "[/url][/b]"; - - $subject = '[ KB ] ' . $row['article_title']; - - $subject = str_replace( "'", "\'" , $subject ); - $message = str_replace( "'", "\'" , $message ); - - $topic_data = insert_post( $message, $subject, $forum_id, $user['user_id'], $user['username'], $user['user_attachsig'] ); $topic_sql = ", topic_id = " . $topic_data['topic_id']; } --- 81,119 ---- } + $article_id = intval( $HTTP_GET_VARS['a'] ); + switch ( $mode ) { case 'approve': ! ! $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = " . $article_id; ! if ( !( $results = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $results ); ! $topic_sql = ''; + + // Insert comment, if not already present if ( $kb_config['use_comments'] ) { if ( !$row['topic_id'] ) { ! $kb_comment = array(); ! // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata); ! ! // Compose post header ! $subject = $lang['KB_comment_prefix'] . $kb_comment['article_title']; ! $message_temp = kb_compose_comment( $kb_comment ); ! ! $kb_message = $message_temp['message']; ! $kb_update_message = $message_temp['update_message']; ! ! // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $topic_sql = ", topic_id = " . $topic_data['topic_id']; } *************** *** 154,158 **** $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 1 " . $topic_sql . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) --- 121,125 ---- $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 1 " . $topic_sql . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 161,192 **** } ! $sql = "SELECT article_category_id, article_body ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! message_die( GENERAL_ERROR, "Could not obtain article category", '', __LINE__, __FILE__, $sql ); ! } ! ! if ( $article = $db->sql_fetchrow( $result ) ) ! { ! $article_category_id = $article['article_category_id']; ! $body = $article['article_body']; ! } update_kb_number( $article_category_id, '+ 1' ); ! ! add_kb_words( $article_id, $body ); ! $message = $lang['Article_approved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$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 ); break; case 'unapprove': - $article_id = intval( $HTTP_GET_VARS['a'] ); - $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 0 WHERE article_id = " . $article_id; --- 128,143 ---- } ! $article_category_id = $row['article_category_id']; update_kb_number( $article_category_id, '+ 1' ); ! 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" ) . '">', '</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 ); + break; case 'unapprove': $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET approved = 0 WHERE article_id = " . $article_id; *************** *** 198,203 **** $sql = "SELECT article_category_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) --- 149,154 ---- $sql = "SELECT article_category_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 212,218 **** update_kb_number( $article_category_id, '- 1' ); $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$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 ); break; --- 163,169 ---- update_kb_number( $article_category_id, '- 1' ); + mx_remove_search_words( $article_id, 'kb' ); $message = $lang['Article_unapproved'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$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 ); break; *************** *** 220,230 **** case 'delete': - $article_id = intval( $HTTP_GET_VARS['a'] ); - if ( $HTTP_GET_VARS['c'] == "yes" ) { $sql = "SELECT article_category_id, approved, topic_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) --- 171,179 ---- case 'delete': if ( $HTTP_GET_VARS['c'] == "yes" ) { $sql = "SELECT article_category_id, approved, topic_id ! FROM " . KB_ARTICLES_TABLE . " ! WHERE article_id = " . $article_id; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 373,378 **** } $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$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 ); } --- 322,328 ---- } + mx_remove_search_words( $article_id, 'kb' ); + $message = $lang['Article_deleted'] . '<br /><br />' . sprintf( $lang['Click_return_article_manager'], '<a href="' . append_sid( "admin_kb_art.$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 ); } *************** *** 380,384 **** { $message = $lang['Confirm_art_delete'] . '<br /><br />' . sprintf( $lang['Confirm_art_delete_yes'], '<a href="' . append_sid( "admin_kb_art.$phpEx?mode=delete&c=yes&a=" . $article_id ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Confirm_art_delete_no'], '<a href="' . append_sid( "admin_kb_art.$phpEx" ) . '">', '</a>' ); - message_die( GENERAL_MESSAGE, $message ); } --- 330,333 ---- Index: admin_kb_config.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/admin/admin_kb_config.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** admin_kb_config.php 17 Mar 2005 12:37:24 -0000 1.13 --- admin_kb_config.php 26 Mar 2005 22:52:35 -0000 1.14 *************** *** 87,98 **** $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\"" : ""; --- 87,108 ---- $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\"" : ""; *************** *** 111,119 **** $use_comments_no = ( !$new['use_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\"" : ""; $del_topic_no = ( !$new['del_topic'] ) ? "checked=\"checked\"" : ""; --- 121,124 ---- *************** *** 243,246 **** --- 248,284 ---- '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'], |
|
From: Jon O. <jon...@us...> - 2005-03-26 22:52:49
|
Update of /cvsroot/mxbb/mx_kb/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25039/modules/mx_kb/templates/subSilver Added Files: kb_post_body.tpl kb_post_pretext.tpl kb_post_preview.tpl Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support --- NEW FILE: kb_post_preview.tpl --- <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> <th height="25" class="thHead">{L_PREVIEW}</th> </tr> <tr> <td class="row1"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <span class="postbody">{PREVIEW_MESSAGE}</span> </td> </tr> </table></td> </tr> <tr> <td class="spaceRow" height="1"><img src="templates/subSilver/images/spacer.gif" width="1" height="1" /></td> </tr> </table> <br clear="all" /> --- NEW FILE: kb_post_body.tpl --- <script language="JavaScript" type="text/javascript"> <!-- // bbCode control by // subBlue design // www.subBlue.com // Startup variables var imageTag = false; var theSelection = false; // Check for Browser & Platform for PC & IE specific bits // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html var clientPC = navigator.userAgent.toLowerCase(); // Get client info var clientVer = parseInt(navigator.appVersion); // Get browser version var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); var is_moz = 0; var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1)); var is_mac = (clientPC.indexOf("mac")!=-1); // Helpline messages b_help = "{L_BBCODE_B_HELP}"; i_help = "{L_BBCODE_I_HELP}"; u_help = "{L_BBCODE_U_HELP}"; q_help = "{L_BBCODE_Q_HELP}"; c_help = "{L_BBCODE_C_HELP}"; l_help = "{L_BBCODE_L_HELP}"; o_help = "{L_BBCODE_O_HELP}"; p_help = "{L_BBCODE_P_HELP}"; w_help = "{L_BBCODE_W_HELP}"; a_help = "{L_BBCODE_A_HELP}"; s_help = "{L_BBCODE_S_HELP}"; f_help = "{L_BBCODE_F_HELP}"; // Define the bbCode tags bbcode = new Array(); bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]'); imageTag = false; // Shows the help messages in the helpline window function helpline(help) { document.post.helpbox.value = eval(help + "_help"); } // Replacement for arrayname.length property function getarraysize(thearray) { for (i = 0; i < thearray.length; i++) { if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) return i; } return thearray.length; } // Replacement for arrayname.push(value) not implemented in IE until version 5.5 // Appends element to the array function arraypush(thearray,value) { thearray[ getarraysize(thearray) ] = value; } // Replacement for arrayname.pop() not implemented in IE until version 5.5 // Removes and returns the last element of an array function arraypop(thearray) { thearraysize = getarraysize(thearray); retval = thearray[thearraysize - 1]; delete thearray[thearraysize - 1]; return retval; } function checkForm() { formErrors = false; if (document.post.article_name.value.length < 2) { formErrors = "{L_EMPTY_ARTICLE_NAME}\r"; } if (document.post.article_desc.value.length < 2) { formErrors = "{L_EMPTY_ARTICLE_DESC}\r"; } if (document.post.message.value.length < 2) { formErrors = "{L_EMPTY_MESSAGE}\r"; } if (document.post.type_id.value=='select_one') { formErrors = "{L_EMPTY_TYPE}\r"; } if (formErrors) { alert(formErrors); return false; } else { bbstyle(-1); //formObj.preview.disabled = true; //formObj.submit.disabled = true; return true; } } function emoticon(text) { var txtarea = document.post.message; text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } function bbfontstyle(bbopen, bbclose) { var txtarea = document.post.message; if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; if (!theSelection) { txtarea.value += bbopen + bbclose; txtarea.focus(); return; } document.selection.createRange().text = bbopen + theSelection + bbclose; txtarea.focus(); return; } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) { mozWrap(txtarea, bbopen, bbclose); return; } else { txtarea.value += bbopen + bbclose; txtarea.focus(); } storeCaret(txtarea); } function bbstyle(bbnumber) { var txtarea = document.post.message; donotinsert = false; theSelection = false; bblast = 0; if (bbnumber == -1) { // Close all open tags & default button names while (bbcode[0]) { butnumber = arraypop(bbcode) - 1; txtarea.value += bbtags[butnumber + 1]; buttext = eval('document.post.addbbcode' + butnumber + '.value'); eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); } imageTag = false; // All tags are closed including image tags :D txtarea.focus(); return; } if ((clientVer >= 4) && is_ie && is_win) { theSelection = document.selection.createRange().text; // Get text selection if (theSelection) { // Add tags around selection document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1]; txtarea.focus(); theSelection = ''; return; } } else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0)) { mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]); return; } // Find last occurance of an open tag the same as the one just clicked for (i = 0; i < bbcode.length; i++) { if (bbcode[i] == bbnumber+1) { bblast = i; donotinsert = true; } } if (donotinsert) { // Close all open tags up to the one just clicked & default button names while (bbcode[bblast]) { butnumber = arraypop(bbcode) - 1; txtarea.value += bbtags[butnumber + 1]; buttext = eval('document.post.addbbcode' + butnumber + '.value'); eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); imageTag = false; } txtarea.focus(); return; } else { // Open tags if (imageTag && (bbnumber != 14)) { // Close image tag before adding another txtarea.value += bbtags[15]; lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list document.post.addbbcode14.value = "Img"; // Return button back to normal state imageTag = false; } // Open tag txtarea.value += bbtags[bbnumber]; if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag arraypush(bbcode,bbnumber+1); eval('document.post.addbbcode'+bbnumber+'.value += "*"'); txtarea.focus(); return; } storeCaret(txtarea); } // From http://www.massless.org/mozedit/ function mozWrap(txtarea, open, close) { var selLength = txtarea.textLength; var selStart = txtarea.selectionStart; var selEnd = txtarea.selectionEnd; if (selEnd == 1 || selEnd == 2) selEnd = selLength; var s1 = (txtarea.value).substring(0,selStart); var s2 = (txtarea.value).substring(selStart, selEnd) var s3 = (txtarea.value).substring(selEnd, selLength); txtarea.value = s1 + open + s2 + close + s3; return; } // Insert at Claret position. Code from // http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 function storeCaret(textEl) { if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); } //--> </script> <!-- BEGIN tinyMCE --> <script language="javascript" type="text/javascript" src="modules/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> <script language="javascript" type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", theme_advanced_toolbar_location : "top", plugins : "table", theme_advanced_buttons3_add_before : "tablecontrols, separator" }); </script> <!-- END tinyMCE --> <form method="post" action="{S_ACTION}" onsubmit="return checkForm(this)" name="post"> {KB_PRETEXT_BOX} {KB_PREVIEW_BOX} <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> <td align="left" class="nav"><a href="{U_KB}" class="nav">{L_KB}</a></td> </tr> </table> <table border="0" cellpadding="4" cellspacing="0" align="center" width="100%" class="forumline"> <tr> <th class="thHead" colspan="2" height="25"><b>{L_ADD_ARTICLE}</b></th> </tr> <!-- BEGIN switch_name --> <tr> <td class="row1"><span class="gen"><b><nobr>{L_NAME}</nobr></b></span></td> <td class="row2"> <span class="gen"> <input type="text" name="username" size="45" maxlength="100" style="width:450px" class="post" value="{USERNAME}" /></span></td> </tr> <!-- END switch_name --> <tr> <td class="row1"><span class="gen"><b><nobr>{L_ARTICLE_TITLE}</nobr></b></span></td> <td class="row2"> <span class="gen"> <input type="text" name="article_name" size="45" maxlength="100" style="width:450px" class="post" value="{ARTICLE_TITLE}" /></span></td> </tr> <tr> <td class="row1"><span class="gen"><b>{L_ARTICLE_DESCRIPTION}</b></span></td> <td class="row2"> <span class="gen"> <input type="text" name="article_desc" size="45" maxlength="255" style="width:450px" class="post" value="{ARTICLE_DESC}" /></span></td> </tr> <tr> <td class="row1" valign="top"><span class="gen"><b><nobr>{L_ARTICLE_TEXT}</nobr></b><br /><br /> <table width="100" border="0" cellspacing="0" cellpadding="5" align="center"> <tr align="center"> <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td> </tr> <!-- BEGIN smilies_row --> <tr align="center" valign="middle"> <!-- BEGIN smilies_col --> <td><a href="javascript:emoticon('{smilies_row.smilies_col.SMILEY_CODE}')"><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td> <!-- END smilies_col --> </tr> <!-- END smilies_row --> <!-- BEGIN switch_smilies_extra --> <tr align="center"> <td colspan="{S_SMILIES_COLSPAN}"><span class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td> </tr> <!-- END switch_smilies_extra --> </table> <br /><br /><span class="gen"><b><nobr>{L_OPTIONS}</nobr></b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span><br /><br /> </td> <td class="row2"> <table width="450" border="0" cellspacing="0" cellpadding="2"> <tr> <td> <table width="450" border="0" cellspacing="0" cellpadding="2"> <tr align="center" valign="middle"> <td><span class="genmed"> <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" /> </span></td> <td><span class="genmed"> <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" /> </span></td> </tr> <tr> <td colspan="9"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><span class="genmed"> {L_FONT_COLOR}: <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')"> <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option> <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option> <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option> <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option> <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option> <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option> <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option> <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option> <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option> <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option> <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option> <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option> <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option> <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option> <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option> </select> {L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')"> <option value="7" class="genmed">{L_FONT_TINY}</option> <option value="9" class="genmed">{L_FONT_SMALL}</option> <option value="12" selected class="genmed">{L_FONT_NORMAL}</option> <option value="18" class="genmed">{L_FONT_LARGE}</option> <option value="24" class="genmed">{L_FONT_HUGE}</option> </select> </span></td> <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td> </tr> </table> </td> </tr> </table> <tr> <td colspan="9"> <span class="gensmall"> <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" /> </span></td> </tr> <tr> <td><span class="gen"><textarea name="message" rows="30" cols="35" wrap="virtual" style="width:450px" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{ARTICLE_BODY}</textarea></span> <!-- BEGIN formatting --> <br /><span class="gen"><b><nobr>{L_FORMATTING}</nobr></b></span><hr><span class="gensmall"><b>{L_PAGES}</b><br />{L_PAGES_EXPLAIN}<br /><b>{L_TOC}</b><br />{L_TOC_EXPLAIN}<br /><b>{L_ABSTRACT}</b><br />{L_ABSTRACT_EXPLAIN}<br /><hr><b>{L_TITLE_FORMAT}</b><br />{L_TITLE_FORMAT_EXPLAIN}<br /><b>{L_SUBTITLE_FORMAT}</b><br />{L_SUBTITLE_FORMAT_EXPLAIN}<br /><b>{L_SUBSUBTITLE_FORMAT}</b><br />{L_SUBSUBTITLE_FORMAT_EXPLAIN}</span><br /><br /> <!-- END formatting --> </td> </tr> </table> </td> </td> </tr> <tr> <td class="row1" valign="top"><span class="gen"><b><nobr>{L_ARTICLE_TYPE}</nobr></b></span></td> <td class="row2"><span class="gen"> <select name="type_id"> <option value="select_one">{L_SELECT}</option> <!-- BEGIN types --> {types.TYPE} <!-- END types --> </select> </span> </td> </tr> <!-- BEGIN switch_edit --> <tr> <td class="row1"><span class="gen"><b>{L_ARTICLE_CATEGORY}</b></span></td> <td class="row2"> <select name="category_id"> {switch_edit.CAT_LIST} </select> </td> </tr> <!-- END switch_edit --> <tr> <td class="catBottom" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" name="preview" value="{L_PREVIEW}" class="mainoption"> <input type="submit" name="article_submit" class="mainoption" value="{L_SUBMIT}" /></td> </tr> </table> </form> --- NEW FILE: kb_post_pretext.tpl --- <br clear="all" /> <table class="forumline" width="100%" cellspacing="0" cellpadding="4" border="0"> <tr> <th height="25" class="thHead">{PRETEXT_HEADER}</th> </tr> <tr> <td class="row1"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <span class="postbody">{PRETEXT_BODY}</span> </td> </tr> </table></td> </tr> <tr> <td class="spaceRow" height="1"><img src="templates/subSilver/images/spacer.gif" width="1" height="1" /></td> </tr> </table> <br clear="all" /> |
|
From: Jon O. <jon...@us...> - 2005-03-26 22:52:49
|
Update of /cvsroot/mxbb/mx_kb/language/lang_english In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25039/modules/mx_kb/language/lang_english Modified Files: lang_kb.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support Index: lang_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/language/lang_english/lang_kb.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** lang_kb.php 18 Feb 2005 10:07:44 -0000 1.13 --- lang_kb.php 26 Mar 2005 22:52:36 -0000 1.14 *************** *** 220,225 **** --- 220,229 ---- $lang['Pre_text_body'] = 'Article Submission Instructions Body'; $lang['Pre_text_explain'] = 'This is text instructions displayed to users at the top of the submission forum.'; + $lang['Show'] = 'Show'; $lang['Hide'] = 'Hide'; + + $lang['Empty_fields'] ='Please fill out all parts of the form.'; + $lang['Empty_fields_return'] ='Click %sHere%s to return to the form.'; $lang['Empty_category'] ='You must choose a category'; $lang['Empty_type']='You must choose a type'; *************** *** 239,243 **** // added ! $lang['Edited_Article_info'] = 'Article updated...'; $lang['No_Articles'] = 'This category is empty!'; $lang['Not_authorized'] = 'Sorry, you are not authorized!'; --- 243,247 ---- // added ! $lang['Edited_Article_info'] = 'Article updated by '; $lang['No_Articles'] = 'This category is empty!'; $lang['Not_authorized'] = 'Sorry, you are not authorized!'; *************** *** 332,334 **** --- 336,350 ---- $lang['Default_article_id'] = "Set default article, for the article viewer"; + $lang['KB_comment_prefix'] = '[ KB ] '; + + $lang['Wysiwyg'] = 'Use wysiwyg editor'; + $lang['Wysiwyg_explain'] = 'If enabled, the standard bbcode/html/smilies input dialog is replaced by a wysiwyg editor.'; + + $lang['Wysiwyg_path'] = 'Path to wysiwyg software'; + $lang['Wysiwyg_path_explain'] = 'This is the path (from mxBB root) to the wysiwyg software folder, eg \'modules/\' if you have uploaded for example tinemce in modules/tinymce.'; + + $lang['Formatting_fixup'] = 'Fixup formatting'; + $lang['Formatting_fixup_explain'] = 'I enabled, the article text is reformatted: wordwrapping, url truncates, img resizing, some bbcode reformatting etc'; + + ?> \ No newline at end of file |
|
From: Jon O. <jon...@us...> - 2005-03-26 22:52:49
|
Update of /cvsroot/mxbb/mx_kb/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25039/modules/mx_kb/includes Modified Files: functions_kb.php kb_article.php kb_header.php kb_moderator.php Added Files: kb_post.php Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support Index: kb_header.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_header.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** kb_header.php 11 Feb 2005 22:10:32 -0000 1.12 --- kb_header.php 26 Mar 2005 22:52:36 -0000 1.13 *************** *** 38,48 **** else { ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $config_name = $row['config_name']; ! $config_value = $row['config_value']; $kb_config[$config_name] = $config_value; } } // $dirname = $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.'.$phpEx; // include($dirname); --- 38,49 ---- else { ! while ( $row_tmp = $db->sql_fetchrow( $result ) ) { ! $config_name = $row_tmp['config_name']; ! $config_value = $row_tmp['config_value']; $kb_config[$config_name] = $config_value; } } + // $dirname = $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_kb.'.$phpEx; // include($dirname); Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/functions_kb.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** functions_kb.php 18 Feb 2005 10:07:43 -0000 1.18 --- functions_kb.php 26 Mar 2005 22:52:35 -0000 1.19 *************** *** 91,99 **** // get author of article ! function get_kb_author( $id ) { global $db; ! $sql = "SELECT username FROM " . USERS_TABLE . " WHERE user_id = $id"; --- 91,99 ---- // get author of article ! function get_kb_author( $id, $get_all_userdata = false ) { global $db; ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = $id"; *************** *** 106,110 **** if ( $row = $db->sql_fetchrow( $result ) ) { ! $name = $row['username']; } else --- 106,117 ---- if ( $row = $db->sql_fetchrow( $result ) ) { ! if ( $get_all_userdata ) ! { ! $name = $row; ! } ! else ! { ! $name = $row['username']; ! } } else *************** *** 124,128 **** $sql = "SELECT type FROM " . KB_TYPES_TABLE . " ! WHERE id = $id"; if ( !( $result = $db->sql_query( $sql ) ) ) --- 131,135 ---- $sql = "SELECT type FROM " . KB_TYPES_TABLE . " ! WHERE id = '$id'"; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 518,521 **** --- 525,707 ---- } + // wgErics good old insert_pm function + function kb_insert_pm( + $to_id, + $message, + $subject, + $from_id, + $html_on = 0, + $bbcode_on = 1, + $smilies_on = 1) + { + global $db, $lang, $user_ip, $board_config, $userdata, $phpbb_root_path, $phpEx; + + if ( !$from_id ) + { + $from_id = $userdata['user_id']; + } + + //get varibles ready + $to_id = intval($to_id); + $from_id = intval($from_id); + $msg_time = time(); + $attach_sig = $userdata['user_attachsig']; + + //get to users info + $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active + FROM " . USERS_TABLE . " + WHERE user_id = '$to_id' + AND user_id <> " . ANONYMOUS; + if ( !($result = $db->sql_query($sql)) ) + { + $error = TRUE; + $error_msg = $lang['No_such_user']; + } + + $to_userdata = $db->sql_fetchrow($result); + + $privmsg_subject = trim(strip_tags($subject)); + if ( empty($privmsg_subject) ) + { + $error = TRUE; + $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_subject']; + } + + if ( !empty($message) ) + { + if ( !$error ) + { + if ( $bbcode_on ) + { + $bbcode_uid = make_bbcode_uid(); + } + + $privmsg_message = prepare_message($message, $html_on, $bbcode_on, $smilies_on, $bbcode_uid); + $privmsg_message = str_replace('\\\n', '\n', $privmsg_message); + + } + } + else + { + $error = TRUE; + $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_message']; + } + + // + // See if recipient is at their inbox limit + // + $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time + FROM " . PRIVMSGS_TABLE . " + WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " + OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " + OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) + AND privmsgs_to_userid = " . $to_userdata['user_id']; + if ( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_MESSAGE, $lang['No_such_user']); + } + + $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : ''; + + if ( $inbox_info = $db->sql_fetchrow($result) ) + { + if ( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] ) + { + $sql = "SELECT privmsgs_id FROM " . PRIVMSGS_TABLE . " + WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " + OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " + OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) + AND privmsgs_date = " . $inbox_info['oldest_post_time'] . " + AND privmsgs_to_userid = " . $to_userdata['user_id']; + if ( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, 'Could not find oldest privmsgs (inbox)', '', __LINE__, __FILE__, $sql); + } + $old_privmsgs_id = $db->sql_fetchrow($result); + $old_privmsgs_id = $old_privmsgs_id['privmsgs_id']; + + $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " + WHERE privmsgs_id = $old_privmsgs_id"; + if ( !$db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs (inbox)'.$sql, '', __LINE__, __FILE__, $sql); + } + + $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TEXT_TABLE . " + WHERE privmsgs_text_id = $old_privmsgs_id"; + if ( !$db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (inbox)', '', __LINE__, __FILE__, $sql); + } + } + } + + $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) + VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', " . $from_id . ", " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', $html_on, $bbcode_on, $smilies_on, $attach_sig)"; + + if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) ) + { + message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info); + } + + $privmsg_sent_id = $db->sql_nextid(); + + $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) + VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("\'", "''", $privmsg_message) . "')"; + + if ( !$db->sql_query($sql, END_TRANSACTION) ) + { + message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql); + } + + // + // Add to the users new pm counter + // + $sql = "UPDATE " . USERS_TABLE . " + SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . " + WHERE user_id = " . $to_userdata['user_id']; + if ( !$status = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql); + } + + if ( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] ) + { + $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])); + $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx; + $server_name = trim($board_config['server_name']); + $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; + $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/'; + + include($phpbb_root_path . 'includes/emailer.'.$phpEx); + $emailer = new emailer($board_config['smtp_delivery']); + + $emailer->from($board_config['board_email']); + $emailer->replyto($board_config['board_email']); + + $emailer->use_template('privmsg_notify', $to_userdata['user_lang']); + $emailer->email_address($to_userdata['user_email']); + $emailer->set_subject($lang['Notification_subject']); + + $emailer->assign_vars(array( + 'USERNAME' => $to_username, + 'SITENAME' => $board_config['sitename'], + 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', + + 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox') + ); + + $emailer->send(); + $emailer->reset(); + } + + return; + + $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); + + message_die(GENERAL_MESSAGE, $msg); + + } // insert_pm() + // get categories for index *************** *** 910,935 **** } ! // insert post for site updates ! // By netclectic - Adrian Cockburn ! function insert_post( $message, ! $subject, ! $forum_id, ! $user_id, ! $user_name, ! $user_attach_sig, ! $topic_id = null, ! $message_update_text = '', ! $bump_post = 1, ! $topic_type = POST_NORMAL, ! $do_notification = false, ! $notify_user = false, ! $current_time = 0, ! $error_die_function = '', ! $html_on = 1, ! $bbcode_on = 1, ! $smilies_on = 1 ) { ! global $db, $board_config, $user_ip; // initialise some variables $topic_vote = 0; --- 1096,1155 ---- } ! /* ! * Description : This functions is used to insert a post into your phpbb forums. ! * It handles all the related bits like updating post counts, ! * indexing search words, etc. ! * The post is inserted for a specific user, so you will have to ! * already have a user setup which you want to use with it. ! * ! * If you're using the POST method to input data then you should call stripslashes on ! * your subject and message before calling insert_post - see test_insert_post for example. ! * ! * Parameters : $message - the message that will form the body of the post ! * $subject - the subject of the post ! * $forum_id - the forum the post is to be added to ! * $user_id - the id of the user for the post ! * $user_name - the username of the user for the post ! * $user_attach_sig - should the user's signature be attached to the post ! * ! * Options Params : $topic_id - if topic_id is passed then the post will be ! * added as a reply to this topic ! * $topic_type - defaults to POST_NORMAL, can also be ! * POST_STICKY, POST_ANNOUNCE or POST_GLOBAL_ANNOUNCE ! * $do_notification - should users be notified of new posts (only valid for replies) ! * $notify_user - should the 'posting' user be signed up for notifications of this topic ! * $current_time - should the current time be used, if not then you should supply a posting time ! * $error_die_function - can be used to supply a custom error function. ! * $html_on = false - should html be allowed (parsed) in the post text. ! * $bbcode_on = true - should bbcode be allowed (parsed) in the post text. ! * $smilies_on = true - should smilies be allowed (parsed) in the post text. ! * ! * Returns : If the function succeeds without an error it will return an array containing ! * the post id and the topic id of the new post. Any error along the way will result in either ! * the normal phpbb message_die function being called or a custom die function determined ! * by the $error_die_function parameter. ! */ ! ! // insert post for site updates, by netclectic - Adrian Cockburn ! function kb_insert_post( ! $message, ! $subject, ! $forum_id, ! $user_id, ! $user_name, ! $user_attach_sig, ! $topic_id = '', ! $message_update_text = '', ! $topic_type = POST_NORMAL, ! $do_notification = false, ! $notify_user = false, ! $current_time = 0, ! $error_die_function = '', ! $html_on = 0, ! $bbcode_on = 1, ! $smilies_on = 1 ) { ! global $db, $board_config, $user_ip, $kb_config; // initialise some variables $topic_vote = 0; *************** *** 937,956 **** $poll_options = ''; $poll_length = ''; ! if ( $bump_post == 0 ) ! { ! $mode = 'update_only'; ! } ! ! $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; ! $error_die_function = ( $error_die_function == '' ) ? "message_die" : $error_die_function; ! $current_time = ( $current_time == 0 ) ? time() : $current_time; ! // parse the message and the subject ! $message_update_text = str_replace( "\'", "''", prepare_message( trim( $message_update_text . $message ), $html_on, $bbcode_on, $smilies_on, $bbcode_uid ) ); ! $message = str_replace( "\'", "''", prepare_message( trim( $message ), $html_on, $bbcode_on, $smilies_on, $bbcode_uid ) ); ! $subject = str_replace( "\'", "''", trim( $subject ) ); ! $username = str_replace( "\'", "''", trim( strip_tags( $user_name ) ) ); // if this is a new topic then insert the topic details ! if ( is_null( $topic_id ) ) { $mode = 'newtopic'; --- 1157,1177 ---- $poll_options = ''; $poll_length = ''; + $mode = 'reply'; ! $bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : ''; ! $error_die_function = ($error_die_function == '') ? "message_die" : $error_die_function; ! $current_time = ($current_time == 0) ? time() : $current_time; ! ! // parse the message and the subject (belt & braces :) ! $message = addslashes(unprepare_message($message)); ! $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); ! $message_update_text = addslashes(unprepare_message($message_update_text)); ! $message_update_text = prepare_message(trim($message_update_text), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); ! $subject = addslashes(unprepare_message(trim($subject))); ! $username = addslashes(unprepare_message(trim($user_name))); ! $username = phpbb_clean_username( $username ); ! // if this is a new topic then insert the topic details ! if ( empty( $topic_id ) ) { $mode = 'newtopic'; *************** *** 963,967 **** } // insert the post details using the topic id ! if ( $mode != 'update_only' ) { $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $user_id . ", '$username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $user_attach_sig)"; --- 1184,1188 ---- } // insert the post details using the topic id ! if ( $mode == 'newtopic' || $kb_config['bump_post'] == '1' ) { $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $user_id . ", '$username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $user_attach_sig)"; *************** *** 1021,1025 **** } // do we need to do user notification ! if ( ( $mode != 'newtopic' ) && $do_notification ) { $post_data = array(); --- 1242,1246 ---- } // do we need to do user notification ! if ( ($mode != 'newtopic') && $do_notification ) { $post_data = array(); *************** *** 1028,1033 **** // End if mode is update_only } ! // Update original post ! // Added by Haplo $sql = "SELECT topic_first_post_id FROM " . TOPICS_TABLE . " --- 1249,1255 ---- // End if mode is update_only } ! ! // Start KB addon - update original post -------------------------------------------------- ! $sql = "SELECT topic_first_post_id FROM " . TOPICS_TABLE . " *************** *** 1042,1045 **** --- 1264,1276 ---- $orig_post_id = $row[0]; + $sql = "UPDATE " . TOPICS_TABLE . " SET + topic_title = '$subject' + WHERE topic_id = '$topic_id'"; + + if ( !( $result = $db->sql_query( $sql, BEGIN_TRANSACTION ) ) ) + { + message_die( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); + } + $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_subject = '$subject', *************** *** 1052,1213 **** message_die( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } // if all is well then return the id of our new post return array( 'post_id' => $post_id, 'topic_id' => $topic_id ); } - function add_kb_words( $post_id, $post_text, $post_title = '' ) - { - global $db, $phpbb_root_path, $mx_root_path, $module_root_path, $board_config, $lang, $is_block, $page_id; - - $stopword_array = @file( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . "/search_stopwords.txt" ); - $synonym_array = @file( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . "/search_synonyms.txt" ); - - $search_raw_words = array(); - $search_raw_words['text'] = split_words( clean_words( 'post', $post_text, $stopword_array, $synonym_array ) ); - $search_raw_words['title'] = split_words( clean_words( 'post', $post_title, $stopword_array, $synonym_array ) ); - - $word = array(); - $word_insert_sql = array(); - while ( list( $word_in, $search_matches ) = @each( $search_raw_words ) ) - { - $word_insert_sql[$word_in] = ''; - if ( !empty( $search_matches ) ) - { - for ( $i = 0; $i < count( $search_matches ); $i++ ) - { - $search_matches[$i] = trim( $search_matches[$i] ); - - if ( $search_matches[$i] != '' ) - { - $word[] = $search_matches[$i]; - if ( !strstr( $word_insert_sql[$word_in], "'" . $search_matches[$i] . "'" ) ) - { - $word_insert_sql[$word_in] .= ( $word_insert_sql[$word_in] != "" ) ? ", '" . $search_matches[$i] . "'" : "'" . $search_matches[$i] . "'"; - } - } - } - } - } - - if ( count( $word ) ) - { - sort( $word ); - - $prev_word = ''; - $word_text_sql = ''; - $temp_word = array(); - for( $i = 0; $i < count( $word ); $i++ ) - { - if ( $word[$i] != $prev_word ) - { - $temp_word[] = $word[$i]; - $word_text_sql .= ( ( $word_text_sql != '' ) ? ', ' : '' ) . "'" . $word[$i] . "'"; - } - $prev_word = $word[$i]; - } - $word = $temp_word; - - $check_words = array(); - switch ( SQL_LAYER ) - { - case 'postgresql': - case 'msaccess': - case 'mssql-odbc': - case 'oracle': - case 'db2': - $sql = "SELECT word_id, word_text - FROM " . SEARCH_WORD_TABLE . " - WHERE word_text IN ($word_text_sql)"; - if ( !( $result = $db->sql_query( $sql ) ) ) - { - message_die( GENERAL_ERROR, 'Could not select words', '', __LINE__, __FILE__, $sql ); - } - - while ( $row = $db->sql_fetchrow( $result ) ) - { - $check_words[$row['word_text']] = $row['word_id']; - } - break; - } - - $value_sql = ''; - $match_word = array(); - for ( $i = 0; $i < count( $word ); $i++ ) - { - $new_match = true; - if ( isset( $check_words[$word[$i]] ) ) - { - $new_match = false; - } - - if ( $new_match ) - { - switch ( SQL_LAYER ) - { - case 'mysql': - case 'mysql4': - $value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . '(\'' . $word[$i] . '\', 0)'; - break; - case 'mssql': - $value_sql .= ( ( $value_sql != '' ) ? ' UNION ALL ' : '' ) . "SELECT '" . $word[$i] . "', 0"; - break; - default: - $sql = "INSERT INTO " . KB_WORD_TABLE . " (word_text, word_common) - VALUES ('" . $word[$i] . "', 0)"; - if ( !$db->sql_query( $sql ) ) - { - message_die( GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql ); - } - break; - } - } - } - - if ( $value_sql != '' ) - { - switch ( SQL_LAYER ) - { - case 'mysql': - case 'mysql4': - $sql = "INSERT IGNORE INTO " . KB_WORD_TABLE . " (word_text, word_common) - VALUES $value_sql"; - break; - case 'mssql': - $sql = "INSERT INTO " . KB_WORD_TABLE . " (word_text, word_common) - $value_sql"; - break; - } - - if ( !$db->sql_query( $sql ) ) - { - message_die( GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql ); - } - } - } - - while ( list( $word_in, $match_sql ) = @each( $word_insert_sql ) ) - { - $title_match = ( $word_in == 'title' ) ? 1 : 0; - - if ( $match_sql != '' ) - { - $sql = "INSERT INTO " . KB_MATCH_TABLE . " (article_id, word_id, title_match) - SELECT $post_id, word_id, $title_match - FROM " . KB_WORD_TABLE . " - WHERE word_text IN ($match_sql)"; - if ( !$db->sql_query( $sql ) ) - { - message_die( GENERAL_ERROR, 'Could not insert new word matches', '', __LINE__, __FILE__, $sql ); - } - } - } - - if ( $mode == 'single' ) - { - remove_common( 'single', 4 / 10, $word ); - } - - return; - } // MX add-on // Generate paths for page and standalone mode --- 1283,1293 ---- message_die( GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql ); } + + // End kb addon coe ---------------------------------------------------------- + // if all is well then return the id of our new post return array( 'post_id' => $post_id, 'topic_id' => $topic_id ); } // MX add-on // Generate paths for page and standalone mode *************** *** 1595,1598 **** --- 1675,1785 ---- return $template; } + + function kb_get_data($row, $userdata, $kb_post_mode = '') + { + global $db; + + $kb_author_data = get_kb_author( $kb_comment['article_author_id'], true ); + + $sql = "SELECT * FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $row['article_category_id'] . "'"; + if ( !( $results = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, "Could not get comments_forum_id", '', __LINE__, __FILE__, $sql ); + } + $cat_row = $db->sql_fetchrow( $results ); + + // Article data + $kb_comment['article_id'] = $row['article_id']; + $kb_comment['article_title'] = $row['article_title']; + $kb_comment['article_desc'] = $row['article_description']; + + $kb_comment['article_category_id'] = $row['article_category_id']; + $kb_comment['category_name'] = $cat_row['category_name']; + $kb_comment['category_forum_id'] = $cat_row['comments_forum_id']; + $kb_comment['topic_id'] = $kb_post_mode == 'edit' ? $row['topic_id'] : ''; + + $kb_comment['article_type_id'] = $row['article_type']; + $kb_comment['article_type'] = get_kb_type( $kb_comment['article_type_id'] ); + + // Article author + $kb_comment['article_author_id'] = $row['article_author_id']; + $kb_comment['article_author'] = $kb_author_data['username']; + $kb_comment['article_author_sig'] = $kb_author_data['user_attachsig']; + + // Article editor + $kb_comment['article_editor_id'] = $userdata['user_id']; + $kb_comment['article_editor'] = $userdata['username']; + $kb_comment['article_editor_sig'] = $userdata['user_attachsig']; + + return $kb_comment; + } + + // Compose phpbb comment header + function kb_compose_comment( $kb_comment ) + { + global $lang, $kb_comment, $phpEx; + + $search = array ( "'&(quot|#34);'i", // Replace HTML entities + "'&(amp|#38);'i", + "'&(lt|#60);'i", + "'&(gt|#62);'i" + ); + + $replace = array ( "\"", + "&", + "<", + ">" + ); + + // Compose phpBB post header + $temp_url = PORTAL_URL . "modules/mx_kb/kb.$phpEx?mode=" . "article&k=" . $kb_comment['article_id']; + + $message = "[b]" . $lang['Article_title'] . ":[/b] " . preg_replace( $search, $replace, $kb_comment['article_title'] ) . "\n"; + $message .= "[b]" . $lang['Author'] . ":[/b] " . $kb_comment['article_author'] . "\n"; + $message .= "[b]" . $lang['Article_description'] . ":[/b] " . preg_replace( $search, $replace, $kb_comment['article_desc'] ) . "\n\n"; + + $message .= "[b]" . $lang['Category'] . ":[/b] " . $kb_comment['category_name'] . "\n"; + $message .= "[b]" . $lang['Article_type'] . ":[/b] " . $kb_comment['article_type'] . "\n\n"; + + $message .= "[b][url=" . $temp_url . "]" . $lang['Read_full_article'] . "[/url][/b]"; + + $message_update_text = "[i]" . $lang['Edited_Article_info'] . $kb_comment['article_editor'] . "[/i]" . "\n\n"; + + return array( 'message' => $message, 'update_message' => $message_update_text ); + } + + function article_formatting( $article ) + { + // Prepare ingress/preword + $search = array (); + $replace = array (); + + $search = array ( "'\[title*?[^\[\]]*?\]'si", + "'\[\/title*?[^\[\]]*?\]'si", + "'\[subtitle*?[^\[\]]*?\]'si", + "'\[\/subtitle*?[^\[\]]*?\]'si", + "'\[subsubtitle*?[^\[\]]*?\]'si", + "'\[\/subsubtitle*?[^\[\]]*?\]'si", + "'\[quote*?[^\[\]]*?\]'si", + "'\[\/quote*?[^\[\]]*?\]'si", + "'\[abstract*?[^\[\]]*?\]'si", + "'\[\/abstract*?[^\[\]]*?\]'si" ); + + $replace = array ( "<span class=\"cattitle\">", + "</span>", + "<span class=\"topictitle\">", + "</span>", + "<span class=\"gensmall\"><b>", + "</b></span>", + "<div align=\"center\"><span class=\"gensmall\"><i>''", + "''</i></span></div>", + "<table cellpadding=\"20\" style=\"margin-bottom: -20px;\"><tr><td><span class=\"postbody\" style=\"font-weight: bold; font-size: 9pt;\">", + "</span></td></td></tr></table>" ); + + $article = preg_replace( $search, $replace, $article ); + + return $article; + } + // Functions for newssuite operation mode Index: kb_article.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/includes/kb_article.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** kb_article.php 1 Feb 2005 20:45:37 -0000 1.13 --- kb_article.php 26 Mar 2005 22:52:36 -0000 1.14 *************** *** 31,34 **** --- 31,35 ---- FROM " . KB_ARTICLES_TABLE . " WHERE article_id = $article_id"; + if ( !( $result = $db->sql_query( $sql ) ) ) { *************** *** 36,42 **** } ! if ( $row = $db->sql_fetchrow( $result ) ) { $article_title = stripslashes( $row['article_title'] ); $approved = $row['approved']; --- 37,54 ---- } ! $row = $db->sql_fetchrow( $result ); ! ! if ( count($row) > 0 ) { $article_title = stripslashes( $row['article_title'] ); + + // + // Define censored word matches + // + + $orig_word = array(); + $replacement_word = array(); + obtain_word_list($orig_word, $replacement_word); + $approved = $row['approved']; *************** *** 47,51 **** $kb_is_auth = array(); $kb_is_auth = kb_auth(AUTH_ALL, $article_category_id, $userdata); - // End of auth check --- 59,62 ---- *************** *** 53,56 **** --- 64,68 ---- // User authorisation levels output // + $kb_auth_can = ( ( $kb_is_auth['auth_post'] ) ? $lang['KB_Rules_post_can'] : $lang['KB_Rules_post_cannot'] ) . '<br />'; $kb_auth_can .= ( ( $kb_is_auth['auth_edit'] ) ? $lang['KB_Rules_edit_can'] : $lang['KB_Rules_edit_cannot'] ) . '<br />'; *************** *** 63,67 **** if ( $kb_is_auth['auth_mod'] ) { - //$kb_auth_can .= sprintf($lang['KB_Rules_moderate'], "<a href=\"modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&start=" . $start . "&sid=" . $userdata['session_id'] . '">', '</a>'); $kb_auth_can .= $lang['KB_Rules_moderate_can'] . '<br />'; } --- 75,78 ---- *************** *** 74,78 **** --- 85,91 ---- $date = create_date( $board_config['default_dateformat'], $row['article_date'], $board_config['board_timezone'] ); + // author information + $author_id = $row['article_author_id']; *************** *** 84,88 **** { $author_name = get_kb_author( $author_id ); - $temp_url = append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$author_id" ); $author_kb_art = '<a href="' . $temp_url . '" class="gensmall">' . $author_name . '</a>'; --- 97,100 ---- *************** *** 94,121 **** $kb_art_description = stripslashes( $row['article_description'] ); ! // Prepare ingress/preword ! $search = array (); ! $replace = array (); ! $search = array ( "'\[title*?[^\[\]]*?\]'si", ! "'\[\/title*?[^\[\]]*?\]'si", ! "'\[subtitle*?[^\[\]]*?\]'si", ! "'\[\/subtitle*?[^\[\]]*?\]'si", ! "'\[subsubtitle*?[^\[\]]*?\]'si", ! "'\[\/subsubtitle*?[^\[\]]*?\]'si", ! "'\[quote*?[^\[\]]*?\]'si", ! "'\[\/quote*?[^\[\]]*?\]'si", ! "'\[abstract*?[^\[\]]*?\]'si", ! "'\[\/abstract*?[^\[\]]*?\]'si" ); ! $replace = array ( "<span class=\"cattitle\">", ! "</span>", ! "<span class=\"topictitle\">", ! "</span>", ! "<span class=\"gensmall\"><b>", ! "</b></span>", ! "<div align=\"center\"><span class=\"gensmall\"><i>''", ! "''</i></span></div>", ! "<table cellpadding=\"20\" style=\"margin-bottom: -20px;\"><tr><td><span class=\"postbody\" style=\"font-weight: bold; font-size: 9pt;\">", ! "</span></td></td></tr></table>" ); ! $article = preg_replace( $search, $replace, $article ); $type_id = $row['article_type']; --- 106,110 ---- $kb_art_description = stripslashes( $row['article_description'] ); ! $article = article_formatting( $article ); $type_id = $row['article_type']; *************** *** 153,177 **** } // Was a highlight request part of the URI? $highlight_match = $highlight = ''; ! if ( isset( $HTTP_GET_VARS['highlight'] ) ) ! { // Split words and phrases ! $words = explode( ' ', trim( htmlspecialchars( $HTTP_GET_VARS['highlight'] ) ) ); ! for( $i = 0; $i < sizeof( $words ); $i++ ) { ! if ( trim( $words[$i] ) != '' ) { ! $highlight_match .= ( ( $highlight_match != '' ) ? '|' : '' ) . str_replace( '*', '\w*', phpbb_preg_quote( $words[$i], '#' ) ); } } ! unset( $words ); ! $highlight = urlencode( $HTTP_GET_VARS['highlight'] ); } ! if ( !$board_config['allow_html'] ) { $article = preg_replace( '#(<)([\/]?.*?)(>)#is', "<\\2>", $article ); --- 142,170 ---- } + // // Was a highlight request part of the URI? + // $highlight_match = $highlight = ''; ! if (isset($HTTP_GET_VARS['highlight'])) ! { // Split words and phrases ! ! $words = explode(' ', trim(htmlspecialchars($HTTP_GET_VARS['highlight']))); ! for($i = 0; $i < sizeof($words); $i++) { ! if (trim($words[$i]) != '') { ! $highlight_match .= (($highlight_match != '') ? '|' : '') . str_replace('*', '\w*', phpbb_preg_quote($words[$i], '#')); } } ! unset($words); ! $highlight = urlencode($HTTP_GET_VARS['highlight']); ! $highlight_match = phpbb_rtrim($highlight_match, "\\"); } ! if ( !$html_on ) { $article = preg_replace( '#(<)([\/]?.*?)(>)#is', "<\\2>", $article ); *************** *** 182,190 **** $bbcode_uid = $row['bbcode_uid']; ! if ( $board_config['allow_bbcode'] ) { if ( $bbcode_uid != '' ) { ! $article = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass( $article, $bbcode_uid ) : preg_replace( '/\:[0-9a-z\:]+\]/si', ']', $article ); } } --- 175,183 ---- $bbcode_uid = $row['bbcode_uid']; ! if ( $bbcode_on ) { if ( $bbcode_uid != '' ) { ! $article = ( $bbcode_on ) ? bbencode_second_pass( $article, $bbcode_uid ) : preg_replace( '/\:[0-9a-z\:]+\]/si', ']', $article ); } } *************** *** 194,209 **** // Parse smilies ! if ( $board_config['allow_smilies'] ) { $article = mx_smilies_pass( $article ); } // Highlight active words (primarily for search) ! if ( $highlight_match ) ! { // This was shamelessly 'borrowed' from volker at multiartstudio dot de // via php.net's annotated manual ! $message = str_replace( '\"', '"', substr( preg_replace( '#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace('#\b(" . $highlight_match . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $article . '<' ), 1, -1 ) ); } --- 187,204 ---- // Parse smilies ! if ( $smilies_on ) { $article = mx_smilies_pass( $article ); } + // // Highlight active words (primarily for search) + // ! if ($highlight_match) ! { // This was shamelessly 'borrowed' from volker at multiartstudio dot de // via php.net's annotated manual ! $article = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace('#\b(" . $highlight_match . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $article . '<'), 1, -1)); } *************** *** 232,235 **** --- 227,231 ---- $page_title = $article_title; + if ( !$is_block && !$print_version ) { *************** *** 238,244 **** // fixup (truncates) urls, images and words for a narrow column layout ! $kb_art_description = kb_decode_truncate_fixup( $kb_art_description ); ! $article = kb_decode_truncate_fixup( $article ); // load header if ( !$print_version && !$reader_mode ) { --- 234,245 ---- // fixup (truncates) urls, images and words for a narrow column layout ! if ( $kb_config['formatting_fixup'] ) ! { ! $kb_art_description = kb_decode_truncate_fixup( $kb_art_description ); ! $article = kb_decode_truncate_fixup( $article ); ! } ! // load header + if ( !$print_version && !$reader_mode ) { *************** *** 247,250 **** --- 248,252 ---- // edit + if ( ( $userdata['user_id'] == $author_id && $kb_is_auth['auth_edit'] ) || $kb_is_auth['auth_mod'] ) { *************** *** 265,281 **** if ( $reader_mode ) { ! $template->set_filenames( array( 'body' => 'kb_article_reader.tpl' ) ! ); } else { ! $template->set_filenames( array( 'body' => 'kb_article_body.tpl' ) ! ); } } else { ! $template->set_filenames( array( 'body' => 'kb_article_body_print.tpl' ) ! ); } --- 267,280 ---- if ( $reader_mode ) { ! $template->set_filenames( array( 'body' => 'kb_article_reader.tpl' ) ); } else { ! $template->set_filenames( array( 'body' => 'kb_article_body.tpl' ) ); } } else { ! $template->set_filenames( array( 'body' => 'kb_article_body_print.tpl' ) ); } *************** *** 287,349 **** else { ! // fix for 0.76 if ( !$topic_id && $approved && $kb_config['use_comments']) { ! // choose a user ! $user_id = $userdata['user_id']; ! // initialise the userdata ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_id = $user_id"; ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( CRITICAL_ERROR, 'Could not obtain lastvisit data from user table', '', __LINE__, __FILE__, $sql ); ! } ! $user = $db->sql_fetchrow( $result ); ! ! $search = array ( "'&(quot|#34);'i", // Replace HTML entities ! "'&(amp|#38);'i", ! "'&(lt|#60);'i", ! "'&(gt|#62);'i" ! ); ! $replace = array ( "\"", ! "&", ! "<", ! ">" ! ); ! $sql = "SELECT comments_forum_id FROM " . KB_CATEGORIES_TABLE . " WHERE category_id = '" . $article_category_id . "'"; ! if ( !( $results = $db->sql_query( $sql ) ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not get comments_forum_id", '', __LINE__, __FILE__, $sql ); ! } ! $cat_row = $db->sql_fetchrow( $results ); ! $forum_id = $cat_row['comments_forum_id']; ! $temp_url = PORTAL_URL . ( $is_block ? "index.$phpEx?page=$page_id&mode=" : "modules/mx_kb/kb.$phpEx?mode=" ) . "article&k=" . $article_id; ! $message = "[b]" . $lang['Category'] . ":[/b] " . $article_category_name . "\n"; ! $message .= "[b]" . $lang['Article_type'] . ":[/b] " . $type . "\n\n"; ! $message .= "[b]" . $lang['Article_title'] . ":[/b] " . preg_replace( $search, $replace, $row['article_title'] ) . "\n"; ! $message .= "[b]" . $lang['Author'] . ":[/b] " . $author_kb_art . "\n"; ! $message .= "[b]" . $lang['Article_description'] . ":[/b] " . preg_replace( $search, $replace, $row['article_description'] ) . "\n\n"; ! $message .= "[b][url=" . $temp_url . "]" . $lang['Read_full_article'] . "[/url][/b]"; ! ! $subject = '[ KB ] ' . $row['article_title']; ! ! $subject = str_replace( "'", "\'" , $subject ); ! $message = str_replace( "'", "\'" , $message ); ! ! $forum_id = $kb_config['forum_id']; ! ! $topic_data = insert_post( $message, $subject, $forum_id, $user['user_id'], $user['username'], $user['user_attachsig'] ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " ! WHERE article_id = " . $article_id; ! if ( !( $result876 = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update article data", '', __LINE__, __FILE__, $sql ); } $topic_id = $topic_data['topic_id']; } if ( $kb_is_auth['auth_comment'] && $kb_config['use_comments'] ) { --- 286,318 ---- else { ! // If no phpbb topic id is created, create on ;) if ( !$topic_id && $approved && $kb_config['use_comments']) { ! $kb_comment = array(); ! ! // Populate the kb_comment variable ! $kb_comment = kb_get_data($row, $userdata); ! // Compose post header ! $subject = $lang['KB_comment_prefix'] . $kb_comment['article_title']; ! $message_temp = kb_compose_comment( $kb_comment ); ! $kb_message = $message_temp['message']; ! $kb_update_message = $message_temp['update_message']; ! // Post ! $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " ! WHERE article_id = " . $kb_comment['article_id']; ! if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update article data", '', __LINE__, __FILE__, $sql ); } + $topic_id = $topic_data['topic_id']; } + if ( $kb_is_auth['auth_comment'] && $kb_config['use_comments'] ) { *************** *** 360,365 **** $comments_img = '<a href="' . $temp_url . '" class="gensmall"> [' . $topic['topic_replies'] . ' - ' . $lang['Post_comments'] . ']</a>'; ! $template->assign_block_vars( 'switch_comments', array( ! ) ); } else --- 329,333 ---- $comments_img = '<a href="' . $temp_url . '" class="gensmall"> [' . $topic['topic_replies'] . ' - ' . $lang['Post_comments'] . ']</a>'; ! $template->assign_block_vars( 'switch_comments', array() ); } else *************** *** 385,390 **** $pagination = generate_pagination( this_kb_mxurl( "mode=article&k=$article_id" . $page_numm ), $topic['topic_replies'], $kb_config['comments_pagination'], $start ) . ' '; get_kb_comments( $topic_id, $start, $show_num_comments ); - // $template->assign_block_vars('switch_comments_show', array()); } // rate if ( $kb_is_auth['auth_rate'] && $kb_config['use_ratings']) --- 353,358 ---- $pagination = generate_pagination( this_kb_mxurl( "mode=article&k=$article_id" . $page_numm ), $topic['topic_replies'], $kb_config['comments_pagination'], $start ) . ' '; get_kb_comments( $topic_id, $start, $show_num_comments ); } + // rate if ( $kb_is_auth['auth_rate'] && $kb_config['use_ratings']) *************** *** 393,396 **** --- 361,365 ---- $rate_img = '<a href="' . $temp_url . '" class="gensmall">' . $lang['ADD_RATING'] . '</a>'; $rate = '<a href="' . $temp_url . '" class="gensmall">' . $lang['ADD_RATING'] . '</a>'; + $template->assign_block_vars( 'switch_ratings', array() ); } *************** *** 403,406 **** --- 372,376 ---- $path_kb = ' '; $path_kb_array = array(); + get_kb_nav( $article_category_id ); *************** *** 410,414 **** 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $kb_config['comments_pagination'] ) + 1 ), ceil( $topic['topic_replies'] / $kb_config['comments_pagination'] ) ), 'L_GOTO_PAGE' => $lang['Goto_page'], ! 'L_ARTICLE_DESCRIPTION' => $lang['Article_description'], 'L_ARTICLE_DATE' => $lang['Date'], --- 380,384 ---- 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $kb_config['comments_pagination'] ) + 1 ), ceil( $topic['topic_replies'] / $kb_config['comments_pagination'] ) ), 'L_GOTO_PAGE' => $lang['Goto_page'], ! 'L_ARTICLE_DESCRIPTION' => $lang['Article_description'], 'L_ARTICLE_DATE' => $lang['Date'], *************** *** 437,448 **** 'RATE_IMG' => $rate_img, 'RATE' => $rate, 'PATH' => $path_kb, ! ! 'S_AUTH_LIST' => $kb_auth_can, ! 'COMMENTS' => $comments, ! 'COMMENTS_IMG' => $comments_img ) ! ); // article pages table of contents --- 407,417 ---- 'RATE_IMG' => $rate_img, 'RATE' => $rate, + 'COMMENTS' => $comments, + 'COMMENTS_IMG' => $comments_img, 'PATH' => $path_kb, ! 'S_AUTH_LIST' => $kb_auth_can ! ) ); // article pages table of contents *************** *** 453,456 **** --- 422,426 ---- $i = 0; + while ( $i < count( $art_pages ) ) { *************** *** 459,465 **** $art_split = explode( '[toc]', $art_pages[$i] ); $article_toc = $art_split[0]; ! // $article_body = $art_split[1]; // Fix up the toc title ! if ( !$board_config['allow_html'] ) { $article_toc = preg_replace( '#(<)([\/]?.*?)(>)#is', "<\\2>", $article_toc ); --- 429,436 ---- $art_split = explode( '[toc]', $art_pages[$i] ); $article_toc = $art_split[0]; ! // Fix up the toc title ! ! if ( !$html_on ) { $article_toc = preg_replace( '#(<)([\/]?.*?)(>)#is', "<\\2>", $article_toc ); *************** *** 468,480 **** // Parse message - // $bbcode_uid = $row['bbcode_uid']; - // $article_toc = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $article_toc); $article_toc = preg_replace( "/\[(\S+)\]/e", "", $article_toc ); - // $txt = preg_replace("/<a href=\"(.*)\">(.*)<\/a>/i", "\\2 (\\1)", $txt); $article_toc = make_clickable( $article_toc ); // Parse smilies ! if ( $board_config['allow_smilies'] ) { $article_toc = mx_smilies_pass( $article_toc ); --- 439,448 ---- // Parse message $article_toc = preg_replace( "/\[(\S+)\]/e", "", $article_toc ); $article_toc = make_clickable( $article_toc ); // Parse smilies ! if ( $smilies_on ) { $article_toc = mx_smilies_pass( $article_toc ); *************** *** 487,493 **** --- 455,463 ---- $article_toc = str_replace( '\"', '"', substr( preg_replace( '#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $article_toc . '<' ), 1, -1 ) ); } + // Replace newlines (we use this rather than nl2br because // till recently it wasn't XHTML compliant) // $article_toc = str_replace("\n", "\n<br />\n", $article_toc); + $page_toc = $art_pages[$i]; *************** *** 524,534 **** $page_link .= '<br />'; } ! $template->assign_block_vars( 'switch_toc.pages', array( 'TOC_ITEM' => $page_link ) ! ); $i++; } } ! // article pages if ( count( $art_pages ) > 1 ) --- 494,505 ---- $page_link .= '<br />'; } ! ! $template->assign_block_vars( 'switch_toc.pages', array( 'TOC_ITEM' => $page_link ) ); ! $i++; } } ! // article pages TOC navigation if ( count( $art_pages ) > 1 ) *************** *** 546,552 **** --- 517,525 ---- $i = 0; + while ( $i < count( $art_pages ) ) { $page_number = $i + 1; + if ( $page_num != $i ) { *************** *** 570,575 **** $page_link .= ', '; } ! $template->assign_block_vars( 'switch_pages.pages', array( 'PAGE_LINK' => $page_link ) ! ); $i++; } --- 543,549 ---- $page_link .= ', '; } ! ! $template->assign_block_vars( 'switch_pages.pages', array( 'PAGE_LINK' => $page_link ) ); ! $i++; } --- NEW FILE: kb_post.php --- <?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: kb_post.php,v 1.1 2005/03/26 22:52:36 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 ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } $category_id = ( isset( $HTTP_GET_VARS['cat'] ) ) ? intval ( $HTTP_GET_VARS['cat'] ) : intval ( $HTTP_POST_VARS['cat'] ); $article_id = ( isset( $HTTP_GET_VARS['k'] ) ) ? intval ( $HTTP_GET_VARS['k'] ) : intval ( $HTTP_POST_VARS['k'] ); if ( empty( $category_id ) ) { // Get old data first $sql = "SELECT article_category_id FROM " . KB_ARTICLES_TABLE . " WHERE article_id = $article_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } $row = $db->sql_fetchrow( $result ); $category_id = $row['article_category_id']; } $kb_post_mode = empty( $article_id ) ? 'add' : 'edit'; // Parameters $submit = ( isset( $HTTP_POST_VARS['article_submit'] ) ) ? true : false; $cancel = ( isset( $HTTP_POST_VARS['cancel'] ) ) ? true : false; $preview = ( isset( $HTTP_POST_VARS['preview'] ) ) ? true : false; $kb_wysiwyg = false; if ( $kb_config['wysiwyg'] ) // Html Textblock { // This switch is for enabling the wysiwyg html editor addon "tiny mce". to disable this feature either remove this section or delete the modules/tinymce folder if ( file_exists( $mx_root_path . 'modules/tinymce/jscripts/tiny_mce/blank.htm' ) ) { $template->assign_block_vars( "tinyMCE", array() ); $bbcode_on = false; $html_on = true; $smilies_on = false; $html_entities_match = array( ); $html_entities_replace = array( ); $kb_wysiwyg = true; } } if ( !$kb_wysiwyg ) { $bbcode_on = $kb_config['allow_bbcode'] ? true : false; $html_on = $kb_config['allow_html'] ? true : false; $smilies_on = $kb_config['allow_smilies'] ? true : false; $board_config['allow_html_tags'] = $kb_config['allowed_html_tags']; $template->assign_block_vars( 'formatting', array() ); } // Start auth check // $kb_is_auth = array(); $kb_is_auth = kb_auth(AUTH_ALL, $category_id, $userdata); // End of auth check // $page_title = $kb_post_mode == 'add' ? $lang['Add_article'] : $lang['Edit_article']; // post article ----------------------------------------------------------------------------ADD/EDIT if ( $submit ) { if ( empty( $HTTP_POST_VARS['article_name'] ) || empty( $HTTP_POST_VARS['article_desc'] ) || empty( $HTTP_POST_VARS['message'] ) ) { $message = $lang['Empty_fields'] . '<br /><br />' . sprintf( $lang['Empty_fields_return'], '<a href="' . append_sid( this_kb_mxurl( 'mode=add' ) ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } $article_title = ( !empty( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( trim ( $HTTP_POST_VARS['article_name'] ) ) : ''; $article_description = ( !empty( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( trim ( $HTTP_POST_VARS['article_desc'] ) ) : ''; $article_text = ( !empty( $HTTP_POST_VARS['message'] ) ) ? $HTTP_POST_VARS['message'] : ''; $bbcode_uid = ( !empty( $HTTP_POST_VARS['bbcode_uid'] ) ) ? $HTTP_POST_VARS['bbcode_uid'] : ''; $date = time(); $author_id = intval ( $userdata['user_id'] ); $type_id = intval ( $HTTP_POST_VARS['type_id'] ); $username = phpbb_clean_username( $HTTP_POST_VARS['username'] ); // Check message if ( !empty( $article_text ) ) { if ( empty( $bbcode_uid ) ) { $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; } $article_text = prepare_message( trim( $article_text ), $html_on, $bbcode_on, $smilies_on, $bbcode_uid ); } switch ( $kb_post_mode ) { case 'edit': // UPDATE Article ------------------------------------------- if ( !($kb_is_auth['auth_edit'] || $kb_is_auth['auth_mod']) ) { $message = $lang['No_edit'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } // Get old data first $sql = "SELECT article_category_id, approved, topic_id FROM " . KB_ARTICLES_TABLE . " WHERE article_id = $article_id"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } $row = $db->sql_fetchrow( $result ); $old_approve = $row['approved']; $old_topic_id = $row['topic_id']; $old_category_id = $row['article_category_id']; $error_msg = ''; // If changed category if ( $old_category_id != $category_id ) { update_kb_number( $old_category_id, '- 1' ); if ( $kb_is_auth['auth_mod'] || ( $kb_is_auth['auth_approval_edit'] && $userdata['user_id'] == $author_id ) ) { update_kb_number( $category, '+ 1' ); } } // If unapproved if ( $kb_is_auth['auth_mod'] || ( $kb_is_auth['auth_approval_edit'] && $userdata['user_id'] == $author_id ) ) { $approve = 1; if ( $old_approve != 1 ) { update_kb_number( $category_id, '+ 1' ); } } else { $approve = 2; if ( $old_approve == 1 && $old_category_id == $category_id ) { update_kb_number( $category_id, '- 1' ); } } $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET article_category_id = '$category_id', article_title = '$article_title', article_description = '$article_description', article_date = '$date', article_author_id = '$author_id', article_body = '$article_text', article_type = '$type_id', approved = '$approve', bbcode_uid = '$bbcode_uid' WHERE article_id = '$article_id'"; if ( !( $edit_article = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not edit article", '', __LINE__, __FILE__, $sql ); } mx_remove_search_words( $article_id, 'kb' ); break; case 'add': // ADD NEW --------------------------------------------------------------------------------- if ( !($kb_is_auth['auth_post'] || $kb_is_auth['auth_mod']) ) { $message = $lang['No_add'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } if ( $kb_is_auth['auth_approval'] || $kb_is_auth['auth_mod'] ) { $approve = 1; update_kb_number( $category_id, '+ 1' ); } else { $approve = 0; } $sql = "INSERT INTO " . KB_ARTICLES_TABLE . " ( article_category_id , article_title , article_description , article_date , article_author_id , username , bbcode_uid , article_body , article_type , approved, views ) VALUES ( '$category_id', '$article_title', '$article_description', '$date', '$author_id', '$username', '$bbcode_uid', '$article_text', '$type_id', '$approve', '0')"; if ( !( $results = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not submit aritcle", '', __LINE__, __FILE__, $sql ); } break; } if ( !$approve || $approve == 0 ) { email_kb_admin( $kb_config['notify'] ); } // Insert phpBB post if using kb commenting if ( $approve == 1 && $kb_config['use_comments'] && $kb_is_auth['auth_comment']) { $kb_comment = array(); // Populate the kb_comment variable $kb_comment = kb_get_data($row, $userdata, $kb_post_mode); // Compose post header $subject = $lang['KB_comment_prefix'] . $kb_comment['article_title']; $message_temp = kb_compose_comment( $kb_comment ); $kb_message = $message_temp['message']; $kb_update_message = $message_temp['update_message']; // Post $topic_data = kb_insert_post( $kb_message, $subject, $kb_comment['category_forum_id'], $kb_comment['article_author_id'], $userdata['article_author'], $userdata['article_author_sig'], $kb_comment['topic_id'], $kb_update_message ); $sql = "UPDATE " . KB_ARTICLES_TABLE . " SET topic_id = " . $topic_data['topic_id'] . " WHERE article_id = " . $kb_comment['article_id']; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not update article data", '', __LINE__, __FILE__, $sql ); } } if ( $approve == 1 ) { mx_add_search_words( 'single', $article_id, stripslashes( $article_text ), stripslashes( $article_title ), 'kb' ); $message = $lang['Article_submitted'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); } else { $message = $lang['Article_submitted_Approve'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); } mx_message_die( GENERAL_MESSAGE, $message ); } // BEGIN - PreText HIDE/SHOW if ( $kb_config['show_pretext'] ) { // Pull Header/Body info. $pt_header = $kb_config['pt_header']; $pt_body = $kb_config['pt_body']; $template->set_filenames( array( 'pretext' => 'kb_post_pretext.tpl' ) ); $template->assign_vars( array( 'PRETEXT_HEADER' => $pt_header, 'PRETEXT_BODY' => $pt_body ) ); $template->assign_var_from_handle( 'KB_PRETEXT_BOX', 'pretext' ); } // END - PreText HIDE/SHOW // ---------------------------------------------------------------------------------------------------------- MAIN FORM // ---------------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------------- // Security if ( !$kb_is_auth['auth_mod'] ) { if ( $kb_post_mode == 'edit' && !$kb_is_auth['auth_edit'] ) { $message = $lang['No_edit'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } if ( $kb_post_mode == 'add' && ( !$kb_is_auth['auth_post'] || $kb_config['allow_new'] == 0 ) ) { $message = $lang['No_add'] . '<br /><br />' . sprintf( $lang['Click_return_kb'], '<a href="' . append_sid( this_kb_mxurl() ) . '">', '</a>' ) . '<br /><br />' . sprintf( $lang['Click_return_index'], '<a href="' . append_sid( $mx_root_path . "index.$phpEx" ) . '">', '</a>' ); mx_message_die( GENERAL_MESSAGE, $message ); } } // First (re)declare basic variables if ( $kb_post_mode == 'edit' ) { $sql = "SELECT * FROM " . KB_ARTICLES_TABLE . " WHERE article_id = '" . $article_id . "'"; if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not obtain article data", '', __LINE__, __FILE__, $sql ); } $row = $db->sql_fetchrow( $result ); } $kb_title = ( isset( $HTTP_POST_VARS['article_name'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_name'] ) ) ) : $row['article_title']; $kb_desc = ( isset( $HTTP_POST_VARS['article_desc'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['article_desc'] ) ) ): $row['article_description']; $kb_text = ( isset( $HTTP_POST_VARS['message'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['message'] ) ) ) : $row['article_body']; $type_id = ( isset( $HTTP_POST_VARS['type_id'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['type_id'] ) ) ) : $row['article_type']; $bbcode_uid = ( isset( $HTTP_POST_VARS['bbcode_uid'] ) ) ? htmlspecialchars( trim( stripslashes( $HTTP_POST_VARS['bbcode_uid'] ) ) ) : $row['bbcode_uid']; if ( $preview ) { $preview_title = $kb_title; $preview_desc = $kb_desc; $preview_text = $kb_text; $orig_word = array(); $replacement_word = array(); obtain_word_list( $orig_word, $replacement_word ); $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; $preview_text = stripslashes(prepare_message(addslashes(unprepare_message($preview_text)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid)); if ( $bbcode_on ) { $preview_text = bbencode_second_pass( $preview_text, $bbcode_uid ); } if ( count( $orig_word ) ) { $preview_title = preg_replace( $orig_word, $replacement_word, $preview_title ); $preview_desc = preg_replace( $orig_word, $replacement_word, $preview_desc ); $preview_text = preg_replace( $orig_word, $replacement_word, $preview_text ); } if ( $smilies_on ) { $preview_text = mx_smilies_pass( $preview_text ); } $preview_text = make_clickable( $preview_text ); $preview_text = str_replace( "\n", '<br />', $preview_text ); $template->set_filenames( array( 'preview' => 'kb_post_preview.tpl' ) ); $template->assign_vars( array( 'L_PREVIEW' => $lang['Preview'], 'ARTICLE_TITLE' => $preview_title, 'ARTICLE_DESC' => $preview_desc, 'ARTICLE_BODY' => $preview_text, 'PREVIEW_MESSAGE' => $preview_text ) ); $template->assign_var_from_handle( 'KB_PREVIEW_BOX', 'preview' ); } // show article form - MAIN if ( $kb_post_mode == 'edit' ) { $s_hidden_vars = '<input type="hidden" name="k" value="' . $article_id . '"><input type="hidden" name="bbcode_uid" value="' . $bbcode_uid . '"><input type="hidden" name="author_id" value="' . $author_id . '">'; } else { $s_hidden_vars = '<input type="hidden" name="cat" value="' . $category_id . '">'; } // $bbcode_uid = $block_config[$block_id][$block_text_par]['bbcode_uid']; if ( $bbcode_uid != '' ) { $kb_text = preg_replace('/\:(([a-z0-9]:)?)' . $bbcode_uid . '/s', '', $kb_text); } $kb_text = str_replace('<', '<', $kb_text); $kb_text = str_replace('>... [truncated message content] |
|
From: Jon O. <jon...@us...> - 2005-03-26 22:52:49
|
Update of /cvsroot/mxbb/mx_kb/templates/subSilver/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25039/modules/mx_kb/templates/subSilver/admin Modified Files: kb_config_body.tpl Log Message: finally rewriting this module, once and for all - rewritten post methods - better security - separated html. bbcode, smilies from phpbb - wysiwyg support Index: kb_config_body.tpl =================================================================== RCS file: /cvsroot/mxbb/mx_kb/templates/subSilver/admin/kb_config_body.tpl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** kb_config_body.tpl 1 Feb 2005 20:45:45 -0000 1.8 --- kb_config_body.tpl 26 Mar 2005 22:52:37 -0000 1.9 *************** *** 70,73 **** --- 70,101 ---- </tr> <tr> + <td class="row1" width="50%">{L_WYSIWYG}<br /><span class="gensmall">{L_WYSIWYG_EXPLAIN}</span></td> + <td class="row2" width="50%"><input type="radio" name="wysiwyg" value="1" {S_WYSIWYG_YES} /> {L_YES} <input type="radio" name="wysiwyg" value="0" {S_WYSIWYG_NO} /> {L_NO}</td> + </tr> + <tr> + <td class="row1" width="50%">{L_WYSIWYG_PATH}<br /><span class="gensmall">{L_WYSIWYG_PATH_EXPLAIN}</span></td> + <td class="row2" width="50%"><input text="text" name="wysiwyg_path" value="{WYSIWYG_PATH}" size="20" maxlength="50" /></td> + </tr> + <tr> + <td class="row1" width="50%">{L_ALLOW_HTML}<br /><span class="gensmall">{L_ALLOW_HTML_EXPLAIN}</span></td> + <td class="row2" width="50%"><input class="post" type="radio" name="allow_html" value="1" {S_ALLOW_HTML_YES} /> {L_YES} <input type="radio" name="allow_html" value="0" {S_ALLOW_HTML_NO} /> {L_NO}</td> + </tr> + <tr> + <td class="row1" width="50%">{L_ALLOWED_HTML_TAGS}<br /><span class="gensmall">{L_ALLOWED_HTML_TAGS_EXPLAIN}</span></td> + <td class="row2" width="50%"><input text="text" name="allowed_html_tags" value="{ALLOWED_HTML_TAGS}" size="15" maxlength="50" /></td> + </tr> + <tr> + <td class="row1" width="50%">{L_ALLOW_BBCODE}<br /><span class="gensmall">{L_ALLOW_BBCODE_EXPLAIN}</span></td> + <td class="row2" width="50%"><input type="radio" name="allow_bbcode" value="1" {S_ALLOW_BBCODE_YES} /> {L_YES} <input type="radio" name="allow_bbcode" value="0" {S_ALLOW_BBCODE_NO} /> {L_NO}</td> + </tr> + <tr> + <td class="row1" width="50%">{L_ALLOW_SMILIES}<br /><span class="gensmall">{L_ALLOW_SMILIES_EXPLAIN}</span></td> + <td class="row2" width="50%"><input type="radio" name="allow_smilies" value="1" {S_ALLOW_SMILIES_YES} /> {L_YES} <input type="radio" name="allow_smilies" value="0" {S_ALLOW_SMILIES_NO} /> {L_NO}</td> + </tr> + <tr> + <td class="row1" width="50%">{L_FORMATTING_FIXUP}<br /><span class="gensmall">{L_FORMATTING_FIXUP_EXPLAIN}</span></td> + <td class="row2" width="50%"><input type="radio" name="formatting_fixup" value="1" {S_FORMATTING_FIXUP_YES} /> {L_YES} <input type="radio" name="formatting_fixup" value="0" {S_FORMATTING_FIXUP_NO} /> {L_NO}</td> + </tr> + <tr> <th class="thHead" colspan="2">{L_COMMENTS_INFO}</th> </tr> |
|
From: Markus P. <mar...@us...> - 2005-03-26 02:48:20
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2226 Modified Files: mx_install.php Log Message: Fixed Global Variables initialization (that piece related to phpBB common.php was not really up to date). Added code to update cache, only if an upgrade processed one or more SQL schemas. Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** mx_install.php 23 Mar 2005 22:20:00 -0000 1.37 --- mx_install.php 26 Mar 2005 02:48:04 -0000 1.38 *************** *** 54,58 **** // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '1.0.6'); define('INSTALLER_NAME', 'mxBB-Installer'); --- 54,58 ---- // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '1.0.7'); define('INSTALLER_NAME', 'mxBB-Installer'); *************** *** 80,92 **** // common.php from phpBB 2.0.13 // - function unset_vars( &$var ) - { - while ( list( $var_name, $null ) = @each( $var ) ) - { - unset( $GLOBALS[$var_name] ); - } - return; - } - error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables set_magic_quotes_runtime(0); // Disable magic_quotes_runtime --- 80,83 ---- *************** *** 117,121 **** // We 'flip' the array of variables to test like this so that // we can validate later with isset($test[$var]) (no in_array()) ! $test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL); // Loop through each input array --- 108,112 ---- // We 'flip' the array of variables to test like this so that // we can validate later with isset($test[$var]) (no in_array()) ! $test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL); // Loop through each input array *************** *** 136,140 **** { // PHP4+ path ! // Not only will array_merge give a warning if a parameter // is not an array, it will actually fail. So we check if --- 127,132 ---- { // PHP4+ path ! $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path'); ! // Not only will array_merge give a warning if a parameter // is not an array, it will actually fail. So we check if *************** *** 150,159 **** unset($input['input']); ! while (list($var,) = @each($input)) { ! unset($$var); } ! unset($input); } --- 142,155 ---- unset($input['input']); ! unset($input['not_unset']); ! while (list($var,) = @each($input)) { ! if (!in_array($var, $not_unset)) ! { ! unset($$var); ! } } ! unset($input); } *************** *** 254,264 **** 'COMMENTS' => 'remove_remarks' ), ! // 'postgres' => array( ! // 'LABEL' => 'PostgreSQL 7.x', ! // 'SCHEMA' => 'postgres', ! // 'DELIM' => ';', ! // 'DELIM_BASIC' => ';', ! // 'COMMENTS' => 'remove_comments' ! // ), // 'mssql' => array( // 'LABEL' => 'MS SQL Server 7/2000', --- 250,260 ---- 'COMMENTS' => 'remove_remarks' ), ! 'postgres' => array( ! 'LABEL' => 'PostgreSQL 7.x', ! 'SCHEMA' => 'postgres', ! 'DELIM' => ';', ! 'DELIM_BASIC' => ';', ! 'COMMENTS' => 'remove_comments' ! ), // 'mssql' => array( // 'LABEL' => 'MS SQL Server 7/2000', *************** *** 563,566 **** --- 559,583 ---- exec_post_process($install_mode); + // + // Update cache? Only if it's an upgrade and we really processed one or more schemas. + // + if( $install_mode == 'upgrade' && count($schemas) > 0 ) + { + // + // FYI: update_session_cache() needs $portal_config to be filled. + // + $sql = 'SELECT * FROM '.PORTAL_TABLE.' WHERE portal_id = 1'; + if( ($result = $db->sql_query($sql)) ) + { + $portal_config = $db->sql_fetchrow($result); + include($mx_root_path . "includes/mx_cache.$phpEx"); + update_session_cache(); + $process_msgs[] = $lang['Cache_generate']; + } + } + + // + // Generate processing report and bye. + // $message = '<hr />'; for( $i=0; $i < count($process_msgs); $i++ ) *************** *** 1221,1225 **** { $fullname = $tmpary[$i] . '/' . $phpbb_files[$j]; ! if( !is_file($fullname) ) { $is_phpbb_dir = false; --- 1238,1242 ---- { $fullname = $tmpary[$i] . '/' . $phpbb_files[$j]; ! if( !@is_file($fullname) ) { $is_phpbb_dir = false; |
|
From: Markus P. <mar...@us...> - 2005-03-23 23:42:34
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16617 Modified Files: mx_install_readme.htm Log Message: Updated install readme with the one distributed with 2.7.5. Index: mx_install_readme.htm =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install_readme.htm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_install_readme.htm 18 Mar 2005 21:59:07 -0000 1.7 --- mx_install_readme.htm 23 Mar 2005 23:41:31 -0000 1.8 *************** *** 1,795 **** ! <!-- saved from url=(0022)http://internet.e-mail --> ! <html> ! <head> ! <title>Mx Portal installation - readme</title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! <!-- link rel="stylesheet" href="templates/subSilver/subSilver.css" type="text/css" --> ! <style type="text/css"> ! <!-- ! /* ! The original subSilver Theme for phpBB version 2+ [...1544 lines suppressed...] ! ! <br /> ! If your language is not already translated, duplicate (copy and paste) the /language/lang_english/ directory, rename it to something like "lang_yourlanguage." Translate all of the included files, save it, ZIP it, and upload it to the mxBB Languages Download Area. Be sure to report translated languages to us. We appreciate your contribution. <img src="http://www.mx-system.com/forum/images/smiles/icon_smile.gif" alt="Smile" border="0" /> ! <br /> ! ! <br /> ! <a href="#top">Back to Top</a> ! <br /> ! ! <br /> ! Jon and MennoniteHobbit ! <br /> ! <span style="font-style: italic">On behalf of the rest of the mxBB Team</span></span> ! </td> ! </tr> ! ! </table> ! </body> ! </html> \ No newline at end of file |
|
From: Markus P. <mar...@us...> - 2005-03-23 22:20:59
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12066 Modified Files: mx_install.php Log Message: Changed mx_install.php so it allows empty db passwords and empty phpbb table prefixes (why not? ). Also fixed PHP warning related to is_file/is_link in install_language_select(). Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** mx_install.php 21 Mar 2005 20:59:33 -0000 1.36 --- mx_install.php 23 Mar 2005 22:20:00 -0000 1.37 *************** *** 54,58 **** // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '1.0.5'); define('INSTALLER_NAME', 'mxBB-Installer'); --- 54,58 ---- // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '1.0.6'); define('INSTALLER_NAME', 'mxBB-Installer'); *************** *** 406,411 **** if( empty($phpbb_path) || empty($phpbb_url) || empty($portal_url) || ! empty($dbms) || empty($dbhost) || empty($dbname) || empty($dbuser) || empty($dbpasswd) || ! empty($table_prefix) || empty($mx_table_prefix) ) { break; --- 406,411 ---- if( empty($phpbb_path) || empty($phpbb_url) || empty($portal_url) || ! empty($dbms) || empty($dbhost) || empty($dbname) || empty($dbuser) || ! empty($mx_table_prefix) ) { break; *************** *** 1026,1030 **** while ( $file = @readdir($dir) ) { ! if ( ereg("^lang_", $file) && !is_file($dirname . '/' . $file) && !is_link($dirname . '/' . $file) ) { $filename = trim(str_replace('lang_', '', $file)); --- 1026,1030 ---- while ( $file = @readdir($dir) ) { ! if ( ereg("^lang_", $file) && !@is_file($dirname . '/' . $file) && !@is_link($dirname . '/' . $file) ) { $filename = trim(str_replace('lang_', '', $file)); *************** *** 1239,1243 **** { @include($config); ! return ( !empty($table_prefix) ); } --- 1239,1243 ---- { @include($config); ! return ( !empty($dbhost) && !empty($dbname) && !empty($dbuser) ); } |
|
From: Markus P. <mar...@us...> - 2005-03-22 01:10:43
|
Update of /cvsroot/mxbb/core/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12234 Removed Files: mx_install.tpl Log Message: Removed mx_install.tpl. --- mx_install.tpl DELETED --- |
|
From: Markus P. <mar...@us...> - 2005-03-22 00:27:38
|
Update of /cvsroot/mxbb/core/install/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17402/includes Added Files: template.php Log Message: Adding includes/templates to install folder. This is due to our new mx_Template class unable to load the phpBB parent at installation time (reason is the phpBB directory is unknown). --- NEW FILE: template.php --- <?php /*************************************************************************** * template.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: template.php,v 1.1 2005/03/22 00:27:23 markus_petrux 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. * ***************************************************************************/ /** * Template class. By Nathan Codding of the phpBB group. * The interface was originally inspired by PHPLib templates, * and the template file formats are quite similar. * */ class Template { var $classname = "Template"; // variable that holds all the data we'll be substituting into // the compiled templates. // ... // This will end up being a multi-dimensional array like this: // $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value // if it's a root-level variable, it'll be like this: // $this->_tpldata[.][0][varname] == value var $_tpldata = array(); // Hash of filenames for each template handle. var $files = array(); // Root template directory. var $root = ""; // this will hash handle names to the compiled code for that handle. var $compiled_code = array(); // This will hold the uncompiled code for that handle. var $uncompiled_code = array(); /** * Constructor. Simply sets the root dir. * */ function Template($root = ".") { $this->set_rootdir($root); } /** * Destroys this template object. Should be called when you're done with it, in order * to clear out the template data so you can load/parse a new template set. */ function destroy() { $this->_tpldata = array(); } /** * Sets the template root directory for this Template object. */ function set_rootdir($dir) { if (!is_dir($dir)) { return false; } $this->root = $dir; return true; } /** * Sets the template filenames for handles. $filename_array * should be a hash of handle => filename pairs. */ function set_filenames($filename_array) { if (!is_array($filename_array)) { return false; } reset($filename_array); while(list($handle, $filename) = each($filename_array)) { $this->files[$handle] = $this->make_filename($filename); } return true; } /** * Load the file for the handle, compile the file, * and run the compiled code. This will print out * the results of executing the template. */ function pparse($handle) { if (!$this->loadfile($handle)) { die("Template->pparse(): Couldn't load template file for handle $handle"); } // actually compile the template now. if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle])) { // Actually compile the code now. $this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle]); } // Run the compiled code. eval($this->compiled_code[$handle]); return true; } /** * Inserts the uncompiled code for $handle as the * value of $varname in the root-level. This can be used * to effectively include a template in the middle of another * template. * Note that all desired assignments to the variables in $handle should be done * BEFORE calling this function. */ function assign_var_from_handle($varname, $handle) { if (!$this->loadfile($handle)) { die("Template->assign_var_from_handle(): Couldn't load template file for handle $handle"); } // Compile it, with the "no echo statements" option on. $_str = ""; $code = $this->compile($this->uncompiled_code[$handle], true, '_str'); // evaluate the variable assignment. eval($code); // assign the value of the generated variable to the given varname. $this->assign_var($varname, $_str); return true; } /** * Block-level variable assignment. Adds a new block iteration with the given * variable assignments. Note that this should only be called once per block * iteration. */ function assign_block_vars($blockname, $vararray) { if (strstr($blockname, '.')) { // Nested block. $blocks = explode('.', $blockname); $blockcount = sizeof($blocks) - 1; $str = '$this->_tpldata'; for ($i = 0; $i < $blockcount; $i++) { $str .= '[\'' . $blocks[$i] . '.\']'; eval('$lastiteration = sizeof(' . $str . ') - 1;'); $str .= '[' . $lastiteration . ']'; } // Now we add the block that we're actually assigning to. // We're adding a new iteration to this block with the given // variable assignments. $str .= '[\'' . $blocks[$blockcount] . '.\'][] = $vararray;'; // Now we evaluate this assignment we've built up. eval($str); } else { // Top-level block. // Add a new iteration to this block with the variable assignments // we were given. $this->_tpldata[$blockname . '.'][] = $vararray; } return true; } /** * Root-level variable assignment. Adds to current assignments, overriding * any existing variable assignment with the same name. */ function assign_vars($vararray) { reset ($vararray); while (list($key, $val) = each($vararray)) { $this->_tpldata['.'][0][$key] = $val; } return true; } /** * Root-level variable assignment. Adds to current assignments, overriding * any existing variable assignment with the same name. */ function assign_var($varname, $varval) { $this->_tpldata['.'][0][$varname] = $varval; return true; } /** * Generates a full path+filename for the given filename, which can either * be an absolute name, or a name relative to the rootdir for this Template * object. */ function make_filename($filename) { // Check if it's an absolute or relative path. if (substr($filename, 0, 1) != '/') { $filename = ($rp_filename = phpbb_realpath($this->root . '/' . $filename)) ? $rp_filename : $filename; } if (!file_exists($filename)) { die("Template->make_filename(): Error - file $filename does not exist"); } return $filename; } /** * If not already done, load the file for the given handle and populate * the uncompiled_code[] hash with its code. Do not compile. */ function loadfile($handle) { // If the file for this handle is already loaded and compiled, do nothing. if (isset($this->uncompiled_code[$handle]) && !empty($this->uncompiled_code[$handle])) { return true; } // If we don't have a file assigned to this handle, die. if (!isset($this->files[$handle])) { die("Template->loadfile(): No file specified for handle $handle"); } $filename = $this->files[$handle]; $str = implode("", @file($filename)); if (empty($str)) { die("Template->loadfile(): File $filename for handle $handle is empty"); } $this->uncompiled_code[$handle] = $str; return true; } /** * Compiles the given string of code, and returns * the result in a string. * If "do_not_echo" is true, the returned code will not be directly * executable, but can be used as part of a variable assignment * for use in assign_code_from_handle(). */ function compile($code, $do_not_echo = false, $retvar = '') { // replace \ with \\ and then ' with \'. $code = str_replace('\\', '\\\\', $code); $code = str_replace('\'', '\\\'', $code); // change template varrefs into PHP varrefs // This one will handle varrefs WITH namespaces $varrefs = array(); preg_match_all('#\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}#is', $code, $varrefs); $varcount = sizeof($varrefs[1]); for ($i = 0; $i < $varcount; $i++) { $namespace = $varrefs[1][$i]; $varname = $varrefs[3][$i]; $new = $this->generate_block_varref($namespace, $varname); $code = str_replace($varrefs[0][$i], $new, $code); } // This will handle the remaining root-level varrefs $code = preg_replace('#\{([a-z0-9\-_]*?)\}#is', '\' . ( ( isset($this->_tpldata[\'.\'][0][\'\1\']) ) ? $this->_tpldata[\'.\'][0][\'\1\'] : \'\' ) . \'', $code); // Break it up into lines. $code_lines = explode("\n", $code); $block_nesting_level = 0; $block_names = array(); $block_names[0] = "."; // Second: prepend echo ', append ' . "\n"; to each line. $line_count = sizeof($code_lines); for ($i = 0; $i < $line_count; $i++) { $code_lines[$i] = chop($code_lines[$i]); if (preg_match('#<!-- BEGIN (.*?) -->#', $code_lines[$i], $m)) { $n[0] = $m[0]; $n[1] = $m[1]; // Added: dougk_ff7-Keeps templates from bombing if begin is on the same line as end.. I think. :) if ( preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $n) ) { $block_nesting_level++; $block_names[$block_nesting_level] = $m[1]; if ($block_nesting_level < 2) { // Block is not nested. $code_lines[$i] = '$_' . $n[1] . '_count = ( isset($this->_tpldata[\'' . $n[1] . '.\']) ) ? sizeof($this->_tpldata[\'' . $n[1] . '.\']) : 0;'; $code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)'; $code_lines[$i] .= "\n" . '{'; } else { // This block is nested. // Generate a namespace string for this block. $namespace = implode('.', $block_names); // strip leading period from root level.. $namespace = substr($namespace, 2); // Get a reference to the data array for this block that depends on the // current indices of all parent blocks. $varref = $this->generate_block_data_ref($namespace, false); // Create the for loop code to iterate over this block. $code_lines[$i] = '$_' . $n[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;'; $code_lines[$i] .= "\n" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)'; $code_lines[$i] .= "\n" . '{'; } // We have the end of a block. unset($block_names[$block_nesting_level]); $block_nesting_level--; $code_lines[$i] .= '} // END ' . $n[1]; $m[0] = $n[0]; $m[1] = $n[1]; } else { // We have the start of a block. $block_nesting_level++; $block_names[$block_nesting_level] = $m[1]; if ($block_nesting_level < 2) { // Block is not nested. $code_lines[$i] = '$_' . $m[1] . '_count = ( isset($this->_tpldata[\'' . $m[1] . '.\']) ) ? sizeof($this->_tpldata[\'' . $m[1] . '.\']) : 0;'; $code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)'; $code_lines[$i] .= "\n" . '{'; } else { // This block is nested. // Generate a namespace string for this block. $namespace = implode('.', $block_names); // strip leading period from root level.. $namespace = substr($namespace, 2); // Get a reference to the data array for this block that depends on the // current indices of all parent blocks. $varref = $this->generate_block_data_ref($namespace, false); // Create the for loop code to iterate over this block. $code_lines[$i] = '$_' . $m[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;'; $code_lines[$i] .= "\n" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)'; $code_lines[$i] .= "\n" . '{'; } } } else if (preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $m)) { // We have the end of a block. unset($block_names[$block_nesting_level]); $block_nesting_level--; $code_lines[$i] = '} // END ' . $m[1]; } else { // We have an ordinary line of code. if (!$do_not_echo) { $code_lines[$i] = 'echo \'' . $code_lines[$i] . '\' . "\\n";'; } else { $code_lines[$i] = '$' . $retvar . '.= \'' . $code_lines[$i] . '\' . "\\n";'; } } } // Bring it back into a single string of lines of code. $code = implode("\n", $code_lines); return $code ; } /** * Generates a reference to the given variable inside the given (possibly nested) * block namespace. This is a string of the form: * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' * It's ready to be inserted into an "echo" line in one of the templates. * NOTE: expects a trailing "." on the namespace. */ function generate_block_varref($namespace, $varname) { // Strip the trailing period. $namespace = substr($namespace, 0, strlen($namespace) - 1); // Get a reference to the data block for this namespace. $varref = $this->generate_block_data_ref($namespace, true); // Prepend the necessary code to stick this in an echo line. // Append the variable reference. $varref .= '[\'' . $varname . '\']'; $varref = '\' . ( ( isset(' . $varref . ') ) ? ' . $varref . ' : \'\' ) . \''; return $varref; } /** * Generates a reference to the array of data values for the given * (possibly nested) block namespace. This is a string of the form: * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] * * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. * NOTE: does not expect a trailing "." on the blockname. */ function generate_block_data_ref($blockname, $include_last_iterator) { // Get an array of the blocks involved. $blocks = explode(".", $blockname); $blockcount = sizeof($blocks) - 1; $varref = '$this->_tpldata'; // Build up the string with everything but the last child. for ($i = 0; $i < $blockcount; $i++) { $varref .= '[\'' . $blocks[$i] . '.\'][$_' . $blocks[$i] . '_i]'; } // Add the block reference for the last child. $varref .= '[\'' . $blocks[$blockcount] . '.\']'; // Add the iterator for the last child if requried. if ($include_last_iterator) { $varref .= '[$_' . $blocks[$blockcount] . '_i]'; } return $varref; } } ?> |