[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/bbcode_shortcodes.php,v $ 14 | $Revision: 1.11 $ 15 | $Date: 2007/02/11 10:40:16 $ 16 | $Author: e107steved $ 17 +----------------------------------------------------------------------------+ 18 */ 19 if (!defined('e107_INIT')) { exit; } 20 21 include_once(e_HANDLER.'shortcode_handler.php'); 22 include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_ren_help.php"); 23 global $register_bb; 24 $bbcode_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__); 25 26 /* 27 SC_BEGIN BB 28 29 global $pref, $eplug_bb, $bbcode_func, $bbcode_help, $bbcode_filedir, $bbcode_imagedir, $bbcode_helpactive, $bbcode_helptag, $register_bb; 30 31 if(e_WYSIWYG){ return; } 32 33 $bbcode_func = ($bbcode_func) ? $bbcode_func : "addtext"; 34 $bbcode_help = ($bbcode_help) ? $bbcode_help : "help"; 35 $bbcode_tag = ($bbcode_helptag != 'helpb') ? ",'$bbcode_helptag'" : ""; 36 37 $rand = rand(1000,9999); 38 $imagedir_display = str_replace("../","",$bbcode_imagedir); 39 40 if($parm == "emotes" && $pref['comments_emoticons'] && $pref['smiley_activate'] && !e_WYSIWYG) 41 { 42 $bbcode['emotes'] = array("expandit","emoticon_selector_".$rand, LANHELP_44, "emotes.png", "Emoticon_Select", "emoticon_selector_".$rand); 43 } 44 45 // Format: $bbcode['UNIQUE_NAME'] = array(ONCLICK_FUNC, ONCLICK_VAR, HELPTEXT, ICON, INCLUDE_FUNC, INCLUDE_FUNCTION_VAR); 46 47 $bbcode['newpage'] = array($bbcode_func,"[newpage]", LANHELP_34, "newpage.png"); 48 $bbcode['link'] = array($bbcode_func,"[link=".LANHELP_35."][/link]", LANHELP_23,"link.png"); 49 $bbcode['b'] = array($bbcode_func,"[b][/b]", LANHELP_24,"bold.png"); 50 $bbcode['i'] = array($bbcode_func,"[i][/i]", LANHELP_25,"italic.png"); 51 $bbcode['u'] = array($bbcode_func,"[u][/u]", LANHELP_26,"underline.png"); 52 $bbcode['center'] = array($bbcode_func,"[center][/center]", LANHELP_28,"center.png"); 53 $bbcode['left'] = array($bbcode_func,"[left][/left]", LANHELP_29,"left.png"); 54 $bbcode['right'] = array($bbcode_func,"[right][/right]", LANHELP_30,"right.png"); 55 $bbcode['bq'] = array($bbcode_func,"[blockquote][/blockquote]", LANHELP_31,"blockquote.png"); 56 $bbcode['code'] = array($bbcode_func,"[code][/code]", LANHELP_32,"code.png"); 57 $bbcode['list'] = array($bbcode_func,"[list][/list]", LANHELP_36,"list.png"); 58 $bbcode['img'] = array($bbcode_func,"[img][/img]", LANHELP_27,"image.png"); 59 $bbcode['flash'] = array($bbcode_func,"[flash=width,height][/flash]", LANHELP_47,"flash.png"); 60 61 $bbcode['fontsize'] = array("expandit","size_selector_".$rand, LANHELP_22,"fontsize.png","Size_Select",'size_selector_'.$rand); 62 $bbcode['fontcol'] = array("expandit","col_selector_".$rand, LANHELP_21,"fontcol.png","Color_Select",'col_selector_'.$rand); 63 $bbcode['preimage'] = array("expandit","preimage_selector_".$rand, LANHELP_45.$imagedir_display,"preimage.png","PreImage_Select","preimage_selector_".$rand); 64 $bbcode['prefile'] = array("expandit","prefile_selector_".$rand, LANHELP_39,"prefile.png","PreFile_Select",'prefile_selector_'.$rand); 65 66 if(!isset($iconpath[$parm])) 67 { 68 $iconpath[$parm] = (file_exists(THEME."bbcode/bold.png") ? THEME."bbcode/" : e_IMAGE."generic/bbcode/"); 69 $iconpath[$parm] .= $bbcode[$parm][3]; 70 } 71 72 73 foreach($register_bb as $key=>$val) // allow themes to plug in to it. 74 { 75 if($val[0]=="") 76 { 77 $val[0] = $bbcode_func; 78 } 79 $bbcode[$key] = $val; 80 $iconpath[$key] = $val[3]; 81 } 82 83 84 foreach($eplug_bb as $key=>$val) // allow plugins to plug into it. 85 { 86 extract($val); 87 // echo "$onclick $onclick_var $helptext $icon <br />"; 88 $bbcode[$name] = array($onclick,$onclick_var,$helptext,$icon,$function,$function_var); 89 $iconpath[$name] = $icon; 90 } 91 92 93 $_onclick_func = ($bbcode[$parm][0]) ? $bbcode[$parm][0] : $bbcode_func; 94 $_onclick_var = $bbcode[$parm][1]; 95 $_helptxt = $bbcode[$parm][2]; 96 $_function = $bbcode[$parm][4]; 97 $_function_var = $bbcode[$parm][5]; 98 99 100 if($bbcode[$parm]) // default - insert text. 101 { 102 $text = "\n<img class='bbcode bbcode_buttons' style='cursor:pointer' src='".$iconpath[$parm]."' alt='' title='".$_helptxt."' onclick=\"{$_onclick_func}('".$_onclick_var."')\" ".($bbcode_helpactive ? "onmouseout=\"{$bbcode_help}(''{$bbcode_tag})\" onmouseover=\"{$bbcode_help}('".$_helptxt."'{$bbcode_tag})\"" : "" )." />\n"; 103 } 104 105 if($_function) 106 { 107 108 $text .= ($bbcode_helpactive && $_helptxt && !$iconpath[$parm]) ? "<span onmouseout=\"{$bbcode_help}(''{$bbcode_tag})\" onmouseover=\"{$bbcode_help}('".$_helptxt."'{$bbcode_tag})\" >" : ""; 109 $text .= $_function($_function_var); 110 $text .= ($bbcode_helpactive && $_helptxt && !$iconpath[$parm]) ? "</span>" : ""; 111 } 112 113 return $text; 114 115 116 117 118 SC_END 119 120 121 122 123 SC_BEGIN BB_HELP 124 if(e_WYSIWYG){ return; } 125 global $bbcode_helpactive,$bbcode_helptag; 126 $bbcode_helptag = ($parm) ? $parm : "helpb"; 127 $bbcode_helpactive = TRUE; 128 return "<input id='{$bbcode_helptag}' class='helpbox' type='text' name='{$bbcode_helptag}' size='100' />\n"; 129 SC_END 130 131 132 133 SC_BEGIN BB_PREIMAGEDIR 134 if(e_WYSIWYG){ return; } 135 global $bbcode_imagedir; 136 $bbcode_imagedir = $parm; 137 return; 138 SC_END 139 140 141 */ 142 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |