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: Autopopulate title with file name  (Read 2945 times)

0 Members and 1 Guest are viewing this topic.

bitcloud

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Autopopulate title with file name
« on: November 12, 2006, 04:08:41 pm »

Hi,

I've really searched this forum for hours and am unable to find how to automatically populate the "title" field with the file name (preferably the file name stripped of underscores and the extension). I'm running the latest version of coppermine. v1.4.10

I know how to mass fill the titles after the uploads are done, but this isn't really workable for an active forum... it also strips any existing titles you may have put in.

I've managed to find in upload.php:
Code: [Select]
        $title=$iptc['Headline'];
    } else {
        $title='';

And this will let me replace $title=''; with $title=$filename; (or whatever else I want) and that will auto populate the field without any troubles, but I'm unable to find the correct variable for the "file name" ($filename isn't it)

I can see this one will be so obvious I'll slap my forehead, but any help would really be appreciated

cheers...
« Last Edit: November 12, 2006, 05:36:15 pm by Nibbler »
Logged

bitcloud

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Autopopulate title with file name
« Reply #1 on: November 12, 2006, 04:16:27 pm »

I know this one's been floating around for a while, so if anyone's still trying to figure out how to autopopulate the title field with the file name when you upload, find the line
Code: [Select]
        $title=$iptc['Headline'];
    } else {
$title='';

and change it to

Code: [Select]
        $title=$iptc['Headline'];
    } else {
// LACHLAN EDIT made title extension instead of ''
        $title=$escrow_array[$index]['actual_name'];
Logged

Nibbler

  • Guest
Logged

bitcloud

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Autopopulate title with file name
« Reply #3 on: November 12, 2006, 05:33:56 pm »

ah thanks! thats a much tidier method

cheers
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.