2009-07-30 31 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是窒息