2011-05-26 25 views
1
<fb:visible-to-connection> 
<img src="http://www.xxx.com/images/welcome1.jpg" border="0" alt="Welcome to "> 
<fb:else> 
<div style="top: 0; position: absolute;"> 
<img src="http://www.xxx.com/images/like_us1.jpg" /> 
</div> 
</fb:else> 
</fb:visible-to-connection> 

此代碼工作正常,如果我在facebook FBML選項卡應用程序中使用它。facebook如何<fb:visible-to-connection>問題?

但我有另一個應用程序使用iframe,我從我的網站加載一個簡單的頁面。我試着去把我的HTML/PHP代碼與FBML一個,但沒有成功一起:

<html> 
<dody> 
<fb:visible-to-connection> 
..........html and php code here........ 
<fb:else> 
<div style="top: 0; position: absolute;"> 
<img src="http://www.xxx.com/images/like_us1.jpg" /> 
</div> 
</fb:else> 
</fb:visible-to-connection> 
</body> 
</html> 

這樣的事情,但它不會真正的工作,

有什麼建議? 謝謝

回答

0

This article有你在找什麼。使用iframe頁面時,您必須使用服務器代碼執行此操作,因爲Facebook會使用有關用戶的匿名信息(包括他們的語言以及他們是不是粉絲)將post變量發送到您的頁面。一旦他們喜歡該頁面,該頁面將刷新,並且您將通過相同的帖子變量信息知道他們是粉絲。

此外,FBML選項卡已棄用,並且您希望在Facebook有時間殺死它們之前將其轉換爲iframe。

+0

很好,謝謝,生病看看 – Patrioticcow 2011-05-26 17:32:13