Image thumbnail not showing because of old code
Posted: Sun Jan 06, 2013 8:43 pm
I am new here and I was hoping to get some advice for fixing a little PHP issue I am having. I know almost no PHP, but I am good at tinkering, so with a push in the right direction I can usually get thing to work.
I had a little piece of code written for my old OsCommerce 2.2 MS-2 ecommerce web site that allowed the user to select features that they wanted in a product from a list, then it would return links and thumbnails for the applicable products. The links to the features and images etc. are stored in a text file.
Now that I am moving my site over to the latest version (2.3.3), my model selection tool brings up the links, but the image thumbnails no longer show up. I have tracked it down to the PHP page that interrogates the text file and returns the results. The offending part of the code is the following:
If I completely remove the first part under "// get resized dimension of photo", then the image shows, but it is huge, not a thumbnail. Can anyone please advise me how I can modify the code to get it to display the image as a 107 pixel wide by 144 pixel high thumbnail? My apologies in advance if this is the wrong forum to ask this question, or if I have left out any relevant info.
Thanks
Kevin
I had a little piece of code written for my old OsCommerce 2.2 MS-2 ecommerce web site that allowed the user to select features that they wanted in a product from a list, then it would return links and thumbnails for the applicable products. The links to the features and images etc. are stored in a text file.
Now that I am moving my site over to the latest version (2.3.3), my model selection tool brings up the links, but the image thumbnails no longer show up. I have tracked it down to the PHP page that interrogates the text file and returns the results. The offending part of the code is the following:
Code: Select all
// get resized dimension of photo
$arr_dimension = mbr_get_resized_dimension($arr_prod[$k]['image'], $config['thumbnail_max_width']);
// display thumbnail
echo ' <div style="float:left; margin:15px; text-align:center; font-size:12px;">
<a href="'.$arr_prod[$k]['page'].'" onclick="this.target=\'_blank\'">
<img src="'.$arr_prod[$k]['image'].'" width="'.$arr_dimension['width'].'" height="'.$arr_dimension['height'].'" alt="" border="0" />
<br />'.$arr_prod[$k]['model_number'].' Thanks
Kevin