在状态消息或帖子中随机发布到Facebook结果

This app is posting to the user's timeline, using PHP and Facebook's PHP API implementation. This is working right now, for over several weeks already.

The following PHP code is being used to post a message:

if($hasPhoto === TRUE)
{
    // Post to FB with picture
    $facebook->setFileUploadSupport(true);

    $result = $facebook->api("/me/photos", "post", array(
        'message'   => $message,
        'place'     => $place,
        'source'    => '@'  . $photo
    ));
} 
else 
{
    // Post to FB without picture
    $result = $facebook->api("/me/feed", "post", array(
        'message'   => $message,
        'place'     => $place
    ));
}

This is working properly, except there are two formattings of the $result:

array ('id' => '103240856515XXX', )
array ('id' => '100004900175XXX_103239809849XXX', )

The Graph API documentation tells us the following:

A post from Facebook Platform:  https://graph.facebook.com/19292868552_10150189643478553
A status message on the Facebook Page: https://graph.facebook.com/10150224661566729

This means the used PHP code generates posts ór status messages. I don´t see any relation between the textmessages, photos, dates, or authors. It seems to happen randomly.

The following shows the relationship from our data between the format of the id and whether a photo is attached.

select count(*) from fbposts where facebookpostid like '%\_%' and hasphoto = 1;  -- 90
select count(*) from fbposts where facebookpostid like '%\_%' and hasphoto = 0;  -- 87
select count(*) from fbposts where facebookpostid not like '%\_%' and hasphoto = 1;  -- 47
select count(*) from fbposts where facebookpostid not like '%\_%' and hasphoto = 0; -- 54

Why does this behaviour happen? How to force a Post? The reason why this is relevant is because Post does have a Privacy property which I would like to query.

Update: Querying a status message 545778052106XXX, given by the FB API, with a photo, gives me:

{
  "id": "545778052106XXX", 
  "from": {
    "name": "Jeffrey Krist", 
    "id": "100000226354XXX"
  }, 
  "name": "My message!", 
  "picture": "http://photos-f.ak.fbcdn.net/hphotos-ak-ash3/522827_545778052106XXX_1151562XXX_s.jpg", 
  "source": "http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s720x720/522827_545778052106XXX_1151562XXX_n.jpg", 
  "height": 720, 
  "width": 720, 
  "images": [
    {
      "height": 2048, 
      "width": 2048, 
      "source": "http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s2048x2048/522827_545778052106XXX_1151562XXX_n.jpg"
    },  .. lots more
  ], 
  "link": "https://www.facebook.com/photo.php?fbid=545778052106402&set=p.545778052106XXX&type=1", 
  "icon": "http://static.ak.fbcdn.net/rsrc.php/v2/yz/r/StEh3RhPXXX.gif", 
  "place": {
    "id": "182665821805XXX", 
    "name": "A company name", 
    "location": {
      "street": "My street 13", ..
    }
  }, 
  "created_time": "2012-11-01T08:35:20+0000", 
  "updated_time": "2012-11-01T08:35:20+0000", 
  "comments": ...
  "likes": ...
}

Querying a post message using a id from the FB API gives me:

{
  "id": "100003331805XXX_299609210160XXX", 
  "from": {
    "name": "Some name", 
    "id": "100003331805XXX"
  }, 
  "message": "My message", 
  "picture": "http://photos-e.ak.fbcdn.net/hphotos-ak-ash3/560724_299609200160XXX_789651XXX_s.jpg", 
  "link": "https://www.facebook.com/photo.php?fbid=299609200160XXX&set=a.285494101571XXX.69331.100003331805XXX&type=1&relevant_count=1", 
  "name": "Photo album name", 
  "icon": "http://static.ak.fbcdn.net/rsrc.php/v2/yz/r/StEh3RhPXXX.gif", 
  "actions": [
    {
      "name": "Comment", 
      "link": "https://www.facebook.com/100003331805XXX/posts/299609210160XXX"
    }, 
    {
      "name": "Like", 
      "link": "https://www.facebook.com/100003331805XXX/posts/299609210160XXX"
    }
  ], 
  "privacy": {
    "value": "ALL_FRIENDS", ...
  }, 
  "place": {
    "id": "174171872642XXX", ...
  }, 
  "type": "photo", 
  "status_type": "added_photos", 
  "object_id": "299609200160XXX", 
  "application": {
    "name": "My app", ...
  }, 
  "created_time": "2012-12-21T22:33:59+0000", 
  "updated_time": "2012-12-21T23:30:39+0000", 
  "likes":  ...
  "comments": ...
}

Querying a composed id, _ ('100000226354XXX_545778052106XXX'), which is message with a photo, gives me:

{
  "error": {
    "message": "Unsupported get request.", 
    "type": "GraphMethodException", 
    "code": 100
  }
}

There is no need to force a post when each status message is a post object.

Status message object 10100948019328597

Post object userid_10100948019328597

Status message object

{
  "id": "10100948019328597", 
  "from": {
    "name": "phwd", 
    "id": "13608786"
  }, 
  "message": "Happy Thanksgiving you cool Canadians!", 
  "updated_time": "2012-10-08T23:17:27+0000", 
  "likes": {
    "data": [
    ], 
    "paging": {
      "next": 
    }
  }
}

Post object

{
  "id": "13608786_10100948019328597", 
  "from": {
    "name": "phwd", 
    "id": "13608786"
  }, 
  "message": "Happy Thanksgiving you cool Canadians!", 
  "actions": [
    {
      "name": "Comment", 
      "link": "http://www.facebook.com/13608786/posts/10100948019328597"
    }, 
    {
      "name": "Like", 
      "link": "http://www.facebook.com/13608786/posts/10100948019328597"
    }
  ], 
  "privacy": {
    "description": "Public", 
    "value": "EVERYONE", 
    "friends": "", 
    "networks": "", 
    "allow": "", 
    "deny": ""
  }, 
  "type": "status", 
  "status_type": "mobile_status_update", 
  "created_time": "2012-10-08T23:17:28+0000", 
  "updated_time": "2012-10-08T23:17:28+0000", 
  "likes": {
    "data": [
     ]
  }, 
  "comments": {
    "count": 0
  }
}

The best way to check would be to compare /me/statuses vs /me/posts