PDA

View Full Version : Problem with restricting code


James Birkett
08-04-2009, 05:51 PM
I have a problem with hiding code from guests.
I am using this code:

<if condition="$show['member']">$code<else /><if condition="$show['guest']">{A message telling them to register}</if></if>


This works fine on my coding forums, however, now when a new thread/post is made that contains either code/html/php tags, they aren't restricted from guests.

Is this to do with post caching? Should I disable it (set to 0)?

EDIT: Fixed that issue - now I have another

If a user posts a large block of code, the box grows (obviously), so when the guest message is displayed, the box is still extremely large.
Is there any way to resize the box for guests messages so it's the size of the custom message rather than the whole block of code.

Lynne
08-04-2009, 06:45 PM
All the css for the code block is in the template. If you don't want to have the same css for your message as with the block itself, then you'll have to put your if condition outside of that and create your own css.

James Birkett
08-04-2009, 07:30 PM
Thanks Lynne :)