TROOZERS talking joomla!

Currently updating all components and mambots to Joomla 1.0.x, these will be available soon.

 
Home arrow Joomla arrow Hacks arrow Offline Administrator
Spacer
spacer
Talking Joomla Spacer Spacer
Troozers
Offline Administrator
Sunday, 14 November 2004

hack iconThis article has been translated to Polish, available at mambopl.com

Have you ever wanted to, as an Administrator, be able to view your own mambo website while it is offline?  One of the reasons you may have your site offline, is that you are updating the look which is made that more difficult when you can't see what it now looks like.

After a conversation, with idigital, I decided to see whether it was possible to allow administrators to view their site, whilst offline, when launched as a preview from within the administration screen.  The following hacks to the mambo core enable this, although some more testing still needs to be done.

/path-to-mambo/administrator/index2.php
Enter the following lines, highlighted in yellow, after line 22 where it loads the language includes and admin.php;

require_once( "../globals.php" );
require_once( "../configuration.php" );
require_once( $mosConfig_absolute_path . "/includes/mambo.php" );
include_once( $mosConfig_absolute_path . "/language/".$mosConfig_lang.".php" );
require_once( $mosConfig_absolute_path . "/administrator/includes/admin.php" );

session_name( "troozers" );
session_start();
$_SESSION['admin_user'] = "Y";
session_write_close();

 

/path-to-mambo/index.php
After line 20, where is loads configuration.php, include the following lines highlighted in yellow and update the "if" statement as shown;

include_once( 'globals.php' );
require_once( 'configuration.php' );

session_name( "troozers" );
session_start();

$ok_to_browse = ( $_SESSION['admin_user'] == "Y" );

// displays offline page
if ( $mosConfig_offline == 1 && ! $ok_to_browse ){


If you browse to your offline site, with the following changes entered, it will still show the offline message.  However, if you select Site > Preview from within the administration screen you should now be able to browse your site. 

When you logout of the administration screen you will still be able to browse your site until the browser window is closed.  This is because the session variable created, to allow administrators to browse their site, is still available to the browser until it's closed.

If you do decide to use this hack please remember to backup the two files before making the changes.  As mentioned before these changes are still being tested, but if you do try them out - tell me how you get on.  Have fun and enjoy
 


 
< Prev   Next >
Spacer
Latest News
Partner Sites
jh design! banner

 RocketTheme Banner

Projects Completed
Amazon Ad
Bottom
Copyright © 2006, Andy Stewart. All Rights Reserved. Joomla! design by jh! design
Spacer Footer