Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Hide file extension in display information cpg1.3  (Read 2565 times)

0 Members and 1 Guest are viewing this topic.

spa2036

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
Hide file extension in display information cpg1.3
« on: December 17, 2005, 01:07:48 pm »

Hi you all,

For my project I need to hide the file extension which is displayed in the image display information. Unfortunately I could not find any posts or tricks to make this happen. While viewing an image the file name is standard displayed with the extension included. What I do need is only the filename without extension.
I know it has something to do with calculating characters in the filename string, remove the last four characters (dot and extension) and return the new name.

Does anyone know how to make this happen?

Thanks in advance.
Rob
Logged
Thanks for sharing this wonderful program

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Hide file extension in display information cpg1.3
« Reply #1 on: December 17, 2005, 05:30:35 pm »

Edit displayimage.php

Replace (in function html_picinfo)

Code: [Select]
$info[$lang_picinfo['Filename']] = htmlspecialchars($CURRENT_PIC_DATA['filename']);

with

Code: [Select]
$info[$lang_picinfo['Filename']] = htmlspecialchars(substr($CURRENT_PIC_DATA['filename'], 0, strpos($CURRENT_PIC_DATA['filename'], '.')));
Logged
Chief Geek at Ranium Systems
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 21 queries.