• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
BbCodes & Buttons Manager

BbCodes & Buttons Manager 3.3.5

No permission to download
See @Xon reply => admin permission


Feel free to support it.


No time and no interest/motivation of XF2.


As usual, thank you. I will release the commit you pushed me during the last months.


I don't understand the question. This addon gives you an access to xenforo template, so you can incluse xenforo css templates.
I just saw your github merges.

Well, nothing now, I actually learned to use this addon fully. I got one problem though, It may be a good option to check if the actual poster of the bbcode has permissions to use It.

Or did I miss something? Does this addon support that, or currently not? Since that's what I'm really looking for, to make actual staff bbcodes.
 

cclaerhout

Well-known member
I just saw your github merges.

Well, nothing now, I actually learned to use this addon fully. I got one problem though, It may be a good option to check if the actual poster of the bbcode has permissions to use It.

Or did I miss something? Does this addon support that, or currently not? Since that's what I'm really looking for, to make actual staff bbcodes.
These are the "Parser permissions (who can use the Bb Code)" (quoted from the addon description). The addon does support this generating a bbcode map. Xon included some patches in the commit you saw.
 
These are the "Parser permissions (who can use the Bb Code)" (quoted from the addon description). The addon does support this generating a bbcode map. Xon included some patches in the commit you saw.
I think you may have misunderstood me, or I am still missing something.

Like I have a bbcode, let's call It test. [test]

I give parser permissions to the "Admin" group.

I post [test] Test [/test], and my css appears nice an fine.

Users do not see that test bbcode due to lack of parsing permissions.

A User posts [test] Test [/test], the User can't see It, but I can.

--
So my problem is, I want parsing enabled for everyone, but if the actual person who made the post doesn't have permission to use the BBcode, then It will disappear for everyone.
 
I think you may have misunderstood me, or I am still missing something.

Like I have a bbcode, let's call It test. [test]

I give parser permissions to the "Admin" group.

I post [test] Test [/test], and my css appears nice an fine.

Users do not see that test bbcode due to lack of parsing permissions.

A User posts [test] Test [/test], the User can't see It, but I can.

--
So my problem is, I want parsing enabled for everyone, but if the actual person who made the post doesn't have permission to use the BBcode, then It will disappear for everyone.

Alright, so solving my own problem using your addon. Seems to be working logically, not a web developer here soz. More like a platform dev instead.
So If anyone is interested applying a custom check in the templates, wheather the POST'S USER is allowed to use the specific BBCode, here is how I did It.

So I went on right ahead, and made myself a custom addon exactly like that: https://xenforo.com/community/resources/how-to-create-your-own-helpers.332/
I'm attaching my own "helper", It's exactly as the tutorial. I left It like that for newbies I guess, BUT I DID bother changing the method. The name is: containsdata

I also edited the Base.php, as I saw that was the correct one to edit, and again I wasn't sure If I'm doing It right, but I should be..
Seems to be working after lots of testing, without errors. (Base.zip, /library/BBM/BbCode/Formatter)

The only thing I added was:
PHP:
$rendererStates['PosterMainUserGroups'] = $this->getPostParam('user_group_id');
$rendererStates['PosterSecondaryUserGroups'] = $this->getPostParam('secondary_group_ids');

Then I went on and called the custom template as usual, which calls my own css design for the bbcode:
upload_2017-8-5_17-50-59.png

Code was:
CSS:
<xen:if is="{xen:helper containsdata, $rendererStates.PosterMainUserGroups, 4} OR {xen:helper containsdata, $rendererStates.PosterSecondaryUserGroups, 4}">
    <div class="admin-title">Text</div>
    <div class="admin-text" style="float:{$float}">{xen:raw $content}</div>
<xen:else />
   {xen:raw $content}
</xen:if>
Notice that the {xen:helper containsdata, $rendererStates.PosterMainUserGroups, 4}
was the usergroup I wanted to limit the bbcode to. And It doesn't work for people who don't have the groupID 4. (This applies to the posters, not to the visitors, so If the poster didn't have permissions, nobody will see It, If It did then everyone will see It)


Once more, thanks for the wonderful addon. I just had to find a way to extend It for myself.


Edit:

Attached a V2 Helper. (Files only)
 

Attachments

Last edited:

cclaerhout

Well-known member
So my problem is, I want parsing enabled for everyone, but if the actual person who made the post doesn't have permission to use the BBcode, then It will disappear for everyone.
What you described above this statement is working as intended. If you want to make the content "disappear " for everyone, just set "blank" in "Unauthorised Return". But I do not recommend it. You should set "unparsed content with tags". As an admin, this will let you know who tried to use this bbcode.

I also edited the Base.php
I haven't read all your post, but avoid to edit a file. Extend the class if you want (you will find information in the development section).
 

cclaerhout

Well-known member
Cedric, can you check out XF2 enough to say if XF2 is going to allow more control over the editor than XF1 did ?

It seemed quite hard to insert "new" buttons and bbcode into XF1, will it be the same hassle for XF2 as it was in XF1 ?
Sorry no time to play with XF2. This question should directly be dealt with XenForo developers ;)
 
Last edited:

cclaerhout

Well-known member
What you described above this statement is working as intended. If you want to make the content "disappear " for everyone, just set "blank" in "Unauthorised Return". But I do not recommend it. You should set "unparsed content with tags". As an admin, this will let you know who tried to use this bbcode.


I haven't read all your post, but avoid to edit a file. Extend the class if you want (you will find information in the development section).
Well that's why the addon is not compatible the way I wanted It. My post explains It, editing was easier.
 

Rambro

Well-known member
@Xon since this didn't make it into the core is there any chance you can add it to your roster of XF2 addons? Having the media and spoiler buttons hidden is going to be a huge pain in the ass for the users.
 
i seem to be getting major errors since update:

Code:
ErrorException: Fatal Error: Allowed memory size of 1077936128 bytes exhausted (tried to allocate 20480 bytes) - library/BBM/BbCode/Formatter/Base.php:1317
Generated By: Unknown Account, Yesterday at 8:01 PM
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
  ["url"] => string(46) "https://portalcentric.net/forums/help/bb-codes"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
and when i go to help page for bbcodes all users see this:


Fatal error: Allowed memory size of 1077936128 bytes exhausted (tried to allocate 262144 bytes) in /home/Admin/public_html/forums/library/BBM/BbCode/Formatter/Base.php on line 1337

it was also complaining about some line around 500ish
i did fresh re-install, error seems to be gone, but still may come back..
 
Last edited:

cclaerhout

Well-known member
i seem to be getting major errors since update:

Code:
ErrorException: Fatal Error: Allowed memory size of 1077936128 bytes exhausted (tried to allocate 20480 bytes) - library/BBM/BbCode/Formatter/Base.php:1317
Generated By: Unknown Account, Yesterday at 8:01 PM
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
  ["url"] => string(46) "https://portalcentric.net/forums/help/bb-codes"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
and when i go to help page for bbcodes all users see this:


Fatal error: Allowed memory size of 1077936128 bytes exhausted (tried to allocate 262144 bytes) in /home/Admin/public_html/forums/library/BBM/BbCode/Formatter/Base.php on line 1337

it was also complaining about some line around 500ish
i did fresh re-install, error seems to be gone, but still may come back..
I had this error on a dev board. Disable/Enable the addon and it was gone. Mostly a cache problem during the update.
 
I had this error on a dev board. Disable/Enable the addon and it was gone. Mostly a cache problem during the update.
well this is still happening, this happens after 2-3 weeks of server runtime, so frustrating, i swear there is a memory leak somewhere...

and disable/enable does not fix it this time, only a reinstall from xml file fixes till it breaks again...
 
I have just updated to current version 3.3.5. However, within template "editor_js_setup" I still can see bb_code_edit.js . Is this correct?

Code:
<xen:if is="{$debugMode}">
     <xen:require js="js/redactor/redactor.full.js" />
<xen:else />
     <xen:require js="js/redactor/redactor.js" />
</xen:if>
<xen:require js="js/xenforo/bb_code_edit.js" />
<xen:require css="editor_ui.css" />
I have updated to new version because after a theme update my autocomplete list keeps hidden. When I type @ + username the autocomplete list shows up for half a second and hides before one is able to make a selection. With chrome debugger I found out that function triggerAutocomplete is responsible for this. Any ideas what I can do?

@cclaerhout
 
ok this is starting to become unacceptable:

Fatal error: Allowed memory size of 2621440000 bytes exhausted (tried to allocate 262144 bytes) in /public_html/forums/library/BBM/BbCode/Formatter/Base.php on line 1337 | some times line 537

Code:
Error Info

ErrorException: Fatal Error: Allowed memory size of 2621440000 bytes exhausted (tried to allocate 262144 bytes) - library/BBM/BbCode/Formatter/Base.php:1337

Generated By: XxUnkn0wnxX, 1 minute ago

Stack Trace



#0 [internal function]: XenForo_Application::handleFatalError()

#1 {main}



Request State



array(3) {

  ["url"] => string(46) "https://portalcentric.net/forums/help/bb-codes"

  ["_GET"] => array(0) {

  }

  ["_POST"] => array(0) {

  }

}
i'm having to reinstall this add-on every 3-4 days to fix this. even server reboot wont fix it.

I request a fix for this ASAP, or at least give me a cron job or something i can place in that will auto rebuild or clear the cache/memory
 
Last edited:
This is the correct github repository: https://github.com/cclaerhout/xen_BBM_v2

Have you tried disabling custom bbcode untill this stops? This shouldn't happen in stock xenforo with stock bbcodes and the bbocdes this add-on adds.
the issue occurs after a 2-3 days period and it only effects the help page. the BBCodes work fine no issues when this memory error occours.

the help page breaks and gives out that annoying Allowed memory size of 2621440000 bytes exhausted to all visitors who view BBcode section of the Help page.

https://portalcentric.net/forums/help/bb-codes becomes broken that's all, buts is very annoying. so im unsure how disabling bbcodes will help when the error only effects the help page and not any other section or threads on the forums?