简体   繁体   English

facebook 像按钮

[英]facebook like button

I have implemented a image gallery where in each image is differentiated by its record id.我已经实现了一个图像库,其中每个图像都通过其记录 ID 来区分。 the like button works properly for rest of images only for two images its not working as intended, this is the post content sent by the image that is working properly赞按钮适用于 rest 的图像仅适用于两个图像它没有按预期工作,这是正常工作的图像发送的帖子内容

connect_text    0
edge_type   like
fb_dtsg AQC7N-EB
href    http://www.mydomain.com/images/p.php?id=2422
iframe_referer  http://www.mydomain.com/index.php
is_personalized false
layout  button_count
lsd 
node_type   link
now_connected   true
page_id 
post_form_id    7500ee8867c2d00acc75d7b6dfe2c733
post_form_id_source AsyncRequest
ref 

and the facebook response for this is: facebook 对此的响应是:

for (;;);{"__ar":1,"payload":{"requires_login":false,"error_info":null,"show_error":false,"node_type":"ExternalLink","node_id":"10150246004339081","edge_type":"ExternalLinkLike","connect_text":0,"success":true,"already_connected":true,"user_profile":{"name":"Mamamia","profile_url":"http:\/\/www.facebook.com\/profile.php?id=100002607508082","pic_square":"http:\/\/profile.ak.fbcdn.net\/static-ak\/rsrc.php\/v1\/yo\/r\/UlIqmHJn-SK.gif"},"story_fbid":107571802673069,"is_admin":false,"admin_url":""},"invalidate_cache":[0]}

while for the faulty image post data is而对于错误的图像发布数据是

connect_text    0
edge_type   like
fb_dtsg AQC7N-EB
href    http://www.mydomain.com/images/p.php?id=2420
iframe_referer  http://www.mydomain.com/index.php
is_personalized false
layout  button_count
lsd 
node_type   link
now_connected   true
page_id 
post_form_id    7500ee8867c2d00acc75d7b6dfe2c733
post_form_id_source AsyncRequest
ref 

and its response is它的反应是

for (;;);{"__ar":1,"payload":{"requires_login":false,"success":false,"already_connected":false,"is_admin":false,"show_error":false,"error_info":null}}

can any body tell me why like buttons are working on some images are not working on others t?任何人都可以告诉我为什么喜欢按钮适用于某些图像而不适用于其他图像吗? the images content is brought from database and is linked in the page by looping the array in foreach condition so hyperlinks are same except for the id of image,the hyperlink is图片内容是从数据库中获取的,并通过在 foreach 条件下循环数组来链接到页面中,因此除了图片的 id 之外,超链接是相同的,超链接是

http://www.facebook.com/plugins/like.php?href=http://www.mydomain.com/images/p.php?id=<?php echo $array[id]; ?>

thanks in advance提前致谢

I had the same error in my header.我的 header 中出现了同样的错误。 It seems the url (domain) did not pass the validation by facebook. url(域)似乎没有通过 facebook 的验证。 In my case, i had 2 dots in it.就我而言,我有2个点。 www.somedomain.net16.net (just a working domain) www.somedomain.net16.net (只是一个工作域)

To see if facebook can retreive data from your site use this url:要查看 facebook 是否可以从您的站点检索数据,请使用此 url:

http://developers.facebook.com/tools/debug/ http://developers.facebook.com/tools/debug/

To test it, just type www.google.nl and you get all kind of information back.要对其进行测试,只需键入 www.google.nl 即可获得所有类型的信息。

Not a proper answer, so sorry for that.不是一个正确的答案,很抱歉。 But I'm experiencing the same problem exactly.但我遇到了同样的问题。 It looks like facebook simply has a problem with certain GET variables in URLs.看起来 facebook 只是 URL 中的某些 GET 变量存在问题。 I can't think of any other explanation, it works for some and not others.我想不出任何其他解释,它适用于某些人而不适用于其他人。 The ones it doesn't work for appear to be random.它不起作用的那些似乎是随机的。

I think this must be a facebook bug.我认为这一定是一个 facebook 错误。 The only thing I can think to do is to either submit the bug or sit tight and hope they've spotted the problem and are working on it, Pain in the arse.我唯一能想到的就是要么提交错误,要么坐下来,希望他们已经发现了问题并正在解决它,痛苦的屁股。 mind.头脑。

EDIT: Well, I've got a workaround.编辑:嗯,我有一个解决方法。 Just add a random GET variable to your URL string.只需在 URL 字符串中添加一个随机 GET 变量即可。 I went with 's=true' and that worked.我选择了 's=true' 并且成功了。 Weird stuff, it must mistake URLs ending in certain numbers as character entities.奇怪的东西,它一定会把以特定数字结尾的 URL 误认为是字符实体。

Use facebook's iframe suggested code which can be obtained here使用 facebook 的 iframe 建议代码,可在此处获得

http://developers.facebook.com/tools/lint/ http://developers.facebook.com/tools/lint/

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

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