This only works for people who use only stubs to access their blogs.
In /admin/_menutop.php find:
<div id="headfunctions">
<?php echo T_('Style:') ?>
<a href="#" onclick="setActiveStyleSheet('Variation'); return false;" title="Variation (Default)">V</a>·<a href="#" onclick="setActiveStyleSheet('Desert'); return false;" title="Desert">D</a>·<a href="#" onclick="setActiveStyleSheet('Legacy'); return false;" title="Legacy">L</a><?php if( is_file( dirname(__FILE__).'/custom.css' ) ) { ?>·<a href="#" onclick="setActiveStyleSheet('Custom'); return false;" title="Custom">C</a><?php } ?>
•
<a href="<?php echo $htsrv_url ?>/login.php?action=logout"><?php echo T_('Logout') ?></a>
•
<a href="<?php echo $baseurl ?>"><?php echo T_('Exit to blogs') ?> <img src="img/close.gif" width="14" height="14" class="top" alt="" title="<?php echo T_('Exit to blogs') ?>" /></a><br />
</div>
and change it to:
<?php
// get the stub name for the active blog, if there is one
if( $blog != '' )
{
$blogstub = getblogstub( $blog );
$blogstub = $baseurl."/".$blogstub;
} else {
// if there is no active blog then pick the default blog
$blogstub = getblogstub( 2 );
$blogstub = $baseurl."/".$blogstub;
}
?>
<div id="headfunctions">
<?php echo T_('Style:') ?>
<a href="#" onclick="setActiveStyleSheet('Variation'); return false;" title="Variation (Default)">V</a>·<a href="#" onclick="setActiveStyleSheet('Desert'); return false;" title="Desert">D</a>·<a href="#" onclick="setActiveStyleSheet('Legacy'); return false;" title="Legacy">L</a><?php if( is_file( dirname(__FILE__).'/custom.css' ) ) { ?>·<a href="#" onclick="setActiveStyleSheet('Custom'); return false;" title="Custom">C</a><?php } ?>
•
<a href="<?php echo $htsrv_url ?>/login.php?action=logout"><?php echo T_('Logout') ?></a>
•
<a href="<?php echo $blogstub ?>"><?php echo T_('Exit to Active Blog') ?> <img src="img/close.gif" width="14" height="14" class="top" alt="" title="<?php echo T_('Exit to Active Blog') ?>" /></a><br />
</div>
The function "getblogstub()" looks like this:
function getblogstub( $whichstub )
{
global $DB, $tableblogs;
// get the blog stub name based on blog ID
$query = "SELECT blog_stub FROM $tableblogs WHERE blog_ID = $whichstub";
$blogstub = $DB->get_var( $query );
return $blogstub;
}
If this was a good hack it would look at blog access method and generate an appropriate link, but it's not. :roll:
I've tried it, but when I click on the admin link on the active blog it takes me to /admin/b2edit.php?blog=5 which just displays a blank page with only the header section?! no body content.
Any suggestions?
PS. I am only using stubs to access all my blogs.