Not Solved Show part of a template only for registered users?
#1
Not Solved
Hi,

is it possible to show a part of a template only to user who are logged in?

Thanks in advance! Smile
Reply
#2
Not Solved
Try this: http://mods.mybb.com/view-resource/templ...at-members
Reply
#3
Not Solved
Thanks for the quick answer and the link!

But I can't write php-code in a template in the adminpanel? Is that right? When I paste the code
if($mybb->user['uid'] != 0) { echo "testing"; }
into my template, the string "testing" doesn't show up?
Reply
#4
Not Solved
Right, you can't use PHP in templates. There is a plugin for that but I can't find it at the moment.
Reply
#5
Not Solved
Okay. I will find another way then. Thanks a lot.


Reply
#6
Not Solved
You can use this :
<?php if(in_array($mybb->user['usergroup'], array(1,7))) { } else {
echo "{$boardstats}";
} ?>

Thats an example of blocking guests (ID=1) & banned (ID=7) from seeing the boardstats. "{$boardstats}" is on the index template.

You also need to install this plugin to allow php in templates:


Attached Files
.zip   allow php in templates.zip (Size: 1.79 KB / Downloads: 52)
Reply
#7
Not Solved
Yay! That's it!
Thank for your help, Janota Smile
Reply
#8
Not Solved
No problem pal Big Grin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)