Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Aug 2005
    Location
    New York!!!
    Posts
    164
    Plugin Contributions
    0

    Default Needing help changing Image Handler for a CDN (Content Delivery Network)

    Ok, we have been working a lot on speeding up our website and have moved to a Content Delivery Network. We currently have our js and css taken care of but are running into a brick wall in coding for the images. We are using image handler 4 for our images. Now, since we are using a cdn, our urls need to change from:

    http://ledchristmaslighting.com/bmz_cache/etc....

    to

    http://cdn.ledchristmaslighting.com/bmz_cache/etc.

    Now, we know that this code right here is what we need to change, but are not sure how to change it in php and we are asking for some help here.

    public_html/includes/classes/bmz_image_handler.class.php

    Line #208 : ((strpos($this->src, substr($bmzConf['cachedir'], strlen($ihConf['dir']['docroot']))) === 0))) &&

    Can anyone help us out here a bit on the coding? I know this part needs to be adjusted and modified to point to our .cdn subdomain:

    ((strpos($this->src, substr
    http://www.trinorthlighting.com, http://ledchristmaslighting.com, http://ledneonlight.com

    Those who bring sunshine to the lives of others, cannot keep it from themselves!

  2. #2
    Join Date
    Aug 2005
    Location
    New York!!!
    Posts
    164
    Plugin Contributions
    0

    Default Re: Needing help changing Image Handler for a CDN (Content Delivery Network)

    Anyone have any suggestions?
    http://www.trinorthlighting.com, http://ledchristmaslighting.com, http://ledneonlight.com

    Those who bring sunshine to the lives of others, cannot keep it from themselves!

  3. #3
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,183
    Plugin Contributions
    11

    Default Re: Needing help changing Image Handler for a CDN (Content Delivery Network)

    This would have been better addressed in the support thread for Image Handler.

    It appears that your site uses both cdnDOTledchristmaslighting.... and ledchristmaslighting...

    You should probably redirect and decide which one to use. IH4 bases the location of the bmz_cache on the variable DIR_FS_CATALOG which is set in the config files.

    Using a redirect from cdnDOT to the regular site should solve the problem.

  4. #4
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Needing help changing Image Handler for a CDN (Content Delivery Network)

    Quote Originally Posted by dbltoe View Post
    This would have been better addressed in the support thread for Image Handler.

    It appears that your site uses both cdnDOTledchristmaslighting.... and ledchristmaslighting...

    You should probably redirect and decide which one to use. IH4 bases the location of the bmz_cache on the variable DIR_FS_CATALOG which is set in the config files.

    Using a redirect from cdnDOT to the regular site should solve the problem.
    Exactly.. this issue won't be resolved by hacking IH4 files as IH4 correctly picks up the image URL from the configuration file..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  5. #5
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Needing help changing Image Handler for a CDN (Content Delivery Network)

    Just for my interest.....
    IH create images on the fly when needed and stores them in the website bmz directory.
    How do you intend creating images on the fly and then uploading them to your cdn?

    I suspect altering the code to refer to the cdn for image display is probably doable.
    But the uploading on the fly bit is going to be a headache

  6. #6
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Needing help changing Image Handler for a CDN (Content Delivery Network)

    Quote Originally Posted by gilby View Post
    Just for my interest.....
    IH create images on the fly when needed and stores them in the website bmz directory.
    How do you intend creating images on the fly and then uploading them to your cdn?

    I suspect altering the code to refer to the cdn for image display is probably doable.
    But the uploading on the fly bit is going to be a headache
    Ahh I get it.. they want to serve the IH4 cache from the CDN versus the bmz_cache folder?? That is going to require a BIG change to IH4's core functionality, and I imagine that the code to do this will NOT be forthcoming from the forum.. Sounds like custom dev to me..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  7. #7
    Join Date
    Aug 2005
    Location
    New York!!!
    Posts
    164
    Plugin Contributions
    0

    red flag Re: Needing help changing Image Handler for a CDN (Content Delivery Network)

    As far as the bmz cache goes, once that is created it is created and done. So it would seem that the easiest thing to do is change the coding on the product page to point to the url cdn.ledchristmaslighting.com

    The cdn domain is not mine, that is the content delivery networks. All it does is cache items. When I point to the cdn network, it comes and gets the non cdn item and caches it multiple servers and adds the cdn. Anyways, when I look at the source code on an output page for an item it shows like this currently:

    <td width="160" valign="top" class="listing-img main" align="center">
    <a href="http://ledchristmaslighting.com/index.php?main_page=product_info&amp;cPath=927_949_966&amp;products_id=18172">** ******<img itemprop="image" src="bmz_cache/0/00a112c160d3ae925c462301acd2d420.image.150x120.jpg"********* alt="C-Splash 2 Light 10 degree beam angle" title=" C-Splash 2 Light 10 degree beam angle " width="150" height="120" /></a><br clear="all" /><br clear="all" />In Stock: 1000<br clear="all" /><br clear="all" /> </td>


    Ok, so I do not want to modify when image handler changes the photo, I just want to modify the source code in the php to reflect what is listed below between the *******

    <td width="160" valign="top" class="listing-img main" align="center">
    <a href="http://ledchristmaslighting.com/index.php?main_page=product_info&amp;cPath=927_949_966&amp;products_id=18172">** ****<img itemprop="image" src="//cdn.ledchristmaslighting.com/bmz_cache/0/00a112c160d3ae925c462301acd2d420.image.150x120.jpg"******* alt="C-Splash 2 Light 10 degree beam angle" title=" C-Splash 2 Light 10 degree beam angle " width="150" height="120" /></a><br clear="all" /><br clear="all" />In Stock: 1000<br clear="all" /><br clear="all" /> </td>
    http://www.trinorthlighting.com, http://ledchristmaslighting.com, http://ledneonlight.com

    Those who bring sunshine to the lives of others, cannot keep it from themselves!

  8. #8
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Needing help changing Image Handler for a CDN (Content Delivery Network)

    Quote Originally Posted by trinorthlighting View Post
    As far as the bmz cache goes, once that is created it is created and done. So it would seem that the easiest thing to do is change the coding on the product page to point to the url cdn.ledchristmaslighting.com

    The cdn domain is not mine, that is the content delivery networks. All it does is cache items. When I point to the cdn network, it comes and gets the non cdn item and caches it multiple servers and adds the cdn. Anyways, when I look at the source code on an output page for an item it shows like this currently:

    <td width="160" valign="top" class="listing-img main" align="center">
    <a href="http://ledchristmaslighting.com/index.php?main_page=product_info&amp;cPath=927_949_966&amp;products_id=18172">** ******<img itemprop="image" src="bmz_cache/0/00a112c160d3ae925c462301acd2d420.image.150x120.jpg"********* alt="C-Splash 2 Light 10 degree beam angle" title=" C-Splash 2 Light 10 degree beam angle " width="150" height="120" /></a><br clear="all" /><br clear="all" />In Stock: 1000<br clear="all" /><br clear="all" /> </td>


    Ok, so I do not want to modify when image handler changes the photo, I just want to modify the source code in the php to reflect what is listed below between the *******

    <td width="160" valign="top" class="listing-img main" align="center">
    <a href="http://ledchristmaslighting.com/index.php?main_page=product_info&amp;cPath=927_949_966&amp;products_id=18172">** ****<img itemprop="image" src="//cdn.ledchristmaslighting.com/bmz_cache/0/00a112c160d3ae925c462301acd2d420.image.150x120.jpg"******* alt="C-Splash 2 Light 10 degree beam angle" title=" C-Splash 2 Light 10 degree beam angle " width="150" height="120" /></a><br clear="all" /><br clear="all" />In Stock: 1000<br clear="all" /><br clear="all" /> </td>
    and I stand by my previous response to this.. You are talking about the image caching function of IH4. You want it to store this image cache on your CDN versus a local folder as it does now. This is a KEY part of IH4s core functionality, and it IS going to require a BIG change to IH4's core code (ie: it's not a simple ONE FILE change).. This is CUSTOM development, and you are probably going to need to hire someone to make this modification for you.. I suspect that the code to do this will NOT be forthcoming (ie: for free) from the forum.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  9. #9
    Join Date
    Aug 2005
    Location
    New York!!!
    Posts
    164
    Plugin Contributions
    0

    Default Re: Needing help changing Image Handler for a CDN (Content Delivery Network)

    I can not store the images on the cdn vs the local folder anyways because of image handler. The coding should be easier to change in zencart than rather changing the IH4 core code. I also have been considering a simple 301 redirect for all images as well.
    http://www.trinorthlighting.com, http://ledchristmaslighting.com, http://ledneonlight.com

    Those who bring sunshine to the lives of others, cannot keep it from themselves!

  10. #10
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Needing help changing Image Handler for a CDN (Content Delivery Network)

    Quote Originally Posted by trinorthlighting View Post
    I can not store the images on the cdn vs the local folder anyways because of image handler. The coding should be easier to change in zencart than rather changing the IH4 core code. I also have been considering a simple 301 redirect for all images as well.
    The PRIMARY purpose of IH4 is to compress and cache the images.. the IH4 image cache is a local directory called bmz_cache.. how do you propose you have images with a URL of cdn.yourdomain.com/bmz_cache/....... without images being stored on the CDN??
    Last edited by DivaVocals; 3 Sep 2013 at 01:20 AM.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Image display issue for preview with image handler, please help
    By bengalliboy in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 16 May 2010, 06:34 PM
  2. Help! Changing image and content of side boxes!
    By kconklin in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 3 Mar 2010, 06:02 PM
  3. Newbie Needing SOme Help With Colour Changing
    By DPM in forum Templates, Stylesheets, Page Layout
    Replies: 24
    Last Post: 2 Apr 2008, 01:55 PM
  4. Urget help for Image Handler 2.0
    By lina0962 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 15 Jan 2007, 01:39 AM

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