我无法联系拥有';喜欢';具有多个URL参数/参数的页面
朋友们 我对这个问题非常着迷,我希望你能为我找到答案,因为我已经广泛地寻找这个问题。我有一个网站,实现了“喜欢”按钮和“评论”按钮。我面临的问题实际上有两个方面: 首先: 当管理员(我)喜欢页面时,通常在“喜欢”按钮旁边的“管理页面”链接并不总是存在。。。我不明白为什么,因为它们是完全相同的PHP页面,从DB中填充了不同的信息,但它们具有相同的结构。所以我不明白为什么:我无法联系拥有';喜欢';具有多个URL参数/参数的页面,url,parameters,facebook-like,facebook-opengraph,feed,Url,Parameters,Facebook Like,Facebook Opengraph,Feed,朋友们 我对这个问题非常着迷,我希望你能为我找到答案,因为我已经广泛地寻找这个问题。我有一个网站,实现了“喜欢”按钮和“评论”按钮。我面临的问题实际上有两个方面: 首先: 当管理员(我)喜欢页面时,通常在“喜欢”按钮旁边的“管理页面”链接并不总是存在。。。我不明白为什么,因为它们是完全相同的PHP页面,从DB中填充了不同的信息,但它们具有相同的结构。所以我不明白为什么: www.rafaelpolit.com/inicio/index.php?sid=14&gim=10 显示管理员页面链接,
- www.rafaelpolit.com/inicio/index.php?sid=14&gim=10
- www.rafaelpolit.com/inicio/index.php?sid=14&gim=183
- 我的页面在URL中使用两个参数来定义页面内容:一个是节,另一个是图像ID
{
"id": "117419061672096",
"name": "Rafael P\u00f3lit - Macro y Objetos",
"picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/188186_117419061672096_2606222_s.jpg",
"link": "http://www.rafaelpolit.com/inicio/index.php?sid=106",
"likes": 2,
"category": "Unknown",
"website": "http://www.rafaelpolit.com/inicio/index.php?sid=106",
"description": "-",
"can_post": true
}
但是如果我使用多个参数访问其中一个URL的图形,例如:
{
"id": "http://www.rafaelpolit.com/inicio/index.php?sid=14"
}
如您所见,如果您输入以下内容:
- graph.facebook.com/159684077425429
- 对于某些页面,我没有获得管理页面链接
- 对于那些页面,我无法知道页面id
- 图形选项不适用于具有多个URL参数/参数的页面
- 以完全相同的方式https://graph.facebook.com/feed 对于具有多个URL参数的页面,该选项不会向“喜欢”某个页面的用户发送消息,对于具有单个参数的页面,该选项可以正常工作
<?php
$ogurl = urlencode("http://www.rafaelpolit.com/inicio/index.php?sid=14&gim=10");
define("FACEBOOK_APP_ID", "15xxxx84127xxxx");
define("FACEBOOK_SECRET", "xxxx5391830xxxx744b171f0d4b5xxxx");
$mymessage = "Thank you for 'Liking' my Picture.";
$access_token_url = "https://graph.facebook.com/oauth/access_token";
$parameters = "grant_type=client_credentials&client_id=" . FACEBOOK_APP_ID .
"&client_secret=" . FACEBOOK_SECRET;
$access_token = file_get_contents($access_token_url . "?" . $parameters);
$apprequest_url = "https://graph.facebook.com/feed";
$parameters = "?" . $access_token . "&message=" .
urlencode($mymessage) . "&id=" . $ogurl . "&method=post";
$myurl = $apprequest_url . $parameters;
$result = file_get_contents($myurl);
// output the post id
echo "post_id" . $result;
?>
对于第一个问题——管理页面-您使用了什么代码来处理类似按钮?如果您有这些参数,第一个问题可能与第二个问题相同。@Abby,谢谢您的答复!我怀疑这是因为有明显的随机不一致性:它有时工作,其他的不!但是,当然,这可能非常我们这是like按钮的代码:/
@Abby,非常抱歉上面的格式设置,仍在学习中。
<div class="fb_cont ui-corner-all" style="width:706px">
<div id="fb-root"></div>
<script type="text/javascript">
//<![CDATA[
window.fbAsyncInit = function() {
FB.init({appId: '154581841273133', status: true, cookie: true, xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
//]]>
</script>
<div class="fb_cont_int" style="padding:5px;">
<div class="fb_likeDiv" style="width:240px;">
<div class="fb-like" data-href="http://www.rafaelpolit.com/inicio/index.php?sid=14&gim=183" data-send="false" data-width="240" data-show-faces="true" data-colorscheme="dark" data-font="tahoma"></div>
</div>
<div class="fb_commentDiv" style="width:446px;">
<div class="fb-comments" data-href="http://www.rafaelpolit.com/inicio/index.php?sid=14&gim=183" data-num-posts="4" data-width="446" data-colorscheme="dark"></div>
</div>
<div class="dummy"><!-- --></div>
</div>
</div>