When the maintenance happen to a application/website, mass user get affected. In most of the case the application/website made completely readonly. In that case the users face huge shock.
That's why it would be best to inform them beforehand.
This feature will enable you display a notice beforehand announcing your plan of maintenance.
NOTE
This is not a 'maintenance mode' feature, it's just a feature to display a pre-notification
- PHP (because the conditions are done in PHP, but you can easily copy the logic in your language)
- JavaScripts
- Browser cookies
- Displays a notice within the mentioned time
- Dismiss the notice only on user acknowledgment
- Doesn't display the notice again within the same day
The package includes four (4) files:
config.php
- contains the configurationsmaintenance.php
- contains the notice texts and logicsmaintenance.css
- contains the stylesmaintenance.js
- contains the necessary javascripts
Include the config.php
in your project:
require_once 'config.php';
Change the Timezone accordingly. Default: Asia/Dhaka
.
Include the maintenance.php
in your project header:
require_once 'maintenance.php';
Add the maintenance.js
in your project footer:
<script src="assets/js/maintenance.js"></script>
Include the maintenance.css
in your project header:
<link rel="stylesheet" href="assets/css/maintenance.css" media="screen">
For Step#2 and #3 you can copy-paste content your script and style files instead of loading them separately.
When your maintenance schedule is ready, open the config.php
and change the schedule date and time, and don't forget to set IS_MAINTENANCE
value to true
when you are ready to display the notice.
The code is licensed in GPL3.