Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

check this code for image non-resizing


Al66

Recommended Posts

Posted

Hi all,

 

I'm trying to get a very useful piece of code to work that I got from a previous poster who doesn't seem to use the forum anymore -the code is added to popup_image.php to enable the 'click to enlarge' link to open a big image in the pop-up window -with the product_info thumbnail image being literally just a thumbnail rather than a downsized version of the bigger image.

 

The code replaces what is currently in the <body> tags to:

 

<body onload="resize();">

<?php

 

define('IN_IMAGE_SUBDIR','images_big/');

 

// if the big image isn't shown uncomment the next line, and check the path:

// maybe you have to remove '/'. or adjust the path, depends on your configuration

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

? ? ? ? ? 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>

 

'This code basically looks for an image in the directory "images/images_big" and shows it if it is there... if not, it will show the thumbnail...

 

'thats it! Just put the thumbnails in your images directory, and create a directory called "images_big" inside the images folder (images/images_big) and upload the full size images into the images_big folder. The thumbnails can be uploaded via admin... but I don't have a solution to upload the big images via admin... using FTP to upload them works just as well I think.'

 

BUT I can't get this to work! -I just get a message about a parse error in the popup window. Any ideas anyone about how to tweak the code for my particular site? I've tried the adjustments he says but I must be missing something. Here is my test page:

http://www.cardaid.co.uk/catalog/product_i...&products_id=28

 

please help!

Posted

Well I am not a PHP expert however I think it is helpful when people have something to say that they say it. So here is my thoughts. Have you looked at line 40 of your code... The error reads:

 

Parse error: parse error in /home3/www/cardaid/catalog/popup_image.php on line 40

 

So in the popup_image.php on line 40 should be the problem. What is the code from lets say line 35-45?

Archived

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

×
×
  • Create New...