FBML 未在 iframe 中的 Facebook 应用程序中呈现 - 请帮助
我正在用 PHP 开发 Facebook 应用程序。它作为 iframe 加载,而不是作为 FBML 加载。与 Facebook 的正常互动有效。例如,以下代码给出用户名:
$facebook = new Facebook($config->appapikey, $config->appsecret);
$user_id = $facebook->require_login($required_permissions = 'email');
echo $user->name;
其中 $user 是我的类,其中用户详细信息是从 facebook 加载的。 我的文档以以下方式开始:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head><title>Appname</title>
</head>
<body>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/de_DE" type="text/javascript"></script>
结束如下:
<script type="text/javascript">
FB_RequireFeatures(['XFBML','CanvasUtil'], function(){
FB.init("<?php echo $config->appapikey; ?>", "/app/xd_receiver.htm");
FB.CanvasClient.startTimerToSizeToContent();
});
</script>
</body>
</html>
文件 xd_receiver.htm 也被加载,正如我在 Firebug 中看到的那样。
但我的问题是,例如请求表单未加载。我的代码:
<fb:serverFbml>
<script type="text/fbml">
<fb:fbml>
<fb:request-form method="post" action="<?php echo $config->site; ?>index.php" type="appname" invite="true" target="_top" content="content">
<fb:multi-friend-selector actiontext="text" rows="3" showborder="true" target="_top"/>
</fb:request-form>
</fb:fbml>
</script>
</fb:serverFbml>
我可以使用 Firebug 查看代码,但 Facebook 不显示表单。
两三周前它被显示了,但这次我的标签
</fb:fbml>
</script>
</fb:serverFbml>
围绕着正文中的完整文本。两周前,我遇到了不再显示任何内容的问题。删除标签后,我的应用程序会显示,但不会显示表单。
我在网络上搜索了 1 周,并在 Facebook 上阅读了许多有关 FBML 和 XFBML 的主题,但没有任何效果对我有用。
所以提前感谢您的帮助。
I'm developing an Facebook Application in PHP. It's loaded as an iframe and not as FBML. The normal interaction with Facebook works. For example the following code gives the username:
$facebook = new Facebook($config->appapikey, $config->appsecret);
$user_id = $facebook->require_login($required_permissions = 'email');
echo $user->name;
Where $user is my class in which the user-details are loaded from facebook.
My document begins the following way:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head><title>Appname</title>
</head>
<body>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/de_DE" type="text/javascript"></script>
And ends likes this:
<script type="text/javascript">
FB_RequireFeatures(['XFBML','CanvasUtil'], function(){
FB.init("<?php echo $config->appapikey; ?>", "/app/xd_receiver.htm");
FB.CanvasClient.startTimerToSizeToContent();
});
</script>
</body>
</html>
Also the file xd_receiver.htm is loaded as I can see in Firebug.
But my problem is that for example the request-form is not loaded. My code:
<fb:serverFbml>
<script type="text/fbml">
<fb:fbml>
<fb:request-form method="post" action="<?php echo $config->site; ?>index.php" type="appname" invite="true" target="_top" content="content">
<fb:multi-friend-selector actiontext="text" rows="3" showborder="true" target="_top"/>
</fb:request-form>
</fb:fbml>
</script>
</fb:serverFbml>
I can see the code with Firebug but the form ist not displayed by Facebook.
2 or 3 weeks ago it was displayed but in this time I had the tags
</fb:fbml>
</script>
</fb:serverFbml>
arround my complete text in the body. 2 weeks ago I had the the problem that nothing any more was displayed. After I removed the tags my app is displayed but not the form.
I am searchign the web vor 1 week now and read many Threads about FBML and XFBML in Facebook but nothing worked for me.
So thank you in advance for help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哇,我不知道该说什么。我刚刚查看了您的所有代码,一切看起来都已就位。也许尝试
在调用 FB.init() 之后添加此内容
Wow, I'm not sure what to say. I just looked over all your code and everything looks to be in place. Maybe try adding this
Right after the call to
FB.init()