Show to guests only

Get help developing custom BBCodes or request one.
Post Reply
whaturmuva
Registered User
Posts: 99
Joined: Thu Jun 19, 2008 3:09 pm
Contact:

Show to guests only

Post by whaturmuva » Thu Dec 19, 2013 1:55 pm

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?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51883
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Show to guests only

Post by Brf » Thu Dec 19, 2013 5:25 pm

You cannot put template-code in a post.
Posts are not part of the template file.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66858
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Show to guests only

Post by Lumpy Burgertushie » Thu Dec 19, 2013 8:10 pm

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
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Show to guests only

Post by RMcGirr83 » Fri Dec 20, 2013 11:43 am

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.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

techman41973
Registered User
Posts: 410
Joined: Thu Mar 28, 2013 10:27 pm

Re: Show to guests only

Post by techman41973 » Wed Oct 08, 2014 11:49 pm

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

User avatar
JoshyPHP
Code Contributor
Posts: 1046
Joined: Mon Jul 11, 2011 12:28 am

Re: Show to guests only

Post by JoshyPHP » Thu Oct 09, 2014 12:42 am

It's not possible. Custom BBCodes do not use the templating engine, you're limited to simple string substitutions.
I wrote the thing that does BBCodes in 3.2.

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Show to guests only

Post by Oyabun1 » Fri Oct 10, 2014 7:36 am

You would need a MOD like, Adaptive Hide BBcodes.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

Post Reply

Return to “Custom BBCode Development and Requests”