
Originally Posted by
ballyc27
Hey there,
referring to post #29, hey_you talks about a method of controlling the image that is displayed on the facebook page after a 'like' button is clicked. I've tried this method but cannot get it to work. Has anyone else got it to work or found another way of doing it?
Thanks.
store.theebooksale.com
On my site I just created a file called jscript_fbimage.php with the following code inside
Code:
<?php
/**
* Add "image_src" link to <head> section for current product's image
*/
$sql = "select p.products_id, p.products_image
from " . TABLE_PRODUCTS . " p
where p.products_status = '1'
and p.products_id = '" . (int)$_GET['products_id'] . "'";
$product_info = $db->Execute($sql);
$products_image = $product_info->fields['products_image'];
if ($products_image == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
$products_image = PRODUCTS_IMAGE_NO_IMAGE;
}
if ($products_image != '') {
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE));
?>
<link rel="image_src" href="<?php echo HTTP_SERVER . DIR_WS_CATALOG . $products_image_medium; ?>" />
<?php }
and threw it in the includes/modules/pages/product_info folder.
I'm not using the FB Like button because I cannot get it to work so I gave up, but it still works if someone shares to FB through AddThis , etc...