desiredin Posted April 4, 2008 Share Posted April 4, 2008 (edited) Looks like your code for the enlarged pop-up is different than what the contribution shows??? Backup your file and use this instead of the other code you have there. <script language="javascript"><!-- document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.addslashes(addslashes($product_info['products_name'])).'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes(addslashes($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 . addslashes(addslashes($product_info['products_name'])) . '" target="_blank" rel="lightbox" title="'.addslashes(addslashes($product_info['products_name'])).'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); </noscript> */ ?> <script language="javascript"><!-- document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.addslashes($product_info['products_name']).'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($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" rel="lightbox" title="'.addslashes($product_info['products_name']).'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); </noscript> Edited April 4, 2008 by desiredin Quote Link to comment Share on other sites More sharing options...
Webbies Posted April 5, 2008 Share Posted April 5, 2008 thank you so much, I now see the mistake I made. I download the text from 15 march (update with all files and did not realize there was some other code nescessary). But it's working now! GREAT. :thumbsup: Looks like your code for the enlarged pop-up is different than what the contribution shows??? Backup your file and use this instead of the other code you have there. <script language="javascript"><!-- document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.addslashes(addslashes($product_info['products_name'])).'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes(addslashes($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 . addslashes(addslashes($product_info['products_name'])) . '" target="_blank" rel="lightbox" title="'.addslashes(addslashes($product_info['products_name'])).'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); </noscript> */ ?> <script language="javascript"><!-- document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.addslashes($product_info['products_name']).'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($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" rel="lightbox" title="'.addslashes($product_info['products_name']).'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); </noscript> Quote Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2008 Share Posted April 6, 2008 Quote Link to comment Share on other sites More sharing options...
desiredin Posted April 6, 2008 Share Posted April 6, 2008 If I get you correct, your "Changed Code" is the file that isn't working for you? Have you tried moving that file over to the new installation to see if it works there? This one no doubt is obvious, and shouldn't be an issue given the amount of pissing around you have done, but have you made sure you refreshed your cache (CTRL-F5) just in case? Quote Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2008 Share Posted April 6, 2008 If I get you correct, your "Changed Code" is the file that isn't working for you? Have you tried moving that file over to the new installation to see if it works there? This one no doubt is obvious, and shouldn't be an issue given the amount of pissing around you have done, but have you made sure you refreshed your cache (CTRL-F5) just in case? Yes the Changed code is the code in question, After each change I refreshed the cache. Just tested Changed code php on other server works fine ...??... is there another file i should be looking at or the server ? Quote Link to comment Share on other sites More sharing options...
desiredin Posted April 7, 2008 Share Posted April 7, 2008 I can't explain why the code works on one server but not the other. Better if you can post an example URL so that we can take a look at what's going on? Preferably your example on both servers for easy comparison. Quote Link to comment Share on other sites More sharing options...
philbydevil Posted April 7, 2008 Share Posted April 7, 2008 Hi. Cool contribution, adds a whole other dimension to a basic (or advanced) osc store. I've had a look through the thread but haven't been able to find anything relating to merging Clubosc Thumb Images (http://addons.oscommerce.com/info/5777) with this lightbox (and there's no support thread for CTI). The installation works great but the image that comes up in the lightbox is just the thumbnail. CTI has two images per product - a thumbnail and a larger image. The larger image has been added via a SQL addition - 'large_products_image' I've changed a bit of the code in product_info to try and make the larger/different image show up but the lightbox just stalls - loads but nothing ends up opening. Here's the slightly modified code I've tried that didn't work: <script language="javascript"><!-- document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['large_products_image']) . '" target="_blank" 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['large_products_image']) . '" target="_blank" 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>'; ?>'); </noscript> Really only changed a couple of $product_info['products_image'] to $product_info['large_products_image'] as that's what was added to the database. So it seems like the new code isn't finding my larger image but I'm not sure why. Any suggestions?? With those of you who aren't using a thumb-large image contribution with the lightbox, doesn't this slow down page loading time and also distort your smaller (thumb) images? Should I ditch the CTI and just use lightbox? Quote Link to comment Share on other sites More sharing options...
desiredin Posted April 7, 2008 Share Posted April 7, 2008 Really only changed a couple of $product_info['products_image'] to $product_info['large_products_image'] as that's what was added to the database. So it seems like the new code isn't finding my larger image but I'm not sure why. Any suggestions?? With those of you who aren't using a thumb-large image contribution with the lightbox, doesn't this slow down page loading time and also distort your smaller (thumb) images? Should I ditch the CTI and just use lightbox? I'm no PHP expert (I get by with way too much trial and error) and may be completely wrong, but I beleive that "large_products_image" is a variable that needs defining somewhere in the document. It isn't simply a matter of changing that text around. Search the document for instances where 'products_image" might be referenced and add your "large_products_image". I found Lightbox great, but I have since moved on to using Shadowbox. It's great and much more versatile than Lightbox is. So much more can be done with it. OSC Shadowbox Implementation Contribution: http://www.oscommerce.com/community/contributions,5852 Examples of Shadowbox: http://www.visceralmagic.com/product_info.php?products_id=7 http://mjijackson.com/shadowbox/ Quote Link to comment Share on other sites More sharing options...
philbydevil Posted April 7, 2008 Share Posted April 7, 2008 Yeah I'm not totally down with PHP either but since there was a database field called 'large_products_image' I thought that I might be able to change it in product_info and it would show the larger image. Might have a play around with the Shadowbox and see if it's any easier to change. Quote Link to comment Share on other sites More sharing options...
philbydevil Posted April 8, 2008 Share Posted April 8, 2008 Ok, I have a partial fix for using Fancy Lightbox Popup with ClubOsc Thumb Images. This will only work if you have large images loaded for all of your products. Otherwise, the lightbox will just hang and no image will load. Around line 84 of product_info you'll find the following code: <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); You need to add p.large_products_image after p.products_image Also, after you've done the following change to product_info (as per the Fancy Lightbox install instructions): <script language="javascript"><!-- document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info ['products_image']) . '" target="_blank" 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" 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>'; ?>'); </noscript> You'll need to change the first ['products_image'] to ['large_products_image'] This seems to work, as long as you have large images loaded for all products. I'm trying to figure out how to revert to the thumbnail image if a large image hasn't been loaded but haven't figure it out just yet. Quote Link to comment Share on other sites More sharing options...
scorp Posted April 11, 2008 Share Posted April 11, 2008 Hi all ive been looking around the forum all day for a answer to this question. Is there a easy way to centre,(<im english) the lightbox popup. at the min it pops up at the very top in the middle which file/files do i need to edit and how? Thx Quote Link to comment Share on other sites More sharing options...
desiredin Posted April 11, 2008 Share Posted April 11, 2008 Hi all ive been looking around the forum all day for a answer to this question. Is there a easy way to centre,(<im english) the lightbox popup. at the min it pops up at the very top in the middle which file/files do i need to edit and how? Thx Heh. I couldn't figure it out in the CSS myself, so I switched to Shadowbox. Centers automatically, just as easy to install/use, and covers a lot more features. Quote Link to comment Share on other sites More sharing options...
scorp Posted April 11, 2008 Share Posted April 11, 2008 Heh. I couldn't figure it out in the CSS myself, so I switched to Shadowbox. Centers automatically, just as easy to install/use, and covers a lot more features. Thx desiredin shadowbox work great thanks i do have a slight problem with it but i will use the right fhread. as its now a shadowbox issue. Quote Link to comment Share on other sites More sharing options...
d3vilr3d Posted April 15, 2008 Share Posted April 15, 2008 Hi Guys, I lightbox 2.02 installed on my oscommerce shop. The program works fine in firefox. But in I.E. 6 / 7, the images won't load. The background would turn grey, but there will be an error that saids: Error: Object doesn't support this property or method. and no enlarged image will be displayed. Anyone have any suggestion about how to fix this problem? Thanks, William Quote Link to comment Share on other sites More sharing options...
flyt42 Posted April 24, 2008 Share Posted April 24, 2008 Quote Link to comment Share on other sites More sharing options...
scubasjl Posted May 17, 2008 Share Posted May 17, 2008 Please help upload the files needed and I have custom theme and it didn't work not sure. <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script type="text/javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> <link rel="stylesheet" href="lightbox/lightbox.css" type="text/css" media="screen" /> <script type="text/javascript" src="lightbox/builder.js"></script> <script type="text/javascript" src="lightbox/prototype.js"></script> <script type="text/javascript" src="lightbox/scriptaculous.js?load=effects"></script> <script type="text/javascript" src="lightbox/lightbox.js"></script> </head> <body> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td style="height:100%;"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <? /* <?php echo TEXT_PRODUCT_NOT_FOUND;?> */ ?> <tr><td> <? tep_draw_heading_top(); ?> <table border="0" cellspacing="0" cellpadding="0"> <tr><td class="cont_header_txt"><? echo(tep_image(DIR_WS_IMAGES.'1_z3.gif'))?> <?php echo TEXT_PRODUCT_NOT_FOUND;?></td></tr> </table> <? tep_draw_heading_top_1(); ?> <? echo $tep_draw_heading_top_prod_type1?> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr><td height="27"></td></tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> <tr><td height="5"></td></tr> </table> <?php echo tep_draw_separator('spacer.gif', '1', '15'); ?><br> <? echo $tep_draw_heading_bottom_prod_type1?> <? tep_draw_heading_bottom_1(); ?> <? tep_draw_heading_bottom(); ?> <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<span class="price_txt">' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span> <span class="price_txt_strice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = '<span class="price_txt">'.$currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']).'</span>'); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr> <td> <? tep_draw_heading_top(); ?> <?/* going title */?> <?php tep_draw_titletop();?> <?php echo $breadcrumb->trail(' » ')?> <?php tep_draw_titlebottom();?> <? tep_draw_heading_top_3(); ?> <? tep_draw_heading_top_2(); ?> <? /* <?php echo $products_name; ?> <?php echo $breadcrumb->trail(' » ')?> */ ?> <?php if (tep_not_null($product_info['products_image'])) { ?> <table cellspacing="0" cellpadding="0" border="0" style="background:url(images/rtc1.gif) no-repeat right top; height:35px;"> <tr> <td style="background:url(images/rbc1.gif) no-repeat right bottom; padding:0 0 0 21px; vertical-align:middle;" class="title2_txt"> <?php echo $products_name; ?><br> </td> </tr> </table> </td> </tr> </table> <table cellspacing="0" cellpadding="0" border="0" style="margin-top:16px;"> <tr> <td width="260" style="text-align:center;"> <script type="text/javascript"> <!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="0" vspace="0"') . '</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="0" vspace="0"') . '</a>'; ?><br> </noscript> <br> <script type="text/javascript"><!-- document.write('<?php echo '<br style="line-height:10px;"> <div><a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . TEXT_CLICK_TO_ENLARGE . '</a></div>'; ?>'); //--></script> <noscript> <?php echo '<br style="line-height:10px;"><div><a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank"> ' . TEXT_CLICK_TO_ENLARGE . '</a> </div>'; ?> </noscript><br> <?php echo '<br style="line-height:10px;"><div class="link7"><a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank"> ' . TEXT_CLICK_TO_ENLARGE . '</a> </div>'; ?> </td> <td> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td height="98" class="link2 txt5"> <?php echo tep_draw_separator('spacer.gif', '1', '1'); ?><br> </td> </tr> </table> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td style="width:100%; background:url(images/side.gif) repeat-x top;"> <table cellspacing="0" cellpadding="0" border="0" style="background:url(images/side.gif) repeat-x bottom;"> <tr> <td style="background:url(images/side.gif) repeat-y left;"> <table cellspacing="0" cellpadding="0" border="0" style="background:url(images/side.gif) repeat-y right;"> <tr> <td style="background:url(images/ltc2.gif) no-repeat left top;"> <table cellspacing="0" cellpadding="0" border="0" style="background:url(images/lbc2.gif) no-repeat left bottom;"> <tr> <td style="background:url(images/rtc2.gif) no-repeat right top;"> <table cellspacing="0" cellpadding="0" border="0" style="background:url(images/rbc2.gif) no-repeat right bottom;height:59px;"> <tr> <td width="120" class="price_txt" style=" text-align:center; vertical-align:middle;"><?=$products_price?><br> </td> <td style="width:auto;"> <?php echo tep_draw_separator('spacer.gif', '1', '14'); ?><br> <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_add_to_cart1.gif', IMAGE_BUTTON_IN_CART); ?><br> <?php echo tep_draw_separator('spacer.gif', '1', '4'); ?><br> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?><br> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <table cellspacing="0" cellpadding="0" border="0" style="margin-top:23px;"> <tr> <td style="padding-left:11px; padding-right:15px;" class="txt5"> <?php } ?> <br style="line-height:20px;"> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table cellpadding="0" cellspacing="0" class=" box_width_cont product"> <tr><td class="p2" height="25" colspan="2"><strong> <?php echo TEXT_PRODUCT_OPTIONS; ?></strong></td></tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td style="width:47px;"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <tr><td height="10" colspan="2"></td></tr> <?php } ?> </table> <?php } ?> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <table cellpadding="0" cellspacing="0" class="product box_width_cont"> <tr><td style=" line-height:15px;"> <?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?> </td></tr> </table> <br style="line-height:10px;"> <?php } if (tep_not_null($product_info['products_url'])) { ?> <table cellpadding="0" cellspacing="0" class="product box_width_cont"> <tr><td style=" line-height:15px;"> <?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?> </td></tr> <tr><td height="17"></td></tr> </table> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <table cellpadding="0" cellspacing="0" class="product box_width_cont"> <tr><td style=" line-height:15px;" class="txt10"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td></tr> <tr><td height="17"></td></tr> </table> <?php } else { ?> <table cellpadding="0" cellspacing="0" class="product box_width_cont"> <tr><td style=" line-height:15px;" class="txt10"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td></tr> <tr><td height="17"></td></tr> </table> <?php } ?> <div style="line-height:16px;"> <?php echo stripslashes($product_info['products_description']); ?><br> </div> <br style="line-height:20px;"> <? tep_draw_heading_bottom_2(); ?> <? tep_draw_heading_bottom_3(); ?> <?php tep_draw_heading_bottom();?> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { ?> <?php //include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); ?> <?php } ?> <? } ?> </td></tr> </table></form> </td> <!-- body_text_eof //--> <td valign="top"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Quote Link to comment Share on other sites More sharing options...
sLaV- Posted May 20, 2008 Share Posted May 20, 2008 (edited) Argh Stupid IE!!! We uploaded lightbox and everything is fine in FF works like a CHARM...tried it in IE and when the product_info.php page begins to load we get an "Operation Aborted" error and then the page displays a "Page cannot be displayed" error message. I have even tried uploading the product_info.php that came with the package but still getting this error in IE7 ... PLEASE help someone, we're dying to use this on our site. Cheers. Edited May 20, 2008 by sLaV- Quote Link to comment Share on other sites More sharing options...
sLaV- Posted May 20, 2008 Share Posted May 20, 2008 Argh Stupid IE!!! We uploaded lightbox and everything is fine in FF works like a CHARM...tried it in IE and when the product_info.php page begins to load we get an "Operation Aborted" error and then the page displays a "Page cannot be displayed" error message. I have even tried uploading the product_info.php that came with the package but still getting this error in IE7 ... PLEASE help someone, we're dying to use this on our site. Cheers. Dont worry problem fixed :) Quote Link to comment Share on other sites More sharing options...
iyah Posted July 1, 2008 Share Posted July 1, 2008 I have the Fancy Product contribution installed. http://www.oscommerce.com/community/contri...ons,3483/page,3 I tried to modify my product info page but strange things happened on my site. How do I modify the page? Here is my product.info page: <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <title><?php echo $header_tags[products_name]; ?></title> <meta name="description" content="<?php echo $header_tags[desc_tag]; ?>"> <meta name="keywords" content="<?php echo $header_tags[keywords_tag]; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> //Start Fancy Product Info <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s><br> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td class="pageHeading" align="left" width="60%">' . $product_info['products_name'] . '</td><td align="center" class="main">Model: ' . $product_info['products_model'] . '</td></tr></table>'; } else { $products_name = '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td class="pageHeading" align="left">' . $product_info['products_name'] . '</td></tr></table>'; } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <td> <table class="productinfoBox1" width="100%" align="center" cellspacing="0" cellpadding="2" border="0" bordercolor="#000000" style="border-collapse: collapse; " bordercolorlight="#AABBDD" bordercolordark="#000080"> <tr> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td><?php echo $products_name; ?></td> </tr> </table> <p> <table width="100%" cellspacing="0" cellpadding="2" border="0" style="border-collapse: collapse" bordercolor="#111111"> <tr> <td class="main" width="60%" align="center"> <table cellspacing="0" cellpadding="2" border="0" style="border-collapse: collapse" bordercolor="#111111"> <tr> <td align="center" class="smallText"> <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($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> <?php if (tep_not_null($product_info['products_image'])) { ?> </td> </tr> </table> <p> <td class="Price" align="center" valign="middle"><p><?php echo $products_price; ?><p> <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?><p> <?php // echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?> <?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table> </td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table> <?php } ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <?php } ?> </table> <?php } ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="200" valign="top"><table border="0" width="200" cellspacing="0" cellpadding="9"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Quote Link to comment Share on other sites More sharing options...
johnhorton79 Posted July 17, 2008 Share Posted July 17, 2008 (edited) i have tried to install this but i just cannot get it to work see image below could someone help me please help would be greatly apricaited here is my productinfo.php <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ E-Commerce Solutions Copyright © 2005 www.flash-template-design.com Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="style.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> <script type="text/javascript" src="lightbox/prototype.js"></script> <script type="text/javascript" src="lightbox/scriptaculous.js?load=effects"></script> <link rel="stylesheet" href="lightbox/lightbox.css" type="text/css" media="screen"> <script type="text/javascript" src="lightbox/builder.js"></script> <script type="text/javascript" src="lightbox/lightbox.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <tr> <td width="160" align="right" valign="top"> <table width="158" cellpadding="0" cellspacing="0" border="0"> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> </table> </td> <td width="549" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="549"> <tr> <td width="100%" height="100%" valign="top" > <table border="0" width="100%" cellpadding="0" cellspacing="0" > <tr> <td width="100%" class="green" height="25" valign="top" style=" background:#235704 url(images/green_bg.gif) repeat-x bottom; padding-top:3px;" align="right"> <table border="0" cellpadding="0" cellspacing="0"><?php if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { include(DIR_WS_BOXES . 'currencies.php'); }?></table></td> </tr> <!--<tr> <td height="20"><div style='height:20px; padding-right:10px;color:#E80377; font-weight:bold; font-size:14px; text-align:left;'> Product Information</div></td> </tr>--> <tr> <td width="100%" valign="top" align="left" style="padding-left:1px; " > <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?> <table border="0" width="100%" cellspacing="0" cellpadding="0" > <tr> <td> <table border="0" cellpadding="0" cellspacing="2" width="100%" > <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" > <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" valign="top"><?php echo $products_name; ?></td> <td class="price" align="right" valign="top"><?php echo $products_price; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?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(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" 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" 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>'; ?>'); </noscript> </td> </tr> </table> <?php } ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <?php } ?> </table> <?php } ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" > <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> </table></form></td></tr> </table></td> <!-- body_text_eof //--> </tr> </table> </td> </tr> </table> </td> </tr> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Edited July 17, 2008 by johnhorton79 Quote Link to comment Share on other sites More sharing options...
BaselineAce Posted September 26, 2008 Share Posted September 26, 2008 Anyone know how to enable automatic resizing of Lightbox images? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 1, 2008 Share Posted October 1, 2008 Contribution available at ; http://addons.oscommerce.com/info/5532 Lightbox is a javascript to display images in a very pro looking popup box, rather than the bog standard OSC popup. It will also centre the image on the screen. For a demo of this script in action, goto www.tractormad.co.uk select a product, and click to enlarge it's image. You will have seen the effect on hundreds of sites, but not many OSC sites are utilising this. Please note that if the script fails, or the user cliks too quickly (very unlikely), the normal style popup window will be used...so its risk free. Installation should take no more than 10 minutes, and involves only one file edit. Hi Mr Tractor, I asked for a review on my site and someone suggested it could do with your excellent contribution. Previously I had the BigSize Image contribution installed http://addons.oscommerce.com/info/1966 which I found was a very simple hack to allow a completely different and larger image in the pop up window, without having to install loads more files and ficky foodle around with lots of code. I managed to install your contribution easily and very much like the light box style, however in doing so, I lost my nice big images, as the BigSize Image mod makes changes to the popup_image.php and the lightbox seems to bypass that file all together. Is there an easy way to have the best of both worlds? (ie: Nice large image, different from small image, displayed in beautiful pop up light box) or do I need to find a better larger image contribution? What do you think? Thanks for your help Gerry Quote Link to comment Share on other sites More sharing options...
bowen Posted October 12, 2008 Share Posted October 12, 2008 hi ALL, a fantastic contrib, but if i could only get it to work..... I have a custom template and have ammended the product_info.php file as described, i have also change DIR_WS_IMAGES for displaying the images to DIR_WS_PRODUCTS as i have my products images in a different folder when i click on an image in firefox it does nothing and in IE7 it shows a 'page error' on thebottom of the task bar. please help as i cannot figure this one out...... my product_info.php file is as follows:: <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> <!-- MODIFIED FOR LIGHTBOX --> <script type="text/javascript" src="http://www.homebuyelectrics.co.uk/lightbox/prototype.js"></script> <script type="text/javascript" src="http://www.homebuyelectrics.co.uk/lightbox/scriptaculous.js?load=effects"></script> <link rel="stylesheet" href="http://www.homebuyelectrics.co.uk/lightbox/lightbox.css" type="text/css" media="screen"> <script type="text/javascript" src="http://www.homebuyelectrics.co.uk/lightbox/lightbox.js"></script> <!-- END MODIFIED FOR LIGHTBOX --> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?> <table cellspacing=0 cellpadding=0> <tr><td width=473 class=br> <table cellspacing=0 cellpadding=0> <tr><td colspan=3 align=center><img src=images/m33.gif width=471 height=33></td></tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s class=ch1 style="color:#777777; font-size:12px">' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class=ch1 >' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr><td height=18 colspan=3></td></tr> <tr><td class=bg colspan=3> <table cellspacing=0 cellpadding=0> <tr><td width=235 valign=middle align=center> <!-- display image --> <?php if (tep_not_null($product_info['products_image'])) { ?> <table cellspacing="0" cellpadding="2" align="center"> <tr> <td align="center" class="smallText"> <? /* <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_PRODUCTS . $product_info['products_image'], addslashes($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_PRODUCTS . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_PRODUCTS . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; */ ?> <!-- MODIFIED FOR LIGHTBOX --> <script language="javascript"><!-- document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_PRODUCTS . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.addslashes($product_info['products_name']).'" >' . tep_image(DIR_WS_PRODUCTS . $product_info['products_image'], addslashes($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_PRODUCTS . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.addslashes($product_info['products_name']).'" >' . tep_image(DIR_WS_PRODUCTS . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); </noscript> <!--END MODIFIED FOR LIGHTBOX --> </td> </tr> </table> <?php } ?> <!--end display image --> </td> <td width=1></td> <td width=235 valign=top> <table cellspacing=0 cellpadding=0 width=207 align=center> <tr><td height=10></td></tr> <tr><td><b><?=$products_name?></b></td></tr> <tr><td height=8></td></tr> <tr><td class=ml1><b>Item # :</b> <?= $products_id; ?></td></tr> <tr><td height=4></td></tr> <tr><td class=ml1> <? if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); else echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?> </td></tr> <tr><td height=10></td></tr> <tr><td>Price:</td></tr> <tr><td height=3></td></tr> <tr><td class=ps3><?php echo $products_price; ?></td></tr> <tr><td height=19></td></tr> <tr><td><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_BUY_NOW); ?> </td></tr> <tr><td height=11></td></tr> </table> </td></tr> </table> </td></tr> <tr><td align=center colspan=3><img src=images/m24.gif width=447 height=1></td></tr> <tr><td height=20 colspan=3></td></tr> <tr><td width=13></td> <td width=445> <table cellspacing=0 cellpadding=0> <tr><td class=ml1><b>Product description</b></td></tr> <tr><td height=10></td></tr> <tr><td><?php echo stripslashes($product_info['products_description']); ?></td></tr> <tr><td height=10></td></tr> </table> </td> <td width=13></td></tr> </table> </td></tr> </table> <!----------------------- Not editable part --------------------------------> <tr><td> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <?php } ?> </table> <?php } ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <!-- <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> --> <tr> <td> <?php /* if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } */ } ?> </td></tr> </table> </form></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Quote Link to comment Share on other sites More sharing options...
Dennisra Posted October 13, 2008 Share Posted October 13, 2008 Is there a way to disable the "right click" and "view image" or "copy image" in the large popup widow? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 17, 2008 Share Posted October 17, 2008 Hey all im lost dont do java script in any way so i have no idea what to do. i need to set a max image hight and width to the pop up when it resizes the image can this be done? here is myh code. // Configuration // var fileLoadingImage = "images/loading.gif"; var fileBottomNavCloseImage = "images/closelabel.gif"; var overlayOpacity = 0.8; // controls transparency of shadow overlay var animate = true; // toggles resizing animations var resizeSpeed = 7; // controls the speed of the image resizing animations (1=slowest and 10=fastest) var borderSize = 10; //if you adjust the padding in the CSS, you will need to update this variable // ----------------------------------------------------------------------------------- // // Global Variables // var imageArray = new Array; var activeImage; if(animate == true){ overlayDuration = 0.2; // shadow fade in/out duration if(resizeSpeed > 10){ resizeSpeed = 10;} if(resizeSpeed < 1){ resizeSpeed = 1;} resizeDuration = (11 - resizeSpeed) * 0.15; } else { overlayDuration = 0; resizeDuration = 0; } // ----------------------------------------------------------------------------------- // // Additional methods for Element added by SU, Couloir // - further additions by Lokesh Dhakar (huddletogether.com) // Object.extend(Element, { getWidth: function(element) { element = $(element); return element.offsetWidth; }, setWidth: function(element,w) { element = $(element); element.style.width = w +"px"; }, setHeight: function(element,h) { element = $(element); element.style.height = h +"px"; }, setTop: function(element,t) { element = $(element); element.style.top = t +"px"; }, setLeft: function(element,l) { element = $(element); element.style.left = l +"px"; }, setSrc: function(element,src) { element = $(element); element.src = src; }, setHref: function(element,href) { element = $(element); element.href = href; }, setInnerHTML: function(element,content) { element = $(element); element.innerHTML = content; } }); // ----------------------------------------------------------------------------------- // // Extending built-in Array object // - array.removeDuplicates() // - array.empty() // Array.prototype.removeDuplicates = function () { for(i = 0; i < this.length; i++){ for(j = this.length-1; j>i; j--){ if(this[i][0] == this[j][0]){ this.splice(j,1); } } } } // ----------------------------------------------------------------------------------- Array.prototype.empty = function () { for(i = 0; i <= this.length; i++){ this.shift(); } } // ----------------------------------------------------------------------------------- // // Lightbox Class Declaration // - initialize() // - start() // - changeImage() // - resizeImageContainer() // - showImage() // - updateDetails() // - updateNav() // - enableKeyboardNav() // - disableKeyboardNav() // - keyboardNavAction() // - preloadNeighborImages() // - end() // // Structuring of code inspired by Scott Upton (http://www.uptonic.com/) // var Lightbox = Class.create(); Lightbox.prototype = { // initialize() // Constructor runs on completion of the DOM loading. Calls updateImageList and then // the function inserts html at the bottom of the page which is used to display the shadow // overlay and the image container. // initialize: function() { this.updateImageList(); // Code inserts html at the bottom of the page that looks similar to this: // // <div id="overlay"></div> // <div id="lightbox"> // <div id="outerImageContainer"> // <div id="imageContainer"> // <img id="lightboxImage"> // <div style="" id="hoverNav"> // <a href="#" id="prevLink"></a> // <a href="#" id="nextLink"></a> // </div> // <div id="loading"> // <a href="#" id="loadingLink"> // <img src="images/loading.gif"> // </a> // </div> // </div> // </div> // <div id="imageDataContainer"> // <div id="imageData"> // <div id="imageDetails"> // <span id="caption"></span> // <span id="numberDisplay"></span> // </div> // <div id="bottomNav"> // <a href="#" id="bottomNavClose"> // <img src="images/close.gif"> // </a> // </div> // </div> // </div> // </div> var objBody = document.getElementsByTagName("body").item(0); var objOverlay = document.createElement("div"); objOverlay.setAttribute('id','overlay'); objOverlay.style.display = 'none'; objOverlay.onclick = function() { myLightbox.end(); } objBody.appendChild(objOverlay); var objLightbox = document.createElement("div"); objLightbox.setAttribute('id','lightbox'); objLightbox.style.display = 'none'; objLightbox.onclick = function(e) { // close Lightbox is user clicks shadow overlay if (!e) var e = window.event; var clickObj = Event.element(e).id; if ( clickObj == 'lightbox') { myLightbox.end(); } }; objBody.appendChild(objLightbox); var objOuterImageContainer = document.createElement("div"); objOuterImageContainer.setAttribute('id','outerImageContainer'); objLightbox.appendChild(objOuterImageContainer); // When Lightbox starts it will resize itself from 250 by 250 to the current image dimension. // If animations are turned off, it will be hidden as to prevent a flicker of a // white 250 by 250 box. if(animate){ Element.setWidth('outerImageContainer', 250); Element.setHeight('outerImageContainer', 250); } else { Element.setWidth('outerImageContainer', 1); Element.setHeight('outerImageContainer', 1); } var objImageContainer = document.createElement("div"); objImageContainer.setAttribute('id','imageContainer'); objOuterImageContainer.appendChild(objImageContainer); var objLightboxImage = document.createElement("img"); objLightboxImage.setAttribute('id','lightboxImage'); objImageContainer.appendChild(objLightboxImage); var objHoverNav = document.createElement("div"); objHoverNav.setAttribute('id','hoverNav'); objImageContainer.appendChild(objHoverNav); var objPrevLink = document.createElement("a"); objPrevLink.setAttribute('id','prevLink'); objPrevLink.setAttribute('href','#'); objHoverNav.appendChild(objPrevLink); var objNextLink = document.createElement("a"); objNextLink.setAttribute('id','nextLink'); objNextLink.setAttribute('href','#'); objHoverNav.appendChild(objNextLink); var objLoading = document.createElement("div"); objLoading.setAttribute('id','loading'); objImageContainer.appendChild(objLoading); var objLoadingLink = document.createElement("a"); objLoadingLink.setAttribute('id','loadingLink'); objLoadingLink.setAttribute('href','#'); objLoadingLink.onclick = function() { myLightbox.end(); return false; } objLoading.appendChild(objLoadingLink); var objLoadingImage = document.createElement("img"); objLoadingImage.setAttribute('src', fileLoadingImage); objLoadingLink.appendChild(objLoadingImage); var objImageDataContainer = document.createElement("div"); objImageDataContainer.setAttribute('id','imageDataContainer'); objLightbox.appendChild(objImageDataContainer); var objImageData = document.createElement("div"); objImageData.setAttribute('id','imageData'); objImageDataContainer.appendChild(objImageData); var objImageDetails = document.createElement("div"); objImageDetails.setAttribute('id','imageDetails'); objImageData.appendChild(objImageDetails); var objCaption = document.createElement("span"); objCaption.setAttribute('id','caption'); objImageDetails.appendChild(objCaption); var objNumberDisplay = document.createElement("span"); objNumberDisplay.setAttribute('id','numberDisplay'); objImageDetails.appendChild(objNumberDisplay); var objBottomNav = document.createElement("div"); objBottomNav.setAttribute('id','bottomNav'); objImageData.appendChild(objBottomNav); var objBottomNavCloseLink = document.createElement("a"); objBottomNavCloseLink.setAttribute('id','bottomNavClose'); objBottomNavCloseLink.setAttribute('href','#'); objBottomNavCloseLink.onclick = function() { myLightbox.end(); return false; } objBottomNav.appendChild(objBottomNavCloseLink); var objBottomNavCloseImage = document.createElement("img"); objBottomNavCloseImage.setAttribute('src', fileBottomNavCloseImage); objBottomNavCloseLink.appendChild(objBottomNavCloseImage); }, // // updateImageList() // Loops through anchor tags looking for 'lightbox' references and applies onclick // events to appropriate links. You can rerun after dynamically adding images w/ajax. // updateImageList: function() { if (!document.getElementsByTagName){ return; } var anchors = document.getElementsByTagName('a'); var areas = document.getElementsByTagName('area'); // loop through all anchor tags for (var i=0; i<anchors.length; i++){ var anchor = anchors[i]; var relAttribute = String(anchor.getAttribute('rel')); // use the string.match() method to catch 'lightbox' references in the rel attribute if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){ anchor.onclick = function () {myLightbox.start(this); return false;} } } // loop through all area tags // todo: combine anchor & area tag loops for (var i=0; i< areas.length; i++){ var area = areas[i]; var relAttribute = String(area.getAttribute('rel')); // use the string.match() method to catch 'lightbox' references in the rel attribute if (area.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){ area.onclick = function () {myLightbox.start(this); return false;} } } }, // // start() // Display overlay and lightbox. If image is part of a set, add siblings to imageArray. // start: function(imageLink) { hideSelectBoxes(); hideFlash(); // stretch overlay to fill page and fade in var arrayPageSize = getPageSize(); Element.setWidth('overlay', arrayPageSize[0]); Element.setHeight('overlay', arrayPageSize[1]); new Effect.Appear('overlay', { duration: overlayDuration, from: 0.0, to: overlayOpacity }); imageArray = []; imageNum = 0; if (!document.getElementsByTagName){ return; } var anchors = document.getElementsByTagName( imageLink.tagName); // if image is NOT part of a set.. if((imageLink.getAttribute('rel') == 'lightbox')){ // add single image to imageArray imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title'))); } else { // if image is part of a set.. // loop through anchors, find other images in set, and add them to imageArray for (var i=0; i<anchors.length; i++){ var anchor = anchors[i]; if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))){ imageArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title'))); } } imageArray.removeDuplicates(); while(imageArray[imageNum][0] != imageLink.getAttribute('href')) { imageNum++;} } // calculate top and left offset for the lightbox var arrayPageScroll = getPageScroll(); var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 10); var lightboxLeft = arrayPageScroll[0]; Element.setTop('lightbox', lightboxTop); Element.setLeft('lightbox', lightboxLeft); Element.show('lightbox'); this.changeImage(imageNum); }, // // changeImage() // Hide most elements and preload image in preparation for resizing image container. // changeImage: function(imageNum) { activeImage = imageNum; // update global var // hide elements during transition if(animate){ Element.show('loading');} Element.hide('lightboxImage'); Element.hide('hoverNav'); Element.hide('prevLink'); Element.hide('nextLink'); Element.hide('imageDataContainer'); Element.hide('numberDisplay'); imgPreloader = new Image(); // once image is preloaded, resize image container imgPreloader.onload=function(){ Element.setSrc('lightboxImage', imageArray[activeImage][0]); myLightbox.resizeImageContainer(imgPreloader.width, imgPreloader.height); imgPreloader.onload=function(){}; // clear onLoad, IE behaves irratically with animated gifs otherwise } imgPreloader.src = imageArray[activeImage][0]; }, // // resizeImageContainer() // resizeImageContainer: function( imgWidth, imgHeight) { // get curren width and height this.widthCurrent = Element.getWidth('outerImageContainer'); this.heightCurrent = Element.getHeight('outerImageContainer'); // get new width and height var widthNew = (imgWidth + (borderSize * 2)); var heightNew = (imgHeight + (borderSize * 2)); // scalars based on change from old to new this.xScale = ( widthNew / this.widthCurrent) * 100; this.yScale = ( heightNew / this.heightCurrent) * 100; // calculate size difference between new and old image, and resize if necessary wDiff = this.widthCurrent - widthNew; hDiff = this.heightCurrent - heightNew; if(!( hDiff == 0)){ new Effect.Scale('outerImageContainer', this.yScale, {scaleX: false, duration: resizeDuration, queue: 'front'}); } if(!( wDiff == 0)){ new Effect.Scale('outerImageContainer', this.xScale, {scaleY: false, delay: resizeDuration, duration: resizeDuration}); } // if new and old image are same size and no scaling transition is necessary, // do a quick pause to prevent image flicker. if((hDiff == 0) && (wDiff == 0)){ if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } else { pause(100);} } Element.setHeight('prevLink', imgHeight); Element.setHeight('nextLink', imgHeight); Element.setWidth( 'imageDataContainer', widthNew); this.showImage(); }, // // showImage() // Display image and begin preloading neighbors. // showImage: function(){ Element.hide('loading'); new Effect.Appear('lightboxImage', { duration: resizeDuration, queue: 'end', afterFinish: function(){ myLightbox.updateDetails(); } }); this.preloadNeighborImages(); }, // // updateDetails() // Display caption, image number, and bottom nav. // updateDetails: function() { // if caption is not null if(imageArray[activeImage][1]){ Element.show('caption'); Element.setInnerHTML( 'caption', imageArray[activeImage][1]); } // if image is part of set display 'Image x of x' if(imageArray.length > 1){ Element.show('numberDisplay'); Element.setInnerHTML( 'numberDisplay', "Image " + eval(activeImage + 1) + " of " + imageArray.length); } new Effect.Parallel( [ new Effect.SlideDown( 'imageDataContainer', { sync: true, duration: resizeDuration, from: 0.0, to: 1.0 }), new Effect.Appear('imageDataContainer', { sync: true, duration: resizeDuration }) ], { duration: resizeDuration, afterFinish: function() { // update overlay size and update nav var arrayPageSize = getPageSize(); Element.setHeight('overlay', arrayPageSize[1]); myLightbox.updateNav(); } } ); }, // // updateNav() // Display appropriate previous and next hover navigation. // updateNav: function() { Element.show('hoverNav'); // if not first image in set, display prev image button if(activeImage != 0){ Element.show('prevLink'); document.getElementById('prevLink').onclick = function() { myLightbox.changeImage(activeImage - 1); return false; } } // if not last image in set, display next image button if(activeImage != (imageArray.length - 1)){ Element.show('nextLink'); document.getElementById('nextLink').onclick = function() { myLightbox.changeImage(activeImage + 1); return false; } } this.enableKeyboardNav(); }, // // enableKeyboardNav() // enableKeyboardNav: function() { document.onkeydown = this.keyboardAction; }, // // disableKeyboardNav() // disableKeyboardNav: function() { document.onkeydown = ''; }, // // keyboardAction() // keyboardAction: function(e) { if (e == null) { // ie keycode = event.keyCode; escapeKey = 27; } else { // mozilla keycode = e.keyCode; escapeKey = e.DOM_VK_ESCAPE; } key = String.fromCharCode(keycode).toLowerCase(); if((key == 'x') || (key == 'o') || (key == 'c') || (keycode == escapeKey)){ // close lightbox myLightbox.end(); } else if((key == 'p') || (keycode == 37)){ // display previous image if(activeImage != 0){ myLightbox.disableKeyboardNav(); myLightbox.changeImage(activeImage - 1); } } else if((key == 'n') || (keycode == 39)){ // display next image if(activeImage != (imageArray.length - 1)){ myLightbox.disableKeyboardNav(); myLightbox.changeImage(activeImage + 1); } } }, // // preloadNeighborImages() // Preload previous and next images. // preloadNeighborImages: function(){ if((imageArray.length - 1) > activeImage){ preloadNextImage = new Image(); preloadNextImage.src = imageArray[activeImage + 1][0]; } if(activeImage > 0){ preloadPrevImage = new Image(); preloadPrevImage.src = imageArray[activeImage - 1][0]; } }, // // end() // end: function() { this.disableKeyboardNav(); Element.hide('lightbox'); new Effect.Fade('overlay', { duration: overlayDuration}); showSelectBoxes(); showFlash(); } } // ----------------------------------------------------------------------------------- // // getPageScroll() // Returns array with x,y page scroll values. // Core code from - quirksmode.com // function getPageScroll(){ var xScroll, yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } arrayPageScroll = new Array(xScroll,yScroll) return arrayPageScroll; } // ----------------------------------------------------------------------------------- // // getPageSize() // Returns array with page width, height and window width, height // Core code from - quirksmode.com // Edit for Firefox by pHaez // function getPageSize(){ var xScroll, yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } var windowWidth, windowHeight; // console.log(self.innerWidth); // console.log(document.documentElement.clientWidth); if (self.innerHeight) { // all except Explorer if(document.documentElement.clientWidth){ windowWidth = document.documentElement.clientWidth; } else { windowWidth = self.innerWidth; } windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } // for small pages with total height less then height of the viewport if(yScroll < windowHeight){ pageHeight = windowHeight; } else { pageHeight = yScroll; } // console.log("xScroll " + xScroll) // console.log("windowWidth " + windowWidth) // for small pages with total width less then width of the viewport if(xScroll < windowWidth){ pageWidth = xScroll; } else { pageWidth = windowWidth; } // console.log("pageWidth " + pageWidth) arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; } // ----------------------------------------------------------------------------------- // // getKey(key) // Gets keycode. If 'x' is pressed then it hides the lightbox. // function getKey(e){ if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } key = String.fromCharCode(keycode).toLowerCase(); if(key == 'x'){ } } // ----------------------------------------------------------------------------------- // // listenKey() // function listenKey () { document.onkeypress = getKey; } // --------------------------------------------------- function showSelectBoxes(){ var selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { selects[i].style.visibility = "visible"; } } // --------------------------------------------------- function hideSelectBoxes(){ var selects = document.getElementsByTagName("select"); for (i = 0; i != selects.length; i++) { selects[i].style.visibility = "hidden"; } } // --------------------------------------------------- function showFlash(){ var flashObjects = document.getElementsByTagName("object"); for (i = 0; i < flashObjects.length; i++) { flashObjects[i].style.visibility = "visible"; } var flashEmbeds = document.getElementsByTagName("embed"); for (i = 0; i < flashEmbeds.length; i++) { flashEmbeds[i].style.visibility = "visible"; } } // --------------------------------------------------- function hideFlash(){ var flashObjects = document.getElementsByTagName("object"); for (i = 0; i < flashObjects.length; i++) { flashObjects[i].style.visibility = "hidden"; } var flashEmbeds = document.getElementsByTagName("embed"); for (i = 0; i < flashEmbeds.length; i++) { flashEmbeds[i].style.visibility = "hidden"; } } // --------------------------------------------------- // // pause(numberMillis) // Pauses code execution for specified time. Uses busy code, not good. // Help from Ran Bar-On [[email protected]] // function pause(ms){ var date = new Date(); curDate = null; do{var curDate = new Date();} while( curDate - date < ms); } /* function pause(numberMillis) { var curently = new Date().getTime() + sender; while (new Date().getTime(); } */ // --------------------------------------------------- function initLightbox() { myLightbox = new Lightbox(); } Event.observe(window, 'load', initLightbox, false); any ideas would be a great help cos i dont know were to begin. thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.