hiding code content from guests

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • _d3v1L
    New Member
    • Apr 2005
    • 10
    • 3.6.x

    hiding code content from guests

    Hi, I was wondering how to hide the content of code tags from unregistered members.
  • Jose Amaral Rego
    Senior Member
    • Feb 2005
    • 11058
    • 1.1.x

    #2
    Admin CP -> Styles & Templates -> Style Manager -> {Choose Style} -> {Drop Down Menu} Edit Templates -> BB Code Layout Templates -> « All Template Groups » -> bbcode_code

    # find in template: bbcode_code
    # add conditional to not display for selected usergroup
    # replace 'X' with usergroup you do not want to view CODE

    HTML Code:
    <if condition="!is_member_of($bbuserinfo, X)"><div style="margin:20px; margin-top:5px">
    	<div class="smallfont" style="margin-bottom:2px">$vbphrase[code]:</div>
    	<pre class="alt2" dir="ltr" style="
    		margin: 0px;
    		padding: $stylevar[cellpadding]px;
    		border: 1px inset;
    		width: $stylevar[codeblockwidth];
    		height: {$blockheight}px;
    		text-align: left;
    		overflow: auto">$code</pre>
    </div></if>

    Comment

    • nishv
      Member
      • Jul 2006
      • 49
      • 3.6.x

      #3
      Need to find a way to add a message like... You need to be logged in to View Code
      Any Idea?
      Nish Vamadevan
      www.techforums.info - Online Technical Forums

      Comment

      • The-Ensemble
        Senior Member
        • Jul 2006
        • 246
        • 3.6.x

        #4
        Here you go.

        HTML Code:
        <if condition="!is_member_of($bbuserinfo, X)"><div style="margin:20px; margin-top:5px">
            <div class="smallfont" style="margin-bottom:2px">$vbphrase[code]:</div>
            <pre class="alt2" dir="ltr" style="
                margin: 0px;
                padding: $stylevar[cellpadding]px;
                border: 1px inset;
                width: $stylevar[codeblockwidth];
                height: {$blockheight}px;
                text-align: left;
                overflow: auto">$code</pre>
        </div></if><if condition="is_member_of($bbuserinfo, X)"><b>You must be logged in to view codes.</b></if>
        That should be right.
        Last edited by The-Ensemble; Thu 19 Jul '07, 6:19am.

        Comment

        • nishv
          Member
          • Jul 2006
          • 49
          • 3.6.x

          #5
          Very nice, thx for ur help

          I am wondering, whether its possible to make it like the vb.org Codedisplayerror: message in a box with a link to Register at the side?

          See the screenshot for more info.

          Thanks Again
          Attached Files
          Nish Vamadevan
          www.techforums.info - Online Technical Forums

          Comment

          • Big Vet Guy
            New Member
            • Nov 2008
            • 7
            • 3.7.x

            #6
            Is there a way to hide the tags, from everyone, but moderators, and Admin?

            Comment

            • peterska2
              Senior Member
              • Oct 2003
              • 8869
              • 3.7.x

              #7
              Sorry, there is no function to do this. This requires modifying the code. We cannot officially support code modifications or forums running modified code, however you can try searching or asking for help with this over at www.vbulletin.org.

              Comment

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