Ubercart, Imagecache, and Clean URLs

Posts: 55
Joined: 08/17/2007

Is there any kind of workaround for imagecache to get it to display images without enabling clean urls? (IIS does not support cleanurls, I would suggest my company switch to apache... but they have too many things running on asp pages).

If not, does anyone know what I would have to edit to manually add images to the catalog page?

Thanks

Posts: 2243
Joined: 08/07/2007
AdministratoreLiTe!

As far as I know, Imagecache has to have clean URLs to work right.

You can override theme_uc_catalog_browse() to use whatever method you want display the category images. You only need to change one line, but you still have to copy the new function into yourtheme_uc_catalog_browse() to put in your template.php file. The line you want to change is

<?php
 
if ($catalog->image){
   
$output .= theme('imagecache', 'thumbnail', $catalog->image['filepath'], $catalog->name, $catalog->name, array('class' => 'category'));
  }
?>

Without imagecache, you'll have to use
<?php
$file
= uc_catalog_image_load($catalog->tid);
$info = image_get_info($file->filepath);
?>

to get information about the image. $catalog->image won't exist without the imagecache module. That's bad coding on my part, so I'm changing the code in the repository as a result.

Posts: 82
Joined: 08/31/2007
Bug FinderInternationalizationizerNot KulvikThe other woman.

hi, for whatever it's worth, i have successfully (so far, as far as i know) used imagecache-5.x-2.0 with non-cleanurls on IIS6.

a few things:

1 - just make sure you do install imageapi before updating to imagecache 2.

2 - as of yesterday, i had to patch thickbox as per this thread BEFORE running the drupal update script otherwise you get the blank white screen of something gone horribly wrong.

3 - run the drupal update script.

4 - configure to your heart's delight and the images will now be accessible at the non-cleanURL url. (index.php?q=files/imagecache/something/files/image.jpg)

hope this helps.

-- sarah

--

i plurk. i twit.