'.get_option('2mb_autocode_topstring').'', $content, $count7); } $count8 = 0; if(get_option('2mb_autocode_bottomtype') == 0) { $content = str_replace('##do_bottom##', do_shortcode(get_option('2mb_autocode_bottomstring')), $content, $count8); } else if(get_option('2mb_autocode_bottomtype') == 1) { $content = str_replace('##do_bottom##', do_shortcode(exec(get_option('2mb_autocode_bottomstring'))), $content, $count8); } else { $content = str_replace('##do_bottom##', '
'.get_option('2mb_autocode_bottomstring').'', $content, $count8);
}
$count9 = 0;
$content = str_replace('##do_top_home##', '', $content, $count9);
$count10 = 0;
$content = str_replace('##do_bottom_home##', '', $content, $count10);
$top = 1;
$bottom = 1;
if($count > 0) {
$top = 0;
}
if(($count3 > 0 && !is_single()) || get_option('2mb_autocode_tophome') == 0) {
$top = 0;
}
if($count5 > 0 && is_single()){
$top = 0;
}
if($count2 > 0) {
$bottom = 0;
}
if(($count4 > 0 && !is_single()) || get_option('2mb_autocode_tophome') == 0) {
$bottom = 0;
}
if($count6 > 0 && is_single()){
$bottom = 0;
}
if($count7 > 0) {
$top = 0;
}
if($count8 > 0) {
$bottom = 0;
}
if($count9 > 0 && !is_single()) {
$top = 1;
}
if($count10 > 0 && !is_single()) {
$bottom = 1;
}
if($top == 1) {
if(get_option('2mb_autocode_toptype') == 1) {
ob_start();
eval(get_option('2mb_autocode_topstring'));
$string = ob_get_contents();
ob_end_clean();
$content = do_shortcode($string).$content;
}
else if(get_option('2mb_autocode_toptype') == 2) {
$content = ''.get_option('2mb_autocode_topstring').''.$content;
}
else {
$content = do_shortcode(get_option('2mb_autocode_topstring')).$content;
}
}
if($bottom == 1) {
if(get_option('2mb_autocode_bottomtype') == 1) {
ob_start();
eval(get_option('2mb_autocode_bottomstring'));
$string = ob_get_contents();
ob_end_clean();
$content = $content.do_shortcode($string);
}
else if(get_option('2mb_autocode_bottomtype') == 2) {
$content = $content.''.get_option('2mb_autocode_bottomstring').'';
}
else {
$content = $content.do_shortcode(get_option('2mb_autocode_bottomstring'));
}
}
return $content;
}
add_action('the_content', 'twomb_autocode_do_php', 0);
function twomb_autocode_do_php($content) {
$content = preg_replace_callback('/\[php\]((.|\n)+)\[\/php\]/', 'twomb_autocode_exec_php', $content);
return $content;
}
function twomb_autocode_exec_php($matches) {
ob_start();
eval($matches[1]);
$output = ob_get_contents();
ob_end_clean();
return $output;
}
add_action('admin_menu', 'twomb_autocode_init_admin_menu');
function twomb_autocode_init_admin_menu() {
add_options_page('Autocode Options', 'Autocode', 'manage_options', 'twomb-autocode-settings', 'twomb_autocode_options');
}
function twomb_autocode_options() {
if(!current_user_can( 'manage_options')) {
wp_die( 'You do not have rights to access this page.');
}
?>
Do you like this plugin? Does it make your life just a little bit easier -- we hope! If it does, please consider donating to help our plugin effort along. Any amount helps. We'll love you forever ;-)
This plugin is rather simple, but to make it as easy as possible to use this plugin, we will include some documentation here:
Enter your settings below, then click save to save your changes.