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

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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.