Page 1 of 1

Show to guests only

Posted: Thu Dec 19, 2013 1:55 pm
by whaturmuva
I was hoping to develop a little bbcode that will display text, but only to guests.

Code: Select all

[guestview]{TEXT}[/guestview]

<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->{TEXT}<!-- ENDIF -->
I thought the above would work but it failed. Any advice on what I'm missing?

Re: Show to guests only

Posted: Thu Dec 19, 2013 5:25 pm
by Brf
You cannot put template-code in a post.
Posts are not part of the template file.

Re: Show to guests only

Posted: Thu Dec 19, 2013 8:10 pm
by Lumpy Burgertushie
nor can you put bbcode in a template file.

If you are working in a template file you can use your IF statement to surrond the text:

Code: Select all

<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->your text here that you want to show to guests only<!-- ENDIF -->

robert

Re: Show to guests only

Posted: Fri Dec 20, 2013 11:43 am
by RMcGirr83

Code: Select all

<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->your text here that you want to show to guests only<!-- ENDIF -->
S_IS_BOT is only triggered if a bot is logged in.

Re: Show to guests only

Posted: Wed Oct 08, 2014 11:49 pm
by techman41973
Anyone figure out how to do this?
I have the same application.
There is text in some of my posts that I don't want to show if the user is logged in.
thanks

Re: Show to guests only

Posted: Thu Oct 09, 2014 12:42 am
by JoshyPHP
It's not possible. Custom BBCodes do not use the templating engine, you're limited to simple string substitutions.

Re: Show to guests only

Posted: Fri Oct 10, 2014 7:36 am
by Oyabun1
You would need a MOD like, Adaptive Hide BBcodes.