Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Mar 2005
    Posts
    8
    Plugin Contributions
    0

    Default Remove http://mysite/ from images ??

    I am trying to do something I'm not sure can even be done. I'd like to remove the http://mysite/ from my product images. For instance, when checking the properties for a product image (right click and select properties) I would come up with http://mysite/images/product_image.gif I would like to remove the http://mysite so I would only have the images/product_image.gif (I already know how to remove the images/ .... that part was easy :)

    I've been searching like crazy but can't come up with a solution. I've tried configuration files and product files etc etc and just can't find the correct code to alter.
    Any suggestions ?
    Thanks

    Steve

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    18,031
    Plugin Contributions
    1

    Default Re: Remove http://mysite/ from images ??

    First question - what problem are you trying to solve with this idea ?

  3. #3
    Join Date
    Jan 2004
    Posts
    58,246
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: Remove http://mysite/ from images ??

    Your browser is adding that, not Zen Cart.
    If you look at the raw HTML by right-clicking the page (not the image) and choose View Page Source, then you'll see that the images do not have the full domain added to them.

    So, as stevesh has also asked, the more important thing here is ... WHY are you even asking this question? What's the business problem you're trying to solve?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Mar 2005
    Posts
    8
    Plugin Contributions
    0

    Default Re: Remove http://mysite/ from images ??

    I use easy populate and if I could remove the http://mysite from the URL then I could link directly to my warehouses images. I have a site that I am putting up with about 12,000 different drop ship products and I'd really really hate to have to upload them all to my server. Plus the images are constantly being changed/updated and if I just direct link to them the images on my site would always be current.

    I understand that the browser is putting in the http:// part, but isn't Zen Cart putting in the 'mysite' part? If I could easily change the 'mysite' to 'mydropshipperssite' then the remote image URL links would work ............ I hope!
    Thoughts ????

    Steve

  5. #5
    Join Date
    May 2010
    Location
    WA State
    Posts
    1,646
    Plugin Contributions
    1

    Default Re: Remove http://mysite/ from images ??

    I understand that the browser is putting in the http:// part, but isn't Zen Cart putting in the 'mysite' part?
    Zen uses relative links so, no, it isn't adding the mysite part - technically, anyway. The cart looks at your configure.php file for the path to your images. I'm not sure if it'll work, but you may be able to edit that file and change the path to point to your external image source.
    Bumble Bee Template - my first contribution!

    The best way to learn is to try stuff. But, back it up first.

  6. #6
    Join Date
    Jan 2004
    Posts
    58,246
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: Remove http://mysite/ from images ??

    Zen Cart looks for physical files on your server, and does a whole lot more than merely output an img tag for the images.

    If you want to host your images someplace else, the FIRST thing you need is clear official permission to ensure you're not violating copyright laws, and then you need to rewrite the image handling infrastructure in Zen Cart to no longer offer multiple images per product, no longer handle intelligent resizing of images, no longer offer click-for-larger-image capability, etc.

    Merely changing a path in configure.php isn't going to accomplish all of that.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Mar 2005
    Posts
    8
    Plugin Contributions
    0

    Default Re: Remove http://mysite/ from images ??

    Yes I have permission from the warehouse, they are sending me a disc with the images right now. Just figured that pointing the URL to their site is the easier way.
    Being that I can't easily change the code to point to an external URL does anyone know of a mod that will do this? I've searched and searched and only came up with a few suggestions that people said would work, but it didn't work for me. They had said to change the DIR_WS_IMAGES (in the config file) to something else that would point to an outside host, except it never did actually work.
    Guess I will keep chugging away at it, there has to be a solution out there somewhere!

    Steve

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    20,966
    Plugin Contributions
    25

    Default Re: Remove http://mysite/ from images ??

    As DrByte said, the solution to what you say you want is to do a massive amount of custom coding, and then accept the loss of a number of commonly-used image features.

  9. #9
    Join Date
    Apr 2006
    Location
    Horicon, WI
    Posts
    2,121
    Plugin Contributions
    0

    Default Re: Remove http://mysite/ from images ??

    Before you would link to the images from the warehouse, you might want to ask them if they want you chewing through their bandwidth rather than your own......
    Mike
    Camelot-Hosting...A PCI compliant Ecommerce Host
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  10. #10
    Join Date
    Mar 2005
    Posts
    8
    Plugin Contributions
    0

    Default Re: Remove http://mysite/ from images ??

    OK, I figured it out (by saying 'I' what I really mean I found a post and made it work) ...... I can't take credit for it.

    I changed the file includes/functions/html_output.html

    Look for this string on or around line 165

    // 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);
    }

    This string will be replaced with this new code

    //by rl if image is located on the web, strip any local path
    if (strstr($src, 'http') != '0') {
    $src = strstr($src, 'http://');
    }

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

    SO - The file will now look something like this (with the new code)

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

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

    //by rl if image is located on the web, strip any local path
    if (strstr($src, 'http') != '0') {
    $src = strstr($src, 'http://');
    }

    // use old method on template images by rl: test for http
    if (strstr($src, 'includes/templates') or strstr($src, 'includes/languages') or PROPORTIONAL_IMAGES_STATUS == '0' or strstr($src, 'http') != '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;
    }

    With the new code the images will be picked from an outside server ONLY if you entered the picture name (when adding new products) with an http://

    From what I understand is that this new code addition will look for the http:// in the product image description entered and remove the http://mystie.com/images/ from the Zen Cart default picture URL when it sees it.

    NOW, that being said ..... and nothing EVER works easily for me ..... my warehouses images will not work with the http:// , the URL must be with out it. Example is if the URL is http://www.ware_house.com/images/product1.img the image wont show. It has to be www.ware_house.com/images/product1.img to work correctly. I am still messing with the new code addition to make it work.

    Steve

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Why my domain name is not WWW.MYSITE.COM but is MYSITE.COM
    By Carl85 in forum General Questions
    Replies: 4
    Last Post: 30 Jan 2011, 04:00 PM
  2. Replies: 7
    Last Post: 8 Dec 2010, 12:53 PM
  3. Replies: 5
    Last Post: 27 Apr 2010, 07:56 PM
  4. change address from http://mysite.com to http://www.mysite.com
    By EliseC in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 26 Mar 2008, 03:32 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
  •