WU8V Posted April 9, 2009 Posted April 9, 2009 I am attempting to install http://addons.oscommerce.com/info/5532 And with some problems, it does work, but there are some images that refuse to show up at all in the product info page, while some work fine. What I mean is, there is no indication of an image in the product info page when it doesn't work. I have checked the install a number of times, and tried to figure it out by doing the following: I renamed an image that works in another product, and put it in the non-working images place...(named the same as the non working image) and the working image no longer worked with that name in that product description. I tried putting the non-working image in with the working image's name, still no joy. I can put the non working image in a product that the old image works, and the image then works. I cannot find the difference between the non working and the working image in the name, or filesize, or filetype. I cannot find a correlation between the name/filetype or size that makes sense. Is there something that I am missing? I would appreciate any help. Thanks, Kurt Quote
germ Posted April 9, 2009 Posted April 9, 2009 What I mean is, there is no indication of an image in the product info page when it doesn't work. I may be way off base here, but when I've seen that happen elsewhere is when the products description contains an apostrophe ( ' ). It wreaks havoc on the Javascript syntax, so nothing shows up. :blush: Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Guest Posted April 9, 2009 Posted April 9, 2009 I had a problem like that once, the image name had punctuation like " or ' in the name. might be your problem. Quote
WU8V Posted April 9, 2009 Author Posted April 9, 2009 I may be way off base here, but when I've seen that happen elsewhere is when the products description contains an apostrophe ( ' ). It wreaks havoc on the Javascript syntax, so nothing shows up. :blush: Ok, I will look for apostrophe's How can I get around that? some of my products are by Uncle Mike's is there an escape character? The filename has no odd characters I am sure, but the product description may. That is a good bet, I have looked at some of the products that were affected, and it looks like the apostrophe may be the culprit in the product name, I will test this when I can get back to the code. How then can I say men's shorts, or women's shirts? Thanks so much, Regards, Kurt Quote
germ Posted April 9, 2009 Posted April 9, 2009 I haven't seen the lightbox code, but standard osC does it this way: <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'], [color="#FF0000"]addslashes($product_info['products_name'])[/color], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . tep_image_button('small_view.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>'); //--></script> Uses the PHP function addslashes Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
germ Posted April 9, 2009 Posted April 9, 2009 Code from the latest version: ;) <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> Maybe this: <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'], [color="#FF0000"]addslashes($product_info['products_name'])[/color], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> I highlighted a suggested change. ;) You can't just copy/paste the code from this post into your source cuz the forum mucks it up. Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
WU8V Posted April 9, 2009 Author Posted April 9, 2009 Jim, Thanks so much, yes it was the apostrophe I will have to make some changes now, but at least I found the culprit. Would be nice if there was an escape character though. (I already tried the /, it didn't work) I have a plan though, and I guess I will call it good. Thanks again, Kurt Quote
germ Posted April 9, 2009 Posted April 9, 2009 Try the code change I posted. Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Guest Posted April 9, 2009 Posted April 9, 2009 Sorry it was product name I ment to say :blush: Quote
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.
Note: Your post will require moderator approval before it will be visible.