可能重复:
修改 php 中的函数以获得所需的结果
我正在做这个模块,在一些人的帮助下,她一直在进步。
我试图让 facebook 用户喜欢,但我显然不能......它让我一无所获......
你能检查一下这个函数是否有任何错误..?
谢谢
function _facebook_graph_friends_list() {
global $user;
if(!empty($user->uid)){
$fbuid = facebook_graph_get_fbuid();
$return = '';
if(!empty($fbuid)){
$facebook = facebook_client();
$friends = $facebook->api('/me/friends');
if(!empty($friends['data'])){
$size = variable_get('facebook_graph_pic_size_nodes','square');
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
foreach($friends['data'] as $data){
$fbid = $data['id'];
$fbfriendlikes[$fbid]=$facebook->api('/'.$fbid.'/likes');
foreach($fbfriendslikes['data'] as $data){
$fbname = $data['name'];
$fbid1 = $data['id'];
$path = $protocol . '://graph.facebook.com/' . $fbid1 . '/picture?type=' . $size;
$image = theme('image', array('path' => $path, 'alt' => $fbname));
$return .= '<div class="fimage">'.$image.'</div>';
$link = '<a href="'.$protocol . '://www.facebook.com/profile.php?id='.$fbid1.'" target="_blank">'.$fbname.'</a>';
$return .= '<div class="flink">'.$link.'</div>';