Randolph Hoppe:
Thanks, MC!
I pasted in this (added a semi-colon at the end of the $myImage line. Was I correct?):
$og_prod_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
//get defined image or default
//$myImage = zen_get_products_image((int)$_GET['products_id']);
$products_id = (int)$_GET['products_id'];
if (zen_not_null($products_id) && $products_id !== 0) {
$sql = "select p.products_image from " . TABLE_PRODUCTS . " p where products_id= :product_id:";
$sql = $db->bindVars($sql, ':product_id:', $products_id, 'integer');
$look_up = $db->Execute($sql);
$products_image = DIR_WS_IMAGES . $look_up->fields['products_image'];
$products_image_extension = substr($products_image, strrpos($products_image, '.'));
$products_image_base = preg_replace('/' . $products_image_extension . '$/', '', $products_image);
$products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
$myImage = zen_image($products_image_large, zen_get_products_name($products_id), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
//$myImage = DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
$img = simplexml_load_string($myImage);
$img = $img['src'];
}
if($this_is_home_page){ $depends = $store_name; $product_type = "website"; }
else if ($categories_name) {
>
> Now, the Facebook Open Graph Scraper/Debugger is not finding an image file. It's saying the image name is basically the domain.com..
Try removing the if statement as commented below... I may have chosen the wrong test values... If it works, still recommend incorporating something to ensure that it doesn't permit other nasties.. :)
I'm wondering if as a result of that if statement that none of the code is being run based on the content of the "error" being the site's base url. If there is more text that might be applicable, that would be good to know about to properly capture the correct information and code.
$og_prod_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
//get defined image or default
//$myImage = zen_get_products_image((int)$_GET['products_id']);
$products_id = (int)$_GET['products_id'];
/* if (zen_not_null($products_id) && $products_id !== 0) */ {
$sql = "select p.products_image from " . TABLE_PRODUCTS . " p where products_id= :product_id:";
$sql = $db->bindVars($sql, ':product_id:', $products_id, 'integer');
$look_up = $db->Execute($sql);
$products_image = DIR_WS_IMAGES . $look_up->fields['products_image'];
$products_image_extension = substr($products_image, strrpos($products_image, '.'));
$products_image_base = preg_replace('/' . $products_image_extension . '$/', '', $products_image);
$products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
$myImage = zen_image($products_image_large, zen_get_products_name($products_id), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
//$myImage = DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
$img = simplexml_load_string($myImage);
$img = $img['src'];
}
if($this_is_home_page){ $depends = $store_name; $product_type = "website"; }
else if ($categories_name) {