To jest tylko wersja do druku, aby zobaczyć pełn± wersję tematu, kliknij TUTAJ
phpBB2 by Przemo
Support forów phpBB2 modified by Przemo

Archiwum działu Ogólne (posty do 12.2007) - [Pro¶ba] O instrukcję, jak dodać nowy button bbCode.

Raknor - 27-06-2006, 05:19
Temat postu: [Pro¶ba] O instrukcję, jak dodać nowy button bbCode.
Pro¶ba, o instukcję, jak dodać nowy button bbCode.

Zrobiłem sobie now± funkcję bbCode, ale za nic nie mogę dotrzeć do tego jak dodać button. :roll:

Mianowicie, do tego co jest na fotce, chcę dodać nowy button.

soser - 27-06-2006, 10:12

w posting.php szukaj :]
Gracek - 27-06-2006, 11:12

o_O
w /templates/styl/posting_body.tpl

Raknor - 27-06-2006, 19:46

Zmienione:

/includes/bbcode.php

Kod:
    // [b] and [/b] for bolding text.
    $text = ($board_config['button_b']) ? str_replace("[b:$uid]", $bbcode_tpl['b_open'], $text) : str_replace("[b:$uid]", '', $text);
    $text = ($board_config['button_b']) ? str_replace("[/b:$uid]", $bbcode_tpl['b_close'], $text) : str_replace("[/b:$uid]", '', $text);
   
    // [sp][/sp] wariant 1 działa bez przycisku
//    $text = str_replace("[sp:$uid]", $bbcode_tpl['sp_open'], $text);
//$text = str_replace("[/sp:$uid]", $bbcode_tpl['sp_close'], $text);

    // [sp][/sp] wariant 2 działa i jest przycisk
$text = (1) ? str_replace("[sp:$uid]", $bbcode_tpl['sp_open'], $text) : str_replace("[sp:$uid]", '', $text);
    $text = (1) ? str_replace("[/sp:$uid]", $bbcode_tpl['sp_close'], $text) : str_replace("[/sp:$uid]", '', $text);

posting.php
Kod:
    'BUTTON_B' => ($board_config['button_b']) ? '<input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline(\'b\')" /> ' : '',
    'BUTTON_Z' => (1) ? '<input type="button" class="button" accesskey="z" name="addbbcode30" value=" Sp " style="width: 50px" onClick="bbstyle(30)" onMouseOver="helpline(\'z\')" /> ' : '',

/templates/styl/posting_body.tpl
Kod:
{BUTTON_B}{BUTTON_Z}{BUTTON_I}


Czy jeszcze co¶ trzeba edytować?

irekk - 27-06-2006, 19:51

daj ty soboie spokoj z tym $board_config['button_z'] zapewne nie masz tego nawet w bazie zamien to na zwykla 1 lub true
Raknor - 27-06-2006, 22:19

Jak radziłe¶, tak też zrobiłem. Jest już przycisk i działa też [sp][/sp], ale po kliknięciu na button wyskakuje undefined (niezdefiniowany). :roll:

Co jeszcze trzeba zmienić?



Powered by phpBB modified by Przemo © 2003 phpBB Group