How can i detect guest in header template?
What variables can I use? Is there any document related to this?
What variables can I use? Is there any document related to this?
![]() |
How can i detect guest in header template?
What variables can I use? Is there any document related to this?
You can rely on the template "header_template_welcome_guest".
This template is displayed for guests (visitors not logged in). What do you want to achieve exactly? [ExiTuS]
If you wanted to display something only to guests, you can be clever with CSS:
$mybb->user['uid'] will be 0 for guests so the CSS class would be guest-notice-uid-0 and would then use the CSS to show the div again. This is assuming this is the sort of thing you wanted to do. (2021-02-22, 10:46 AM)Matt Wrote: If you wanted to display something only to guests, you can be clever with CSS: Thanks for reply, so, can i do that? if ({$mybb->user['uid']}==0){ //guest javascript codes }else{ //members javascript codes }
You can't have conditions in templates without an additional plugin (this is the one people usually use I think http://mybbhacks.zingaburga.com/showthread.php?tid=464).
As I said before,
put the code for guests into template "header_template_welcome_guest", for members into "header_template_welcome_member" [ExiTuS] (2021-02-22, 10:46 AM)Matt Wrote: If you wanted to display something only to guests, you can be clever with CSS: Hi Matt! I want to do something very similar with this plugin https://community.mybb.com/mods.php?action=view&pid=462 but to be able to display the message to the every group not just moderator and regardless if they able to post or not https://community.mybb.com/mods.php?acti...w&pid=1344 Looks I have to change only this
but I do not know how to do it Can you please help with this? Thanks
My forum powered by MyBB https://alhimika.net/forum/
|
« Next Oldest | Next Newest »
|