Mercurial > repos > phpBB-MODs > Special_And_Normal_Rank_Images
changeset 2:4d1dd45e6549
Update to v1.1.0:
* Fix problems with ranks not showing with certain configs on memberlist
* Update documentation to be easier to find
* Update instructions for combining MODs
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 15 Jun 2009 12:41:04 +0000 |
parents | 26a2404a2f38 |
children | e4fbc191a598 |
files | Install.xml contrib/Install.xml |
diffstat | 2 files changed, 72 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/Install.xml Sun Jun 07 17:55:54 2009 +0000 +++ b/Install.xml Mon Jun 15 12:41:04 2009 +0000 @@ -27,22 +27,30 @@ <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> + <mod-version>1.1.0</mod-version> <installation> <level>intermediate</level> <time>600</time> - <target-version>3.0.1</target-version> + <target-version>3.0.5</target-version> </installation> <history> <entry> - <date>2008-01-09</date> + <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>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>2008-01-08</date> + <date>2009-01-08</date> <rev-version>1.0.0</rev-version> <changelog lang="en-gb"> <change>No code changes - first release</change> @@ -89,9 +97,10 @@ <action-group> <open src="includes/constants.php"> <edit> - <find><![CDATA[?>]]></find> - <action type="before-add"><![CDATA[// Special and normal rank images + <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> @@ -105,9 +114,9 @@ * * @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 +* @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) @@ -124,6 +133,18 @@ </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 = '';
--- a/contrib/Install.xml Sun Jun 07 17:55:54 2009 +0000 +++ b/contrib/Install.xml Mon Jun 15 12:41:04 2009 +0000 @@ -12,8 +12,8 @@ <license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license> <title lang="en-gb">Special and Normal Rank Images - Multi-Race Rank Theme changes</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 changes are dependant on both the "Special and Normal Rank Images" and "Multi-Race Rank Themes" MODs. The following instructions should be performed after installing both MODs. The changes make the Special and Normal Rank Images MOD more compatible with the Multi-Race Rank Theme MOD so that even members with special ranks can select a rank theme. - + <author-notes lang="en-gb"><![CDATA[These changes are dependant on both the "Special and Normal Rank Images" MOD and v1.2.x of the "Multi-Race Rank Themes" MOD. The following instructions should be performed after installing both MODs. The changes make the Special and Normal Rank Images MOD more compatible with the Multi-Race Rank Theme MOD so that even members with special ranks can select a rank theme. + Note: These extra instructions do not allow users with special ranks to change the theme of their special rank, just the theme of their normal rank. A MOD may follow that allows this functionality, but the Multi-Race Rank Theme MOD and the Special and Normal Rank Images MOD are designed to extend the method used by phpBB, not replace and majorly change it.]]></author-notes> <author-group> <author> @@ -26,14 +26,22 @@ <link-group> <link type="parent" href="Install.xml" lang="en-gb">Main instructions</link> </link-group> - <mod-version>0.1.3b</mod-version> + <mod-version>1.1.0</mod-version> <installation> <level>intermediate</level> <time>300</time> - <target-version>3.0.1</target-version> + <target-version>3.0.5</target-version> </installation> <history> <entry> + <date>2009-06-15</date> + <rev-version>1.1.0</rev-version> + <changelog lang="en-gb"> + <change>Update: Change instructions to match the alterations in v1.1.0 of the main MOD</change> + <change>Update: Try to make sure all instructions add the parameter at the end, even if other MODs are applied before or after</change> + </changelog> + </entry> + <entry> <date>2008-11-09</date> <rev-version>0.1.3b</rev-version> <changelog lang="en-gb"> @@ -57,23 +65,24 @@ </history> </header> <action-group> - <open src="includes/functions_display.php"> + <open src="includes/functions_display.php"> + <edit> + <find><![CDATA[* @param string &$rank_img_src the additional rank image source is stored here after execution, if the user has an additional rank]]></find> + <action type="after-add"><![CDATA[ +* @param int $rank_theme the rank theme set to load the extra rank from (defaulting to DEFAULT_RANK_THEME_ID)]]></action> + </edit> <edit> - <find><![CDATA[* -*/ -function get_user_additional_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)]]></find> - <action type="replace-with"><![CDATA[ -* @param int $rank_theme the rank theme set to load from (defaulting to DEFAULT_RANK_THEME_ID) -* -*/ -function get_user_additional_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src, $rank_theme = DEFAULT_RANK_THEME_ID)]]> - </action> + <find><![CDATA[function get_user_additional_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[ get_user_rank(0, $user_posts, $rank_title, $rank_img, $rank_img_src);]]></find> <inline-edit> - <inline-find>, $rank_img_src</inline-find> - <inline-action type="after-add">, $rank_theme</inline-action> + <inline-find>);</inline-find> + <inline-action type="before-add">, $rank_theme</inline-action> </inline-edit> </edit> </open> @@ -86,20 +95,28 @@ <inline-action type="replace-with">true</inline-action> </inline-edit> </edit> - </open> + </open> <open src="memberlist.php"> <edit> + <find><![CDATA[ //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']);]]></find> + <inline-edit> + <inline-find>);</inline-find> + <inline-action type="before-add">, $row['user_rank_theme']</inline-action> + </inline-edit> + </edit> + <edit> <find><![CDATA[ get_user_additional_rank($data['user_rank'], $data['user_posts'], $rank_title, $rank_img, $rank_img_src);]]></find> <inline-edit> - <inline-find>, $rank_img_src</inline-find> - <inline-action type="after-add">, $data['user_rank_theme']</inline-action> + <inline-find>);</inline-find> + <inline-action type="before-add">, $data['user_rank_theme']</inline-action> </inline-edit> </edit> <edit> <find><![CDATA[ get_user_additional_rank($data['user_rank'], $data['user_posts'], $extra_rank_title, $extra_rank_img, $extra_rank_img_src);]]></find> <inline-edit> - <inline-find>, $extra_rank_img_src</inline-find> - <inline-action type="after-add">, $data['user_rank_theme']</inline-action> + <inline-find>);</inline-find> + <inline-action type="before-add">, $data['user_rank_theme']</inline-action> </inline-edit> </edit> </open> @@ -107,15 +124,15 @@ <edit> <find><![CDATA[ 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']);]]></find> <inline-edit> - <inline-find>, $user_cache[$poster_id]['rank_image_src']</inline-find> - <inline-action type="after-add">, $row['user_rank_theme']</inline-action> + <inline-find>);</inline-find> + <inline-action type="before-add">, $row['user_rank_theme']</inline-action> </inline-edit> </edit> <edit> <find><![CDATA[ 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> <inline-edit> - <inline-find>, $user_cache[$poster_id]['extra_rank_image_src']</inline-find> - <inline-action type="after-add">, $row['user_rank_theme']</inline-action> + <inline-find>);</inline-find> + <inline-action type="before-add">, $row['user_rank_theme']</inline-action> </inline-edit> </edit> </open>