Changeset 1914880
- Timestamp:
- 07/25/2018 03:46:53 PM (8 years ago)
- Location:
- ultimate-popunder/trunk
- Files:
-
- 3 edited
-
functions.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
-
ultimate-popunder.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ultimate-popunder/trunk/functions.php
r1747546 r1914880 49 49 $popLength = isset( $options['ultimate_popunder_text_poplength'] ) ? intval( $options['ultimate_popunder_text_poplength'] ) : 30; 50 50 $popMax = isset( $options['ultimate_popunder_text_popmax'] ) ? intval( $options['ultimate_popunder_text_popmax'] ) : 1; 51 52 51 53 52 54 $sql = " … … 66 68 { 67 69 $post_meta = get_post_meta( $obj_post->post_id ); 68 $content .= "[\"{$post_meta['_popunder_url'][0]}\", {$post_meta['_popunder_priority'][0]}],"; 70 71 // Show it to everyone 72 if ($post_meta['_popunder_post_visible'][0] == '*') 73 { 74 $content .= "[\"{$post_meta['_popunder_url'][0]}\", {$post_meta['_popunder_priority'][0]}],"; 75 } 76 77 // Show it to only those not logged in 78 if ($post_meta['_popunder_post_visible'][0] == 'guest' && ! is_user_logged_in()) 79 { 80 $content .= "[\"{$post_meta['_popunder_url'][0]}\", {$post_meta['_popunder_priority'][0]}],"; 81 } 82 83 // Show it to only those logged in 84 if ($post_meta['_popunder_post_visible'][0] == 'member' && is_user_logged_in()) 85 { 86 $content .= "[\"{$post_meta['_popunder_url'][0]}\", {$post_meta['_popunder_priority'][0]}],"; 87 } 69 88 } 70 89 $content .= "];"; … … 204 223 update_post_meta( $post_id, '_popunder_post_type', sanitize_text_field( $_POST['_popunder_post_type'] ) ); 205 224 225 if( isset( $_POST['_popunder_post_visible'] ) ) 226 update_post_meta( $post_id, '_popunder_post_visible', sanitize_text_field( $_POST['_popunder_post_visible'] ) ); 227 206 228 if( isset( $_POST['_popunder_priority'] ) ) 207 229 update_post_meta( $post_id, '_popunder_priority', intval( $_POST['_popunder_priority'] ) ); … … 222 244 $pop_post_type = isset( $values['_popunder_post_type'] ) ? esc_attr( $values['_popunder_post_type'][0] ) : ''; 223 245 $pop_priority = isset( $values['_popunder_priority'] ) ? esc_attr( $values['_popunder_priority'][0] ) : '10'; 246 $pop_visibility = isset( $values['_popunder_post_visible'] ) ? esc_attr( $values['_popunder_post_visible'][0] ) : '*'; 224 247 225 248 wp_nonce_field( 'popunder_meta_box_nonce', 'popunder_post_meta_nonce' ); … … 235 258 <th style="text-align:left;"><label for="_popunder_url">URL</label></th> 236 259 <th style="text-align:left;"><label for="_popunder_post_type">Post Type</label></th> 260 <th style="text-align:left;"><label for="_popunder_post_visible">Visibility</label></th> 237 261 <th style="text-align:left;"><label for="_popunder_priority">Priority</label></th> 238 262 </tr> … … 241 265 <tbody> 242 266 <tr> 243 <td style="width: 75%;padding-right:10px">267 <td style="width:55%;padding-right:10px"> 244 268 <input class="regular-text code" style="width:100%;" type="text" name="_popunder_url" id="_popunder_url" value="<?php echo $pop_url; ?>" /> 245 269 </td> … … 265 289 </td> 266 290 <td style="width:15%;padding-right:10px"> 291 <select name="_popunder_post_visible" id="_popunder_post_visible" style="width:100%;"> 292 <option value="*"<?php if ($pop_visibility === "*") echo ' selected="selected"'; ?>>everyone</option> 293 <?php 294 $arr_visible_users = ['guest','member']; 295 foreach ($arr_visible_users as $str_user_type) 296 { 297 if ($str_user_type === $pop_visibility) 298 { 299 ?><option value="<?php echo $str_user_type; ?>" selected="selected"><?php echo $str_user_type; ?></option><?php 300 } 301 else 302 { 303 ?><option value="<?php echo $str_user_type; ?>"><?php echo $str_user_type; ?></option><?php 304 } 305 } 306 ?> 307 </select> 308 </td> 309 <td style="width:15%;padding-right:10px"> 267 310 <input style="width:100%;" type="number" name="_popunder_priority" id="_popunder_priority" onkeypress="return event.charCode >= 48 && event.charCode <= 57" value="<?php echo $pop_priority; ?>" /> 268 311 </td> -
ultimate-popunder/trunk/readme.txt
r1776494 r1914880 4 4 Donate link: paypal.me/GriffithDesignsMD 5 5 Requires at least: 4.0 6 Tested up to: 4.9 6 Tested up to: 4.9.7 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 34 34 35 35 == Changelog == 36 = 1.2.5 = 37 * Added ability to restrict popunder to the user's state: 38 * everyone 39 * not logged in (guest) 40 * logged in (member) 41 36 42 = 1.2.4 = 37 43 * Fix Content Closure -
ultimate-popunder/trunk/ultimate-popunder.php
r1747546 r1914880 5 5 Plugin URI: # 6 6 Description: Be able to create any popunder AD for your site, and track the activity in 3rd party systems as well. 7 Version: 1.2. 47 Version: 1.2.5 8 8 Author: Cris Griffith 9 9 Author URI: https://profiles.wordpress.org/webmasterjunkie … … 13 13 defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 14 14 15 define( 'ULTIMATE_POPUNDER_VERSION', '1.2. 4' );15 define( 'ULTIMATE_POPUNDER_VERSION', '1.2.5' ); 16 16 17 17 require_once( plugin_dir_path( __FILE__ ) . "functions.php" );
Note: See TracChangeset
for help on using the changeset viewer.