-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSMF2-0x_install.xml
200 lines (197 loc) · 11.3 KB
/
SMF2-0x_install.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?xml version="1.0"?>
<!--
* Battle was developed for SMF forums c/o SA, nend & Chen Zhen
* Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2018 SA | nend | Chen Zhen
* Revamped and supported by Chen Zhen
* This software package is distributed under the terms of its Creative Commons - Attribution No Derivatives License (by-nd) 3.0
* License: https://creativecommons.org/licenses/by-nd/3.0/
* Support thread: https://web-develop.ca/index.php?board=15.0
-->
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
<id>wdm2005:battle</id>
<name>Battle</name>
<version>1.16</version>
<file name="$sourcedir/Profile-View.php">
<operation>
<search position="before"><![CDATA[function summary($memID)
{
global $context,]]></search>
<add><![CDATA[ $settings,]]></add>
</operation>
<operation>
<search position="before"><![CDATA[ loadCustomFields($memID);]]></search>
<add><![CDATA[
if ($modSettings['enable_sts_profile'] && $modSettings['enable_battle'] && allowedTo('view_battle'))
{
$check = 9 * ((!empty($user_info['hp']) ? $user_info['hp'] : 9) + (!empty($user_info['energy']) ? $user_info['energy'] : 9) + (!empty($user_info['stamina']) ? $user_info['stamina'] : 9) + (!empty($user_info['exp']) ? $user_info['exp'] : 9));
$context['custom_fields'][] = array(
'name' => 'Battle Stats',
'placement' => 0,
'output_html' => '
<p>
<span>
<img border="0" src="' . $settings['images_url'] . '/battle/bomb.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsA'] . ': ' . $context['member']['atk'] .'
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/shield.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsD'] . ': ' . $context['member']['def'] . '
<span style="' . ($modSettings['battle_enable_membattle'] == 1 ? 'display:inline;' : 'display:none;') . '">
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/battle_sword.gif" alt="" style="vertical-align:top;" />
<a href="' . $scripturl . '?action=battle;sa=fight;attack=' . $context['member']['id'] . ';session=' . $context['session_id'] . $check . ';#battle_main">' . $txt['battle_statsATK'] . '</a>
</span>
</span>
</p>'
);
}]]></add>
</operation>
</file>
<file name="$themedir/PersonalMessage.template.php">
<operation>
<search position="before"><![CDATA[function template_folder()
{
global $context,]]></search>
<add><![CDATA[ $user_info,]]></add>
</operation>
<operation>
<search position="before"><![CDATA[if (!isset($context['disabled_fields']['posts']))
echo '
<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';]]></search>
<add><![CDATA[
if ($modSettings['enable_sts_pm'])
{
$check = 9 * ((!empty($user_info['hp']) ? $user_info['hp'] : 9) + (!empty($user_info['energy']) ? $user_info['energy'] : 9) + (!empty($user_info['stamina']) ? $user_info['stamina'] : 9) + (!empty($user_info['exp']) ? $user_info['exp'] : 9));
echo'
<li>
<span style="' . (allowedTo('view_battle') && $modSettings['enable_battle'] == 1 ? 'display:inline;' : 'display:none;') . '">
<img border="0" src="' . $settings['images_url'] . '/battle/bomb.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsA'] . ': ' . $message['member']['atk'] .'
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/shield.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsD'] . ': ' . $message['member']['def'] . '
<span style="' . ($modSettings['battle_enable_membattle'] == 1 ? 'display:inline;' : 'display:none;') . '">
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/battle_sword.gif" alt="" style="vertical-align:top;" />
<a href="' . $scripturl . '?action=battle;sa=fight;attack=' . $message['member']['id'] . ';session=' . $context['session_id'] . $check . ';#battle_main">' . $txt['battle_statsATK'] . '</a>
</span>
</span>
</li>';
}]]></add>
</operation>
</file>
<file name="$themedir/Display.template.php">
<operation>
<search position="before"><![CDATA[function template_main()
{
global $context,]]></search>
<add><![CDATA[ $user_info,]]></add>
</operation>
<operation>
<search position="before"><![CDATA[// Show how many posts they have made.
if (!isset($context['disabled_fields']['posts']))
echo '
<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';]]></search>
<add><![CDATA[
if (!empty($modSettings['enable_sts_post']))
{
$check = 9 * ((!empty($user_info['hp']) ? $user_info['hp'] : 9) + (!empty($user_info['energy']) ? $user_info['energy'] : 9) + (!empty($user_info['stamina']) ? $user_info['stamina'] : 9) + (!empty($user_info['exp']) ? $user_info['exp'] : 9));
echo '
<li>
<span style="' . (allowedTo('view_battle') && $modSettings['enable_battle'] == 1 ? 'display:inline;' : 'display:none;') . '">
<img border="0" src="' . $settings['images_url'] . '/battle/bomb.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsA'] . ': ' . $message['member']['atk'] .'
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/shield.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsD'] . ': ' . $message['member']['def'] . '
<span style="' . ($modSettings['battle_enable_membattle'] == 1 ? 'display:inline;' : 'display:none;') . '">
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/battle_sword.gif" alt="" style="vertical-align:top;" />
<a href="' . $scripturl . '?action=battle;sa=fight;attack=' . $message['member']['id'] . ';session=' . $context['session_id'] . $check . ';#battle_main">' . $txt['battle_statsATK'] . '</a>
</span>
</span>
</li>';
}]]></add>
</operation>
</file>
<file name="$sourcedir/Load.php">
<operation>
<search position="before"><![CDATA[mem.birthdate, mem.icq,]]></search>
<add><![CDATA[ mem.battle_only_buddies_shout, mem.stat_point, mem.is_dead, mem.lastupdate, mem.atk, mem.max_atk, mem.def, mem.max_def, mem.gold, mem.exp, mem.max_exp, mem.stamina, mem.max_stamina, mem.energy, mem.max_energy, mem.hp, mem.max_hp, mem.level, mem.mem_slays, mem.mon_slays, mem.bpm, mem.battle_points,' . ($modSettings['bcash'] !== 'gold' ? ' mem.' . $modSettings['bcash'] . ',' : '') . ']]></add>
</operation>
<operation>
<search position="before"><![CDATA[mem.member_ip2, mem.icq,]]></search>
<add><![CDATA[ mem.battle_only_buddies_shout, mem.stat_point, mem.is_dead, mem.lastupdate, mem.atk, mem.max_atk, mem.def, mem.max_def, mem.gold, mem.exp, mem.max_exp, mem.stamina, mem.max_stamina, mem.energy, mem.max_energy, mem.hp, mem.max_hp, mem.level, mem.mem_slays, mem.mon_slays, mem.bpm, mem.battle_points,' . ($modSettings['bcash'] !== 'gold' ? ' mem.' . $modSettings['bcash'] . ',' : '') . ']]></add>
</operation>
<operation>
<search position="after"><![CDATA[ // First do a quick run through to make sure there is something to be shown.]]></search>
<add><![CDATA[ // Battle ~ Load the hook for adding to the member context
$battleContext = array();
call_integration_hook('integrate_member_context', array(&$battleContext, &$profile));
$memberContext[$user] += $battleContext;
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[ // Set up the $user_info array.]]></search>
<add><![CDATA[ // Battle ~ Load the hook for adding to the $user_info array
call_integration_hook('integrate_user_info', array(&$user_info, &$user_settings));
]]></add>
</operation>
</file>
<file name="$boarddir/Themes/core/Display.template.php" error="skip">
<operation>
<search position="before"><![CDATA[function template_main()
{
global $context,]]></search>
<add><![CDATA[ $user_info,]]></add>
</operation>
<operation>
<search position="before"><![CDATA[echo '
<li>', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';]]></search>
<add><![CDATA[
// Show the Battle stats
if ($modSettings['enable_sts_post'])
{
$check = 9 * ((!empty($user_info['hp']) ? $user_info['hp'] : 9) + (!empty($user_info['energy']) ? $user_info['energy'] : 9) + (!empty($user_info['stamina']) ? $user_info['stamina'] : 9) + (!empty($user_info['exp']) ? $user_info['exp'] : 9));
echo'
<li>
<span style="' . (allowedTo('view_battle') && $modSettings['enable_battle'] == 1 ? 'display:inline;' : 'display:none;') . '">
<img border="0" src="' . $settings['images_url'] . '/battle/bomb.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsA'] . ': ' . $message['member']['atk'] .'
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/shield.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsD'] . ': ' . $message['member']['def'] . '
<span style="' . ($modSettings['battle_enable_membattle'] == 1 ? 'display:inline;' : 'display:none;') . '">
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/battle_sword.gif" alt="" style="vertical-align:top;" />
<a href="' . $scripturl . '?action=battle;sa=fight;attack=' . $message['member']['id'] . ';session=' . $context['session_id'] . $check . ';#battle_main">' . $txt['battle_statsATK'] . '</a>
</span>
</span>
</li>';
}]]></add>
</operation>
</file>
<file name="$boarddir/Themes/core/PersonalMessage.template.php" error="skip">
<operation>
<search position="before"><![CDATA[function template_folder()
{
global $context,]]></search>
<add><![CDATA[ $user_info,]]></add>
</operation>
<operation>
<search position="before"><![CDATA[echo '
<li>', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';]]></search>
<add><![CDATA[
// Show the Battle stats
if ($modSettings['enable_sts_post'])
{
$check = 9 * ((!empty($user_info['hp']) ? $user_info['hp'] : 9) + (!empty($user_info['energy']) ? $user_info['energy'] : 9) + (!empty($user_info['stamina']) ? $user_info['stamina'] : 9) + (!empty($user_info['exp']) ? $user_info['exp'] : 9));
echo'
<li>
<span style="' . (allowedTo('view_battle') && $modSettings['enable_battle'] == 1 ? 'display:inline;' : 'display:none;') . '">
<img border="0" src="' . $settings['images_url'] . '/battle/bomb.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsA'] . ': ' . $message['member']['atk'] .'
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/shield.png" alt="" style="vertical-align:top;" /> ' . $txt['battle_statsD'] . ': ' . $message['member']['def'] . '
<span style="' . ($modSettings['battle_enable_membattle'] == 1 ? 'display:inline;' : 'display:none;') . '">
<br />
<img border="0" src="' . $settings['images_url'] . '/battle/battle_sword.gif" alt="" style="vertical-align:top;" />
<a href="' . $scripturl . '?action=battle;sa=fight;attack=' . $message['member']['id'] . ';session=' . $context['session_id'] . $check . ';#battle_main">' . $txt['battle_statsATK'] . '</a>
</span>
</span>
</li>';
}]]></add>
</operation>
</file>
</modification>