Form To Forum Post
Hello everyone. I am looking to have a form I have created with a simple questionnaire post to the forum as a “forum post” once the user has submitted it..
Can someone help me out with where to start on this? I know how to post php to a page, just not the bbpress part.
I take it no one has done it with bbpress or has an idea what to do..
Guess I’ll switch to a different forum.
Suspect that not a lot of bbpress people will have done this, and probably none that view this forum.
Basically you just need your form to save the relevant bits to the database as a forum entry.
I’d start by looking at how an entry is stored in the database, and then get your form to do this for you.
Thanks for the reply @robin-w. I have browsed my db files and noticed the bbpress tables are located inside wp_posts?
I figured they would have their own prefixes/tables. Anyways, would you mind showing me an example of how it could post say my html form name as a topic in a bbpress specified forum?
I already have the form setup and know how to post it, although I am not as familiar with sql and such.
Thank you, I appreciate it!
Think this is beyond the scope of a help forum ! It would take me much research and many hours to document.
Suggest you post to
and see if someone will create it for you.
Thanks again @robin-w. I do not feel this needs to be a paid job for a developer. I am just trying to figure out how bbpress inserts data into the tables.
I have manually populated a “wp_posts” table and filled in all the rows as a topic made in the forums shows, although the one I manually added does not show up. I have even got my form to post to specific columns and they still do not show up in the forums.
There must be something simple I am missing.
I guess the developers don’t visit their own forum anymore?
$sql="INSERT INTO wp_posts (post_type, post_parent, post_title, post_content, post_author) VALUES ('$_POST[forum]','$_POST[forumid]','$_POST','$_POST','$_POST')";
This is the code im using to get my form to post to the db, and it still does not create the topic even though it populates
Suspect that there are values in a “forum” post that you need to populate.
I suspect (but don’t know) that the forum will be a category, and the topics will be posts. Therefore you need to link your topic to it’s forum so need to link the post to it’s category.
Try searching round phrases such as “wordpress post category in database” which got me a bunch of articles eg
‘I guess the developers don’t visit their own forum anymore?’ – sounds critical, the developers are busy developing – remember this is all free stuff, and no-one pays their, or indeed my time to do this. They do regularly visit, but I would not expect to get a load of development advice for free to do something that is not in significant demand. Even writing this took ten minutes !
I hope you find a solution, and in the spirit of free open source, post the solution when you get it. I’ll add it to the codex, so that others can benefit.
Thanks @robin W. I understand this is free, just like the millions of other scripts/software online.. What I don’t understand is how such a popular script has no developers support on their forums, or even documentation on how to achieve certain things within their script. I have used plenty of open source scripts, and have always had some type of reply or documentation from a person who knew about it.
I would of course post the solution if I had at least the right documentation to achieve it.
Here is what the wordpress documentation on how to insert a post, and I believe it would be somewhat the same within a bbpress post, but have no idea since it is not documented anywhere that I see.
I’m very new to bbpress but have been working with WordPress for quite a while. I have a WordPress form (displayed using a custom page template) to post solution here: http://pinkishhue.com/an-alternative-to-tdo-mini-forms-for-wordpress/#workingsolution
Perhaps this code could be altered to insert the post as a forum post instead of a regular post? Sounds like it shouldn’t be too complicated (maybe!)
Hope that helps.
– Great – thanks for posting that – I’ll take a look
Do you fancy having a go at seeing if you can get this going for a bbpress entry !
Come back and let us know.
Thanks for posting. I have actually already got the form I created to post as a forum post here..
The next step I need help with is getting multiple fields to post into post_content, like I ask in that thread.
In my form, if you change one of the input names to just “description”, then that will post into post_content. I would like more fields to post though
- You must be logged in to reply to this topic.