Code : Tout sélectionner
############################################################################
##
## MOD Title: BBcode [hs]..[/hs]
## MOD Author: Shadow < Shadow_vampire@hotmail.com >
##
## MOD Description: Un nouveau BBcode, pour le Hors-Sujet
##
## MOD Version: 1.0.0
## phpBB Version: 2.0.10
##
## Installation Level: Easy
## Installation Time: 3 Minutes
##
## Files To Edit: (6)
## posting.php,
## privmsg.php,
## includes/bbcode.php,
## language/lang_french/lang_main.php,
## templates/subSilver/bbcode.tpl,
## templates/subSilver/posting_body.tpl
##
## Included Files: n/a
##
############################################################################
##
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/
## for the latest version of this MOD. Downloading this MOD from other
## sites could cause malicious code to enter into your phpBB Forum.
## As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##
############################################################################
##
## Author Notes: n/a
##
############################################################################
##
## Before Adding This MOD To Your Forum, You Should Back Up All Files
## Related To This MOD
##
############################################################################
#
#-----[ OPEN ]--------------------------------------------------------------
#
posting.php
#
#-----[ FIND ]--------------------------------------------------------------
#
'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
'L_BBCODE_Y_HELP' => $lang['bbcode_y_help'],
#
#-----[ OPEN ]--------------------------------------------------------------
#
privmsg.php
#
#-----[ FIND ]--------------------------------------------------------------
#
'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
'L_BBCODE_Y_HELP' => $lang['bbcode_y_help'],
#
#-----[ OPEN ]--------------------------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]--------------------------------------------------------------
#
$bbcode_tpl['code_open'] = str_replace('{L_CODE}', $lang['Code'], $bbcode_tpl['code_open']);
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
$bbcode_tpl['hs_open'] = str_replace('{L_HS}', $lang['Hs'], $bbcode_tpl['hs_open']);
#
#-----[ FIND ]--------------------------------------------------------------
#
// [i] and [/i] for italicizing text.
$text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text);
$text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text);
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
// [hs] and [/hs] for centered text.
$text = str_replace("[hs:$uid]", $bbcode_tpl['hs_open'], $text);
$text = str_replace("[/hs:$uid]", $bbcode_tpl['hs_close'], $text);
#
#-----[ FIND ]--------------------------------------------------------------
#
// [i] and [/i] for italicizing text.
$text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text);
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
// [hs] and [/hs] for centered text.
$text = preg_replace("#\[hs\](.*?)\[/hs\]#si", "[hs:$uid]\\1[/hs:$uid]", $text);
#
#-----[ OPEN ]--------------------------------------------------------------
#
languages/lang_french/lang_main.php
#
#-----[ FIND ]--------------------------------------------------------------
#
$lang['bbcode_f_help'] = 'Taille du texte: [size=x-small]texte en petit[/size]';
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
$lang['bbcode_y_help'] = 'Texte Hors Sujet: [hs]text[/hs] (alt+y)';
#
#-----[ FIND ]--------------------------------------------------------------
#
$lang['Code'] = 'Code'; // comes before bbcode code output.
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
$lang['Hs'] = 'Hors Sujet';
#
#-----[ OPEN ]--------------------------------------------------------------
#
templates/subSilver/bbcode.tpl
#
#-----[ FIND ]--------------------------------------------------------------
#
<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
<!-- BEGIN hs_open --></span>
<table width="90%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<td><span class="genmed"><b>{L_HS}:</b></span></td>
</tr>
<tr>
<td class="quote"><!-- END hs_open -->
<!-- BEGIN hs_close --></td>
</tr>
</table>
<span class="postbody"><!-- END hs_close -->
#
#-----[ OPEN ]--------------------------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]--------------------------------------------------------------
#
f_help = "{L_BBCODE_F_HELP}";
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
y_help = "{L_BBCODE_Y_HELP}";
#
#-----[ FIND ]--------------------------------------------------------------
#
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
- ','
- ','
#
#-----[ IN-LINE, FIND ]-----------------------------------------------------
#
'',''
#
#-----[ IN-LINE, ADD ]------------------------------------------------------
#
,'[hs]','[/hs]'
#
#-----[ FIND ]--------------------------------------------------------------
#
<input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
</span></td>
#
#-----[ AFTER, ADD ]--------------------------------------------------------
#
<td><span class="genmed">
<input type="button" class="button" accesskey="y" name="addbbcode18" value=" Hs " style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('y')" />
</span></td>
#
#-----[ FIND ]--------------------------------------------------------------
#
<td colspan="9">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
#
#-----[ REMPLACE WITH ]-----------------------------------------------------
#
<td colspan="10">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
#
#-----[ FIND ]--------------------------------------------------------------
#
<select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">
#
#-----[ REMPLACE WITH ]-----------------------------------------------------
#
<select name="addbbcode20" onChange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">
#
#-----[ FIND ]--------------------------------------------------------------
#
</select> {L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">
#
#-----[ REMPLACE WITH ]-----------------------------------------------------
#
</select> {L_FONT_SIZE}:<select name="addbbcode22" onChange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">
#
#-----[ FIND ]--------------------------------------------------------------
#
</tr>
<tr>
<td colspan="9"> <span class="gensmall">
#
#-----[ REMPLACE WITH ]-----------------------------------------------------
#
</tr>
<tr>
<td colspan="10"> <span class="gensmall">
#
#-----[ FIND ]--------------------------------------------------------------
#
</tr>
<tr>
<td colspan="9"><span class="gen">
#
#-----[ REMPLACE WITH ]-----------------------------------------------------
#
</tr>
<tr>
<td colspan="10"><span class="gen">
#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------------------
#
# EoM[/code]
PS: Voici un exemple sur un forum test : ici