Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Plugin hook for discussion posts?
R3OATH
New
Hey guys and girls.
I'm trying to write a fairly simple plugin for a community site I'm developing, and I need to fire an event/hook when a user posts a new discussion. This will update a few fields in our own DB. I've tried having a look through the source, but I was unable to find the function that deals with the actual posting. Unless I'm currently blind, which may be the case haha. Any pointers in the right direction or the function name I need to hook up in my plugin?
Thank you in advance,
Tristan.
0
Comments
You need to hook the model, in MVC system is the model that is associated with database entry.
The model concerned is the DiscussionModel, the events you could use are BeforeSaveDiscussion, and AfterSaveDiscussion (look in /application/vanilla/models/class.discussionmodel.php)
e.g
grep is your friend.
Thank you x00, exactly what I needed!