Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem with enlarging images


TBBucs

Recommended Posts

I found the following code (used in popup_image.php) from another topic that looks for an enlarged product image in a directory called images_big:

<body onload="resize();">
<?php
	define('IN_IMAGE_SUBDIR','images_big/');

	//echo DIR_FS_CATALOG.DIR_WS_IMAGES.IN_IMAGE_SUBDIR.$products_values['products_name'];

	if (is_file(DIR_FS_CATALOG.DIR_WS_IMAGES.IN_IMAGE_SUBDIR.$products_values['products_image']))
		$image = DIR_WS_IMAGES.IN_IMAGE_SUBDIR.$products_values['products_image'];

	else
		$image = DIR_WS_IMAGES . $products_values['products_image'];

	echo tep_image($image, $products_values['products_name']);
?>
</body>

Suffice it to say, it didn't work. I click 'enlarge image' and I get a blank popup window. I tried echo-ing the directory to see where it was pointing, and it is looking at the right place, but the $products_values['products_image'] variable is not returning a value. So the result of the echo was:

 

.../public_html/images/images_big/

 

So for whatever reason, there is no value stored in the $products_values array. I'm not sure why, but that's definitely the problem. Any ideas as to what's going on?

Link to comment
Share on other sites

I found the following code (used in popup_image.php) from another topic that looks for an enlarged product image in a directory called images_big:

<body onload="resize();">
<?php
	define('IN_IMAGE_SUBDIR','images_big/');

	//echo DIR_FS_CATALOG.DIR_WS_IMAGES.IN_IMAGE_SUBDIR.$products_values['products_name'];

	if (is_file(DIR_FS_CATALOG.DIR_WS_IMAGES.IN_IMAGE_SUBDIR.$products_values['products_image']))
		$image = DIR_WS_IMAGES.IN_IMAGE_SUBDIR.$products_values['products_image'];

	else
		$image = DIR_WS_IMAGES . $products_values['products_image'];

	echo tep_image($image, $products_values['products_name']);
?>
</body>

Suffice it to say, it didn't work. I click 'enlarge image' and I get a blank popup window. I tried echo-ing the directory to see where it was pointing, and it is looking at the right place, but the $products_values['products_image'] variable is not returning a value. So the result of the echo was:

 

.../public_html/images/images_big/

 

So for whatever reason, there is no value stored in the $products_values array. I'm not sure why, but that's definitely the problem. Any ideas as to what's going on?

 

Shouldn't you use 'file_exists' instead of 'is_file'

 

if (file_exists(DIR_FS_CATALOG.DIR_WS_IMAGES.IN_IMAGE_SUBDIR.$products_values['products_image']))

echo DIR_FS_CATALOG.DIR_WS_IMAGES.IN_IMAGE_SUBDIR.$products_values['products_name'];

else

echo DIR_FS_CATALOG.DIR_WS_IMAGES.$products_values['products_name'];

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...