inherit
55687
0
Jan 2, 2023 9:31:02 GMT -8
Ollie
83
August 2005
oliverclews
|
Post by Ollie on Dec 5, 2018 11:55:45 GMT -8
Evening everyone,
I've been doing some searching on here and I can't seem to find the information I'm after. I remember years ago there was some code you could use to display a certain message to someone if they were a guest and then have this different if they are logged in.
I'm wanting to use it to show different information at the top of my forum based on whether a user is logged in or a guest. If anyone knows what code to use I would be so appreciative!
Thanks, Ollie
|
|
inherit
96289
0
May 17, 2020 9:37:00 GMT -8
elli
1,822
January 2007
ebbymac
|
Post by elli on Dec 5, 2018 12:37:13 GMT -8
Here's one way to accomplish what you're after: {if !$[current_user.is_guest]} This message is for members and staff {else} This message is for guests {/if}
Note the exclamation mark preceeding $[current_user.is_guest] — the exclamation is called a "not" operator. It says if the current user is not a guest, show the following message, otherwise (else), show the next message. This would go in your forum's HTML templates. For example, Admin > Themes > Layout Templates > Forum Wrapper. Let me know if you have more questions.
|
|
inherit
55687
0
Jan 2, 2023 9:31:02 GMT -8
Ollie
83
August 2005
oliverclews
|
Post by Ollie on Dec 5, 2018 13:20:52 GMT -8
Genuis! Thank you so much elli You're a star!
|
|