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: Adopt filename as title on upload  (Read 5813 times)

0 Members and 1 Guest are viewing this topic.

pnear

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 35
    • http://www.thenears.com
Adopt filename as title on upload
« on: January 10, 2005, 06:59:45 pm »

Apologies in advance - this seems like something that would have been asked many times before but my searches were not fruitful.

I would like to adopt the filename as the title of an image if no title has been specified.  I see that this can be done using the admin tools after the fact, but no setting to use this rule on upload.  I swear I'd seen that somewhere before.

Why:  I'm streaming via RSS and by default, most of my images have no titles.  This looks odd in an RSS reader, and I'd like to at least output something.

Any help pointing me to the answer would be appreciated.

Cheers,
Pete
« Last Edit: September 29, 2005, 09:11:10 am by GauGau »
Logged

Nibbler

  • Guest
Re: Adopt filename as title on upload
« Reply #1 on: January 10, 2005, 07:09:28 pm »

include/picmgmt.inc.php

Code: [Select]
$title = $title ? $title : $filename;
Just after the globals should do the trick.
Logged

wbc

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 53
Re: Adopt filename as title on upload
« Reply #2 on: January 26, 2005, 12:20:33 pm »

include/picmgmt.inc.php

Code: [Select]
$title = $title ? $title : $filename;
Just after the globals should do the trick.

I do'nt understand what you mean by the "glbals". would you please point it out? Thank you
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Adopt filename as title on upload
« Reply #3 on: January 26, 2005, 12:55:34 pm »

look in the file for the word global.  "global" is a declaration statement that makes those variables available on a global scope.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

wbc

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 53
Re: Adopt filename as title on upload
« Reply #4 on: January 27, 2005, 11:49:00 am »

Hi !
there are two sections related to "alobal":

(1)
// Add a picture to an album
function add_picture($aid, $filepath, $filename, $title = '', $caption = '', $keywords = '', $user1 = '', $user2 = '', $user3 = '', $user4 = '', $category = 0, $raw_ip = '', $hdr_ip = '',$iwidth=0,$iheight=0)
{
    global $CONFIG, $ERROR, $USER_DATA, $PIC_NEED_APPROVAL;
    global $lang_errors;

$title = $title ? $title : $filename;


and  
(2)

* @return 'true' in case of success
*/
function resize_image($src_file, $dest_file, $new_size, $method, $thumb_use)
{
    global $CONFIG, $ERROR;
    global $lang_errors;

$title = $title ? $title : $filename;

    $imginfo = getimagesize($src_file);

and I put  $title = $title ? $title : $filename;  in both sections. Is it correct ?


Great ! It seems work!  How about batch_add files? It also works ?
« Last Edit: January 27, 2005, 12:00:47 pm by wbc »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Adopt filename as title on upload
« Reply #5 on: January 27, 2005, 01:11:15 pm »

and I put  $title = $title ? $title : $filename;  in both sections. Is it correct ?
It's probably only needed once, but tt least it won't hurt if it's in there twice.


Great ! It seems work!  How about batch_add files? It also works ?
No, the batch-add is not controlled by upload.php, but by searchnew.php

Joachim
Logged

wbc

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 53
Re: Adopt filename as title on upload
« Reply #6 on: January 28, 2005, 01:44:38 am »

so, how to do it for batch_add  ????
Logged

wbc

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 53
Re: Adopt filename as title on upload
« Reply #7 on: January 28, 2005, 11:52:39 am »

Great ! It also work for batch_add !


but there is a problem that there are ***.jpg(file type), .jpg  can't be removed !

Can it be removed?
How ?


Thank you.
« Last Edit: January 29, 2005, 11:54:06 am by wbc »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Adopt filename as title on upload
« Reply #8 on: January 30, 2005, 08:24:41 am »

I don't understand your question, please re-phrase and use more words - a screenshot might help as well to illustrate your problem.

Joachim
Logged

LWAA

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Adopt filename as title on upload
« Reply #9 on: September 28, 2005, 12:41:36 pm »

hi - is there any way to make this change to image already uploaded?
Logged
<i>"I understand everything, except what you're telling me"</i>

Nibbler

  • Guest
Re: Adopt filename as title on upload
« Reply #10 on: September 28, 2005, 12:57:47 pm »

Use admin tools.
Logged

LWAA

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Adopt filename as title on upload
« Reply #11 on: September 28, 2005, 01:12:00 pm »

I found something that shows the filename in an info box under the pic, that will do, thanks.
Logged
<i>"I understand everything, except what you're telling me"</i>
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.