2012-04-18 49 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