WordPress Ad Widget - Version 2.5.0

Version Description

Download this release

Release Info

Developer broadstreetads
Plugin Icon wp plugin WordPress Ad Widget
Version 2.5.0
Comparing to
See all releases

Code changes from version 2.4.1 to 2.5.0

Files changed (3) hide show
  1. adwidget.php +20 -4
  2. readme.txt +1 -1
  3. views/modal/signup.php +8 -8
adwidget.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Wordpress Ad Widget
4
  Plugin URI: https://github.com/broadstreetads/wordpress-ad-widget
5
  Description: The easiest way to place ads in your Wordpress sidebar. Go to Settings -> Ad Widget
6
- Version: 2.4.1
7
  Author: Broadstreet Ads
8
  Author URI: http://broadstreetads.com
9
  */
@@ -20,7 +20,7 @@ add_action('admin_menu', array('AdWidget_Core', 'registerAdmin'));
20
  class AdWidget_Core
21
  {
22
  CONST KEY_INSTALL_REPORT = 'AdWidget_Installed';
23
- CONST VERSION = '2.4.1';
24
 
25
  /**
26
  * The callback used to register the scripts
@@ -284,6 +284,7 @@ class AdWidget_ImageWidget extends WP_Widget
284
  $link = @$instance['w_link'];
285
  $img = @$instance['w_img'];
286
  $resize = @$instance['w_resize'];
 
287
  $id = rand(1, 100000);
288
 
289
  if($resize == 'yes')
@@ -295,6 +296,16 @@ class AdWidget_ImageWidget extends WP_Widget
295
  $resize_s = '';
296
  }
297
 
 
 
 
 
 
 
 
 
 
 
298
  echo $before_widget;
299
 
300
  if(!$img)
@@ -310,7 +321,7 @@ class AdWidget_ImageWidget extends WP_Widget
310
  }
311
  else
312
  {
313
- echo "<a target='_blank' href='$link' alt='Ad'><img $resize_s src='$img' alt='Ad' /></a>";
314
  }
315
 
316
  echo $after_widget;
@@ -332,6 +343,7 @@ class AdWidget_ImageWidget extends WP_Widget
332
  $instance['w_link'] = $new_instance['w_link'];
333
  $instance['w_img'] = $new_instance['w_img'];
334
  $instance['w_resize'] = @$new_instance['w_resize'];
 
335
  $instance['w_adv'] = $new_instance['w_adv'];
336
 
337
  /* New ad? Upload it to Broadstreet */
@@ -373,7 +385,7 @@ class AdWidget_ImageWidget extends WP_Widget
373
  $link_id = $this->get_field_id('w_link');
374
  $img_id = $this->get_field_id('w_img');
375
 
376
- $defaults = array('w_link' => get_bloginfo('url'), 'w_img' => '', 'w_adv' => 'New Advertiser', 'w_resize' => 'no');
377
 
378
  $instance = wp_parse_args((array) $instance, $defaults);
379
 
@@ -406,6 +418,10 @@ class AdWidget_ImageWidget extends WP_Widget
406
  <label for="<?php echo $this->get_field_id('w_resize'); ?>">Auto Resize to Max Width? </label>
407
  <input type="checkbox" name="<?php echo $this->get_field_name('w_resize'); ?>" value="yes" <?php if($instance['w_resize'] == 'yes') echo 'checked'; ?> />
408
  </p>
 
 
 
 
409
  <?php if(!Broadstreet_Mini_Utility::hasAdserving()): ?>
410
  <p>
411
  <span style="color: green; font-weight: bold;">New!</span> When you're ready for a more powerful adserver with click reporting <a target="_blank" href="#" onclick="broadstreet_upgrade(); return false;">click here</a>.
3
  Plugin Name: Wordpress Ad Widget
4
  Plugin URI: https://github.com/broadstreetads/wordpress-ad-widget
5
  Description: The easiest way to place ads in your Wordpress sidebar. Go to Settings -> Ad Widget
6
+ Version: 2.5.0
7
  Author: Broadstreet Ads
8
  Author URI: http://broadstreetads.com
9
  */
20
  class AdWidget_Core
21
  {
22
  CONST KEY_INSTALL_REPORT = 'AdWidget_Installed';
23
+ CONST VERSION = '2.5.0';
24
 
25
  /**
26
  * The callback used to register the scripts
284
  $link = @$instance['w_link'];
285
  $img = @$instance['w_img'];
286
  $resize = @$instance['w_resize'];
287
+ $new = @$instance['w_new'];
288
  $id = rand(1, 100000);
289
 
290
  if($resize == 'yes')
296
  $resize_s = '';
297
  }
298
 
299
+ # There's a reason for this dumb condition
300
+ if($new == 'yes' || $new == '')
301
+ {
302
+ $target = 'target="_blank"';
303
+ }
304
+ else
305
+ {
306
+ $target = '';
307
+ }
308
+
309
  echo $before_widget;
310
 
311
  if(!$img)
321
  }
322
  else
323
  {
324
+ echo "<a $target href='$link' alt='Ad'><img $resize_s src='$img' alt='Ad' /></a>";
325
  }
326
 
327
  echo $after_widget;
343
  $instance['w_link'] = $new_instance['w_link'];
344
  $instance['w_img'] = $new_instance['w_img'];
345
  $instance['w_resize'] = @$new_instance['w_resize'];
346
+ $instance['w_new'] = @$new_instance['w_new'];
347
  $instance['w_adv'] = $new_instance['w_adv'];
348
 
349
  /* New ad? Upload it to Broadstreet */
385
  $link_id = $this->get_field_id('w_link');
386
  $img_id = $this->get_field_id('w_img');
387
 
388
+ $defaults = array('w_link' => get_bloginfo('url'), 'w_img' => '', 'w_adv' => 'New Advertiser', 'w_resize' => 'no', 'w_new' => 'no');
389
 
390
  $instance = wp_parse_args((array) $instance, $defaults);
391
 
418
  <label for="<?php echo $this->get_field_id('w_resize'); ?>">Auto Resize to Max Width? </label>
419
  <input type="checkbox" name="<?php echo $this->get_field_name('w_resize'); ?>" value="yes" <?php if($instance['w_resize'] == 'yes') echo 'checked'; ?> />
420
  </p>
421
+ <p>
422
+ <label for="<?php echo $this->get_field_id('w_new'); ?>">Open in New Window? </label>
423
+ <input type="checkbox" name="<?php echo $this->get_field_name('w_new'); ?>" value="yes" <?php if($instance['w_resize'] == 'yes') echo 'checked'; ?> />
424
+ </p>
425
  <?php if(!Broadstreet_Mini_Utility::hasAdserving()): ?>
426
  <p>
427
  <span style="color: green; font-weight: bold;">New!</span> When you're ready for a more powerful adserver with click reporting <a target="_blank" href="#" onclick="broadstreet_upgrade(); return false;">click here</a>.
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: Broadstreet
3
  Tags: wordpress,ad,widget,sidebar,google,tag,code
4
  Requires at least: 3.0
5
  Tested up to: 3.8.1
6
- Stable tag: 2.4.1
7
 
8
  Easily upload ad images and ad code to your sidebar. For those that don't need or
9
  want a complicated ad management system.
3
  Tags: wordpress,ad,widget,sidebar,google,tag,code
4
  Requires at least: 3.0
5
  Tested up to: 3.8.1
6
+ Stable tag: 2.5.0
7
 
8
  Easily upload ad images and ad code to your sidebar. For those that don't need or
9
  want a complicated ad management system.
views/modal/signup.php CHANGED
@@ -5,16 +5,16 @@
5
  <div id="clients-section">
6
  <table id="clients">
7
  <tr>
8
- <td><a href="http://baristanet.com/"><img src="http://broadstreetads.com/assets/images/featured-clients/baristanet.png" /></a></td>
9
- <td><a href="http://thebatavian.com/"><img src="http://broadstreetads.com/assets/images/featured-clients/batavian.png" /></a></td>
10
- <td><a href="http://arlnow.com/"><img src="http://broadstreetads.com/assets/images/featured-clients/arlingtonnow.png" /></a></td>
11
- <td><a href="http://hulafrog.com/"><img src="http://broadstreetads.com/assets/images/featured-clients/hulafrog.png" /></a></td>
12
  </tr>
13
  <tr>
14
- <td><a href="http://natomasbuzz.com/"><img src="http://broadstreetads.com/assets/images/featured-clients/natomas.png" /></a></td>
15
- <td><a href="http://www.sheepsheadbites.com/"><img src="http://broadstreetads.com/assets/images/featured-clients/sheepshead.png" /></a></td>
16
- <td><a href="http://www.pvpost.com/"><img src="http://broadstreetads.com/assets/images/featured-clients/pvpost.png" /></a></td>
17
- <td><a href="http://njnewscommons.com/"><img src="http://broadstreetads.com/assets/images/featured-clients/njnewscommons.png" /></a></td>
18
  </tr>
19
  </table>
20
  </div>
5
  <div id="clients-section">
6
  <table id="clients">
7
  <tr>
8
+ <td><a href="http://baristanet.com/"><img src="http://broadstreetads.com/assets/app/images/featured-clients/baristanet.png" /></a></td>
9
+ <td><a href="http://thebatavian.com/"><img src="http://broadstreetads.com/assets/app/images/featured-clients/batavian.png" /></a></td>
10
+ <td><a href="http://arlnow.com/"><img src="http://broadstreetads.com/assets/app/images/featured-clients/arlingtonnow.png" /></a></td>
11
+ <td><a href="http://hulafrog.com/"><img src="http://broadstreetads.com/assets/app/images/featured-clients/hulafrog.png" /></a></td>
12
  </tr>
13
  <tr>
14
+ <td><a href="http://natomasbuzz.com/"><img src="http://broadstreetads.com/assets/app/images/featured-clients/natomas.png" /></a></td>
15
+ <td><a href="http://www.sheepsheadbites.com/"><img src="http://broadstreetads.com/assets/app/images/featured-clients/sheepshead.png" /></a></td>
16
+ <td><a href="http://www.pvpost.com/"><img src="http://broadstreetads.com/assets/app/images/featured-clients/pvpost.png" /></a></td>
17
+ <td><a href="http://njnewscommons.com/"><img src="http://broadstreetads.com/assets/app/images/featured-clients/njnewscommons.png" /></a></td>
18
  </tr>
19
  </table>
20
  </div>