Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: distante on March 17, 2012, 07:38:04 PM

Title: Any ideas on how to make image attach facebook compatible?
Post by: distante on March 17, 2012, 07:38:04 PM
If I put this http://www.simplemachines.org/community/index.php?action=dlattach;topic=471506.0;attach=199454;image in facebook, isn't caching as an Image, It doesn't get showed, but If I embed that in a Img is showed...
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=471506.0;attach=199454;image)

Facebook is debuging the image link and redirecting to the forum (even when guest have permissions for see attachments).
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.simplemachines.org%2Fcommunity%2Findex.php%3Faction%3Ddlattach%3Btopic%3D471506.0%3Battach%3D199454%3Bimage
Quote
Response Code:   200
Fetched URL:   http://www.simplemachines.org/community/index.php?action=dlattach%3Btopic%3D471506.0%3Battach%3D199454%3Bimage
URL canónica:   http://www.simplemachines.org/community/index.php

Any Idea of how to do the attach img facebook friendly?
Title: Re: Any ideas on how to make image attach facebook compatible?
Post by: SA™ on March 18, 2012, 05:07:18 AM
i got it to return  the proper url using this

http://www.simplemachines.org/community/index.php?topic=460796.msg3218218#msg3218218

http://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.sa-smf.com%2Fcommunity%2Findex.php%3Faction%3Ddlattach%3Btopic%3D1374.0%3Battach%3D1398%3Bimage

tho even that is a bit buggy ignore the errors on the debug tool
Title: Re: Any ideas on how to make image attach facebook compatible?
Post by: SA™ on March 18, 2012, 05:15:01 AM
i got it

Quote
if(strstr($_SERVER["REQUEST_URI"], '%3D')) {

   $_SERVER["REQUEST_URI"] = urldecode(http_build_query($_SERVER["REQUEST_URI"]));

}

solves the issue just add it to the top of index.php to try an test it

maybe not :D
Title: Re: Any ideas on how to make image attach facebook compatible?
Post by: distante on March 18, 2012, 12:22:12 PM
hahah. So, still no really fix for this?
Title: Re: Any ideas on how to make image attach facebook compatible?
Post by: SA™ on March 18, 2012, 03:53:48 PM
half and half lol i can get the debugger to display the correct url but it still dont show the pic on facebook guest hve permission to see atachments aswell