Loading...
 

Score Details

Implementation

The field `score` in users_users holds user's total score.

The table tiki_users_score logs events so that users aren't scored twice for same thing

  • user - user's login
  • event_id - an unique id for this event
  • expire - expiration time for this scoring. so that users can earn points per 10 minutes in a chat, for example
  • tstamp - timestamp of this score


Every time the user makes some scoring action, the event will be given a unique id (for example, read_article_10 if he's reading article with id 10). If there is no event for this user with same event id, or if the event has expired, this new event will be logged and the user's score will be updated. TODO: old events (with age configurable) should be erased for performance.

The table tiki_score holds all events and respective punctuation:

  • event - the name of the event. In the previous example 'read_article' would be the event's name.
  • score - number of points for these events
  • expiration - how long, in seconds, before the user can earn points again for the same event. 0 indicates only once.


All events are listed in lib/score/events.php. This file loads the array $events, each element is an array with properties of an event. The properties are, by array index:

0 - dependent features, separated by space or comma. Event will only appear in admin if all features listed here are set to "y".
1 - category name
2 - event name - a string identifier for the event
3 - description, must be inside tra()
4 - default score
5 - default expiration

Elements in $events file are sorted as they appear in admin, they must be grouped by category.

Creating new event


Edit lib/score/events.php and add the new event. Find in code where the event occurs and put the hook:

Copy to clipboard
global $user, $tikilib, $feature_score; // if not in global scope if ($feature_score == 'y') { $this->score_event($user, "EVENT_NAME"); }

Future expansion and ideas


In the future Score and Karma will be integrated in one system. lfagundes aka batawata has some ideas not yet documented, but by now everyone is invited to write here any ideas for these cool features.

Ideas for these cool features

  • Upload/download ratio. It would be nice to see a file gallery upload/download ratio. Maybe this is a "Score" feature, or maybe it's a "Gallery" feature. It's probably familiar to some people as a feature of online bulletin board systems. It encourages people to contribute file uploads. The ratio requirement should only apply to a particular group, and should return a message when the ratio has been exceeded. An option would allow the first download "free." The system could tell the user his ratio, and how many downloads he has available, before he commits to making a download. Download failures, to the extent detectable, would not be counted.

  • Score results in privileges. For example, a user who a member of a basic group and attains a certain minimum score is included in another group that has the download privilege.

  • Score phases out. Here a user's score erodes over time if he doesn't continue to participate. For example, the points for creating a wiki page could have a life of six months and then expire. When combined with the previous item, this user could lose his download privilege because of his inactivity, but could re-establish it by creating another wiki page.

  • Dual Ratings. I like the idea of having two separate ratings, one for karma, one for points. Points could perhaps be redeemed for various stuff for example. Karma should reflect the level of respect for a member regardless of their level of activity. In other words, a casual user can have karma just as good as a power user. I don't think its fair to give those with higher karma greater leverage in doling out karma ratings either.

doc.tiki.org

Get Started

Admin Guide User Guide

Keywords

Keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):

Accessibility (WAI and 508)
Accounting
Articles and Submissions
Backlinks
Banners
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Link Cache
Calendar
Category
Chat
Clean URLs
Comments
Communication Center
Compression (gzip)
Contacts (Address Book)
Contact us
Content Templates
Contribution
Cookie
Copyright
Credit
Custom Home and Group Home Page
Date and Time
Debugger Console
Directory of hyperlinks
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
Draw
Dynamic Content
Dynamic Variable
External Authentication
FAQ
Featured links
File Gallery
Forum
Friendship Network (Community)
Gmap Google maps
Groups
Hotword
HTML Page
i18n (Multilingual, l10n)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
Kaltura video management
Karma
Live Support
Login
Logs (system & action)
Look and Feel
Mail-in
Map with Mapserver
Menu
Meta Elements
Mobile Tiki and Voice Tiki
Module
MultiTiki
MyTiki
Newsletter
Notepad
Payment
Performance Speed / Load
Permissions
Platform independence (Linux-Apache, Windows/IIS, Mac, BSD)
Polls
Profiles
Profile Manager
Report
Toolbar
Quiz
Rating
Feeds
Score
Search engine optimization
Search
Search and Replace
Security
Semantic links
Shadowbox
Shadow Layers
Share
Shopping cart
Shoutbox
Slideshow
Smiley
Social Networks
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Stats
Surveys
Tags
Task
Tell a Friend, alert + Social Bookmarking
TikiTests
Theme CSS & Smarty
Tiki Manager
Trackers
Transitions
User Administration including registration and banning
User Files
User Menu
Watch
WebDAV
Webmail
Web Services
Wiki History, page rename, etc
Wiki Syntax
Wiki structure (book and table of content)
Workspace
WSOD
WYSIWYCA
WYSIWYG
XMLRPC

Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki