|
From: Jon O. <jon...@us...> - 2005-05-26 21:54:21
|
Update of /cvsroot/mxbb/core27x/modules/mx_textblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4750/core27x/modules/mx_textblocks Modified Files: mx_textblock_bbcode.php mx_textblock_html.php mx_textblock_multi.php Log Message: massive commit, for 2.7.7 http://www.mx-system.com/forum/viewtopic.php?t=6902 Index: mx_textblock_html.php =================================================================== RCS file: /cvsroot/mxbb/core27x/modules/mx_textblocks/mx_textblock_html.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_textblock_html.php 6 May 2005 06:48:08 -0000 1.1 --- mx_textblock_html.php 26 May 2005 21:54:09 -0000 1.2 *************** *** 11,18 **** ***************************************************************************/ ! $block_config = read_block_config( $block_id ); ! $title = $block_config[$block_id]['block_title']; ! $message = $block_config[$block_id][Html]['parameter_value']; // --- 11,33 ---- ***************************************************************************/ ! /** ! * 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"); ! } ! ! ! $block_config = read_block_config($block_id); ! ! $title = $block_config[$block_id]['block_title']; ! $message = $block_config[$block_id]['Html']['parameter_value']; ! ! $message = str_replace("\n", "\n<br />\n", $message); // *************** *** 20,24 **** // $template->set_filenames(array( ! "body_block" => "mx_textblock_html.tpl") ); --- 35,39 ---- // $template->set_filenames(array( ! 'body_block' => 'mx_textblock_html.tpl') ); *************** *** 31,36 **** if ( $is_auth_ary[auth_edit] ) { ! $s_hidden_fields = '<input type="hidden" name="id" value="' . $block_id . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="page" value="' . $page_id. '" />'; $s_hidden_fields .= '<input type="hidden" name="mode" value="edithtml" />'; --- 46,51 ---- if ( $is_auth_ary[auth_edit] ) { ! $s_hidden_fields = '<input type="hidden" name="block_id" value="' . $block_id . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $page_id. '" />'; $s_hidden_fields .= '<input type="hidden" name="mode" value="edithtml" />'; *************** *** 56,61 **** ); ! $template->pparse("body_block"); ! ?> --- 71,76 ---- ); ! $template->pparse('body_block'); ! ?> \ No newline at end of file Index: mx_textblock_multi.php =================================================================== RCS file: /cvsroot/mxbb/core27x/modules/mx_textblocks/mx_textblock_multi.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_textblock_multi.php 6 May 2005 06:48:08 -0000 1.1 --- mx_textblock_multi.php 26 May 2005 21:54:09 -0000 1.2 *************** *** 1,35 **** <?php ! /*************************************************************************** ! mx_block_html_floating.php ! * ------------------- ! * email : ban...@gm... ! * ! * ! ***************************************************************************/ ! $block_config = read_block_config( $block_id ); ! $title = $block_config[$block_id]['block_title']; ! $message = $block_config[$block_id][Text]['parameter_value']; ! $block_style = $block_config[$block_id][block_style]['parameter_value']; ! $text_style = $block_config[$block_id][text_style]['parameter_value']; ! $title_style = $block_config[$block_id][title_style]['parameter_value']; ! $show_title = $block_config[$block_id][show_title]['parameter_value']; // ********************************************************************** ! // Read language definition // ********************************************************************** ! ! if ( !file_exists($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx ) ) { ! include( $module_root_path . 'language/lang_english/lang_main.'.$phpEx ); ! } else { ! include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx ); ! } // Block Pages/toc ! if ( isset($HTTP_POST_VARS['page_num']) || isset($HTTP_GET_VARS['page_num']) ) { $page_num = ( isset($HTTP_POST_VARS['page_num']) ) ? $HTTP_POST_VARS['page_num'] : $HTTP_GET_VARS['page_num']; --- 1,57 ---- <?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( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! ! $block_config = read_block_config($block_id); ! $title = $block_config[$block_id]['block_title']; ! ! $message = $block_config[$block_id]['Text']['parameter_value']; ! ! $block_style = $block_config[$block_id]['block_style']['parameter_value']; ! $text_style = $block_config[$block_id]['text_style']['parameter_value']; ! $title_style = $block_config[$block_id]['title_style']['parameter_value']; ! $show_title = $block_config[$block_id]['show_title']['parameter_value']; ! ! $allow_bbcode = $board_config['allow_bbcode'] ? true : false; ! $allow_html = $board_config['allow_html'] ? true : false; ! $allow_smilies = $board_config['allow_smilies'] ? true : false; // ********************************************************************** ! // Read language definition // ********************************************************************** ! if( !file_exists($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) ) { ! include($module_root_path . 'language/lang_english/lang_main.' . $phpEx); ! } else { ! include($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); ! } + // // Block Pages/toc ! // ! if( isset($HTTP_POST_VARS['page_num']) || isset($HTTP_GET_VARS['page_num']) ) { $page_num = ( isset($HTTP_POST_VARS['page_num']) ) ? $HTTP_POST_VARS['page_num'] : $HTTP_GET_VARS['page_num']; *************** *** 38,42 **** else { ! $page_num = 0; } --- 60,64 ---- else { ! $page_num = 0; } *************** *** 44,51 **** $message = trim($art_pages[$page_num]); $message = str_replace('[toc]', '', $message); // End Pages/TOC ! $bbcode_uid = $block_config[$block_id][Text]['bbcode_uid']; ! $message = mx_decode( $message, $bbcode_uid ) ; // --- 66,83 ---- $message = trim($art_pages[$page_num]); $message = str_replace('[toc]', '', $message); + // // End Pages/TOC + // ! if( !$allow_html ) ! { ! $message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message); ! } ! ! if( $allow_bbcode ) ! { ! $bbcode_uid = $block_config[$block_id]['Text']['bbcode_uid']; ! $message = mx_decode($message, $bbcode_uid, $allow_smilies, $allow_bbcode); ! } // *************** *** 53,57 **** // $template->set_filenames(array( ! "body_block" => "mx_textblock_multi.tpl") ); --- 85,89 ---- // $template->set_filenames(array( ! 'body_block' => 'mx_textblock_multi.tpl') ); *************** *** 64,69 **** if ( $is_auth_ary[auth_edit] ) { ! $s_hidden_fields = '<input type="hidden" name="id" value="' . $block_id . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="page" value="' . $page_id. '" />'; $s_hidden_fields .= '<input type="hidden" name="mode" value="edit" />'; --- 96,101 ---- if ( $is_auth_ary[auth_edit] ) { ! $s_hidden_fields = '<input type="hidden" name="block_id" value="' . $block_id . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $page_id. '" />'; $s_hidden_fields .= '<input type="hidden" name="mode" value="edit" />'; *************** *** 92,217 **** }; ! $block_style = (($block_style=='') || ($block_style=='FALSE')) ? '' : 'forumline'; ! $text_style = (($text_style=='') || ($text_style=='none')) ? 'genmed' : $text_style; $template->assign_vars(array( ! 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => ( $show_title=='TRUE' ? '' : ( !empty( $lang[$title] ) ? $lang[$title] : $title ) ), ! 'S_ACTION' => $edit_url, ! 'U_TEXT' => $message, ! 'EDIT_IMG' => $edit_img, ! 'BLOCK_ID' => $block_id, ! 'BLOCK_STYLE' => $block_style, ! 'TEXT_STYLE' => $text_style, ! 'TITLE_STYLE' => $block_style, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields, ! 'L_TOC' => $lang['Toc_title'], ! 'L_GOTO_PAGE' => $lang['Goto_page'] ! )); ! // ! //article pages table of contents // ! if ( count($art_pages) > 1 ) { $template->assign_block_vars('switch_toc', array()); ! $i = 0; ! while($i < count($art_pages)) ! { $page_number = $i + 1; - - $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); ! } ! // ! // 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); ! } ! // ! // Replace naughty words ! // ! if ( count($orig_word) ) ! { ! $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]; if( $page_num != $i ) { ! $temp_url = append_sid("index.php?page=$page_id&mode=article&page_num=$page_number"); $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . ' - ' . $article_toc . '</a>'; } else { ! $page_link = $page_number . ' - ' . $article_toc ; } ! if( $i < count($art_pages) - 1 ) { ! $page_link .= '<br />'; } $template->assign_block_vars('switch_toc.pages', array( ! 'TOC_ITEM' => $page_link) ); ! $i++; } ! } ! // ! //article pages // ! if ( count($art_pages) > 1 ) { $template->assign_block_vars('switch_pages', array()); ! $i = 0; ! while($i < count($art_pages)) ! { $page_number = $i + 1; if( $page_num != $i ) { ! $temp_url = append_sid("index.php?page=$page_id&mode=article&page_num=$page_number"); ! $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . '</a>'; } else { ! $page_link = $page_number; } ! if( $i < count($art_pages) - 1 ) { ! $page_link .= ', '; } $template->assign_block_vars('switch_pages.pages', array( ! 'PAGE_LINK' => $page_link) ); ! $i++; } ! } ! $template->pparse("body_block"); ! ! ?> --- 124,267 ---- }; ! $block_style = ( ( $block_style == '' ) || ( $block_style == 'FALSE' ) ) ? '' : 'forumline'; ! $text_style = ( ( $text_style == '' ) || ( $text_style == 'none' ) ) ? 'genmed' : $text_style; $template->assign_vars(array( ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ), ! 'L_TITLE' => ( $show_title=='TRUE' ? '' : ( !empty( $lang[$title] ) ? $lang[$title] : $title ) ), ! 'S_ACTION' => $edit_url, ! 'U_TEXT' => $message, ! 'EDIT_IMG' => $edit_img, ! 'MOVE_L_IMG' => $move_l_img, ! 'MOVE_R_IMG' => $move_r_img, ! 'MOVE_U_IMG' => $move_u_img, ! 'MOVE_D_IMG' => $move_d_img, ! 'CACHE_IMG' => $cache_img, ! 'DELETE_IMG' => $delete_img, ! 'BLOCK_ID' => $block_id, ! 'BLOCK_STYLE' => $block_style, ! 'TEXT_STYLE' => $text_style, ! 'TITLE_STYLE' => $block_style, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields, ! 'L_TOC' => $lang['Toc_title'], ! 'L_GOTO_PAGE' => $lang['Goto_page'] ! )); ! ! $xtra_dynamic = isset($HTTP_GET_VARS['dynamic_block']) ? '&dynamic_block=' . $HTTP_GET_VARS['dynamic_block'] : ''; ! // ! // Formatting the TOC // ! if( count($art_pages) > 1 ) { $template->assign_block_vars('switch_toc', array()); ! $i = 0; ! ! while( $i < count($art_pages) ) ! { $page_number = $i + 1; ! $art_split = explode('[toc]', $art_pages[$i]); ! $article_toc = $art_split[0]; ! // $article_body = $art_split[1]; ! // ! // Fix up the toc title ! // ! if( !$allow_html ) ! { ! $article_toc = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $article_toc); ! } ! ! // ! // Parse message ! // ! $article_toc = preg_replace("/\[(\S+)\]/e", "", $article_toc); ! $article_toc = make_clickable($article_toc); ! ! // ! // Parse smilies ! // ! if( $allow_smilies ) ! { ! $article_toc = mx_smilies_pass($article_toc); ! } ! ! // ! // Replace naughty words ! // ! if( count($orig_word) ) ! { ! $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]; if( $page_num != $i ) { ! $temp_url = append_sid(PORTAL_URL . "index.php?page=$page_id&mode=pagination&page_num=$page_number"); $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . ' - ' . $article_toc . '</a>'; } else { ! $page_link = $page_number . ' - ' . $article_toc; } ! if( $i < count($art_pages) - 1 ) { ! $page_link .= '<br />'; } + $template->assign_block_vars('switch_toc.pages', array( ! 'TOC_ITEM' => $page_link) ); ! ! $i++; } ! } ! // ! // Formatting the TOC navigation/pagination // ! if( count($art_pages) > 1 ) { $template->assign_block_vars('switch_pages', array()); ! $i = 0; ! ! while( $i < count($art_pages) ) ! { $page_number = $i + 1; + if( $page_num != $i ) { ! $temp_url = append_sid(PORTAL_URL . "index.php?page=$page_id&mode=pagination&page_num=$page_number" . $xtra_dynamic); ! $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . '</a>'; } else { ! $page_link = $page_number; } ! if( $i < count($art_pages) - 1 ) { ! $page_link .= ', '; } + $template->assign_block_vars('switch_pages.pages', array( ! 'PAGE_LINK' => $page_link) ); ! ! $i++; } ! } ! $template->pparse('body_block'); ! ! ?> \ No newline at end of file Index: mx_textblock_bbcode.php =================================================================== RCS file: /cvsroot/mxbb/core27x/modules/mx_textblocks/mx_textblock_bbcode.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_textblock_bbcode.php 6 May 2005 06:48:08 -0000 1.1 --- mx_textblock_bbcode.php 26 May 2005 21:54:09 -0000 1.2 *************** *** 10,13 **** --- 10,25 ---- * ***************************************************************************/ + /** + * 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"); + } + // // Read block Configuration *************** *** 16,29 **** $block_config = read_block_config($block_id); ! $title = $block_config[$block_id]['block_title']; $message = $block_config[$block_id][Text]['parameter_value']; ! $bbcode_uid = $block_config[$block_id][Text]['bbcode_uid']; ! $message = mx_decode( $message, $bbcode_uid ) ; // // Start output of page // $template->set_filenames(array( "body_block" => "mx_textblock_bbcode.tpl") --- 28,53 ---- $block_config = read_block_config($block_id); ! $title = $block_config[$block_id]['block_title']; $message = $block_config[$block_id][Text]['parameter_value']; ! $bbcode_on = true; ! $html_on = false; ! $smilies_on = true; ! ! if( !$html_on ) ! { ! $message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message); ! } ! if( $bbcode_on ) ! { ! $bbcode_uid = $block_config[$block_id][Text]['bbcode_uid']; ! $message = mx_decode($message, $bbcode_uid, $smilies_on, $bbcode_on); ! } // // Start output of page // + $template->set_filenames(array( "body_block" => "mx_textblock_bbcode.tpl") *************** *** 33,41 **** $is_auth_ary = block_auth(AUTH_EDIT, $block_id , $userdata, $block_config[$block_id][auth_edit], $block_config[$block_id][auth_edit_group] ); ! if ( $is_auth_ary[auth_edit] ) { ! $s_hidden_fields = '<input type="hidden" name="id" value="' . $block_id . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="page" value="' . $page_id. '" />'; $s_hidden_fields .= '<input type="hidden" name="mode" value="edit" />'; $edit_url = append_sid( $module_root_path . "admin/mx_textblock_edit.php" ); --- 57,66 ---- $is_auth_ary = block_auth(AUTH_EDIT, $block_id , $userdata, $block_config[$block_id][auth_edit], $block_config[$block_id][auth_edit_group] ); ! if ( $is_auth_ary['auth_edit'] ) { ! $s_hidden_fields = '<input type="hidden" name="block_id" value="' . $block_id . '" />'; ! $s_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $page_id. '" />'; $s_hidden_fields .= '<input type="hidden" name="mode" value="edit" />'; + $s_hidden_fields .= '<input type="hidden" name="block_mode" value="bbcode" />'; $edit_url = append_sid( $module_root_path . "admin/mx_textblock_edit.php" ); *************** *** 60,64 **** )); ! $template->pparse("body_block"); ! ?> --- 85,89 ---- )); ! $template->pparse('body_block'); ! ?> \ No newline at end of file |