Superb simple hack, it'll come in handy for my website thanks. I had to modify the plugin to work with the vB SSO a little to get it to work but otherwise it works without a hitch. I have this now working on vB 3.8 b1 and MediaWiki 1.13.2.
To get this to work with the vB SSO all you need to do is change the query (appears twice in the XML) from:
Code:
SELECT user_editcount
FROM mw_user
WHERE user.username = user_real_name
to
Code:
SELECT user_editcount
FROM wiki_user
WHERE user.username = user_name
For me wiki_ is my prefix, it may be different for everyone else, the vB SSO however requires you to use user_name rather than user_real_name.
Here's the modified file if you want to add it to the front page AngelBlue, rename the file as you see fit.
Hi,
I have two different databases. One for the main forums and the other for WIKI. The forums database isn't able to see mw_user and I start getting errors like this:
Hi,
I have two different databases. One for the main forums and the other for WIKI. The forums database isn't able to see mw_user and I start getting errors like this:
'forums.mw_user' doesn't exist
Any ideas on how to fix this?
TIA!
mysql can access multiple databases in one query.. so name the database wikidatabasename.mw_user ... also make sure that forums-database-user has access to wikidatabasename .
Is it alright with you if I modify the code, add extras to it, then release for 3.8?
Good that you're taking the lead on this..
some point re 3.8 -
1. Performance improves greatly if there is a(ny) index on real_user_name in the mw_user table. With about 10K users, the database started overrunning max connections and failing the first time hourly cleanup cron job ran (that is what updates the wiki stats).
2. This plugin fails if there are multiple entries for real_user_name (which would happen if you had legacy entries... but it might be better not to make the index unique - might break the linkage. if you fix all the dupes initially, hopefully will not happen again). A way around is to use "SELECT sum(user_editcount) ..... " instead of "SELECT user_editcount ...." in the cron query.
3. the template to be edited for memberinfo is "memberinfo_block_statistics"
wikieditsperday is not showing for some reason (hook location?). the edit i made was:
<li><br>$vbphrase[total_wikiedits]: $userinfo[wikiedits]</li>
<if condition="$userinfo[wikiedits] > 0">
<li><a href="/wikihome/Special:Contributions/$userinfo[username]" rel="nofollow">Click here to see Wiki edits</a></li>
</if>
I'm not the greatest at PHP/MySQL and this would be my first take on something so please don't expect anything for a while (I am an extremely busy person). However I'll be doing plenty of tests on my site first between now and whenever I get to release it. If someone else manages to do it before me then props to them.
I'll try and get a plugin working but please remember, no promises. I will have a bash at it though.