Version Description
- Template ads - you can now include ads anywhere in your theme template with some simple tags. You can load the top/random/bottom/footer ads, or you can load an ad from a text file on disk. Template ads inherit the same restrictions as for ads configured via the UI.
- UI usability improvements.
Download this release
Release Info
Developer | reviewmylife |
Plugin | Ad Injection |
Version | 1.1.0.1 |
Comparing to | |
See all releases |
Code changes from version 0.9.7.11 to 1.1.0.1
- ad-injection-admin.php +13 -4
- ad-injection.php +23 -2
- readme.txt +92 -23
- ui-tab-main.php +39 -40
ad-injection-admin.php
CHANGED
@@ -339,7 +339,7 @@ function adinj_top_message_box(){
|
|
339 |
|
340 |
} else if (!isset($_GET['tab'])){
|
341 |
echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
|
342 |
-
echo "
|
343 |
echo '</strong></p></div>';
|
344 |
}
|
345 |
}
|
@@ -393,7 +393,8 @@ function adinj_side_info_box(){
|
|
393 |
<div class="inside" style="margin:5px;">
|
394 |
<h4>More Ad Injection information</h4>
|
395 |
<ul>
|
396 |
-
<li><a href="http://wordpress.org/extend/plugins/ad-injection/" target="_new">Ad Injection
|
|
|
397 |
<li><a href="http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/" target="_new">Ad Injection at reviewmylife</a></li>
|
398 |
<li><b><a href="<?php echo adinj_feedback_url(); ?>" target="_new">Report a bug / give feedback</a></b></li>
|
399 |
</ul>
|
@@ -401,8 +402,8 @@ function adinj_side_info_box(){
|
|
401 |
<h4><font color="red">Important!</font></h4>
|
402 |
<p>You are responsible for making sure the ad settings and positioning you define are in compliance with your ad provider's terms of service! Failure to do so could get you banned by them!</p>
|
403 |
|
404 |
-
<h4><font color="red">
|
405 |
-
<p>I'm actively listening to your feedback and fixing
|
406 |
|
407 |
<h4>More by this author</h4>
|
408 |
<ul>
|
@@ -1418,6 +1419,14 @@ function adinj_default_options(){
|
|
1418 |
'widget_exclude_archive' => '',
|
1419 |
'widget_exclude_search' => '',
|
1420 |
'widget_exclude_404' => '',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1421 |
// dynamic features
|
1422 |
'ad_insertion_mode' => 'mfunc',
|
1423 |
'sevisitors_only' => 'off',
|
339 |
|
340 |
} else if (!isset($_GET['tab'])){
|
341 |
echo '<div id="message" class="updated below-h2"><p style="line-height:140%"><strong>';
|
342 |
+
echo "22nd July 2011: You can now put ads anywhere in your theme template - you just need to add some simple PHP - see the readme.txt for details (search for 'adinj_print_ad'. Also UI updates. Please contact me ASAP if you spot any bugs, or odd behaviour via the ".'<a href="'.adinj_feedback_url().'" target="_new">quick feedback form</a>.';
|
343 |
echo '</strong></p></div>';
|
344 |
}
|
345 |
}
|
393 |
<div class="inside" style="margin:5px;">
|
394 |
<h4>More Ad Injection information</h4>
|
395 |
<ul>
|
396 |
+
<li><a href="http://wordpress.org/extend/plugins/ad-injection/faq/" target="_new">Ad Injection FAQ</a></li>
|
397 |
+
<li><a href="http://wordpress.org/extend/plugins/ad-injection/other_notes/" target="_new">Ad Injection Troubleshooting</a></li>
|
398 |
<li><a href="http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/" target="_new">Ad Injection at reviewmylife</a></li>
|
399 |
<li><b><a href="<?php echo adinj_feedback_url(); ?>" target="_new">Report a bug / give feedback</a></b></li>
|
400 |
</ul>
|
402 |
<h4><font color="red">Important!</font></h4>
|
403 |
<p>You are responsible for making sure the ad settings and positioning you define are in compliance with your ad provider's terms of service! Failure to do so could get you banned by them!</p>
|
404 |
|
405 |
+
<h4><font color="red">Still in development</font></h4>
|
406 |
+
<p>I'm actively listening to your feedback and fixing problems, and will be adding new features later in 2011. Please let me know if you like the plugin too!</p>
|
407 |
|
408 |
<h4>More by this author</h4>
|
409 |
<ul>
|
1419 |
'widget_exclude_archive' => '',
|
1420 |
'widget_exclude_search' => '',
|
1421 |
'widget_exclude_404' => '',
|
1422 |
+
// template ads
|
1423 |
+
'template_exclude_front' => '',
|
1424 |
+
'template_exclude_home' => '',
|
1425 |
+
'template_exclude_page' => '',
|
1426 |
+
'template_exclude_single' => '',
|
1427 |
+
'template_exclude_archive' => '',
|
1428 |
+
'template_exclude_search' => '',
|
1429 |
+
'template_exclude_404' => '',
|
1430 |
// dynamic features
|
1431 |
'ad_insertion_mode' => 'mfunc',
|
1432 |
'sevisitors_only' => 'off',
|
ad-injection.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Ad Injection
|
4 |
Plugin URI: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
|
5 |
Description: Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
|
6 |
-
Version:
|
7 |
Author: reviewmylife
|
8 |
Author URI: http://www.reviewmylife.co.uk/
|
9 |
License: GPLv2
|
@@ -29,7 +29,8 @@ define('ADINJ_NO_CONFIG_FILE', 1);
|
|
29 |
// 10 = exclusion tick boxes for top, random, bottom, and new footer ad
|
30 |
// 11 = options to disable rnd ad at bottom, and to get new ad for each rnd slot
|
31 |
// 13 = post/page id restrictions
|
32 |
-
|
|
|
33 |
|
34 |
// Files
|
35 |
// TODO will these paths work on windows?
|
@@ -1037,6 +1038,26 @@ function adinj_db_version($ops){
|
|
1037 |
}
|
1038 |
}
|
1039 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1040 |
// Widget support
|
1041 |
require_once('ad-injection-widget.php');
|
1042 |
add_action('widgets_init', 'adinj_widgets_init');
|
3 |
Plugin Name: Ad Injection
|
4 |
Plugin URI: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
|
5 |
Description: Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
|
6 |
+
Version: 1.1.0.1
|
7 |
Author: reviewmylife
|
8 |
Author URI: http://www.reviewmylife.co.uk/
|
9 |
License: GPLv2
|
29 |
// 10 = exclusion tick boxes for top, random, bottom, and new footer ad
|
30 |
// 11 = options to disable rnd ad at bottom, and to get new ad for each rnd slot
|
31 |
// 13 = post/page id restrictions
|
32 |
+
// 14 = template ads
|
33 |
+
define('ADINJ_DB_VERSION', 14);
|
34 |
|
35 |
// Files
|
36 |
// TODO will these paths work on windows?
|
1038 |
}
|
1039 |
}
|
1040 |
|
1041 |
+
// template ads
|
1042 |
+
function adinj_print_ad($adname=''){
|
1043 |
+
$reason = adinj_ads_completely_disabled_from_page("");
|
1044 |
+
if ($reason !== false){
|
1045 |
+
return;
|
1046 |
+
}
|
1047 |
+
if (adinj_excluded_by_tick_box('template_')) return;
|
1048 |
+
if ($adname == 'random'){
|
1049 |
+
echo adinj_ad_code_random();
|
1050 |
+
} else if ($adname == 'top'){
|
1051 |
+
echo adinj_ad_code_top();
|
1052 |
+
} else if ($adname == 'bottom'){
|
1053 |
+
echo adinj_ad_code_bottom();
|
1054 |
+
} else if ($adname == 'footer'){
|
1055 |
+
echo adinj_ad_code_footer();
|
1056 |
+
} else if (preg_match("/.+\.txt/i", $adname)){
|
1057 |
+
adshow_display_ad_file_v2($adname);
|
1058 |
+
}
|
1059 |
+
}
|
1060 |
+
|
1061 |
// Widget support
|
1062 |
require_once('ad-injection-widget.php');
|
1063 |
add_action('widgets_init', 'adinj_widgets_init');
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: reviewmylife
|
|
3 |
Donate link: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
|
4 |
Tags: ad injection, adsense, advert injection, advert, ad, injection, advertising, affiliate, inject, injection, insert, widget, widgets, sidebar, monetize, monetise, banner, Amazon, ClickBank, TradeDoubler, Google, adBrite, post, WordPress, automatically, plugin, Adsense Injection, free, blog, ad rotation, A:B testing, split testing, WP Super Cache, W3 Total Cache, WP Cache
|
5 |
Requires at least: 2.8.6
|
6 |
-
Tested up to: 3.2
|
7 |
-
Stable tag:
|
8 |
|
9 |
Injects any adverts (e.g. AdSense) into the WordPress posts or widget area. Restrict who sees ads by post length/age/referrer or IP. Cache compatible.
|
10 |
|
@@ -12,6 +12,10 @@ Injects any adverts (e.g. AdSense) into the WordPress posts or widget area. Rest
|
|
12 |
|
13 |
Ad Injection from [reviewmylife](http://www.reviewmylife.co.uk/ "reviewmylife") injects any kind of advert (e.g. Google AdSense, Amazon Associates, ClickBank, TradeDoubler, etc) into the existing content of your WordPress posts and pages. You can control the number of adverts based on the post length, and it can restrict who sees adverts by post age, visitor referrer and IP address. Adverts can be configured in the post (random, top, and bottom positions) or in any widget/sidebar area. There's support for A:B split testing / ad rotation. And the dynamic restrictions (by IP and referrer) work with WP Super Cache, W3 Total Cache and WP Cache.
|
14 |
|
|
|
|
|
|
|
|
|
15 |
**New Features 0.9.7.x**
|
16 |
|
17 |
* Archive and home page ads now fully supported with the same controls as ads for single posts/pages.
|
@@ -51,9 +55,13 @@ You can specify that ads should only be shown to search engine visitors (or from
|
|
51 |
|
52 |
Adverts can be restricted to posts that are more than a defined numbers of days old. This prevents your regular visitors from having to see your ads.
|
53 |
|
54 |
-
= Category, tag and post type filters =
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
|
57 |
|
58 |
= Block ads from IP addresses =
|
59 |
|
@@ -103,6 +111,7 @@ This section describes how to install the plugin and get it working.
|
|
103 |
4. Make sure you select the option to say which ad injection mode to use. Dynamic features (ad rotation, and referrer/IP ad filtering) will only work with either 1) WP Super Cache/W3 Total Cache/WP Cache or 2) no caching plugin.
|
104 |
5. Tick the box right at the top to enable your ads.
|
105 |
6. If you are using a caching plugin you may need to clear the cache to see your ads immediately.
|
|
|
106 |
|
107 |
**Recommended cache plugin settings**
|
108 |
|
@@ -116,6 +125,8 @@ Note: If you use a version of WP Super Cache prior to 0.9.9.8 it must be config
|
|
116 |
|
117 |
You can uninstall by deactivating the plugin and deleting from the WordPress plugins control panel.
|
118 |
|
|
|
|
|
119 |
If you have been using mfunc mode with a caching plugin then you *must* also clear the cache afterwards, otherwise you'll get errors saying the Ad Injection includes can't be found.
|
120 |
|
121 |
== Frequently Asked Questions ==
|
@@ -126,17 +137,19 @@ I used to use the excellent Adsense Injection by Dax Herrera, but found I needed
|
|
126 |
|
127 |
= How is this plugin different to Adsense Injection by Dax Herrera? =
|
128 |
|
129 |
-
One a basic level it can do the same job as Dax's excellent Adsense Injection. If you want it can just inject
|
130 |
|
131 |
* Inject any type of advert from any ad provider.
|
132 |
* Restrict ad display by referrer (e.g. can restrict display to search engine visitors).
|
133 |
* Can prevent specific IP addresses from seeing adverts.
|
134 |
-
* Can define randomly positioned adverts, and adverts at the top and
|
135 |
* Add adverts to the widget area.
|
|
|
136 |
* Ad rotation / split testing.
|
137 |
-
* Restrict adverts by category
|
138 |
* Vary number of adverts based on post length.
|
139 |
* You can inject raw JavaScript and PHP.
|
|
|
140 |
* The dynamic features (ad rotation, restricting ads by referrer and IP) work with WP Super Cache, W3 Total Cache and WP Cache.
|
141 |
* Define alternate content for users who are dynamically restricted from seeing ads.
|
142 |
* Compatible with the <!--noadsense--> <!--adsensestart--> in-page tags from Adsense Injection to make migration easy.
|
@@ -155,6 +168,8 @@ As far as I can tell using this plugin should be legal for AdSense **as long as
|
|
155 |
|
156 |
Ad Injection is designed as a generic plugin for injecting all types of adverts. It will not specifically check that the defined ad quantities or positions are in compliance of the AdSense TOS for you. For example Ad Injection will allow you to inject more ads than Google allows if you configure it to do so.
|
157 |
|
|
|
|
|
158 |
Be careful if you use the float left/right positioning options. These options could cause your AdSense adverts to appear under other elements of your page if you have also set a float value for them (e.g. floating images, and adverts together could be problematic). However the new 'clear' option should allow you to make sure this doesn't happen.
|
159 |
|
160 |
The best advice for any advert plugin is to manually check that you are happy with the advert quantities and positioning it produces, to ensure that you comply with the TOS for your ad program.
|
@@ -163,7 +178,7 @@ You use this plugin at your own risk.
|
|
163 |
|
164 |
= Do you have any testing recommendations? =
|
165 |
|
166 |
-
For testing your ad settings I'd recommend that you first disable any caching plugin, and then set Ad Injection to test mode.
|
167 |
|
168 |
If you are unsure as to why ads are appearing (or aren't) enable debug mode from the UI and look for the 'ADINJ DEBUG' tags in the HTML source of your webpage.
|
169 |
|
@@ -175,7 +190,7 @@ Using a second browser in 'privacy mode' is also a good way of testing your site
|
|
175 |
|
176 |
= Do I need to have WP Super Cache (or anther caching plugin) installed? =
|
177 |
|
178 |
-
No! All the features of this plugin will work with no caching plugin installed. But if you do have WP Super Cache the dynamic features (ad rotation and enabling ads based on IP address and referrer) will still work. And your blog will run a lot faster than with no caching plugin. Usually
|
179 |
|
180 |
= Will the dynamic features work with other caching plugins? =
|
181 |
|
@@ -193,10 +208,19 @@ Note that W3 Total Cache will not cache pages with mfunc tags if you use the Pag
|
|
193 |
|
194 |
The speed of your website does depend on more factors than just page serve time so other features that the caching plugins offer (such as CDN and minification support) may swing the advantage either way.
|
195 |
|
196 |
-
WP Hyper Cache does not support mfunc tags so only use it if you don't want to use any of the dynamic features. If using WP Hyper Cache set the Ad Injection mode to '
|
197 |
|
198 |
For reference: dynamic features are ad rotation, and blocking ad views by IP and referrer.
|
199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
= Can I just have adverts on the home page? =
|
201 |
|
202 |
i.e. adverts on the home page, but not on single posts or pages.
|
@@ -210,7 +234,7 @@ Yes you can do this, there are two ways.
|
|
210 |
|
211 |
Ads will only appear if your front, home or archives page if you show the full post - not if you show excerpts*.
|
212 |
|
213 |
-
*
|
214 |
|
215 |
= How do I stop adverts from appearing on my contacts form page? =
|
216 |
|
@@ -223,7 +247,7 @@ To stop ads appearing on the contact page (or any other post/page) you have many
|
|
223 |
|
224 |
= How can I put ads on category (or other archive pages)? =
|
225 |
|
226 |
-
The top, random and
|
227 |
|
228 |
On the main settings page for Ad Injection just enter the number of adverts you want on these page types using the Archives column in the 'Ad placement settings' section.
|
229 |
|
@@ -243,15 +267,6 @@ Check your style sheet to see if either the text or headings have the 'clear' at
|
|
243 |
|
244 |
Google's AdSense TOS only allow allow three ad units, and three link units per page. If you have for example tried to insert four ad units on your page then Google will (probably) disable the forth one automatically. Read Google's AdSense [program policies](https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=48182 "AdSense program policies") for more info.
|
245 |
|
246 |
-
= What if I am using an incompatible caching plugin? =
|
247 |
-
|
248 |
-
Don't worry - everything will still work except for:
|
249 |
-
|
250 |
-
1. Filtering ads based on the IP address of the visitor.
|
251 |
-
2. Filtering the ads based on the HTTP referrer of the visitor.
|
252 |
-
|
253 |
-
If you aren't interested in these features then it doesn't matter! Just make sure you tick the box to say that you to use 'Direct static ad insertion' on the Ad Injection settings screen.
|
254 |
-
|
255 |
= How can I show different ads for different categories? =
|
256 |
|
257 |
If you want to show different ads for different categories using widgets you can set up filters for the different ads from the widget UI. If you want to show different top, random, or bottom adverts on different categories you can use some very simple PHP in the ad box (this will also work for the widgets as well if you don't like the UI method).
|
@@ -290,7 +305,7 @@ This is John's Ad.
|
|
290 |
This is Paul's Ad.
|
291 |
<?php } ?>`
|
292 |
|
293 |
-
Note this will only work in direct insertion mode. It won
|
294 |
|
295 |
= How can I show different ads to people in different countries? =
|
296 |
|
@@ -325,6 +340,35 @@ Therefore if you are defining ads with both a category and a tag, you will need*
|
|
325 |
|
326 |
I know this might cause extra work for you, but having this restriction allows more precise control of where the ads appear. This is a deliberate design decision, rather than some random behaviour.
|
327 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
= How can I sell my ads / track my ad clicks? =
|
329 |
|
330 |
These are advanced features which I have no plans for adding into the core Ad Injection. You might however be able to use Ad Injection with Google Ad Manager or OpenX Ad Server that should allow you to sell your own ads and track their clicks.
|
@@ -376,7 +420,25 @@ Here are some things to check if the ads are not appearing, or are appearing whe
|
|
376 |
|
377 |
Ad Injection can only (with most themes) insert ads into archive pages if you are showing the full post. The ads will almost certainly get truncated or stripped out if you are showing excerpts.
|
378 |
|
379 |
-
I hope to add proper support for ads in
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
|
381 |
= If you are using a caching plugin =
|
382 |
|
@@ -425,6 +487,10 @@ If you do get any errors please use the 'Report a bug or give feedback' link on
|
|
425 |
|
426 |
== Changelog ==
|
427 |
|
|
|
|
|
|
|
|
|
428 |
= 0.9.7.11 =
|
429 |
* Filter ads by post/page ID
|
430 |
* Other misc bug fixes
|
@@ -598,6 +664,9 @@ Fix 'Something badly wrong in num_rand_ads_to_insert' message that occurs on pag
|
|
598 |
|
599 |
== Upgrade Notice ==
|
600 |
|
|
|
|
|
|
|
601 |
= 0.9.7.11 =
|
602 |
* Filter ads by post/page ID and other misc fixes.
|
603 |
|
3 |
Donate link: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
|
4 |
Tags: ad injection, adsense, advert injection, advert, ad, injection, advertising, affiliate, inject, injection, insert, widget, widgets, sidebar, monetize, monetise, banner, Amazon, ClickBank, TradeDoubler, Google, adBrite, post, WordPress, automatically, plugin, Adsense Injection, free, blog, ad rotation, A:B testing, split testing, WP Super Cache, W3 Total Cache, WP Cache
|
5 |
Requires at least: 2.8.6
|
6 |
+
Tested up to: 3.2.1
|
7 |
+
Stable tag: 1.1.0.1
|
8 |
|
9 |
Injects any adverts (e.g. AdSense) into the WordPress posts or widget area. Restrict who sees ads by post length/age/referrer or IP. Cache compatible.
|
10 |
|
12 |
|
13 |
Ad Injection from [reviewmylife](http://www.reviewmylife.co.uk/ "reviewmylife") injects any kind of advert (e.g. Google AdSense, Amazon Associates, ClickBank, TradeDoubler, etc) into the existing content of your WordPress posts and pages. You can control the number of adverts based on the post length, and it can restrict who sees adverts by post age, visitor referrer and IP address. Adverts can be configured in the post (random, top, and bottom positions) or in any widget/sidebar area. There's support for A:B split testing / ad rotation. And the dynamic restrictions (by IP and referrer) work with WP Super Cache, W3 Total Cache and WP Cache.
|
14 |
|
15 |
+
**New Features 1.1.x.x**
|
16 |
+
|
17 |
+
* Template ads - you can now include ads anywhere in your theme template with some simple tags. You can load the top/random/bottom/footer ads, or you can load an ad from a text file on disk. Template ads inherit the same dynamic and global restrictions as for ads configured via the UI.
|
18 |
+
|
19 |
**New Features 0.9.7.x**
|
20 |
|
21 |
* Archive and home page ads now fully supported with the same controls as ads for single posts/pages.
|
55 |
|
56 |
Adverts can be restricted to posts that are more than a defined numbers of days old. This prevents your regular visitors from having to see your ads.
|
57 |
|
58 |
+
= Category, tag, author, post ID, and post type filters =
|
59 |
+
|
60 |
+
You can configure the adverts to only appear on specific categories, tags, authors, post IDs, or post types (or exclude them using these conditions).
|
61 |
+
|
62 |
+
= Template ads =
|
63 |
|
64 |
+
Ads can be included anywhere in your theme template with some simple tags. You can load the top/random/bottom/footer ads, or you can load an ad from a text file on disk. Template ads inherit the same dynamic and global restrictions as for ads configured via the UI.
|
65 |
|
66 |
= Block ads from IP addresses =
|
67 |
|
111 |
4. Make sure you select the option to say which ad injection mode to use. Dynamic features (ad rotation, and referrer/IP ad filtering) will only work with either 1) WP Super Cache/W3 Total Cache/WP Cache or 2) no caching plugin.
|
112 |
5. Tick the box right at the top to enable your ads.
|
113 |
6. If you are using a caching plugin you may need to clear the cache to see your ads immediately.
|
114 |
+
7. If something doesn't work as expected turn on debug mode and look for the debug messages in the HTML source.
|
115 |
|
116 |
**Recommended cache plugin settings**
|
117 |
|
125 |
|
126 |
You can uninstall by deactivating the plugin and deleting from the WordPress plugins control panel.
|
127 |
|
128 |
+
Uninstalling will delete all files and settings created by Ad Injection. It will also delete any template ads that you have put in the ad-injection-data folder.
|
129 |
+
|
130 |
If you have been using mfunc mode with a caching plugin then you *must* also clear the cache afterwards, otherwise you'll get errors saying the Ad Injection includes can't be found.
|
131 |
|
132 |
== Frequently Asked Questions ==
|
137 |
|
138 |
= How is this plugin different to Adsense Injection by Dax Herrera? =
|
139 |
|
140 |
+
One a basic level it can do the same job as Dax's excellent Adsense Injection. If you want it can just inject AdSense between paragraphs like his plugin does. I used to use his plugin, but found that I wanted a lot more features. Here are some of the extra features.
|
141 |
|
142 |
* Inject any type of advert from any ad provider.
|
143 |
* Restrict ad display by referrer (e.g. can restrict display to search engine visitors).
|
144 |
* Can prevent specific IP addresses from seeing adverts.
|
145 |
+
* Can define randomly positioned adverts, and adverts at the top, bottom and footer of the posts.
|
146 |
* Add adverts to the widget area.
|
147 |
+
* Adverts can be put anywhere in your theme template.
|
148 |
* Ad rotation / split testing.
|
149 |
+
* Restrict adverts by category, tag, author, post ID.
|
150 |
* Vary number of adverts based on post length.
|
151 |
* You can inject raw JavaScript and PHP.
|
152 |
+
* Include ads anywhere in the theme template if you edit your theme's PHP.
|
153 |
* The dynamic features (ad rotation, restricting ads by referrer and IP) work with WP Super Cache, W3 Total Cache and WP Cache.
|
154 |
* Define alternate content for users who are dynamically restricted from seeing ads.
|
155 |
* Compatible with the <!--noadsense--> <!--adsensestart--> in-page tags from Adsense Injection to make migration easy.
|
168 |
|
169 |
Ad Injection is designed as a generic plugin for injecting all types of adverts. It will not specifically check that the defined ad quantities or positions are in compliance of the AdSense TOS for you. For example Ad Injection will allow you to inject more ads than Google allows if you configure it to do so.
|
170 |
|
171 |
+
Note that AdSense has limits as to the number of adverts you can include on a page. If you try to include more then you will end up with 'blank boxes' on your page.
|
172 |
+
|
173 |
Be careful if you use the float left/right positioning options. These options could cause your AdSense adverts to appear under other elements of your page if you have also set a float value for them (e.g. floating images, and adverts together could be problematic). However the new 'clear' option should allow you to make sure this doesn't happen.
|
174 |
|
175 |
The best advice for any advert plugin is to manually check that you are happy with the advert quantities and positioning it produces, to ensure that you comply with the TOS for your ad program.
|
178 |
|
179 |
= Do you have any testing recommendations? =
|
180 |
|
181 |
+
For testing your ad settings I'd recommend that you first disable any caching plugin, and then set Ad Injection to test mode so that 1) you can instantly see any changes you make to the settings and 2) so that only you will see the adverts.
|
182 |
|
183 |
If you are unsure as to why ads are appearing (or aren't) enable debug mode from the UI and look for the 'ADINJ DEBUG' tags in the HTML source of your webpage.
|
184 |
|
190 |
|
191 |
= Do I need to have WP Super Cache (or anther caching plugin) installed? =
|
192 |
|
193 |
+
No! All the features of this plugin will work with no caching plugin installed. But if you do have WP Super Cache the dynamic features (ad rotation and enabling ads based on IP address and referrer) will still work. And your blog will (probably) run a lot faster than with no caching plugin. Usually caching plugin prevent dynamic plugin features from working - but I've spent a lot of time creating a framework to allow this plugin's dynamic features to work with some of the most common caching plugins. Just make sure you choose the mfunc dynamic insertion mode from the Ad Injection settings screen.
|
194 |
|
195 |
= Will the dynamic features work with other caching plugins? =
|
196 |
|
208 |
|
209 |
The speed of your website does depend on more factors than just page serve time so other features that the caching plugins offer (such as CDN and minification support) may swing the advantage either way.
|
210 |
|
211 |
+
WP Hyper Cache does not support mfunc tags so only use it if you don't want to use any of the dynamic features. If using WP Hyper Cache set the Ad Injection mode to 'direct'.
|
212 |
|
213 |
For reference: dynamic features are ad rotation, and blocking ad views by IP and referrer.
|
214 |
|
215 |
+
= What if I am using an incompatible caching plugin? =
|
216 |
+
|
217 |
+
Don't worry - everything will still work except for:
|
218 |
+
|
219 |
+
1. Filtering ads based on the IP address of the visitor.
|
220 |
+
2. Filtering the ads based on the HTTP referrer of the visitor.
|
221 |
+
|
222 |
+
If you aren't interested in these features then it doesn't matter! Just make sure you tick the box to say that you to use 'Direct static ad insertion' on the Ad Injection settings screen.
|
223 |
+
|
224 |
= Can I just have adverts on the home page? =
|
225 |
|
226 |
i.e. adverts on the home page, but not on single posts or pages.
|
234 |
|
235 |
Ads will only appear if your front, home or archives page if you show the full post - not if you show excerpts*.
|
236 |
|
237 |
+
*However if your theme leaves the HTML tags intact then you may in fact see the top ad in your excerpt. Whether you do or not depends on how your theme deals with excerpts.
|
238 |
|
239 |
= How do I stop adverts from appearing on my contacts form page? =
|
240 |
|
247 |
|
248 |
= How can I put ads on category (or other archive pages)? =
|
249 |
|
250 |
+
The top, random, bottom and footer ads can be placed into the category pages. Category pages are a type of archive.
|
251 |
|
252 |
On the main settings page for Ad Injection just enter the number of adverts you want on these page types using the Archives column in the 'Ad placement settings' section.
|
253 |
|
267 |
|
268 |
Google's AdSense TOS only allow allow three ad units, and three link units per page. If you have for example tried to insert four ad units on your page then Google will (probably) disable the forth one automatically. Read Google's AdSense [program policies](https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=48182 "AdSense program policies") for more info.
|
269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
= How can I show different ads for different categories? =
|
271 |
|
272 |
If you want to show different ads for different categories using widgets you can set up filters for the different ads from the widget UI. If you want to show different top, random, or bottom adverts on different categories you can use some very simple PHP in the ad box (this will also work for the widgets as well if you don't like the UI method).
|
305 |
This is Paul's Ad.
|
306 |
<?php } ?>`
|
307 |
|
308 |
+
Note this will only work in direct insertion mode. It won't work in mfunc mode unless you also load in the WordPress database dependencies.
|
309 |
|
310 |
= How can I show different ads to people in different countries? =
|
311 |
|
340 |
|
341 |
I know this might cause extra work for you, but having this restriction allows more precise control of where the ads appear. This is a deliberate design decision, rather than some random behaviour.
|
342 |
|
343 |
+
= Can I put adverts in other locations other than top, random, bottom, footer and widget? =
|
344 |
+
|
345 |
+
Yes - you can put adverts anywhere, if you are willing to edit your theme template.
|
346 |
+
|
347 |
+
The `adinj_print_ad` function can be used anywhere in your theme to print the top, random, bottom or footer ad. It can also be used to load ads stored in text files in the ad-injection-data directory.
|
348 |
+
|
349 |
+
For example this will print the random ad. The ad will be subject to same global and dynamic restrictions an 'in content' random ad, but it will not be subject to conditions relating to the post length, post tags, categories, or number of ads already inserted.
|
350 |
+
|
351 |
+
`<?php if (function_exists('adinj_print_ad')){ adinj_print_ad('random'); } ?>`
|
352 |
+
|
353 |
+
Here are some more examples:
|
354 |
+
|
355 |
+
`<?php if (function_exists('adinj_print_ad')){ adinj_print_ad('top'); } ?>`
|
356 |
+
`<?php if (function_exists('adinj_print_ad')){ adinj_print_ad('bottom'); } ?>`
|
357 |
+
`<?php if (function_exists('adinj_print_ad')){ adinj_print_ad('footer'); } ?>`
|
358 |
+
|
359 |
+
Here is an example of how to load a text file ad from the ad-injection-data directory. They contents of the text file will be printed straight onto the page.
|
360 |
+
|
361 |
+
`<?php if (function_exists('adinj_print_ad')){ adinj_print_ad('adsense-banner-wide.txt'); } ?>`
|
362 |
+
|
363 |
+
The `function_exists` condition ensures that the ads will silently dissapear if the plugin is deactivated rather than generating an error.
|
364 |
+
|
365 |
+
If you are using template ads with a compatible caching plugin you will need to include adshow.php (once on the page) using mfunc tags. You will need to alter the code below to include the correct path.
|
366 |
+
|
367 |
+
`<!--mfunc include_once('/home/public_html/wordpress/wp-content/plugins/ad-injection/adshow.php') -->
|
368 |
+
<?php include_once('/home/public_html/wordpress/wp-content/plugins/ad-injection/adshow.php'); ?>
|
369 |
+
<!--/mfunc-->
|
370 |
+
<?php if (function_exists('adinj_print_ad')){ adinj_print_ad('random'); } ?>`
|
371 |
+
|
372 |
= How can I sell my ads / track my ad clicks? =
|
373 |
|
374 |
These are advanced features which I have no plans for adding into the core Ad Injection. You might however be able to use Ad Injection with Google Ad Manager or OpenX Ad Server that should allow you to sell your own ads and track their clicks.
|
420 |
|
421 |
Ad Injection can only (with most themes) insert ads into archive pages if you are showing the full post. The ads will almost certainly get truncated or stripped out if you are showing excerpts.
|
422 |
|
423 |
+
I hope to add proper support for excerpt ads in a later release.
|
424 |
+
|
425 |
+
= My adverts are overlapping with other page elements (e.g. images) =
|
426 |
+
|
427 |
+
You can try defining the 'clear' display setting so that multiple floated parts of your page do not overlap.
|
428 |
+
|
429 |
+
If you always have a floated image at the top of the page you can set which paragraph the first random advert will start from. If you needed finer control over where the random adverts appear you can use the <!--adstart--> and <!--adend--> tags in the page.
|
430 |
+
|
431 |
+
= I have set the ads to float but the text/headings aren't flowing around them =
|
432 |
+
|
433 |
+
Check your style sheet to see if either the text or headings have the 'clear' attribute set. This may be preventing your text / headings from flowing around the advert.
|
434 |
+
|
435 |
+
= I have configured four Google AdSense ad units but only three are showing. Why? =
|
436 |
+
|
437 |
+
Google's AdSense TOS only allow allow three ad units, and three link units per page. If you have for example tried to insert four ad units on your page then Google will (probably) disable the forth one automatically. Read Google's AdSense [program policies](https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=48182 "AdSense program policies") for more info.
|
438 |
+
|
439 |
+
= Parts of the adverts are appearing in the snippets on the archive and home pages =
|
440 |
+
|
441 |
+
Ad Injection does not currently have support for inserting adverts into snippets, however ads in snippets may or may not work depending on how your theme processes the pages's content. If you end up with unwanted parts of the ad code in your snippets you may need to disable the top/random/bottom ads from your archive, home or front pages using the tick boxes near the top of the UI.
|
442 |
|
443 |
= If you are using a caching plugin =
|
444 |
|
487 |
|
488 |
== Changelog ==
|
489 |
|
490 |
+
= 1.1.0.1 =
|
491 |
+
* Template ads - you can now include ads anywhere in your theme template with some simple tags. You can load the top/random/bottom/footer ads, or you can load an ad from a text file on disk. Template ads inherit the same restrictions as for ads configured via the UI.
|
492 |
+
* UI usability improvements.
|
493 |
+
|
494 |
= 0.9.7.11 =
|
495 |
* Filter ads by post/page ID
|
496 |
* Other misc bug fixes
|
664 |
|
665 |
== Upgrade Notice ==
|
666 |
|
667 |
+
= 1.1.0.1 =
|
668 |
+
* Template ads - you can now include ads anywhere in your theme template with some simple tags. UI usability improvements.
|
669 |
+
|
670 |
= 0.9.7.11 =
|
671 |
* Filter ads by post/page ID and other misc fixes.
|
672 |
|
ui-tab-main.php
CHANGED
@@ -16,7 +16,7 @@ function adinj_tab_main(){
|
|
16 |
|
17 |
|
18 |
<?php adinj_postbox_start(__("Ad placement settings", 'adinj'), 'adsettings'); ?>
|
19 |
-
<p><b>Exclude ads from page types</b></p>
|
20 |
<?php
|
21 |
$count_pages = wp_count_posts('page', 'readable');
|
22 |
$count_posts = wp_count_posts('post', 'readable');
|
@@ -26,38 +26,39 @@ function adinj_tab_main(){
|
|
26 |
<table class="adinjstatustable">
|
27 |
<tr>
|
28 |
<td></td>
|
29 |
-
<td><b>Single</b></td>
|
30 |
-
<td><b>Page</b></td>
|
31 |
<td><b>Home</b></td>
|
32 |
<td><b>Archive</b></td>
|
33 |
-
<td><b>Front</b></td>
|
34 |
<td><b>404</b></td>
|
35 |
<td><b>Search</b></td>
|
36 |
</tr>
|
37 |
<?php
|
38 |
adinj_add_exclude_row('All ads');
|
39 |
-
adinj_add_exclude_row('Top', 'top_');
|
40 |
-
adinj_add_exclude_row('Random', 'random_');
|
41 |
-
adinj_add_exclude_row('Bottom', 'bottom_');
|
42 |
-
adinj_add_exclude_row('Footer', 'footer_');
|
43 |
-
adinj_add_exclude_row('Widget', 'widget_');
|
|
|
44 |
?>
|
|
|
45 |
</table>
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
single - <?php echo $count_posts->publish; ?> single post(s)<br />
|
51 |
-
archive - categories, tags, authors, dates<br />
|
52 |
|
53 |
<p><span style="font-size:10px;"><b>Notes:</b> Your home page is the page displaying your latest posts. It may be different to your front page if you have configured your front page to be a static page.</span></p>
|
54 |
<p><span style="font-size:10px;">If you have <a href='options-reading.php'>set your front page</a> to be a static 'page' rather than your latest posts, the 'page' tick box will also apply to the front page.</span></p>
|
55 |
-
<p><span style="font-size:10px;">
|
|
|
56 |
<p></p>
|
57 |
|
58 |
<table border="0" class="adinjtable">
|
59 |
<tr><td></td><td><b>Single/Page</b></td><td><b>Home</b></td><td><b>Archive</b></td></tr>
|
60 |
-
<tr><td colspan="4"><h3>Top ad</h3></td></tr>
|
61 |
|
62 |
<tr><td><b>Enabled/disabled</b> (on posts longer than):</td><td>
|
63 |
<?php
|
@@ -71,7 +72,7 @@ function adinj_tab_main(){
|
|
71 |
?>
|
72 |
</td></tr>
|
73 |
|
74 |
-
<tr><td>Max num of top ads on whole page:</td><td>1</td><td>
|
75 |
<?php
|
76 |
$num_ads_array = array(0,1,2,3,4,5,6,7,8,9,10);
|
77 |
adinj_selection_box("home_max_num_top_ads_per_page", $num_ads_array);
|
@@ -82,11 +83,11 @@ function adinj_tab_main(){
|
|
82 |
|
83 |
|
84 |
<tr><td colspan="4">
|
85 |
-
|
86 |
<p></p>
|
87 |
</td></tr>
|
88 |
|
89 |
-
<tr><td colspan="4"><h3>Random ads</h3></td></tr>
|
90 |
<tr><td>Max num of random ads on whole page:</td><td>
|
91 |
n/a
|
92 |
</td><td>
|
@@ -96,7 +97,7 @@ function adinj_tab_main(){
|
|
96 |
adinj_selection_box("archive_max_num_random_ads_per_page", $num_ads_array);
|
97 |
?>
|
98 |
</td></tr>
|
99 |
-
<tr><td>Max num of random ads per post:</td><td>
|
100 |
<?php
|
101 |
adinj_selection_box("max_num_of_ads", $num_ads_array);
|
102 |
echo '</td><td>';
|
@@ -125,7 +126,7 @@ function adinj_tab_main(){
|
|
125 |
<p></p>
|
126 |
</td></tr>
|
127 |
|
128 |
-
<tr><td colspan="4"><h3>Bottom ad</h3></td></tr>
|
129 |
|
130 |
<tr><td><b>Enabled/disabled</b> (on posts longer than):</td><td>
|
131 |
<?php
|
@@ -137,7 +138,7 @@ function adinj_tab_main(){
|
|
137 |
?>
|
138 |
</td></tr>
|
139 |
|
140 |
-
<tr><td>Max num of bottom ads on whole page:</td><td>1</td><td>
|
141 |
<?php
|
142 |
adinj_selection_box("home_max_num_bottom_ads_per_page", $num_ads_array);
|
143 |
echo '</td><td>';
|
@@ -146,11 +147,11 @@ function adinj_tab_main(){
|
|
146 |
</td></tr>
|
147 |
|
148 |
<tr><td colspan="4">
|
149 |
-
|
150 |
<p></p>
|
151 |
</td></tr>
|
152 |
|
153 |
-
<tr><td colspan="4"><h3>Footer ad</h3></td></tr>
|
154 |
<tr><td colspan="4">
|
155 |
<?php adinj_condition_tables('footer_', 'ui_footer_conditions_show'); ?>
|
156 |
<p></p>
|
@@ -166,7 +167,7 @@ function adinj_tab_main(){
|
|
166 |
|
167 |
<?php adinj_postbox_start(__("Adverts", 'adinj'), 'adverts'); ?>
|
168 |
|
169 |
-
<h3>Top ad (above the post content - this is not a 'header' ad)</h3>
|
170 |
<table border="0" class="adinjtable">
|
171 |
<tr><td>
|
172 |
<textarea name="ad_code_top_1" rows="10" cols="60"><?php echo $ops['ad_code_top_1']; ?></textarea>
|
@@ -181,7 +182,7 @@ function adinj_tab_main(){
|
|
181 |
</table>
|
182 |
<p><span style="font-size:10px;">Be especially careful if you decide to use the 'float' layout options. Make sure that you don't have adverts floated over the top of other page elements, or vice-versa.</span></p>
|
183 |
|
184 |
-
<h3>Random ad (inserted randomly between paragraphs)</h3>
|
185 |
<table border="0" class="adinjtable">
|
186 |
<tr><td>
|
187 |
<textarea name="ad_code_random_1" rows="10" cols="60"><?php echo $ops['ad_code_random_1']; ?></textarea>
|
@@ -195,7 +196,7 @@ function adinj_tab_main(){
|
|
195 |
</td></tr>
|
196 |
</table>
|
197 |
|
198 |
-
<h3>Bottom ad (below the post content
|
199 |
<table border="0" class="adinjtable">
|
200 |
<tr><td>
|
201 |
<textarea name="ad_code_bottom_1" rows="10" cols="60"><?php echo $ops['ad_code_bottom_1']; ?></textarea>
|
@@ -210,7 +211,7 @@ function adinj_tab_main(){
|
|
210 |
</table>
|
211 |
|
212 |
|
213 |
-
<h3>Footer ad (
|
214 |
<table border="0" class="adinjtable">
|
215 |
<tr><td>
|
216 |
<textarea name="ad_code_footer_1" rows="10" cols="60"><?php echo $ops['ad_code_footer_1']; ?></textarea>
|
@@ -248,7 +249,7 @@ function adinj_tab_main(){
|
|
248 |
function adinj_global_settings_box($ops){
|
249 |
adinj_postbox_start(__("Global settings", 'adinj'), 'global'); ?>
|
250 |
|
251 |
-
<p>These settings apply to all ads (
|
252 |
|
253 |
<input type="radio" name="ads_enabled" value="on" <?php if ($ops['ads_enabled']=='on') echo 'checked="checked"'; ?> /> <b>On: <?php _e('Ads enabled', 'adinj') ?></b><br />
|
254 |
<input type="radio" name="ads_enabled" value="off" <?php if ($ops['ads_enabled']=='off' || $ops['ads_enabled']=='') echo 'checked="checked"'; ?> /> <b>Off</b><br />
|
@@ -348,13 +349,12 @@ function adinj_insertion_mode_box($ops){
|
|
348 |
</script>
|
349 |
|
350 |
|
351 |
-
<div class="inside" style="margin:10px">
|
352 |
<h4><a name="dynamic"></a>Show ads only to search engine visitors (dynamic feature)</h4>
|
353 |
|
354 |
<blockquote>
|
355 |
<?php adinj_add_checkbox('sevisitors_only') ?><?php _e("Only show ads to search engine visitors (customise search engine referrers below if necessary).", 'adinj') ?><br />
|
356 |
<textarea name="ad_referrers" rows="2" cols="70"><?php echo $ops['ad_referrers']; ?></textarea>
|
357 |
-
<p>Comma separated list e.g.: <br /><code>.google., .bing., .yahoo., .ask., search?, search
|
358 |
</blockquote>
|
359 |
|
360 |
<h4>Blocked IP addresses (dynamic feature)</h4>
|
@@ -368,7 +368,6 @@ function adinj_insertion_mode_box($ops){
|
|
368 |
|
369 |
<p>For reference your current IP address is <code><?php echo $_SERVER['REMOTE_ADDR'] ?></code></p>
|
370 |
</blockquote>
|
371 |
-
</div>
|
372 |
|
373 |
<?php adinj_postbox_end();
|
374 |
}
|
@@ -390,7 +389,7 @@ function adinj_add_exclude_row($name, $prefix=''){
|
|
390 |
|
391 |
function adinj_random_ad_limit_table(){
|
392 |
?>
|
393 |
-
<tr><td>No ads if shorter than:</td>
|
394 |
<?php
|
395 |
$prefixes = array("", "home_", "archive_");
|
396 |
$unit = adinj_counting_unit_description();
|
@@ -402,7 +401,7 @@ function adinj_random_ad_limit_table(){
|
|
402 |
echo '</td>';
|
403 |
} ?>
|
404 |
</tr>
|
405 |
-
<tr><td>Only 1 ad if
|
406 |
<?php
|
407 |
foreach ($prefixes as $prefix){
|
408 |
echo '<td>';
|
@@ -410,7 +409,7 @@ function adinj_random_ad_limit_table(){
|
|
410 |
echo '</td>';
|
411 |
} ?>
|
412 |
</tr>
|
413 |
-
<tr><td>Only 2 ads if
|
414 |
<?php
|
415 |
foreach ($prefixes as $prefix){
|
416 |
echo '<td>';
|
@@ -419,7 +418,7 @@ function adinj_random_ad_limit_table(){
|
|
419 |
}
|
420 |
?>
|
421 |
</tr>
|
422 |
-
<tr><td>Only 3 ads if
|
423 |
<?php
|
424 |
foreach ($prefixes as $prefix){
|
425 |
echo '<td>';
|
@@ -540,7 +539,7 @@ function adinj_side_status_box(){
|
|
540 |
<td><b>A</b></td>
|
541 |
</tr>
|
542 |
<tr>
|
543 |
-
<td style="text-align:right"><b>Top</b></td>
|
544 |
<td><?php echo adinj_count_live_ads('top', $ops); ?></td>
|
545 |
<td><?php echo adinj_count_live_ads('top_alt', $ops); ?></td>
|
546 |
<td><?php adinj_print_ad_dot('top', 'single') ?></td>
|
@@ -549,7 +548,7 @@ function adinj_side_status_box(){
|
|
549 |
<td><?php adinj_print_ad_dot('top', 'archive') ?></td>
|
550 |
</tr>
|
551 |
<tr>
|
552 |
-
<td style="text-align:right"><b>Random</b></td>
|
553 |
<td><?php echo adinj_count_live_ads('random', $ops); ?></td>
|
554 |
<td><?php echo adinj_count_live_ads('random_alt', $ops); ?></td>
|
555 |
<td><?php adinj_print_ad_dot('random', 'single') ?></td>
|
@@ -558,7 +557,7 @@ function adinj_side_status_box(){
|
|
558 |
<td><?php adinj_print_ad_dot('random', 'archive') ?></td>
|
559 |
</tr>
|
560 |
<tr>
|
561 |
-
<td style="text-align:right"><b>Bottom</b></td>
|
562 |
<td><?php echo adinj_count_live_ads('bottom', $ops); ?></td>
|
563 |
<td><?php echo adinj_count_live_ads('bottom_alt', $ops); ?></td>
|
564 |
<td><?php adinj_print_ad_dot('bottom', 'single') ?></td>
|
@@ -567,7 +566,7 @@ function adinj_side_status_box(){
|
|
567 |
<td><?php adinj_print_ad_dot('bottom', 'archive') ?></td>
|
568 |
</tr>
|
569 |
<tr>
|
570 |
-
<td style="text-align:right"><b>Footer</b></td>
|
571 |
<td><?php echo adinj_count_live_ads('footer', $ops); ?></td>
|
572 |
<td><?php echo adinj_count_live_ads('footer_alt', $ops); ?></td>
|
573 |
<td><?php adinj_print_ad_dot('footer', 'single') ?></td>
|
16 |
|
17 |
|
18 |
<?php adinj_postbox_start(__("Ad placement settings", 'adinj'), 'adsettings'); ?>
|
19 |
+
<p><b><a name="pagetypefilters"></a>Exclude ads from page types</b></p>
|
20 |
<?php
|
21 |
$count_pages = wp_count_posts('page', 'readable');
|
22 |
$count_posts = wp_count_posts('post', 'readable');
|
26 |
<table class="adinjstatustable">
|
27 |
<tr>
|
28 |
<td></td>
|
29 |
+
<td><b>Single(<?php echo $count_posts->publish; ?>)</b></td>
|
30 |
+
<td><b>Page(<?php echo $count_pages->publish; ?>)</b></td>
|
31 |
<td><b>Home</b></td>
|
32 |
<td><b>Archive</b></td>
|
33 |
+
<td><b><a href="<?php echo get_bloginfo('url'); ?>" target="_new">Front</a></b></td>
|
34 |
<td><b>404</b></td>
|
35 |
<td><b>Search</b></td>
|
36 |
</tr>
|
37 |
<?php
|
38 |
adinj_add_exclude_row('All ads');
|
39 |
+
adinj_add_exclude_row('|_ <a href="#topadplacement">Top</a>', 'top_');
|
40 |
+
adinj_add_exclude_row('|_ <a href="#randomadplacement">Random</a>', 'random_');
|
41 |
+
adinj_add_exclude_row('|_ <a href="#bottomadplacement">Bottom</a>', 'bottom_');
|
42 |
+
adinj_add_exclude_row('|_ <a href="#footeradplacement">Footer</a>', 'footer_');
|
43 |
+
adinj_add_exclude_row('|_ Widget', 'widget_');
|
44 |
+
adinj_add_exclude_row('|_ Template', 'template_');
|
45 |
?>
|
46 |
+
<tr><td colspan="8"><span style="font-size:10px;">Go to the <a href="widgets.php">widget control panel</a> to set up any widgets. See the <a href="http://wordpress.org/extend/plugins/ad-injection/faq/" target="_new">FAQ</a> for how to set up template ads.</span></td></tr>
|
47 |
</table>
|
48 |
|
49 |
+
<p>
|
50 |
+
|
51 |
+
</p>
|
|
|
|
|
52 |
|
53 |
<p><span style="font-size:10px;"><b>Notes:</b> Your home page is the page displaying your latest posts. It may be different to your front page if you have configured your front page to be a static page.</span></p>
|
54 |
<p><span style="font-size:10px;">If you have <a href='options-reading.php'>set your front page</a> to be a static 'page' rather than your latest posts, the 'page' tick box will also apply to the front page.</span></p>
|
55 |
+
<p><span style="font-size:10px;">Archive pages are the categories, tags, authors and date pages.</span></p>
|
56 |
+
|
57 |
<p></p>
|
58 |
|
59 |
<table border="0" class="adinjtable">
|
60 |
<tr><td></td><td><b>Single/Page</b></td><td><b>Home</b></td><td><b>Archive</b></td></tr>
|
61 |
+
<tr><td colspan="4"><h3><a name="topadplacement"></a>Top ad [<a href="#topadcode">code</a>] [<a href="#pagetypefilters">page type filters</a>]</h3></td></tr>
|
62 |
|
63 |
<tr><td><b>Enabled/disabled</b> (on posts longer than):</td><td>
|
64 |
<?php
|
72 |
?>
|
73 |
</td></tr>
|
74 |
|
75 |
+
<tr><td><b>|_</b> Max num of top ads on whole page:</td><td>1</td><td>
|
76 |
<?php
|
77 |
$num_ads_array = array(0,1,2,3,4,5,6,7,8,9,10);
|
78 |
adinj_selection_box("home_max_num_top_ads_per_page", $num_ads_array);
|
83 |
|
84 |
|
85 |
<tr><td colspan="4">
|
86 |
+
<b>|_</b><?php adinj_condition_tables('top_', 'ui_top_conditions_show'); ?>
|
87 |
<p></p>
|
88 |
</td></tr>
|
89 |
|
90 |
+
<tr><td colspan="4"><h3><a name="randomadplacement"></a>Random ads [<a href="#randomadcode">code</a>] [<a href="#pagetypefilters">page type filters</a>]</h3></td></tr>
|
91 |
<tr><td>Max num of random ads on whole page:</td><td>
|
92 |
n/a
|
93 |
</td><td>
|
97 |
adinj_selection_box("archive_max_num_random_ads_per_page", $num_ads_array);
|
98 |
?>
|
99 |
</td></tr>
|
100 |
+
<tr><td><b>|_ </b>Max num of random ads per post:</td><td>
|
101 |
<?php
|
102 |
adinj_selection_box("max_num_of_ads", $num_ads_array);
|
103 |
echo '</td><td>';
|
126 |
<p></p>
|
127 |
</td></tr>
|
128 |
|
129 |
+
<tr><td colspan="4"><h3><a name="bottomadplacement"></a>Bottom ad [<a href="#bottomadcode">code</a>] [<a href="#pagetypefilters">page type filters</a>]</h3></td></tr>
|
130 |
|
131 |
<tr><td><b>Enabled/disabled</b> (on posts longer than):</td><td>
|
132 |
<?php
|
138 |
?>
|
139 |
</td></tr>
|
140 |
|
141 |
+
<tr><td><b>|_ </b>Max num of bottom ads on whole page:</td><td>1</td><td>
|
142 |
<?php
|
143 |
adinj_selection_box("home_max_num_bottom_ads_per_page", $num_ads_array);
|
144 |
echo '</td><td>';
|
147 |
</td></tr>
|
148 |
|
149 |
<tr><td colspan="4">
|
150 |
+
<b>|_ </b><?php adinj_condition_tables('bottom_', 'ui_bottom_conditions_show'); ?>
|
151 |
<p></p>
|
152 |
</td></tr>
|
153 |
|
154 |
+
<tr><td colspan="4"><h3><a name="footeradplacement"></a>Footer ad [<a href="#footeradcode">code</a>] [<a href="#pagetypefilters">page type filters</a>]</h3></td></tr>
|
155 |
<tr><td colspan="4">
|
156 |
<?php adinj_condition_tables('footer_', 'ui_footer_conditions_show'); ?>
|
157 |
<p></p>
|
167 |
|
168 |
<?php adinj_postbox_start(__("Adverts", 'adinj'), 'adverts'); ?>
|
169 |
|
170 |
+
<h3><a name="topadcode"></a>Top ad (above the post content - this is not a 'header' ad) [<a href="#topadplacement">placement</a>] <!--[<a href='?page=ad-injection&tab=adrotation#multiple_top'>pool</a>]--></h3>
|
171 |
<table border="0" class="adinjtable">
|
172 |
<tr><td>
|
173 |
<textarea name="ad_code_top_1" rows="10" cols="60"><?php echo $ops['ad_code_top_1']; ?></textarea>
|
182 |
</table>
|
183 |
<p><span style="font-size:10px;">Be especially careful if you decide to use the 'float' layout options. Make sure that you don't have adverts floated over the top of other page elements, or vice-versa.</span></p>
|
184 |
|
185 |
+
<h3><a name="randomadcode"></a>Random ad (inserted randomly between paragraphs) [<a href="#randomadplacement">placement</a>] <!--[<a href='?page=ad-injection&tab=adrotation#multiple_random'>pool</a>]--></h3>
|
186 |
<table border="0" class="adinjtable">
|
187 |
<tr><td>
|
188 |
<textarea name="ad_code_random_1" rows="10" cols="60"><?php echo $ops['ad_code_random_1']; ?></textarea>
|
196 |
</td></tr>
|
197 |
</table>
|
198 |
|
199 |
+
<h3><a name="bottomadcode"></a>Bottom ad (below the post content) [<a href="#bottomadplacement">placement</a>] <!--[<a href='?page=ad-injection&tab=adrotation#multiple_bottom'>pool</a>]--></h3>
|
200 |
<table border="0" class="adinjtable">
|
201 |
<tr><td>
|
202 |
<textarea name="ad_code_bottom_1" rows="10" cols="60"><?php echo $ops['ad_code_bottom_1']; ?></textarea>
|
211 |
</table>
|
212 |
|
213 |
|
214 |
+
<h3><a name="footeradcode"></a>Footer ad (put into 'the_footer' hook - not supported by all themes) [<a href="#footeradplacement">placement</a>] <!--[<a href='?page=ad-injection&tab=adrotation#multiple_footer'>pool</a>]--></h3>
|
215 |
<table border="0" class="adinjtable">
|
216 |
<tr><td>
|
217 |
<textarea name="ad_code_footer_1" rows="10" cols="60"><?php echo $ops['ad_code_footer_1']; ?></textarea>
|
249 |
function adinj_global_settings_box($ops){
|
250 |
adinj_postbox_start(__("Global settings", 'adinj'), 'global'); ?>
|
251 |
|
252 |
+
<p>These settings apply to all ads (top, random, bottom, footer, and widget). They will override all other settings.</p>
|
253 |
|
254 |
<input type="radio" name="ads_enabled" value="on" <?php if ($ops['ads_enabled']=='on') echo 'checked="checked"'; ?> /> <b>On: <?php _e('Ads enabled', 'adinj') ?></b><br />
|
255 |
<input type="radio" name="ads_enabled" value="off" <?php if ($ops['ads_enabled']=='off' || $ops['ads_enabled']=='') echo 'checked="checked"'; ?> /> <b>Off</b><br />
|
349 |
</script>
|
350 |
|
351 |
|
|
|
352 |
<h4><a name="dynamic"></a>Show ads only to search engine visitors (dynamic feature)</h4>
|
353 |
|
354 |
<blockquote>
|
355 |
<?php adinj_add_checkbox('sevisitors_only') ?><?php _e("Only show ads to search engine visitors (customise search engine referrers below if necessary).", 'adinj') ?><br />
|
356 |
<textarea name="ad_referrers" rows="2" cols="70"><?php echo $ops['ad_referrers']; ?></textarea>
|
357 |
+
<p>Comma separated list e.g.: <br /><code>.google., .bing., .yahoo., .ask., search?, search.</code></p>
|
358 |
</blockquote>
|
359 |
|
360 |
<h4>Blocked IP addresses (dynamic feature)</h4>
|
368 |
|
369 |
<p>For reference your current IP address is <code><?php echo $_SERVER['REMOTE_ADDR'] ?></code></p>
|
370 |
</blockquote>
|
|
|
371 |
|
372 |
<?php adinj_postbox_end();
|
373 |
}
|
389 |
|
390 |
function adinj_random_ad_limit_table(){
|
391 |
?>
|
392 |
+
<tr><td> <b>|_</b> No ads if shorter than:</td>
|
393 |
<?php
|
394 |
$prefixes = array("", "home_", "archive_");
|
395 |
$unit = adinj_counting_unit_description();
|
401 |
echo '</td>';
|
402 |
} ?>
|
403 |
</tr>
|
404 |
+
<tr><td> <b>|_</b> Only 1 ad if post shorter than:</td>
|
405 |
<?php
|
406 |
foreach ($prefixes as $prefix){
|
407 |
echo '<td>';
|
409 |
echo '</td>';
|
410 |
} ?>
|
411 |
</tr>
|
412 |
+
<tr><td> <b>|_</b> Only 2 ads if post shorter than:</td>
|
413 |
<?php
|
414 |
foreach ($prefixes as $prefix){
|
415 |
echo '<td>';
|
418 |
}
|
419 |
?>
|
420 |
</tr>
|
421 |
+
<tr><td> <b>|_</b> Only 3 ads if post shorter than:</td>
|
422 |
<?php
|
423 |
foreach ($prefixes as $prefix){
|
424 |
echo '<td>';
|
539 |
<td><b>A</b></td>
|
540 |
</tr>
|
541 |
<tr>
|
542 |
+
<td style="text-align:right"><b><a href="#topadplacement">Top</a></b></td>
|
543 |
<td><?php echo adinj_count_live_ads('top', $ops); ?></td>
|
544 |
<td><?php echo adinj_count_live_ads('top_alt', $ops); ?></td>
|
545 |
<td><?php adinj_print_ad_dot('top', 'single') ?></td>
|
548 |
<td><?php adinj_print_ad_dot('top', 'archive') ?></td>
|
549 |
</tr>
|
550 |
<tr>
|
551 |
+
<td style="text-align:right"><b><a href="#randomadplacement">Random</a></b></td>
|
552 |
<td><?php echo adinj_count_live_ads('random', $ops); ?></td>
|
553 |
<td><?php echo adinj_count_live_ads('random_alt', $ops); ?></td>
|
554 |
<td><?php adinj_print_ad_dot('random', 'single') ?></td>
|
557 |
<td><?php adinj_print_ad_dot('random', 'archive') ?></td>
|
558 |
</tr>
|
559 |
<tr>
|
560 |
+
<td style="text-align:right"><b><a href="#bottomadplacement">Bottom</a></b></td>
|
561 |
<td><?php echo adinj_count_live_ads('bottom', $ops); ?></td>
|
562 |
<td><?php echo adinj_count_live_ads('bottom_alt', $ops); ?></td>
|
563 |
<td><?php adinj_print_ad_dot('bottom', 'single') ?></td>
|
566 |
<td><?php adinj_print_ad_dot('bottom', 'archive') ?></td>
|
567 |
</tr>
|
568 |
<tr>
|
569 |
+
<td style="text-align:right"><b><a href="#footeradplacement">Footer</a></b></td>
|
570 |
<td><?php echo adinj_count_live_ads('footer', $ops); ?></td>
|
571 |
<td><?php echo adinj_count_live_ads('footer_alt', $ops); ?></td>
|
572 |
<td><?php adinj_print_ad_dot('footer', 'single') ?></td>
|