Wp-Insert - Version 1.4

Version Description

Download this release

Release Info

Developer namith.jawahar
Plugin Icon 128x128 Wp-Insert
Version 1.4
Comparing to
See all releases

Code changes from version 1.3.3 to 1.4

Files changed (6) hide show
  1. includes/ads.php +35 -6
  2. includes/inpostads.php +175 -15
  3. js/common.js +18 -0
  4. readme.txt +4 -2
  5. support/support.php +1 -1
  6. wp-insert.php +1 -1
includes/ads.php CHANGED
@@ -31,6 +31,7 @@ add_meta_box('wp_insert_ad_widget_8', 'Ad Widget : 8', 'wp_insert_ad_widget_8_HT
31
  add_meta_box('wp_insert_ad_widget_9', 'Ad Widget : 9', 'wp_insert_ad_widget_9_HTML', 'adWidgets');
32
  add_meta_box('wp_insert_ad_widget_10', 'Ad Widget : 10', 'wp_insert_ad_widget_10_HTML', 'adWidgets');
33
 
 
34
  add_meta_box('wp_insert_in_post_ad_top_1', 'Ad - Above Post Content', 'wp_insert_in_post_ad_top_1_HTML', 'inPostAds');
35
  //add_meta_box('wp_insert_in_post_ad_top_2', 'Ad - Above Post Content : 2', 'wp_insert_in_post_ad_top_2_HTML', 'inPostAds');
36
  add_meta_box('wp_insert_in_post_ad_bottom_1', 'Ad - Below Post Content', 'wp_insert_in_post_ad_bottom_1_HTML', 'inPostAds');
@@ -98,7 +99,7 @@ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
98
  <div id="post-body-content" class="has-sidebar-content">
99
  <?php do_meta_boxes('inPostAds','advanced',null); ?>
100
  <input type="hidden" name="action" value="update" />
101
- <input type="hidden" name="page_options" value="<?php wp_insert_in_post_ad_parameters('middle_1'); wp_insert_in_post_ad_parameters('right_1'); wp_insert_in_post_ad_parameters('left_1'); wp_insert_in_post_ad_parameters('bottom_1'); wp_insert_in_post_ad_parameters('top_1'); wp_insert_ad_widget_parameters(1); wp_insert_ad_widget_parameters(2); wp_insert_ad_widget_parameters(3); wp_insert_ad_widget_parameters(4); wp_insert_ad_widget_parameters(5); wp_insert_ad_widget_parameters(6); wp_insert_ad_widget_parameters(7); wp_insert_ad_widget_parameters(8); wp_insert_ad_widget_parameters(9); wp_insert_ad_widget_parameters(10); ?>" />
102
  <p class="submit">
103
  <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
104
  </p>
@@ -126,8 +127,30 @@ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
126
  <?php
127
  }
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  function wp_insert_in_post_ad_parameters($in_post_adID) {
130
- echo 'wp_insert_in_post_ad_'.$in_post_adID.'_enable,wp_insert_in_post_ad_'.$in_post_adID.'_content,wp_insert_in_post_ad_'.$in_post_adID.'_exclude_ids,wp_insert_in_post_ad_'.$in_post_adID.'_exclude_home,wp_insert_in_post_ad_'.$in_post_adID.'_exclude_archives,wp_insert_in_post_ad_'.$in_post_adID.'_style,';
131
  }
132
 
133
  function wp_insert_in_post_ad_HTML($in_post_adID) { ?>
@@ -135,10 +158,16 @@ function wp_insert_in_post_ad_HTML($in_post_adID) { ?>
135
  <?php if(get_option('wp_insert_in_post_ad_'.$in_post_adID.'_enable')) { ?><input type="button" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable_button', '#wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable')"/>
136
  <?php } else { ?><input type="button" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable_button', '#wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable')"/><?php } ?>
137
  <input style="display:none;" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable" name="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_in_post_ad_'.$in_post_adID.'_enable')) echo ' checked="checked"'; ?> />
138
- <p>
139
- <label for="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content">Ad Code:</label>
140
- <textarea id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content" class="widefat" name="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content" cols="20" rows="16"><?php echo get_option('wp_insert_in_post_ad_'.$in_post_adID.'_content'); ?></textarea>
141
- </p>
 
 
 
 
 
 
142
  <div style="margin:6px;">
143
  <label for="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_exclude_ids">Exclude On Posts/Pages:</label><div class="clear"></div>
144
  <input style="margin: 10px 6px 0pt; float: left; width: 60%;" class="widefat" type="text" value="<?php echo get_option('wp_insert_in_post_ad_'.$in_post_adID.'_exclude_ids'); ?>" name="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_exclude_ids" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_exclude_ids" />
31
  add_meta_box('wp_insert_ad_widget_9', 'Ad Widget : 9', 'wp_insert_ad_widget_9_HTML', 'adWidgets');
32
  add_meta_box('wp_insert_ad_widget_10', 'Ad Widget : 10', 'wp_insert_ad_widget_10_HTML', 'adWidgets');
33
 
34
+ add_meta_box('wp_insert_multiple_ad_network', 'Multiple Ad Networks', 'wp_insert_multiple_ad_network_HTML', 'inPostAds');
35
  add_meta_box('wp_insert_in_post_ad_top_1', 'Ad - Above Post Content', 'wp_insert_in_post_ad_top_1_HTML', 'inPostAds');
36
  //add_meta_box('wp_insert_in_post_ad_top_2', 'Ad - Above Post Content : 2', 'wp_insert_in_post_ad_top_2_HTML', 'inPostAds');
37
  add_meta_box('wp_insert_in_post_ad_bottom_1', 'Ad - Below Post Content', 'wp_insert_in_post_ad_bottom_1_HTML', 'inPostAds');
99
  <div id="post-body-content" class="has-sidebar-content">
100
  <?php do_meta_boxes('inPostAds','advanced',null); ?>
101
  <input type="hidden" name="action" value="update" />
102
+ <input type="hidden" name="page_options" value="wp_insert_multiple_ad_network_type,<?php wp_insert_in_post_ad_parameters('middle_1'); wp_insert_in_post_ad_parameters('right_1'); wp_insert_in_post_ad_parameters('left_1'); wp_insert_in_post_ad_parameters('bottom_1'); wp_insert_in_post_ad_parameters('top_1'); wp_insert_ad_widget_parameters(1); wp_insert_ad_widget_parameters(2); wp_insert_ad_widget_parameters(3); wp_insert_ad_widget_parameters(4); wp_insert_ad_widget_parameters(5); wp_insert_ad_widget_parameters(6); wp_insert_ad_widget_parameters(7); wp_insert_ad_widget_parameters(8); wp_insert_ad_widget_parameters(9); wp_insert_ad_widget_parameters(10); ?>" />
103
  <p class="submit">
104
  <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
105
  </p>
127
  <?php
128
  }
129
 
130
+ function wp_insert_multiple_ad_network_HTML() {
131
+ if(!get_option('wp_insert_multiple_ad_network_type')) { add_option("wp_insert_multiple_ad_network_type", 'Primary Ad Network Only', '', 'yes'); }
132
+ ?>
133
+ <div>
134
+ Select the Multiple Ad Network Setup that best suits you : <select name="wp_insert_multiple_ad_network_type" id="wp_insert_multiple_ad_network_type">
135
+ <?php
136
+ $multiple_ad_network_types = array("Primary Ad Network Only","Primary and Alternate Ad Network 1","All Ad Networks");
137
+ $output = '';
138
+ foreach ($multiple_ad_network_types as $multiple_ad_network_type) {
139
+ $output .= '<option';
140
+ if ( get_option('wp_insert_multiple_ad_network_type') == $multiple_ad_network_type) { $output .= ' selected="selected"'; }
141
+ $output .= '>'.$multiple_ad_network_type.'</option>';
142
+ }
143
+ echo $output;
144
+ ?>
145
+ </select>
146
+ <p>
147
+ <small>Multiple Ad Networks can be setup to display ads from different networks without infringing the terms of any network.<br/>At a time only ads from one network (Randomly Choosen) will be shown.<br/>This feature can also be used to randomly display different sized Ads from the same network.</small>
148
+ </p>
149
+ </div>
150
+ <?php }
151
+
152
  function wp_insert_in_post_ad_parameters($in_post_adID) {
153
+ echo 'wp_insert_in_post_ad_'.$in_post_adID.'_enable,wp_insert_in_post_ad_'.$in_post_adID.'_content,wp_insert_in_post_ad_'.$in_post_adID.'_content_1,wp_insert_in_post_ad_'.$in_post_adID.'_content_2,wp_insert_in_post_ad_'.$in_post_adID.'_exclude_ids,wp_insert_in_post_ad_'.$in_post_adID.'_exclude_home,wp_insert_in_post_ad_'.$in_post_adID.'_exclude_archives,wp_insert_in_post_ad_'.$in_post_adID.'_style,';
154
  }
155
 
156
  function wp_insert_in_post_ad_HTML($in_post_adID) { ?>
158
  <?php if(get_option('wp_insert_in_post_ad_'.$in_post_adID.'_enable')) { ?><input type="button" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable_button" value="Click to Deactivate" class="button" style="font-weight:bold;color:red;" onclick="wpInsertToggleAdWidget('#wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable_button', '#wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable')"/>
159
  <?php } else { ?><input type="button" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable_button" value="Click to Activate" class="button" style="font-weight:bold;color:#2f9303;" onclick="wpInsertToggleAdWidget('#wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable_button', '#wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable')"/><?php } ?>
160
  <input style="display:none;" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable" name="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_enable" type="checkbox" value="1"<?php if(get_option('wp_insert_in_post_ad_'.$in_post_adID.'_enable')) echo ' checked="checked"'; ?> />
161
+
162
+ <div style="margin:10px 6px;">
163
+ <?php if((get_option('wp_insert_multiple_ad_network_type') == "Primary and Alternate Ad Network 1") || (get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks")) { ?><input type="button" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_button" value="Primary Ad Code" class="button" style="color:#2f9303;" onclick="SwitchAds('wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content','wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_1','wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_2')"/> <?php } else {?><label for="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content">Primary Ad Code:</label><?php } ?>
164
+ <?php if((get_option('wp_insert_multiple_ad_network_type') == "Primary and Alternate Ad Network 1") || (get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks")) { ?><input type="button" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_1_button" value="Alternative Ad Code : 1" class="button" style="color:red;" onclick="SwitchAds('wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_1','wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content','wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_2')"/> <?php } ?>
165
+ <?php if(get_option('wp_insert_multiple_ad_network_type') == "All Ad Networks") { ?><input type="button" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_2_button" value="Alternative Ad Code : 2" class="button" style="color:red;" onclick="SwitchAds('wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_2','wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_1','wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content')"/> <?php } ?>
166
+ <textarea style="display:block;height:315px;" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content" class="widefat" name="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content" cols="20" rows="16"><?php echo get_option('wp_insert_in_post_ad_'.$in_post_adID.'_content'); ?></textarea>
167
+ <textarea style="display:none;height:0px;" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_1" class="widefat" name="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_1" cols="20" rows="16"><?php echo get_option('wp_insert_in_post_ad_'.$in_post_adID.'_content_1'); ?></textarea>
168
+ <textarea style="display:none;height:0px;" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_2" class="widefat" name="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_content_2" cols="20" rows="16"><?php echo get_option('wp_insert_in_post_ad_'.$in_post_adID.'_content_2'); ?></textarea>
169
+ </div>
170
+
171
  <div style="margin:6px;">
172
  <label for="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_exclude_ids">Exclude On Posts/Pages:</label><div class="clear"></div>
173
  <input style="margin: 10px 6px 0pt; float: left; width: 60%;" class="widefat" type="text" value="<?php echo get_option('wp_insert_in_post_ad_'.$in_post_adID.'_exclude_ids'); ?>" name="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_exclude_ids" id="wp_insert_in_post_ad_<?php echo $in_post_adID; ?>_exclude_ids" />
includes/inpostads.php CHANGED
@@ -1,6 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  function wp_insert_filter_content_ads($content, $ad_ID) {
3
  $output = '';
 
4
  $page_details = wp_insert_get_current_page_details();
5
 
6
  if(get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_enable')) {
@@ -25,16 +35,46 @@ function wp_insert_filter_content_ads($content, $ad_ID) {
25
  $ad_style = get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_style');
26
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
27
  if(!get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
28
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content').'</div>'.$trigger, $triggerpoint, 2);
 
 
 
 
 
 
 
 
 
 
29
  }
30
  else if(!get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
31
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content').'</div>'.$trigger, $triggerpoint, 2);
 
 
 
 
 
 
 
 
 
 
32
  }
33
  else {
34
  if(is_singular()) {
35
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_exclude_ids')));
36
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
37
- $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content').'</div>'.$trigger, $triggerpoint, 2);
 
 
 
 
 
 
 
 
 
 
38
  }
39
  }
40
  }
@@ -44,16 +84,46 @@ function wp_insert_filter_content_ads($content, $ad_ID) {
44
  $ad_style = get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_style');
45
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
46
  if(!get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
47
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
48
  }
49
  else if(!get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
50
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
51
  }
52
  else {
53
  if(is_singular()) {
54
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_exclude_ids')));
55
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
56
- $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
57
  }
58
  }
59
  }
@@ -62,16 +132,46 @@ function wp_insert_filter_content_ads($content, $ad_ID) {
62
  $ad_style = get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_style');
63
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
64
  if(!get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
65
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
66
  }
67
  else if(!get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
68
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
69
  }
70
  else {
71
  if(is_singular()) {
72
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_exclude_ids')));
73
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
74
- $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
75
  }
76
  }
77
  }
@@ -80,16 +180,46 @@ function wp_insert_filter_content_ads($content, $ad_ID) {
80
  $ad_style = get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_style');
81
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
82
  if(!get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
83
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
84
  }
85
  else if(!get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
86
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
87
  }
88
  else {
89
  if(is_singular()) {
90
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_exclude_ids')));
91
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
92
- $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
93
  }
94
  }
95
  }
@@ -98,16 +228,46 @@ function wp_insert_filter_content_ads($content, $ad_ID) {
98
  $ad_style = get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_style');
99
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
100
  if(!get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
101
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
102
  }
103
  else if(!get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
104
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
105
  }
106
  else {
107
  if(is_singular()) {
108
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_exclude_ids')));
109
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
110
- $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content').'</div>';
 
 
 
 
 
 
 
 
 
 
111
  }
112
  }
113
  }
1
  <?php
2
+ $random = 0;
3
+ switch(get_option('wp_insert_multiple_ad_network_type')) {
4
+ case "All Ad Networks":
5
+ $random = rand(0,2);
6
+ break;
7
+ case "Primary and Alternate Ad Network 1":
8
+ $random = rand(0,1);
9
+ break;
10
+ }
11
  function wp_insert_filter_content_ads($content, $ad_ID) {
12
  $output = '';
13
+ global $random;
14
  $page_details = wp_insert_get_current_page_details();
15
 
16
  if(get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_enable')) {
35
  $ad_style = get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_style');
36
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
37
  if(!get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
38
+ switch($random) {
39
+ case 0:
40
+ $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content').'</div>'.$trigger, $triggerpoint, 2);
41
+ break;
42
+ case 1:
43
+ $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_1').'</div>'.$trigger, $triggerpoint, 2);
44
+ break;
45
+ case 2:
46
+ $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_2').'</div>'.$trigger, $triggerpoint, 2);
47
+ break;
48
+ }
49
  }
50
  else if(!get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
51
+ switch($random) {
52
+ case 0:
53
+ $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content').'</div>'.$trigger, $triggerpoint, 2);
54
+ break;
55
+ case 1:
56
+ $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_1').'</div>'.$trigger, $triggerpoint, 2);
57
+ break;
58
+ case 2:
59
+ $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_2').'</div>'.$trigger, $triggerpoint, 2);
60
+ break;
61
+ }
62
  }
63
  else {
64
  if(is_singular()) {
65
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_exclude_ids')));
66
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
67
+ switch($random) {
68
+ case 0:
69
+ $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content').'</div>'.$trigger, $triggerpoint, 2);
70
+ break;
71
+ case 1:
72
+ $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_1').'</div>'.$trigger, $triggerpoint, 2);
73
+ break;
74
+ case 2:
75
+ $content = substr_replace($content, '<div id="in_post_ad_middle_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_middle_'.$ad_ID.'_content_2').'</div>'.$trigger, $triggerpoint, 2);
76
+ break;
77
+ }
78
  }
79
  }
80
  }
84
  $ad_style = get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_style');
85
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
86
  if(!get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
87
+ switch($random) {
88
+ case 0:
89
+ $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content').'</div>';
90
+ break;
91
+ case 1:
92
+ $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_1').'</div>';
93
+ break;
94
+ case 2:
95
+ $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_2').'</div>';
96
+ break;
97
+ }
98
  }
99
  else if(!get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
100
+ switch($random) {
101
+ case 0:
102
+ $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content').'</div>';
103
+ break;
104
+ case 1:
105
+ $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_1').'</div>';
106
+ break;
107
+ case 2:
108
+ $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_2').'</div>';
109
+ break;
110
+ }
111
  }
112
  else {
113
  if(is_singular()) {
114
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_exclude_ids')));
115
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
116
+ switch($random) {
117
+ case 0:
118
+ $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content').'</div>';
119
+ break;
120
+ case 1:
121
+ $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_1').'</div>';
122
+ break;
123
+ case 2:
124
+ $output .= '<div id="in_post_ad_top_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_in_post_ad_top_'.$ad_ID.'_content_2').'</div>';
125
+ break;
126
+ }
127
  }
128
  }
129
  }
132
  $ad_style = get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_style');
133
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
134
  if(!get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
135
+ switch($random) {
136
+ case 0:
137
+ $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content').'</div>';
138
+ break;
139
+ case 1:
140
+ $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_1').'</div>';
141
+ break;
142
+ case 2:
143
+ $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_2').'</div>';
144
+ break;
145
+ }
146
  }
147
  else if(!get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
148
+ switch($random) {
149
+ case 0:
150
+ $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content').'</div>';
151
+ break;
152
+ case 1:
153
+ $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_1').'</div>';
154
+ break;
155
+ case 2:
156
+ $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_2').'</div>';
157
+ break;
158
+ }
159
  }
160
  else {
161
  if(is_singular()) {
162
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_exclude_ids')));
163
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
164
+ switch($random) {
165
+ case 0:
166
+ $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content').'</div>';
167
+ break;
168
+ case 1:
169
+ $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_1').'</div>';
170
+ break;
171
+ case 2:
172
+ $output .= '<div id="in_post_ad_left_'.$ad_ID.'" style="float:left;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_left_'.$ad_ID.'_content_2').'</div>';
173
+ break;
174
+ }
175
  }
176
  }
177
  }
180
  $ad_style = get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_style');
181
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
182
  if(!get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
183
+ switch($random) {
184
+ case 0:
185
+ $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content').'</div>';
186
+ break;
187
+ case 1:
188
+ $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_1').'</div>';
189
+ break;
190
+ case 2:
191
+ $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_2').'</div>';
192
+ break;
193
+ }
194
  }
195
  else if(!get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
196
+ switch($random) {
197
+ case 0:
198
+ $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content').'</div>';
199
+ break;
200
+ case 1:
201
+ $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_1').'</div>';
202
+ break;
203
+ case 2:
204
+ $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_2').'</div>';
205
+ break;
206
+ }
207
  }
208
  else {
209
  if(is_singular()) {
210
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_exclude_ids')));
211
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
212
+ switch($random) {
213
+ case 0:
214
+ $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content').'</div>';
215
+ break;
216
+ case 1:
217
+ $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_1').'</div>';
218
+ break;
219
+ case 2:
220
+ $output .= '<div id="in_post_ad_right_'.$ad_ID.'" style="float:right;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_right_'.$ad_ID.'_content_2').'</div>';
221
+ break;
222
+ }
223
  }
224
  }
225
  }
228
  $ad_style = get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_style');
229
  if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
230
  if(!get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
231
+ switch($random) {
232
+ case 0:
233
+ $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content').'</div>';
234
+ break;
235
+ case 1:
236
+ $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_1').'</div>';
237
+ break;
238
+ case 2:
239
+ $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_2').'</div>';
240
+ break;
241
+ }
242
  }
243
  else if(!get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
244
+ switch($random) {
245
+ case 0:
246
+ $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content').'</div>';
247
+ break;
248
+ case 1:
249
+ $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_1').'</div>';
250
+ break;
251
+ case 2:
252
+ $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_2').'</div>';
253
+ break;
254
+ }
255
  }
256
  else {
257
  if(is_singular()) {
258
  $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_exclude_ids')));
259
  if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
260
+ switch($random) {
261
+ case 0:
262
+ $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content').'</div>';
263
+ break;
264
+ case 1:
265
+ $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_1').'</div>';
266
+ break;
267
+ case 2:
268
+ $content .= '<div id="in_post_ad_bottom_'.$ad_ID.'" style="clear:both;'.$ad_style.'">'.get_option('wp_insert_in_post_ad_bottom_'.$ad_ID.'_content_2').'</div>';
269
+ break;
270
+ }
271
  }
272
  }
273
  }
js/common.js CHANGED
@@ -16,6 +16,24 @@
16
  }
17
  }
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  /* PopUps */
20
 
21
  //Code to find Y coordinates of any element starts here
16
  }
17
  }
18
 
19
+ function SwitchAds(adBox0,adBox1,adBox2) {
20
+ if(document.getElementById(adBox0).style.display == "block") {
21
+ jQuery("#"+adBox0).animate({backgroundColor: "#FFFBCC"}, 500, "linear", function() { jQuery("#"+adBox0).animate({backgroundColor: "#FFFFFF"}, 500, "linear"); } );
22
+ }
23
+ else {
24
+ if(document.getElementById(adBox1).style.display == "block") {
25
+ jQuery("#"+adBox1+"_button").animate({color: "red"}, 1500, "linear");
26
+ jQuery("#"+adBox0+"_button").animate({color: "#2f9303"}, 1500, "linear");
27
+ jQuery("#"+adBox1).animate({height: "0px"}, 500, "linear", function() { document.getElementById(adBox0).style.display = "block";jQuery("#"+adBox0).animate({height: "315px"}, 1000, "linear");document.getElementById(adBox1).style.display = "none"; } );
28
+ }
29
+ else {
30
+ jQuery("#"+adBox2+"_button").animate({color: "red"}, 1500, "linear");
31
+ jQuery("#"+adBox0+"_button").animate({color: "#2f9303"}, 1500, "linear");
32
+ jQuery("#"+adBox2).animate({height: "0px"}, 500, "linear", function() { document.getElementById(adBox0).style.display = "block";jQuery("#"+adBox0).animate({height: "315px"}, 1000, "linear");document.getElementById(adBox2).style.display = "none"; } );
33
+ }
34
+ }
35
+ }
36
+
37
  /* PopUps */
38
 
39
  //Code to find Y coordinates of any element starts here
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Namith Jawahar
3
  Donate link: http://smartlogix.co.in/
4
  Tags: adsense,google,widget,post,admin,plugin,rss,feedburner,ads,subscribe,fck editor,category description editor,excerpt,WYSIWYG,WYSIWYG editor,in post ads,feed logo,smartlogix,ads in feeds,analytics,google analytics,header,footer,ad management,advertisements,content,ad,advertising,blog,feed,feeds,formatting,html,javascript,manage,post,posts,seo,sidebar,widget,widgets,wordpress,tracking,syntex highlighter,highlighting,theme tools,plugin tools,developer tools,highlighting,theme editor,plugin editor,middle ad,ad filtration,pagewise ad filtration
5
  Requires at least: 2.7
6
- Tested up to: 2.8.5
7
- Stable tag: 1.3.3
8
 
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin
10
 
@@ -29,6 +29,8 @@ Manage Ads (Completely Rewritten with a New and Powerful Interface)<br/>
29
  Ten ad widgets at your disposal <br/>
30
  * Go to the widgets page under "Appearance" and place the widgets onto the sidebars you want the ads to appear onto <br/>
31
  * Option to style the Ads <br/>
 
 
32
  <br/>
33
  <br/>
34
  Manage Feeds<br/>
3
  Donate link: http://smartlogix.co.in/
4
  Tags: adsense,google,widget,post,admin,plugin,rss,feedburner,ads,subscribe,fck editor,category description editor,excerpt,WYSIWYG,WYSIWYG editor,in post ads,feed logo,smartlogix,ads in feeds,analytics,google analytics,header,footer,ad management,advertisements,content,ad,advertising,blog,feed,feeds,formatting,html,javascript,manage,post,posts,seo,sidebar,widget,widgets,wordpress,tracking,syntex highlighter,highlighting,theme tools,plugin tools,developer tools,highlighting,theme editor,plugin editor,middle ad,ad filtration,pagewise ad filtration
5
  Requires at least: 2.7
6
+ Tested up to: 2.8.6
7
+ Stable tag: 1.4
8
 
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin
10
 
29
  Ten ad widgets at your disposal <br/>
30
  * Go to the widgets page under "Appearance" and place the widgets onto the sidebars you want the ads to appear onto <br/>
31
  * Option to style the Ads <br/>
32
+ * <b>Multiple Ad Network Support.</b> (You can now run any ad-network along with adsense or any other network)<br/>
33
+ * Support for upto three different Ad networks all delivering at the same time<br/>
34
  <br/>
35
  <br/>
36
  Manage Feeds<br/>
support/support.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php function show_support_options() { ?>
2
  <table class="form-table">
3
  <tr valign="bottom">
4
- <th scope="row"><small><span style="color:#FF0000;"><b>Donate a Dollar</b></span><br/><span style="color:#008E04;">Support our FREE Plugins</span><br/>
5
  You Might Also Like <a target="_blank" href="http://wordpress.org/extend/plugins/wp-private/">WP-PRIVATE</a></small></th>
6
  <td width="100px">
7
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
1
  <?php function show_support_options() { ?>
2
  <table class="form-table">
3
  <tr valign="bottom">
4
+ <th scope="row"><small><span style="color:#FF0000;"><b>Donate a few Dollars</b></span><br/><span style="color:#008E04;">Support our FREE Plugins</span><br/>
5
  You Might Also Like <a target="_blank" href="http://wordpress.org/extend/plugins/wp-private/">WP-PRIVATE</a></small></th>
6
  <td width="100px">
7
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
wp-insert.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: wp-insert
4
  Plugin URI: http://www.smartlogix.co.in/
5
  Description: The ultimate wordpress plugin
6
- Version: 1.3.3
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin
3
  Plugin Name: wp-insert
4
  Plugin URI: http://www.smartlogix.co.in/
5
  Description: The ultimate wordpress plugin
6
+ Version: 1.4
7
  Author: Namith Jawahar
8
  Author URI: http://www.smartlogix.co.in/
9
  WP-INSERT by SMARTLOGIX : The ultimate wordpress plugin