简体   繁体   English

为什么Facebook的sharer.php正确显示我的一些缩略图,而不是其他人?

[英]Why is Facebook's sharer.php properly displaying some of my thumbnails, but not others?

OK, this is my first question on SO, so be gentle. 好的,这是我关于SO的第一个问题,所以请保持温和。 Doing my best to be thorough. 尽我所能彻底。 :) :)

We want users to be able to share URLs specific to ordering photos of their children on our site. 我们希望用户能够共享特定于在我们网站上订购其子女照片的网址。 We currently have no interest in implementing Open Graph on our site. 我们目前没有兴趣在我们的网站上实施Open Graph。 We're not trying to track that data at this time, and it's more work than I have time for anyway. 我们目前不是在试图跟踪这些数据,而是比我有时间做更多的工作。 So I opted for the quickest route: the sharer.php link. 所以我选择了最快的路线:sharer.php链接。

I realize that FB's sharer.php is deprecated in favor of 'og:' tags, but see no indication at https://developers.facebook.com/docs/reference/plugins/share-links/ - which was updated three weeks ago, so it obviously should still work. 我意识到FB的sharer.php已被弃用而不赞成'og:'标签,但在https://developers.facebook.com/docs/reference/plugins/share-links/上看不到任何迹象 - 这是在三周前更新的,所以它显然应该仍然有效。

I followed the instructions in these blog posts to customize the links: 我按照这些博客文章中的说明自定义链接:

http://ar.zu.my/how-to-really-customize-the-deprecated-facebook-sharer-dot-php/ http://ar.zu.my/how-to-really-customize-the-deprecated-facebook-sharer-dot-php/

http://www.therykers.net/?p=37 http://www.therykers.net/?p=37

However, we only get thumbnails to properly display in the FB Share dialog when using our site's demo subdomain, even though the source code for our sharer.php link is identical in all instances (aside from the image/name of the child, the site's subdomain, and the photography studio name). 但是,在使用我们网站的演示子域时,我们只能在FB Share对话框中正确显示缩略图,即使我们的sharer.php链接的源代码在所有实例中都是相同的(除了孩子的图像/名称,网站的子域名和摄影工作室名称)。

This source code (demo site) properly displays the image: 此源代码(演示站点)正确显示图像:

<a href="https://www.facebook.com/sharer.php?
s=100
&p[url]=https://demo.mysmilecentral.com/public/show?link_code=funankizwd
&p[images][0]=http://assests0_bop_heroku_com.s3.amazonaws.com/images/sp00/sp00-001-1/0106_022_0028.jpg
&p[title]=Order%20Pictures%20of%20CASEY%20at%20Sample Studio's%20MySmileCentral!
&p[summary]=View%20images%20and/or%20order%20pictures%20of%20CASEY." target="_blank">
<img src="https://assests0_bop_heroku_com.s3.amazonaws.com/images/fb-share-btn2.png" style="margin-top: -35px; margin-right: 126px; float: right" />
</a>

But this ('live' site) doesn't: 但是这个(“直播”网站)不会:

<a href="https://www.facebook.com/sharer.php?
s=100
&p[url]=https://rowlandphoto.mysmilecentral.com/public/show?link_code=2cols21uogpx
&p[images][0]=http://assests0_bop_heroku_com.s3.amazonaws.com/images/bj20/bj20-bb2013-1/1448_img_0128.jpg
&p[title]=Order%20Pictures%20of%20Gabrielle%20at%20Rowland Studio's%20MySmileCentral!
&p[summary]=View%20images%20and/or%20order%20pictures%20of%20Gabrielle." target="_blank">
<img src="https://assests0_bop_heroku_com.s3.amazonaws.com/images/fb-share-btn2.png" style="margin-top: -35px; margin-right: 126px; float: right" />
</a>

Both images meet the dimension requirements of FB Share, and are publicly viewable. 两个图像均符合FB Share的尺寸要求,并且可公开查看。

I've spent several hours trying to find an answer (Googling, searching here), and haven't come up with a logical reason for this. 我花了几个小时试图找到答案(谷歌搜索,在这里搜索),并没有提出合理的理由。

If you open up your web inspector you would realize that https://www.facebook.com/sharer.php deprecated redirects to https://www.facebook.com/sharer/sharer.php , which only has one supported parameter u for the url being shared which depends on Open Graph meta data (which you have opted not to use). 如果您打开网络检查员,您会意识到https://www.facebook.com/sharer.php 已弃用重定向到https://www.facebook.com/sharer/sharer.php ,它只有一个受支持的参数u对于共享的URL, 这取决于Open Graph元数据 (您已选择不使用)。

The p array (p[url], etc) is not supported in the new Facebook Share dialog. 新的Facebook共享对话框中不支持p数组(p [url]等)。 By using deprecated features, you should expect unstable behaviour or no results at all. 通过使用已弃用的功能,您应该预期不稳定的行为或根本没有结果。 There isn't anything much more to say about that. 关于这一点没有更多的话要说。

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

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