Appnitro Software Forums » MachForm 2

entry_data and entry_no in hook


  1. rouven
    Member

    Hi,
    i am trying to use entry_data and entry_no in a post hook function. But I really don't know how. currently i am parsing the complete user_input array to a textfile, but that isn't really beautiful because of the name of the elements. I have to store the output into a file and upload this file via ftp to a remote server.

    cheers,

    rouven

    Posted 3 years ago #
  2. Hi rouven,

    I must say that this would involve a lot of code, since you need to rebuild that entry_data and entry_no variable.

    Check includes/helper-functions.php file, search around line 251 and you'll find send_notification() function.

    Inside that function you'll see how those "variables" being generated.


    MachForm Founder

    Posted 3 years ago #
  3. rouven
    Member

    Now I have my hook ready and just filled a session variable with the content I need. What seems to be more complicated than I thought is the correct placement to call the hook. I just want to call the hook after the review was submitted...
    Thats what I tried:

    if($is_inserted && empty($form_review) && function_exists("form{$form_id}_hook_insert_ftp")){
     call_user_func("form{$form_id}_hook_insert_ftp",$_SESSION['file_input']);
    }

    right before line 1060 at includes/post-functions.php

    But this was never executed...

    Posted 3 years ago #
  4. rouven
    Member

    ok, seems to be the user function:

    [29-Aug-2008 15:29:04] PHP Warning:  call_user_func(form1_hook_insert_ftp) [<a href='function.call-user-func'>function.call-user-func</a>]: First argument is expected to be a valid callback in blubb\includes\post-functions.php on line 2052

    I just replaced the call to the function by the content of the function itselfs and everything seems to work as expected. Also i moved the rows to the commit_form_review function, because that seems to be the position after submitting the review.

    Posted 3 years ago #
  5. well done! commit_form_review is indeed the correct place to put your hook.


    MachForm Founder

    Posted 3 years ago #

RSS feed for this topic

Reply