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">&lt;div style=&quot;background-color:#ff9999; width:468px; height:60px;&quot;&gt;
&lt;h5&gt;AD INJECTION TEST ADVERT 468x60 - <?php 
    adinj_get_test_ad_link_escaped($rnd);
    ?>
&lt;/h5&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#ff9999; width:728px; height:90px;&quot;&gt;
&lt;h5&gt;AD INJECTION TEST ADVERT 728x90&lt;/h5&gt;
<?php 
    adinj_get_test_ad_link_escaped($rnd);
    ?>
&lt;br /&gt;
&lt;a href=&quot;http://www.advancedhtml.co.uk/&quot;&gt;www.advancedhtml.co.uk&lt;/a&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#ccff99; width:160px; height:90px;&quot;&gt;
&lt;h5&gt;TEST ADVERT 160x90&lt;/h5&gt;
<?php 
    adinj_get_test_ad_link_escaped($rnd);
    ?>
&lt;br /&gt;
&lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;reviewmylife.co.uk&lt;/a&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#cccc99; width:468px; height:15px;&quot;&gt;
&lt;font size=&quot;-2&quot;&gt;&lt;b&gt;TEST ADVERT 160x90&lt;/b&gt; <?php 
    adinj_get_test_ad_link_escaped($rnd);
    ?>
&lt;/font&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#ccccff; width:336px; height:280px;&quot;&gt;
&lt;h5&gt;TEST ADVERT 336x280 - <?php 
    adinj_get_test_ad_link_escaped($rnd);
    ?>
&lt;/h5&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#ffff99; width:468px; height:60px;&quot;&gt;
&lt;b&gt;TEST ADVERT 468x60 with date() and rand()&lt;/b&gt;&lt;br /&gt;
&lt;?php echo &quot;date=&quot;.date(&quot;Y-m-d H:i:s&quot;) .&quot; rand=&quot;.rand(); ?&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;www.reviewmylife.co.uk&lt;/a&gt;
&lt;/div&gt;</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">
&lt;?php if (function_exists('adinj_print_ad')){ adinj_print_ad('top'); } ?&gt;</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">
&lt;?php if (function_exists('adinj_print_ad')){ adinj_print_ad('hotel-ad.txt'); } ?&gt;</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">&lt;!--mfunc include_once('<?php 
    echo ADINJ_PATH;
    ?>
/adshow.php') --&gt;
&lt;?php include_once('<?php 
    echo ADINJ_PATH;
    ?>
/adshow.php'); ?&gt;
&lt;!--/mfunc--&gt;
&lt;?php if (function_exists('adinj_print_ad')){ adinj_print_ad('random'); } ?&gt;</textarea></p>

	<?php 
    adinj_postbox_end();
}
Example #3
0
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>&lt;!--topad--&gt;</code> OR <code>&lt;!--randomad--&gt;</code> OR <code>&lt;!--bottomad--&gt;</code> - These tags allow precise positioning of the adverts instead of using the computer calculated positions.</li>
</ul>

<ul>
<li><code>&lt;!--adinj_exclude_start--&gt;&lt;!--adinj_exclude_end--&gt;</code> - Exclude ads from specific sections of the post.</li>
</ul>

<ul>
<li><code>&lt;!--adstart--&gt;</code> - Random ads will start from this point.</li>
<li><code>&lt;!--adend--&gt;</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>&lt;!--noadsense--&gt;</code> OR <code>&lt;!-no-adsense--&gt;</code> OR <code>&lt;!--NoAds--&gt;</code> OR <code>&lt;!--OffAds--&gt;</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>&lt;!--adsensestart--&gt;</code> - Random ads will start from this point. For compatibility with Adsense Injection.</li>
</ul>

<p></p>

<ul>
<li><code>&lt;!--adsandwich--&gt;</code> - Inserts the top and bottom ad but no random ads. Disables all other ads.</li>
<li><code>&lt;!--adfooter--&gt;</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>&lt;!--noadsense--&gt;</code> OR <code>&lt;!-no-adsense--&gt;</code> OR <code>&lt;!--NoAds--&gt;</code> OR <code>&lt;!--OffAds--&gt;</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>&lt;!--adsandwich--&gt;</code> - Inserts the top and bottom ad but no random ads. Disables all other ads.</li>
<li><code>&lt;!--adfooter--&gt;</code> - Insert a single ad at the very bottom. Disables all other ads.</li>
</ul>

<p></p>

<ol>
<li><code>&lt;!--adsensestart--&gt;</code> - Random ads will start from this point*. For compatibility with Adsense Injection.</li>
<li><code>&lt;!--adsenseend--&gt;</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>&lt;!--adstart--&gt;</code> - Random ads will start from this point*.</li>
<li><code>&lt;!--adend--&gt;</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">&lt;div style=&quot;background-color:#ff9999; width:468px; height:60px;&quot;&gt;
&lt;h5&gt;TEST ADVERT 468x60 - &lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;www.reviewmylife.co.uk&lt;/a&gt;&lt;/h5&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#ff9999; width:728px; height:90px;&quot;&gt;
&lt;h5&gt;TEST ADVERT 728x90&lt;/h5&gt;
&lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;www.reviewmylife.co.uk&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.advancedhtml.co.uk/&quot;&gt;www.advancedhtml.co.uk&lt;/a&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#ccff99; width:160px; height:90px;&quot;&gt;
&lt;h5&gt;TEST ADVERT 160x90&lt;/h5&gt;
&lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;reviewmylife.co.uk&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.advancedhtml.co.uk/&quot;&gt;advancedhtml.co.uk&lt;/a&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#cccc99; width:468px; height:15px;&quot;&gt;
&lt;font size=&quot;-2&quot;&gt;&lt;b&gt;TEST ADVERT 160x90&lt;/b&gt; &lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;reviewmylife.co.uk&lt;/a&gt;&lt;/font&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#ccccff; width:336px; height:280px;&quot;&gt;
&lt;h5&gt;TEST ADVERT 336x280 - &lt;a href=&quot;http://www.reviewmylife.co.uk/&quot;&gt;www.reviewmylife.co.uk&lt;/a&gt;&lt;/h5&gt;
&lt;/div&gt;</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">&lt;div style=&quot;background-color:#ffff99; width:468px; height:60px;&quot;&gt;
&lt;b&gt;TEST ADVERT 468x60 with date() and rand()&lt;/b&gt;&lt;br /&gt;
&lt;?php echo &quot;date=&quot;.date(&quot;Y-m-d H:i:s&quot;) .&quot; rand=&quot;.rand(); ?&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.advancedhtml.co.uk/&quot;&gt;www.advancedhtml.co.uk&lt;/a&gt;
&lt;/div&gt;</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();
}