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.
Thank only possible for writer topic
jackmaessen
✭✭✭
I have a question about this plugin. I am trying to find a solution that only the topic writer can thank for a comment.
So in his own topic, he is the only one who can thank on comment of other comment writers.
I think there should be added something in this piece of code (class.thankfullpeople.plugin.php):
if ($AllowThank) { static $LocalizedThankButtonText; if ($LocalizedThankButtonText === Null) $LocalizedThankButtonText = T('ThankCommentOption', T('Thank')); $ThankUrl = 'plugin/thankfor/'.strtolower($Type).'/'.$ObjectID.'?Target='.$Sender->SelfUrl; $Option = '<span class="Thank">'.Anchor($LocalizedThankButtonText, $ThankUrl).'</span>'; echo $Option; //$Sender->Options .= $Option;
I just don't know how to catch the topic writer only
0
Comments
I don't know the source, but you would have to
a) not show the possibility to thank any more for all discussions
b) show possibility to thank and allow thanking only to discussion author by checking everytime it is displayed and thanks are written to db
(This code is not tested and simply a draft for you to find your way, young Jedi)
this is the complete function in which the text Thank is parsed in the meta
While you are looking at changing the plugin, you could even improve your version
Look at that: https://github.com/vanilla/vanilla/blob/2.1/applications/vanilla/views/discussion/helper_functions.php#L126-128
Replace function "AfterCommentMeta" by "CommentInfo" so that it will work with Vanilla 2.3
Then look at what useful information is in the EventArguments: https://github.com/vanilla/vanilla/blob/2.1/applications/vanilla/views/discussion/helper_functions.php#L66-74
$Type will now always be "Comment" and $Object is the Comment.
Line 31 and 40 tell me that there are functions PluginController_ThankFor_Create and PluginController_UnThankFor_Create exist which do the real job. You have to do the check here again, otherwise people could simply write yourforum/plugin/thankfor/comment/100 in their address bar in order to thank for any comment.