Forum Replies Created

Viewing 15 replies - 481 through 495 (of 808 total)
  • Plugin Author hoffcamp

    (@hoffcamp)

    Lili, you make perfect sense, but what you did is going to prevent you from updating the plugin, since every file is completely rewritten each time, or at least force you to redo the changes you made after each update. Instead I would make a new directory in /wp-content/plugins, something like ‘fm-cp-integration’, and then make a file within that folder, ‘fm-cp-integration.php’, and put the following code in:

    <?php
    /*
    Plugin Name: Form Manager Custom Submission Action
    Description: (your description here)
    */
    
    add_action( 'fm_form_submission' , 'fm_cp_submission_action' );
    function fm_cp_submission_action($args){
    	(your code here)
    }
    ?>

    Then just paste whatever code you want to attach to form submission within the function body.

    The plugins section will now show a ‘Form Manager Custom Submission Action’ plugin. Activate it and you should be all set. This way you won’t have to worry about updates obliterating your changes.

    Plugin Author hoffcamp

    (@hoffcamp)

    I added an action hook, ‘fm_form_submission’, which is called after a form has been submitted, and after the data has been submitted to the database and e-mails are sent. The action function should take a single array as an argument. You should do a print_r of the array to see what you have access to; the top level of the array has two keys, ‘form’ and ‘data’. The ‘form’ key gives you all of the information about the current form stored in the database, and the ‘data’ key is an array containing the processed submission data. You can access the individual form items in the ‘data’ array by their nicknames, if they have them.

    If you have any questions, feel free to ask! I have been out of town for the past few days, so I’ll be around to answer questions faster now.

    Plugin Author hoffcamp

    (@hoffcamp)

    The problem with the ‘select’ functionality as you are trying to use it is that the posted value is always the ‘value’ attribute of the option tag, which in normal usage is just the index of the option. The FM script takes the index and puts the ‘text’ of the option into the database, but your select only has a single dummy option, so that is the problem.

    What you could do is make a form with a ‘text’ form item instead of the ‘list’ type, and then replace it with a select box with JS on the front end. Or make a hidden text, using conditions, and populate this value with a select box. Either way the posted value of the text item will be passed through to the database unchanged (except for stripping HTML tags and security stuff). You could also hook into the ‘submit’ button, as long as you end up calling whatever it is that it calls by default, and use that to post the right value for the text field based on the currently selected option. The only important part of the form items is the ‘name’ of the tag, which is usually the type name followed by a random string. As long as there is a post value associated with that name, everything should be fine.

    I noticed in the code you posted that you are editing the ‘ajax’ version of the form submit, which isn’t used, and should have been removed. I was trying to make a widget for forms, but never finished it.

    Plugin Author hoffcamp

    (@hoffcamp)

    I’m going to change it so the admin won’t receive two e-mails, since its always exactly the same e-mail twice, and it is confusing, and pointless. Thanks for bringing this up.

    Plugin Author hoffcamp

    (@hoffcamp)

    What are the details of your setup, like WP version, etc.? Also, what other plugins do you have installed?

    Plugin Author hoffcamp

    (@hoffcamp)

    You can type in a URL into a text field, but if users post an HTML link the tags will be stripped. I’m guessing you are using the FM plugin to gather the data, and you are putting it into some other format for public viewing?

    Plugin Author hoffcamp

    (@hoffcamp)

    That would be great! send the e-mail to campbell AT campbellhoffman DOT com.

    Plugin Author hoffcamp

    (@hoffcamp)

    The problem in that thread you linked to ended up being something that the WP e-Commerce plugin was doing. Are you using that plugin?

    Also I haven’t tested the latest versions of the plugin on WP 3.0, only 3.2.

    Plugin Author hoffcamp

    (@hoffcamp)

    Sorry I’ve been out of town – I’ll add an action hook for form submission that includes the posted data and information about the current form. I think you mentioned in another post that you wanted something like that, so I’m assuming you are comfortable with PHP & MySQL? That is really the only way I can see this working.

    Plugin Author hoffcamp

    (@hoffcamp)

    For saving, you have to save a new file. I’m not sure if you can do that directly within WordPress. You will need to use FTP. Monster should tell you how to put files on your server via FTP, and a good FTP program is FireFTP for FireFox.

    Unfortunately there isn’t a way to attach PDF or other file types to the e-mails.

    Plugin Author hoffcamp

    (@hoffcamp)

    There is always a blurb of technical information that accompanies a fatal error. Without that information I can’t know where to begin looking to solve the problem. I would really like to help, and I appreciate that going through the hassle of manually deleting a plugin is no fun, but unless you try to activate the plugin again to get the particulars of the error there is not much I can do.

    Plugin Author hoffcamp

    (@hoffcamp)

    I meant the install error message. I know it is a hassle to install and then manually delete the plugin, but I won’t be able to figure out what is wrong without the error message generated when you try to activate the plugin.

    Plugin Author hoffcamp

    (@hoffcamp)

    Could you have one of the generated e-mails sent directly to campbellATcampbellhoffmanDOTcom?

    Plugin Author hoffcamp

    (@hoffcamp)

    I hate to ask you this, but what was the error?

    Plugin Author hoffcamp

    (@hoffcamp)

    Okay, let me clarify some things. You can use summary templates as the e-mail template, but the custom e-mail thing in the advanced tab is something different. The custom e-mail notifications are a layer above the template system, so you can use a summary template within your custom e-mail, along with other things, but not vice versa. I apologize that it is a bit confusing.

    I’ll try to answer the rest of your questions:

    -(get the person’s name) The way to access any of the submission data is via the nickname of the form element, which you can assign under ‘form extra’. If an element has the nickname ‘first-name’, you would put [item first-name] in the custom e-mail box, and fm_summary_get_item_label('first-name') in the summary template.

    -(save the custom template) This might be a bug. You should not save the file as ‘fm-summary-multi.php’, since that is one of the default templates and will be replaced every time you update. If you can’t save the file as something else then this is a bug. How are you saving/uploading the file, and who is your host?

    -(different e-mails per form) You can use the custom e-mail notifications to do this. You probably read this already. The custom e-mails are stored per template, and you can ‘stack’ them, so you can have more than one of these per form (as long as each has their own @start and @end)

    -(just a summary e-mailed to you) If you stack the custom e-mail notifications you can put yourself as the recipient of a simpler e-mail, in addition to the e-mail that goes out to whoever else.

    -(add a pdf) This is not something that can be done. Sorry 🙁 this has been asked for before, so its on the list.

    Let me know how this works for you.

Viewing 15 replies - 481 through 495 (of 808 total)