在活动页面上张贴图片 [英] Posting Picture on Event Page

查看:136
本文介绍了在活动页面上张贴图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Facebook上发布了一个事件墙壁上的图片。
正在发布

i am having a Problem posting a Picture in the Wall of an Event on Facebook. It is Posting

我目前的代码是:

$post_array = array(
    "access_token" => $facebook->getAccessToken(),
    'source' => "@" . realpath("image.png"),
    'message' => 'Some Message'
);
$post_id = $facebook->api("/".$event_id['id']."/feed", "POST", $post_array);

一切都正常,除了图像:它不会显示。

Everything is working fine, except for the Image: It won't be displayed.

任何帮助在那里?

推荐答案



//Setup the Facebook object for file upload
$facebook = new Facebook(array(
  'appId'  => 'your_app_id_here',
  'secret' => 'your_secret_here',
  'cookie' => true,
  'fileUpload' => true
));

然后:



$file = "image.png";
//The event information array (timestamps are "Facebook time"...)
$event_info = array(
    "access_token' => 'your access token",    
    "name" => "Event Title",    
    "start_time" => 1290790800,
    "end_time" => 1290799800,
    "location" => "Your Location",
    "description" => "Event Description"
);

$event_info[basename($file)] = '@' . realpath($file);

$result = $facebook->api('me/events','post',$event_info);

希望有帮助

这篇关于在活动页面上张贴图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆