changeset 15:fe74124d7205 default tip

Finally commit fix released back in 2012!
author IBBoard <dev@ibboard.co.uk>
date Fri, 24 Jul 2015 19:51:56 +0100
parents 7ddd54f4ad7d
children
files contrib/MultiRaceRankThemesIntegration.xml contrib/Upgrade-1.2.2-to-1.2.3.xml install.xml
diffstat 3 files changed, 207 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/MultiRaceRankThemesIntegration.xml	Sat Oct 08 16:34:52 2011 +0100
+++ b/contrib/MultiRaceRankThemesIntegration.xml	Fri Jul 24 19:51:56 2015 +0100
@@ -30,7 +30,7 @@
 		<installation>
 			<level>intermediate</level>
 			<time>300</time>
-			<target-version>3.0.8</target-version>
+			<target-version>3.0.9</target-version>
 		</installation>
 		<history>
 			<entry>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/Upgrade-1.2.2-to-1.2.3.xml	Fri Jul 24 19:51:56 2015 +0100
@@ -0,0 +1,156 @@
+<?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 - Upgrade 1.2.2 to 1.2.3</title>
+		<description lang="en-gb">This MOD will allow users with special ranks (e.g. Administrators) to have a normal rank theme in addition to their special rank image in topics.</description>
+		<author-notes lang="en-gb"><![CDATA[These instructions are provided as a convenience to aid upgrading. If you encounter problems, please try reverting to a clean copy of the code and re-applying the latest changes from scratch.
+
+		IMPORTANT: These upgrade instructions take no account of other MODs and integration. Each change assumes a vanilla install. If you don't have a vanilla install of v1.2.2 of this MOD then simply wrap the code that matches the IF...ELSE statement in the IF statement from the Replace instructions.]]></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="parent" href="../install.xml" lang="en-gb">Main instructions</link>
+		</link-group>
+		<mod-version>1.0.0</mod-version>
+		<installation>
+			<level>intermediate</level>
+			<time>300</time>
+			<target-version>3.0.9</target-version>
+		</installation>
+		<history>
+			<entry>
+				<date>2010-08-01</date>
+				<rev-version>1.0.0</rev-version>
+				<changelog lang="en-gb">
+					<change>Create update instructions</change>
+				</changelog>
+			</entry>
+		</history>
+	</header>
+	<action-group>
+		<open src="includes/ucp/ucp_pm_viewmessage.php">
+			<edit>
+				<find><![CDATA[
+	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']);
+	}]]></find>
+				<action type="replace-with"><![CDATA[
+	if (!empty($user_row['user_rank']))
+	{
+		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[	$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);
+	}]]></find>
+				<action type="replace-with"><![CDATA[
+	if (!empty($data['user_rank']))
+	{
+		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>
+		</open>
+		<open src="viewtopic.php">
+			<edit>
+				<find><![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']);
+			}
+]]></find>
+				<action type="before-add"><![CDATA[
+			if (!empty($row['user_rank']))
+			{
+				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>
+		</open>
+	</action-group>
+</mod>
--- a/install.xml	Sat Oct 08 16:34:52 2011 +0100
+++ b/install.xml	Fri Jul 24 19:51:56 2015 +0100
@@ -26,15 +26,23 @@
 		<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 type="contrib" href="contrib/Upgrade-1.2.2-to-1.2.3.xml" lang="en-gb">Upgrade 1.2.2 to 1.2.3</link>
 		</link-group>
-		<mod-version>1.2.2</mod-version>
+		<mod-version>1.2.3</mod-version>
 		<installation>
 			<level>intermediate</level>
 			<time>600</time>
-			<target-version>3.0.8</target-version>
+			<target-version>3.0.9</target-version>
 		</installation>
 		<history>
 			<entry>
+				<date>2012-08-20</date>
+				<rev-version>1.2.3</rev-version>
+				<changelog lang="en-gb">
+					<change>Fix: Correct behaviour of SHOW_SPECIAL_AS_EXTRA constant</change>
+				</changelog>
+			</entry>
+			<entry>
 				<date>2010-12-04</date>
 				<rev-version>1.2.2</rev-version>
 				<changelog lang="en-gb">
@@ -171,19 +179,23 @@
 				<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)
+	if (!empty($user_row['user_rank']))
 	{
-		$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'] = '';
+		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']);
+			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']);
+		}
 	}
-	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>
+]]></action>
 			</edit>
 		</open>
 		<open src="memberlist.php">
@@ -203,18 +215,21 @@
 				<find><![CDATA[	if ((!empty($data['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $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)
+	if (!empty($data['user_rank']))
 	{
-		$extra_rank_title = $rank_title;
-		$extra_rank_img = $rank_img;
-		$extra_rank_img_src = $rank_img_src;
-		$rank_title = $rank_img = $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);
+			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>
@@ -278,18 +293,21 @@
 			<edit>
 				<find><![CDATA[			if ((!empty($row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email'))]]></find>
 				<action type="before-add"><![CDATA[
-			if (defined('SHOW_SPECIAL_AS_EXTRA') && SHOW_SPECIAL_AS_EXTRA)
+			if (!empty($row['user_rank']))
 			{
-				$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'] = '';
+				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']);
+					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>