Page 3 of 23 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 221
  1. #21
    Join Date
    May 2007
    Location
    Leicester, England
    Posts
    165
    Plugin Contributions
    1

    Default Re: attribute pop up images

    A friend has helped me to add a margin around the pop-up image. The 'backgorund' colour can be adjusted so that the margin can appear to be a border.

    Here's the revised file:
    Attached Files Attached Files

  2. #22
    Join Date
    Feb 2007
    Location
    South Florida, USA
    Posts
    1,372
    Plugin Contributions
    4

    Default Re: attribute pop up images

    Quote Originally Posted by blag View Post
    I modified the script so that it now works using the corresponding images in the /images/large/ subdirectory rather than images/attributes/medium

    I did this because the 'large' directory already exists in the default zen cart set-up (I believe) AND I have already uploaded a significant number of the attributes 'large' images there!

    In this mod of the mod, the required large image 'suffix' follows the Zen cart convention i.e. image_name_LRG.xxx

    I hope that it may be of use to someone.
    Blag,
    Please allow me to correct an inaccuracy in this post.
    The correct path is images/medium/attributes.
    images/medium/ is created upon installation, you only create the attributes subfolder.
    I think that it will also work if you put your large image in images/large/attributes and use the _LRG at the end of the file's name, Zen Cart scans both directories by default.
    I am very interested in your research, please submit everything to the downloads --> other section, I think this contrib really belongs there.
    Respectfully.

  3. #23
    Join Date
    May 2007
    Location
    Leicester, England
    Posts
    165
    Plugin Contributions
    1

    Default Re: attribute pop up images

    Quote Originally Posted by ckosloff View Post
    Blag,
    Please allow me to correct an inaccuracy in this post.
    The correct path is images/medium/attributes.
    images/medium/ is created upon installation, you only create the attributes subfolder.
    I think that it will also work if you put your large image in images/large/attributes and use the _LRG at the end of the file's name, Zen Cart scans both directories by default.
    I am very interested in your research, please submit everything to the downloads --> other section, I think this contrib really belongs there.
    Respectfully.
    ckosloff

    I haven't yet finalised my mods, so they are not 'ready' to be submitted to the download section.

    Having reviewed the code for the mod, I can assure you that the mod, as originally posted will work only with images of suffix _MED in the folder you describe - no other variations will work. (Unless, that is, I have completely misread the code)

  4. #24
    Join Date
    Feb 2007
    Location
    South Florida, USA
    Posts
    1,372
    Plugin Contributions
    4

    Default Re: attribute pop up images

    Quote Originally Posted by blag View Post
    ckosloff

    I haven't yet finalised my mods, so they are not 'ready' to be submitted to the download section.

    Having reviewed the code for the mod, I can assure you that the mod, as originally posted will work only with images of suffix _MED in the folder you describe - no other variations will work. (Unless, that is, I have completely misread the code)
    Point taken, and thanks for clarifying that.
    I'll try to do a test to verify precisely that, if you are right won't add anything.
    Please continue your research, this is an important contribution to Zen Cart.

  5. #25
    Join Date
    May 2007
    Location
    Leicester, England
    Posts
    165
    Plugin Contributions
    1

    Default Re: attribute pop up images

    ckosloff

    I have finally sorted the module, and here it is in zipped including a 'Read Me' text file.
    Attached Files Attached Files

  6. #26
    Join Date
    May 2007
    Location
    Leicester, England
    Posts
    165
    Plugin Contributions
    1

    Default Re: attribute pop up images

    Quote Originally Posted by blag View Post
    ckosloff

    I have finally sorted the module, and here it is in zipped including a 'Read Me' text file.
    OOPS!

    The zip file is utterly confusing, because there are superseded files included. Please ingnore and download the updated version from Downloads/Other Modules/Attribute Pop-up (Large Images)

  7. #27
    Join Date
    Feb 2007
    Location
    South Florida, USA
    Posts
    1,372
    Plugin Contributions
    4

    Default Re: attribute pop up images

    Quote Originally Posted by blag View Post
    OOPS!

    The zip file is utterly confusing, because there are superseded files included. Please ingnore and download the updated version from Downloads/Other Modules/Attribute Pop-up (Large Images)
    Good job!
    Just one question here.
    When I upload an attribute image swatch (a thumbnail), Zen Cart by default will try to upload it to ROOT/images/attributes.
    In the old version of this contrib, Zen Cart was scanning in ROOT/images/medium/attributes for the larger image.
    Now, where exactly will Zen Cart scan in your mod:
    1) ROOT/images/large/
    2) ROOT/images/large/attributes (I create this subfolder).
    3) Both
    ?
    Thanks for the hard work.

  8. #28
    Join Date
    Jun 2007
    Posts
    2
    Plugin Contributions
    0

    Default Re: attribute pop up images

    ckosloff, the information you are looking for is in the attributes.php file. You can easily modify the path for it to work wherever you wish.

    this is the line you need to change: $path = DIR_WS_IMAGES . '/large/'



    blag, have you thought about adding lightbox support to this as well? Thanks for your hard work.

  9. #29
    Join Date
    Feb 2007
    Location
    South Florida, USA
    Posts
    1,372
    Plugin Contributions
    4

    Default Re: attribute pop up images

    Quote Originally Posted by btetra View Post
    ckosloff, the information you are looking for is in the attributes.php file. You can easily modify the path for it to work wherever you wish.

    this is the line you need to change: $path = DIR_WS_IMAGES . '/large/'



    blag, have you thought about adding lightbox support to this as well? Thanks for your hard work.
    gotcha, thanks.

  10. #30
    Join Date
    May 2007
    Location
    Leicester, England
    Posts
    165
    Plugin Contributions
    1

    Have a Drink Re: attribute pop up images

    ckosloff & btetra

    The revised files in my version look here, and here ONLY: ROOT/images/large/

    (as explained in the Read Me File - I though I had made this absolutely clear)

    I suppose it would be possible to script it so that it looked in a secondary folder, but since I have declared that the files must be in a certain location and in a specific format, I believe that is sufficient

    SO you can use existing 'large' files for the pop-up (In some case, including me, this will avoid duplication of these files in different locations)

    If you want to modify the file locations setting open the file attributes.php and search for 'Mike Scott 070606'

    Once found you will see that the next 'section' of the PHP file looks like this:

    Code:
    $array_filename = split("[/\\.]", $products_options->fields['attributes_image']) ;
                        $filename = $array_filename[count($array_filename)-2];
                        $extension = '.'.$array_filename[count($array_filename)-1];
                        $filename = $filename.'_LRG';
                        $path = DIR_WS_IMAGES . '/large/';
                        $attribute_image_lrg = $path . $filename. $extension;
                        $selected_attrname = $products_options_names->fields['products_options_name'] . ': '.$products_options->fields['products_options_values_name'];
    As btetra rightly suggested, you can edit the line
    Code:
     $path = DIR_WS_IMAGES . '/large/';
    to a new filepath to suit your requirements


    To change the border sizes you need to modify the following lines in the javascript file :
    Code:
    writeln('<html><head><title>Loading...</title><style>body{margin-bottom:32px;margin-left:8px;margin-right:8px;margin-top:8px;font-family:tahoma, arial, helvetica, Geneva, sans-serif;}</style>')

    Code:
    writeln('width=parseInt(document.images[0].width)+16;');
    writeln('height=parseInt(document.images[0].height)+40;');
    writeln('window.resizeTo(width+12,height+84);}');writeln('if (isNN){');       
    writeln('window.innerWidth=document.images["George"].width+16;');
    But note that Internet Explorer does funny things: that is why the line writeln('window.resizeTo(width+12,height+84) doesn't seem to make sense, it seems to be that the additional value for the height needs to be twice the 'real' value plus 4 pixels, whilst the value for the additional width is 4 pixels less than its 'real' value!

    To change the font for the text, modify it here:
    Code:
    writeln('<html><head><title>Loading...</title><style>body{margin-bottom:32px;margin-left:8px;margin-right:8px;margin-top:8px;font-family:tahoma, arial, helvetica, Geneva, sans-serif;}</style>');
    To change the background colour of the image i.e. the borders, you need to chnage the hex value in this line:
    Code:
    else writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
    writeln('<img name="George" src='+imageURL+' style="display:block"> <center>' + imageDesc + '<br/><a href="#" onclick=" self.close();">Close Window</a></center></body>
    after 'bgcolor=".


    I don't know anything about Lightbox - so I would have to look into that. What IS lightbox? (BTW I am not a programmer and I have never previously dabbled with either php or javascript - this was just beginner's luck.

    FOOTNOTE:

    My motivation to produce this was the fact that I am convinced that I can produce far better-looking thumbnails than the auto-generated thumbnail software does, and, it goes without saying that the page load time must be reduced because the browser is only loading the thumbnail, not the whole large file, and then processing it for display purposes - even if some or all of the image processing is done server-side.

    I have just realised that the Attributes.php file is probably not the original for 1.3.7, I think that it may be the 'Products with Attributes' version.

 

 
Page 3 of 23 FirstFirst 1234513 ... LastLast

Similar Threads

  1. Pop up for attribute
    By chandroo007 in forum General Questions
    Replies: 0
    Last Post: 31 Jan 2011, 10:48 AM
  2. Attribute Pop-Up?
    By TurtleDove in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 24 Sep 2010, 05:22 AM
  3. Pop Up Images
    By crzy4prple in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Apr 2010, 06:37 AM
  4. attribute image pop up (large images)
    By kitcorsa in forum General Questions
    Replies: 12
    Last Post: 19 Sep 2008, 05:44 AM
  5. Adding a pop up window to an attribute
    By esoin in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 14 Sep 2007, 02:19 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