XMB Forum Software
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: [Resolved] Custom BBcode
Segen
Member
***


Avatar


Posts: 7
Registered: 8-25-2024
Member Is Offline


[*] posted on 8-30-2024 at 05:10 AM
[Resolved] Custom BBcode


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>', );




セゲントラ
View user's profile Visit user's homepage View All Posts By User
Segen
Member
***


Avatar


Posts: 7
Registered: 8-25-2024
Member Is Offline


[*] posted on 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 ')'



セゲントラ
View user's profile Visit user's homepage View All Posts By User
lottos
Administrator
********




Posts: 477
Registered: 6-3-2002
Member Is Offline

Mood: pass me a TimTam

[*] posted on 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.

  • View user's profile View All Posts By User
    Segen
    Member
    ***


    Avatar


    Posts: 7
    Registered: 8-25-2024
    Member Is Offline


    [*] posted on 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 22 times





    セゲントラ
    View user's profile Visit user's homepage View All Posts By User
    lottos
    Administrator
    ********




    Posts: 477
    Registered: 6-3-2002
    Member Is Offline

    Mood: pass me a TimTam

    [*] posted on 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
    View user's profile View All Posts By User
    Segen
    Member
    ***


    Avatar


    Posts: 7
    Registered: 8-25-2024
    Member Is Offline


    [*] posted on 8-31-2024 at 04:27 AM


    That works! Thank you :heart:



    セゲントラ
    View user's profile Visit user's homepage View All Posts By User
    lottos
    Administrator
    ********




    Posts: 477
    Registered: 6-3-2002
    Member Is Offline

    Mood: pass me a TimTam

    [*] posted on 8-31-2024 at 04:28 AM


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


    You are welcome.
    View user's profile View All Posts By User

      Go To Top

    Powered by XMB 1.9.12 (Debug Mode)
    XMB Forum Software © 2001-2024 The XMB Group
    [Queries: 16] [PHP: 24.8% - SQL: 75.2%]