Under Construction - Version 1.1

Version Description

*Add option to set Google Font *Add option to set font size *Add option to set FB and Twitter URL

Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 Under Construction
Version 1.1
Comparing to
See all releases

Version 1.1

Files changed (7) hide show
  1. facebook.png +0 -0
  2. form.php +111 -0
  3. readme.txt +35 -0
  4. screenshot-1.png +0 -0
  5. twitter.png +0 -0
  6. uc.png +0 -0
  7. under-construction.php +155 -0
facebook.png ADDED
Binary file
form.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+
3
+ <div class="icon32" id="icon-edit-pages"></div>
4
+
5
+ <h2>Under Construction</h2>
6
+
7
+ <div id="poststuff" class="metabox-holder has-right-sidebar">
8
+
9
+ <div id="post-body">
10
+
11
+ <div id="post-body-content" class="form-wrap">
12
+
13
+ <form name="post_form" method="post" action="" enctype="multipart/form-data">
14
+
15
+ <div id="titlediv">
16
+
17
+ <div class="form-field">
18
+
19
+ <label for="title"><?php _e('Set Under Construction') ?></label>
20
+
21
+ <select name="set_opt" id="set_opt">
22
+ <option value="No" <?php echo ($set_opt=='No')?'selected=selected':'';?>>No</option>
23
+ <option value="Yes" <?php echo ($set_opt=='Yes')?'selected=selected':'';?>>Yes</option>
24
+ </select>
25
+ </div>
26
+
27
+ </div>
28
+ <div id="titlediv">
29
+
30
+ <div class="form-field">
31
+
32
+ <label for="title"><?php _e('Choose Font') ?></label>
33
+
34
+ <select name="set_font" id="set_font">
35
+ <option value="Open+Sans" <?php echo ($set_font=='Open+Sans')?'selected=selected':'';?>>Open Sans</option>
36
+ <option value="Roboto" <?php echo ($set_font=='Roboto')?'selected=selected':'';?>>Roboto</option>
37
+ <option value="Oswald" <?php echo ($set_font=='Oswald')?'selected=selected':'';?>>Oswald</option>
38
+ <option value="Droid+Sans" <?php echo ($set_font=='Droid+Sans')?'selected=selected':'';?>>Droid Sans</option>
39
+ <option value="Lobster" <?php echo ($set_font=='Lobster')?'selected=selected':'';?>>Lobster</option>
40
+ <option value="Inconsolata" <?php echo ($set_font=='Inconsolata')?'selected=selected':'';?>>Inconsolata</option>
41
+ <option value="Rokkitt" <?php echo ($set_font=='Rokkitt')?'selected=selected':'';?>>Rokkitt</option>
42
+ </select>
43
+ </div>
44
+
45
+ </div>
46
+ <div id="titlediv">
47
+
48
+ <div class="form-field">
49
+
50
+ <label for="title"><?php _e('Set Font Size') ?></label>
51
+
52
+ <select name="set_size" id="set_size">
53
+ <?php for($i=14; $i<=80;$i++){?>
54
+ <option value="<?php echo $i;?>" <?php echo ($set_size==$i)?'selected=selected':'';?>><?php echo $i;?></option>
55
+ <?php } ?>
56
+
57
+ </select>
58
+ </div>
59
+
60
+ </div>
61
+
62
+ <div id="titlediv">
63
+
64
+ <div class="form-field">
65
+
66
+ <label for="title"><?php _e('Message') ?></label>
67
+
68
+ <textarea name="set_msg" id="set_msg" cols="30" rows="3"><?php echo $set_msg;?></textarea>
69
+ </div>
70
+
71
+ </div>
72
+ <div id="titlediv">
73
+
74
+ <div class="form-field">
75
+
76
+ <label for="title"><?php _e('Set Facebook URL') ?></label>
77
+
78
+ <input type="text" name="set_fb" id="set_fb" value="<?php echo $set_fb;?>"/>
79
+ </div>
80
+
81
+ </div>
82
+ <div id="titlediv">
83
+
84
+ <div class="form-field">
85
+
86
+ <label for="title"><?php _e('Set Twitter URL') ?></label>
87
+
88
+ <input type="text" name="set_tweet" id="set_tweet" value="<?php echo $set_tweet;?>"/>
89
+ </div>
90
+
91
+ </div>
92
+
93
+
94
+
95
+
96
+ <div style="margin-top:15px;">
97
+
98
+
99
+ <input type="submit" name="submit" value="Submit" class="button" />
100
+
101
+ <input type="hidden" name="act" value="save" />
102
+
103
+ </form>
104
+
105
+ </div>
106
+
107
+ </div>
108
+
109
+ </div>
110
+
111
+ </div>
readme.txt ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Under Construction ===
2
+ Contributors: WebFactory
3
+ Tags: under construction page, coming soon page, maintenance, maintenance page, coming soon
4
+ Requires at least: 3.2
5
+ Tested up to: 3.6
6
+ Stable tag: 1.1
7
+ License: GPLv2 or later
8
+
9
+ Set Under Construction Message for website
10
+
11
+ == Description ==
12
+
13
+ Set Under Construction Message for website
14
+
15
+
16
+ == Installation ==
17
+
18
+ 1. Upload 'under-construction-page' to the '/wp-content/plugins/' directory
19
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
20
+ 3. Click on the Under Construction
21
+ 4. You can choose your option and enter your coming soon message.
22
+ 5. Click on "Submit" button.
23
+
24
+
25
+ == Screenshots ==
26
+
27
+ 1. Under Construction
28
+
29
+ == Changelog ==
30
+
31
+ = 1.1 =
32
+
33
+ *Add option to set Google Font
34
+ *Add option to set font size
35
+ *Add option to set FB and Twitter URL
screenshot-1.png ADDED
Binary file
twitter.png ADDED
Binary file
uc.png ADDED
Binary file
under-construction.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Under Construction Page
4
+ Plugin URI: http://nitinmaurya.com/
5
+ Description: Set Under Construction Message for website.
6
+ Version: 1.1
7
+ Author: Nitin Maurya
8
+ Author URI: http://nitinmaurya.com/
9
+ License: A "Slug" license name e.g. GPL2
10
+ */
11
+ register_activation_hook(__FILE__,'under_construction_install');
12
+ function under_construction_install(){
13
+ global $wp_version;
14
+ if(version_compare($wp_version, "3.2.1", "<")) {
15
+ deactivate_plugins(basename(__FILE__));
16
+ wp_die("This plugin requires WordPress version 3.2.1 or higher.");
17
+ }
18
+ set_under_construction();
19
+ }
20
+ add_action('admin_menu','under_construction_menu');
21
+ function under_construction_menu(){
22
+ add_menu_page('Under Construction', 'Under Construction','administrator', 'under-construction.php', 'under_construction_action', plugins_url('uc.png', __FILE__));
23
+ }
24
+
25
+
26
+ function under_construction_action(){
27
+ $option_name1 = 'set_opt' ;
28
+ $option_name2 = 'set_msg' ;
29
+ $option_name3 = 'set_font' ;
30
+ $option_name4 = 'set_fb' ;
31
+ $option_name5 = 'set_tweet' ;
32
+ $option_name6 = 'set_size' ;
33
+ switch($_REQUEST[act]) {
34
+ case "save":
35
+ set_under_construction();
36
+ echo '<div class="updated below-h2" id="message" style="position:relative; clear:both;"><p>Under Construction: '.$_REQUEST['set_opt'].'</p></div>';
37
+ break;
38
+ default:
39
+
40
+ }
41
+ $set_opt=get_option( $option_name1 );
42
+ $set_msg=get_option( $option_name2 );
43
+ $set_font=get_option( $option_name3 );
44
+ $set_fb=get_option( $option_name4 );
45
+ $set_tweet=get_option( $option_name5 );
46
+ $set_size=get_option( $option_name6 );
47
+ require_once('form.php');
48
+ }
49
+
50
+
51
+ function set_under_construction(){
52
+ $option_name1 = 'set_opt' ;
53
+ $option_name2 = 'set_msg' ;
54
+ $option_name3 = 'set_font' ;
55
+ $option_name4 = 'set_fb' ;
56
+ $option_name5 = 'set_tweet' ;
57
+ $option_name6 = 'set_size' ;
58
+ $new_value1 = ($_REQUEST['set_opt']=="")?'No': $_REQUEST['set_opt'];
59
+ if ( get_option( $option_name1 ) !== false ) {
60
+ update_option( $option_name1, $new_value1 );
61
+ } else {
62
+ $deprecated = null;
63
+ $autoload = 'no';
64
+ add_option( $option_name1, $new_value1, $deprecated, $autoload );
65
+ }
66
+
67
+
68
+ $new_value2 = ($_REQUEST['set_msg']=="")?'Website is Coming Soon': $_REQUEST['set_msg'];
69
+ if ( get_option( $option_name2 ) !== false ) {
70
+ update_option( $option_name2, $new_value2 );
71
+ } else {
72
+ $deprecated = null;
73
+ $autoload = 'no';
74
+ add_option( $option_name2, $new_value2, $deprecated, $autoload );
75
+ }
76
+
77
+
78
+ $new_value3 = ($_REQUEST['set_font']=="")?'Arial': $_REQUEST['set_font'];
79
+ if ( get_option( $option_name3 ) !== false ) {
80
+ update_option( $option_name3, $new_value3 );
81
+ } else {
82
+ $deprecated = null;
83
+ $autoload = 'no';
84
+ add_option( $option_name3, $new_value3, $deprecated, $autoload );
85
+ }
86
+
87
+ $new_value4 = ($_REQUEST['set_fb']=="")?'#': $_REQUEST['set_fb'];
88
+ if ( get_option( $option_name4 ) !== false ) {
89
+ update_option( $option_name4, $new_value4 );
90
+ } else {
91
+ $deprecated = null;
92
+ $autoload = 'no';
93
+ add_option( $option_name4, $new_value4, $deprecated, $autoload );
94
+ }
95
+
96
+ $new_value5 = ($_REQUEST['set_tweet']=="")?'#': $_REQUEST['set_tweet'];
97
+ if ( get_option( $option_name5 ) !== false ) {
98
+ update_option( $option_name5, $new_value5 );
99
+ } else {
100
+ $deprecated = null;
101
+ $autoload = 'no';
102
+ add_option( $option_name5, $new_value5, $deprecated, $autoload );
103
+ }
104
+
105
+ $new_value6 = ($_REQUEST['set_size']=="")?'14': $_REQUEST['set_size'];
106
+ if ( get_option( $option_name6 ) !== false ) {
107
+ update_option( $option_name6, $new_value6 );
108
+ } else {
109
+ $deprecated = null;
110
+ $autoload = 'no';
111
+ add_option( $option_name6, $new_value6, $deprecated, $autoload );
112
+ }
113
+
114
+
115
+
116
+ }
117
+
118
+ function show_uc(){
119
+ $option_name1 = 'set_opt' ;
120
+ $option_name2 = 'set_msg' ;
121
+ $option_name3 = 'set_font' ;
122
+ $option_name4 = 'set_fb' ;
123
+ $option_name5 = 'set_tweet' ;
124
+ $option_name6 = 'set_size' ;
125
+ $set_opt=get_option( $option_name1 );
126
+ $set_msg=get_option( $option_name2 );
127
+ $set_font=get_option( $option_name3 );
128
+ $set_fb=get_option( $option_name4 );
129
+ $set_tweet=get_option( $option_name5 );
130
+ $set_size=get_option( $option_name6 );
131
+ $under_msg="";
132
+ if($set_opt=='Yes'){
133
+ if($set_font!='Arial'){
134
+ $render_font=str_replace('+',' ',$set_font);
135
+ $under_msg.="<link href='http://fonts.googleapis.com/css?family=".$set_font."' rel='stylesheet' type='text/css'><style>.under_css{font-family: '".$render_font."', sans-serif;margin:0 auto; text-align:center;font-size:".$set_size."px;padding-top:30px;}</style>";
136
+ }else{
137
+ $under_msg.="<style>.under_css{font-family: Arial, sans-serif;margin:0 auto; text-align:center;font-size:".$set_size."px;padding-top:30px;}</style>";
138
+ }
139
+ if($set_fb!="#"){
140
+ $fb_msg="<a href='".$set_fb."' target='_blank'><img src='wp-content/plugins/under-construction-page/facebook.png'></a>";
141
+ }
142
+ if($set_tweet!="#"){
143
+ $tweet_msg="<a href='".$set_tweet."' target='_blank'><img src='wp-content/plugins/under-construction-page/twitter.png'></a>";
144
+ }
145
+
146
+ $under_msg.="<div class='under_css'>".$set_msg."<br>".$fb_msg."&nbsp;".$tweet_msg."</div>";
147
+ echo $under_msg;
148
+ exit(0);
149
+ }
150
+
151
+ }
152
+ add_action('wp_head', 'show_uc');
153
+
154
+
155
+ ?>