Version Description
- Any logo images will be in center of page
- Lastpass fields corrected width
- Bug fixes
Download this release
Release Info
Developer | fruitfulcode |
Plugin | Maintenance |
Version | 1.1 |
Comparing to | |
See all releases |
Version 1.1
- assets/banner-772x250.png +0 -0
- css/admin.css +55 -0
- functions.php +103 -0
- images/background.png +0 -0
- images/body_bg.jpg +0 -0
- images/buttons.png +0 -0
- images/header_bg.jpg +0 -0
- images/icon-small.png +0 -0
- images/icon.png +0 -0
- images/ie.png +0 -0
- images/mini-logo.png +0 -0
- index.php +65 -0
- js/init.js +47 -0
- lib/functions.php +55 -0
- lib/images/error.png +0 -0
- lib/images/fruitfulcode.png +0 -0
- lib/images/logo-bg-default.png +0 -0
- lib/images/pass-icon.png +0 -0
- lib/images/theme-bg-default.jpg +0 -0
- lib/images/user-icon.png +0 -0
- lib/index.php +205 -0
- lib/js/DD_belatedPNG_0.0.7a-min.js +14 -0
- lib/js/jquery.countdown.js +7 -0
- lib/js/jquery.placeholder.js +106 -0
- lib/options.php +15 -0
- lib/style.css +254 -0
- page-options.php +66 -0
- readme.txt +60 -0
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
assets/banner-772x250.png
ADDED
Binary file
|
css/admin.css
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#confirmOverlay{width:100%;height:100%;position:fixed;top:0;left:0;background:url( '../images/ie.png ');background:-moz-linear-gradient(rgba(11,11,11,0.1),rgba(11,11,11,0.6)) repeat-x rgba(11,11,11,0.2);background:-webkit-gradient(linear,0% 0%,0% 100%,from(rgba(11,11,11,0.1)),to(rgba(11,11,11,0.6))) repeat-x rgba(11,11,11,0.2);z-index:100000;}
|
2 |
+
#confirmBox{background:url( '../images/body_bg.jpg ') repeat-x left bottom #e5e5e5;width:460px;position:fixed;left:50%;top:50%;margin:-130px 0 0 -230px;border:1px solid rgba(33,33,33,0.6);-moz-box-shadow:0 0 2px rgba(255,255,255,0.6) inset;-webkit-box-shadow:0 0 2px rgba(255,255,255,0.6) inset;box-shadow:0 0 2px rgba(255,255,255,0.6) inset;}
|
3 |
+
#confirmBox h1,#confirmBox p{font:26px/1 'Cuprum ', 'Lucida Sans Unicode ', 'Lucida Grande ',sans-serif;background:url( '../images/header_bg.jpg ') repeat-x left bottom #f5f5f5;padding:18px 25px;text-shadow:1px 1px 0 rgba(255,255,255,0.6);color:#666;}
|
4 |
+
#confirmBox h1{letter-spacing:0.3px;color:#888;margin:0;}
|
5 |
+
#confirmBox p{background:none;font-size:16px;line-height:1.4;padding-top:35px;}
|
6 |
+
#confirmButtons{padding:15px 0 25px;text-align:center;}
|
7 |
+
#confirmBox .button{display:inline-block;background:url( '../images/buttons.png ') no-repeat;color:white;position:relative;height:33px;font:17px/33px 'Cuprum ', 'Lucida Sans Unicode ', 'Lucida Grande ',sans-serif;margin-right:15px;padding:0 35px 0 40px;text-decoration:none;border:none;}
|
8 |
+
#confirmBox .button:last-child{margin-right:0;}
|
9 |
+
#confirmBox .button span{position:absolute;top:0;right:-5px;background:url( '../images/buttons.png ') no-repeat;width:5px;height:33px}
|
10 |
+
#confirmBox .blue{background-position:left top;text-shadow:1px 1px 0 #5889a2;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
|
11 |
+
#confirmBox .blue span{background-position:-195px 0;}
|
12 |
+
#confirmBox .blue:hover{background-position:left bottom;}
|
13 |
+
#confirmBox .blue:hover span{background-position:-195px bottom;}
|
14 |
+
#confirmBox .gray{background-position:-200px top;text-shadow:1px 1px 0 #707070;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
|
15 |
+
#confirmBox .gray span{background-position:-395px 0;}
|
16 |
+
#confirmBox .gray:hover{background-position:-200px bottom;}
|
17 |
+
#confirmBox .gray:hover span{background-position:-395px bottom;}
|
18 |
+
#maintenance-options {position:relative;}
|
19 |
+
#maintenance-options h1 {font-size:35px;}
|
20 |
+
#maintenance-options h1,
|
21 |
+
#maintenance-options h2{float:left;font-family: 'Open Sans ',Arial,Helvetica,sans-serif;font-size:35px;font-weight:bold;}
|
22 |
+
#maintenance-options select{margin:0 0 20px 6px;}
|
23 |
+
#maintenance-options .nav{position:absolute;top:25px;right:50px;text-align:right;}
|
24 |
+
#maintenance-options .nav li{display:inline;padding:0 5px;}
|
25 |
+
#maintenance-options .nav li a{color:#656656;font-size:11px;}
|
26 |
+
#maintenance-options .description{color:#ff0000;padding:0 0 20px 10px;width:450px;}
|
27 |
+
#maintenance-options h3{margin:0 0 16px 4px;}
|
28 |
+
#maintenance-options #steps{margin:0 0 20px 15px;padding:0 0 0 14px;}
|
29 |
+
#maintenance-options #steps li{margin:0 0 5px 0;padding:0;}
|
30 |
+
.theme-options{border:0;margin:0;padding:0;width:471px}
|
31 |
+
.theme-options h4{margin-top:0;}
|
32 |
+
.theme-options div{border:0;margin:0 0 30px 0;padding:10px 0 0 0px;}
|
33 |
+
.theme-options label{display:block;float:left;margin:0 0 5px;padding-right:15px;text-align:right;width:118px;padding-top:4px;}
|
34 |
+
.theme-options input,#options #tabs .theme-options textarea{margin:0 0 15px 0;width:300px;}
|
35 |
+
.theme-options textarea{height:80px;}
|
36 |
+
.theme-options .explanation{margin-top:-15px;font-size:10px;color:#ccc;}
|
37 |
+
#maintenance-options input.button{width:auto !important;}
|
38 |
+
#maintenance-options #credits{color:#d54e21;font-size:11px;}
|
39 |
+
.fl{width:100%;float:left;}
|
40 |
+
#theme{width:20%}
|
41 |
+
.title{display:block;float:left;width:100%; margin-bottom: 20px;}
|
42 |
+
/*Checkbox*/
|
43 |
+
.tzCheckBox{background:url( '../images/background.png ') no-repeat right bottom;display:inline-block;min-width:60px;height:33px;white-space:nowrap;position:relative;cursor:pointer;margin:18px 0 0 20px;}
|
44 |
+
.tzCheckBox.checked{background-position:top left;margin:18px 0 0 6px;}
|
45 |
+
.tzCheckBox .tzCBContent{color:white;line-height:31px;padding-right:38px;text-align:right;}
|
46 |
+
.tzCheckBox.checked .tzCBContent{text-align:left;padding:0 0 0 38px;}
|
47 |
+
.tzCBPart{background:url( '../images/background.png ') no-repeat left bottom;width:14px;position:absolute;top:0;left:-14px;height:33px;overflow:hidden;}
|
48 |
+
.tzCheckBox.checked .tzCBPart{background-position:top right;left:auto;right:-14px;}
|
49 |
+
.logo{float:left;margin-right:20px;padding-top:15px;}
|
50 |
+
.button-primary{width:82px !important;float:right}
|
51 |
+
#contact-support {background-image: url("../images/mini-logo.png"); background-position: 0 3px; background-repeat: no-repeat; display: block; float: left; height: 30px; margin-left: 16px; margin-top: 50px; padding: 4px 42px;}
|
52 |
+
|
53 |
+
*+html #maintenance-options.wrap form #general .title h1 {line-height:1em !important; margin-top:15px; }
|
54 |
+
*+html .time-block, .video-block, .html-block {margin-top:20px;}
|
55 |
+
*+html .button-primary {width:100px !important}
|
functions.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
function css_activate () {
|
3 |
+
$str_css = "<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700|Arvo:400,400italic,700,700italic' rel='stylesheet' type='text/css'>";
|
4 |
+
return $str_css;
|
5 |
+
}
|
6 |
+
|
7 |
+
function user_logout() {
|
8 |
+
wp_safe_redirect(get_bloginfo('url'));
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
|
13 |
+
function mt_template_redirect($template)
|
14 |
+
{
|
15 |
+
global $mt_options;
|
16 |
+
|
17 |
+
$mt_options = mt_get_option();
|
18 |
+
if ( $mt_options['logged_in_permission'] ) {
|
19 |
+
mt_handle_template($mt_options);
|
20 |
+
}
|
21 |
+
|
22 |
+
}
|
23 |
+
|
24 |
+
function mt_get_option()
|
25 |
+
{
|
26 |
+
$option = get_option( basename(dirname(__FILE__)) );
|
27 |
+
if ( !$option ) {
|
28 |
+
$option = array( 'state' => 'live', 'logged_in_permission' => true );
|
29 |
+
add_option(basename(dirname(__FILE__)), $option);
|
30 |
+
}
|
31 |
+
return $option;
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
function mt_update_option($data)
|
36 |
+
{
|
37 |
+
return update_option(basename(dirname(__FILE__)), $data);
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
function mt_get_lib_var()
|
42 |
+
{
|
43 |
+
global $mt_themes;
|
44 |
+
$mt_themes = array();
|
45 |
+
|
46 |
+
$dir = dirname(__FILE__).'/'.LIB_DIR.'/';
|
47 |
+
if ($handle = opendir($dir)) {
|
48 |
+
while (false !== ($file = readdir($handle))) {
|
49 |
+
if ($file != "." && $file != ".." && !is_file($file) && file_exists($dir.$file.'/index.php') ) {
|
50 |
+
$mt_themes[] = ucfirst($file);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
closedir($handle);
|
54 |
+
}
|
55 |
+
|
56 |
+
return true;
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
function mt_handle_template($option)
|
61 |
+
{
|
62 |
+
$dir = get_template_directory().'/';
|
63 |
+
|
64 |
+
if (!is_user_logged_in()) {
|
65 |
+
switch ( $option['state'] ) {
|
66 |
+
case 'maintenance':
|
67 |
+
{
|
68 |
+
/* load selected theme */
|
69 |
+
if ( $option['expiry_date'] ) {
|
70 |
+
list( $date,$time ) = explode( '|', $option['expiry_date'] );
|
71 |
+
list( $month, $day, $year ) = explode( '.', $date );
|
72 |
+
list( $hour, $minute, $second ) = explode ( ':', $time );
|
73 |
+
$timestamp = mktime( $hour, $minute, $second, $month, $day, $year );
|
74 |
+
|
75 |
+
/* if page should be opened now, return true and break function */
|
76 |
+
if ( time() > $timestamp ) {
|
77 |
+
return true;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
$lib_dir = dirname( __FILE__ ) . '/' . LIB_DIR . '/';
|
82 |
+
if ( file_exists( $lib_dir . 'index.php' ) ) {
|
83 |
+
mt_prepare_template_vars();
|
84 |
+
include_once $lib_dir . 'index.php';
|
85 |
+
exit();
|
86 |
+
}
|
87 |
+
}
|
88 |
+
break;
|
89 |
+
}
|
90 |
+
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
function mt_prepare_template_vars()
|
96 |
+
{
|
97 |
+
global $mt_lib, $mt_options;
|
98 |
+
$mt_lib = $mt_options['lib_options'];
|
99 |
+
return true;
|
100 |
+
|
101 |
+
}
|
102 |
+
|
103 |
+
?>
|
images/background.png
ADDED
Binary file
|
images/body_bg.jpg
ADDED
Binary file
|
images/buttons.png
ADDED
Binary file
|
images/header_bg.jpg
ADDED
Binary file
|
images/icon-small.png
ADDED
Binary file
|
images/icon.png
ADDED
Binary file
|
images/ie.png
ADDED
Binary file
|
images/mini-logo.png
ADDED
Binary file
|
index.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Maintenance
|
4 |
+
Plugin URI: http://wordpress.org/extend/plugins/maintenance/
|
5 |
+
Description: Take your site down from public view with a click of a button hiding the site when you need to change a few things or run an upgrade, making it only accessible by login and password. There is also an area to add a custom message which will be shown to the users while your site is down. Users stay on the same page when they input wrong initials.
|
6 |
+
Version: 1.1
|
7 |
+
Author: fruitfulcode
|
8 |
+
Author URI: http://fruitfulcode.com
|
9 |
+
License: GPL2
|
10 |
+
*/
|
11 |
+
/* Copyright 2012 Fruitfulcode (email : support@fruitfulcode.com)
|
12 |
+
|
13 |
+
This program is free software; you can redistribute it and/or modify
|
14 |
+
it under the terms of the GNU General Public License, version 2, as
|
15 |
+
published by the Free Software Foundation.
|
16 |
+
|
17 |
+
This program is distributed in the hope that it will be useful,
|
18 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
+
GNU General Public License for more details.
|
21 |
+
|
22 |
+
You should have received a copy of the GNU General Public License
|
23 |
+
along with this program; if not, write to the Free Software
|
24 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
define( 'LIB_DIR', 'lib' );
|
29 |
+
define( 'PLUGIN_URL', WP_PLUGIN_URL . '/' . basename (dirname ( __FILE__ ) ) . '/' );
|
30 |
+
|
31 |
+
include_once 'functions.php';
|
32 |
+
|
33 |
+
$mt_options = mt_get_option();
|
34 |
+
if ($mt_options['state'] == "maintenance") {
|
35 |
+
add_filter('show_admin_bar', '__return_false');
|
36 |
+
}
|
37 |
+
|
38 |
+
add_action( 'template_redirect', 'mt_template_redirect' );
|
39 |
+
add_action( 'admin_menu', 'dashboard_menu' );
|
40 |
+
add_action( 'wp_logout','user_logout');
|
41 |
+
register_deactivation_hook( __FILE__, 'deactivate_plugin' );
|
42 |
+
|
43 |
+
include_once 'page-options.php';
|
44 |
+
|
45 |
+
function dashboard_menu()
|
46 |
+
{
|
47 |
+
$page = add_menu_page('Maintenance', 'Maintenance', 'manage_options', 'maintenance', 'mt_manage_options', PLUGIN_URL . '/images/icon-small.png');
|
48 |
+
add_action( "admin_print_styles-$page", 'admin_head' );
|
49 |
+
}
|
50 |
+
|
51 |
+
function admin_head()
|
52 |
+
{
|
53 |
+
|
54 |
+
echo css_activate ();
|
55 |
+
wp_enqueue_script( 'maintenance', PLUGIN_URL .'js/init.js' );
|
56 |
+
wp_enqueue_style ('maintenance', PLUGIN_URL .'css/admin.css' );
|
57 |
+
}
|
58 |
+
|
59 |
+
function deactivate_plugin()
|
60 |
+
{
|
61 |
+
return delete_option( basename(dirname(__FILE__)) );
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
?>
|
js/init.js
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(window).ready(function(){
|
2 |
+
jQuery.fn.tzCheckbox = function(options){
|
3 |
+
|
4 |
+
// Default On / Off labels:
|
5 |
+
|
6 |
+
options = jQuery.extend({
|
7 |
+
labels : ['ON','OFF']
|
8 |
+
},options);
|
9 |
+
|
10 |
+
return this.each(function(){
|
11 |
+
var originalCheckBox = jQuery(this),
|
12 |
+
labels = [];
|
13 |
+
|
14 |
+
// Checking for the data-on / data-off HTML5 data attributes:
|
15 |
+
if(originalCheckBox.data('on')){
|
16 |
+
labels[0] = originalCheckBox.data('on');
|
17 |
+
labels[1] = originalCheckBox.data('off');
|
18 |
+
}
|
19 |
+
else labels = options.labels;
|
20 |
+
|
21 |
+
// Creating the new checkbox markup:
|
22 |
+
var checkBox = jQuery('<span>');
|
23 |
+
checkBox.addClass(this.checked?' tzCheckBox checked':'tzCheckBox');
|
24 |
+
checkBox.prepend('<span class="tzCBContent">'+labels[this.checked?0:1]+ '</span><span class="tzCBPart"></span>');
|
25 |
+
|
26 |
+
// Inserting the new checkbox, and hiding the original:
|
27 |
+
checkBox.insertAfter(originalCheckBox.hide());
|
28 |
+
|
29 |
+
checkBox.click(function(){
|
30 |
+
checkBox.toggleClass('checked');
|
31 |
+
|
32 |
+
var isChecked = checkBox.hasClass('checked');
|
33 |
+
|
34 |
+
// Synchronizing the original checkbox:
|
35 |
+
originalCheckBox.attr('checked',isChecked);
|
36 |
+
checkBox.find('.tzCBContent').html(labels[isChecked?0:1]);
|
37 |
+
});
|
38 |
+
|
39 |
+
// Listening for changes on the original and affecting the new one:
|
40 |
+
originalCheckBox.bind('change',function(){
|
41 |
+
checkBox.click();
|
42 |
+
});
|
43 |
+
});
|
44 |
+
};
|
45 |
+
|
46 |
+
jQuery('#ch_location').tzCheckbox({labels:['On','Off']});
|
47 |
+
});
|
lib/functions.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_filter( 'lib_update', 'lib_update' );
|
3 |
+
|
4 |
+
function lib_update( $options )
|
5 |
+
{
|
6 |
+
|
7 |
+
$options['lib_options']['logo'] = lib_file_upload( 'logo' );
|
8 |
+
$options['lib_options']['body_bg'] = lib_file_upload( 'body_bg' );
|
9 |
+
|
10 |
+
if ( $_POST['remove_logo'] ) {
|
11 |
+
$options['lib_options']['logo'] = '';
|
12 |
+
}
|
13 |
+
elseif ( $_POST['remove_bg'] ) {
|
14 |
+
$options['lib_options']['body_bg'] = '';
|
15 |
+
}
|
16 |
+
return $options;
|
17 |
+
}
|
18 |
+
|
19 |
+
function lib_file_upload( $type )
|
20 |
+
{
|
21 |
+
|
22 |
+
$field_name = $type;
|
23 |
+
|
24 |
+
$file = array(
|
25 |
+
'tmp_name' => $_FILES['lib_options']['tmp_name'][$field_name],
|
26 |
+
'name' => $_FILES['lib_options']['name'][$field_name],
|
27 |
+
'size' => $_FILES['lib_options']['size'][$field_name],
|
28 |
+
'error' => $_FILES['lib_options']['error'][$field_name]
|
29 |
+
);
|
30 |
+
|
31 |
+
/*$dir = WP_CONTENT_DIR . '/uploads/maintenance/';*/
|
32 |
+
$upload_dir = wp_upload_dir();
|
33 |
+
$dir = $upload_dir[ 'basedir' ] . '/maintenance/';
|
34 |
+
$url = $upload_dir[ 'baseurl' ] . '/maintenance/';
|
35 |
+
|
36 |
+
if ( !file_exists( dirname($dir) ) ) {
|
37 |
+
mkdir( dirname($dir) );
|
38 |
+
}
|
39 |
+
if ( !file_exists( $dir ) ) {
|
40 |
+
mkdir( $dir );
|
41 |
+
}
|
42 |
+
|
43 |
+
if ( $file['name'] ) {
|
44 |
+
$filename = strtolower($field_name.'.'.end( explode( '.', $file['name'] ) ));
|
45 |
+
move_uploaded_file( $file['tmp_name'], $dir . $filename );
|
46 |
+
/*return WP_CONTENT_URL . '/uploads/maintenance/'.$filename;*/
|
47 |
+
return $url . $filename;
|
48 |
+
}
|
49 |
+
else {
|
50 |
+
$options = mt_get_option();
|
51 |
+
return $options['lib_options'][$field_name];
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
?>
|
lib/images/error.png
ADDED
Binary file
|
lib/images/fruitfulcode.png
ADDED
Binary file
|
lib/images/logo-bg-default.png
ADDED
Binary file
|
lib/images/pass-icon.png
ADDED
Binary file
|
lib/images/theme-bg-default.jpg
ADDED
Binary file
|
lib/images/user-icon.png
ADDED
Binary file
|
lib/index.php
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
global $wpdb, $error, $wp_query, $current_theme_locale_name, $mt_lib;
|
3 |
+
|
4 |
+
if (!is_array($wp_query->query_vars))
|
5 |
+
$wp_query->query_vars = array();
|
6 |
+
|
7 |
+
$action = $_REQUEST['action'];
|
8 |
+
$info = $error = '';
|
9 |
+
nocache_headers();
|
10 |
+
$class_login = "user-icon";
|
11 |
+
$class_password = "pass-icon";
|
12 |
+
|
13 |
+
header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
|
14 |
+
|
15 |
+
if ( defined('RELOCATE') )
|
16 |
+
{ // Move flag is set
|
17 |
+
if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) )
|
18 |
+
$_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
|
19 |
+
|
20 |
+
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
|
21 |
+
if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
|
22 |
+
update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
|
23 |
+
}
|
24 |
+
|
25 |
+
switch($_REQUEST["action"])
|
26 |
+
{
|
27 |
+
case 'login' :
|
28 |
+
default:
|
29 |
+
$user_login = '';
|
30 |
+
$user_pass = '';
|
31 |
+
$using_cookie = false;
|
32 |
+
|
33 |
+
if ( !isset( $_REQUEST['redirect_to'] ) ) {
|
34 |
+
$redirect_to = get_settings('siteurl');
|
35 |
+
} else {
|
36 |
+
$redirect_to = $_REQUEST['redirect_to'];
|
37 |
+
}
|
38 |
+
|
39 |
+
if(isset($_SESSION['redirect_me_back'])) $redirect_to = $_SESSION['redirect_me_back'];
|
40 |
+
|
41 |
+
if( $_POST ) {
|
42 |
+
$user_login = $_POST['log'];
|
43 |
+
$user_login = sanitize_user( $user_login );
|
44 |
+
$user_pass = $_POST['pwd'];
|
45 |
+
$rememberme = $_POST['rememberme'];
|
46 |
+
|
47 |
+
$access = array();
|
48 |
+
$access['user_login'] = $user_login;
|
49 |
+
$access['user_password'] = $user_pass;
|
50 |
+
$access['remember'] = false;
|
51 |
+
$user = wp_signon( $access, false);
|
52 |
+
|
53 |
+
if ( is_wp_error($user) ) {
|
54 |
+
$info = 'You entered your login and password are incorrect!';
|
55 |
+
$class_login = 'error-login';
|
56 |
+
$class_password = 'error-password';
|
57 |
+
}
|
58 |
+
|
59 |
+
} else {
|
60 |
+
if (function_exists('wp_get_cookie_login'))
|
61 |
+
{
|
62 |
+
$cookie_login = wp_get_cookie_login();
|
63 |
+
if ( ! empty($cookie_login) ) {
|
64 |
+
$using_cookie = true;
|
65 |
+
$user_login = $cookie_login['login'];
|
66 |
+
$user_pass = $cookie_login['password'];
|
67 |
+
}
|
68 |
+
}
|
69 |
+
elseif ( !empty($_COOKIE) )
|
70 |
+
{
|
71 |
+
if ( !empty($_COOKIE[USER_COOKIE]) )
|
72 |
+
$user_login = $_COOKIE[USER_COOKIE];
|
73 |
+
if ( !empty($_COOKIE[PASS_COOKIE]) ) {
|
74 |
+
$user_pass = $_COOKIE[PASS_COOKIE];
|
75 |
+
$using_cookie = true;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
do_action('wp_authenticate', array(&$user_login, &$user_pass));
|
81 |
+
if ( $user_login && $user_pass ) {
|
82 |
+
$user = new WP_User(0, $user_login);
|
83 |
+
|
84 |
+
if ( wp_login($user_login,
|
85 |
+
$user_pass,
|
86 |
+
$using_cookie) ) {
|
87 |
+
if ( !$using_cookie )
|
88 |
+
wp_setcookie($user_login, $user_pass, false, '', '', $rememberme);
|
89 |
+
do_action('wp_login', $user_login);
|
90 |
+
wp_redirect($redirect_to);
|
91 |
+
exit;
|
92 |
+
} else {
|
93 |
+
if ( $using_cookie )
|
94 |
+
$error = __('Your session has expired.',$current_theme_locale_name);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
?>
|
98 |
+
|
99 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
100 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
101 |
+
<head>
|
102 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
103 |
+
<title><?php echo $mt_lib['page_title']; ?></title>
|
104 |
+
|
105 |
+
<link rel="stylesheet" type="text/css" href="<?php echo PLUGIN_URL . LIB_DIR; ?>/style.css" />
|
106 |
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
|
107 |
+
|
108 |
+
<?php
|
109 |
+
if ( $mt_lib['expiry_date'] ):
|
110 |
+
list( $date,$time ) = explode( '|', $mt_lib['expiry_date'] );
|
111 |
+
list( $month, $day, $year ) = explode( '.', $date );
|
112 |
+
list( $hours, $minutes, $seconds ) = explode ( ':', $time );
|
113 |
+
$month--;
|
114 |
+
?>
|
115 |
+
|
116 |
+
<script type="text/javascript" src="<?php echo PLUGIN_URL . LIB_DIR; ?>/js/jquery.countdown.js"></script>
|
117 |
+
<script type="text/javascript">
|
118 |
+
$(function () {
|
119 |
+
var austDay = new Date(<?php echo "$year, $month, $day, $hours, $minutes, $seconds, 0"; ?>);
|
120 |
+
$('#defaultCountdown').countdown({until: austDay, layout: '{dn} {dl}, {hn} {hl}, {mn} {ml}, and {sn} {sl}'});
|
121 |
+
$('#year').text(austDay.getFullYear());
|
122 |
+
});
|
123 |
+
</script>
|
124 |
+
<?php endif; ?>
|
125 |
+
|
126 |
+
<?php if ( $mt_lib['body_bg'] || $mt_lib['body_bg_color'] ): ?>
|
127 |
+
<style type="text/css">
|
128 |
+
body { background:
|
129 |
+
<?php echo $mt_lib['body_bg_color']; ?>
|
130 |
+
<?php if ( $mt_lib['body_bg'] ) {
|
131 |
+
echo "url({$mt_lib['body_bg']}) repeat-x scroll 0 0";
|
132 |
+
} else {
|
133 |
+
echo 'url('. PLUGIN_URL . LIB_DIR . '/images/theme-bg-default.jpg' .') repeat-x scroll 0 0';
|
134 |
+
}
|
135 |
+
|
136 |
+
?>;}
|
137 |
+
|
138 |
+
</style>
|
139 |
+
<?php endif; ?>
|
140 |
+
|
141 |
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
142 |
+
<script type="text/javascript">
|
143 |
+
$(document).ready(function() {
|
144 |
+
$(".username").focus(function() { $(".user-icon").css("left","-49px");});
|
145 |
+
$(".username").blur(function() { $(".user-icon").css("left","0px"); });
|
146 |
+
$(".password").focus(function() { $(".pass-icon").css("left","-49px");});
|
147 |
+
$(".password").blur(function() { $(".pass-icon").css("left","0px");});
|
148 |
+
});
|
149 |
+
|
150 |
+
</script>
|
151 |
+
<script type="text/javascript" src="<?php echo PLUGIN_URL . LIB_DIR ?>/js/jquery.placeholder.js"></script>
|
152 |
+
<script type="text/javascript">
|
153 |
+
$(document).ready(function() {
|
154 |
+
$('input[placeholder]').placeholder();
|
155 |
+
});
|
156 |
+
|
157 |
+
$(window).load(function() {
|
158 |
+
var vWrapWidth = -$("#wrapper").width()/2;
|
159 |
+
var vWrapHeight = -$("#wrapper").height()/2;
|
160 |
+
$("#wrapper").css({'margin-left' : vWrapWidth});
|
161 |
+
$("#wrapper").css({'margin-top' : vWrapHeight});
|
162 |
+
|
163 |
+
var vCompWidth = -$(".company a img").width()/2;
|
164 |
+
$(".company a img").css({'margin-left' : vCompWidth});
|
165 |
+
});
|
166 |
+
|
167 |
+
</script>
|
168 |
+
</head>
|
169 |
+
<body>
|
170 |
+
<div id="wrapper">
|
171 |
+
<div class="company">
|
172 |
+
<a href="<?php bloginfo('home'); ?>"><img src="<?php if ( $mt_lib['logo'] ) { echo $mt_lib['logo']; } else { echo PLUGIN_URL . LIB_DIR.'/images/fruitfulcode.png'; } ?>" alt="logo"/></a>
|
173 |
+
</div>
|
174 |
+
|
175 |
+
<form name="loginform" id="loginform" class="login-form" method="post">
|
176 |
+
|
177 |
+
<div class="header">
|
178 |
+
<h1><?php echo $mt_lib['heading']; ?></h1>
|
179 |
+
<span><?php echo $mt_lib['time_text']; ?></span>
|
180 |
+
</div>
|
181 |
+
|
182 |
+
<div class="content">
|
183 |
+
<div class="<?php echo $class_login; ?>"></div>
|
184 |
+
<div class="<?php echo $class_password; ?>"></div>
|
185 |
+
<div class="inputs">
|
186 |
+
<input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1); ?>" size="20" class="input username" placeholder="Username"/>
|
187 |
+
<input type="password" name="pwd" id="login_password" value="" size="20" class="input password" placeholder="Password" />
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
|
191 |
+
<?php do_action('login_form'); ?>
|
192 |
+
|
193 |
+
|
194 |
+
<div class="footer">
|
195 |
+
<input type="submit" class="button" name="submit" id="submit" value="<?php _e('Sign In',$current_theme_locale_name); ?>" tabindex="4" />
|
196 |
+
<input type="hidden" name="redirect_to" value="<?php echo wp_specialchars($redirect_to); ?>" />
|
197 |
+
</div>
|
198 |
+
|
199 |
+
</form>
|
200 |
+
</div> <!-- end wrapper -->
|
201 |
+
</body>
|
202 |
+
</html>
|
203 |
+
<?php die();
|
204 |
+
break;
|
205 |
+
} ?>
|
lib/js/DD_belatedPNG_0.0.7a-min.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>.
|
3 |
+
* Author: Drew Diller
|
4 |
+
* Email: drew.diller@gmail.com
|
5 |
+
* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/
|
6 |
+
* Version: 0.0.7a
|
7 |
+
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license
|
8 |
+
*
|
9 |
+
* Example usage:
|
10 |
+
* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector
|
11 |
+
* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement
|
12 |
+
**/
|
13 |
+
|
14 |
+
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2 E={J:\'E\',Z:{},1E:7(){4(x.1l&&!x.1l[6.J]){x.1l.23(6.J,\'24:25-26-27:3\')}4(1F.11){1F.11(\'28\',7(){E=29})}},1G:7(){2 a=x.1m(\'8\');x.1H.1b.1n(a,x.1H.1b.1b);2 b=a.1o;b.1c(6.J+\'\\\\:*\',\'{12:2a(#1I#2b)}\');b.1c(6.J+\'\\\\:9\',\'Q:1p;\');b.1c(\'1J.\'+6.J+\'1K\',\'12:y; 1q:y; Q:1p; z-2c:-1; 1d:-1r; 1L:1M;\');6.1o=b},1N:7(){2 a=13.2d;4(13.1e.K(\'2e\')!=-1||13.1e.K(\'1q\')!=-1){E.1f(a)}4(13.1e==\'8.1s\'){2 b=(a.F.1s==\'y\')?\'y\':\'2f\';G(2 v M a.3){a.3[v].9.8.1s=b}}4(13.1e.K(\'14\')!=-1){E.1t(a)}},1t:7(a){4(a.F.14.K(\'2g\')!=-1){2 b=a.F.14;b=1u(b.2h(b.1v(\'=\')+1,b.1v(\')\')),10)/2i;a.3.N.9.8.14=a.F.14;a.3.C.I.2j=b}},15:7(a){2k(7(){E.1f(a)},1)},2l:7(a){2 b=a.1O(\',\');G(2 i=0;i<b.2m;i++){6.1o.1c(b[i],\'12:2n(E.1P(6))\')}},1f:7(a){a.S.1Q=\'\';6.1R(a);6.16(a);6.1t(a);4(a.O){6.1S(a)}},1T:7(b){2 c=6;2 d={2o:\'16\',2p:\'16\'};4(b.17==\'A\'){2 e={2q:\'15\',2r:\'15\',2s:\'15\',2t:\'15\'};G(2 a M e){d[a]=e[a]}}G(2 h M d){b.11(\'1w\'+h,7(){c[d[h]](b)})}b.11(\'2u\',6.1N)},1x:7(a){a.8.2v=1;4(a.F.Q==\'2w\'){a.8.Q=\'2x\'}},1S:7(a){2 b={\'2y\':P,\'2z\':P,\'2A\':P};G(2 s M b){a.3.N.9.8[s]=a.F[s]}},1R:7(a){4(!a.F){1g}U{2 b=a.F}G(2 v M a.3){a.3[v].9.8.1U=b.1U}a.S.18=\'\';a.S.19=\'\';2 c=(b.18==\'1V\');2 d=P;4(b.19!=\'y\'||a.O){4(!a.O){a.D=b.19;a.D=a.D.2B(5,a.D.1v(\'")\')-5)}U{a.D=a.1h}2 e=6;4(!e.Z[a.D]){2 f=x.1m(\'1J\');e.Z[a.D]=f;f.2C=e.J+\'1K\';f.S.1Q=\'12:y; Q:1p; 1y:-1r; 1d:-1r; 1q:y;\';f.11(\'2D\',7(){6.1i=6.2E;6.1j=6.2F;e.16(a)});f.1h=a.D;f.1W(\'1i\');f.1W(\'1j\');x.1X.1n(f,x.1X.1b)}a.3.C.I.1h=a.D;d=V}a.3.C.I.1w=!d;a.3.C.I.N=\'y\';a.3.N.9.8.18=b.18;a.S.19=\'y\';a.S.18=\'1V\'},16:7(e){2 f=e.F;2 g={\'W\':e.2G+1,\'H\':e.2H+1,\'w\':6.Z[e.D].1i,\'h\':6.Z[e.D].1j,\'L\':e.2I,\'T\':e.2J,\'1k\':e.2K,\'1z\':e.2L};2 i=(g.L+g.1k==1)?1:0;2 j=7(a,l,t,w,h,o){a.2M=w+\',\'+h;a.2N=o+\',\'+o;a.2O=\'2P,1Y\'+w+\',1Y\'+w+\',\'+h+\'2Q,\'+h+\' 2R\';a.8.1i=w+\'u\';a.8.1j=h+\'u\';a.8.1y=l+\'u\';a.8.1d=t+\'u\'};j(e.3.N.9,(g.L+(e.O?0:g.1k)),(g.T+(e.O?0:g.1z)),(g.W-1),(g.H-1),0);j(e.3.C.9,(g.L+g.1k),(g.T+g.1z),(g.W),(g.H),1);2 k={\'X\':0,\'Y\':0};2 m=7(a,b){2 c=P;2S(b){1a\'1y\':1a\'1d\':k[a]=0;1A;1a\'2T\':k[a]=.5;1A;1a\'2U\':1a\'2V\':k[a]=1;1A;1I:4(b.K(\'%\')!=-1){k[a]=1u(b)*.2W}U{c=V}}2 d=(a==\'X\');k[a]=2X.2Y(c?((g[d?\'W\':\'H\']*k[a])-(g[d?\'w\':\'h\']*k[a])):1u(b));4(k[a]==0){k[a]++}};G(2 b M k){m(b,f[\'2Z\'+b])}e.3.C.I.Q=(k.X/g.W)+\',\'+(k.Y/g.H);2 n=f.30;2 p={\'T\':1,\'R\':g.W+i,\'B\':g.H,\'L\':1+i};2 q={\'X\':{\'1B\':\'L\',\'1C\':\'R\',\'d\':\'W\'},\'Y\':{\'1B\':\'T\',\'1C\':\'B\',\'d\':\'H\'}};4(n!=\'1D\'){2 c={\'T\':(k.Y),\'R\':(k.X+g.w),\'B\':(k.Y+g.h),\'L\':(k.X)};4(n.K(\'1D-\')!=-1){2 v=n.1O(\'1D-\')[1].31();c[q[v].1B]=1;c[q[v].1C]=g[q[v].d]}4(c.B>g.H){c.B=g.H}e.3.C.9.8.1Z=\'20(\'+c.T+\'u \'+(c.R+i)+\'u \'+c.B+\'u \'+(c.L+i)+\'u)\'}U{e.3.C.9.8.1Z=\'20(\'+p.T+\'u \'+p.R+\'u \'+p.B+\'u \'+p.L+\'u)\'}},1P:7(a){a.8.12=\'y\';4(a.17==\'32\'||a.17==\'33\'||a.17==\'34\'){1g}a.O=V;4(a.17==\'35\'){4(a.1h.21().K(/\\.22$/)!=-1){a.O=P;a.8.1L=\'1M\'}U{1g}}U 4(a.F.19.21().K(\'.22\')==-1){1g}2 b=E;a.3={N:{},C:{}};2 c={9:{},I:{}};G(2 r M a.3){G(2 e M c){2 d=b.J+\':\'+e;a.3[r][e]=x.1m(d)}a.3[r].9.36=V;a.3[r].9.37(a.3[r].I);a.38.1n(a.3[r].9,a)}a.3.C.9.39=\'y\';a.3.C.I.3a=\'3b\';a.3.N.I.1w=V;b.1T(a);b.1x(a);b.1x(a.3c);b.1f(a)}};3d{x.3e("3f",V,P)}3g(r){}E.1E();E.1G();',62,203,'||var|vml|if||this|function|style|shape|||||||||||||||||||||px|||document|none||||image|vmlBg|DD_belatedPNG|currentStyle|for||fill|ns|search||in|color|isImg|true|position||runtimeStyle||else|false||||imgSize||attachEvent|behavior|event|filter|handlePseudoHover|vmlOffsets|nodeName|backgroundColor|backgroundImage|case|firstChild|addRule|top|propertyName|applyVML|return|src|width|height|bLW|namespaces|createElement|insertBefore|styleSheet|absolute|border|10000px|display|vmlOpacity|parseInt|lastIndexOf|on|giveLayout|left|bTW|break|b1|b2|repeat|createVmlNameSpace|window|createVmlStyleSheet|documentElement|default|img|_sizeFinder|visibility|hidden|readPropertyChange|split|fixPng|cssText|vmlFill|copyImageBorders|attachHandlers|zIndex|transparent|removeAttribute|body|0l|clip|rect|toLowerCase|png|add|urn|schemas|microsoft|com|onbeforeunload|null|url|VML|index|srcElement|background|block|lpha|substring|100|opacity|setTimeout|fix|length|expression|resize|move|mouseleave|mouseenter|focus|blur|onpropertychange|zoom|static|relative|borderStyle|borderWidth|borderColor|substr|className|onload|offsetWidth|offsetHeight|clientWidth|clientHeight|offsetLeft|offsetTop|clientLeft|clientTop|coordsize|coordorigin|path|m0|l0|xe|switch|center|right|bottom|01|Math|ceil|backgroundPosition|backgroundRepeat|toUpperCase|BODY|TD|TR|IMG|stroked|appendChild|parentNode|fillcolor|type|tile|offsetParent|try|execCommand|BackgroundImageCache|catch'.split('|'),0,{}))
|
lib/js/jquery.countdown.js
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* http://keith-wood.name/countdown.html
|
2 |
+
Countdown for jQuery v1.5.8.
|
3 |
+
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
|
4 |
+
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
|
5 |
+
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
|
6 |
+
Please attribute the author if you use it. */
|
7 |
+
(function($){function Countdown(){this.regional=[];this.regional['']={labels:['Years','Months','Weeks','Days','Hours','Minutes','Seconds'],labels1:['Year','Month','Week','Day','Hour','Minute','Second'],compactLabels:['y','m','w','d'],whichLabels:null,timeSeparator:':',isRTL:false};this._defaults={until:null,since:null,timezone:null,serverSync:null,format:'dHMS',layout:'',compact:false,significant:0,description:'',expiryUrl:'',expiryText:'',alwaysExpire:false,onExpiry:null,onTick:null,tickInterval:1};$.extend(this._defaults,this.regional['']);this._serverSyncs=[]}var w='countdown';var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;$.extend(Countdown.prototype,{markerClassName:'hasCountdown',_timer:setInterval(function(){$.countdown._updateTargets()},980),_timerTargets:[],setDefaults:function(a){this._resetExtraLabels(this._defaults,a);extendRemove(this._defaults,a||{})},UTCDate:function(a,b,c,e,f,g,h,i){if(typeof b=='object'&&b.constructor==Date){i=b.getMilliseconds();h=b.getSeconds();g=b.getMinutes();f=b.getHours();e=b.getDate();c=b.getMonth();b=b.getFullYear()}var d=new Date();d.setUTCFullYear(b);d.setUTCDate(1);d.setUTCMonth(c||0);d.setUTCDate(e||1);d.setUTCHours(f||0);d.setUTCMinutes((g||0)-(Math.abs(a)<30?a*60:a));d.setUTCSeconds(h||0);d.setUTCMilliseconds(i||0);return d},periodsToSeconds:function(a){return a[0]*31557600+a[1]*2629800+a[2]*604800+a[3]*86400+a[4]*3600+a[5]*60+a[6]},_settingsCountdown:function(a,b){if(!b){return $.countdown._defaults}var c=$.data(a,w);return(b=='all'?c.options:c.options[b])},_attachCountdown:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName)){return}c.addClass(this.markerClassName);var d={options:$.extend({},b),_periods:[0,0,0,0,0,0,0]};$.data(a,w,d);this._changeCountdown(a)},_addTarget:function(a){if(!this._hasTarget(a)){this._timerTargets.push(a)}},_hasTarget:function(a){return($.inArray(a,this._timerTargets)>-1)},_removeTarget:function(b){this._timerTargets=$.map(this._timerTargets,function(a){return(a==b?null:a)})},_updateTargets:function(){for(var i=this._timerTargets.length-1;i>=0;i--){this._updateCountdown(this._timerTargets[i])}},_updateCountdown:function(a,b){var c=$(a);b=b||$.data(a,w);if(!b){return}c.html(this._generateHTML(b));c[(this._get(b,'isRTL')?'add':'remove')+'Class']('countdown_rtl');var d=this._get(b,'onTick');if(d){var e=b._hold!='lap'?b._periods:this._calculatePeriods(b,b._show,this._get(b,'significant'),new Date());var f=this._get(b,'tickInterval');if(f==1||this.periodsToSeconds(e)%f==0){d.apply(a,[e])}}var g=b._hold!='pause'&&(b._since?b._now.getTime()<b._since.getTime():b._now.getTime()>=b._until.getTime());if(g&&!b._expiring){b._expiring=true;if(this._hasTarget(a)||this._get(b,'alwaysExpire')){this._removeTarget(a);var h=this._get(b,'onExpiry');if(h){h.apply(a,[])}var i=this._get(b,'expiryText');if(i){var j=this._get(b,'layout');b.options.layout=i;this._updateCountdown(a,b);b.options.layout=j}var k=this._get(b,'expiryUrl');if(k){window.location=k}}b._expiring=false}else if(b._hold=='pause'){this._removeTarget(a)}$.data(a,w,b)},_changeCountdown:function(a,b,c){b=b||{};if(typeof b=='string'){var d=b;b={};b[d]=c}var e=$.data(a,w);if(e){this._resetExtraLabels(e.options,b);extendRemove(e.options,b);this._adjustSettings(a,e);$.data(a,w,e);var f=new Date();if((e._since&&e._since<f)||(e._until&&e._until>f)){this._addTarget(a)}this._updateCountdown(a,e)}},_resetExtraLabels:function(a,b){var c=false;for(var n in b){if(n!='whichLabels'&&n.match(/[Ll]abels/)){c=true;break}}if(c){for(var n in a){if(n.match(/[Ll]abels[0-9]/)){a[n]=null}}}},_adjustSettings:function(a,b){var c;var d=this._get(b,'serverSync');var e=0;var f=null;for(var i=0;i<this._serverSyncs.length;i++){if(this._serverSyncs[i][0]==d){f=this._serverSyncs[i][1];break}}if(f!=null){e=(d?f:0);c=new Date()}else{var g=(d?d.apply(a,[]):null);c=new Date();e=(g?c.getTime()-g.getTime():0);this._serverSyncs.push([d,e])}var h=this._get(b,'timezone');h=(h==null?-c.getTimezoneOffset():h);b._since=this._get(b,'since');if(b._since!=null){b._since=this.UTCDate(h,this._determineTime(b._since,null));if(b._since&&e){b._since.setMilliseconds(b._since.getMilliseconds()+e)}}b._until=this.UTCDate(h,this._determineTime(this._get(b,'until'),c));if(e){b._until.setMilliseconds(b._until.getMilliseconds()+e)}b._show=this._determineShow(b)},_destroyCountdown:function(a){var b=$(a);if(!b.hasClass(this.markerClassName)){return}this._removeTarget(a);b.removeClass(this.markerClassName).empty();$.removeData(a,w)},_pauseCountdown:function(a){this._hold(a,'pause')},_lapCountdown:function(a){this._hold(a,'lap')},_resumeCountdown:function(a){this._hold(a,null)},_hold:function(a,b){var c=$.data(a,w);if(c){if(c._hold=='pause'&&!b){c._periods=c._savePeriods;var d=(c._since?'-':'+');c[c._since?'_since':'_until']=this._determineTime(d+c._periods[0]+'y'+d+c._periods[1]+'o'+d+c._periods[2]+'w'+d+c._periods[3]+'d'+d+c._periods[4]+'h'+d+c._periods[5]+'m'+d+c._periods[6]+'s');this._addTarget(a)}c._hold=b;c._savePeriods=(b=='pause'?c._periods:null);$.data(a,w,c);this._updateCountdown(a,c)}},_getTimesCountdown:function(a){var b=$.data(a,w);return(!b?null:(!b._hold?b._periods:this._calculatePeriods(b,b._show,this._get(b,'significant'),new Date())))},_get:function(a,b){return(a.options[b]!=null?a.options[b]:$.countdown._defaults[b])},_determineTime:function(k,l){var m=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var n=function(a){a=a.toLowerCase();var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':h+=parseInt(j[1],10);break;case'm':g+=parseInt(j[1],10);break;case'h':f+=parseInt(j[1],10);break;case'd':e+=parseInt(j[1],10);break;case'w':e+=parseInt(j[1],10)*7;break;case'o':d+=parseInt(j[1],10);e=Math.min(e,$.countdown._getDaysInMonth(c,d));break;case'y':c+=parseInt(j[1],10);e=Math.min(e,$.countdown._getDaysInMonth(c,d));break}j=i.exec(a)}return new Date(c,d,e,f,g,h,0)};var o=(k==null?l:(typeof k=='string'?n(k):(typeof k=='number'?m(k):k)));if(o)o.setMilliseconds(0);return o},_getDaysInMonth:function(a,b){return 32-new Date(a,b,32).getDate()},_normalLabels:function(a){return a},_generateHTML:function(c){var d=this._get(c,'significant');c._periods=(c._hold?c._periods:this._calculatePeriods(c,c._show,d,new Date()));var e=false;var f=0;var g=d;var h=$.extend({},c._show);for(var i=Y;i<=S;i++){e|=(c._show[i]=='?'&&c._periods[i]>0);h[i]=(c._show[i]=='?'&&!e?null:c._show[i]);f+=(h[i]?1:0);g-=(c._periods[i]>0?1:0)}var j=[false,false,false,false,false,false,false];for(var i=S;i>=Y;i--){if(c._show[i]){if(c._periods[i]){j[i]=true}else{j[i]=g>0;g--}}}var k=this._get(c,'compact');var l=this._get(c,'layout');var m=(k?this._get(c,'compactLabels'):this._get(c,'labels'));var n=this._get(c,'whichLabels')||this._normalLabels;var o=this._get(c,'timeSeparator');var p=this._get(c,'description')||'';var q=function(a){var b=$.countdown._get(c,'compactLabels'+n(c._periods[a]));return(h[a]?c._periods[a]+(b?b[a]:m[a])+' ':'')};var r=function(a){var b=$.countdown._get(c,'labels'+n(c._periods[a]));return((!d&&h[a])||(d&&j[a])?'<span class="countdown_section"><span class="countdown_amount">'+c._periods[a]+'</span><br/>'+(b?b[a]:m[a])+'</span>':'')};return(l?this._buildLayout(c,h,l,k,d,j):((k?'<span class="countdown_row countdown_amount'+(c._hold?' countdown_holding':'')+'">'+q(Y)+q(O)+q(W)+q(D)+(h[H]?this._minDigits(c._periods[H],2):'')+(h[M]?(h[H]?o:'')+this._minDigits(c._periods[M],2):'')+(h[S]?(h[H]||h[M]?o:'')+this._minDigits(c._periods[S],2):''):'<span class="countdown_row countdown_show'+(d||f)+(c._hold?' countdown_holding':'')+'">'+r(Y)+r(O)+r(W)+r(D)+r(H)+r(M)+r(S))+'</span>'+(p?'<span class="countdown_row countdown_descr">'+p+'</span>':'')))},_buildLayout:function(c,d,e,f,g,h){var j=this._get(c,(f?'compactLabels':'labels'));var k=this._get(c,'whichLabels')||this._normalLabels;var l=function(a){return($.countdown._get(c,(f?'compactLabels':'labels')+k(c._periods[a]))||j)[a]};var m=function(a,b){return Math.floor(a/b)%10};var o={desc:this._get(c,'description'),sep:this._get(c,'timeSeparator'),yl:l(Y),yn:c._periods[Y],ynn:this._minDigits(c._periods[Y],2),ynnn:this._minDigits(c._periods[Y],3),y1:m(c._periods[Y],1),y10:m(c._periods[Y],10),y100:m(c._periods[Y],100),y1000:m(c._periods[Y],1000),ol:l(O),on:c._periods[O],onn:this._minDigits(c._periods[O],2),onnn:this._minDigits(c._periods[O],3),o1:m(c._periods[O],1),o10:m(c._periods[O],10),o100:m(c._periods[O],100),o1000:m(c._periods[O],1000),wl:l(W),wn:c._periods[W],wnn:this._minDigits(c._periods[W],2),wnnn:this._minDigits(c._periods[W],3),w1:m(c._periods[W],1),w10:m(c._periods[W],10),w100:m(c._periods[W],100),w1000:m(c._periods[W],1000),dl:l(D),dn:c._periods[D],dnn:this._minDigits(c._periods[D],2),dnnn:this._minDigits(c._periods[D],3),d1:m(c._periods[D],1),d10:m(c._periods[D],10),d100:m(c._periods[D],100),d1000:m(c._periods[D],1000),hl:l(H),hn:c._periods[H],hnn:this._minDigits(c._periods[H],2),hnnn:this._minDigits(c._periods[H],3),h1:m(c._periods[H],1),h10:m(c._periods[H],10),h100:m(c._periods[H],100),h1000:m(c._periods[H],1000),ml:l(M),mn:c._periods[M],mnn:this._minDigits(c._periods[M],2),mnnn:this._minDigits(c._periods[M],3),m1:m(c._periods[M],1),m10:m(c._periods[M],10),m100:m(c._periods[M],100),m1000:m(c._periods[M],1000),sl:l(S),sn:c._periods[S],snn:this._minDigits(c._periods[S],2),snnn:this._minDigits(c._periods[S],3),s1:m(c._periods[S],1),s10:m(c._periods[S],10),s100:m(c._periods[S],100),s1000:m(c._periods[S],1000)};var p=e;for(var i=Y;i<=S;i++){var q='yowdhms'.charAt(i);var r=new RegExp('\\{'+q+'<\\}(.*)\\{'+q+'>\\}','g');p=p.replace(r,((!g&&d[i])||(g&&h[i])?'$1':''))}$.each(o,function(n,v){var a=new RegExp('\\{'+n+'\\}','g');p=p.replace(a,v)});return p},_minDigits:function(a,b){a=''+a;if(a.length>=b){return a}a='0000000000'+a;return a.substr(a.length-b)},_determineShow:function(a){var b=this._get(a,'format');var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c},_calculatePeriods:function(c,d,e,f){c._now=f;c._now.setMilliseconds(0);var g=new Date(c._now.getTime());if(c._since){if(f.getTime()<c._since.getTime()){c._now=f=g}else{f=c._since}}else{g.setTime(c._until.getTime());if(f.getTime()>c._until.getTime()){c._now=f=g}}var h=[0,0,0,0,0,0,0];if(d[Y]||d[O]){var i=$.countdown._getDaysInMonth(f.getFullYear(),f.getMonth());var j=$.countdown._getDaysInMonth(g.getFullYear(),g.getMonth());var k=(g.getDate()==f.getDate()||(g.getDate()>=Math.min(i,j)&&f.getDate()>=Math.min(i,j)));var l=function(a){return(a.getHours()*60+a.getMinutes())*60+a.getSeconds()};var m=Math.max(0,(g.getFullYear()-f.getFullYear())*12+g.getMonth()-f.getMonth()+((g.getDate()<f.getDate()&&!k)||(k&&l(g)<l(f))?-1:0));h[Y]=(d[Y]?Math.floor(m/12):0);h[O]=(d[O]?m-h[Y]*12:0);f=new Date(f.getTime());var n=(f.getDate()==i);var o=$.countdown._getDaysInMonth(f.getFullYear()+h[Y],f.getMonth()+h[O]);if(f.getDate()>o){f.setDate(o)}f.setFullYear(f.getFullYear()+h[Y]);f.setMonth(f.getMonth()+h[O]);if(n){f.setDate(o)}}var p=Math.floor((g.getTime()-f.getTime())/1000);var q=function(a,b){h[a]=(d[a]?Math.floor(p/b):0);p-=h[a]*b};q(W,604800);q(D,86400);q(H,3600);q(M,60);q(S,1);if(p>0&&!c._since){var r=[1,12,4.3482,7,24,60,60];var s=S;var t=1;for(var u=S;u>=Y;u--){if(d[u]){if(h[s]>=t){h[s]=0;p=1}if(p>0){h[u]++;p=0;s=u;t=1}}t*=r[u]}}if(e){for(var u=Y;u<=S;u++){if(e&&h[u]){e--}else if(!e){h[u]=0}}}return h}});function extendRemove(a,b){$.extend(a,b);for(var c in b){if(b[c]==null){a[c]=null}}return a}$.fn.countdown=function(a){var b=Array.prototype.slice.call(arguments,1);if(a=='getTimes'||a=='settings'){return $.countdown['_'+a+'Countdown'].apply($.countdown,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){$.countdown['_'+a+'Countdown'].apply($.countdown,[this].concat(b))}else{$.countdown._attachCountdown(this,a)}})};$.countdown=new Countdown()})(jQuery);
|
lib/js/jquery.placeholder.js
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Placeholder plugin for jQuery
|
3 |
+
* ---
|
4 |
+
* Copyright 2010, Daniel Stocks (http://webcloud.se)
|
5 |
+
* Released under the MIT, BSD, and GPL Licenses.
|
6 |
+
*/
|
7 |
+
(function($) {
|
8 |
+
function Placeholder(input) {
|
9 |
+
this.input = input;
|
10 |
+
if (input.attr('type') == 'password') {
|
11 |
+
this.handlePassword();
|
12 |
+
}
|
13 |
+
// Prevent placeholder values from submitting
|
14 |
+
$(input[0].form).submit(function() {
|
15 |
+
if (input.hasClass('placeholder') && input[0].value == input.attr('placeholder')) {
|
16 |
+
input[0].value = '';
|
17 |
+
}
|
18 |
+
});
|
19 |
+
}
|
20 |
+
Placeholder.prototype = {
|
21 |
+
show : function(loading) {
|
22 |
+
// FF and IE saves values when you refresh the page. If the user refreshes the page with
|
23 |
+
// the placeholders showing they will be the default values and the input fields won't be empty.
|
24 |
+
if (this.input[0].value === '' || (loading && this.valueIsPlaceholder())) {
|
25 |
+
if (this.isPassword) {
|
26 |
+
try {
|
27 |
+
this.input[0].setAttribute('type', 'text');
|
28 |
+
} catch (e) {
|
29 |
+
this.input.before(this.fakePassword.show()).hide();
|
30 |
+
}
|
31 |
+
}
|
32 |
+
this.input.addClass('placeholder');
|
33 |
+
this.input[0].value = this.input.attr('placeholder');
|
34 |
+
}
|
35 |
+
},
|
36 |
+
hide : function() {
|
37 |
+
if (this.valueIsPlaceholder() && this.input.hasClass('placeholder')) {
|
38 |
+
this.input.removeClass('placeholder');
|
39 |
+
this.input[0].value = '';
|
40 |
+
if (this.isPassword) {
|
41 |
+
try {
|
42 |
+
this.input[0].setAttribute('type', 'password');
|
43 |
+
} catch (e) { }
|
44 |
+
// Restore focus for Opera and IE
|
45 |
+
this.input.show();
|
46 |
+
this.input[0].focus();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
},
|
50 |
+
valueIsPlaceholder : function() {
|
51 |
+
return this.input[0].value == this.input.attr('placeholder');
|
52 |
+
},
|
53 |
+
handlePassword: function() {
|
54 |
+
var input = this.input;
|
55 |
+
input.attr('realType', 'password');
|
56 |
+
this.isPassword = true;
|
57 |
+
// IE < 9 doesn't allow changing the type of password inputs
|
58 |
+
if ($.browser.msie && input[0].outerHTML) {
|
59 |
+
var fakeHTML = $(input[0].outerHTML.replace(/type=(['"])?password\1/gi, 'type=$1text$1'));
|
60 |
+
this.fakePassword = fakeHTML.val(input.attr('placeholder')).addClass('placeholder').focus(function() {
|
61 |
+
input.trigger('focus');
|
62 |
+
$(this).hide();
|
63 |
+
});
|
64 |
+
$(input[0].form).submit(function() {
|
65 |
+
fakeHTML.remove();
|
66 |
+
input.show()
|
67 |
+
});
|
68 |
+
}
|
69 |
+
}
|
70 |
+
};
|
71 |
+
var NATIVE_SUPPORT = !!("placeholder" in document.createElement( "input" ));
|
72 |
+
$.fn.placeholder = function() {
|
73 |
+
return NATIVE_SUPPORT ? this : this.each(function() {
|
74 |
+
var input = $(this);
|
75 |
+
var placeholder = new Placeholder(input);
|
76 |
+
placeholder.show(true);
|
77 |
+
input.focus(function() {
|
78 |
+
placeholder.hide();
|
79 |
+
});
|
80 |
+
input.blur(function() {
|
81 |
+
placeholder.show(false);
|
82 |
+
});
|
83 |
+
|
84 |
+
// On page refresh, IE doesn't re-populate user input
|
85 |
+
// until the window.onload event is fired.
|
86 |
+
if ($.browser.msie) {
|
87 |
+
$(window).load(function() {
|
88 |
+
if(input.val()) {
|
89 |
+
input.removeClass("placeholder");
|
90 |
+
}
|
91 |
+
placeholder.show(true);
|
92 |
+
});
|
93 |
+
// What's even worse, the text cursor disappears
|
94 |
+
// when tabbing between text inputs, here's a fix
|
95 |
+
input.focus(function() {
|
96 |
+
if(this.value == "") {
|
97 |
+
var range = this.createTextRange();
|
98 |
+
range.collapse(true);
|
99 |
+
range.moveStart('character', 0);
|
100 |
+
range.select();
|
101 |
+
}
|
102 |
+
});
|
103 |
+
}
|
104 |
+
});
|
105 |
+
}
|
106 |
+
})(jQuery);
|
lib/options.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php global $mt_option; $lib_options = ''; $lib_options = $mt_option['lib_options']; ?>
|
2 |
+
<label for="page_title">Page title</label>
|
3 |
+
<input type="text" id="page_title" name="lib_options[page_title]" value="<?php echo ( isset( $lib_options['page_title'] ) ) ? $lib_options['page_title'] : 'Website is under construction'; ?>" />
|
4 |
+
<label for="heading">Headline</label>
|
5 |
+
<input type="text" id="heading" name="lib_options[heading]" value="<?php echo ( isset( $lib_options['heading'] ) ) ? $lib_options['heading'] : 'Customer login'; ?>" />
|
6 |
+
<label for="time_text">Description</label>
|
7 |
+
<input type="text" id="time_text" name="lib_options[time_text]" value="<?php echo ( isset( $lib_options['time_text'] ) ) ? $lib_options['time_text'] : 'Please login to see website'; ?>" />
|
8 |
+
<label for="theme_logo">Logo</label>
|
9 |
+
<input type="file" id="theme_logo" name="lib_options[logo]" />
|
10 |
+
<?php if ( $lib_options['logo'] ): ?><input class="button remove" type="submit" name="remove_logo" value="x" /><?php endif; ?>
|
11 |
+
<label for="body_bg">Background image</label>
|
12 |
+
<input type="file" id="body_bg" name="lib_options[body_bg]" />
|
13 |
+
<?php if ( $lib_options['body_bg'] ): ?><input class="button remove" type="submit" name="remove_bg" value="x" /><?php endif; ?>
|
14 |
+
<label for="body_bg_color">Background color</label>
|
15 |
+
<input type="text" id="body_bg_color" name="lib_options[body_bg_color]" value="<?php echo ( isset( $lib_options['body_bg_color'] ) ) ? stripslashes($lib_options['body_bg_color']) : '#fff'; ?>" />
|
lib/style.css
ADDED
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700|Arvo:400,400italic,700,700italic);
|
2 |
+
|
3 |
+
::selection {
|
4 |
+
color: #fff;
|
5 |
+
background: #f676b2; /* Safari */
|
6 |
+
}
|
7 |
+
::-moz-selection {
|
8 |
+
color: #fff;
|
9 |
+
background: #f676b2; /* Firefox */
|
10 |
+
}
|
11 |
+
|
12 |
+
* {
|
13 |
+
margin: 0;
|
14 |
+
padding: 0;
|
15 |
+
border: 0;
|
16 |
+
}
|
17 |
+
|
18 |
+
body {
|
19 |
+
|
20 |
+
font-family: 'Open Sans', Arial, Helvetica, sans-serif;
|
21 |
+
font-weight:300;
|
22 |
+
text-align: left;
|
23 |
+
text-decoration: none;
|
24 |
+
}
|
25 |
+
|
26 |
+
#wrapper {
|
27 |
+
position: absolute;
|
28 |
+
left: 50%;
|
29 |
+
top: 50%;
|
30 |
+
z-index: 1;
|
31 |
+
}
|
32 |
+
|
33 |
+
.login-form {
|
34 |
+
width: 300px;
|
35 |
+
margin: 0 auto;
|
36 |
+
position: relative;
|
37 |
+
z-index:5;
|
38 |
+
border-radius:5px;
|
39 |
+
background: #fff;
|
40 |
+
border: 1px solid #fff;
|
41 |
+
box-shadow: 0px 1px 5px rgba(0,0,0,0.5);
|
42 |
+
-moz-box-shadow: 0px 1px 5px rgba(0,0,0,0.5);
|
43 |
+
-webkit-box-shadow: 0px 1px 5px rgba(0,0,0,0.5);
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
.login-form .header {
|
48 |
+
padding: 20px 30px 30px 30px;
|
49 |
+
text-align: center;
|
50 |
+
}
|
51 |
+
|
52 |
+
.login-form .header h1 {
|
53 |
+
font-weight: 300;
|
54 |
+
font-size: 28px;
|
55 |
+
line-height:34px;
|
56 |
+
color: #414848;
|
57 |
+
text-shadow: 1px 1px 0 rgba(256,256,256,1.0);
|
58 |
+
margin-bottom: 10px;
|
59 |
+
text-align: center;
|
60 |
+
margin-top: 15px;
|
61 |
+
}
|
62 |
+
|
63 |
+
.login-form .header span {
|
64 |
+
font-size: 13px;
|
65 |
+
line-height: 16px;
|
66 |
+
color:#678889;
|
67 |
+
font-weight:400;
|
68 |
+
text-shadow: 1px 1px 0 rgba(256,256,256,1.0);
|
69 |
+
}
|
70 |
+
|
71 |
+
|
72 |
+
.login-form .content {
|
73 |
+
padding: 0;
|
74 |
+
position:relative;
|
75 |
+
z-index:1;
|
76 |
+
}
|
77 |
+
|
78 |
+
.login-form .content .input {
|
79 |
+
width: 188px !important;
|
80 |
+
padding: 15px 25px;
|
81 |
+
|
82 |
+
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
83 |
+
font-weight: 400;
|
84 |
+
font-size: 14px;
|
85 |
+
color: #9d9e9e;
|
86 |
+
text-shadow: 1px 1px 0 rgba(256,256,256,1.0);
|
87 |
+
|
88 |
+
/*background: #dfe9ec;*/
|
89 |
+
border: 1px solid #fff;
|
90 |
+
border-radius: 5px;
|
91 |
+
|
92 |
+
box-shadow: inset 0 1px 3px rgba(0,0,0,0.50);
|
93 |
+
-moz-box-shadow: inset 0 1px 3px rgba(0,0,0,0.50);
|
94 |
+
-webkit-box-shadow: inset 0 1px 3px rgba(0,0,0,0.50);
|
95 |
+
}
|
96 |
+
|
97 |
+
/* Second input field */
|
98 |
+
.login-form .content .password, .login-form .content .pass-icon {
|
99 |
+
margin-top: 25px;
|
100 |
+
}
|
101 |
+
|
102 |
+
.error-password {top:73px;}
|
103 |
+
|
104 |
+
.login-form .content .input:hover {
|
105 |
+
/*background: #fff;*/
|
106 |
+
color: #414848;
|
107 |
+
}
|
108 |
+
|
109 |
+
.login-form .content .input:focus {
|
110 |
+
background: #fff;
|
111 |
+
color: #414848;
|
112 |
+
box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
|
113 |
+
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
|
114 |
+
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
|
115 |
+
}
|
116 |
+
|
117 |
+
input {
|
118 |
+
outline: none;
|
119 |
+
}
|
120 |
+
|
121 |
+
.user-icon, .pass-icon, .error-login, .error-password {
|
122 |
+
width: 46px;
|
123 |
+
height: 47px;
|
124 |
+
display: block;
|
125 |
+
position: absolute;
|
126 |
+
left: 0px;
|
127 |
+
padding-right: 2px;
|
128 |
+
z-index: -3;
|
129 |
+
|
130 |
+
-moz-border-radius-topleft: 5px;
|
131 |
+
-moz-border-radius-bottomleft: 5px;
|
132 |
+
-webkit-border-top-left-radius: 5px;
|
133 |
+
-webkit-border-bottom-left-radius: 5px;
|
134 |
+
border-top-left-radius:5px;
|
135 |
+
border-bottom-left-radius:5px;
|
136 |
+
}
|
137 |
+
|
138 |
+
|
139 |
+
.user-icon {
|
140 |
+
top: 0;
|
141 |
+
background: #171717 url(images/user-icon.png) no-repeat center;
|
142 |
+
}
|
143 |
+
|
144 |
+
.pass-icon {
|
145 |
+
top:48px;
|
146 |
+
background: #171717 url(images/pass-icon.png) no-repeat center;
|
147 |
+
}
|
148 |
+
|
149 |
+
/* Animation */
|
150 |
+
.input, .user-icon, .pass-icon, .button, .register {
|
151 |
+
transition: all 0.5s;
|
152 |
+
-moz-transition: all 0.5s;
|
153 |
+
-webkit-transition: all 0.5s;
|
154 |
+
-o-transition: all 0.5s;
|
155 |
+
-ms-transition: all 0.5s;
|
156 |
+
}
|
157 |
+
|
158 |
+
|
159 |
+
.login-form .footer {
|
160 |
+
padding: 20px 30px 30px;
|
161 |
+
overflow: auto;
|
162 |
+
|
163 |
+
}
|
164 |
+
|
165 |
+
/* Login button */
|
166 |
+
.login-form .footer .button {
|
167 |
+
float:right;
|
168 |
+
padding: 11px 25px;
|
169 |
+
font-weight: 300;
|
170 |
+
font-size: 18px;
|
171 |
+
color: #fff;
|
172 |
+
text-shadow: 0px 1px 0 rgba(0,0,0,0.25);
|
173 |
+
border-radius:5px;
|
174 |
+
background: #F15A29;
|
175 |
+
border: 1px solid #fff;
|
176 |
+
cursor: pointer;
|
177 |
+
|
178 |
+
box-shadow: inset 0 0 2px rgba(256,256,256,0.75);
|
179 |
+
-moz-box-shadow: inset 0 0 2px rgba(256,256,256,0.75);
|
180 |
+
-webkit-box-shadow: inset 0 0 2px rgba(256,256,256,0.75);
|
181 |
+
}
|
182 |
+
|
183 |
+
.login-form .footer .button:hover {
|
184 |
+
background: #171717;
|
185 |
+
border: 1px solid rgba(256,256,256,0.75);
|
186 |
+
|
187 |
+
box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
|
188 |
+
-moz-box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
|
189 |
+
-webkit-box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
|
190 |
+
}
|
191 |
+
|
192 |
+
.login-form .footer .button:focus {
|
193 |
+
position: relative;
|
194 |
+
bottom: -1px;
|
195 |
+
|
196 |
+
background: #56c2e1;
|
197 |
+
|
198 |
+
box-shadow: inset 0 1px 6px rgba(256,256,256,0.75);
|
199 |
+
-moz-box-shadow: inset 0 1px 6px rgba(256,256,256,0.75);
|
200 |
+
-webkit-box-shadow: inset 0 1px 6px rgba(256,256,256,0.75);
|
201 |
+
}
|
202 |
+
|
203 |
+
/* Register button */
|
204 |
+
.login-form .footer .register {
|
205 |
+
display: block;
|
206 |
+
float: right;
|
207 |
+
padding: 10px;
|
208 |
+
margin-right: 20px;
|
209 |
+
|
210 |
+
background: none;
|
211 |
+
border: none;
|
212 |
+
cursor: pointer;
|
213 |
+
|
214 |
+
font-family: 'Bree Serif', serif;
|
215 |
+
font-weight: 300;
|
216 |
+
font-size: 18px;
|
217 |
+
color: #414848;
|
218 |
+
text-shadow: 0px 1px 0 rgba(256,256,256,0.5);
|
219 |
+
}
|
220 |
+
|
221 |
+
.login-form .footer .register:hover {
|
222 |
+
color: #3f9db8;
|
223 |
+
}
|
224 |
+
|
225 |
+
.login-form .footer .register:focus {
|
226 |
+
position: relative;
|
227 |
+
bottom: -1px;
|
228 |
+
}
|
229 |
+
|
230 |
+
.company {
|
231 |
+
margin-bottom: 45px;
|
232 |
+
min-width: 600px;
|
233 |
+
}
|
234 |
+
|
235 |
+
.company a {
|
236 |
+
width: 100%;
|
237 |
+
max-width: 600px;
|
238 |
+
|
239 |
+
}
|
240 |
+
|
241 |
+
.company a img {
|
242 |
+
left: 50%;
|
243 |
+
position: relative;
|
244 |
+
}
|
245 |
+
.inputs{
|
246 |
+
background:#FFFFFF;
|
247 |
+
padding:0 30px 15px;
|
248 |
+
}
|
249 |
+
|
250 |
+
.error-login, .error-password { background:url("images/error.png") no-repeat scroll center center #171717; left: -49px;}
|
251 |
+
|
252 |
+
.company {
|
253 |
+
margin-bottom: 20px;
|
254 |
+
}
|
page-options.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function mt_manage_options()
|
4 |
+
{
|
5 |
+
global $mt_option;
|
6 |
+
|
7 |
+
$mt_option = mt_get_option();
|
8 |
+
|
9 |
+
if ( $_POST ) {
|
10 |
+
$state = $_POST['state'];
|
11 |
+
if (!$state) { $mt_option['state'] = 'live'; }
|
12 |
+
else { $mt_option['state'] = 'maintenance'; }
|
13 |
+
|
14 |
+
$mt_option['lib_options'] = $_POST['lib_options'];
|
15 |
+
|
16 |
+
/* trigger theme activation */
|
17 |
+
if ( file_exists( dirname( __FILE__ ).'/'.LIB_DIR.'/functions.php' ) ) {
|
18 |
+
include_once dirname( __FILE__ ).'/'.LIB_DIR.'/functions.php';
|
19 |
+
$mt_option = apply_filters( 'lib_update', $mt_option );
|
20 |
+
}
|
21 |
+
|
22 |
+
/* counter */
|
23 |
+
$mt_option['expiry_date'] = $_POST['lib_options']['expiry_date'] ? $_POST['lib_options']['expiry_date'] : '';
|
24 |
+
if ( !$mt_option['expiry_date'] ) {
|
25 |
+
unset( $mt_option['expiry_date'] );
|
26 |
+
}
|
27 |
+
mt_update_option($mt_option);
|
28 |
+
}
|
29 |
+
|
30 |
+
mt_get_lib_var();
|
31 |
+
?>
|
32 |
+
|
33 |
+
<div id="maintenance-options" class="wrap">
|
34 |
+
<form method="post" action="" enctype="multipart/form-data" name="options-form">
|
35 |
+
<div id="general">
|
36 |
+
<div class="title">
|
37 |
+
<img src="<?php echo PLUGIN_URL ?>images/icon.png" alt="Logo" class="logo" />
|
38 |
+
<h1>Maintenance -</h1>
|
39 |
+
<input name="state" type="checkbox" id="ch_location" name="ch_location" <?php if ( $mt_option['state'] == 'maintenance' ) echo 'checked="true"' ?> />
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="theme-options">
|
43 |
+
<?php include_once dirname( __FILE__ ).'/'.LIB_DIR.'/options.php'; ?>
|
44 |
+
<input type="submit" id="mt-submit" name="save_changes" class="button-primary" value="Save changes" />
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
</form>
|
48 |
+
|
49 |
+
<!-- Contact Support-->
|
50 |
+
<div id="contact-support">
|
51 |
+
<a href="mailto:support@fruitfulcode.com" title="Contact Support" target="_blank">
|
52 |
+
Contact Support
|
53 |
+
</a><br>
|
54 |
+
<a href="http://codecanyon.net/item/maintenance-wordpress-plugin/2781350" title="Premium version" target="_blank">
|
55 |
+
Check out our extended version of plugin with new features
|
56 |
+
</a><br>
|
57 |
+
</div>
|
58 |
+
<!-- End Contact Support-->
|
59 |
+
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<?php
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
?>
|
readme.txt
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Plugin Name ===
|
2 |
+
Contributors: fruitfulcode
|
3 |
+
Donate link: http://fruitfulcode.com/
|
4 |
+
Tags: maintenance, login, under-construction, administration, offline, unavailable, landing page
|
5 |
+
Requires at least: 3.0
|
6 |
+
Tested up to: 3.3.2
|
7 |
+
Stable tag: 1.0
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
Close your website on maintenance. Search engines and regular users don't see your site. Access only by login
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
Take your site down from public view with a click of a button hiding the site when you need to change a few things or run an upgrade, making it only accessible by login and password. There is also an area to add a custom message which will be shown to the users while your site is down. Users stay on the same page when they input wrong initials.
|
16 |
+
|
17 |
+
|
18 |
+
<h3>Links:</h3>
|
19 |
+
<a target="_blank" href="http://fruitfulcode.com/maintenance/free">DEMO</a><br>
|
20 |
+
<a target="_blank" href="http://fruitfulcode.com/blog/wordpress-maintenance-plugin/">More information</a>
|
21 |
+
|
22 |
+
|
23 |
+
<h3>Extended version</h3>
|
24 |
+
|
25 |
+
You can purchase an extended version of our plug-in and support our team
|
26 |
+
<a target="_blank" href="http://codecanyon.net/item/maintenance-wordpress-plugin/2781350">Link</a>
|
27 |
+
|
28 |
+
== Installation ==
|
29 |
+
|
30 |
+
1. Upload the «Maintenance» folder to the /wp-content/plugins/ directory
|
31 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
32 |
+
3. Go to Dashboard > Maintenance
|
33 |
+
|
34 |
+
== Screenshots ==
|
35 |
+
1. Dashboard
|
36 |
+
1. Login page
|
37 |
+
|
38 |
+
== Frequently Asked Questions ==
|
39 |
+
|
40 |
+
= Where can I find out the username and password to get to the site? =
|
41 |
+
|
42 |
+
You can use your administrator access or create new user in wordpress dashboard
|
43 |
+
http://yousite.com/wp-admin/users.php
|
44 |
+
|
45 |
+
= If I incorrectly write a login and password I will see the error on the page wp-login? =
|
46 |
+
No, it will be display error on current maintenance page, without redirect to wp-login page
|
47 |
+
|
48 |
+
|
49 |
+
== Changelog ==
|
50 |
+
|
51 |
+
= 1.1 =
|
52 |
+
|
53 |
+
* Any logo images will be in center of page
|
54 |
+
* Lastpass fields corrected width
|
55 |
+
* Bug fixes
|
56 |
+
|
57 |
+
= 1.0 =
|
58 |
+
* initial release
|
59 |
+
|
60 |
+
== Upgrade Notice ==
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.png
ADDED
Binary file
|