view Install.xml @ 1:26a2404a2f38

Initial commit of v1.0.1 instructions no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Sun, 07 Jun 2009 17:55:54 +0000
parents
children 4d1dd45e6549
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.1.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/Install.xml" lang="en-gb">Multi-Race Rank Theme MOD integration</link>
		</link-group>
		<mod-version>1.0.1</mod-version>
		<installation>
			<level>intermediate</level>
			<time>600</time>
			<target-version>3.0.1</target-version>
		</installation>
		<history>
			<entry>
				<date>2008-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>2008-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[?>]]></find>
				<action type="before-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
]]>
				</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 rank title will be stored here after execution
* @param string &$rank_img the rank image as full img tag is stored here after execution
* @param string &$rank_img_src the rank image source is stored here after execution
*
*/
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="memberlist.php">
			<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/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'				=> '',]]></find>
				<action type="before-add"><![CDATA[
				'extra_rank_title'		=> '',
				'extra_rank_image'		=> '',
				'extra_rank_image_src'	=> '',]]></action>
			</edit>
			<edit>
				<find><![CDATA[				'username'			=> $row['username'],]]></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>