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: How Make Pic Title Required?  (Read 2655 times)

0 Members and 1 Guest are viewing this topic.

treret

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
How Make Pic Title Required?
« on: October 26, 2007, 05:46:54 pm »

Some of my users don't put the Title when they upload there pics. I want they MUST put the title, otherwise they can't go ahed and upload the picture.
I know it must be something to change to upload.php.
How can I do it?

Thanks.
« Last Edit: October 30, 2007, 06:58:48 pm by GauGau »
Logged

treret

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: How Make Pic Title Required?
« Reply #1 on: October 30, 2007, 05:52:59 pm »

Finally I didi it.

In upload.php

after

Code: [Select]
        if (!$album){
                        cpg_die(ERROR, $lang_db_input_php['album_not_selected'], __FILE__, __LINE__);
                }    

add
Code: [Select]
               
if ($title == '')                        {
                         cpg_die(ERROR, $lang_db_input_php['title_not_entered'], __FILE__, __LINE__);
}
In lang/english.php, after

Code: [Select]
'album_not_selected'add
Code: [Select]
  'title_not_entered=> 'You have not entered the Title.', //cpg1.4
Logged

treret

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: How Make Pic Title Required?
« Reply #2 on: October 30, 2007, 06:24:55 pm »

I forgot a line.

In upload.php

after
Code: [Select]
        $album = (int)$_POST['album'];

add
Code: [Select]
$title = addslashes($_POST['title']);
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: How Make Pic Title Required?
« Reply #3 on: October 30, 2007, 06:59:54 pm »

Thanks for returning and sharing your solution. However, this will be very annoying for your users to end with a die-statement: they have to start the upload from scratch. Don't you think that this is not very user-friendly?
Logged

treret

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: How Make Pic Title Required?
« Reply #4 on: October 30, 2007, 07:13:05 pm »

Hi,

No, it doesn't die the upload, it just needs a page back without loosing any infomation already added.
It works in the same way as if you have not selected the album and you have to go back and select it.

 
Logged

treret

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: How Make Pic Title Required?
« Reply #5 on: February 01, 2008, 11:57:33 am »

There is an error in the code I wrote up

Wrong code:

 
Code: [Select]
'title_not_entered=> 'You have not entered the Title.', //cpg1.4
Correct Code:

 
Code: [Select]
'title_not_entered' => 'You have not entered the Title.', //cpg1.4
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.