wp-maintenance-mode
Last commit date
!wartungsmodus.php
16 years ago
readme.txt
16 years ago
screenshot-1.png
16 years ago
site.php
16 years ago
!wartungsmodus.php
43 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: !Wartungsmodus |
| 4 | Version: 1.3 |
| 5 | Plugin URI: http://bueltge.de/wp-wartungsmodus-plugin/101/ |
| 6 | Description: Adds a maintenance-page to your blog that lets visitors know your blog is down for maintenancetime. User with rights for theme-options get full access to the blog including the frontend. |
| 7 | Author: Frank Bültge |
| 8 | Author URI: http://bueltge.de/ |
| 9 | */ |
| 10 | |
| 11 | /** |
| 12 | ------------------------------------------------------------------------------------ |
| 13 | ACKNOWLEDGEMENTS |
| 14 | ------------------------------------------------------------------------------------ |
| 15 | Basisscript von Angsuman Chakraborty - http://blog.taragana.com/ |
| 16 | ------------------------------------------------------------------------------------ |
| 17 | */ |
| 18 | |
| 19 | // Zeit, die in der Mitteilung als Wartungszeit genannt wird |
| 20 | $backtime = 60; // In Minuten |
| 21 | |
| 22 | global $wp_version; |
| 23 | |
| 24 | if ( version_compare($wp_version, '2.1', '<') ) { |
| 25 | require (ABSPATH . WPINC . '/pluggable-functions.php'); // < WP 2.1 |
| 26 | } else { |
| 27 | require (ABSPATH . WPINC . '/pluggable.php'); // >= WP 2.1 |
| 28 | } |
| 29 | |
| 30 | if ( !strstr($_SERVER['PHP_SELF'], 'feed/') |
| 31 | && !strstr($_SERVER['PHP_SELF'], 'wp-admin/') |
| 32 | && !strstr($_SERVER['PHP_SELF'], 'wp-login.php') |
| 33 | && !current_user_can('switch_themes') ) |
| 34 | { |
| 35 | include("site.php"); |
| 36 | exit(); |
| 37 | } else if ( strstr($_SERVER['PHP_SELF'], 'feed/') || strstr($_SERVER['PHP_SELF'], 'trackback/') ) { |
| 38 | $backtime = $backtime * 60; |
| 39 | header("HTTP/1.0 503 Service Unavailable"); |
| 40 | header("Retry-After: $backtime"); |
| 41 | exit(); |
| 42 | } |
| 43 | ?> |