|
From: Jon O. <jon...@us...> - 2005-05-06 06:48:22
|
Update of /cvsroot/mxbb/core27x/modules/mx_textblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13016/modules/mx_textblocks Added Files: TextBlocks.pak mx_textblock_bbcode.php mx_textblock_html.php mx_textblock_multi.php Log Message: Initital core 2.7.x commit :-) --- NEW FILE: mx_textblock_html.php --- <?php /*************************************************************************** * mx_block_html.php * ------------------- * begin : Octobre, 2002 * copyright : (C) 2002 MX-System * email : su...@mx... * * $Id: mx_textblock_html.php,v 1.1 2005/05/06 06:48:08 jonohlsson Exp $ * ***************************************************************************/ $block_config = read_block_config( $block_id ); $title = $block_config[$block_id]['block_title']; $message = $block_config[$block_id][Html]['parameter_value']; // // Start output of page // $template->set_filenames(array( "body_block" => "mx_textblock_html.tpl") ); $is_auth_ary = array(); $is_auth_ary = block_auth(AUTH_EDIT, $block_id , $userdata, $block_config[$block_id][auth_edit], $block_config[$block_id][auth_edit_group] ); //if( $userdata['user_level'] == ADMIN ) //{ 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" />'; $edit_url = append_sid( $module_root_path . "admin/mx_textblock_edit.php" ); $edit_img = '<input type="image" src="' . PHPBB_URL . $images['icon_edit'] . '" alt="' . $lang['Block_Edit'] . '" title="' . $lang['Block_Edit'] . '"></input>'; $template->assign_block_vars("switch_admin", array()); } else { $template->assign_block_vars("switch_not_admin", array()); }; $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, 'BLOCK_ID' => $block_id, 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields) ); $template->pparse("body_block"); ?> --- NEW FILE: TextBlocks.pak --- module=+:20=+:Text Blocks=+:modules/mx_textblocks/=+:Textblocks module=+: function=+:20=+:20=+:TextBlock_BBcode=+:TextBlock_BBcode=+:mx_textblock_bbcode.php=+:modules/mx_textblock/admin/admin_mx_textblock_edit.php parameter=+:20=+:15=+:Text=+:BBText=+:Insert your text here=+: block=+:1=+:Welcome=+:=+:20=+:0=+:5=+:0 function=+:20=+:21=+:TextBlock_Html=+:TextBlock_Html=+:mx_textblock_html.php=+:modules/mx_textblock/admin/admin_mx_textblock_html_edit.php parameter=+:21=+:16=+:Html=+:Html=+:Entre your Html code here=+: function=+:20=+:22=+:TextBlock_Multi=+:Textblock for bbcode and html with parameters=+:mx_textblock_multi.php=+:modules/mx_textblock/admin/admin_mx_textblock_edit.php parameter=+:22=+:50=+:Text=+:BBText=+:Enter your block text here=+: parameter=+:22=+:51=+:Text_Style=+:Values=+:none=+: option=+:11=+:51=+:none=+:No text style option=+:12=+:51=+:gen=+:General text (gen) option=+:13=+:51=+:genmed=+:General text medium sized (genmed) option=+:14=+:51=+:gensmall=+:General text small sized (gensmall) option=+:15=+:51=+:postbody=+:Posting body (postbody) parameter=+:22=+:52=+:Block_Style=+:Boolean=+:TRUE=+: parameter=+:22=+:53=+:Title_Style=+:Boolean=+:TRUE=+: parameter=+:22=+:54=+:Show_Title=+:Boolean=+:TRUE=+: --- NEW FILE: mx_textblock_multi.php --- <?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']; $page_num = $page_num - 1; } else { $page_num = 0; } $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][Text]['bbcode_uid']; $message = mx_decode( $message, $bbcode_uid ) ; // // Start output of page // $template->set_filenames(array( "body_block" => "mx_textblock_multi.tpl") ); $is_auth_ary = array(); $is_auth_ary = block_auth(AUTH_EDIT, $block_id , $userdata, $block_config[$block_id][auth_edit], $block_config[$block_id][auth_edit_group] ); $title_style = (($title_style=='') || ($title_style=='FALSE')) ? 0 : 1; $show_title = (($show_title=='') || ($show_title=='FALSE')) ? 0 : 1; 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" ); $edit_img = '<input type="image" src="' . PHPBB_URL . $images['icon_edit'] . '" alt="' . $lang['Block_Edit'] . '" title="' . $lang['Block_Edit'] . '"></input>'; if ( $title_style ) { $template->assign_block_vars("switch_admin_style", array()); } else { $template->assign_block_vars("switch_admin_nostyle", array()); } } else { if ( $title_style && $show_title) { $template->assign_block_vars("switch_not_admin_style", array()); } elseif ( !$title_style && $show_title) { $template->assign_block_vars("switch_not_admin_nostyle", array()); } }; $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"); ?> --- NEW FILE: mx_textblock_bbcode.php --- <?php /*************************************************************************** * mx_block.php * ------------------- * begin : Octobre, 2002 * copyright : (C) 2002 MX-System * email : su...@mx... * * $Id: mx_textblock_bbcode.php,v 1.1 2005/05/06 06:48:08 jonohlsson Exp $ * ***************************************************************************/ // // Read block Configuration // $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") ); $is_auth_ary = array(); $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" ); $edit_img = '<input type="image" src="' . PHPBB_URL . $images['icon_edit'] . '" alt="' . $lang['Block_Edit'] . '" title="' . $lang['Block_Edit'] . '"></input>'; $template->assign_block_vars("switch_admin", array()); } else { $template->assign_block_vars("switch_not_admin", array()); }; $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, 'BLOCK_ID' => $block_id, 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields )); $template->pparse("body_block"); ?> |