コード例 #1
0
function adinj_tab_main()
{
    $ops = adinj_options();
    ?>
	
	<p><a href="#adsettings">Ad Placement settings</a> | <a href="#adverts">Ads</a> | <a href="#restrictions">Ad insert mode/dynamic restrictions</a> | <a href="#filters">Filters</a> | <a href="#docsquickstart">Quick Start</a> | <a href="#testads">Test ads</a></p>
	
	<?php 
    adinj_global_settings_box($ops);
    ?>
	
	<?php 
    adinj_placement_settings_box($ops);
    ?>

	<?php 
    adinj_adverts_box($ops);
    ?>
	
	<?php 
    adinj_insertion_mode_box($ops);
    ?>
	
	<?php 
    adinj_filters_box($ops);
    ?>
	
	<br clear="all" />
	
	<?php 
    adinj_docs();
    adinj_testads();
    global $adinj_warning_msg_chmod;
    if (!empty($adinj_warning_msg_chmod)) {
        echo '<a name="warning_msg_chmod"></a>';
        echo '<br clear="all" />';
        echo $adinj_warning_msg_chmod;
    }
}
コード例 #2
0
function adinj_tab_adrotation()
{
    $ops = adinj_options();
    echo <<<DOCS
\t<p><a href="#multiple_top">Top adverts</a> | <a href="#multiple_random">Random adverts</a> | <a href="#multiple_bottom">Bottom adverts</a> | <a href="#multiple_footer">Footer adverts</a> | <a href="#advanced">Advanced</a> | <a href="#docs_tags">Tag docs</a> | <a href="#testads">Test ads</a></p>
DOCS;
    $total_rand_split = adinj_total_split('ad_code_random_', $ops);
    $total_rand_alt_split = adinj_total_split('ad_code_random_alt_', $ops);
    $total_top_split = adinj_total_split('ad_code_top_', $ops);
    $total_top_alt_split = adinj_total_split('ad_code_top_alt_', $ops);
    $total_bottom_split = adinj_total_split('ad_code_bottom_', $ops);
    $total_bottom_alt_split = adinj_total_split('ad_code_bottom_alt_', $ops);
    $total_footer_split = adinj_total_split('ad_code_footer_', $ops);
    $total_footer_alt_split = adinj_total_split('ad_code_footer_alt_', $ops);
    ?>
	
	<style type="text/css">
	.adinjtable td { vertical-align: top; }
	</style>
	
	<?php 
    adinj_postbox_start(__("Ad rotation / alt content docs", 'adinj'), 'docs_adrotation');
    echo <<<DOCS
\t<p>Ad rotation / split testing and alternate content are advanced features. If you don't understand these features you probably don't need them and can therefore ignore this tab. In summary:</p>
\t<ul>
\t<li><b>Ad rotation / split testing:</b> You can define multiple adverts for the same ad space which are rotated according to the ratios you define. The percentage of views that each ad will be shows is displated beneath the ratio text box. For example if you define two ads and set both to have a ratio of '50' they will each be shown (roughly) 50% of the time. The numbers don't have to add up to 100 as the ratio is calculated based on the total. e.g. if you have two advert - one is set with a ratio of '1' and the other '3' the ratios will be 25% and 75%. Please remember this isn't strict ad rotation, it is random selection based on ratios so the ratios will be correct over a large sample of ad views, not a small sample.</li>
\t<li><b>Alternate content:</b> This is content that is displayed when ads are blocked for the user. You could use this alternate content to show other content, some kind of layout filler, or even a different type of ad. I've added support for rotation of alternate content as well.</li>
\t</ul>
DOCS;
    adinj_postbox_end();
    adinj_postbox_start(__("Top adverts", 'adinj'), 'multiple_top');
    echo '<table border="0" cellspacing="5" class="adinjtable">';
    for ($i = 1; $i <= 10; ++$i) {
        adinj_add_row_with_text_box('ad_code_top_', $i, 'Ad code', $total_top_split);
    }
    adinj_add_row_with_text_box('ad_code_top_alt_', 1, 'Alt content', $total_top_alt_split);
    adinj_add_row_with_text_box('ad_code_top_alt_', 2, 'Alt content', $total_top_alt_split);
    echo '</table>';
    adinj_postbox_end();
    adinj_postbox_start(__("Random adverts", 'adinj'), 'multiple_random');
    echo '<table border="0" cellspacing="5" class="adinjtable">';
    for ($i = 1; $i <= 10; ++$i) {
        adinj_add_row_with_text_box('ad_code_random_', $i, 'Ad code', $total_rand_split);
    }
    adinj_add_row_with_text_box('ad_code_random_alt_', 1, 'Alt content', $total_rand_alt_split);
    adinj_add_row_with_text_box('ad_code_random_alt_', 2, 'Alt content', $total_rand_alt_split);
    echo '</table>';
    adinj_postbox_end();
    adinj_postbox_start(__("Bottom adverts", 'adinj'), 'multiple_bottom');
    echo '<table border="0" cellspacing="5" class="adinjtable">';
    for ($i = 1; $i <= 10; ++$i) {
        adinj_add_row_with_text_box('ad_code_bottom_', $i, 'Ad code', $total_bottom_split);
    }
    adinj_add_row_with_text_box('ad_code_bottom_alt_', 1, 'Alt content', $total_bottom_alt_split);
    adinj_add_row_with_text_box('ad_code_bottom_alt_', 2, 'Alt content', $total_bottom_alt_split);
    echo '</table>';
    adinj_postbox_end();
    adinj_postbox_start(__("Footer adverts", 'adinj'), 'multiple_footer');
    echo '<table border="0" cellspacing="5" class="adinjtable">';
    for ($i = 1; $i <= 10; ++$i) {
        adinj_add_row_with_text_box('ad_code_footer_', $i, 'Ad code', $total_footer_split);
    }
    adinj_add_row_with_text_box('ad_code_footer_alt_', 1, 'Alt content', $total_footer_alt_split);
    adinj_add_row_with_text_box('ad_code_footer_alt_', 2, 'Alt content', $total_footer_alt_split);
    echo '</table>';
    adinj_postbox_end();
    adinj_advanced();
    adinj_docs_tags();
    adinj_testads();
}