2009-08-19 8 views
0

RSSストリームにGoogle AdSenseを追加しようとしています。私はサードパーティーに依存しているため、「RSS向けAdSense」を使いたくない。RSSストリームのAdSense -

私は、RSSではRSSコードが壊れているので、小さい/大きい文字は使用できないことに気付きました。私はhtmlentities()関数を使ってそれらをエスケープします。それはそうのように、ストリーム内の基本的なHTTPを表示するには正常に動作します:私は、GoogleのAdSenseコードとまったく同じことをしようとするとき

$bottom = '<p><a href="http://www.domain.com/image-' .$row['id']. '.html" target="_blank">Post a comment ></a>'; 
echo htmlentities($bottom); 

しかし、何も示していません。まず

$ad_code = '<script type="text/javascript"><!-- 
        google_ad_client = "pub-37909010735xxxx"; 
        /* banner, RSS Feed */ 
        google_ad_slot = "xxxxx"; 
        google_ad_width = 468; 
        google_ad_height = 60; 
        //--> 
        </script> 
        <script type="text/javascript" 
        src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
        </script>'; 
echo htmlentities($ad_code); 

私はRSSサービス向けAdSenseにユーザーを強制的に、GoogleはAdSenseののその使用をブロックされたと思ったが、その後、私はそのようなスラッシュドットのようにいくつかの人気のあるウェブサイトは、私がやりたい正確に何をやることに気づきました。

確かに私は何か間違っていますが、私はそれに指を置くことはできません。

編集:これは、あなたが問題を抱えている理由は、あなたがRSSフィード内では、JavaScript、インラインまたは外部を含めることができないということである出力

<description>&lt;a href=&quot;http://www.domain.com/image-8551.html&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://www.domain.com/images/1250670754.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I guess being called snuggly-bumpkins was too much?&lt;script type=&quot;text/javascript&quot;&gt;&lt;!-- 
        google_ad_client = &quot;pub-3790901073xxxxx&quot;; 
        /* banner, RSS Feed */ 
        google_ad_slot = &quot;xxxxxxx&quot;; 
        google_ad_width = 468; 
        google_ad_height = 60; 
        //--&gt; 

        &lt;/script&gt; 
        &lt;script type=&quot;text/javascript&quot; 
        src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt; 
        &lt;/script&gt;&lt;p&gt;&lt;a href=&quot;http://www.domain.com/image-8551.html&quot; target=&quot;_blank&quot;&gt;Post a comment &gt;&lt;/a&gt;</description> 

答えて

0

です。

AdSense用AdSenseは、サードパーティに依存している可能性がありますが、JavaScriptを使用するのではなく、画像または画像マップをフィードに含めることによって機能します。