Customizing the Comment Form -- Storing new data?

In order to allow my clients to use their galleries as an order form, I've added fields to the comment form so that on each image they can order different print sizes, etc. I've got the front-end all figured out, my question is how do I add these fields to the back-end part of the plugin so that the information is stored and posted?

Also, I tried monkeying with this some yesterday without any luck, but I wanted to basically have two versions of the comment form so that I could have albums open for 'normal' comments as well, without having the order information. What do I need to rename in both files in order to achieve this? This is not as big a deal as the previous question, however.

Comments

  • If you've added the front-end, then you should be able to get the variables from your inputs via the `$_POST` superglobal. The `comment_form` plugin already shows how to do this in `getUserInfo()`. Note that the default plugin uses the filter `save_comment_custom_data` aliased to `comment_form_save_comment` to retrieve the information after it's submitted. What you do with the information after that entirely depends on how you want to use it.

    I would suggest to leave the default `comment_form` plugin how it is. Doing so will help ease Zenphoto upgrades. I would simply rename your custom plugin and move it to the root `plugins` directory. Doing that should allow for both to be used in tandem. Just be careful that the functions are named differently than the default plugin and that any global variables specific to your plugin are unique as well.
  • Thanks for the response!

    A few questions as I'm going over the files. First, something I think I might have missed at first. In the label column, I probably have to use the `` format, right? And then I use the name in `
Sign In or Register to comment.