Resource icon

Custom BB Code Manager v1.3.4

No permission to download
Hi! I've just started to use the addon and have some suggestions:
Now every tag-render generates db query, so if my post will have 100 tags there will be 100 queries.
It is possible to store tags in simpleCache or get them in pre_view event by one query.
Other suggestion is to automatically or optionally add buttons to editor when bbcode is created.
BTW, do you have github?
 
There is a small bug in the user tag code. It appears that XF's bbcode parser passes $tag['children'][0] as array if it finds mismatched tags. This causes getUserIdFromUser() and getUserByName() to throw exceptions, however XenForo_BbCode_TextWrapper::__toString() can't throw exceptions so the page dies with a fatal error.

I don't fully understand the code, so there is probably a better fix than this, but this seems to solve the problem.

Replace:
PHP:
$userid = XenForo_Model_User::getUserIdFromUser( $userModel->getUserByName($tag['children'][0]) );

with:
PHP:
if (!is_array($tag['children'][0]))
    $userinfo = $userModel->getUserByName($tag['children'][0]);
else
    $tag['children'][0] = '';
 
if (is_array($userinfo))
    $userid = XenForo_Model_User::getUserIdFromUser($userinfo);
else
    $userid = 0;
 
Hello, I have a question about a limitation that appears to be happening on my forums. Whenever I goto [Help > BB Codes] I can only see a few of the BBC that I have added. I have made about ~50 BBCs for my forum and would like to know if there's a way to select just a few essential ones or display them.

So in a nutshell, most BBCs aren't showing up on the help page. Is this an addon limitation or Xenforo? If any would you have time to explain how I can fix it?

Thanks for the great addon!
 
There is a small bug in the user tag code. It appears that XF's bbcode parser passes $tag['children'][0] as array if it finds mismatched tags. This causes getUserIdFromUser() and getUserByName() to throw exceptions, however XenForo_BbCode_TextWrapper::__toString() can't throw exceptions so the page dies with a fatal error.

I don't fully understand the code, so there is probably a better fix than this, but this seems to solve the problem.

Replace:
PHP:
$userid = XenForo_Model_User::getUserIdFromUser( $userModel->getUserByName($tag['children'][0]) );

with:
PHP:
if (!is_array($tag['children'][0]))
    $userinfo = $userModel->getUserByName($tag['children'][0]);
else
    $tag['children'][0] = '';
 
if (is_array($userinfo))
    $userid = XenForo_Model_User::getUserIdFromUser($userinfo);
else
    $userid = 0;

Thank you. Been getting this error a lot and will try to see if this fixes the bug.
 
Can you tell me, when you plan to release the new version. I want to go online with my site very soon. Over 100 Queries in not acceptable on a live system. So i have to fix it myself, or checkout your new version. If you send me your alpha version i can help you to improve it.
 
If someone doesn't answer this before he does, this will be a reminder and more detailed explanation for King Kovifor:

How do I embed a code with URLs that have two variables in them? I want to include Spotify playlists, but they require the inclusion of both the username and the playlist ID, i.e. http://open.spotify.com/user/trombone13/playlist/7zIfE7iCGnqlgJ3evYVWYI

The username (trombone13) is needed as well as the ID (7zIfE7iCGnqlgJ3evYVWYI), but I'm not sure how to do it with multiple options. Help is appreciated! :)

p.s. If someone needs me to write out the code details for Spotify track embeds, I can--it's pretty easy to do. :)
 
I am using the "Double Post Merge" addon by Syndol, and for every double post merged, this addon creates 2 queries. Besides this, every spoiler creates one DB query. The Addon itself has 2 queries already, the number ofqueies is just baffling, any solution to this?
 
First thank you for sharing this add-on ...

I tired to create a custom BB code to align images left and right ... but it didn't work ..

Here is the codes that I used :
Simple Replacement Start:
Code:
<img class="alignleft" border="0" alt="" src="
Simple Replacement End:
Code:
" />
but it didn't work ..
any help is appreciated to sort it out .. thank you
 
King Kovifor, can you have a look at why so many queries are being created for each post that is merged?
 
First thank you for sharing this add-on ...

I tired to create a custom BB code to align images left and right ... but it didn't work ..

Here is the codes that I used :
Simple Replacement Start:
Code:
<img class="alignleft" border="0" alt="" src="
Simple Replacement End:
Code:
" />
but it didn't work ..
any help is appreciated to sort it out .. thank you
any ideas ?
 
There is just use the align function already available, select the image and align accordingly.
 
First thank you for sharing this add-on ...

I tired to create a custom BB code to align images left and right ... but it didn't work ..

Here is the codes that I used :
Simple Replacement Start:
Code:
<img class="alignleft" border="0" alt="" src="
Simple Replacement End:
Code:
" />
but it didn't work ..
any help is appreciated to sort it out .. thank you
yodawn, you're right - but BB Code is all about converting to HTML so theoretically what A.Chakery is trying to do is correct.

Technically, though this won't work.

How I would do this is the following.

Simple Replacement Start
Code:
<div class="alignleft">

Simple Replacement End
Code:
</div>

So if your tag was called ALIGNLEFT you would use it like so:

[ALIGNLEFT][IMG]http://www.domain.com/path/to/image.png[/IMG][/ALIGNLEFT]
 
I am using the "Double Post Merge" addon by Syndol, and for every double post merged, this addon creates 2 queries. Besides this, every spoiler creates one DB query. The Addon itself has 2 queries already, the number ofqueies is just baffling, any solution to this?
Yorick, anything for this?

And also get issues with URL link title parsing in BBCodes. :(
 
yodawn, you're right - but BB Code is all about converting to HTML so theoretically what A.Chakery is trying to do is correct.

Technically, though this won't work.

How I would do this is the following.

Simple Replacement Start
Code:
<div class="alignleft">

Simple Replacement End
Code:
</div>

So if your tag was called ALIGNLEFT you would use it like so:

[ALIGNLEFT][IMG]http://www.domain.com/path/to/image.png[/IMG][/ALIGNLEFT]
It worked thank you ...


And would you please tell me how to create custom buttons for BB_codes ?

thank you
 
I am using the "Double Post Merge" addon by Syndol, and for every double post merged, this addon creates 2 queries. Besides this, every spoiler creates one DB query. The Addon itself has 2 queries already, the number ofqueies is just baffling, any solution to this?
Anything for this?
 
Top Bottom