Advanced search  

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

Pages: [1]   Go Down

Author Topic: Returning a file extension (how to?)  (Read 2885 times)

0 Members and 1 Guest are viewing this topic.

Steve_TLS

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 3
    • Steve's Photo Gallery
Returning a file extension (how to?)
« on: June 18, 2005, 10:27:24 pm »

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.
Logged

Nibbler

  • Guest
Re: Returning a file extension (how to?)
« Reply #1 on: June 18, 2005, 11:20:29 pm »

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.
Logged

Steve_TLS

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 3
    • Steve's Photo Gallery
Re: Returning a file extension (how to?)
« Reply #2 on: June 19, 2005, 12:12:07 am »

Thanks for that. I'll get to work on it.
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 21 queries.