MyBB Community Forums

Full Version: Check if member login? how to?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I represent this code In mybboard?


showcurrentthemecode();

if (user is login) {
do code here  and show the content page.
}
else {
 echo " please login first ";
}


I know this is SQL and PHP and im actually in the verge of learning the language... I know basic and some advance php codes so i think i can understand some codes... I might as well ask what codes are better and used in this areas ... thanks  Big Grin

im actually planning to create a download page inside a forum and activeable by plugin using On and Off switches on the Admin CP. but right now i need to build up the things inside the webpage. again thanks Big Grin
	if($mybb->user['uid'] != 0) {
// Is logged in
	} else {
// Is not logged in.
}
If you use it within an function you need to globalise $mybb. like
global $mybb;
Something like that Smile
does this mean the code is

global $mybb; 
if($mybb->user['uid'] != 0) {
// Is logged in
    } else {
// Is not logged in.
} 

?? I think it need to require something right ?
Nope, not if you make an plug-in.