Find a better way, hopefully using views, to get filepath. Current way is not elegent and forces the reliance on imagecache.

The Galleriffic plugin requires a filepath for the slide and thumbnail.

<ul class="thumbs noscript">
    <li>
        <a class="thumb" href="path/to/slide" title="your image title">
            <img src="path/to/thumbnail" alt="your image title again for graceful degradation" />
        </a>
        <div class="caption">
            (Any html can go here)
        </div>
    </li>
    ... (repeat for every image in the gallery)
</ul>

The view wasn't giving me this info so I had to hack around to get it to output the filepath:

	  if($object->fieldtype == 'imagefield') {

	    $object->filepath = db_fetch_array(db_query('SELECT filepath FROM {files} WHERE fid = %d' , $object->raw));

		$object->imagecache = str_replace("_default","",$object->imagecache);

		$object->imagecache = str_replace("_linked","",$object->imagecache);

		$object->raw = imagecache_create_url($object->imagecache, $object->filepath['filepath'], $bypass_browser_cache = FALSE);

	  }

This is a bad solution and should be fixed.

Comments

1kenthomas’s picture

Can you explain the difference between 6.x-6.x and ...1.x?

I am not getting correct filepaths from this method and am diagnosing, want to make sure I'm on the "newest."

acouch’s picture

Version: 6.x-6.x-dev » 6.x-1.x-dev

they are the same repository. the 6.x-6.x was created in the interface when I first submitted and am not sure how to change the cvs. once i get a partial release that won't be visible. if anyone knows how to correct that i would appreciate an explanation!

acouch’s picture

Status: Active » Closed (fixed)

I am getting the FID from the row and looking up the correct path which is not as good as making a handler but works.