Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

My boxes are crazy


spiced

Recommended Posts

After upgrading to new server (old was using apache 1.3 and now I use apache 2.0 - new php - ...) and copied an EXACT backup of my oscommerce site all is working fine, but I have an strange issue.

 

Boxes have no width parameter, so they appears so big at screen.

It seems php don't assign width and height parameters to generated html code.

I've checked generated html at old server and I have it:

...

width="200" height="90.769230769231"></a>

 

But new server generated html has no that parameters:

...

</a>

 

Because oscommerce site is just an EXACT copy of old one, I think I have some problem with apache or php configuration.

 

Maybe someone has any idea about what happens ?.

 

Thank you very much indeed for your help.

 

Spiced

Link to comment
Share on other sites

It seems problem is here:

 

By example, whats_new.php

 

Original line:

 

$info_box_contents[] = array('align' => 'center',

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price);

 

 

I've changed for:

 

$info_box_contents[] = array('align' => 'center',

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], 150, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $whats_new_price);

 

No problem with old server, but with new server direct value "150" instead "SMALL_IMAGE_WIDTH" seems not to work.

 

Why ?

Link to comment
Share on other sites

<?php

$value1="1";

$value2="2";

$info_box_contents = array($value1,$value2,3);

echo $info_box_contents[0];

echo $info_box_contents[1];

echo $info_box_contents[2];

?>

 

To test array I've tryed this source and answer was 123. Right

Link to comment
Share on other sites

Problem is inside html_output.php, function tep_image

 

Now, if field "small image height" is blank, system don't calculates automatically size.

 

"Calculate image size" is true.

 

php or mysql version can affect this ?

Link to comment
Share on other sites

humm, spiced? Hello? Anyone else allowed in on this conversation or is it just you? lol

 

With your 6 posts above, to be perfectly honest I haven't really got a clue what you are asking. Is the problem with your infoboxes not being the right width, or images not being the right width?

 

If images, you are along the right lines - in admin->configure->maximum values, set a maximum small image width. Leave the height blank and it will keep the same proportions. If its the infoboxes, you can set this by editing you includes/application_top file - its on a line define('BOX_WIDTH.............etc. etc.

 

Hope that helps, but if not, take a deep breath, and post back the problem so we can help rather than giggle at the side whilst you get yourself in a tizwoz again!! ;)

Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Link to comment
Share on other sites

jejeje

Thx you

I thought maybe someday it will help other people if I speaked step-by-step what I was doing...

 

Conclusion is:

 

1) My boxes are crazy because images inside it have original size, instead small one

2) My site don't use height parameter, so oscommerce must resize using only width parameter (I use "200")

3) With my old PHP this worked fine, but now, using PHP 4.3.2, PHP internal function 'getimagesize' don't works, so image is not resized

 

getimagesize call is inside html_output.php, function tep_image

 

Spiced

Link to comment
Share on other sites

OK, dead easy to fix then, just add an image width to the end of your image tag. If necessary, also add a height to get the proportions right.

 

i.e. <img scr="yourimage.jpg" width="200>

 

Jobs a good'un ;)

Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...