提要对话框:图片未显示
我的 Facebook 提要对话框链接正确呈现了对话框页面,但使用图片参数设置的图像未显示 - 只是表示没有图片的灰线。
我已经更改了图片文件和类型几次,但图像仍然不显示。
代码如下:
$share_url = "https://www.facebook.com/dialog/feed?app_id=$app_id";
$share_url .= "&link=http://www.doozeez.com";
$share_url .= "&picture=http://doozeez.com/images/halloweenloot.png";
$share_url .= "&caption=to spend in the biggest rewards program in the www (whole wide world)";
$share_url .= "&name=doozeez ... get zeez for what you dooz";
$share_url .= "&description=grab your invitation to join me at the front of the line for doozeez launch";
$share_url .= "&redirect_uri=http://www.doozeez.com/";
echo("<script> top.location.href='" . $share_url . "'</script>");
我已经对图片网址使用和不使用 urlencode() 进行了操作,这没有什么区别。我还通过 Facebook 调试器 linter 运行了它。
我们的 php.ini 文件中是否有需要更改的内容?我们的图像文件似乎无法在 Facebook 平台上使用。然而,它们在公共网络上显示得很好。
My Facebook feed dialog link correctly renders a dialog page, but the image set with the picture parameter does not show up -- just the gray line that indicates no picture.
I've changed picture files and types a few times, but the image still doesn't show up.
Here is the code:
$share_url = "https://www.facebook.com/dialog/feed?app_id=$app_id";
$share_url .= "&link=http://www.doozeez.com";
$share_url .= "&picture=http://doozeez.com/images/halloweenloot.png";
$share_url .= "&caption=to spend in the biggest rewards program in the www (whole wide world)";
$share_url .= "&name=doozeez ... get zeez for what you dooz";
$share_url .= "&description=grab your invitation to join me at the front of the line for doozeez launch";
$share_url .= "&redirect_uri=http://www.doozeez.com/";
echo("<script> top.location.href='" . $share_url . "'</script>");
I've done it with and without a urlencode() for the picture url, and that doesn't make a difference. I've also run it through the Facebook debugger linter.
Is there something we need to change in our php.ini file? Our image files seem to be unavailable to the Facebook platform. Yet, they display on the public web just fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
如果其他人遇到此问题,请注意 Facebook 要求您的图像具有扩展名(即使您已经使用了正确的标头)。即使您的图像在 lint 工具中工作而没有
.png
或.jpg
等扩展名,情况也是如此。In case anyone else encounters this issue, make note that Facebook requires your image to an have extension (even if you already use the proper headers). This is true even if your image works in the lint tool without an extension like
.png
or.jpg
.我对 .png 图像也遇到了类似的问题,
我将图像格式更改为 .gif 并且它自行解决了。
I had a similar problem with a .png image
I change the image format to .gif and it resolved itself.
Facebook 在访问您的图像时收到 404 错误,请检查您的 .htaccess 文件。
http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fdoozeez.com%2Fimages%2Fhalloweenloot.png
你好,
弗雷德里克
Facebook gets a 404 Error when accessing your images please check your .htaccess file.
http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fdoozeez.com%2Fimages%2Fhalloweenloot.png
Greetings,
Frederick
自 2011 年 10 月 1 日起,每个页面选项卡也需要 https。
https://developers.facebook.com/roadmap/
但我的图片没有显示在feed 对话框,尽管它显示在 fb 调试控制台中...:S
Since october 1st 2011 every pagetab needs https too.
https://developers.facebook.com/roadmap/
But my image doesn't show up in the feed dialog, althought it's shown up in the fb debug console... :S
我遇到的另一个问题是,我已经将图像共享到 Facebook,并且当时为该网站启用了身份验证,然后我将其禁用。然而,当我尝试与 Facebook 分享时,它似乎缓存了上一期,这就是导致问题的原因。更改文件名或稍后重试即可解决该问题。就我而言,我删除了图像并制作了一个新图像(它们是动态的)
An alternative problem I experienced was that I had already shared the image to facebook and at that time had authentication enabled for the site, which I then disabled. However when I tried to share with facebook it had seemed to cache the previous issue and that was causing the problem. Changing the file name or trying again later would resolve it. In my case I deleted the image and made a new one (they were dynamic)
对我来说,解决这个问题的方法是将协议从 https 更改为 http 并将图像格式从 png 更改为 jpg
For me what solved this was changing the protocol from https to http and changing the image format from png to jpg
以防万一有人仍在寻找答案。我发现我的域启用了热链接保护,这就是为什么它阻止所有图像直接被引用。因此,为了让 Facebook 直接引用我的图像,我必须关闭热链接保护。另一种选择(我猜是更好的选择)只是添加 facebook.com 作为例外,以便能够热链接您的图像。
我的网络主机是 Godaddy。
Just in case some one still is looking for an answer. I found out that my domain had Hotlink Protection on, that's why it was stopping all images from directly being referenced. So in order for Facebook to reference my images directly, I had to turn off Hotlink Protection. Another alternative (better one, I guess) is only to add facebook.com as an exception to be able to hotlink your images.
My web host was Godaddy.
对我来说:我的 url 字符串中有小写的
.jpg
,但实际的图像文件是大写的“.JPG”for me: I had lowercase
.jpg
in the url string, but the actual image file was uppercase `.JPG'