2013-01-10 5 views
0

이것은 트위터 버튼이 생성되어 내부에 텍스트를 추가했습니다.PHP : 트위터 버튼에 텍스트 + 링크가 표시되지 않습니다.

> <iframe allowtransparency="true" frameborder="0" scrolling="no" 
> src="http://platform.twitter.com/widgets/tweet_button.1357735024.html#_=1357817606773&amp;count=horizontal&amp;id=twitter-widget-0&amp;lang=en&amp;original_referer=&amp;size=m&amp;text=<?php 
> echo $art["title"].' 
> http://web.com/article.php?art_id='.$art["id"];?>&amp;url=<?php 
> echo 
> 'http://web.com/article.php?art_id='.$art[id];?>&amp;via=MyWeb" 
> class="twitter-share-button twitter-count-horizontal" style="width: 
> 107px; height: 20px;" title="Twitter Tweet Button" 
> data-twttr-rendered="true"></iframe> 

문제는 내가 트위터에 링크를 추가 할 수 없다는 것입니다. 거기에 추가하면 간단한 텍스트까지 표시되지 않습니다.

비슷한 문제가 있거나 도움이 되었다면 어떻게 해결할 수 있습니까?

은 (거기에 실수가있을 수 있습니다) 당신이

답변

0

내가 좀 그냥 따라 쉽게 iframe이 SRC의 건물을 만들기 위해 코드를 재구성 것 감사드립니다. 또한 $ art [ 'title']이 urlencoded인지 확인해야합니다.

<?php 
    $iframe_src = 'http://platform.twitter.com/widgets/tweet_button.1357735024.html#_=1357817606773&amp;count=horizontal&amp;id=twitter-widget-0&amp;lang=en&amp;original_referer=&amp;size=m&amp;text='; 
    $iframe_src .= urlencode($art['title']); 
    $iframe_src .= 'http://web.com/article.php?art_id='.$art['id']; 
    $iframe_src .= '&amp;url=http://web.com/article.php?art_id='.$art['id'].'&amp;via=MyWeb'; 
?> 
<iframe allowtransparency="true" frameborder="0" scrolling="no" src="<?php echo $iframe_src; ?>" 
    class="twitter-share-button twitter-count-horizontal" 
    style="width:107px; height: 20px;" title="Twitter Tweet Button" 
    data-twttr-rendered="true"></iframe> 
관련 문제