2009-07-30 52 views
0

我们有一个Joomla 1.5网站与博客中的子文件夹/blog/检查的Joomla登录从WordPress的博客

我们想在每一页的顶部的登录状态。为了保持导航的一致性,我们希望在WordPress博客顶部显示joomla登录状态。

例如:

登录|注册|帮助

您loged作为斯蒂芬·鲍 |帮助

问题是,虽然scipt正确地返回登录状态,如果我将它添加到wordpress模板状态正确返回并绘制到屏幕,但页面停止绘制。任何人都有任何想法,我如何阻止Joomla脚本使Wordpress脚本停止。

<?php 

define('_JEXEC', 1); 
define('JPATH_BASE', '/Library/WebServer/testqueensberrycom'); 
define('DS', DIRECTORY_SEPARATOR); 
require_once (JPATH_BASE .DS.'includes'.DS.'defines.php'); 
require_once (JPATH_BASE .DS.'includes'.DS.'framework.php'); 

$mainframe =& JFactory::getApplication('site'); 
$mainframe->initialise(); 
//$mainframe->triggerEvent('onAfterInitialise'); 
//$mainframe->route(); 
//$mainframe->authorize(''); 

$user =& JFactory::getUser(); 

if (($user->id) > 0){ 
    return 'You are signed in as: <a href="/editprofile/user.html">' . $user->username . '</a> | <a href="/index.php?option=com_content&view=article&id=225">Help</a> | <a href="/index.php?option=com_user&task=logout&return=cGFydG5lci9wcm9jZXNzL3BhcnRuZXIuaHRtbA==">Sign out</a>'; 
} else { 
    return '<a href="/index.php?option=com_user&view=login">Login</a> | Join | <a href="/index.php?option=com_content&view=article&id=225">Help</a>'; 
} 

?> 
+0

予以明确。这是一个php脚本,我正在尝试在wordpress安装中运行。问题本身并不是脚本本身。这是它似乎杀了wordpress会话。 任何接受者? – 2009-08-01 04:17:27

回答

0

嗯,有很多的可能性。 Joomla有很多功能,比如注册全局模拟等等(很多取决于你是否使用遗留模式......) - 这可能很容易与其他脚本冲突。它也使得很多定义和填充很多全球性的点,这也可能与其他脚本冲突。

事情我能想到的尝试:

  • 添加$mainframe->close();
  • 尝试的Joomla码后设定error_reporting(E_ALL);已经跑,看看有什么WordPress是窒息