|
From: Markus P. <mar...@us...> - 2005-04-26 19:52:36
|
Update of /cvsroot/mxbb/core/modules/mx_textblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1355/mx_textblocks Modified Files: mx_textblock_bbcode.php mx_textblock_blog.php mx_textblock_html.php mx_textblock_multi.php Log Message: Code cleanup and fixed XHTML issues in some templates. Index: mx_textblock_html.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_textblocks/mx_textblock_html.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mx_textblock_html.php 12 Apr 2005 17:38:37 -0000 1.6 --- mx_textblock_html.php 26 Apr 2005 19:52:18 -0000 1.7 *************** *** 12,16 **** */ ! /** * 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 --- 12,16 ---- */ ! /** * 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 *************** *** 18,51 **** * (at your option) any later version. */ ! ! $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); // Start output of page ! $template->set_filenames( array( "body_block" => "mx_textblock_html.tpl" ) ! ); ! ! $template->assign_vars( array( 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => ( !empty( $lang[$title] ) ? $lang[$title] : $title ), ! 'S_ACTION' => $edit_url, ! 'U_URL' => append_sid( PORTAL_URL . 'index.' . $phpEx . '?block_id=' . $block_id ), ! '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, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields ) ! ); ! $template->pparse( "body_block" ); ?> \ No newline at end of file --- 18,60 ---- * (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); + // // Start output of page + // + $template->set_filenames(array( + 'body_block' => 'mx_textblock_html.tpl') + ); ! $template->assign_vars(array( ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ), ! 'L_TITLE' => ( !empty($lang[$title]) ? $lang[$title] : $title ), ! 'S_ACTION' => $edit_url, ! 'U_URL' => append_sid(PORTAL_URL . 'index.' . $phpEx . '?block_id=' . $block_id), ! '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, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields) ! ); ! $template->pparse('body_block'); ?> \ No newline at end of file Index: mx_textblock_multi.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_textblocks/mx_textblock_multi.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mx_textblock_multi.php 12 Apr 2005 17:38:37 -0000 1.8 --- mx_textblock_multi.php 26 Apr 2005 19:52:18 -0000 1.9 *************** *** 12,16 **** */ ! /** * 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 --- 12,16 ---- */ ! /** * 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 *************** *** 18,23 **** * (at your option) any later version. */ ! ! $block_config = read_block_config( $block_id ); $title = $block_config[$block_id]['block_title']; --- 18,29 ---- * (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']; *************** *** 36,51 **** // 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']; $page_num = $page_num - 1; } --- 42,60 ---- // 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']; $page_num = $page_num - 1; } *************** *** 55,90 **** } ! $art_pages = explode( '[page]', $message ); ! $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 ) ; } - - // Start output of page ! $template->set_filenames( array( "body_block" => "mx_textblock_multi.tpl" ) ! ); ! if ( $show_title == 'TRUE' ) { ! if ( $title_style == 'TRUE' ) { ! $template->assign_block_vars( "switch_standard_style", array() ); } else { ! $template->assign_block_vars( "switch_no_style", array() ); } } --- 64,101 ---- } ! $art_pages = explode('[page]', $message); ! $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); } ! // ! // Start output of page ! // ! $template->set_filenames(array( ! 'body_block' => 'mx_textblock_multi.tpl') ! ); ! if( $show_title == 'TRUE' ) { ! if( $title_style == 'TRUE' ) { ! $template->assign_block_vars('switch_standard_style', array()); } else { ! $template->assign_block_vars('switch_no_style', array()); } } *************** *** 93,202 **** $text_style = ( ( $text_style == '' ) || ( $text_style == 'none' ) ) ? 'genmed' : $text_style; ! $template->assign_vars( array( 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => ( !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( "index.php?page=$page_id&mode=pagination&page_num=$page_number" . $xtra_dynamic ); $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( "index.php?page=$page_id&mode=pagination&page_num=$page_number" . $xtra_dynamic ); $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . '</a>'; } --- 104,223 ---- $text_style = ( ( $text_style == '' ) || ( $text_style == 'none' ) ) ? 'genmed' : $text_style; ! $template->assign_vars(array( ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ), ! 'L_TITLE' => ( !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" . $xtra_dynamic); $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>'; } *************** *** 206,222 **** } ! 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 --- 227,244 ---- } ! 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_blog.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_textblocks/mx_textblock_blog.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_textblock_blog.php 13 Apr 2005 21:23:28 -0000 1.7 --- mx_textblock_blog.php 26 Apr 2005 19:52:18 -0000 1.8 *************** *** 12,16 **** */ ! /** * 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 --- 12,16 ---- */ ! /** * 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 *************** *** 18,30 **** * (at your option) any later version. */ ! ! if ( isset( $HTTP_POST_VARS['u'] ) || isset( $HTTP_GET_VARS['u'] ) ) { ! $sub_id = ( isset( $HTTP_POST_VARS['u'] ) ) ? intval( $HTTP_POST_VARS['u'] ) : intval( $HTTP_GET_VARS['u'] ); $blog_mode = 'user'; } ! else if ( isset( $HTTP_POST_VARS['g'] ) || isset( $HTTP_GET_VARS['g'] ) ) { ! $sub_id = ( isset( $HTTP_POST_VARS['g'] ) ) ? intval( $HTTP_POST_VARS['g'] ) : intval( $HTTP_GET_VARS['g'] ); $blog_mode = 'group'; } --- 18,36 ---- * (at your option) any later version. */ ! ! if( !defined('IN_PORTAL') ) { ! die("Hacking attempt"); ! } ! ! ! if( isset($HTTP_POST_VARS['u']) || isset($HTTP_GET_VARS['u']) ) ! { ! $sub_id = ( isset($HTTP_POST_VARS['u']) ) ? intval($HTTP_POST_VARS['u']) : intval($HTTP_GET_VARS['u']); $blog_mode = 'user'; } ! else if( isset($HTTP_POST_VARS['g']) || isset($HTTP_GET_VARS['g']) ) { ! $sub_id = ( isset($HTTP_POST_VARS['g']) ) ? intval($HTTP_POST_VARS['g']) : intval($HTTP_GET_VARS['g']); $blog_mode = 'group'; } *************** *** 38,42 **** } ! $block_config = read_block_config( $block_id, false, $sub_id ); $title = $block_config[$block_id]['block_title']; --- 44,48 ---- } ! $block_config = read_block_config($block_id, false, $sub_id); $title = $block_config[$block_id]['block_title']; *************** *** 51,66 **** // 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']; $page_num = $page_num - 1; } --- 57,75 ---- // 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']; $page_num = $page_num - 1; } *************** *** 70,87 **** } ! $art_pages = explode( '[page]', $message ); ! $message = trim( $art_pages[$page_num] ); ! $message = str_replace( '[toc]', '', $message ); // End Pages/TOC $bbcode_uid = $block_config[$block_id]['Blog']['bbcode_uid']; ! $message = mx_decode( $message, $bbcode_uid ) ; // EDIT BLOG ! $iss_auth_ary = array(); ! $iss_auth_ary = block_auth( AUTH_EDIT, $block_id , $userdata, $block_config[$block_id][auth_edit], $block_config[$block_id][auth_edit_group] ); ! $blog_validate = ( $blog_mode == 'user' ) ? $sub_id == $userdata['user_id'] : mx_auth_group( $sub_id, true ); ! if ( $blog_validate || $iss_auth_ary[auth_edit] ) { $ss_hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; --- 79,100 ---- } ! $art_pages = explode('[page]', $message); ! $message = trim($art_pages[$page_num]); ! $message = str_replace('[toc]', '', $message); ! ! // // End Pages/TOC + // $bbcode_uid = $block_config[$block_id]['Blog']['bbcode_uid']; ! $message = mx_decode($message, $bbcode_uid); + // // EDIT BLOG ! // ! $iss_auth_ary = block_auth(AUTH_EDIT, $block_id, $userdata, $block_config[$block_id]['auth_edit'], $block_config[$block_id]['auth_edit_group']); ! $blog_validate = ( $blog_mode == 'user' ) ? $sub_id == $userdata['user_id'] : mx_auth_group($sub_id, true); ! if( $blog_validate || $iss_auth_ary['auth_edit'] ) { $ss_hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; *************** *** 89,94 **** $ss_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $page_id . '" />'; $ss_hidden_fields .= '<input type="hidden" name="mode" value="editblog" />'; ! //$ss_hidden_fields .= '<input type="hidden" name="u" value="' . intval( $HTTP_GET_VARS['u'] ) . '" />'; ! //$ss_hidden_fields .= '<input type="hidden" name="g" value="' . intval( $HTTP_GET_VARS['g'] ) . '" />'; $ss_hidden_fields .= '<input type="hidden" name="u" value="' . $sub_id. '" />'; $ss_hidden_fields .= '<input type="hidden" name="g" value="' . $sub_id. '" />'; --- 102,107 ---- $ss_hidden_fields .= '<input type="hidden" name="portalpage" value="' . $page_id . '" />'; $ss_hidden_fields .= '<input type="hidden" name="mode" value="editblog" />'; ! //$ss_hidden_fields .= '<input type="hidden" name="u" value="' . intval($HTTP_GET_VARS['u']) . '" />'; ! //$ss_hidden_fields .= '<input type="hidden" name="g" value="' . intval($HTTP_GET_VARS['g']) . '" />'; $ss_hidden_fields .= '<input type="hidden" name="u" value="' . $sub_id. '" />'; $ss_hidden_fields .= '<input type="hidden" name="g" value="' . $sub_id. '" />'; *************** *** 98,127 **** $splitt_admin_file = 'modules/mx_textblocks/admin/mx_textblock_edit.php'; $editt_url = append_sid( $mx_root_path . $splitt_admin_file . "?sid=" . $userdata['session_id'] ); ! $editt_img = '<input type="image" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/block_icons/block_edit.gif" alt="' . $lang['Block_Edit'] . '" title="' . $lang['Block_Edit'] . ' :: ' . $block_config[$block_id][block_title] . '"></input>'; ! $template->assign_block_vars( "switch_blog_edit", array( 'EDIT_ACTION' => $editt_url, ! 'EDIT_IMG' => $editt_img, ! 'S_HIDDEN_FORM_FIELDS' => $ss_hidden_fields ! ) ); } else { ! $template->assign_block_vars( "switch_blog_noedit", array() ); } // Start output of page ! $template->set_filenames( array( "body_block" => "mx_textblock_blog.tpl" ) ! ); ! ! if ( $show_title == 'TRUE' ) { ! if ( $title_style == 'TRUE' ) { ! $template->assign_block_vars( "switch_standard_style", array() ); } else { ! $template->assign_block_vars( "switch_no_style", array() ); } } --- 111,143 ---- $splitt_admin_file = 'modules/mx_textblocks/admin/mx_textblock_edit.php'; $editt_url = append_sid( $mx_root_path . $splitt_admin_file . "?sid=" . $userdata['session_id'] ); ! $editt_img = '<input type="image" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/block_icons/block_edit.gif" alt="' . $lang['Block_Edit'] . '" title="' . $lang['Block_Edit'] . ' :: ' . $block_config[$block_id]['block_title'] . '"></input>'; ! $template->assign_block_vars('switch_blog_edit', array( ! 'EDIT_ACTION' => $editt_url, ! 'EDIT_IMG' => $editt_img, ! 'S_HIDDEN_FORM_FIELDS' => $ss_hidden_fields ! )); } else { ! $template->assign_block_vars('switch_blog_noedit', array()); } + // // Start output of page + // + $template->set_filenames(array( + 'body_block' => 'mx_textblock_blog.tpl') + ); ! if( $show_title == 'TRUE' ) { ! if( $title_style == 'TRUE' ) { ! $template->assign_block_vars('switch_standard_style', array()); } else { ! $template->assign_block_vars('switch_no_style', array()); } } *************** *** 130,200 **** $text_style = ( ( $text_style == '' ) || ( $text_style == 'none' ) ) ? 'genmed' : $text_style; ! if ( !empty($blog_id) && $userdata['session_logged_in'] && $blog_mode == 'user' ) { ! $template->assign_block_vars( "switch_blog_id", array( ! 'BLOG_ID' => sprintf( $blog_id, $userdata['username'] ) ! ) ); } ! $template->assign_vars( array( 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => ( !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'] ! ) ); // 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 --- 146,221 ---- $text_style = ( ( $text_style == '' ) || ( $text_style == 'none' ) ) ? 'genmed' : $text_style; ! if( !empty($blog_id) && $userdata['session_logged_in'] && $blog_mode == 'user' ) { ! $template->assign_block_vars('switch_blog_id', array( ! 'BLOG_ID' => sprintf($blog_id, $userdata['username']) ! )); } ! $template->assign_vars(array( ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ), ! 'L_TITLE' => ( !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'] ! )); + // // 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 *************** *** 203,239 **** $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>'; } --- 224,262 ---- $page_toc = $art_pages[$i]; ! if( $page_num != $i ) { ! $temp_url = append_sid(PORTAL_URL . "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(PORTAL_URL . "index.php?page=$page_id&mode=article&page_num=$page_number"); $page_link = '<a href="' . $temp_url . '" class="nav">' . $page_number . '</a>'; } *************** *** 243,257 **** } ! 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 --- 266,281 ---- } ! 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/core/modules/mx_textblocks/mx_textblock_bbcode.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_textblock_bbcode.php 12 Apr 2005 17:38:37 -0000 1.7 --- mx_textblock_bbcode.php 26 Apr 2005 19:52:14 -0000 1.8 *************** *** 12,16 **** */ ! /** * 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 --- 12,16 ---- */ ! /** * 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 *************** *** 18,25 **** * (at your option) any later version. */ - - // Read block Configuration ! $block_config = read_block_config( $block_id ); $title = $block_config[$block_id]['block_title']; --- 18,31 ---- * (at your option) any later version. */ ! if( !defined('IN_PORTAL') ) ! { ! die("Hacking attempt"); ! } ! ! // ! // Read block Configuration ! // ! $block_config = read_block_config($block_id); $title = $block_config[$block_id]['block_title']; *************** *** 30,65 **** $smilies_on = $board_config['allow_smilies'] ? true : false; ! 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" ) ! ); ! ! $template->assign_vars( array( 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => ( !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, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields ! ) ); ! $template->pparse( "body_block" ); ?> \ No newline at end of file --- 36,74 ---- $smilies_on = $board_config['allow_smilies'] ? true : false; ! 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') + ); ! $template->assign_vars(array( ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ), ! 'L_TITLE' => ( !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, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields ! )); ! $template->pparse('body_block'); ?> \ No newline at end of file |