function adinj_add_padding_top_bottom_options($prefix, $options = NULL, $topname = NULL, $bottomname = NULL)
{
    $tname = $prefix . 'padding_top';
    $bname = $prefix . 'padding_bottom';
    $tdefault = NULL;
    $bdefault = NULL;
    if ($topname != NULL) {
        $tname = $topname;
        $tdefault = "padding_top";
    }
    if ($bottomname != NULL) {
        $bname = $bottomname;
        $bdefault = "padding_bottom";
    }
    _e("Padding top", 'adinj');
    echo "<br />";
    $padding_settings = array('d', 0, 1, 2, 3, 4, 5, 7, 10, 15, 20, 30);
    adinj_selection_box($tname, $padding_settings, "(px)", $options[$tdefault]);
    echo "<br />";
    _e("Padding bottom", 'adinj');
    echo "<br />";
    adinj_selection_box($bname, $padding_settings, "(px)", $options[$bdefault]);
}
Ejemplo n.º 2
0
function adinj_advanced()
{
    adinj_postbox_start(__("Advanced settings", 'adinj'), "advanced");
    echo "<p>If your theme or another plugin is causing problems with Ad Injection (e.g. by changing the priority of the 'wpautop' filter which may prevent the random ads from being added) you can try modifying Ad Injection's the_content filter priority here. Try '100', if that doesn't work try something higher. ";
    adinj_selection_box("the_content_filter_priority", array(0, 1, 10, 11, 100, 200, 1000));
    echo ' Default: 10</p>';
    adinj_postbox_end();
}
Ejemplo n.º 3
0
function adinj_random_ad_limit_table()
{
    ?>
	<tr><td>&nbsp;|_ No ads if post shorter than:</td>
	<?php 
    $prefixes = array("", "home", "archive");
    $unit = adinj_counting_unit_description();
    $ad_limit_settings = array('d', 100, 200, 300, 400, 500, 750, 1000, 1500, 2000, 2500, 3000, 5000, 7500, 10000, 15000, 20000);
    foreach ($prefixes as $prefix) {
        echo '<td><div class="adinj_' . $prefix . '">';
        echo '<div class="' . $prefix . '_max_num_random_ads_per_page">';
        echo '<div class="' . $prefix . '_max_num_random_ads_per_post">';
        if (!empty($prefix)) {
            $prefix = $prefix . '_';
        }
        adinj_selection_box($prefix . "no_random_ads_if_shorter_than", $ad_limit_settings, $unit);
        echo '</div></div></div></td>';
    }
    ?>
	</tr>
	<tr><td>&nbsp;|_ Max 1 ad if post shorter than:</td>
	<?php 
    foreach ($prefixes as $prefix) {
        echo '<td><div class="adinj_' . $prefix . '">';
        echo '<div class="' . $prefix . '_max_num_random_ads_per_page">';
        echo '<div class="' . $prefix . '_max_num_random_ads_per_post">';
        if (!empty($prefix)) {
            $prefix = $prefix . '_';
        }
        adinj_selection_box($prefix . "one_ad_if_shorter_than", $ad_limit_settings, $unit);
        echo '</div></div></div></td>';
    }
    ?>
	</tr>
	<tr><td>&nbsp;|_ Max 2 ads if post shorter than:</td>
	<?php 
    foreach ($prefixes as $prefix) {
        echo '<td><div class="adinj_' . $prefix . '">';
        echo '<div class="' . $prefix . '_max_num_random_ads_per_page">';
        echo '<div class="' . $prefix . '_max_num_random_ads_per_post">';
        if (!empty($prefix)) {
            $prefix = $prefix . '_';
        }
        adinj_selection_box($prefix . "two_ads_if_shorter_than", $ad_limit_settings, $unit);
        echo '</div></div></div></td>';
    }
    ?>
	</tr>
	<tr><td>&nbsp;|_ Max 3 ads if post shorter than:</td>
	<?php 
    foreach ($prefixes as $prefix) {
        echo '<td><div class="adinj_' . $prefix . '">';
        echo '<div class="' . $prefix . '_max_num_random_ads_per_page">';
        echo '<div class="' . $prefix . '_max_num_random_ads_per_post">';
        if (!empty($prefix)) {
            $prefix = $prefix . '_';
        }
        adinj_selection_box($prefix . "three_ads_if_shorter_than", $ad_limit_settings, $unit);
        echo '</div></div></div></td>';
    }
    ?>
	</tr>
	<?php 
}
Ejemplo n.º 4
0
function adinj_add_alignment_options($prefix)
{
    _e("Alignment", 'adinj');
    echo "<br />";
    adinj_selection_box($prefix . 'align', array(ADINJ_RULE_DISABLED, 'left', 'center', 'right', 'float left', 'float right'));
    echo "<br />";
    _e("Clear (CSS)", 'adinj');
    echo "<br />";
    adinj_selection_box($prefix . 'clear', array(ADINJ_RULE_DISABLED, 'left', 'right', 'both'));
    echo "<br />";
    _e("Margin top", 'adinj');
    echo "<br />";
    adinj_selection_box($prefix . 'margin_top', array(ADINJ_RULE_DISABLED, 0, 1, 2, 3, 4, 5, 7, 10, 15, 20, 30), "(px)");
    echo "<br />";
    _e("Margin bottom", 'adinj');
    echo "<br />";
    adinj_selection_box($prefix . 'margin_bottom', array(ADINJ_RULE_DISABLED, 0, 1, 2, 3, 4, 5, 7, 10, 15, 20, 30), "(px)");
}