BBCode Center

Discuţii legate de instalarea şi funcţionarea unor MODificări vechi sau noi ale forumului phpBB 2.0.x.
Închis
Avatar utilizator
BuGsY
Fost coleg
Mesaje: 1193
Membru din: 19-Iun-2003, 15:24:49
Ext: Nu
Server: Windows
Nivel phpBB: Mediu
Nivel php: Mediu
Localitate: Constanţa
Contact:

BBCode Center

Mesaj de BuGsY »

Scriu aici pentru ca nu mai gasesc topicul unde cineva intreba daca ar putea sa creeze un mod (sau daca exista aceasta facilitate deja) cu care sa scrie centrat. Ei bine exista un mod se numeste BBCode Center, iar inserarea acestuia poate decurge astfel:

Cod: Selectaţi tot

# 
#-----[ OPEN ]------------------------------------------ 
#
# includes/bbcode.php
# 
#-----[ 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);

# 
#-----[ ADD BELOW ]------------------------------------------ 
#
	// [center] and [/center] for centered text. 
	$text = str_replace("[center:$uid]", $bbcode_tpl['center_open'], $text);
	$text = str_replace("[/center:$uid]", $bbcode_tpl['center_close'], $text);



# 
#-----[ FIND ]------------------------------------------ 
#
	// [i] and [/i] for italicizing text.
	$text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text);

# 
#-----[ ADD BELOW ]------------------------------------------ 
#
	// [center] and [/center] for centered text.
	$text = preg_replace("#\[center\](.*?)\[/center\]#si", "[center:$uid]\\1[/center:$uid]", $text);



# 
#-----[ OPEN ]------------------------------------------ 
#
#  posting.php/privmsg.php
# 
#-----[ FIND ]------------------------------------------ 
#
	'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],

# 
#-----[ ADD BELOW ]------------------------------------------ 
#
	'L_BBCODE_Y_HELP' => $lang['bbcode_y_help'], 



# 
#-----[ OPEN ]------------------------------------------ 
#
# languages/lang_english/lang_main.php
# 
#-----[ FIND ]------------------------------------------ 
#
$lang['bbcode_f_help'] = 'Font size: [size=x-small]small text[/size]';

# 
#-----[ ADD BELOW ]------------------------------------------ 
#
$lang['bbcode_y_help'] = 'Font Center: [center]text[/center] (alt+y)';



# 
#-----[ OPEN ]------------------------------------------ 
#
# templates/xxx/bbcode.tpl
# 
#-----[ FIND ]------------------------------------------ 
#
	<!-- BEGIN i_open --><span style="font-style: italic"><!-- END i_open -->
	<!-- BEGIN i_close --></span><!-- END i_close -->

# 
#-----[ ADD BELOW ]------------------------------------------ 
#
	<!-- BEGIN center_open --><div align="center"><!-- END center_open -->
	<!-- BEGIN center_close --></div><!-- END center_close -->



# 
#-----[ OPEN ]------------------------------------------ 
#
# templates/xxx/posting_body.tpl
# 
#-----[ FIND ]------------------------------------------ 
#
f_help = "{L_BBCODE_F_HELP}";

# 
#-----[ ADD BELOW ]------------------------------------------ 
#
y_help = "{L_BBCODE_Y_HELP}";


# 
#-----[ FIND ]------------------------------------------ 
#
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','');

#
#-----[ IN-LINE FIND ]------------------------------------------
#
'',''

#
#-----[ IN-LINE ADD ]------------------------------------------
#
,'[center]','[/center]'


#
#-----[ 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>

#
#-----[ ADD BELOW ]------------------------------------------
#
# see "Note" at the beginning of this guide

<td><span class="genmed">
<input type="button" class="button" accesskey="y" name="addbbcode18" value=" Center " style="width: 60px" onClick="bbstyle(18)" onMouseOver="helpline('y')" />
</span></td>

#
#-----[ FIND ]------------------------------------------
#
<select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">

#
#-----[ REPLACE WITH ]--------------------------------------------------
#
# see "Note" at the beginning of this guide

<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')">

#
#-----[ REPLACE WITH ]--------------------------------------------------
#
# see "Note" at the beginning of this guide

</select> &{L_FONT_SIZE}:<select name="addbbcode22" onChange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">

#
#-----[ FIND und increase colspan value ]--------------------------------------------------
#
# see "Note" at the beginning of this guide

</span></td>
</tr>
<tr>
<td colspan="9">

#
#-----[ FIND und increase colspan value ]--------------------------------------------------
#
# see "Note" at the beginning of this guide

</tr>
<tr>
<td colspan="9"> <span class="gensmall">

#
#-----[ FIND und increase colspan value ]--------------------------------------------------
#
# see "Note" at the beginning of this guide

</tr>
<tr>
<td colspan="9"><span class="gen"> [/code]
Avatar utilizator
dorin
Fost coleg
Mesaje: 4620
Membru din: 24-Iun-2003, 23:23:29
Versiune: 3.1.10
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Mediu
Nivel php: Puţin experimentat
Contact:

Mesaj de dorin »

Mda, aveam nevoie de asa ceva mai ales pentru imagini.

Multumim :wink:
Avatar utilizator
bogdan
AdministratorAdministrator
Mesaje: 10888
Membru din: 18-Oct-2002, 13:14:27
Versiune: 3.0.11
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Experimentat
Nivel php: Mediu
Localitate: Bucuresti
Contact:

Re: BBCode Center

Mesaj de bogdan »

BuGsY scrie:Scriu aici pentru ca nu mai gasesc topicul unde cineva intreba daca ar putea sa creeze un mod (sau daca exista aceasta facilitate deja) cu care sa scrie centrat.
mesajul e cel de aici: viewtopic.php?p=2908#2908
Închis

Înapoi la “2.0.x Suport pentru MODificări”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 17 vizitatori