view install.xml @ 9:09596edfe65e v1.2.1

* Fix ambiguity in viewtopic.php instructions no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Sat, 14 Aug 2010 13:37:04 +0000
parents 2b9634b63474
children 1b7db8283b8d
line wrap: on
line source

<?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">Special and Normal Rank Images</title>
		<description lang="en-gb">This MOD will allow users with special ranks (e.g. Administrators) to have a normal rank image in addition to their special rank image in topics and on their profile page.</description>
		<author-notes lang="en-gb"><![CDATA[While this mod doesn't have to be installed along-side the "Multi-Race Rank Theme" mod, it is compatible with the mod and can be used to compliment it. Instructions on how to alter the Multi-Race Rank Theme mod to allow users with special ranks to choose a theme can be found in the /contrib folder.

The styling used by this mod is entirely arbitrary and was included as an example. You may wish to use different HTML in memberlist_view.html and viewtopic_body.html.]]></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/MultiRaceRankThemesIntegration.xml" lang="en-gb">Multi-Race Rank Theme MOD integration</link>
		</link-group>
		<mod-version>1.2.1</mod-version>
		<installation>
			<level>intermediate</level>
			<time>600</time>
			<target-version>3.0.7</target-version>
		</installation>
		<history>
			<entry>
				<date>2010-08-14</date>
				<rev-version>1.2.1</rev-version>
				<changelog lang="en-gb">
					<change>Fix: Resolve ambiguity in viewtopic.php instructions</change>
				</changelog>
			</entry>
			<entry>
				<date>2010-08-01</date>
				<rev-version>1.2.0</rev-version>
				<changelog lang="en-gb">
					<change>Update version number and other minor fixes for release</change>
				</changelog>
			</entry>
			<entry>
				<date>2010-03-20</date>
				<rev-version>1.1.1</rev-version>
				<changelog lang="en-gb">
					<change>Fix: Correct array indexes in ucp_pm_viewmessage.php (should be image, not img) - thanks to _RocknRoll for reporting it</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-06-15</date>
				<rev-version>1.1.0</rev-version>
				<changelog lang="en-gb">
					<change>Add: Add config value for Memberlist that also fixes the situation where only users with special ranks show ranks in the members list</change>
					<change>Add: Add code and template to add both ranks when viewing PMs</change>
					<change>Change: Update documentation on get_user_additional_rank to make it different to get_user_rank</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-01-09</date>
				<rev-version>1.0.1</rev-version>
				<changelog lang="en-gb">
					<change>No code changes - convert instructions to less semantically rich MODX 1.2.1 format</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-01-08</date>
				<rev-version>1.0.0</rev-version>
				<changelog lang="en-gb">
					<change>No code changes - first release</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-05-12</date>
				<rev-version>0.1.5</rev-version>
				<changelog lang="en-gb">
					<change>Fix: Stop users without a special rank showing their posting rank twice when SPECIAL_RANK_AS_EXTRA is set to true</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-05-09</date>
				<rev-version>0.1.4b</rev-version>
				<changelog lang="en-gb">
					<change>Update: Add ability to have the special rank show as the 'extra' rank to allow admins to have their admin rank in a different location to their post rank (add new change to includes/constants.php and overhaul changes in viewtopic.php and memberlist.php)</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-05-05</date>
				<rev-version>0.1.3b</rev-version>
				<changelog lang="en-gb">
					<change>Fix: Move mis-placed instruction from a template file to memberlist.php and make sure instruction doesn't match multiple locations</change>
					<change>Change: Separate out Subsilver instructions</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-04-13</date>
				<rev-version>0.1.2b</rev-version>
				<changelog lang="en-gb">
					<change>Fix: "Undeclared index" warnings that were reported in viewtopic.php when viewing guest posts (added setting of blank defaults for guests)</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-04-13</date>
				<rev-version>0.1.1b</rev-version>
				<changelog lang="en-gb">
					<change>Initial release</change>
				</changelog>
			</entry>
		</history>
	</header>
	<action-group>
		<open src="includes/constants.php">
			<edit>
				<find><![CDATA[// Additional constants]]></find>
				<action type="after-add"><![CDATA[// Special and normal rank images
define('SHOW_SPECIAL_AS_EXTRA', false); //Set to true if you want topics and profiles to show the special ranks, e.g. Administrator, as the 'extra' rank
define('SHOW_ONLY_NORMAL_RANKS_ON_MEMBERLIST', false); //Set to true if you want the memberslist to show only normal ranks and not special ranks
]]>
				</action>
			</edit>
		</open>
		<open src="includes/functions_display.php">
			<edit>
				<find><![CDATA[/**
* Get user avatar]]></find>
				<action type="before-add"><![CDATA[/**
* Get user's additional (normal) rank title and image if they have a special rank
*
* @param int $user_rank the current stored users rank id
* @param int $user_posts the users number of posts
* @param string &$rank_title the additional rank title will be stored here after execution, if the user has an additional rank
* @param string &$rank_img the additional rank image as full img tag is stored here after execution, if the user has an additional rank
* @param string &$rank_img_src the additional rank image source is stored here after execution, if the user has an additional rank
*
*/
function get_user_additional_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
{
	if (!empty($user_rank))
	{
		//Always pass 0 to save duplicating get_user_rank and getting the special rank back
		get_user_rank(0, $user_posts, $rank_title, $rank_img, $rank_img_src);
	}
}
]]>
				</action>
			</edit>
		</open>
		<open src="includes/ucp/ucp_pm_viewmessage.php">
			<edit>
				<find><![CDATA[		'RANK_TITLE'		=> $user_info['rank_title'],
		'RANK_IMG'			=> $user_info['rank_image'],]]></find>
				<action type="after-add"><![CDATA[		'EXTRA_RANK_TITLE'		=> $user_info['extra_rank_title'],
		'EXTRA_RANK_IMG'			=> $user_info['extra_rank_img'],]]></action>
			</edit>
			<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>
				<action type="after-add"><![CDATA[	$user_row['extra_rank_title'] = $user_row['extra_rank_img'] = $user_row['extra_rank_img_src'] = '';

	if (defined('SHOW_SPECIAL_AS_EXTRA') && SHOW_SPECIAL_AS_EXTRA)
	{
		$user_row['extra_rank_title'] = $user_row['rank_title'];
		$user_row['extra_rank_img'] = $user_row['rank_image'];
		$user_row['extra_rank_img_src'] = $user_row['rank_img_src'];
		$user_row['rank_title'] = $user_row['rank_image'] = $user_row['rank_image_src'] = '';

		get_user_additional_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
	}
	else
	{
		get_user_additional_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['extra_rank_title'], $user_row['extra_rank_img'], $user_row['extra_rank_img_src']);
	}]]></action>
			</edit>
		</open>
		<open src="memberlist.php">
			<edit>
				<find><![CDATA[				if (isset($cp_row['row']) && sizeof($cp_row['row']))]]></find>
				<action type="before-add"><![CDATA[				$user_rank = $row['user_rank'];

				if (defined('SHOW_ONLY_NORMAL_RANKS_ON_MEMBERLIST') && SHOW_ONLY_NORMAL_RANKS_ON_MEMBERLIST)
				{
					$user_rank = 0;
				}

				//Reset our ranks, since show_profile() gets the values for the profile page
				get_user_rank($user_rank, (($user_id == ANONYMOUS) ? false : $row['user_posts']), $memberrow['RANK_TITLE'], $memberrow['RANK_IMG'], $memberrow['RANK_IMG_SRC']);]]></action>
			</edit>
			<edit>
				<find><![CDATA[	if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_user'))]]></find>
				<action type="before-add"><![CDATA[	$extra_rank_title = $extra_rank_img = $extra_rank_img_src = '';

	if (defined('SHOW_SPECIAL_AS_EXTRA') && SHOW_SPECIAL_AS_EXTRA)
	{
		$extra_rank_title = $rank_title;
		$extra_rank_img = $rank_img;
		$extra_rank_img_src = $rank_img_src;
		$rank_title = $rank_img = $rank_img_src = '';

		get_user_additional_rank($data['user_rank'], $data['user_posts'], $rank_title, $rank_img, $rank_img_src);
	}
	else
	{
		get_user_additional_rank($data['user_rank'], $data['user_posts'], $extra_rank_title, $extra_rank_img, $extra_rank_img_src);
	}
]]></action>
			</edit>
			<edit>
				<find><![CDATA[		'ICQ_STATUS_IMG'	=> (!empty($data['user_icq']))]]></find>
				<action type="before-add"><![CDATA[
		'EXTRA_RANK_TITLE'	=> $extra_rank_title,
		'EXTRA_RANK_IMG'	=> $extra_rank_img,
		'EXTRA_RANK_IMG_SRC'=> $extra_rank_img_src,]]></action>
			</edit>
		</open>
		<open src="styles/prosilver/template/memberlist_view.html">
			<edit>
				<find><![CDATA[			<!-- IF RANK_IMG --><dd style="text-align: center;">{RANK_IMG}</dd><!-- ENDIF -->]]></find>
				<action type="after-add"><![CDATA[
			<!-- IF EXTRA_RANK_TITLE --><dd style="text-align: center;">{EXTRA_RANK_TITLE}</dd><!-- ENDIF -->
			<!-- IF EXTRA_RANK_IMG --><dd style="text-align: center;">{EXTRA_RANK_IMG}</dd><!-- ENDIF -->]]>
				</action>
			</edit>
			<edit>
				<find><![CDATA[			<!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt> <dd>{RANK_IMG}</dd><!-- ENDIF -->]]></find>
				<action type="after-add"><![CDATA[
			<!-- IF EXTRA_RANK_TITLE --><dt>&nbsp;</dt> <dd>{EXTRA_RANK_TITLE}</dd><!-- ENDIF -->
			<!-- IF EXTRA_RANK_IMG --><dt>&nbsp;</dt> <dd>{EXTRA_RANK_IMG}</dd><!-- ENDIF -->]]></action>
			</edit>
		</open>
		<open src="styles/prosilver/template/ucp_pm_viewmessage.html">
			<edit>
				<find><![CDATA[		<!-- IF RANK_IMG --><dd>{RANK_IMG}</dd><!-- ENDIF -->]]></find>
				<action type="after-add"><![CDATA[		<!-- IF EXTRA_RANK_TITLE --><dd>{EXTRA_RANK_TITLE}</dd><!-- ENDIF -->
		<!-- IF EXTRA_RANK_IMG --><dd>{EXTRA_RANK_IMG}</dd><!-- ENDIF -->]]></action>
			</edit>
		</open>
		<open src="styles/prosilver/template/viewtopic_body.html">
			<edit>
				<find><![CDATA[			<!-- IF postrow.RANK_TITLE or postrow.RANK_IMG --><dd>{postrow.RANK_TITLE}<!-- IF postrow.RANK_TITLE and postrow.RANK_IMG --><br /><!-- ENDIF -->{postrow.RANK_IMG}</dd><!-- ENDIF -->]]></find>
				<action type="after-add"><![CDATA[			<!-- IF postrow.EXTRA_RANK_TITLE or postrow.EXTRA_RANK_IMG --><dd>{postrow.EXTRA_RANK_TITLE}<!-- IF postrow.EXTRA_RANK_TITLE and postrow.EXTRA_RANK_IMG --><br /><!-- ENDIF -->{postrow.EXTRA_RANK_IMG}</dd><!-- ENDIF -->]]>
				</action>
			</edit>
		</open>
		<open src="viewtopic.php">
			<edit>
				<find><![CDATA[				'sig'				=> '',
				'profile'			=> '',]]></find>
				<action type="before-add"><![CDATA[
				'extra_rank_title'		=> '',
				'extra_rank_image'		=> '',
				'extra_rank_image_src'	=> '',]]></action>
			</edit>
			<edit>
				<find><![CDATA[
				'username'			=> $row['username'],
				'user_colour'		=> $row['user_colour'],

				'online'		=> false,]]></find>
				<action type="before-add"><![CDATA[
				'extra_rank_title'		=> '',
				'extra_rank_image'		=> '',
				'extra_rank_image_src'	=> '',]]></action>
			</edit>
			<edit>
				<find><![CDATA[			if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email'))]]></find>
				<action type="before-add"><![CDATA[
			if (defined('SHOW_SPECIAL_AS_EXTRA') && SHOW_SPECIAL_AS_EXTRA)
			{
				$user_cache[$poster_id]['extra_rank_title'] = $user_cache[$poster_id]['rank_title'];
				$user_cache[$poster_id]['extra_rank_image'] = $user_cache[$poster_id]['rank_image'];
				$user_cache[$poster_id]['extra_rank_image_src'] = $user_cache[$poster_id]['rank_image_src'];
				$user_cache[$poster_id]['rank_title'] = $user_cache[$poster_id]['rank_image'] = $user_cache[$poster_id]['rank_image_src'] = '';

				get_user_additional_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']);
			}
			else
			{
				get_user_additional_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['extra_rank_title'], $user_cache[$poster_id]['extra_rank_image'], $user_cache[$poster_id]['extra_rank_image_src']);
			}
]]></action>
			</edit>
			<edit>
				<find><![CDATA[		'RANK_IMG_SRC'		=> $user_cache[$poster_id]['rank_image_src'],]]></find>
				<action type="after-add"><![CDATA[
		'EXTRA_RANK_TITLE'	=> $user_cache[$poster_id]['extra_rank_title'],
		'EXTRA_RANK_IMG'	=> $user_cache[$poster_id]['extra_rank_image'],
		'EXTRA_RANK_IMG_SRC'=> $user_cache[$poster_id]['extra_rank_image_src'],]]></action>
			</edit>
		</open>
	</action-group>
</mod>