lifesessions Posted February 26, 2008 Posted February 26, 2008 hoping one of you crafty guys out there could help, I'm trying to use a slick java script to display my images on my osCommerce site. The problem that I am using a php file to pull up an image to display which, what I believe is messing up the java script. This is what I mean in relation to my website: This is the product info page that I'm trying to get the script to work on: http://lifesessions.com/cart/product...products_id=33 When you hit "click to enlarge" the lightbox java script starts but can't pull up the image. Here's a bit of the code that pulls up the right picture: <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <script language="javascript"><!-- document.write('<?php echo '<a href="' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '" target="_parent" rel="lightbox" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> </td> </tr> </table> <?php Here's the popup_image.php code Code: <?php /* $Id: popup_image.php,v 1.16 2003/02/13 03:10:56 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $navigation->remove_current_page(); $products_query = tep_db_query("select pd.products_name, p.products_image, p.products_bimage from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and 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 (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> </head> <?php if ($products_values['products_bimage'] == '') { echo tep_image(DIR_WS_IMAGES . $products_values['products_image'], $products_values['products_name']); } else { echo tep_image(DIR_WS_IMAGES . $products_values['products_bimage'], $products_values['products_name']); } ?> I have two images loaded, one small for the thumbnail and the a larger one that the popup_image.php pulls up. Any ideas why it's not working? Could it be that the javascript wants an actual jpg file and not something like this: http://lifesessions.com/cart/popup_image.php?pID=33 Is way to incorporate the popup_image.php info into the product_info.php file? Thank you for reading and ant advice offered Josh
shrykull Posted March 10, 2008 Posted March 10, 2008 Hi, This is a good question. I'm also wondering how to change the code of lightbox to upload .jpg in popup file? I already have Small gifs as thumbnails and large ones for popup window. Is there someone who did, or knows how to incorporate lightbox in such a case? Shrykull
Recommended Posts
Archived
This topic is now archived and is closed to further replies.