2009-08-19 3 views
0

RSS 스트림에 Google 애드 센스를 추가하려고합니다. 제 3 자에 의존하기 때문에 "RSS 용 애드 센스"를 사용하고 싶지 않습니다.RSS 스트림의 애드 센스

RSS에서 RSS 코드가 깨져서 작은 문자/큰 문자는 사용할 수 없습니다. 좋아, 나는 그들을 탈출하는 htmlentities() 함수를 사용합니다. 그것은과 같이, 스트림의 기본 HTTP를 표시하기 위해 잘 작동 : 나는 구글 애드 센스 코드와 정확히 같은 일을하려고 할 때

$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 서비스 용 애드 센스에 강제로 사용자가 애드 센스의 사용을 차단 생각하지만 나는 그런 슬래시닷 (Slashdot)와 같은 일부 인기있는 웹 사이트가 내가 원하는 정확히 무엇을 할 것으로 나타났습니다.

분명히 뭔가 잘못하고 있지만 그 위에 손가락을 넣을 수는 없습니다.

편집 : 이것은 문제가있는 이유는 RSS 피드를 내부에 자바 스크립트, 인라인 또는 외부를 포함 할 수 없다는 것입니다 출력

<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

입니다.

RSS 용 애드 센스는 타사에 의존 할 수 있지만 자바 스크립트를 사용하지 않고 이미지 또는 이미지 맵을 피드에 포함시켜 작동합니다.