function adinj_tab_debug() { $ops = adinj_options(); adinj_postbox_start(__("Debugging", 'adinj'), 'debugging'); adinj_add_checkbox('debug_mode'); ?> Enable debug mode <p>If you are not sure why ads aren't appearing, or why they are appearing, enable debug mode and look at the debug information (search for 'ADINJ DEBUG') in the HTML of your content pages.</p> <?php if (adinj_problem_with_wpminify_check()) { echo adinj_get_problem_with_wpminify_message(); } adinj_debug_information(); ?> <p></p> <p>If you want to restore all settings (excluding the ad contents) to their default values use this button.</p> <input type="submit" name="adinj_action" value="<?php _e('Reset to Default', 'adinj'); ?> " /> <p>You can delete the database settings if you are going to uninstall Ad Injection (they will be automatically deleted if you uninstall via WordPress as well).</p> <input type="submit" name="adinj_action" value="<?php _e('Delete settings from DB', 'adinj'); ?> " /> <p>This button will delete all your Ad Injection widgets.</p> <input type="submit" name="adinj_action" value="<?php _e('Delete widget settings from DB', 'adinj'); ?> " /> <?php adinj_postbox_end(); }
function adinj_testads() { adinj_postbox_start(__("Test Adverts and template ad examples", 'adinj'), "testads", '95%'); $rnd = rand(0, 2); ?> <p>You can copy and paste these adverts into the boxes above to test your ad setup before switching to your real ads.</p> <h4><a name="468x60"></a>468x60 banner</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#ff9999; width:468px; height:60px;"> <h5>AD INJECTION TEST ADVERT 468x60 - <?php adinj_get_test_ad_link_escaped($rnd); ?> </h5> </div></textarea></p> <div style="background-color:#99ffff; width:468px; height:60px;"> <h5>AD INJECTION TEST ADVERT 468x60 - <?php adinj_get_test_ad_link($rnd); ?> </h5> </div><p></p> <h4><a name="728x90"></a>728x90 banner</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#ff9999; width:728px; height:90px;"> <h5>AD INJECTION TEST ADVERT 728x90</h5> <?php adinj_get_test_ad_link_escaped($rnd); ?> <br /> <a href="http://www.advancedhtml.co.uk/">www.advancedhtml.co.uk</a> </div></textarea></p> <div style="background-color:#ff9999; width:728px; height:90px;"> <h5>AD INJECTION TEST ADVERT 728x90</h5> <?php adinj_get_test_ad_link($rnd); ?> <br /> <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a> </div><p></p> <h4>160x90 link unit</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#ccff99; width:160px; height:90px;"> <h5>TEST ADVERT 160x90</h5> <?php adinj_get_test_ad_link_escaped($rnd); ?> <br /> <a href="http://www.reviewmylife.co.uk/">reviewmylife.co.uk</a> </div></textarea></p> <div style="background-color:#ccff99; width:160px; height:90px;"> <h5>TEST ADVERT 160x90</h5> <?php adinj_get_test_ad_link($rnd); ?> <br /> <a href="http://www.reviewmylife.co.uk/">reviewmylife.co.uk</a><br /> </div><p></p> <h4><a name="468x15"></a>468x15 link unit</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#cccc99; width:468px; height:15px;"> <font size="-2"><b>TEST ADVERT 160x90</b> <?php adinj_get_test_ad_link_escaped($rnd); ?> </font> </div></textarea></p> <div style="background-color:#cccc99; width:468px; height:15px;"> <font size="-2"><b>TEST ADVERT 468x15</b> <?php adinj_get_test_ad_link($rnd); ?> </font> </div><p></p> <h4><a name="336x280"></a>336x280 large rectangle</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#ccccff; width:336px; height:280px;"> <h5>TEST ADVERT 336x280 - <?php adinj_get_test_ad_link_escaped($rnd); ?> </h5> </div></textarea></p> <div style="background-color:#ccccff; width:336px; height:280px;"> <h5>TEST ADVERT 336x280 - <?php adinj_get_test_ad_link($rnd); ?> </h5> </div><p></p> <h4>468x60 banner with dynamic PHP</h4> <p>The PHP will execute if you use as long as you don't use an caching plugin.</p> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="5"><div style="background-color:#ffff99; width:468px; height:60px;"> <b>TEST ADVERT 468x60 with date() and rand()</b><br /> <?php echo "date=".date("Y-m-d H:i:s") ." rand=".rand(); ?><br /> <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a> </div></textarea></p> <div style="background-color:#ffff99; width:468px; height:60px;"> <b>TEST ADVERT 468x60 with date() and rand()</b><br /> <?php echo "date=" . date("Y-m-d H:i:s") . " rand=" . rand(); ?> <br /> <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a> </div><p></p> <h4>Template ad examples</h4> <p>Template ads allow any of the ads to be inserted anywhere in your theme. <b>*Don't*</b> try putting any of this code into one of the ad boxes - it is not an advert - it is code to load an advert directly into your theme.</p> <b>Simple examples for loading top, random, bottom or footer ads</b><br /> <p>If you are using mfunc mode (for selected caching plugins) you may need to include the ad framework loading code snippet below. You would have to include this snippet above the ad display code.</p> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="1"> <?php if (function_exists('adinj_print_ad')){ adinj_print_ad('top'); } ?></textarea></p> <p>You can load the 'top', 'random', 'bottom', and 'footer' ads.</p> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="1"> <?php if (function_exists('adinj_print_ad')){ adinj_print_ad('hotel-ad.txt'); } ?></textarea></p> <p>Or you can load ads stored as text files in the ad-injection-data directory (<?php echo ADINJ_AD_PATH; ?> /)</p> <b>Ad framework loading code for mfunc mode with caching plugins + 1 random ad <font color="red">(mfunc mode not recommended unless you really know what it is for!</font></b><br /> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="110" rows="5"><!--mfunc include_once('<?php echo ADINJ_PATH; ?> /adshow.php') --> <?php include_once('<?php echo ADINJ_PATH; ?> /adshow.php'); ?> <!--/mfunc--> <?php if (function_exists('adinj_print_ad')){ adinj_print_ad('random'); } ?></textarea></p> <?php adinj_postbox_end(); }
function adinj_docs() { ?> <hr /> <?php adinj_postbox_start(__("Quick Start", 'adinj'), "docsquickstart", '95%'); ?> <p>1. Copy and paste your ad code into the ad code boxes. [<a href="#adverts">Goto adverts</a>]</p> <p>2. Choose how many ads of each type you want displayed. [<a href="#adsettings">Goto ad placement settings</a>]</p> <p>3. Make sure ads are enabled for the page types you want them to be enabled for. [<a href="#global">Goto global settings</a>]</p> <p>4. Check the ad insertion mode. You will probably want 'direct' mode unless you are 1) an advanced user who understands what mfunc is, 2) using a compatible caching plugin and 3) are using the dynamic features (dynamic restrictions or ad rotation). [<a href="#restrictions">Goto 'Ad insertion mode and dynamic ad display restriction'</a>]</p> <p>5. Enable your ads by selecting the 'on' option at the top. [<a href="#global">Goto global settings</a>]</p> <?php adinj_postbox_end(); }
function adinj_docs_tags() { ?> <?php adinj_postbox_start(__("Supported in-page tags", 'adinj'), "docs_tags", '95%'); ?> <p>These tags can be inserted into the page source to override the configured behaviour on single posts and pages. Because sometimes specific pages need to be treated differently.</p> <h3>Fully supported tags</h3><br /> <ul> <li><code><!--topad--></code> OR <code><!--randomad--></code> OR <code><!--bottomad--></code> - These tags allow precise positioning of the adverts instead of using the computer calculated positions.</li> </ul> <ul> <li><code><!--adinj_exclude_start--><!--adinj_exclude_end--></code> - Exclude ads from specific sections of the post.</li> </ul> <ul> <li><code><!--adstart--></code> - Random ads will start from this point.</li> <li><code><!--adend--></code> - Random ads will not be inserted after this point.</li> </ul> <p>The above adstart/adend tags and below adsensestart tag will not affect the top and bottom ad.</p> <h3>Other tags</h3><br /> <ul> <li><code><!--noadsense--></code> OR <code><!-no-adsense--></code> OR <code><!--NoAds--></code> OR <code><!--OffAds--></code> - disables all ads on this page. These tags are here to make this plugin compatible with the tags from Adsense Injection, Whydowork Adsense and Quick Adsense.</li> </ul> <p></p> <ul> <li><code><!--adsensestart--></code> - Random ads will start from this point. For compatibility with Adsense Injection.</li> </ul> <p></p> <ul> <li><code><!--adsandwich--></code> - Inserts the top and bottom ad but no random ads. Disables all other ads.</li> <li><code><!--adfooter--></code> - Insert a single ad at the very bottom. Disables all other ads.</li> </ul> <h4>Custom field for disabling adverts</h4> <p>To disable all adverts on the page you can also set the custom <code>disable_adverts</code> field to '1' from the WordPress post editor.</p> <?php adinj_postbox_end(); }
function adinj_docs() { ?> <hr /> <?php adinj_postbox_start(__("Quick Start", 'adinj'), "docs", '95%'); ?> <p>1. Copy and paste your ad code into the ad code boxes.</p> <p>2. Choose how many ads of each type you want displayed.</p> <p>3. Configure any ad positioning (optional).</p> <p>4. Check the ad insertion mode (in the Insertion mode and ad display restriction section).</p> <p>5. If you are using a compatible ad insertion mode you may configure dynamic ad display restrictions. i.e. showing ads only to certain people (e.g. search engine visitors), or blocking ads from specific IPs.</p> <p>6. Enable your ads (tick box at the very top).</p> </div> <h3><?php echo adinj_get_logo(); ?> Supported in-page tags</h3> <div class="inside" style="margin:10px"> <p>These tags can be inserted into the page source to override the configured behaviour on individual pages. Because sometimes specific pages need to be treated differently.</p> <ul> <li><code><!--noadsense--></code> OR <code><!-no-adsense--></code> OR <code><!--NoAds--></code> OR <code><!--OffAds--></code> - disables all ads on this page. These tags are here to make this plugin compatible with the tags from Adsense Injection, Whydowork Adsense and Quick Adsense.</li> </ul> <p></p> <ul> <li><code><!--adsandwich--></code> - Inserts the top and bottom ad but no random ads. Disables all other ads.</li> <li><code><!--adfooter--></code> - Insert a single ad at the very bottom. Disables all other ads.</li> </ul> <p></p> <ol> <li><code><!--adsensestart--></code> - Random ads will start from this point*. For compatibility with Adsense Injection.</li> <li><code><!--adsenseend--></code> - Random ads will not be inserted after this point*. New tag but I've kept the Adsense Injection naming convention to make it fit with the above tag.</li> <li><code><!--adstart--></code> - Random ads will start from this point*.</li> <li><code><!--adend--></code> - Random ads will not be inserted after this point*.</li> </ol> <p>These four tags will not affect the top and bottom ad.</p> <h4>Custom field for disabling adverts</h4> <p>To disable all adverts on the page you can also set the custom <code>disable_adverts</code> field to '1' from the WordPress post editor.</p> <?php adinj_postbox_end(); ?> <?php adinj_postbox_start(__("Test Adverts", 'adinj'), "testads", '95%'); ?> <p>You can copy and paste these adverts into the boxes above to test your ad setup before switching to your real ads.</p> <h4><a name="468x60"></a>468x60 banner</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#ff9999; width:468px; height:60px;"> <h5>TEST ADVERT 468x60 - <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a></h5> </div></textarea></p> <div style="background-color:#99ffff; width:468px; height:60px;"> <h5>TEST ADVERT 468x60 - <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a></h5> </div><p></p> <h4><a name="728x90"></a>728x90 banner</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#ff9999; width:728px; height:90px;"> <h5>TEST ADVERT 728x90</h5> <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a><br /> <a href="http://www.advancedhtml.co.uk/">www.advancedhtml.co.uk</a> </div></textarea></p> <div style="background-color:#ff9999; width:728px; height:90px;"> <h5>TEST ADVERT 728x90</h5> <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a><br /> <a href="http://www.advancedhtml.co.uk/">www.advancedhtml.co.uk</a> </div><p></p> <h4>160x90 link unit</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#ccff99; width:160px; height:90px;"> <h5>TEST ADVERT 160x90</h5> <a href="http://www.reviewmylife.co.uk/">reviewmylife.co.uk</a><br /> <a href="http://www.advancedhtml.co.uk/">advancedhtml.co.uk</a> </div></textarea></p> <div style="background-color:#ccff99; width:160px; height:90px;"> <h5>TEST ADVERT 160x90</h5> <a href="http://www.reviewmylife.co.uk/">reviewmylife.co.uk</a> <a href="http://www.advancedhtml.co.uk/">advancedhtml.co.uk</a><br /> </div><p></p> <h4><a name="468x15"></a>468x15 link unit</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#cccc99; width:468px; height:15px;"> <font size="-2"><b>TEST ADVERT 160x90</b> <a href="http://www.reviewmylife.co.uk/">reviewmylife.co.uk</a></font> </div></textarea></p> <div style="background-color:#cccc99; width:468px; height:15px;"> <font size="-2"><b>TEST ADVERT 160x90</b> <a href="http://www.reviewmylife.co.uk/">reviewmylife.co.uk</a></font> </div><p></p> <h4><a name="336x280"></a>336x280 large rectangle</h4> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="4"><div style="background-color:#ccccff; width:336px; height:280px;"> <h5>TEST ADVERT 336x280 - <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a></h5> </div></textarea></p> <div style="background-color:#ccccff; width:336px; height:280px;"> <h5>TEST ADVERT 336x280 - <a href="http://www.reviewmylife.co.uk/">www.reviewmylife.co.uk</a></h5> </div><p></p> <h4>468x60 banner with dynamic PHP</h4> <p>The PHP will execute if 1) WP Super Cache is turned on in legacy mode, and 2) if WP Super Cache is not installed/disabled.</p> <p><textarea onclick="javascript:this.focus();this.select();" style="min-height:50px;" cols="80" rows="5"><div style="background-color:#ffff99; width:468px; height:60px;"> <b>TEST ADVERT 468x60 with date() and rand()</b><br /> <?php echo "date=".date("Y-m-d H:i:s") ." rand=".rand(); ?><br /> <a href="http://www.advancedhtml.co.uk/">www.advancedhtml.co.uk</a> </div></textarea></p> <div style="background-color:#ffff99; width:468px; height:60px;"> <b>TEST ADVERT 468x60 with date() and rand()</b><br /> <?php echo "date=" . date("Y-m-d H:i:s") . " rand=" . rand(); ?> <br /> <a href="http://www.advancedhtml.co.uk/">www.advancedhtml.co.uk</a> </div><p></p> <?php adinj_postbox_end(); }