Returning a file extension (how to?) Returning a file extension (how to?)
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Returning a file extension (how to?)

Started by Steve_TLS, June 18, 2005, 10:27:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Steve_TLS

I'm not lazy, just lacking some skill and need someone to do a little work for me please. I'm after a bit of code that will return the extension of a file in a variable. I want to test it and turn off two rows of cells in my file information window.

Probably much to the dismay of the authors of CPG, I've disabled a few things and added some. I added two text boxes to help me with posting on Bulleting boards, one with the BB img tags attached and one with the url tag containing an image tag to the image thumb for a quick copy and paste for a "click for a big one" post. But I want to turn them off if the file isn't a gif or a jpg as they wouldn't work.

I'm not sure how I got this far just by copying and pasting and testing and re-testing until it worked. I'll post the code when I'm finished and happy with it for all to pick on :)

My gallery and results to date are here: www.wotid.com/pictures

Thanks.

Nibbler

You can use the provided Coppermine function is_image($filename). That will give you a true/false answer. Make sure media.functions.inc.php has been included before you call the function.

Steve_TLS

Thanks for that. I'll get to work on it.