Segen
Member
Posts: 7
Registered: 8-25-2024
Member Is Offline
|
|
[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>',
);
|
セゲントラ
|
|
Segen
Member
Posts: 7
Registered: 8-25-2024
Member Is Offline
|
|
|
|
lottos
Administrator
Posts: 477
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
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
Member
Posts: 7
Registered: 8-25-2024
Member Is Offline
|
|
Quote: Originally posted by lottos |
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
セゲントラ
|
|
lottos
Administrator
Posts: 477
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
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.
|
|
Segen
Member
Posts: 7
Registered: 8-25-2024
Member Is Offline
|
|
That works! Thank you
セゲントラ
|
|
lottos
Administrator
Posts: 477
Registered: 6-3-2002
Member Is Offline
Mood: pass me a TimTam
|
|
|
|