XMB Forum Software

[Resolved] Custom BBcode

Segen - 8-30-2024 at 05:10 AM

Full Board URL: https://sempaij.jp.net/
XMB Version: 1.9.12

I want to add a spoiler bbcode but I find it impossible to add it to the functions.inc.php file, I always keep getting Parse error: syntax error, unexpected '30' (T_LNUMBER), expecting ')'

Code:
//Balance simple tags. $begin = array( 0 => '[b]', 1 => '[i]', 2 => '[u]', 3 => '[marquee]', 4 => '[blink]', 5 => '[strike]', 6 => '[quote]', 8 => '[list]', 9 => '[list=1]', 10 => '[list=a]', 11 => '[list=A]', 12 => '[spoiler]', ); $end = array( 0 => '[/b]', 1 => '[/i]', 2 => '[/u]', 3 => '[/marquee]', 4 => '[/blink]', 5 => '[/strike]', 6 => '[/quote]', 8 => '[/list]', 9 => '[/list=1]', 10 => '[/list=a]', 11 => '[/list=A]', 12 => '[/spoiler]', );


Code:
// Replace simple tags. $find = array( 30 => '[spoiler]', 31 => '[/spoiler]', ); $replace = array( 30 => '<span class="spoiler" >', 31 => '</span><style>.spoiler:hover{background-color:white;}.spoiler{color: black;background-color:black;}</style>', );

Segen - 8-31-2024 at 02:40 AM

Even after following this guide https://svn.code.sf.net/p/xmb-forum/code/hacks/trunk/spoiler... I still get a Parse error: syntax error, unexpected '30' (T_LNUMBER), expecting ')'

lottos - 8-31-2024 at 03:03 AM

Quote: Originally posted by Segen  
Even after following this guide https://svn.code.sf.net/p/xmb-forum/code/hacks/trunk/spoiler... I still get a Parse error: syntax error, unexpected '30' (T_LNUMBER), expecting ')'


Where instructions say:
Find Code:
==========

24 => '
  • '

    ==================
    Replace Code With:
    ==================

    24 => '
  • ',
    25 => '[spoiler]',
    26 => '[/spoiler]'

    did you literally do that and have duplicate
    25 =>
    26 =>

    ? Looks like you don't based on the 30 your mentioned above which is correct.

    Maybe attach your file.


    Segen - 8-31-2024 at 03:23 AM

    Quote: Originally posted by lottos  
    Quote: Originally posted by Segen  
    Even after following this guide https://svn.code.sf.net/p/xmb-forum/code/hacks/trunk/spoiler... I still get a Parse error: syntax error, unexpected '30' (T_LNUMBER), expecting ')'


    Where instructions say:
    Find Code:
    ==========

    24 => '
  • '

    ==================
    Replace Code With:
    ==================

    24 => '
  • ',
    25 => '[spoiler]',
    26 => '[/spoiler]'

    did you literally do that and have duplicate
    25 =>
    26 =>

    ? Looks like you don't based on the 30 your mentioned above which is correct.

    Maybe attach your file.



  • I still have them added as 30 and 31, anything passed 29 in $find = array( and $replace = array( gives me that error

    Attachment: functions.inc.php (95kB)
    This file has been downloaded 31 times


    lottos - 8-31-2024 at 04:15 AM

    Try adding a comma after both occurrences of 29

    Ie:

    29 => '[/rquote]',
    29 => ' </td></tr></table>',


    Edit: As per screenshot, user is unlikely to continue using xmb and as this issue was user and not xmb related, I am unlikely to provide further assistance.

    delete.png - 30kB

    Segen - 8-31-2024 at 04:27 AM

    That works! Thank you :heart:

    lottos - 8-31-2024 at 04:28 AM

    Quote: Originally posted by Segen  
    That works! Thank you :heart:


    You are welcome.