Add custom metadata to forum topics for sorting purposes
[Updates] Well, it worked for a good while, and just when I was good and ready to launch, things went haywire again. I appreciate all who have helped me find my bearings thus far. Hopefully this journey will have a happy ending (without any plot twists )
I’ll try to break down what I’m trying to accomplish as clearly as possible.
1. I want to add custom metadata to forum posts, which I will use to sort form posts into “categories” (using custom loops that will only display posts that contain certain metadata). I’ve been looking at Rate Forum Posts (http://is.gd/oyinad) and I’m struggling to decipher how the author managed to so easily add custom metadata to the bp_bb_meta table. It’s pretty slick stuff. If somebody could point me to the basic idea I’d be very grateful.
2. The user will generate the custom metadata when he or she wants to create a new form post. I will have to customize the forum’s ‘New Topic’ form, to accept the metadata, and insert it into the bp_bb_meta table hen the user submits the form. The metadata consists of a fixed set of values that will be presented as options for the user to choose from via check-boxes and radio buttons. The form must be validated to ensure that the user selected at least one checkbox, and one of the two radio buttons. Again, I’m trying to figure out the basics of modifying the form, as well as form validation.
So here’s what I need my customized installation of BuddyPress to be able to do:
1. User logs in, goes to the forum and types up a new post (standard stuff)
2. User must select at least one of three options from a check list, AND one of two radio buttons. If the user fails to do this, the new post will fail, with an error message, and the user will have to select the required options
3. The form will submit the data to the appropriate tables, including the custom metadata that the user selected
4. The post will be called by the appropriate loop, which will only output posts that contain the required metadata
So, that’s the basic plan. I’m now trying to figure out how to code it. I’ll post my findings here for all to benefit, but I’d really appreciate and hints, tips or pointers. Maybe I’m going about it the wrong way.
Thanks for your time and consideration.
- The topic ‘Add custom metadata to forum topics for sorting purposes’ is closed to new replies.