Announcement

Collapse
No announcement yet.

Widget permissions?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spillage
    replied
    That did it.

    Thank you for your assistance.
    Your time is greatly appreciated.

    All the best for the festive season.

    Leave a comment:


  • Wayne Luke
    replied
    Sorry.. Change conditional to condition.

    HTML Code:
    <vb:if condition="is_member_of($bbuserinfo, 2,5,6,7,12,13)">
    <div class="cms_widget">
         <div class="block">
            <div class="cms_widget_header">
            <h3><img src="{vb:stylevar imgdir_siteicons}/html.png" alt="" /> {vb:raw widget_title}</h3>
            </div>
            <div class="cms_widget_content widget_content">
            {vb:raw static_html}
            </div>
        </div>
    </div>
    </vb:if>

    Leave a comment:


  • Spillage
    replied
    Arrrh, I see.

    When saving the template, I get the following error;
    The following error occurred when attempting to evaluate this template:

    Parse error: syntax error, unexpected ')' in /var/www/vhosts/nscale.net/httpdocs/forums/includes/adminfunctions_template.php(5217) : eval()'d code on line 1

    This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
    Why would the ")" be unexpected on line #1?

    Leave a comment:


  • Wayne Luke
    replied
    Originally posted by Spillage View Post
    I'm using a Static HTML widget.
    It contains;
    Code:
    <vb:if conditional="is_member_of($bbuserinfo, 2,5,6,7,12,13)">
    <script type="text/javascript" src="http://ji.revolvermaps.com/r.js"></script><script type="text/javascript">rm_f1st('0','212','true','false','000000','8mg13fu8x4l','true','ff0000');</script><noscript><applet codebase="http://ri.revolvermaps.com/j" code="core.RE" width="212" height="212" archive="g.jar"><param name="cabbase" value="g.cab" /><param name="r" value="true" /><param name="n" value="false" /><param name="i" value="8mg13fu8x4l" /><param name="m" value="0" /><param name="s" value="212" /><param name="c" value="ff0000" /><param name="v" value="true" /><param name="b" value="000000" /><param name="rfc" value="true" /></applet></noscript>
    </vb:if>
    You can't use conditionals in the content of the widget. You need to use a custom template.

    So at the bottom of your widget it should say:
    Template Name - vbcms_widget_static_page

    So looking at that template in the style manager you get this code:
    HTML Code:
    <div class="cms_widget">
        <div class="block">
            <div class="cms_widget_header">
            <h3><img src="{vb:stylevar imgdir_siteicons}/html.png" alt="" /> {vb:raw widget_title}</h3>
            </div>
            <div class="cms_widget_content widget_content">
            {vb:raw static_html}
            </div>
        </div>
    </div>
    So you would copy this code and select "Add New Template" from the Style Manager dropdown.

    In this new template you're going to give it a name. Say something like: vbcms_widget_static_page_custom1

    Then your code would be:
    HTML Code:
    <vb:if conditional="is_member_of($bbuserinfo, 2,5,6,7,12,13)">
    <div class="cms_widget">
         <div class="block">
            <div class="cms_widget_header">
            <h3><img src="{vb:stylevar imgdir_siteicons}/html.png" alt="" /> {vb:raw widget_title}</h3>
            </div>
            <div class="cms_widget_content widget_content">
            {vb:raw static_html}
            </div>
        </div>
    </div>
    </vb:if>
    So now in your widget, the code you would enter would be this:
    HTML Code:
    <script type="text/javascript" src="http://ji.revolvermaps.com/r.js"></script><script type="text/javascript">rm_f1st('0','212','true','false','000000','8mg13fu8x4l','true','ff0000');</script><noscript><applet codebase="http://ri.revolvermaps.com/j" code="core.RE" width="212" height="212" archive="g.jar"><param name="cabbase" value="g.cab" /><param name="r" value="true" /><param name="n" value="false" /><param name="i" value="8mg13fu8x4l" /><param name="m" value="0" /><param name="s" value="212" /><param name="c" value="ff0000" /><param name="v" value="true" /><param name="b" value="000000" /><param name="rfc" value="true" /></applet></noscript>
    And you would set the template name to: vbcms_widget_static_page_custom1

    Leave a comment:


  • Spillage
    replied
    I'm using a Static HTML widget.
    It contains;
    Code:
    <vb:if conditional="is_member_of($bbuserinfo, 2,5,6,7,12,13)">
    <script type="text/javascript" src="http://ji.revolvermaps.com/r.js"></script><script type="text/javascript">rm_f1st('0','212','true','false','000000','8mg13fu8x4l','true','ff0000');</script><noscript><applet codebase="http://ri.revolvermaps.com/j" code="core.RE" width="212" height="212" archive="g.jar"><param name="cabbase" value="g.cab" /><param name="r" value="true" /><param name="n" value="false" /><param name="i" value="8mg13fu8x4l" /><param name="m" value="0" /><param name="s" value="212" /><param name="c" value="ff0000" /><param name="v" value="true" /><param name="b" value="000000" /><param name="rfc" value="true" /></applet></noscript>
    </vb:if>

    Leave a comment:


  • Wayne Luke
    replied
    Originally posted by Spillage View Post
    Thanks, Wayne.
    That's what I thought, and had tried, but it doesn't seem to work.
    With that code in place, I can log out, and the widget is still visible.
    Would have to see the code you're using and the settings for your widget.

    Leave a comment:


  • Spillage
    replied
    Thanks, Wayne.
    That's what I thought, and had tried, but it doesn't seem to work.
    With that code in place, I can log out, and the widget is still visible.

    Leave a comment:


  • Wayne Luke
    replied
    There is no inherit Widget permissions in the system. However you can assign custom templates to individual widgets. Within those custom templates, you can surround the HTML code in a conditional that checks the usergroup. For example:

    HTML Code:
    <vb:if conditional="is_member_of($bbuserinfo, X,Y,Z)">
    ... widget code here...
    </vb:if>
    If they aren't in the usergroups that are represented by X, Y, and Z then the code will be empty and nothing will be shown.

    Leave a comment:


  • Spillage
    started a topic Widget permissions?

    Widget permissions?

    How do you set viewing permissions for widgets?
    I want to restrict certain widgets to members only.

    TiA,
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X