How Make Pic Title Required? How Make Pic Title Required?
 

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]

Main Menu

How Make Pic Title Required?

Started by treret, October 26, 2007, 05:46:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

treret

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.

treret

Finally I didi it.

In upload.php

after

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


add
               
if ($title == '')                        {
                         cpg_die(ERROR, $lang_db_input_php['title_not_entered'], __FILE__, __LINE__);
}

In lang/english.php, after

'album_not_selected'
add
  'title_not_entered=> 'You have not entered the Title.', //cpg1.4

treret

I forgot a line.

In upload.php

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


add
$title = addslashes($_POST['title']);

Joachim Müller

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?

treret

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.


treret

There is an error in the code I wrote up

Wrong code:

'title_not_entered=> 'You have not entered the Title.', //cpg1.4

Correct Code:

'title_not_entered' => 'You have not entered the Title.', //cpg1.4