cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
function process_data
January 26, 2008
6:12 pm
WEBchris
Guest

Please replace the ??? with your data!

  • Your URL: http://???
  • The browser used: ???
  • cforms version: ???
  • Your Wordpress version: ???

Salut!

I want to change, manupilate the datas after sending. I thing i use the function process_data. In help you said that i should change the file 'function.php' of the WP-Theme. I made an own Theme and haven't this file im my folder ../wp-content/themes/own/

Where can i find this file?

Can i change one variable in dependent of an  other? For example for female->Mrs. {name} and for male->Mr. {name}

Is this possible?

Thank you for your help! 

January 26, 2008
6:28 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Sorry in the v7.2 help I wrongly called it function.php, its correct name is functions.php ('s' was missing).

Simply create this file and put it into your theme dir, WP will pick it up automatically. 

There is currently now way to dynamically change your response text (or variables) based on a certain condition (provided by user input).

PS: I just released v7.3, it should help your date picker / Year navigation. 

 

January 27, 2008
1:31 am
WEBchris
Guest

Merci for your help.

Now i have updated my system. The year navigation was a good idea.

To change the resonse text dynamically based on input is that what i looked for. But i don't find any how to's. There is anything on the help pages or where i can find some information how i make this? (syntacs)

 

January 27, 2008
9:02 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Sorry I had a typo above, I meant to say that there no support for this specific requirement. You can not incorporate any Business Logic/Rules or dynamic Workflow into cforms yet.

January 27, 2008
3:13 pm
WEBchris
Guest

Salut Oliver,

no problem that this is not supported. I can also use the process_data function.

But I have some problems:
I create the file'functions.php' and uploaded it in th wp-folder. No problem, the site go on. But the formular-data are not changed. Here my test-code if the functions do.

file <functions.php>:

<?php
///////////////////////////////////////////////
/*                                           */
/*  Post-Processing of cfomsII               */
/*                                           */
///////////////////////////////////////////////

function process_data($cformsdata)
{

    $formID = $cformsdata['id'];

    $form   = $cformsdata['data']; 

 
    if ( $formID == '' ) 

    // 1st form 

    {
        foreach ( array_keys($form) as $key )

       { 
            if ( $key=="Name" )

            // what's the rigt key-word?
            $form[$key] = 'Name-Mr./Mrs. '.$form[$key]; 

            if ( $key=="cf_field_41" )

            // fieldname  the right  key?
            $form[$key] = 'cf_field_41-Mr./Mrs. '.$form[$key];

        }
        // send to 3d party or do something else
    }
}
add_action('cforms_data','process_data');
?>

Can you find any misstakes?

 

January 27, 2008
3:29 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Another misunderstanding, the hook that allows you to receive a copy of the submitted user data and process it in your own function (like yours above) is a one-way street.

Unfortunately, you can't feed back modifications to cforms yet. This was meant to further process user input and do something with it outside of cforms.

But it does bring up a good point, being able to report post-submission changes back to cforms…I'll have to look into that.

Since this would be new/changed  functionality, perhaps we can take it off-line.

(I'll be super busy the next two days, but I'll send you an update via email by mid of next week) 

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
23 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3757

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5356

Posts: 18735

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)