View Single Post
  #20  
Old 09-02-2008, 08:55 AM
  polkadotninja's Avatar 
polkadotninja polkadotninja is offline
 

Newbie
  
Join Date: Aug 2007
Posts: 5
 

Default Re: Dynamic Images - a FREE mod for image resizing!

One more note ... in case anyone is interested in doing what I mentioned at the end of the last post (replacing product thumbnails with a resized version of the main product image), here's what I came up with, which, so far, seems to work ...

In include/func/func.files.php:

Modify the function call for func_get_image_url to look like the following (added one arg) -

PHP Code:
function func_get_image_url($id$type 'T'$image_path false$no_url false) { 

Then modify the line in that same function which looks like this -

PHP Code:
if (is_url($image_path)) { 

to this -

PHP Code:
if (is_url($image_path) || $no_url) { 

In include/search.php:

Modify the section that looks like this -

PHP Code:
# Get thumbnail URL
       
$products[$k]["tmbn_url"] = false;
                
        if (!
is_null($v['image_path_T'])) { 

to this -

PHP Code:
# Get thumbnail URL
       
$products[$k]["tmbn_url"] = false;
        
        if (
$active_modules.PHPSS_Dynamic_Images != "") {
          
$products[$k]["tmbn_url"] = func_get_image_url($v['productid'], "P"falsetrue);
        }
        
        else if (!
is_null($v['image_path_T'])) { 


Oh, one last thing, you might as well hide the thumbnail rows in skin1/main/product_details.tpl. I think that's it. Everything else just works once that's done ... the trick was to make the tmbn_url property point to the product's main image URL.

- Sam
__________________
Version 4.1.10
Reply With Quote