I have a UDT that outputs logo images from a certain folder based on what section the user is in.
I need these images to link to their product websites, so i have named the images like
www-google-com.gif, www-facebook-com.gif
My plan is to extract the link from the image name but the smarty syntax isnt working for me.
I need to replace the slashes with dots and remove the file extension (.gif, .jpg etc.)
i have something like
Code: Select all
$files = glob("uploads/images/".$params['id']."/*.*", GLOB_BRACE);
if($files)
{
$folder = $params['id'].'/';
$i=1;
foreach($files as $file)
{
if(!preg_match('/thumb/',$file))
{
//$image = explode('.',$files[$i]);
$image = explode('-',$files[$i]);
$im = explode($folder,$image[0]);
$thumb = explode($folder,$file);
$path = $thumb[0].$folder.'/'.$thumb[1];
print"<a href='$image[$i]' >";
print" <img src='".$path."' />";
print "</a>";
}
}
}
Thanks for any help