这样就可以了:
<?php
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__) );//this is when we are in the root
define( 'DS', DIRECTORY_SEPARATOR);
//导入
require_once (JPATH_BASE.DS.'includes'.DS.'defines.php');
require_once (JPATH_BASE.DS.'includes'.DS.'framework.php');
//初始化Joomla的相关信息
$mainframe =&JFactory::getApplication('site');
$mainframe->initialise();
//过的当前用户
$user = &JFactory::getUser();
if(!$user->get("username")){
?>
你还未登录!
<?php
}
本文介绍了一个使用PHP脚本初始化 Joomla 网站的过程,通过定义关键路径和包含必要的框架文件来实现网站的基本设置。此外,还展示了如何检查当前用户的登录状态。
1128

被折叠的 条评论
为什么被折叠?



