简体   繁体   中英

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. 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. 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.

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.

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://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).

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.

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).

The p array (p[url], etc) is not supported in the new Facebook Share dialog. By using deprecated features, you should expect unstable behaviour or no results at all. There isn't anything much more to say about that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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