0

我想让用户点击我的粉丝页面上的链接在其墙上发帖

在我的 main.php 文件下面

<div style="margin: 40px auto; width: 300px; border: 1px solid #c0c0c0; padding: 10px; overflow: hidden;">
    <img src="http://graph.facebook.com/<?php echo $uid; ?>/picture" alt="<?php echo $me['id']; ?>" style="float: left; border-width:0px; margin-right: 10px;" />Bonjour Mr <?php echo $meo['last_name']; ?> !<br />
    Selectionner vos photos YK ?<br /><br /><br />
    Votre identifiant <?php echo $me['id']; ?>
</div>
<div>
    <a onclick="publishWall();return false;" href="#">Poster un article sur mon mur via l'API Javascript</a>
</div>
    ...
<script type="text/javascript">
    function publishWall(){
        FB.ui({
            method: 'stream.publish',
            message: '',
            attachment:{
                name: "Démo Symfony+Facebook",
                caption: '',
                description: "Une démo simple d'application Facebook avec Symfony et les dernières API Javascript et PHP de Facebook.",
                href: "http://www.lexik.fr/blog/symfony/non-classe/exemple-dapplication-utilisant-la-graph-api-de-facebook-1187"
            },
            user_prompt_message: "Application de démo Symfony+Facebook"},
            function (response) {}
        );
    }
</script>
4

2 回答 2

2

请改用以下feed方法:

<h1>feed</h1>
<p>
Publishing to the stream is easy, as all the fields are optional. Just specify
what you need, and leave the rest out.
</p>

<script>
var publish = {
  method: 'feed',
  message: 'getting educated about Facebook Connect',
  name: 'Connect',
  caption: 'The Facebook Connect JavaScript SDK',
  description: (
      'A small JavaScript library that allows you to harness ' +
      'the power of Facebook, bringing the user\'s identity, ' +
      'social graph and distribution power to your site.'
  ),
  link: 'http://fbrell.com/',
  picture: 'http://fbrell.com/f8.jpg',
  actions: [
    { name: 'fbrell', link: 'http://fbrell.com/' }
  ],
  user_message_prompt: 'Share your thoughts about RELL'
};

FB.ui(publish, Log.info.bind('feed callback'));
</script>

示例取自Facebook 测试控制台(Examples->FB.ui->feed)。

于 2011-04-20T12:45:02.030 回答
0

恐怕您无法使用 FB.UI 在用户相册中发布照片

您必须先使用图形 api 来发布您的图片:http: //developers.facebook.com/docs/reference/api/photo/

然后你可以发布一个引用该图片的墙贴(我不确定在相册中发布图片是否也会在墙上发布,我想是的)

于 2011-04-20T14:52:06.010 回答