在上传的图片中标记朋友

时间:2011-10-11 17:26:30

标签: facebook

我有上传图片的代码,并在墙上标记用户

$facebook->setFileUploadSupport(true);
                $args = array('message' => 'by http://www.lookmywebpage.com/api');
                copy('http://demo.lookmywebpage.com/facebook-upload-photos/penguin.png', 'tmp/file.jpeg');
                $args['image'] = '@' . realpath('tmp/file.jpeg');
                $data = $facebook->api('/me/photos', 'post', $args);
                unlink('tmp/file.jpeg');
                //assigning users to tag and cordinates
                $argstag = array('to' => $user);
                $argstag['x'] = 40;
                $argstag['y'] = 40;
                $datatag = $facebook->api('/' . $data['id'] . '/tags', 'post', $argstag);
                echo 'Success! Check your facebook wall now';

但我需要在其上标记20位朋友..有些人请帮助我

1 个答案:

答案 0 :(得分:1)

很简单。 如果您已经拥有friend_id,只需将其替换为"$user"变量并执行for循环