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 »

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: 52018
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Show to guests only

Post by Brf »

You cannot put template-code in a post.
Posts are not part of the template file.
User avatar
Lumpy Burgertushie
Registered User
Posts: 67902
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Show to guests only

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

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21132
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Show to guests only

Post 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.
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 | My extensions are updated regularly on github
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 »

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: 1125
Joined: Mon Jul 11, 2011 12:28 am

Re: Show to guests only

Post by JoshyPHP »

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 »

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”