forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 upload => Topic started 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
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?
-
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?
-
Just want to delete the "Title" field only after the images have been uploaded. I want to retain the description field
-
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.
-
Added the script change.
But the multi flash upload option still shows the title field after the photo is uploaded.
-
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
$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'";
-
Thanks your new code worked perfectly :D
-
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.
-
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?
-
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
$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'";
-
Thanks for the updated code.
Before I try out the new code is the description field mandatory with this new code?
-
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.