Help:Implementing a "Semantic Point System"

My community using Semantic MediaWiki was looking for a point system that we could enable. The goal was to provide users with points for creating, editing and encouraging the contributions of others. I didn't want to use an extension, but thought I could instead use the data from the Semantic Extra Special Properties extension to make it happen.

The planned point system
The community decided on a simple point system to start
 * 5 points for every page creation
 * 1 point for every 10 page edits
 * 5 points for each additional user who contributes to a page you created

The last piece: Points for each additional user who contributes to a page you created was the most complicated and I needed to use the Template Result format with intro and outro Templates to calculate that number.

Result Format Templates
You will need to create your result format templates first. The query format templates have variables inside them that will be referred to on the point system template itself:


 * Template "Query Format/Author count"


 * Template "Query Format/Author count intro"


 * Template "Query Format/Author count outro"

Creating the Point Template Itself
The point template itself was designed to go on user pages, and will use the magic word BASEPAGENAME. It doesn't work when added to user subpages at this time. I broke the Template up into 3 sections, to better explain the process. The three sections of code below should be pasted one after the other.

The first thing the template does is define a set of variables used to calculate the user's points. Each variable is retrieved from the Extra Special Properties through either #ask or #show functions.

Create Template:User points with the following code

The next part of the Template executes the math based on the point system I defined above. If you want to make adjustments to the system to award different point values, you can swap out the whole numbers in the expressions for your own. Paste this immediately after the code above:

To display the points on the page, I went with a side box. Here's where you can feel free to be creative. I opted to go with a tiered point system that would display a different image at each level. I also added information into the display on how points are earned along with the final point count. I wanted to added a property for that point value so I could use it in queries to generate user leaderboards etc.

Hopefully, someone find this template useful or gets their own ideas from it.