如何在 PHP 中使用 Facebook Sharer

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11186852/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 23:56:44  来源:igfitidea点击:

How to use Facebook Sharer in PHP

phpfacebook

提问by Newbie

Am I missing something? I use this simple code

我错过了什么吗?我用这个简单的代码

<a name="fb_share" type="button" href="https://www.facebook.com/sharer.php?u=123.abc.comt=TEst">share on Facebook</a>

and the content that is being shared is blank? Thanks

并且正在共享的内容是空白的?谢谢

回答by Ahmed Nuaman

You're missing the ampersand ('&') in your url:

您的网址中缺少与号 ('&'):

<a name="fb_share" type="button" href="https://www.facebook.com/sharer.php?u=123.abc.com&t=TEst">share on Facebook</a>

回答by Cathy

The Share button is no longer deprecated and has made a come back as share dialogue: https://developers.facebook.com/docs/reference/plugins/share-links/

分享按钮不再被弃用,并作为分享对话回归:https: //developers.facebook.com/docs/reference/plugins/share-links/

On sites like buzzfeed.com their share buttons are still an important source of referral.

在像 buzzfeed.com 这样的网站上,他们的分享按钮仍然是重要的推荐来源。

回答by devWaleed

Ah, Its simple, What ever page you want to share, Just put it after u= Any link after that will be shared on facebook, If the link page has og:meta-tags, og:image, og:title and og:decription, It will also be shared of that page making it interactive :)

啊,很简单,你想分享什么页面,只要把它放在 u= 之后的任何链接都会在 facebook 上分享,如果链接页面有 og:meta-tags, og:image, og:title 和 og:说明,它也将共享该页面,使其具有交互性 :)

回答by Nitzan Tomer

Don't use the sharer, it has been deprecated and is no longer supported:

不要使用共享器,它已被弃用且不再受支持:

The Share button has been deprecated in favor of the Like button, and will no longer be supported.
Please use the Like button whenever possible to drive maximum traffic to your apps.

Share 按钮已被弃用,取而代之的是 Like 按钮,并且将不再受支持。
请尽可能使用“赞”按钮来为您的应用带来最大流量。

(http://developers.facebook.com/docs/share/)

http://developers.facebook.com/docs/share/

What happened to the old Share button?

We deprecated the Share Button when we launched the Like button, because the Like button improves clickthrough rates by allowing users to connect with one click, and by allowing them to see which of their friends have already connected.

旧的“共享”按钮发生了什么变化?

我们在推出“赞”按钮时弃用了“分享”按钮,因为“赞”按钮允许用户通过单击连接并允许他们查看哪些朋友已经连接,从而提高了点击率。

(http://developers.facebook.com/docs/reference/plugins/like/)

http://developers.facebook.com/docs/reference/plugins/like/