Current time: 07-24-2014, 08:26 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Show only for logged in users
02-21-2011, 10:15 PM
Post: #1
Solved: 3 Years, 4 Months, 4 Weeks, 8 Hours, 1 Minute, 21 Seconds ago Show only for logged in users
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.
Find all posts by this user
Quote this message in a reply
02-21-2011, 10:17 PM
Post: #2
Solved: 3 Years, 4 Months, 4 Weeks, 8 Hours, 1 Minute, 21 Seconds ago RE: Show only for logged in users
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-22-2011, 05:35 AM
Post: #3
Solved: 3 Years, 4 Months, 4 Weeks, 8 Hours, 1 Minute, 21 Seconds ago RE: Show only for logged in users
http://community.mybb.com/thread-31860.h...nditionals

^Link in case you need it. Toungue

Your friendly neighbourhood lurker.
Visit this user's website Find all posts by this user
Quote this message in a reply
02-22-2011, 05:45 AM (This post was last modified: 02-22-2011 05:46 AM by Danny247.)
Post: #4
Solved: 3 Years, 4 Months, 4 Weeks, 8 Hours, 1 Minute, 21 Seconds ago RE: Show only for logged in users
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 

.
Find all posts by this user
Quote this message in a reply
02-23-2011, 12:24 AM
Post: #5
Solved: 3 Years, 4 Months, 4 Weeks, 8 Hours, 1 Minute, 21 Seconds ago RE: Show only for logged in users
Thank you all! Big Grin

social. forever.
an online community.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication