× Joomla Facebook Connect support forum

Topic-icon JFBCGraph Image selection Issue in Facebook

Active Subscriptions:

None
For some articles, there are two " page as I used both default Open Graph image setting and leave {JFBCGraph image=xxx} in some articles. Example: www.kingsdb.com/tutor/physics/118-ken-chan

I want Facebook to grap the second image added by {JFBCGraph} as the default thumbnail, but it fails. Is it possible to remove the first "
The topic has been locked.
Support Specialist
14 years 9 months ago #12732 by alzander
Anson,
The first Open Graph image that shows up on the page is what Facebook should take and use in the posts. JFBConnect always puts the {JFBCGraph image..} tag first and then puts any default images defined 2nd. Looking at your page, that means that the image you want should be used.

If you just added the {JFBCGraph image..} tag and immediately tried to Like the page, Facebook will use it's cache of the page, which would use the default image. Facebook takes about 24-48 hours to 'see' new Open Graph tags on the page. Alternatively, you can use the URL debug tool to force Facebook to update it's cache and see what Facebook sees about your page:
developers.facebook.com/tools/debug

Additionally, I did a little research, and found that in early June, Facebook posted that for Open Graph images to display properly in certain cases, the image needs to be at least 180px:
developers.facebook.com/blog/post/511/
The case they mention, for posting to feeds, isn't the same as Liking a page, but it's possible that's the cause. You may want to try a larger image.

I hope it's just the caching issue, but let us know if the wider image or forcing the cache helps you.

Thanks, and good luck,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 9 months ago #12733 by fb_634042543
Hi Alex, I have tried few more articles, all of them can show correct image in URL debug tool. But none of them can shows the 1st "og:image" that I want after I clicked the "Like" button. (all of them have image greater than 180px)
Here are some example page
www.kingsdb.com/discount/modern/471
www.kingsdb.com/discount/modern/479
www.kingsdb.com/discount/beacon/477

Is it possible to replace the default "og:image" property if {JFBCGraph image} is used? Or other suggestion to deal with it~ Thank you=]
The topic has been locked.
Active Subscriptions:

None
14 years 9 months ago #12854 by fb_634042543
Hi Alex, any ideas about this issue? Is it simply due to the cache problem?

Any comment/idea/guideline is appreciated. Thanks a lot=]
The topic has been locked.
Support Specialist
14 years 9 months ago #12871 by alzander
Anson,
I really don't have any great answers. The first image is what's supposed to be used, and we've tested that a bit as well. We can give you some code to not include the default if a specific JFBCGraph image tag is already included, but we'd like for you to test something first.

My guess is that Facebook doesn't like the image name that you're using. Specifically:
http://www.kingsdb.com/images/stories/jreviews/_28162326441966690881714380888896989612775864020090n_1314001225.jpg
It's possible they think that's spammy or bogus when actually scanning it to use in a Like, even if it shows up in their Linter alright.

What I'd recommend is removing the default image tag, use the linter tool (to make sure the default doesn't show and updates their cache), and then wait 24 hours to make sure everything's cleared on Facebook's end. This will make it so the only image tag is the long one above, and will be a good test to see if Facebook will even use that. If so, then we can supply the code to skip the default. It shouldn't be necessary, but if it works.. it works :)

Let us know how the test goes. Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 9 months ago #12873 by fb_634042543
I have removed the default image tag and then use the linter tool for the 3 examples I showed before. All of them can find and use {JFBCGraph image} in linter and in FB msg. That means it works perfectly if only one "og:image" is present.

Please help to skip the default if {JFBCGraph image} is used. Thanks a lot, Alex=]

PS: I'm using JFBConnect v3.2.2
The topic has been locked.
Support Specialist
14 years 9 months ago #12944 by alzander
Anson,
Try the following modification which should prevent multiple image tags from being inserted. In the /plugins/system/jfbcsystem.php file, toward the end you'll see the function _getJFBCGraphProperty. At the end of this function, modify the code as below.

Right above this function, add the following variable:
var $imageTagSet;
private function _getJFBCGraphProperty($graphField, $headerGraphString)

Then, at the bottom of the function, add the if/else block shown below:
if (strpos($headerGraphString, $graphName) === false || $graphName == 'og:image')
{
   if ($graphName == 'og:image' && $this->imageTagSet) // Add these 4 lines
      return "";
   else if ($graphName == 'og:image')
      $this->imageTagSet = true;  // Up to here
     
   return '<meta property="' . $graphName . '" content="' . $graphValue . '"/>' . $carriageReturn;
}
else
   return '';

This is untested, but pretty easy code, so hopefully, it should just work. If not, let us know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 9 months ago #13009 by fb_634042543
It works perfectly, thanks Alex~~

By the way, I hope you consider to make an option "override FB default image if {JFBCGraph image} is used" in backend~~It could provide more flexibility to user=]
The topic has been locked.
Support Specialist
14 years 9 months ago #13028 by alzander
We'll consider it, but it likely won't be in the 4.0 release, so please keep the code above handy. We're still not sure why that's required on your site, as it shouldn't be. We also don't like adding new options in general, unless required, and this one is something we'd need to investigate a bit more before throwing it in.

Thanks for the feedback though, and glad to hear that got you going!
Alex
The topic has been locked.