Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Is it safe to add a custom column to qa_userpoints? (for plugin)

0 votes
65 views
asked Jul 4 in Plugins by q2apro

I am on the way to develop a plugin to grant extra points for question edits.

The recent (q2a 1.8.0) point system can be overridden, but it is not that easy to customize. Here are gidgreen's replies from the past:

1. http://www.question2answer.org/qa/14516/adding-a-new-type-of-custom-points-via-plugin
2. http://www.question2answer.org/qa/4312/modify-the-point-system

add a custom column to qa_userpoints via your module's init_queries(...) function and then override qa_db_points_calculations(...) in qa-db-points.php to add in the extra calculation based on that custom column.

It was done already with one plugin: https://github.com/arjunsuresh/q2a-betterpoints

Is that foolproof and future safe? Probably adding a prefix to the colum, e.g. q_editpoints?

Q2A version: 1.8.0

1 Answer

0 votes
answered 4 days ago by q2apro
Answering myself:

I added the extra column.

I added the additional calculation. (However, very limited, only 1 kind of query possible for getting the points!)

Works.

See example implementation of https://github.com/arjunsuresh/q2a-betterpoints to implement it yourself.
...