Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: additional fields?  (Read 4024 times)

0 Members and 1 Guest are viewing this topic.

annie

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
additional fields?
« on: October 11, 2003, 03:30:51 am »

Is there an easier way to create some additional data fields to populate the database when an image is uploaded?

I've been working on both creating new fields (eg "extent") and adding additional user fields (eg "user5").  I've gone through and edited field names and parameters in all the places I can find.  All goes fine...the MySQL picture table gets configured  by schema.sql,  the new field names and labels show up in all the places that it seems they should, but when it comes time to edit photo information, I get the 'Invalid action for form creation' error.

It leads to this bit of code in editpics.php:

<snip>

function create_form(&$data)
{
        foreach($data as $element){
                if ((is_array($element))) {
                    switch($element[2]){
                            case 0 :
                                    form_input($element[0], $element[1], $element[3]);
                                    break;
                            case 1 :
                                    form_alb_list_box($element[0], $element[1]);
                                    break;
                            case 2 :
                                    form_textarea($element[0], $element[1], $element[3]);
                                    break;
                            case 3 :
                                    form_pic_info($element[0]);
                                    break;
                            case 4 :
                                    form_options();
                                    break;
                            default:
                                        cpg_die(CRITICAL_ERROR, 'Invalid action for form creation', __FILE__, __LINE__);
                    } // switch
                } else {
                        form_label($element);
                }
        }
}

</snip>

Can someone enlighten me as to what this is doing, and why it is choking on my extra fields?

Or maybe, even better, point me to some pre-existing code or discussion of adding or modifying data fields for this application.

Many many thanks.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
additional fields?
« Reply #1 on: October 11, 2003, 04:03:26 am »

Have you tried using the four extra fields that cpg comes with?  All you have to do is name them and they will automatically appear.  Take a look in the config menu.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

annie

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
additional fields?
« Reply #2 on: October 11, 2003, 05:12:14 pm »

Yes, I have used the four additional fields without problem, but need more fields for the application I have in mind.  I want to add four more user-named fields, and some six more explicitly-named fields.

I have narrowed the problem down...it occurs when I add additional user-named fields to the existing four.  If I add explicitly-named fields  to the database and to the various arrays in the php scripting, I don't *seem* to have the problem.

It still seems to come down to that bit of code I quoted, and I don't quite know what is going on there.   (As in a couple other aspects of life) :roll:
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 14 queries.