Results 1 to 10 of 614

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,633
    Plugin Contributions
    88

    Default Re: Image Handler 5 (for v1.5.5) Support Thread

    @Goshawk, did you merge/update your store's template directory to make the IH-required changes to /includes/modules/YOUR_TEMPLATE/main_product_image.php?

  2. #2
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: Image Handler 5 (for v1.5.5) Support Thread

    Yes I have,

    Here is the code
    Code:
    <?php
    /**
     * main_product_image module
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: main_product_image.php 4663 2006-10-02 04:08:32Z drbyte $
     */
    if (!defined('IS_ADMIN_FLAG')) {
        die('Illegal Access');
    }
    
    // -----
    // This notifier lets an observer know that the module has begun its processing.
    //
    $GLOBALS['zco_notifier']->notify('NOTIFY_MODULES_MAIN_PRODUCT_IMAGE_START');
    
    $products_image_extension = substr($products_image, strrpos($products_image, '.'));
    $products_image_base = str_replace($products_image_extension, '', $products_image);
    $products_image_medium = $products_image_base . IMAGE_SUFFIX_MEDIUM . $products_image_extension;
    $products_image_large = $products_image_base . IMAGE_SUFFIX_LARGE . $products_image_extension;
    
    // -----
    // This notifier lets an image-handling observer know that it's time to determine the image information,
    // providing the following parameters:
    //
    // $p1 ... (r/o) ... A copy of the $products_image value
    // $p2 ... (r/w) ... A boolean value, set by the observer to true if the image has been handled.
    // $p3 ... (r/w) ... A reference to the $products_image_extension value
    // $p4 ... (r/w) ... A reference to the $products_image_base value
    // $p5 ... (r/w) ... A reference to the medium product-image-name
    // $p6 ... (r/w) ... A reference to the large product-image-name.
    //
    // If the observer has set the $product_image_handled flag to true, it's indicated that any of the
    // other values have been updated for separate handling.
    //
    $main_image_handled = false;
    $GLOBALS['zco_notifier']->notify(
        'NOTIFY_MODULES_MAIN_PRODUCT_IMAGE_FILENAME',
        $products_image,
        $main_image_handled,
        $products_image_extension,
        $products_image_base,
        $products_image_medium,
        $products_image_large
    );
    
    if ($main_image_handled !== true) {
        // check for a medium image else use small
        if (!file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) {
            $products_image_medium = DIR_WS_IMAGES . $products_image;
        } else {
            $products_image_medium = DIR_WS_IMAGES . 'medium/' . $products_image_medium;
        }
        // check for a large image else use medium else use small
        if (!file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) {
            if (!file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) {
                $products_image_large = DIR_WS_IMAGES . $products_image;
            } else {
                $products_image_large = DIR_WS_IMAGES . 'medium/' . $products_image_medium;
            }
        } else {
            $products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_large;
        }
    
        /*
        echo
        'Base ' . $products_image_base . ' - ' . $products_image_extension . '<br>' .
        'Medium ' . $products_image_medium . '<br><br>' .
        'Large ' . $products_image_large . '<br><br>';
        */
        // to be built into a single variable string
    }
    
    $GLOBALS['zco_notifier']->notify('NOTIFY_MODULES_MAIN_PRODUCT_IMAGE_END');
    Time is but an illusion, there is only "now"!

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,633
    Plugin Contributions
    88

    Default Re: Image Handler 5 (for v1.5.5) Support Thread

    @Goshawk, a link to the site displaying this behavior will help me help you.

  4. #4
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: Image Handler 5 (for v1.5.5) Support Thread

    Thanks, but I cannot give you a link, as the site is currently only running on my pc in xampp.
    I will check all the files related to the image displays as well as the products, hopefully I will find the problem.

    Thanks for your response, I love IH and have used it in most websites I have built since 2006.

    This site is also using twitch wholesale module, it is perhaps related to this plug-in, and I may have overwritten a file without realising.

    Goshawk.
    Time is but an illusion, there is only "now"!

  5. #5
    Join Date
    Aug 2006
    Location
    Kihikihi, New Zealand
    Posts
    230
    Plugin Contributions
    3

    Default Re: Image Handler 5 (for v1.5.5) Support Thread

    I found the problem:

    Believe it or not, it was related to includes/configure.php

    I manually set the parameters inside the config file and here is the wrong code:

    Code:
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    When I removed the forward slashes the problem disappeared. I noticed that the url was localhost/shop//page......

    Just thought I post my error here just in case someone else has the same problem.

    Goshawk
    Time is but an illusion, there is only "now"!

  6. #6
    Join Date
    Jul 2012
    Posts
    16,751
    Plugin Contributions
    17

    Default Re: Image Handler 5 (for v1.5.5) Support Thread

    Quote Originally Posted by Goshawk View Post
    I found the problem:

    Believe it or not, it was related to includes/configure.php

    I manually set the parameters inside the config file and here is the wrong code:

    Code:
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    When I removed the forward slashes the problem disappeared. I noticed that the url was localhost/shop//page......

    Just thought I post my error here just in case someone else has the same problem.

    Goshawk
    Actually it would be the extra slash you have at the end of HTTP_SERVER and/or HTTPS_SERVER.

    DIR_WS_CATALOG should always end with a slash which means that if it exists on its own, that it is a slash. Also possible that DIR_WS_IMAGES begins with an extra slash, but less likely for it to be there.

    The idea is that a URI that perhaps did not need to be https:// would be generated by:
    HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . 'filename.jpg'
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,753
    Plugin Contributions
    0

    Default Re: Image Handler 5 (for v1.5.5) Support Thread

    oh you are so very close there McNumbers.
    I suspect that their configure.php had
    Code:
    /**
     * Enter the domain for your store
     * HTTP_SERVER is your Main webserver: eg-http://www.yourdomain.com
     * HTTPS_SERVER is your Secure/SSL webserver: eg-https://www.yourdomain.com
     */
    define('HTTP_SERVER', 'http://localhost/shop/');
    define('HTTPS_SERVER', 'https://localhost/shop/');
    and
    Code:
    /**
     * These DIR_WS_xxxx values refer to the name of any subdirectory in which your store is located.
     * These values get added to the HTTP_CATALOG_SERVER and HTTPS_CATALOG_SERVER values to form the complete URLs to your storefront.
     * They should always start and end with a slash ... ie: '/' or '/foldername/'
     */
    define('DIR_WS_CATALOG', '/');
    define('DIR_WS_HTTPS_CATALOG', '/');
    When it should be
    Code:
    /**
     * Enter the domain for your store
     * HTTP_SERVER is your Main webserver: eg-http://www.yourdomain.com
     * HTTPS_SERVER is your Secure/SSL webserver: eg-https://www.yourdomain.com
     */
    define('HTTP_SERVER', 'http://localhost');
    define('HTTPS_SERVER', 'https://localhost');
    and
    Code:
    /**
     * These DIR_WS_xxxx values refer to the name of any subdirectory in which your store is located.
     * These values get added to the HTTP_CATALOG_SERVER and HTTPS_CATALOG_SERVER values to form the complete URLs to your storefront.
     * They should always start and end with a slash ... ie: '/' or '/foldername/'
     */
    define('DIR_WS_CATALOG', '/shop/');
    define('DIR_WS_HTTPS_CATALOG', '/shop/');
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

 

 

Similar Threads

  1. v150 Image Handler 4 (for v1.5.x) Support Thread
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 1684
    Last Post: 2 Oct 2022, 06:55 AM
  2. Attribute image replaces main product image on select [Support Thread]
    By exoticcorpse in forum All Other Contributions/Addons
    Replies: 158
    Last Post: 24 Aug 2020, 05:07 PM
  3. v139h Image Handler 3 Support Thread (for ZC v1.3.9)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 1095
    Last Post: 2 Oct 2017, 12:42 PM
  4. v138a Image Handler 2 (for ZC v1.3.8 ONLY) Support
    By timkroeger in forum All Other Contributions/Addons
    Replies: 7098
    Last Post: 12 Oct 2014, 03:48 AM
  5. Image Handler Support Please
    By nadinesky in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 30 Sep 2013, 03:47 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR