PDA

View Full Version : [REL] Small Maintenance Script



Bowler153
03-11-2013, 08:50 PM
Have it Hooked up to one file so there is less clutter in files.
If you have a DJ Panel or Usersystem, You can Put it in here and manage your website directly from your panel from anywhere.
Email: [email protected] if you have any sugestions.


<head>
<!--Your Config File-->
<?PHP include("config.php"); ?>
<!--Your Config File-->

<?PHP
$query = mysql_query("SELECT * FROM site_settings"); // 'site_settings' is a table in the database
$array = mysql_fetch_array($query);
$maintenance = $array['maint'];
?>
</head>
<body>
<?PHP
////////////////////////////MAINTENANCE CONTENT////////////////////////////
if($maintenance === 'yes') {
?>
<Title> Maintenance *SiteName* </Title>
<!-------------------ANY HTML CONTENT----------------->
<!--------CAN PUT MAINTENANCE LAYOUT IN HERE-------->
<br>
This is the maintenance page and this website is currently ON maintenance.

<?PHP
}

////////////////////////////MAINSITE CONTENT////////////////////////////

elseif($maintenance === 'no') {
?>
<Title>*SiteName*</Title>
<!-------------------ANY HTML CONTENT----------------->
<br>
This is the Homepage and is NOT on maintenance.

<?php
}
?>
</body>





CREATE TABLE IF NOT EXISTS `site_settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`maint` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

INSERT INTO `site_settings` (`id`, `maint`) VALUES
(1, 'no');

Want to hide these adverts? Register an account for free!