[ Index ] |
|
Code source de PHP NUKE 7.9 |
1 <script language="JavaScript" type="text/javascript"> 2 <!-- 3 // bbCode control by 4 // subBlue design 5 // www.subBlue.com 6 7 // Startup variables 8 var imageTag = false; 9 var theSelection = false; 10 11 // Check for Browser & Platform for PC & IE specific bits 12 // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html 13 var clientPC = navigator.userAgent.toLowerCase(); // Get client info 14 var clientVer = parseInt(navigator.appVersion); // Get browser version 15 16 var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); 17 var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) 18 && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) 19 && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); 20 21 var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1)); 22 var is_mac = (clientPC.indexOf("mac")!=-1); 23 24 25 // Helpline messages 26 b_help = "{L_BBCODE_B_HELP}"; 27 i_help = "{L_BBCODE_I_HELP}"; 28 u_help = "{L_BBCODE_U_HELP}"; 29 q_help = "{L_BBCODE_Q_HELP}"; 30 c_help = "{L_BBCODE_C_HELP}"; 31 l_help = "{L_BBCODE_L_HELP}"; 32 o_help = "{L_BBCODE_O_HELP}"; 33 p_help = "{L_BBCODE_P_HELP}"; 34 w_help = "{L_BBCODE_W_HELP}"; 35 a_help = "{L_BBCODE_A_HELP}"; 36 s_help = "{L_BBCODE_S_HELP}"; 37 f_help = "{L_BBCODE_F_HELP}"; 38 39 // Define the bbCode tags 40 bbcode = new Array(); 41 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]'); 42 imageTag = false; 43 44 // Shows the help messages in the helpline window 45 function helpline(help) { 46 document.post.helpbox.value = eval(help + "_help"); 47 } 48 49 50 // Replacement for arrayname.length property 51 function getarraysize(thearray) { 52 for (i = 0; i < thearray.length; i++) { 53 if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) 54 return i; 55 } 56 return thearray.length; 57 } 58 59 // Replacement for arrayname.push(value) not implemented in IE until version 5.5 60 // Appends element to the array 61 function arraypush(thearray,value) { 62 thearray[ getarraysize(thearray) ] = value; 63 } 64 65 // Replacement for arrayname.pop() not implemented in IE until version 5.5 66 // Removes and returns the last element of an array 67 function arraypop(thearray) { 68 thearraysize = getarraysize(thearray); 69 retval = thearray[thearraysize - 1]; 70 delete thearray[thearraysize - 1]; 71 return retval; 72 } 73 74 75 function checkForm() { 76 77 formErrors = false; 78 79 if (document.post.message.value.length < 2) { 80 formErrors = "{L_EMPTY_MESSAGE}"; 81 } 82 83 if (formErrors) { 84 alert(formErrors); 85 return false; 86 } else { 87 bbstyle(-1); 88 //formObj.preview.disabled = true; 89 //formObj.submit.disabled = true; 90 return true; 91 } 92 } 93 94 function emoticon(text) { 95 text = ' ' + text + ' '; 96 if (document.post.message.createTextRange && document.post.message.caretPos) { 97 var caretPos = document.post.message.caretPos; 98 caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; 99 document.post.message.focus(); 100 } else { 101 document.post.message.value += text; 102 document.post.message.focus(); 103 } 104 } 105 106 function bbfontstyle(bbopen, bbclose) { 107 if ((clientVer >= 4) && is_ie && is_win) { 108 theSelection = document.selection.createRange().text; 109 if (!theSelection) { 110 document.post.message.value += bbopen + bbclose; 111 document.post.message.focus(); 112 return; 113 } 114 document.selection.createRange().text = bbopen + theSelection + bbclose; 115 document.post.message.focus(); 116 return; 117 } else { 118 document.post.message.value += bbopen + bbclose; 119 document.post.message.focus(); 120 return; 121 } 122 storeCaret(document.post.message); 123 } 124 125 126 function bbstyle(bbnumber) { 127 128 donotinsert = false; 129 theSelection = false; 130 bblast = 0; 131 132 if (bbnumber == -1) { // Close all open tags & default button names 133 while (bbcode[0]) { 134 butnumber = arraypop(bbcode) - 1; 135 document.post.message.value += bbtags[butnumber + 1]; 136 buttext = eval('document.post.addbbcode' + butnumber + '.value'); 137 eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); 138 } 139 imageTag = false; // All tags are closed including image tags :D 140 document.post.message.focus(); 141 return; 142 } 143 144 if ((clientVer >= 4) && is_ie && is_win) 145 theSelection = document.selection.createRange().text; // Get text selection 146 147 if (theSelection) { 148 // Add tags around selection 149 document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1]; 150 document.post.message.focus(); 151 theSelection = ''; 152 return; 153 } 154 155 // Find last occurance of an open tag the same as the one just clicked 156 for (i = 0; i < bbcode.length; i++) { 157 if (bbcode[i] == bbnumber+1) { 158 bblast = i; 159 donotinsert = true; 160 } 161 } 162 163 if (donotinsert) { // Close all open tags up to the one just clicked & default button names 164 while (bbcode[bblast]) { 165 butnumber = arraypop(bbcode) - 1; 166 document.post.message.value += bbtags[butnumber + 1]; 167 buttext = eval('document.post.addbbcode' + butnumber + '.value'); 168 eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); 169 imageTag = false; 170 } 171 document.post.message.focus(); 172 return; 173 } else { // Open tags 174 175 if (imageTag && (bbnumber != 14)) { // Close image tag before adding another 176 document.post.message.value += bbtags[15]; 177 lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list 178 document.post.addbbcode14.value = "Img"; // Return button back to normal state 179 imageTag = false; 180 } 181 182 // Open tag 183 document.post.message.value += bbtags[bbnumber]; 184 if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag 185 arraypush(bbcode,bbnumber+1); 186 eval('document.post.addbbcode'+bbnumber+'.value += "*"'); 187 document.post.message.focus(); 188 return; 189 } 190 storeCaret(document.post.message); 191 } 192 193 // Insert at Claret position. Code from 194 // http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 195 function storeCaret(textEl) { 196 if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate(); 197 } 198 199 //--> 200 </script> 201 202 <!-- BEGIN privmsg_extensions --> 203 <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%"> 204 <tr> 205 <td valign="top" align="center" width="100%"> 206 <table height="40" cellspacing="2" cellpadding="2" border="0"> 207 <tr valign="middle"> 208 <td>{INBOX_IMG}</td> 209 <td><span class="cattitle">{INBOX_LINK} </span></td> 210 <td>{SENTBOX_IMG}</td> 211 <td><span class="cattitle">{SENTBOX_LINK} </span></td> 212 <td>{OUTBOX_IMG}</td> 213 <td><span class="cattitle">{OUTBOX_LINK} </span></td> 214 <td>{SAVEBOX_IMG}</td> 215 <td><span class="cattitle">{SAVEBOX_LINK} </span></td> 216 </tr> 217 </table> 218 </td> 219 </tr> 220 </table> 221 222 <br clear="all" /> 223 <!-- END privmsg_extensions --> 224 225 <form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)"> 226 227 {POST_PREVIEW_BOX} 228 {ERROR_BOX} 229 230 <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> 231 <tr> 232 <td align="left"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a> 233 <!-- BEGIN switch_not_privmsg --> 234 -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td> 235 <!-- END switch_not_privmsg --> 236 </tr> 237 </table> 238 239 <table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline"> 240 <tr> 241 <th class="thHead" colspan="2" height="25"><b>{L_POST_A}</b></th> 242 </tr> 243 <!-- BEGIN switch_username_select --> 244 <tr> 245 <td class="row1"><span class="gen"><b>{L_USERNAME}</b></span></td> 246 <td class="row2"><span class="genmed"><input type="text" class="post" tabindex="1" name="username" size="25" maxlength="25" value="{USERNAME}" /></span></td> 247 </tr> 248 <!-- END switch_username_select --> 249 <!-- BEGIN switch_privmsg --> 250 <tr> 251 <td class="row1"><span class="gen"><b>{L_USERNAME}</b></span></td> 252 <td class="row2"><span class="genmed"><input type="text" class="post" name="username" maxlength="25" size="25" tabindex="1" value="{USERNAME}" /> <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="liteoption" onClick="window.open('{U_SEARCH_USER}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" /></span></td> 253 </tr> 254 <!-- END switch_privmsg --> 255 <tr> 256 <td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td> 257 <td class="row2" width="78%"> <span class="gen"> 258 <input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" /> 259 </span> </td> 260 </tr> 261 <tr> 262 <td class="row1" valign="top"> 263 <table width="100%" border="0" cellspacing="0" cellpadding="1"> 264 <tr> 265 <td><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td> 266 </tr> 267 <tr> 268 <td valign="middle" align="center"> <br /> 269 <table width="100" border="0" cellspacing="0" cellpadding="5"> 270 <tr align="center"> 271 <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td> 272 </tr> 273 <!-- BEGIN smilies_row --> 274 <tr align="center" valign="middle"> 275 <!-- BEGIN smilies_col --> 276 <td><a href="javascript:emoticon('{smilies_row.smilies_col.SMILEY_CODE}')"><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></a></td> 277 <!-- END smilies_col --> 278 </tr> 279 <!-- END smilies_row --> 280 <!-- BEGIN switch_smilies_extra --> 281 <tr align="center"> 282 <td colspan="{S_SMILIES_COLSPAN}"><span class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td> 283 </tr> 284 <!-- END switch_smilies_extra --> 285 </table> 286 </td> 287 </tr> 288 </table> 289 </td> 290 <td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span> 291 <table width="450" border="0" cellspacing="0" cellpadding="2"> 292 <tr align="center" valign="middle"> 293 <td><span class="genmed"> 294 <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" /> 295 </span></td> 296 <td><span class="genmed"> 297 <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" /> 298 </span></td> 299 <td><span class="genmed"> 300 <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" /> 301 </span></td> 302 <td><span class="genmed"> 303 <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" /> 304 </span></td> 305 <td><span class="genmed"> 306 <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" /> 307 </span></td> 308 <td><span class="genmed"> 309 <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" /> 310 </span></td> 311 <td><span class="genmed"> 312 <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" /> 313 </span></td> 314 <td><span class="genmed"> 315 <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')" /> 316 </span></td> 317 <td><span class="genmed"> 318 <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" /> 319 </span></td> 320 </tr> 321 <tr> 322 <td colspan="9"> 323 <table width="100%" border="0" cellspacing="0" cellpadding="0"> 324 <tr> 325 <td><span class="genmed"> {L_FONT_COLOR}: 326 <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')"> 327 <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option> 328 <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option> 329 <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option> 330 <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option> 331 <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option> 332 <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option> 333 <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option> 334 <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option> 335 <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option> 336 <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option> 337 <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option> 338 <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option> 339 <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option> 340 <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option> 341 <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option> 342 </select> {L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')"> 343 <option value="7" class="genmed">{L_FONT_TINY}</option> 344 <option value="9" class="genmed">{L_FONT_SMALL}</option> 345 <option value="12" selected class="genmed">{L_FONT_NORMAL}</option> 346 <option value="18" class="genmed">{L_FONT_LARGE}</option> 347 <option value="24" class="genmed">{L_FONT_HUGE}</option> 348 </select> 349 </span></td> 350 <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td> 351 </tr> 352 </table> 353 </td> 354 </tr> 355 <tr> 356 <td colspan="9"> <span class="gensmall"> 357 <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" /> 358 </span></td> 359 </tr> 360 <tr> 361 <td colspan="9"><span class="gen"> 362 <textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea> 363 </span></td> 364 </tr> 365 </table> 366 </span></td> 367 </tr> 368 <tr> 369 <td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td> 370 <td class="row2"><span class="gen"> </span> 371 <table cellspacing="0" cellpadding="1" border="0"> 372 <!-- BEGIN switch_html_checkbox --> 373 <tr> 374 <td> 375 <input type="checkbox" name="disable_html" {S_HTML_CHECKED} /> 376 </td> 377 <td><span class="gen">{L_DISABLE_HTML}</span></td> 378 </tr> 379 <!-- END switch_html_checkbox --> 380 <!-- BEGIN switch_bbcode_checkbox --> 381 <tr> 382 <td> 383 <input type="checkbox" name="disable_bbcode" {S_BBCODE_CHECKED} /> 384 </td> 385 <td><span class="gen">{L_DISABLE_BBCODE}</span></td> 386 </tr> 387 <!-- END switch_bbcode_checkbox --> 388 <!-- BEGIN switch_smilies_checkbox --> 389 <tr> 390 <td> 391 <input type="checkbox" name="disable_smilies" {S_SMILIES_CHECKED} /> 392 </td> 393 <td><span class="gen">{L_DISABLE_SMILIES}</span></td> 394 </tr> 395 <!-- END switch_smilies_checkbox --> 396 <!-- BEGIN switch_signature_checkbox --> 397 <tr> 398 <td> 399 <input type="checkbox" name="attach_sig" {S_SIGNATURE_CHECKED} /> 400 </td> 401 <td><span class="gen">{L_ATTACH_SIGNATURE}</span></td> 402 </tr> 403 <!-- END switch_signature_checkbox --> 404 <!-- BEGIN switch_notify_checkbox --> 405 <tr> 406 <td> 407 <input type="checkbox" name="notify" {S_NOTIFY_CHECKED} /> 408 </td> 409 <td><span class="gen">{L_NOTIFY_ON_REPLY}</span></td> 410 </tr> 411 <!-- END switch_notify_checkbox --> 412 <!-- BEGIN switch_delete_checkbox --> 413 <tr> 414 <td> 415 <input type="checkbox" name="delete" /> 416 </td> 417 <td><span class="gen">{L_DELETE_POST}</span></td> 418 </tr> 419 <!-- END switch_delete_checkbox --> 420 <!-- BEGIN switch_type_toggle --> 421 <tr> 422 <td></td> 423 <td><span class="gen">{S_TYPE_TOGGLE}</span></td> 424 </tr> 425 <!-- END switch_type_toggle --> 426 </table> 427 </td> 428 </tr> 429 {POLLBOX} 430 <tr> 431 <td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" /> <input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td> 432 </tr> 433 </table> 434 435 <table width="100%" cellspacing="2" border="0" align="center" cellpadding="2"> 436 <tr> 437 <td align="right" valign="top"><span class="gensmall">{S_TIMEZONE}</span></td> 438 </tr> 439 </table> 440 </form> 441 442 <table width="100%" cellspacing="2" border="0" align="center"> 443 <tr> 444 <td valign="top" align="right">{JUMPBOX}</td> 445 </tr> 446 </table> 447 448 {TOPIC_REVIEW_BOX}
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 11:11:59 2007 | par Balluche grâce à PHPXref 0.7 |