Пример #1
0
function adinj_side_status_box()
{
    $ops = adinj_options();
    ?>
	<div class="postbox-container" style="width:258px;">
		<div class="metabox-holder">	
		<div class="meta-box-sortables" style="min-height:50px;">
		<div class="postbox">
		<h3 class="hndle"><span><?php 
    echo adinj_get_logo();
    ?>
 Status</span></h3>
		<div class="inside" style="margin:5px;">
			
			<style type="text/css">
			.adinjstatustable td { vertical-align: top; }
			.adinjstatustable td { padding: 2px; }
			</style>
		
			<table border="0" cellpadding="2" class="adinjstatustable">

			
			<tr><td style="text-align:right">
			<b><a href="#global">Ads enabled</a></b>
			</td><td>
			<?php 
    $info = adinj_get_status('global');
    echo adinj_dot($info[0]) . ' ' . $info[1];
    if ($info[0] != 'red') {
        ?>
			</td></tr>

			<tr><td style="text-align:right">
			<b><a href='#global'>Ads on posts</a></b>
			</td><td>
			<?php 
        $info = adinj_get_status('older_than_normal');
        echo adinj_dot($info[0]) . ' ' . $info[1];
        ?>
			</td></tr>

			<tr><td style="text-align:right">
			<b><a href='#global'>Widgets on posts</a></b>
			</td><td>
			<?php 
        $info = adinj_get_status('older_than_widgets');
        echo adinj_dot($info[0]) . ' ' . $info[1];
        ?>
			</td></tr>
			
			<tr><td style="text-align:right">
			<b><a href="#restrictions">Mode</a></b>
			</td><td>
			<?php 
        $info = adinj_get_status('mode');
        echo adinj_dot($info[0]) . ' ' . $info[1];
        ?>
			</td></tr>
			
			<tr><td style="text-align:right">
			<b><a href="#restrictions">Restrictions</a></b>
			</td><td>
			<?php 
        $info = adinj_get_status('restrictions');
        echo adinj_dot($info[0]) . ' ' . $info[1];
        ?>
			</td></tr>
			
			<tr><td style="text-align:right">
			<b><a href='?page=ad-injection&amp;tab=debug#debugging'>Debug mode</a></b>
			</td><td>
			<?php 
        $info = adinj_get_status('debugging');
        echo adinj_dot($info[0]) . ' ' . $info[1];
        ?>
			</td></tr>
			
			<tr><td colspan="2">
			<p></p>
			<b>Ads on/off summary</b><br />
			<table class="adinjstatustable">
			<tr>
				<td></td>
				<td><b>Ads</b></td>
				<td><b>Alt</b></td>
				<td><b>S</b></td>
				<td><b>P</b></td>
				<td><b>H</b></td>
				<td><b>F</b></td>
				<td><b>A</b></td>
			</tr>
			<tr>
				<td style="text-align:right"><b><a href="#topadplacement">Top</a></b></td>
				<td><?php 
        echo adinj_count_live_ads('top', $ops);
        ?>
</td>
				<td><?php 
        echo adinj_count_live_ads('top_alt', $ops);
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('top', 'single');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('top', 'page');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('top', 'home');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('top', 'front');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('top', 'archive');
        ?>
</td>
			</tr>
			<tr>
				<td style="text-align:right"><b><a href="#randomadplacement">Random</a></b></td>
				<td><?php 
        echo adinj_count_live_ads('random', $ops);
        ?>
</td>
				<td><?php 
        echo adinj_count_live_ads('random_alt', $ops);
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('random', 'single');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('random', 'page');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('random', 'home');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('random', 'front');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('random', 'archive');
        ?>
</td>
			</tr>
			<tr>
				<td style="text-align:right"><b><a href="#bottomadplacement">Bottom</a></b></td>
				<td><?php 
        echo adinj_count_live_ads('bottom', $ops);
        ?>
</td>
				<td><?php 
        echo adinj_count_live_ads('bottom_alt', $ops);
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('bottom', 'single');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('bottom', 'page');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('bottom', 'home');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('bottom', 'front');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('bottom', 'archive');
        ?>
</td>
			</tr>
			<tr>
				<td style="text-align:right"><b><a href="#footeradplacement">Footer</a></b></td>
				<td><?php 
        echo adinj_count_live_ads('footer', $ops);
        ?>
</td>
				<td><?php 
        echo adinj_count_live_ads('footer_alt', $ops);
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('footer', 'single');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('footer', 'page');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('footer', 'home');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('footer', 'front');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('footer', 'archive');
        ?>
</td>
			</tr>
			<tr>
				<td style="text-align:right"><b>Widget</b></td>
				<td></td>
				<td></td>
				<td><?php 
        adinj_print_ad_dot('widget', 'single');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('widget', 'page');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('widget', 'home');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('widget', 'front');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('widget', 'archive');
        ?>
</td>
			</tr>
			<tr>
				<td style="text-align:right"><b>Template</b></td>
				<td></td>
				<td></td>
				<td><?php 
        adinj_print_ad_dot('template', 'single');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('template', 'page');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('template', 'home');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('template', 'front');
        ?>
</td>
				<td><?php 
        adinj_print_ad_dot('template', 'archive');
        ?>
</td>
			</tr>
			</table>
			<p>S=single post | P=single page | H=home | F=front | A=archive
			<!--E=excerpt--></p>
			</td></tr>

			<tr><td>
			</td><td>
			</td></tr>
			<tr><td>
			</td><td>
			<?php 
    }
    ?>
			</td></tr>
			</table>
		</div>
		</div>	
		</div>
		</div>
	</div> 	
	
	<br />
	<?php 
}
function adinj_print_ad_dot($adtype, $pagetype)
{
    if (adinj_max_num_ads($adtype, $pagetype) > 0) {
        echo adinj_dot('green');
    } else {
        echo adinj_dot('red');
    }
}
Пример #3
0
function adinj_green_or_red_dot($option)
{
    $ops = adinj_options();
    if ($ops[$option] == 'on') {
        return adinj_dot('red');
    } else {
        return adinj_dot('green');
    }
}