Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 5 Years, 4 Months, 4 Weeks, 1 Day, 19 Hours, 58 Minutes, 22 Seconds ago Show only for logged in users
#1
Solved: 5 Years, 4 Months, 4 Weeks, 1 Day, 19 Hours, 58 Minutes, 22 Seconds ago
What is the code for only displaying content for logged in users in templates?

something like
<---BEGIN LOGGED_IN ONLY--->
if you are logged in, you will see this. otherwise, this is inviable.
<---END LOGGED_IN ONLY--->

Thanks Big Grin
social. forever.
an online community.
#2
Solved: 5 Years, 4 Months, 4 Weeks, 1 Day, 19 Hours, 58 Minutes, 22 Seconds ago
You can't do this in templates by default, you need to install the PHP in templates plugin.
Can you still feel the butterflies?

Free never tasted like pudding.
#3
Solved: 5 Years, 4 Months, 4 Weeks, 1 Day, 19 Hours, 58 Minutes, 22 Seconds ago
http://community.mybb.com/thread-31860.h...nditionals

^Link in case you need it. Toungue
Your friendly neighbourhood lurker.
#4
Solved: 5 Years, 4 Months, 4 Weeks, 1 Day, 19 Hours, 58 Minutes, 22 Seconds ago
Once you have the plugin listed above, use this code:

PHP Code:
if(!$mybb->user['uid'])
error_no_permission();
}
// place your PHP/templates/HTML/whatever code below the bracket above, or just below this line 
.
#5
Solved: 5 Years, 4 Months, 4 Weeks, 1 Day, 19 Hours, 58 Minutes, 22 Seconds ago
Thank you all! Big Grin
social. forever.
an online community.


Forum Jump:


Users browsing this thread: 1 Guest(s)