Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 119708

DZVO on "[Plugin: Yet Another Related Posts Plugin] White Page when not publish a post"

$
0
0

Hello Mitcho,
my name is Maik, I use your Plugin on different Blogs.
But in one Blog I have a problem.

When I edit a post and I don't publish the new version, then I get a white page for this posting.

i used your plugin in my plugin :)
here is the code

<?php
/*
Plugin Name: Google Ads!
Plugin URI:
Description: add Google Ads in the Blog posts
Version: 0.1
Author: Maik Schindler
Author URI: http://www.zauberpage.de
*/

add_action('plugins_loaded', 'msGoogleAdsInstall');
add_filter('the_content', 'msGoogleAds');

function msGoogleAdsInstall()
{
        global $wpdb;

        if(isset($_REQUEST['activate']) && $_REQUEST['activate'] == true){
                $checkedTable = $wpdb->get_var("SELECT meta_value FROM $wpdb->postmeta WHERE meta_key='_simple_google_ads' LIMIT 1");
                if(!$checkedTable)
                        $wpdb->query("INSERT INTO $wpdb->postmeta SET meta_key = '_simple_google_ads', meta_value = '1'");
        }elseif(isset($_REQUEST['activate']) && $_REQUEST['action'] == 'deactivate'
                && isset($_REQUEST['plugin']) && $_REQUEST['plugin'] == 'google-ads/google-ads.php'){
                $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = '_simple_google_ads'");
        }
}

function msGoogleAds($content = false)
{
        global $post;

        if(is_single()){
        $ads = '<div class="ads">
                        <script type="text/javascript"><!--
                                google_ad_client = "pub-8320213041632818";
                                google_ad_width = 300;
                                google_ad_height = 250;
                                google_ad_format = "300x250_as";
                                google_ad_type = "text";
                                google_ad_channel = "5398256405";
                                google_color_border = "FFFFFF";
                                google_color_bg = "FFFFFF";
                                google_color_link = "0058AF";
                                google_color_text = "000000";
                                google_color_url = "A01A00";
                                //--></script>
                        <script type="text/javascript"
                          src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                        </script>
                        ';
                                if (function_exists('related_entries')){
                                        $ads .= related_entries(array(), $post->ID, false);
                                }
                        $ads .= '
                        </div>';
        }else{
                $ads = '';
        }
        $content = str_replace('<!-- google ads -->', $ads, $content);

        return $content;
}
?>

here can you see the plugin in works http://www.xxltravel.de/nachrichten/.../

Can you help me?
Do you see what is the problem?

Maik

http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/


Viewing all articles
Browse latest Browse all 119708

Trending Articles