Chris@76
|
1 <?php
|
Chris@76
|
2 /**
|
Chris@76
|
3 * Simple Machines Forum (SMF)
|
Chris@76
|
4 *
|
Chris@76
|
5 * @package SMF
|
Chris@76
|
6 * @author Simple Machines
|
Chris@76
|
7 * @copyright 2011 Simple Machines
|
Chris@76
|
8 * @license http://www.simplemachines.org/about/smf/license.php BSD
|
Chris@76
|
9 *
|
Chris@76
|
10 * @version 2.0
|
Chris@76
|
11 */
|
Chris@76
|
12
|
Chris@76
|
13 // Template for the profile side bar - goes before any other profile template.
|
Chris@76
|
14 function template_profile_above()
|
Chris@76
|
15 {
|
Chris@76
|
16 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
17
|
Chris@76
|
18 echo '
|
Chris@76
|
19 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/profile.js"></script>';
|
Chris@76
|
20
|
Chris@76
|
21 // Prevent Chrome from auto completing fields when viewing/editing other members profiles
|
Chris@76
|
22 if ($context['browser']['is_chrome'] && !$context['user']['is_owner'])
|
Chris@76
|
23 echo '
|
Chris@76
|
24 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
25 disableAutoComplete();
|
Chris@76
|
26 // ]]></script>';
|
Chris@76
|
27
|
Chris@76
|
28 // If an error occurred while trying to save previously, give the user a clue!
|
Chris@76
|
29 if (!empty($context['post_errors']))
|
Chris@76
|
30 echo '
|
Chris@76
|
31 ', template_error_message();
|
Chris@76
|
32
|
Chris@76
|
33 // If the profile was update successfully, let the user know this.
|
Chris@76
|
34 if (!empty($context['profile_updated']))
|
Chris@76
|
35 echo '
|
Chris@76
|
36 <div class="windowbg" id="profile_success">
|
Chris@76
|
37 ', $context['profile_updated'], '
|
Chris@76
|
38 </div>';
|
Chris@76
|
39 }
|
Chris@76
|
40
|
Chris@76
|
41 // Template for closing off table started in profile_above.
|
Chris@76
|
42 function template_profile_below()
|
Chris@76
|
43 {
|
Chris@76
|
44 }
|
Chris@76
|
45
|
Chris@76
|
46 // This template displays users details without any option to edit them.
|
Chris@76
|
47 function template_summary()
|
Chris@76
|
48 {
|
Chris@76
|
49 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
50
|
Chris@76
|
51 // Display the basic information about the user
|
Chris@76
|
52 echo '
|
Chris@76
|
53 <div id="profileview" class="flow_auto">
|
Chris@76
|
54 <div class="cat_bar">
|
Chris@76
|
55 <h3 class="catbg">
|
Chris@76
|
56 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['summary'], '</span>
|
Chris@76
|
57 </h3>
|
Chris@76
|
58 </div>
|
Chris@76
|
59 <div id="basicinfo">
|
Chris@76
|
60 <div class="windowbg">
|
Chris@76
|
61 <span class="topslice"><span></span></span>
|
Chris@76
|
62 <div class="content flow_auto">
|
Chris@76
|
63 <div class="username"><h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4></div>
|
Chris@76
|
64 ', $context['member']['avatar']['image'], '
|
Chris@76
|
65 <ul class="reset">';
|
Chris@76
|
66
|
Chris@76
|
67 // What about if we allow email only via the forum??
|
Chris@76
|
68 if ($context['member']['show_email'] === 'yes' || $context['member']['show_email'] === 'no_through_forum' || $context['member']['show_email'] === 'yes_permission_override')
|
Chris@76
|
69 echo '
|
Chris@76
|
70 <li><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '" title="', $context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'yes_permission_override' ? $context['member']['email'] : '', '" rel="nofollow"><img src="', $settings['images_url'], '/email_sm.gif" alt="', $txt['email'], '" /></a></li>';
|
Chris@76
|
71
|
Chris@76
|
72 // Don't show an icon if they haven't specified a website.
|
Chris@76
|
73 if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
|
Chris@76
|
74 echo '
|
Chris@76
|
75 <li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $context['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
|
Chris@76
|
76
|
Chris@76
|
77 // Are there any custom profile fields for the summary?
|
Chris@76
|
78 if (!empty($context['custom_fields']))
|
Chris@76
|
79 {
|
Chris@76
|
80 foreach ($context['custom_fields'] as $field)
|
Chris@76
|
81 if (($field['placement'] == 1 || empty($field['output_html'])) && !empty($field['value']))
|
Chris@76
|
82 echo '
|
Chris@76
|
83 <li class="custom_field">', $field['output_html'], '</li>';
|
Chris@76
|
84 }
|
Chris@76
|
85
|
Chris@76
|
86 echo '
|
Chris@76
|
87 ', !isset($context['disabled_fields']['icq']) && !empty($context['member']['icq']['link']) ? '<li>' . $context['member']['icq']['link'] . '</li>' : '', '
|
Chris@76
|
88 ', !isset($context['disabled_fields']['msn']) && !empty($context['member']['msn']['link']) ? '<li>' . $context['member']['msn']['link'] . '</li>' : '', '
|
Chris@76
|
89 ', !isset($context['disabled_fields']['aim']) && !empty($context['member']['aim']['link']) ? '<li>' . $context['member']['aim']['link'] . '</li>' : '', '
|
Chris@76
|
90 ', !isset($context['disabled_fields']['yim']) && !empty($context['member']['yim']['link']) ? '<li>' . $context['member']['yim']['link'] . '</li>' : '', '
|
Chris@76
|
91 </ul>
|
Chris@76
|
92 <span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '';
|
Chris@76
|
93
|
Chris@76
|
94 // Can they add this member as a buddy?
|
Chris@76
|
95 if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
|
Chris@76
|
96 echo '
|
Chris@76
|
97 <br /><a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';
|
Chris@76
|
98
|
Chris@76
|
99 echo '
|
Chris@76
|
100 </span>';
|
Chris@76
|
101
|
Chris@76
|
102 echo '
|
Chris@76
|
103 <p id="infolinks">';
|
Chris@76
|
104
|
Chris@76
|
105 if (!$context['user']['is_owner'] && $context['can_send_pm'])
|
Chris@76
|
106 echo '
|
Chris@76
|
107 <a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '">', $txt['profile_sendpm_short'], '</a><br />';
|
Chris@76
|
108 echo '
|
Chris@76
|
109 <a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
|
Chris@76
|
110 <a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
|
Chris@76
|
111 </p>';
|
Chris@76
|
112
|
Chris@76
|
113 echo '
|
Chris@76
|
114 </div>
|
Chris@76
|
115 <span class="botslice"><span></span></span>
|
Chris@76
|
116 </div>
|
Chris@76
|
117 </div>
|
Chris@76
|
118 <div id="detailedinfo">
|
Chris@76
|
119 <div class="windowbg2">
|
Chris@76
|
120 <span class="topslice"><span></span></span>
|
Chris@76
|
121 <div class="content">
|
Chris@76
|
122 <dl>';
|
Chris@76
|
123
|
Chris@76
|
124 if ($context['user']['is_owner'] || $context['user']['is_admin'])
|
Chris@76
|
125 echo '
|
Chris@76
|
126 <dt>', $txt['username'], ': </dt>
|
Chris@76
|
127 <dd>', $context['member']['username'], '</dd>';
|
Chris@76
|
128
|
Chris@76
|
129 if (!isset($context['disabled_fields']['posts']))
|
Chris@76
|
130 echo '
|
Chris@76
|
131 <dt>', $txt['profile_posts'], ': </dt>
|
Chris@76
|
132 <dd>', $context['member']['posts'], ' (', $context['member']['posts_per_day'], ' ', $txt['posts_per_day'], ')</dd>';
|
Chris@76
|
133
|
Chris@76
|
134 // Only show the email address fully if it's not hidden - and we reveal the email.
|
Chris@76
|
135 if ($context['member']['show_email'] == 'yes')
|
Chris@76
|
136 echo '
|
Chris@76
|
137 <dt>', $txt['email'], ': </dt>
|
Chris@76
|
138 <dd><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></dd>';
|
Chris@76
|
139
|
Chris@76
|
140 // ... Or if the one looking at the profile is an admin they can see it anyway.
|
Chris@76
|
141 elseif ($context['member']['show_email'] == 'yes_permission_override')
|
Chris@76
|
142 echo '
|
Chris@76
|
143 <dt>', $txt['email'], ': </dt>
|
Chris@76
|
144 <dd><em><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '">', $context['member']['email'], '</a></em></dd>';
|
Chris@76
|
145
|
Chris@76
|
146 if (!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))
|
Chris@76
|
147 echo '
|
Chris@76
|
148 <dt>', $txt['custom_title'], ': </dt>
|
Chris@76
|
149 <dd>', $context['member']['title'], '</dd>';
|
Chris@76
|
150
|
Chris@76
|
151 if (!empty($context['member']['blurb']))
|
Chris@76
|
152 echo '
|
Chris@76
|
153 <dt>', $txt['personal_text'], ': </dt>
|
Chris@76
|
154 <dd>', $context['member']['blurb'], '</dd>';
|
Chris@76
|
155
|
Chris@76
|
156 // If karma enabled show the members karma.
|
Chris@76
|
157 if ($modSettings['karmaMode'] == '1')
|
Chris@76
|
158 echo '
|
Chris@76
|
159 <dt>', $modSettings['karmaLabel'], ' </dt>
|
Chris@76
|
160 <dd>', ($context['member']['karma']['good'] - $context['member']['karma']['bad']), '</dd>';
|
Chris@76
|
161
|
Chris@76
|
162 elseif ($modSettings['karmaMode'] == '2')
|
Chris@76
|
163 echo '
|
Chris@76
|
164 <dt>', $modSettings['karmaLabel'], ' </dt>
|
Chris@76
|
165 <dd>+', $context['member']['karma']['good'], '/-', $context['member']['karma']['bad'], '</dd>';
|
Chris@76
|
166
|
Chris@76
|
167 if (!isset($context['disabled_fields']['gender']) && !empty($context['member']['gender']['name']))
|
Chris@76
|
168 echo '
|
Chris@76
|
169 <dt>', $txt['gender'], ': </dt>
|
Chris@76
|
170 <dd>', $context['member']['gender']['name'], '</dd>';
|
Chris@76
|
171
|
Chris@76
|
172 echo '
|
Chris@76
|
173 <dt>', $txt['age'], ':</dt>
|
Chris@76
|
174 <dd>', $context['member']['age'] . ($context['member']['today_is_birthday'] ? ' <img src="' . $settings['images_url'] . '/cake.png" alt="" />' : ''), '</dd>';
|
Chris@76
|
175
|
Chris@76
|
176 if (!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))
|
Chris@76
|
177 echo '
|
Chris@76
|
178 <dt>', $txt['location'], ':</dt>
|
Chris@76
|
179 <dd>', $context['member']['location'], '</dd>';
|
Chris@76
|
180
|
Chris@76
|
181 echo '
|
Chris@76
|
182 </dl>';
|
Chris@76
|
183
|
Chris@76
|
184 // Any custom fields for standard placement?
|
Chris@76
|
185 if (!empty($context['custom_fields']))
|
Chris@76
|
186 {
|
Chris@76
|
187 $shown = false;
|
Chris@76
|
188 foreach ($context['custom_fields'] as $field)
|
Chris@76
|
189 {
|
Chris@76
|
190 if ($field['placement'] != 0 || empty($field['output_html']))
|
Chris@76
|
191 continue;
|
Chris@76
|
192
|
Chris@76
|
193 if (empty($shown))
|
Chris@76
|
194 {
|
Chris@76
|
195 echo '
|
Chris@76
|
196 <dl>';
|
Chris@76
|
197 $shown = true;
|
Chris@76
|
198 }
|
Chris@76
|
199
|
Chris@76
|
200 echo '
|
Chris@76
|
201 <dt>', $field['name'], ':</dt>
|
Chris@76
|
202 <dd>', $field['output_html'], '</dd>';
|
Chris@76
|
203 }
|
Chris@76
|
204
|
Chris@76
|
205 if (!empty($shown))
|
Chris@76
|
206 echo '
|
Chris@76
|
207 </dl>';
|
Chris@76
|
208 }
|
Chris@76
|
209
|
Chris@76
|
210 echo '
|
Chris@76
|
211 <dl class="noborder">';
|
Chris@76
|
212
|
Chris@76
|
213 // Can they view/issue a warning?
|
Chris@76
|
214 if ($context['can_view_warning'] && $context['member']['warning'])
|
Chris@76
|
215 {
|
Chris@76
|
216 echo '
|
Chris@76
|
217 <dt>', $txt['profile_warning_level'], ': </dt>
|
Chris@76
|
218 <dd>
|
Chris@76
|
219 <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=', $context['can_issue_warning'] ? 'issuewarning' : 'viewwarning', '">', $context['member']['warning'], '%</a>';
|
Chris@76
|
220
|
Chris@76
|
221 // Can we provide information on what this means?
|
Chris@76
|
222 if (!empty($context['warning_status']))
|
Chris@76
|
223 echo '
|
Chris@76
|
224 <span class="smalltext">(', $context['warning_status'], ')</span>';
|
Chris@76
|
225
|
Chris@76
|
226 echo '
|
Chris@76
|
227 </dd>';
|
Chris@76
|
228 }
|
Chris@76
|
229
|
Chris@76
|
230 // Is this member requiring activation and/or banned?
|
Chris@76
|
231 if (!empty($context['activate_message']) || !empty($context['member']['bans']))
|
Chris@76
|
232 {
|
Chris@76
|
233
|
Chris@76
|
234 // If the person looking at the summary has permission, and the account isn't activated, give the viewer the ability to do it themselves.
|
Chris@76
|
235 if (!empty($context['activate_message']))
|
Chris@76
|
236 echo '
|
Chris@76
|
237 <dt class="clear"><span class="alert">', $context['activate_message'], '</span> (<a href="' . $scripturl . '?action=profile;save;area=activateaccount;u=' . $context['id_member'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '"', ($context['activate_type'] == 4 ? ' onclick="return confirm(\'' . $txt['profileConfirm'] . '\');"' : ''), '>', $context['activate_link_text'], '</a>)</dt>';
|
Chris@76
|
238
|
Chris@76
|
239 // If the current member is banned, show a message and possibly a link to the ban.
|
Chris@76
|
240 if (!empty($context['member']['bans']))
|
Chris@76
|
241 {
|
Chris@76
|
242 echo '
|
Chris@76
|
243 <dt class="clear"><span class="alert">', $txt['user_is_banned'], '</span> [<a href="#" onclick="document.getElementById(\'ban_info\').style.display = document.getElementById(\'ban_info\').style.display == \'none\' ? \'\' : \'none\';return false;">' . $txt['view_ban'] . '</a>]</dt>
|
Chris@76
|
244 <dt class="clear" id="ban_info" style="display: none;">
|
Chris@76
|
245 <strong>', $txt['user_banned_by_following'], ':</strong>';
|
Chris@76
|
246
|
Chris@76
|
247 foreach ($context['member']['bans'] as $ban)
|
Chris@76
|
248 echo '
|
Chris@76
|
249 <br /><span class="smalltext">', $ban['explanation'], '</span>';
|
Chris@76
|
250
|
Chris@76
|
251 echo '
|
Chris@76
|
252 </dt>';
|
Chris@76
|
253 }
|
Chris@76
|
254 }
|
Chris@76
|
255
|
Chris@76
|
256 echo '
|
Chris@76
|
257 <dt>', $txt['date_registered'], ': </dt>
|
Chris@76
|
258 <dd>', $context['member']['registered'], '</dd>';
|
Chris@76
|
259
|
Chris@76
|
260 // If the person looking is allowed, they can check the members IP address and hostname.
|
Chris@76
|
261 if ($context['can_see_ip'])
|
Chris@76
|
262 {
|
Chris@76
|
263 if (!empty($context['member']['ip']))
|
Chris@76
|
264 echo '
|
Chris@76
|
265 <dt>', $txt['ip'], ': </dt>
|
Chris@76
|
266 <dd><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['member']['ip'], ';u=', $context['member']['id'], '">', $context['member']['ip'], '</a></dd>';
|
Chris@76
|
267
|
Chris@76
|
268 if (empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']))
|
Chris@76
|
269 echo '
|
Chris@76
|
270 <dt>', $txt['hostname'], ': </dt>
|
Chris@76
|
271 <dd>', $context['member']['hostname'], '</dd>';
|
Chris@76
|
272 }
|
Chris@76
|
273
|
Chris@76
|
274 echo '
|
Chris@76
|
275 <dt>', $txt['local_time'], ':</dt>
|
Chris@76
|
276 <dd>', $context['member']['local_time'], '</dd>';
|
Chris@76
|
277
|
Chris@76
|
278 if (!empty($modSettings['userLanguage']) && !empty($context['member']['language']))
|
Chris@76
|
279 echo '
|
Chris@76
|
280 <dt>', $txt['language'], ':</dt>
|
Chris@76
|
281 <dd>', $context['member']['language'], '</dd>';
|
Chris@76
|
282
|
Chris@76
|
283 echo '
|
Chris@76
|
284 <dt>', $txt['lastLoggedIn'], ': </dt>
|
Chris@76
|
285 <dd>', $context['member']['last_login'], '</dd>
|
Chris@76
|
286 </dl>';
|
Chris@76
|
287
|
Chris@76
|
288 // Are there any custom profile fields for the summary?
|
Chris@76
|
289 if (!empty($context['custom_fields']))
|
Chris@76
|
290 {
|
Chris@76
|
291 $shown = false;
|
Chris@76
|
292 foreach ($context['custom_fields'] as $field)
|
Chris@76
|
293 {
|
Chris@76
|
294 if ($field['placement'] != 2 || empty($field['output_html']))
|
Chris@76
|
295 continue;
|
Chris@76
|
296 if (empty($shown))
|
Chris@76
|
297 {
|
Chris@76
|
298 $shown = true;
|
Chris@76
|
299 echo '
|
Chris@76
|
300 <div class="custom_fields_above_signature">
|
Chris@76
|
301 <ul class="reset nolist">';
|
Chris@76
|
302 }
|
Chris@76
|
303 echo '
|
Chris@76
|
304 <li>', $field['output_html'], '</li>';
|
Chris@76
|
305 }
|
Chris@76
|
306 if ($shown)
|
Chris@76
|
307 echo '
|
Chris@76
|
308 </ul>
|
Chris@76
|
309 </div>';
|
Chris@76
|
310 }
|
Chris@76
|
311
|
Chris@76
|
312 // Show the users signature.
|
Chris@76
|
313 if ($context['signature_enabled'] && !empty($context['member']['signature']))
|
Chris@76
|
314 echo '
|
Chris@76
|
315 <div class="signature">
|
Chris@76
|
316 <h5>', $txt['signature'], ':</h5>
|
Chris@76
|
317 ', $context['member']['signature'], '
|
Chris@76
|
318 </div>';
|
Chris@76
|
319
|
Chris@76
|
320 echo '
|
Chris@76
|
321 </div>
|
Chris@76
|
322 <span class="botslice"><span></span></span>
|
Chris@76
|
323 </div>
|
Chris@76
|
324 </div>
|
Chris@76
|
325 <div class="clear"></div>
|
Chris@76
|
326 </div>';
|
Chris@76
|
327 }
|
Chris@76
|
328
|
Chris@76
|
329 // Template for showing all the posts of the user, in chronological order.
|
Chris@76
|
330 function template_showPosts()
|
Chris@76
|
331 {
|
Chris@76
|
332 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
333
|
Chris@76
|
334 echo '
|
Chris@76
|
335 <div class="cat_bar">
|
Chris@76
|
336 <h3 class="catbg">
|
Chris@76
|
337 ', (!isset($context['attachments']) && empty($context['is_topics']) ? $txt['showMessages'] : (!empty($context['is_topics']) ? $txt['showTopics'] : $txt['showAttachments'])), ' - ', $context['member']['name'], '
|
Chris@76
|
338 </h3>
|
Chris@76
|
339 </div>
|
Chris@76
|
340 <div class="pagesection">
|
Chris@76
|
341 <span>', $txt['pages'], ': ', $context['page_index'], '</span>
|
Chris@76
|
342 </div>';
|
Chris@76
|
343
|
Chris@76
|
344 // Button shortcuts
|
Chris@76
|
345 $quote_button = create_button('quote.gif', 'reply_quote', 'quote', 'align="middle"');
|
Chris@76
|
346 $reply_button = create_button('reply_sm.gif', 'reply', 'reply', 'align="middle"');
|
Chris@76
|
347 $remove_button = create_button('delete.gif', 'remove_message', 'remove', 'align="middle"');
|
Chris@76
|
348 $notify_button = create_button('notify_sm.gif', 'notify_replies', 'notify', 'align="middle"');
|
Chris@76
|
349
|
Chris@76
|
350 // Are we displaying posts or attachments?
|
Chris@76
|
351 if (!isset($context['attachments']))
|
Chris@76
|
352 {
|
Chris@76
|
353 // For every post to be displayed, give it its own div, and show the important details of the post.
|
Chris@76
|
354 foreach ($context['posts'] as $post)
|
Chris@76
|
355 {
|
Chris@76
|
356 echo '
|
Chris@76
|
357 <div class="topic">
|
Chris@76
|
358 <div class="', $post['alternate'] == 0 ? 'windowbg2' : 'windowbg', ' core_posts">
|
Chris@76
|
359 <span class="topslice"><span></span></span>
|
Chris@76
|
360 <div class="content">
|
Chris@76
|
361 <div class="counter">', $post['counter'], '</div>
|
Chris@76
|
362 <div class="topic_details">
|
Chris@76
|
363 <h5><strong><a href="', $scripturl, '?board=', $post['board']['id'], '.0">', $post['board']['name'], '</a> / <a href="', $scripturl, '?topic=', $post['topic'], '.', $post['start'], '#msg', $post['id'], '">', $post['subject'], '</a></strong></h5>
|
Chris@76
|
364 <span class="smalltext">« <strong>', $txt['on'], ':</strong> ', $post['time'], ' »</span>
|
Chris@76
|
365 </div>
|
Chris@76
|
366 <div class="list_posts">';
|
Chris@76
|
367
|
Chris@76
|
368 if (!$post['approved'])
|
Chris@76
|
369 echo '
|
Chris@76
|
370 <div class="approve_post">
|
Chris@76
|
371 <em>', $txt['post_awaiting_approval'], '</em>
|
Chris@76
|
372 </div>';
|
Chris@76
|
373
|
Chris@76
|
374 echo '
|
Chris@76
|
375 ', $post['body'], '
|
Chris@76
|
376 </div>
|
Chris@76
|
377 </div>';
|
Chris@76
|
378
|
Chris@76
|
379 if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
|
Chris@76
|
380 echo '
|
Chris@76
|
381 <div class="floatright">
|
Chris@76
|
382 <ul class="reset smalltext quickbuttons">';
|
Chris@76
|
383
|
Chris@76
|
384 // If they *can* reply?
|
Chris@76
|
385 if ($post['can_reply'])
|
Chris@76
|
386 echo '
|
Chris@76
|
387 <li class="reply_button"><a href="', $scripturl, '?action=post;topic=', $post['topic'], '.', $post['start'], '"><span>', $txt['reply'], '</span></a></li>';
|
Chris@76
|
388
|
Chris@76
|
389 // If they *can* quote?
|
Chris@76
|
390 if ($post['can_quote'])
|
Chris@76
|
391 echo '
|
Chris@76
|
392 <li class="quote_button"><a href="', $scripturl . '?action=post;topic=', $post['topic'], '.', $post['start'], ';quote=', $post['id'], '"><span>', $txt['quote'], '</span></a></li>';
|
Chris@76
|
393
|
Chris@76
|
394 // Can we request notification of topics?
|
Chris@76
|
395 if ($post['can_mark_notify'])
|
Chris@76
|
396 echo '
|
Chris@76
|
397 <li class="notify_button"><a href="', $scripturl, '?action=notify;topic=', $post['topic'], '.', $post['start'], '"><span>', $txt['notify'], '</span></a></li>';
|
Chris@76
|
398
|
Chris@76
|
399 // How about... even... remove it entirely?!
|
Chris@76
|
400 if ($post['can_delete'])
|
Chris@76
|
401 echo '
|
Chris@76
|
402 <li class="remove_button"><a href="', $scripturl, '?action=deletemsg;msg=', $post['id'], ';topic=', $post['topic'], ';profile;u=', $context['member']['id'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');"><span>', $txt['remove'], '</span></a></li>';
|
Chris@76
|
403
|
Chris@76
|
404 if ($post['can_reply'] || $post['can_mark_notify'] || $post['can_delete'])
|
Chris@76
|
405 echo '
|
Chris@76
|
406 </ul>
|
Chris@76
|
407 </div>';
|
Chris@76
|
408
|
Chris@76
|
409 echo '
|
Chris@76
|
410 <br class="clear" />
|
Chris@76
|
411 <span class="botslice"><span></span></span>
|
Chris@76
|
412 </div>
|
Chris@76
|
413 </div>';
|
Chris@76
|
414 }
|
Chris@76
|
415 }
|
Chris@76
|
416 else
|
Chris@76
|
417 {
|
Chris@76
|
418 echo '
|
Chris@76
|
419 <table border="0" width="100%" cellspacing="1" cellpadding="2" class="table_grid" align="center">
|
Chris@76
|
420 <thead>
|
Chris@76
|
421 <tr class="titlebg">
|
Chris@76
|
422 <th class="first_th lefttext" scope="col" width="25%">
|
Chris@76
|
423 <a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=filename', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'filename' ? ';asc' : ''), '">
|
Chris@76
|
424 ', $txt['show_attach_filename'], '
|
Chris@76
|
425 ', ($context['sort_order'] == 'filename' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
|
Chris@76
|
426 </a>
|
Chris@76
|
427 </th>
|
Chris@76
|
428 <th scope="col" width="12%">
|
Chris@76
|
429 <a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=downloads', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'downloads' ? ';asc' : ''), '">
|
Chris@76
|
430 ', $txt['show_attach_downloads'], '
|
Chris@76
|
431 ', ($context['sort_order'] == 'downloads' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
|
Chris@76
|
432 </a>
|
Chris@76
|
433 </th>
|
Chris@76
|
434 <th class="lefttext" scope="col" width="30%">
|
Chris@76
|
435 <a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=subject', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'subject' ? ';asc' : ''), '">
|
Chris@76
|
436 ', $txt['message'], '
|
Chris@76
|
437 ', ($context['sort_order'] == 'subject' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
|
Chris@76
|
438 </a>
|
Chris@76
|
439 </th>
|
Chris@76
|
440 <th class="last_th lefttext" scope="col">
|
Chris@76
|
441 <a href="', $scripturl, '?action=profile;u=', $context['current_member'], ';area=showposts;sa=attach;sort=posted', ($context['sort_direction'] == 'down' && $context['sort_order'] == 'posted' ? ';asc' : ''), '">
|
Chris@76
|
442 ', $txt['show_attach_posted'], '
|
Chris@76
|
443 ', ($context['sort_order'] == 'posted' ? '<img src="' . $settings['images_url'] . '/sort_' . ($context['sort_direction'] == 'down' ? 'down' : 'up') . '.gif" alt="" />' : ''), '
|
Chris@76
|
444 </a>
|
Chris@76
|
445 </th>
|
Chris@76
|
446 </tr>
|
Chris@76
|
447 </thead>
|
Chris@76
|
448 <tbody>';
|
Chris@76
|
449
|
Chris@76
|
450 // Looks like we need to do all the attachments instead!
|
Chris@76
|
451 $alternate = false;
|
Chris@76
|
452 foreach ($context['attachments'] as $attachment)
|
Chris@76
|
453 {
|
Chris@76
|
454 echo '
|
Chris@76
|
455 <tr class="', $attachment['approved'] ? ($alternate ? 'windowbg' : 'windowbg2') : 'approvebg', '">
|
Chris@76
|
456 <td><a href="', $scripturl, '?action=dlattach;topic=', $attachment['topic'], '.0;attach=', $attachment['id'], '">', $attachment['filename'], '</a>', !$attachment['approved'] ? ' <em>(' . $txt['awaiting_approval'] . ')</em>' : '', '</td>
|
Chris@76
|
457 <td align="center">', $attachment['downloads'], '</td>
|
Chris@76
|
458 <td><a href="', $scripturl, '?topic=', $attachment['topic'], '.msg', $attachment['msg'], '#msg', $attachment['msg'], '" rel="nofollow">', $attachment['subject'], '</a></td>
|
Chris@76
|
459 <td>', $attachment['posted'], '</td>
|
Chris@76
|
460 </tr>';
|
Chris@76
|
461 $alternate = !$alternate;
|
Chris@76
|
462 }
|
Chris@76
|
463
|
Chris@76
|
464 // No posts? Just end the table with a informative message.
|
Chris@76
|
465 if ((isset($context['attachments']) && empty($context['attachments'])) || (!isset($context['attachments']) && empty($context['posts'])))
|
Chris@76
|
466 echo '
|
Chris@76
|
467 <tr>
|
Chris@76
|
468 <td class="tborder windowbg2 padding centertext" colspan="4">
|
Chris@76
|
469 ', isset($context['attachments']) ? $txt['show_attachments_none'] : ($context['is_topics'] ? $txt['show_topics_none'] : $txt['show_posts_none']), '
|
Chris@76
|
470 </td>
|
Chris@76
|
471 </tr>';
|
Chris@76
|
472
|
Chris@76
|
473 echo '
|
Chris@76
|
474 </tbody>
|
Chris@76
|
475 </table>';
|
Chris@76
|
476 }
|
Chris@76
|
477 // Show more page numbers.
|
Chris@76
|
478 echo '
|
Chris@76
|
479 <div class="pagesection" style="margin-bottom: 0;">
|
Chris@76
|
480 <span>', $txt['pages'], ': ', $context['page_index'], '</span>
|
Chris@76
|
481 </div>';
|
Chris@76
|
482 }
|
Chris@76
|
483
|
Chris@76
|
484 // Template for showing all the buddies of the current user.
|
Chris@76
|
485 function template_editBuddies()
|
Chris@76
|
486 {
|
Chris@76
|
487 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
488
|
Chris@76
|
489 echo '
|
Chris@76
|
490 <div class="title_bar">
|
Chris@76
|
491 <h3 class="titlebg">
|
Chris@76
|
492 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/online.gif" alt="" class="icon" />', $txt['editBuddies'], '</span>
|
Chris@76
|
493 </h3>
|
Chris@76
|
494 </div>
|
Chris@76
|
495 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="table_grid" align="center">
|
Chris@76
|
496 <tr class="catbg">
|
Chris@76
|
497 <th class="first_th lefttext" scope="col" width="20%">', $txt['name'], '</th>
|
Chris@76
|
498 <th scope="col">', $txt['status'], '</th>
|
Chris@76
|
499 <th scope="col">', $txt['email'], '</th>
|
Chris@76
|
500 <th scope="col">', $txt['icq'], '</th>
|
Chris@76
|
501 <th scope="col">', $txt['aim'], '</th>
|
Chris@76
|
502 <th scope="col">', $txt['yim'], '</th>
|
Chris@76
|
503 <th scope="col">', $txt['msn'], '</th>
|
Chris@76
|
504 <th class="last_th" scope="col"></th>
|
Chris@76
|
505 </tr>';
|
Chris@76
|
506
|
Chris@76
|
507 // If they don't have any buddies don't list them!
|
Chris@76
|
508 if (empty($context['buddies']))
|
Chris@76
|
509 echo '
|
Chris@76
|
510 <tr class="windowbg2">
|
Chris@76
|
511 <td colspan="8" align="center"><strong>', $txt['no_buddies'], '</strong></td>
|
Chris@76
|
512 </tr>';
|
Chris@76
|
513
|
Chris@76
|
514 // Now loop through each buddy showing info on each.
|
Chris@76
|
515 $alternate = false;
|
Chris@76
|
516 foreach ($context['buddies'] as $buddy)
|
Chris@76
|
517 {
|
Chris@76
|
518 echo '
|
Chris@76
|
519 <tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
|
Chris@76
|
520 <td>', $buddy['link'], '</td>
|
Chris@76
|
521 <td align="center"><a href="', $buddy['online']['href'], '"><img src="', $buddy['online']['image_href'], '" alt="', $buddy['online']['label'], '" title="', $buddy['online']['label'], '" /></a></td>
|
Chris@76
|
522 <td align="center">', ($buddy['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $buddy['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $buddy['name'] . '" /></a>'), '</td>
|
Chris@76
|
523 <td align="center">', $buddy['icq']['link'], '</td>
|
Chris@76
|
524 <td align="center">', $buddy['aim']['link'], '</td>
|
Chris@76
|
525 <td align="center">', $buddy['yim']['link'], '</td>
|
Chris@76
|
526 <td align="center">', $buddy['msn']['link'], '</td>
|
Chris@76
|
527 <td align="center"><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.gif" alt="', $txt['buddy_remove'], '" title="', $txt['buddy_remove'], '" /></a></td>
|
Chris@76
|
528 </tr>';
|
Chris@76
|
529
|
Chris@76
|
530 $alternate = !$alternate;
|
Chris@76
|
531 }
|
Chris@76
|
532
|
Chris@76
|
533 echo '
|
Chris@76
|
534 </table>';
|
Chris@76
|
535
|
Chris@76
|
536 // Add a new buddy?
|
Chris@76
|
537 echo '
|
Chris@76
|
538 <br />
|
Chris@76
|
539 <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=buddies" method="post" accept-charset="', $context['character_set'], '">
|
Chris@76
|
540 <div class="tborder add_buddy">
|
Chris@76
|
541 <div class="title_bar">
|
Chris@76
|
542 <h3 class="titlebg">', $txt['buddy_add'], '</h3>
|
Chris@76
|
543 </div>
|
Chris@76
|
544 <span class="upperframe"><span></span></span>
|
Chris@76
|
545 <div class="roundframe">
|
Chris@76
|
546 <label for="new_buddy">
|
Chris@76
|
547 <strong>', $txt['who_member'], ':</strong>
|
Chris@76
|
548 </label>
|
Chris@76
|
549 <input type="text" name="new_buddy" id="new_buddy" size="25" class="input_text" />
|
Chris@76
|
550 <input type="submit" value="', $txt['buddy_add_button'], '" class="button_submit" />
|
Chris@76
|
551 </div>
|
Chris@76
|
552 <span class="lowerframe"><span></span></span>
|
Chris@76
|
553 </div>
|
Chris@76
|
554 </form>
|
Chris@76
|
555 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
|
Chris@76
|
556 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
557 var oAddBuddySuggest = new smc_AutoSuggest({
|
Chris@76
|
558 sSelf: \'oAddBuddySuggest\',
|
Chris@76
|
559 sSessionId: \'', $context['session_id'], '\',
|
Chris@76
|
560 sSessionVar: \'', $context['session_var'], '\',
|
Chris@76
|
561 sSuggestId: \'new_buddy\',
|
Chris@76
|
562 sControlId: \'new_buddy\',
|
Chris@76
|
563 sSearchType: \'member\',
|
Chris@76
|
564 sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
|
Chris@76
|
565 bItemList: false
|
Chris@76
|
566 });
|
Chris@76
|
567 // ]]></script>';
|
Chris@76
|
568 }
|
Chris@76
|
569
|
Chris@76
|
570 // Template for showing the ignore list of the current user.
|
Chris@76
|
571 function template_editIgnoreList()
|
Chris@76
|
572 {
|
Chris@76
|
573 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
574
|
Chris@76
|
575 echo '
|
Chris@76
|
576 <div class="title_bar">
|
Chris@76
|
577 <h3 class="titlebg">
|
Chris@76
|
578 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['editIgnoreList'], '</span>
|
Chris@76
|
579 </h3>
|
Chris@76
|
580 </div>
|
Chris@76
|
581 <table border="0" width="100%" cellspacing="1" cellpadding="4" class="table_grid" align="center">
|
Chris@76
|
582 <tr class="catbg">
|
Chris@76
|
583 <th class="first_th" scope="col" width="20%">', $txt['name'], '</th>
|
Chris@76
|
584 <th scope="col">', $txt['status'], '</th>
|
Chris@76
|
585 <th scope="col">', $txt['email'], '</th>
|
Chris@76
|
586 <th scope="col">', $txt['icq'], '</th>
|
Chris@76
|
587 <th scope="col">', $txt['aim'], '</th>
|
Chris@76
|
588 <th scope="col">', $txt['yim'], '</th>
|
Chris@76
|
589 <th scope="col">', $txt['msn'], '</th>
|
Chris@76
|
590 <th class="last_th" scope="col"></th>
|
Chris@76
|
591 </tr>';
|
Chris@76
|
592
|
Chris@76
|
593 // If they don't have anyone on their ignore list, don't list it!
|
Chris@76
|
594 if (empty($context['ignore_list']))
|
Chris@76
|
595 echo '
|
Chris@76
|
596 <tr class="windowbg2">
|
Chris@76
|
597 <td colspan="8" align="center"><strong>', $txt['no_ignore'], '</strong></td>
|
Chris@76
|
598 </tr>';
|
Chris@76
|
599
|
Chris@76
|
600 // Now loop through each buddy showing info on each.
|
Chris@76
|
601 $alternate = false;
|
Chris@76
|
602 foreach ($context['ignore_list'] as $member)
|
Chris@76
|
603 {
|
Chris@76
|
604 echo '
|
Chris@76
|
605 <tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
|
Chris@76
|
606 <td>', $member['link'], '</td>
|
Chris@76
|
607 <td align="center"><a href="', $member['online']['href'], '"><img src="', $member['online']['image_href'], '" alt="', $member['online']['label'], '" title="', $member['online']['label'], '" /></a></td>
|
Chris@76
|
608 <td align="center">', ($member['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $member['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $member['name'] . '" /></a>'), '</td>
|
Chris@76
|
609 <td align="center">', $member['icq']['link'], '</td>
|
Chris@76
|
610 <td align="center">', $member['aim']['link'], '</td>
|
Chris@76
|
611 <td align="center">', $member['yim']['link'], '</td>
|
Chris@76
|
612 <td align="center">', $member['msn']['link'], '</td>
|
Chris@76
|
613 <td align="center"><a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore;remove=', $member['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.gif" alt="', $txt['ignore_remove'], '" title="', $txt['ignore_remove'], '" /></a></td>
|
Chris@76
|
614 </tr>';
|
Chris@76
|
615
|
Chris@76
|
616 $alternate = !$alternate;
|
Chris@76
|
617 }
|
Chris@76
|
618
|
Chris@76
|
619 echo '
|
Chris@76
|
620 </table>';
|
Chris@76
|
621
|
Chris@76
|
622 // Add a new buddy?
|
Chris@76
|
623 echo '
|
Chris@76
|
624 <br />
|
Chris@76
|
625 <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=lists;sa=ignore" method="post" accept-charset="', $context['character_set'], '">
|
Chris@76
|
626 <div class="tborder add_buddy">
|
Chris@76
|
627 <div class="title_bar">
|
Chris@76
|
628 <h3 class="titlebg">', $txt['ignore_add'], '</h3>
|
Chris@76
|
629 </div>
|
Chris@76
|
630 <span class="upperframe"><span></span></span>
|
Chris@76
|
631 <div class="roundframe">
|
Chris@76
|
632 <label for="new_buddy">
|
Chris@76
|
633 <strong>', $txt['who_member'], ':</strong>
|
Chris@76
|
634 </label>
|
Chris@76
|
635 <input type="text" name="new_ignore" id="new_ignore" size="25" class="input_text" />
|
Chris@76
|
636 <input type="submit" value="', $txt['ignore_add_button'], '" class="button_submit" />
|
Chris@76
|
637 </div>
|
Chris@76
|
638 <span class="lowerframe"><span></span></span>
|
Chris@76
|
639 </div>
|
Chris@76
|
640 </form>
|
Chris@76
|
641 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
|
Chris@76
|
642 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
643 var oAddIgnoreSuggest = new smc_AutoSuggest({
|
Chris@76
|
644 sSelf: \'oAddIgnoreSuggest\',
|
Chris@76
|
645 sSessionId: \'', $context['session_id'], '\',
|
Chris@76
|
646 sSessionVar: \'', $context['session_var'], '\',
|
Chris@76
|
647 sSuggestId: \'new_ignore\',
|
Chris@76
|
648 sControlId: \'new_ignore\',
|
Chris@76
|
649 sSearchType: \'member\',
|
Chris@76
|
650 sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
|
Chris@76
|
651 bItemList: false
|
Chris@76
|
652 });
|
Chris@76
|
653 // ]]></script>';
|
Chris@76
|
654 }
|
Chris@76
|
655
|
Chris@76
|
656 // This template shows an admin information on a users IP addresses used and errors attributed to them.
|
Chris@76
|
657 function template_trackActivity()
|
Chris@76
|
658 {
|
Chris@76
|
659 global $context, $settings, $options, $scripturl, $txt;
|
Chris@76
|
660
|
Chris@76
|
661 // The first table shows IP information about the user.
|
Chris@76
|
662 echo '
|
Chris@76
|
663 <div class="title_bar">
|
Chris@76
|
664 <h3 class="titlebg"><strong>', $txt['view_ips_by'], ' ', $context['member']['name'], '</strong></h3>
|
Chris@76
|
665 </div>';
|
Chris@76
|
666
|
Chris@76
|
667 // The last IP the user used.
|
Chris@76
|
668 echo '
|
Chris@76
|
669 <div id="tracking" class="windowbg2">
|
Chris@76
|
670 <span class="topslice"><span></span></span>
|
Chris@76
|
671 <div class="content">
|
Chris@76
|
672 <dl class="noborder">
|
Chris@76
|
673 <dt>', $txt['most_recent_ip'], ':
|
Chris@76
|
674 ', (empty($context['last_ip2']) ? '' : '<br />
|
Chris@76
|
675 <span class="smalltext">(<a href="' . $scripturl . '?action=helpadmin;help=whytwoip" onclick="return reqWin(this.href);">' . $txt['why_two_ip_address'] . '</a>)</span>'), '
|
Chris@76
|
676 </dt>
|
Chris@76
|
677 <dd>
|
Chris@76
|
678 <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip'], ';u=', $context['member']['id'], '">', $context['last_ip'], '</a>';
|
Chris@76
|
679
|
Chris@76
|
680 // Second address detected?
|
Chris@76
|
681 if (!empty($context['last_ip2']))
|
Chris@76
|
682 echo '
|
Chris@76
|
683 , <a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=', $context['last_ip2'], ';u=', $context['member']['id'], '">', $context['last_ip2'], '</a>';
|
Chris@76
|
684
|
Chris@76
|
685 echo '
|
Chris@76
|
686 </dd>';
|
Chris@76
|
687
|
Chris@76
|
688 // Lists of IP addresses used in messages / error messages.
|
Chris@76
|
689 echo '
|
Chris@76
|
690 <dt>', $txt['ips_in_messages'], ':</dt>
|
Chris@76
|
691 <dd>
|
Chris@76
|
692 ', (count($context['ips']) > 0 ? implode(', ', $context['ips']) : '(' . $txt['none'] . ')'), '
|
Chris@76
|
693 </dd>
|
Chris@76
|
694 <dt>', $txt['ips_in_errors'], ':</dt>
|
Chris@76
|
695 <dd>
|
Chris@76
|
696 ', (count($context['ips']) > 0 ? implode(', ', $context['error_ips']) : '(' . $txt['none'] . ')'), '
|
Chris@76
|
697 </dd>';
|
Chris@76
|
698
|
Chris@76
|
699 // List any members that have used the same IP addresses as the current member.
|
Chris@76
|
700 echo '
|
Chris@76
|
701 <dt>', $txt['members_in_range'], ':</dt>
|
Chris@76
|
702 <dd>
|
Chris@76
|
703 ', (count($context['members_in_range']) > 0 ? implode(', ', $context['members_in_range']) : '(' . $txt['none'] . ')'), '
|
Chris@76
|
704 </dd>
|
Chris@76
|
705 </dl>
|
Chris@76
|
706 </div>
|
Chris@76
|
707 <span class="botslice"><span></span></span>
|
Chris@76
|
708 </div>
|
Chris@76
|
709 <br />';
|
Chris@76
|
710
|
Chris@76
|
711 // Show the track user list.
|
Chris@76
|
712 template_show_list('track_user_list');
|
Chris@76
|
713 }
|
Chris@76
|
714
|
Chris@76
|
715 // The template for trackIP, allowing the admin to see where/who a certain IP has been used.
|
Chris@76
|
716 function template_trackIP()
|
Chris@76
|
717 {
|
Chris@76
|
718 global $context, $settings, $options, $scripturl, $txt;
|
Chris@76
|
719
|
Chris@76
|
720 // This function always defaults to the last IP used by a member but can be set to track any IP.
|
Chris@76
|
721 // The first table in the template gives an input box to allow the admin to enter another IP to track.
|
Chris@76
|
722 echo '
|
Chris@76
|
723 <div class="cat_bar">
|
Chris@76
|
724 <h3 class="catbg">', $txt['trackIP'], '</h3>
|
Chris@76
|
725 </div>
|
Chris@76
|
726 <div class="windowbg2">
|
Chris@76
|
727 <span class="topslice"><span></span></span>
|
Chris@76
|
728 <form action="', $context['base_url'], '" method="post" accept-charset="', $context['character_set'], '">
|
Chris@76
|
729 <div class="padding">', $txt['enter_ip'], ': <input type="text" name="searchip" value="', $context['ip'], '" class="input_text" /> <input type="submit" value="', $txt['trackIP'], '" class="button_submit" /></div>
|
Chris@76
|
730 </form>
|
Chris@76
|
731 <span class="botslice"><span></span></span>
|
Chris@76
|
732 </div>
|
Chris@76
|
733 <br />';
|
Chris@76
|
734
|
Chris@76
|
735 // The table inbetween the first and second table shows links to the whois server for every region.
|
Chris@76
|
736 if ($context['single_ip'])
|
Chris@76
|
737 {
|
Chris@76
|
738 echo '
|
Chris@76
|
739 <div class="title_bar">
|
Chris@76
|
740 <h3 class="titlebg">', $txt['whois_title'], ' ', $context['ip'], '</h3>
|
Chris@76
|
741 </div>
|
Chris@76
|
742 <div class="windowbg2">
|
Chris@76
|
743 <span class="topslice"><span></span></span>
|
Chris@76
|
744 <div class="padding">';
|
Chris@76
|
745 foreach ($context['whois_servers'] as $server)
|
Chris@76
|
746 echo '
|
Chris@76
|
747 <a href="', $server['url'], '" target="_blank" class="new_win"', isset($context['auto_whois_server']) && $context['auto_whois_server']['name'] == $server['name'] ? ' style="font-weight: bold;"' : '', '>', $server['name'], '</a><br />';
|
Chris@76
|
748 echo '
|
Chris@76
|
749 </div>
|
Chris@76
|
750 <span class="botslice"><span></span></span>
|
Chris@76
|
751 </div>
|
Chris@76
|
752 <br />';
|
Chris@76
|
753 }
|
Chris@76
|
754
|
Chris@76
|
755 // The second table lists all the members who have been logged as using this IP address.
|
Chris@76
|
756 echo '
|
Chris@76
|
757 <div class="title_bar">
|
Chris@76
|
758 <h3 class="titlebg">', $txt['members_from_ip'], ' ', $context['ip'], '</h3>
|
Chris@76
|
759 </div>';
|
Chris@76
|
760 if (empty($context['ips']))
|
Chris@76
|
761 echo '
|
Chris@76
|
762 <p class="windowbg2 description"><em>', $txt['no_members_from_ip'], '</em></p>';
|
Chris@76
|
763 else
|
Chris@76
|
764 {
|
Chris@76
|
765 echo '
|
Chris@76
|
766 <table class="table_grid" cellspacing="0" width="100%">
|
Chris@76
|
767 <thead>
|
Chris@76
|
768 <tr class="catbg">
|
Chris@76
|
769 <th class="first_th" scope="col">', $txt['ip_address'], '</th>
|
Chris@76
|
770 <th class="last_th" scope="col">', $txt['display_name'], '</th>
|
Chris@76
|
771 </tr>
|
Chris@76
|
772 </thead>
|
Chris@76
|
773 <tbody>';
|
Chris@76
|
774
|
Chris@76
|
775 // Loop through each of the members and display them.
|
Chris@76
|
776 foreach ($context['ips'] as $ip => $memberlist)
|
Chris@76
|
777 echo '
|
Chris@76
|
778 <tr>
|
Chris@76
|
779 <td class="windowbg2"><a href="', $context['base_url'], ';searchip=', $ip, '">', $ip, '</a></td>
|
Chris@76
|
780 <td class="windowbg2">', implode(', ', $memberlist), '</td>
|
Chris@76
|
781 </tr>';
|
Chris@76
|
782
|
Chris@76
|
783 echo '
|
Chris@76
|
784 </tbody>
|
Chris@76
|
785 </table>
|
Chris@76
|
786 <br />';
|
Chris@76
|
787 }
|
Chris@76
|
788
|
Chris@76
|
789 template_show_list('track_message_list');
|
Chris@76
|
790
|
Chris@76
|
791 echo '<br />';
|
Chris@76
|
792
|
Chris@76
|
793 template_show_list('track_user_list');
|
Chris@76
|
794 }
|
Chris@76
|
795
|
Chris@76
|
796 function template_showPermissions()
|
Chris@76
|
797 {
|
Chris@76
|
798 global $context, $settings, $options, $scripturl, $txt;
|
Chris@76
|
799
|
Chris@76
|
800 echo '
|
Chris@76
|
801 <div class="cat_bar">
|
Chris@76
|
802 <h3 class="catbg">
|
Chris@76
|
803 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['showPermissions'], '</span>
|
Chris@76
|
804 </h3>
|
Chris@76
|
805 </div>';
|
Chris@76
|
806
|
Chris@76
|
807 if ($context['member']['has_all_permissions'])
|
Chris@76
|
808 {
|
Chris@76
|
809 echo '
|
Chris@76
|
810 <p class="windowbg description">', $txt['showPermissions_all'], '</p>';
|
Chris@76
|
811 }
|
Chris@76
|
812 else
|
Chris@76
|
813 {
|
Chris@76
|
814 echo '
|
Chris@76
|
815 <p class="description">',$txt['showPermissions_help'],'</p>
|
Chris@76
|
816 <div id="permissions" class="flow_hidden">';
|
Chris@76
|
817
|
Chris@76
|
818 if (!empty($context['no_access_boards']))
|
Chris@76
|
819 {
|
Chris@76
|
820 echo '
|
Chris@76
|
821 <div class="cat_bar">
|
Chris@76
|
822 <h3 class="catbg">', $txt['showPermissions_restricted_boards'], '</h3>
|
Chris@76
|
823 </div>
|
Chris@76
|
824 <div class="windowbg smalltext">
|
Chris@76
|
825 <span class="topslice"><span></span></span>
|
Chris@76
|
826 <div class="content">', $txt['showPermissions_restricted_boards_desc'], ':<br />';
|
Chris@76
|
827 foreach ($context['no_access_boards'] as $no_access_board)
|
Chris@76
|
828 echo '
|
Chris@76
|
829 <a href="', $scripturl, '?board=', $no_access_board['id'], '.0">', $no_access_board['name'], '</a>', $no_access_board['is_last'] ? '' : ', ';
|
Chris@76
|
830 echo '
|
Chris@76
|
831 </div>
|
Chris@76
|
832 <span class="botslice"><span></span></span>
|
Chris@76
|
833 </div>';
|
Chris@76
|
834 }
|
Chris@76
|
835
|
Chris@76
|
836 // General Permissions section.
|
Chris@76
|
837 echo '
|
Chris@76
|
838 <div class="tborder">
|
Chris@76
|
839 <div class="cat_bar">
|
Chris@76
|
840 <h3 class="catbg">', $txt['showPermissions_general'], '</h3>
|
Chris@76
|
841 </div>';
|
Chris@76
|
842 if (!empty($context['member']['permissions']['general']))
|
Chris@76
|
843 {
|
Chris@76
|
844 echo '
|
Chris@76
|
845 <table class="table_grid" width="100%" cellspacing="0">
|
Chris@76
|
846 <thead>
|
Chris@76
|
847 <tr class="titlebg">
|
Chris@76
|
848 <th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
|
Chris@76
|
849 <th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
|
Chris@76
|
850 </tr>
|
Chris@76
|
851 </thead>
|
Chris@76
|
852 <tbody>';
|
Chris@76
|
853
|
Chris@76
|
854 foreach ($context['member']['permissions']['general'] as $permission)
|
Chris@76
|
855 {
|
Chris@76
|
856 echo '
|
Chris@76
|
857 <tr>
|
Chris@76
|
858 <td class="windowbg" title="', $permission['id'], '">
|
Chris@76
|
859 ', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
|
Chris@76
|
860 </td>
|
Chris@76
|
861 <td class="windowbg2 smalltext">';
|
Chris@76
|
862
|
Chris@76
|
863 if ($permission['is_denied'])
|
Chris@76
|
864 echo '
|
Chris@76
|
865 <span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']),'</span>';
|
Chris@76
|
866 else
|
Chris@76
|
867 echo '
|
Chris@76
|
868 ', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']);
|
Chris@76
|
869
|
Chris@76
|
870 echo '
|
Chris@76
|
871 </td>
|
Chris@76
|
872 </tr>';
|
Chris@76
|
873 }
|
Chris@76
|
874 echo '
|
Chris@76
|
875 </tbody>
|
Chris@76
|
876 </table>
|
Chris@76
|
877 </div><br />';
|
Chris@76
|
878 }
|
Chris@76
|
879 else
|
Chris@76
|
880 echo '
|
Chris@76
|
881 <p class="windowbg2 description">', $txt['showPermissions_none_general'], '</p>';
|
Chris@76
|
882
|
Chris@76
|
883 // Board permission section.
|
Chris@76
|
884 echo '
|
Chris@76
|
885 <div class="tborder">
|
Chris@76
|
886 <form action="' . $scripturl . '?action=profile;u=', $context['id_member'], ';area=permissions#board_permissions" method="post" accept-charset="', $context['character_set'], '">
|
Chris@76
|
887 <div class="cat_bar">
|
Chris@76
|
888 <h3 class="catbg"><span class="ie6_header floatleft">
|
Chris@76
|
889 <a id="board_permissions"></a>', $txt['showPermissions_select'], ':
|
Chris@76
|
890 <select name="board" onchange="if (this.options[this.selectedIndex].value) this.form.submit();">
|
Chris@76
|
891 <option value="0"', $context['board'] == 0 ? ' selected="selected"' : '', '>', $txt['showPermissions_global'], ' </option>';
|
Chris@76
|
892 if (!empty($context['boards']))
|
Chris@76
|
893 echo '
|
Chris@76
|
894 <option value="" disabled="disabled">---------------------------</option>';
|
Chris@76
|
895
|
Chris@76
|
896 // Fill the box with any local permission boards.
|
Chris@76
|
897 foreach ($context['boards'] as $board)
|
Chris@76
|
898 echo '
|
Chris@76
|
899 <option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['name'], ' (', $board['profile_name'], ')</option>';
|
Chris@76
|
900
|
Chris@76
|
901 echo '
|
Chris@76
|
902 </select></span>
|
Chris@76
|
903 </h3>
|
Chris@76
|
904 </div>
|
Chris@76
|
905 </form>';
|
Chris@76
|
906 if (!empty($context['member']['permissions']['board']))
|
Chris@76
|
907 {
|
Chris@76
|
908 echo '
|
Chris@76
|
909 <table class="table_grid" width="100%" cellspacing="0">
|
Chris@76
|
910 <thead>
|
Chris@76
|
911 <tr class="titlebg">
|
Chris@76
|
912 <th class="lefttext first_th" scope="col" width="50%">', $txt['showPermissions_permission'], '</th>
|
Chris@76
|
913 <th class="lefttext last_th" scope="col" width="50%">', $txt['showPermissions_status'], '</th>
|
Chris@76
|
914 </tr>
|
Chris@76
|
915 </thead>
|
Chris@76
|
916 <tbody>';
|
Chris@76
|
917 foreach ($context['member']['permissions']['board'] as $permission)
|
Chris@76
|
918 {
|
Chris@76
|
919 echo '
|
Chris@76
|
920 <tr>
|
Chris@76
|
921 <td class="windowbg" title="', $permission['id'], '">
|
Chris@76
|
922 ', $permission['is_denied'] ? '<del>' . $permission['name'] . '</del>' : $permission['name'], '
|
Chris@76
|
923 </td>
|
Chris@76
|
924 <td class="windowbg2 smalltext">';
|
Chris@76
|
925
|
Chris@76
|
926 if ($permission['is_denied'])
|
Chris@76
|
927 {
|
Chris@76
|
928 echo '
|
Chris@76
|
929 <span class="alert">', $txt['showPermissions_denied'], ': ', implode(', ', $permission['groups']['denied']), '</span>';
|
Chris@76
|
930 }
|
Chris@76
|
931 else
|
Chris@76
|
932 {
|
Chris@76
|
933 echo '
|
Chris@76
|
934 ', $txt['showPermissions_given'], ': ', implode(', ', $permission['groups']['allowed']);
|
Chris@76
|
935 }
|
Chris@76
|
936 echo '
|
Chris@76
|
937 </td>
|
Chris@76
|
938 </tr>';
|
Chris@76
|
939 }
|
Chris@76
|
940 echo '
|
Chris@76
|
941 </tbody>
|
Chris@76
|
942 </table>';
|
Chris@76
|
943 }
|
Chris@76
|
944 else
|
Chris@76
|
945 echo '
|
Chris@76
|
946 <p class="windowbg2 description">', $txt['showPermissions_none_board'], '</p>';
|
Chris@76
|
947 echo '
|
Chris@76
|
948 </div>
|
Chris@76
|
949 </div>';
|
Chris@76
|
950 }
|
Chris@76
|
951 }
|
Chris@76
|
952
|
Chris@76
|
953 // Template for user statistics, showing graphs and the like.
|
Chris@76
|
954 function template_statPanel()
|
Chris@76
|
955 {
|
Chris@76
|
956 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
957
|
Chris@76
|
958 // First, show a few text statistics such as post/topic count.
|
Chris@76
|
959 echo '
|
Chris@76
|
960 <div id="profileview">
|
Chris@76
|
961 <div id="generalstats">
|
Chris@76
|
962 <div class="cat_bar">
|
Chris@76
|
963 <h3 class="catbg">
|
Chris@76
|
964 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_info.gif" alt="" class="icon" />
|
Chris@76
|
965 ', $txt['statPanel_generalStats'], ' - ', $context['member']['name'], '
|
Chris@76
|
966 </span>
|
Chris@76
|
967 </h3>
|
Chris@76
|
968 </div>
|
Chris@76
|
969 <div class="windowbg2">
|
Chris@76
|
970 <span class="topslice"><span></span></span>
|
Chris@76
|
971 <div class="content">
|
Chris@76
|
972 <dl>
|
Chris@76
|
973 <dt>', $txt['statPanel_total_time_online'], ':</dt>
|
Chris@76
|
974 <dd>', $context['time_logged_in'], '</dd>
|
Chris@76
|
975 <dt>', $txt['statPanel_total_posts'], ':</dt>
|
Chris@76
|
976 <dd>', $context['num_posts'], ' ', $txt['statPanel_posts'], '</dd>
|
Chris@76
|
977 <dt>', $txt['statPanel_total_topics'], ':</dt>
|
Chris@76
|
978 <dd>', $context['num_topics'], ' ', $txt['statPanel_topics'], '</dd>
|
Chris@76
|
979 <dt>', $txt['statPanel_users_polls'], ':</dt>
|
Chris@76
|
980 <dd>', $context['num_polls'], ' ', $txt['statPanel_polls'], '</dd>
|
Chris@76
|
981 <dt>', $txt['statPanel_users_votes'], ':</dt>
|
Chris@76
|
982 <dd>', $context['num_votes'], ' ', $txt['statPanel_votes'], '</dd>
|
Chris@76
|
983 </dl>
|
Chris@76
|
984 </div>
|
Chris@76
|
985 <span class="botslice"><span></span></span>
|
Chris@76
|
986 </div>
|
Chris@76
|
987 </div>';
|
Chris@76
|
988
|
Chris@76
|
989 // This next section draws a graph showing what times of day they post the most.
|
Chris@76
|
990 echo '
|
Chris@76
|
991 <div id="activitytime" class="flow_hidden">
|
Chris@76
|
992 <div class="cat_bar">
|
Chris@76
|
993 <h3 class="catbg">
|
Chris@76
|
994 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_history.gif" alt="" class="icon" />', $txt['statPanel_activityTime'], '</span>
|
Chris@76
|
995 </h3>
|
Chris@76
|
996 </div>
|
Chris@76
|
997 <div class="windowbg2">
|
Chris@76
|
998 <span class="topslice"><span></span></span>
|
Chris@76
|
999 <div class="content">';
|
Chris@76
|
1000
|
Chris@76
|
1001 // If they haven't post at all, don't draw the graph.
|
Chris@76
|
1002 if (empty($context['posts_by_time']))
|
Chris@76
|
1003 echo '
|
Chris@76
|
1004 <span>', $txt['statPanel_noPosts'], '</span>';
|
Chris@76
|
1005 // Otherwise do!
|
Chris@76
|
1006 else
|
Chris@76
|
1007 {
|
Chris@76
|
1008 echo '
|
Chris@76
|
1009 <ul class="activity_stats flow_hidden">';
|
Chris@76
|
1010
|
Chris@76
|
1011 // The labels.
|
Chris@76
|
1012 foreach ($context['posts_by_time'] as $time_of_day)
|
Chris@76
|
1013 {
|
Chris@76
|
1014 echo '
|
Chris@76
|
1015 <li', $time_of_day['is_last'] ? ' class="last"' : '', '>
|
Chris@76
|
1016 <div class="bar" style="padding-top: ', ((int) (100 - $time_of_day['relative_percent'])), 'px;" title="', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '">
|
Chris@76
|
1017 <div style="height: ', (int) $time_of_day['relative_percent'], 'px;">
|
Chris@76
|
1018 <span>', sprintf($txt['statPanel_activityTime_posts'], $time_of_day['posts'], $time_of_day['posts_percent']), '</span>
|
Chris@76
|
1019 </div>
|
Chris@76
|
1020 </div>
|
Chris@76
|
1021 <span class="stats_hour">', $time_of_day['hour_format'], '</span>
|
Chris@76
|
1022 </li>';
|
Chris@76
|
1023 }
|
Chris@76
|
1024
|
Chris@76
|
1025 echo '
|
Chris@76
|
1026
|
Chris@76
|
1027 </ul>';
|
Chris@76
|
1028 }
|
Chris@76
|
1029
|
Chris@76
|
1030 echo '
|
Chris@76
|
1031 <span class="clear" />
|
Chris@76
|
1032 </div>
|
Chris@76
|
1033 <span class="botslice"><span></span></span>
|
Chris@76
|
1034 </div>
|
Chris@76
|
1035 </div>';
|
Chris@76
|
1036
|
Chris@76
|
1037 // Two columns with the most popular boards by posts and activity (activity = users posts / total posts).
|
Chris@76
|
1038 echo '
|
Chris@76
|
1039 <div class="flow_hidden">
|
Chris@76
|
1040 <div id="popularposts">
|
Chris@76
|
1041 <div class="cat_bar">
|
Chris@76
|
1042 <h3 class="catbg">
|
Chris@76
|
1043 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_replies.gif" alt="" class="icon" />', $txt['statPanel_topBoards'], '</span>
|
Chris@76
|
1044 </h3>
|
Chris@76
|
1045 </div>
|
Chris@76
|
1046 <div class="windowbg2">
|
Chris@76
|
1047 <span class="topslice"><span></span></span>
|
Chris@76
|
1048 <div class="content">';
|
Chris@76
|
1049
|
Chris@76
|
1050 if (empty($context['popular_boards']))
|
Chris@76
|
1051 echo '
|
Chris@76
|
1052 <span>', $txt['statPanel_noPosts'], '</span>';
|
Chris@76
|
1053
|
Chris@76
|
1054 else
|
Chris@76
|
1055 {
|
Chris@76
|
1056 echo '
|
Chris@76
|
1057 <dl>';
|
Chris@76
|
1058
|
Chris@76
|
1059 // Draw a bar for every board.
|
Chris@76
|
1060 foreach ($context['popular_boards'] as $board)
|
Chris@76
|
1061 {
|
Chris@76
|
1062 echo '
|
Chris@76
|
1063 <dt>', $board['link'], '</dt>
|
Chris@76
|
1064 <dd>
|
Chris@76
|
1065 <div class="profile_pie" style="background-position: -', ((int) ($board['posts_percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_memberposts'], $board['posts'], $board['total_posts_member'], $board['posts_percent']), '">
|
Chris@76
|
1066 ', sprintf($txt['statPanel_topBoards_memberposts'], $board['posts'], $board['total_posts_member'], $board['posts_percent']), '
|
Chris@76
|
1067 </div>
|
Chris@76
|
1068 <span>', empty($context['hide_num_posts']) ? $board['posts'] : '', '</span>
|
Chris@76
|
1069 </dd>';
|
Chris@76
|
1070 }
|
Chris@76
|
1071
|
Chris@76
|
1072 echo '
|
Chris@76
|
1073 </dl>';
|
Chris@76
|
1074 }
|
Chris@76
|
1075 echo '
|
Chris@76
|
1076 </div>
|
Chris@76
|
1077 <span class="botslice"><span></span></span>
|
Chris@76
|
1078 </div>
|
Chris@76
|
1079 </div>';
|
Chris@76
|
1080 echo '
|
Chris@76
|
1081 <div id="popularactivity">
|
Chris@76
|
1082 <div class="cat_bar">
|
Chris@76
|
1083 <h3 class="catbg">
|
Chris@76
|
1084 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/stats_replies.gif" alt="" class="icon" />', $txt['statPanel_topBoardsActivity'], '</span>
|
Chris@76
|
1085 </h3>
|
Chris@76
|
1086 </div>
|
Chris@76
|
1087 <div class="windowbg2">
|
Chris@76
|
1088 <span class="topslice"><span></span></span>
|
Chris@76
|
1089 <div class="content">';
|
Chris@76
|
1090
|
Chris@76
|
1091 if (empty($context['board_activity']))
|
Chris@76
|
1092 echo '
|
Chris@76
|
1093 <span>', $txt['statPanel_noPosts'], '</span>';
|
Chris@76
|
1094 else
|
Chris@76
|
1095 {
|
Chris@76
|
1096 echo '
|
Chris@76
|
1097 <dl>';
|
Chris@76
|
1098
|
Chris@76
|
1099 // Draw a bar for every board.
|
Chris@76
|
1100 foreach ($context['board_activity'] as $activity)
|
Chris@76
|
1101 {
|
Chris@76
|
1102 echo '
|
Chris@76
|
1103 <dt>', $activity['link'], '</dt>
|
Chris@76
|
1104 <dd>
|
Chris@76
|
1105 <div class="profile_pie" style="background-position: -', ((int) ($activity['percent'] / 5) * 20), 'px 0;" title="', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '">
|
Chris@76
|
1106 ', sprintf($txt['statPanel_topBoards_posts'], $activity['posts'], $activity['total_posts'], $activity['posts_percent']), '
|
Chris@76
|
1107 </div>
|
Chris@76
|
1108 <span>', $activity['percent'], '%</span>
|
Chris@76
|
1109 </dd>';
|
Chris@76
|
1110 }
|
Chris@76
|
1111
|
Chris@76
|
1112 echo '
|
Chris@76
|
1113 </dl>';
|
Chris@76
|
1114 }
|
Chris@76
|
1115 echo '
|
Chris@76
|
1116 </div>
|
Chris@76
|
1117 <span class="botslice"><span></span></span>
|
Chris@76
|
1118 </div>
|
Chris@76
|
1119 </div>
|
Chris@76
|
1120 </div>';
|
Chris@76
|
1121
|
Chris@76
|
1122 echo '
|
Chris@76
|
1123 </div>
|
Chris@76
|
1124 <br class="clear" />';
|
Chris@76
|
1125 }
|
Chris@76
|
1126
|
Chris@76
|
1127 // Template for editing profile options.
|
Chris@76
|
1128 function template_edit_options()
|
Chris@76
|
1129 {
|
Chris@76
|
1130 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
1131
|
Chris@76
|
1132 // The main header!
|
Chris@76
|
1133 echo '
|
Chris@76
|
1134 <form action="', (!empty($context['profile_custom_submit_url']) ? $context['profile_custom_submit_url'] : $scripturl . '?action=profile;area=' . $context['menu_item_selected'] . ';u=' . $context['id_member'] . ';save'), '" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" enctype="multipart/form-data" onsubmit="return checkProfileSubmit();">
|
Chris@76
|
1135 <div class="cat_bar">
|
Chris@76
|
1136 <h3 class="catbg">
|
Chris@76
|
1137 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />';
|
Chris@76
|
1138
|
Chris@76
|
1139 // Don't say "Profile" if this isn't the profile...
|
Chris@76
|
1140 if (!empty($context['profile_header_text']))
|
Chris@76
|
1141 echo '
|
Chris@76
|
1142 ', $context['profile_header_text'];
|
Chris@76
|
1143 else
|
Chris@76
|
1144 echo '
|
Chris@76
|
1145 ', $txt['profile'];
|
Chris@76
|
1146
|
Chris@76
|
1147 echo '
|
Chris@76
|
1148 </span>
|
Chris@76
|
1149 </h3>
|
Chris@76
|
1150 </div>';
|
Chris@76
|
1151
|
Chris@76
|
1152 // Have we some description?
|
Chris@76
|
1153 if ($context['page_desc'])
|
Chris@76
|
1154 echo '
|
Chris@76
|
1155 <p class="windowbg description">', $context['page_desc'], '</p>';
|
Chris@76
|
1156
|
Chris@76
|
1157 echo '
|
Chris@76
|
1158 <div class="windowbg2">
|
Chris@76
|
1159 <span class="topslice"><span></span></span>
|
Chris@76
|
1160 <div class="content">';
|
Chris@76
|
1161
|
Chris@76
|
1162 // Any bits at the start?
|
Chris@76
|
1163 if (!empty($context['profile_prehtml']))
|
Chris@76
|
1164 echo '
|
Chris@76
|
1165 <div>', $context['profile_prehtml'], '</div>';
|
Chris@76
|
1166
|
Chris@76
|
1167 if (!empty($context['profile_fields']))
|
Chris@76
|
1168 echo '
|
Chris@76
|
1169 <dl>';
|
Chris@76
|
1170
|
Chris@76
|
1171 // Start the big old loop 'of love.
|
Chris@76
|
1172 $lastItem = 'hr';
|
Chris@76
|
1173 foreach ($context['profile_fields'] as $key => $field)
|
Chris@76
|
1174 {
|
Chris@76
|
1175 // We add a little hack to be sure we never get more than one hr in a row!
|
Chris@76
|
1176 if ($lastItem == 'hr' && $field['type'] == 'hr')
|
Chris@76
|
1177 continue;
|
Chris@76
|
1178
|
Chris@76
|
1179 $lastItem = $field['type'];
|
Chris@76
|
1180 if ($field['type'] == 'hr')
|
Chris@76
|
1181 {
|
Chris@76
|
1182 echo '
|
Chris@76
|
1183 </dl>
|
Chris@76
|
1184 <hr width="100%" size="1" class="hrcolor clear" />
|
Chris@76
|
1185 <dl>';
|
Chris@76
|
1186 }
|
Chris@76
|
1187 elseif ($field['type'] == 'callback')
|
Chris@76
|
1188 {
|
Chris@76
|
1189 if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
|
Chris@76
|
1190 {
|
Chris@76
|
1191 $callback_func = 'template_profile_' . $field['callback_func'];
|
Chris@76
|
1192 $callback_func();
|
Chris@76
|
1193 }
|
Chris@76
|
1194 }
|
Chris@76
|
1195 else
|
Chris@76
|
1196 {
|
Chris@76
|
1197 echo '
|
Chris@76
|
1198 <dt>
|
Chris@76
|
1199 <strong', !empty($field['is_error']) ? ' class="error"' : '', '>', $field['label'], '</strong>';
|
Chris@76
|
1200
|
Chris@76
|
1201 // Does it have any subtext to show?
|
Chris@76
|
1202 if (!empty($field['subtext']))
|
Chris@76
|
1203 echo '
|
Chris@76
|
1204 <br />
|
Chris@76
|
1205 <span class="smalltext">', $field['subtext'], '</span>';
|
Chris@76
|
1206
|
Chris@76
|
1207 echo '
|
Chris@76
|
1208 </dt>
|
Chris@76
|
1209 <dd>';
|
Chris@76
|
1210
|
Chris@76
|
1211 // Want to put something infront of the box?
|
Chris@76
|
1212 if (!empty($field['preinput']))
|
Chris@76
|
1213 echo '
|
Chris@76
|
1214 ', $field['preinput'];
|
Chris@76
|
1215
|
Chris@76
|
1216 // What type of data are we showing?
|
Chris@76
|
1217 if ($field['type'] == 'label')
|
Chris@76
|
1218 echo '
|
Chris@76
|
1219 ', $field['value'];
|
Chris@76
|
1220
|
Chris@76
|
1221 // Maybe it's a text box - very likely!
|
Chris@76
|
1222 elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
|
Chris@76
|
1223 echo '
|
Chris@76
|
1224 <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '" />';
|
Chris@76
|
1225
|
Chris@76
|
1226 // You "checking" me out? ;)
|
Chris@76
|
1227 elseif ($field['type'] == 'check')
|
Chris@76
|
1228 echo '
|
Chris@76
|
1229 <input type="hidden" name="', $key, '" value="0" /><input type="checkbox" name="', $key, '" id="', $key, '" ', !empty($field['value']) ? ' checked="checked"' : '', ' value="1" class="input_check" ', $field['input_attr'], ' />';
|
Chris@76
|
1230
|
Chris@76
|
1231 // Always fun - select boxes!
|
Chris@76
|
1232 elseif ($field['type'] == 'select')
|
Chris@76
|
1233 {
|
Chris@76
|
1234 echo '
|
Chris@76
|
1235 <select name="', $key, '" id="', $key, '">';
|
Chris@76
|
1236
|
Chris@76
|
1237 if (isset($field['options']))
|
Chris@76
|
1238 {
|
Chris@76
|
1239 // Is this some code to generate the options?
|
Chris@76
|
1240 if (!is_array($field['options']))
|
Chris@76
|
1241 $field['options'] = eval($field['options']);
|
Chris@76
|
1242 // Assuming we now have some!
|
Chris@76
|
1243 if (is_array($field['options']))
|
Chris@76
|
1244 foreach ($field['options'] as $value => $name)
|
Chris@76
|
1245 echo '
|
Chris@76
|
1246 <option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
|
Chris@76
|
1247 }
|
Chris@76
|
1248
|
Chris@76
|
1249 echo '
|
Chris@76
|
1250 </select>';
|
Chris@76
|
1251 }
|
Chris@76
|
1252
|
Chris@76
|
1253 // Something to end with?
|
Chris@76
|
1254 if (!empty($field['postinput']))
|
Chris@76
|
1255 echo '
|
Chris@76
|
1256 ', $field['postinput'];
|
Chris@76
|
1257
|
Chris@76
|
1258 echo '
|
Chris@76
|
1259 </dd>';
|
Chris@76
|
1260 }
|
Chris@76
|
1261 }
|
Chris@76
|
1262
|
Chris@76
|
1263 if (!empty($context['profile_fields']))
|
Chris@76
|
1264 echo '
|
Chris@76
|
1265 </dl>';
|
Chris@76
|
1266
|
Chris@76
|
1267 // Are there any custom profile fields - if so print them!
|
Chris@76
|
1268 if (!empty($context['custom_fields']))
|
Chris@76
|
1269 {
|
Chris@76
|
1270 if ($lastItem != 'hr')
|
Chris@76
|
1271 echo '
|
Chris@76
|
1272 <hr width="100%" size="1" class="hrcolor clear" />';
|
Chris@76
|
1273
|
Chris@76
|
1274 echo '
|
Chris@76
|
1275 <dl>';
|
Chris@76
|
1276
|
Chris@76
|
1277 foreach ($context['custom_fields'] as $field)
|
Chris@76
|
1278 {
|
Chris@76
|
1279 echo '
|
Chris@76
|
1280 <dt>
|
Chris@76
|
1281 <strong>', $field['name'], ': </strong><br />
|
Chris@76
|
1282 <span class="smalltext">', $field['desc'], '</span>
|
Chris@76
|
1283 </dt>
|
Chris@76
|
1284 <dd>
|
Chris@76
|
1285 ', $field['input_html'], '
|
Chris@76
|
1286 </dd>';
|
Chris@76
|
1287 }
|
Chris@76
|
1288
|
Chris@76
|
1289 echo '
|
Chris@76
|
1290 </dl>';
|
Chris@76
|
1291
|
Chris@76
|
1292 }
|
Chris@76
|
1293
|
Chris@76
|
1294 // Any closing HTML?
|
Chris@76
|
1295 if (!empty($context['profile_posthtml']))
|
Chris@76
|
1296 echo '
|
Chris@76
|
1297 <div>', $context['profile_posthtml'], '</div>';
|
Chris@76
|
1298 elseif ($lastItem != 'hr')
|
Chris@76
|
1299 echo '
|
Chris@76
|
1300 <hr width="100%" size="1" class="hrcolor clear" />';
|
Chris@76
|
1301
|
Chris@76
|
1302 // Only show the password box if it's actually needed.
|
Chris@76
|
1303 if ($context['require_password'])
|
Chris@76
|
1304 echo '
|
Chris@76
|
1305 <dl>
|
Chris@76
|
1306 <dt>
|
Chris@76
|
1307 <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br />
|
Chris@76
|
1308 <span class="smalltext">', $txt['required_security_reasons'], '</span>
|
Chris@76
|
1309 </dt>
|
Chris@76
|
1310 <dd>
|
Chris@76
|
1311 <input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
|
Chris@76
|
1312 </dd>
|
Chris@76
|
1313 </dl>';
|
Chris@76
|
1314
|
Chris@76
|
1315 echo '
|
Chris@76
|
1316 <div class="righttext">';
|
Chris@76
|
1317
|
Chris@76
|
1318 // The button shouldn't say "Change profile" unless we're changing the profile...
|
Chris@76
|
1319 if (!empty($context['submit_button_text']))
|
Chris@76
|
1320 echo '
|
Chris@76
|
1321 <input type="submit" value="', $context['submit_button_text'], '" class="button_submit" />';
|
Chris@76
|
1322 else
|
Chris@76
|
1323 echo '
|
Chris@76
|
1324 <input type="submit" value="', $txt['change_profile'], '" class="button_submit" />';
|
Chris@76
|
1325
|
Chris@76
|
1326 echo '
|
Chris@76
|
1327 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
|
Chris@76
|
1328 <input type="hidden" name="u" value="', $context['id_member'], '" />
|
Chris@76
|
1329 <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
|
Chris@76
|
1330 </div>
|
Chris@76
|
1331 </div>
|
Chris@76
|
1332 <span class="botslice"><span></span></span>
|
Chris@76
|
1333 </div>
|
Chris@76
|
1334 <br />
|
Chris@76
|
1335 </form>';
|
Chris@76
|
1336
|
Chris@76
|
1337 // Some javascript!
|
Chris@76
|
1338 echo '
|
Chris@76
|
1339 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
1340 function checkProfileSubmit()
|
Chris@76
|
1341 {';
|
Chris@76
|
1342
|
Chris@76
|
1343 // If this part requires a password, make sure to give a warning.
|
Chris@76
|
1344 if ($context['require_password'])
|
Chris@76
|
1345 echo '
|
Chris@76
|
1346 // Did you forget to type your password?
|
Chris@76
|
1347 if (document.forms.creator.oldpasswrd.value == "")
|
Chris@76
|
1348 {
|
Chris@76
|
1349 alert("', $txt['required_security_reasons'], '");
|
Chris@76
|
1350 return false;
|
Chris@76
|
1351 }';
|
Chris@76
|
1352
|
Chris@76
|
1353 // Any onsubmit javascript?
|
Chris@76
|
1354 if (!empty($context['profile_onsubmit_javascript']))
|
Chris@76
|
1355 echo '
|
Chris@76
|
1356 ', $context['profile_javascript'];
|
Chris@76
|
1357
|
Chris@76
|
1358 echo '
|
Chris@76
|
1359 }';
|
Chris@76
|
1360
|
Chris@76
|
1361 // Any totally custom stuff?
|
Chris@76
|
1362 if (!empty($context['profile_javascript']))
|
Chris@76
|
1363 echo '
|
Chris@76
|
1364 ', $context['profile_javascript'];
|
Chris@76
|
1365
|
Chris@76
|
1366 echo '
|
Chris@76
|
1367 // ]]></script>';
|
Chris@76
|
1368
|
Chris@76
|
1369 // Any final spellchecking stuff?
|
Chris@76
|
1370 if (!empty($context['show_spellchecking']))
|
Chris@76
|
1371 echo '
|
Chris@76
|
1372 <form name="spell_form" id="spell_form" method="post" accept-charset="', $context['character_set'], '" target="spellWindow" action="', $scripturl, '?action=spellcheck"><input type="hidden" name="spellstring" value="" /></form>';
|
Chris@76
|
1373 }
|
Chris@76
|
1374
|
Chris@76
|
1375 // Personal Message settings.
|
Chris@76
|
1376 function template_profile_pm_settings()
|
Chris@76
|
1377 {
|
Chris@76
|
1378 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
1379
|
Chris@76
|
1380 echo '
|
Chris@76
|
1381 <dt>
|
Chris@76
|
1382 <label for="pm_prefs">', $txt['pm_display_mode'], ':</label>
|
Chris@76
|
1383 </dt>
|
Chris@76
|
1384 <dd>
|
Chris@76
|
1385 <select name="pm_prefs" id="pm_prefs" onchange="if (this.value == 2 && !document.getElementById(\'copy_to_outbox\').checked) alert(\'', $txt['pm_recommend_enable_outbox'], '\');">
|
Chris@76
|
1386 <option value="0"', $context['display_mode'] == 0 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_all'], '</option>
|
Chris@76
|
1387 <option value="1"', $context['display_mode'] == 1 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_one'], '</option>
|
Chris@76
|
1388 <option value="2"', $context['display_mode'] == 2 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_linked'], '</option>
|
Chris@76
|
1389 </select>
|
Chris@76
|
1390 </dd>
|
Chris@76
|
1391 <dt>
|
Chris@76
|
1392 <label for="view_newest_pm_first">', $txt['recent_pms_at_top'], '</label>
|
Chris@76
|
1393 </dt>
|
Chris@76
|
1394 <dd>
|
Chris@76
|
1395 <input type="hidden" name="default_options[view_newest_pm_first]" value="0" />
|
Chris@76
|
1396 <input type="checkbox" name="default_options[view_newest_pm_first]" id="view_newest_pm_first" value="1"', !empty($context['member']['options']['view_newest_pm_first']) ? ' checked="checked"' : '', ' class="input_check" />
|
Chris@76
|
1397 </dd>
|
Chris@76
|
1398 </dl>
|
Chris@76
|
1399 <hr />
|
Chris@76
|
1400 <dl>
|
Chris@76
|
1401 <dt>
|
Chris@76
|
1402 <label for="pm_receive_from">', $txt['pm_receive_from'], '</label>
|
Chris@76
|
1403 </dt>
|
Chris@76
|
1404 <dd>
|
Chris@76
|
1405 <select name="pm_receive_from" id="pm_receive_from">
|
Chris@76
|
1406 <option value="0"', empty($context['receive_from']) || (empty($modSettings['enable_buddylist']) && $context['receive_from'] < 3) ? ' selected="selected"' : '', '>', $txt['pm_receive_from_everyone'], '</option>';
|
Chris@76
|
1407
|
Chris@76
|
1408 if (!empty($modSettings['enable_buddylist']))
|
Chris@76
|
1409 echo '
|
Chris@76
|
1410 <option value="1"', !empty($context['receive_from']) && $context['receive_from'] == 1 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_ignore'], '</option>
|
Chris@76
|
1411 <option value="2"', !empty($context['receive_from']) && $context['receive_from'] == 2 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_buddies'], '</option>';
|
Chris@76
|
1412
|
Chris@76
|
1413 echo '
|
Chris@76
|
1414 <option value="3"', !empty($context['receive_from']) && $context['receive_from'] > 2 ? ' selected="selected"' : '', '>', $txt['pm_receive_from_admins'], '</option>
|
Chris@76
|
1415 </select>
|
Chris@76
|
1416 </dd>
|
Chris@76
|
1417 <dt>
|
Chris@76
|
1418 <label for="pm_email_notify">', $txt['email_notify'], '</label>
|
Chris@76
|
1419 </dt>
|
Chris@76
|
1420 <dd>
|
Chris@76
|
1421 <select name="pm_email_notify" id="pm_email_notify">
|
Chris@76
|
1422 <option value="0"', empty($context['send_email']) ? ' selected="selected"' : '', '>', $txt['email_notify_never'], '</option>
|
Chris@76
|
1423 <option value="1"', !empty($context['send_email']) && ($context['send_email'] == 1 || (empty($modSettings['enable_buddylist']) && $context['send_email'] > 1)) ? ' selected="selected"' : '', '>', $txt['email_notify_always'], '</option>';
|
Chris@76
|
1424
|
Chris@76
|
1425 if (!empty($modSettings['enable_buddylist']))
|
Chris@76
|
1426 echo '
|
Chris@76
|
1427 <option value="2"', !empty($context['send_email']) && $context['send_email'] > 1 ? ' selected="selected"' : '', '>', $txt['email_notify_buddies'], '</option>';
|
Chris@76
|
1428
|
Chris@76
|
1429 echo '
|
Chris@76
|
1430 </select>
|
Chris@76
|
1431 </dd>
|
Chris@76
|
1432 <dt>
|
Chris@76
|
1433 <label for="popup_messages">', $txt['popup_messages'], '</label>
|
Chris@76
|
1434 </dt>
|
Chris@76
|
1435 <dd>
|
Chris@76
|
1436 <input type="hidden" name="default_options[popup_messages]" value="0" />
|
Chris@76
|
1437 <input type="checkbox" name="default_options[popup_messages]" id="popup_messages" value="1"', !empty($context['member']['options']['popup_messages']) ? ' checked="checked"' : '', ' class="input_check" />
|
Chris@76
|
1438 </dd>
|
Chris@76
|
1439 </dl>
|
Chris@76
|
1440 <hr />
|
Chris@76
|
1441 <dl>
|
Chris@76
|
1442 <dt>
|
Chris@76
|
1443 <label for="copy_to_outbox"> ', $txt['copy_to_outbox'], '</label>
|
Chris@76
|
1444 </dt>
|
Chris@76
|
1445 <dd>
|
Chris@76
|
1446 <input type="hidden" name="default_options[copy_to_outbox]" value="0" />
|
Chris@76
|
1447 <input type="checkbox" name="default_options[copy_to_outbox]" id="copy_to_outbox" value="1"', !empty($context['member']['options']['copy_to_outbox']) ? ' checked="checked"' : '', ' class="input_check" />
|
Chris@76
|
1448 </dd>
|
Chris@76
|
1449 <dt>
|
Chris@76
|
1450 <label for="pm_remove_inbox_label">', $txt['pm_remove_inbox_label'], '</label>
|
Chris@76
|
1451 </dt>
|
Chris@76
|
1452 <dd>
|
Chris@76
|
1453 <input type="hidden" name="default_options[pm_remove_inbox_label]" value="0" />
|
Chris@76
|
1454 <input type="checkbox" name="default_options[pm_remove_inbox_label]" id="pm_remove_inbox_label" value="1"', !empty($context['member']['options']['pm_remove_inbox_label']) ? ' checked="checked"' : '', ' class="input_check" />
|
Chris@76
|
1455 </dd>';
|
Chris@76
|
1456
|
Chris@76
|
1457 }
|
Chris@76
|
1458
|
Chris@76
|
1459 // Template for showing theme settings. Note: template_options() actually adds the theme specific options.
|
Chris@76
|
1460 function template_profile_theme_settings()
|
Chris@76
|
1461 {
|
Chris@76
|
1462 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
1463
|
Chris@76
|
1464 echo '
|
Chris@76
|
1465 <dd></dd>
|
Chris@76
|
1466 </dl>
|
Chris@76
|
1467 <ul id="theme_settings">
|
Chris@76
|
1468 <li>
|
Chris@76
|
1469 <input type="hidden" name="default_options[show_board_desc]" value="0" />
|
Chris@76
|
1470 <label for="show_board_desc"><input type="checkbox" name="default_options[show_board_desc]" id="show_board_desc" value="1"', !empty($context['member']['options']['show_board_desc']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['board_desc_inside'], '</label>
|
Chris@76
|
1471 </li>
|
Chris@76
|
1472 <li>
|
Chris@76
|
1473 <input type="hidden" name="default_options[show_children]" value="0" />
|
Chris@76
|
1474 <label for="show_children"><input type="checkbox" name="default_options[show_children]" id="show_children" value="1"', !empty($context['member']['options']['show_children']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['show_children'], '</label>
|
Chris@76
|
1475 </li>
|
Chris@76
|
1476 <li>
|
Chris@76
|
1477 <input type="hidden" name="default_options[use_sidebar_menu]" value="0" />
|
Chris@76
|
1478 <label for="use_sidebar_menu"><input type="checkbox" name="default_options[use_sidebar_menu]" id="use_sidebar_menu" value="1"', !empty($context['member']['options']['use_sidebar_menu']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['use_sidebar_menu'], '</label>
|
Chris@76
|
1479 </li>
|
Chris@76
|
1480 <li>
|
Chris@76
|
1481 <input type="hidden" name="default_options[show_no_avatars]" value="0" />
|
Chris@76
|
1482 <label for="show_no_avatars"><input type="checkbox" name="default_options[show_no_avatars]" id="show_no_avatars" value="1"', !empty($context['member']['options']['show_no_avatars']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['show_no_avatars'], '</label>
|
Chris@76
|
1483 </li>
|
Chris@76
|
1484 <li>
|
Chris@76
|
1485 <input type="hidden" name="default_options[show_no_signatures]" value="0" />
|
Chris@76
|
1486 <label for="show_no_signatures"><input type="checkbox" name="default_options[show_no_signatures]" id="show_no_signatures" value="1"', !empty($context['member']['options']['show_no_signatures']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['show_no_signatures'], '</label>
|
Chris@76
|
1487 </li>';
|
Chris@76
|
1488
|
Chris@76
|
1489 if ($settings['allow_no_censored'])
|
Chris@76
|
1490 echo '
|
Chris@76
|
1491 <li>
|
Chris@76
|
1492 <input type="hidden" name="default_options[show_no_censored]" value="0" />
|
Chris@76
|
1493 <label for="show_no_censored"><input type="checkbox" name="default_options[show_no_censored]" id="show_no_censored" value="1"' . (!empty($context['member']['options']['show_no_censored']) ? ' checked="checked"' : '') . ' class="input_check" /> ' . $txt['show_no_censored'] . '</label>
|
Chris@76
|
1494 </li>';
|
Chris@76
|
1495
|
Chris@76
|
1496 echo '
|
Chris@76
|
1497 <li>
|
Chris@76
|
1498 <input type="hidden" name="default_options[return_to_post]" value="0" />
|
Chris@76
|
1499 <label for="return_to_post"><input type="checkbox" name="default_options[return_to_post]" id="return_to_post" value="1"', !empty($context['member']['options']['return_to_post']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['return_to_post'], '</label>
|
Chris@76
|
1500 </li>
|
Chris@76
|
1501 <li>
|
Chris@76
|
1502 <input type="hidden" name="default_options[no_new_reply_warning]" value="0" />
|
Chris@76
|
1503 <label for="no_new_reply_warning"><input type="checkbox" name="default_options[no_new_reply_warning]" id="no_new_reply_warning" value="1"', !empty($context['member']['options']['no_new_reply_warning']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['no_new_reply_warning'], '</label>
|
Chris@76
|
1504 </li>';
|
Chris@76
|
1505
|
Chris@76
|
1506 if (!empty($modSettings['enable_buddylist']))
|
Chris@76
|
1507 echo '
|
Chris@76
|
1508 <li>
|
Chris@76
|
1509 <input type="hidden" name="default_options[posts_apply_ignore_list]" value="0" />
|
Chris@76
|
1510 <label for="posts_apply_ignore_list"><input type="checkbox" name="default_options[posts_apply_ignore_list]" id="posts_apply_ignore_list" value="1"', !empty($context['member']['options']['posts_apply_ignore_list']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['posts_apply_ignore_list'], '</label>
|
Chris@76
|
1511 </li>';
|
Chris@76
|
1512
|
Chris@76
|
1513 echo '
|
Chris@76
|
1514 <li>
|
Chris@76
|
1515 <input type="hidden" name="default_options[view_newest_first]" value="0" />
|
Chris@76
|
1516 <label for="view_newest_first"><input type="checkbox" name="default_options[view_newest_first]" id="view_newest_first" value="1"', !empty($context['member']['options']['view_newest_first']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['recent_posts_at_top'], '</label>
|
Chris@76
|
1517 </li>';
|
Chris@76
|
1518
|
Chris@76
|
1519 // Choose WYSIWYG settings?
|
Chris@76
|
1520 if (empty($modSettings['disable_wysiwyg']))
|
Chris@76
|
1521 echo '
|
Chris@76
|
1522 <li>
|
Chris@76
|
1523 <input type="hidden" name="default_options[wysiwyg_default]" value="0" />
|
Chris@76
|
1524 <label for="wysiwyg_default"><input type="checkbox" name="default_options[wysiwyg_default]" id="wysiwyg_default" value="1"', !empty($context['member']['options']['wysiwyg_default']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['wysiwyg_default'], '</label>
|
Chris@76
|
1525 </li>';
|
Chris@76
|
1526
|
Chris@76
|
1527 if (empty($modSettings['disableCustomPerPage']))
|
Chris@76
|
1528 {
|
Chris@76
|
1529 echo '
|
Chris@76
|
1530 <li>
|
Chris@76
|
1531 <label for="topics_per_page">', $txt['topics_per_page'], '</label>
|
Chris@76
|
1532 <select name="default_options[topics_per_page]" id="topics_per_page">
|
Chris@76
|
1533 <option value="0"', empty($context['member']['options']['topics_per_page']) ? ' selected="selected"' : '', '>', $txt['per_page_default'], ' (', $modSettings['defaultMaxTopics'], ')</option>
|
Chris@76
|
1534 <option value="5"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 5 ? ' selected="selected"' : '', '>5</option>
|
Chris@76
|
1535 <option value="10"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 10 ? ' selected="selected"' : '', '>10</option>
|
Chris@76
|
1536 <option value="25"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 25 ? ' selected="selected"' : '', '>25</option>
|
Chris@76
|
1537 <option value="50"', !empty($context['member']['options']['topics_per_page']) && $context['member']['options']['topics_per_page'] == 50 ? ' selected="selected"' : '', '>50</option>
|
Chris@76
|
1538 </select>
|
Chris@76
|
1539 </li>
|
Chris@76
|
1540 <li>
|
Chris@76
|
1541 <label for="messages_per_page">', $txt['messages_per_page'], '</label>
|
Chris@76
|
1542 <select name="default_options[messages_per_page]" id="messages_per_page">
|
Chris@76
|
1543 <option value="0"', empty($context['member']['options']['messages_per_page']) ? ' selected="selected"' : '', '>', $txt['per_page_default'], ' (', $modSettings['defaultMaxMessages'], ')</option>
|
Chris@76
|
1544 <option value="5"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 5 ? ' selected="selected"' : '', '>5</option>
|
Chris@76
|
1545 <option value="10"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 10 ? ' selected="selected"' : '', '>10</option>
|
Chris@76
|
1546 <option value="25"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 25 ? ' selected="selected"' : '', '>25</option>
|
Chris@76
|
1547 <option value="50"', !empty($context['member']['options']['messages_per_page']) && $context['member']['options']['messages_per_page'] == 50 ? ' selected="selected"' : '', '>50</option>
|
Chris@76
|
1548 </select>
|
Chris@76
|
1549 </li>';
|
Chris@76
|
1550 }
|
Chris@76
|
1551
|
Chris@76
|
1552 if (!empty($modSettings['cal_enabled']))
|
Chris@76
|
1553 echo '
|
Chris@76
|
1554 <li>
|
Chris@76
|
1555 <label for="calendar_start_day">', $txt['calendar_start_day'], ':</label>
|
Chris@76
|
1556 <select name="default_options[calendar_start_day]" id="calendar_start_day">
|
Chris@76
|
1557 <option value="0"', empty($context['member']['options']['calendar_start_day']) ? ' selected="selected"' : '', '>', $txt['days'][0], '</option>
|
Chris@76
|
1558 <option value="1"', !empty($context['member']['options']['calendar_start_day']) && $context['member']['options']['calendar_start_day'] == 1 ? ' selected="selected"' : '', '>', $txt['days'][1], '</option>
|
Chris@76
|
1559 <option value="6"', !empty($context['member']['options']['calendar_start_day']) && $context['member']['options']['calendar_start_day'] == 6 ? ' selected="selected"' : '', '>', $txt['days'][6], '</option>
|
Chris@76
|
1560 </select>
|
Chris@76
|
1561 </li>';
|
Chris@76
|
1562
|
Chris@76
|
1563 echo '
|
Chris@76
|
1564 <li>
|
Chris@76
|
1565 <label for="display_quick_reply">', $txt['display_quick_reply'], '</label>
|
Chris@76
|
1566 <select name="default_options[display_quick_reply]" id="display_quick_reply">
|
Chris@76
|
1567 <option value="0"', empty($context['member']['options']['display_quick_reply']) ? ' selected="selected"' : '', '>', $txt['display_quick_reply1'], '</option>
|
Chris@76
|
1568 <option value="1"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 1 ? ' selected="selected"' : '', '>', $txt['display_quick_reply2'], '</option>
|
Chris@76
|
1569 <option value="2"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 2 ? ' selected="selected"' : '', '>', $txt['display_quick_reply3'], '</option>
|
Chris@76
|
1570 </select>
|
Chris@76
|
1571 </li>
|
Chris@76
|
1572 <li>
|
Chris@76
|
1573 <label for="display_quick_mod">', $txt['display_quick_mod'], '</label>
|
Chris@76
|
1574 <select name="default_options[display_quick_mod]" id="display_quick_mod">
|
Chris@76
|
1575 <option value="0"', empty($context['member']['options']['display_quick_mod']) ? ' selected="selected"' : '', '>', $txt['display_quick_mod_none'], '</option>
|
Chris@76
|
1576 <option value="1"', !empty($context['member']['options']['display_quick_mod']) && $context['member']['options']['display_quick_mod'] == 1 ? ' selected="selected"' : '', '>', $txt['display_quick_mod_check'], '</option>
|
Chris@76
|
1577 <option value="2"', !empty($context['member']['options']['display_quick_mod']) && $context['member']['options']['display_quick_mod'] != 1 ? ' selected="selected"' : '', '>', $txt['display_quick_mod_image'], '</option>
|
Chris@76
|
1578 </select>
|
Chris@76
|
1579 </li>
|
Chris@76
|
1580 </ul>
|
Chris@76
|
1581 <dl>
|
Chris@76
|
1582 <dd></dd>';
|
Chris@76
|
1583 }
|
Chris@76
|
1584
|
Chris@76
|
1585 function template_notification()
|
Chris@76
|
1586 {
|
Chris@76
|
1587 global $context, $settings, $options, $txt, $scripturl, $modSettings;
|
Chris@76
|
1588
|
Chris@76
|
1589 // The main containing header.
|
Chris@76
|
1590 echo '
|
Chris@76
|
1591 <div class="cat_bar">
|
Chris@76
|
1592 <h3 class="catbg">
|
Chris@76
|
1593 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['profile'], '</span>
|
Chris@76
|
1594 </h3>
|
Chris@76
|
1595 </div>
|
Chris@76
|
1596 <p class="windowbg description">', $txt['notification_info'], '</p>
|
Chris@76
|
1597 <div class="windowbg2">
|
Chris@76
|
1598 <span class="topslice"><span></span></span>
|
Chris@76
|
1599 <div class="content">
|
Chris@76
|
1600 <form action="', $scripturl, '?action=profile;area=notification;save" method="post" accept-charset="', $context['character_set'], '" id="notify_options" class="flow_hidden">';
|
Chris@76
|
1601
|
Chris@76
|
1602 // Allow notification on announcements to be disabled?
|
Chris@76
|
1603 if (!empty($modSettings['allow_disableAnnounce']))
|
Chris@76
|
1604 echo '
|
Chris@76
|
1605 <input type="hidden" name="notify_announcements" value="0" />
|
Chris@76
|
1606 <label for="notify_announcements"><input type="checkbox" id="notify_announcements" name="notify_announcements"', !empty($context['member']['notify_announcements']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['notify_important_email'], '</label><br />';
|
Chris@76
|
1607
|
Chris@76
|
1608 // More notification options.
|
Chris@76
|
1609 echo '
|
Chris@76
|
1610 <input type="hidden" name="default_options[auto_notify]" value="0" />
|
Chris@76
|
1611 <label for="auto_notify"><input type="checkbox" id="auto_notify" name="default_options[auto_notify]" value="1"', !empty($context['member']['options']['auto_notify']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['auto_notify'], '</label><br />';
|
Chris@76
|
1612
|
Chris@76
|
1613 if (empty($modSettings['disallow_sendBody']))
|
Chris@76
|
1614 echo '
|
Chris@76
|
1615 <input type="hidden" name="notify_send_body" value="0" />
|
Chris@76
|
1616 <label for="notify_send_body"><input type="checkbox" id="notify_send_body" name="notify_send_body"', !empty($context['member']['notify_send_body']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['notify_send_body'], '</label><br />';
|
Chris@76
|
1617
|
Chris@76
|
1618 echo '
|
Chris@76
|
1619 <br />
|
Chris@76
|
1620 <label for="notify_regularity">', $txt['notify_regularity'], ':</label>
|
Chris@76
|
1621 <select name="notify_regularity" id="notify_regularity">
|
Chris@76
|
1622 <option value="0"', $context['member']['notify_regularity'] == 0 ? ' selected="selected"' : '', '>', $txt['notify_regularity_instant'], '</option>
|
Chris@76
|
1623 <option value="1"', $context['member']['notify_regularity'] == 1 ? ' selected="selected"' : '', '>', $txt['notify_regularity_first_only'], '</option>
|
Chris@76
|
1624 <option value="2"', $context['member']['notify_regularity'] == 2 ? ' selected="selected"' : '', '>', $txt['notify_regularity_daily'], '</option>
|
Chris@76
|
1625 <option value="3"', $context['member']['notify_regularity'] == 3 ? ' selected="selected"' : '', '>', $txt['notify_regularity_weekly'], '</option>
|
Chris@76
|
1626 </select>
|
Chris@76
|
1627 <br /><br />
|
Chris@76
|
1628 <label for="notify_types">', $txt['notify_send_types'], ':</label>
|
Chris@76
|
1629 <select name="notify_types" id="notify_types">
|
Chris@76
|
1630 <option value="1"', $context['member']['notify_types'] == 1 ? ' selected="selected"' : '', '>', $txt['notify_send_type_everything'], '</option>
|
Chris@76
|
1631 <option value="2"', $context['member']['notify_types'] == 2 ? ' selected="selected"' : '', '>', $txt['notify_send_type_everything_own'], '</option>
|
Chris@76
|
1632 <option value="3"', $context['member']['notify_types'] == 3 ? ' selected="selected"' : '', '>', $txt['notify_send_type_only_replies'], '</option>
|
Chris@76
|
1633 <option value="4"', $context['member']['notify_types'] == 4 ? ' selected="selected"' : '', '>', $txt['notify_send_type_nothing'], '</option>
|
Chris@76
|
1634 </select><br class="clear" />
|
Chris@76
|
1635
|
Chris@76
|
1636 <div>
|
Chris@76
|
1637 <input id="notify_submit" type="submit" value="', $txt['notify_save'], '" class="button_submit floatright" />
|
Chris@76
|
1638 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
|
Chris@76
|
1639 <input type="hidden" name="u" value="', $context['id_member'], '" />
|
Chris@76
|
1640 <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
|
Chris@76
|
1641 </div><br class="clear" />
|
Chris@76
|
1642 </form>
|
Chris@76
|
1643 </div>
|
Chris@76
|
1644 <span class="botslice"><span></span></span>
|
Chris@76
|
1645 </div>
|
Chris@76
|
1646 <br />';
|
Chris@76
|
1647
|
Chris@76
|
1648 template_show_list('topic_notification_list');
|
Chris@76
|
1649
|
Chris@76
|
1650 echo '
|
Chris@76
|
1651 <br />';
|
Chris@76
|
1652
|
Chris@76
|
1653 template_show_list('board_notification_list');
|
Chris@76
|
1654 }
|
Chris@76
|
1655
|
Chris@76
|
1656 // Template for choosing group membership.
|
Chris@76
|
1657 function template_groupMembership()
|
Chris@76
|
1658 {
|
Chris@76
|
1659 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
1660
|
Chris@76
|
1661 // The main containing header.
|
Chris@76
|
1662 echo '
|
Chris@76
|
1663 <form action="', $scripturl, '?action=profile;area=groupmembership;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
|
Chris@76
|
1664 <div class="cat_bar">
|
Chris@76
|
1665 <h3 class="catbg">
|
Chris@76
|
1666 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['profile'], '</span>
|
Chris@76
|
1667 </h3>
|
Chris@76
|
1668 </div>
|
Chris@76
|
1669 <p class="description">', $txt['groupMembership_info'], '</p>';
|
Chris@76
|
1670
|
Chris@76
|
1671 // Do we have an update message?
|
Chris@76
|
1672 if (!empty($context['update_message']))
|
Chris@76
|
1673 echo '
|
Chris@76
|
1674 <div id="profile_success">
|
Chris@76
|
1675 ', $context['update_message'], '.
|
Chris@76
|
1676 </div>';
|
Chris@76
|
1677
|
Chris@76
|
1678 // Requesting membership to a group?
|
Chris@76
|
1679 if (!empty($context['group_request']))
|
Chris@76
|
1680 {
|
Chris@76
|
1681 echo '
|
Chris@76
|
1682 <div class="groupmembership">
|
Chris@76
|
1683 <div class="cat_bar">
|
Chris@76
|
1684 <h3 class="catbg">', $txt['request_group_membership'], '</h3>
|
Chris@76
|
1685 </div>
|
Chris@76
|
1686 <span class="upperframe"><span></span></span>
|
Chris@76
|
1687 <div class="roundframe"><div class="innerframe">
|
Chris@76
|
1688 ', $txt['request_group_membership_desc'], ':
|
Chris@76
|
1689 <textarea name="reason" rows="4" style="' . ($context['browser']['is_ie8'] ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';"></textarea>
|
Chris@76
|
1690 <div class="righttext" style="margin: 0.5em 0.5% 0 0.5%;">
|
Chris@76
|
1691 <input type="hidden" name="gid" value="', $context['group_request']['id'], '" />
|
Chris@76
|
1692 <input type="submit" name="req" value="', $txt['submit_request'], '" class="button_submit" />
|
Chris@76
|
1693 </div>
|
Chris@76
|
1694 </div></div>
|
Chris@76
|
1695 <span class="lowerframe"><span></span></span>
|
Chris@76
|
1696 </div>';
|
Chris@76
|
1697 }
|
Chris@76
|
1698 else
|
Chris@76
|
1699 {
|
Chris@76
|
1700 echo '
|
Chris@76
|
1701 <table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_grid">
|
Chris@76
|
1702 <thead>
|
Chris@76
|
1703 <tr class="catbg">
|
Chris@76
|
1704 <th class="first_th" scope="col" ', $context['can_edit_primary'] ? ' colspan="2"' : '', '>', $txt['current_membergroups'], '</th>
|
Chris@76
|
1705 <th class="last_th" scope="col"></th>
|
Chris@76
|
1706 </tr>
|
Chris@76
|
1707 </thead>
|
Chris@76
|
1708 <tbody>';
|
Chris@76
|
1709
|
Chris@76
|
1710 $alternate = true;
|
Chris@76
|
1711 foreach ($context['groups']['member'] as $group)
|
Chris@76
|
1712 {
|
Chris@76
|
1713 echo '
|
Chris@76
|
1714 <tr class="', $alternate ? 'windowbg' : 'windowbg2', '" id="primdiv_', $group['id'], '">';
|
Chris@76
|
1715
|
Chris@76
|
1716 if ($context['can_edit_primary'])
|
Chris@76
|
1717 echo '
|
Chris@76
|
1718 <td width="4%">
|
Chris@76
|
1719 <input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '" ', $group['is_primary'] ? 'checked="checked"' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');" ', $group['can_be_primary'] ? '' : 'disabled="disabled"', ' class="input_radio" />
|
Chris@76
|
1720 </td>';
|
Chris@76
|
1721
|
Chris@76
|
1722 echo '
|
Chris@76
|
1723 <td>
|
Chris@76
|
1724 <label for="primary_', $group['id'], '"><strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br /><span class="smalltext">' . $group['desc'] . '</span>' : ''), '</label>
|
Chris@76
|
1725 </td>
|
Chris@76
|
1726 <td width="15%" class="righttext">';
|
Chris@76
|
1727
|
Chris@76
|
1728 // Can they leave their group?
|
Chris@76
|
1729 if ($group['can_leave'])
|
Chris@76
|
1730 echo '
|
Chris@76
|
1731 <a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . '">' . $txt['leave_group'] . '</a>';
|
Chris@76
|
1732 echo '
|
Chris@76
|
1733 </td>
|
Chris@76
|
1734 </tr>';
|
Chris@76
|
1735 $alternate = !$alternate;
|
Chris@76
|
1736 }
|
Chris@76
|
1737
|
Chris@76
|
1738 echo '
|
Chris@76
|
1739 </tbody>
|
Chris@76
|
1740 </table>';
|
Chris@76
|
1741
|
Chris@76
|
1742 if ($context['can_edit_primary'])
|
Chris@76
|
1743 echo '
|
Chris@76
|
1744 <div class="padding righttext">
|
Chris@76
|
1745 <input type="submit" value="', $txt['make_primary'], '" class="button_submit" />
|
Chris@76
|
1746 </div>';
|
Chris@76
|
1747
|
Chris@76
|
1748 // Any groups they can join?
|
Chris@76
|
1749 if (!empty($context['groups']['available']))
|
Chris@76
|
1750 {
|
Chris@76
|
1751 echo '
|
Chris@76
|
1752 <br />
|
Chris@76
|
1753 <table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_grid">
|
Chris@76
|
1754 <thead>
|
Chris@76
|
1755 <tr class="catbg">
|
Chris@76
|
1756 <th class="first_th" scope="col">
|
Chris@76
|
1757 ', $txt['available_groups'], '
|
Chris@76
|
1758 </th>
|
Chris@76
|
1759 <th class="last_th" scope="col"></th>
|
Chris@76
|
1760 </tr>
|
Chris@76
|
1761 </thead>
|
Chris@76
|
1762 <tbody>';
|
Chris@76
|
1763
|
Chris@76
|
1764 $alternate = true;
|
Chris@76
|
1765 foreach ($context['groups']['available'] as $group)
|
Chris@76
|
1766 {
|
Chris@76
|
1767 echo '
|
Chris@76
|
1768 <tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
|
Chris@76
|
1769 <td>
|
Chris@76
|
1770 <strong>', (empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>'), '</strong>', (!empty($group['desc']) ? '<br /><span class="smalltext">' . $group['desc'] . '</span>' : ''), '
|
Chris@76
|
1771 </td>
|
Chris@76
|
1772 <td width="15%" class="lefttext">';
|
Chris@76
|
1773
|
Chris@76
|
1774 if ($group['type'] == 3)
|
Chris@76
|
1775 echo '
|
Chris@76
|
1776 <a href="', $scripturl, '?action=profile;save;u=', $context['id_member'], ';area=groupmembership;', $context['session_var'], '=', $context['session_id'], ';gid=', $group['id'], '">', $txt['join_group'], '</a>';
|
Chris@76
|
1777 elseif ($group['type'] == 2 && $group['pending'])
|
Chris@76
|
1778 echo '
|
Chris@76
|
1779 ', $txt['approval_pending'];
|
Chris@76
|
1780 elseif ($group['type'] == 2)
|
Chris@76
|
1781 echo '
|
Chris@76
|
1782 <a href="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=groupmembership;request=', $group['id'], '">', $txt['request_group'], '</a>';
|
Chris@76
|
1783
|
Chris@76
|
1784 echo '
|
Chris@76
|
1785 </td>
|
Chris@76
|
1786 </tr>';
|
Chris@76
|
1787 $alternate = !$alternate;
|
Chris@76
|
1788 }
|
Chris@76
|
1789 echo '
|
Chris@76
|
1790 </tbody>
|
Chris@76
|
1791 </table>';
|
Chris@76
|
1792 }
|
Chris@76
|
1793
|
Chris@76
|
1794 // Javascript for the selector stuff.
|
Chris@76
|
1795 echo '
|
Chris@76
|
1796 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
1797 var prevClass = "";
|
Chris@76
|
1798 var prevDiv = "";
|
Chris@76
|
1799 function highlightSelected(box)
|
Chris@76
|
1800 {
|
Chris@76
|
1801 if (prevClass != "")
|
Chris@76
|
1802 {
|
Chris@76
|
1803 prevDiv.className = prevClass;
|
Chris@76
|
1804 }
|
Chris@76
|
1805 prevDiv = document.getElementById(box);
|
Chris@76
|
1806 prevClass = prevDiv.className;
|
Chris@76
|
1807
|
Chris@76
|
1808 prevDiv.className = "highlight2";
|
Chris@76
|
1809 }';
|
Chris@76
|
1810 if (isset($context['groups']['member'][$context['primary_group']]))
|
Chris@76
|
1811 echo '
|
Chris@76
|
1812 highlightSelected("primdiv_' . $context['primary_group'] . '");';
|
Chris@76
|
1813 echo '
|
Chris@76
|
1814 // ]]></script>';
|
Chris@76
|
1815 }
|
Chris@76
|
1816
|
Chris@76
|
1817 echo '
|
Chris@76
|
1818 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
|
Chris@76
|
1819 <input type="hidden" name="u" value="', $context['id_member'], '" />
|
Chris@76
|
1820 </form>';
|
Chris@76
|
1821 }
|
Chris@76
|
1822
|
Chris@76
|
1823 function template_ignoreboards()
|
Chris@76
|
1824 {
|
Chris@76
|
1825 global $context, $txt, $settings, $scripturl;
|
Chris@76
|
1826 // The main containing header.
|
Chris@76
|
1827 echo '
|
Chris@76
|
1828 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
1829 function selectBoards(ids)
|
Chris@76
|
1830 {
|
Chris@76
|
1831 var toggle = true;
|
Chris@76
|
1832
|
Chris@76
|
1833 for (i = 0; i < ids.length; i++)
|
Chris@76
|
1834 toggle = toggle & document.forms.creator["ignore_brd" + ids[i]].checked;
|
Chris@76
|
1835
|
Chris@76
|
1836 for (i = 0; i < ids.length; i++)
|
Chris@76
|
1837 document.forms.creator["ignore_brd" + ids[i]].checked = !toggle;
|
Chris@76
|
1838 }
|
Chris@76
|
1839 // ]]></script>
|
Chris@76
|
1840
|
Chris@76
|
1841 <form action="', $scripturl, '?action=profile;area=ignoreboards;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
|
Chris@76
|
1842 <div class="cat_bar">
|
Chris@76
|
1843 <h3 class="catbg">
|
Chris@76
|
1844 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['profile'], '</span>
|
Chris@76
|
1845 </h3>
|
Chris@76
|
1846 </div>
|
Chris@76
|
1847 <p class="description">', $txt['ignoreboards_info'], '</p>
|
Chris@76
|
1848 <div class="windowbg2">
|
Chris@76
|
1849 <span class="topslice"><span></span></span>
|
Chris@76
|
1850 <div class="content flow_hidden">
|
Chris@76
|
1851 <ul class="ignoreboards floatleft">';
|
Chris@76
|
1852
|
Chris@76
|
1853 $i = 0;
|
Chris@76
|
1854 $limit = ceil($context['num_boards'] / 2);
|
Chris@76
|
1855 foreach ($context['categories'] as $category)
|
Chris@76
|
1856 {
|
Chris@76
|
1857 if ($i == $limit)
|
Chris@76
|
1858 {
|
Chris@76
|
1859 echo '
|
Chris@76
|
1860 </ul>
|
Chris@76
|
1861 <ul class="ignoreboards floatright">';
|
Chris@76
|
1862
|
Chris@76
|
1863 $i++;
|
Chris@76
|
1864 }
|
Chris@76
|
1865
|
Chris@76
|
1866 echo '
|
Chris@76
|
1867 <li class="category">
|
Chris@76
|
1868 <a href="javascript:void(0);" onclick="selectBoards([', implode(', ', $category['child_ids']), ']); return false;">', $category['name'], '</a>
|
Chris@76
|
1869 <ul>';
|
Chris@76
|
1870
|
Chris@76
|
1871 foreach ($category['boards'] as $board)
|
Chris@76
|
1872 {
|
Chris@76
|
1873 if ($i == $limit)
|
Chris@76
|
1874 echo '
|
Chris@76
|
1875 </ul>
|
Chris@76
|
1876 </li>
|
Chris@76
|
1877 </ul>
|
Chris@76
|
1878 <ul class="ignoreboards floatright">
|
Chris@76
|
1879 <li class="category">
|
Chris@76
|
1880 <ul>';
|
Chris@76
|
1881
|
Chris@76
|
1882 echo '
|
Chris@76
|
1883 <li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
|
Chris@76
|
1884 <label for="ignore_brd', $board['id'], '"><input type="checkbox" id="ignore_brd', $board['id'], '" name="ignore_brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked="checked"' : '', ' class="input_check" /> ', $board['name'], '</label>
|
Chris@76
|
1885 </li>';
|
Chris@76
|
1886
|
Chris@76
|
1887 $i++;
|
Chris@76
|
1888 }
|
Chris@76
|
1889
|
Chris@76
|
1890 echo '
|
Chris@76
|
1891 </ul>
|
Chris@76
|
1892 </li>';
|
Chris@76
|
1893 }
|
Chris@76
|
1894
|
Chris@76
|
1895 echo '
|
Chris@76
|
1896 </ul>
|
Chris@76
|
1897 <br class="clear" />';
|
Chris@76
|
1898
|
Chris@76
|
1899 // Show the standard "Save Settings" profile button.
|
Chris@76
|
1900 template_profile_save();
|
Chris@76
|
1901
|
Chris@76
|
1902 echo '
|
Chris@76
|
1903 </div>
|
Chris@76
|
1904 <span class="botslice"><span></span></span>
|
Chris@76
|
1905 </div>
|
Chris@76
|
1906 </form>
|
Chris@76
|
1907 <br />';
|
Chris@76
|
1908 }
|
Chris@76
|
1909
|
Chris@76
|
1910 // Simple load some theme variables common to several warning templates.
|
Chris@76
|
1911 function template_load_warning_variables()
|
Chris@76
|
1912 {
|
Chris@76
|
1913 global $modSettings, $context;
|
Chris@76
|
1914
|
Chris@76
|
1915 $context['warningBarWidth'] = 200;
|
Chris@76
|
1916 // Setup the colors - this is a little messy for theming.
|
Chris@76
|
1917 $context['colors'] = array(
|
Chris@76
|
1918 0 => 'green',
|
Chris@76
|
1919 $modSettings['warning_watch'] => 'darkgreen',
|
Chris@76
|
1920 $modSettings['warning_moderate'] => 'orange',
|
Chris@76
|
1921 $modSettings['warning_mute'] => 'red',
|
Chris@76
|
1922 );
|
Chris@76
|
1923
|
Chris@76
|
1924 // Work out the starting color.
|
Chris@76
|
1925 $context['current_color'] = $context['colors'][0];
|
Chris@76
|
1926 foreach ($context['colors'] as $limit => $color)
|
Chris@76
|
1927 if ($context['member']['warning'] >= $limit)
|
Chris@76
|
1928 $context['current_color'] = $color;
|
Chris@76
|
1929 }
|
Chris@76
|
1930
|
Chris@76
|
1931 // Show all warnings of a user?
|
Chris@76
|
1932 function template_viewWarning()
|
Chris@76
|
1933 {
|
Chris@76
|
1934 global $context, $txt, $scripturl, $settings;
|
Chris@76
|
1935
|
Chris@76
|
1936 template_load_warning_variables();
|
Chris@76
|
1937
|
Chris@76
|
1938 echo '
|
Chris@76
|
1939 <div class="title_bar">
|
Chris@76
|
1940 <h3 class="titlebg">
|
Chris@76
|
1941 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />
|
Chris@76
|
1942 ', sprintf($txt['profile_viewwarning_for_user'], $context['member']['name']), '
|
Chris@76
|
1943 </span>
|
Chris@76
|
1944 </h3>
|
Chris@76
|
1945 </div>
|
Chris@76
|
1946 <div class="windowbg">
|
Chris@76
|
1947 <span class="topslice"><span></span></span>
|
Chris@76
|
1948 <div class="content">
|
Chris@76
|
1949 <dl class="settings">
|
Chris@76
|
1950 <dt>
|
Chris@76
|
1951 <strong>', $txt['profile_warning_name'], ':</strong>
|
Chris@76
|
1952 </dt>
|
Chris@76
|
1953 <dd>
|
Chris@76
|
1954 ', $context['member']['name'], '
|
Chris@76
|
1955 </dd>
|
Chris@76
|
1956 <dt>
|
Chris@76
|
1957 <strong>', $txt['profile_warning_level'], ':</strong>
|
Chris@76
|
1958 </dt>
|
Chris@76
|
1959 <dd>
|
Chris@76
|
1960 <div>
|
Chris@76
|
1961 <div>
|
Chris@76
|
1962 <div style="font-size: 8pt; height: 12pt; width: ', $context['warningBarWidth'], 'px; border: 1px solid black; background-color: white; padding: 1px; position: relative;">
|
Chris@76
|
1963 <div id="warning_text" style="padding-top: 1pt; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['member']['warning'], '%</div>
|
Chris@76
|
1964 <div id="warning_progress" style="width: ', $context['member']['warning'], '%; height: 12pt; z-index: 1; background-color: ', $context['current_color'], ';"> </div>
|
Chris@76
|
1965 </div>
|
Chris@76
|
1966 </div>
|
Chris@76
|
1967 </div>
|
Chris@76
|
1968 </dd>';
|
Chris@76
|
1969
|
Chris@76
|
1970 // There's some impact of this?
|
Chris@76
|
1971 if (!empty($context['level_effects'][$context['current_level']]))
|
Chris@76
|
1972 echo '
|
Chris@76
|
1973 <dt>
|
Chris@76
|
1974 <strong>', $txt['profile_viewwarning_impact'], ':</strong>
|
Chris@76
|
1975 </dt>
|
Chris@76
|
1976 <dd>
|
Chris@76
|
1977 ', $context['level_effects'][$context['current_level']], '
|
Chris@76
|
1978 </dd>';
|
Chris@76
|
1979
|
Chris@76
|
1980 echo '
|
Chris@76
|
1981 </dl>
|
Chris@76
|
1982 </div>
|
Chris@76
|
1983 <span class="botslice"><span></span></span>
|
Chris@76
|
1984 </div>';
|
Chris@76
|
1985
|
Chris@76
|
1986 template_show_list('view_warnings');
|
Chris@76
|
1987 }
|
Chris@76
|
1988
|
Chris@76
|
1989 // Show a lovely interface for issuing warnings.
|
Chris@76
|
1990 function template_issueWarning()
|
Chris@76
|
1991 {
|
Chris@76
|
1992 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
1993
|
Chris@76
|
1994 template_load_warning_variables();
|
Chris@76
|
1995
|
Chris@76
|
1996 echo '
|
Chris@76
|
1997 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
1998 function setWarningBarPos(curEvent, isMove, changeAmount)
|
Chris@76
|
1999 {
|
Chris@76
|
2000 barWidth = ', $context['warningBarWidth'], ';
|
Chris@76
|
2001
|
Chris@76
|
2002 // Are we passing the amount to change it by?
|
Chris@76
|
2003 if (changeAmount)
|
Chris@76
|
2004 {
|
Chris@76
|
2005 if (document.getElementById(\'warning_level\').value == \'SAME\')
|
Chris@76
|
2006 percent = ', $context['member']['warning'], ' + changeAmount;
|
Chris@76
|
2007 else
|
Chris@76
|
2008 percent = parseInt(document.getElementById(\'warning_level\').value) + changeAmount;
|
Chris@76
|
2009 }
|
Chris@76
|
2010 // If not then it\'s a mouse thing.
|
Chris@76
|
2011 else
|
Chris@76
|
2012 {
|
Chris@76
|
2013 if (!curEvent)
|
Chris@76
|
2014 var curEvent = window.event;
|
Chris@76
|
2015
|
Chris@76
|
2016 // If it\'s a movement check the button state first!
|
Chris@76
|
2017 if (isMove)
|
Chris@76
|
2018 {
|
Chris@76
|
2019 if (!curEvent.button || curEvent.button != 1)
|
Chris@76
|
2020 return false
|
Chris@76
|
2021 }
|
Chris@76
|
2022
|
Chris@76
|
2023 // Get the position of the container.
|
Chris@76
|
2024 contain = document.getElementById(\'warning_contain\');
|
Chris@76
|
2025 position = 0;
|
Chris@76
|
2026 while (contain != null)
|
Chris@76
|
2027 {
|
Chris@76
|
2028 position += contain.offsetLeft;
|
Chris@76
|
2029 contain = contain.offsetParent;
|
Chris@76
|
2030 }
|
Chris@76
|
2031
|
Chris@76
|
2032 // Where is the mouse?
|
Chris@76
|
2033 if (curEvent.pageX)
|
Chris@76
|
2034 {
|
Chris@76
|
2035 mouse = curEvent.pageX;
|
Chris@76
|
2036 }
|
Chris@76
|
2037 else
|
Chris@76
|
2038 {
|
Chris@76
|
2039 mouse = curEvent.clientX;
|
Chris@76
|
2040 mouse += document.documentElement.scrollLeft != "undefined" ? document.documentElement.scrollLeft : document.body.scrollLeft;
|
Chris@76
|
2041 }
|
Chris@76
|
2042
|
Chris@76
|
2043 // Is this within bounds?
|
Chris@76
|
2044 if (mouse < position || mouse > position + barWidth)
|
Chris@76
|
2045 return;
|
Chris@76
|
2046
|
Chris@76
|
2047 percent = Math.round(((mouse - position) / barWidth) * 100);
|
Chris@76
|
2048
|
Chris@76
|
2049 // Round percent to the nearest 5 - by kinda cheating!
|
Chris@76
|
2050 percent = Math.round(percent / 5) * 5;
|
Chris@76
|
2051 }
|
Chris@76
|
2052
|
Chris@76
|
2053 // What are the limits?
|
Chris@76
|
2054 minLimit = ', $context['min_allowed'], ';
|
Chris@76
|
2055 maxLimit = ', $context['max_allowed'], ';
|
Chris@76
|
2056
|
Chris@76
|
2057 percent = Math.max(percent, minLimit);
|
Chris@76
|
2058 percent = Math.min(percent, maxLimit);
|
Chris@76
|
2059
|
Chris@76
|
2060 size = barWidth * (percent/100);
|
Chris@76
|
2061
|
Chris@76
|
2062 setInnerHTML(document.getElementById(\'warning_text\'), percent + "%");
|
Chris@76
|
2063 document.getElementById(\'warning_level\').value = percent;
|
Chris@76
|
2064 document.getElementById(\'warning_progress\').style.width = size + "px";
|
Chris@76
|
2065
|
Chris@76
|
2066 // Get the right color.
|
Chris@76
|
2067 color = "black"';
|
Chris@76
|
2068
|
Chris@76
|
2069 foreach ($context['colors'] as $limit => $color)
|
Chris@76
|
2070 echo '
|
Chris@76
|
2071 if (percent >= ', $limit, ')
|
Chris@76
|
2072 color = "', $color, '";';
|
Chris@76
|
2073
|
Chris@76
|
2074 echo '
|
Chris@76
|
2075 document.getElementById(\'warning_progress\').style.backgroundColor = color;
|
Chris@76
|
2076
|
Chris@76
|
2077 // Also set the right effect.
|
Chris@76
|
2078 effectText = "";';
|
Chris@76
|
2079
|
Chris@76
|
2080 foreach ($context['level_effects'] as $limit => $text)
|
Chris@76
|
2081 echo '
|
Chris@76
|
2082 if (percent >= ', $limit, ')
|
Chris@76
|
2083 effectText = "', $text, '";';
|
Chris@76
|
2084
|
Chris@76
|
2085 echo '
|
Chris@76
|
2086 setInnerHTML(document.getElementById(\'cur_level_div\'), effectText);
|
Chris@76
|
2087 }
|
Chris@76
|
2088
|
Chris@76
|
2089 // Disable notification boxes as required.
|
Chris@76
|
2090 function modifyWarnNotify()
|
Chris@76
|
2091 {
|
Chris@76
|
2092 disable = !document.getElementById(\'warn_notify\').checked;
|
Chris@76
|
2093 document.getElementById(\'warn_sub\').disabled = disable;
|
Chris@76
|
2094 document.getElementById(\'warn_body\').disabled = disable;
|
Chris@76
|
2095 document.getElementById(\'warn_temp\').disabled = disable;
|
Chris@76
|
2096 document.getElementById(\'new_template_link\').style.display = disable ? \'none\' : \'\';
|
Chris@76
|
2097 }
|
Chris@76
|
2098
|
Chris@76
|
2099 function changeWarnLevel(amount)
|
Chris@76
|
2100 {
|
Chris@76
|
2101 setWarningBarPos(false, false, amount);
|
Chris@76
|
2102 }
|
Chris@76
|
2103
|
Chris@76
|
2104 // Warn template.
|
Chris@76
|
2105 function populateNotifyTemplate()
|
Chris@76
|
2106 {
|
Chris@76
|
2107 index = document.getElementById(\'warn_temp\').value;
|
Chris@76
|
2108 if (index == -1)
|
Chris@76
|
2109 return false;
|
Chris@76
|
2110
|
Chris@76
|
2111 // Otherwise see what we can do...';
|
Chris@76
|
2112
|
Chris@76
|
2113 foreach ($context['notification_templates'] as $k => $type)
|
Chris@76
|
2114 echo '
|
Chris@76
|
2115 if (index == ', $k, ')
|
Chris@76
|
2116 document.getElementById(\'warn_body\').value = "', strtr($type['body'], array('"' => "'", "\n" => '\\n', "\r" => '')), '";';
|
Chris@76
|
2117
|
Chris@76
|
2118 echo '
|
Chris@76
|
2119 }
|
Chris@76
|
2120
|
Chris@76
|
2121 // ]]></script>';
|
Chris@76
|
2122
|
Chris@76
|
2123 echo '
|
Chris@76
|
2124 <form action="', $scripturl, '?action=profile;u=', $context['id_member'], ';area=issuewarning" method="post" class="flow_hidden" accept-charset="', $context['character_set'], '">
|
Chris@76
|
2125 <div class="cat_bar">
|
Chris@76
|
2126 <h3 class="catbg">
|
Chris@76
|
2127 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />
|
Chris@76
|
2128 ', $context['user']['is_owner'] ? $txt['profile_warning_level'] : $txt['profile_issue_warning'], '
|
Chris@76
|
2129 </span>
|
Chris@76
|
2130 </h3>
|
Chris@76
|
2131 </div>';
|
Chris@76
|
2132
|
Chris@76
|
2133 if (!$context['user']['is_owner'])
|
Chris@76
|
2134 echo '
|
Chris@76
|
2135 <p class="description">', $txt['profile_warning_desc'], '</p>';
|
Chris@76
|
2136
|
Chris@76
|
2137 echo '
|
Chris@76
|
2138 <div class="windowbg">
|
Chris@76
|
2139 <span class="topslice"><span></span></span>
|
Chris@76
|
2140 <div class="content">
|
Chris@76
|
2141 <dl class="settings">';
|
Chris@76
|
2142
|
Chris@76
|
2143 if (!$context['user']['is_owner'])
|
Chris@76
|
2144 echo '
|
Chris@76
|
2145 <dt>
|
Chris@76
|
2146 <strong>', $txt['profile_warning_name'], ':</strong>
|
Chris@76
|
2147 </dt>
|
Chris@76
|
2148 <dd>
|
Chris@76
|
2149 <strong>', $context['member']['name'], '</strong>
|
Chris@76
|
2150 </dd>';
|
Chris@76
|
2151
|
Chris@76
|
2152 echo '
|
Chris@76
|
2153 <dt>
|
Chris@76
|
2154 <strong>', $txt['profile_warning_level'], ':</strong>';
|
Chris@76
|
2155
|
Chris@76
|
2156 // Is there only so much they can apply?
|
Chris@76
|
2157 if ($context['warning_limit'])
|
Chris@76
|
2158 echo '
|
Chris@76
|
2159 <br /><span class="smalltext">', sprintf($txt['profile_warning_limit_attribute'], $context['warning_limit']), '</span>';
|
Chris@76
|
2160
|
Chris@76
|
2161 echo '
|
Chris@76
|
2162 </dt>
|
Chris@76
|
2163 <dd>
|
Chris@76
|
2164 <div id="warndiv1" style="display: none;">
|
Chris@76
|
2165 <div>
|
Chris@76
|
2166 <span class="floatleft" style="padding: 0 0.5em"><a href="#" onclick="changeWarnLevel(-5); return false;">[-]</a></span>
|
Chris@76
|
2167 <div class="floatleft" id="warning_contain" style="font-size: 8pt; height: 12pt; width: ', $context['warningBarWidth'], 'px; border: 1px solid black; background-color: white; padding: 1px; position: relative;" onmousedown="setWarningBarPos(event, true);" onmousemove="setWarningBarPos(event, true);" onclick="setWarningBarPos(event);">
|
Chris@76
|
2168 <div id="warning_text" style="padding-top: 1pt; width: 100%; z-index: 2; color: black; position: absolute; text-align: center; font-weight: bold;">', $context['member']['warning'], '%</div>
|
Chris@76
|
2169 <div id="warning_progress" style="width: ', $context['member']['warning'], '%; height: 12pt; z-index: 1; background-color: ', $context['current_color'], ';"> </div>
|
Chris@76
|
2170 </div>
|
Chris@76
|
2171 <span class="floatleft" style="padding: 0 0.5em"><a href="#" onclick="changeWarnLevel(5); return false;">[+]</a></span>
|
Chris@76
|
2172 <div class="clear_left smalltext">', $txt['profile_warning_impact'], ': <span id="cur_level_div">', $context['level_effects'][$context['current_level']], '</span></div>
|
Chris@76
|
2173 </div>
|
Chris@76
|
2174 <input type="hidden" name="warning_level" id="warning_level" value="SAME" />
|
Chris@76
|
2175 </div>
|
Chris@76
|
2176 <div id="warndiv2">
|
Chris@76
|
2177 <input type="text" name="warning_level_nojs" size="6" maxlength="4" value="', $context['member']['warning'], '" class="input_text" /> ', $txt['profile_warning_max'], '
|
Chris@76
|
2178 <div class="smalltext">', $txt['profile_warning_impact'], ':<br />';
|
Chris@76
|
2179 // For non-javascript give a better list.
|
Chris@76
|
2180 foreach ($context['level_effects'] as $limit => $effect)
|
Chris@76
|
2181 echo '
|
Chris@76
|
2182 ', sprintf($txt['profile_warning_effect_text'], $limit, $effect), '<br />';
|
Chris@76
|
2183
|
Chris@76
|
2184 echo '
|
Chris@76
|
2185 </div>
|
Chris@76
|
2186 </div>
|
Chris@76
|
2187 </dd>';
|
Chris@76
|
2188
|
Chris@76
|
2189 if (!$context['user']['is_owner'])
|
Chris@76
|
2190 {
|
Chris@76
|
2191 echo '
|
Chris@76
|
2192 <dt>
|
Chris@76
|
2193 <strong>', $txt['profile_warning_reason'], ':</strong><br />
|
Chris@76
|
2194 <span class="smalltext">', $txt['profile_warning_reason_desc'], '</span>
|
Chris@76
|
2195 </dt>
|
Chris@76
|
2196 <dd>
|
Chris@76
|
2197 <input type="text" name="warn_reason" id="warn_reason" value="', $context['warning_data']['reason'], '" size="50" style="width: 80%;" class="input_text" />
|
Chris@76
|
2198 </dd>
|
Chris@76
|
2199 </dl>
|
Chris@76
|
2200 <hr />
|
Chris@76
|
2201 <dl class="settings">
|
Chris@76
|
2202 <dt>
|
Chris@76
|
2203 <strong>', $txt['profile_warning_notify'], ':</strong>
|
Chris@76
|
2204 </dt>
|
Chris@76
|
2205 <dd>
|
Chris@76
|
2206 <input type="checkbox" name="warn_notify" id="warn_notify" onclick="modifyWarnNotify();" ', $context['warning_data']['notify'] ? 'checked="checked"' : '', ' class="input_check" />
|
Chris@76
|
2207 </dd>
|
Chris@76
|
2208 <dt>
|
Chris@76
|
2209 <strong>', $txt['profile_warning_notify_subject'], ':</strong>
|
Chris@76
|
2210 </dt>
|
Chris@76
|
2211 <dd>
|
Chris@76
|
2212 <input type="text" name="warn_sub" id="warn_sub" value="', empty($context['warning_data']['notify_subject']) ? $txt['profile_warning_notify_template_subject'] : $context['warning_data']['notify_subject'], '" size="50" style="width: 80%;" class="input_text" />
|
Chris@76
|
2213 </dd>
|
Chris@76
|
2214 <dt>
|
Chris@76
|
2215 <strong>', $txt['profile_warning_notify_body'], ':</strong>
|
Chris@76
|
2216 </dt>
|
Chris@76
|
2217 <dd>
|
Chris@76
|
2218 <select name="warn_temp" id="warn_temp" disabled="disabled" onchange="populateNotifyTemplate();" style="font-size: x-small;">
|
Chris@76
|
2219 <option value="-1">', $txt['profile_warning_notify_template'], '</option>
|
Chris@76
|
2220 <option value="-1">------------------------------</option>';
|
Chris@76
|
2221
|
Chris@76
|
2222 foreach ($context['notification_templates'] as $id_template => $template)
|
Chris@76
|
2223 echo '
|
Chris@76
|
2224 <option value="', $id_template, '">', $template['title'], '</option>';
|
Chris@76
|
2225
|
Chris@76
|
2226 echo '
|
Chris@76
|
2227 </select>
|
Chris@76
|
2228 <span class="smalltext" id="new_template_link" style="display: none;">[<a href="', $scripturl, '?action=moderate;area=warnings;sa=templateedit;tid=0" target="_blank" class="new_win">', $txt['profile_warning_new_template'], '</a>]</span><br />
|
Chris@76
|
2229 <textarea name="warn_body" id="warn_body" cols="40" rows="8">', $context['warning_data']['notify_body'], '</textarea>
|
Chris@76
|
2230 </dd>';
|
Chris@76
|
2231 }
|
Chris@76
|
2232 echo '
|
Chris@76
|
2233 </dl>
|
Chris@76
|
2234 <div class="righttext">
|
Chris@76
|
2235 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
|
Chris@76
|
2236 <input type="submit" name="save" value="', $context['user']['is_owner'] ? $txt['change_profile'] : $txt['profile_warning_issue'], '" class="button_submit" />
|
Chris@76
|
2237 </div>
|
Chris@76
|
2238 </div>
|
Chris@76
|
2239 <span class="botslice"><span></span></span>
|
Chris@76
|
2240 </div>
|
Chris@76
|
2241 </form>';
|
Chris@76
|
2242
|
Chris@76
|
2243 // Previous warnings?
|
Chris@76
|
2244 echo '<br />
|
Chris@76
|
2245 <div class="cat_bar">
|
Chris@76
|
2246 <h3 class="catbg">
|
Chris@76
|
2247 ', $txt['profile_warning_previous'], '
|
Chris@76
|
2248 </h3>
|
Chris@76
|
2249 </div>
|
Chris@76
|
2250 <table border="0" width="100%" cellspacing="0" cellpadding="5" class="table_grid">
|
Chris@76
|
2251 <thead>
|
Chris@76
|
2252 <tr class="titlebg lefttext">
|
Chris@76
|
2253 <th class="first_th" scope="col" width="20%">', $txt['profile_warning_previous_issued'], '</th>
|
Chris@76
|
2254 <th scope="col" width="30%">', $txt['profile_warning_previous_time'], '</th>
|
Chris@76
|
2255 <th scope="col">', $txt['profile_warning_previous_reason'], '</th>
|
Chris@76
|
2256 <th class="last_th" scope="col" width="6%">', $txt['profile_warning_previous_level'], '</th>
|
Chris@76
|
2257 </tr>
|
Chris@76
|
2258 </thead>
|
Chris@76
|
2259 <tbody>';
|
Chris@76
|
2260
|
Chris@76
|
2261 // Print the warnings.
|
Chris@76
|
2262 $alternate = 0;
|
Chris@76
|
2263 foreach ($context['previous_warnings'] as $warning)
|
Chris@76
|
2264 {
|
Chris@76
|
2265 $alternate = !$alternate;
|
Chris@76
|
2266 echo '
|
Chris@76
|
2267 <tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
|
Chris@76
|
2268 <td class="smalltext">', $warning['issuer']['link'], '</td>
|
Chris@76
|
2269 <td class="smalltext">', $warning['time'], '</td>
|
Chris@76
|
2270 <td class="smalltext">
|
Chris@76
|
2271 <div class="floatleft">
|
Chris@76
|
2272 ', $warning['reason'], '
|
Chris@76
|
2273 </div>';
|
Chris@76
|
2274
|
Chris@76
|
2275 if (!empty($warning['id_notice']))
|
Chris@76
|
2276 echo '
|
Chris@76
|
2277 <div class="floatright">
|
Chris@76
|
2278 <a href="', $scripturl, '?action=moderate;area=notice;nid=', $warning['id_notice'], '" onclick="window.open(this.href, \'\', \'scrollbars=yes,resizable=yes,width=400,height=250\');return false;" target="_blank" class="new_win" title="', $txt['profile_warning_previous_notice'], '"><img src="', $settings['images_url'], '/filter.gif" alt="" /></a>
|
Chris@76
|
2279 </div>';
|
Chris@76
|
2280 echo '
|
Chris@76
|
2281 </td>
|
Chris@76
|
2282 <td class="smalltext">', $warning['counter'], '</td>
|
Chris@76
|
2283 </tr>';
|
Chris@76
|
2284 }
|
Chris@76
|
2285
|
Chris@76
|
2286 if (empty($context['previous_warnings']))
|
Chris@76
|
2287 echo '
|
Chris@76
|
2288 <tr class="windowbg2">
|
Chris@76
|
2289 <td align="center" colspan="4">
|
Chris@76
|
2290 ', $txt['profile_warning_previous_none'], '
|
Chris@76
|
2291 </td>
|
Chris@76
|
2292 </tr>';
|
Chris@76
|
2293
|
Chris@76
|
2294 echo '
|
Chris@76
|
2295 </tbody>
|
Chris@76
|
2296 </table>
|
Chris@76
|
2297 <div class="pagesection">', $txt['pages'], ': ', $context['page_index'], '</div>';
|
Chris@76
|
2298
|
Chris@76
|
2299 // Do our best to get pretty javascript enabled.
|
Chris@76
|
2300 echo '
|
Chris@76
|
2301 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
2302 document.getElementById(\'warndiv1\').style.display = "";
|
Chris@76
|
2303 document.getElementById(\'warndiv2\').style.display = "none";';
|
Chris@76
|
2304
|
Chris@76
|
2305 if (!$context['user']['is_owner'])
|
Chris@76
|
2306 echo '
|
Chris@76
|
2307 modifyWarnNotify();';
|
Chris@76
|
2308
|
Chris@76
|
2309 echo '
|
Chris@76
|
2310 // ]]></script>';
|
Chris@76
|
2311 }
|
Chris@76
|
2312
|
Chris@76
|
2313 // Template to show for deleting a users account - now with added delete post capability!
|
Chris@76
|
2314 function template_deleteAccount()
|
Chris@76
|
2315 {
|
Chris@76
|
2316 global $context, $settings, $options, $scripturl, $txt, $scripturl;
|
Chris@76
|
2317
|
Chris@76
|
2318 // The main containing header.
|
Chris@76
|
2319 echo '
|
Chris@76
|
2320 <form action="', $scripturl, '?action=profile;area=deleteaccount;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
|
Chris@76
|
2321 <div class="title_bar">
|
Chris@76
|
2322 <h3 class="titlebg">
|
Chris@76
|
2323 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['deleteAccount'], '</span>
|
Chris@76
|
2324 </h3>
|
Chris@76
|
2325 </div>';
|
Chris@76
|
2326 // If deleting another account give them a lovely info box.
|
Chris@76
|
2327 if (!$context['user']['is_owner'])
|
Chris@76
|
2328 echo '
|
Chris@76
|
2329 <p class="windowbg2 description">', $txt['deleteAccount_desc'], '</p>';
|
Chris@76
|
2330 echo '
|
Chris@76
|
2331 <div class="windowbg2">
|
Chris@76
|
2332 <span class="topslice"><span></span></span>
|
Chris@76
|
2333 <div class="content">';
|
Chris@76
|
2334
|
Chris@76
|
2335 // If they are deleting their account AND the admin needs to approve it - give them another piece of info ;)
|
Chris@76
|
2336 if ($context['needs_approval'])
|
Chris@76
|
2337 echo '
|
Chris@76
|
2338 <div id ="profile_error" class="alert">', $txt['deleteAccount_approval'], '</div>';
|
Chris@76
|
2339
|
Chris@76
|
2340 // If the user is deleting their own account warn them first - and require a password!
|
Chris@76
|
2341 if ($context['user']['is_owner'])
|
Chris@76
|
2342 {
|
Chris@76
|
2343 echo '
|
Chris@76
|
2344 <div class="alert">', $txt['own_profile_confirm'], '</div>
|
Chris@76
|
2345 <div>
|
Chris@76
|
2346 <strong', (isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : ''), '>', $txt['current_password'], ': </strong>
|
Chris@76
|
2347 <input type="password" name="oldpasswrd" size="20" class="input_password" />
|
Chris@76
|
2348 <input type="submit" value="', $txt['yes'], '" class="button_submit" />
|
Chris@76
|
2349 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
|
Chris@76
|
2350 <input type="hidden" name="u" value="', $context['id_member'], '" />
|
Chris@76
|
2351 <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
|
Chris@76
|
2352 </div>';
|
Chris@76
|
2353 }
|
Chris@76
|
2354 // Otherwise an admin doesn't need to enter a password - but they still get a warning - plus the option to delete lovely posts!
|
Chris@76
|
2355 else
|
Chris@76
|
2356 {
|
Chris@76
|
2357 echo '
|
Chris@76
|
2358 <div class="alert">', $txt['deleteAccount_warning'], '</div>';
|
Chris@76
|
2359
|
Chris@76
|
2360 // Only actually give these options if they are kind of important.
|
Chris@76
|
2361 if ($context['can_delete_posts'])
|
Chris@76
|
2362 echo '
|
Chris@76
|
2363 <div>
|
Chris@76
|
2364 ', $txt['deleteAccount_posts'], ':
|
Chris@76
|
2365 <select name="remove_type">
|
Chris@76
|
2366 <option value="none">', $txt['deleteAccount_none'], '</option>
|
Chris@76
|
2367 <option value="posts">', $txt['deleteAccount_all_posts'], '</option>
|
Chris@76
|
2368 <option value="topics">', $txt['deleteAccount_topics'], '</option>
|
Chris@76
|
2369 </select>
|
Chris@76
|
2370 </div>';
|
Chris@76
|
2371
|
Chris@76
|
2372 echo '
|
Chris@76
|
2373 <div>
|
Chris@76
|
2374 <label for="deleteAccount"><input type="checkbox" name="deleteAccount" id="deleteAccount" value="1" class="input_check" onclick="if (this.checked) return confirm(\'', $txt['deleteAccount_confirm'], '\');" /> ', $txt['deleteAccount_member'], '.</label>
|
Chris@76
|
2375 </div>
|
Chris@76
|
2376 <div>
|
Chris@76
|
2377 <input type="submit" value="', $txt['delete'], '" class="button_submit" />
|
Chris@76
|
2378 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
|
Chris@76
|
2379 <input type="hidden" name="u" value="', $context['id_member'], '" />
|
Chris@76
|
2380 <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
|
Chris@76
|
2381 </div>';
|
Chris@76
|
2382 }
|
Chris@76
|
2383 echo '
|
Chris@76
|
2384 </div>
|
Chris@76
|
2385 <span class="botslice"><span></span></span>
|
Chris@76
|
2386 </div>
|
Chris@76
|
2387 <br />
|
Chris@76
|
2388 </form>';
|
Chris@76
|
2389 }
|
Chris@76
|
2390
|
Chris@76
|
2391 // Template for the password box/save button stuck at the bottom of every profile page.
|
Chris@76
|
2392 function template_profile_save()
|
Chris@76
|
2393 {
|
Chris@76
|
2394 global $context, $settings, $options, $txt;
|
Chris@76
|
2395
|
Chris@76
|
2396 echo '
|
Chris@76
|
2397
|
Chris@76
|
2398 <hr width="100%" size="1" class="hrcolor clear" />';
|
Chris@76
|
2399
|
Chris@76
|
2400 // Only show the password box if it's actually needed.
|
Chris@76
|
2401 if ($context['require_password'])
|
Chris@76
|
2402 echo '
|
Chris@76
|
2403 <dl>
|
Chris@76
|
2404 <dt>
|
Chris@76
|
2405 <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br />
|
Chris@76
|
2406 <span class="smalltext">', $txt['required_security_reasons'], '</span>
|
Chris@76
|
2407 </dt>
|
Chris@76
|
2408 <dd>
|
Chris@76
|
2409 <input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
|
Chris@76
|
2410 </dd>
|
Chris@76
|
2411 </dl>';
|
Chris@76
|
2412
|
Chris@76
|
2413 echo '
|
Chris@76
|
2414 <div class="righttext">
|
Chris@76
|
2415 <input type="submit" value="', $txt['change_profile'], '" class="button_submit" />
|
Chris@76
|
2416 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
|
Chris@76
|
2417 <input type="hidden" name="u" value="', $context['id_member'], '" />
|
Chris@76
|
2418 <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
|
Chris@76
|
2419 </div>';
|
Chris@76
|
2420 }
|
Chris@76
|
2421
|
Chris@76
|
2422 // Small template for showing an error message upon a save problem in the profile.
|
Chris@76
|
2423 function template_error_message()
|
Chris@76
|
2424 {
|
Chris@76
|
2425 global $context, $txt;
|
Chris@76
|
2426
|
Chris@76
|
2427 echo '
|
Chris@76
|
2428 <div class="windowbg" id="profile_error">
|
Chris@76
|
2429 <span>', !empty($context['custom_error_title']) ? $context['custom_error_title'] : $txt['profile_errors_occurred'], ':</span>
|
Chris@76
|
2430 <ul class="reset">';
|
Chris@76
|
2431
|
Chris@76
|
2432 // Cycle through each error and display an error message.
|
Chris@76
|
2433 foreach ($context['post_errors'] as $error)
|
Chris@76
|
2434 echo '
|
Chris@76
|
2435 <li>', isset($txt['profile_error_' . $error]) ? $txt['profile_error_' . $error] : $error, '.</li>';
|
Chris@76
|
2436
|
Chris@76
|
2437 echo '
|
Chris@76
|
2438 </ul>
|
Chris@76
|
2439 </div>';
|
Chris@76
|
2440 }
|
Chris@76
|
2441
|
Chris@76
|
2442 // Display a load of drop down selectors for allowing the user to change group.
|
Chris@76
|
2443 function template_profile_group_manage()
|
Chris@76
|
2444 {
|
Chris@76
|
2445 global $context, $txt, $scripturl;
|
Chris@76
|
2446
|
Chris@76
|
2447 echo '
|
Chris@76
|
2448 <dt>
|
Chris@76
|
2449 <strong>', $txt['primary_membergroup'], ': </strong><br />
|
Chris@76
|
2450 <span class="smalltext">(<a href="', $scripturl, '?action=helpadmin;help=moderator_why_missing" onclick="return reqWin(this.href);">', $txt['moderator_why_missing'], '</a>)</span>
|
Chris@76
|
2451 </dt>
|
Chris@76
|
2452 <dd>
|
Chris@76
|
2453 <select name="id_group" ', ($context['user']['is_owner'] && $context['member']['group_id'] == 1 ? 'onchange="if (this.value != 1 && !confirm(\'' . $txt['deadmin_confirm'] . '\')) this.value = 1;"' : ''), '>';
|
Chris@76
|
2454 // Fill the select box with all primary member groups that can be assigned to a member.
|
Chris@76
|
2455 foreach ($context['member_groups'] as $member_group)
|
Chris@76
|
2456 if (!empty($member_group['can_be_primary']))
|
Chris@76
|
2457 echo '
|
Chris@76
|
2458 <option value="', $member_group['id'], '"', $member_group['is_primary'] ? ' selected="selected"' : '', '>
|
Chris@76
|
2459 ', $member_group['name'], '
|
Chris@76
|
2460 </option>';
|
Chris@76
|
2461 echo '
|
Chris@76
|
2462 </select>
|
Chris@76
|
2463 </dd>
|
Chris@76
|
2464 <dt>
|
Chris@76
|
2465 <strong>', $txt['additional_membergroups'], ':</strong>
|
Chris@76
|
2466 </dt>
|
Chris@76
|
2467 <dd>
|
Chris@76
|
2468 <span id="additional_groupsList">
|
Chris@76
|
2469 <input type="hidden" name="additional_groups[]" value="0" />';
|
Chris@76
|
2470 // For each membergroup show a checkbox so members can be assigned to more than one group.
|
Chris@76
|
2471 foreach ($context['member_groups'] as $member_group)
|
Chris@76
|
2472 if ($member_group['can_be_additional'])
|
Chris@76
|
2473 echo '
|
Chris@76
|
2474 <label for="additional_groups-', $member_group['id'], '"><input type="checkbox" name="additional_groups[]" value="', $member_group['id'], '" id="additional_groups-', $member_group['id'], '"', $member_group['is_additional'] ? ' checked="checked"' : '', ' class="input_check" /> ', $member_group['name'], '</label><br />';
|
Chris@76
|
2475 echo '
|
Chris@76
|
2476 </span>
|
Chris@76
|
2477 <a href="javascript:void(0);" onclick="document.getElementById(\'additional_groupsList\').style.display = \'block\'; document.getElementById(\'additional_groupsLink\').style.display = \'none\'; return false;" id="additional_groupsLink" style="display: none;">', $txt['additional_membergroups_show'], '</a>
|
Chris@76
|
2478 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
2479 document.getElementById("additional_groupsList").style.display = "none";
|
Chris@76
|
2480 document.getElementById("additional_groupsLink").style.display = "";
|
Chris@76
|
2481 // ]]></script>
|
Chris@76
|
2482 </dd>';
|
Chris@76
|
2483
|
Chris@76
|
2484 }
|
Chris@76
|
2485
|
Chris@76
|
2486 // Callback function for entering a birthdate!
|
Chris@76
|
2487 function template_profile_birthdate()
|
Chris@76
|
2488 {
|
Chris@76
|
2489 global $txt, $context;
|
Chris@76
|
2490
|
Chris@76
|
2491 // Just show the pretty box!
|
Chris@76
|
2492 echo '
|
Chris@76
|
2493 <dt>
|
Chris@76
|
2494 <strong>', $txt['dob'], ':</strong><br />
|
Chris@76
|
2495 <span class="smalltext">', $txt['dob_year'], ' - ', $txt['dob_month'], ' - ', $txt['dob_day'], '</span>
|
Chris@76
|
2496 </dt>
|
Chris@76
|
2497 <dd>
|
Chris@76
|
2498 <input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" class="input_text" /> -
|
Chris@76
|
2499 <input type="text" name="bday1" size="2" maxlength="2" value="', $context['member']['birth_date']['month'], '" class="input_text" /> -
|
Chris@76
|
2500 <input type="text" name="bday2" size="2" maxlength="2" value="', $context['member']['birth_date']['day'], '" class="input_text" />
|
Chris@76
|
2501 </dd>';
|
Chris@76
|
2502 }
|
Chris@76
|
2503
|
Chris@76
|
2504 // Show the signature editing box?
|
Chris@76
|
2505 function template_profile_signature_modify()
|
Chris@76
|
2506 {
|
Chris@76
|
2507 global $txt, $context, $settings;
|
Chris@76
|
2508
|
Chris@76
|
2509 echo '
|
Chris@76
|
2510 <dt>
|
Chris@76
|
2511 <strong>', $txt['signature'], ':</strong><br />
|
Chris@76
|
2512 <span class="smalltext">', $txt['sig_info'], '</span><br />
|
Chris@76
|
2513 <br />';
|
Chris@76
|
2514
|
Chris@76
|
2515 if ($context['show_spellchecking'])
|
Chris@76
|
2516 echo '
|
Chris@76
|
2517 <input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'creator\', \'signature\');" class="button_submit" />';
|
Chris@76
|
2518
|
Chris@76
|
2519 echo '
|
Chris@76
|
2520 </dt>
|
Chris@76
|
2521 <dd>
|
Chris@76
|
2522 <textarea class="editor" onkeyup="calcCharLeft();" name="signature" rows="5" cols="50">', $context['member']['signature'], '</textarea><br />';
|
Chris@76
|
2523
|
Chris@76
|
2524 // If there is a limit at all!
|
Chris@76
|
2525 if (!empty($context['signature_limits']['max_length']))
|
Chris@76
|
2526 echo '
|
Chris@76
|
2527 <span class="smalltext">', sprintf($txt['max_sig_characters'], $context['signature_limits']['max_length']), ' <span id="signatureLeft">', $context['signature_limits']['max_length'], '</span></span><br />';
|
Chris@76
|
2528
|
Chris@76
|
2529 if ($context['signature_warning'])
|
Chris@76
|
2530 echo '
|
Chris@76
|
2531 <span class="smalltext">', $context['signature_warning'], '</span>';
|
Chris@76
|
2532
|
Chris@76
|
2533 // Load the spell checker?
|
Chris@76
|
2534 if ($context['show_spellchecking'])
|
Chris@76
|
2535 echo '
|
Chris@76
|
2536 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/spellcheck.js"></script>';
|
Chris@76
|
2537
|
Chris@76
|
2538 // Some javascript used to count how many characters have been used so far in the signature.
|
Chris@76
|
2539 echo '
|
Chris@76
|
2540 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
2541 function tick()
|
Chris@76
|
2542 {
|
Chris@76
|
2543 if (typeof(document.forms.creator) != "undefined")
|
Chris@76
|
2544 {
|
Chris@76
|
2545 calcCharLeft();
|
Chris@76
|
2546 setTimeout("tick()", 1000);
|
Chris@76
|
2547 }
|
Chris@76
|
2548 else
|
Chris@76
|
2549 setTimeout("tick()", 800);
|
Chris@76
|
2550 }
|
Chris@76
|
2551
|
Chris@76
|
2552 function calcCharLeft()
|
Chris@76
|
2553 {
|
Chris@76
|
2554 var maxLength = ', $context['signature_limits']['max_length'], ';
|
Chris@76
|
2555 var oldSignature = "", currentSignature = document.forms.creator.signature.value;
|
Chris@76
|
2556
|
Chris@76
|
2557 if (!document.getElementById("signatureLeft"))
|
Chris@76
|
2558 return;
|
Chris@76
|
2559
|
Chris@76
|
2560 if (oldSignature != currentSignature)
|
Chris@76
|
2561 {
|
Chris@76
|
2562 oldSignature = currentSignature;
|
Chris@76
|
2563
|
Chris@76
|
2564 if (currentSignature.replace(/\r/, "").length > maxLength)
|
Chris@76
|
2565 document.forms.creator.signature.value = currentSignature.replace(/\r/, "").substring(0, maxLength);
|
Chris@76
|
2566 currentSignature = document.forms.creator.signature.value.replace(/\r/, "");
|
Chris@76
|
2567 }
|
Chris@76
|
2568
|
Chris@76
|
2569 setInnerHTML(document.getElementById("signatureLeft"), maxLength - currentSignature.length);
|
Chris@76
|
2570 }
|
Chris@76
|
2571
|
Chris@76
|
2572 addLoadEvent(tick);
|
Chris@76
|
2573 // ]]></script>
|
Chris@76
|
2574 </dd>';
|
Chris@76
|
2575 }
|
Chris@76
|
2576
|
Chris@76
|
2577 function template_profile_avatar_select()
|
Chris@76
|
2578 {
|
Chris@76
|
2579 global $context, $txt, $modSettings;
|
Chris@76
|
2580
|
Chris@76
|
2581 // Start with the upper menu
|
Chris@76
|
2582 echo '
|
Chris@76
|
2583 <dt>
|
Chris@76
|
2584 <strong id="personal_picture">', $txt['personal_picture'], '</strong>
|
Chris@76
|
2585 <input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_none" value="none"' . ($context['member']['avatar']['choice'] == 'none' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_none"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['no_avatar'] . '</label><br />
|
Chris@76
|
2586 ', !empty($context['member']['avatar']['allow_server_stored']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_server_stored" value="server_stored"' . ($context['member']['avatar']['choice'] == 'server_stored' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_server_stored"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['choose_avatar_gallery'] . '</label><br />' : '', '
|
Chris@76
|
2587 ', !empty($context['member']['avatar']['allow_external']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_external" value="external"' . ($context['member']['avatar']['choice'] == 'external' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_external"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['my_own_pic'] . '</label><br />' : '', '
|
Chris@76
|
2588 ', !empty($context['member']['avatar']['allow_upload']) ? '<input type="radio" onclick="swap_avatar(this); return true;" name="avatar_choice" id="avatar_choice_upload" value="upload"' . ($context['member']['avatar']['choice'] == 'upload' ? ' checked="checked"' : '') . ' class="input_radio" /><label for="avatar_choice_upload"' . (isset($context['modify_error']['bad_avatar']) ? ' class="error"' : '') . '>' . $txt['avatar_will_upload'] . '</label>' : '', '
|
Chris@76
|
2589 </dt>
|
Chris@76
|
2590 <dd>';
|
Chris@76
|
2591
|
Chris@76
|
2592 // If users are allowed to choose avatars stored on the server show selection boxes to choice them from.
|
Chris@76
|
2593 if (!empty($context['member']['avatar']['allow_server_stored']))
|
Chris@76
|
2594 {
|
Chris@76
|
2595 echo '
|
Chris@76
|
2596 <div id="avatar_server_stored">
|
Chris@76
|
2597 <div>
|
Chris@76
|
2598 <select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');">';
|
Chris@76
|
2599 // This lists all the file catergories.
|
Chris@76
|
2600 foreach ($context['avatars'] as $avatar)
|
Chris@76
|
2601 echo '
|
Chris@76
|
2602 <option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected="selected"' : ''), '>', $avatar['name'], '</option>';
|
Chris@76
|
2603 echo '
|
Chris@76
|
2604 </select>
|
Chris@76
|
2605 </div>
|
Chris@76
|
2606 <div>
|
Chris@76
|
2607 <select name="file" id="file" size="10" style="display: none;" onchange="showAvatar()" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'server_stored\');" disabled="disabled"><option></option></select>
|
Chris@76
|
2608 </div>
|
Chris@76
|
2609 <div><img name="avatar" id="avatar" src="', !empty($context['member']['avatar']['allow_external']) && $context['member']['avatar']['choice'] == 'external' ? $context['member']['avatar']['external'] : $modSettings['avatar_url'] . '/blank.gif', '" alt="Do Nothing" /></div>
|
Chris@76
|
2610 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
2611 var files = ["' . implode('", "', $context['avatar_list']) . '"];
|
Chris@76
|
2612 var avatar = document.getElementById("avatar");
|
Chris@76
|
2613 var cat = document.getElementById("cat");
|
Chris@76
|
2614 var selavatar = "' . $context['avatar_selected'] . '";
|
Chris@76
|
2615 var avatardir = "' . $modSettings['avatar_url'] . '/";
|
Chris@76
|
2616 var size = avatar.alt.substr(3, 2) + " " + avatar.alt.substr(0, 2) + String.fromCharCode(117, 98, 116);
|
Chris@76
|
2617 var file = document.getElementById("file");
|
Chris@76
|
2618
|
Chris@76
|
2619 if (avatar.src.indexOf("blank.gif") > -1)
|
Chris@76
|
2620 changeSel(selavatar);
|
Chris@76
|
2621 else
|
Chris@76
|
2622 previewExternalAvatar(avatar.src)
|
Chris@76
|
2623
|
Chris@76
|
2624 function changeSel(selected)
|
Chris@76
|
2625 {
|
Chris@76
|
2626 if (cat.selectedIndex == -1)
|
Chris@76
|
2627 return;
|
Chris@76
|
2628
|
Chris@76
|
2629 if (cat.options[cat.selectedIndex].value.indexOf("/") > 0)
|
Chris@76
|
2630 {
|
Chris@76
|
2631 var i;
|
Chris@76
|
2632 var count = 0;
|
Chris@76
|
2633
|
Chris@76
|
2634 file.style.display = "inline";
|
Chris@76
|
2635 file.disabled = false;
|
Chris@76
|
2636
|
Chris@76
|
2637 for (i = file.length; i >= 0; i = i - 1)
|
Chris@76
|
2638 file.options[i] = null;
|
Chris@76
|
2639
|
Chris@76
|
2640 for (i = 0; i < files.length; i++)
|
Chris@76
|
2641 if (files[i].indexOf(cat.options[cat.selectedIndex].value) == 0)
|
Chris@76
|
2642 {
|
Chris@76
|
2643 var filename = files[i].substr(files[i].indexOf("/") + 1);
|
Chris@76
|
2644 var showFilename = filename.substr(0, filename.lastIndexOf("."));
|
Chris@76
|
2645 showFilename = showFilename.replace(/[_]/g, " ");
|
Chris@76
|
2646
|
Chris@76
|
2647 file.options[count] = new Option(showFilename, files[i]);
|
Chris@76
|
2648
|
Chris@76
|
2649 if (filename == selected)
|
Chris@76
|
2650 {
|
Chris@76
|
2651 if (file.options.defaultSelected)
|
Chris@76
|
2652 file.options[count].defaultSelected = true;
|
Chris@76
|
2653 else
|
Chris@76
|
2654 file.options[count].selected = true;
|
Chris@76
|
2655 }
|
Chris@76
|
2656
|
Chris@76
|
2657 count++;
|
Chris@76
|
2658 }
|
Chris@76
|
2659
|
Chris@76
|
2660 if (file.selectedIndex == -1 && file.options[0])
|
Chris@76
|
2661 file.options[0].selected = true;
|
Chris@76
|
2662
|
Chris@76
|
2663 showAvatar();
|
Chris@76
|
2664 }
|
Chris@76
|
2665 else
|
Chris@76
|
2666 {
|
Chris@76
|
2667 file.style.display = "none";
|
Chris@76
|
2668 file.disabled = true;
|
Chris@76
|
2669 document.getElementById("avatar").src = avatardir + cat.options[cat.selectedIndex].value;
|
Chris@76
|
2670 document.getElementById("avatar").style.width = "";
|
Chris@76
|
2671 document.getElementById("avatar").style.height = "";
|
Chris@76
|
2672 }
|
Chris@76
|
2673 }
|
Chris@76
|
2674
|
Chris@76
|
2675 function showAvatar()
|
Chris@76
|
2676 {
|
Chris@76
|
2677 if (file.selectedIndex == -1)
|
Chris@76
|
2678 return;
|
Chris@76
|
2679
|
Chris@76
|
2680 document.getElementById("avatar").src = avatardir + file.options[file.selectedIndex].value;
|
Chris@76
|
2681 document.getElementById("avatar").alt = file.options[file.selectedIndex].text;
|
Chris@76
|
2682 document.getElementById("avatar").alt += file.options[file.selectedIndex].text == size ? "!" : "";
|
Chris@76
|
2683 document.getElementById("avatar").style.width = "";
|
Chris@76
|
2684 document.getElementById("avatar").style.height = "";
|
Chris@76
|
2685 }
|
Chris@76
|
2686
|
Chris@76
|
2687 function previewExternalAvatar(src)
|
Chris@76
|
2688 {
|
Chris@76
|
2689 if (!document.getElementById("avatar"))
|
Chris@76
|
2690 return;
|
Chris@76
|
2691
|
Chris@76
|
2692 var maxHeight = ', !empty($modSettings['avatar_max_height_external']) ? $modSettings['avatar_max_height_external'] : 0, ';
|
Chris@76
|
2693 var maxWidth = ', !empty($modSettings['avatar_max_width_external']) ? $modSettings['avatar_max_width_external'] : 0, ';
|
Chris@76
|
2694 var tempImage = new Image();
|
Chris@76
|
2695
|
Chris@76
|
2696 tempImage.src = src;
|
Chris@76
|
2697 if (maxWidth != 0 && tempImage.width > maxWidth)
|
Chris@76
|
2698 {
|
Chris@76
|
2699 document.getElementById("avatar").style.height = parseInt((maxWidth * tempImage.height) / tempImage.width) + "px";
|
Chris@76
|
2700 document.getElementById("avatar").style.width = maxWidth + "px";
|
Chris@76
|
2701 }
|
Chris@76
|
2702 else if (maxHeight != 0 && tempImage.height > maxHeight)
|
Chris@76
|
2703 {
|
Chris@76
|
2704 document.getElementById("avatar").style.width = parseInt((maxHeight * tempImage.width) / tempImage.height) + "px";
|
Chris@76
|
2705 document.getElementById("avatar").style.height = maxHeight + "px";
|
Chris@76
|
2706 }
|
Chris@76
|
2707 document.getElementById("avatar").src = src;
|
Chris@76
|
2708 }
|
Chris@76
|
2709 // ]]></script>
|
Chris@76
|
2710 </div>';
|
Chris@76
|
2711 }
|
Chris@76
|
2712
|
Chris@76
|
2713 // If the user can link to an off server avatar, show them a box to input the address.
|
Chris@76
|
2714 if (!empty($context['member']['avatar']['allow_external']))
|
Chris@76
|
2715 {
|
Chris@76
|
2716 echo '
|
Chris@76
|
2717 <div id="avatar_external">
|
Chris@76
|
2718 <div class="smalltext">', $txt['avatar_by_url'], '</div>
|
Chris@76
|
2719 <input type="text" name="userpicpersonal" size="45" value="', $context['member']['avatar']['external'], '" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'external\');" onchange="if (typeof(previewExternalAvatar) != \'undefined\') previewExternalAvatar(this.value);" class="input_text" />
|
Chris@76
|
2720 </div>';
|
Chris@76
|
2721 }
|
Chris@76
|
2722
|
Chris@76
|
2723 // If the user is able to upload avatars to the server show them an upload box.
|
Chris@76
|
2724 if (!empty($context['member']['avatar']['allow_upload']))
|
Chris@76
|
2725 {
|
Chris@76
|
2726 echo '
|
Chris@76
|
2727 <div id="avatar_upload">
|
Chris@76
|
2728 <input type="file" size="44" name="attachment" value="" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'upload\');" class="input_file" />
|
Chris@76
|
2729 ', ($context['member']['avatar']['id_attach'] > 0 ? '<br /><br /><img src="' . $context['member']['avatar']['href'] . (strpos($context['member']['avatar']['href'], '?') === false ? '?' : '&') . 'time=' . time() . '" alt="" /><input type="hidden" name="id_attach" value="' . $context['member']['avatar']['id_attach'] . '" />' : ''), '
|
Chris@76
|
2730 </div>';
|
Chris@76
|
2731 }
|
Chris@76
|
2732
|
Chris@76
|
2733 echo '
|
Chris@76
|
2734 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
2735 ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "' . ($context['member']['avatar']['choice'] == 'server_stored' ? '' : 'none') . '";' : '', '
|
Chris@76
|
2736 ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "' . ($context['member']['avatar']['choice'] == 'external' ? '' : 'none') . '";' : '', '
|
Chris@76
|
2737 ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "' . ($context['member']['avatar']['choice'] == 'upload' ? '' : 'none') . '";' : '', '
|
Chris@76
|
2738
|
Chris@76
|
2739 function swap_avatar(type)
|
Chris@76
|
2740 {
|
Chris@76
|
2741 switch(type.id)
|
Chris@76
|
2742 {
|
Chris@76
|
2743 case "avatar_choice_server_stored":
|
Chris@76
|
2744 ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "";' : '', '
|
Chris@76
|
2745 ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "none";' : '', '
|
Chris@76
|
2746 ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "none";' : '', '
|
Chris@76
|
2747 break;
|
Chris@76
|
2748 case "avatar_choice_external":
|
Chris@76
|
2749 ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "none";' : '', '
|
Chris@76
|
2750 ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "";' : '', '
|
Chris@76
|
2751 ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "none";' : '', '
|
Chris@76
|
2752 break;
|
Chris@76
|
2753 case "avatar_choice_upload":
|
Chris@76
|
2754 ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "none";' : '', '
|
Chris@76
|
2755 ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "none";' : '', '
|
Chris@76
|
2756 ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "";' : '', '
|
Chris@76
|
2757 break;
|
Chris@76
|
2758 case "avatar_choice_none":
|
Chris@76
|
2759 ', !empty($context['member']['avatar']['allow_server_stored']) ? 'document.getElementById("avatar_server_stored").style.display = "none";' : '', '
|
Chris@76
|
2760 ', !empty($context['member']['avatar']['allow_external']) ? 'document.getElementById("avatar_external").style.display = "none";' : '', '
|
Chris@76
|
2761 ', !empty($context['member']['avatar']['allow_upload']) ? 'document.getElementById("avatar_upload").style.display = "none";' : '', '
|
Chris@76
|
2762 break;
|
Chris@76
|
2763 }
|
Chris@76
|
2764 }
|
Chris@76
|
2765 // ]]></script>
|
Chris@76
|
2766 </dd>';
|
Chris@76
|
2767 }
|
Chris@76
|
2768
|
Chris@76
|
2769 // Callback for modifying karam.
|
Chris@76
|
2770 function template_profile_karma_modify()
|
Chris@76
|
2771 {
|
Chris@76
|
2772 global $context, $modSettings, $txt;
|
Chris@76
|
2773
|
Chris@76
|
2774 echo '
|
Chris@76
|
2775 <dt>
|
Chris@76
|
2776 <strong>', $modSettings['karmaLabel'], '</strong>
|
Chris@76
|
2777 </dt>
|
Chris@76
|
2778 <dd>
|
Chris@76
|
2779 ', $modSettings['karmaApplaudLabel'], ' <input type="text" name="karma_good" size="4" value="', $context['member']['karma']['good'], '" onchange="setInnerHTML(document.getElementById(\'karmaTotal\'), this.value - this.form.karma_bad.value);" style="margin-right: 2ex;" class="input_text" /> ', $modSettings['karmaSmiteLabel'], ' <input type="text" name="karma_bad" size="4" value="', $context['member']['karma']['bad'], '" onchange="this.form.karma_good.onchange();" class="input_text" /><br />
|
Chris@76
|
2780 (', $txt['total'], ': <span id="karmaTotal">', ($context['member']['karma']['good'] - $context['member']['karma']['bad']), '</span>)
|
Chris@76
|
2781 </dd>';
|
Chris@76
|
2782 }
|
Chris@76
|
2783
|
Chris@76
|
2784 // Select the time format!
|
Chris@76
|
2785 function template_profile_timeformat_modify()
|
Chris@76
|
2786 {
|
Chris@76
|
2787 global $context, $modSettings, $txt, $scripturl, $settings;
|
Chris@76
|
2788
|
Chris@76
|
2789 echo '
|
Chris@76
|
2790 <dt>
|
Chris@76
|
2791 <strong>', $txt['time_format'], ':</strong><br />
|
Chris@76
|
2792 <a href="', $scripturl, '?action=helpadmin;help=time_format" onclick="return reqWin(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.gif" alt="', $txt['help'], '" class="floatleft" /></a>
|
Chris@76
|
2793 <span class="smalltext"> ', $txt['date_format'], '</span>
|
Chris@76
|
2794 </dt>
|
Chris@76
|
2795 <dd>
|
Chris@76
|
2796 <select name="easyformat" onchange="document.forms.creator.time_format.value = this.options[this.selectedIndex].value;" style="margin-bottom: 4px;">';
|
Chris@76
|
2797 // Help the user by showing a list of common time formats.
|
Chris@76
|
2798 foreach ($context['easy_timeformats'] as $time_format)
|
Chris@76
|
2799 echo '
|
Chris@76
|
2800 <option value="', $time_format['format'], '"', $time_format['format'] == $context['member']['time_format'] ? ' selected="selected"' : '', '>', $time_format['title'], '</option>';
|
Chris@76
|
2801 echo '
|
Chris@76
|
2802 </select><br />
|
Chris@76
|
2803 <input type="text" name="time_format" value="', $context['member']['time_format'], '" size="30" class="input_text" />
|
Chris@76
|
2804 </dd>';
|
Chris@76
|
2805 }
|
Chris@76
|
2806
|
Chris@76
|
2807 // Time offset?
|
Chris@76
|
2808 function template_profile_timeoffset_modify()
|
Chris@76
|
2809 {
|
Chris@76
|
2810 global $txt, $context;
|
Chris@76
|
2811
|
Chris@76
|
2812 echo '
|
Chris@76
|
2813 <dt>
|
Chris@76
|
2814 <strong', (isset($context['modify_error']['bad_offset']) ? ' class="error"' : ''), '>', $txt['time_offset'], ':</strong><br />
|
Chris@76
|
2815 <span class="smalltext">', $txt['personal_time_offset'], '</span>
|
Chris@76
|
2816 </dt>
|
Chris@76
|
2817 <dd>
|
Chris@76
|
2818 <input type="text" name="time_offset" id="time_offset" size="5" maxlength="5" value="', $context['member']['time_offset'], '" class="input_text" /> <a href="javascript:void(0);" onclick="currentDate = new Date(', $context['current_forum_time_js'], '); document.getElementById(\'time_offset\').value = autoDetectTimeOffset(currentDate); return false;">', $txt['timeoffset_autodetect'], '</a><br />', $txt['current_time'], ': <em>', $context['current_forum_time'], '</em>
|
Chris@76
|
2819 </dd>';
|
Chris@76
|
2820 }
|
Chris@76
|
2821
|
Chris@76
|
2822 // Theme?
|
Chris@76
|
2823 function template_profile_theme_pick()
|
Chris@76
|
2824 {
|
Chris@76
|
2825 global $txt, $context, $scripturl;
|
Chris@76
|
2826
|
Chris@76
|
2827 echo '
|
Chris@76
|
2828 <dt>
|
Chris@76
|
2829 <strong>', $txt['current_theme'], ':</strong>
|
Chris@76
|
2830 </dt>
|
Chris@76
|
2831 <dd>
|
Chris@76
|
2832 ', $context['member']['theme']['name'], ' <a href="', $scripturl, '?action=theme;sa=pick;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['change'], '</a>
|
Chris@76
|
2833 </dd>';
|
Chris@76
|
2834 }
|
Chris@76
|
2835
|
Chris@76
|
2836 // Smiley set picker.
|
Chris@76
|
2837 function template_profile_smiley_pick()
|
Chris@76
|
2838 {
|
Chris@76
|
2839 global $txt, $context, $modSettings, $settings;
|
Chris@76
|
2840
|
Chris@76
|
2841 echo '
|
Chris@76
|
2842 <dt>
|
Chris@76
|
2843 <strong>', $txt['smileys_current'], ':</strong>
|
Chris@76
|
2844 </dt>
|
Chris@76
|
2845 <dd>
|
Chris@76
|
2846 <select name="smiley_set" onchange="document.getElementById(\'smileypr\').src = this.selectedIndex == 0 ? \'', $settings['images_url'], '/blank.gif\' : \'', $modSettings['smileys_url'], '/\' + (this.selectedIndex != 1 ? this.options[this.selectedIndex].value : \'', !empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'], '\') + \'/smiley.gif\';">';
|
Chris@76
|
2847 foreach ($context['smiley_sets'] as $set)
|
Chris@76
|
2848 echo '
|
Chris@76
|
2849 <option value="', $set['id'], '"', $set['selected'] ? ' selected="selected"' : '', '>', $set['name'], '</option>';
|
Chris@76
|
2850 echo '
|
Chris@76
|
2851 </select> <img id="smileypr" src="', $context['member']['smiley_set']['id'] != 'none' ? $modSettings['smileys_url'] . '/' . ($context['member']['smiley_set']['id'] != '' ? $context['member']['smiley_set']['id'] : (!empty($settings['smiley_sets_default']) ? $settings['smiley_sets_default'] : $modSettings['smiley_sets_default'])) . '/smiley.gif' : $settings['images_url'] . '/blank.gif', '" alt=":)" align="top" style="padding-left: 20px;" />
|
Chris@76
|
2852 </dd>';
|
Chris@76
|
2853 }
|
Chris@76
|
2854
|
Chris@76
|
2855 // Change the way you login to the forum.
|
Chris@76
|
2856 function template_authentication_method()
|
Chris@76
|
2857 {
|
Chris@76
|
2858 global $context, $settings, $options, $scripturl, $modSettings, $txt;
|
Chris@76
|
2859
|
Chris@76
|
2860 // The main header!
|
Chris@76
|
2861 echo '
|
Chris@76
|
2862 <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/register.js"></script>
|
Chris@76
|
2863 <form action="', $scripturl, '?action=profile;area=authentication;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" enctype="multipart/form-data">
|
Chris@76
|
2864 <div class="cat_bar">
|
Chris@76
|
2865 <h3 class="catbg">
|
Chris@76
|
2866 <span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['authentication'], '</span>
|
Chris@76
|
2867 </h3>
|
Chris@76
|
2868 </div>
|
Chris@76
|
2869 <p class="windowbg description">', $txt['change_authentication'], '</p>
|
Chris@76
|
2870 <div class="windowbg2">
|
Chris@76
|
2871 <span class="topslice"><span></span></span>
|
Chris@76
|
2872 <div class="content">
|
Chris@76
|
2873 <dl>
|
Chris@76
|
2874 <dt>
|
Chris@76
|
2875 <input type="radio" onclick="updateAuthMethod();" name="authenticate" value="openid" id="auth_openid"', $context['auth_method'] == 'openid' ? ' checked="checked"' : '', ' class="input_radio" /><label for="auth_openid"><strong>', $txt['authenticate_openid'], '</strong></label> <em><a href="', $scripturl, '?action=helpadmin;help=register_openid" onclick="return reqWin(this.href);" class="help">(?)</a></em><br />
|
Chris@76
|
2876 <input type="radio" onclick="updateAuthMethod();" name="authenticate" value="passwd" id="auth_pass"', $context['auth_method'] == 'password' ? ' checked="checked"' : '', ' class="input_radio" /><label for="auth_pass"><strong>', $txt['authenticate_password'], '</strong></label>
|
Chris@76
|
2877 </dt>
|
Chris@76
|
2878 <dd>
|
Chris@76
|
2879 <dl id="auth_openid_div">
|
Chris@76
|
2880 <dt>
|
Chris@76
|
2881 <em>', $txt['authenticate_openid_url'], ':</em>
|
Chris@76
|
2882 </dt>
|
Chris@76
|
2883 <dd>
|
Chris@76
|
2884 <input type="text" name="openid_identifier" id="openid_url" size="30" tabindex="', $context['tabindex']++, '" value="', $context['member']['openid_uri'], '" class="input_text openid_login" />
|
Chris@76
|
2885 </dd>
|
Chris@76
|
2886 </dl>
|
Chris@76
|
2887 <dl id="auth_pass_div">
|
Chris@76
|
2888 <dt>
|
Chris@76
|
2889 <em>', $txt['choose_pass'], ':</em>
|
Chris@76
|
2890 </dt>
|
Chris@76
|
2891 <dd>
|
Chris@76
|
2892 <input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
|
Chris@76
|
2893 <span id="smf_autov_pwmain_div" style="display: none;"><img id="smf_autov_pwmain_img" src="', $settings['images_url'], '/icons/field_invalid.gif" alt="*" /></span>
|
Chris@76
|
2894 </dd>
|
Chris@76
|
2895 <dt>
|
Chris@76
|
2896 <em>', $txt['verify_pass'], ':</em>
|
Chris@76
|
2897 </dt>
|
Chris@76
|
2898 <dd>
|
Chris@76
|
2899 <input type="password" name="passwrd2" id="smf_autov_pwverify" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
|
Chris@76
|
2900 <span id="smf_autov_pwverify_div" style="display: none;"><img id="smf_autov_pwverify_img" src="', $settings['images_url'], '/icons/field_valid.gif" alt="*" /></span>
|
Chris@76
|
2901 </dd>
|
Chris@76
|
2902 </dl>
|
Chris@76
|
2903 </dd>
|
Chris@76
|
2904 </dl>';
|
Chris@76
|
2905
|
Chris@76
|
2906 if ($context['require_password'])
|
Chris@76
|
2907 echo '
|
Chris@76
|
2908 <hr width="100%" size="1" class="hrcolor clear" />
|
Chris@76
|
2909 <dl>
|
Chris@76
|
2910 <dt>
|
Chris@76
|
2911 <strong', isset($context['modify_error']['bad_password']) || isset($context['modify_error']['no_password']) ? ' class="error"' : '', '>', $txt['current_password'], ': </strong><br />
|
Chris@76
|
2912 <span class="smalltext">', $txt['required_security_reasons'], '</span>
|
Chris@76
|
2913 </dt>
|
Chris@76
|
2914 <dd>
|
Chris@76
|
2915 <input type="password" name="oldpasswrd" size="20" style="margin-right: 4ex;" class="input_password" />
|
Chris@76
|
2916 </dd>
|
Chris@76
|
2917 </dl>';
|
Chris@76
|
2918
|
Chris@76
|
2919 echo '
|
Chris@76
|
2920 <div class="righttext">
|
Chris@76
|
2921 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
|
Chris@76
|
2922 <input type="hidden" name="u" value="', $context['id_member'], '" />
|
Chris@76
|
2923 <input type="hidden" name="sa" value="', $context['menu_item_selected'], '" />
|
Chris@76
|
2924 <input type="submit" value="', $txt['change_profile'], '" class="button_submit" />
|
Chris@76
|
2925 </div>
|
Chris@76
|
2926 </div>
|
Chris@76
|
2927 <span class="botslice"><span></span></span>
|
Chris@76
|
2928 </div>
|
Chris@76
|
2929 </form>';
|
Chris@76
|
2930
|
Chris@76
|
2931 // The password stuff.
|
Chris@76
|
2932 echo '
|
Chris@76
|
2933 <script type="text/javascript"><!-- // --><![CDATA[
|
Chris@76
|
2934 var regTextStrings = {
|
Chris@76
|
2935 "password_short": "', $txt['registration_password_short'], '",
|
Chris@76
|
2936 "password_reserved": "', $txt['registration_password_reserved'], '",
|
Chris@76
|
2937 "password_numbercase": "', $txt['registration_password_numbercase'], '",
|
Chris@76
|
2938 "password_no_match": "', $txt['registration_password_no_match'], '",
|
Chris@76
|
2939 "password_valid": "', $txt['registration_password_valid'], '"
|
Chris@76
|
2940 };
|
Chris@76
|
2941 var verificationHandle = new smfRegister("creator", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
|
Chris@76
|
2942 var currentAuthMethod = \'passwd\';
|
Chris@76
|
2943 function updateAuthMethod()
|
Chris@76
|
2944 {
|
Chris@76
|
2945 // What authentication method is being used?
|
Chris@76
|
2946 if (!document.getElementById(\'auth_openid\') || !document.getElementById(\'auth_openid\').checked)
|
Chris@76
|
2947 currentAuthMethod = \'passwd\';
|
Chris@76
|
2948 else
|
Chris@76
|
2949 currentAuthMethod = \'openid\';
|
Chris@76
|
2950
|
Chris@76
|
2951 // No openID?
|
Chris@76
|
2952 if (!document.getElementById(\'auth_openid\'))
|
Chris@76
|
2953 return true;
|
Chris@76
|
2954
|
Chris@76
|
2955 document.forms.creator.openid_url.disabled = currentAuthMethod == \'openid\' ? false : true;
|
Chris@76
|
2956 document.forms.creator.smf_autov_pwmain.disabled = currentAuthMethod == \'passwd\' ? false : true;
|
Chris@76
|
2957 document.forms.creator.smf_autov_pwverify.disabled = currentAuthMethod == \'passwd\' ? false : true;
|
Chris@76
|
2958 document.getElementById(\'smf_autov_pwmain_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
|
Chris@76
|
2959 document.getElementById(\'smf_autov_pwverify_div\').style.display = currentAuthMethod == \'passwd\' ? \'\' : \'none\';
|
Chris@76
|
2960
|
Chris@76
|
2961 if (currentAuthMethod == \'passwd\')
|
Chris@76
|
2962 {
|
Chris@76
|
2963 verificationHandle.refreshMainPassword();
|
Chris@76
|
2964 verificationHandle.refreshVerifyPassword();
|
Chris@76
|
2965 document.forms.creator.openid_url.style.backgroundColor = \'\';
|
Chris@76
|
2966 document.getElementById("auth_openid_div").style.display = "none";
|
Chris@76
|
2967 document.getElementById("auth_pass_div").style.display = "";
|
Chris@76
|
2968 }
|
Chris@76
|
2969 else
|
Chris@76
|
2970 {
|
Chris@76
|
2971 document.forms.creator.smf_autov_pwmain.style.backgroundColor = \'\';
|
Chris@76
|
2972 document.forms.creator.smf_autov_pwverify.style.backgroundColor = \'\';
|
Chris@76
|
2973 document.forms.creator.openid_url.style.backgroundColor = \'#FCE184\';
|
Chris@76
|
2974 document.getElementById("auth_openid_div").style.display = "";
|
Chris@76
|
2975 document.getElementById("auth_pass_div").style.display = "none";
|
Chris@76
|
2976 }
|
Chris@76
|
2977 }
|
Chris@76
|
2978 updateAuthMethod();
|
Chris@76
|
2979 // ]]></script>';
|
Chris@76
|
2980 }
|
Chris@76
|
2981
|
Chris@76
|
2982 ?> |