Addon to associate more metadata with a thread
OK so I've posted two questions already. This is the last new thread today I promise! This one is a different question.
I'm new here but have been reading about how to write addons.
I'm interested in writing an addon that allows the original poster (just the first person to start a thread) to put some metadata with their post. I know there are tags, but I'm thinking of something more general, and in addition to tags. Like,
- An arbitrary text box (in addition to the title and actual post box, a custom one for a custom purpose)
- A dropdown list of five items (similar to the existing "Category" dropdown, but for a different purpose)
- A set of radio buttons or checkboxes.
All of the above input will be formatted by the addon, and presented in a standardized format as the first post in the discussion thread.
So, instead of a post that just consists of the text as it was typed in the box, the first post would consist of something generated by the addon which may look like this:
Language: ruby Minimum requirements: 0.23.3 Text: [the text the user pasted]
Just the first post is special; then all subsequent comments on this thread will be the regular type of comment with no bells and whistles.
Can anyone offer some pointers?
Thanks,
David
Comments
I'd have a close look at Tagging and other similar-functionality plugins for the hooks you'll want to use since they'll be similar.
If you want to be able to filter/sort by this info later, make each a new column on the GDN_Discussion table. Otherwise, you could store them all in the Attributes field.
I'm sure others will be along with more tips soon.
http://vanillaforums.org/addon/extradiscussiondata-plugin
Thanks Jason and Linc.
Jason,
Your plugin looks great. All I'd have to do is have more than one extra GDN_Discussion columns and modify your plugin a bit.
However I can't get yours to work. Here's what I do. I place the ExtraDiscussionData in my plugin folder, change this line:
to this:
since the extra MySQL column I named "ExtraData1". Then I click Enable your plugin. However I see this message:
Note that ExtraData1 has the following:
I'm not experienced with MySQL so I could be doing something wrong!
I'm using the following config.php file:
Hmm, maybe I should post the question on your ExtraDiscussionData plugins page. I'll post it there instead..
This thread is continued here: http://vanillaforums.org/discussion/comment/225996#Comment_225996
I feel super spammy, but check out Discussion Extender as well: http://vanillaforums.org/addon/discussionextender-plugin
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.