coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: dreams83 on September 14, 2006, 09:14:45 AM

Title: Detect what filetype being display
Post by: dreams83 on September 14, 2006, 09:14:45 AM
How do you detect if and MP3 file is being played or an JPEG file is being viewed?
Is there a variable in cpg that will tell what type of file is being view?

Because what I want is something like this

if ( file being view is mp3 ) {
    I want to display extra stuff here.
    //I think I know what to do here but I don't know how to detect the file type.
}
else
    do nothing



If you guys could point me in the right direction that would be cool.
Title: Re: Detect what filetype being display
Post by: Nibbler on September 14, 2006, 12:19:13 PM
Depends where you are using the code. Post details.
Title: Re: Detect what filetype being display
Post by: dreams83 on September 15, 2006, 12:03:00 AM
i think in the intermediate display image part.

I only want to show the highlighted part if it is a mp3 file, but I don't know how to detect if it is or not.
Title: Re: Detect what filetype being display
Post by: dreams83 on September 15, 2006, 01:16:39 AM
I was able to figured out how to do it now. I just read the url and look at the extension.

Thank You