Changeset 987913
- Timestamp:
- 09/12/2014 05:27:48 AM (12 years ago)
- File:
-
- 1 edited
-
2mb-autocode/trunk/2mb-autocode.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
2mb-autocode/trunk/2mb-autocode.php
r984821 r987913 5 5 Description: This plugin allows you to place predetermined text, php, or shortcodes at the top and/or bottom of posts. 6 6 Plugin Name: 2MB Autocode 7 Plugin URI: http://2mb.solutions/ autocode8 Version: 1. 07 Plugin URI: http://2mb.solutions/plugins/autocode 8 Version: 1.1 9 9 License: Gpl v2 or later 10 10 */ … … 18 18 $count2 = 0; 19 19 $content = str_replace('##no_bottom##', '', $content, $count2); 20 if((is_single() || get_option('2mb_autocode_tophome') == 1) && $count == 0) { 20 $count3 = 0; 21 $content = str_replace('##no_top_home##', '', $content, $count3); 22 $count4 = 0; 23 $content = str_replace('##no_bottom_home##', '', $content, $count4); 24 $count5 = 0; 25 $content = str_replace('##no_top_post##', '', $content, $count5); 26 $count6 = 0; 27 $content = str_replace('##no_bottom_post##', '', $content, $count6); 28 $count7 = 0; 29 if(get_option('2mb_autocode_toptype') == 0) { 30 $content = str_replace('##do_top##', do_shortcode(get_option('2mb_autocode_topstring')), $content, $count7); 31 } 32 else if(get_option('2mb_autocode_toptype') == 1) { 33 $content = str_replace('##do_top##', do_shortcode(exec(get_option('2mb_autocode_topstring'))), $content, $count7); 34 } 35 else { 36 $content = str_replace('##do_top##', '<pre>'.get_option('2mb_autocode_topstring').'</pre>', $content, $count7); 37 } 38 $count8 = 0; 39 if(get_option('2mb_autocode_bottomtype') == 0) { 40 $content = str_replace('##do_bottom##', do_shortcode(get_option('2mb_autocode_bottomstring')), $content, $count8); 41 } 42 else if(get_option('2mb_autocode_bottomtype') == 1) { 43 $content = str_replace('##do_bottom##', do_shortcode(exec(get_option('2mb_autocode_bottomstring'))), $content, $count8); 44 } 45 else { 46 $content = str_replace('##do_bottom##', '<pre>'.get_option('2mb_autocode_bottomstring').'</pre>', $content, $count8); 47 } 48 $top = 1; 49 $bottom = 1; 50 if($count > 0) { 51 $top = 0; 52 } 53 if($count3 > 0 && !is_single()) { 54 $top = 0; 55 } 56 if($count5 > 0 && is_single()){ 57 $top = 0; 58 } 59 if($count2 > 0) { 60 $bottom = 0; 61 } 62 if($count4 > 0 && !is_single()) { 63 $bottom = 0; 64 } 65 if($count6 > 0 && is_single()){ 66 $bottom = 0; 67 } 68 if($count7 > 0) { 69 $top = 0; 70 } 71 if($count8 > 0) { 72 $bottom = 0; 73 } 74 if($top == 1) { 21 75 if(get_option('2mb_autocode_toptype') == 1) { 22 76 $content = do_shortcode(exec(get_option('2mb_autocode_topstring'))).$content; … … 29 83 } 30 84 } 31 if( (is_single() || get_option('2mb_autocode_bottomhome') == 1) && $count2 == 0) {85 if($bottom == 1) { 32 86 if(get_option('2mb_autocode_bottomtype') == 1) { 33 87 $content = $content.do_shortcode(exec(get_option('2mb_autocode_bottomstring')));
Note: See TracChangeset
for help on using the changeset viewer.