开发者

Work out percentage of change done by one person on MediaWiki

I would like to work out the percentage of editing/change that one person has done to one article, so I can send out donations accordingly.

How do I do开发者_如何学C this automatically? (preferably in PHP)


The editing history is stored in the revision table. If you have the page-id you can get the percentage of user edits by page (just replace the 1 with the page-id):

SELECT
    rev_user, rev_user_text,
    count(*) as rev_user_count,
    (SELECT count(*) FROM revision WHERE rev_page = 1) as rev_total_count,
    100 * count(*)/(SELECT count(*) FROM revision WHERE rev_page = 1) as rev_percent
FROM revision
WHERE rev_page = 1
GROUP BY rev_user
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜