PluginProbe
Wp-Insert / 1.5.0
Wp-Insert v1.5.0
trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.3.0 1.3.1 1.3.3 1.4 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 2.0 All 63 releases
wp-insert / includes / templateads.php

templateads.php in Wp-Insert 1.5.0, at includes/templateads.php

58 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 function wp_template_ad($ad_ID) {
3 $output = '';
4 global $random;
5 $page_details = wp_insert_get_current_page_details();
6
7 if(get_option('wp_insert_template_ad_'.$ad_ID.'_enable')) {
8 $ad_style = get_option('wp_insert_template_ad_'.$ad_ID.'_style');
9 if($ad_style == '') { $ad_style = 'margin: 5px; padding: 0px;'; }
10 if(!get_option('wp_insert_template_ad_'.$ad_ID.'_exclude_home') && ($page_details == 'HOME')) {
11 switch($random) {
12 case 0:
13 $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content').'</div>';
14 break;
15 case 1:
16 $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_1').'</div>';
17 break;
18 case 2:
19 $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_2').'</div>';
20 break;
21 }
22 }
23 else if(!get_option('wp_insert_template_ad_'.$ad_ID.'_exclude_archives') && ($page_details == 'ARCHIVE')) {
24 switch($random) {
25 case 0:
26 $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content').'</div>';
27 break;
28 case 1:
29 $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_1').'</div>';
30 break;
31 case 2:
32 $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_2').'</div>';
33 break;
34 }
35 }
36 else {
37 if(is_singular()) {
38 $page_ids = explode(',', str_replace(" ", "", get_option('wp_insert_template_ad_'.$ad_ID.'_exclude_ids')));
39 if(wp_insert_is_in_array($page_details, $page_ids) =='FALSE') {
40 switch($random) {
41 case 0:
42 $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content').'</div>';
43 break;
44 case 1:
45 $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_1').'</div>';
46 break;
47 case 2:
48 $output .= '<div id="template_ad_'.$ad_ID.'" style="'.$ad_style.'">'.get_option('wp_insert_template_ad_'.$ad_ID.'_content_2').'</div>';
49 break;
50 }
51 }
52 }
53 }
54 }
55
56 echo $output;
57 }
58 ?>