Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何检查用户是否在 Joomla 2.5 中登录?我似乎只能找到旧版本 joomla 的代码片段。是一样的吗?
if(JFactory::getUser()->id) { //user has logged in }
是的,和以前一样,试试这个-
$user =& JFactory::getUser(); if($user->id!=0){ //user is logged in }
$user = JFactory::getUser()->guest;
如果您使用的是PHP 5.3。