Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Pop-up image resize


edmond1815

Recommended Posts

Posted

Hi,

I have a pop-up image, with bigg image about my product.

In pop-up_image.php i have this code:

 

<?php

 

/*

 

osCommerce, Open Source E-Commerce Solutions

 

http://www.oscommerce.com

 

 

 

Copyright © 2002 osCommerce

 

 

 

Released under the GNU General Public License

 

*/

 

 

 

require('includes/application_top.php');

 

 

 

$products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_id = '" . $HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . $languages_id . "'");

 

$products_values = tep_db_fetch_array($products_query);

 

?>

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

 

<html <?php echo HTML_PARAMS; ?>>

 

<head>

 

<title><?php echo $products_values['products_name']; ?></title>

 

<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

 

<script language="javascript"><!--

 

var i=0;

 

function resize() {

 

if (navigator.appName == 'Netscape') i=40;

 

if (document.images[0]) window.resizeTo(document.images[0].width +8, document.images[0].height+0+60-i);

 

self.focus();

 

}

 

//--></script>

 

</head>

 

<body onload="resize();">

 

<?php

 

 

 

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

 

// if the big image isn't shown unkomment 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>

 

How can i elimante white borders, from top and left? I just elimnate from right and bottom, but i want to elimnate that too.

I want the pop-up window fit to my image, with is standard.: 500x600 px

 

Any advice?

 

Here is an example. Just click on image, with product

 

http://www.adifar.ro/product_info.php/cPat.../products_id/40

Archived

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

×
×
  • Create New...