facebook喜欢不读og:属性

时间:2011-11-14 14:54:11

标签: facebook properties

我有一些页面包含配置文件和文章,内容来自php和mysql。我关于facebook的代码是:(其他一切都是..........)

<head>
.....
<meta property="og:title" content="<?php echo $title; ?>" />
<meta property="og:description" content="<?php echo $description; ?>" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://xxxxxxxx?profile.php?id=<?php echo $id;?>"/>
<meta property="og:image" content="<?php echo $imagename;?>" />
<meta property="og:site_name" content="xxxxxxxxx" />
<meta property="fb:admins" content="xxxxxxxxxxxxxxxxx" />
.....
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
..............
<div class="fb-like" data-href="http://xxxxxxxxx/profile.php?id=<?php echo $id; ?>;" data-send="true" data-width="450" data-show-faces="true"></div>
................
</body>

1)facebook喜欢从我的索引页面和facebook调试器中获取内容我得到了错误:

 Inferred Property: The og:url property should be explicitly provided, even if a value can be inferred from other tags.
 Inferred Property: The og:title property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property:  The og:image property should be explicitly provided, even if a value can be inferred from other tags.
Inferred Property:  The og:locale property should be explicitly provided, even if a value can be inferred from other tags. 

2)facebook管理员号码没问题

3)php生成内容确定。我从浏览器中检查了页面代码

任何建议??

1 个答案:

答案 0 :(得分:0)

来自文档:

In addition, we've extended the basic meta data to add a required field to connect your webpage with Facebook:

fb:app_id - A Facebook Platform application ID that administers this page.

http://developers.facebook.com/docs/opengraph/

尝试添加该标记,看看是否有帮助。

另外,请确保URL已正确编码: http://www.php.net/manual/en/function.rawurlencode.php