BbCodes & Buttons Manager

BbCodes & Buttons Manager 3.3.5

No permission to download
regarding the content protected.. i am trying to hide links from guests..

i want to be able to show guests our thread content but hiding the links and attachments.. not by default it shows content protection but i have seen many forums have this instead:

kCjhMj8.png


how do i get it to show this? instead of content protected?? and i haven't found nay other add ones that does as shown in the above image..

the class that comes with that image is called "importantMessage"
but i haven't had any luck in finding anything on xenforo that may be using that class.

i have been trying to find this feature for a long time and its been driving me nuts.....

Edit:
i have found a few template edits that archives this but i would prefer not editing it as so many other add ones use the TMS system find keywords within the template for it to operate properly..
and it might break the functionality of BBM manager and other add ones...

is there any way to achieve this through ur add one? like edit the phrases or make a template edit? so instead of saying Content protected it shows as the above image? with the Registration and login links?

this one is a simple TMS ver: https://xenforo.com/community/resources/hide-bbcodes-to-guests.3713/
but it fails to work on testing board - most likely due to the BBM manager

tried using this code
Code:
<xen:if is="!{$visitor.user_id}">
<span style="font-size:10px;padding-left:10px;"><i>Sorry, you need to <a href="{xen:link register}">register</a> or <a href="{xen:link login}">login</a> to see this BBcode !</i></span>
<xen:else />

inside the bbm_viewer_content_protected phrase but the login/register links failed to work...

but if i use this method it will apply to all protected content including registered members who are viewing threads with protected content...
 
Last edited:
@XxUnkn0wnxX

First of all thank you, I've patched a bug. Now, just to refresh memory, see this picture:
viewer_perms_demo-png.81012

So what you want to do is to hide the url Bb Code and customize the protected template layout.

This template is "bbm_viewer_content_protected". Here are the available variables inside it:
  • {$tagName}, you will need this
  • {$rendererStates}, you won't need this, but if you want to access its data, use: {xen:helper dump, $rendererStates}

The default content of this template is basic:
Code:
<xen:require css="bbm_viewer_content_protected.css" />

<div class="bbm_protected_title">
   {xen:raw $phrase}
</div>

You can customize it using a template modification or even coding directly inside it (do no code in the master template cause your mods will be erased after an update). Here is a possible solution:
Code:
<xen:require css="bbm_viewer_content_protected.css" />

<xen:if is="{$tagName} == 'url'">
   <xen:include template="yourNewTemplate" />
<xen:else />
   <div class="bbm_protected_title">
     {xen:raw $phrase}
   </div>
</xen:if>

You just need to create your new template and customize it as you want to. This new template will only be used for the url tag. If you want to use it with more tags, use this conditional:
Code:
<xen:if is="in_array({$tagName}, array('url', 'attach'))">
 
  • Like
Reactions: Xon
so if i made a template called "hide_url_guest"

? - can i just use code that i found lying such as:

<xen:if is="!{$visitor.user_id} OR {$visitor.user_state} != 'valid'">
Please <label for="LoginControl"><a href="{xen:link login}" class="inner">Register/Login (Confirm your Email)</a></label> to view Links or Attachments
</xen:if>

and i would include this for the css?

<xen:require css="hide_url_guest.css" /> <-- i assume you where referring the the customisations made in here?
 
Last edited:
so if i made a template called "hide_url_guest"

? - can i just use code that i found lying such as:

<xen:if is="!{$visitor.user_id} OR {$visitor.user_state} != 'valid'">
Please <label for="LoginControl"><a href="{xen:link login}" class="inner">Register/Login (Confirm your Email)</a></label> to view Links or Attachments
</xen:if>

and i would include this for the css?

<xen:require css="hide_url_guest.css" /> <-- i assume you where referring the the customisations made in here?
  • Can you use any XenForo template tags ?= > Yes.
  • Is this necessary ? => No, for example the above conditional is not needed since the visitor check is done before, so the template "hide_url_guest.css" will only be used for people who don't have the permission to see the url Bb Code. But if you want to reuse css, yes.
 
Hello, cclaerhout -


where do I find the permission settings?

Update: I found it, under user permissions.

My problem is, that the "This content is protected" message shows up, while I have all permissions on "not set". What do I need to do to disable any kind of protection (everyone is allowed to see everything)?

I know there is a setting "Activate the Bb Codes Content Protection", but either way it gives the above message. Strangely enough, my fellow admin sees "This content is protected", while I do see the content. We both are members of the admin group, with no additional memberships.
 
Last edited:
Hello, cclaerhout -


where do I find the permission settings?

Update: I found it, under user permissions.

My problem is, that the "This content is protected" message shows up, while I have all permissions on "not set". What do I need to do to disable any kind of protection (everyone is allowed to see everything)?

I know there is a setting "Activate the Bb Codes Content Protection", but either way it gives the above message. Strangely enough, my fellow admin sees "This content is protected", while I do see the content. We both are members of the admin group, with no additional memberships.
Last time someone reported such a problem, he found the problem came from an incorrect permissions settings [ref]. If you're sure of you, contact by pm (admin+ftp access), I will have a look, but that will next weekend.
 
@cclaerhout got several fatal errors with the new version:

Code:
ErrorException: Fatal Error: syntax error, unexpected end of file, expecting function (T_FUNCTION) - library/BBM/Protection/Helper/ContentProtection.php:8
Generated By: Unknown Account, Yesterday at 8:38 PM
Stack Trace

#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}

Request State

array(3) {
  ["url"] => string(42) "http://dressedwell.net/taigachat/list.json"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(8) {
    ["sidebar"] => string(1) "1"
    ["lastrefresh"] => string(2) "79"
    ["fake"] => string(1) "0"
    ["room"] => string(1) "1"
    ["_xfRequestUri"] => string(1) "/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}

Code:
XenForo_Exception: Invalid model 'BBM_Model_BbCodes' specified - library/XenForo/Model.php:192
Generated By: Leitmotif, Yesterday at 8:37 PM
Stack Trace

#0 /home/dressedw/public_html/library/BBM/Helper/Bbm.php(108): XenForo_Model::create('BBM_Model_BbCod...')
#1 /home/dressedw/public_html/library/BBM/BbCode/Formatter/Base.php(52): BBM_Helper_Bbm::getBbmBbCodes()
#2 /home/dressedw/public_html/library/BBM/BbCode/Formatter/Base.php(38): BBM_BbCode_Formatter_Base->bakeBbmTags()
#3 /home/dressedw/public_html/library/XenForo/BbCode/Formatter/Base.php(117): BBM_BbCode_Formatter_Base->getTags()
#4 /home/dressedw/public_html/library/BBM/BbCode/Formatter/Base.php(28): XenForo_BbCode_Formatter_Base->__construct()
#5 /home/dressedw/public_html/library/XenForo/BbCode/Formatter/Base.php(1941): BBM_BbCode_Formatter_Base->__construct()
#6 /home/dressedw/public_html/library/Dark/TaigaChat/ControllerPublic/TaigaChat.php(33): XenForo_BbCode_Formatter_Base::create('Base')
#7 /home/dressedw/public_html/library/XenForo/FrontController.php(347): Dark_TaigaChat_ControllerPublic_TaigaChat->actionList()
#8 /home/dressedw/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#9 /home/dressedw/public_html/index.php(13): XenForo_FrontController->run()
#10 {main}

Request State

array(3) {
  ["url"] => string(42) "http://dressedwell.net/taigachat/list.json"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(8) {
    ["sidebar"] => string(1) "1"
    ["lastrefresh"] => string(2) "79"
    ["fake"] => string(1) "0"
    ["room"] => string(1) "1"
    ["_xfRequestUri"] => string(1) "/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}

Code:
ErrorException: Fatal Error: Class 'BBM_BbCode_Formatter_Base' not found - library/XenForo/BbCode/Formatter/Base.php:1941
Generated By: Leitmotif, Yesterday at 8:37 PM
Stack Trace

#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}

Request State

array(3) {
  ["url"] => string(42) "http://dressedwell.net/taigachat/list.json"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(8) {
    ["sidebar"] => string(1) "1"
    ["lastrefresh"] => string(2) "79"
    ["fake"] => string(1) "0"
    ["room"] => string(1) "1"
    ["_xfRequestUri"] => string(1) "/"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
@cclaerhout got several fatal errors with the new version:

Code:
ErrorException: Fatal Error: syntax error, unexpected end of file, expecting function (T_FUNCTION) - library/BBM/Protection/Helper/ContentProtection.php:8
Generated By: Unknown Account, Yesterday at 8:38 PM
Stack Trace
@Rambro Can you make sure the files uploaded correctly?

As given that this line is throwing an error, I wouldn't be surprised if the file is truncated.
 
Hello Cedric,

I have check permission for some bbcode ex : fiedlset
but can't find a way for url and and image, bot are displaying protected content mention.

After setting up your addon, we have "content is protected' message in our threads : http://www.forum-des-portables-asus...des-forums-a-lire-avant-de-poster-merci.8433/
Note that even 'text' between fieldset is protected

same for this thread first message including text :
http://www.forum-des-portables-asus.fr/forums/index.php?threads/asus-p750lb-t2059g.11986/

I check in group permission, all is set OK.
Please can you help ?
 
Last edited:
@Rambro
Yes, reupload the files, the error is coming from a class that hasn't been changed since a while.
@kankan
I'm not sure to understand, be sure to upgrade to the last version of the addon, if the problem still occurs, contact me by pm so we can talk in French.
 
@kankan
I'm going to reply to your pm here since it can be usefull for others.

  • About the XenForo Bb Codes Viewing permissions
    viewPerms.webp
    The configuration for the admin is certainly not correct. The default state for a Bb Code is it to be parsed. So if I ask you the question "Do you want me to disable/to hide the content of the url Bb Code", if you say "YES" (green) it will be disabled. If you say "No" (grey - default state), it will be parsed. All your settings are on "Allow" which mean all these Bb Codes will be disabled. So fix this.
  • About the Bbm Bb Codes Viewing permissions
    BbmBbPerms.webp
    Your viewing permissions are correct, but your Parsing permissions (screenshot above) are not. You enable them ("Activate parsing usergroup permissions for this Bb Code?") but you didn't select any usergroups. So it is enabled for no one. To fix this, simply uncheck "Activate parsing usergroup permissions for this Bb Code?" and save.
  • About the following error: "ErrorException: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given - library/BBM/Helper/BbCodes.php:426"
    It's coming from the new HTML checker that is sometimes used by some Bb Codes. It shows you're not using a recent version of PHP (< 5.3.6). So the solution is to upgrade it OR to use an alternative method to check the Html content of your Bb Codes. To set it, just do as described in the below screenshot:
    HtmlChecker.webp
 
Last edited:
-Feedback-
The problem of GeorgeS was the same as Kankan about the XenForo viewing permissions configuration, but is was not coming from the usergroups settings, nor the node settings, but the user settings.
 
Top Bottom