Skip to content

Instantly share code, notes, and snippets.

@yanhua365
Created October 9, 2014 07:53
Show Gist options
  • Save yanhua365/6a79529636c6636826c8 to your computer and use it in GitHub Desktop.
Save yanhua365/6a79529636c6636826c8 to your computer and use it in GitHub Desktop.
discuz论坛判断用户是否登录的功能
//$_G['uid'] 表示注册用户的的 id 号,如果用户已经登录,该变量非空!
//通过判断 $_G['uid'] 是否为空来判断用户是否已经登录,如果没有登录,则调用 showmessage 提示用户登录或者注册!
if(empty($_G['uid'])) {
showmessage('to_login', '', array(), array('showmsg' => true, 'login' => 1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment