多页Facebook共享一页 [英] Multiple Facebook Shares on One Page

查看:123
本文介绍了多页Facebook共享一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个日常交易聚合网站,我无法让Facebook分享正常工作。每个页面都有很多交易,每个页面都有自己的FB分享,所以他们可以在墙上,朋友的墙壁等上发布。



这里是网站,所以你可以尝试分享: http://bit.ly/xFGzj5



以下是Im使用的代码:

 <! - 每个交易都有此按钮链接到FB - > 
< a href =http://www.facebook.com/share.php?u=<?php echo urlencode($ shareurl);?> onclick =return fbs_click('<?php echo urlencode($ shareurl);?>','<?php echo $ title;?>')target =_ blank>< img src = ../../images/fb.pngborder =0alt =在Facebook上分享class =smicon/>< / a>

<! - 这里是JS函数: - >

< script>
function fbs_click(u,t){
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'& t =' + encodeURIComponent方法(T), '共享者', '工具栏= 0,状态= 0,宽度= 626,高度= 436');
返回false;
}
< / script>

使用此方法,现在标题无法正常工作,有时会出现图像,有时会出现它没有。当图像显示时,有大约200个缩略图可供选择(取决于页面上有多少交易),所以用户必须循环浏览,直到找到正确的。



理想情况下,我希望网址/标题正常工作(显然),默认情况下,图片会转到该特定交易的图片,点击分享按钮。任何人都有任何关于如何做这项工作的想法?

解决方案

你为什么要这样做?
i建议使用社交小部件或JavaScript sdk fb提供。例如,使用js sdk可以执行以下操作: https://developers.facebook.com/docs/reference/dialogs/send/



对于社交小部件,您可以为每个项目添加类似的内容:
https://developers.facebook.com/docs/reference/plugins/like/



或发送按钮:
https://developers.facebook.com/docs/reference/plugins / send /


I have a daily deal aggregator site and i can't get the Facebook share to work properly. There are lots of deals on each page and each one has it's own FB share so they can post it on their wall, friends walls etc.

here is the site so you can try the share: http://bit.ly/xFGzj5

Here is the code Im using now:

<!-- Each Deal has this button that links to FB -->
<a href="http://www.facebook.com/share.php?u=<?php echo urlencode($shareurl); ?>" onclick="return fbs_click('<?php echo urlencode($shareurl); ?>','<?php echo $title; ?>')" target="_blank"><img src="../../images/fb.png" border="0" alt="Share On Facebook" class="smicon" /></a>

<!--And here is the JS function:-->

<script>
function fbs_click(u,t) {
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
</script>

With this method, right now the title is not working properly, and sometimes an image shows up, sometimes it doesn't. When an image does show there are about 200 thumbnails to choose from (depending on how many deals are on the page) so the user has to cycle through it until they find the right one.

Ideally, I want the url/title working properly (obviously) and have the image go to that specific deal's image by default when they click the share button. Anyone have any ideas on how to make this work???

解决方案

why are you taking this approach? i recommend using either the social widgets or the javascript sdk fb provides.

for example, with the js sdk you can do this: https://developers.facebook.com/docs/reference/dialogs/send/

as for the social widgets, you can add a like for each item: https://developers.facebook.com/docs/reference/plugins/like/

or send button: https://developers.facebook.com/docs/reference/plugins/send/

这篇关于多页Facebook共享一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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