Changeset 1763298
- Timestamp:
- 11/10/2017 07:49:58 PM (7 years ago)
- Location:
- radcontrol/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
radcontrol/trunk/adcontrol.php
r1600157 r1763298 3 3 /* 4 4 Plugin Name: AdControl 5 Plugin URI: http ://wordads.co/6 Description: 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.5 Plugin URI: http://wordads.co/ 6 Description: Harness WordPress.com's advertising partners for your own website. Requires <a href="http/" target="_blank">Jetpack</a> to be installed and connected. 7 7 Author: Automattic 8 Version: 1. 2.19 Author URI: http ://automattic.com8 Version: 1. 9 Author URI: http://automattic.com 10 10 Text Domain: adcontrol 11 11 Domain Path: /languages … … 28 28 */ 29 29 30 define( 'ADCONTROL_VERSION', '1. 2.1' );30 define( 'ADCONTROL_VERSION', '1.' ); 31 31 define( 'ADCONTROL_ROOT', dirname( __FILE__ ) ); 32 32 define( 'ADCONTROL_BASENAME', plugin_basename( __FILE__ ) ); … … 34 34 define( 'ADCONTROL_URL', plugins_url( '/', __FILE__ ) ); 35 35 define( 'ADCONTROL_API_TEST_ID', '26942' ); 36 36 37 37 38 add_action( 'plugins_loaded', array( 'AdControl', 'plugin_textdomain'), 99 ); … … 126 127 127 128 $this->insert_adcode(); 128 $this->insert_extras();129 129 } 130 130 … … 154 154 155 155 if ( $this->option( 'leaderboard' ) ) { 156 add_action( 'wp_head', array( $this, 'insert_header_ad' ), 100 );157 }158 }159 160 /**161 * Add the actions/filters to insert extra-network features.162 *163 * @since 0.1164 */165 private function insert_extras() {166 require_once( ADCONTROL_ROOT . '/php/networks/amazon.php' );156 157 158 159 case 'twentyfourteen': 160 161 162 163 164 165 166 167 167 } 168 168 … … 210 210 $data_tags = ( $this->params->cloudflare ) ? ' data-cfasync="false"' : ''; 211 211 echo <<<HTML 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 212 229 <script$data_tags type="text/javascript" src="//s.pubmine.com/head.js"></script> 230 213 231 HTML; 214 232 } … … 261 279 262 280 /** 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 263 324 * Get the ad for the spot and type. 264 325 * @param string $spot top, side, or belowpost … … 267 328 function get_ad( $spot, $type = 'iponweb' ) { 268 329 $snippet = ''; 330 269 331 if ( 'iponweb' == $type ) { 270 332 $section_id = ADCONTROL_API_TEST_ID; 271 333 $width = 300; 272 334 $height = 250; 335 273 336 if ( 'top' == $spot ) { 274 337 // mrec for mobile, leaderboard for desktop … … 276 339 $width = $this->params->mobile_device ? 300 : 728; 277 340 $height = $this->params->mobile_device ? 250 : 90; 278 } else if ( 'belowpost' ) { 341 $blocker_unit = $this->params->mobile_device ? 'top_mrec' : 'top'; 342 } else if ( 'belowpost' == $spot ) { 279 343 $section_id = 0 === $this->params->blog_id ? ADCONTROL_API_TEST_ID : $this->params->blog_id . '1'; 280 344 $width = 300; 281 345 $height = 250; 346 347 348 349 350 282 351 } 352 283 353 $data_tags = ( $this->params->cloudflare ) ? ' data-cfasync="false"' : ''; 284 354 $snippet = <<<HTML 285 <script$data_tags type='text/javascript'> 286 (function(g){g.__ATA.initAd({sectionId:$section_id, width:$width, height:$height});})(window); 355 <script$data_tags id='s$section_id' type='text/javascript'> 356 (function(g){if('undefined'!=typeof g.__ATA){ 357 g.__ATA.initAd({collapseEmpty:'after', sectionId:$section_id, width:$width, height:$height}); 358 $second_belowpost 359 }})(window); 287 360 </script> 288 361 HTML; … … 290 363 $leaderboard = 'top' == $spot && ! $this->params->mobile_device; 291 364 $snippet = $this->get_house_ad( $leaderboard ? 'leaderboard' : 'mrec' ); 292 } 293 365 if ( 'belowpost' == $spot && $this->option( 'second_belowpost', true ) ) { 366 $snippet .= $this->get_house_ad( $leaderboard ? 'leaderboard' : 'mrec' ); 367 } 368 } 369 370 $ad_blocker_ad = 'iponweb' == $type ? $this->get_adblocker_ad( $blocker_unit ) : ''; 371 $second_belowpost_css = ''; 372 $double_mrec = ''; 373 if ( 'belowpost' == $spot && $this->option( 'second_belowpost', true ) ) { 374 if ( 'iponweb' == $type ) { 375 $ad_blocker_ad .= $this->get_adblocker_ad( 'mrec2' ); 376 } 377 378 $double_mrec = 'wpmrec2x'; 379 $second_belowpost_css = <<<HTML 380 <style type="text/css"> 381 div.wpmrec2x{max-width:610px;} 382 div.wpmrec2x div.u > div{float:left;margin-right:10px;} 383 div.wpmrec2x div.u > div:nth-child(3n){margin-right:0px;} 384 </style> 385 HTML; 386 } 387 388 $header = 'top' == $spot ? 'wpcnt-header' : ''; 294 389 $about = __( 'Advertisements', 'adcontrol' ); 295 390 return <<<HTML 296 <div class="wpcnt"> 391 $second_belowpost_css 392 <div class="wpcnt $header $double_mrec"> 297 393 <div class="wpa"> 298 394 <span class="wpa-about">$about</span> … … 300 396 $snippet 301 397 </div> 398 302 399 </div> 303 400 </div> 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 304 443 HTML; 305 444 } -
radcontrol/trunk/css/ac-style.css
r1600157 r1763298 4 4 <div class="wpcnt"> 5 5 <div class="wpa [wpmrec|wpwidesky|wpleaderboard]"> 6 <a class="wpa-about" href="http ://wordpress.com/about-these-ads/" rel="nofollow">6 <a class="wpa-about" href="http://wordpress.com/about-these-ads/" rel="nofollow"> 7 7 About these ads 8 8 </a> -
radcontrol/trunk/languages/adcontrol.pot
r1318784 r1763298 122 122 msgid "" 123 123 "Harness WordPress.com's advertising partners for your own website. Requires " 124 "<a href=\"http ://jetpack.me/\" target=\"_blank\">Jetpack</a> to be installed "124 "<a href=\"http/\" target=\"_blank\">Jetpack</a> to be installed " 125 125 "and connected." 126 126 msgstr "" … … 131 131 132 132 #. Author URI of the plugin/theme 133 msgid "http ://automattic.com"133 msgid "http://automattic.com" 134 134 msgstr "" -
radcontrol/trunk/php/admin.php
r1576964 r1763298 11 11 'leaderboard', 12 12 'leaderboard_mobile', 13 14 15 16 17 13 18 'wordads_approved', 14 19 'wordads_active', … … 271 276 isset( $settings['leaderboard_mobile'] ) && $settings['leaderboard_mobile'] ? 1 : 0; 272 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 273 293 return $to_save; 274 294 } … … 354 374 add_settings_field( 355 375 'adcontrol_userdash_leaderboard_id', 356 __( 'Enable header unit:', 'adcontrol' ),376 __( 'Enable header :', 'adcontrol' ), 357 377 array( $this, 'setting_leaderboard' ), 358 378 $this->basic_settings_key, … … 363 383 add_settings_field( 364 384 'adcontrol_userdash_leaderboard_mobile_id', 365 __( 'Enable mobile header unit:', 'adcontrol' ),385 __( 'Enable mobile header :', 'adcontrol' ), 366 386 array( $this, 'setting_leaderboard_mobile' ), 367 387 $this->basic_settings_key, 368 388 $section_name, 369 389 array( 'label_for' => 'leaderboard_mobile' ) 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 370 444 ); 371 445 … … 381 455 add_settings_field( 382 456 'adcontrol_userdash_tos_id', 383 sprintf( __( 'I have read and agree to the %sWordAds Terms of Service%s', 'adcontrol' ), '<br /><a href="http ://wordpress.com/tos-wordads/" target="_blank">', '</a>' ),457 sprintf( __( 'I have read and agree to the %sWordAds Terms of Service%s', 'adcontrol' ), '<br /><a href="http://wordpress.com/tos-wordads/" target="_blank">', '</a>' ), 384 458 array( $this, 'setting_tos' ), 385 459 $this->basic_settings_key, … … 423 497 424 498 /** 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 425 539 * @since 0.1 426 540 */ -
radcontrol/trunk/php/networks/adsense.php
r1503924 r1763298 23 23 //--> 24 24 </script> 25 <script' . $data_tags . ' src=" http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';25 <script' . $data_tags . ' src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>'; 26 26 return $output; 27 27 } -
radcontrol/trunk/php/no-jetpack.php
r1312024 r1763298 30 30 $notice = sprintf( 31 31 __( 'AdControl requires %sJetpack%s to be installed and connected at this time. %sHelp getting started.%s', 'adcontrol' ), 32 '<a href="http ://jetpack.me/" target="_blank">', '</a>',33 '<a href="http ://jetpack.me/support/getting-started-with-jetpack/" target="_blank">', '</a>'32 '<a href="http/" target="_blank">', '</a>', 33 '<a href="http/support/getting-started-with-jetpack/" target="_blank">', '</a>' 34 34 ); 35 35 … … 47 47 */ 48 48 function settings_link( $links ) { 49 $settings_link = '<a href="http ://jetpack.me/" target="_blank">Install Jetpack</a>';49 $settings_link = '<a href="http/" target="_blank">Install Jetpack</a>'; 50 50 array_unshift( $links, $settings_link ); 51 51 return $links; … … 76 76 $notice = sprintf( 77 77 __( 'AdControl requires %sJetpack%s to be installed and connected at this time. %sHelp getting started.%s', 'adcontrol' ), 78 '<a href="http ://jetpack.me/" target="_blank">', '</a>',79 '<a href="http ://jetpack.me/support/getting-started-with-jetpack/" target="_blank">', '</a>'78 '<a href="http/" target="_blank">', '</a>', 79 '<a href="http/support/getting-started-with-jetpack/" target="_blank">', '</a>' 80 80 ); 81 81 -
radcontrol/trunk/php/params.php
r1503924 r1763298 30 30 'AdSafe' => 1, // TODO 31 31 ); 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 32 48 } 33 49 … … 166 182 * @since 0.1 167 183 */ 168 public staticfunction should_show() {184 public function should_show() { 169 185 global $wp_query; 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 170 202 if ( is_single() || ( is_page() && ! is_home() ) ) { 171 203 return true; -
radcontrol/trunk/readme.txt
r1671989 r1763298 3 3 Tags: advertising, ad codes, ads 4 4 Requires at least: 3.4 5 Tested up to: 4. 86 Stable tag: 1. 2.15 Tested up to: 4. 6 Stable tag: 1. 7 7 8 8 Harness WordPress.com's advertising partners for your own website. … … 16 16 Make sure you [apply to WordAds](https://wordads.co/signup/) for each site you want to run AdControl on. 17 17 18 Requires [Jetpack](http ://jetpack.me/) to be installed and connected. [Help getting started.](http://jetpack.me/support/getting-started-with-jetpack/)18 Requires [Jetpack](http/support/getting-started-with-jetpack/) 19 19 20 20 New in version 1.1.3 Moved inline JavaScript in the header to an external JavaScript. … … 23 23 24 24 1. [Apply to WordAds](https://wordads.co/signup/) for each site you want to run AdControl on. 25 1. [Install and activate Jetpack.](http ://wordpress.org/plugins/jetpack/installation/)25 1. [Install and activate Jetpack.](http://wordpress.org/plugins/jetpack/installation/) 26 26 1. Upload `AdControl` to the `/wp-content/plugins/` directory. 27 27 1. Activate the plugin through the 'Plugins' menu in WordPress. … … 35 35 36 36 == Changelog == 37 38 39 40 41 42 43 37 44 38 45 = 1.2.1 =
Note: See TracChangeset
for help on using the changeset viewer.