Extension:SocialRewarding

SocialRewarding extension for MediaWiki
Version: 0.9.1

Date: 2009-05-22

Copyright (C) 2007 Bernhard Hoisl 

This package is the SocialRewarding extension for MediaWiki. The focus is laid on generating benefits for users in order to achieve a higher contribution rate in a wiki system. Therefore, social rewarding mechanisms are implemented to reward people contributing to an online community. In an online community social rewarding is in the majority of cases based on accentuation of the most active members. For example, ranking of users' activities ("top contributors"). In this extension four techniques have been designed: "Amount of References", "Most Viewed Articles", "Rating of Articles", and a "Recommender System". An in-depth explanation of social rewarding methods, their design principles and a technical description can be found in the document named "SocialRewardingDocumentation.pdf" which is included in the package and should be located in the same directory as the extension.

The SocialRewarding extension is licensed under the terms of the GNU General Public License, version 2 or later (see http://www.fsf.org/licenses/gpl.html). You should have received a copy of the GNU General Public License along with this program (have a look at file "SocialRewardingCOPYING").

Installation requirements

 * A web-server (extension was tested on Apache 2.0.54).
 * MediaWiki 1.6 or higher (extension was tested with 1.6.0, 1.6.7, 1.7.1 and 1.10.0; with some little adaptations the extension should work on older versions, too).
 * PHP 4.3 or higher; 5.x is recommended (extension was tested with PHP 4.3.5 and 5.1.4). If you use a PHP version prior 5 social rewarding method "Amount of References" will be disabled automatically because of a nonexistent SOAP interface.
 * A MySQL server, 4.0 or higher (extension was tested with MySQL 4.0.18).

The SocialRewarding extension was developed on Apache 2.0.54 with MediaWiki 1.6.7 and 1.10.0 respectively, PHP 5.1.4 and MySQL 4.0.18.

The extension may work with older software products, but then it can be that not all features are available. However, to minimize problems it is recommended that you always use the latest stable release of all software products.

For security reasons please turn register_globals = Off in your php.ini. Neither MediaWiki nor the SocialRewarding extension need register_globals to be enabled.

Installation

 * Download a copy of the zipped SocialRewarding package.
 * Unpack all files to the extension directory of your MediaWiki installation (e.g. [MediaWikiPath]/extensions/SocialRewarding/).
 * To activate the SocialRewarding extension in MediaWiki you have to edit your [MediaWikiPath]/LocalSettings.php. Insert the following at the end of the file:
 * Configure the SocialRewarding package by editing the file SocialRewardingConfigDetail.php or SocialRewardingConfigShort.php depending whether you would like to have a detailed or only a short description of the configuration parameters. To enable one of the configuration files you have to edit the file SocialRewarding.php and un-/comment lines 43 or 44 where the short and the long version of the configuration files are loaded. The short version is loaded by default. Be sure to have your copy of the SocialRewarding extension configured correctly before moving on to the next step.
 * For setting up social rewarding method Amount of References you have to obtain a license key from http://www.google.com/apis to be able to use Google's SOAP Search API (beta). The license key has to be inserted into the variable $SocialRewarding["references"]["googleKey"] in your configuration file.
 * Now start your favorite web-browser and navigate to the installation script. The URL should be something like http://www.YourWebServer.org/MediaWiki/index.php/Special:SocialRewardingInstall. Alternatively, you can also reach the installation page, if you browse the special pages of your MediaWiki and click on the link called "Social Rewarding: Installation".
 * If you get an error while trying to reach the installation special page you probably have to copy all special pages of this package to the [MediaWikiPath]/includes/ or [MediaWikiPath]/includes/specials/ directory - depending on your MediaWiki version. To identify special pages they are all starting with "SpecialSocialRewarding".
 * Follow the instructions on the installation page. After you completed the installation successfully your SocialRewarding extension should work.

Known issues

 * If you get a bunch of errors after installation about undefined indices, this is normal, and it probably means your running your PHP with display_errors = On. Just switch it off.


 * It's usually better to fix warnings/errors than to hide them. What do you see? —Emufarmers(T 05:36, 13 January 2011 (UTC)


 * I get undefined index errors @ SocialRewardingHooksFunctions.php, lines 72, 226 and 690 - all with the $_GET var. Should be easily reproducible using PHP v5.3.4 (display_errors = On), latest MediaWiki (1.16.1), and just for completeness, MySQL is 5.1.53 (but it shouldn't matter). Happens right after installing. Everything works fine on production server with display_errors = Off.


 * Oh, and Apache 2.2.17


 * Add isset checks:
 * etc.
 * In this case, simply hiding the notices is probably okay, although they'll still appear in your error log and make it more difficult to find actual problems. —Emufarmers(T 19:36, 13 January 2011 (UTC)
 * In this case, simply hiding the notices is probably okay, although they'll still appear in your error log and make it more difficult to find actual problems. —Emufarmers(T 19:36, 13 January 2011 (UTC)


 * Another bug: if MediaWiki is set up to use "ugly URLs" (i.e., index.php?title=Special:Version instead of index.php/Special:Version), SocialRewarding installation fails. This is due to using $_SERVER["PHP_SELF"] on SpecialSocialRewardingInstall.php line 117-119 (not sure which one it was), which doesn't retain GET variables. This happened on my server which I rent for $2, I don't know how common these ugly URLs are. Anyway, here's the fix (put before the first $output= in the get function): And put replace $_SERVER["PHP_SELF"] with $postBackUrl later down the function. Should probably be integrated into the next version. Enjoy


 * Sorry to keep posting bugs here, just not sure how else to report them. I got the following error after making new pages: Fatal error: Call to a member function getId on a non-object in /home/studen43/public_html/wiki/he/extensions/SocialRewarding/SocialRewardingMarkupsFunctions.php on line 54 I fixed it by replacing the entire if($revision) block to the following: if ($revision) { // Only Amount of References from previous revision can be displayed $revision_previous = $revision->getPrevious; if($revision_previous) { $rev_id = $revision_previous->getId; } else { $rev_id = 0; } } else { $rev_id = 0; }


 * $wgMessageCache is not working anymore