2012-04-18 51 views
0

我的粉絲頁存在問題。一個畫廊腳本正在運行我的網站空間,我也將它放在Fanpage的iframe中的應用程序中。畫廊腳本已經獲得一個Share按鈕來在Facebook上發佈照片。這部分運行良好,但是當我點擊在Facebook上發佈的鏈接時,我的網頁空間被轉到了我的頁面,而不是網頁和照片的iframe。是否有可能編輯鏈接到Facebook的iframe頁面?鏈接到Facebook Fanpage Iframe

回答

0

這一般不是問題。您可以嘗試將您的網站重定向到Facebook選項卡應用程序中,然後檢查HTTP_REFERRER和網址。你可以看看this example

有一個URL你可以嘗試打電話,看看你是否被重定向到正確的應用程序。另外,您可以將app_data參數添加到URL中以確定應用程序中的真實目標。

所有這一切可以通過下面的代碼來完成:

// set the target facebook page name and id to perform a forceRedirectToTab() 
$tmpFbHelper   
    ->setPageName($iniHandler->getIniSetting('facebook.'.fbHelper::getAppNamespace().'.page.name')) 
    ->setPageId($iniHandler->getIniSetting('facebook.'.fbHelper::getAppNamespace().'.page.id')) 
    ->setSecret($iniHandler->getIniSetting('facebook.'.fbHelper::getAppNamespace().'.secret')); 

// perform a redirect to the facebook tab application if someone opens the url out of facebook 
// the facebook-linter is not affected by this :) 
$tmpFbHelper->forceRedirectToTab(); 

// perform a deeplink if for example a special url is called or you identify some app-data 
$tmpFbHelper->performDeeplink(); 

你將不得不看着你的鏈接發佈到流,使得PHP代碼發現,你會重定向和深層連結!

我希望這個想法可以幫助你:)

+0

但是對於這個解決方案,我必須爲此腳本支付10美元。但我不想使用這個scrpt包的所有功能。任何其他的想法腳本的reffer? – 2012-04-18 20:12:59

+0

10 $沒有那麼多錢;)...但是您應該嘗試以下操作:您在該流上發佈的網址可能類似於domain.com/stream/the-target-link/ 比在您創建的網站中一個將所有傳入/流/ *請求重定向回Facebook應用程序的htaccess redirectUri規則,並且您將其他傳入URL('the-target-link')添加爲&app_data = {deeplink:your-target-url }。在你的網站上,你測試了app_data和'deeplink'鍵......如果設置了這個,你可以運行重定向到這個參數上;) – dk1 2012-04-19 08:17:07