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.

BuddyPress Forums

  1. I'm trying to figure out how to use an embedded GF to replace the form that BP members use to create forum topics. The reason is I want to have them upload a document and have this stored on the GF entries unseen by forum members but to show the topic title, comment and tags. Can anyone point me in the right direction?

    Posted 13 years ago on Monday August 15, 2011 | Permalink
  2. I haven't used BuddyPress in a while but I believe BuddyPress themes typically have a theme file for the registration form, sometimes it's register.php, with the form within it. You have to edit that and remove the default form and implement a Gravity Form via the appropriate function call.

    Posted 13 years ago on Monday August 15, 2011 | Permalink
  3. Thanks Carl,

    There's an index file in the forums that controls forum submissions, and while I've integrated a GF into it and it works fine in posting to the BP forum by using the field values I need, I can't get the form to register an entry at the same time. I guess the question is, is it possible to take the values from a GF, post to the forum and also have the form work as normal.

    Peter

    Posted 13 years ago on Monday August 15, 2011 | Permalink
  4. I just realized you are wanting to use Gravity Forms to replace the BuddyPress forum post form... NOT the registration form. I'm not 100% sure how you would do that. I'm sure it's possible but out of the box Gravity Forms doesn't create BuddyPress forum posts.

    It is possible but you would have to write a customization to do this, it's not something it does out of the box. You would have to use the gform_post_submission hook to take the form data and create a post. You'd have to know how to use code to create a BuddyPress forum post and you'd have to write the custom code to do so.

    Posted 13 years ago on Monday August 15, 2011 | Permalink
  5. Carl,

    Yes, I figured that it would be the post_submission hook that takes the form data and I'm almost there with that.

    Peter

    Posted 13 years ago on Tuesday August 16, 2011 | Permalink
  6. Carl,

    I'm sorry but using the gform_post_submission hook in the form of your examples (with the 10,2 arguments) I'm getting a "missing argument 2" error. Any help appreciated.

    add_action("gform_post_submission_1", "collect_fields", 10, 2);
    function collect_fields ($entry, $form){

    ...

    Posted 13 years ago on Tuesday August 16, 2011 | Permalink
  7. Please post the code you are trying to implement to http://pastie.org and then post a link to the code here so we can look at your code.

    Posted 13 years ago on Tuesday August 16, 2011 | Permalink
  8. I am getting the same error. It is only accepting one argument which is the $entry. I am no longer getting the $form array and I am not sure what changed.

    Thanks.

    Posted 13 years ago on Wednesday August 17, 2011 | Permalink
  9. See above. Post your custom code on http://pastie.org and provide a link to it so we can see your code. I can't see what you are doing wrong without being able to see the code.

    Posted 13 years ago on Wednesday August 17, 2011 | Permalink
  10. Carl,

    I created this action in my theme's functions.php just to check I can get the form data:

    add_action ("gform_post_submission_1", "collect_fields", 10 , 2);
    						function collect_fields ($entry, $form){
                                                    $entrydate = $entry["date_created"];
    						echo $entrydate;
    						}

    and called it after the form submission with

    <?php do_action ('gform_post_submission_1') ?>

    and get the 'missing argument 2 for collect_fields ( )' error. Apologies for being dumb.

    Posted 13 years ago on Wednesday August 17, 2011 | Permalink
  11. Hi Peter,

    You do not need the do_action("gform_post_submission_1") as Gravity Forms will handle triggering this action at the appropriate time when the form is submitted. This is likely why you are getting the error.

    Posted 13 years ago on Wednesday August 17, 2011 | Permalink
  12. You don't need both the do_action and the add_action. You need one or the other.

    You should remove the <?php do_action ('gform_post_submission_1') ?> since it's not correct.

    What line number is the error thrown on, and which line in functions.php is that?

    Posted 13 years ago on Wednesday August 17, 2011 | Permalink
  13. You're right of course...no error now but I can't seem to get the function to echo the $entrydate after the form is submitted. Thanks for the real-time support.

    Posted 13 years ago on Wednesday August 17, 2011 | Permalink
  14. You would not typically echo the results from functions.php. You probably want to return the results, then echo them in your template where you want them displayed.

    I don't think I'm clear on which part of the problem we're trying to solve here. You're making progress but I think I missed some of the interim steps. Where are you stuck exactly? What are you trying to do with $entrydate? You're just trying to set $entrydate to $entry["date_created"], but then what are you doing with it? I think you need to return it, then echo it in your template (or maybe insert it with the bbPress topic/reply.)

    Posted 13 years ago on Thursday August 18, 2011 | Permalink
  15. Chris,

    Thanks. The bigger problem here is to use a GF to create a new forum topic post in addition to storing entries in the usual way. As a newcomer to this I was trying to figure out whether I can construct the topic post using gform_post_submission and ran into the issue of how to return results - it wasn't obvious to me not to use do_action after creating the add_action.

    As you can tell, I'm not a developer and would be happy to save myself (and you) some time if you would like to quote me to create that code to plug into BP.

    Posted 13 years ago on Thursday August 18, 2011 | Permalink
  16. Chris,

    Do you have a suggestion for who can help with this?

    Peter

    Posted 13 years ago on Monday August 22, 2011 | Permalink
  17. Sure Peter. Here is a recent suggestion from Carl regarding consultants who are familiar with Gravity Forms.

    http://www.gravityhelp.com/forums/topic/help-customizing-gravity-form-image-upload-functionality#post-32767

    Posted 13 years ago on Monday August 22, 2011 | Permalink
  18. Thanks, Chris.

    Posted 13 years ago on Monday August 22, 2011 | Permalink

This topic has been resolved and has been closed to new replies.