Home  >  Article  >  Backend Development  >  网页上facebook分享功能具体实现_PHP教程

网页上facebook分享功能具体实现_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:39:501420browse

复制代码 代码如下:



题外话:直接跳到facebook登录页面的分享按钮:

url为: http://www.facebook.com/sharer.php?u=www.baidu.com&t=123213123

其中的u参数为你要分享的链接。t 参数目前还没弄清楚是干什么的。

facebook分享功能的实现:

分享页面设定

1.一个链接: 参数是要分享的页面的链接
复制代码 代码如下:


2.fb识别的标签:
复制代码 代码如下:

testtitle> <br><meta property="og:image" content="test/test.jpg"> <br><meta property="og:description" content="test>"> <br><meta property="og:url" content="https://www.baidu.com"> <br>

注意:

1.title fb可以自动读取要分享页面的title 这个要设置在fb的sharer.php参数里
你也可以自己设置 方式就是
复制代码 代码如下:



2.image标签 可以写多个 分享人可以自己选择图片

3.url就是你的要分享的页面
4.description 介绍信息

提示:

图片像素必须是100*100 这样的格式 我用90*90 就是OK的

例如:300*100 150*50在www.facebook.com图片会截取90x90图片显示就不正确了
如果图片小了 更不行了,分享的那个弹出框就不会显示你的图片 这个情况发生在图片小于90x90的情况吧

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/728112.htmlTechArticle复制代码 代码如下: span style=" font-family: Verdana, Arial, Helvetica, sans-serif; word-wrap: normal; word-break: normal; line-height: 19.5px;"span style="word-wrap:normal...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn