Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我无法联系拥有';喜欢';具有多个URL参数/参数的页面_Url_Parameters_Facebook Like_Facebook Opengraph_Feed - Fatal编程技术网

我无法联系拥有';喜欢';具有多个URL参数/参数的页面

我无法联系拥有';喜欢';具有多个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 显示管理员页面链接,

朋友们

我对这个问题非常着迷,我希望你能为我找到答案,因为我已经广泛地寻找这个问题。我有一个网站,实现了“喜欢”按钮和“评论”按钮。我面临的问题实际上有两个方面:

首先

当管理员(我)喜欢页面时,通常在“喜欢”按钮旁边的“管理页面”链接并不总是存在。。。我不明白为什么,因为它们是完全相同的PHP页面,从DB中填充了不同的信息,但它们具有相同的结构。所以我不明白为什么:

  • www.rafaelpolit.com/inicio/index.php?sid=14&gim=10
显示管理员页面链接,而

  • www.rafaelpolit.com/inicio/index.php?sid=14&gim=183
没有。 有什么想法吗

如果在Open Graph Protocol(开放图形协议)页面上描述的过程正常,则上述问题不会成为问题(https://developers.facebook.com/docs/opengraph/#publishing)在出版之下真的会有用!实际问题是:

  • 我的页面在URL中使用两个参数来定义页面内容:一个是节,另一个是图像ID
我的其他网页,使用一个单一的URL属性,工作良好!!!因此,如果我访问(为了简化目的,我使用图表):

它正确地显示了:

{
   "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
Facebook页面实际上工作正常!!!:(如果我不能从我自己的网站以外的任何地方访问页面,是否有办法真正了解页面ID

因此,总结一下我的问题:

  • 对于某些页面,我没有获得管理页面链接
  • 对于那些页面,我无法知道页面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&amp;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&amp;gim=183" data-num-posts="4" data-width="446" data-colorscheme="dark"></div>
    </div>
    <div class="dummy"><!-- --></div>
</div>
</div>