Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Image Enlarge Won't work


Becki

Recommended Posts

Hi,

 

I uploaded my edited files from an offline store onto my host. Now when I click on enlarge image on product_info page it just doesn't go anywhere and an error on page warning comes up. When I look at that it says 'object expected' line 1 character 1 in ....product_info.php?.....

The product_info pages are identical to the originals as is popup_image.php

 

Any ideas as to why it has stopped working?

 

Thanks

 

Becki

Link to comment
Share on other sites

I uploaded my edited files from an offline store onto my host. Now when I click on enlarge image on product_info page it just doesn't go anywhere and an error on page warning comes up. When I look at that it says 'object expected' line 1 character 1 in ....product_info.php?.....

The product_info pages are identical to the originals as is popup_image.php

 

post the code

Link to comment
Share on other sites

post the loop around the image in the product_info page

post the popup_image file

and a url would be great!

 

david

 

popup_image.php

<?php

/*

$Id: popup_image.php,v 1.18 2003/06/05 23:26:23 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');

 

$navigation->remove_current_page();

 

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

$products = tep_db_fetch_array($products_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 $products['products_name']; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

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

var i=0;

function resize() {

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

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

self.focus();

}

//--></script>

</head>

<body onload="resize();">

<?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?>

</body>

</html>

<?php require('includes/application_bottom.php'); ?>

 

code around image in product_info.php

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

</td>

</tr>

</table>

<?php

}

?>

 

 

URL

 

Many thanks

Link to comment
Share on other sites

popup_image.php

code around image in product_info.php

URL

Many thanks

 

well - to be honest, I can't see how this script is supoped to work, But I do see that you have an errant space in the javascript name :

<a href="java script:pop

should be :

<a href="java script:pop

 

also - are you intentionally escaping all the single quote :

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href

 

david

Link to comment
Share on other sites

well - to be honest, I can't see how this script is supoped to work, But I do see that you have an errant space in the javascript name :

<a href="java script:pop

should be :

<a href="java script:pop

 

also - are you intentionally escaping all the single quote :

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href

 

david

 

I haven't changed product_info at all so that is the original, that space isn't actually there - i don't know how it got in there! i must have done something whilst writing the message.

 

I've just tried turning off using templates within the STS module via admin, anyway that works so I suppose it must be my template?!

 

I see this in 'view source' at the top of the page with template

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html $htmlparams>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Fire Down Below</title>

<meta name="Description" content="Fire Down Below"/>

<meta name="Keywords" content="Fire Down Below"/>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>

<!-- EOF: Generated Meta Tags -->

<base href="http://www.craftmehappy.co.uk/">

 

<!-- start get_javascript(applicationtop2header) //-->

 

<!-- end get_javascript(applicationtop2header) //-->

 

<link rel="stylesheet" type="text/css" href="stylesheet.css">

<style type="text/css">

<!--

.style1 {font-family: Georgia, "Times New Roman", Times, serif}

.style7 {

font-family: Arial, Helvetica, sans-serif;

font-size: xx-small;

}

.style13 {font-size: 10px; color: #FFFFFF; }

.style27 {font-family: Arial, Helvetica, sans-serif}

.style28 {font-size: medium; font-family: Arial, Helvetica, sans-serif; }

.style29 {font-size: medium}

.style30 {font-size: xx-small}

.style34 {color: #000000}

.style38 {font-size: medium; font-family: Arial, Helvetica, sans-serif; color: #000000; }

-->

</style>

 

</head>

I know i need to sort the class out etc

 

and this without (when pop up works)

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

<html dir="LTR" lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>CraftMeHappy.co.uk</title>

<base href="http://www.craftmehappy.co.uk/">

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

Link to comment
Share on other sites

I asked because I saw product_thumbs.php in your source code when looking at your site. Someone else is having this problem, as well, and I notice in your code postings above that "and this without (when pop up works)", you have the function popup in your <head> tags; whereas, when it doesn't work, that function popup javascript is missing.

 

So if what you're describing holds true -- turning off the template brings you joy; turning it on bringd the rain -- let's see what's missing: The function popup.

 

Best I can offer as I don't use Basic Design Pack. Was there a step during the "install" where you needed to manually add this function in your head tags (within a specified php file) and it just got missed by mistake?

 

jon

It's all just ones and zeros....

Link to comment
Share on other sites

I asked because I saw product_thumbs.php in your source code when looking at your site. Someone else is having this problem, as well, and I notice in your code postings above that "and this without (when pop up works)", you have the function popup in your <head> tags; whereas, when it doesn't work, that function popup javascript is missing.

 

So if what you're describing holds true -- turning off the template brings you joy; turning it on bringd the rain -- let's see what's missing: The function popup.

 

Best I can offer as I don't use Basic Design Pack. Was there a step during the "install" where you needed to manually add this function in your head tags (within a specified php file) and it just got missed by mistake?

 

jon

 

I don't think so not in BSP, butby turning STS templates off makes it work it seems like it is STS - when I try a sts_default template that comes with it it still doesn't work. Whats strange is that I'm sure it worked offline!

 

Someone said possibly it's beacuse the javascript file has moved from it's default location. The only thing that has chnaged is that at home my index.php file was :localhost/catalog/index.php whereas now it is domainname/index.php.

 

What I have also noticed is that some images when you look at properties come up with

whereas some come up with

 

Becki

Link to comment
Share on other sites

I'll bite. Post the code to your product_thumbs.php? Have you tried manually adding the correct function popup javascript in this file as a test?

 

jon

 

 

No need to - GOT IT WORKING :), I'm sorry for wasting your time - i found where the applicationtop2header was coming from, anyway includes/header.php had not uploaded correctly when I ftp it

 

All seems to be working now although when the popup box opens it's smaller than the actual image - i can't remember than happening!

 

Any ideas with the image properties in my previous post!

 

Thanks for your help

 

Becki

Link to comment
Share on other sites

Good on you :) You may have provided the answer for the other poster. It's hard to troubleshoot (given my lack of knowledge re: contibutions) because so many of you are using any combination of contribs. And then there's the missing file, Oops!

 

I don't consider anything a time waster as long as I learn something :)

 

Admin >> Configuration >>Images. Set your "Small Image Width" but not your height (leave blank). I've never messed around with "Calculate Image Size" True or False (not a need) so have fun :)

 

jon

It's all just ones and zeros....

Link to comment
Share on other sites

Good on you :) You may have provided the answer for the other poster. It's hard to troubleshoot (given my lack of knowledge re: contibutions) because so many of you are using any combination of contribs. And then there's the missing file, Oops!

 

I don't consider anything a time waster as long as I learn something :)

 

Admin >> Configuration >>Images. Set your "Small Image Width" but not your height (leave blank). I've never messed around with "Calculate Image Size" True or False (not a need) so have fun :)

 

jon

 

 

I changed the values in popup_image to

function resize() {

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

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

self.focus();

 

it was width 30 height50.

 

Window resizes correctly now.

 

I don't know if you knwo anything about this(!) but in firefox the gradient images on the top of the info boxes have something covering them like a white mask! When you scroll up and down the page some gradient bars show clearly then others. It's like there is white bands across the page that only show up on top of the gradient bars?!

 

Thanks

Becki

Link to comment
Share on other sites

Okay, tested. Anywhere you have this (I'm using CategoriesBoxHeading as one example):

 

TD.CategoriesBoxHeading {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

font-weight: bold;

background-image: url(images/boxgradientbar.gif);

background-attachment: fixed;

background-repeat: repeat;

color: #FFFFFF;

}

 

Change to this:

 

TD.CategoriesBoxHeading {

background-image: url('images/boxgradientbar.gif');

background-repeat: repeat;

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

font-weight: bold;

color: #FFFFFF

}

 

jon

It's all just ones and zeros....

Link to comment
Share on other sites

Okay, tested. Anywhere you have this (I'm using CategoriesBoxHeading as one example):

 

TD.CategoriesBoxHeading {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

font-weight: bold;

background-image: url(images/boxgradientbar.gif);

background-attachment: fixed;

background-repeat: repeat;

color: #FFFFFF;

}

 

Change to this:

 

TD.CategoriesBoxHeading {

background-image: url('images/boxgradientbar.gif');

background-repeat: repeat;

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

font-weight: bold;

color: #FFFFFF

}

 

jon

 

Awesome! Thank you very much! Works great! If your bored and want more questions let me know! There's plenty more!

 

Thanks for your help.

 

Becki

Link to comment
Share on other sites

Well, gee, I wonder if highjacking your own thread is within the forum rules LOL!!! Fire away and I'll do my best.

 

jon

 

Don't answer this is you don't want to but for some reason in firefox/konqueror the page aligns to the left hand side, whereas in IE it centres. Plus i noticed in konqueror but not firefox the three images top right align to top of the page whereas in firefox/IE theyare where their supposed to be (centred vertically between the nav bar and top of page)

 

Also, as mentioned before some images have address (right click/properties):

 

typically the newlett packard laser :) !

 

some have

 

They both have the correct name (top of properties box)

lj1100xi.gif&w=100&h=80
for example. I don't think this is an issue - just don't know why it is happening!

 

In firefox all images have the address inclusing the img=images/dvd/etc and size details.

 

Strange.

 

I also thought the site was a bit slow, it's just gone live so have not optimised it or anything! What did you think?

 

Thanks :)

 

Becki

Link to comment
Share on other sites

You have 3 Qs:

 

1. Why are some images called by product_thumbs... and some the normal osc way

2. Layout issues

3. Site loading speed

 

As to #1:

Since you are using a template (design pack) which provided some images (I gather), those images (top 3 on right) are being called from sts_templates/test/images/english/ (note use of code, not quote tags to keep the url whole):

http://www.craftmehappy.co.uk/product_thumb.php?img=includes/sts_templates/test/images/english/header_account.gif&w=30&h=30

Your Hewlett-Packard is also being called through product_thumbs but from the standard /images/ directory:

http://www.craftmehappy.co.uk/product_thumb.php?img=images/hewlett_packard/lj1100xi.gif&w=100&h=80

You could try moving one of the top 3 right-hand *.gifs into your standard images folder and see what happens :) I'm guessing in whatever file you defined where these images come from needs to be edited.

 

As to #2:

In your header.php, you have 2 empty TD cells preceding your images and preceding the text beneath the images:

<td width="150" align="center" valign="middle"> </td>

You can either remove these so your bank of images&text are centered between the right and your banner and, so that the images appear to be dropped down in Konq, you could add a cheap & dirty <br> just before each image:

From this:

<td width="50" align="center" valign="bottom" class="style7"><a href=https://www.craftmehappy.co.uk/account.php?osCsid=c6cd0ccd62b9f64510f05d0d1c900caa class="headerNavigation"><img src="product_thumb.php?img=includes/sts_templates/test/images/english/header_account.gif&w=30&h=30" width="30" height="30" border="0" alt=" my account " title=" my account "></a></td>

to:

<td width="50" align="center" valign="bottom" class="style7"><br><a href=https://www.craftmehappy.co.uk/account.php?osCsid=c6cd0ccd62b9f64510f05d0d1c900caa class="headerNavigation"><img src="product_thumb.php?img=includes/sts_templates/test/images/english/header_account.gif&w=30&h=30" width="30" height="30" border="0" alt=" my account " title=" my account "></a></td>

 

As to #3:

I don't know what version of osc you're using but there is a series of updates outlined in the latest download (update-20060817.txt). Intergrating these into your current setup, including optimising, should surely help.

 

You have a lot going on in terms of what's serving up so as soon as you can, delete the stock products and categories (including images).

 

Best I can offer :)

 

jon

It's all just ones and zeros....

Link to comment
Share on other sites

Hi,

 

Thanks for that, I'll look through it and give it ago. In terms of the problem with konq i thought it was just something such like that Konq didn't understand the valign 'center' or hallign 'bottom' commands?

 

For the product_thumb question I just thought it was strange that images in say the new products box seemed to have a full address with the image directory paths etc whereas some didn't - ever though the images are stored in the same place. maybe it is the auto thumbnailer not being used for those images.

 

Thanks

Becki

Link to comment
Share on other sites

  • 7 months later...

It's been a while since the last post on this thread, but I'm pretty sure that someone out there is going to google this Javascript OBJECT EXPECTED error for OsCommerce, so I figured I'd post. I also had the same issue. I recognized the template because Becki mentioned the applicationleft2right ($) parts. I used the same template. I think it's just something in installation really. I had the template today and reinstalled it. The first time it worked but the second time it had the JavaScript error.

 

Anyway, to make a long story short, thanks for the help. All I did was upload the same includes/header.php file again. Easy!

 

:)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...