Jump to content

Extension:RandomUsersWithAvatars

From mediawiki.org
Revision as of 22:32, 13 August 2012 by KrenairBot (talk | contribs) (This extension appears to be in SVN, not Git.)
MediaWiki extensions manual
RandomUsersWithAvatars
Release status: stable
Implementation Tag
Description Shows the avatars of randomly chosen wiki users who have uploaded an avatar.
Author(s) David Pean
Jack Phoenix
Latest version 1.1 (20th of December, 2009)
MediaWiki 1.11
License GNU General Public License 2.0 or later
Download Template:WikimediaDownload/svn
Example Halopedia main page (while not logged in)
Translate the RandomUsersWithAvatars extension if it is available at translatewiki.net

RandomUsersWithAvatars parser hook extension displays randomly chosen avatars of your wiki's users on the page wherever you place the tag. For example, <randomuserswithavatars count=15 row=5/> would display a total of 15 avatars, 5 per row.

You need to have SocialProfile installed and configured properly before installing this extension.

It should also be noted that if only one user has uploaded an avatar and no other user has done so, using <randomuserswithavatars> causes a PHP warning about invalid arguments for foreach in the main extension file and no avatars are displayed. For example, if 2 or more users have uploaded an avatar, then this tag will work properly.

It's recommended to add some styling to the output of <randomuserswithavatars> tag, so you can add the following CSS styles into your wiki's MediaWiki:Common.css:

/* Meet the Community */
.random-users-avatars {
	padding: 0px 0px 0px 10px;
}

.random-users-avatars h2 {
	border-bottom: none;
	margin: 0px 0px 0px 0px;
	padding: 7px 0px 8px 0px;
}

.random-users-avatars img {
	border: 1px solid #DCDCDC;
	display: block;
	float: left;
	height: 50px;
	margin: 0px 8px 8px 0px;
	width: 50px;
}

Installation

  1. Download the files from SVN and place them in $IP/extensions/RandomUsersWithAvatars/
  2. Add
    require_once("$IP/extensions/RandomUsersWithAvatars/RandomUsersWithAvatars.php");
    
    into your wiki's LocalSettings.php
  3. Installation can now be verified through your wiki's Special:Version.