Hi
We have a Joomla 1.5 site with a blog in a subfolder /blog/
We would like to have a login status at the top of each page. For consistency of navigation we want to show the joomla login status at the top of the wordpress blog.
eg
Login | Register | Help
or
You are loged in as stephen baugh | Help
The problem is that although the scipt blow correctly returns the login status, if I add it to a wordpress template the status is correctly returned and drawn to the screen, but then the page stops drawing. Anyone have any ideas how I stop the Joomla scripts making the Wordpress script stop.
Thanks Stephen
<?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>';
}
?>