I am trying to find some way where I can control what content are shown based on uploaded files (extension). For example:
If the uploaded file is a .jpg or .png image, somewhere in the body of the article will display the thumbnail of the uploaded image.

It is kinda like to display file icon based on file extension of file value field. But I don't know how to do it. Can anyone offer a snippet?

Thanks a lot!

Comments

strands’s picture

I haven't tried it myself, but maybe the iTweak module is what you're after.

I've also used the link here http://drupal.org/node/86413 for D5, but maybe the D6 link helps.

Seán

usabilitydeveloper.com’s picture

thanks for your reply. it is a good module. but i more than just want to show image thumbnails.

i need something like this but it doesn't work:

if ($node->taxonomy[9])
{
$file->filemime = $fields['filemime']->content; 
     if(strpos($file->filemime, 'audio/') === 0)   // check file mime
	 {
     print ....;
 	 }
}
usabilitydeveloper.com’s picture

i figured it out by myself.

if ($node->taxonomy[9])
{
	
foreach ($node->files as $fid => $file)
 {
$file->filemime = $node->files[$fid]->filemime;
     if(strpos($file->filemime, 'audio/') === 0)
	 {
     print '......';
 	 }
 }
}