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.
Conditionally Locking Comments
So, I wrote a Dice Roller plugin for the forums and want to add a bit of functionality that basically does something like this:
This is to ensure that once people roll dice in the forum, they can't change those posts.
I've been digging through some of the source code but haven't seen any sort of property / flag I can set.
Is this doable in Vanilla 2? If so, does anyone have recommendations for which source files to check or do you know which properties can be set?
As a last resort, I guess I could add a column to the Comment table that's "DiceRolled" and just manually set / get / check that in the Discussion Controller / Model.
Thanks!
John
If (DiceRolled){
Comment.Editable = False;
Comment.Deletable = False;
}
This is to ensure that once people roll dice in the forum, they can't change those posts.
I've been digging through some of the source code but haven't seen any sort of property / flag I can set.
Is this doable in Vanilla 2? If so, does anyone have recommendations for which source files to check or do you know which properties can be set?
As a last resort, I guess I could add a column to the Comment table that's "DiceRolled" and just manually set / get / check that in the Discussion Controller / Model.
Thanks!
John
Tagged:
0
Comments
However, there are no "magic events" to hook into. The Comment function is pretty big and significant, so it doesn't seem wise to override it on a plugin for such a small piece of functionality.
Does anyone know if there is a way to get the developers to add a magic event to the main code base?
I would love a BeforePermissionCheck event or something like that so we could set the $CanEdit variable. It would need to be between the current lines 308 and 309.
Thanks!