PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Set number of submission form per registration users

  1. simbian
    Member

    I know that is possible to set the number of submission form, it is possible to do it for every registered user or i can just set a total counter?

    I explain the scenario. I would put an upload form accessible to only registered Wordpress users, each user could do max 1 upload per day.

    Thanks in advice
    Simone from Italy

    Posted 12 years ago on Friday October 7, 2011 | Permalink
  2. You could use:

    http://codex.wordpress.org/Function_Reference/get_user_meta
    http://codex.wordpress.org/Function_Reference/update_user_meta

    and

    gravity_form()
    http://www.gravityhelp.com/documentation/page/Embedding_A_Form

    as well as

    gform_post_submission
    http://www.gravityhelp.com/documentation/page/Gform_post_submission

    So what you would do is assign a variable to each user's meta using update_user_meta in tandem with gform_post_submission. Once a user has filled out the form, you would write the date to the the user's meta w/ update_user_meta.

    On page load you'd check the value using get_user_meta, if the date in the meta variable isn't the same as the current date, then you'd call the form using gravity_form(), if not you'd make it do something else, like show a message saying they'll be able to submit tomorrow.

    Posted 12 years ago on Friday October 7, 2011 | Permalink
  3. simbian
    Member

    thanks for the reply, i understood the concept but im not so expert about coding, so it isn't easy for me... Could you guide me with a practical sample code?

    thanks again.

    Posted 12 years ago on Friday October 7, 2011 | Permalink
  4. It might look something like this:
    http://pastie.org/private/tbefa5edwkaw5e4o7x0a

    Haven't tested this at all, but it should be more than enough to get you started if it doesn't work out of the box.

    Posted 12 years ago on Monday October 10, 2011 | Permalink