2021-02-22, 06:44 AM
2021-02-22, 10:39 AM
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]
This template is displayed for guests (visitors not logged in).
What do you want to achieve exactly?
[ExiTuS]
2021-02-22, 10:46 AM
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.
<div class="guest-notice guest-notice-uid-{$mybb->user['uid']}">
...
</div>
.guest-notice {
display: none;
}
.guest-notice-uid-0 {
display: block;
}
$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, 12:32 PM
(2021-02-22, 10:46 AM)Matt Wrote: [ -> ]If you wanted to display something only to guests, you can be clever with CSS:
<div class="guest-notice guest-notice-uid-{$mybb->user['uid']}"> ... </div>
.guest-notice { display: none; } .guest-notice-uid-0 { display: block; }
$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.
Thanks for reply, so, can i do that?
if ({$mybb->user['uid']}==0){
//guest javascript codes
}else{
//members javascript codes
}
2021-02-22, 12:34 PM
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).
2021-02-22, 03:05 PM
As I said before,
put the code for guests into template "header_template_welcome_guest",
for members into "header_template_welcome_member"
[ExiTuS]
put the code for guests into template "header_template_welcome_guest",
for members into "header_template_welcome_member"
[ExiTuS]
2021-02-22, 03:08 PM
(2021-02-22, 03:05 PM)[ExiTuS] Wrote: [ -> ]As I said before,
put the code for guests into template "header_template_welcome_guest",
for members into "header_template_welcome_member"
[ExiTuS]
Oh yes, this would work
2021-02-22, 03:45 PM
(2021-02-22, 10:46 AM)Matt Wrote: [ -> ]If you wanted to display something only to guests, you can be clever with CSS:
<div class="guest-notice guest-notice-uid-{$mybb->user['uid']}"> ... </div>
.guest-notice { display: none; } .guest-notice-uid-0 { display: block; }
$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.
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
if (is_moderator($fid, "canpostclosedthreads") && $thread['closed'])
eval("\$newreply = \"".$display.$templates->get("showthread_newreply")."\";");
but I do not know how to do it
Can you please help with this?
Thanks