Resource icon

Custom BB Code Manager v1.3.4

No permission to download
Is there any way to include templates via PHP Callback. For eg, if a specific BBCode is inserted, eg:
[bbcode][/bbcode] -> Include a template in place of this.
 
I used Brogan's table bbCode, but anyone know how to create a header across the top ... in other words, how to get it to span the columns (colspan)?
 
Add another bbcode named [tdcolspan] with one required option.

Start replace: <td colspan="{1}">
End replace: </td>

Usage: [tdcolspan=2]Test[/tdcolspan]
 
Add another bbcode named [tdcolspan] with one required option.

Start replace: <td colspan="{1}">
End replace: </td>

Usage: [tdcolspan=2]Test[/tdcolspan]

MOZ, I haven't created a new bbCode before so I want to be sure that I'm doing this correctly.

BB Code Title: Table COLSPAN
BB Code Description: (Anything I want?)
BB Code Tag:
Example: [tdcolspan=2]Test[/tdcolspan]

Simple replacement start: <td colspan="{1}">
Simple replacement end: </td>

So, what do I type in the "Code tag"?

Anything else I need to ensure is 'checked'?
 
BB Code Title: Span Columns
BB Code Description: (Anything I want?) Anything you want, remember the users see this when checking the BBCodes help page
BB Code Tag: tdclospan
Example: [tdcolspan=2]Test[/tdcolspan]
Activate BB Code: [Checked]
Requires Advanced Options: [Checked]
Number of Options: 1
Simple replacement start: <td colspan="{1}">
Simple replacement end: </td>

This should do it. (y)
 
So, within the [TH] tags, I would use the [tdcolspan=4]TEST HEADER[/tdcolspan], right?

So, it would be [TH][tdcolspan=4]TEST HEADER[/tdcolspan][/TH] ?
 
NO. This is separate.

If you want to have the color header then have this for Simple replacement start :

<td style="border: 1px solid #C0C0C0; text-align: center; font-weight: bold; background-color: #DDEEDD; padding: 1px 2px" colspan="{1}">
 
You can't forbid someone to use a tag, but you can use a different display per user as describe above.

Thanks for that report !
Find this code in library/KingK/BbCodeManager/BbCode/Formatter/default.php:
Code:
<input id="spoiler_' . $tagId . '" class="button" type="button" value="' . $buttonText . '" onclick="]
And replace with that:
Code:
<input id="spoiler_' . $tagId . '" class="button" type="button" value="' .  htmlspecialchars($buttonText) . '" onclick="
It seems to be safe after this.

I'm going to check my bbcodes after this ^^
I kinda forgot about this post... but, your method of escaping isn't secure, things like this still work:
Code:
[spoiler=asdf" onmouseover=alert(document.cookie) "asdf]Stuff[/spoiler]

This is because escaping with slashes doesn't work within a single quote. (That's also not the right way to escape for web.)
To solve, swap htmlspecialchars and addslashes for addslashes(htmlentities($textHere, ENT_QUOTES))

This will escape all characters with any significance in HTML, eg. < will become &lt;, and addslashes will then escape the backslash to prevent it from breaking the HTML.
 
I kinda forgot about this post... but, your method of escaping isn't secure, things like this still work:
Code:
[spoiler=asdf" onmouseover=alert(document.cookie) "asdf]Stuff[/spoiler]

This is because escaping with slashes doesn't work within a single quote. (That's also not the right way to escape for web.)
To solve, swap htmlspecialchars and addslashes for addslashes(htmlentities($textHere, ENT_QUOTES))

This will escape all characters with any significance in HTML, eg. < will become &lt;, and addslashes will then escape the backslash to prevent it from breaking the HTML.

Thanks a lot for your message and advices ! I hope KingK will update this fast.

I upload the new Default.php file here ({yourforum}/library/KingK_BbCodeManager/BbCode/Formatter/Default.php
I will delete here from here once the addon would have been officially updated.
 

Attachments

I'm trying to create bbcode to use html anchors in a page. The problem is when creating the link to the ancor, the bbcode is like this:
Code:
[GOTO=anchorname]link text[/GOTO]

and is replaced this way:
Code:
<a href="#%s">link text</a>

It works because in the post the html code result is:


The problem is that xenforo parses the url and when you click redirects you to this url: http://xenforourl/#anchorname

I had this working in vb and it's very annoying because we have several articles that use this bbcode.
I'm also looking for help here--unfortunately I'm not familiar with PHP Callbacks. :(
 
You zip file is all messed up. Cotains 2 x kingk folders and they are both of different filesize and different in terms of number of files, yet structure seems similar, appears to be an error when packaging..
 
I'm also looking for help here--unfortunately I'm not familiar with PHP Callbacks. :(
I don't know how to do it wither, can anyone point us in the right direction?
Any wiki, article, library, etc. addon is useless without anchors (you need to index long articles somehow).
 
I was trying to make some, since it doesn't sound too hard. But unfortunately it doesn't work - as if the bbcode isn't recognized?

What's wrong with this:
bbcode_ref.webp

With this result when used:
bbcode_ref2.webp
 
Think somebody can help me make a custom BB Code that will call a .yml file and display it in a Code Box.

What Im trying to get is a way for my admins to pull server information on players just by typing the BBCode or something similar, and it will spit out a yml file which the server already creates and stores ATM that i currently manually go and get open and copy the data into a Code box.

Currently the .yml files are on a different server but thats not an issue as I can setup a Cron job to download updated files daily to the webserver. Or the files are already stored on a webserver that can be accessed through a URL also.

If anyone is willing to help me that would be wonderful :)

Thanks in advance :)
 
Top Bottom