New plugin: disable points for accepted self-answers

Post date: 2020-08-10 01:25:31
Views: 108

Q2A can award points for accepting answers, but it does so indiscriminately, even if the accepted answer is from the user posting the question. For my own Q2A forum I wanted the person accepting an answer to be awarded points only if they accepted someone else's answer, so that users wouldn't game the system by posting lots of trivial questions and accepting their own answers (not that I'd have to worry about people doing that ATM, but anyway).

Initially I simply patched the respective query in qa-include/db/points.php, but that is suboptimal as the change doesn't survive software updates. So I wrote a plugin for this as finger practice while I'm learning PHP:

https://github.com/ansgarwiechers/q2a-no-self-accept-points

Enjoy.

The plugin overrides the function qa_db_points_calculations(). If there is a better way of doing this: feel free to suggest.

Please click Here to read the full story.
 
Other Top and Latest Questions:
Movie: Spy x Family Code: White
Ripley: VI - Some Heavy Instrument
Frieren: Beyond Journey's End: Well-Laid Plans
South Carolina coach Dawn Staley says women's basketball will get 'better and better'
Israel's war Cabinet is locked between restraint and revenge
Volkswagen union vote in Tennessee to test UAW's power after victories in Detroit
The salary a single person needs to live comfortably in every U.S. state
Meaningful birthday gift for 10yo (first of series) ?
Treasury Department plans to impose new sanctions on Iran after Israel attack
Dr. Martens shares plunge 30% to all-time low, trading briefly halted on weak outlook