osCmax v2.5 User Manual
Results 1 to 2 of 2

Is it possible to have two sizes for the small image? If so, how?

This is a discussion on Is it possible to have two sizes for the small image? If so, how? within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; I have a mature catalog running on osCMax RC3 that already has over 2,000 product image thumbnails sized manually to ...

      
  1. #1
    Member
    Join Date
    Apr 2007
    Posts
    40
    Rep Power
    0


    Default Is it possible to have two sizes for the small image? If so, how?

    I have a mature catalog running on osCMax RC3 that already has over 2,000 product image thumbnails sized manually to 100x125. I previously removed the MoPics module and added one that lets you input a small image and a large image. Now I have decided I would like to increase the size of the small image to 125x150, but I don't want to redo all the previous images, which are actually 100x125 (not sized dynamically) and will distort if I increase to a size larger than they actually are.

    In the interim, I had a computer crash and lost most of the original pics and my notes on the modifications I've made to my catalog. So I would like to make this change in image size apply only to products added from this point on.

    Is there a way to change the code and database to search for a 100x125 image, and if there isn't one that size, then display 125x150? Or to set it based on the date the product was added. If so, can someone give me an example of the code to do that?

    I don't understand php very well, but I believe the code that calls the small image now is
    Code:
     
    <?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="javascript: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
    }
    ?>
    Also, what would i need to add/change in the database?
    Last edited by aaanativearts; 04-23-2009 at 03:09 PM.

  2. #2
    osCMax Development Team
    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    3,014
    Rep Power
    36


    Lightbulb Re: Is it possible to have two sizes for the small image? If so, how?

    Has taken a wee while to sort out, as part of a bigger project:
    Enhanced Dynamic MoPics and Images stored in directories
    This will allow you to define sizes in the Admin console - not precisely what you're asking for but with similar end results.
    Hosting plans with installation, configuration, contributions, support and maintenance.

Similar Threads

  1. Mutli image sizes
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 09-05-2008, 02:01 PM
  2. Image sizes
    By cygnus in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 04-01-2005, 08:31 PM
  3. Image Sizes- Question
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 05-05-2004, 08:29 PM
  4. Different Image Sizes for Different Products
    By jhixson in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 03-08-2004, 08:17 PM
  5. Having 3 image sizes for a product
    By bradeng in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 03-11-2003, 10:22 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •