News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

Main Menu

additional fields?

Started by annie, October 11, 2003, 03:30:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

annie

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.

kegobeer

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.
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

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: