Changeset 1720418
- Timestamp:
- 08/28/2017 09:13:28 AM (9 years ago)
- Location:
- floating-div
- Files:
-
- 9 added
- 4 edited
-
tags/3.0 (added)
-
tags/3.0/css (added)
-
tags/3.0/css/psfd.css (added)
-
tags/3.0/css/psfd_admin.css (added)
-
tags/3.0/js (added)
-
tags/3.0/js/psfd_colorpicker.js (added)
-
tags/3.0/js/psfd_media_cover.js (added)
-
tags/3.0/pluginlyspeaking-floatingdiv.php (added)
-
tags/3.0/readme.txt (added)
-
trunk/css/psfd.css (modified) (5 diffs)
-
trunk/css/psfd_admin.css (modified) (6 diffs)
-
trunk/pluginlyspeaking-floatingdiv.php (modified) (16 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
floating-div/trunk/css/psfd.css
r1608680 r1720418 1 .exp_floatdiv_container_pro { 2 cursor: pointer; 3 z-index:100; 4 position:fixed; 5 min-height:50px; 6 min-width:50px; 7 background-repeat: no-repeat; 8 background-position: center center; 9 background-size:100% 100%; 10 } 11 1 12 .exp_floatdiv_content_pro { 2 13 position:fixed; 3 padding:10px;4 14 z-index:100; 5 15 background-repeat: no-repeat; 6 16 background-position: center center; 7 17 background-size:100% 100%; 18 } 19 20 .exp_floatdiv_content_padding_pro { 21 padding:10px; 22 } 23 24 .exp_floatdiv_content_coll_pro { 25 position:fixed; 26 z-index:100; 27 background-repeat: no-repeat; 28 background-position: center center; 29 background-size:100% 100%; 30 } 31 32 .exp_floatdiv_content_coll_padding_pro { 33 padding:10px; 34 } 35 36 .exp_floatdiv_container_inside_pro { 37 height:25px; 38 width:25px; 39 cursor: pointer; 40 z-index:100; 41 float:right; 42 } 43 44 .exp_floatdiv_content_pro.psts_font_not_force { 45 font-family:"Trebuchet MS",Verdana,sans-serif; 46 } 47 48 .exp_floatdiv_content_coll_pro.psts_font_not_force { 8 49 font-family:"Trebuchet MS",Verdana,sans-serif; 9 50 } … … 12 53 @media only screen and (min-width : 769px) { 13 54 14 .psfd_width_160px{ 55 .psfd_no_desktop{display:none !important;} 56 57 .psfd_width_160px{ 15 58 width:160px; 16 59 } … … 36 79 /* Small Devices, Tablets */ 37 80 @media only screen and (min-width : 481px) and (max-width : 768px) { 38 .exp_floatdiv_content_pro { 81 82 .psfd_no_tablet{display:none !important;} 83 84 .exp_floatdiv_content_pro { 39 85 font-size:80%; 40 86 } … … 65 111 @media only screen and (max-width : 480px) { 66 112 67 .exp_floatdiv_content_pro { 113 .psfd_no_mobile{display:none !important;} 114 115 .exp_floatdiv_content_pro { 68 116 font-size:60%; 69 117 } … … 78 126 79 127 .psfd_width_260px{ 80 width:1 10px;128 width:120px; 81 129 } 82 130 83 131 .psfd_width_310px{ 84 width:1 30px;132 width:150px; 85 133 } 86 134 87 135 .psfd_width_360px{ 88 width: 160px;136 width:210px; 89 137 } 90 138 -
floating-div/trunk/css/psfd_admin.css
r1608680 r1720418 1 #psfd_content { 1 .psfd_radio_pleft { 2 margin-left:15px !important; 3 } 4 5 .psfd_radio_pright { 6 margin-right:5px !important; 7 } 8 9 .psfd_input_align_right { 10 text-align:right; 11 } 12 13 .psfd_input_small_width { 14 width:60px; 15 } 16 17 18 .psfd_if_appearing_active{ 19 display:none; 20 } 21 22 .psfd_if_disappearing_active{ 23 display:none; 24 } 25 26 .psfd_start_hidden{ 27 display:none; 28 } 29 30 #psfd_collapsible_settings { 31 display:none; 32 } 33 34 #psfdp_content { 2 35 height:250px; 3 36 } … … 7 40 } 8 41 9 .psfd_select_1 50p{10 width:1 50px;42 .psfd_select_125p{ 43 width:125px; 11 44 } 12 45 … … 20 53 } 21 54 22 .psfd_table_100 td{55 .psfd_table_100_label{ 23 56 vertical-align:middle; 24 width:50%;25 57 height:60px; 58 width:240px; 59 } 60 61 .psfd_table_100_input{ 62 vertical-align:middle; 63 height:60px; 64 width:200px; 26 65 } 27 66 … … 34 73 } 35 74 75 .psfd_table_settings td{ 76 height:60px; 77 } 78 36 79 .psfd_label_margins { 37 width:100px;38 80 display: block; 39 float:left; 40 padding-top:4px; 81 line-height:30px; 82 } 83 84 .psfd_back_image { 85 margin-top:-12px; 86 display:inline-block; 41 87 } 42 88 … … 54 100 } 55 101 56 #psfd _content_metabox h2 {102 #psfdp_content_metabox h2 { 57 103 font-size: 17px; 58 104 color: #0073aa; … … 72 118 } 73 119 74 #psfd _settings_metabox h2 {120 #psfdp_settings_metabox h2 { 75 121 font-size: 17px; 76 122 color: #0073aa; -
floating-div/trunk/pluginlyspeaking-floatingdiv.php
r1710933 r1720418 3 3 * Plugin Name: PluginlySpeaking FloatingDiv 4 4 * Plugin URI: http://pluginlyspeaking.com/plugins/floating-div/ 5 * Description: Create a simple div, floating up and down when the user is scrolling5 * Description: Sticky container, Floating Div is arguably the simplest way to show any type of content on a side of the screen that will remain visible as the user scrolls 6 6 * Author: PluginlySpeaking 7 * Version: 2.17 * Version: 3.0 8 8 * Author URI: http://www.pluginlyspeaking.com 9 9 * License: GPL2 10 10 */ 11 11 12 // Check for the PRO version13 add_action( 'admin_init', 'psfd_free_pro_check' );14 function psfd_free_pro_check() {15 if (is_plugin_active('pluginlyspeaking-floatingdiv-pro/pluginlyspeaking-floatingdiv-pro.php')) {16 17 function my_admin_notice(){18 echo '<div class="updated">19 <p>Floating Div <strong>PRO</strong> version is activated.</p>20 <p>Floating Div <strong>FREE</strong> version is desactivated.</p>21 </div>';22 }23 add_action('admin_notices', 'my_admin_notice');24 25 deactivate_plugins(__FILE__);26 }27 }28 29 12 add_action( 'wp_enqueue_scripts', 'psfd_add_script' ); 30 13 … … 32 15 wp_enqueue_style( 'psfd_css', plugins_url('css/psfd.css', __FILE__)); 33 16 wp_enqueue_script('jquery'); 17 wp_enqueue_script('jquery-effects-fold'); 18 wp_enqueue_script('jquery-effects-slide'); 19 wp_enqueue_script('jquery-effects-fade'); 20 wp_enqueue_script('jquery-effects-explode'); 21 wp_enqueue_script('jquery-effects-clip'); 34 22 } 35 23 … … 91 79 92 80 $prefix = '_floating_div_'; 81 93 82 $width = get_post_meta($post->ID, $prefix.'width',true); 94 if ($width == "")83 if($width == '') 95 84 $width = "260px"; 85 86 $all_pages = get_post_meta($post->ID, $prefix.'all_pages',true); 96 87 ?> 97 <table class="ps pt_table">88 <table class="psfd_table_settings"> 98 89 <tr> 99 90 <td colspan="2"><label for="width">Width of content : </label> … … 107 98 </td> 108 99 </tr> 109 </table> 110 100 <tr> 101 <td><label for="all_pages">Show on all pages : </label></td> 102 <td><input type="radio" id="all_pages_yes" name="all_pages" value="yes" <?php echo (empty($all_pages)) ? '' : psfd_check($all_pages,'yes'); ?>> Yes <input type="radio" id="all_pages_no" name="all_pages" value="no" <?php echo (empty($all_pages)) ? 'checked="checked"' : psfd_check($all_pages,'no'); ?>> No<br></td> 103 </tr> 104 </table> 111 105 <?php 112 106 … … 124 118 <ul style="list-style-type:disc;padding-left:20px;"> 125 119 <li>Get a collapsible content</li> 120 <li>Reveal your div after some time</li> 121 <li>Hide your div after some time</li> 122 <li>Fix your div after scrolling</li> 126 123 <li>Container location</li> 127 124 <li>Use your theme's font</li> … … 138 135 } 139 136 140 141 137 add_action('add_meta_boxes','psfd_init_content_metabox'); 142 138 … … 153 149 $margin_bottom = get_post_meta($post->ID, $prefix.'margin_bottom',true); 154 150 $margin_right = get_post_meta($post->ID, $prefix.'margin_right',true); 151 $margin_left = get_post_meta($post->ID, $prefix.'margin_left',true); 155 152 $borders = get_post_meta($post->ID, $prefix.'borders',true); 156 153 $border_color = get_post_meta($post->ID, $prefix.'border_color',true); … … 169 166 <table class="psfd_table_100"> 170 167 <tr> 168 <td class="psfd_table_100_label"> 169 <label for="position">Choose your floating div position : </label> 170 </td> 171 <td class="psfd_table_100_input"> 172 <select name="position" class="psfd_select_125p"> 173 <option <?php selected( $position, "top_right"); ?> id="psfd_position_top_right" value="top_right">Top Right</option> 174 <option <?php selected( $position, "top"); ?> id="psfd_position_top" value="top">Top</option> 175 <option <?php selected( $position, "top_left"); ?> id="psfd_position_top_left" value="top_left">Top Left</option> 176 <option <?php selected( $position, "bottom_right"); ?> id="psfd_position_bottom_right" value="bottom_right">Bottom Right</option> 177 <option <?php selected( $position, "bottom"); ?> id="psfd_position_bottom" value="bottom">Bottom</option> 178 <option <?php selected( $position, "bottom_left"); ?> id="psfd_position_bottom_left" value="bottom_left">Bottom Left</option> 179 </select> 180 </td> 181 <td class="psfd_table_100_label"> 182 <div class="psfd_div_margins psfd_div_margin_top"> 183 <label for="margin_top" class="psfd_label_margins" >Specify a margin Top : </label> 184 </div> 185 <div class="psfd_div_margins psfd_div_margin_bottom"> 186 <label for="margin_bottom" class="psfd_label_margins" >Specify a margin Bottom : </label> 187 </div> 188 <div class="psfd_div_margins psfd_div_margin_right"> 189 <label for="margin_right" class="psfd_label_margins" >Specify a margin Right : </label> 190 </div> 191 <div class="psfd_div_margins psfd_div_margin_left"> 192 <label for="margin_left" class="psfd_label_margins" >Specify a margin Left : </label> 193 </div> 194 </td> 195 <td class="psfd_table_100_input"> 196 <div class="psfd_div_margins psfd_div_margin_top"> 197 <input type="text" id="psfd_margin_top" class="psfd_input_align_right psfd_input_small_width" name="margin_top" value="<?php echo $margin_top; ?>" /> px 198 </div> 199 <div class="psfd_div_margins psfd_div_margin_bottom"> 200 <input type="text" id="psfd_margin_bottom" class="psfd_input_align_right psfd_input_small_width" name="margin_bottom" value="<?php echo $margin_bottom; ?>" /> px 201 </div> 202 <div class="psfd_div_margins psfd_div_margin_right"> 203 <input type="text" id="psfd_margin_right" class="psfd_input_align_right psfd_input_small_width" name="margin_right" value="<?php echo $margin_right; ?>" /> px 204 </div> 205 <div class="psfd_div_margins psfd_div_margin_left"> 206 <input type="text" id="psfd_margin_left" class="psfd_input_align_right psfd_input_small_width" name="margin_left" value="<?php echo $margin_left; ?>" /> px 207 </div> 208 </td> 171 209 <td> 172 <label for="position">Choose your content position : </label>173 174 <select name="position" class="psfd_select_150p">175 <option <?php selected( $position, "top_right"); ?> id="psfd_position_top_right" value="top_right">Top Right</option>176 <option <?php selected( $position, "bottom_right"); ?> id="psfd_position_bottom_right" value="bottom_right">Bottom Right</option>177 </select>178 </td>179 <td>180 <div id="psfd_div_margin_top" class="psfd_div_margins">181 <label for="margin_top" class="psfd_label_margins" >Margin Top : </label>182 <input type="text" id="psfd_margin_top" name="margin_top" placeholder="(in px) ex : 10 for 10px" value="<?php echo $margin_top; ?>" />183 </div>184 <div id="psfd_div_margin_bottom" class="psfd_div_margins">185 <label for="margin_bottom" class="psfd_label_margins" >Margin Bottom : </label>186 <input type="text" id="psfd_margin_bottom" name="margin_bottom" placeholder="(in px) ex : 10 for 10px" value="<?php echo $margin_bottom; ?>" />187 </div>188 <div id="psfd_div_margin_right" class="psfd_div_margins">189 <label for="margin_right" class="psfd_label_margins" >Margin Right : </label>190 <input type="text" id="psfd_margin_right" name="margin_right" placeholder="(in px) ex : 10 for 10px" value="<?php echo $margin_right; ?>" />191 </div>192 210 </td> 193 211 </tr> … … 196 214 197 215 198 <table class="psfd_table_100 _3td">216 <table class="psfd_table_100"> 199 217 <tr> 200 <td class="psfd_t d_label">218 <td class="psfd_table_100_label"> 201 219 <label for="corners">Do you want rounded corners ? </label> 202 220 </td> 203 <td class="psfd_td_thin"> 204 <input type="radio" id="corners_yes" name="corners" value="25px" <?php echo (empty($corners)) ? '' : psfd_check($corners,'25px'); ?>> Yes 205 <input type="radio" id="corners_no" name="corners" value="2px" <?php echo (empty($corners)) ? 'checked="checked"' : psfd_check($corners,'2px'); ?>> No 221 <td class="psfd_table_100_input"> 222 <input type="radio" id="corners_yes" name="corners" class="psfd_radio_pright" value="25px" <?php echo (empty($corners)) ? '' : psfd_check($corners,'25px'); ?>> Yes 223 <input type="radio" id="corners_no" name="corners" class="psfd_radio_pright psfd_radio_pleft" value="2px" <?php echo (empty($corners)) ? 'checked="checked"' : psfd_check($corners,'2px'); ?>> No 224 </td> 225 <td> 226 </td> 227 <td> 206 228 </td> 207 229 <td> … … 209 231 </tr> 210 232 <tr> 211 <td class="psfd_t d_label">233 <td class="psfd_table_100_label"> 212 234 <label for="borders">Do you want a border ? </label> 213 235 </td> 214 <td class="psfd_td_thin"> 215 <input type="radio" id="psfd_borders_yes" name="borders" value="yes" <?php echo (empty($borders)) ? 'checked="checked"' : psfd_check($borders,'yes'); ?>> Yes 216 <input type="radio" id="psfd_borders_no" name="borders" value="no" <?php echo (empty($borders)) ? '' : psfd_check($borders,'no'); ?>> No 236 <td class="psfd_table_100_input"> 237 <input type="radio" id="psfd_borders_yes" name="borders" class="psfd_radio_pright" value="yes" <?php echo (empty($borders)) ? 'checked="checked"' : psfd_check($borders,'yes'); ?>> Yes 238 <input type="radio" id="psfd_borders_no" name="borders" class="psfd_radio_pright psfd_radio_pleft" value="no" <?php echo (empty($borders)) ? '' : psfd_check($borders,'no'); ?>> No 239 </td> 240 <td class="psfd_table_100_label"> 241 <div class="psfd_border_color"> 242 <label for="border_color" class="psfd_label_colorpicker" >Choose your Border Color : </label> 243 </div> 244 </td> 245 <td class="psfd_table_100_input"> 246 <div class="psfd_border_color"> 247 <input id="border_color" name="border_color" type="text" value="<?php echo (empty($border_color)) ? '#000000' : $border_color; ?>" class="psfd_colorpicker" /> 248 </div> 217 249 </td> 218 250 <td> 219 <div id="psfd_border_color">220 <label for="border_color" class="psts_table_31_l" >Border Color : </label>221 <input id="border_color" name="border_color" type="text" value="<?php echo (empty($border_color)) ? '#000000' : $border_color; ?>" class="psfd_colorpicker" />222 </div>223 251 </td> 224 252 </tr> 225 253 <tr> 226 <td class="psfd_t d_label" >254 <td class="psfd_table_100_label" > 227 255 <label for="background">Choose your background type : </label> 228 256 </td> 229 <td class="psfd_t d_thin">230 <select name="background" class="psfd_select_1 50p">257 <td class="psfd_table_100_input"> 258 <select name="background" class="psfd_select_125p"> 231 259 <option <?php selected( $background, "color"); ?> id="psfd_background_color" value="color">Color</option> 232 260 <option <?php selected( $background, "image"); ?> id="psfd_background_image" value="image">Image</option> 233 261 </select> 234 262 </td> 235 <td> 236 <div id="psfd_div_background_color"> 237 <label for="background_color" class="psfd_label_colorpicker">Background Color : </label> 263 <td class="psfd_table_100_label"> 264 <div class="psfd_div_background_color"> 265 <label for="background_color" class="psfd_label_colorpicker">Choose your Background Color : </label> 266 </div> 267 <div class="psfd_div_background_image"> 268 <label for="image" class="psfd_back_image">Choose your Background Image : </label> 269 </div> 270 </td> 271 <td class="psfd_table_100_input"> 272 <div class="psfd_div_background_color"> 238 273 <input id="background_color" name="background_color" type="text" value="<?php echo (empty($background_color)) ? '#FFFFFF' : $background_color; ?>" class="psfd_colorpicker" /> 239 </div> 240 241 <div id="psfd_div_background_image"> 242 <label for="image">Background Image : </label> 274 </div> 275 <div class="psfd_div_background_image"> 243 276 <input type="text" name="image" id="psfd_media_background_image" value="<?php echo $image; ?>" /> 244 277 <input type="button" class="button background-image-button" value="Choose an image" /> 245 278 </div> 246 279 </td> 280 <td> 281 </td> 247 282 </tr> 248 </table> 249 283 </table> 250 284 251 285 <script type="text/javascript"> 252 286 $=jQuery.noConflict(); 253 287 jQuery(document).ready( function($) { 288 254 289 if($('#psfd_position_top_right').is(':selected')) { 255 $('#psfd_div_margin_top').show(); 256 $('#psfd_div_margin_bottom').hide(); 257 $('#psfd_div_margin_right').show(); 290 $('.psfd_div_margin_top').show(); 291 $('.psfd_div_margin_bottom').hide(); 292 $('.psfd_div_margin_right').show(); 293 $('.psfd_div_margin_left').hide(); 294 } 295 if($('#psfd_position_top').is(':selected')) { 296 $('.psfd_div_margin_top').show(); 297 $('.psfd_div_margin_bottom').hide(); 298 $('.psfd_div_margin_right').hide(); 299 $('.psfd_div_margin_left').hide(); 300 } 301 if($('#psfd_position_top_left').is(':selected')) { 302 $('.psfd_div_margin_top').show(); 303 $('.psfd_div_margin_bottom').hide(); 304 $('.psfd_div_margin_right').hide(); 305 $('.psfd_div_margin_left').show(); 258 306 } 259 307 if($('#psfd_position_bottom_right').is(':selected')) { 260 $('#psfd_div_margin_top').hide(); 261 $('#psfd_div_margin_bottom').show(); 262 $('#psfd_div_margin_right').show(); 308 $('.psfd_div_margin_top').hide(); 309 $('.psfd_div_margin_bottom').show(); 310 $('.psfd_div_margin_right').show(); 311 $('.psfd_div_margin_left').hide(); 312 } 313 if($('#psfd_position_bottom').is(':selected')) { 314 $('.psfd_div_margin_top').hide(); 315 $('.psfd_div_margin_bottom').show(); 316 $('.psfd_div_margin_right').hide(); 317 $('.psfd_div_margin_left').hide(); 318 } 319 if($('#psfd_position_bottom_left').is(':selected')) { 320 $('.psfd_div_margin_top').hide(); 321 $('.psfd_div_margin_bottom').show(); 322 $('.psfd_div_margin_right').hide(); 323 $('.psfd_div_margin_left').show(); 263 324 } 264 325 265 326 $('select[name=position]').live('change', function(){ 266 327 if($('#psfd_position_top_right').is(':selected')) { 267 $('#psfd_div_margin_top').show(); 268 $('#psfd_div_margin_bottom').hide(); 269 $('#psfd_div_margin_right').show(); 328 $('.psfd_div_margin_top').show(); 329 $('.psfd_div_margin_bottom').hide(); 330 $('.psfd_div_margin_right').show(); 331 $('.psfd_div_margin_left').hide(); 332 } 333 if($('#psfd_position_top').is(':selected')) { 334 $('.psfd_div_margin_top').show(); 335 $('.psfd_div_margin_bottom').hide(); 336 $('.psfd_div_margin_right').hide(); 337 $('.psfd_div_margin_left').hide(); 338 } 339 if($('#psfd_position_top_left').is(':selected')) { 340 $('.psfd_div_margin_top').show(); 341 $('.psfd_div_margin_bottom').hide(); 342 $('.psfd_div_margin_right').hide(); 343 $('.psfd_div_margin_left').show(); 270 344 } 271 345 if($('#psfd_position_bottom_right').is(':selected')) { 272 $('#psfd_div_margin_top').hide(); 273 $('#psfd_div_margin_bottom').show(); 274 $('#psfd_div_margin_right').show(); 275 } 276 }); 346 $('.psfd_div_margin_top').hide(); 347 $('.psfd_div_margin_bottom').show(); 348 $('.psfd_div_margin_right').show(); 349 $('.psfd_div_margin_left').hide(); 350 } 351 if($('#psfd_position_bottom').is(':selected')) { 352 $('.psfd_div_margin_top').hide(); 353 $('.psfd_div_margin_bottom').show(); 354 $('.psfd_div_margin_right').hide(); 355 $('.psfd_div_margin_left').hide(); 356 } 357 if($('#psfd_position_bottom_left').is(':selected')) { 358 $('.psfd_div_margin_top').hide(); 359 $('.psfd_div_margin_bottom').show(); 360 $('.psfd_div_margin_right').hide(); 361 $('.psfd_div_margin_left').show(); 362 } 363 }); 277 364 278 365 if($('#psfd_background_color').is(':selected')) { 279 $(' #psfd_div_background_color').show();280 $(' #psfd_div_background_image').hide();366 $('.psfd_div_background_color').show(); 367 $('.psfd_div_background_image').hide(); 281 368 } 282 369 if($('#psfd_background_image').is(':selected')) { 283 $(' #psfd_div_background_color').hide();284 $(' #psfd_div_background_image').show();370 $('.psfd_div_background_color').hide(); 371 $('.psfd_div_background_image').show(); 285 372 } 286 373 287 374 $('select[name=background]').live('change', function(){ 288 375 if($('#psfd_background_color').is(':selected')) { 289 $(' #psfd_div_background_color').show();290 $(' #psfd_div_background_image').hide();376 $('.psfd_div_background_color').show(); 377 $('.psfd_div_background_image').hide(); 291 378 } 292 379 if($('#psfd_background_image').is(':selected')) { 293 $(' #psfd_div_background_color').hide();294 $(' #psfd_div_background_image').show();380 $('.psfd_div_background_color').hide(); 381 $('.psfd_div_background_image').show(); 295 382 } 296 383 }); 297 384 298 385 if($('#psfd_borders_yes').is(':checked')) { 299 $(' #psfd_border_color').show();386 $('.psfd_border_color').show(); 300 387 } 301 388 if($('#psfd_borders_no').is(':checked')) { 302 $(' #psfd_border_color').hide();389 $('.psfd_border_color').hide(); 303 390 } 304 391 305 392 $('input[name=borders]').live('change', function(){ 306 393 if($('#psfd_borders_yes').is(':checked')) { 307 $(' #psfd_border_color').show();394 $('.psfd_border_color').show(); 308 395 } 309 396 if($('#psfd_borders_no').is(':checked')) { 310 $(' #psfd_border_color').hide();397 $('.psfd_border_color').hide(); 311 398 } 312 399 }); … … 315 402 316 403 <?php 404 317 405 318 406 } … … 344 432 } 345 433 } 434 346 435 add_action('save_post','psfd_save_metabox'); 347 436 function psfd_save_metabox($post_id){ … … 349 438 $prefix = '_floating_div_'; 350 439 440 //Metabox Settings 351 441 if(isset($_POST['width'])){ 352 442 update_post_meta($post_id, $prefix.'width', sanitize_text_field($_POST['width'])); 443 } 444 if(isset($_POST['all_pages'])){ 445 update_post_meta($post_id, $prefix.'all_pages', sanitize_text_field($_POST['all_pages'])); 353 446 } 354 447 … … 364 457 if(isset($_POST['margin_bottom'])){ 365 458 update_post_meta($post_id, $prefix.'margin_bottom', sanitize_text_field($_POST['margin_bottom'])); 459 } 460 if(isset($_POST['margin_left'])){ 461 update_post_meta($post_id, $prefix.'margin_left', sanitize_text_field($_POST['margin_left'])); 366 462 } 367 463 if(isset($_POST['margin_right'])){ … … 438 534 { 439 535 $prefix = '_floating_div_'; 440 $div_content = get_post_meta( get_the_id(), $prefix . 'content', true ); 441 $div_width = get_post_meta( get_the_id(), $prefix . 'width', true ); 442 if ($div_width == '') 443 $div_width = '260px'; 444 $div_width_class = "psfd_width_".$div_width; 445 446 $div_corners = get_post_meta( get_the_id(), $prefix . 'corners', true ); 447 $div_position = get_post_meta( get_the_id(), $prefix . 'position', true ); 448 if ($div_position == '') 449 $div_position = 'top_right'; 450 451 if ($div_position == 'top_right') 536 $all_pages = get_post_meta( get_the_id(), $prefix.'all_pages',true); 537 if ($all_pages == '') 538 $all_pages = 'no'; 539 540 if($all_pages == "no") 452 541 { 453 $div_margin_top = get_post_meta( get_the_id(), $prefix . 'margin_top', true ); 454 if ($div_margin_top == "") 455 $div_margin_top = 0; 456 } 457 if ($div_position == 'bottom_right') 458 { 459 $div_margin_bottom = get_post_meta( get_the_id(), $prefix . 'margin_bottom', true ); 460 if ($div_margin_bottom == "") 461 $div_margin_bottom = 0; 462 } 463 464 $div_margin_right = get_post_meta( get_the_id(), $prefix . 'margin_right', true ); 465 if ($div_margin_right == "") 466 $div_margin_right = 0; 467 468 $div_borders = get_post_meta( get_the_id(), $prefix.'borders',true); 469 $div_border_color = get_post_meta( get_the_id(), $prefix . 'border_color', true ); 470 471 if($div_borders == "yes" || $div_borders == "") 472 $border_class = 'border:2px solid '.$div_border_color.';'; 473 if($div_borders == "no") 474 $border_class = 'border-style: none;'; 475 476 $div_background = get_post_meta( get_the_id(), $prefix . 'background', true ); 477 478 if ($div_background == '') 479 $div_background = 'color'; 480 $background = 'background:#FFFFFF'; 481 if ($div_background == 'color') 482 { 483 $div_background_color = get_post_meta( get_the_id(), $prefix . 'background_color', true ); 484 $background = 'background:'.$div_background_color.''; 485 } 486 487 if ($div_background == 'image') 488 { 489 $div_image = get_post_meta( get_the_id(), $prefix.'image',true); 490 $background = 'background-image:url('.esc_attr($div_image).')'; 491 } 492 493 $postid = get_the_ID(); 494 495 $css_position = ''; 496 switch ($div_position) { 497 case 'top_right': 498 $css_position .= 'right:'.$div_margin_right.'px;'; 499 $css_position .= 'top:'.$div_margin_top.'px;'; 500 break; 501 case 'bottom_right': 502 $css_position .= 'right:'.$div_margin_right.'px;'; 503 $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 504 break; 505 default: 506 $css_position .= 'right:10px;'; 507 $css_position .= 'top:10px;'; 508 } 509 510 $output = ''; 511 512 $output .= '<div id="floatdiv_'.$postid.'" class="exp_floatdiv_content_pro '.$div_width_class.'" style="'.$css_position.';'.$border_class.'border-radius:'.esc_attr( $div_corners).';'.$background.';">'; 513 $output .= ''. psfd_get_wysiwyg_output_pro( $prefix . 'content', get_the_ID() ) .''; 514 $output .= '</div>'; 515 542 $div_content = get_post_meta( get_the_id(), $prefix . 'content', true ); 543 $div_width = get_post_meta( get_the_id(), $prefix . 'width', true ); 544 if ($div_width == '') 545 $div_width = '260px'; 546 $div_width_class = "psfd_width_".$div_width; 547 548 $div_corners = get_post_meta( get_the_id(), $prefix . 'corners', true ); 549 $div_position = get_post_meta( get_the_id(), $prefix . 'position', true ); 550 if ($div_position == '') 551 $div_position = 'top_right'; 552 if (in_array($div_position, array('top_right', 'top', 'top_left'), true)) 553 { 554 $div_margin_top = get_post_meta( get_the_id(), $prefix . 'margin_top', true ); 555 if ($div_margin_top == "") 556 $div_margin_top = 0; 557 } 558 if (in_array($div_position, array('top_right', 'bottom_right'), true)) 559 { 560 $div_margin_right = get_post_meta( get_the_id(), $prefix . 'margin_right', true ); 561 if ($div_margin_right == "") 562 $div_margin_right = 0; 563 } 564 if (in_array($div_position, array('top_left', 'bottom_left'), true)) 565 { 566 $div_margin_left = get_post_meta( get_the_id(), $prefix . 'margin_left', true ); 567 if ($div_margin_left == "") 568 $div_margin_left = 0; 569 } 570 if (in_array($div_position, array('bottom_right', 'bottom', 'bottom_left'), true)) 571 { 572 $div_margin_bottom = get_post_meta( get_the_id(), $prefix . 'margin_bottom', true ); 573 if ($div_margin_bottom == "") 574 $div_margin_bottom = 0; 575 } 576 577 $div_borders = get_post_meta( get_the_id(), $prefix.'borders',true); 578 $div_border_color = get_post_meta( get_the_id(), $prefix . 'border_color', true ); 579 if($div_border_color == "") 580 $div_border_color = '#000000'; 581 582 if($div_borders == "yes" || $div_borders == "") 583 $border_class = 'border:2px solid '.$div_border_color.''; 584 585 if($div_borders == "no") 586 $border_class = "border-style:none"; 587 588 $div_background = get_post_meta( get_the_id(), $prefix . 'background', true ); 589 590 if ($div_background == '') 591 $div_background = 'color'; 592 $background = 'background:#FFFFFF'; 593 if ($div_background == 'color') 594 { 595 $div_background_color = get_post_meta( get_the_id(), $prefix . 'background_color', true ); 596 if($div_background_color == "") 597 $div_background_color = '#FFFFFF'; 598 $background = 'background:'.$div_background_color.''; 599 } 600 601 if ($div_background == 'image') 602 { 603 $div_image = get_post_meta( get_the_id(), $prefix.'image',true); 604 $background = 'background-image:url('.esc_attr($div_image).')'; 605 } 606 607 $postid = get_the_ID(); 608 609 $css_position = ''; 610 switch ($div_position) { 611 case 'top_right': 612 $css_position .= 'right:'.$div_margin_right.'px;'; 613 $css_position .= 'top:'.$div_margin_top.'px;'; 614 break; 615 case 'top': 616 $css_position .= 'top:'.$div_margin_top.'px;'; 617 $css_position .= 'left:50%;margin-left:-'. $div_width / 2 . 'px;'; 618 break; 619 case 'top_left': 620 $css_position .= 'left:'.$div_margin_left.'px;'; 621 $css_position .= 'top:'.$div_margin_top.'px;'; 622 break; 623 case 'bottom_right': 624 $css_position .= 'right:'.$div_margin_right.'px;'; 625 $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 626 break; 627 case 'bottom': 628 $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 629 $css_position .= 'left:50%;margin-left:-'. $div_width / 2 . 'px;'; 630 break; 631 case 'bottom_left': 632 $css_position .= 'left:'.$div_margin_left.'px;'; 633 $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 634 break; 635 default: 636 $css_position .= 'right:10px;'; 637 $css_position .= 'top:10px;'; 638 } 639 $output = ''; 640 641 $output .= '<div id="floatdiv_'.$postid.'" class="exp_floatdiv_content_pro '.$device_restrict_no_tablet.' '.$device_restrict_no_desktop.' '.$device_restrict_no_mobile.' '.$force_font_class.' '.$div_width_class.'" style="'.$css_position.';border-radius:'.esc_attr( $div_corners).';'.$background.';">'; 642 $output .= '<div class="exp_floatdiv_content_padding_pro" style="'.$border_class.';border-radius:'.esc_attr( $div_corners).';">'; 643 $output .= ''. psfd_get_wysiwyg_output_pro( $prefix . 'content', get_the_ID() ) .''; 644 $output .= '</div>'; 645 $output .= '</div>'; 646 647 $output .= '<script type="text/javascript">'; 648 $output .= '$j=jQuery.noConflict();'; 649 $output .= '$j(document).ready(function()'; 650 $output .= '{'; 651 $output .= '$j("#floatdiv_'.$postid.'").appendTo("body");'; 652 $output .= 'var height = $j("#floatdiv_'.$postid.'").height();'; 653 $output .= '$j("#floatdiv_'.$postid.'").height(height);'; 654 $output .= '})'; 655 $output .= '</script>'; 656 } 657 516 658 } 517 659 endforeach; wp_reset_query(); … … 520 662 add_shortcode( 'floating_div_ps', 'psfd_shortcode' ); 521 663 664 function psfd_footer() { 665 global $post; 666 $args = array('post_type' => 'floating_div_ps', 'numberposts'=>-1); 667 $custom_posts = get_posts($args); 668 $output = ''; 669 foreach($custom_posts as $post) : setup_postdata($post); 670 671 $prefix = '_floating_div_'; 672 $all_pages = get_post_meta( get_the_id(), $prefix.'all_pages',true); 673 if ($all_pages == '') 674 $all_pages = 'no'; 675 676 if($all_pages == "yes") 677 { 678 $div_content = get_post_meta( get_the_id(), $prefix . 'content', true ); 679 $div_width = get_post_meta( get_the_id(), $prefix . 'width', true ); 680 if ($div_width == '') 681 $div_width = '260px'; 682 $div_width_class = "psfd_width_".$div_width; 683 684 $div_corners = get_post_meta( get_the_id(), $prefix . 'corners', true ); 685 $div_position = get_post_meta( get_the_id(), $prefix . 'position', true ); 686 if ($div_position == '') 687 $div_position = 'top_right'; 688 if (in_array($div_position, array('top_right', 'top', 'top_left'), true)) 689 { 690 $div_margin_top = get_post_meta( get_the_id(), $prefix . 'margin_top', true ); 691 if ($div_margin_top == "") 692 $div_margin_top = 0; 693 } 694 if (in_array($div_position, array('top_right', 'bottom_right'), true)) 695 { 696 $div_margin_right = get_post_meta( get_the_id(), $prefix . 'margin_right', true ); 697 if ($div_margin_right == "") 698 $div_margin_right = 0; 699 } 700 if (in_array($div_position, array('top_left', 'bottom_left'), true)) 701 { 702 $div_margin_left = get_post_meta( get_the_id(), $prefix . 'margin_left', true ); 703 if ($div_margin_left == "") 704 $div_margin_left = 0; 705 } 706 if (in_array($div_position, array('bottom_right', 'bottom', 'bottom_left'), true)) 707 { 708 $div_margin_bottom = get_post_meta( get_the_id(), $prefix . 'margin_bottom', true ); 709 if ($div_margin_bottom == "") 710 $div_margin_bottom = 0; 711 } 712 713 $div_borders = get_post_meta( get_the_id(), $prefix.'borders',true); 714 $div_border_color = get_post_meta( get_the_id(), $prefix . 'border_color', true ); 715 if($div_border_color == "") 716 $div_border_color = '#000000'; 717 718 if($div_borders == "yes" || $div_borders == "") 719 $border_class = 'border:2px solid '.$div_border_color.''; 720 721 if($div_borders == "no") 722 $border_class = "border-style:none"; 723 724 $div_background = get_post_meta( get_the_id(), $prefix . 'background', true ); 725 726 if ($div_background == '') 727 $div_background = 'color'; 728 $background = 'background:#FFFFFF'; 729 if ($div_background == 'color') 730 { 731 $div_background_color = get_post_meta( get_the_id(), $prefix . 'background_color', true ); 732 if($div_background_color == "") 733 $div_background_color = '#FFFFFF'; 734 $background = 'background:'.$div_background_color.''; 735 } 736 737 if ($div_background == 'image') 738 { 739 $div_image = get_post_meta( get_the_id(), $prefix.'image',true); 740 $background = 'background-image:url('.esc_attr($div_image).')'; 741 } 742 743 $postid = get_the_ID(); 744 745 $css_position = ''; 746 switch ($div_position) { 747 case 'top_right': 748 $css_position .= 'right:'.$div_margin_right.'px;'; 749 $css_position .= 'top:'.$div_margin_top.'px;'; 750 break; 751 case 'top': 752 $css_position .= 'top:'.$div_margin_top.'px;'; 753 $css_position .= 'left:50%;margin-left:-'. $div_width / 2 . 'px;'; 754 break; 755 case 'top_left': 756 $css_position .= 'left:'.$div_margin_left.'px;'; 757 $css_position .= 'top:'.$div_margin_top.'px;'; 758 break; 759 case 'bottom_right': 760 $css_position .= 'right:'.$div_margin_right.'px;'; 761 $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 762 break; 763 case 'bottom': 764 $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 765 $css_position .= 'left:50%;margin-left:-'. $div_width / 2 . 'px;'; 766 break; 767 case 'bottom_left': 768 $css_position .= 'left:'.$div_margin_left.'px;'; 769 $css_position .= 'bottom:'.$div_margin_bottom.'px;'; 770 break; 771 default: 772 $css_position .= 'right:10px;'; 773 $css_position .= 'top:10px;'; 774 } 775 776 $output = ''; 777 778 $output .= '<div id="floatdiv_'.$postid.'" class="exp_floatdiv_content_pro '.$device_restrict_no_tablet.' '.$device_restrict_no_desktop.' '.$device_restrict_no_mobile.' '.$force_font_class.' '.$div_width_class.'" style="'.$css_position.';border-radius:'.esc_attr( $div_corners).';'.$background.';">'; 779 $output .= '<div class="exp_floatdiv_content_padding_pro" style="'.$border_class.';border-radius:'.esc_attr( $div_corners).';">'; 780 $output .= ''. psfd_get_wysiwyg_output_pro( $prefix . 'content', get_the_ID() ) .''; 781 $output .= '</div>'; 782 $output .= '</div>'; 783 784 $output .= '<script type="text/javascript">'; 785 $output .= '$j=jQuery.noConflict();'; 786 $output .= '$j(document).ready(function()'; 787 $output .= '{'; 788 $output .= '$j("#floatdiv_'.$postid.'").appendTo("body");'; 789 $output .= 'var height = $j("#floatdiv_'.$postid.'").height();'; 790 $output .= '$j("#floatdiv_'.$postid.'").height(height);'; 791 792 $output .= '})'; 793 $output .= '</script>'; 794 795 } 796 797 endforeach; wp_reset_query(); 798 echo $output; 799 } 800 add_action( 'wp_footer', 'psfd_footer' ); 801 522 802 523 803 -
floating-div/trunk/readme.txt
r1710932 r1720418 4 4 Requires at least: 3.6 5 5 Tested up to: 4.8.1 6 Stable tag: 2.16 Stable tag: 3.0 7 7 License: GPL2 8 8 License URI: http://www.gnu.org/licenses/gpl.html … … 42 42 43 43 1. Make your div collapsible. 44 2. There will be different location for the div (top right, bottom, etc…). 45 3. Use your own theme font. 46 4. Show/hide the table for different types of devices (desktop computer, tablets, smartphones). 47 5. Choose who sees what. Only allow Guest/Logged In users to see the table. 48 6. A Technical support for setting up and implementing the plugin. 49 7. That's where you will find the [PRO version](http://pluginlyspeaking.com/plugins/floating-div/) 44 2. Reveal your div after some time. 45 3. Hide your div after some time. 46 4. There will be different location for the div (top right, bottom, etc…). 47 5. Use your own theme font. 48 6. Show/hide the floating div for different types of devices (desktop computer, tablets, smartphones). 49 7. Choose who sees what. Only allow Guest/Logged In users to see the floating div. 50 8. A Technical support for setting up and implementing the plugin. 51 9. That's where you will find the [PRO version](http://pluginlyspeaking.com/plugins/floating-div/) 50 52 51 53 = Here is an example of the possible uses : = … … 78 80 == Changelog == 79 81 82 = 3.0 = 83 * Show on all pages feature 84 * Minors css updates 85 80 86 = 2.0.1 = 81 87 * Minors css updates
Note: See TracChangeset
for help on using the changeset viewer.