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

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

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