从时间轴隐藏上传的PHoto

时间:2014-03-12 18:01:21

标签: php facebook codeigniter facebook-graph-api

我正在构建一个脚本,根据页面粉丝数量的变化上传封面图片。

上传照片时,它会显示在时间线上。

有什么方法可以将它从时间轴上删除。

$photo = FCPATH . "assets/img/image(" . rand(1, 3) . ").jpg";

    $this->facebook->setFileUploadSupport(true);

    $photo_uploaded = $this->facebook->api("/" . $page_id . "/photos", "POST", array
        ('access_token' => $this->input->get('access_token'), 'source' => '@' . $photo));

    $this->facebook->api("/" . $page_id, "POST", array(
        'access_token' => $this->input->get('access_token'),
        'cover' => $photo_uploaded['id'],
        'offset_y' => 0));

    $this->facebook->api("/" . $photo_uploaded['id'], "DELETE", array('access_token' =>
            $this->input->get('access_token')));

    $this->manager->setFansCount($page_id, $data['likes']);

1 个答案:

答案 0 :(得分:1)

添加no_feed_story参数并将true设置为封面图片API调用以取消故事,并添加no_story并设置为true以取消照片上传故事(而不是删除它)。

E.g。

$this->facebook->api("/" . $page_id, "POST", array(
    'access_token' => $this->input->get('access_token'),
    'cover' => $photo_uploaded['id'],
    'offset_y' => 0
    'no_feed_story' => true ));