technovistalimited / maintenance-notice-feature

Display a scheduled maintenance notice on your PHP project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maintenance Notice Feature (PHP)

GitHub release GitHub license

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

Maintenance Notice Feature (PHP)

Requirements

  • PHP (because the conditions are done in PHP, but you can easily copy the logic in your language)
  • JavaScripts
  • Browser cookies

Features

  • Displays a notice within the mentioned time
  • Dismiss the notice only on user acknowledgment
  • Doesn't display the notice again within the same day

Installation

The package includes four (4) files:

  1. config.php - contains the configurations
  2. maintenance.php - contains the notice texts and logics
  3. maintenance.css - contains the styles
  4. maintenance.js - contains the necessary javascripts

Step 0: Include the Configurations

Include the config.php in your project:

require_once 'config.php';

Change the Timezone accordingly. Default: Asia/Dhaka.

Step 1: Include the Maintenance notice

Include the maintenance.php in your project header:

require_once 'maintenance.php';

Step 2: Include the JavaScripts

Add the maintenance.js in your project footer:

<script src="assets/js/maintenance.js"></script>

Step 3: Include the Styling

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.

How to Use

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.

License

The code is licensed in GPL3.


TechnoVista Limited

About

Display a scheduled maintenance notice on your PHP project.

License:GNU General Public License v3.0


Languages

Language:PHP 73.0%Language:JavaScript 23.0%Language:CSS 4.0%