简体   繁体   English

如何定制facebook的sharer.php以在聊天和时间线上分享图像

[英]How to cusomize facebook's sharer.php to sharer images on chats and Timeline

Below is the code used to share an image in facebook: 以下是用于在Facebook中共享图像的代码:

<div><a href="#" 
  onclick="
    window.open(
      'https://www.facebook.com/sharer/sharer.php?m2w&u=[[Link to share]]&mode=message', 
      'facebook-share-dialog', 
      'width=626,height=436'); 
    return false;"><img src="send.png(the image clicking on which the sharer window will open)"></a></div>

the above code will open the facebook sharer window in private message mode. 上面的代码将以私人消息模式打开facebook sharer窗口。 在此输入图像描述

If we remove the &mode=message after the link to share, the sharer window will say share on your timeline. 如果我们在共享链接后删除&mode =消息 ,则共享者窗口将在您的时间轴上显示共享。 Can anyone please help me how to make the sharer window open saying 'share on a friends timeline' or 'share in a group' by default. 任何人都可以帮助我如何让共享窗口打开,默认情况下“分享朋友时间线”或“分享群组”。

I'm not sure what you're asking for, 我不确定你要的是什么,

If we remove the &mode=message after the link to share, the sharer window will say share on your timeline. 如果我们在共享链接后删除&mode =消息,则共享者窗口将在您的时间轴上显示共享。 Can anyone please help me how to make the sharer window open saying 'share on a friends timeline' or 'share in a group' by default. 任何人都可以帮助我如何让共享窗口打开,默认情况下“分享朋友时间线”或“分享群组”。

anyways if you want to show the option "Share on a friend's timeline" to be shown by default add &mode=friend to end of share dialog and for group use &mode=group 无论如何,如果你想显示默认显示选项“分享在朋友的时间线上”,请添加&mode=friend到分享结束对话框以及组使用&mode=group

<a id="share" href="#" data-share="https://www.facebook.com/sharer/sharer.php?m2w&u=http://flatuicolors.com/&mode=group" class="groupBtn">Share in Group</a>

<a id="share" href="#" data-share="https://www.facebook.com/sharer/sharer.php?m2w&u=http://flatuicolors.com/&mode=friend" class="friendBtn">Share on Friend's Timeline</a>

Here's an example http://jsfiddle.net/AdamAzad/Lm2sc/ 这是一个例子http://jsfiddle.net/AdamAzad/Lm2sc/

为了通过私人消息“共享”添加&mode =消息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM