|
From: Jon O. <jon...@us...> - 2005-03-21 21:53:12
|
Update of /cvsroot/mxbb/core/modules/mx_textblocks/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1521/modules/mx_textblocks/admin Modified Files: mx_textblock_edit.php Log Message: merging, resolving conflict Index: mx_textblock_edit.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_textblocks/admin/mx_textblock_edit.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mx_textblock_edit.php 21 Mar 2005 21:24:43 -0000 1.14 --- mx_textblock_edit.php 21 Mar 2005 21:52:40 -0000 1.15 *************** *** 24,27 **** --- 24,28 ---- require( $mx_root_path . 'admin/pagestart.php' ); + include_once($phpbb_root_path . 'includes/functions_search.'.$phpEx); // required for search tables include_once($phpbb_root_path . "includes/functions_post.$phpEx"); // required by mx_generate_smilies *************** *** 38,42 **** } ! $block_id = isset( $HTTP_GET_VARS['block_id'] ) ? intval( $HTTP_GET_VARS['block_id'] ) : intval( $HTTP_POST_VARS['block_id'] ); $portalpage = isset( $HTTP_GET_VARS['portalpage'] ) ? intval( $HTTP_GET_VARS['portalpage'] ) : intval( $HTTP_POST_VARS['portalpage'] ); --- 39,43 ---- } ! // Initial vars $block_id = isset( $HTTP_GET_VARS['block_id'] ) ? intval( $HTTP_GET_VARS['block_id'] ) : intval( $HTTP_POST_VARS['block_id'] ); $portalpage = isset( $HTTP_GET_VARS['portalpage'] ) ? intval( $HTTP_GET_VARS['portalpage'] ) : intval( $HTTP_POST_VARS['portalpage'] ); *************** *** 57,61 **** ! // OBS OBS OBS // $blog_validate = ( $blog_mode == 'group' ) ? mx_auth_group( $sub_id, $userdata['user_id'], true ) : $sub_id == $userdata['user_id']; $blog_validate = ( $blog_mode == 'group' ) ? mx_auth_group_cache( $sub_id, true ) : $sub_id == $userdata['user_id']; --- 58,62 ---- ! // Blog mode: // $blog_validate = ( $blog_mode == 'group' ) ? mx_auth_group( $sub_id, $userdata['user_id'], true ) : $sub_id == $userdata['user_id']; $blog_validate = ( $blog_mode == 'group' ) ? mx_auth_group_cache( $sub_id, true ) : $sub_id == $userdata['user_id']; *************** *** 82,93 **** } - $html_entities_match = array( '#&#', '#<#', '#>#' ); - $html_entities_replace = array( '&', '<', '>' ); - // Parameters ! $submit = ( isset( $HTTP_POST_VARS['post'] ) ) ? true : 0; ! $cancel = ( isset( $HTTP_POST_VARS['cancel'] ) ) ? true : 0; ! $preview = ( isset( $HTTP_POST_VARS['preview'] ) ) ? true : 0; $refresh = $preview || $submit_search; --- 83,91 ---- } // Parameters ! $submit = ( isset( $HTTP_POST_VARS['post'] ) ) ? true : false; ! $cancel = ( isset( $HTTP_POST_VARS['cancel'] ) ) ? true : false; ! $preview = ( isset( $HTTP_POST_VARS['preview'] ) ) ? true : false; $refresh = $preview || $submit_search; *************** *** 103,106 **** --- 101,105 ---- $error = false; + /* // Toggles *************** *** 124,127 **** --- 123,127 ---- $bbcode_on = true; } + */ if ( !$board_config['allow_smilies'] ) *************** *** 139,143 **** // Define all config data - // echo('aa '.$sub_id); // Main parameters --- 139,142 ---- *************** *** 148,169 **** $show_stats_par = "show_stats"; ! if ( isset( $block_config[$block_id]['Html'] ) ) { ! $block_info_par = "Html"; $mode = "edithtml"; } ! else if ( isset( $block_config[$block_id]['Text'] ) ) { ! $block_info_par = "Text"; $mode = "edit"; } ! else if ( isset( $block_config[$block_id]['Blog'] ) ) { ! $block_info_par = "Blog"; $mode = "editblog"; } else { ! $block_info_par = ""; $mode = "edit"; } --- 147,183 ---- $show_stats_par = "show_stats"; ! if ( isset( $block_config[$block_id]['Html'] ) ) // Html Textblock { ! $block_text_par = "Html"; $mode = "edithtml"; + $bbcode_on = false; + $html_on = true; + + $html_entities_match = array( ); + $html_entities_replace = array( ); } ! else if ( isset( $block_config[$block_id]['Text'] ) ) // Multi or BBcode Textblock { ! $block_text_par = "Text"; $mode = "edit"; + $bbcode_on = true; + $html_on = true; + + $html_entities_match = array( '#&#', '#<#', '#>#' ); + $html_entities_replace = array( '&', '<', '>' ); } ! else if ( isset( $block_config[$block_id]['Blog'] ) ) // Blog Textblock { ! $block_text_par = "Blog"; $mode = "editblog"; + $bbcode_on = true; + $html_on = true; + + $html_entities_match = array( '#&#', '#<#', '#>#' ); + $html_entities_replace = array( '&', '<', '>' ); } else { ! $block_text_par = ""; $mode = "edit"; } *************** *** 179,183 **** $new_vars = array(); ! $new_vars = array( $block_info_par, $block_style_par, $text_style_par, $title_style_par, $blog_id_par ); $new = array(); --- 193,197 ---- $new_vars = array(); ! $new_vars = array( $block_text_par, $block_style_par, $text_style_par, $title_style_par, $blog_id_par ); $new = array(); *************** *** 197,207 **** else { ! if ( $new_vars[$j] == 'Text' || $new_vars[$j] == 'Blog' ) { ! if ( $bbcode_on && $mode != 'edithtml' ) { $bbcode_uid = make_bbcode_uid(); } ! $new[$new_vars[$j]] = prepare_message( $new[$new_vars[$j]], $html_on, $bbcode_on, $smilies_on, $bbcode_uid ); } --- 211,223 ---- else { ! if ( $new_vars[$j] == $block_text_par ) { ! if ( $bbcode_on ) { $bbcode_uid = make_bbcode_uid(); } ! ! //Format the input: ! $new[$new_vars[$j]] = prepare_message( trim($new[$new_vars[$j]]), $html_on, $bbcode_on, $smilies_on, $bbcode_uid ); } *************** *** 243,248 **** if ( $sub_id == "0" ) { ! $block_title = ( isset( $HTTP_POST_VARS['block_title'] ) ) ? trim( strip_tags( $HTTP_POST_VARS['block_title'] ) ) : $block_config[$block_id]['block_title']; ! $block_desc = trim( strip_tags( $HTTP_POST_VARS['block_desc'] ) ); $show_block = intval( $HTTP_POST_VARS['show_block'] ); $show_title = intval( $HTTP_POST_VARS['show_title'] ); --- 259,264 ---- if ( $sub_id == "0" ) { ! $block_title = ( isset( $HTTP_POST_VARS['block_title'] ) ) ? htmlspecialchars(trim( $HTTP_POST_VARS['block_title'] ) ) : $block_config[$block_id]['block_title']; ! $block_desc = htmlspecialchars(trim( $HTTP_POST_VARS['block_desc'] ) ); $show_block = intval( $HTTP_POST_VARS['show_block'] ); $show_title = intval( $HTTP_POST_VARS['show_title'] ); *************** *** 267,271 **** } ! mx_add_search_words( 'single', $block_id, stripslashes( str_replace( "\'", "''", $new[$block_info_par] ) ), stripslashes( str_replace( "\'", "''", $block_title ) ) ); } --- 283,287 ---- } ! mx_add_search_words( 'single', $block_id, stripslashes( str_replace( "\'", "''", $new[$block_text_par] ) ), stripslashes( str_replace( "\'", "''", $block_title ) ) ); } *************** *** 289,317 **** } ! $block_info = $new[$block_info_par]; ! $bbcode_uid = $block_config[$block_id][$block_info_par]['bbcode_uid']; $blog_id = trim( stripslashes( $new[$blog_id_par] )); ! if ( $preview ) ! { ! $preview_title = trim( strip_tags( stripslashes( $block_title ) ) ); ! $preview_info = trim( $block_info ) ; ! $preview_info = preg_replace( '#<textarea>#si', '<textarea>', $preview_info ); ! } if ( $mode != 'edithtml' ) { ! $block_info = preg_replace( "/\:(([a-z0-9]:)?)$bbcode_uid/si", '', $block_info ); ! $block_info = str_replace( '<br />', "\n", $block_info ); ! $block_info = preg_replace( '#</textarea>#si', '</textarea>', $block_info ); ! $block_info = trim( stripslashes( $block_info ) ); } else { $block_title = trim( strip_tags( stripslashes( $block_title ) ) ); ! $block_info = str_replace( '<br />', "\n", $block_info ); ! $block_info = preg_replace( '#</textarea>#si', '</textarea>', $block_info ); ! $block_info = trim( stripslashes( $block_info ) ); } // Style parameters --- 305,329 ---- } ! $block_text = $new[$block_text_par]; ! $bbcode_uid = $block_config[$block_id][$block_text_par]['bbcode_uid']; $blog_id = trim( stripslashes( $new[$blog_id_par] )); ! $block_text = htmlspecialchars( trim( stripslashes( $block_text ) ) ) ; ! $block_title = htmlspecialchars( trim( stripslashes( $block_title ) ) ) ; if ( $mode != 'edithtml' ) { ! $block_text = preg_replace( "/\:(([a-z0-9]:)?)$bbcode_uid/si", '', $block_text ); ! $block_text = str_replace( '<br />', "\n", $block_text ); ! $block_text = preg_replace( '#</textarea>#si', '</textarea>', $block_text ); ! $block_text = trim( stripslashes( $block_text ) ); } else { $block_title = trim( strip_tags( stripslashes( $block_title ) ) ); ! $block_text = str_replace( '<br />', "\n", $block_text ); ! $block_text = preg_replace( '#</textarea>#si', '</textarea>', $block_text ); ! $block_text = trim( stripslashes( $block_text ) ); } // Style parameters *************** *** 355,358 **** --- 367,371 ---- $show_stats_yes = ( $show_stats == 1 ) ? "checked=\"checked\"" : ""; $show_stats_no = ( $show_stats == 0 ) ? "checked=\"checked\"" : ""; + // Start output, first preview, then errors then post form *************** *** 376,379 **** --- 389,397 ---- if ( $preview && !$error ) { + $preview_title = $block_title; + $preview_text = $block_text; + + // $preview_text = preg_replace( '#<textarea>#si', '<textarea>', $preview_text ); + $orig_word = array(); $replacement_word = array(); *************** *** 384,408 **** $bbcode_uid = make_bbcode_uid(); } ! // $preview_info = stripslashes(preg_replace($html_entities_match, $html_entities_replace, $preview_info)); ! $preview_info = stripslashes( prepare_message( $preview_info, $html_on, $bbcode_on, $smilies_on, $bbcode_uid ) ); // Finalise processing as per viewtopic - if ( !$html_on ) - { - if ( $user_sig != '' || !$userdata['user_allowhtml'] ) - { - $user_sig = preg_replace( '#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig ); - } - } - - if ( $attach_sig && $user_sig != '' && $userdata['user_sig_bbcode_uid'] ) - { - $user_sig = bbencode_second_pass( $user_sig, $userdata['user_sig_bbcode_uid'] ); - } - if ( $bbcode_on && $mode != 'edithtml' ) { ! $preview_info = bbencode_second_pass( $preview_info, $bbcode_uid ); } --- 402,416 ---- $bbcode_uid = make_bbcode_uid(); } ! ! //$mxbb_tmp = $board_config['allow_html_tags']; //Should we have specfic allowed tags spec for mx textblocks? ! //$board_config['allow_html_tags'] = ''; ! $preview_text = stripslashes(prepare_message(addslashes(unprepare_message($preview_text)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid)); ! //$board_config['allow_html_tags'] = $mxbb_tmp; // Finalise processing as per viewtopic if ( $bbcode_on && $mode != 'edithtml' ) { ! $preview_text = bbencode_second_pass( $preview_text, $bbcode_uid ); } *************** *** 410,423 **** { $preview_title = preg_replace( $orig_word, $replacement_word, $preview_title ); ! $preview_info = preg_replace( $orig_word, $replacement_word, $preview_info ); } if ( $smilies_on && $mode != 'edithtml' ) { ! $preview_info = mx_smilies_pass( $preview_info ); } ! $preview_info = make_clickable( $preview_info ); ! $preview_info = str_replace( "\n", '<br />', $preview_info ); $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />'; --- 418,435 ---- { $preview_title = preg_replace( $orig_word, $replacement_word, $preview_title ); ! $preview_text = preg_replace( $orig_word, $replacement_word, $preview_text ); } if ( $smilies_on && $mode != 'edithtml' ) { ! $preview_text = mx_smilies_pass( $preview_text ); } ! $preview_text = make_clickable( $preview_text ); ! ! if ( $mode != 'edithtml' ) ! { ! $preview_text = str_replace( "\n", '<br />', $preview_text ); ! } $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" />'; *************** *** 429,433 **** $template->assign_vars( array( 'BLOCK_TITLE' => $preview_title, ! 'BLOCK_INFO' => $preview_info, 'S_HIDDEN_FIELDS' => $s_hidden_fields, --- 441,445 ---- $template->assign_vars( array( 'BLOCK_TITLE' => $preview_title, ! 'BLOCK_INFO' => $preview_text, 'S_HIDDEN_FIELDS' => $s_hidden_fields, *************** *** 463,470 **** { $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx?mode=edit"; ! }elseif ( $mode == 'edithtml' ) { $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx?mode=edithtml"; ! }elseif ( $mode == 'editblog' ) { $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx?mode=editblog"; --- 475,484 ---- { $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx?mode=edit"; ! } ! elseif ( $mode == 'edithtml' ) { $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx?mode=edithtml"; ! } ! elseif ( $mode == 'editblog' ) { $POST_ACTION = $module_root_path . "admin/mx_textblock_edit.$phpEx?mode=editblog"; *************** *** 506,514 **** 'L_EXPLAIN' => $lang['Block_admin_explain'], 'BLOCK_TITLE' => $block_title, ! 'BLOCK_INFO' => $block_info, 'HTML_STATUS' => $html_status, 'SMILIES_STATUS' => $smilies_status, ! 'BLOCK_TEXT_NAME' => $block_info_par, 'L_BLOCK_STYLE' => $lang['Block_Style'], --- 520,528 ---- 'L_EXPLAIN' => $lang['Block_admin_explain'], 'BLOCK_TITLE' => $block_title, ! 'BLOCK_INFO' => $block_text, 'HTML_STATUS' => $html_status, 'SMILIES_STATUS' => $smilies_status, ! 'BLOCK_TEXT_NAME' => $block_text_par, 'L_BLOCK_STYLE' => $lang['Block_Style'], |