forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 upload => Topic started by: crl on January 29, 2012, 06:12:54 pm

Title: Disable title field on Multiple Files Flash Driven upload option?
Post by: crl on January 29, 2012, 06:12:54 pm
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
Code: [Select]
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?
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: Αndré on January 30, 2012, 04:30:26 pm
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?
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: crl on January 30, 2012, 05:09:10 pm
Just want to delete the "Title" field only after the images have been uploaded.  I want to retain the description field
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: Αndré on January 31, 2012, 09:28:47 am
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.
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: crl on February 01, 2012, 11:43:50 pm
Added the script change.
But the multi flash upload option still shows the title field after the photo is uploaded.
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: Αndré on February 02, 2012, 10:17:42 am
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:
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
Code: [Select]
$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
Code: [Select]
if ($superCage->get->keyExists('newer_than')) {
    unset($data[2]);
}

find
Code: [Select]
$title       = get_post_var('title', $pid);and replace with
Code: [Select]
$title       = $superCage->get->keyExists('newer_than') ? '' : get_post_var('title', $pid);
find
Code: [Select]
$update .= ", title = '$title'";and replace with
Code: [Select]
//$update .= ", title = '$title'";
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: crl on February 04, 2012, 03:22:21 pm
Thanks your new code worked perfectly :D
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: Αndré on February 04, 2012, 06:27:35 pm
Please
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.
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: crl on February 15, 2012, 06:54:19 pm
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?
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: Αndré on February 24, 2012, 02:02:21 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

Do you want to disable that field completely, or just after the flash upload?
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 (http://forum.coppermine-gallery.net/index.php/topic,74332.msg358054.html#msg358054)), open editpics.php, find
Code: [Select]
$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
Code: [Select]
$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
Code: [Select]
$title       = get_post_var('title', $pid);and replace with
Code: [Select]
//$title       = get_post_var('title', $pid);
find
Code: [Select]
$update .= ", title = '$title'";and replace with
Code: [Select]
//$update .= ", title = '$title'";
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: crl on February 24, 2012, 05:05:28 pm
Thanks for the updated code.
Before I try out the new code is the description field mandatory with this new code?
Title: Re: Disable title field on Multiple Files Flash Driven upload option?
Post by: Αndré on March 01, 2012, 01:37:05 pm
No, as
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.