Page 68 of 710 FirstFirst ... 1858666768697078118168568 ... LastLast
Results 671 to 680 of 7099
  1. #671
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,241
    Plugin Contributions
    20

    Default Re: Image Handler 2 Support

    Quote Originally Posted by colinr View Post
    I will check through my code when I get a chance and send amendments.
    Much appreciated - thank you.
    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

  2. #672

    Default Re: Image Handler 2 Support

    Hi Ryk,

    Further to my previous post I think I have got to the bottom of this.

    When I first looked at this a couple of weeks back I duplicated the html image wrapper function 'zen_attribute_image' in /includes/functions/html_output.php and renamed the duplicate function 'zen_attribute_image' so that I could easily apply new code to attribute images only.

    Here then is the complete zen_attribute_image function - including the pop-up code modifications I sent last night - which should simply be appended to /includes/functions/html_output.php.

    /*
    * The HTML attribute image wrapper function
    */
    function zen_attribute_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
    global $template_dir;

    // soft clean the alt tag
    $alt = zen_clean_html($alt);

    // use old method on template images
    if (strstr($src, 'includes/templates') or strstr($src, 'includes/languages') or PROPORTIONAL_IMAGES_STATUS == '0') {
    return zen_image_OLD($src, $alt, $width, $height, $parameters);
    }

    //auto replace with defined missing image
    if ($src == DIR_WS_IMAGES and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
    $src = DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE;
    }

    if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
    return false;
    }

    // if not in current template switch to template_default
    if (!file_exists($src)) {
    $src = str_replace(DIR_WS_TEMPLATES . $template_dir, DIR_WS_TEMPLATES . 'template_default', $src);
    }

    // hook for handle_image() function such as Image Handler etc
    if (function_exists('handle_image')) {
    $newimg = handle_image($src, $alt, $width, $height, $parameters);
    list($src, $alt, $width, $height, $parameters) = $newimg;
    }

    // Convert width/height to int for proper validation.
    // intval() used to support compatibility with plugins like image-handler
    $width = empty($width) ? $width : intval($width);
    $height = empty($height) ? $height : intval($height);

    // alt is added to the img tag even if it is null to prevent browsers from outputting
    // the image filename as default

    $image = '<img src="thumb.php?src=' . zen_output_string($src) . '&x=100&y=41&f=0" alt="' . zen_output_string($alt) . '"';

    if (zen_not_null($alt)) {
    $image .= ' title=" ' . zen_output_string($alt) . ' "';
    }

    if (zen_not_null($parameters)) $image .= ' ' . $parameters;

    $image .= ' onclick="popupWindow(\'http://YOUR_DOMAIN/index.php?main_page=popup_image&src='.zen_output_string($src).'\')"';

    $image .= ' />';

    return $image;
    }



    ?>


    You then need to modify /includes/modules/attributes.php (or naturally a copy of this file at /includes/modules/YOUR_TEMPLATES/attributes.php) changing all occurances of...

    zen_image(

    ...to..

    zen_attribute_image(

    ...so that the new zen_attribute_image function is called rather than the generic zen_image function.

    There may, of course, be a more elegant way to do this. Any suggestions are welcome.

    ColinR

  3. #673
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,241
    Plugin Contributions
    20

    Default Re: Image Handler 2 Support

    BRILLIANT!!



    Thank you - that's superb.

    One possibility for improvement that you may be able to rattle off the top of your head, but which would take me hours of trial and error

    Could it be made obvious that the attribute image is now a link? The mouse pointer doesn't change when rolled over.
    Last edited by Ryk; 16 Nov 2006 at 12:24 AM.
    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

  4. #674

    Default Re: Image Handler 2 Support

    Quote Originally Posted by Ryk View Post
    BRILLIANT!!



    Thank you - that's superb.
    Cheers!

    Quote Originally Posted by Ryk View Post
    One possibility for improvement that you may be able to rattle off the top of your head, but which would take me hours of trial and error

    Could it be made obvious that the attribute image is now a link? The mouse pointer doesn't change when rolled over.
    /includes/templates/YOUR_TEMPLATES/css/stylesheet.css

    attribImg { cursor: pointer; cursor: hand; }

    ...or...

    attribImg img { cursor: pointer; cursor: hand; }

    ...ought to do it.

    Alternatively:

    $image = '<a href="javascript: popupWindow(\'http://YOUR_DOMAIN/index.php?main_page=popup_image&src='.zen_output_s tring($src).'\')"><img src="thumb.php?src=' . zen_output_string($src) . '&x=100&y=41&f=0" alt="' . zen_output_string($alt) . '"';

    if (zen_not_null($alt)) {
    $image .= ' title=" ' . zen_output_string($alt) . ' "';
    }

    if (zen_not_null($parameters)) $image .= ' ' . $parameters;

    $image .= ' /></a>';


    ColinR
    Last edited by colinr; 16 Nov 2006 at 12:51 AM.

  5. #675
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,241
    Plugin Contributions
    20

    Default Re: Image Handler 2 Support

    Quote Originally Posted by colinr View Post

    .attribImg img { cursor: pointer; cursor: hand; }
    works for me.

    I think this is worth packing up as a contribution. Do you want to do it, or shall I?

    Incidentally, you can remove "http://YOUR_DOMAIN/" from javascript: popupWindow without any ill-effect - or so it seems!
    Last edited by Ryk; 16 Nov 2006 at 01:17 AM.
    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

  6. #676
    Join Date
    Jul 2005
    Posts
    36
    Plugin Contributions
    0

    Default Re: Image Handler 2 Support

    Because I had some problems with the zoom in, I tried to reinstall Image Handler, but now I get this error on my front-page:

    Fatal error: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png: fatal libpng error: zlib error in /opt/lampp/htdocs/zencartnieuw/includes/classes/bmz_image_handler.class.php on line 646

    It's under the welcome message, the rest of the front page is normal.
    Does anybody have a clue what this could be?

  7. #677
    Join Date
    Jul 2005
    Posts
    36
    Plugin Contributions
    0

    Default Re: Image Handler 2 Support

    Oh yeah, I'm using the newest version of xampp (for a while now). I had Image Handler working the first time on the same test-server.

  8. #678

    Default Re: Image Handler 2 Support

    Hi Ryk,

    Quote Originally Posted by Ryk View Post
    works for me.

    I think this is worth packing up as a contribution. Do you want to do it, or shall I?
    If you're happy to lend a hand turning this into a downloadable contribution that would be great as I'm a bit short of time at the moment.

    I've sent a message to the developer of the thumb.php script to see if I can include it in the package and will let you know. If not then a link in the installation instructions would do it - but naturally this could break at some point.

    As this stuff is actually independent of IH2 we could extend it's use to improve the presentation of ALL images from an otherwise default ZenCart install.

    It may also be possible to modify the core zen_image function(s) rather than creating a new zen_attribute_image function - but we'll need to look into this.

    Quote Originally Posted by Ryk View Post
    Incidentally, you can remove "http://YOUR_DOMAIN/" from javascript: popupWindow without any ill-effect - or so it seems!
    Ok. I'm not sure if this would work for all browsers so to play it safe we can replace http://YOUR_DOMAIN/ with the base href variable. Should be easy enough.

    ColinR

  9. #679
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,241
    Plugin Contributions
    20

    Default Re: Image Handler 2 Support

    Check your PMs.

    Re the domain ... only checked on FF & IE, but vaild point.
    Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
    20 years with Zencart !

  10. #680
    Join Date
    Apr 2006
    Posts
    72
    Plugin Contributions
    0

    Default Image Handler 2 Support - Is this Behavior Correct?

    Okay, it seems to work well except:

    When rollover/popups are enabled, all my original 2nd, 3rd etc images are gone on the product page. No big deal, I didn't need this feature anyway.

    HOWEVER:

    When uploading an image for a product, I MUST select a "base name" (which says "optional") for it to upload all three sizes (otherwise they're all the same LARGE size). Subsequent uploads for the same product - additional images - do not require that I add the base name.

    Is this how it's supposed to work? The "optional" tag makes me thing this is off just a bit.

    Chris

 

 

Similar Threads

  1. v150 Image Handler 4 (for v1.5.x) Support Thread
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 1687
    Last Post: 17 Nov 2024, 07:26 PM
  2. 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
  3. Image Handler Support Please
    By nadinesky in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 30 Sep 2013, 03:47 PM
  4. Image handler only covers part of screen
    By shaneburton in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 14 May 2009, 07:15 PM
  5. Is Image Handler the only way to go?
    By wwwursa in forum Installing on a Windows Server
    Replies: 2
    Last Post: 23 Dec 2007, 09:22 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