Disable title field on Multiple Files Flash Driven upload option? Disable title field on Multiple Files Flash Driven upload option?
 

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

Disable title field on Multiple Files Flash Driven upload option?

Started by crl, January 29, 2012, 06:12:54 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

crl

I am trying to disable the title field when members are uploading images.

The "Simple one file at a time" is sorted, deleted the line
array($lang_upload_php['pic_title'], 'title', 0, 255, 1),
in the upload.php

However the "Multiple Files - Flash Driven" upload option still displays the title field.  Any idea on how to remove the title field on this upload option?

Αndré

The flash uploader redirects to editpics.php. This file is also used to edit all files of an album. Do you want to disable that field completely, or just after the flash upload?

crl

Just want to delete the "Title" field only after the images have been uploaded.  I want to retain the description field

Αndré

Please apply that mod: http://forum.coppermine-gallery.net/index.php/topic,73826.msg356029.html#msg356029

Then (if it works as expected) we can check for the newly added parameter newer_than and remove the title field. So please confirm if the other mod works as expected.

crl

Added the script change.
But the multi flash upload option still shows the title field after the photo is uploaded.

Αndré

Of course it will still show the title field. Please read the other thread what those changes are supposed to do. It's important that you'll find the newer_than parameter in the URLs after the flash upload, as we need it for your request:
Quote from: crl on January 30, 2012, 05:09:10 PM
want to delete the "Title" field only after the images have been uploaded

In the meantime Phill already confirmed that the mod (only show pictures from the last flash upload) works for him. If it also works for you, apply the following changes:

Open editpics.php, find
$data = array(
    array($icon_array['file_info'] . $lang_editpics_php['pic_info'], '', 3),
    array($icon_array['album'] . $lang_common['album'], 'aid', 1),
    array($icon_array['title'] . $lang_common['title'], 'title', 0, 255),
    array($icon_array['description'] . $captionLabel, 'caption', 2, $CONFIG['max_img_desc_length']),
    array($icon_array['keyword'] . $keywordLabel, 'keywords', 0, 255),
    array($CONFIG['user_field1_name'], 'user1', 0, 255),
    array($CONFIG['user_field2_name'], 'user2', 0, 255),
    array($CONFIG['user_field3_name'], 'user3', 0, 255),
    array($CONFIG['user_field4_name'], 'user4', 0, 255),
);

and below, add
if ($superCage->get->keyExists('newer_than')) {
    unset($data[2]);
}


find
$title       = get_post_var('title', $pid);
and replace with
$title       = $superCage->get->keyExists('newer_than') ? '' : get_post_var('title', $pid);

find
$update .= ", title = '$title'";
and replace with
//$update .= ", title = '$title'";

crl


Αndré

Please
Quote from: Joachim Müller on September 28, 2008, 12:46:26 PM
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.

crl

Noticed that I still have a few problems.

After the image has been uploaded, if Edit File Information is used the title field is still available.  How do I remove this field completely?

Another question, is it possible to make the Description Field to be completed compulsory when uploading an image?

Αndré

Quote from: crl on February 15, 2012, 06:54:19 PM
After the image has been uploaded, if Edit File Information is used the title field is still available.  How do I remove this field completely?
:o

Quote from: Αndré on January 30, 2012, 04:30:26 PM
Do you want to disable that field completely, or just after the flash upload?
Quote from: crl on January 30, 2012, 05:09:10 PM
Just want to delete the "Title" field only after the images have been uploaded.
::)


So we have to start from scratch. Undo all changes from this thread (or at least all changes from that post), open editpics.php, find
$data = array(
    array($icon_array['file_info'] . $lang_editpics_php['pic_info'], '', 3),
    array($icon_array['album'] . $lang_common['album'], 'aid', 1),
    array($icon_array['title'] . $lang_common['title'], 'title', 0, 255),
    array($icon_array['description'] . $captionLabel, 'caption', 2, $CONFIG['max_img_desc_length']),
    array($icon_array['keyword'] . $keywordLabel, 'keywords', 0, 255),
    array($CONFIG['user_field1_name'], 'user1', 0, 255),
    array($CONFIG['user_field2_name'], 'user2', 0, 255),
    array($CONFIG['user_field3_name'], 'user3', 0, 255),
    array($CONFIG['user_field4_name'], 'user4', 0, 255),
);

and replace with
$data = array(
    array($icon_array['file_info'] . $lang_editpics_php['pic_info'], '', 3),
    array($icon_array['album'] . $lang_common['album'], 'aid', 1),
    //array($icon_array['title'] . $lang_common['title'], 'title', 0, 255),
    array($icon_array['description'] . $captionLabel, 'caption', 2, $CONFIG['max_img_desc_length']),
    array($icon_array['keyword'] . $keywordLabel, 'keywords', 0, 255),
    array($CONFIG['user_field1_name'], 'user1', 0, 255),
    array($CONFIG['user_field2_name'], 'user2', 0, 255),
    array($CONFIG['user_field3_name'], 'user3', 0, 255),
    array($CONFIG['user_field4_name'], 'user4', 0, 255),
);


find
$title       = get_post_var('title', $pid);
and replace with
//$title       = get_post_var('title', $pid);

find
$update .= ", title = '$title'";
and replace with
//$update .= ", title = '$title'";

crl

Thanks for the updated code.
Before I try out the new code is the description field mandatory with this new code?

Αndré

No, as
Quote from: Joachim Müller on September 28, 2008, 10:28:42 AM
We have a strict "One question/issue per thread rule", which helps both supporters/moderators to keep track of open/closed issues as well as users who search the board or browse it, looking for answers to their question.