BBCODE централизиране

Аз си направих сам :) Обаче при менюто ми не намира center в такъв смисал дава: undefined

ето ви и урочето :P
Код:
Отварям include/bbcode.php

намирам
	// [b] and [/b] for bolding text.
	$text = str_replace("[b:$uid]", $bbcode_tpl['b_open'], $text);
	$text = str_replace("[/b:$uid]", $bbcode_tpl['b_close'], $text);

под него добавям

	// [center] and [/center] for bolding text.
	$text = str_replace("[center:$uid]", $bbcode_tpl['center_open'], $text);
	$text = str_replace("[/center:$uid]", $bbcode_tpl['center_close'], $text);

намирам

	// [b] and [/b] for bolding text.
	$text = preg_replace("#\[b\](.*?)\[/b\]#si", "[b:$uid]\\1[/b:$uid]", $text);


под него добавям

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

Запаметявам!

Отварям templates/subSilver/bbcode.tpl 

Намирам

<span style="font-weight: bold">
</span>

Под него добавям

<div align="center">
</div>

Запаметявам!

Отварям language/lang_english/lang_main.php 

Намирам 

$lang['bbcode_b_help'] = "Чер текст: [b]текст[/b] (alt+b)";

Под него добавям

$lang['bbcode_center_help'] = "Център текст: [center]текст[/center]";

Отварям posting.php 

намирам 

	'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], 

Под него добавям

	'L_BBCODE_CENTER_HELP' => $lang['bbcode_center_help'], 


Отварям templates/subSilver/posting_body.tpl 

Намирам

b_help = "{L_BBCODE_B_HELP}";

Под него добавям

center_help = "{L_BBCODE_CENTER_HELP}";

Намирам 

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

Заменям

bbtags = new Array('','','','','','','
','
Код:
','
','
  • ','
','
  • ','
','
','','','
','​
');

Намирам

<td><span class="genmed">
<input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
</span></td>

Под него добавям

<td><span class="genmed">
<input type="button" class="button" accesskey="center" name="addbbcode20" value=" CENTER " style="width: 70px" onClick="bbstyle(20)" onMouseOver="helpline('center')" />
</span></td>

намирам

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

замествам

<select name="addbbcode20" onChange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">

Намирам
</select>  {L_FONT_SIZE}:<select name="addbbcode20" selected onChange="bbfontstyle('.value + ']', '');this.selectedIndex=0;" onMouseOver="helpline('f')">

Заменям
</select>  {L_FONT_SIZE}:<select name="addbbcode22" selected onChange="bbfontstyle('.value + ']', '');this.selectedIndex=0;" onMouseOver="helpline('f')">[/code]
 

Back
Горе