用PHP设置封面照片Facebook活动

时间:2014-05-19 08:05:35

标签: php facebook facebook-events

我在将封面照片设置为活动时遇到问题。我可以创建一个活动,我将用封面照片更新此活动。我希望你能找到我的失败。

        if($_POST['response']){
            $name = $_POST['eventname'];
            $date = $_POST['date'];
            $start_time = $_POST['startTime'];
            $description = $_POST['description'];
            $city = $_POST['city'];
            $newTime = $date.'T'.$start_time.':00+0000';
            $pic = $_FILES["picture"]["tmp_name"];
            $response = $facebook->api(
                "/$page_id/events",
                "POST",
                array (
                    'name' => $name,
                    'start_time' => $newTime,
                    'description' => $description,
                    'location' => $city,
                    basename($pic) => '@'.$pic
                )
            );
            if($response['id']){
                $photoConfig = array ( 
                    'source' => '@'.realpath($pic)
                );
                //$photo_uploaded = $facebook->api($response['id'].'/photos',"POST", $photoConfig);
                //$photo_uploaded = $facebook->api($response['id'].'/picture',"POST", $photoConfig);
                //$photo_uploaded = $facebook->api($response['id'],"POST", $photoConfig);
                $test = $facebook->api($page_id.'/photos',"POST",$photoConfig);
                /*$param = array(
                    'cover' =>$albumPhoto['id'],//$photo_uploaded['id'],
                    'offset_x' => 0,
                    'offset_y' => 0,
                    'no_feed_story' => true
                );
                $eventUpdate = $facebook->api( $response['id'], 'POST', $param );*/
            }

        }

0 个答案:

没有答案