changeset 33:536903c5733c 1.4.0 1.4.1

* Update to v1.4 then v1.4.1 for release * Update to latest XSL * Rename Install.xml to install.xml because validation became picky about the capitalisation * Fix the spacing on one find * Re-include v1.3.6 changes no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Mon, 02 Aug 2010 19:30:31 +0000
parents 92e983461432
children b42dcaaed003
files Install.xml contrib/Upgrade-1.2.4.xml contrib/modx.prosilver.en.xsl install.xml modx.prosilver.en.xsl subsilver2.xml
diffstat 6 files changed, 2264 insertions(+), 1463 deletions(-) [+]
line wrap: on
line diff
--- a/Install.xml	Sat Mar 20 16:49:45 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1242 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
-<!--For security purposes, please check: http://www.phpbb.com/mods/ for the
-      latest version of this MOD. Although MODs are checked before being
-      allowed in the MODs Database there is no guarantee that there are no
-      security problems within the MOD. No support will be given for MODs not
-      found within the MODs Database which can be found at
-      http://www.phpbb.com/mods/-->
-<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.3.xsd">
-	<header>
-		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
-		<title lang="en-gb">Multi-race rank themes</title>
-		<description lang="en-gb">This MOD will allow you to add, modify and remove rank themes.
-
-Rank themes are selectable collections of ranks that normal users can choose to use, allowing RPG forums to have different 'races' or allowing 'normal' forums to provide an set of alternative icon images for their users.
-
-Note that users with "special ranks" (normally Administrators etc.) will not get a theme selection in the UCP as the special rank is their rank theme. If users with special ranks want a themed rank image then you need to also install my "Special and Normal Rank Images" MOD.</description>
-		<author-notes lang="en-gb"><![CDATA[The following description is taken from digiTsai's phpBB2 'Rank themes' mod (with some minor modifications in the last paragraph), as I couldn't word it any better myself:
-
-Different ranking themes for your forum. Users are allowed to choose a ranking theme to their liking. For example, you can add two ranking themes named "Good" and "Evil" for your forum. The ranking then might look like this:
-
-Posts	| Good   | Evil
-Needed	| Ranks  | Ranks
-=========================
-0       | Knight | Zombie
-10      | Priest | Minion
-20      | Zealot | Demon
-50      | Angel	 | Devil
-
-So if one were to choose the "good" ranking, then he/she will go through the ranks Knight, Priest, Zealot, and finally Angel, but another user might decide to choose the "Evil" theme, he/she will go through the ranks Zombie, Minion, Demon, then Devil.
-
-On install, there are two ranking themes already added, "special" and "default". Ranks classified as special cannot be chosen by the public and will continue to override any rank theme selection, as is the phpBB3 default behaviour. The default ranking theme is the one a newly registered user has (unless they choose something else).
-]]></author-notes>
-		<author-group>
-			<author>
-				<realname>IBBoard</realname>
-				<email>phpbb@ibboard.co.uk</email>
-				<username>IBBoard</username>
-				<homepage>http://www.ibboard.co.uk</homepage>
-			</author>
-		</author-group>
-		<link-group>
-			<link type="template" href="subsilver2.xml" lang="en-gb">subsilver2</link>
-			<link type="contrib" href="contrib/Upgrade-1.2.4.xml" lang="en-gb">Upgrade instructions from v1.2.4</link>
-		</link-group>
-		<mod-version>1.3.6</mod-version>
-		<installation>
-			<level>intermediate</level>
-			<time>3600</time>
-			<target-version>3.0.7</target-version>
-		</installation>
-		<history>
-			<entry>
-				<date>2010-03-20</date>
-				<rev-version>1.3.6</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Ensure that $s_rank_theme_options is initialised - thanks to _RocknRoll for reporting it</change>
-					<change>Fix: Change RANKSET_TEXT to correct RANKTHEME_TEXT name in memberlist.php - thanks to _RocknRoll for reporting it</change>
-					<change>Fix: Correct $phpExt to $phpEx in rank list link generation - thanks to _RocknRoll for reporting it</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2010-03-02</date>
-				<rev-version>1.3.5</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Added instruction to include "user_rank_theme" field in "leaders" query - thanks to Anyasha for reporting it</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2010-02-12</date>
-				<rev-version>1.3.4</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Correct "find" instruction in styles/prosilver/template/ucp_register.html - thanks to Anyasha for reporting it</change>
-					<change>Fix: Correct names of folder from "themes" to "theme" - thanks to Anyasha for reporting it</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2010-02-11</date>
-				<rev-version>1.3.3</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Correct logic errors that stop the creation of rank themes - thanks to Anyasha for reporting it</change>
-					<change>Fix: Remove request for non-existant language file in install file - thanks to Anyasha for reporting it</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2009-06-15</date>
-				<rev-version>1.3.2</rev-version>
-				<changelog lang="en-gb">
-					<change>Add: Add missing multi-ranking to PM viewing</change>
-					<change>Fix: Backport changes from 1.2.4 to pass validation</change>
-					<change>Change: Change edits of get_user_rank() calls to find closing brackets and add before to ensure the optional parameters is at the end</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2009-05-17</date>
-				<rev-version>1.3.1</rev-version>
-				<changelog lang="en-gb">
-					<change>Change: Hide rank theme if user has a special rank (as per v1.2)</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2009-05-17</date>
-				<rev-version>1.3.0</rev-version>
-				<changelog lang="en-gb">
-					<change>Add: ACP interface for changing user's theme</change>
-					<change>Add: constant to define whether users can select ranks at registration</change>
-					<change>Add: permissions for changing rank theme</change>
-					<change>Fix: Remove hidden form field that would potentially allow user to change theme when they weren't supposed to</change>
-					<change>Fix: Use permissions to check and enforce whether people can change rank themes</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2009-05-10</date>
-				<rev-version>1.2.3</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Update to latest MODX format</change>
-					<change>Fix: Remove apology from author notes as the formatting of the new MODX styling is no longer broken for author notes</change>
-					<change>Fix: Fix closing tag in adm/style/acp_ranks.html template</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-04-29</date>
-				<rev-version>1.2.2</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Fix typo in tag name of instructions (no code functionality changes)</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-04-28</date>
-				<rev-version>1.2.1</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Fix some code formatting to pass validation (no code functionality changes)</change>
-					<change>Fix: Separate out subsilver instructions to templates/subsilver2.xml to pass validation (no code functionality changes)</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-04-12</date>
-				<rev-version>1.2.0</rev-version>
-				<changelog lang="en-gb">
-					<change>Update: No issues found in 1.1b7 - change to 1.2.0 and submit to MOD Database</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-03-29</date>
-				<rev-version>1.1.7</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: move one bracket to new line for code formatting to pass validation (fix copied from v1.0.3)</change>
-					<change>Fix: undefined variable $special_rank in includes/acp/acp_ranks.php by moving code (fix copied from v1.0.3)</change>
-					<change>Fix: Make rank theme ordering alphabetical but with 'default' at the start (thanks to ccole513 for finding the issue and supplying an initial fix)</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-03-29</date>
-				<rev-version>1.1.6</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Move UCP Profile rank list generation out of "if allowed birthdays" block (phpBB3 changed around that area for Gold, but instructions were pre-Gold). Only affects sites who disabled birthdays.</change>
-					<change>Add: subsilver theme instructions and files (requested and partially helped by gergokee)</change>
-					<change>Update: Minor tweaks to prosilver theme</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-03-28</date>
-				<rev-version>1.1.5</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Replace DEFAULT_RANK_THEME_ID with SPECIAL_RANK_THEME_ID in validation of rank theme in ucp_profile.php</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-03-23</date>
-				<rev-version>1.1.4</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Add ordering of ranks in a theme to memberslist.php (thanks to ccole513 for finding it)</change>
-					<change>Update: Make one instruction that involved adding to an associative array in acp_ranks.php clearer so that the comma doesn't get missed (thanks to ccole513 for finding it)</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-03-23</date>
-				<rev-version>1.1.3</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Add styling for rank theme list on registration page</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-03-23</date>
-				<rev-version>1.1.2</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Merge changes made to v1.0.x to pass MOD database submission.</change>
-					<change>Add: Rank theme selction on registration</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-01-20</date>
-				<rev-version>1.1.1</rev-version>
-				<changelog lang="en-gb">
-					<change>Add: Add rank theme pages to members list with prosilver styling.</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2008-01-20</date>
-				<rev-version>1.0.2</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Corrected ACP page so that the post count box shows by default, because 'default' theme is selected. Thanks to Scorpio for finding the strange behaviour.</change>
-					<change>Update: Update the change log with missed prefixes and a credit for catching a mistake.</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2007-12-29</date>
-				<rev-version>1.0.1</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Fixed XSL (changed back to Prosilver and replaced with valid XSL file). Thanks to Mitch1063 for finding the mistake.</change>
-					<change>Update: Used new feature of MODX format and moved to RC numbering.</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2007-12-13</date>
-				<rev-version>0.1.6</rev-version>
-				<changelog lang="en-gb">
-					<change>Update: Merged the template and language changes back into this file to pass mod validation check.</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2007-12-13</date>
-				<rev-version>0.1.5</rev-version>
-				<changelog lang="en-gb">
-					<change>Update: Checked for compatibility with phpBB3 Gold</change>
-					<change>Update: Moved template changes out to template/prosilver.xml</change>
-					<change>Update: Moved language changes out to languages/en.xml</change>
-					<change>Fix: Make some find instructions slightly less ambiguous</change>
-					<change>Fix: Alter some find instructions that have changed slightly from initial write to Gold</change>
-					<change>Fix: Include fix from http://www.phpbb.com/community/viewtopic.php?f=70&amp;t=554987&amp;st=0&amp;sk=t&amp;sd=a&amp;start=15#p3117909</change>
-					<change>Fix: Alter the UCP instructions so that they don't get caught in the "if birthday enabled" checks</change>
-					<change>Update: Replace some "after-add" instructions with inline edits (shorter and stops the duplicate calling of the method)</change>
-					<change>Update: Make use of inline changes</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2007-07-18</date>
-				<rev-version>0.1.4</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Added missing instruction to add the $rank_theme parameter to the get_user_rank function (parameter documentation was included before, but the parameter wasn't!)</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2007-07-13</date>
-				<rev-version>0.1.3</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Added missing "NO_RANKS_FOR_THEME" translation</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2007-07-06</date>
-				<rev-version>0.1.2</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: corrected SQL so that all tables used the "phpbb_" prefix</change>
-					<change>Fix: corrected SQL so that the new table had the correct charset</change>
-					<change>Fix: corrected XML document so that "find and replace" show as "find and replace" rather than a find with two code blocks</change>
-					<change>Change: changed a replace that replaced a line with a comment to a replace that replaced the line with a comment and the original line commented out (for clarity and so it doesn't look like code is missing)</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2007-06-26</date>
-				<rev-version>0.1.1</rev-version>
-				<changelog lang="en-gb">
-					<change>Fix: Added "ALTER TABLE" command for phpbb_users table</change>
-				</changelog>
-			</entry>
-			<entry>
-				<date>2007-06-26</date>
-				<rev-version>0.1.0</rev-version>
-				<changelog lang="en-gb">
-					<change>Initial Version</change>
-				</changelog>
-			</entry>
-		</history>
-	</header>
-	<action-group>
-	    <sql><![CDATA[ALTER TABLE phpbb_users ADD user_rank_theme INT DEFAULT 1 NOT NULL ;
-ALTER TABLE phpbb_ranks ADD rank_theme INT DEFAULT 1 NOT NULL ;
-
-UPDATE phpbb_ranks SET rank_theme = -1 WHERE rank_special = 1;
-
-CREATE TABLE phpbb_rank_themes (
-  rtheme_id smallint(5) NOT NULL auto_increment,
-  rtheme_title varchar(50) default NULL,
-  rtheme_public tinyint(1) default '0',
-  PRIMARY KEY  (rtheme_id)
-) CHARSET=utf8 COLLATE=utf8_bin;
-
-INSERT INTO phpbb_rank_themes VALUES (-1, 'Special', 0);
-INSERT INTO phpbb_rank_themes VALUES (1, 'Default', 1);]]></sql>
-		<copy>
-			<file from="root/styles/prosilver/template/memberlist_ranks.html" to="styles/prosilver/template/memberlist_ranks.html" />
-			<file from="root/styles/prosilver/theme/images/icon_ranks.gif" to="styles/prosilver/theme/images/icon_ranks.gif" />
-			<file from="root/install/install_MultiRaceRankThemes.php" to="install/install_MultiRaceRankThemes.php" />
-			<file from="root/language/en/mods/permissions_MultiRaceRankThemes.php" to="language/en/mods/permissions_MultiRaceRankThemes.php" />
-		</copy>
-		<open src="adm/style/acp_ranks.html">
-			<edit>
-				<find><![CDATA[	<dl>
-		<dt><label for="special_rank">{L_RANK_SPECIAL}:</label></dt>
-		<dd><label><input onchange="dE('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> />{L_YES}</label>
-			<label><input onchange="dE('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
-	</dl>
-]]></find>
-				<action type="replace-with"><![CDATA[	 <dl>
-		<dt><label for="rank_theme">{L_RANK_THEME}:</label></dt>
-		<dd><select name="rank_theme" id="rank_theme" onchange="if (this.selectedIndex > 0) { dE('posts', 1) } else { dE('posts', -1) }">{S_RANK_THEME_LIST}</select></dd>
-	</dl>
-]]>
-				</action>
-			</edit>
-			<edit>
-				<find><![CDATA[<!-- ELSE -->
-
-	<h1>{L_ACP_MANAGE_RANKS}</h1>]]></find>
-				<action type="before-add"><![CDATA[<!-- ELSEIF S_EDIT_THEME -->
-
-
-	<a href="{U_BACK}" style="float: right">&laquo; {L_BACK}</a>
-	<h1>{L_ACP_MANAGE_RANK_THEMES}</h1>
-
-	<p>{L_ACP_RANK_THEMES_EXPLAIN}</p>
-
-	<form id="acp_ranks" method="post" action="{U_ACTION}">
-
-	<fieldset>
-		<legend>{L_ACP_RANK_THEMES}</legend>
-	<dl>
-		<dt><label for="title">{L_RANK_THEME_TITLE}:</label></dt>
-		<dd><input name="title" type="text" id="title" value="{RANK_THEME_TITLE}" maxlength="255" /></dd>
-	</dl>
-	<dl>
-		<dt><label for="theme_public">{L_RANK_THEME_PUBLIC}:</label></dt>
-		<dd><label><input type="radio" class="radio" name="theme_public" value="1" id="theme_public"<!-- IF S_RANK_THEME_PUBLIC --> checked="checked"<!-- ENDIF --> />{L_YES}</label>
-			<label><input type="radio" class="radio" name="theme_public" value="0"<!-- IF not S_RANK_THEME_PUBLIC --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
-	</dl>
-
-	<p class="submit-buttons">
-		<input type="hidden" name="action" value="save_theme" />
-
-		<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
-		<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
-	</p>
-	</fieldset>
-
-	</form>]]>
-				</action>
-			</edit>
-			<edit>
-				<find><![CDATA[
-	<!-- BEGIN ranks -->]]></find>
-				<action type="before-add"><![CDATA[
-	<!-- BEGIN themes -->
-		<tr><th colspan="4">{themes.RANK_THEME_TITLE}<!-- IF not themes.S_THEME_PUBLIC --> ({L_PRIVATE})<!-- ENDIF --><!-- IF themes.U_EDIT_THEME --> <span style="margin-left: 5em"><a href="{themes.U_EDIT_THEME}">{ICON_EDIT}</a> <a href="{themes.U_DELETE_THEME}">{ICON_DELETE}</a></span><!-- ENDIF --></th></tr>]]>
-				</action>
-			</edit>
-			<edit>
-				<find><![CDATA[<!-- END ranks -->]]></find>
-				<action type="replace-with"><![CDATA[
-		<!-- BEGINELSE -->
-		<tr>
-			<td colspan="4">{L_NO_RANKS_FOR_THEME}</td>
-		</tr>
-		<!-- END ranks -->
-	<!-- END themes -->]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[
-		<input class="button2" name="add" type="submit" value="{L_ADD_RANK}" />]]></find>
-				<action type="before-add"><![CDATA[
-		<input class="button2" name="add_theme" type="submit" value="{L_ADD_RANK_THEME}" />]]></action>
-			</edit>
-		</open>
-		<open src="adm/style/acp_users.html">
-			<edit>
-				<find><![CDATA[		<dt><label for="user_rank">{L_USER_RANK}:</label></dt>
-		<dd><select name="user_rank" id="user_rank">{S_RANK_OPTIONS}</select></dd>]]></find>
-				<action type="after-add"><![CDATA[		<dt><label for="user_rank_theme">{L_USER_RANK_THEME}:</label></dt>
-		<dd><select name="user_rank_theme" id="user_rank_theme">{S_RANK_THEME_OPTIONS}</select></dd>]]>
-				</action>
-			</edit>
-		</open>
-		<open src="adm/style/admin.css">
-			<edit>
-				<find><![CDATA[
-	color: #FFFFFF;
-	background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x;
-	border-top: 1px solid #6DACD2;
-	border-bottom: 1px solid #327AA5;]]></find>
-				<action type="replace-with"><![CDATA[
-	background-color: #DCEBFE;
-	border: 1px solid #6DACD2;
-	border-width: 1px 0;]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[td {
-	text-align: left;]]></find>
-				<action type="before-add"><![CDATA[
-thead th {
-	color: #FFFFFF;
-	background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x;
-	border-bottom-color: #327AA5
-}
-				]]></action>
-			</edit>
-		</open>
-		<open src="includes/acp/acp_ranks.php">
-			<edit>
-				<find><![CDATA[var $u_action;]]></find>
-				<action type="after-add"><![CDATA[var $rank_themes = array();]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[
-		$action = (isset($_POST['add'])) ? 'add' : $action;]]></find>
-				<action type="after-add"><![CDATA[
-		$action = (isset($_POST['add_theme'])) ? 'add_theme' : $action;
-				]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[				$special_rank = request_var('special_rank', 0);]]></find>
-				<action type="replace-with"><![CDATA[				//Multi-rank theme mod: special rank now calculated another way
-				//$special_rank = request_var('special_rank', 0);
-				$rank_theme = request_var('rank_theme', DEFAULT_RANK_THEME_ID);
-
-				if ($rank_theme < 0)
-				{
-					$special_rank = 1; //Stick with the phpBB convention and use magic numbers for the "special rank" value
-					$rank_theme = SPECIAL_RANK_THEME_ID;
-				}
-				else
-				{
-					$special_rank = 0;
-				}]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[					'rank_image'		=> htmlspecialchars_decode($rank_image)]]></find>
-				<action type="before-add"><![CDATA[					'rank_theme'		=> $rank_theme,]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[					$cache->destroy('_ranks');
-
-					add_log('admin', 'LOG_RANK_REMOVED', $rank_title);]]></find>
-				<action type="after-add"><![CDATA[
-
-					trigger_error($user->lang['RANK_REMOVED'] . adm_back_link($this->u_action));]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[					if ($action == 'edit' && $rank_id == $row['rank_id'])
-					{
-						$ranks = $row;
-					}
-				}
-				$db->sql_freeresult($result);]]></find>
-				<action type="after-add"><![CDATA[
-
-				$this->load_rank_themes();
-
-				$rank_theme_list = '';
-				$rank_theme = (isset($ranks['rank_theme']) ? $ranks['rank_theme'] : DEFAULT_RANK_THEME_ID);
-
-				foreach ($this->rank_themes as $id => $theme_data)
-				{
-					$rank_theme_list.= '<option value="' . $id . '"' . ($rank_theme == $id ? ' selected="selected"' : '') . '>' . $theme_data['rtheme_title'] . '</option>';
-				}]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[					'S_SPECIAL_RANK'	=> (!isset($ranks['rank_special']) || $ranks['rank_special']) ? true : false,]]></find>
-				<action type="replace-with"><![CDATA[					'S_SPECIAL_RANK'	=> (isset($ranks['rank_special']) && $ranks['rank_special']) ? true : false,
-					'S_RANK_THEME_LIST'	=> $rank_theme_list,]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[			}
-
-		$template->assign_vars(array(]]></find>
-				<action type="before-add"><![CDATA[
-
-			//Multi-rank theme mod: Add separate theme saving, deleting, adding and editing rather than overriding a single mode
-			case 'save_theme':
-
-				$theme_title = utf8_normalize_nfc(request_var('title', '', true));
-				$theme_public = request_var('theme_public', RANK_THEME_PUBLIC);
-
-				if (!$theme_title)
-				{
-					trigger_error($user->lang['NO_RANK_THEME_TITLE'] . adm_back_link($this->u_action), E_USER_WARNING);
-				}
-
-				if ($rank_id == DEFAULT_RANK_THEME_ID || $rank_id == SPECIAL_RANK_THEME_ID || $rank_id < 0)
-				{
-					trigger_error($user->lang['MUST_SELECT_RANK_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
-				}
-
-				$sql_ary = array(
-					'rtheme_title'		=> $theme_title,
-					'rtheme_public'		=> $theme_public
-				);
-
-				if ($rank_id)
-				{
-					$sql = 'UPDATE ' . RANK_THEMES_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE rtheme_id = $rank_id";
-					$message = $user->lang['RANK_THEME_UPDATED'];
-
-					add_log('admin', 'LOG_RANK_THEME_UPDATED', $theme_title);
-				}
-				else
-				{
-					$sql = 'INSERT INTO ' . RANK_THEMES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
-					$message = $user->lang['RANK_THEME_ADDED'];
-
-					add_log('admin', 'LOG_RANK_THEME_ADDED', $theme_title);
-				}
-
-				$db->sql_query($sql);
-
-				$cache->destroy('_ranks');
-
-				trigger_error($message . adm_back_link($this->u_action));
-
-			break;
-
-			case 'delete_theme':
-				//Don't allow deletion of special or default rank sets
-				if ($rank_id == DEFAULT_RANK_THEME_ID || $rank_id == SPECIAL_RANK_THEME_ID || $rank_id < 0)
-				{
-					trigger_error($user->lang['MUST_SELECT_RANK_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
-				}
-
-				if (confirm_box(true))
-				{
-					$sql = 'SELECT rtheme_title
-						FROM ' . RANK_THEMES_TABLE . '
-						WHERE rtheme_id = ' . $rank_id;
-					$result = $db->sql_query($sql);
-					$theme_title = (string) $db->sql_fetchfield('rtheme_title');
-					$db->sql_freeresult($result);
-
-					$sql = 'DELETE FROM ' . RANKS_TABLE . "
-						WHERE rank_theme = $rank_id";
-					$db->sql_query($sql);
-
-					$sql = 'DELETE FROM ' . RANK_THEMES_TABLE . "
-						WHERE rtheme_id = $rank_id";
-					$db->sql_query($sql);
-
-					$sql = 'UPDATE ' . USERS_TABLE . "
-						SET user_rank_theme = ".DEFAULT_RANK_THEME_ID."
-						WHERE user_rank_theme = $rank_id";
-					$db->sql_query($sql);
-
-					$cache->destroy('_ranks');
-
-					add_log('admin', 'LOG_RANK_THEME_REMOVED', $theme_title);
-
-					trigger_error($user->lang['RANK_THEME_REMOVED'] . adm_back_link($this->u_action));
-				}
-				else
-				{
-					confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
-						'i'			=> $id,
-						'mode'		=> $mode,
-						'rank_id'	=> $rank_id,
-						'action'	=> 'delete_theme',
-					)));
-				}
-
-			break;
-
-			case 'edit_theme':
-			case 'add_theme':
-
-				$theme = array();
-
-				$sql = 'SELECT *
-					FROM ' . RANK_THEMES_TABLE . '
-					WHERE rtheme_id = ' . $rank_id;
-				$result = $db->sql_query($sql);
-
-				while ($row = $db->sql_fetchrow($result))
-				{
-					$theme = $row;
-				}
-				$db->sql_freeresult($result);
-
-				$template->assign_vars(array(
-					'S_EDIT_THEME'		=> true,
-					'U_BACK'			=> $this->u_action,
-					'U_ACTION'			=> $this->u_action . '&amp;id=' . $rank_id,
-					'RANK_THEME_TITLE'	=> (isset($theme['rtheme_title'])) ? $theme['rtheme_title'] : '',
-					'S_RANK_THEME_PUBLIC'	=> (isset($theme['rtheme_public']) && $theme['rtheme_public']) ? true : false)
-				);
-
-
-				return;
-
-			break;]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[		$sql = 'SELECT *
-			FROM ' . RANKS_TABLE . '
-			ORDER BY rank_special DESC, rank_min ASC, rank_title ASC';]]></find>
-				<action type="before-add"><![CDATA[
-
-		$this->load_rank_themes();
-
-		$ranks = array();
-
-		foreach ($this->rank_themes as $theme)
-		{
-			$ranks[$theme['rtheme_id']] = array();
-		}]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[			$template->assign_block_vars('ranks', array(]]></find>
-				<action type="replace-with"><![CDATA[
-			$ranks[$row['rank_theme']][] = $row;
-		}
-
-		foreach ($this->rank_themes as $theme)
-		{
-			$template->assign_block_vars('themes', array(
-				'RANK_THEME_TITLE'	=> $theme['rtheme_title'],
-				'S_THEME_PUBLIC'	=> $theme['rtheme_public'],
-				'U_EDIT_THEME'		=> ($theme['rtheme_id'] != DEFAULT_RANK_THEME_ID && $theme['rtheme_id'] != SPECIAL_RANK_THEME_ID ? $this->u_action . '&amp;action=edit_theme&amp;id=' . $theme['rtheme_id'] : ''),
-				'U_DELETE_THEME'	=> ($theme['rtheme_id'] != DEFAULT_RANK_THEME_ID && $theme['rtheme_id'] != SPECIAL_RANK_THEME_ID ? $this->u_action . '&amp;action=delete_theme&amp;id=' . $theme['rtheme_id'] : '')));
-
-			if (sizeof($ranks[$theme['rtheme_id']]) > 0)
-			{
-				foreach ($ranks[$theme['rtheme_id']] as $row)
-				{
-					$template->assign_block_vars('themes.ranks', array(]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[}
-		$db->sql_freeresult($result);
-
-	}]]></find>
-				<action type="replace-with"><![CDATA[
-				}
-			}
-		}
-		$db->sql_freeresult($result);
-	}
-
-	function load_rank_themes()
-	{
-		if (sizeof($this->rank_themes) > 0)
-		{
-			return;
-		}
-
-		global $db, $user;
-
-		$sql = 'SELECT * FROM ' . RANK_THEMES_TABLE. ' WHERE rtheme_id <> ' . DEFAULT_RANK_THEME_ID . ' AND rtheme_id <> ' . SPECIAL_RANK_THEME_ID . ' ORDER BY rtheme_title';
-		$result = $db->sql_query($sql);
-
-		$this->rank_themes = array(SPECIAL_RANK_THEME_ID => array('rtheme_id' => SPECIAL_RANK_THEME_ID, 'rtheme_title' => $user->lang['SPECIAL_RANK_THEME'], 'rtheme_public' => false),
-									DEFAULT_RANK_THEME_ID => array('rtheme_id' => DEFAULT_RANK_THEME_ID, 'rtheme_title' => $user->lang['DEFAULT_RANK_THEME'], 'rtheme_public' => true));
-
-		while ($row = $db->sql_fetchrow($result))
-		{
-			$this->rank_themes[$row['rtheme_id']] = $row;
-		}
-		$db->sql_freeresult($result);
-	}]]></action>
-			</edit>
-		</open>
-		<open src="includes/acp/acp_users.php">
-			<edit>
-				<find><![CDATA[					$rank_id = request_var('user_rank', 0);]]></find>
-				<action type="after-add"><![CDATA[					$rank_theme = request_var('user_rank_theme', DEFAULT_RANK_THEME_ID);]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[						SET user_rank = $rank_id]]></find>
-				<action type="after-add"><![CDATA[						, user_rank_theme = $rank_theme]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[					$s_rank_options .= '<option value="' . $row['rank_id'] . '"' . $selected . '>' . $row['rank_title'] . '</option>';
-				}
-				$db->sql_freeresult($result);]]></find>
-				<action type="after-add"><![CDATA[				$sql = $db->sql_build_query('SELECT', array(
-					'SELECT'	=> 'rtheme_id, rtheme_title',
-
-					'FROM'		=> array(
-						RANK_THEMES_TABLE		=> 'r'
-					),
-
-					'WHERE'		=> 'rtheme_public = 1 AND rtheme_id > '.DEFAULT_RANK_THEME_ID,
-
-					'ORDER_BY'	=> 'rtheme_title ASC',
-				));
-
-				$result = $db->sql_query($sql);
-				$valid_selection = false;
-				$s_rank_theme_options = '';
-
-				while ($row = $db->sql_fetchrow($result))
-				{
-					if ($row['rtheme_id'] == $user_row['user_rank_theme'])
-					{
-						$selected = ' selected="selected"';
-						$valid_selection = true;
-					}
-					else
-					{
-						$selected = '';
-					}
-
-					$s_rank_theme_options .= "<option value=\"{$row['rtheme_id']}\"$selected>{$row['rtheme_title']}</option>";
-				}
-				$db->sql_freeresult($result);
-
-				$selected = (!$valid_selection) ? ' selected="selected"' : '';
-				$s_rank_theme_options = "<option value=\"".DEFAULT_RANK_THEME_ID."\"$selected>{$user->lang['DEFAULT_RANK_THEME']}</option>$s_rank_theme_options";]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[					'S_RANK_OPTIONS'	=> $s_rank_options)]]></find>
-				<inline-edit>
-            		<inline-find>)</inline-find>
-					<inline-action type="before-add"><![CDATA[, 'S_RANK_THEME_OPTIONS'	=> $s_rank_theme_options]]></inline-action>
-				</inline-edit>
-			</edit>
-		</open>
-		<open src="includes/cache.php">
-			<edit>
-				<find><![CDATA[			$sql = 'SELECT *
-				FROM ' . RANKS_TABLE . '
-				ORDER BY rank_min DESC';]]></find>
-				<action type="replace-with"><![CDATA[			//Make sure we only pull data for public rank themes and the special theme
-			$sql = $db->sql_build_query('SELECT', array(
-				'SELECT'	=> 'r.*',
-
-				'FROM'		=> array(
-					RANK_THEMES_TABLE	=> 't'
-				),
-
-				'LEFT_JOIN'	=> array(
-					array(
-						'FROM'	=> array(RANKS_TABLE			=> 'r'),
-						'ON'	=> 'r.rank_theme = t.rtheme_id'
-					)
-				),
-
-				'WHERE'		=> 't.rtheme_public = ' . RANK_THEME_PUBLIC . ' OR t.rtheme_id = ' . SPECIAL_RANK_THEME_ID,
-				'ORDER_BY'	=> 'r.rank_min DESC'
-			));]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[$ranks['normal'][] = array(]]></find>
-				<action type="replace-with"><![CDATA[$ranks[$row['rank_theme']][] = array(]]></action>
-			</edit>
-		</open>
-		<open src="includes/constants.php">
-			<edit>
-				<find><![CDATA[// Additional constants]]></find>
-				<action type="after-add"><![CDATA[
-define('SPECIAL_RANK_THEME_ID', -1);
-define('DEFAULT_RANK_THEME_ID', 1);
-define('DEFAULT_RANK_THEME_ID', 1);
-define('RANK_THEME_PRIVATE', 0);
-define('RANK_THEME_PUBLIC', 1);
-define('ALLOW_RANK_THEME_AT_REGISTRATION', true);]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[// Additional tables]]></find>
-				<action type="after-add"><![CDATA[define('RANK_THEMES_TABLE',			$table_prefix . 'rank_themes');]]></action>
-			</edit>
-		</open>
-		<open src="includes/functions.php">
-			<edit>
-				<find><![CDATA[		'U_FAQ'					=> append_sid("{$phpbb_root_path}faq.$phpEx"),]]></find>
-				<action type="after-add"><![CDATA[		'U_RANKS'				=> append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=ranks'),]]></action>
-			</edit>
-		</open>
-		<open src="includes/functions_display.php">
-			<edit>
-				<find><![CDATA[* @param string &$rank_img_src the rank image source is stored here after execution]]></find>
-				<action type="after-add"><![CDATA[* @param int $rank_theme the rank theme set to load from (defaulting to DEFAULT_RANK_THEME_ID)]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)]]></find>
-				<inline-edit>
-            				<inline-find>)</inline-find>
-					<inline-action type="before-add">, $rank_theme = DEFAULT_RANK_THEME_ID</inline-action>
-				</inline-edit>
-			</edit>
-			<edit>
-				<find><![CDATA[		if (!empty($ranks['normal']))
-		{
-			foreach ($ranks['normal'] as $rank)]]></find>
-				<action type="replace-with"><![CDATA[		//Multi-rank theme: find our theme, defaulting to DEFAULT_RANK_THEME_ID if the user chose an invalid value
-		if (!empty($ranks[$rank_theme]))
-		{
-			$theme = $ranks[$rank_theme];
-		}
-		else
-		{
-			//Assume DEFAULT_RANK_THEME_ID always exists
-			$theme = $ranks[DEFAULT_RANK_THEME_ID];
-		}
-
-		if (!empty($theme))
-		{
-			foreach ($theme as $rank)]]></action>
-			</edit>
-		</open>
-		<open src="includes/ucp/ucp_pm_viewmessage.php">
-			<edit>
-				<find><![CDATA[	get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);]]></find>
-				<inline-edit>
-					<inline-find>);</inline-find>
-					<inline-action type="before-add"><![CDATA[, $user_row['user_rank_theme']]]></inline-action>
-				</inline-edit>
-			</edit>
-		</open>
-		<open src="includes/ucp/ucp_profile.php">
-			<edit>
-				<find><![CDATA[					'interests'		=> utf8_normalize_nfc(request_var('interests', $user->data['user_interests'], true)),]]></find>
-				<action type="after-add"><![CDATA[					'rank_theme'		=> request_var('rank_theme', $user->data['user_rank_theme']),]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[ 				if ($config['allow_birthdays'])
-  				{
-					$data['bday_day'] = $data['bday_month'] = $data['bday_year'] = 0;]]></find>
-				<action type="before-add"><![CDATA[				if (!$auth->acl_get('u_change_rank_theme'))
-				{
-					//Enforce "cannot change rank theme"
-					$data['rank_theme'] = $user->data['user_rank_theme'];
-				}]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[
-						'interests'		=> array('string', true, 2, 500),]]></find>
-				<action type="after-add"><![CDATA[
-						'rank_theme'	=> array('num', true, SPECIAL_RANK_THEME_ID),]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[
-							'user_interests'=> $data['interests'],]]></find>
-				<action type="after-add"><![CDATA[
-							'user_rank_theme' => $data['rank_theme'],]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[					$template->assign_vars(array(
-						'S_BIRTHDAY_DAY_OPTIONS'	=> $s_birthday_day_options,
-						'S_BIRTHDAY_MONTH_OPTIONS'	=> $s_birthday_month_options,
-						'S_BIRTHDAY_YEAR_OPTIONS'	=> $s_birthday_year_options,
-						'S_BIRTHDAYS_ENABLED'		=> true,
-					));
-				}]]></find>
-				<action type="after-add"><![CDATA[				//Multi-rank theme: Construct the rank theme options, if applicable
-				$s_rank_theme_options = '';
-
-				if ($user->data['user_rank'] == 0 && $auth->acl_get('u_change_rank_theme'))
-				{
-					$sql = $db->sql_build_query('SELECT', array(
-						'SELECT'	=> 'rtheme_id, rtheme_title',
-
-						'FROM'		=> array(
-							RANK_THEMES_TABLE		=> 'r'
-						),
-
-						'WHERE'		=> 'rtheme_public = ' . RANK_THEME_PUBLIC . ' AND rtheme_id <> ' . DEFAULT_RANK_THEME_ID,
-
-						'ORDER_BY'	=> 'rtheme_title ASC',
-					));
-
-					$result = $db->sql_query($sql);
-					$valid_selection = false;
-
-					while ($row = $db->sql_fetchrow($result))
-					{
-						if ($row['rtheme_id'] == $data['rank_theme'])
-						{
-							$selected = ' selected="selected"';
-							$valid_selection = true;
-						}
-						else
-						{
-							$selected = '';
-						}
-
-						$s_rank_theme_options .= '<option value="' . $row['rtheme_id'] . '"' . $selected . '>' . $row['rtheme_title'] . '</option>';
-					}
-
-					$db->sql_freeresult($result);
-
-					$selected = (!$valid_selection) ? ' selected="selected"' : ''; //If they've managed to get a bad selection, make sure "default" is selected
-					$s_rank_theme_options = '<option value="' . DEFAULT_RANK_THEME_ID . '"' . $selected . '>' . $user->lang['DEFAULT_RANK_THEME'] . '</option>' . $s_rank_theme_options; //And append to the start
-				}]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[					'INTERESTS'	=> $data['interests'],]]></find>
-				<action type="after-add"><![CDATA[					'S_RANK_THEME_OPTIONS'	=> $s_rank_theme_options,]]></action>
-			</edit>
-		</open>
-		<open src="includes/ucp/ucp_register.php">
-			<edit>
-				<find><![CDATA[					'tz'				=> request_var('tz', (float) $config['board_timezone']),]]></find>
-				<action type="after-add"><![CDATA[					'rank_theme'		=> request_var('rank_theme', DEFAULT_RANK_THEME_ID),]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[			'tz'				=> request_var('tz', (float) $timezone),]]></find>
-				<action type="after-add"><![CDATA[			'rank_theme'		=> request_var('rank_theme', DEFAULT_RANK_THEME_ID),]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[		// Check and initialize some variables if needed
-		if ($submit)
-		{]]></find>
-				<action type="before-add"><![CDATA[		if (!defined('ALLOW_RANK_THEME_AT_REGISTRATION') || !ALLOW_RANK_THEME_AT_REGISTRATION)
-		{
-			//Enforce "cannot select rank theme"
-			$data['rank_theme'] = DEFAULT_RANK_THEME_ID;
-		}]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[				'tz'				=> array('num', false, -14, 14),]]></find>
-				<action type="after-add"><![CDATA[				'rank_theme'	=> array('num', true, SPECIAL_RANK_THEME_ID),]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[					'user_timezone'			=> (float) $data['tz'],]]></find>
-				<action type="after-add"><![CDATA[					'user_rank_theme'		=> (int) $data['rank_theme'],]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[		$template->assign_vars(array(
-			'ERROR'				=> (sizeof($error)) ? implode('<br />', $error) : '',]]></find>
-				<action type="before-add"><![CDATA[		//IBBoard: Construct the rank theme options, if applicable
-		$s_rank_theme_options = '';
-
-		if (defined('ALLOW_RANK_THEME_AT_REGISTRATION') && ALLOW_RANK_THEME_AT_REGISTRATION)
-		{
-			$sql = $db->sql_build_query('SELECT', array(
-				'SELECT'	=> 'rtheme_id, rtheme_title',
-
-				'FROM'		=> array(
-					RANK_THEMES_TABLE		=> 'r'
-				),
-
-				'WHERE'		=> 'rtheme_public = ' . RANK_THEME_PUBLIC . ' AND rtheme_id <> '.DEFAULT_RANK_THEME_ID,
-
-				'ORDER_BY'	=> 'rtheme_title ASC',
-			));
-
-			$result = $db->sql_query($sql);
-			$valid_selection = false;
-
-			while ($row = $db->sql_fetchrow($result))
-			{
-				if ($row['rtheme_id'] == $data['rank_theme'])
-				{
-					$selected = ' selected="selected"';
-					$valid_selection = true;
-				}
-				else
-				{
-					$selected = '';
-				}
-
-				$s_rank_theme_options .= '<option value="' . $row['rtheme_id'] . '"' . $selected . '>' . $row['rtheme_title'] . '</option>';
-			}
-
-			$db->sql_freeresult($result);
-
-			$selected = (!$valid_selection) ? ' selected="selected"' : ''; //If they've managed to get a bad selection, make sure "default" is selected
-			$s_rank_theme_options = '<option value="' . DEFAULT_RANK_THEME_ID . '"' . $selected . '>' . $user->lang['DEFAULT_RANK_THEME'] . '</option>' . $s_rank_theme_options; //And append to the start
-		}]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[			'S_TZ_OPTIONS'		=> tz_select($data['tz']),]]></find>
-				<action type="after-add"><![CDATA[			'S_RANK_THEME_OPTIONS'		=> $s_rank_theme_options,]]></action>
-			</edit>
-		</open>
-		<open src="language/en/acp/common.php">
-			<edit>
-				<find><![CDATA[));
-
-?>]]></find>
-				<action type="before-add"><![CDATA[	//Multi-rank theme: Add rank theme logging messages
-	'LOG_RANK_THEME_ADDED'		=> '<strong>Added new rank theme</strong><br />» %s',
-	'LOG_RANK_THEME_REMOVED'		=> '<strong>Removed rank theme</strong><br />» %s',
-	'LOG_RANK_THEME_UPDATED'		=> '<strong>Updated rank theme</strong><br />» %s',
-	//Multi-rank theme: Add other common new langs
-	'PRIVATE'					=> 'Private',
-	'ACP_MANAGE_RANK_THEMES'			=> 'Manage rank themes',
-	'ACP_RANK_THEMES'					=> 'Rank themes',
-]]></action>
-			</edit>
-		</open>
-		<open src="language/en/acp/users.php">
-			<edit>
-				<find><![CDATA[));
-
-?>]]></find>
-				<action type="before-add"><![CDATA[	//Multi-rank theme: Add langs for editing user
-	'USER_RANK_THEME'				=> 'User rank theme',]]></action>
-			</edit>
-		</open>
-		<open src="language/en/acp/posting.php">
-			<edit>
-				<find><![CDATA[	'RANK_UPDATED'			=> 'The rank was successfully updated.',]]></find>
-				<action type="after-add"><![CDATA[	//Multi-rank theme: Rank theme specific language strings
-	'ADD_RANK_THEME'		=> 'Add new rank theme',
-	'ACP_RANK_THEMES_EXPLAIN'	=> 'Using this page you can add, edit, view and delete rank themes. Rank themes can be made private so that they are not selectable by users. Deleting a rank theme will delete all ranks within it.',
-	'RANK_THEME_TITLE'		=> 'Rank theme title',
-	'RANK_THEME_PUBLIC'		=> 'Set as public rank theme',
-	'RANK_THEME'			=> 'Rank theme',
-	'MUST_SELECT_RANK_THEME'	=> 'You must select a valid rank theme. Default and special themes cannot be deleted.',
-	'RANK_THEME_ADDED'		=> 'The rank theme was successfully added.',
-	'RANK_THEME_REMOVED'	=> 'The rank theme (and all ranks within it) was successfully removed.',
-	'RANK_THEME_UPDATED'	=> 'The rank theme was successfully updated.',
-	'NO_RANKS_FOR_THEME'	=> 'No ranks for theme',]]></action>
-			</edit>
-		</open>
-		<open src="language/en/common.php">
-			<edit>
-				<find><![CDATA[	'datetime'                      => array(]]></find>
-				<action type="before-add"><![CDATA[
-	//Multi-rank theme: Add in new rank naming
-	'DEFAULT_RANK_THEME'	=> 'Default theme',
-	'SPECIAL_RANK_THEME'	=> 'Special theme',
-	//Multi-rank theme: Add header link text
-	'RANKS_EXPLAIN'         => 'Available rank themes',
-	'RANKS'                 => 'Rank Themes',
-	//Multi-rank theme: Add install message
-	'MULTI_RACE_ADDED_PERMISSIONS'	=> 'Added permissions for Multi-Race Rank Themes MOD',]]></action>
-			</edit>
-		</open>
-		<open src="language/en/memberlist.php">
-			<edit>
-				<find><![CDATA[));
-
-?>]]></find>
-				<action type="before-add"><![CDATA[// Multi-rank theme: Rank theme list information
-	'RANKTHEMES'		=> 'Rank Themes',
-	'RANKTHEME_TEXT'	=> 'Rank themes allow you to customise the name and image of the rank that is displayed beside your post. For a full list of the ranks within a scheme click on the scheme name. For more detail on ranks please see the <a href="%1$s">FAQ</a>.',
-	'RANK_NAME'		=> 'Rank',
-	'RANK_IMG'		=> 'Rank image',
-	'RANK_POSTS'		=> 'Required post count',
-	'NO_RANKSET_ERROR'	=> 'The rank theme you selected was invalid. Please check the link and try again.'
-]]></action>
-			</edit>
-		</open>
-		<open src="language/en/ucp.php">
-			<edit>
-				<find><![CDATA[	'UCP_PROFILE_SIGNATURE'		=> 'Edit signature',]]></find>
-				<action type="after-add"><![CDATA[	'UCP_RANK_THEME'			=> 'Rank theme',	//Multi-rank theme: Add rank theme label]]></action>
-			</edit>
-		</open>
-		<open src="memberlist.php">
-			<edit>
-				<find><![CDATA[$topic_id	= request_var('t', 0);]]></find>
-				<action type="after-add"><![CDATA[$rank_theme	= request_var('r', 0);]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'searchuser', 'leaders')))]]></find>
-				<inline-edit>
-					<inline-find>, 'leaders'</inline-find>
-					<inline-action type="after-add"><![CDATA[, 'ranks']]></inline-action>
-				</inline-edit>
-			</edit>
-			<edit>
-				<find><![CDATA[	case 'email':]]></find>
-				<action type="after-add"><![CDATA[	case 'ranks':]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[			'SELECT'	=> 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',]]></find>
-				<inline-edit>
-					<inline-find>u.user_rank,</inline-find>
-					<inline-action type="after-add"><![CDATA[ u.user_rank_theme,]]></inline-action>
-				</inline-edit>
-			</edit>
-			<edit>
-				<find><![CDATA[			get_user_rank($row['user_rank'], (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']), $rank_title, $rank_img, $rank_img_src);]]></find>
-				<inline-edit>
-					<inline-find>);</inline-find>
-					<inline-action type="before-add"><![CDATA[, $row['user_rank_theme']]]></inline-action>
-				</inline-edit>
-			</edit>
-			<edit>
-				<find><![CDATA[	case 'group':
-	default:
-		// The basic memberlist]]></find>
-				<action type="before-add"><![CDATA[	case 'ranks':
-		// Display all available rank sets or the list of ranks for a set
-		$page_title = $user->lang['RANKTHEMES'];
-		$template_html = 'memberlist_ranks.html';
-
-		if ($rank_theme == 0)
-		{
-			// Get list of rank themes
-			$sql = 'SELECT rtheme_id, rtheme_title
-				FROM ' . RANK_THEMES_TABLE . '
-				WHERE rtheme_public = ' . RANK_THEME_PUBLIC . '
-					AND rtheme_id <> ' . DEFAULT_RANK_THEME_ID . '
-				ORDER BY rtheme_title ASC';
-			$result = $db->sql_query($sql);
-
-			$template->assign_vars(array(
-				'L_RANKTHEME_TEXT' => sprintf($user->lang['RANKTHEME_TEXT'], append_sid("{$phpbb_root_path}faq.{$phpEx}#f15"))
-			));
-
-			$template->assign_block_vars('rankset', array(
-				'RANKSET_URL' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=ranks&amp;r=' . DEFAULT_RANK_THEME_ID),
-				'RANKSET_NAME' => $user->lang['DEFAULT_RANK_THEME']
-			));
-
-			while ($row = $db->sql_fetchrow($result))
-			{
-				$template->assign_block_vars('rankset', array(
-					'RANKSET_URL' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=ranks&amp;r=' . $row['rtheme_id']),
-					'RANKSET_NAME' => $row['rtheme_title']
-				));
-			}
-
-			$db->sql_freeresult($result);
-		}
-		else
-		{
-			$sql = 'SELECT rtheme_title
-				FROM ' . RANK_THEMES_TABLE . '
-				WHERE rtheme_public = ' . RANK_THEME_PUBLIC . '
-					AND rtheme_id = ' . $rank_theme;
-			$result = $db->sql_query($sql);
-			$row = $db->sql_fetchrow($result);
-			$db->sql_freeresult($result);
-
-			if ($row != false)
-			{
-				$set_title = $row['rtheme_title'];
-				$template->assign_vars(array(
-					'RANKSET_NAME' => $set_title,
-					'U_RANKSET_LIST_LINK' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=ranks')
-				));
-				$sql = 'SELECT rank_title, rank_min, rank_image
-					FROM ' . RANKS_TABLE . '
-					WHERE rank_theme = ' . $rank_theme . '
-					ORDER BY rank_min ASC';
-				$result = $db->sql_query($sql);
-
-				while ($rank = $db->sql_fetchrow($result))
-				{
-					$rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
-					$template->assign_block_vars('rank', array(
-						'RANK_NAME' => $rank['rank_title'],
-						'RANK_IMG' => $rank_img,
-						'RANK_POSTS' => $rank['rank_min']
-					));
-				}
-
-				$db->sql_freeresult($result);
-			}
-			else
-			{
-				trigger_error($user->lang['NO_RANKSET_ERROR']);
-			}
-		}
-
-	break;]]></action>
-			</edit>
-			<edit>
-				<find><![CDATA[	get_user_rank($data['user_rank'], (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src);]]></find>
-				<inline-edit>
-					<inline-find>);</inline-find>
-					<inline-action type="before-add"><![CDATA[, $data['user_rank_theme']]]></inline-action>
-				</inline-edit>
-			</edit>
-		</open>
-		<open src="styles/prosilver/template/overall_header.html">
-			<edit>
-				<find><![CDATA[					<!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->]]></find>
-				<action type="after-add"><![CDATA[					<li class="icon-ranks"><a href="{U_RANKS}" title="{L_RANKS_EXPLAIN}">{L_RANKS}</a></li>]]></action>
-			</edit>
-		</open>
-		<open src="styles/prosilver/template/ucp_profile_profile_info.html">
-			<edit>
-				<find><![CDATA[	<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->]]></find>
-				<action type="after-add"><![CDATA[
-	<!-- IF S_RANK_THEME_OPTIONS -->
-	<dl>
-		<dt><label for="rank_theme">{L_UCP_RANK_THEME}:</label></dt>
-		<dd><select name="rank_theme" id="rank_theme">{S_RANK_THEME_OPTIONS}</select></dd>
-	</dl>
-	<!-- ENDIF -->]]></action>
-			</edit>
-		</open>
-		<open src="styles/prosilver/template/ucp_register.html">
-			<edit>
-				<find><![CDATA[		<dt><label for="tz">{L_TIMEZONE}:</label></dt>
-		<dd><select name="tz" id="tz" tabindex="7" class="autowidth">{S_TZ_OPTIONS}</select></dd>
-	</dl>]]></find>
-				<action type="after-add"><![CDATA[
-	<!-- IF S_RANK_THEME_OPTIONS -->
-	<dl>
-		<dt><label for="rank_theme">{L_UCP_RANK_THEME}:</label></dt>
-		<dd><select name="rank_theme" id="rank_theme">{S_RANK_THEME_OPTIONS}</select></dd>
-	</dl>
-	<!-- ENDIF -->]]></action>
-			</edit>
-		</open>
-		<open src="styles/prosilver/theme/bidi.css">
-			<edit>
-				<find><![CDATA[.rtl .icon-bookmark, .rtl .icon-bump, .rtl .icon-subscribe, .rtl .icon-unsubscribe, .rtl .icon-pages, .rtl .icon-search {]]></find>
-				<inline-edit>
-					<inline-find>{</inline-find>
-					<inline-action type="before-add"><![CDATA[, .rtl .icon-ranks]]></inline-action>
-				</inline-edit>
-			</edit>
-		</open>
-		<open src="styles/prosilver/theme/buttons.css">
-			<edit>
-				<find><![CDATA[.icon-bookmark, .icon-bump, .icon-subscribe, .icon-unsubscribe, .icon-pages, .icon-search {]]></find>
-				<inline-edit>
-					<inline-find>{</inline-find>
-					<inline-action type="before-add"><![CDATA[, .icon-ranks]]></inline-action>
-				</inline-edit>
-			</edit>
-		</open>
-		<open src="styles/prosilver/theme/colours.css">
-			<edit>
-				<find><![CDATA[.icon-search					{ background-image: url("{T_THEME_PATH}/images/icon_search.gif"); }]]></find>
-				<action type="after-add"><![CDATA[.icon-ranks					{ background-image: url("{T_THEME_PATH}/images/icon_ranks.gif"); }]]></action>
-			</edit>
-		</open>
-		<open src="viewtopic.php">
-			<edit>
-				<find><![CDATA[			get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);]]></find>
-				<inline-edit>
-					<inline-find>);</inline-find>
-					<inline-action type="before-add"><![CDATA[, $row['user_rank_theme']]]></inline-action>
-				</inline-edit>
-			</edit>
-		</open>
-		<diy-instructions lang="en">Ensure that you have run the SQL queries at the start of the MOD. These can be run from a command-line session or through an application such as phpMyAdmin.
-
-Clear the template cache. Either log in to your server via FTP/SSH and delete cache/tpl_* or log in to the ACP, go to the "Styles" tab then the "Templates" style component, then click "Refresh" for each template and confirm the cache clearing.
-
-Clear the rank theme cache. Either create a new rank, which should rebuild the cache, or delete cache/data_ranks.php.
-
-Add the additional permissions by pointing your browser to http://example.com/forums/install/install_MultiRaceRankThemesPermissions.php (where "example.com/forums/" is the location of your forums), then delete the install_MultiRaceRankThemesPermissions.php file.
-
-Add the "can change rank theme" permission to groups who should be able to change their rank theme. The default is to not allow rank theme changing. With a default forum the easiest way to add the permission to all users is to change the "Standard Features" User Role permission to "Yes" value under the Profile tab.</diy-instructions>
-	</action-group>
-</mod>
\ No newline at end of file
--- a/contrib/Upgrade-1.2.4.xml	Sat Mar 20 16:49:45 2010 +0000
+++ b/contrib/Upgrade-1.2.4.xml	Mon Aug 02 19:30:31 2010 +0000
@@ -6,7 +6,7 @@
       security problems within the MOD. No support will be given for MODs not
       found within the MODs Database which can be found at
       http://www.phpbb.com/mods/-->
-<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.3.xsd">
+<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
 	<header>
 		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
 		<title lang="en-gb">Multi-Race Rank Themes - Upgrade Instructions</title>
@@ -25,9 +25,9 @@
 			</author>
 		</author-group>
 		<link-group>
-			<link type="parent" href="../Install.xml" lang="en-gb">Main instructions</link>
-		</link-group>
-		<mod-version>1.3.6</mod-version>
+			<link type="parent" href="../install.xml" lang="en-gb">Main instructions</link>
+		</link-group>
+		<mod-version>1.4.0</mod-version>
 		<installation>
 			<level>intermediate</level>
 			<time>300</time>
@@ -35,6 +35,13 @@
 		</installation>
 		<history>
 			<entry>
+				<date>2010-08-02</date>
+				<rev-version>1.4.0</rev-version>
+				<changelog lang="en-gb">
+					<change>Update to final 1.4.0 release - no changes</change>
+				</changelog>
+			</entry>
+			<entry>
 				<date>2010-03-20</date>
 				<rev-version>1.3.6</rev-version>
 				<changelog lang="en-gb">
--- a/contrib/modx.prosilver.en.xsl	Sat Mar 20 16:49:45 2010 +0000
+++ b/contrib/modx.prosilver.en.xsl	Mon Aug 02 19:30:31 2010 +0000
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- MODX by the phpBB MOD Team XSL file v1.2.3 copyright 2005-2009 the phpBB MOD Team.
+<!-- MODX by the phpBB MOD Team XSL file v1.2.4 copyright 2005-2010 the phpBB MOD Team.
 	This file is released under the GNU GPL version 2.  See license.txt.
-	$Id: modx.prosilver.en.xsl 3407 2009-10-26 01:49:01Z Raimon $ -->
+	$Id: modx.prosilver.en.xsl 211 2010-02-27 20:05:11Z tumba25 $ -->
 <!DOCTYPE xsl:stylesheet[
 	<!ENTITY nbsp "&#160;">
 ]>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:mod="http://www.phpbb.com/mods/xml/modx-1.2.3.xsd">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:mod="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
 	<xsl:output method="html" omit-xml-declaration="no" indent="yes" />
 	<xsl:variable name="title" select="mod:mod/mod:header/mod:title" />
 	<xsl:variable name="version">
@@ -410,12 +410,12 @@
 
 dl.author-info dd { margin-left:112px; margin-bottom:8px; }
 .rtl dl.author-info dd { margin-left:112px; margin-bottom:8px; }
-ol#file-copy { padding:5px; margin-left:20px; margin-right:20px; margin-bottom:10px; }
-ol#file-copy li { margin-left:30px; margin-right:30px; vertical-align:top;}
-ol#file-copy span { font-weight:bold; }
-ol#file-copy dt {margin-right:5px; float:none !important }
-ol#file-copy dl {width:100%}
-h2#lang-fca, h2#lang-edts, h2#lang-diy, h2#lang-sql { margin-left:5px; }
+ol#file-copy, ol#file-delete { padding:5px; margin-left:20px; margin-right:20px; margin-bottom:10px; }
+ol#file-copy li, ol#file-delete li { margin-left:30px; margin-right:30px; vertical-align:top;}
+ol#file-copy span, ol#file-delete span { font-weight:bold; }
+ol#file-copy dt, ol#file-delete dt {margin-right:5px; float:none !important }
+ol#file-copy dl, ol#file-delete dl {width:100%}
+h2#lang-fca, h2#lang-edts, h2#lang-diy, h2#lang-sql, h2#lang-installer-h2, h2#lang-del-head { margin-left:5px; }
 
 /* Code block */
 div.codebox {
@@ -511,6 +511,11 @@
 						mhcls_ll.push('<xsl:value-of select="generate-id()"/>');
 					</xsl:if>
 				</xsl:for-each>
+
+				var link_ll = [];
+				<xsl:for-each select="mod:link-group/mod:link">
+					link_ll.push('<xsl:value-of select="generate-id()"/>');
+				</xsl:for-each>
 			</xsl:for-each>
 
 			var opens_ll = [];
@@ -529,8 +534,10 @@
 			</xsl:for-each>
 
 			var finds_ll = [];
+			var removes_ll = [];
 			var regex_ll = [];
 			var ifinds_ll = [];
+			var iremoves_ll = [];
 			var iregex_ll = [];
 			var addafters_ll = [];
 			var iaddafters_ll = [];
@@ -545,6 +552,9 @@
 				<xsl:for-each select="mod:find">
 					finds_ll.push('<xsl:value-of select="generate-id()"/>');
 				</xsl:for-each>
+				<xsl:for-each select="mod:remove">
+					removes_ll.push('<xsl:value-of select="generate-id()"/>');
+				</xsl:for-each>
 				<xsl:if test="count(mod:comment) > 0">
 					comments_ll.push('<xsl:value-of select="generate-id()"/>');
 				</xsl:if>
@@ -572,6 +582,9 @@
 							iregex_ll.push('<xsl:value-of select="generate-id()"/>');
 						</xsl:if>
 					</xsl:for-each>
+					<xsl:for-each select="mod:inline-remove">
+						iremoves_ll.push('<xsl:value-of select="generate-id()"/>');
+					</xsl:for-each>
 					<xsl:for-each select="mod:inline-find|mod:inline-action">
 						codes_ll.push('<xsl:value-of select="generate-id()"/>');
 						<xsl:if test="name() = 'inline-action'">
@@ -601,6 +614,11 @@
 				copies_ll.push('<xsl:value-of select="generate-id()"/>');
 			</xsl:for-each>
 
+			var delete_ll = [];
+			<xsl:for-each select="mod:action-group/mod:delete/mod:file">
+				delete_ll.push('<xsl:value-of select="generate-id()"/>');
+			</xsl:for-each>
+
 			<xsl:text disable-output-escaping="yes">
 <![CDATA[
 // The following line from http://www.ryancooper.com/resources/keycode.asp
@@ -643,7 +661,7 @@
 "lic=License\n" +
 "lict=This MOD has been licensed under the following license:\n" +
 "ont=and other notes\n" +
-"ontt1=Before adding this MOD to your forum, you should back up all files related to this MOD.\n" +
+"ontt1=Before adding this MOD to your forum, you should back up all files and databases related to this MOD.\n" +
 "ontt2=This MOD was designed for phpBB\n" +
 "ontt3=and may not function as stated on other phpBB versions. MODs for phpBB 3.0 will <strong>not</strong> work on phpBB 2.0 and vice versa.\n" +
 "onttq=This MOD is development quality. It is not recommended that you install it on a live forum.\n" +
@@ -659,24 +677,28 @@
 "cm-cmt=Comments\n" +
 "fnd=Find\n" +
 "fndt=<strong>Tip:</strong> This may be a partial find and not the whole line.\n" +
+"remove=Find and Delete\n" +
+"removet=<strong>Tip:</strong> Find and delete this code.\n" +
 "rplw=Replace with\n" +
 "rplwt=<strong>Tip:</strong> Replace the preceding line(s) to find with the following lines.\n" +
 "aft=Add after\n" +
 "aftt=<strong>Tip:</strong> Add these lines on a new blank line after the preceding line(s) to find.\n" +
 "bef=Add before\n" +
 "beft=<strong>Tip:</strong> Add these lines on a new blank line before the preceding line(s) to find.\n" +
-"inc=Increment\n" +
-"inct=<strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.\n" +
+"inc=Operation\n" +
+"inct=<strong>Tip:</strong> This allows you to alter integers.\n" +
 "ifnd=In-line Find\n" +
 "ifndt=<strong>Tip:</strong> This is a partial match of a line for in-line operations.\n" +
+"iremove=In-line Find and Delete\n" +
+"iremovet=<strong>Tip:</strong> Find this code in the line and delete it.\n" +
 "irplw=In-line Replace with\n" +
 "irplwt=\n" +
 "iaft=In-line Add after\n" +
 "iaftt=\n" +
 "ibef=In-line Add before\n" +
 "ibeft=\n" +
-"iinc=In-line Increment\n" +
-"iinct=<strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.\n" +
+"iinc=In-line Operation\n" +
+"iinct=<strong>Tip:</strong> This allows you to alter integers.\n" +
 "diy=DIY instructions\n" +
 "diyt=These are manual instructions that cannot be performed automatically. You should follow these instructions carefully.\n" +
 "eom=Save all files. End of MOD.\n" +
@@ -684,7 +706,7 @@
 "slg=Select language:\n" +
 "dbms=Select Database Type:\n" +
 "foot=MOD UA XSLT File Copyright &#169; 2007 The phpBB Group, this MOD is copyright to the authors listed above.\n" +
-"regex=This find contains an advanced feature known as regular expressions, click here to learn more.\n" +
+"regex=This find contains an advanced feature known as regular expressions.\n" +
 "mhe-v=- Version\n" +
 "mh=MOD history\n" +
 "addtl-modx=Additional MODX files\n" +
@@ -694,7 +716,16 @@
 "link-l=Language\n" +
 "link-p=Parent\n" +
 "link-te=Template\n" +
+"link-txt=Text file\n" +
 "link-tl=Template lang\n" +
+"link-un=Uninstall instructions\n" +
+"installer-h2=PHP install file\n" +
+"installer-exp1=There is a PHP install file that needs to be run in order to complete the installation.\n" +
+"installer-exp2=To run it point your browser to, for example,\n" +
+"ispt-int=Support in your language <strong>might</strong> be available at a <a href=\"http://www.phpbb.com/support/intl/\">international support site</a>.\n" +
+"del-heads=Delete files\n" +
+"del-head=Delete file\n" +
+"del-file=Delete\n" +
 "atm=About this MOD";
 
 var box = codes_ll;
@@ -704,23 +735,27 @@
 var arrClasCnt = [
 	['a-'	, authors_ll		],
 	['c-'	, copies_ll			],
+	['del-'	, delete_ll			],
 	['cm-'	, comments_ll		],
 	['opn'	, opens_ll			],
 	['cde-'	, codes_ll			],
 	['edt-'	, edits_ll			],
 	['fnd'	, finds_ll			],
+	['fnd'	, removes_ll			],
 	['regex', regex_ll			],
 	['rplw'	, replacewiths_ll	],
 	['aft'	, addafters_ll		],
 	['bef'	, addbefores_ll		],
 	['inc'	, increments_ll		],
 	['ifnd'	, ifinds_ll			],
+	['ifnd'	, iremoves_ll			],
 	['regex', iregex_ll			],
 	['irplw', ireplacewiths_ll	],
 	['iaft'	, iaddafters_ll		],
 	['ibef'	, iaddbefores_ll	],
 	['iinc'	, iincrements_ll	],
-	['mhe'	, mhes_ll			]
+	['mhe'	, mhes_ll			],
+	['link', link_ll]
 ];
 
 function startup()
@@ -1118,8 +1153,6 @@
 
 	var rtl_float = (ie) ? 'styleFloat' : 'cssFloat';
 
-//alert(rtl_spec.length);
-
 	if(direction == 'rtl')
 	{
 		for(j = 0; j < dts.length; j++)
@@ -1636,7 +1669,7 @@
 
 	<xsl:template name="give-header">
 		<fieldset>
-		<legend id="lang-atm">About this MOD</legend>
+			<legend id="lang-atm">About this MOD</legend>
 			<div class="mod-about">
 				<span class="corners-top"><span></span></span>
 				<dl>
@@ -1692,45 +1725,45 @@
 						<xsl:call-template name="give-installation"></xsl:call-template>
 					</xsl:for-each>
 					<xsl:if test="mod:author-notes != 'N/A' and mod:author-notes != 'n/a' and mod:author-notes != ''">
-					<dt id="lang-ant" name="left4px">Author notes:</dt>
-					<dd>
-						<xsl:if test="count(mod:author-notes) > 1">
-							<dl id="author-notes" class="nopadding">
-								<xsl:for-each select="mod:author-notes">
-									<dt><xsl:value-of select="@lang" /></dt>
-									<dd lang="{@lang}">
-										<p>
-											<xsl:call-template name="add-line-breaks">
-												<xsl:with-param name="string"><xsl:value-of select="current()" /></xsl:with-param>
-											</xsl:call-template>
-										</p>
-									</dd>
-								</xsl:for-each>
-							</dl>
-						</xsl:if>
-						<xsl:if test="count(mod:author-notes) = 1">
-							<p lang="{@lang}">
-								<xsl:call-template name="add-line-breaks">
-									<xsl:with-param name="string"><xsl:value-of select="mod:author-notes" /></xsl:with-param>
-								</xsl:call-template>
-							</p>
-						</xsl:if>
-					</dd>
+						<dt id="lang-ant" name="left4px">Author notes:</dt>
+						<dd>
+							<xsl:if test="count(mod:author-notes) > 1">
+								<dl id="author-notes" class="nopadding">
+									<xsl:for-each select="mod:author-notes">
+										<dt><xsl:value-of select="@lang" /></dt>
+										<dd lang="{@lang}">
+											<p>
+												<xsl:call-template name="add-line-breaks">
+													<xsl:with-param name="string"><xsl:value-of select="current()" /></xsl:with-param>
+												</xsl:call-template>
+											</p>
+										</dd>
+									</xsl:for-each>
+								</dl>
+							</xsl:if>
+							<xsl:if test="count(mod:author-notes) = 1">
+								<p lang="{@lang}">
+									<xsl:call-template name="add-line-breaks">
+										<xsl:with-param name="string"><xsl:value-of select="mod:author-notes" /></xsl:with-param>
+									</xsl:call-template>
+								</p>
+							</xsl:if>
+						</dd>
 					</xsl:if>
 				</dl>
 				<span class="corners-bottom"><span></span></span>
 			</div>
 		</fieldset>
 		<fieldset>
-		<xsl:for-each select="mod:author-group">
-			<xsl:if test="count(mod:author) > 1">
-				<legend id="lang-aus">Authors</legend>
-			</xsl:if>
-			<xsl:if test="count(mod:author) = 1">
-				<legend id="lang-au">Author</legend>
-			</xsl:if>
-			<xsl:call-template name="give-authors"></xsl:call-template>
-		</xsl:for-each>
+			<xsl:for-each select="mod:author-group">
+				<xsl:if test="count(mod:author) > 1">
+					<legend id="lang-aus">Authors</legend>
+				</xsl:if>
+				<xsl:if test="count(mod:author) = 1">
+					<legend id="lang-au">Author</legend>
+				</xsl:if>
+				<xsl:call-template name="give-authors"></xsl:call-template>
+			</xsl:for-each>
 		</fieldset>
 		<xsl:if test="count(../mod:action-group/mod:open) > 0">
 			<h3 id="lang-fte">Files to edit</h3>
@@ -1753,26 +1786,34 @@
 		<ul class="link-group" id="link-group">
 			<xsl:for-each select="mod:link-group/mod:link">
 				<li lang="{@lang}">
-					<span class="link-group-lang"><xsl:value-of select="@lang" />&nbsp;</span><strong>
+					<span class="link-group-lang"><xsl:value-of select="@lang" />&nbsp;</span>
+					<strong>
+						<xsl:if test="@type = 'contrib'">
+							<span id="lang-link-c[{generate-id()}]">Contrib</span>:
+						</xsl:if>
 						<xsl:if test="@type = 'dependency'">
-							<span id="lang-link-d">Dependency</span>:
+							<span id="lang-link-d[{generate-id()}]">Dependency</span>:
+						</xsl:if>
+						<xsl:if test="@type = 'language'">
+							<span id="lang-link-l[{generate-id()}]">Language</span>:
+						</xsl:if>
+						<xsl:if test="@type = 'parent'">
+							<span id="lang-link-p[{generate-id()}]">Parent</span>:
 						</xsl:if>
 						<xsl:if test="@type = 'template'">
-							<span id="lang-link-te">Template</span>:
-						</xsl:if>
-						<xsl:if test="@type = 'contrib'">
-							<span id="lang-link-c">Contrib</span>:
-						</xsl:if>
-						<xsl:if test="@type = 'language'">
-							<span id="lang-link-l">Language</span>:
+							<span id="lang-link-te[{generate-id()}]">Template</span>:
 						</xsl:if>
 						<xsl:if test="@type = 'template-lang'">
-							<span id="lang-link-tl">Template lang</span>:
+							<span id="lang-link-tl[{generate-id()}]">Template lang</span>:
+						</xsl:if>
+						<xsl:if test="@type = 'text'">
+							<span id="lang-link-txt[{generate-id()}]">Text file</span>:
 						</xsl:if>
-						<xsl:if test="@type = 'parent'">
-							<span id="lang-link-p">Parent</span>:
+						<xsl:if test="@type = 'uninstall'">
+							<span id="lang-link-un[{generate-id()}]">Uninstall instructions</span>:
 						</xsl:if>
-					</strong>&nbsp;<a href="{@href}"><xsl:value-of select="current()" /></a>
+					</strong>
+					&nbsp;<a href="{@href}"><xsl:value-of select="current()" /></a>
 				</li>
 			</xsl:for-each>
 		</ul>
@@ -1781,16 +1822,16 @@
 			<h3><span id="lang-dcl">Disclaimer</span>&nbsp;<span id="lang-ont">and other notes</span></h3>
 			<div class="mod-about">
 				<span class="corners-top"><span></span></span>
-					<div class="mod-about-padding">
+				<div class="mod-about-padding">
 					<p><span id="lang-dclt">For security purposes, please check: <a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a> for the latest version of this MOD. Downloading this MOD from other sites could cause malicious code to enter into your phpBB Forum. As such, phpBB will not offer support for MODs not offered in our MODs database, located at: <a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a></span></p>
-					<p><span id="lang-ontt1">Before adding this MOD to your forum, you should back up all files related to this MOD.</span></p>
+					<p><span id="lang-ontt1">Before adding this MOD to your forum, you should back up all files and databases related to this MOD.</span></p>
 					<p><span id="lang-ontt2">This MOD was designed for phpBB</span><xsl:text> </xsl:text><xsl:value-of select="mod:installation/mod:target-version" /><xsl:text> </xsl:text>&nbsp;<span id="lang-ontt3">and may not function as stated on other phpBB versions. MODs for phpBB 3.0 will <strong>not</strong> work on phpBB 2.0 and vice versa.</span></p>
 					<xsl:for-each select="./mod:mod-version">
 						<xsl:if test="substring-before(current(), '.') = 0">
 							<p><strong class="red"><span id="lang-onttq">This MOD is development quality. It is not recommended that you install it on a live forum.</span></strong></p>
 						</xsl:if>
 					</xsl:for-each>
-					</div>
+				</div>
 				<span class="corners-bottom"><span></span></span>
 			</div>
 		</div>
@@ -1798,11 +1839,12 @@
 			<h3><span id="lang-lic">License</span>&nbsp;<span id="lang-isp">and English support</span></h3>
 			<div class="mod-about">
 				<span class="corners-top"><span></span></span>
-					<div class="mod-about-padding">
+				<div class="mod-about-padding">
 					<p><span id="lang-lict">This MOD has been licensed under the following license:</span></p>
 					<p style='white-space:pre;'><a href="license.txt"><xsl:value-of select="mod:license" /></a></p>
 					<p><span id="lang-ispt">English support can be obtained at <a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a> for released MODs.</span></p>
-					</div>
+					<p><span id="lang-ispt-int">Support in your language <strong>might</strong> be available at a <a href="http://www.phpbb.com/support/intl/">international support site</a>.</span></p>
+				</div>
 				<span class="corners-bottom"><span></span></span>
 			</div>
 			<xsl:for-each select="mod:history">
@@ -1824,23 +1866,31 @@
 								<xsl:when test="@phpbbcom = 'no' or @phpbbcom = 'No' or @phpbbcom = 'NO'">
 									<dd name="author-dd"><span dir="ltr"><xsl:value-of select="$authorname" /></span></dd>
 								</xsl:when>
+
 								<xsl:otherwise>
-									<xsl:variable name="authortemp">
-										<xsl:call-template name="replaceCharsInString">
-											<xsl:with-param name="stringIn" select="string($authorname)"/>
-											<xsl:with-param name="charsIn" select="'#'"/>
-											<xsl:with-param name="charsOut" select="'%23'"/>
+									<xsl:variable name="authorurl">
+										<xsl:call-template name="validate-username">
+											<xsl:with-param name="string-in" select="string($authorname)"/>
 										</xsl:call-template>
 									</xsl:variable>
-									<xsl:variable name="authorurl">
-										<xsl:call-template name="replaceCharsInString">
-											<xsl:with-param name="stringIn" select="string($authortemp)"/>
-											<xsl:with-param name="charsIn" select="' '"/>
-											<xsl:with-param name="charsOut" select="'%20'"/>
-										</xsl:call-template>
-									</xsl:variable>
-									<dd name="author-dd"><a dir="ltr" href="http://www.phpbb.com/community/memberlist.php?mode=viewprofile&amp;un={$authorurl}"><xsl:value-of select="$authorname" /></a></dd>
+
+									<xsl:variable name="browserEngine" select="system-property('xsl:vendor')" />
+									<xsl:choose>
+										<xsl:when test="$browserEngine='Opera'">
+											<xsl:variable name="operaurl">
+												<xsl:call-template name="validate-opera">
+													<xsl:with-param name="string-in" select="string($authorurl)"/>
+												</xsl:call-template>
+											</xsl:variable>
+											<dd name="author-dd"><a dir="ltr" href="http://www.phpbb.com/community/memberlist.php?mode=viewprofile&amp;un={$operaurl}"><xsl:value-of select="$authorname" /></a></dd>
+										</xsl:when>
+										<xsl:otherwise>
+											<dd name="author-dd"><a dir="ltr" href="http://www.phpbb.com/community/memberlist.php?mode=viewprofile&amp;un={$authorurl}"><xsl:value-of select="$authorname" /></a></dd>
+										</xsl:otherwise>
+
+									</xsl:choose>
 								</xsl:otherwise>
+
 							</xsl:choose>
 						</xsl:for-each>
 						<xsl:if test="mod:email != 'N/A' and mod:email != 'n/a' and mod:email != ''">
@@ -2043,23 +2093,49 @@
 					<xsl:for-each select="mod:sql">
 						<xsl:call-template name="give-sql"></xsl:call-template>
 					</xsl:for-each>
-				<span class="corners-bottom"><span></span></span></div>
+				<span class="corners-bottom"><span></span></span>
+			</div>
 		</xsl:if>
 		<xsl:if test="count(mod:copy) > 0">
 			<xsl:for-each select="mod:copy">
 				<xsl:call-template name="give-filez"></xsl:call-template>
 			</xsl:for-each>
 		</xsl:if>
+		<xsl:if test="count(mod:delete) > 0">
+			<xsl:for-each select="mod:delete">
+				<xsl:call-template name="away-filez"></xsl:call-template>
+			</xsl:for-each>
+		</xsl:if>
 		<xsl:if test="count(mod:open) > 0">
-		<h2 id="lang-edts">Edits</h2>
-		<p><span class="key">s</span><span class="key">w</span><span class="key">x</span><span id="lang-edtt">Use your keyboard to navigate the code boxes. You may also hit '<em>s</em>' on your keyboard to go to the first code box.</span></p>
-		<div id="edits">
-			<div class="inner">
-				<xsl:for-each select="mod:open">
-					<xsl:call-template name="give-fileo"></xsl:call-template>
-				</xsl:for-each>
+			<h2 id="lang-edts">Edits</h2>
+			<p><span class="key">s</span><span class="key">w</span><span class="key">x</span><span id="lang-edtt">Use your keyboard to navigate the code boxes. You may also hit '<em>s</em>' on your keyboard to go to the first code box.</span></p>
+			<div id="edits">
+				<div class="inner">
+					<xsl:for-each select="mod:open">
+						<xsl:call-template name="give-fileo"></xsl:call-template>
+					</xsl:for-each>
+				</div>
 			</div>
-		</div>
+		</xsl:if>
+		<xsl:if test="count(mod:php-installer) > 0">
+			<h2 id="lang-installer-h2">PHP install file</h2>
+			<div class="mod-about">
+				<span class="corners-top"><span></span></span>
+					<div class="mod-about-padding">
+						<p>
+							<span id="lang-installer-exp1">There is a PHP install file that needs to be run in order to complete the installation.</span>
+							<br />
+							<span id="lang-installer-exp2">To run it point your browser to, for example,</span><span dir="ltr"> domain.tld/phpBB3/<xsl:value-of select="mod:php-installer" /></span>
+						</p>
+						<div class="content">
+							<div class="codebox">
+								<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select All</span></a></div>
+								<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="mod:php-installer" /></pre></div>
+							</div>
+						</div>
+					</div>
+				<span class="corners-bottom"><span></span></span>
+			</div>
 		</xsl:if>
 		<xsl:call-template name="give-manual" />
 	</xsl:template>
@@ -2126,12 +2202,12 @@
 								</dl>
 							</div>
 						</xsl:if>
-						<xsl:for-each select="mod:find|mod:action|mod:inline-edit">
+						<xsl:for-each select="mod:find|mod:remove|mod:action|mod:inline-edit">
 							<xsl:if test="name() = 'find'">
 								<h4 id="lang-fnd[{generate-id()}]">Find</h4>
 								<p><span id="lang-fndt[{generate-id()}]"><strong>Tip:</strong> This may be a partial find and not the whole line.</span>
 									<xsl:if test="@type = 'regex'">
-										<br /><em id="lang-regex[{generate-id()}]">This find contains an advanced feature known as regular expressions, click here to learn more.</em>
+										<br /><em id="lang-regex[{generate-id()}]">This find contains an advanced feature known as regular expressions.</em>
 									</xsl:if>
 								</p>
 								<div class="codebox">
@@ -2139,22 +2215,30 @@
 									<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="current()" /></pre></div>
 								</div>
 							</xsl:if>
+							<xsl:if test="name() = 'remove'">
+								<h4 id="lang-remove[{generate-id()}]" style="color: #FF0FFF;">Find and Delete</h4>
+								<p><span id="lang-removet[{generate-id()}]"><strong>Tip:</strong>  Find and delete this code.</span></p>
+								<div class="codebox">
+									<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select All</span></a></div>
+									<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="current()" /></pre></div>
+								</div>
+							</xsl:if>
 							<xsl:if test="name() = 'action'">
 								<xsl:if test="@type = 'after-add'">
-									<h4 id="lang-aft[{generate-id()}]">Add after</h4>
+									<h4 id="lang-aft[{generate-id()}]" style="color: #009933;">Add after</h4>
 									<p><span id="lang-aftt[{generate-id()}]"><strong>Tip:</strong> Add these lines on a new blank line after the preceding line(s) to find.</span></p>
 								</xsl:if>
 								<xsl:if test="@type = 'before-add'">
-									<h4 id="lang-bef[{generate-id()}]">Add before</h4>
+									<h4 id="lang-bef[{generate-id()}]" style="color: #AC1987;">Add before</h4>
 									<p><span id="lang-beft[{generate-id()}]"><strong>Tip:</strong> Add these lines on a new blank line before the preceding line(s) to find.</span></p>
 								</xsl:if>
 								<xsl:if test="@type = 'replace-with'">
-									<h4 id="lang-rplw[{generate-id()}]">Replace with</h4>
+									<h4 id="lang-rplw[{generate-id()}]" style="color: #AE1616;">Replace with</h4>
 									<p><span id="lang-rplwt[{generate-id()}]"><strong>Tip:</strong> Replace the preceding line(s) to find with the following lines.</span></p>
 								</xsl:if>
 								<xsl:if test="@type = 'operation'">
-									<h4 id="lang-inc[{generate-id()}]">Increment</h4>
-									<p><span id="lang-inct[{generate-id()}]"><strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.</span></p>
+									<h4 id="lang-inc[{generate-id()}]" style="color: #333333;">Operation</h4>
+									<p><span id="lang-inct[{generate-id()}]"><strong>Tip:</strong> This allows you to alter integers.</span></p>
 								</xsl:if>
 								<div class="codebox">
 									<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select all</span></a></div>
@@ -2163,12 +2247,12 @@
 							</xsl:if>
 							<xsl:if test="name() = 'inline-edit'">
 								<div class="mod-inlineedit">
-									<xsl:for-each select="mod:inline-find|mod:inline-action|mod:inline-comment">
+									<xsl:for-each select="mod:inline-find|mod:inline-remove|mod:inline-action|mod:inline-comment">
 										<xsl:if test="name() = 'inline-find'">
 											<h5 id="lang-ifnd[{generate-id()}]">In-line Find</h5>
 											<p><span id="lang-ifndt[{generate-id()}]"><strong>Tip:</strong> This is a partial match of a line for in-line operations.</span>
 												<xsl:if test="@type = 'regex'">
-													<br /><em id="lang-regex[{generate-id()}]">This find contains an advanced feature known as regular expressions, click here to learn more.</em>
+													<br /><em id="lang-regex[{generate-id()}]">This find contains an advanced feature known as regular expressions.</em>
 												</xsl:if>
 											</p>
 											<div class="codebox">
@@ -2176,22 +2260,30 @@
 												<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="current()" /></pre></div>
 											</div>
 										</xsl:if>
+										<xsl:if test="name() = 'inline-remove'">
+											<h5 id="lang-iremove[{generate-id()}]" style="color: #FF0FFF;">In-line Find and Delete</h5>
+											<p><span id="lang-iremovet[{generate-id()}]"><strong>Tip:</strong> Find this code in the line and delete it.</span></p>
+											<div class="codebox">
+												<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select all</span></a></div>
+												<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="current()" /></pre></div>
+											</div>
+										</xsl:if>
 										<xsl:if test="name() = 'inline-action'">
 											<xsl:if test="@type = 'after-add'">
-												<h5 id="lang-iaft[{generate-id()}]">In-line Add after</h5>
+												<h5 id="lang-iaft[{generate-id()}]" style="color: #009933;">In-line Add after</h5>
 												<p><span id="lang-iaftt[{generate-id()}]"></span></p>
 											</xsl:if>
 											<xsl:if test="@type = 'before-add'">
-												<h5 id="lang-ibef[{generate-id()}]">In-line Add before</h5>
+												<h5 id="lang-ibef[{generate-id()}]" style="color: #AC1987;">In-line Add before</h5>
 												<p><span id="lang-ibeft[{generate-id()}]"></span></p>
 											</xsl:if>
 											<xsl:if test="@type = 'replace-with'">
-												<h5 id="lang-irplw[{generate-id()}]">In-line Replace with</h5>
+												<h5 id="lang-irplw[{generate-id()}]" style="color: #AE1616;">In-line Replace with</h5>
 												<p><span id="lang-irplwt[{generate-id()}]"></span></p>
 											</xsl:if>
 											<xsl:if test="@type = 'operation'">
-												<h5 id="lang-iinc[{generate-id()}]">In-line Increment</h5>
-												<p><span id="lang-iinct[{generate-id()}]"><strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.</span></p>
+												<h5 id="lang-iinc[{generate-id()}]" style="color: #333333;">In-line Operation</h5>
+												<p><span id="lang-iinct[{generate-id()}]"><strong>Tip:</strong> This allows you to alter integers.</span></p>
 											</xsl:if>
 											<div class="codebox">
 												<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select All</span></a></div>
@@ -2231,6 +2323,26 @@
 		</ol>
 	</xsl:template>
 
+	<xsl:template name="away-filez">
+		<xsl:choose>
+			<xsl:when test="count(mod:file) > 1">
+				<h2 id="lang-del-heads">Delete files</h2>
+			</xsl:when>
+			<xsl:otherwise>
+				<h2 id="lang-del-head">Delete file</h2>
+			</xsl:otherwise>
+		</xsl:choose>
+		<ol id="file-delete">
+			<xsl:for-each select="mod:file">
+				<li>
+					<dl>
+						<dt><span id="lang-del-file[{generate-id()}]">Delete:</span>&nbsp;<xsl:value-of select="@name" /></dt>
+					</dl>
+				</li>
+			</xsl:for-each>
+		</ol>
+	</xsl:template>
+
 	<!-- add-line-breaks borrowed from http://www.stylusstudio.com/xsllist/200103/post40180.html -->
 	<xsl:template name="add-line-breaks">
 		<xsl:param name="string" select="." />
@@ -2265,4 +2377,279 @@
 		</xsl:choose>
 	</xsl:template>
 
-</xsl:stylesheet>
+	<!-- Replace some chars -->
+	<xsl:template name="validate-username">
+		<xsl:param name="string-in"/>
+
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+
+		<xsl:call-template name="replaceCharsInString">
+			<xsl:with-param name="stringIn" select="string($string-in)"/>
+			<xsl:with-param name="charsIn" select="'#'"/>
+			<xsl:with-param name="charsOut" select="'%23'"/>
+		</xsl:call-template>
+
+		</xsl:with-param><xsl:with-param name="charsIn" select="'&amp;'"/><xsl:with-param name="charsOut" select="'%26'"/></xsl:call-template> <!-- & -->
+		</xsl:with-param><xsl:with-param name="charsIn" select="'+'"/><xsl:with-param name="charsOut" select="'%2B'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="' '"/><xsl:with-param name="charsOut" select="'%20'"/></xsl:call-template> <!-- space -->
+	</xsl:template>
+
+	<!-- This is only needed for Opera support, hiding it here at the bottom. -->
+	<xsl:template name="validate-opera">
+		<xsl:param name="string-in"/>
+
+		<!-- This doesn't follow any coding guidelines. But is easier to read this way -->
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+
+		<xsl:call-template name="replaceCharsInString">
+			<xsl:with-param name="stringIn" select="string($string-in)"/>
+			<xsl:with-param name="charsIn" select="'é'"/>
+			<xsl:with-param name="charsOut" select="'%C3%A9'"/>
+		</xsl:call-template>
+
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ÿ'"/><xsl:with-param name="charsOut" select="'%C3%BF'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'þ'"/><xsl:with-param name="charsOut" select="'%C3%BE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ý'"/><xsl:with-param name="charsOut" select="'%C3%BD'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ü'"/><xsl:with-param name="charsOut" select="'%C3%BC'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'û'"/><xsl:with-param name="charsOut" select="'%C3%BB'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ú'"/><xsl:with-param name="charsOut" select="'%C3%BA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ù'"/><xsl:with-param name="charsOut" select="'%C3%B9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ø'"/><xsl:with-param name="charsOut" select="'%C3%B8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'÷'"/><xsl:with-param name="charsOut" select="'%C3%B7'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ö'"/><xsl:with-param name="charsOut" select="'%C3%B6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'õ'"/><xsl:with-param name="charsOut" select="'%C3%B5'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ô'"/><xsl:with-param name="charsOut" select="'%C3%B4'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ó'"/><xsl:with-param name="charsOut" select="'%C3%B3'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ò'"/><xsl:with-param name="charsOut" select="'%C3%B2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ñ'"/><xsl:with-param name="charsOut" select="'%C3%B1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ð'"/><xsl:with-param name="charsOut" select="'%C3%B0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ï'"/><xsl:with-param name="charsOut" select="'%C3%AF'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'î'"/><xsl:with-param name="charsOut" select="'%C3%AE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'í'"/><xsl:with-param name="charsOut" select="'%C3%AD'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ì'"/><xsl:with-param name="charsOut" select="'%C3%AC'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ë'"/><xsl:with-param name="charsOut" select="'%C3%AB'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ê'"/><xsl:with-param name="charsOut" select="'%C3%AA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'é'"/><xsl:with-param name="charsOut" select="'%C3%A9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'è'"/><xsl:with-param name="charsOut" select="'%C3%A8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ç'"/><xsl:with-param name="charsOut" select="'%C3%A7'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'æ'"/><xsl:with-param name="charsOut" select="'%C3%A6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'å'"/><xsl:with-param name="charsOut" select="'%C3%A5'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ä'"/><xsl:with-param name="charsOut" select="'%C3%A4'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ã'"/><xsl:with-param name="charsOut" select="'%C3%A3'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'â'"/><xsl:with-param name="charsOut" select="'%C3%A2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'á'"/><xsl:with-param name="charsOut" select="'%C3%A1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'à'"/><xsl:with-param name="charsOut" select="'%C3%A0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ß'"/><xsl:with-param name="charsOut" select="'%C3%9F'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Þ'"/><xsl:with-param name="charsOut" select="'%C3%9E'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ý'"/><xsl:with-param name="charsOut" select="'%C3%9D'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ü'"/><xsl:with-param name="charsOut" select="'%C3%9C'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Û'"/><xsl:with-param name="charsOut" select="'%C3%9B'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ú'"/><xsl:with-param name="charsOut" select="'%C3%9A'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ù'"/><xsl:with-param name="charsOut" select="'%C3%99'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ø'"/><xsl:with-param name="charsOut" select="'%C3%98'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'×'"/><xsl:with-param name="charsOut" select="'%C3%97'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ö'"/><xsl:with-param name="charsOut" select="'%C3%96'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Õ'"/><xsl:with-param name="charsOut" select="'%C3%95'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ô'"/><xsl:with-param name="charsOut" select="'%C3%94'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ó'"/><xsl:with-param name="charsOut" select="'%C3%93'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ò'"/><xsl:with-param name="charsOut" select="'%C3%92'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ñ'"/><xsl:with-param name="charsOut" select="'%C3%91'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ð'"/><xsl:with-param name="charsOut" select="'%C3%90'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ï'"/><xsl:with-param name="charsOut" select="'%C3%8F'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Î'"/><xsl:with-param name="charsOut" select="'%C3%8E'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Í'"/><xsl:with-param name="charsOut" select="'%C3%8D'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ì'"/><xsl:with-param name="charsOut" select="'%C3%8C'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ë'"/><xsl:with-param name="charsOut" select="'%C3%8B'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ê'"/><xsl:with-param name="charsOut" select="'%C3%8A'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'É'"/><xsl:with-param name="charsOut" select="'%C3%89'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'È'"/><xsl:with-param name="charsOut" select="'%C3%88'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ç'"/><xsl:with-param name="charsOut" select="'%C3%87'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Æ'"/><xsl:with-param name="charsOut" select="'%C3%86'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Å'"/><xsl:with-param name="charsOut" select="'%C3%85'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ä'"/><xsl:with-param name="charsOut" select="'%C3%84'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ã'"/><xsl:with-param name="charsOut" select="'%C3%83'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Â'"/><xsl:with-param name="charsOut" select="'%C3%82'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Á'"/><xsl:with-param name="charsOut" select="'%C3%81'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'À'"/><xsl:with-param name="charsOut" select="'%C3%80'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¿'"/><xsl:with-param name="charsOut" select="'%C2%BF'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¾'"/><xsl:with-param name="charsOut" select="'%C2%BE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'½'"/><xsl:with-param name="charsOut" select="'%C2%BD'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¼'"/><xsl:with-param name="charsOut" select="'%C2%BC'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'»'"/><xsl:with-param name="charsOut" select="'%C2%BB'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'º'"/><xsl:with-param name="charsOut" select="'%C2%BA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¹'"/><xsl:with-param name="charsOut" select="'%C2%B9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¸'"/><xsl:with-param name="charsOut" select="'%C2%B8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'·'"/><xsl:with-param name="charsOut" select="'%C2%B7'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¶'"/><xsl:with-param name="charsOut" select="'%C2%B6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'µ'"/><xsl:with-param name="charsOut" select="'%C2%B5'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'´'"/><xsl:with-param name="charsOut" select="'%C2%B4'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'³'"/><xsl:with-param name="charsOut" select="'%C2%B3'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'²'"/><xsl:with-param name="charsOut" select="'%C2%B2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'±'"/><xsl:with-param name="charsOut" select="'%C2%B1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'°'"/><xsl:with-param name="charsOut" select="'%C2%B0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¯'"/><xsl:with-param name="charsOut" select="'%C2%AF'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'®'"/><xsl:with-param name="charsOut" select="'%C2%AE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¬'"/><xsl:with-param name="charsOut" select="'%C2%AC'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'«'"/><xsl:with-param name="charsOut" select="'%C2%AB'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ª'"/><xsl:with-param name="charsOut" select="'%C2%AA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'©'"/><xsl:with-param name="charsOut" select="'%C2%A9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¨'"/><xsl:with-param name="charsOut" select="'%C2%A8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'§'"/><xsl:with-param name="charsOut" select="'%C2%A7'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¦'"/><xsl:with-param name="charsOut" select="'%C2%A6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¥'"/><xsl:with-param name="charsOut" select="'%C2%A5'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¤'"/><xsl:with-param name="charsOut" select="'%C2%A4'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'£'"/><xsl:with-param name="charsOut" select="'%C2%A3'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¢'"/><xsl:with-param name="charsOut" select="'%C2%A2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¡'"/><xsl:with-param name="charsOut" select="'%C2%A1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ÿ'"/><xsl:with-param name="charsOut" select="'%C5%B8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ž'"/><xsl:with-param name="charsOut" select="'%C5%BE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'œ'"/><xsl:with-param name="charsOut" select="'%C5%93'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'›'"/><xsl:with-param name="charsOut" select="'%E2%80%BA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'š'"/><xsl:with-param name="charsOut" select="'%C5%A1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'™'"/><xsl:with-param name="charsOut" select="'%E2%84%A2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'˜'"/><xsl:with-param name="charsOut" select="'%CB%9C'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'—'"/><xsl:with-param name="charsOut" select="'%E2%80%94'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'–'"/><xsl:with-param name="charsOut" select="'%E2%80%93'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'•'"/><xsl:with-param name="charsOut" select="'%E2%80%A2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'”'"/><xsl:with-param name="charsOut" select="'%E2%80%9D'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'“'"/><xsl:with-param name="charsOut" select="'%E2%80%9C'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'’'"/><xsl:with-param name="charsOut" select="'%E2%80%99'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‘'"/><xsl:with-param name="charsOut" select="'%E2%80%98'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ž'"/><xsl:with-param name="charsOut" select="'%C5%BD'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Œ'"/><xsl:with-param name="charsOut" select="'%C5%92'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‹'"/><xsl:with-param name="charsOut" select="'%E2%80%B9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Š'"/><xsl:with-param name="charsOut" select="'%C5%A0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‰'"/><xsl:with-param name="charsOut" select="'%E2%80%B0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ˆ'"/><xsl:with-param name="charsOut" select="'%CB%86'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‡'"/><xsl:with-param name="charsOut" select="'%E2%80%A1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'†'"/><xsl:with-param name="charsOut" select="'%E2%80%A0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'…'"/><xsl:with-param name="charsOut" select="'%E2%80%A6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'„'"/><xsl:with-param name="charsOut" select="'%E2%80%9E'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ƒ'"/><xsl:with-param name="charsOut" select="'%C6%92'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‚'"/><xsl:with-param name="charsOut" select="'%E2%80%9A'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'€'"/><xsl:with-param name="charsOut" select="'%E2%82%AC'"/></xsl:call-template>
+	</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/install.xml	Mon Aug 02 19:30:31 2010 +0000
@@ -0,0 +1,1255 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
+<!--For security purposes, please check: http://www.phpbb.com/mods/ for the
+      latest version of this MOD. Although MODs are checked before being
+      allowed in the MODs Database there is no guarantee that there are no
+      security problems within the MOD. No support will be given for MODs not
+      found within the MODs Database which can be found at
+      http://www.phpbb.com/mods/-->
+<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
+	<header>
+		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
+		<title lang="en-gb">Multi-race rank themes</title>
+		<description lang="en-gb">This MOD will allow you to add, modify and remove rank themes.
+
+Rank themes are selectable collections of ranks that normal users can choose to use, allowing RPG forums to have different 'races' or allowing 'normal' forums to provide an set of alternative icon images for their users.
+
+Note that users with "special ranks" (normally Administrators etc.) will not get a theme selection in the UCP as the special rank is their rank theme. If users with special ranks want a themed rank image then you need to also install my "Special and Normal Rank Images" MOD.</description>
+		<author-notes lang="en-gb"><![CDATA[The following description is taken from digiTsai's phpBB2 'Rank themes' mod (with some minor modifications in the last paragraph), as I couldn't word it any better myself:
+
+Different ranking themes for your forum. Users are allowed to choose a ranking theme to their liking. For example, you can add two ranking themes named "Good" and "Evil" for your forum. The ranking then might look like this:
+
+Posts	| Good   | Evil
+Needed	| Ranks  | Ranks
+=========================
+0       | Knight | Zombie
+10      | Priest | Minion
+20      | Zealot | Demon
+50      | Angel	 | Devil
+
+So if one were to choose the "good" ranking, then he/she will go through the ranks Knight, Priest, Zealot, and finally Angel, but another user might decide to choose the "Evil" theme, he/she will go through the ranks Zombie, Minion, Demon, then Devil.
+
+On install, there are two ranking themes already added, "special" and "default". Ranks classified as special cannot be chosen by the public and will continue to override any rank theme selection, as is the phpBB3 default behaviour. The default ranking theme is the one a newly registered user has (unless they choose something else).
+]]></author-notes>
+		<author-group>
+			<author>
+				<realname>IBBoard</realname>
+				<email>phpbb@ibboard.co.uk</email>
+				<username>IBBoard</username>
+				<homepage>http://www.ibboard.co.uk</homepage>
+			</author>
+		</author-group>
+		<link-group>
+			<link type="template" href="subsilver2.xml" lang="en-gb">subsilver2</link>
+			<link type="contrib" href="contrib/Upgrade-1.2.4.xml" lang="en-gb">Upgrade instructions from v1.2.4</link>
+		</link-group>
+		<mod-version>1.4.1</mod-version>
+		<installation>
+			<level>intermediate</level>
+			<time>3600</time>
+			<target-version>3.0.7</target-version>
+		</installation>
+		<history>
+			<entry>
+				<date>2010-08-02</date>
+				<rev-version>1.4.1</rev-version>
+				<changelog lang="en-gb">
+					<change>Patch in v1.3.6 changes that got lost in machine swaps</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2010-08-02</date>
+				<rev-version>1.4.0</rev-version>
+				<changelog lang="en-gb">
+					<change>Update to final 1.4.0 release - no changes</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2010-03-20</date>
+				<rev-version>1.3.6</rev-version>
+				<changelog lang="en-gb">
+						<change>Fix: Ensure that $s_rank_theme_options is initialised - thanks to _RocknRoll for reporting it</change>
+						<change>Fix: Change RANKSET_TEXT to correct RANKTHEME_TEXT name in memberlist.php - thanks to _RocknRoll for reporting it</change>
+						<change>Fix: Correct $phpExt to $phpEx in rank list link generation - thanks to _RocknRoll for reporting it</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2010-03-02</date>
+				<rev-version>1.3.5</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Added instruction to include "user_rank_theme" field in "leaders" query - thanks to Anyasha for reporting it</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2010-02-12</date>
+				<rev-version>1.3.4</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Correct "find" instruction in styles/prosilver/template/ucp_register.html - thanks to Anyasha for reporting it</change>
+					<change>Fix: Correct names of folder from "themes" to "theme" - thanks to Anyasha for reporting it</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2010-02-11</date>
+				<rev-version>1.3.3</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Correct logic errors that stop the creation of rank themes - thanks to Anyasha for reporting it</change>
+					<change>Fix: Remove request for non-existant language file in install file - thanks to Anyasha for reporting it</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2009-06-15</date>
+				<rev-version>1.3.2</rev-version>
+				<changelog lang="en-gb">
+					<change>Add: Add missing multi-ranking to PM viewing</change>
+					<change>Fix: Backport changes from 1.2.4 to pass validation</change>
+					<change>Change: Change edits of get_user_rank() calls to find closing brackets and add before to ensure the optional parameters is at the end</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2009-05-17</date>
+				<rev-version>1.3.1</rev-version>
+				<changelog lang="en-gb">
+					<change>Change: Hide rank theme if user has a special rank (as per v1.2)</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2009-05-17</date>
+				<rev-version>1.3.0</rev-version>
+				<changelog lang="en-gb">
+					<change>Add: ACP interface for changing user's theme</change>
+					<change>Add: constant to define whether users can select ranks at registration</change>
+					<change>Add: permissions for changing rank theme</change>
+					<change>Fix: Remove hidden form field that would potentially allow user to change theme when they weren't supposed to</change>
+					<change>Fix: Use permissions to check and enforce whether people can change rank themes</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2009-05-10</date>
+				<rev-version>1.2.3</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Update to latest MODX format</change>
+					<change>Fix: Remove apology from author notes as the formatting of the new MODX styling is no longer broken for author notes</change>
+					<change>Fix: Fix closing tag in adm/style/acp_ranks.html template</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-04-29</date>
+				<rev-version>1.2.2</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Fix typo in tag name of instructions (no code functionality changes)</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-04-28</date>
+				<rev-version>1.2.1</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Fix some code formatting to pass validation (no code functionality changes)</change>
+					<change>Fix: Separate out subsilver instructions to templates/subsilver2.xml to pass validation (no code functionality changes)</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-04-12</date>
+				<rev-version>1.2.0</rev-version>
+				<changelog lang="en-gb">
+					<change>Update: No issues found in 1.1b7 - change to 1.2.0 and submit to MOD Database</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-03-29</date>
+				<rev-version>1.1.7</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: move one bracket to new line for code formatting to pass validation (fix copied from v1.0.3)</change>
+					<change>Fix: undefined variable $special_rank in includes/acp/acp_ranks.php by moving code (fix copied from v1.0.3)</change>
+					<change>Fix: Make rank theme ordering alphabetical but with 'default' at the start (thanks to ccole513 for finding the issue and supplying an initial fix)</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-03-29</date>
+				<rev-version>1.1.6</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Move UCP Profile rank list generation out of "if allowed birthdays" block (phpBB3 changed around that area for Gold, but instructions were pre-Gold). Only affects sites who disabled birthdays.</change>
+					<change>Add: subsilver theme instructions and files (requested and partially helped by gergokee)</change>
+					<change>Update: Minor tweaks to prosilver theme</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-03-28</date>
+				<rev-version>1.1.5</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Replace DEFAULT_RANK_THEME_ID with SPECIAL_RANK_THEME_ID in validation of rank theme in ucp_profile.php</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-03-23</date>
+				<rev-version>1.1.4</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Add ordering of ranks in a theme to memberslist.php (thanks to ccole513 for finding it)</change>
+					<change>Update: Make one instruction that involved adding to an associative array in acp_ranks.php clearer so that the comma doesn't get missed (thanks to ccole513 for finding it)</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-03-23</date>
+				<rev-version>1.1.3</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Add styling for rank theme list on registration page</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-03-23</date>
+				<rev-version>1.1.2</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Merge changes made to v1.0.x to pass MOD database submission.</change>
+					<change>Add: Rank theme selction on registration</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-01-20</date>
+				<rev-version>1.1.1</rev-version>
+				<changelog lang="en-gb">
+					<change>Add: Add rank theme pages to members list with prosilver styling.</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2008-01-20</date>
+				<rev-version>1.0.2</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Corrected ACP page so that the post count box shows by default, because 'default' theme is selected. Thanks to Scorpio for finding the strange behaviour.</change>
+					<change>Update: Update the change log with missed prefixes and a credit for catching a mistake.</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2007-12-29</date>
+				<rev-version>1.0.1</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Fixed XSL (changed back to Prosilver and replaced with valid XSL file). Thanks to Mitch1063 for finding the mistake.</change>
+					<change>Update: Used new feature of MODX format and moved to RC numbering.</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2007-12-13</date>
+				<rev-version>0.1.6</rev-version>
+				<changelog lang="en-gb">
+					<change>Update: Merged the template and language changes back into this file to pass mod validation check.</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2007-12-13</date>
+				<rev-version>0.1.5</rev-version>
+				<changelog lang="en-gb">
+					<change>Update: Checked for compatibility with phpBB3 Gold</change>
+					<change>Update: Moved template changes out to template/prosilver.xml</change>
+					<change>Update: Moved language changes out to languages/en.xml</change>
+					<change>Fix: Make some find instructions slightly less ambiguous</change>
+					<change>Fix: Alter some find instructions that have changed slightly from initial write to Gold</change>
+					<change>Fix: Include fix from http://www.phpbb.com/community/viewtopic.php?f=70&amp;t=554987&amp;st=0&amp;sk=t&amp;sd=a&amp;start=15#p3117909</change>
+					<change>Fix: Alter the UCP instructions so that they don't get caught in the "if birthday enabled" checks</change>
+					<change>Update: Replace some "after-add" instructions with inline edits (shorter and stops the duplicate calling of the method)</change>
+					<change>Update: Make use of inline changes</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2007-07-18</date>
+				<rev-version>0.1.4</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Added missing instruction to add the $rank_theme parameter to the get_user_rank function (parameter documentation was included before, but the parameter wasn't!)</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2007-07-13</date>
+				<rev-version>0.1.3</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Added missing "NO_RANKS_FOR_THEME" translation</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2007-07-06</date>
+				<rev-version>0.1.2</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: corrected SQL so that all tables used the "phpbb_" prefix</change>
+					<change>Fix: corrected SQL so that the new table had the correct charset</change>
+					<change>Fix: corrected XML document so that "find and replace" show as "find and replace" rather than a find with two code blocks</change>
+					<change>Change: changed a replace that replaced a line with a comment to a replace that replaced the line with a comment and the original line commented out (for clarity and so it doesn't look like code is missing)</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2007-06-26</date>
+				<rev-version>0.1.1</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Added "ALTER TABLE" command for phpbb_users table</change>
+				</changelog>
+			</entry>
+			<entry>
+				<date>2007-06-26</date>
+				<rev-version>0.1.0</rev-version>
+				<changelog lang="en-gb">
+					<change>Initial Version</change>
+				</changelog>
+			</entry>
+		</history>
+	</header>
+	<action-group>
+	    <sql><![CDATA[ALTER TABLE phpbb_users ADD user_rank_theme INT DEFAULT 1 NOT NULL ;
+ALTER TABLE phpbb_ranks ADD rank_theme INT DEFAULT 1 NOT NULL ;
+
+UPDATE phpbb_ranks SET rank_theme = -1 WHERE rank_special = 1;
+
+CREATE TABLE phpbb_rank_themes (
+  rtheme_id smallint(5) NOT NULL auto_increment,
+  rtheme_title varchar(50) default NULL,
+  rtheme_public tinyint(1) default '0',
+  PRIMARY KEY  (rtheme_id)
+) CHARSET=utf8 COLLATE=utf8_bin;
+
+INSERT INTO phpbb_rank_themes VALUES (-1, 'Special', 0);
+INSERT INTO phpbb_rank_themes VALUES (1, 'Default', 1);]]></sql>
+		<copy>
+			<file from="root/styles/prosilver/template/memberlist_ranks.html" to="styles/prosilver/template/memberlist_ranks.html" />
+			<file from="root/styles/prosilver/theme/images/icon_ranks.gif" to="styles/prosilver/theme/images/icon_ranks.gif" />
+			<file from="root/install/install_MultiRaceRankThemes.php" to="install/install_MultiRaceRankThemes.php" />
+			<file from="root/language/en/mods/permissions_MultiRaceRankThemes.php" to="language/en/mods/permissions_MultiRaceRankThemes.php" />
+		</copy>
+		<open src="adm/style/acp_ranks.html">
+			<edit>
+				<find><![CDATA[	<dl>
+		<dt><label for="special_rank">{L_RANK_SPECIAL}:</label></dt>
+		<dd><label><input onchange="dE('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> />{L_YES}</label>
+			<label><input onchange="dE('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+	</dl>
+]]></find>
+				<action type="replace-with"><![CDATA[	 <dl>
+		<dt><label for="rank_theme">{L_RANK_THEME}:</label></dt>
+		<dd><select name="rank_theme" id="rank_theme" onchange="if (this.selectedIndex > 0) { dE('posts', 1) } else { dE('posts', -1) }">{S_RANK_THEME_LIST}</select></dd>
+	</dl>
+]]>
+				</action>
+			</edit>
+			<edit>
+				<find><![CDATA[<!-- ELSE -->
+
+	<h1>{L_ACP_MANAGE_RANKS}</h1>]]></find>
+				<action type="before-add"><![CDATA[<!-- ELSEIF S_EDIT_THEME -->
+
+
+	<a href="{U_BACK}" style="float: right">&laquo; {L_BACK}</a>
+	<h1>{L_ACP_MANAGE_RANK_THEMES}</h1>
+
+	<p>{L_ACP_RANK_THEMES_EXPLAIN}</p>
+
+	<form id="acp_ranks" method="post" action="{U_ACTION}">
+
+	<fieldset>
+		<legend>{L_ACP_RANK_THEMES}</legend>
+	<dl>
+		<dt><label for="title">{L_RANK_THEME_TITLE}:</label></dt>
+		<dd><input name="title" type="text" id="title" value="{RANK_THEME_TITLE}" maxlength="255" /></dd>
+	</dl>
+	<dl>
+		<dt><label for="theme_public">{L_RANK_THEME_PUBLIC}:</label></dt>
+		<dd><label><input type="radio" class="radio" name="theme_public" value="1" id="theme_public"<!-- IF S_RANK_THEME_PUBLIC --> checked="checked"<!-- ENDIF --> />{L_YES}</label>
+			<label><input type="radio" class="radio" name="theme_public" value="0"<!-- IF not S_RANK_THEME_PUBLIC --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+	</dl>
+
+	<p class="submit-buttons">
+		<input type="hidden" name="action" value="save_theme" />
+
+		<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
+		<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
+	</p>
+	</fieldset>
+
+	</form>]]>
+				</action>
+			</edit>
+			<edit>
+				<find><![CDATA[
+	<!-- BEGIN ranks -->]]></find>
+				<action type="before-add"><![CDATA[
+	<!-- BEGIN themes -->
+		<tr><th colspan="4">{themes.RANK_THEME_TITLE}<!-- IF not themes.S_THEME_PUBLIC --> ({L_PRIVATE})<!-- ENDIF --><!-- IF themes.U_EDIT_THEME --> <span style="margin-left: 5em"><a href="{themes.U_EDIT_THEME}">{ICON_EDIT}</a> <a href="{themes.U_DELETE_THEME}">{ICON_DELETE}</a></span><!-- ENDIF --></th></tr>]]>
+				</action>
+			</edit>
+			<edit>
+				<find><![CDATA[<!-- END ranks -->]]></find>
+				<action type="replace-with"><![CDATA[
+		<!-- BEGINELSE -->
+		<tr>
+			<td colspan="4">{L_NO_RANKS_FOR_THEME}</td>
+		</tr>
+		<!-- END ranks -->
+	<!-- END themes -->]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[
+		<input class="button2" name="add" type="submit" value="{L_ADD_RANK}" />]]></find>
+				<action type="before-add"><![CDATA[
+		<input class="button2" name="add_theme" type="submit" value="{L_ADD_RANK_THEME}" />]]></action>
+			</edit>
+		</open>
+		<open src="adm/style/acp_users.html">
+			<edit>
+				<find><![CDATA[		<dt><label for="user_rank">{L_USER_RANK}:</label></dt>
+		<dd><select name="user_rank" id="user_rank">{S_RANK_OPTIONS}</select></dd>]]></find>
+				<action type="after-add"><![CDATA[		<dt><label for="user_rank_theme">{L_USER_RANK_THEME}:</label></dt>
+		<dd><select name="user_rank_theme" id="user_rank_theme">{S_RANK_THEME_OPTIONS}</select></dd>]]>
+				</action>
+			</edit>
+		</open>
+		<open src="adm/style/admin.css">
+			<edit>
+				<find><![CDATA[
+	color: #FFFFFF;
+	background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x;
+	border-top: 1px solid #6DACD2;
+	border-bottom: 1px solid #327AA5;]]></find>
+				<action type="replace-with"><![CDATA[
+	background-color: #DCEBFE;
+	border: 1px solid #6DACD2;
+	border-width: 1px 0;]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[td {
+	text-align: left;]]></find>
+				<action type="before-add"><![CDATA[
+thead th {
+	color: #FFFFFF;
+	background: #70AED3 url("../images/gradient2b.gif") bottom left repeat-x;
+	border-bottom-color: #327AA5
+}
+				]]></action>
+			</edit>
+		</open>
+		<open src="includes/acp/acp_ranks.php">
+			<edit>
+				<find><![CDATA[var $u_action;]]></find>
+				<action type="after-add"><![CDATA[var $rank_themes = array();]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[
+		$action = (isset($_POST['add'])) ? 'add' : $action;]]></find>
+				<action type="after-add"><![CDATA[
+		$action = (isset($_POST['add_theme'])) ? 'add_theme' : $action;
+				]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[				$special_rank = request_var('special_rank', 0);]]></find>
+				<action type="replace-with"><![CDATA[				//Multi-rank theme mod: special rank now calculated another way
+				//$special_rank = request_var('special_rank', 0);
+				$rank_theme = request_var('rank_theme', DEFAULT_RANK_THEME_ID);
+
+				if ($rank_theme < 0)
+				{
+					$special_rank = 1; //Stick with the phpBB convention and use magic numbers for the "special rank" value
+					$rank_theme = SPECIAL_RANK_THEME_ID;
+				}
+				else
+				{
+					$special_rank = 0;
+				}]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[					'rank_image'		=> htmlspecialchars_decode($rank_image)]]></find>
+				<action type="before-add"><![CDATA[					'rank_theme'		=> $rank_theme,]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[					$cache->destroy('_ranks');
+
+					add_log('admin', 'LOG_RANK_REMOVED', $rank_title);]]></find>
+				<action type="after-add"><![CDATA[
+
+					trigger_error($user->lang['RANK_REMOVED'] . adm_back_link($this->u_action));]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[					if ($action == 'edit' && $rank_id == $row['rank_id'])
+					{
+						$ranks = $row;
+					}
+				}
+				$db->sql_freeresult($result);]]></find>
+				<action type="after-add"><![CDATA[
+
+				$this->load_rank_themes();
+
+				$rank_theme_list = '';
+				$rank_theme = (isset($ranks['rank_theme']) ? $ranks['rank_theme'] : DEFAULT_RANK_THEME_ID);
+
+				foreach ($this->rank_themes as $id => $theme_data)
+				{
+					$rank_theme_list.= '<option value="' . $id . '"' . ($rank_theme == $id ? ' selected="selected"' : '') . '>' . $theme_data['rtheme_title'] . '</option>';
+				}]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[					'S_SPECIAL_RANK'	=> (!isset($ranks['rank_special']) || $ranks['rank_special']) ? true : false,]]></find>
+				<action type="replace-with"><![CDATA[					'S_SPECIAL_RANK'	=> (isset($ranks['rank_special']) && $ranks['rank_special']) ? true : false,
+					'S_RANK_THEME_LIST'	=> $rank_theme_list,]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[			}
+
+		$template->assign_vars(array(]]></find>
+				<action type="before-add"><![CDATA[
+
+			//Multi-rank theme mod: Add separate theme saving, deleting, adding and editing rather than overriding a single mode
+			case 'save_theme':
+
+				$theme_title = utf8_normalize_nfc(request_var('title', '', true));
+				$theme_public = request_var('theme_public', RANK_THEME_PUBLIC);
+
+				if (!$theme_title)
+				{
+					trigger_error($user->lang['NO_RANK_THEME_TITLE'] . adm_back_link($this->u_action), E_USER_WARNING);
+				}
+
+				if ($rank_id == DEFAULT_RANK_THEME_ID || $rank_id == SPECIAL_RANK_THEME_ID || $rank_id < 0)
+				{
+					trigger_error($user->lang['MUST_SELECT_RANK_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
+				}
+
+				$sql_ary = array(
+					'rtheme_title'		=> $theme_title,
+					'rtheme_public'		=> $theme_public
+				);
+
+				if ($rank_id)
+				{
+					$sql = 'UPDATE ' . RANK_THEMES_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE rtheme_id = $rank_id";
+					$message = $user->lang['RANK_THEME_UPDATED'];
+
+					add_log('admin', 'LOG_RANK_THEME_UPDATED', $theme_title);
+				}
+				else
+				{
+					$sql = 'INSERT INTO ' . RANK_THEMES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+					$message = $user->lang['RANK_THEME_ADDED'];
+
+					add_log('admin', 'LOG_RANK_THEME_ADDED', $theme_title);
+				}
+
+				$db->sql_query($sql);
+
+				$cache->destroy('_ranks');
+
+				trigger_error($message . adm_back_link($this->u_action));
+
+			break;
+
+			case 'delete_theme':
+				//Don't allow deletion of special or default rank sets
+				if ($rank_id == DEFAULT_RANK_THEME_ID || $rank_id == SPECIAL_RANK_THEME_ID || $rank_id < 0)
+				{
+					trigger_error($user->lang['MUST_SELECT_RANK_THEME'] . adm_back_link($this->u_action), E_USER_WARNING);
+				}
+
+				if (confirm_box(true))
+				{
+					$sql = 'SELECT rtheme_title
+						FROM ' . RANK_THEMES_TABLE . '
+						WHERE rtheme_id = ' . $rank_id;
+					$result = $db->sql_query($sql);
+					$theme_title = (string) $db->sql_fetchfield('rtheme_title');
+					$db->sql_freeresult($result);
+
+					$sql = 'DELETE FROM ' . RANKS_TABLE . "
+						WHERE rank_theme = $rank_id";
+					$db->sql_query($sql);
+
+					$sql = 'DELETE FROM ' . RANK_THEMES_TABLE . "
+						WHERE rtheme_id = $rank_id";
+					$db->sql_query($sql);
+
+					$sql = 'UPDATE ' . USERS_TABLE . "
+						SET user_rank_theme = ".DEFAULT_RANK_THEME_ID."
+						WHERE user_rank_theme = $rank_id";
+					$db->sql_query($sql);
+
+					$cache->destroy('_ranks');
+
+					add_log('admin', 'LOG_RANK_THEME_REMOVED', $theme_title);
+
+					trigger_error($user->lang['RANK_THEME_REMOVED'] . adm_back_link($this->u_action));
+				}
+				else
+				{
+					confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+						'i'			=> $id,
+						'mode'		=> $mode,
+						'rank_id'	=> $rank_id,
+						'action'	=> 'delete_theme',
+					)));
+				}
+
+			break;
+
+			case 'edit_theme':
+			case 'add_theme':
+
+				$theme = array();
+
+				$sql = 'SELECT *
+					FROM ' . RANK_THEMES_TABLE . '
+					WHERE rtheme_id = ' . $rank_id;
+				$result = $db->sql_query($sql);
+
+				while ($row = $db->sql_fetchrow($result))
+				{
+					$theme = $row;
+				}
+				$db->sql_freeresult($result);
+
+				$template->assign_vars(array(
+					'S_EDIT_THEME'		=> true,
+					'U_BACK'			=> $this->u_action,
+					'U_ACTION'			=> $this->u_action . '&amp;id=' . $rank_id,
+					'RANK_THEME_TITLE'	=> (isset($theme['rtheme_title'])) ? $theme['rtheme_title'] : '',
+					'S_RANK_THEME_PUBLIC'	=> (isset($theme['rtheme_public']) && $theme['rtheme_public']) ? true : false)
+				);
+
+
+				return;
+
+			break;]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[		$sql = 'SELECT *
+			FROM ' . RANKS_TABLE . '
+			ORDER BY rank_special DESC, rank_min ASC, rank_title ASC';]]></find>
+				<action type="before-add"><![CDATA[
+
+		$this->load_rank_themes();
+
+		$ranks = array();
+
+		foreach ($this->rank_themes as $theme)
+		{
+			$ranks[$theme['rtheme_id']] = array();
+		}]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[			$template->assign_block_vars('ranks', array(]]></find>
+				<action type="replace-with"><![CDATA[
+			$ranks[$row['rank_theme']][] = $row;
+		}
+
+		foreach ($this->rank_themes as $theme)
+		{
+			$template->assign_block_vars('themes', array(
+				'RANK_THEME_TITLE'	=> $theme['rtheme_title'],
+				'S_THEME_PUBLIC'	=> $theme['rtheme_public'],
+				'U_EDIT_THEME'		=> ($theme['rtheme_id'] != DEFAULT_RANK_THEME_ID && $theme['rtheme_id'] != SPECIAL_RANK_THEME_ID ? $this->u_action . '&amp;action=edit_theme&amp;id=' . $theme['rtheme_id'] : ''),
+				'U_DELETE_THEME'	=> ($theme['rtheme_id'] != DEFAULT_RANK_THEME_ID && $theme['rtheme_id'] != SPECIAL_RANK_THEME_ID ? $this->u_action . '&amp;action=delete_theme&amp;id=' . $theme['rtheme_id'] : '')));
+
+			if (sizeof($ranks[$theme['rtheme_id']]) > 0)
+			{
+				foreach ($ranks[$theme['rtheme_id']] as $row)
+				{
+					$template->assign_block_vars('themes.ranks', array(]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[}
+		$db->sql_freeresult($result);
+
+	}]]></find>
+				<action type="replace-with"><![CDATA[
+				}
+			}
+		}
+		$db->sql_freeresult($result);
+	}
+
+	function load_rank_themes()
+	{
+		if (sizeof($this->rank_themes) > 0)
+		{
+			return;
+		}
+
+		global $db, $user;
+
+		$sql = 'SELECT * FROM ' . RANK_THEMES_TABLE. ' WHERE rtheme_id <> ' . DEFAULT_RANK_THEME_ID . ' AND rtheme_id <> ' . SPECIAL_RANK_THEME_ID . ' ORDER BY rtheme_title';
+		$result = $db->sql_query($sql);
+
+		$this->rank_themes = array(SPECIAL_RANK_THEME_ID => array('rtheme_id' => SPECIAL_RANK_THEME_ID, 'rtheme_title' => $user->lang['SPECIAL_RANK_THEME'], 'rtheme_public' => false),
+									DEFAULT_RANK_THEME_ID => array('rtheme_id' => DEFAULT_RANK_THEME_ID, 'rtheme_title' => $user->lang['DEFAULT_RANK_THEME'], 'rtheme_public' => true));
+
+		while ($row = $db->sql_fetchrow($result))
+		{
+			$this->rank_themes[$row['rtheme_id']] = $row;
+		}
+		$db->sql_freeresult($result);
+	}]]></action>
+			</edit>
+		</open>
+		<open src="includes/acp/acp_users.php">
+			<edit>
+				<find><![CDATA[					$rank_id = request_var('user_rank', 0);]]></find>
+				<action type="after-add"><![CDATA[					$rank_theme = request_var('user_rank_theme', DEFAULT_RANK_THEME_ID);]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[						SET user_rank = $rank_id]]></find>
+				<action type="after-add"><![CDATA[						, user_rank_theme = $rank_theme]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[					$s_rank_options .= '<option value="' . $row['rank_id'] . '"' . $selected . '>' . $row['rank_title'] . '</option>';
+				}
+				$db->sql_freeresult($result);]]></find>
+				<action type="after-add"><![CDATA[				$sql = $db->sql_build_query('SELECT', array(
+					'SELECT'	=> 'rtheme_id, rtheme_title',
+
+					'FROM'		=> array(
+						RANK_THEMES_TABLE		=> 'r'
+					),
+
+					'WHERE'		=> 'rtheme_public = 1 AND rtheme_id > '.DEFAULT_RANK_THEME_ID,
+
+					'ORDER_BY'	=> 'rtheme_title ASC',
+				));
+
+				$result = $db->sql_query($sql);
+				$valid_selection = false;
+
+				while ($row = $db->sql_fetchrow($result))
+				{
+					if ($row['rtheme_id'] == $user_row['user_rank_theme'])
+					{
+						$selected = ' selected="selected"';
+						$valid_selection = true;
+					}
+					else
+					{
+						$selected = '';
+					}
+
+					$s_rank_theme_options .= "<option value=\"{$row['rtheme_id']}\"$selected>{$row['rtheme_title']}</option>";
+				}
+				$db->sql_freeresult($result);
+
+				$selected = (!$valid_selection) ? ' selected="selected"' : '';
+				$s_rank_theme_options = "<option value=\"".DEFAULT_RANK_THEME_ID."\"$selected>{$user->lang['DEFAULT_RANK_THEME']}</option>$s_rank_theme_options";]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[					'S_RANK_OPTIONS'	=> $s_rank_options)]]></find>
+				<inline-edit>
+            		<inline-find>)</inline-find>
+					<inline-action type="before-add"><![CDATA[, 'S_RANK_THEME_OPTIONS'	=> $s_rank_theme_options]]></inline-action>
+				</inline-edit>
+			</edit>
+		</open>
+		<open src="includes/cache.php">
+			<edit>
+				<find><![CDATA[			$sql = 'SELECT *
+				FROM ' . RANKS_TABLE . '
+				ORDER BY rank_min DESC';]]></find>
+				<action type="replace-with"><![CDATA[			//Make sure we only pull data for public rank themes and the special theme
+			$sql = $db->sql_build_query('SELECT', array(
+				'SELECT'	=> 'r.*',
+
+				'FROM'		=> array(
+					RANK_THEMES_TABLE	=> 't'
+				),
+
+				'LEFT_JOIN'	=> array(
+					array(
+						'FROM'	=> array(RANKS_TABLE			=> 'r'),
+						'ON'	=> 'r.rank_theme = t.rtheme_id'
+					)
+				),
+
+				'WHERE'		=> 't.rtheme_public = ' . RANK_THEME_PUBLIC . ' OR t.rtheme_id = ' . SPECIAL_RANK_THEME_ID,
+				'ORDER_BY'	=> 'r.rank_min DESC'
+			));]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[$ranks['normal'][] = array(]]></find>
+				<action type="replace-with"><![CDATA[$ranks[$row['rank_theme']][] = array(]]></action>
+			</edit>
+		</open>
+		<open src="includes/constants.php">
+			<edit>
+				<find><![CDATA[// Additional constants]]></find>
+				<action type="after-add"><![CDATA[
+define('SPECIAL_RANK_THEME_ID', -1);
+define('DEFAULT_RANK_THEME_ID', 1);
+define('RANK_THEME_PRIVATE', 0);
+define('RANK_THEME_PUBLIC', 1);
+define('ALLOW_RANK_THEME_AT_REGISTRATION', true);]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[// Additional tables]]></find>
+				<action type="after-add"><![CDATA[define('RANK_THEMES_TABLE',			$table_prefix . 'rank_themes');]]></action>
+			</edit>
+		</open>
+		<open src="includes/functions.php">
+			<edit>
+				<find><![CDATA[		'U_FAQ'					=> append_sid("{$phpbb_root_path}faq.$phpEx"),]]></find>
+				<action type="after-add"><![CDATA[		'U_RANKS'				=> append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=ranks'),]]></action>
+			</edit>
+		</open>
+		<open src="includes/functions_display.php">
+			<edit>
+				<find><![CDATA[* @param string &$rank_img_src the rank image source is stored here after execution]]></find>
+				<action type="after-add"><![CDATA[* @param int $rank_theme the rank theme set to load from (defaulting to DEFAULT_RANK_THEME_ID)]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)]]></find>
+				<inline-edit>
+            				<inline-find>)</inline-find>
+					<inline-action type="before-add">, $rank_theme = DEFAULT_RANK_THEME_ID</inline-action>
+				</inline-edit>
+			</edit>
+			<edit>
+				<find><![CDATA[		if (!empty($ranks['normal']))
+		{
+			foreach ($ranks['normal'] as $rank)]]></find>
+				<action type="replace-with"><![CDATA[		//Multi-rank theme: find our theme, defaulting to DEFAULT_RANK_THEME_ID if the user chose an invalid value
+		if (!empty($ranks[$rank_theme]))
+		{
+			$theme = $ranks[$rank_theme];
+		}
+		else
+		{
+			//Assume DEFAULT_RANK_THEME_ID always exists
+			$theme = $ranks[DEFAULT_RANK_THEME_ID];
+		}
+
+		if (!empty($theme))
+		{
+			foreach ($theme as $rank)]]></action>
+			</edit>
+		</open>
+		<open src="includes/ucp/ucp_pm_viewmessage.php">
+			<edit>
+				<find><![CDATA[	get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);]]></find>
+				<inline-edit>
+					<inline-find>);</inline-find>
+					<inline-action type="before-add"><![CDATA[, $user_row['user_rank_theme']]]></inline-action>
+				</inline-edit>
+			</edit>
+		</open>
+		<open src="includes/ucp/ucp_profile.php">
+			<edit>
+				<find><![CDATA[					'interests'		=> utf8_normalize_nfc(request_var('interests', $user->data['user_interests'], true)),]]></find>
+				<action type="after-add"><![CDATA[					'rank_theme'		=> request_var('rank_theme', $user->data['user_rank_theme']),]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[ 				if ($config['allow_birthdays'])
+  				{
+					$data['bday_day'] = $data['bday_month'] = $data['bday_year'] = 0;]]></find>
+				<action type="before-add"><![CDATA[				if (!$auth->acl_get('u_change_rank_theme'))
+				{
+					//Enforce "cannot change rank theme"
+					$data['rank_theme'] = $user->data['user_rank_theme'];
+				}]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[
+						'interests'		=> array('string', true, 2, 500),]]></find>
+				<action type="after-add"><![CDATA[
+						'rank_theme'	=> array('num', true, SPECIAL_RANK_THEME_ID),]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[
+							'user_interests'=> $data['interests'],]]></find>
+				<action type="after-add"><![CDATA[
+							'user_rank_theme' => $data['rank_theme'],]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[					$template->assign_vars(array(
+						'S_BIRTHDAY_DAY_OPTIONS'	=> $s_birthday_day_options,
+						'S_BIRTHDAY_MONTH_OPTIONS'	=> $s_birthday_month_options,
+						'S_BIRTHDAY_YEAR_OPTIONS'	=> $s_birthday_year_options,
+						'S_BIRTHDAYS_ENABLED'		=> true,
+					));
+				}]]></find>
+				<action type="after-add"><![CDATA[				//Multi-rank theme: Construct the rank theme options, if applicable
+				$s_rank_theme_options = '';
+
+				if ($user->data['user_rank'] == 0 && $auth->acl_get('u_change_rank_theme'))
+				{
+					$sql = $db->sql_build_query('SELECT', array(
+						'SELECT'	=> 'rtheme_id, rtheme_title',
+
+						'FROM'		=> array(
+							RANK_THEMES_TABLE		=> 'r'
+						),
+
+						'WHERE'		=> 'rtheme_public = ' . RANK_THEME_PUBLIC . ' AND rtheme_id <> ' . DEFAULT_RANK_THEME_ID,
+
+						'ORDER_BY'	=> 'rtheme_title ASC',
+					));
+
+					$result = $db->sql_query($sql);
+					$valid_selection = false;
+
+					while ($row = $db->sql_fetchrow($result))
+					{
+						if ($row['rtheme_id'] == $data['rank_theme'])
+						{
+							$selected = ' selected="selected"';
+							$valid_selection = true;
+						}
+						else
+						{
+							$selected = '';
+						}
+
+						$s_rank_theme_options .= '<option value="' . $row['rtheme_id'] . '"' . $selected . '>' . $row['rtheme_title'] . '</option>';
+					}
+
+					$db->sql_freeresult($result);
+
+					$selected = (!$valid_selection) ? ' selected="selected"' : ''; //If they've managed to get a bad selection, make sure "default" is selected
+					$s_rank_theme_options = '<option value="' . DEFAULT_RANK_THEME_ID . '"' . $selected . '>' . $user->lang['DEFAULT_RANK_THEME'] . '</option>' . $s_rank_theme_options; //And append to the start
+				}]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[					'INTERESTS'	=> $data['interests'],]]></find>
+				<action type="after-add"><![CDATA[					'S_RANK_THEME_OPTIONS'	=> $s_rank_theme_options,]]></action>
+			</edit>
+		</open>
+		<open src="includes/ucp/ucp_register.php">
+			<edit>
+				<find><![CDATA[					'tz'				=> request_var('tz', (float) $config['board_timezone']),]]></find>
+				<action type="after-add"><![CDATA[					'rank_theme'		=> request_var('rank_theme', DEFAULT_RANK_THEME_ID),]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[			'tz'				=> request_var('tz', (float) $timezone),]]></find>
+				<action type="after-add"><![CDATA[			'rank_theme'		=> request_var('rank_theme', DEFAULT_RANK_THEME_ID),]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[		// Check and initialize some variables if needed
+		if ($submit)
+		{]]></find>
+				<action type="before-add"><![CDATA[		if (!defined('ALLOW_RANK_THEME_AT_REGISTRATION') || !ALLOW_RANK_THEME_AT_REGISTRATION)
+		{
+			//Enforce "cannot select rank theme"
+			$data['rank_theme'] = DEFAULT_RANK_THEME_ID;
+		}]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[				'tz'				=> array('num', false, -14, 14),]]></find>
+				<action type="after-add"><![CDATA[				'rank_theme'	=> array('num', true, SPECIAL_RANK_THEME_ID),]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[					'user_timezone'			=> (float) $data['tz'],]]></find>
+				<action type="after-add"><![CDATA[					'user_rank_theme'		=> (int) $data['rank_theme'],]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[		$template->assign_vars(array(
+			'ERROR'				=> (sizeof($error)) ? implode('<br />', $error) : '',]]></find>
+				<action type="before-add"><![CDATA[		//IBBoard: Construct the rank theme options, if applicable
+		$s_rank_theme_options = '';
+
+		if (defined('ALLOW_RANK_THEME_AT_REGISTRATION') && ALLOW_RANK_THEME_AT_REGISTRATION)
+		{
+			$sql = $db->sql_build_query('SELECT', array(
+				'SELECT'	=> 'rtheme_id, rtheme_title',
+
+				'FROM'		=> array(
+					RANK_THEMES_TABLE		=> 'r'
+				),
+
+				'WHERE'		=> 'rtheme_public = ' . RANK_THEME_PUBLIC . ' AND rtheme_id <> '.DEFAULT_RANK_THEME_ID,
+
+				'ORDER_BY'	=> 'rtheme_title ASC',
+			));
+
+			$result = $db->sql_query($sql);
+			$valid_selection = false;
+			$s_rank_theme_options = '';
+
+			while ($row = $db->sql_fetchrow($result))
+			{
+				if ($row['rtheme_id'] == $data['rank_theme'])
+				{
+					$selected = ' selected="selected"';
+					$valid_selection = true;
+				}
+				else
+				{
+					$selected = '';
+				}
+
+				$s_rank_theme_options .= '<option value="' . $row['rtheme_id'] . '"' . $selected . '>' . $row['rtheme_title'] . '</option>';
+			}
+
+			$db->sql_freeresult($result);
+
+			$selected = (!$valid_selection) ? ' selected="selected"' : ''; //If they've managed to get a bad selection, make sure "default" is selected
+			$s_rank_theme_options = '<option value="' . DEFAULT_RANK_THEME_ID . '"' . $selected . '>' . $user->lang['DEFAULT_RANK_THEME'] . '</option>' . $s_rank_theme_options; //And append to the start
+		}]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[			'S_TZ_OPTIONS'		=> tz_select($data['tz']),]]></find>
+				<action type="after-add"><![CDATA[			'S_RANK_THEME_OPTIONS'		=> $s_rank_theme_options,]]></action>
+			</edit>
+		</open>
+		<open src="language/en/acp/common.php">
+			<edit>
+				<find><![CDATA[));
+
+?>]]></find>
+				<action type="before-add"><![CDATA[	//Multi-rank theme: Add rank theme logging messages
+	'LOG_RANK_THEME_ADDED'		=> '<strong>Added new rank theme</strong><br />» %s',
+	'LOG_RANK_THEME_REMOVED'		=> '<strong>Removed rank theme</strong><br />» %s',
+	'LOG_RANK_THEME_UPDATED'		=> '<strong>Updated rank theme</strong><br />» %s',
+	//Multi-rank theme: Add other common new langs
+	'PRIVATE'					=> 'Private',
+	'ACP_MANAGE_RANK_THEMES'			=> 'Manage rank themes',
+	'ACP_RANK_THEMES'					=> 'Rank themes',
+]]></action>
+			</edit>
+		</open>
+		<open src="language/en/acp/users.php">
+			<edit>
+				<find><![CDATA[));
+
+?>]]></find>
+				<action type="before-add"><![CDATA[	//Multi-rank theme: Add langs for editing user
+	'USER_RANK_THEME'				=> 'User rank theme',]]></action>
+			</edit>
+		</open>
+		<open src="language/en/acp/posting.php">
+			<edit>
+				<find><![CDATA[	'RANK_UPDATED'			=> 'The rank was successfully updated.',]]></find>
+				<action type="after-add"><![CDATA[	//Multi-rank theme: Rank theme specific language strings
+	'ADD_RANK_THEME'		=> 'Add new rank theme',
+	'ACP_RANK_THEMES_EXPLAIN'	=> 'Using this page you can add, edit, view and delete rank themes. Rank themes can be made private so that they are not selectable by users. Deleting a rank theme will delete all ranks within it.',
+	'RANK_THEME_TITLE'		=> 'Rank theme title',
+	'RANK_THEME_PUBLIC'		=> 'Set as public rank theme',
+	'RANK_THEME'			=> 'Rank theme',
+	'MUST_SELECT_RANK_THEME'	=> 'You must select a valid rank theme. Default and special themes cannot be deleted.',
+	'RANK_THEME_ADDED'		=> 'The rank theme was successfully added.',
+	'RANK_THEME_REMOVED'	=> 'The rank theme (and all ranks within it) was successfully removed.',
+	'RANK_THEME_UPDATED'	=> 'The rank theme was successfully updated.',
+	'NO_RANKS_FOR_THEME'	=> 'No ranks for theme',]]></action>
+			</edit>
+		</open>
+		<open src="language/en/common.php">
+			<edit>
+				<find><![CDATA[	'datetime'			=> array(]]></find>
+				<action type="before-add"><![CDATA[
+	//Multi-rank theme: Add in new rank naming
+	'DEFAULT_RANK_THEME'	=> 'Default theme',
+	'SPECIAL_RANK_THEME'	=> 'Special theme',
+	//Multi-rank theme: Add header link text
+	'RANKS_EXPLAIN'         => 'Available rank themes',
+	'RANKS'                 => 'Rank Themes',
+	//Multi-rank theme: Add install message
+	'MULTI_RACE_ADDED_PERMISSIONS'	=> 'Added permissions for Multi-Race Rank Themes MOD',]]></action>
+			</edit>
+		</open>
+		<open src="language/en/memberlist.php">
+			<edit>
+				<find><![CDATA[));
+
+?>]]></find>
+				<action type="before-add"><![CDATA[// Multi-rank theme: Rank theme list information
+	'RANKTHEMES'		=> 'Rank Themes',
+	'RANKTHEME_TEXT'	=> 'Rank themes allow you to customise the name and image of the rank that is displayed beside your post. For a full list of the ranks within a scheme click on the scheme name. For more detail on ranks please see the <a href="%1$s">FAQ</a>.',
+	'RANK_NAME'		=> 'Rank',
+	'RANK_IMG'		=> 'Rank image',
+	'RANK_POSTS'		=> 'Required post count',
+	'NO_RANKSET_ERROR'	=> 'The rank theme you selected was invalid. Please check the link and try again.'
+]]></action>
+			</edit>
+		</open>
+		<open src="language/en/ucp.php">
+			<edit>
+				<find><![CDATA[	'UCP_PROFILE_SIGNATURE'		=> 'Edit signature',]]></find>
+				<action type="after-add"><![CDATA[	'UCP_RANK_THEME'			=> 'Rank theme',	//Multi-rank theme: Add rank theme label]]></action>
+			</edit>
+		</open>
+		<open src="memberlist.php">
+			<edit>
+				<find><![CDATA[$topic_id	= request_var('t', 0);]]></find>
+				<action type="after-add"><![CDATA[$rank_theme	= request_var('r', 0);]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'searchuser', 'leaders')))]]></find>
+				<inline-edit>
+					<inline-find>, 'leaders'</inline-find>
+					<inline-action type="after-add"><![CDATA[, 'ranks']]></inline-action>
+				</inline-edit>
+			</edit>
+			<edit>
+				<find><![CDATA[	case 'email':]]></find>
+				<action type="after-add"><![CDATA[	case 'ranks':]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[			'SELECT'	=> 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',]]></find>
+				<inline-edit>
+					<inline-find>u.user_rank,</inline-find>
+					<inline-action type="after-add"><![CDATA[ u.user_rank_theme,]]></inline-action>
+				</inline-edit>
+			</edit>
+			<edit>
+				<find><![CDATA[			get_user_rank($row['user_rank'], (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']), $rank_title, $rank_img, $rank_img_src);]]></find>
+				<inline-edit>
+					<inline-find>);</inline-find>
+					<inline-action type="before-add"><![CDATA[, $row['user_rank_theme']]]></inline-action>
+				</inline-edit>
+			</edit>
+			<edit>
+				<find><![CDATA[	case 'group':
+	default:
+		// The basic memberlist]]></find>
+				<action type="before-add"><![CDATA[	case 'ranks':
+		// Display all available rank sets or the list of ranks for a set
+		$page_title = $user->lang['RANKTHEMES'];
+		$template_html = 'memberlist_ranks.html';
+
+		if ($rank_theme == 0)
+		{
+			// Get list of rank themes
+			$sql = 'SELECT rtheme_id, rtheme_title
+				FROM ' . RANK_THEMES_TABLE . '
+				WHERE rtheme_public = ' . RANK_THEME_PUBLIC . '
+					AND rtheme_id <> ' . DEFAULT_RANK_THEME_ID . '
+				ORDER BY rtheme_title ASC';
+			$result = $db->sql_query($sql);
+
+			$template->assign_vars(array(
+				'L_RANKTHEME_TEXT' => sprintf($user->lang['RANKTHEME_TEXT'], append_sid("{$phpbb_root_path}faq.{$phpEx}#f15"))
+			));
+
+			$template->assign_block_vars('rankset', array(
+				'RANKSET_URL' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=ranks&amp;r=' . DEFAULT_RANK_THEME_ID),
+				'RANKSET_NAME' => $user->lang['DEFAULT_RANK_THEME']
+			));
+
+			while ($row = $db->sql_fetchrow($result))
+			{
+				$template->assign_block_vars('rankset', array(
+					'RANKSET_URL' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=ranks&amp;r=' . $row['rtheme_id']),
+					'RANKSET_NAME' => $row['rtheme_title']
+				));
+			}
+
+			$db->sql_freeresult($result);
+		}
+		else
+		{
+			$sql = 'SELECT rtheme_title
+				FROM ' . RANK_THEMES_TABLE . '
+				WHERE rtheme_public = ' . RANK_THEME_PUBLIC . '
+					AND rtheme_id = ' . $rank_theme;
+			$result = $db->sql_query($sql);
+			$row = $db->sql_fetchrow($result);
+			$db->sql_freeresult($result);
+
+			if ($row != false)
+			{
+				$set_title = $row['rtheme_title'];
+				$template->assign_vars(array(
+					'RANKSET_NAME' => $set_title,
+					'U_RANKSET_LIST_LINK' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=ranks')
+				));
+				$sql = 'SELECT rank_title, rank_min, rank_image
+					FROM ' . RANKS_TABLE . '
+					WHERE rank_theme = ' . $rank_theme . '
+					ORDER BY rank_min ASC';
+				$result = $db->sql_query($sql);
+
+				while ($rank = $db->sql_fetchrow($result))
+				{
+					$rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
+					$template->assign_block_vars('rank', array(
+						'RANK_NAME' => $rank['rank_title'],
+						'RANK_IMG' => $rank_img,
+						'RANK_POSTS' => $rank['rank_min']
+					));
+				}
+
+				$db->sql_freeresult($result);
+			}
+			else
+			{
+				trigger_error($user->lang['NO_RANKSET_ERROR']);
+			}
+		}
+
+	break;]]></action>
+			</edit>
+			<edit>
+				<find><![CDATA[	get_user_rank($data['user_rank'], (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src);]]></find>
+				<inline-edit>
+					<inline-find>);</inline-find>
+					<inline-action type="before-add"><![CDATA[, $data['user_rank_theme']]]></inline-action>
+				</inline-edit>
+			</edit>
+		</open>
+		<open src="styles/prosilver/template/overall_header.html">
+			<edit>
+				<find><![CDATA[					<!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->]]></find>
+				<action type="after-add"><![CDATA[					<li class="icon-ranks"><a href="{U_RANKS}" title="{L_RANKS_EXPLAIN}">{L_RANKS}</a></li>]]></action>
+			</edit>
+		</open>
+		<open src="styles/prosilver/template/ucp_profile_profile_info.html">
+			<edit>
+				<find><![CDATA[	<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->]]></find>
+				<action type="after-add"><![CDATA[
+	<!-- IF S_RANK_THEME_OPTIONS -->
+	<dl>
+		<dt><label for="rank_theme">{L_UCP_RANK_THEME}:</label></dt>
+		<dd><select name="rank_theme" id="rank_theme">{S_RANK_THEME_OPTIONS}</select></dd>
+	</dl>
+	<!-- ENDIF -->]]></action>
+			</edit>
+		</open>
+		<open src="styles/prosilver/template/ucp_register.html">
+			<edit>
+				<find><![CDATA[		<dt><label for="tz">{L_TIMEZONE}:</label></dt>
+		<dd><select name="tz" id="tz" tabindex="7" class="autowidth">{S_TZ_OPTIONS}</select></dd>
+	</dl>]]></find>
+				<action type="after-add"><![CDATA[
+	<!-- IF S_RANK_THEME_OPTIONS -->
+	<dl>
+		<dt><label for="rank_theme">{L_UCP_RANK_THEME}:</label></dt>
+		<dd><select name="rank_theme" id="rank_theme">{S_RANK_THEME_OPTIONS}</select></dd>
+	</dl>
+	<!-- ENDIF -->]]></action>
+			</edit>
+		</open>
+		<open src="styles/prosilver/theme/bidi.css">
+			<edit>
+				<find><![CDATA[.rtl .icon-bookmark, .rtl .icon-bump, .rtl .icon-subscribe, .rtl .icon-unsubscribe, .rtl .icon-pages, .rtl .icon-search {]]></find>
+				<inline-edit>
+					<inline-find>{</inline-find>
+					<inline-action type="before-add"><![CDATA[, .rtl .icon-ranks]]></inline-action>
+				</inline-edit>
+			</edit>
+		</open>
+		<open src="styles/prosilver/theme/buttons.css">
+			<edit>
+				<find><![CDATA[.icon-bookmark, .icon-bump, .icon-subscribe, .icon-unsubscribe, .icon-pages, .icon-search {]]></find>
+				<inline-edit>
+					<inline-find>{</inline-find>
+					<inline-action type="before-add"><![CDATA[, .icon-ranks]]></inline-action>
+				</inline-edit>
+			</edit>
+		</open>
+		<open src="styles/prosilver/theme/colours.css">
+			<edit>
+				<find><![CDATA[.icon-search					{ background-image: url("{T_THEME_PATH}/images/icon_search.gif"); }]]></find>
+				<action type="after-add"><![CDATA[.icon-ranks					{ background-image: url("{T_THEME_PATH}/images/icon_ranks.gif"); }]]></action>
+			</edit>
+		</open>
+		<open src="viewtopic.php">
+			<edit>
+				<find><![CDATA[			get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);]]></find>
+				<inline-edit>
+					<inline-find>);</inline-find>
+					<inline-action type="before-add"><![CDATA[, $row['user_rank_theme']]]></inline-action>
+				</inline-edit>
+			</edit>
+		</open>
+		<diy-instructions lang="en">Ensure that you have run the SQL queries at the start of the MOD. These can be run from a command-line session or through an application such as phpMyAdmin.
+
+Clear the template cache. Either log in to your server via FTP/SSH and delete cache/tpl_* or log in to the ACP, go to the "Styles" tab then the "Templates" style component, then click "Refresh" for each template and confirm the cache clearing.
+
+Clear the rank theme cache. Either create a new rank, which should rebuild the cache, or delete cache/data_ranks.php.
+
+Add the additional permissions by pointing your browser to http://example.com/forums/install/install_MultiRaceRankThemesPermissions.php (where "example.com/forums/" is the location of your forums), then delete the install_MultiRaceRankThemesPermissions.php file.
+
+Add the "can change rank theme" permission to groups who should be able to change their rank theme. The default is to not allow rank theme changing. With a default forum the easiest way to add the permission to all users is to change the "Standard Features" User Role permission to "Yes" value under the Profile tab.</diy-instructions>
+	</action-group>
+</mod>
\ No newline at end of file
--- a/modx.prosilver.en.xsl	Sat Mar 20 16:49:45 2010 +0000
+++ b/modx.prosilver.en.xsl	Mon Aug 02 19:30:31 2010 +0000
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- MODX by the phpBB MOD Team XSL file v1.2.3 copyright 2005-2009 the phpBB MOD Team.
+<!-- MODX by the phpBB MOD Team XSL file v1.2.4 copyright 2005-2010 the phpBB MOD Team.
 	This file is released under the GNU GPL version 2.  See license.txt.
-	$Id: modx.prosilver.en.xsl 3407 2009-10-26 01:49:01Z Raimon $ -->
+	$Id: modx.prosilver.en.xsl 211 2010-02-27 20:05:11Z tumba25 $ -->
 <!DOCTYPE xsl:stylesheet[
 	<!ENTITY nbsp "&#160;">
 ]>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:mod="http://www.phpbb.com/mods/xml/modx-1.2.3.xsd">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:mod="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
 	<xsl:output method="html" omit-xml-declaration="no" indent="yes" />
 	<xsl:variable name="title" select="mod:mod/mod:header/mod:title" />
 	<xsl:variable name="version">
@@ -410,12 +410,12 @@
 
 dl.author-info dd { margin-left:112px; margin-bottom:8px; }
 .rtl dl.author-info dd { margin-left:112px; margin-bottom:8px; }
-ol#file-copy { padding:5px; margin-left:20px; margin-right:20px; margin-bottom:10px; }
-ol#file-copy li { margin-left:30px; margin-right:30px; vertical-align:top;}
-ol#file-copy span { font-weight:bold; }
-ol#file-copy dt {margin-right:5px; float:none !important }
-ol#file-copy dl {width:100%}
-h2#lang-fca, h2#lang-edts, h2#lang-diy, h2#lang-sql { margin-left:5px; }
+ol#file-copy, ol#file-delete { padding:5px; margin-left:20px; margin-right:20px; margin-bottom:10px; }
+ol#file-copy li, ol#file-delete li { margin-left:30px; margin-right:30px; vertical-align:top;}
+ol#file-copy span, ol#file-delete span { font-weight:bold; }
+ol#file-copy dt, ol#file-delete dt {margin-right:5px; float:none !important }
+ol#file-copy dl, ol#file-delete dl {width:100%}
+h2#lang-fca, h2#lang-edts, h2#lang-diy, h2#lang-sql, h2#lang-installer-h2, h2#lang-del-head { margin-left:5px; }
 
 /* Code block */
 div.codebox {
@@ -511,6 +511,11 @@
 						mhcls_ll.push('<xsl:value-of select="generate-id()"/>');
 					</xsl:if>
 				</xsl:for-each>
+
+				var link_ll = [];
+				<xsl:for-each select="mod:link-group/mod:link">
+					link_ll.push('<xsl:value-of select="generate-id()"/>');
+				</xsl:for-each>
 			</xsl:for-each>
 
 			var opens_ll = [];
@@ -529,8 +534,10 @@
 			</xsl:for-each>
 
 			var finds_ll = [];
+			var removes_ll = [];
 			var regex_ll = [];
 			var ifinds_ll = [];
+			var iremoves_ll = [];
 			var iregex_ll = [];
 			var addafters_ll = [];
 			var iaddafters_ll = [];
@@ -545,6 +552,9 @@
 				<xsl:for-each select="mod:find">
 					finds_ll.push('<xsl:value-of select="generate-id()"/>');
 				</xsl:for-each>
+				<xsl:for-each select="mod:remove">
+					removes_ll.push('<xsl:value-of select="generate-id()"/>');
+				</xsl:for-each>
 				<xsl:if test="count(mod:comment) > 0">
 					comments_ll.push('<xsl:value-of select="generate-id()"/>');
 				</xsl:if>
@@ -572,6 +582,9 @@
 							iregex_ll.push('<xsl:value-of select="generate-id()"/>');
 						</xsl:if>
 					</xsl:for-each>
+					<xsl:for-each select="mod:inline-remove">
+						iremoves_ll.push('<xsl:value-of select="generate-id()"/>');
+					</xsl:for-each>
 					<xsl:for-each select="mod:inline-find|mod:inline-action">
 						codes_ll.push('<xsl:value-of select="generate-id()"/>');
 						<xsl:if test="name() = 'inline-action'">
@@ -601,6 +614,11 @@
 				copies_ll.push('<xsl:value-of select="generate-id()"/>');
 			</xsl:for-each>
 
+			var delete_ll = [];
+			<xsl:for-each select="mod:action-group/mod:delete/mod:file">
+				delete_ll.push('<xsl:value-of select="generate-id()"/>');
+			</xsl:for-each>
+
 			<xsl:text disable-output-escaping="yes">
 <![CDATA[
 // The following line from http://www.ryancooper.com/resources/keycode.asp
@@ -643,7 +661,7 @@
 "lic=License\n" +
 "lict=This MOD has been licensed under the following license:\n" +
 "ont=and other notes\n" +
-"ontt1=Before adding this MOD to your forum, you should back up all files related to this MOD.\n" +
+"ontt1=Before adding this MOD to your forum, you should back up all files and databases related to this MOD.\n" +
 "ontt2=This MOD was designed for phpBB\n" +
 "ontt3=and may not function as stated on other phpBB versions. MODs for phpBB 3.0 will <strong>not</strong> work on phpBB 2.0 and vice versa.\n" +
 "onttq=This MOD is development quality. It is not recommended that you install it on a live forum.\n" +
@@ -659,24 +677,28 @@
 "cm-cmt=Comments\n" +
 "fnd=Find\n" +
 "fndt=<strong>Tip:</strong> This may be a partial find and not the whole line.\n" +
+"remove=Find and Delete\n" +
+"removet=<strong>Tip:</strong> Find and delete this code.\n" +
 "rplw=Replace with\n" +
 "rplwt=<strong>Tip:</strong> Replace the preceding line(s) to find with the following lines.\n" +
 "aft=Add after\n" +
 "aftt=<strong>Tip:</strong> Add these lines on a new blank line after the preceding line(s) to find.\n" +
 "bef=Add before\n" +
 "beft=<strong>Tip:</strong> Add these lines on a new blank line before the preceding line(s) to find.\n" +
-"inc=Increment\n" +
-"inct=<strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.\n" +
+"inc=Operation\n" +
+"inct=<strong>Tip:</strong> This allows you to alter integers.\n" +
 "ifnd=In-line Find\n" +
 "ifndt=<strong>Tip:</strong> This is a partial match of a line for in-line operations.\n" +
+"iremove=In-line Find and Delete\n" +
+"iremovet=<strong>Tip:</strong> Find this code in the line and delete it.\n" +
 "irplw=In-line Replace with\n" +
 "irplwt=\n" +
 "iaft=In-line Add after\n" +
 "iaftt=\n" +
 "ibef=In-line Add before\n" +
 "ibeft=\n" +
-"iinc=In-line Increment\n" +
-"iinct=<strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.\n" +
+"iinc=In-line Operation\n" +
+"iinct=<strong>Tip:</strong> This allows you to alter integers.\n" +
 "diy=DIY instructions\n" +
 "diyt=These are manual instructions that cannot be performed automatically. You should follow these instructions carefully.\n" +
 "eom=Save all files. End of MOD.\n" +
@@ -684,7 +706,7 @@
 "slg=Select language:\n" +
 "dbms=Select Database Type:\n" +
 "foot=MOD UA XSLT File Copyright &#169; 2007 The phpBB Group, this MOD is copyright to the authors listed above.\n" +
-"regex=This find contains an advanced feature known as regular expressions, click here to learn more.\n" +
+"regex=This find contains an advanced feature known as regular expressions.\n" +
 "mhe-v=- Version\n" +
 "mh=MOD history\n" +
 "addtl-modx=Additional MODX files\n" +
@@ -694,7 +716,16 @@
 "link-l=Language\n" +
 "link-p=Parent\n" +
 "link-te=Template\n" +
+"link-txt=Text file\n" +
 "link-tl=Template lang\n" +
+"link-un=Uninstall instructions\n" +
+"installer-h2=PHP install file\n" +
+"installer-exp1=There is a PHP install file that needs to be run in order to complete the installation.\n" +
+"installer-exp2=To run it point your browser to, for example,\n" +
+"ispt-int=Support in your language <strong>might</strong> be available at a <a href=\"http://www.phpbb.com/support/intl/\">international support site</a>.\n" +
+"del-heads=Delete files\n" +
+"del-head=Delete file\n" +
+"del-file=Delete\n" +
 "atm=About this MOD";
 
 var box = codes_ll;
@@ -704,23 +735,27 @@
 var arrClasCnt = [
 	['a-'	, authors_ll		],
 	['c-'	, copies_ll			],
+	['del-'	, delete_ll			],
 	['cm-'	, comments_ll		],
 	['opn'	, opens_ll			],
 	['cde-'	, codes_ll			],
 	['edt-'	, edits_ll			],
 	['fnd'	, finds_ll			],
+	['fnd'	, removes_ll			],
 	['regex', regex_ll			],
 	['rplw'	, replacewiths_ll	],
 	['aft'	, addafters_ll		],
 	['bef'	, addbefores_ll		],
 	['inc'	, increments_ll		],
 	['ifnd'	, ifinds_ll			],
+	['ifnd'	, iremoves_ll			],
 	['regex', iregex_ll			],
 	['irplw', ireplacewiths_ll	],
 	['iaft'	, iaddafters_ll		],
 	['ibef'	, iaddbefores_ll	],
 	['iinc'	, iincrements_ll	],
-	['mhe'	, mhes_ll			]
+	['mhe'	, mhes_ll			],
+	['link', link_ll]
 ];
 
 function startup()
@@ -1118,8 +1153,6 @@
 
 	var rtl_float = (ie) ? 'styleFloat' : 'cssFloat';
 
-//alert(rtl_spec.length);
-
 	if(direction == 'rtl')
 	{
 		for(j = 0; j < dts.length; j++)
@@ -1636,7 +1669,7 @@
 
 	<xsl:template name="give-header">
 		<fieldset>
-		<legend id="lang-atm">About this MOD</legend>
+			<legend id="lang-atm">About this MOD</legend>
 			<div class="mod-about">
 				<span class="corners-top"><span></span></span>
 				<dl>
@@ -1692,45 +1725,45 @@
 						<xsl:call-template name="give-installation"></xsl:call-template>
 					</xsl:for-each>
 					<xsl:if test="mod:author-notes != 'N/A' and mod:author-notes != 'n/a' and mod:author-notes != ''">
-					<dt id="lang-ant" name="left4px">Author notes:</dt>
-					<dd>
-						<xsl:if test="count(mod:author-notes) > 1">
-							<dl id="author-notes" class="nopadding">
-								<xsl:for-each select="mod:author-notes">
-									<dt><xsl:value-of select="@lang" /></dt>
-									<dd lang="{@lang}">
-										<p>
-											<xsl:call-template name="add-line-breaks">
-												<xsl:with-param name="string"><xsl:value-of select="current()" /></xsl:with-param>
-											</xsl:call-template>
-										</p>
-									</dd>
-								</xsl:for-each>
-							</dl>
-						</xsl:if>
-						<xsl:if test="count(mod:author-notes) = 1">
-							<p lang="{@lang}">
-								<xsl:call-template name="add-line-breaks">
-									<xsl:with-param name="string"><xsl:value-of select="mod:author-notes" /></xsl:with-param>
-								</xsl:call-template>
-							</p>
-						</xsl:if>
-					</dd>
+						<dt id="lang-ant" name="left4px">Author notes:</dt>
+						<dd>
+							<xsl:if test="count(mod:author-notes) > 1">
+								<dl id="author-notes" class="nopadding">
+									<xsl:for-each select="mod:author-notes">
+										<dt><xsl:value-of select="@lang" /></dt>
+										<dd lang="{@lang}">
+											<p>
+												<xsl:call-template name="add-line-breaks">
+													<xsl:with-param name="string"><xsl:value-of select="current()" /></xsl:with-param>
+												</xsl:call-template>
+											</p>
+										</dd>
+									</xsl:for-each>
+								</dl>
+							</xsl:if>
+							<xsl:if test="count(mod:author-notes) = 1">
+								<p lang="{@lang}">
+									<xsl:call-template name="add-line-breaks">
+										<xsl:with-param name="string"><xsl:value-of select="mod:author-notes" /></xsl:with-param>
+									</xsl:call-template>
+								</p>
+							</xsl:if>
+						</dd>
 					</xsl:if>
 				</dl>
 				<span class="corners-bottom"><span></span></span>
 			</div>
 		</fieldset>
 		<fieldset>
-		<xsl:for-each select="mod:author-group">
-			<xsl:if test="count(mod:author) > 1">
-				<legend id="lang-aus">Authors</legend>
-			</xsl:if>
-			<xsl:if test="count(mod:author) = 1">
-				<legend id="lang-au">Author</legend>
-			</xsl:if>
-			<xsl:call-template name="give-authors"></xsl:call-template>
-		</xsl:for-each>
+			<xsl:for-each select="mod:author-group">
+				<xsl:if test="count(mod:author) > 1">
+					<legend id="lang-aus">Authors</legend>
+				</xsl:if>
+				<xsl:if test="count(mod:author) = 1">
+					<legend id="lang-au">Author</legend>
+				</xsl:if>
+				<xsl:call-template name="give-authors"></xsl:call-template>
+			</xsl:for-each>
 		</fieldset>
 		<xsl:if test="count(../mod:action-group/mod:open) > 0">
 			<h3 id="lang-fte">Files to edit</h3>
@@ -1753,26 +1786,34 @@
 		<ul class="link-group" id="link-group">
 			<xsl:for-each select="mod:link-group/mod:link">
 				<li lang="{@lang}">
-					<span class="link-group-lang"><xsl:value-of select="@lang" />&nbsp;</span><strong>
+					<span class="link-group-lang"><xsl:value-of select="@lang" />&nbsp;</span>
+					<strong>
+						<xsl:if test="@type = 'contrib'">
+							<span id="lang-link-c[{generate-id()}]">Contrib</span>:
+						</xsl:if>
 						<xsl:if test="@type = 'dependency'">
-							<span id="lang-link-d">Dependency</span>:
+							<span id="lang-link-d[{generate-id()}]">Dependency</span>:
+						</xsl:if>
+						<xsl:if test="@type = 'language'">
+							<span id="lang-link-l[{generate-id()}]">Language</span>:
+						</xsl:if>
+						<xsl:if test="@type = 'parent'">
+							<span id="lang-link-p[{generate-id()}]">Parent</span>:
 						</xsl:if>
 						<xsl:if test="@type = 'template'">
-							<span id="lang-link-te">Template</span>:
-						</xsl:if>
-						<xsl:if test="@type = 'contrib'">
-							<span id="lang-link-c">Contrib</span>:
-						</xsl:if>
-						<xsl:if test="@type = 'language'">
-							<span id="lang-link-l">Language</span>:
+							<span id="lang-link-te[{generate-id()}]">Template</span>:
 						</xsl:if>
 						<xsl:if test="@type = 'template-lang'">
-							<span id="lang-link-tl">Template lang</span>:
+							<span id="lang-link-tl[{generate-id()}]">Template lang</span>:
+						</xsl:if>
+						<xsl:if test="@type = 'text'">
+							<span id="lang-link-txt[{generate-id()}]">Text file</span>:
 						</xsl:if>
-						<xsl:if test="@type = 'parent'">
-							<span id="lang-link-p">Parent</span>:
+						<xsl:if test="@type = 'uninstall'">
+							<span id="lang-link-un[{generate-id()}]">Uninstall instructions</span>:
 						</xsl:if>
-					</strong>&nbsp;<a href="{@href}"><xsl:value-of select="current()" /></a>
+					</strong>
+					&nbsp;<a href="{@href}"><xsl:value-of select="current()" /></a>
 				</li>
 			</xsl:for-each>
 		</ul>
@@ -1781,16 +1822,16 @@
 			<h3><span id="lang-dcl">Disclaimer</span>&nbsp;<span id="lang-ont">and other notes</span></h3>
 			<div class="mod-about">
 				<span class="corners-top"><span></span></span>
-					<div class="mod-about-padding">
+				<div class="mod-about-padding">
 					<p><span id="lang-dclt">For security purposes, please check: <a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a> for the latest version of this MOD. Downloading this MOD from other sites could cause malicious code to enter into your phpBB Forum. As such, phpBB will not offer support for MODs not offered in our MODs database, located at: <a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a></span></p>
-					<p><span id="lang-ontt1">Before adding this MOD to your forum, you should back up all files related to this MOD.</span></p>
+					<p><span id="lang-ontt1">Before adding this MOD to your forum, you should back up all files and databases related to this MOD.</span></p>
 					<p><span id="lang-ontt2">This MOD was designed for phpBB</span><xsl:text> </xsl:text><xsl:value-of select="mod:installation/mod:target-version" /><xsl:text> </xsl:text>&nbsp;<span id="lang-ontt3">and may not function as stated on other phpBB versions. MODs for phpBB 3.0 will <strong>not</strong> work on phpBB 2.0 and vice versa.</span></p>
 					<xsl:for-each select="./mod:mod-version">
 						<xsl:if test="substring-before(current(), '.') = 0">
 							<p><strong class="red"><span id="lang-onttq">This MOD is development quality. It is not recommended that you install it on a live forum.</span></strong></p>
 						</xsl:if>
 					</xsl:for-each>
-					</div>
+				</div>
 				<span class="corners-bottom"><span></span></span>
 			</div>
 		</div>
@@ -1798,11 +1839,12 @@
 			<h3><span id="lang-lic">License</span>&nbsp;<span id="lang-isp">and English support</span></h3>
 			<div class="mod-about">
 				<span class="corners-top"><span></span></span>
-					<div class="mod-about-padding">
+				<div class="mod-about-padding">
 					<p><span id="lang-lict">This MOD has been licensed under the following license:</span></p>
 					<p style='white-space:pre;'><a href="license.txt"><xsl:value-of select="mod:license" /></a></p>
 					<p><span id="lang-ispt">English support can be obtained at <a href="http://www.phpbb.com/mods/">http://www.phpbb.com/mods/</a> for released MODs.</span></p>
-					</div>
+					<p><span id="lang-ispt-int">Support in your language <strong>might</strong> be available at a <a href="http://www.phpbb.com/support/intl/">international support site</a>.</span></p>
+				</div>
 				<span class="corners-bottom"><span></span></span>
 			</div>
 			<xsl:for-each select="mod:history">
@@ -1824,23 +1866,31 @@
 								<xsl:when test="@phpbbcom = 'no' or @phpbbcom = 'No' or @phpbbcom = 'NO'">
 									<dd name="author-dd"><span dir="ltr"><xsl:value-of select="$authorname" /></span></dd>
 								</xsl:when>
+
 								<xsl:otherwise>
-									<xsl:variable name="authortemp">
-										<xsl:call-template name="replaceCharsInString">
-											<xsl:with-param name="stringIn" select="string($authorname)"/>
-											<xsl:with-param name="charsIn" select="'#'"/>
-											<xsl:with-param name="charsOut" select="'%23'"/>
+									<xsl:variable name="authorurl">
+										<xsl:call-template name="validate-username">
+											<xsl:with-param name="string-in" select="string($authorname)"/>
 										</xsl:call-template>
 									</xsl:variable>
-									<xsl:variable name="authorurl">
-										<xsl:call-template name="replaceCharsInString">
-											<xsl:with-param name="stringIn" select="string($authortemp)"/>
-											<xsl:with-param name="charsIn" select="' '"/>
-											<xsl:with-param name="charsOut" select="'%20'"/>
-										</xsl:call-template>
-									</xsl:variable>
-									<dd name="author-dd"><a dir="ltr" href="http://www.phpbb.com/community/memberlist.php?mode=viewprofile&amp;un={$authorurl}"><xsl:value-of select="$authorname" /></a></dd>
+
+									<xsl:variable name="browserEngine" select="system-property('xsl:vendor')" />
+									<xsl:choose>
+										<xsl:when test="$browserEngine='Opera'">
+											<xsl:variable name="operaurl">
+												<xsl:call-template name="validate-opera">
+													<xsl:with-param name="string-in" select="string($authorurl)"/>
+												</xsl:call-template>
+											</xsl:variable>
+											<dd name="author-dd"><a dir="ltr" href="http://www.phpbb.com/community/memberlist.php?mode=viewprofile&amp;un={$operaurl}"><xsl:value-of select="$authorname" /></a></dd>
+										</xsl:when>
+										<xsl:otherwise>
+											<dd name="author-dd"><a dir="ltr" href="http://www.phpbb.com/community/memberlist.php?mode=viewprofile&amp;un={$authorurl}"><xsl:value-of select="$authorname" /></a></dd>
+										</xsl:otherwise>
+
+									</xsl:choose>
 								</xsl:otherwise>
+
 							</xsl:choose>
 						</xsl:for-each>
 						<xsl:if test="mod:email != 'N/A' and mod:email != 'n/a' and mod:email != ''">
@@ -2043,23 +2093,49 @@
 					<xsl:for-each select="mod:sql">
 						<xsl:call-template name="give-sql"></xsl:call-template>
 					</xsl:for-each>
-				<span class="corners-bottom"><span></span></span></div>
+				<span class="corners-bottom"><span></span></span>
+			</div>
 		</xsl:if>
 		<xsl:if test="count(mod:copy) > 0">
 			<xsl:for-each select="mod:copy">
 				<xsl:call-template name="give-filez"></xsl:call-template>
 			</xsl:for-each>
 		</xsl:if>
+		<xsl:if test="count(mod:delete) > 0">
+			<xsl:for-each select="mod:delete">
+				<xsl:call-template name="away-filez"></xsl:call-template>
+			</xsl:for-each>
+		</xsl:if>
 		<xsl:if test="count(mod:open) > 0">
-		<h2 id="lang-edts">Edits</h2>
-		<p><span class="key">s</span><span class="key">w</span><span class="key">x</span><span id="lang-edtt">Use your keyboard to navigate the code boxes. You may also hit '<em>s</em>' on your keyboard to go to the first code box.</span></p>
-		<div id="edits">
-			<div class="inner">
-				<xsl:for-each select="mod:open">
-					<xsl:call-template name="give-fileo"></xsl:call-template>
-				</xsl:for-each>
+			<h2 id="lang-edts">Edits</h2>
+			<p><span class="key">s</span><span class="key">w</span><span class="key">x</span><span id="lang-edtt">Use your keyboard to navigate the code boxes. You may also hit '<em>s</em>' on your keyboard to go to the first code box.</span></p>
+			<div id="edits">
+				<div class="inner">
+					<xsl:for-each select="mod:open">
+						<xsl:call-template name="give-fileo"></xsl:call-template>
+					</xsl:for-each>
+				</div>
 			</div>
-		</div>
+		</xsl:if>
+		<xsl:if test="count(mod:php-installer) > 0">
+			<h2 id="lang-installer-h2">PHP install file</h2>
+			<div class="mod-about">
+				<span class="corners-top"><span></span></span>
+					<div class="mod-about-padding">
+						<p>
+							<span id="lang-installer-exp1">There is a PHP install file that needs to be run in order to complete the installation.</span>
+							<br />
+							<span id="lang-installer-exp2">To run it point your browser to, for example,</span><span dir="ltr"> domain.tld/phpBB3/<xsl:value-of select="mod:php-installer" /></span>
+						</p>
+						<div class="content">
+							<div class="codebox">
+								<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select All</span></a></div>
+								<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="mod:php-installer" /></pre></div>
+							</div>
+						</div>
+					</div>
+				<span class="corners-bottom"><span></span></span>
+			</div>
 		</xsl:if>
 		<xsl:call-template name="give-manual" />
 	</xsl:template>
@@ -2126,12 +2202,12 @@
 								</dl>
 							</div>
 						</xsl:if>
-						<xsl:for-each select="mod:find|mod:action|mod:inline-edit">
+						<xsl:for-each select="mod:find|mod:remove|mod:action|mod:inline-edit">
 							<xsl:if test="name() = 'find'">
 								<h4 id="lang-fnd[{generate-id()}]">Find</h4>
 								<p><span id="lang-fndt[{generate-id()}]"><strong>Tip:</strong> This may be a partial find and not the whole line.</span>
 									<xsl:if test="@type = 'regex'">
-										<br /><em id="lang-regex[{generate-id()}]">This find contains an advanced feature known as regular expressions, click here to learn more.</em>
+										<br /><em id="lang-regex[{generate-id()}]">This find contains an advanced feature known as regular expressions.</em>
 									</xsl:if>
 								</p>
 								<div class="codebox">
@@ -2139,22 +2215,30 @@
 									<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="current()" /></pre></div>
 								</div>
 							</xsl:if>
+							<xsl:if test="name() = 'remove'">
+								<h4 id="lang-remove[{generate-id()}]" style="color: #FF0FFF;">Find and Delete</h4>
+								<p><span id="lang-removet[{generate-id()}]"><strong>Tip:</strong>  Find and delete this code.</span></p>
+								<div class="codebox">
+									<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select All</span></a></div>
+									<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="current()" /></pre></div>
+								</div>
+							</xsl:if>
 							<xsl:if test="name() = 'action'">
 								<xsl:if test="@type = 'after-add'">
-									<h4 id="lang-aft[{generate-id()}]">Add after</h4>
+									<h4 id="lang-aft[{generate-id()}]" style="color: #009933;">Add after</h4>
 									<p><span id="lang-aftt[{generate-id()}]"><strong>Tip:</strong> Add these lines on a new blank line after the preceding line(s) to find.</span></p>
 								</xsl:if>
 								<xsl:if test="@type = 'before-add'">
-									<h4 id="lang-bef[{generate-id()}]">Add before</h4>
+									<h4 id="lang-bef[{generate-id()}]" style="color: #AC1987;">Add before</h4>
 									<p><span id="lang-beft[{generate-id()}]"><strong>Tip:</strong> Add these lines on a new blank line before the preceding line(s) to find.</span></p>
 								</xsl:if>
 								<xsl:if test="@type = 'replace-with'">
-									<h4 id="lang-rplw[{generate-id()}]">Replace with</h4>
+									<h4 id="lang-rplw[{generate-id()}]" style="color: #AE1616;">Replace with</h4>
 									<p><span id="lang-rplwt[{generate-id()}]"><strong>Tip:</strong> Replace the preceding line(s) to find with the following lines.</span></p>
 								</xsl:if>
 								<xsl:if test="@type = 'operation'">
-									<h4 id="lang-inc[{generate-id()}]">Increment</h4>
-									<p><span id="lang-inct[{generate-id()}]"><strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.</span></p>
+									<h4 id="lang-inc[{generate-id()}]" style="color: #333333;">Operation</h4>
+									<p><span id="lang-inct[{generate-id()}]"><strong>Tip:</strong> This allows you to alter integers.</span></p>
 								</xsl:if>
 								<div class="codebox">
 									<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select all</span></a></div>
@@ -2163,12 +2247,12 @@
 							</xsl:if>
 							<xsl:if test="name() = 'inline-edit'">
 								<div class="mod-inlineedit">
-									<xsl:for-each select="mod:inline-find|mod:inline-action|mod:inline-comment">
+									<xsl:for-each select="mod:inline-find|mod:inline-remove|mod:inline-action|mod:inline-comment">
 										<xsl:if test="name() = 'inline-find'">
 											<h5 id="lang-ifnd[{generate-id()}]">In-line Find</h5>
 											<p><span id="lang-ifndt[{generate-id()}]"><strong>Tip:</strong> This is a partial match of a line for in-line operations.</span>
 												<xsl:if test="@type = 'regex'">
-													<br /><em id="lang-regex[{generate-id()}]">This find contains an advanced feature known as regular expressions, click here to learn more.</em>
+													<br /><em id="lang-regex[{generate-id()}]">This find contains an advanced feature known as regular expressions.</em>
 												</xsl:if>
 											</p>
 											<div class="codebox">
@@ -2176,22 +2260,30 @@
 												<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="current()" /></pre></div>
 											</div>
 										</xsl:if>
+										<xsl:if test="name() = 'inline-remove'">
+											<h5 id="lang-iremove[{generate-id()}]" style="color: #FF0FFF;">In-line Find and Delete</h5>
+											<p><span id="lang-iremovet[{generate-id()}]"><strong>Tip:</strong> Find this code in the line and delete it.</span></p>
+											<div class="codebox">
+												<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select all</span></a></div>
+												<div class="codePre"><pre id="{generate-id()}" dir="ltr"><xsl:value-of select="current()" /></pre></div>
+											</div>
+										</xsl:if>
 										<xsl:if test="name() = 'inline-action'">
 											<xsl:if test="@type = 'after-add'">
-												<h5 id="lang-iaft[{generate-id()}]">In-line Add after</h5>
+												<h5 id="lang-iaft[{generate-id()}]" style="color: #009933;">In-line Add after</h5>
 												<p><span id="lang-iaftt[{generate-id()}]"></span></p>
 											</xsl:if>
 											<xsl:if test="@type = 'before-add'">
-												<h5 id="lang-ibef[{generate-id()}]">In-line Add before</h5>
+												<h5 id="lang-ibef[{generate-id()}]" style="color: #AC1987;">In-line Add before</h5>
 												<p><span id="lang-ibeft[{generate-id()}]"></span></p>
 											</xsl:if>
 											<xsl:if test="@type = 'replace-with'">
-												<h5 id="lang-irplw[{generate-id()}]">In-line Replace with</h5>
+												<h5 id="lang-irplw[{generate-id()}]" style="color: #AE1616;">In-line Replace with</h5>
 												<p><span id="lang-irplwt[{generate-id()}]"></span></p>
 											</xsl:if>
 											<xsl:if test="@type = 'operation'">
-												<h5 id="lang-iinc[{generate-id()}]">In-line Increment</h5>
-												<p><span id="lang-iinct[{generate-id()}]"><strong>Tip:</strong> This allows you to alter integers. For help on what each operator means, click here.</span></p>
+												<h5 id="lang-iinc[{generate-id()}]" style="color: #333333;">In-line Operation</h5>
+												<p><span id="lang-iinct[{generate-id()}]"><strong>Tip:</strong> This allows you to alter integers.</span></p>
 											</xsl:if>
 											<div class="codebox">
 												<div class="codeHead"><span id="lang-cde-c[{generate-id()}]">Code:</span><a href="#" onclick="select_code(this); return false;" class="codeSelect"><span id="lang-cde-sa[{generate-id()}]">Select All</span></a></div>
@@ -2231,6 +2323,26 @@
 		</ol>
 	</xsl:template>
 
+	<xsl:template name="away-filez">
+		<xsl:choose>
+			<xsl:when test="count(mod:file) > 1">
+				<h2 id="lang-del-heads">Delete files</h2>
+			</xsl:when>
+			<xsl:otherwise>
+				<h2 id="lang-del-head">Delete file</h2>
+			</xsl:otherwise>
+		</xsl:choose>
+		<ol id="file-delete">
+			<xsl:for-each select="mod:file">
+				<li>
+					<dl>
+						<dt><span id="lang-del-file[{generate-id()}]">Delete:</span>&nbsp;<xsl:value-of select="@name" /></dt>
+					</dl>
+				</li>
+			</xsl:for-each>
+		</ol>
+	</xsl:template>
+
 	<!-- add-line-breaks borrowed from http://www.stylusstudio.com/xsllist/200103/post40180.html -->
 	<xsl:template name="add-line-breaks">
 		<xsl:param name="string" select="." />
@@ -2265,4 +2377,279 @@
 		</xsl:choose>
 	</xsl:template>
 
-</xsl:stylesheet>
+	<!-- Replace some chars -->
+	<xsl:template name="validate-username">
+		<xsl:param name="string-in"/>
+
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+
+		<xsl:call-template name="replaceCharsInString">
+			<xsl:with-param name="stringIn" select="string($string-in)"/>
+			<xsl:with-param name="charsIn" select="'#'"/>
+			<xsl:with-param name="charsOut" select="'%23'"/>
+		</xsl:call-template>
+
+		</xsl:with-param><xsl:with-param name="charsIn" select="'&amp;'"/><xsl:with-param name="charsOut" select="'%26'"/></xsl:call-template> <!-- & -->
+		</xsl:with-param><xsl:with-param name="charsIn" select="'+'"/><xsl:with-param name="charsOut" select="'%2B'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="' '"/><xsl:with-param name="charsOut" select="'%20'"/></xsl:call-template> <!-- space -->
+	</xsl:template>
+
+	<!-- This is only needed for Opera support, hiding it here at the bottom. -->
+	<xsl:template name="validate-opera">
+		<xsl:param name="string-in"/>
+
+		<!-- This doesn't follow any coding guidelines. But is easier to read this way -->
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+		<xsl:call-template name="replaceCharsInString"><xsl:with-param name="stringIn">
+
+		<xsl:call-template name="replaceCharsInString">
+			<xsl:with-param name="stringIn" select="string($string-in)"/>
+			<xsl:with-param name="charsIn" select="'é'"/>
+			<xsl:with-param name="charsOut" select="'%C3%A9'"/>
+		</xsl:call-template>
+
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ÿ'"/><xsl:with-param name="charsOut" select="'%C3%BF'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'þ'"/><xsl:with-param name="charsOut" select="'%C3%BE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ý'"/><xsl:with-param name="charsOut" select="'%C3%BD'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ü'"/><xsl:with-param name="charsOut" select="'%C3%BC'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'û'"/><xsl:with-param name="charsOut" select="'%C3%BB'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ú'"/><xsl:with-param name="charsOut" select="'%C3%BA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ù'"/><xsl:with-param name="charsOut" select="'%C3%B9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ø'"/><xsl:with-param name="charsOut" select="'%C3%B8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'÷'"/><xsl:with-param name="charsOut" select="'%C3%B7'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ö'"/><xsl:with-param name="charsOut" select="'%C3%B6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'õ'"/><xsl:with-param name="charsOut" select="'%C3%B5'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ô'"/><xsl:with-param name="charsOut" select="'%C3%B4'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ó'"/><xsl:with-param name="charsOut" select="'%C3%B3'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ò'"/><xsl:with-param name="charsOut" select="'%C3%B2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ñ'"/><xsl:with-param name="charsOut" select="'%C3%B1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ð'"/><xsl:with-param name="charsOut" select="'%C3%B0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ï'"/><xsl:with-param name="charsOut" select="'%C3%AF'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'î'"/><xsl:with-param name="charsOut" select="'%C3%AE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'í'"/><xsl:with-param name="charsOut" select="'%C3%AD'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ì'"/><xsl:with-param name="charsOut" select="'%C3%AC'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ë'"/><xsl:with-param name="charsOut" select="'%C3%AB'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ê'"/><xsl:with-param name="charsOut" select="'%C3%AA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'é'"/><xsl:with-param name="charsOut" select="'%C3%A9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'è'"/><xsl:with-param name="charsOut" select="'%C3%A8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ç'"/><xsl:with-param name="charsOut" select="'%C3%A7'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'æ'"/><xsl:with-param name="charsOut" select="'%C3%A6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'å'"/><xsl:with-param name="charsOut" select="'%C3%A5'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ä'"/><xsl:with-param name="charsOut" select="'%C3%A4'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ã'"/><xsl:with-param name="charsOut" select="'%C3%A3'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'â'"/><xsl:with-param name="charsOut" select="'%C3%A2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'á'"/><xsl:with-param name="charsOut" select="'%C3%A1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'à'"/><xsl:with-param name="charsOut" select="'%C3%A0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ß'"/><xsl:with-param name="charsOut" select="'%C3%9F'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Þ'"/><xsl:with-param name="charsOut" select="'%C3%9E'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ý'"/><xsl:with-param name="charsOut" select="'%C3%9D'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ü'"/><xsl:with-param name="charsOut" select="'%C3%9C'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Û'"/><xsl:with-param name="charsOut" select="'%C3%9B'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ú'"/><xsl:with-param name="charsOut" select="'%C3%9A'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ù'"/><xsl:with-param name="charsOut" select="'%C3%99'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ø'"/><xsl:with-param name="charsOut" select="'%C3%98'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'×'"/><xsl:with-param name="charsOut" select="'%C3%97'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ö'"/><xsl:with-param name="charsOut" select="'%C3%96'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Õ'"/><xsl:with-param name="charsOut" select="'%C3%95'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ô'"/><xsl:with-param name="charsOut" select="'%C3%94'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ó'"/><xsl:with-param name="charsOut" select="'%C3%93'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ò'"/><xsl:with-param name="charsOut" select="'%C3%92'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ñ'"/><xsl:with-param name="charsOut" select="'%C3%91'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ð'"/><xsl:with-param name="charsOut" select="'%C3%90'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ï'"/><xsl:with-param name="charsOut" select="'%C3%8F'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Î'"/><xsl:with-param name="charsOut" select="'%C3%8E'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Í'"/><xsl:with-param name="charsOut" select="'%C3%8D'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ì'"/><xsl:with-param name="charsOut" select="'%C3%8C'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ë'"/><xsl:with-param name="charsOut" select="'%C3%8B'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ê'"/><xsl:with-param name="charsOut" select="'%C3%8A'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'É'"/><xsl:with-param name="charsOut" select="'%C3%89'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'È'"/><xsl:with-param name="charsOut" select="'%C3%88'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ç'"/><xsl:with-param name="charsOut" select="'%C3%87'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Æ'"/><xsl:with-param name="charsOut" select="'%C3%86'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Å'"/><xsl:with-param name="charsOut" select="'%C3%85'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ä'"/><xsl:with-param name="charsOut" select="'%C3%84'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ã'"/><xsl:with-param name="charsOut" select="'%C3%83'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Â'"/><xsl:with-param name="charsOut" select="'%C3%82'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Á'"/><xsl:with-param name="charsOut" select="'%C3%81'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'À'"/><xsl:with-param name="charsOut" select="'%C3%80'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¿'"/><xsl:with-param name="charsOut" select="'%C2%BF'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¾'"/><xsl:with-param name="charsOut" select="'%C2%BE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'½'"/><xsl:with-param name="charsOut" select="'%C2%BD'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¼'"/><xsl:with-param name="charsOut" select="'%C2%BC'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'»'"/><xsl:with-param name="charsOut" select="'%C2%BB'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'º'"/><xsl:with-param name="charsOut" select="'%C2%BA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¹'"/><xsl:with-param name="charsOut" select="'%C2%B9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¸'"/><xsl:with-param name="charsOut" select="'%C2%B8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'·'"/><xsl:with-param name="charsOut" select="'%C2%B7'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¶'"/><xsl:with-param name="charsOut" select="'%C2%B6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'µ'"/><xsl:with-param name="charsOut" select="'%C2%B5'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'´'"/><xsl:with-param name="charsOut" select="'%C2%B4'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'³'"/><xsl:with-param name="charsOut" select="'%C2%B3'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'²'"/><xsl:with-param name="charsOut" select="'%C2%B2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'±'"/><xsl:with-param name="charsOut" select="'%C2%B1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'°'"/><xsl:with-param name="charsOut" select="'%C2%B0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¯'"/><xsl:with-param name="charsOut" select="'%C2%AF'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'®'"/><xsl:with-param name="charsOut" select="'%C2%AE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¬'"/><xsl:with-param name="charsOut" select="'%C2%AC'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'«'"/><xsl:with-param name="charsOut" select="'%C2%AB'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ª'"/><xsl:with-param name="charsOut" select="'%C2%AA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'©'"/><xsl:with-param name="charsOut" select="'%C2%A9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¨'"/><xsl:with-param name="charsOut" select="'%C2%A8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'§'"/><xsl:with-param name="charsOut" select="'%C2%A7'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¦'"/><xsl:with-param name="charsOut" select="'%C2%A6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¥'"/><xsl:with-param name="charsOut" select="'%C2%A5'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¤'"/><xsl:with-param name="charsOut" select="'%C2%A4'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'£'"/><xsl:with-param name="charsOut" select="'%C2%A3'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¢'"/><xsl:with-param name="charsOut" select="'%C2%A2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'¡'"/><xsl:with-param name="charsOut" select="'%C2%A1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ÿ'"/><xsl:with-param name="charsOut" select="'%C5%B8'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ž'"/><xsl:with-param name="charsOut" select="'%C5%BE'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'œ'"/><xsl:with-param name="charsOut" select="'%C5%93'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'›'"/><xsl:with-param name="charsOut" select="'%E2%80%BA'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'š'"/><xsl:with-param name="charsOut" select="'%C5%A1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'™'"/><xsl:with-param name="charsOut" select="'%E2%84%A2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'˜'"/><xsl:with-param name="charsOut" select="'%CB%9C'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'—'"/><xsl:with-param name="charsOut" select="'%E2%80%94'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'–'"/><xsl:with-param name="charsOut" select="'%E2%80%93'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'•'"/><xsl:with-param name="charsOut" select="'%E2%80%A2'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'”'"/><xsl:with-param name="charsOut" select="'%E2%80%9D'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'“'"/><xsl:with-param name="charsOut" select="'%E2%80%9C'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'’'"/><xsl:with-param name="charsOut" select="'%E2%80%99'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‘'"/><xsl:with-param name="charsOut" select="'%E2%80%98'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Ž'"/><xsl:with-param name="charsOut" select="'%C5%BD'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Œ'"/><xsl:with-param name="charsOut" select="'%C5%92'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‹'"/><xsl:with-param name="charsOut" select="'%E2%80%B9'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'Š'"/><xsl:with-param name="charsOut" select="'%C5%A0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‰'"/><xsl:with-param name="charsOut" select="'%E2%80%B0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ˆ'"/><xsl:with-param name="charsOut" select="'%CB%86'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‡'"/><xsl:with-param name="charsOut" select="'%E2%80%A1'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'†'"/><xsl:with-param name="charsOut" select="'%E2%80%A0'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'…'"/><xsl:with-param name="charsOut" select="'%E2%80%A6'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'„'"/><xsl:with-param name="charsOut" select="'%E2%80%9E'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'ƒ'"/><xsl:with-param name="charsOut" select="'%C6%92'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'‚'"/><xsl:with-param name="charsOut" select="'%E2%80%9A'"/></xsl:call-template>
+		</xsl:with-param><xsl:with-param name="charsIn" select="'€'"/><xsl:with-param name="charsOut" select="'%E2%82%AC'"/></xsl:call-template>
+	</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
--- a/subsilver2.xml	Sat Mar 20 16:49:45 2010 +0000
+++ b/subsilver2.xml	Mon Aug 02 19:30:31 2010 +0000
@@ -6,7 +6,7 @@
       security problems within the MOD. No support will be given for MODs not
       found within the MODs Database which can be found at
       http://www.phpbb.com/mods/-->
-<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.3.xsd">
+<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
 	<header>
 		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
 		<title lang="en-gb">Multi-race rank themes - subsilver2</title>
@@ -39,9 +39,9 @@
 			</author>
 		</author-group>
 		<link-group>
-			<link type="parent" href="Install.xml" lang="en-gb">Main instructions</link>
+			<link type="parent" href="install.xml" lang="en-gb">Main instructions</link>
 		</link-group>
-		<mod-version>1.3.5</mod-version>
+		<mod-version>1.4.0</mod-version>
 		<installation>
 			<level>intermediate</level>
 			<time>180</time>
@@ -49,6 +49,13 @@
 		</installation>
 		<history>
 			<entry>
+				<date>2010-08-02</date>
+				<rev-version>1.4.0</rev-version>
+				<changelog lang="en-gb">
+					<change>Update to final 1.4.0 release - no changes</change>
+				</changelog>
+			</entry>
+			<entry>
 				<date>2010-03-02</date>
 				<rev-version>1.3.5</rev-version>
 				<changelog lang="en-gb">