Extension:SocialProfile

From MediaWiki.org

Jump to: navigation, search

                 

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
Social Profile

Release status: stable

SocialProfile.png
Implementation  Special page, Database, Ajax
Description Incorporates a basic social profile into a MediaWiki, specifically Avatars, Friending, Foeing, User Board, Board Blast, basic Profile Information, User Levels, Awards and Gifts.
Author(s)  David Pean, Aaron Wright and Jack Phoenix
Last Version  1.4 (June 10, 2009)
MediaWiki  1.14
License GPL 2.0
Download Download snapshot

Subversion [Help]
Browse source code

Example  Halopedia

check usage (experimental)

SocialProfile extension will incorporate a social profile, user board, and basic profile information into MediaWiki, specifically Avatars, Friending, Foeing, User Board, Board Blast, basic Profile Information, User Levels rank system, Awards and Gifts. The package also notifies users via email when other users request them as a friend or foe and/or sends them a message. The package was developed by Wikia, Inc.

You'll need MediaWiki 1.14 or newer for this extension. Everything else required by SocialProfile is included in the package already.

If you are upgrading from SocialProfile version 1.2 or older, you'll need to create four new database tables manually: gift, system_gift, user_gift and user_system_gift. If you're upgrading from 1.3, you'll need to create user_system_messages database table.

Contents

[edit] Screen Shots

[edit] Avatars

Users can upload an avatar which will appear on profile pages and user board posts. Administrators (or other users with the avatarremove privilege) can remove offensive or inappropriate avatars through Special:RemoveAvatar.

Spavatars.png

[edit] Profile Page

Users will have a profile page, which displays friendships with other users, basic profile information, and any public messages they received.

Spprofile.png

[edit] Editing Profile Information

Users can update their profile information with a simple form.

Spprofileupdate.png

[edit] User Board

You can send public or private messages to other users with the User Board. The User Board supports wiki text and also has conversation threads between users.

Spboard.png

[edit] Board Blast

Users can send messages to multiple friends or foes using Board Blast.

Spboardblast.png

[edit] Installation

To install SocialProfile extension, please follow the steps below.

[edit] Copy All Necessary Files into the Extension Folder

First, copy all files into the extensions folder, maintaining the current file structure. For example:

svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SocialProfile/ SocialProfile

If you install the folder in a different location please change any path references below.

[edit] Create database tables

Run the script 'install.php' from the command line (Database superuser has to be mentioned in AdminSettings.php)

[edit] LocalSettings.php

Open LocalSettings.php in your favourite non-Windows Notepad text editor and add the following lines:

require_once("$IP/extensions/SocialProfile/SocialProfile.php");
$wgExtraNamespaces[NS_USER_PROFILE] = 'User_profile';
$wgExtraNamespaces[NS_USER_WIKI] = 'UserWiki';

If $wgExtraNamespaces has already been defined in the file, you need to throw the above two namespace declarations into that array, like this:

$wgExtraNamespaces = array(
	110 => 'Custom_namespace',
	111 => 'Custom_namespace_talk',
	NS_USER_PROFILE => 'User_profile',
	NS_USER_WIKI => 'UserWiki',
);

[edit] Directories

The following directories should exist under the wiki's $wgUploadDirectory:

  • avatars/ — the directory where all user-uploaded avatar images are stored
  • awards/ — system gift (award) and normal gift images will be stored here

Please read below for more info.

[edit] Add Default Avatar Images

Please move the directory avatars from extensions/SocialProfile for images used in your MediaWiki installation. This directory should be writeable.

[edit] Add Awards Folder

Please move the directory awards/ from extensions/SocialProfile for images used in your MediaWiki installation. This directory should be writeable. The images included in this folder by default can be used for awards if you upload them through Special:SystemGiftManagerLogo, but they won't show up as "defaults" the same way avatar default images do show up.

[edit] Update MediaWiki source code

In the past, you had to register AJAX functions by editing /includes/AjaxFunctions.php. This is no longer necessary as of version 1.3.

If you're using an older version of SocialProfile, the following lines should be present in your /includes/AjaxFunctions.php file:

global $IP;
require_once("$IP/extensions/SocialProfile/UserBoard/UserBoard_AjaxFunctions.php");
require_once("$IP/extensions/SocialProfile/UserRelationship/Relationship_AjaxFunctions.php");

[edit] Settings

Some features will not work without additional modifications, but if chosen by the site admin, may be left out.

[edit] Friends/Foes

To enable friends/foes to display on the user page, the following additions need to be made to LocalSettings.php:

The following settings should be placed directly under the require_once line:

$wgUserProfileDisplay['friends'] = true;
$wgUserProfileDisplay['foes'] = true;

[edit] Board

To enable the Board to display on the user page, allowing users to view messages posted, the following additions need to be made to LocalSettings.php:

The following settings should be placed directly under the require_once line:

$wgUserBoard = true;
$wgUserProfileDisplay['board'] = true;

[edit] User-specific statistics

To enable per-user statistics that show up on the profile pages, add the following into your wiki's LocalSettings.php:

$wgUserProfileDisplay['stats'] = true;

[edit] Points/rank system

User Levels show on the users' profile pages and on various other places across the wiki. This feature is available from SocialProfile version 1.1 onwards (rev:37590).

Note that this feature must be correctly configured, or it can interfere with other features, such as avatar upload and messaging. See the discussion on the talk page.

To enable User Levels, add something like the following into your wiki's LocalSettings.php, after calling SocialProfile.php:

require_once("$IP/extensions/SocialProfile/UserStats/EditCount.php"); // Necessary edit counter
// The actual user level definitions -- key is simple: 'Level name' => points needed
$wgUserLevels = array(
	'Recruit' => 0,
	'Apprentice' => 1200,
	'Private' => 1750,
	'Corporal' => 2500,
	'Sergeant' => 5000,
	'Gunnery Sergeant' => 10000,
	'Lieutenant' => 20000,
	'Captain' => 35000,
	'Major' => 50000,
	'Lieutenant Commander' => 75000,
	'Commander' => 100000,
	'Colonel' => 150000,
	'Brigadier' => 250000,
	'Brigadier General' => 350000,
	'Major General' => 500000,
	'Lieutenant General' => 650000,
	'General' => 800000,
	'General of the Army' => 1000000,
);

You may also want to configure the actions the for which points are being awarded. By default, 50 points are awarded on a main namespace edit. The defaults are:

$wgUserStatsPointValues['edit'] = 50; // Points awarded on a main namespace edit
$wgUserStatsPointValues['vote'] = 0; // Points awarded for voting for an article
$wgUserStatsPointValues['comment'] = 0; // Points awarded for leaving a comment
$wgUserStatsPointValues['comment_plus'] = 0; // Points awarded if your comment gets a thumbs up 
$wgUserStatsPointValues['comment_ignored'] = 0; // Points awarded if another user ignores your comments
$wgUserStatsPointValues['opinions_created'] = 0; // Points awarded for writing a blog article
$wgUserStatsPointValues['opinions_pub'] = 0; // Points awarded for having that article hit the "Blogs" page
$wgUserStatsPointValues['referral_complete'] = 0; // Points awarded for recruiting a new user
$wgUserStatsPointValues['friend'] = 0; // Points awarded for adding a friend
$wgUserStatsPointValues['foe'] = 0; // Points awarded for adding a foe
$wgUserStatsPointValues['gift_rec'] = 0; // Points awarded for receiving a gift
$wgUserStatsPointValues['gift_sent'] = 0; // Points awarded for giving a gift
$wgUserStatsPointValues['points_winner_weekly'] = 0; // Points awarded for having the most points for a week 
$wgUserStatsPointValues['points_winner_monthly'] = 0; // Points awarded for having the most points for a month 
$wgUserStatsPointValues['user_image'] = 1000; // Points awareded for adding your first avatar 
$wgUserStatsPointValues['poll_vote'] = 0; // Points awarded for taking a poll
$wgUserStatsPointValues['quiz_points'] = 0; // Points awarded for answering a quiz question 
$wgUserStatsPointValues['quiz_created'] = 0; // Points awarded for creating a quiz question 
$wgNamespacesForEditPoints = array(0); // Array of namespaces for that can earn you points. Use numerical keys. Default is 0 -- only main namespace edits can earn a user points.

Most of the above require separate Wikia extensions to be installed and configured. However, there are actions for which you can give out points without installing separate extensions. These actions are:

  • editing ($wgUserStatsPointValues['edit'])
  • friending another user ($wgUserStatsPointValues['friend'])
  • foeing another user ($wgUserStatsPointValues['foe'])
  • uploading your first avatar ($wgUserStatsPointValues['user_image'])
  • sending a gift ($wgUserStatsPointValues['gift_sent'])
  • receiving a gift ($wgUserStatsPointValues['gift_rec'])

Even if you didn't want to change the defaults, you might need to re-define one $wgUserStatsPointValues variable after including EditCount.php and defining $wgUserLevels. You could just add the following default to your wiki's LocalSettings.php, assuming that you don't want to change it:

$wgUserStatsPointValues['edit'] = 50;

After UserLevels is configured, you might want to visit Special:UpdateEditCounts to initialize the points (requires you to have the updatepoints user right). You should also visit this page every time after changing $wgUserStatsPointValues.

The list of users with the most points can be seen at Special:TopUsers.

[edit] New Configuration Variables Introduced in 1.3

  • $wgUserGiftsDirectory — path to UserGifts files. Defaults to $IP/extensions/SocialProfile/UserGifts.
  • $wgUserGiftsScripts — similar to the above. Defaults to $wgScriptPath/extensions/SocialProfile/UserGifts.
  • $wgSystemGiftsDirectory — path to SystemGift files. Defaults to $IP/extensions/SocialProfile/SystemGifts.
  • $wgSystemGiftsScripts — Defaults to $wgScriptPath/extensions/SocialProfile/SystemGifts.
  • $wgFriendingEnabled — whether to enable friending or not. Not really effective, don't rely on it.
  • $wgMaxCustomUserGiftCount — maximum number of private custom gifts that a user may create. If not set (as per default), normal users cannot access Special:GiftManager, only those with giftadmin privileges can access it. Please note that when this is set, users can create their own gifts but they cannot delete them.
  • $wgGiveGiftPerRow(description needed)

[edit] New Special Pages in 1.3 release

  • Related to SystemGifts a.k.a the award functionality:
    • Special:TopAwards — lists the awards that have been given out the most times.
    • Special:ViewSystemGifts — a special page for viewing all of your own awards.
    • Special:ViewSystemGift — not meant to be accessed directly.
    • Special:SystemGiftManager — allows to add and remove awards, requires the awardsmanage right.
    • Special:SystemGiftManagerLogo — allows to upload award images which will be stored in the awards folder. Restricted to users with the awardsmanage right.
    • Special:PopulateAwards — a special page to give out awards. Restricted to users with awardsmanage right.


  • Related to UserGifts a.k.a user-to-user gifting functionality:
    • Special:GiveGift — a special page that allows you to give a gift to another wiki user.
    • Special:ViewGifts — a special page for viewing all your own gifts.
    • Special:ViewGift — not meant to be accessed directly.
    • Special:GiftManager — allows to add, remove and modify gifts. Restricted to users with the giftadmin right or all logged-in users if $wgMaxCustomUserGiftCount is set.
    • Special:GiftManagerLogo — allows to upload new gift images, restricted to users with the giftadmin right.
    • Special:RemoveMasterGift — allows to remove a gift completely, restricted to users with giftadmin right.
    • Special:RemoveGift — allows an individual user to remove a gift given to him/her.

[edit] Restricted Special Pages

Certain special pages introduced by SocialProfile extension are restricted to the staff user group by default. To enable access to the special page Special:PopulateUserProfiles, create a user group called staff and add yourself into the group.

If you do not want to create such a user group however, you can manually edit the file extensions/SocialProfile/UserProfile/SpecialPopulateUserProfiles.php.

[edit] Custom Information

The titles of the custom text input boxes can be changed, via the pages:

  • MediaWiki:Custom-info-field1
  • MediaWiki:Custom-info-field2
  • MediaWiki:Custom-info-field3
  • MediaWiki:Custom-info-field4

[edit] Logging

SocialProfile adds two logs: avatar log (Special:Log/avatar), which tracks avatar image uploads and user profile log (Special:Log/profile), which tracks changes to users' social profiles. Since version version 1.1 (rev:37590), avatar and profile logs can be hidden from the recent changes as they tend to flood the recent changes list quickly.

To turn off the display of avatar uploads, set:

$wgUploadAvatarInRecentChanges = false;

To turn off the display of user profile changes, set:

$wgUpdateProfileInRecentChanges = false;

Both of these variables are pre-set to false in version 1.1.

[edit] Permissions

  • avatarremove — allows access to Special:RemoveAvatar, it allows removal of others' avatars. Given to 'sysop' and 'staff' groups by default.
  • awardsmanage — allows access to Special:PopulateAwards and Special:SystemGiftManager. Given to 'awardsmanage', 'sysop' and 'staff' groups by default.
  • giftadmin — allows access to Special:GiftManager. Given to 'giftadmin', 'sysop' and 'staff' groups by default.
  • updatepoints — available since r50604. Users with this right are allowed access to Special:UpdateEditCounts. By default no group has this right.
  • userboard-delete — available since r50565. Users with this right can delete other users' board messages. By default no group has this right.

[edit] Developer Info

Please see Extension:SocialProfile/For developers for info on how to develop SocialProfile, submit patches and more.

[edit] Reporting software bugs

Bugs and issues can be reported on the talk page:

http://www.mediawiki.org/w/index.php?title=Extension_talk:SocialProfile&action=edit&section=new

or on the MediaWiki Bugzilla (select SocialProfile as the component):

https://bugzilla.wikimedia.org/enter_bug.cgi?product=MediaWiki%20extensions

[edit] Licensing and downloads

The extension is available under the GNU General Public License 2.0 or later, and the newest version can always be downloaded from MediaWiki SVN:

http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/SocialProfile/

Older releases of SocialProfile extension can be also downloaded from MediaWiki SVN and they are located in the tags/extensions/SocialProfile/ directory:

http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/SocialProfile/

The software is provided as-is. Updates will be made when critical vulnerabilities are discovered.