0
|
1 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
|
2 <?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
|
|
3 <!--For security purposes, please check: http://www.phpbb.com/mods/ for the
|
|
4 latest version of this MOD. Although MODs are checked before being
|
|
5 allowed in the MODs Database there is no guarantee that there are no
|
|
6 security problems within the MOD. No support will be given for MODs not
|
|
7 found within the MODs Database which can be found at
|
|
8 http://www.phpbb.com/mods/-->
|
|
9 <mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.1.xsd">
|
|
10
|
|
11 <header>
|
|
12 <license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
|
|
13 <title lang="en-gb">User Rank Progression Bar - Special and Normal Rank MOD Integration</title>
|
|
14 <description lang="en-gb">These additional instructions provide integration with the Special and Normal Rank Images MOD so that users with both a special and normal rank can see their progress towards the next rank.</description>
|
|
15 <author-group>
|
|
16 <author>
|
|
17 <realname>IBBoard</realname>
|
|
18 <email>phpbb@ibboard.co.uk</email>
|
|
19 <username>IBBoard</username>
|
|
20 <homepage>http://www.ibboard.co.uk</homepage>
|
|
21 </author>
|
|
22 </author-group>
|
|
23 <link-group>
|
|
24 <link type="parent" href="../Install.xml" lang="en-gb">Main install instructions</link>
|
|
25 </link-group>
|
|
26 <mod-version>0.1</mod-version>
|
|
27 <installation>
|
|
28 <level>intermediate</level>
|
|
29 <time>180</time>
|
|
30 <target-version>3.0.5</target-version>
|
|
31 </installation>
|
|
32 <history>
|
|
33 <entry>
|
|
34 <date>2009-06-03</date>
|
|
35 <rev-version>0.1</rev-version>
|
|
36 <changelog lang="en-gb">
|
|
37 <change>Initial release</change>
|
|
38 </changelog>
|
|
39 </entry>
|
|
40 </history>
|
|
41 </header>
|
|
42 <action-group>
|
|
43 <open src="includes/functions_display.php">
|
|
44 <!-- The documentation for this method currently duplicates the standard method, so as this is my MOD we'll just do the easy method and replace the lot -->
|
|
45 <edit>
|
|
46 <find><![CDATA[/**
|
|
47 * Get user's additional (normal) rank title and image if they have a special rank
|
|
48 *
|
|
49 * @param int $user_rank the current stored users rank id
|
|
50 * @param int $user_posts the users number of posts
|
|
51 * @param string &$rank_title the rank title will be stored here after execution
|
|
52 * @param string &$rank_img the rank image as full img tag is stored here after execution
|
|
53 * @param string &$rank_img_src the rank image source is stored here after execution
|
|
54 *
|
|
55 */
|
|
56 function get_user_additional_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
|
|
57 {
|
|
58 if (!empty($user_rank))
|
|
59 {
|
|
60 //Always pass 0 to save duplicating get_user_rank
|
|
61 get_user_rank(0, $user_posts, $rank_title, $rank_img, $rank_img_src);
|
|
62 }
|
|
63 //else the user doesn't have a special rank and so they don't have a special rank
|
|
64 }]]></find>
|
|
65 <action type="replace-with"><![CDATA[/**
|
|
66 * Get user's additional (normal) rank title and image if they have a special rank
|
|
67 *
|
|
68 * @param int $user_rank the current stored users rank id
|
|
69 * @param int $user_posts the users number of posts
|
|
70 * @param string &$rank_title the rank title will be stored here after execution
|
|
71 * @param string &$rank_img the rank image as full img tag is stored here after execution
|
|
72 * @param string &$rank_img_src the rank image source is stored here after execution
|
|
73 * @param int &$percent_complete the percentage of the way a user is to the next rank will be stored here after execution, where -1 meaning "not applicable"
|
|
74 *
|
|
75 */
|
|
76 function get_user_additional_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src, &$percent_complete)
|
|
77 {
|
|
78 if (!empty($user_rank))
|
|
79 {
|
|
80 //Always pass 0 to save duplicating get_user_rank
|
|
81 get_user_rank(0, $user_posts, $rank_title, $rank_img, $rank_img_src, $percent_complete);
|
|
82 }
|
|
83 //else the user doesn't have a special rank and so they don't have a special rank
|
|
84 }]]></action>
|
|
85 </edit>
|
|
86 </open>
|
|
87 <open src="memberlist.php">
|
|
88 <edit>
|
|
89 <find><![CDATA[ get_user_additional_rank($data['user_rank'], $data['user_posts'], $rank_title, $rank_img, $rank_img_src);]]></find>
|
|
90 <inline-edit>
|
|
91 <inline-find>$rank_img_src</inline-find>
|
|
92 <inline-action type="after-add"><![CDATA[, $percentage_progress]]></inline-action>
|
|
93 </inline-edit>
|
|
94 </edit>
|
|
95 <edit>
|
|
96 <find><![CDATA[get_user_additional_rank($data['user_rank'], $data['user_posts'], $extra_rank_title, $extra_rank_img, $extra_rank_img_src);]]></find>
|
|
97 <inline-edit>
|
|
98 <inline-find>$extra_rank_img_src</inline-find>
|
|
99 <inline-action type="after-add"><![CDATA[, $percentage_progress]]></inline-action>
|
|
100 </inline-edit>
|
|
101 </edit>
|
|
102 </open>
|
|
103 <open src="viewtopic.php">
|
|
104 <edit>
|
|
105 <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>
|
|
106 <inline-edit>
|
|
107 <inline-find>$user_cache[$poster_id]['rank_image_src']</inline-find>
|
|
108 <inline-action type="after-add"><![CDATA[, $user_cache[$poster_id]['percentage_progress']]]></inline-action>
|
|
109 </inline-edit>
|
|
110 </edit>
|
|
111 <edit>
|
|
112 <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>
|
|
113 <inline-edit>
|
|
114 <inline-find>$user_cache[$poster_id]['extra_rank_image_src']</inline-find>
|
|
115 <inline-action type="after-add"><![CDATA[, $user_cache[$poster_id]['percentage_progress']]]></inline-action>
|
|
116 </inline-edit>
|
|
117 </edit>
|
|
118 </open>
|
|
119 </action-group>
|
|
120 </mod>
|