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.
Bookmarks