请求事件图片 [英] Requesting Picture for Event

查看:153
本文介绍了请求事件图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力抓住事件图片几天,没有运气。我正在像所有其他事件元素一样正常请求:



https://graph.facebook.com/eventid/picture



这是一个无效的例子(在explorer中):
https://developers.facebook.com/tools/explorer/?method=GET&path=107798885938238%2Fpicture



不过,父母,参加,拒绝,所有工作..



谢谢!

解决方案

我有同样的问题,因为你有。



经过一些研究,我找到了解决方案。



使用 http://graph.facebook.com/eventid/?fields=picture&type=large



您可以选择小型,普通,大型或平方式作为类型。



您可以将其称为单独的api调用,

  $ event = $ facebook-> api('/'.$ even吨[ ID]); 

$ picture = $ facebook-> api('/'.$ event ['id']。'?fields = picture& type = large');
$ picture = $ picture ['picture'];

echo'< img src ='。$ picture。'>';
echo $ event ['name'];

echo $ event ['end_time']; //将工作,无需调用

或同时调用其他字段。但是,你必须定义你要调用的每个字段。

  $ event = $ facebook-> api(' /'.$event['id'].'?fields=name,start_time,picture&type=large'); 

echo'< img src ='。$ event ['picture']。'>';
echo $ event ['name'];

echo $ event ['end_time']; //不行,end_time没有被叫做


I've been trying to grab event pictures for a few days now, with no luck. I'm making a normal request just like all the other event elements:

https://graph.facebook.com/eventid/picture

Here's a non-functioning example (in explorer): https://developers.facebook.com/tools/explorer/?method=GET&path=107798885938238%2Fpicture

However parent, attending, declined, all work..

Thank you!

解决方案

I've had the same problem as you have.

After some looking into it, I found the solution.

Use http://graph.facebook.com/eventid/?fields=picture&type=large

You can choose small, normal, large or square as type.

You can call this as a separate api call,

$event = $facebook->api('/'.$event['id']);

$picture = $facebook->api('/'.$event['id'].'?fields=picture&type=large');
$picture = $picture['picture'];

echo '<img src="'.$picture.'">';
echo $event['name'];

echo $event['end_time']; // will work, no need to call

or call for other fields at the same time. But then you'll have to define every field you want to call.

$event = $facebook->api('/'.$event['id'].'?fields=name,start_time,picture&type=large');

echo '<img src="'.$event['picture'].'">';
echo $event['name'];

echo $event['end_time']; // will not work, end_time hasn't been called

这篇关于请求事件图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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