Plugin Directory

Changeset 1426244


Ignore:
Timestamp:
05/29/2016 06:01:36 AM (10 years ago)
Author:
joshlimecuda
Message:

version 1.1.0

Location:
ownerauthor-ad-split-for-genesis/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • ownerauthor-ad-split-for-genesis/trunk

    • Property svn:ignore set to
      deploy.sh
      README.md
      .git
      .gitignore
  • ownerauthor-ad-split-for-genesis/trunk/admin/Global_Settings.php

    r1422584 r1426244  
    119119        add_meta_box( 'aoas_default_settings', __( 'Defaults', 'adsense_owner_author_split' ), array( $this, 'default_settings' ), $this->pagehook, 'main' );
    120120        add_meta_box( 'aoas_above_ad_settings', __( 'Above-Content Ad', 'adsense_owner_author_split' ), array( $this, 'above_ad' ), $this->pagehook, 'main' );
     121        add_meta_box( 'aoas_shortcode_ad_settings', __( 'Content Ad', 'adsense_owner_author_split' ), array( $this, 'shortcode_ad' ), $this->pagehook, 'main' );
    121122        add_meta_box( 'aoas_below_ad_settings', __( 'Below-Content Ad', 'adsense_owner_author_split' ), array( $this, 'below_ad' ), $this->pagehook, 'main' );
    122         add_meta_box( 'aoas_shortcode_ad_settings', __( 'Shortcode Ad', 'adsense_owner_author_split' ), array( $this, 'shortcode_ad' ), $this->pagehook, 'main' );
    123123    }
    124124
     
    172172
    173173                <tr valign="top">
    174                     <th scope="row"><label for="owner_above_adsense_code"><?php _e( 'Above-Content Adsense Code', 'adsense_owner_author_split' ); ?></label></th>
     174                    <th scope="row"><label for="owner_above_adsense_code"><?php _e( 'Above-Content Ad Code', 'adsense_owner_author_split' ); ?></label></th>
    175175                    <td>
    176176                        <p><textarea name="<?php echo $this->get_field_name( 'owner_above_adsense_code' ); ?>" class="regular-text" id="owner_above_adsense_code" cols="78" rows="8"><?php echo esc_attr( $this->get_field_value( 'owner_above_adsense_code' ) ); ?></textarea></p>
     
    193193
    194194    /**
     195     * Build the fields for the shortcode ad metabox
     196     *
     197     * @since     1.0.0
     198     * @access    public
     199     */
     200    public function shortcode_ad() {
     201
     202        $shortcode = '<code>[gb_ad]</code>';
     203        ?>
     204
     205        <table class="form-table">
     206            <tbody>
     207
     208                <tr valign="top">
     209                    <th scope="row"><label for="owner_shortcode_adsense_code"><?php _e( 'Content Ad Code', 'adsense_owner_author_split' ); ?></label></th>
     210                    <td>
     211                        <p><textarea name="<?php echo $this->get_field_name( 'owner_shortcode_adsense_code' ); ?>" class="regular-text" id="owner_shortcode_adsense_code" cols="78" rows="8"><?php echo esc_attr( $this->get_field_value( 'owner_shortcode_adsense_code' ) ); ?></textarea></p>
     212                    </td>
     213                </tr>
     214
     215                <tr valign="top">
     216                    <th scope="row"><label for="owner_shortcode_weight"><?php _e( 'Weight', 'adsense_owner_author_split' ); ?></label></th>
     217                    <td>
     218                        <p><input type="range" min="0" max="10" step="1" name="<?php echo $this->get_field_name( 'owner_shortcode_weight' ); ?>" class="regular-text" id="owner_shortcode_weight" value="<?php echo esc_attr( $this->get_field_value( 'owner_shortcode_weight' ) ); ?>" oninput="outputUpdate('#owner_shortcode_weight_output', value)" /></p>
     219                        <p class="description">Show the Owner's ad in the shortcode for every <strong><output for="owner_shortcode_weight" id="owner_shortcode_weight_output"><?php echo esc_attr( $this->get_field_value( 'owner_shortcode_weight' ) ); ?></output></strong> out of 10 page loads</p>
     220                    </td>
     221                </tr>
     222
     223                <tr valign="top">
     224                    <th scope="row"></th>
     225                    <td>
     226                        <p class="description"><?php printf( esc_html__( 'Include content ad within your content by using the %s shortcode', 'adsense_owner_author_split' ), $shortcode ); ?></p>
     227                    </td>
     228                </tr>
     229
     230            </tbody>
     231        </table>
     232
     233    <?php
     234    }
     235
     236    /**
    195237     * Build the fields for the below ad metabox
    196238     *
     
    204246
    205247                <tr valign="top">
    206                     <th scope="row"><label for="owner_below_adsense_code"><?php _e( 'Below-Content Adsense Code', 'adsense_owner_author_split' ); ?></label></th>
     248                    <th scope="row"><label for="owner_below_adsense_code"><?php _e( 'Below-Content Ad Code', 'adsense_owner_author_split' ); ?></label></th>
    207249                    <td>
    208250                        <p><textarea name="<?php echo $this->get_field_name( 'owner_below_adsense_code' ); ?>" class="regular-text" id="owner_above_adsense_code" cols="78" rows="8"><?php echo esc_attr( $this->get_field_value( 'owner_below_adsense_code' ) ); ?></textarea></p>
     
    219261
    220262            </tbody>
    221         </table>
    222 
    223     <?php
    224     }
    225 
    226     /**
    227      * Build the fields for the shortcode ad metabox
    228      *
    229      * @since     1.0.0
    230      * @access    public
    231      */
    232     public function shortcode_ad() { ?>
    233 
    234         <table class="form-table">
    235             <tbody>
    236 
    237                 <tr valign="top">
    238                     <th scope="row"><label for="owner_shortcode_adsense_code"><?php _e( 'Shortcode Adsense Code', 'adsense_owner_author_split' ); ?></label></th>
    239                     <td>
    240                         <p><textarea name="<?php echo $this->get_field_name( 'owner_shortcode_adsense_code' ); ?>" class="regular-text" id="owner_shortcode_adsense_code" cols="78" rows="8"><?php echo esc_attr( $this->get_field_value( 'owner_shortcode_adsense_code' ) ); ?></textarea></p>
    241                     </td>
    242                 </tr>
    243 
    244                 <tr valign="top">
    245                     <th scope="row"><label for="owner_shortcode_weight"><?php _e( 'Weight', 'adsense_owner_author_split' ); ?></label></th>
    246                     <td>
    247                         <p><input type="range" min="0" max="10" step="1" name="<?php echo $this->get_field_name( 'owner_shortcode_weight' ); ?>" class="regular-text" id="owner_shortcode_weight" value="<?php echo esc_attr( $this->get_field_value( 'owner_shortcode_weight' ) ); ?>" oninput="outputUpdate('#owner_shortcode_weight_output', value)" /></p>
    248                         <p class="description">Show the Owner's ad in the shortcode for every <strong><output for="owner_shortcode_weight" id="owner_shortcode_weight_output"><?php echo esc_attr( $this->get_field_value( 'owner_shortcode_weight' ) ); ?></output></strong> out of 10 page loads</p>
    249                     </td>
    250                 </tr>
    251 
    252             </tbody>
     263
    253264        </table>
    254265
  • ownerauthor-ad-split-for-genesis/trunk/admin/Post_Metabox.php

    r1422584 r1426244  
    4444            return;
    4545
    46         add_meta_box( 'gb_post_ad_control', __( 'Adsense Owner/Author Split', 'adsense-owner-author-split' ), array( $this, 'metabox_options' ), 'post', 'side', 'high' );
     46        add_meta_box( 'gb_post_ad_control', __( 'Automatic Ad Blocks', 'adsense-owner-author-split' ), array( $this, 'metabox_options' ), 'post', 'side', 'high' );
    4747    }
    4848
     
    8080                            <label for="gb_adsense_hide_content_ads">
    8181                            <select name="gb_adsense_hide_content_ads" id="gb_adsense_hide_content_ads" default="">
    82                                 <option value="show-ads" <?php echo ( $show_selected ) ? 'selected' : ''; ?>>Show Ads on Post</option>
    83                                 <option value="hide-ads" <?php echo ( $hide_selected ) ? 'selected' : ''; ?>>Hide Ads on Post</option>
     82                                <option value="show-ads" <?php echo ( $show_selected ) ? 'selected' : ''; ?>><?php _e( 'Show Automatic Ads on Post', 'adsense-owner-author-split' ); ?></option>
     83                                <option value="hide-ads" <?php echo ( $hide_selected ) ? 'selected' : ''; ?>><?php _e( 'Hide Automatic Ads on Post', 'adsense-owner-author-split' ); ?></option>
    8484                            </select>
    8585                            </label>
     86                        </p>
     87                    </td>
     88                </tr>
     89
     90                <tr valign="top">
     91                    <td>
     92                        <p class="description">
     93                            <?php
     94                                _e( 'This option determines whether the automatic above and below content ads will display on this post', 'adsense-owner-author-split' );
     95                            ?>
     96                        </p>
     97                    </td>
     98                </tr>
     99
     100                <tr valign="top">
     101                    <td>
     102                        <p>
     103                            <?php $this->update_ad_codes(); ?>
    86104                        </p>
    87105                    </td>
     
    120138    }
    121139
     140    /**
     141     * Prompt users that can save their profile ads to include them
     142     * if they haven't been added yet
     143     *
     144     * @since     1.1.0
     145     * @access    public
     146     */
     147    public function update_ad_codes() {
     148
     149        if( ! current_user_can( 'unfiltered_html' ) )
     150            return;
     151
     152        $profile_link = get_edit_user_link( get_current_user_id() );
     153
     154        echo '<a href="' . $profile_link . '#aoas-profile-settings" target="_blank">' . __( 'Update Your Ad Codes', 'adsense-owner-author-split') . '</a>';
     155
     156    }
     157
    122158}
  • ownerauthor-ad-split-for-genesis/trunk/admin/User_Profile_Setting.php

    r1422584 r1426244  
    4141    public static function user_meta( $user ) { ?>
    4242
    43         <h3><?php echo __( 'Adsense Owner/Author Split', 'adsense_owner_author_split' ); ?></h3>
     43        <h3 id="aoas-profile-settings"><?php echo __( 'Adsense Owner/Author Split', 'adsense_owner_author_split' ); ?></h3>
    4444
    4545        <table class="form-table">
  • ownerauthor-ad-split-for-genesis/trunk/adsense-owner-author-split.php

    r1422584 r1426244  
    77 * Plugin URI:      https://github.com/BeardedGinger/adsense-owner-author-split
    88 * Description:     Built specifically for use with the Genesis Framework, split ad space with post author and set how often your ad displays vs the post author's ad
    9  * Version:         1.0.0
     9 * Version:         1.1.0
    1010 * Author:          Josh Mallard
    1111 * Author URI:      http://gingercult.com
  • ownerauthor-ad-split-for-genesis/trunk/includes/Main.php

    r1422584 r1426244  
    5858        require plugin_dir_path( __FILE__ ) . 'Content_Ads.php';
    5959
    60         add_action( 'genesis_entry_content', array( $this, 'before_content_ad' ), 0 );
    61         add_action( 'genesis_entry_content', array( $this, 'below_content_ad' ), 10 );
     60        add_action( 'genesis_entry_content', array( $this, 'before_content_ad' ), apply_filters( 'above_content_ad_priority', 0 ) );
     61        add_action( 'genesis_entry_content', array( $this, 'below_content_ad' ), apply_filters( 'below_content_ad_priority', 10 ) );
    6262
    6363    }
  • ownerauthor-ad-split-for-genesis/trunk/readme.txt

    r1423606 r1426244  
    55Requires at least: 4.2
    66Tested up to: 4.5.2
    7 Stable tag: 1.0.0
     7Stable tag: 1.1.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5353
    5454Set the site owner ads and display weight
    55 Set the post author ads on their profile page 
     55Set the post author ads on their profile page
    5656
    5757== Changelog ==
     58
     59= 1.1.0 =
     60* Update shortcode ad wording to "Content Ad"
     61* Added shortcode reference to global settings page
     62* Update title and wording on postmeta box
     63* Made select options on postmeta box translatable
     64* Added post metabox prompt to update ad codes
     65* Added filters (above_content_ad_priority and below_content_ad_priority) for changing the priority on the automatic content ads
    5866
    5967= 1.0.0 =
Note: See TracChangeset for help on using the changeset viewer.