forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: bitcloud on November 12, 2006, 04:08:41 pm

Title: Autopopulate title with file name
Post by: bitcloud 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...
Title: Re: Autopopulate title with file name
Post by: bitcloud 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'];
Title: Re: Autopopulate title with file name
Post by: Nibbler on November 12, 2006, 05:15:41 pm
http://forum.coppermine-gallery.net/index.php?topic=13546.0
Title: Re: Autopopulate title with file name
Post by: bitcloud on November 12, 2006, 05:33:56 pm
ah thanks! thats a much tidier method

cheers