This Mod allows you to redirect you site to a "Closed for Maintenance" page from your Admin Control panel.
Database Row value added:Settings Table
Pages changed:- admin/settings.php
- lang/
your_language/admin.php
- Index.php
New files: - templates/
your_template/maintenance.html
Time to complete:15-20 minutes
Database update:
Download this file
http://www.1024x768wallpapers.com/Code_help_files/install_MainP.zipUnZip it and copy it into your root directory then run it through your browser
http://www.yoursite.com/install_MainP.php
This install_MainP file just inserts another row to your settings table the name "maintenance" and a value of "0". It does not change the table in any way. Edit admin/settings.php
Find
show_setting_row("gz_compress_level");
Add after
show_setting_row("maintenance", "radio"); //Mod of maintenance page
Edit lang/
your_langage/admin.php
Find:
$setting['gz_compress_level'] = "GZip level of compression<br /><span class=\"smalltext\">0-9, 0=none, 9=max</span>";
Add After
$setting['maintenance'] = "Turn maintenance page ON"; //Mod of maintenance page
Now you have a choice....If you want this to work when someone first comes to your site then
Edit Index.php
Find
$user_access = get_permission();
Add After
//-----------------------------------------------------
//--- Maintenance --------------------------------
//-----------------------------------------------------
$maintenance = $config['maintenance'];
$redirect_url = TEMPLATE_PATH."/maintenance.html";
if ($maintenance){
header("Location: ".$site_sess->url($redirect_url, "&"));
exit;
}
//-----------------------------------------------------
//--- End of Maintenance -------------------------
//-----------------------------------------------------
or if you want it to work for every page then ..
Edit page_header.php
Find
if (!defined('ROOT_PATH')) {
die("Security violation");
}
and insert the code above just below it.
Create new file in your templates/
Your_template/maintenance.html folder.
Add this html...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Site closed for Maintenance</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablebgcolor">
<tr>
<td align="center">
<!-- add your maintenance page content here -->
Sorry but the site is closed for maintenance
<!-- End of maintenance page content here -->
</td>
</tr>
</table>
<br>
</body>
</html>
Change the content of this HTML page to suite your sites needs.
Now you can test the Mod.
- Log into your Admin Panel
- Click on the "Settings" Link on the left side menu
- At the bottom of the General section you will see an extra Radio Button field
"Turn maintenance page ON" - Select Yes to turn Maintenance page on
- Try going to your home page
That's it. Nothing to fancy but it's a lot better than nothing
Fugaziman