Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 8 Months, 3 Days, 9 Hours, 25 Minutes, 11 Seconds ago Show only for logged in users
#1
Solved: 3 Years, 8 Months, 3 Days, 9 Hours, 25 Minutes, 11 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.
Reply
#2
Solved: 3 Years, 8 Months, 3 Days, 9 Hours, 25 Minutes, 11 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.
Reply
#3
Solved: 3 Years, 8 Months, 3 Days, 9 Hours, 25 Minutes, 11 Seconds ago
http://community.mybb.com/thread-31860.html?highlight=PHP+Conditionals

^Link in case you need it. Toungue
Your friendly neighbourhood lurker.
Reply
#4
Solved: 3 Years, 8 Months, 3 Days, 9 Hours, 25 Minutes, 11 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 
.
Reply
#5
Solved: 3 Years, 8 Months, 3 Days, 9 Hours, 25 Minutes, 11 Seconds ago
Thank you all! Big Grin
social. forever.
an online community.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)