Changeset 690197
- Timestamp:
- 04/01/2013 05:18:03 PM (13 years ago)
- Location:
- wp-backgrounds-lite
- Files:
-
- 7 edited
-
tags/1.1/inoplugs_background_plugin.php (modified) (13 diffs)
-
tags/1.2/inoplugs_background_plugin.php (modified) (9 diffs)
-
tags/1.3/inoplugs_background_plugin.php (modified) (10 diffs)
-
tags/1.4/inoplugs_background_plugin.php (modified) (10 diffs)
-
tags/1.5/inoplugs_background_plugin.php (modified) (10 diffs)
-
tags/1.6/inoplugs_background_plugin.php (modified) (21 diffs)
-
trunk/inoplugs_background_plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-backgrounds-lite/tags/1.1/inoplugs_background_plugin.php
r380910 r690197 4 4 * Plugin URI: http://inoplugs.com 5 5 * Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a> 6 * Author: InoPlugs | Peter Schoenmann6 * Author: InoPlugs 7 7 * Version: 1.1.0.0 8 8 * Author URI: http://inoplugs.com … … 17 17 add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes')); 18 18 add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow')); 19 20 19 20 21 21 //options 22 22 $ino_zindex = '-999'; 23 23 $ino_bg_color = ''; 24 24 $ino_credit = true; 25 26 27 25 26 27 28 28 if (function_exists('register_uninstall_hook')){ 29 29 register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds'); 30 30 } 31 31 32 32 function deinstall_inoplugs_wp_backgrounds() { 33 33 delete_option('inoplugs_bg_options'); 34 34 35 35 $allposts = get_posts('numberposts=-1&post_type=post&post_status=any'); 36 36 … … 43 43 //metabox 44 44 $prefix = 'ino_'; 45 45 46 46 $meta_box = array( 47 47 'id' => 'ino-meta-box_post', … … 67 67 ) 68 68 ); 69 69 70 70 $meta_box = array( 71 71 'id' => 'ino-meta-box_post', … … 91 91 ) 92 92 ); 93 93 94 94 add_action('admin_menu', 'ino_add_box'); 95 95 96 96 // Add meta box 97 97 function ino_add_box() { 98 98 global $meta_box; 99 99 100 100 add_meta_box($meta_box['id'], $meta_box['title'], 'ino_show_box', $meta_box['page'], $meta_box['context'], $meta_box['priority']); 101 101 } 102 102 103 103 // Callback function to show fields in meta box 104 104 function ino_show_box() { 105 105 global $meta_box, $post; 106 106 107 107 // Use nonce for verification 108 108 echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />'; 109 109 110 110 echo '<table class="form-table">'; 111 111 112 112 foreach ($meta_box['fields'] as $field) { 113 113 // get current post meta data 114 114 $meta = get_post_meta($post->ID, $field['id'], true); 115 115 116 116 echo '<tr>', 117 117 '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>', 118 118 '<td>'; 119 119 switch ($field['type']) { 120 121 122 123 124 //If Text 120 121 122 123 124 //If Text 125 125 case 'text': 126 126 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />', 127 127 '<br />', $field['desc']; 128 128 break; 129 130 131 //If Text Area 129 130 131 //If Text Area 132 132 case 'textarea': 133 133 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>', 134 134 '<br />', $field['desc']; 135 135 break; 136 137 138 //If Button 139 136 137 138 //If Button 139 140 140 case 'button': 141 141 echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />'; … … 145 145 '</tr>'; 146 146 } 147 147 148 148 echo '</table>'; 149 149 } 150 150 151 151 add_action('save_post', 'ino_save_data'); 152 152 153 153 // Save data from meta box 154 154 function ino_save_data($post_id) { 155 155 global $meta_box; 156 156 157 157 // verify nonce 158 158 if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) { 159 159 return $post_id; 160 160 } 161 161 162 162 // check autosave 163 163 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 164 164 return $post_id; 165 165 } 166 166 167 167 // check permissions 168 168 if ('page' == $_POST['post_type']) { … … 173 173 return $post_id; 174 174 } 175 175 176 176 foreach ($meta_box['fields'] as $field) { 177 177 $old = get_post_meta($post_id, $field['id'], true); 178 178 $new = $_POST[$field['id']]; 179 179 180 180 if ($new && $new != $old) { 181 181 update_post_meta($post_id, $field['id'], $new); … … 185 185 } 186 186 } 187 187 188 188 function ino_admin_scripts() { 189 189 wp_enqueue_script('media-upload'); … … 198 198 add_action('admin_print_styles', 'ino_admin_styles'); 199 199 200 200 201 201 //metabox 202 202 $prefix = 'ino_'; 203 203 204 204 $meta_box_page = array( 205 205 'id' => 'ino-meta-box_page', … … 225 225 ) 226 226 ); 227 227 228 228 add_action('admin_menu', 'ino_add_box_page'); 229 229 230 230 // Add meta box page 231 231 function ino_add_box_page() { 232 232 global $meta_box_page; 233 233 234 234 add_meta_box($meta_box_page['id'], $meta_box_page['title'], 'ino_show_box_page', $meta_box_page['page'], $meta_box_page['context'], $meta_box_page['priority']); 235 235 } 236 236 237 237 // Callback function to show fields in meta box 238 238 function ino_show_box_page() { 239 239 global $meta_box_page, $post; 240 240 241 241 // Use nonce for verification 242 242 echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />'; 243 243 244 244 echo '<table class="form-table">'; 245 245 246 246 foreach ($meta_box_page['fields'] as $field) { 247 247 // get current post meta data 248 248 $meta = get_post_meta($post->ID, $field['id'], true); 249 249 250 250 echo '<tr>', 251 251 '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>', 252 252 '<td>'; 253 253 switch ($field['type']) { 254 255 256 257 258 //If Text 254 255 256 257 258 //If Text 259 259 case 'text': 260 260 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />', 261 261 '<br />', $field['desc']; 262 262 break; 263 264 265 //If Text Area 263 264 265 //If Text Area 266 266 case 'textarea': 267 267 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>', 268 268 '<br />', $field['desc']; 269 269 break; 270 271 272 //If Button 273 270 271 272 //If Button 273 274 274 case 'button': 275 275 echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />'; … … 279 279 '</tr>'; 280 280 } 281 281 282 282 echo '</table>'; 283 283 } 284 284 285 285 add_action('save_post', 'ino_save_data_page'); 286 286 287 287 // Save data from meta box 288 288 function ino_save_data_page($post_id) { 289 289 global $meta_box_page; 290 290 291 291 // verify nonce 292 292 if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) { 293 293 return $post_id; 294 294 } 295 295 296 296 // check autosave 297 297 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 298 298 return $post_id; 299 299 } 300 300 301 301 // check permissions 302 302 if ('page' == $_POST['post_type']) { … … 307 307 return $post_id; 308 308 } 309 309 310 310 foreach ($meta_box_page['fields'] as $field) { 311 311 $old = get_post_meta($post_id, $field['id'], true); 312 312 $new = $_POST[$field['id']]; 313 313 314 314 if ($new && $new != $old) { 315 315 update_post_meta($post_id, $field['id'], $new); … … 319 319 } 320 320 } 321 321 322 322 function ino_admin_scripts_page() { 323 323 wp_enqueue_script('media-upload'); -
wp-backgrounds-lite/tags/1.2/inoplugs_background_plugin.php
r390402 r690197 4 4 * Plugin URI: http://inoplugs.com 5 5 * Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a> 6 * Author: InoPlugs | Peter Schoenmann6 * Author: InoPlugs 7 7 * Version: 1.2.0.0 8 8 * Author URI: http://inoplugs.com … … 17 17 add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes')); 18 18 add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow')); 19 20 19 20 21 21 //options 22 22 $ino_zindex = '-999'; 23 23 $ino_bg_color = ''; 24 24 $ino_credit = true; 25 26 27 25 26 27 28 28 if (function_exists('register_uninstall_hook')){ 29 29 register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds'); 30 30 } 31 31 32 32 function deinstall_inoplugs_wp_backgrounds() { 33 33 delete_option('inoplugs_bg_options'); 34 34 35 35 $allposts = get_posts('numberposts=-1&post_type=post&post_status=any'); 36 36 … … 43 43 //metabox 44 44 $prefix = 'ino_'; 45 45 46 46 $meta_box = array( 47 47 $meta_box_post = array( … … 68 68 ) 69 69 ), 70 70 71 71 $meta_box_page = array( 72 72 'id' => 'ino-meta-box_page', … … 90 90 'std' => 'Select Background Image' 91 91 ) 92 ) 92 ) 93 93 ) 94 94 ); 95 96 95 96 97 97 add_action('admin_menu', 'ino_add_box'); 98 98 99 99 // Add meta box 100 100 function ino_add_box() { 101 101 global $meta_box; 102 102 foreach($meta_box as $box){ 103 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 103 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 104 104 } 105 105 } 106 107 106 107 108 108 // Callback function to show fields in meta box 109 109 function ino_show_box() { 110 110 global $meta_box, $post; 111 111 112 112 // Use nonce for verification 113 113 echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />'; 114 114 115 115 echo '<table class="form-table">'; 116 116 117 117 foreach ($meta_box[0]['fields'] as $field) { 118 118 // get current post meta data 119 119 $meta = get_post_meta($post->ID, $field['id'], true); 120 120 121 121 echo '<tr>', 122 122 '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>', 123 123 '<td>'; 124 124 switch ($field['type']) { 125 126 127 128 129 //If Text 125 126 127 128 129 //If Text 130 130 case 'text': 131 131 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />', 132 132 '<br />', $field['desc']; 133 133 break; 134 135 136 //If Text Area 134 135 136 //If Text Area 137 137 case 'textarea': 138 138 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>', 139 139 '<br />', $field['desc']; 140 140 break; 141 142 143 //If Button 144 141 142 143 //If Button 144 145 145 case 'button': 146 146 echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />'; … … 150 150 '</tr>'; 151 151 } 152 152 153 153 echo '</table>'; 154 154 } 155 155 156 156 add_action('save_post', 'ino_save_data'); 157 158 157 158 159 159 // Save data from meta box 160 160 function ino_save_data($post_id) { 161 161 global $meta_box; 162 162 163 163 // verify nonce 164 164 if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) { 165 165 return $post_id; 166 166 } 167 167 168 168 // check autosave 169 169 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 170 170 return $post_id; 171 171 } 172 172 173 173 // check permissions 174 174 if ('page' == $_POST['post_type']) { … … 179 179 return $post_id; 180 180 } 181 181 182 182 foreach ($meta_box[0]['fields'] as $field) { 183 183 $old = get_post_meta($post_id, $field['id'], true); 184 184 $new = $_POST[$field['id']]; 185 185 186 186 if ($new && $new != $old) { 187 187 update_post_meta($post_id, $field['id'], $new); … … 191 191 } 192 192 } 193 193 194 194 function ino_admin_scripts() { 195 195 wp_enqueue_script('media-upload'); … … 203 203 add_action('admin_print_scripts', 'ino_admin_scripts'); 204 204 add_action('admin_print_styles', 'ino_admin_styles'); 205 205 206 206 ?> -
wp-backgrounds-lite/tags/1.3/inoplugs_background_plugin.php
r394918 r690197 4 4 * Plugin URI: http://inoplugs.com 5 5 * Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a> 6 * Author: InoPlugs | Peter Schoenmann6 * Author: InoPlugs 7 7 * Version: 1.3.0.0 8 8 * Author URI: http://inoplugs.com … … 17 17 add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes')); 18 18 add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow')); 19 20 19 20 21 21 //options 22 22 $ino_zindex = '-999'; 23 23 $ino_bg_color = ''; 24 24 $ino_credit = true; 25 26 27 25 26 27 28 28 if (function_exists('register_uninstall_hook')){ 29 29 register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds'); 30 30 } 31 31 32 32 function deinstall_inoplugs_wp_backgrounds() { 33 33 delete_option('inoplugs_bg_options'); 34 34 35 35 $allposts = get_posts('numberposts=-1&post_type=post&post_status=any'); 36 36 … … 43 43 //metabox 44 44 $prefix = 'ino_'; 45 45 46 46 $meta_box = array( 47 47 $meta_box_post = array( … … 68 68 ) 69 69 ), 70 70 71 71 $meta_box_page = array( 72 72 'id' => 'ino-meta-box_page', … … 90 90 'std' => 'Select Background Image' 91 91 ), 92 92 93 93 array( 94 94 'name' => '', … … 98 98 'std' => '' 99 99 ) 100 ) 100 ) 101 101 ) 102 102 ); 103 104 103 104 105 105 add_action('admin_menu', 'ino_add_box'); 106 106 107 107 // Add meta box 108 108 function ino_add_box() { 109 109 global $meta_box; 110 110 foreach($meta_box as $box){ 111 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 111 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 112 112 } 113 113 } 114 115 114 115 116 116 // Callback function to show fields in meta box 117 117 function ino_show_box() { 118 118 global $meta_box, $post; 119 119 120 120 // Use nonce for verification 121 121 echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />'; 122 122 123 123 echo '<table class="form-table">'; 124 124 125 125 foreach ($meta_box[0]['fields'] as $field) { 126 126 // get current post meta data 127 127 $meta = get_post_meta($post->ID, $field['id'], true); 128 128 129 129 echo '<tr>', 130 130 '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>', 131 131 '<td>'; 132 132 switch ($field['type']) { 133 134 135 136 137 //If Text 133 134 135 136 137 //If Text 138 138 case 'text': 139 139 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />', 140 140 '<br />', $field['desc']; 141 141 break; 142 143 144 //If Text Area 142 143 144 //If Text Area 145 145 case 'textarea': 146 146 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>', 147 147 '<br />', $field['desc']; 148 148 break; 149 150 151 //If Button 152 149 150 151 //If Button 152 153 153 case 'button': 154 154 echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />'; … … 158 158 '</tr>'; 159 159 } 160 160 161 161 echo '</table>'; 162 162 } 163 163 164 164 add_action('save_post', 'ino_save_data'); 165 166 165 166 167 167 // Save data from meta box 168 168 function ino_save_data($post_id) { 169 169 global $meta_box; 170 170 171 171 // verify nonce 172 172 if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) { 173 173 return $post_id; 174 174 } 175 175 176 176 // check autosave 177 177 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 178 178 return $post_id; 179 179 } 180 180 181 181 // check permissions 182 182 if ('page' == $_POST['post_type']) { … … 187 187 return $post_id; 188 188 } 189 189 190 190 foreach ($meta_box[0]['fields'] as $field) { 191 191 $old = get_post_meta($post_id, $field['id'], true); 192 192 $new = $_POST[$field['id']]; 193 193 194 194 if ($new && $new != $old) { 195 195 update_post_meta($post_id, $field['id'], $new); … … 199 199 } 200 200 } 201 201 202 202 function ino_admin_scripts() { 203 203 wp_enqueue_script('media-upload'); … … 211 211 add_action('admin_print_scripts', 'ino_admin_scripts'); 212 212 add_action('admin_print_styles', 'ino_admin_styles'); 213 213 214 214 ?> -
wp-backgrounds-lite/tags/1.4/inoplugs_background_plugin.php
r401589 r690197 4 4 * Plugin URI: http://inoplugs.com 5 5 * Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a> 6 * Author: InoPlugs | Peter Schoenmann6 * Author: InoPlugs 7 7 * Version: 1.4.0.0 8 8 * Author URI: http://inoplugs.com … … 17 17 add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes')); 18 18 add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow')); 19 20 19 20 21 21 //options 22 22 $ino_zindex = '-999'; 23 23 $ino_bg_color = ''; 24 24 $ino_credit = true; 25 26 27 25 26 27 28 28 if (function_exists('register_uninstall_hook')){ 29 29 register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds'); 30 30 } 31 31 32 32 function deinstall_inoplugs_wp_backgrounds() { 33 33 delete_option('inoplugs_bg_options'); 34 34 35 35 $allposts = get_posts('numberposts=-1&post_type=post&post_status=any'); 36 36 … … 43 43 //metabox 44 44 $prefix = 'ino_'; 45 45 46 46 $meta_box = array( 47 47 $meta_box_post = array( … … 68 68 ) 69 69 ), 70 70 71 71 $meta_box_page = array( 72 72 'id' => 'ino-meta-box_page', … … 90 90 'std' => 'Select Background Image' 91 91 ), 92 92 93 93 array( 94 94 'name' => '', … … 98 98 'std' => '' 99 99 ) 100 ) 100 ) 101 101 ) 102 102 ); 103 104 103 104 105 105 add_action('admin_menu', 'ino_add_box'); 106 106 107 107 // Add meta box 108 108 function ino_add_box() { 109 109 global $meta_box; 110 110 foreach($meta_box as $box){ 111 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 111 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 112 112 } 113 113 } 114 115 114 115 116 116 // Callback function to show fields in meta box 117 117 function ino_show_box() { 118 118 global $meta_box, $post; 119 119 120 120 // Use nonce for verification 121 121 echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />'; 122 122 123 123 echo '<table class="form-table">'; 124 124 125 125 foreach ($meta_box[0]['fields'] as $field) { 126 126 // get current post meta data 127 127 $meta = get_post_meta($post->ID, $field['id'], true); 128 128 129 129 echo '<tr>', 130 130 '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>', 131 131 '<td>'; 132 132 switch ($field['type']) { 133 134 135 136 137 //If Text 133 134 135 136 137 //If Text 138 138 case 'text': 139 139 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />', 140 140 '<br />', $field['desc']; 141 141 break; 142 143 144 //If Text Area 142 143 144 //If Text Area 145 145 case 'textarea': 146 146 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>', 147 147 '<br />', $field['desc']; 148 148 break; 149 150 151 //If Button 152 149 150 151 //If Button 152 153 153 case 'button': 154 154 echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />'; … … 158 158 '</tr>'; 159 159 } 160 160 161 161 echo '</table>'; 162 162 } 163 163 164 164 add_action('save_post', 'ino_save_data'); 165 166 165 166 167 167 // Save data from meta box 168 168 function ino_save_data($post_id) { 169 169 global $meta_box; 170 170 171 171 // verify nonce 172 172 if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) { 173 173 return $post_id; 174 174 } 175 175 176 176 // check autosave 177 177 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 178 178 return $post_id; 179 179 } 180 180 181 181 // check permissions 182 182 if ('page' == $_POST['post_type']) { … … 187 187 return $post_id; 188 188 } 189 189 190 190 foreach ($meta_box[0]['fields'] as $field) { 191 191 $old = get_post_meta($post_id, $field['id'], true); 192 192 $new = $_POST[$field['id']]; 193 193 194 194 if ($new && $new != $old) { 195 195 update_post_meta($post_id, $field['id'], $new); … … 199 199 } 200 200 } 201 201 202 202 function ino_admin_scripts() { 203 203 wp_enqueue_script('media-upload'); … … 211 211 add_action('admin_print_scripts', 'ino_admin_scripts'); 212 212 add_action('admin_print_styles', 'ino_admin_styles'); 213 213 214 214 ?> -
wp-backgrounds-lite/tags/1.5/inoplugs_background_plugin.php
r573497 r690197 4 4 * Plugin URI: http://inoplugs.com 5 5 * Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a> 6 * Author: InoPlugs | Peter Schoenmann6 * Author: InoPlugs 7 7 * Version: 1.5.0.0 8 8 * Author URI: http://inoplugs.com … … 17 17 add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes')); 18 18 add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow')); 19 20 19 20 21 21 //options 22 22 $ino_zindex = '-999'; 23 23 $ino_bg_color = ''; 24 24 $ino_credit = true; 25 26 27 25 26 27 28 28 if (function_exists('register_uninstall_hook')){ 29 29 register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds'); 30 30 } 31 31 32 32 function deinstall_inoplugs_wp_backgrounds() { 33 33 delete_option('inoplugs_bg_options'); 34 34 35 35 $allposts = get_posts('numberposts=-1&post_type=post&post_status=any'); 36 36 … … 43 43 //metabox 44 44 $prefix = 'ino_'; 45 45 46 46 $meta_box = array( 47 47 $meta_box_post = array( … … 68 68 ) 69 69 ), 70 70 71 71 $meta_box_page = array( 72 72 'id' => 'ino-meta-box_page', … … 90 90 'std' => 'Select Background Image' 91 91 ), 92 92 93 93 array( 94 94 'name' => '', … … 98 98 'std' => '' 99 99 ) 100 ) 100 ) 101 101 ) 102 102 ); 103 104 103 104 105 105 add_action('admin_menu', 'ino_add_box'); 106 106 107 107 // Add meta box 108 108 function ino_add_box() { 109 109 global $meta_box; 110 110 foreach($meta_box as $box){ 111 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 111 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 112 112 } 113 113 } 114 115 114 115 116 116 // Callback function to show fields in meta box 117 117 function ino_show_box() { 118 118 global $meta_box, $post; 119 119 120 120 // Use nonce for verification 121 121 echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />'; 122 122 123 123 echo '<table class="form-table">'; 124 124 125 125 foreach ($meta_box[0]['fields'] as $field) { 126 126 // get current post meta data 127 127 $meta = get_post_meta($post->ID, $field['id'], true); 128 128 129 129 echo '<tr>', 130 130 '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>', 131 131 '<td>'; 132 132 switch ($field['type']) { 133 134 135 136 137 //If Text 133 134 135 136 137 //If Text 138 138 case 'text': 139 139 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />', 140 140 '<br />', $field['desc']; 141 141 break; 142 143 144 //If Text Area 142 143 144 //If Text Area 145 145 case 'textarea': 146 146 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>', 147 147 '<br />', $field['desc']; 148 148 break; 149 150 151 //If Button 152 149 150 151 //If Button 152 153 153 case 'button': 154 154 echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />'; … … 158 158 '</tr>'; 159 159 } 160 160 161 161 echo '</table>'; 162 162 } 163 163 164 164 add_action('save_post', 'ino_save_data'); 165 166 165 166 167 167 // Save data from meta box 168 168 function ino_save_data($post_id) { 169 169 global $meta_box; 170 170 171 171 // verify nonce 172 172 if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) { 173 173 return $post_id; 174 174 } 175 175 176 176 // check autosave 177 177 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 178 178 return $post_id; 179 179 } 180 180 181 181 // check permissions 182 182 if ('page' == $_POST['post_type']) { … … 187 187 return $post_id; 188 188 } 189 189 190 190 foreach ($meta_box[0]['fields'] as $field) { 191 191 $old = get_post_meta($post_id, $field['id'], true); 192 192 $new = $_POST[$field['id']]; 193 193 194 194 if ($new && $new != $old) { 195 195 update_post_meta($post_id, $field['id'], $new); … … 199 199 } 200 200 } 201 201 202 202 function ino_admin_scripts() { 203 203 wp_enqueue_script('media-upload'); … … 211 211 add_action('admin_print_scripts', 'ino_admin_scripts'); 212 212 add_action('admin_print_styles', 'ino_admin_styles'); 213 213 214 214 ?> -
wp-backgrounds-lite/tags/1.6/inoplugs_background_plugin.php
r619395 r690197 4 4 * Plugin URI: http://inoplugs.com 5 5 * Description: Set clickable fullsize background images for Posts/Pages | Get the Premium version here: <a href="http://inoplugs.com/wpbackgroundsII">WP-Backgrounds II</a> 6 * Author: InoPlugs | Peter Schoenmann6 * Author: InoPlugs 7 7 * Version: 2.1.0.0 8 8 * Author URI: http://inoplugs.com 9 9 */ 10 10 11 11 define( 'INO_WPBLITE_URLPATH', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__ ),'',plugin_basename(__FILE__)) ); 12 12 define( 'INO_WPBLITE_TEXTDOMAIN', 'inowpblite' ); 13 13 define( 'INO_WPBLITE_OPTIONNAME', 'inoplugs_bglite_options' ); 14 14 15 15 load_plugin_textdomain( INO_WPBLITE_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 16 16 17 17 require_once('inoplugs_classes/inoplugs_background_display.php'); 18 19 20 18 19 20 21 21 global $ino_bglite_options; 22 22 $ino_bglite_options = array(); 23 23 $ino_bglite_options = get_option(INO_WPBLITE_OPTIONNAME); 24 25 //set falback settings 24 25 //set falback settings 26 26 $ino_bglite_options['zindex'] = empty($ino_bglite_options['zindex']) ? "-1" : $ino_bglite_options['zindex']; 27 27 $ino_bglite_options['bg_color'] = empty($ino_bglite_options['bg_color']) ? "" : $ino_bglite_options['bg_color']; … … 33 33 $inoplugs_wp_backgrounds_display = new inoplugs_background_display(); 34 34 35 # Add the options/actions to WordPress 35 # Add the options/actions to WordPress 36 36 add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes')); 37 add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow')); 38 37 add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow')); 38 39 39 if (function_exists('register_uninstall_hook')){ 40 40 register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds'); 41 41 } 42 42 43 43 function deinstall_inoplugs_wp_backgrounds() { 44 44 delete_option('inoplugs_bg_options'); 45 45 46 46 $allposts = get_posts('numberposts=-1&post_type=post&post_status=any'); 47 47 … … 68 68 'std' => '' 69 69 ), 70 70 71 71 array( 72 72 'name' => '', … … 76 76 'std' => __('Select Background Image',INO_WPBLITE_TEXTDOMAIN) 77 77 ), 78 78 79 79 array( 80 80 'name' => '', … … 86 86 ) 87 87 ), 88 88 89 89 $meta_box_page = array( 90 90 'id' => 'ino-meta-box_page', … … 108 108 'std' => __('Select Background Image',INO_WPBLITE_TEXTDOMAIN) 109 109 ), 110 110 111 111 array( 112 112 'name' => '', … … 116 116 'std' => '' 117 117 ) 118 ) 118 ) 119 119 ) 120 120 ); 121 122 121 122 123 123 add_action('admin_menu', 'ino_add_box'); 124 124 125 125 // Add meta box 126 126 function ino_add_box() { 127 127 global $meta_box; 128 128 foreach($meta_box as $box){ 129 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 129 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']); 130 130 } 131 131 } 132 133 132 133 134 134 // Callback function to show fields in meta box 135 135 function ino_show_box() { 136 136 global $meta_box, $post; 137 137 138 138 // Use nonce for verification 139 139 echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />'; 140 140 141 141 echo '<table class="form-table">'; 142 142 143 143 foreach ($meta_box[0]['fields'] as $field) { 144 144 // get current post meta data 145 145 $meta = get_post_meta($post->ID, $field['id'], true); 146 146 147 147 echo '<tr>', 148 148 '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>', 149 149 '<td>'; 150 150 switch ($field['type']) { 151 152 153 154 155 //If Text 151 152 153 154 155 //If Text 156 156 case 'text': 157 157 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />', 158 158 '<br />', $field['desc']; 159 159 break; 160 161 162 //If Button 163 160 161 162 //If Button 163 164 164 case 'button': 165 165 echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />'; … … 169 169 '</tr>'; 170 170 } 171 171 172 172 echo '</table>'; 173 173 } 174 174 175 175 add_action('save_post', 'ino_save_data'); 176 177 176 177 178 178 // Save data from meta box 179 179 function ino_save_data($post_id) { 180 180 global $meta_box; 181 181 182 182 // verify nonce 183 183 if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) { 184 184 return $post_id; 185 185 } 186 186 187 187 // check autosave 188 188 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { 189 189 return $post_id; 190 190 } 191 191 192 192 // check permissions 193 193 if ('page' == $_POST['post_type']) { … … 198 198 return $post_id; 199 199 } 200 200 201 201 foreach ($meta_box[0]['fields'] as $field) { 202 202 $old = get_post_meta($post_id, $field['id'], true); 203 203 $new = $_POST[$field['id']]; 204 204 205 205 if ($new && $new != $old) { 206 206 update_post_meta($post_id, $field['id'], $new); … … 210 210 } 211 211 } 212 212 213 213 function ino_admin_scripts() { 214 214 wp_enqueue_script('media-upload'); … … 217 217 wp_enqueue_script('my-upload'); 218 218 } 219 219 220 220 function ino_admin_styles() { 221 221 wp_enqueue_style('thickbox'); 222 222 } 223 223 224 224 add_action('admin_print_scripts', 'ino_admin_scripts'); 225 225 add_action('admin_print_styles', 'ino_admin_styles'); 226 227 226 227 228 228 # Register an administration page 229 229 230 230 add_action('admin_menu', 'inowpblite_addAdminPage'); 231 231 232 232 function inowpblite_addAdminPage() { 233 233 add_options_page(__('WP-Backgrounds Lite',INO_WPBLITE_TEXTDOMAIN), 'WP-Backgrounds Lite', 8, 'WP-Backgrounds', 'inowpblite_adminmenu'); … … 235 235 236 236 # Generates the administration menu 237 237 238 238 239 239 add_action('wp_ajax_inoptions_inowpblite_ajax_save','inoplugs_inowpblite_save_ajax'); 240 240 241 241 function inoplugs_inowpblite_save_ajax() { 242 242 … … 246 246 unset($data['security'], $data['action']); 247 247 248 if(update_option(INO_WPBLITE_OPTIONNAME, $data)) 248 if(update_option(INO_WPBLITE_OPTIONNAME, $data)) 249 249 { 250 250 die('1'); … … 258 258 <div class="wrap"> 259 259 <div id="message"></div> 260 260 261 261 <script type="text/javascript"> 262 262 jQuery(document).ready(function($) { … … 291 291 } 292 292 </script> 293 293 294 294 <div class="logo"><a href="http://inoplugs.com"><img style="float:left;" src="<?php $ino_urlpath = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),'',plugin_basename(__FILE__)); echo $ino_urlpath; ?>images/logo.png" height="100" alt="logo" /></a> 295 295 <h2 style="float:left; margin-top: 64px;"><?php _e('Backgrounds Lite Option Page',INO_WPBLITE_TEXTDOMAIN); ?></h2> … … 297 297 </div> 298 298 <div style="clear: both;"></div> 299 299 300 300 <form method="post" action="options.php" name="ino_inowpblite_option_form" id="ino_inowpblite_option_form"> 301 301 <?php global $ino_bglite_options; wp_nonce_field('update-options'); ?> 302 302 303 303 <div id="ino-options-cont"> 304 304 … … 314 314 </div> 315 315 </div> 316 317 316 317 318 318 <div id="ino-containerid" class="tab-option"> 319 319 <h3 class="option-title"><strong><?php _e('ID or class of the content container/wrapper',INO_WPBLITE_TEXTDOMAIN); ?></strong></h3> 320 320 <div class="option-content"> 321 321 322 322 <label for="containerid"> 323 323 <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[containerid]" value="<?php if( !empty($ino_bglite_options['containerid']) ) { echo $ino_bglite_options['containerid']; }else{ echo ""; } ?>" /><br/> … … 328 328 </div> 329 329 </div> 330 331 330 331 332 332 <div id="ino-zindexcontainer" class="tab-option"> 333 333 <h3 class="option-title"><strong><?php _e('Z-index value of content layer',INO_WPBLITE_TEXTDOMAIN); ?></strong></h3> 334 334 <div class="option-content"> 335 335 336 336 <label for="zindexcontainer"> 337 <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[zindexcontainer]" value="<?php if( !empty($ino_bglite_options['zindexcontainer']) ) { echo $ino_bglite_options['zindexcontainer']; }else{ echo "5"; } ?>" /> 337 <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[zindexcontainer]" value="<?php if( !empty($ino_bglite_options['zindexcontainer']) ) { echo $ino_bglite_options['zindexcontainer']; }else{ echo "5"; } ?>" /> 338 338 <br /><?php _e('Enter the z-index value of the background layer (5 by default).',INO_WPBLITE_TEXTDOMAIN); ?> 339 339 </label> … … 342 342 </div> 343 343 </div> 344 344 345 345 <div id="ino-positioncontainer" class="tab-option"> 346 346 <h3 class="option-title"><strong><?php _e('Position of the content container/wrapper',INO_WPBLITE_TEXTDOMAIN); ?></strong></h3> 347 347 <div class="option-content"> 348 348 349 349 <label for="positioncontainer"> 350 <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[positioncontainer]" value="<?php if( !empty($ino_bglite_options['positioncontainer']) ) { echo $ino_bglite_options['positioncontainer']; }else{ echo "relative"; } ?>" /> 350 <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[positioncontainer]" value="<?php if( !empty($ino_bglite_options['positioncontainer']) ) { echo $ino_bglite_options['positioncontainer']; }else{ echo "relative"; } ?>" /> 351 351 <br /><?php _e('Enter the position of the content container/wrapper. Default value is \'relative\'. Only change it if you know what you\'re doing.',INO_WPBLITE_TEXTDOMAIN); ?> 352 352 </label> … … 355 355 </div> 356 356 </div> 357 357 358 358 <div id="ino-bg_color" class="tab-option"> 359 359 <h3 class="option-title"><strong><?php _e('Body background color',INO_WPBLITE_TEXTDOMAIN); ?></strong></h3> 360 360 <div class="option-content"> 361 361 362 362 <label for="bg_color"> 363 <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[bg_color]" value="<?php if( !empty($ino_bglite_options['bg_color']) ) { echo $ino_bglite_options['bg_color']; }else{ echo ""; } ?>" /> 363 <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[bg_color]" value="<?php if( !empty($ino_bglite_options['bg_color']) ) { echo $ino_bglite_options['bg_color']; }else{ echo ""; } ?>" /> 364 364 <br /><?php _e('This option helps you to adjust the default body background color. Leave the field empty to deactivate this option.',INO_WPBLITE_TEXTDOMAIN); ?> 365 365 </label> … … 376 376 <input type="submit" class="button-primary" value="<?php _e('Save Changes',INO_WPBLITE_TEXTDOMAIN) ?>" /> 377 377 </p> 378 </form> 378 </form> 379 379 </div> 380 380 381 381 <?php 382 382 } -
wp-backgrounds-lite/trunk/inoplugs_background_plugin.php
r681209 r690197 4 4 * Plugin URI: http://inoplugs.com 5 5 * Description: Set clickable fullsize background images for Posts/Pages | Get the Premium version here: <a href="http://inoplugs.com/wpbackgroundsII">WP-Backgrounds II</a> 6 * Author: InoPlugs | Peter Schoenmann6 * Author: InoPlugs 7 7 * Version: 2.2.5 8 8 * Author URI: http://inoplugs.com
Note: See TracChangeset
for help on using the changeset viewer.