Extension:RandomUsersWithAvatars

From MediaWiki.org

Jump to: navigation, search

           

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

Release status: stable

Implementation  Tag
Description Shows the avatars of randomly chosen wiki users who have set an avatar for themselves.
Author(s)  Wikia, Inc. (New York Team)
Last Version  1.0 (1st of July, 2008)
MediaWiki  1.11
License No license specified
Download SVN (browse)
Example  Halopedia main page (while not logged in)

check usage (experimental)

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 Extension: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;
}

[edit] 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.