Hello again,
Now what I'm pasting here should work, barring anything unforseen. One thing about scripting languages (and for that matter any software with updated versions) is that some things are dependent upon which version of PHP being run. I'm assuming here that you are running above PHP4. It probably won't matter regardless, I'm just saying it for indemnification.
Code:
foreach(array_keys($products) as $key) {
$products[$key]["PICTURE"] = ''.GetProductThumb($products[$key]["ProductID"], $products[$key]["ProductName"]).'';
}
function GetProductThumb ($ProductID, $alt=false) {
$filepath = CST_IMAGE_DIRECTORY."/".CST_IMAGE_THUMB_PREFIX.$ProductID.".jpg";
if(file_exists($filepath)) {
$image_size = getimagesize($filepath);
$img = '[img]'.CST_IMAGE_DIRECTORY_REL.'/'.CST_IMAGE_THUMB_PREFIX.$ProductID.'.jpg'.'[/img]';
return $img;
} else {
return '[img]'.CST_TEMPLATE_DIR.'/pagegfx/no-image-placeholder.gif[/img]';
}
I have included both functions because although there is a much more efficient way to go about it, that is the least amount of work on your part to get it working for now. If you have any other problems, I'll give them a shot.