[ 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_handlers/ren_help.php,v $ 14 | $Revision: 1.61 $ 15 | $Date: 2006/12/24 13:35:32 $ 16 | $Author: mrpete $ 17 +----------------------------------------------------------------------------+ 18 */ 19 20 if (!defined('e107_INIT')) { exit; } 21 22 23 24 function ren_help($mode = 1, $addtextfunc = "addtext", $helpfunc = "help") 25 { 26 // ren_help() is deprecated - use display_help(). 27 return display_help("helpb", $mode, $addtextfunc, $helpfunc = "help"); 28 } 29 30 31 32 33 34 function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $helpfunc = "help") 35 { 36 if(e_WYSIWYG){ return; } 37 global $tp, $pref, $eplug_bb, $bbcode_func, $register_bb, $bbcode_help, $bbcode_helpactive, $bbcode_helptag; 38 39 $bbcode_func = $addtextfunc; 40 $bbcode_help = $helpfunc; 41 $bbcode_helptag = $tagid; 42 43 // load the template 44 if(is_readable(THEME."bbcode_template.php")) 45 { 46 include(THEME."bbcode_template.php"); 47 } 48 else 49 { 50 include(e_THEME."templates/bbcode_template.php"); 51 } 52 53 if($mode != 2 && $mode != "forum") 54 { 55 $bbcode_helpactive = TRUE; 56 } 57 58 // Load the Plugin bbcode AFTER the templates, so they can modify or replace. 59 foreach($pref['e_bb_list'] as $val) 60 { 61 if(is_readable(e_PLUGIN.$val."/e_bb.php")) 62 { 63 require(e_PLUGIN.$val."/e_bb.php"); 64 } 65 } 66 67 $temp['news'] = $BBCODE_TEMPLATE_NEWSPOST; 68 $temp['extended'] = $BBCODE_TEMPLATE_NEWSPOST; 69 $temp['admin'] = $BBCODE_TEMPLATE_ADMIN; 70 $temp['mailout'] = $BBCODE_TEMPLATE_ADMIN."{BB=shortcode}"; 71 $temp['cpage'] = $BBCODE_TEMPLATE_CPAGE; 72 $temp['maintenance']= $BBCODE_TEMPLATE_ADMIN; 73 $temp['comment'] = "{BB_HELP}<br />".$BBCODE_TEMPLATE; 74 75 if($temp[$mode]) 76 { 77 $BBCODE_TEMPLATE = $temp[$mode]; 78 } 79 if(is_readable(e_FILE."shortcode/batch/bbcode_shortcodes.php")) 80 { 81 require_once(e_FILE."shortcode/batch/bbcode_shortcodes.php"); 82 return $tp->parseTemplate($BBCODE_TEMPLATE, FALSE, $bbcode_shortcodes); 83 } 84 else 85 { 86 return "ERROR: ".e_FILE."shortcode/batch/bbcode_shortcodes.php IS NOT READABLE."; 87 } 88 89 } 90 91 92 function Size_Select($formid='size_selector') { 93 $text ="<!-- Start of Size selector --> 94 <div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}'>"; 95 $text .="<div style='position:absolute; bottom:30px; right:125px'>"; 96 $text .= "<table class='fborder' style='background-color: #fff'> 97 <tr><td class='forumheader3'> 98 <select class='tbox' name='preimageselect' onchange=\"addtext(this.value); expandit('{$formid}')\"> 99 <option value=''>".LANHELP_41."</option>"; 100 101 $sizes = array(7,8,9,10,11,12,14,15,18,20,22,24,26,28,30,36); 102 foreach($sizes as $s){ 103 $text .= "<option value='[size=".$s."][/size]'>".$s."px</option>\n"; 104 } 105 $text .="</select></td></tr> \n </table></div> 106 </div>\n<!-- End of Size selector -->"; 107 108 return $text; 109 } 110 111 112 function Color_Select($formid='col_selector') { 113 114 $text = "<!-- Start of Color selector --> 115 <div style='margin-left: 0px; margin-right: 0px; width: 221px; position: relative; z-index: 1000; float: right; display: none' id='{$formid}' onclick=\"this.style.display='none'\" > 116 <div style='position: absolute; bottom: 30px; right: 145px; width: 221px'>"; 117 118 $text .= "<script type='text/javascript'> 119 //<![CDATA[ 120 var maxtd = 18; 121 var maxtddiv = -1; 122 var coloursrgb = new Array('00', '33', '66', '99', 'cc', 'ff'); 123 var coloursgrey = new Array('000000', '333333', '666666', '999999', 'cccccc', 'ffffff'); 124 var colourssol = new Array('ff0000', '00ff00', '0000ff', 'ffff00', '00ffff', 'ff00ff'); 125 var rowswitch = 0; 126 var rowline = ''; 127 var rows1 = ''; 128 var rows2 = ''; 129 var notr = 0; 130 var tdblk = '<td style=\'background-color: #000000; cursor: default; height: 10px; width: 10px;\'><\/td>'; 131 var g = 1; 132 var s = 0; 133 134 function td_render(color) { 135 return '<td style=\'background-color: #' + color + '; height: 10px; width: 10px;\' onmousedown=\"addtext(\'[color=#' + color + '][/color]\')\"><\/td>'; 136 } 137 138 for (i=0; i < coloursrgb.length; i++) { 139 for (j=0; j < coloursrgb.length; j++) { 140 for (k=0; k < coloursrgb.length; k++) { 141 maxtddiv++; 142 if (maxtddiv % maxtd == 0) { 143 if (rowswitch) { 144 if (notr < 5){ 145 rows1 += '<\/tr><tr>' + td_render(coloursgrey[g]) + tdblk; 146 g++; 147 } 148 rowswitch = 0; 149 notr++; 150 }else{ 151 rows2 += '<\/tr><tr>' + td_render(colourssol[s]) + tdblk; 152 s++; 153 rowswitch = 1; 154 } 155 maxtddiv = 0; 156 } 157 rowline = td_render(coloursrgb[j] + coloursrgb[k] + coloursrgb[i]); 158 if (rowswitch) { 159 rows1 += rowline; 160 }else{ 161 rows2 += rowline; 162 } 163 } 164 } 165 } 166 document.write('<table cellspacing=\'1\' cellpadding=\'0\' style=\'cursor: pointer; background-color: #000; width: 100%; border: 0px\'><tr>'); 167 document.write(td_render(coloursgrey[0]) + tdblk + rows1 + rows2); 168 document.write('<\/tr><\/table>'); 169 //]]> 170 </script>"; 171 172 $text .="</div> 173 </div> 174 <!-- End of Color selector -->"; 175 176 return $text; 177 } 178 179 180 function PreImage_Select($formid) { 181 global $fl, $tp, $bbcode_imagedir; 182 183 $path = ($bbcode_imagedir) ? $bbcode_imagedir : e_IMAGE."newspost_images/"; 184 $formid = ($formid) ? ($formid) : "preimage_selector"; 185 186 187 if(!is_object($fl)){ 188 require_once(e_HANDLER."file_class.php"); 189 $fl = new e_file; 190 } 191 192 $rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*'); 193 $imagelist = $fl->get_files($path,"",$rejecthumb,2); 194 sort($imagelist); 195 196 $text ="<!-- Start of PreImage selector --> 197 <div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}'>"; 198 $text .="<div style='position:absolute; bottom:30px; right:100px'>"; 199 $text .= "<table class='fborder' style='background-color: #fff'> 200 <tr><td class='forumheader3' style='white-space: nowrap'>"; 201 202 if(!count($imagelist)) 203 { 204 205 $text .= LANHELP_46."<b>".str_replace("../","",$path)."</b>"; 206 } 207 else 208 { 209 $text .= "<select class='tbox' name='preimageselect' onchange=\"addtext(this.value); expandit('{$formid}')\"> 210 <option value=''>".LANHELP_42."</option>"; 211 foreach($imagelist as $image) 212 { 213 $e_path = $tp->createConstants($image['path'],1); 214 $showpath = str_replace($path,"",$image['path']); 215 if(strstr($image['fname'], "thumb")) 216 { 217 $fi = str_replace("thumb_", "", $image['fname']); 218 if(file_exists($path.$fi)) 219 { 220 // thumb and main image found 221 $text .= "<option value=\"[link=".$e_path.$fi."][img]".$e_path.$image['fname']."[/img][/link]\">".$showpath.$image['fname']." (".LANHELP_38.")</option>\n 222 "; 223 } 224 else 225 { 226 $text .= "<option value=\"[img]".$e_path.$image['fname']."[/img]\">".$showpath.$image['fname']."</option>\n 227 "; 228 } 229 } 230 else 231 { 232 $text .= "<option value=\"[img]".$e_path.$image['fname']."[/img]\">".$showpath.$image['fname']."</option>\n"; 233 } 234 } 235 $text .="</select>"; 236 } 237 $text .="</td></tr> \n </table></div> 238 </div>\n<!-- End of PreImage selector -->\n"; 239 return $text; 240 } 241 242 function PreFile_Select($formid='prefile_selector',$bbcode_filedir) { 243 require_once(e_HANDLER."userclass_class.php"); 244 global $IMAGES_DIRECTORY, $fl, $sql; 245 $rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*'); 246 247 $filelist = array(); 248 $downloadList = array(); 249 250 $sql->db_Select("download", "*", "download_class != ".e_UC_NOBODY); 251 while ($row = $sql->db_Fetch()) { 252 extract($row); 253 if($download_url) 254 { 255 $filelist[] = array("id" => $download_id, "name" => $download_name, "url" => $download_url, "class" => $download_class); 256 $downloadList[] = $download_url; 257 } 258 } 259 260 $tmp = $fl->get_files(e_FILE."downloads/","",$rejecthumb); 261 foreach($tmp as $value) 262 { 263 if(!in_array($value['fname'], $downloadList)) 264 { 265 $filelist[] = array("id" => 0, "name" => $value['fname'], "url" => $value['fname']); 266 } 267 } 268 $text ="<!-- Start of PreFile selector --> 269 <div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}'>"; 270 $text .="<div style='position:absolute; bottom:30px; right:75px'>"; 271 $text .= "<table class='fborder' style='background-color: #fff'> 272 <tr><td class='forumheader3' style='white-space: nowrap'>"; 273 274 275 if(!count($filelist)) 276 { 277 $text .= LANHELP_40; 278 } 279 else 280 { 281 $text .= "<select class='tbox' name='prefileselect' onchange=\"addtext(this.value); expandit('{$formid}')\"> 282 <option value=''>".LANHELP_43."</option>"; 283 foreach($filelist as $file) 284 { 285 if(isset($file['class'])) 286 { 287 $ucinfo = "^".$file['class']; 288 $ucname = r_userclass_name($file['class']); 289 } 290 else 291 { 292 $ucinfo = ""; 293 $ucname = r_userclass_name(0); 294 } 295 296 if($file['id']) 297 { 298 $text .= "<option value=\"[file={e_BASE}request.php?".$file['id']."{$cinfo}]".$file['name']."[/file]\">".$file['name']." - $ucname</option>\n"; 299 } 300 else 301 { 302 $text .= "<option value=\"[file={e_BASE}request.php?".$file['url']."{$cinfo}]".$file['name']."[/file]\">".$file['name']." - $ucname</option>\n"; 303 } 304 305 } 306 $text .="</select>"; 307 } 308 309 $text .="</td></tr> \n </table></div> 310 </div>\n<!-- End of PreFile selector -->\n"; 311 return $text; 312 } 313 314 function Emoticon_Select($formid='emoticon_selector') { 315 require_once(e_HANDLER."emote.php"); 316 $text ="<!-- Start of Emoticon selector --> 317 <div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}' onclick=\"this.style.display='none'\" > 318 <div style='position:absolute; bottom:30px; right:75px; width:221px; height:133px; overflow:auto;'> 319 <table class='fborder' style='background-color:#fff;'> 320 <tr><td class='forumheader3'> 321 ".r_emote()." 322 </td></tr></table> 323 </div> 324 </div>\n<!-- End of Emoticon selector -->\n"; 325 return $text; 326 } 327 328 ?>
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 |