Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2220

phpBB Custom Coding • Re: A tag to hide text for users but not modos/admin ?

$
0
0
In the template you would use:

Code:

<!-- IF U_MCP or U_ACP -->// your HTML<!-- ENDIF -->
MCP condition only works on index, viewtopic and viewforum.

If you are looking to do something else or make this work in posting pane explain what you want more precisely.
Sorry, That works in the Template files but NOT as a BBCode. BBCode HTML replacement occurs after the HTML templates are read, not before, so that code would just be ignored and will just be sent to the browser.

And It does read that the OP wants a BBCode.

For instance, using that to attempt to hide text via a BBCode for instance resulted in outputing the following into my browser (found via inspect element):

Code:

<div class="content"><!-- IF U_MCP or U_ACP -->This should be hidden.<!-- ENDIF --></div>
And "This should be hidden." was the content of the post, and was visible to anyone who had access to the post. As U_MCP and U_ACP are not processed in a web browser, but serverside, before what is sent to your browser is "built."

Statistics: Posted by [Dimetrodon] — Wed Oct 16, 2024 6:11 am



Viewing all articles
Browse latest Browse all 2220

Trending Articles