By rout on
I'm hoping someone can provide me with some guidance with this. I need to obtain the path to the Imagecache thumbnails that are linked to a node.
This is the code I am using, which succeeds in obtaining the path to the original image file.
Can anyone recommend a solution on how to obtain the path to the Imagecache thumbnails?
function imagefiles_get_thumbnails($nid){
if (module_exists('imagefield')){
$SQL = "SELECT * FROM node, files, content_field_image
WHERE node.nid = %d AND node.nid = content_field_image.nid AND files.fid = content_field_image.field_image_fid
ORDER BY node.nid ASC, content_field_image.delta ASC
";
$result = db_query($SQL,$nid);
while ($record = db_fetch_object($result)){
$images[] = $record->filepath;
};
if (count($images) > 0){
return $images;
}else{
return false;
};
}else{
return false;
};
}