Plugin Directory

Changeset 1576964

Timestamp:
01/18/2017 02:56:33 AM (8 years ago)
Author:
derekspringer
Message:

1.2 release

Location:
radcontrol/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • radcontrol/trunk/adcontrol.php

    r1528300 r1576964  
    66Description: Harness WordPress.com's advertising partners for your own website. Requires <a href="http://jetpack.me/" target="_blank">Jetpack</a> to be installed and connected.
    77Author: Automattic
    8 Version: 1.1.3
     8Version: 1.
    99Author URI: http://automattic.com
    1010Text Domain: adcontrol
     
    2828*/
    2929
    30 define( 'ADCONTROL_VERSION', '1.1.3' );
     30define( 'ADCONTROL_VERSION', '1.' );
    3131define( 'ADCONTROL_ROOT', dirname( __FILE__ ) );
    3232define( 'ADCONTROL_BASENAME', plugin_basename( __FILE__ ) );
     
    232232        }
    233233
    234         return $content . $this->get_ad( 'belowpost' );
     234        $ad_type = $this->option( 'wordads_house', true ) ? 'house' : 'iponweb';
     235        return $content . $this->get_ad( 'belowpost', $ad_type );
    235236    }
    236237
     
    254255
    255256        if ( ! $this->params->mobile_device || $this->option( 'leaderboard_mobile', true ) ) {
    256             echo $this->get_ad( 'top' );
     257            $ad_type = $this->option( 'wordads_house', true ) ? 'house' : 'iponweb';
     258            echo $this->get_ad( 'top', $ad_type );
    257259        }
    258260    }
     
    285287            </script>
    286288HTML;
    287         }
    288 
    289         $about = __( 'About these ads', 'adcontrol' );
     289        } else if ( 'house' == $type ) {
     290            $width = 300;
     291            $height = 250;
     292            $ad_url = 'https://s0.wp.com/wp-content/blog-plugins/wordads/house/';
     293            if ( 'top' == $spot && ! $this->params->mobile_device ) {
     294                $width = 728;
     295                $height = 90;
     296                $ad_url .= 'leaderboard.png';
     297            } else {
     298                $ad_url .= 'mrec.png';
     299            }
     300
     301            $snippet = <<<HTML
     302            <a href="https://wordpress.com/create/" target="_blank">
     303                <img src="$ad_url" alt="WordPress.com: Grow Your Business" width="$width" height="$height" />
     304            </a>
     305HTML;
     306        }
     307
     308        $about = __( 'Advertisements', 'adcontrol' );
    290309        return <<<HTML
    291310        <div class="wpcnt">
  • radcontrol/trunk/php/admin.php

    r1373404 r1576964  
    1313        'wordads_approved',
    1414        'wordads_active',
     15
    1516    );
    1617    private $active_tab = 'adcontrol_settings';
     
    7980            '<span style="color:green;">Yes</span>' :
    8081            '<span style="color:red;">No</span>';
     82
    8183
    8284        $type = $this->get_option( 'tos' ) && $this->get_option( 'wordads_approved' ) ?
     
    8688        echo <<<HTML
    8789        <div class="notice $type is-dismissible">
    88             <p>TOS: $tos | Status: $status</p>
     90            <p>TOS: $tos | Status: $status</p>
    8991            <pre>$response</pre>
    9092        </div>
  • radcontrol/trunk/php/api.php

    r1339079 r1576964  
    6565            self::$wordads_status = array(
    6666                'approved' => true,
    67                 'active'   => true
     67                'active'   => true,
     68                'house'    => true,
    6869            );
    6970
     
    8081        self::$wordads_status = array(
    8182            'approved' => $body->approved,
    82             'active'   => $body->active
     83            'active'   => $body->active,
     84            'house'    => $body->house,
    8385        );
    8486
     
    9799        }
    98100
    99         return self::$wordads_status['approved'];
     101        return self::$wordads_status['approved'];
    100102    }
    101103
     
    111113        }
    112114
    113         return self::$wordads_status['active'];
     115        return self::$wordads_status['active'] ? '1' : '0';
     116    }
     117
     118    /**
     119     * Returns status of WordAds house ads.
     120     * @return boolean true if WP.com house ads should be shown
     121     *
     122     * @since 1.2
     123     */
     124    public static function is_wordads_house() {
     125        if ( is_null( self::$wordads_status ) ) {
     126            self::get_wordads_status();
     127        }
     128
     129        return self::$wordads_status['house'] ? '1' : '0';
    114130    }
    115131
     
    125141            $options['wordads_approved'] = self::is_wordads_approved();
    126142            $options['wordads_active'] = self::is_wordads_active();
     143
    127144            update_option( 'adcontrol_settings', $options );
    128145        }
  • radcontrol/trunk/php/widgets.php

    r1528300 r1576964  
    2525        }
    2626
    27         $about = __( 'About these ads', 'adcontrol' );
     27        if ( ! isset( $instance['unit'] ) ) {
     28            $instance['unit'] = 'mrec';
     29        }
     30
     31        $about = __( 'Advertisements', 'adcontrol' );
    2832        $section_id = 0 === $adcontrol->params->blog_id ? ADCONTROL_API_TEST_ID : $adcontrol->params->blog_id . '3';
    2933        $width = AdControl::$ad_tag_ids[$instance['unit']]['width'];
    3034        $height = AdControl::$ad_tag_ids[$instance['unit']]['height'];
    31         $data_tags = ( $adcontrol->params->cloudflare ) ? ' data-cfasync="false"' : '';
     35
     36        $snippet = '';
     37        if ( $adcontrol->option( 'wordads_house', true ) ) {
     38            $ad_url = 'https://s0.wp.com/wp-content/blog-plugins/wordads/house/';
     39            if ( 'leaderboard' == $instance['unit'] && ! $this->params->mobile_device ) {
     40                $ad_url .= 'leaderboard.png';
     41            } else if ( 'wideskyscraper' == $instance['unit'] ) {
     42                $ad_url .= 'widesky.png';
     43            } else {
     44                $ad_url .= 'mrec.png';
     45            }
     46
     47            $snippet = <<<HTML
     48            <a href="https://wordpress.com/create/" target="_blank">
     49                <img src="$ad_url" alt="WordPress.com: Grow Your Business" width="$width" height="$height" />
     50            </a>
     51HTML;
     52        } else {
     53            $section_id = 0 === $adcontrol->params->blog_id ? ADCONTROL_API_TEST_ID : $adcontrol->params->blog_id . '3';
     54            $data_tags = ( $adcontrol->params->cloudflare ) ? ' data-cfasync="false"' : '';
     55            $snippet = <<<HTML
     56            <script$data_tags type='text/javascript'>
     57                (function(g){g.__ATA.initAd({sectionId:$section_id, width:$width, height:$height});})(window);
     58            </script>
     59HTML;
     60        }
     61
    3262        echo <<< HTML
    3363        <div class="wpcnt">
     
    3565                <a class="wpa-about" href="https://en.wordpress.com/about-these-ads/" rel="nofollow">$about</a>
    3666                <div class="u {$instance['unit']}">
    37                     <script$data_tags type='text/javascript'>
    38                         (function(g){g.__ATA.initAd({sectionId:$section_id, width:$width, height:$height});})(window);
    39                     </script>
     67                    $snippet
    4068                </div>
    4169            </div>
  • radcontrol/trunk/readme.txt

    r1528300 r1576964  
    33Tags: advertising, ad codes, ads
    44Requires at least: 3.4
    5 Tested up to: 4.7
    6 Stable tag: 1.1.3
     5Tested up to: 4.7
     6Stable tag: 1.
    77
    88Harness WordPress.com's advertising partners for your own website.
     
    3636== Changelog ==
    3737
     38
     39
     40
     41
     42
     43
    3844= 1.1.3 =
     45
    3946* Changed the bulk of the JavaScript in the header from being inline to an external JavaScript.
    4047
Note: See TracChangeset for help on using the changeset viewer.