coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: treret on October 26, 2007, 05:46:54 PM

Title: How Make Pic Title Required?
Post by: treret 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.
Title: Re: How Make Pic Title Required?
Post by: treret on October 30, 2007, 05:52:59 PM
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
Title: Re: How Make Pic Title Required?
Post by: treret on October 30, 2007, 06:24:55 PM
I forgot a line.

In upload.php

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


add
$title = addslashes($_POST['title']);
Title: Re: How Make Pic Title Required?
Post by: Joachim Müller 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?
Title: Re: How Make Pic Title Required?
Post by: treret 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.

Title: Re: How Make Pic Title Required?
Post by: treret on February 01, 2008, 11:57:33 AM
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