comparison forum/Themes/default/Wireless.template.php @ 76:e3e11437ecea website

Add forum code
author Chris Cannam
date Sun, 07 Jul 2013 11:25:48 +0200
parents
children
comparison
equal deleted inserted replaced
75:72f59aa7e503 76:e3e11437ecea
1 <?php
2 /**
3 * Simple Machines Forum (SMF)
4 *
5 * @package SMF
6 * @author Simple Machines
7 * @copyright 2011 Simple Machines
8 * @license http://www.simplemachines.org/about/smf/license.php BSD
9 *
10 * @version 2.0
11 */
12
13 // This is the header for WAP 1.1 output. You can view it with ?wap in the URL.
14 function template_wap_above()
15 {
16 global $context, $settings, $options;
17
18 // Show the xml declaration...
19 echo '<?xml version="1.0"?', '>
20 <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
21 <wml>
22 <head>
23 </head>';
24 }
25
26 // This is the board index (main page) in WAP 1.1.
27 function template_wap_boardindex()
28 {
29 global $context, $settings, $options, $scripturl;
30
31 // This is the "main" card...
32 echo '
33 <card id="main" title="', $context['page_title'], '">
34 <p><strong>', $context['forum_name_html_safe'], '</strong><br /></p>';
35
36 // Show an anchor for each category.
37 foreach ($context['categories'] as $category)
38 {
39 // Skip it if it's empty.
40 if (!empty($category['boards']))
41 echo '
42 <p><a href="#c', $category['id'], '">', $category['name'], '</a><br /></p>';
43 }
44
45 // Okay, that's it for the main card.
46 echo '
47 </card>';
48
49 // Now fill out the deck of cards with the boards in each category.
50 foreach ($context['categories'] as $category)
51 {
52 // Begin the card, and make the name available.
53 echo '
54 <card id="c', $category['id'], '" title="', strip_tags($category['name']), '">
55 <p><strong>', strip_tags($category['name']), '</strong><br /></p>';
56
57 // Now show a link for each board.
58 foreach ($category['boards'] as $board)
59 echo '
60 <p><a href="', $scripturl, '?board=', $board['id'], '.0;wap">', $board['name'], '</a><br /></p>';
61
62 echo '
63 </card>';
64 }
65 }
66
67 // This is the message index (list of topics in a board) for WAP 1.1.
68 function template_wap_messageindex()
69 {
70 global $context, $settings, $options, $scripturl, $txt;
71
72 echo '
73 <card id="main" title="', $context['page_title'], '">
74 <p><strong>', $context['name'], '</strong></p>';
75
76 if (isset($context['boards']) && count($context['boards']) > 0)
77 {
78 foreach ($context['boards'] as $board)
79 echo '
80 <p>- <a href="', $scripturl, '?board=', $board['id'], '.0;wap">', $board['name'], '</a><br /></p>';
81 echo '
82 <p><br /></p>';
83 }
84
85 if (!empty($context['topics']))
86 {
87 echo '
88 <p>', $txt['pages'], ': ', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';wap">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';wap">&gt;</a> <a href="' . $context['links']['last'] . ';wap">&gt;&gt;</a> ' : '', '<br /></p>';
89
90 foreach ($context['topics'] as $topic)
91 echo '
92 <p><a href="', $scripturl, '?topic=', $topic['id'], '.0;wap">', $topic['first_post']['subject'], '</a>', (!$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), ' - ', $topic['first_post']['member']['name'], '<br /></p>';
93
94 echo '
95 <p>', $txt['pages'], ': ', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';wap">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';wap">&gt;</a> <a href="' . $context['links']['last'] . ';wap">&gt;&gt;</a> ' : '', '</p>';
96 }
97
98 echo '
99 </card>';
100 }
101
102 function template_wap_display()
103 {
104 global $context, $settings, $options, $txt;
105
106 echo '
107 <card id="main" title="', $context['page_title'], '">
108 <p><strong>' . $context['linktree'][1]['name'] . ' > ' . $context['linktree'][count($context['linktree']) - 2]['name'] . '</strong></p>
109 <p><strong>', $context['subject'], '</strong></p>
110 <p>', $txt['pages'], ': ', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';wap">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';wap">&gt;</a> <a href="' . $context['links']['last'] . ';wap">&gt;&gt;</a> ' : '', '<br /><br /></p>';
111
112 while ($message = $context['get_message']())
113 {
114 // This is a special modification to the post so it will work on phones:
115 $message['body'] = preg_replace('~<div class="(?:quote|code)header">(.+?)</div>~', '<br />--- $1 ---', $message['body']);
116 $message['body'] = strip_tags(str_replace(
117 array(
118 '<blockquote>',
119 '</blockquote>',
120 '<code>',
121 '</code>',
122 '<li>',
123 $txt['code_select'],
124 ),
125 array(
126 '<br>',
127 '<br>--- ' . $txt['wireless_end_quote'] . ' ---<br>',
128 '<br>',
129 '<br>--- ' . $txt['wireless_end_code'] . ' ---<br>',
130 '<br>* ',
131 '',
132 ), $message['body']), '<br>');
133
134 echo '
135 <p><u>', $message['member']['name'], '</u>:', (!$message['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '<br /></p>
136 <p>', $message['body'], '<br /><br /></p>';
137 }
138
139 echo '
140 <p>', $txt['pages'], ': ', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';wap">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';wap">&gt;</a> <a href="' . $context['links']['last'] . ';wap">&gt;&gt;</a> ' : '', '</p>
141 </card>';
142 }
143
144 function template_wap_login()
145 {
146 global $context, $modSettings, $scripturl, $txt;
147
148 echo '
149 <card id="login" title="', $context['page_title'], '">';
150
151 if (isset($context['login_errors']))
152 foreach ($context['login_errors'] as $error)
153 echo '
154 <p><strong>', $error, '</strong></p>';
155
156 echo '
157 <p>', $txt['username'], ':<br />
158 <input type="text" name="user" class="input_text" /></p>
159
160 <p>', $txt['password'], ':<br />
161 <input type="password" name="passwrd" class="input_password" /></p>';
162
163 // Open ID?
164 if (!empty($modSettings['enableOpenID']))
165 echo '
166 <p><strong>&mdash;', $txt['or'], '&mdash;</strong></p>
167
168 <p>', $txt['openid'], ':<br />
169 <input type="text" name="openid_identifier" class="input_text openid_login" size="17" /></p>';
170
171 echo '
172 <p><do type="accept" label="', $txt['login'], '">
173 <go method="post" href="', $scripturl, '?action=login2;wap">
174 <postfield name="user" value="$user" />
175 <postfield name="passwrd" value="$passwrd" />
176 <postfield name="cookieneverexp" value="1" />
177 </go>
178 </do></p>
179 </card>';
180 }
181
182 function template_wap_recent()
183 {
184 global $context, $settings, $options, $scripturl, $txt;
185
186 echo '
187 <card id="recent" title="', $context['page_title'], '">
188 <p><strong>', $_REQUEST['action'] == 'unread' ? $txt['wireless_recent_unread_posts'] : $txt['wireless_recent_unread_replies'], '</strong></p>';
189
190 if (empty($context['topics']))
191 echo '
192 <p>', $txt['old_posts'], '</p>';
193 else
194 {
195 echo '
196 <p>', $txt['pages'], ': ', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';wap">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';wap">&gt;</a> <a href="' . $context['links']['last'] . ';wap">&gt;&gt;</a> ' : '', '<br /><br /></p>';
197 foreach ($context['topics'] as $topic)
198 {
199 echo '
200 <p><a href="', $scripturl, '?topic=', $topic['id'], '.msg', $topic['new_from'], ';topicseen;imode#new">', $topic['first_post']['subject'], '</a></p>';
201 }
202 }
203
204 echo '
205 </card>';
206 }
207
208 function template_wap_error()
209 {
210 global $context, $settings, $options, $txt, $scripturl;
211
212 echo '
213 <card id="main" title="', $context['page_title'], '">
214 <p><strong>', $context['error_title'], '</strong></p>
215 <p>', $context['error_message'], '</p>
216 <p><a href="', $scripturl, '?wap">', $txt['wireless_error_home'], '</a></p>
217 </card>';
218 }
219
220 function template_wap_below()
221 {
222 global $context, $settings, $options, $txt;
223
224 echo '
225 <card id="switch" title="', $txt['wireless_go_to_full_version'], '">
226 <p>
227 <a href="', $context['linktree'][count($context['linktree']) - 1]['url'], (count($context['linktree']) > 1 ? ';' : '?'), 'nowap" rel="nofollow">', $txt['wireless_go_to_full_version'], '</a>
228 </p>
229 </card>
230 </wml>';
231 }
232
233 // The cHTML protocol used for i-mode starts here.
234 function template_imode_above()
235 {
236 global $context, $settings, $options, $user_info;
237
238 echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD Compact HTML 1.0 Draft//EN">
239 <html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
240 <head>
241 <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />';
242
243 // Present a canonical url for search engines to prevent duplicate content in their indices.
244 if ($user_info['is_guest'] && !empty($context['canonical_url']))
245 echo '
246 <link rel="canonical" href="', $context['canonical_url'], '" />';
247
248 echo '
249 <title>', $context['page_title'], '</title>
250 </head>
251 <body>';
252 }
253
254 function template_imode_boardindex()
255 {
256 global $context, $settings, $options, $scripturl, $txt;
257
258 echo '
259 <table border="0" cellspacing="0" cellpadding="0">
260 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $context['forum_name_html_safe'], '</font></td></tr>';
261 $count = 0;
262 foreach ($context['categories'] as $category)
263 {
264 if (!empty($category['boards']) || $category['is_collapsed'])
265 echo '
266 <tr bgcolor="#b6dbff"><td>', $category['can_collapse'] ? '<a href="' . $scripturl . '?action=collapse;c=' . $category['id'] . ';sa=' . ($category['is_collapsed'] ? 'expand;' : 'collapse;') . $context['session_var'] . '=' . $context['session_id'] . ';imode">' : '', $category['name'], $category['can_collapse'] ? '</a>' : '', '</td></tr>';
267
268 foreach ($category['boards'] as $board)
269 {
270 $count++;
271 echo '
272 <tr><td>', $board['new'] ? '<font color="#ff0000">' : '', $count < 10 ? '&#' . (59105 + $count) . ';' : '<strong>-</strong>', $board['new'] ? '</font>' : ($board['children_new'] ? '<font color="#ff0000">.</font>' : ''), ' <a href="', $scripturl, '?board=', $board['id'], '.0;imode"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $board['name'], '</a></td></tr>';
273 }
274 }
275 echo '
276 <tr bgcolor="#6d92aa"><td>', $txt['wireless_options'], '</td></tr>';
277 if ($context['user']['is_guest'])
278 echo '
279 <tr><td><a href="', $scripturl, '?action=login;imode">', $txt['wireless_options_login'], '</a></td></tr>';
280 else
281 {
282 if ($context['allow_pm'])
283 echo '
284 <tr><td><a href="', $scripturl, '?action=pm;imode">', empty($context['user']['unread_messages']) ? $txt['wireless_pm_inbox'] : sprintf($txt['wireless_pm_inbox_new'], $context['user']['unread_messages']), '</a></td></tr>';
285 echo '
286 <tr><td><a href="', $scripturl, '?action=unread;imode">', $txt['wireless_recent_unread_posts'], '</a></td></tr>
287 <tr><td><a href="', $scripturl, '?action=unreadreplies;imode">', $txt['wireless_recent_unread_replies'], '</a></td></tr>
288 <tr><td><a href="', $scripturl, '?action=logout;', $context['session_var'], '=', $context['session_id'], ';imode">', $txt['wireless_options_logout'], '</a></td></tr>';
289 }
290 echo '
291 </table>';
292 }
293
294 function template_imode_messageindex()
295 {
296 global $context, $settings, $options, $scripturl, $txt;
297
298 echo '
299 <table border="0" cellspacing="0" cellpadding="0">
300 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $context['name'], '</font></td></tr>';
301
302 if (!empty($context['boards']))
303 {
304 echo '
305 <tr bgcolor="#b6dbff"><td>', $txt['parent_boards'], '</td></tr>';
306 foreach ($context['boards'] as $board)
307 echo '
308 <tr><td>', $board['new'] ? '<font color="#ff0000">-</font> ' : ($board['children_new'] ? '-<font color="#ff0000">.</font>' : '- '), '<a href="', $scripturl, '?board=', $board['id'], '.0;imode">', $board['name'], '</a></td></tr>';
309 }
310
311 $count = 0;
312 if (!empty($context['topics']))
313 {
314 echo '
315 <tr bgcolor="#b6dbff"><td>', $txt['topics'], '</td></tr>
316 <tr><td>', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';imode">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';imode">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';imode">&gt;</a> <a href="' . $context['links']['last'] . ';imode">&gt;&gt;</a> ' : '', '</td></tr>';
317 foreach ($context['topics'] as $topic)
318 {
319 $count++;
320 echo '
321 <tr><td>', $count < 10 ? '&#' . (59105 + $count) . '; ' : '', '<a href="', $scripturl, '?topic=', $topic['id'], '.0;imode"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $topic['first_post']['subject'], '</a>', (!$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), $topic['new'] && $context['user']['is_logged'] ? ' [<a href="' . $scripturl . '?topic=' . $topic['id'] . '.msg' . $topic['new_from'] . ';imode#new">' . $txt['new'] . '</a>]' : '', '</td></tr>';
322 }
323 }
324 echo '
325 <tr bgcolor="#b6dbff"><td>', $txt['wireless_navigation'], '</td></tr>
326 <tr><td>&#59115; <a href="', $context['links']['up'], ($context['links']['up'] == $scripturl . '?' ? '' : ';'), 'imode" accesskey="0">', $txt['wireless_navigation_up'], '</a></td></tr>', !empty($context['links']['next']) ? '
327 <tr><td>&#59104; <a href="' . $context['links']['next'] . ';imode" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></td></tr>' : '', !empty($context['links']['prev']) ? '
328 <tr><td><strong>[*]</strong> <a href="' . $context['links']['prev'] . ';imode" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></td></tr>' : '', $context['can_post_new'] ? '
329 <tr><td><a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;imode">' . $txt['start_new_topic'] . '</a></td></tr>' : '', '
330 </table>';
331 }
332
333 function template_imode_display()
334 {
335 global $context, $settings, $options, $scripturl, $board, $txt;
336
337 echo '
338 <table border="0" cellspacing="0" cellpadding="0">
339 <tr bgcolor="#b6dbff"><td>' . $context['linktree'][1]['name'] . ' > ' . $context['linktree'][count($context['linktree']) - 2]['name'] . '</td></tr>
340 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $context['subject'], '</font></td></tr>
341 <tr><td>', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';imode">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';imode">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';imode">&gt;</a> <a href="' . $context['links']['last'] . ';imode">&gt;&gt;</a> ' : '', '</td></tr>';
342 while ($message = $context['get_message']())
343 {
344 // This is a special modification to the post so it will work on phones:
345 $message['body'] = preg_replace('~<div class="(?:quote|code)header">(.+?)</div>~', '<br />--- $1 ---', $message['body']);
346 $message['body'] = strip_tags(str_replace(
347 array(
348 '<blockquote>',
349 '</blockquote>',
350 '<code>',
351 '</code>',
352 '<li>',
353 $txt['code_select'],
354 ),
355 array(
356 '<br />',
357 '<br />--- ' . $txt['wireless_end_quote'] . ' ---<br />',
358 '<br />',
359 '<br />--- ' . $txt['wireless_end_code'] . ' ---<br />',
360 '<br />* ',
361 '',
362 ), $message['body']), '<br>');
363
364 echo '
365 <tr><td>', $message['first_new'] ? '
366 <a id="new"></a>' : '',
367 $context['wireless_moderate'] && $message['member']['id'] ? '<a href="' . $scripturl . '?action=profile;u=' . $message['member']['id'] . ';imode">' . $message['member']['name'] . '</a>' : '<strong>' . $message['member']['name'] . '</strong>', ':
368 ', ((empty($context['wireless_more']) && $message['can_modify']) || !empty($context['wireless_moderate']) ? '[<a href="' . $scripturl . '?action=post;msg=' . $message['id'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';imode">' . $txt['wireless_display_edit'] . '</a>]' : ''), (!$message['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '<br />
369 ', $message['body'], '
370 </td></tr>';
371 }
372 echo '
373 <tr bgcolor="#b6dbff"><td>', $txt['wireless_navigation'], '</td></tr>
374 <tr><td>&#59115; <a href="', $context['links']['up'], ';imode" accesskey="0">', $txt['wireless_navigation_index'], '</a></td></tr>', $context['user']['is_logged'] ? '
375 <tr><td>&#59115; <a href="' . $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time']. ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';imode" accesskey="1">' . $txt['mark_unread'] . '</a></td></tr>' : '', !empty($context['links']['next']) ? '
376 <tr><td><a href="' . $context['links']['next'] . ';imode' . $context['wireless_moderate'] . '" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></td></tr>' : '', !empty($context['links']['prev']) ? '
377 <tr><td><a href="' . $context['links']['prev'] . ';imode' . $context['wireless_moderate'] . '" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></td></tr>' : '', $context['can_reply'] ? '
378 <tr><td><a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';imode">' . $txt['reply'] . '</a></td></tr>' : '';
379
380 if (!empty($context['wireless_more']) && empty($context['wireless_moderate']))
381 echo '
382 <tr><td><a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], ';moderate;imode">', $txt['wireless_display_moderate'], '</a></td></tr>';
383 elseif (!empty($context['wireless_moderate']))
384 {
385 if ($context['can_sticky'])
386 echo '
387 <tr><td><a href="', $scripturl, '?action=sticky;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';imode">', $txt['wireless_display_' . ($context['is_sticky'] ? 'unsticky' : 'sticky')], '</a></td></tr>';
388 if ($context['can_lock'])
389 echo '
390 <tr><td><a href="', $scripturl, '?action=lock;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';imode">', $txt['wireless_display_' . ($context['is_locked'] ? 'unlock' : 'lock')], '</a></td></tr>';
391 }
392
393 echo '
394 </table>';
395 }
396
397 function template_imode_post()
398 {
399 global $context, $settings, $options, $scripturl, $txt, $modSettings;
400
401 // !!! $modSettings['guest_post_no_email']
402 echo '
403 <form action="', $scripturl, '?action=', $context['destination'], ';board=', $context['current_board'], '.0;imode" method="post">
404 <table border="0" cellspacing="0" cellpadding="0">';
405
406 if (!$context['becomes_approved'])
407 echo '
408 <tr><td>' . $txt['wait_for_approval'] . '<input type="hidden" name="not_approved" value="1" /></td></tr>';
409
410 if ($context['locked'])
411 echo '
412 <tr><td>' . $txt['topic_locked_no_reply'] . '</td></tr>';
413
414 if (isset($context['name']) && isset($context['email']))
415 {
416 echo '
417 <tr><td>', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) ? '<font color="#cc0000">' . $txt['username'] . '</font>' : $txt['username'], ':</td></tr>
418 <tr><td><input type="text" name="guestname" value="', $context['name'], '" class="input_text" /></td></tr>';
419
420 if (empty($modSettings['guest_post_no_email']))
421 echo '
422 <tr><td>', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? '<font color="#cc0000">' . $txt['email'] . '</font>' : $txt['email'], ':</td></tr>
423 <tr><td><input type="text" name="email" value="', $context['email'], '" class="input_text" /></td></tr>';
424 }
425
426 // !!! Needs a more specific imode template.
427 if ($context['require_verification'])
428 echo '
429 <tr><td>', !empty($context['post_error']['need_qr_verification']) ? '<font color="#cc0000">' . $txt['verification'] . '</font>' : $txt['verification'], ':</td></tr>
430 <tr><td>', template_control_verification($context['visual_verification_id'], 'all'), '</td></tr>';
431
432 echo '
433 <tr><td>', isset($context['post_error']['no_subject']) ? '<font color="#FF0000">' . $txt['subject'] . '</font>' : $txt['subject'], ':</td></tr>
434 <tr><td><input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' maxlength="80" class="input_text" /></td></tr>
435 <tr><td>', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? '<font color="#ff0000">' . $txt['message'] . '</font>' : $txt['message'], ':</td></tr>
436 <tr><td><textarea name="message" id="message" rows="5" cols="20">', $context['message'], '</textarea></td></tr>
437 <tr><td>
438 <input type="submit" name="post" value="', $context['submit_label'], '" class="button_submit" />
439 <input type="hidden" name="icon" value="wireless" />
440 <input type="hidden" name="goback" value="', $context['back_to_topic'] || !empty($options['return_to_post']) ? '1' : '0', '" />
441 <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
442 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />', isset($context['current_topic']) ? '
443 <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />' : '', '
444 <input type="hidden" name="notify" value="', $context['notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
445 </td></tr>
446 <tr><td>
447 &#59115; ', !empty($context['current_topic']) ? '<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.new;imode">' . $txt['wireless_navigation_topic'] . '</a>' : '<a href="' . $scripturl . '?board=' . $context['current_board'] . '.0;imode" accesskey="0">' . $txt['wireless_navigation_index'] . '</a>', '
448 </td></tr>
449 </table>
450 </form>';
451 }
452
453 function template_imode_login()
454 {
455 global $context, $settings, $options, $scripturl, $txt, $modSettings;
456
457 echo '
458 <form action="', $scripturl, '?action=login2;imode" method="post">
459 <table border="0" cellspacing="0" cellpadding="0">
460 <tr bgcolor="#b6dbff"><td>', $txt['login'], '</td></tr>';
461 if (isset($context['login_errors']))
462 foreach ($context['login_errors'] as $error)
463 echo '
464 <tr><td><strong><font color="#ff00000">', $error, '</strong></td></tr>';
465 echo '
466 <tr><td>', $txt['username'], ':</td></tr>
467 <tr><td><input type="text" name="user" size="10" class="input_text" /></td></tr>
468 <tr><td>', $txt['password'], ':</td></tr>
469 <tr><td><input type="password" name="passwrd" size="10" class="input_password" /></td></tr>';
470
471 // Open ID?
472 if (!empty($modSettings['enableOpenID']))
473 echo '
474 <tr><td><strong>&mdash;', $txt['or'], '&mdash;</strong></td></tr>
475 <tr><td>', $txt['openid'], ':</td></tr>
476 <tr><td><input type="text" name="openid_identifier" class="input_text openid_login" size="17" /></td></tr>';
477
478 echo '
479 <tr><td><input type="submit" value="', $txt['login'], '" class="button_submit" /><input type="hidden" name="cookieneverexp" value="1" /></td></tr>
480 <tr bgcolor="#b6dbff"><td>', $txt['wireless_navigation'], '</td></tr>
481 <tr><td>[0] <a href="', $scripturl, '?imode" accesskey="0">', $txt['wireless_navigation_up'], '</a></td></tr>
482 </table>
483 </form>';
484 }
485
486 function template_imode_pm()
487 {
488 global $context, $settings, $options, $scripturl, $txt, $user_info;
489
490 if ($_REQUEST['action'] == 'findmember')
491 {
492 echo '
493 <form action="', $scripturl, '?action=findmember;', $context['session_var'], '=', $context['session_id'], ';imode" method="post">
494 <table border="0" cellspacing="0" cellpadding="0">
495 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $txt['wireless_pm_search_member'], '</font></td></tr>
496 <tr bgcolor="#b6dbff"><td>', $txt['find_members'], '</td></tr>
497 <tr><td>
498 <strong>', $txt['wireless_pm_search_name'], ':</strong>
499 <input type="text" name="search" value="', isset($context['last_search']) ? $context['last_search'] : '', '" class="input_text" />', empty($_REQUEST['u']) ? '' : '
500 <input type="hidden" name="u" value="' . $_REQUEST['u'] . '" />', '
501 </td></tr>
502 <tr><td><input type="submit" value="', $txt['search'], '" class="button_submit" /></td></tr>';
503 if (!empty($context['last_search']))
504 {
505 echo '
506 <tr bgcolor="#b6dbff"><td>', $txt['find_results'], '</td></tr>';
507 if (empty($context['results']))
508 echo '
509 <tr bgcolor="#b6dbff"><td>[-] ', $txt['find_no_results'], '</tr></td>';
510 else
511 {
512 echo '
513 <tr bgcolor="#b6dbff"><td>', empty($context['links']['prev']) ? '' : '<a href="' . $context['links']['first'] . ';imode">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';imode">&lt;</a> ', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', empty($context['links']['next']) ? '' : ' <a href="' . $context['links']['next'] . ';imode">&gt;</a> <a href="' . $context['links']['last'] . ';imode">&gt;&gt;</a> ', '</tr></td>';
514 $count = 0;
515 foreach ($context['results'] as $result)
516 {
517 $count++;
518 echo '
519 <tr bgcolor="#b6dbff"><td>
520 ', $count < 10 ? '&#' . (59105 + $count) . '; ' : '', '<a href="', $scripturl, '?action=pm;sa=send;u=', empty($_REQUEST['u']) ? $result['id'] : $_REQUEST['u'] . ',' . $result['id'], ';imode"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $result['name'], '</a>
521 </tr></td>';
522 }
523 }
524 }
525 echo '
526 <tr bgcolor="#b6dbff"><td>', $txt['wireless_navigation'], '</tr></td>
527 <tr><td>[0] <a href="', $context['links']['up'], ';imode" accesskey="0">', $txt['wireless_navigation_up'], '</a></tr></td>';
528 if (!empty($context['results']))
529 echo empty($context['links']['next']) ? '' : '
530 <tr><td>[#] <a href="' . $context['links']['next'] . ';imode" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></tr></td>', empty($context['links']['prev']) ? '' : '
531 <tr><td>[*] <a href="' . $context['links']['prev'] . ';imode" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></tr></td>';
532 echo '
533 </table>
534 </form>';
535 }
536 elseif (!empty($_GET['sa']))
537 {
538 echo '
539 <table border="0" cellspacing="0" cellpadding="0">';
540 if ($_GET['sa'] == 'addbuddy')
541 {
542 echo '
543 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $txt['wireless_pm_add_buddy'], '</font></td></tr>
544 <tr bgcolor="#b6dbff"><td>', $txt['wireless_pm_select_buddy'], '</td></tr>';
545 $count = 0;
546 foreach ($context['buddies'] as $buddy)
547 {
548 $count++;
549 if ($buddy['selected'])
550 echo '
551 <tr><td>[-] <span style="color: gray">', $buddy['name'], '</span></tr></td>';
552 else
553 echo '
554 <tr><td>
555 ', $count < 10 ? '&#' . (59105 + $count) . '; ' : '', '<a href="', $buddy['add_href'], ';imode"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $buddy['name'], '</a>
556 </tr></td>';
557 }
558 echo '
559 <tr bgcolor="#b6dbff"><td>', $txt['wireless_navigation'], '</tr></td>
560 <tr><td>[0] <a href="', $context['pm_href'], ';imode" accesskey="0">', $txt['wireless_navigation_up'], '</a></tr></td>
561 </table>';
562 }
563 if ($_GET['sa'] == 'send' || $_GET['sa'] == 'send2')
564 {
565 echo '
566 <form action="', $scripturl, '?action=pm;sa=send2;imode" method="post">
567 <table border="0" cellspacing="0" cellpadding="0">
568 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $txt['new_message'], '</tr></td>', empty($context['post_error']['messages']) ? '' : '
569 <tr><td><font color="#ff0000">' . implode('<br />', $context['post_error']['messages']) . '</font></tr></td>', '
570 <tr><td>
571 <strong>', $txt['pm_to'], ':</strong> ';
572 if (empty($context['recipients']['to']))
573 echo $txt['wireless_pm_no_recipients'];
574 else
575 {
576 $to_names = array();
577 $ids = array();
578 foreach ($context['recipients']['to'] as $to)
579 {
580 $ids[] = $to['id'];
581 $to_names[] = $to['name'];
582 }
583 echo implode(', ', $to_names);
584 $ids = implode(',', $ids);
585 }
586 echo '
587 ', empty($ids) ? '' : '<input type="hidden" name="u" value="' . $ids . '" />', '<br />
588 <a href="', $scripturl, '?action=findmember', empty($ids) ? '' : ';u=' . $ids, ';', $context['session_var'], '=', $context['session_id'], ';imode">', $txt['wireless_pm_search_member'], '</a>', empty($user_info['buddies']) ? '' : '<br />
589 <a href="' . $scripturl . '?action=pm;sa=addbuddy' . (empty($ids) ? '' : ';u=' . $ids) . ';imode">' . $txt['wireless_pm_add_buddy'] . '</a>', '
590 </tr></td>
591 <tr><td>
592 <strong>', $txt['subject'], ':</strong> <input type="text" name="subject" value="', $context['subject'], '" class="input_text" />
593 </tr></td>
594 <tr><td>
595 <strong>', $txt['message'], ':</strong><br />
596 <textarea name="message" id="message" rows="5" cols="20">', $context['message'], '</textarea>
597 </tr></td>
598 <tr><td>
599 <input type="submit" value="', $txt['send_message'], '" class="button_submit" />
600 <input type="hidden" name="outbox" value="', $context['copy_to_outbox'] ? '1' : '0', '" />
601 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
602 <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
603 <input type="hidden" name="replied_to" value="', !empty($context['quoted_message']['id']) ? $context['quoted_message']['id'] : 0, '" />
604 <input type="hidden" name="pm_head" value="', !empty($context['quoted_message']['pm_head']) ? $context['quoted_message']['pm_head'] : 0, '" />
605 <input type="hidden" name="f" value="', isset($context['folder']) ? $context['folder'] : '', '" />
606 <input type="hidden" name="l" value="', isset($context['current_label_id']) ? $context['current_label_id'] : -1, '" />
607 </tr></td>';
608 if ($context['reply'])
609 echo '
610 <tr bgcolor="#b6dbff"><td>', $txt['wireless_pm_reply_to'], '</tr></td>
611 <tr><td><strong>', $context['quoted_message']['subject'], '</strong></tr></td>
612 <tr><td>', $context['quoted_message']['body'], '</tr></td>';
613 echo '
614 <tr bgcolor="#b6dbff"><td>', $txt['wireless_navigation'], '</tr></td>
615 <tr><td>[0] <a href="', $scripturl, '?action=pm;imode" accesskey="0">', $txt['wireless_navigation_up'], '</a></tr></td>
616 </table>
617 </form>';
618 }
619 }
620 elseif (empty($_GET['pmsg']))
621 {
622 echo '
623 <table border="0" cellspacing="0" cellpadding="0">
624 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $context['current_label_id'] == -1 ? $txt['wireless_pm_inbox'] : $txt['pm_current_label'] . ': ' . $context['current_label'], '</td></tr>
625 <tr><td>', empty($context['links']['prev']) ? '' : '<a href="' . $context['links']['first'] . ';imode">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';imode">&lt;</a> ', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', empty($context['links']['next']) ? '' : ' <a href="' . $context['links']['next'] . ';imode">&gt;</a> <a href="' . $context['links']['last'] . ';imode">&gt;&gt;</a> ', '</tr></td>';
626 $count = 0;
627 while ($message = $context['get_pmessage']())
628 {
629 $count++;
630 echo '
631 <tr><td>
632 ', $count < 10 ? '&#' . (59105 + $count) . '; ' : '', '<a href="', $scripturl, '?action=pm;start=', $context['start'], ';pmsg=', $message['id'], ';l=', $context['current_label_id'], ';imode"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $message['subject'], ' <em>', $txt['wireless_pm_by'], '</em> ', $message['member']['name'], '</a>', $message['is_unread'] ? ' [' . $txt['new'] . ']' : '', '
633 </td></tr>';
634 }
635
636 if ($context['currently_using_labels'])
637 {
638 $labels = array();
639 ksort($context['labels']);
640 foreach ($context['labels'] as $label)
641 $labels[] = '<a href="' . $scripturl . '?action=pm;l=' . $label['id'] . ';imode">' . $label['name'] . '</a>' . (!empty($label['unread_messages']) ? ' (' . $label['unread_messages'] . ')' : '');
642 echo '
643 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $txt['pm_labels'], '</font></td></tr>
644 <tr><td>
645 ', implode(', ', $labels), '
646 </td></tr>';
647 }
648 echo '
649 <tr bgcolor="#b6dbff"><td>', $txt['wireless_navigation'], '</tr></td>
650 <tr><td>[0] <a href="', $scripturl, '?imode" accesskey="0">', $txt['wireless_navigation_up'], '</a></tr></td>', empty($context['links']['next']) ? '' : '
651 <tr><td>[#] <a href="' . $context['links']['next'] . ';imode" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></tr></td>', empty($context['links']['prev']) ? '' : '
652 <tr><td>[*] <a href="' . $context['links']['prev'] . ';imode" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></tr></td>', $context['can_send_pm'] ? '
653 <tr><td><a href="' . $scripturl . '?action=pm;sa=send;imode">' . $txt['new_message'] . '</a></tr></td>' : '', '
654 </table>';
655 }
656 else
657 {
658 $message = $context['get_pmessage']();
659 $message['body'] = preg_replace('~<div class="(?:quote|code)header">(.+?)</div>~', '<br />--- $1 ---', $message['body']);
660 $message['body'] = strip_tags(str_replace(
661 array(
662 '<blockquote>',
663 '</blockquote>',
664 '<code>',
665 '</code>',
666 '<li>',
667 $txt['code_select'],
668 ),
669 array(
670 '<br />',
671 '<br />--- ' . $txt['wireless_end_quote'] . ' ---<br />',
672 '<br />',
673 '<br />--- ' . $txt['wireless_end_code'] . ' ---<br />',
674 '<br />* ',
675 '',
676 ), $message['body']), '<br>');
677
678 echo '
679 <table border="0" cellspacing="0" cellpadding="0">
680 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $message['subject'], '</td></tr>
681 <tr bgcolor="#b6dbff"><td>
682 <strong>', $txt['wireless_pm_by'], ':</strong> ', $message['member']['name'], '<br />
683 <strong>', $txt['on'], ':</strong> ', $message['time'], '
684 </td></tr>
685 <tr><td>
686 ', $message['body'], '
687 </td></tr>
688 <tr bgcolor="#b6dbff"><td>', $txt['wireless_navigation'], '</tr></td>
689 <tr><td>[0] <a href="', $scripturl, '?action=pm;start=', $context['start'], ';l=', $context['current_label_id'], ';imode" accesskey="0">', $txt['wireless_navigation_up'], '</a></tr></td>';
690 if ($context['can_send_pm'])
691 echo '
692 <tr><td><a href="', $scripturl, '?action=pm;sa=send;pmsg=', $message['id'], ';u=', $message['member']['id'], ';reply;imode">', $txt['wireless_pm_reply'], '</a></tr></td>';
693
694 if ($context['can_send_pm'] && $message['number_recipients'] > 1)
695 echo '
696 <tr><td><a href="', $scripturl, '?action=pm;sa=send;pmsg=', $message['id'], ';u=all;reply;imode">', $txt['wireless_pm_reply_all'], '</a></tr></td>';
697
698 echo '
699 </table>';
700 }
701 }
702
703 function template_imode_recent()
704 {
705 global $context, $settings, $options, $scripturl, $txt;
706
707 echo '
708 <table border="0" cellspacing="0" cellpadding="0">
709 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $_REQUEST['action'] == 'unread' ? $txt['wireless_recent_unread_posts'] : $txt['wireless_recent_unread_replies'], '</tr></td>';
710
711 $count = 0;
712 if (empty($context['topics']))
713 echo '
714 <tr><td>', $txt['old_posts'], '</td></tr>';
715 else
716 {
717 echo '
718 <tr><td>', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';imode">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';imode">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';imode">&gt;</a> <a href="' . $context['links']['last'] . ';imode">&gt;&gt;</a> ' : '', '</td></tr>';
719 foreach ($context['topics'] as $topic)
720 {
721 $count++;
722 echo '
723 <tr><td>', $count < 10 ? '&#' . (59105 + $count) . '; ' : '', '<a href="', $scripturl, '?topic=', $topic['id'], '.msg', $topic['new_from'], ';topicseen;imode#new"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $topic['first_post']['subject'], '</a></td></tr>';
724 }
725 }
726 echo '
727 <tr bgcolor="#b6dbff"><td>', $txt['wireless_navigation'], '</td></tr>
728 <tr><td>[0] <a href="', $context['links']['up'], '?imode" accesskey="0">', $txt['wireless_navigation_up'], '</a></td></tr>', !empty($context['links']['next']) ? '
729 <tr><td>[#] <a href="' . $context['links']['next'] . ';imode" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></td></tr>' : '', !empty($context['links']['prev']) ? '
730 <tr><td>[*] <a href="' . $context['links']['prev'] . ';imode" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></td></tr>' : '', '
731 </table>';
732 }
733
734 function template_imode_error()
735 {
736 global $context, $settings, $options, $txt, $scripturl;
737
738 echo '
739 <table border="0" cellspacing="0" cellpadding="0">
740 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $context['error_title'], '</font></td></tr>
741 <tr><td>', $context['error_message'], '</td></tr>
742 <tr class="windowbg"><td>[0] <a href="', $scripturl, '?imode" accesskey="0">', $txt['wireless_error_home'], '</a></td></tr>
743 </table>';
744 }
745
746 function template_imode_profile()
747 {
748 global $context, $settings, $options, $scripturl, $board, $txt;
749
750 echo '
751 <table border="0" cellspacing="0" cellpadding="0">
752 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $txt['summary'], ' - ', $context['member']['name'], '</font></td></tr>
753 <tr><td>
754 <strong>', $txt['name'], ':</strong> ', $context['member']['name'], '
755 </td></tr>
756 <tr><td>
757 <strong>', $txt['position'], ': </strong>', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '
758 </td></tr>
759 <tr><td>
760 <strong>', $txt['lastLoggedIn'], ':</strong> ', $context['member']['last_login'], '
761 </td></tr>';
762
763 if (!empty($context['member']['bans']))
764 {
765 echo '
766 <tr><td>
767 <font color="red"><strong>', $txt['user_banned_by_following'], ':</strong></font>';
768
769 foreach ($context['member']['bans'] as $ban)
770 echo '
771 <br />', $ban['explanation'], '';
772
773 echo '
774 </td></tr>';
775 }
776
777 echo '
778
779 <tr bgcolor="#b6dbff"><td>', $txt['additional_info'], '</td></tr>';
780
781 if (!$context['user']['is_owner'] && $context['can_send_pm'])
782 echo '
783 <tr><td><a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], ';imode">', $txt['wireless_profile_pm'], '.</a></td></tr>';
784
785 if (!$context['user']['is_owner'] && !empty($context['can_edit_ban']))
786 echo '
787 <tr><td><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $context['id_member'], ';imode">', $txt['profileBanUser'], '.</a></td></tr>';
788
789 echo '
790 <tr><td><a href="', $scripturl, '?imode">', $txt['wireless_error_home'], '.</a></td></tr>';
791
792 echo '
793 </table>';
794 }
795
796 function template_imode_ban_edit()
797 {
798 global $context, $settings, $options, $scripturl, $board, $txt, $modSettings;
799
800 echo '
801 <form action="', $scripturl, '?action=admin;area=ban;sa=add;imode" method="post">
802 <table border="0" cellspacing="0" cellpadding="0">
803 <tr bgcolor="#6d92aa"><td><font color="#ffffff">', $context['ban']['is_new'] ? $txt['ban_add_new'] : $txt['ban_edit'] . ' \'' . $context['ban']['name'] . '\'', '</font></td></tr>
804 <tr><td>
805 <strong>', $txt['ban_name'], ': </strong>
806 <input type="text" name="ban_name" value="', $context['ban']['name'], '" size="20" class="input_text" />
807 </td></tr>
808 <tr><td>
809 <strong>', $txt['ban_expiration'], ': </strong><br />
810 <input type="radio" name="expiration" value="never" ', $context['ban']['expiration']['status'] == 'never' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['never'], '<br />
811 <input type="radio" name="expiration" value="one_day" ', $context['ban']['expiration']['status'] == 'still_active_but_we_re_counting_the_days' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_will_expire_within'], ' <input type="text" name="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" /> ', $txt['ban_days'], '<br />
812 <input type="radio" name="expiration" value="expired" ', $context['ban']['expiration']['status'] == 'expired' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_expired'], '<br />
813 </td></tr>
814 <tr><td>
815 <strong>', $txt['ban_reason'], ': </strong>
816 <input type="text" name="reason" value="', $context['ban']['reason'], '" size="20" class="input_text" />
817 </td></tr>
818 <tr><td>
819 <strong>', $txt['ban_notes'], ': </strong><br />
820 <textarea name="notes" cols="20" rows="3">', $context['ban']['notes'], '</textarea>
821 </td></tr>
822 <tr><td>
823 <strong>', $txt['ban_restriction'], ': </strong><br />
824 <input type="checkbox" name="full_ban" value="1"', $context['ban']['cannot']['access'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['ban_full_ban'], '<br />
825 <input type="checkbox" name="cannot_post" value="1"', $context['ban']['cannot']['post'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['ban_cannot_post'], '<br />
826 <input type="checkbox" name="cannot_register" value="1"', $context['ban']['cannot']['register'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['ban_cannot_register'], '<br />
827 <input type="checkbox" name="cannot_login" value="1"', $context['ban']['cannot']['login'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['ban_cannot_login'], '
828 </td></tr>';
829
830 if (!empty($context['ban_suggestions']))
831 {
832 echo '
833 <tr bgcolor="#b6dbff"><td>', $txt['ban_triggers'], '</td></tr>
834 <tr><td>
835 <input type="checkbox" name="ban_suggestion[]" value="main_ip" class="input_check" /> <strong>', $txt['wireless_ban_ip'], ':</strong><br />
836 &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="20" class="input_text" />
837 </td></tr>';
838
839 if (empty($modSettings['disableHostnameLookup']))
840 echo '
841 <tr><td>
842 <input type="checkbox" name="ban_suggestion[]" value="hostname" class="input_check" /> <strong>', $txt['wireless_ban_hostname'], ':</strong><br />
843 &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="20" class="input_text" />
844 </td></tr>';
845
846 echo '
847 <tr><td>
848 <input type="checkbox" name="ban_suggestion[]" value="email" class="input_check" /> <strong>', $txt['wireless_ban_email'], ':</strong><br />
849 &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="email" value="', $context['ban_suggestions']['email'], '" size="20" class="input_text" />
850 </td></tr>
851 <tr><td>
852 <input type="checkbox" name="ban_suggestion[]" value="user" class="input_check" /> <strong>', $txt['ban_on_username'], ':</strong><br />';
853
854 if (empty($context['ban_suggestions']['member']['id']))
855 echo '
856 &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="user" value="" size="20" class="input_text" />';
857 else
858 echo '
859 &nbsp;&nbsp;&nbsp;&nbsp;', $context['ban_suggestions']['member']['name'], '
860 <input type="hidden" name="bannedUser" value="', $context['ban_suggestions']['member']['id'], '" />';
861
862 echo '
863 </td></tr>';
864 }
865
866 echo '
867 <tr><td><input type="submit" name="', $context['ban']['is_new'] ? 'add_ban' : 'modify_ban', '" value="', $context['ban']['is_new'] ? $txt['ban_add'] : $txt['ban_modify'], '" class="button_submit" /></td></tr>
868 <tr bgcolor="#b6dbff"><td>', $txt['wireless_additional_info'], '</td></tr>
869 <tr><td><a href="', $scripturl, '?imode">', $txt['wireless_error_home'], '.</a></td></tr>';
870
871 echo '
872 </table>
873 <input type="hidden" name="old_expire" value="', $context['ban']['expiration']['days'], '" />
874 <input type="hidden" name="bg" value="', $context['ban']['id'], '" />
875 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
876 </form>';
877 }
878
879 function template_imode_below()
880 {
881 global $context, $settings, $options, $txt;
882
883 echo '
884 <br /><a href="', $context['linktree'][count($context['linktree']) - 1]['url'], (count($context['linktree']) > 1 ? ';' : '?'), 'nowap" rel="nofollow">', $txt['wireless_go_to_full_version'], '</a>
885 </body>
886 </html>';
887 }
888
889 // XHTMLMP (XHTML Mobile Profile) templates used for WAP 2.0 start here
890 function template_wap2_above()
891 {
892 global $context, $settings, $options, $user_info;
893
894 echo '<?xml version="1.0" encoding="', $context['character_set'], '"?', '>
895 <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
896 <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
897 <head>
898 <title>', $context['page_title'], '</title>';
899
900 // Present a canonical url for search engines to prevent duplicate content in their indices.
901 if ($user_info['is_guest'] && !empty($context['canonical_url']))
902 echo '
903 <link rel="canonical" href="', $context['canonical_url'], '" />';
904
905 echo '
906 <link rel="stylesheet" href="', $settings['default_theme_url'], '/css/wireless.css" type="text/css" />
907 </head>
908 <body>';
909 }
910
911 function template_wap2_boardindex()
912 {
913 global $context, $settings, $options, $scripturl, $txt;
914
915 echo '
916 <p class="catbg">', $context['forum_name_html_safe'], '</p>';
917
918 $count = 0;
919 foreach ($context['categories'] as $category)
920 {
921 if (!empty($category['boards']) || $category['is_collapsed'])
922 echo '
923 <p class="titlebg">', $category['can_collapse'] ? '<a href="' . $scripturl . '?action=collapse;c=' . $category['id'] . ';sa=' . ($category['is_collapsed'] ? 'expand;' : 'collapse;') . $context['session_var'] . '=' . $context['session_id'] . ';wap2">' : '', $category['name'], $category['can_collapse'] ? '</a>' : '', '</p>';
924
925 foreach ($category['boards'] as $board)
926 {
927 $count++;
928 echo '
929 <p class="windowbg">', $board['new'] ? '<span class="updated">' : '', $count < 10 ? '[' . $count . '' : '[-', $board['children_new'] && !$board['new'] ? '<span class="updated">' : '', '] ', $board['new'] || $board['children_new'] ? '</span>' : '', '<a href="', $scripturl, '?board=', $board['id'], '.0;wap2"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $board['name'], '</a></p>';
930 }
931 }
932
933 echo '
934 <p class="titlebg">', $txt['wireless_options'], '</p>';
935 if ($context['user']['is_guest'])
936 echo '
937 <p class="windowbg"><a href="', $scripturl, '?action=login;wap2">', $txt['wireless_options_login'], '</a></p>';
938 else
939 {
940 if ($context['allow_pm'])
941 echo '
942 <p class="windowbg"><a href="', $scripturl, '?action=pm;wap2">', empty($context['user']['unread_messages']) ? $txt['wireless_pm_inbox'] : sprintf($txt['wireless_pm_inbox_new'], $context['user']['unread_messages']), '</a></p>';
943 echo '
944 <p class="windowbg"><a href="', $scripturl, '?action=unread;wap2">', $txt['wireless_recent_unread_posts'], '</a></p>
945 <p class="windowbg"><a href="', $scripturl, '?action=unreadreplies;wap2">', $txt['wireless_recent_unread_replies'], '</a></p>
946 <p class="windowbg"><a href="', $scripturl, '?action=logout;', $context['session_var'], '=', $context['session_id'], ';wap2">', $txt['wireless_options_logout'], '</a></p>';
947 }
948 }
949
950 function template_wap2_messageindex()
951 {
952 global $context, $settings, $options, $scripturl, $txt;
953
954 echo '
955 <p class="catbg">', $context['name'], '</p>';
956
957 if (!empty($context['boards']))
958 {
959 echo '
960 <p class="titlebg">', $txt['parent_boards'], '</p>';
961 foreach ($context['boards'] as $board)
962 echo '
963 <p class="windowbg">', $board['new'] ? '<span class="updated">[-] </span>' : ($board['children_new'] ? '[-<span class="updated">] </span>' : '[-] '), '<a href="', $scripturl, '?board=', $board['id'], '.0;wap2">', $board['name'], '</a></p>';
964 }
965
966 $count = 0;
967 if (!empty($context['topics']))
968 {
969 echo '
970 <p class="titlebg">', $txt['topics'], '</p>
971 <p class="windowbg">', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';wap2">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap2">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';wap2">&gt;</a> <a href="' . $context['links']['last'] . ';wap2">&gt;&gt;</a> ' : '', '</p>';
972 foreach ($context['topics'] as $topic)
973 {
974 $count++;
975 echo '
976 <p class="windowbg">', $count < 10 ? '[' . $count . '] ' : '', '<a href="', $scripturl, '?topic=', $topic['id'], '.0;wap2"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $topic['first_post']['subject'], '</a>', (!$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), $topic['new'] && $context['user']['is_logged'] ? ' [<a href="' . $scripturl . '?topic=' . $topic['id'] . '.msg' . $topic['new_from'] . ';wap2#new" class="new">' . $txt['new'] . '</a>]' : '', '</p>';
977 }
978 }
979
980 echo '
981 <p class="titlebg">', $txt['wireless_navigation'], '</p>
982 <p class="windowbg">[0] <a href="', $context['links']['up'], ($context['links']['up'] == $scripturl . '?' ? '' : ';'), 'wap2" accesskey="0">', $txt['wireless_navigation_up'], '</a></p>', !empty($context['links']['next']) ? '
983 <p class="windowbg">[#] <a href="' . $context['links']['next'] . ';wap2" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></p>' : '', !empty($context['links']['prev']) ? '
984 <p class="windowbg">[*] <a href="' . $context['links']['prev'] . ';wap2" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></p>' : '', $context['can_post_new'] ? '
985 <p class="windowbg"><a href="' . $scripturl . '?action=post;board=' . $context['current_board'] . '.0;wap2">' . $txt['start_new_topic'] . '</a></p>' : '';
986 }
987
988 function template_wap2_display()
989 {
990 global $context, $settings, $options, $scripturl, $txt;
991
992 echo '
993 <p class="titlebg">' . $context['linktree'][1]['name'] . ' > ' . $context['linktree'][count($context['linktree']) - 2]['name'] . '</p>
994 <p class="catbg">', $context['subject'], '</p>
995 <p class="windowbg">', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';wap2">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap2">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';wap2">&gt;</a> <a href="' . $context['links']['last'] . ';wap2">&gt;&gt;</a> ' : '', '</p>';
996 $alternate = true;
997 while ($message = $context['get_message']())
998 {
999 // This is a special modification to the post so it will work on phones:
1000 $message['body'] = preg_replace('~<div class="(?:quote|code)header">(.+?)</div>~', '<br />--- $1 ---', $message['body']);
1001 $message['body'] = strip_tags(str_replace(
1002 array(
1003 '<blockquote>',
1004 '</blockquote>',
1005 '<code>',
1006 '</code>',
1007 '<li>',
1008 $txt['code_select'],
1009 ),
1010 array(
1011 '<br />',
1012 '<br />--- ' . $txt['wireless_end_quote'] . ' ---<br />',
1013 '<br />',
1014 '<br />--- ' . $txt['wireless_end_code'] . ' ---<br />',
1015 '<br />* ',
1016 '',
1017 ), $message['body']), '<br>');
1018
1019 echo $message['first_new'] ? '
1020 <a id="new"></a>' : '', '
1021 <p class="windowbg', $alternate ? '' : '2', '">
1022 ', $context['wireless_moderate'] && $message['member']['id'] ? '<a href="' . $scripturl . '?action=profile;u=' . $message['member']['id'] . ';wap2">' . $message['member']['name'] . '</a>' : '<strong>' . $message['member']['name'] . '</strong>', ':
1023 ', ((empty($context['wireless_more']) && $message['can_modify']) || !empty($context['wireless_moderate']) ? '[<a href="' . $scripturl . '?action=post;msg=' . $message['id'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';wap2">' . $txt['wireless_display_edit'] . '</a>]' : ''), (!$message['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '<br />
1024 ', $message['body'], '
1025 </p>';
1026 $alternate = !$alternate;
1027 }
1028 echo '
1029 <p class="titlebg">', $txt['wireless_navigation'], '</p>
1030 <p class="windowbg">[0] <a href="', $context['links']['up'], ';wap2" accesskey="0">', $txt['wireless_navigation_index'], '</a></p>', $context['user']['is_logged'] ? '
1031 <p class="windowbg">[1] <a href="' . $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time']. ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';wap2" accesskey="1">' . $txt['mark_unread'] . '</a></p>' : '', !empty($context['links']['next']) ? '
1032 <p class="windowbg">[#] <a href="' . $context['links']['next'] . ';wap2' . $context['wireless_moderate'] . '" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></p>' : '', !empty($context['links']['prev']) ? '
1033 <p class="windowbg">[*] <a href="' . $context['links']['prev'] . ';wap2' . $context['wireless_moderate'] . '" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></p>' : '', $context['can_reply'] ? '
1034 <p class="windowbg"><a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';wap2">' . $txt['reply'] . '</a></p>' : '';
1035
1036 if (!empty($context['wireless_more']) && empty($context['wireless_moderate']))
1037 echo '
1038 <p class="windowbg"><a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], ';moderate;wap2">', $txt['wireless_display_moderate'], '</a></p>';
1039 elseif (!empty($context['wireless_moderate']))
1040 {
1041 if ($context['can_sticky'])
1042 echo '
1043 <p class="windowbg"><a href="', $scripturl, '?action=sticky;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';wap2">', $txt['wireless_display_' . ($context['is_sticky'] ? 'unsticky' : 'sticky')], '</a></p>';
1044 if ($context['can_lock'])
1045 echo '
1046 <p class="windowbg"><a href="', $scripturl, '?action=lock;topic=', $context['current_topic'], '.', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';wap2">', $txt['wireless_display_' . ($context['is_locked'] ? 'unlock' : 'lock')], '</a></p>';
1047 }
1048 }
1049
1050 function template_wap2_login()
1051 {
1052 global $context, $modSettings, $scripturl, $txt;
1053
1054 echo '
1055 <form action="', $scripturl, '?action=login2;wap2" method="post">
1056 <p class="catbg">', $txt['login'], '</p>';
1057
1058 if (isset($context['login_errors']))
1059 foreach ($context['login_errors'] as $error)
1060 echo '
1061 <p class="windowbg" style="color: #ff0000;"><strong>', $error, '</strong></p>';
1062
1063 echo '
1064 <p class="windowbg">', $txt['username'], ':</p>
1065 <p class="windowbg"><input type="text" name="user" size="10" class="input_text" /></p>
1066 <p class="windowbg">', $txt['password'], ':</p>
1067 <p class="windowbg"><input type="password" name="passwrd" size="10" class="input_password" /></p>';
1068
1069 // Open ID?
1070 if (!empty($modSettings['enableOpenID']))
1071 echo '
1072 <p class="windowbg"><strong>&mdash;', $txt['or'], '&mdash;</strong></p>
1073 <p class="windowbg">', $txt['openid'], ':</p>
1074 <p class="windowbg"><input type="text" name="openid_identifier" class="input_text openid_login" size="17" /></p>';
1075
1076 echo '
1077 <p class="windowbg"><input type="submit" value="', $txt['login'], '" class="button_submit" /><input type="hidden" name="cookieneverexp" value="1" /></p>
1078 <p class="catbg">', $txt['wireless_navigation'], '</p>
1079 <p class="windowbg">[0] <a href="', $scripturl, '?wap2" accesskey="0">', $txt['wireless_navigation_up'], '</a></p>
1080 </form>';
1081 }
1082
1083 function template_wap2_post()
1084 {
1085 global $context, $settings, $options, $scripturl, $txt, $modSettings;
1086
1087 echo '
1088 <form action="', $scripturl, '?action=', $context['destination'], ';board=', $context['current_board'], '.0;wap2" method="post">
1089 <p class="titlebg">', $context['page_title'], '</p>';
1090
1091 if (!$context['becomes_approved'])
1092 echo '
1093 <p class="windowbg">
1094 ' . $txt['wait_for_approval'] . '
1095 <input type="hidden" name="not_approved" value="1" />
1096 </p>';
1097
1098 if ($context['locked'])
1099 echo '
1100 <p class="windowbg">
1101 ' . $txt['topic_locked_no_reply'] . '
1102 </p>';
1103
1104 if (isset($context['name']) && isset($context['email']))
1105 {
1106 echo '
1107 <p class="windowbg"' . (isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) ? ' style="color: #ff0000"' : '') . '>
1108 ' . $txt['username'] . ': <input type="text" name="guestname" value="' . $context['name'] . '" class="input_text" />
1109 </p>';
1110
1111 if (empty($modSettings['guest_post_no_email']))
1112 echo '
1113 <p class="windowbg"' . (isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' style="color: #ff0000"' : '') . '>
1114 ' . $txt['email'] . ': <input type="text" name="email" value="' . $context['email'] . '" class="input_text" />
1115 </p>';
1116 }
1117
1118 if ($context['require_verification'])
1119 echo '
1120 <p class="windowbg"', !empty($context['post_error']['need_qr_verification']) ? ' style="color: #ff0000"' : '', '>
1121 ' . $txt['verification'] . ': ', template_control_verification($context['visual_verification_id'], 'all'), '
1122 </p>';
1123
1124 echo '
1125 <p class="windowbg"', isset($context['post_error']['no_subject']) ? ' style="color: #ff0000"' : '', '>
1126 ', $txt['subject'], ': <input type="text" name="subject"', $context['subject'] == '' ? '' : ' value="' . $context['subject'] . '"', ' maxlength="80" class="input_text" />
1127 </p>
1128 <p class="windowbg"', isset($context['post_error']['no_message']) || isset($context['post_error']['long_message']) ? ' style="color: #ff0000;"' : '', '>
1129 ', $txt['message'], ': <br />
1130 <textarea name="message" id="message" rows="5" cols="20">', $context['message'], '</textarea>
1131 </p>
1132 <p class="windowbg">
1133 <input type="submit" name="post" value="', $context['submit_label'], '" class="button_submit" />
1134 <input type="hidden" name="icon" value="wireless" />
1135 <input type="hidden" name="goback" value="', $context['back_to_topic'] || !empty($options['return_to_post']) ? '1' : '0', '" />
1136 <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
1137 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />', isset($context['current_topic']) ? '
1138 <input type="hidden" name="topic" value="' . $context['current_topic'] . '" />' : '', '
1139 <input type="hidden" name="notify" value="', $context['notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
1140 </p>
1141 <p class="windowbg">[0] ', !empty($context['current_topic']) ? '<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.new;wap2">' . $txt['wireless_navigation_topic'] . '</a>' : '<a href="' . $scripturl . '?board=' . $context['current_board'] . '.0;wap2" accesskey="0">' . $txt['wireless_navigation_index'] . '</a>', '</p>
1142 </form>';
1143 }
1144
1145 function template_wap2_pm()
1146 {
1147 global $context, $settings, $options, $scripturl, $txt, $user_info;
1148
1149 if ($_REQUEST['action'] == 'findmember')
1150 {
1151 echo '
1152 <form action="', $scripturl, '?action=findmember;', $context['session_var'], '=', $context['session_id'], ';wap2" method="post">
1153 <p class="catbg">', $txt['wireless_pm_search_member'], '</p>
1154 <p class="titlebg">', $txt['find_members'], '</p>
1155 <p class="windowbg">
1156 <strong>', $txt['wireless_pm_search_name'], ':</strong>
1157 <input type="text" name="search" value="', isset($context['last_search']) ? $context['last_search'] : '', '" class="input_text" />', empty($_REQUEST['u']) ? '' : '
1158 <input type="hidden" name="u" value="' . $_REQUEST['u'] . '" />', '
1159 </p>
1160 <p class="windowbg"><input type="submit" value="', $txt['search'], '" class="button_submit" /></p>
1161 </form>';
1162 if (!empty($context['last_search']))
1163 {
1164 echo '
1165 <p class="titlebg">', $txt['find_results'], '</p>';
1166 if (empty($context['results']))
1167 echo '
1168 <p class="windowbg">[-] ', $txt['find_no_results'], '</p>';
1169 else
1170 {
1171 echo '
1172 <p class="windowbg">', empty($context['links']['prev']) ? '' : '<a href="' . $context['links']['first'] . ';wap2">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap2">&lt;</a> ', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', empty($context['links']['next']) ? '' : ' <a href="' . $context['links']['next'] . ';wap2">&gt;</a> <a href="' . $context['links']['last'] . ';wap2">&gt;&gt;</a> ', '</p>';
1173 $count = 0;
1174 foreach ($context['results'] as $result)
1175 {
1176 $count++;
1177 echo '
1178 <p class="windowbg">
1179 [', $count < 10 ? $count : '-', '] <a href="', $scripturl, '?action=pm;sa=send;u=', empty($_REQUEST['u']) ? $result['id'] : $_REQUEST['u'] . ',' . $result['id'], ';wap2"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $result['name'], '</a>
1180 </p>';
1181 }
1182 }
1183 }
1184 echo '
1185 <p class="titlebg">', $txt['wireless_navigation'], '</p>
1186 <p class="windowbg">[0] <a href="', $context['links']['up'], ';wap2" accesskey="0">', $txt['wireless_navigation_up'], '</a></p>';
1187 if (!empty($context['results']))
1188 echo empty($context['links']['next']) ? '' : '
1189 <p class="windowbg">[#] <a href="' . $context['links']['next'] . ';wap2" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></p>', empty($context['links']['prev']) ? '' : '
1190 <p class="windowbg">[*] <a href="' . $context['links']['prev'] . ';wap2" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></p>';
1191 }
1192 elseif (!empty($_GET['sa']))
1193 {
1194 if ($_GET['sa'] == 'addbuddy')
1195 {
1196 echo '
1197 <p class="catbg">', $txt['wireless_pm_add_buddy'], '</p>
1198 <p class="titlebg">', $txt['wireless_pm_select_buddy'], '</p>';
1199 $count = 0;
1200 foreach ($context['buddies'] as $buddy)
1201 {
1202 $count++;
1203 if ($buddy['selected'])
1204 echo '
1205 <p class="windowbg">[-] <span style="color: gray">', $buddy['name'], '</span></p>';
1206 else
1207 echo '
1208 <p class="windowbg">
1209 [', $count < 10 ? $count : '-', '] <a href="', $buddy['add_href'], ';wap2"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $buddy['name'], '</a>
1210 </p>';
1211 }
1212 echo '
1213 <p class="titlebg">', $txt['wireless_navigation'], '</p>
1214 <p class="windowbg">[0] <a href="', $context['pm_href'], ';wap2" accesskey="0">', $txt['wireless_navigation_up'], '</a></p>';
1215 }
1216 if ($_GET['sa'] == 'send' || $_GET['sa'] == 'send2')
1217 {
1218 echo '
1219 <form action="', $scripturl, '?action=pm;sa=send2;wap2" method="post">
1220 <p class="catbg">', $txt['new_message'], '</p>', empty($context['post_error']['messages']) ? '' : '
1221 <p class="windowbg error">' . implode('<br />', $context['post_error']['messages']) . '</p>', '
1222 <p class="windowbg">
1223 <strong>', $txt['pm_to'], ':</strong> ';
1224 if (empty($context['recipients']['to']))
1225 echo $txt['wireless_pm_no_recipients'];
1226 else
1227 {
1228 $to_names = array();
1229 $ids = array();
1230 foreach ($context['recipients']['to'] as $to)
1231 {
1232 $ids[] = $to['id'];
1233 $to_names[] = $to['name'];
1234 }
1235 echo implode(', ', $to_names);
1236 $ids = implode(',', $ids);
1237 }
1238 echo '
1239 ', empty($ids) ? '' : '<input type="hidden" name="u" value="' . $ids . '" />', '<br />
1240 <a href="', $scripturl, '?action=findmember', empty($ids) ? '' : ';u=' . $ids, ';', $context['session_var'], '=', $context['session_id'], ';wap2">', $txt['wireless_pm_search_member'], '</a>', empty($user_info['buddies']) ? '' : '<br />
1241 <a href="' . $scripturl . '?action=pm;sa=addbuddy' . (empty($ids) ? '' : ';u=' . $ids) . ';wap2">' . $txt['wireless_pm_add_buddy'] . '</a>', '
1242 </p>
1243 <p class="windowbg">
1244 <strong>', $txt['subject'], ':</strong> <input type="text" name="subject" value="', $context['subject'], '" />
1245 </p>
1246 <p class="windowbg">
1247 <strong>', $txt['message'], ':</strong><br />
1248 <textarea name="message" id="message" rows="5" cols="20">', $context['message'], '</textarea>
1249 </p>
1250 <p class="windowbg">
1251 <input type="submit" value="', $txt['send_message'], '" class="button_submit" />
1252 <input type="hidden" name="outbox" value="', $context['copy_to_outbox'] ? '1' : '0', '" />
1253 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
1254 <input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '" />
1255 <input type="hidden" name="replied_to" value="', !empty($context['quoted_message']['id']) ? $context['quoted_message']['id'] : 0, '" />
1256 <input type="hidden" name="pm_head" value="', !empty($context['quoted_message']['pm_head']) ? $context['quoted_message']['pm_head'] : 0, '" />
1257 <input type="hidden" name="f" value="', isset($context['folder']) ? $context['folder'] : '', '" />
1258 <input type="hidden" name="l" value="', isset($context['current_label_id']) ? $context['current_label_id'] : -1, '" />
1259 </p>';
1260 if ($context['reply'])
1261 echo '
1262 <p class="titlebg">', $txt['wireless_pm_reply_to'], '</p>
1263 <p class="windowbg"><strong>', $context['quoted_message']['subject'], '</strong></p>
1264 <p class="windowbg">', $context['quoted_message']['body'], '</p>';
1265 echo '
1266 <p class="titlebg">', $txt['wireless_navigation'], '</p>
1267 <p class="windowbg">[0] <a href="', $scripturl, '?action=pm;wap2" accesskey="0">', $txt['wireless_navigation_up'], '</a></p>
1268 </form>';
1269 }
1270 }
1271 elseif (empty($_GET['pmsg']))
1272 {
1273 echo '
1274 <p class="catbg">', $context['current_label_id'] == -1 ? $txt['wireless_pm_inbox'] : $txt['pm_current_label'] . ': ' . $context['current_label'], '</p>
1275 <p class="windowbg">', empty($context['links']['prev']) ? '' : '<a href="' . $context['links']['first'] . ';wap2">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap2">&lt;</a> ', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', empty($context['links']['next']) ? '' : ' <a href="' . $context['links']['next'] . ';wap2">&gt;</a> <a href="' . $context['links']['last'] . ';wap2">&gt;&gt;</a> ', '</p>';
1276 $count = 0;
1277 while ($message = $context['get_pmessage']())
1278 {
1279 $count++;
1280 echo '
1281 <p class="windowbg">
1282 [', $count < 10 ? $count : '-', '] <a href="', $scripturl, '?action=pm;start=', $context['start'], ';pmsg=', $message['id'], ';l=', $context['current_label_id'], ';wap2"', $count < 10 ? ' accesskey="' . $count . '"' : '', '>', $message['subject'], ' <em>', $txt['wireless_pm_by'], '</em> ', $message['member']['name'], '</a>', $message['is_unread'] ? ' [' . $txt['new'] . ']' : '', '
1283 </p>';
1284 }
1285
1286 if ($context['currently_using_labels'])
1287 {
1288 $labels = array();
1289 ksort($context['labels']);
1290 foreach ($context['labels'] as $label)
1291 $labels[] = '<a href="' . $scripturl . '?action=pm;l=' . $label['id'] . ';wap2">' . $label['name'] . '</a>' . (!empty($label['unread_messages']) ? ' (' . $label['unread_messages'] . ')' : '');
1292 echo '
1293 <p class="catbg">
1294 ', $txt['pm_labels'], '
1295 </p>
1296 <p class="windowbg">
1297 ', implode(', ', $labels), '
1298 </p>';
1299 }
1300
1301 echo '
1302 <p class="titlebg">', $txt['wireless_navigation'], '</p>
1303 <p class="windowbg">[0] <a href="', $scripturl, '?wap2" accesskey="0">', $txt['wireless_navigation_up'], '</a></p>', empty($context['links']['next']) ? '' : '
1304 <p class="windowbg">[#] <a href="' . $context['links']['next'] . ';wap2" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></p>', empty($context['links']['prev']) ? '' : '
1305 <p class="windowbg">[*] <a href="' . $context['links']['prev'] . ';wap2" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></p>', $context['can_send_pm'] ? '
1306 <p class="windowbg"><a href="' . $scripturl . '?action=pm;sa=send;wap2">' . $txt['new_message'] . '</a></p>' : '';
1307 }
1308 else
1309 {
1310 $message = $context['get_pmessage']();
1311 $message['body'] = preg_replace('~<div class="(?:quote|code)header">(.+?)</div>~', '<br />--- $1 ---', $message['body']);
1312 $message['body'] = strip_tags(str_replace(
1313 array(
1314 '<blockquote>',
1315 '</blockquote>',
1316 '<code>',
1317 '</code>',
1318 '<li>',
1319 $txt['code_select'],
1320 ),
1321 array(
1322 '<br />',
1323 '<br />--- ' . $txt['wireless_end_quote'] . ' ---<br />',
1324 '<br />',
1325 '<br />--- ' . $txt['wireless_end_code'] . ' ---<br />',
1326 '<br />* ',
1327 '',
1328 ), $message['body']), '<br>');
1329
1330 echo '
1331 <p class="catbg">', $message['subject'], '</p>
1332 <p class="titlebg">
1333 <strong>', $txt['wireless_pm_by'], ':</strong> ', $message['member']['name'], '<br />
1334 <strong>', $txt['on'], ':</strong> ', $message['time'], '
1335 </p>
1336 <p class="windowbg">
1337 ', $message['body'], '
1338 </p>
1339 <p class="titlebg">', $txt['wireless_navigation'], '</p>
1340 <p class="windowbg">[0] <a href="', $scripturl, '?action=pm;start=', $context['start'], ';l=', $context['current_label_id'], ';wap2" accesskey="0">', $txt['wireless_navigation_up'], '</a></p>';
1341 if ($context['can_send_pm'])
1342 echo '
1343 <p class="windowbg"><a href="', $scripturl, '?action=pm;sa=send;pmsg=', $message['id'], ';u=', $message['member']['id'], ';reply;wap2">', $txt['wireless_pm_reply'], '</a></p>';
1344
1345 if ($context['can_send_pm'] && $message['number_recipients'] > 1)
1346 echo '
1347 <p class="windowbg"><a href="', $scripturl, '?action=pm;sa=send;pmsg=', $message['id'], ';u=all;reply;wap2">', $txt['wireless_pm_reply_all'], '</a></p>';
1348
1349 }
1350 }
1351
1352 function template_wap2_recent()
1353 {
1354 global $context, $settings, $options, $scripturl, $txt;
1355
1356 echo '
1357 <p class="catbg">', $_REQUEST['action'] == 'unread' ? $txt['wireless_recent_unread_posts'] : $txt['wireless_recent_unread_replies'], '</p>';
1358
1359 $count = 0;
1360 if (empty($context['topics']))
1361 echo '
1362 <p class="windowbg">', $txt['old_posts'], '</p>';
1363 else
1364 {
1365 echo '
1366 <p class="windowbg">', !empty($context['links']['prev']) ? '<a href="' . $context['links']['first'] . ';wap2">&lt;&lt;</a> <a href="' . $context['links']['prev'] . ';wap2">&lt;</a> ' : '', '(', $context['page_info']['current_page'], '/', $context['page_info']['num_pages'], ')', !empty($context['links']['next']) ? ' <a href="' . $context['links']['next'] . ';wap2">&gt;</a> <a href="' . $context['links']['last'] . ';wap2">&gt;&gt;</a> ' : '', '</p>';
1367 foreach ($context['topics'] as $topic)
1368 {
1369 $count++;
1370 echo '
1371 <p class="windowbg">', ($count < 10 ? '[' . $count . '] ' : ''), '<a href="', $scripturl, '?topic=', $topic['id'], '.msg', $topic['new_from'], ';topicseen;wap2#new"', ($count < 10 ? ' accesskey="' . $count . '"' : ''), '>', $topic['first_post']['subject'], '</a></p>';
1372 }
1373 }
1374 echo '
1375 <p class="titlebg">', $txt['wireless_navigation'], '</p>
1376 <p class="windowbg">[0] <a href="', $context['links']['up'], '?wap2" accesskey="0">', $txt['wireless_navigation_up'], '</a></p>', !empty($context['links']['next']) ? '
1377 <p class="windowbg">[#] <a href="' . $context['links']['next'] . ';wap2" accesskey="#">' . $txt['wireless_navigation_next'] . '</a></p>' : '', !empty($context['links']['prev']) ? '
1378 <p class="windowbg">[*] <a href="' . $context['links']['prev'] . ';wap2" accesskey="*">' . $txt['wireless_navigation_prev'] . '</a></p>' : '';
1379 }
1380
1381 function template_wap2_error()
1382 {
1383 global $context, $settings, $options, $txt, $scripturl;
1384
1385 echo '
1386 <p class="catbg">', $context['error_title'], '</p>
1387 <p class="windowbg">', $context['error_message'], '</p>
1388 <p class="windowbg">[0] <a href="', $scripturl, '?wap2" accesskey="0">', $txt['wireless_error_home'], '</a></p>';
1389 }
1390
1391 function template_wap2_profile()
1392 {
1393 global $context, $settings, $options, $scripturl, $board, $txt;
1394
1395 echo '
1396 <p class="catbg">', $txt['summary'], ' - ', $context['member']['name'], '</p>
1397 <p class="windowbg"><strong>', $txt['name'], ':</strong> ', $context['member']['name'], '</p>
1398 <p class="windowbg"><strong>', $txt['position'], ': </strong>', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</p>
1399 <p class="windowbg"><strong>', $txt['lastLoggedIn'], ':</strong> ', $context['member']['last_login'], '</p>';
1400
1401 if (!empty($context['member']['bans']))
1402 {
1403 echo '
1404 <p class="titlebg"><strong>', $txt['user_banned_by_following'], ':</strong></p>';
1405
1406 foreach ($context['member']['bans'] as $ban)
1407 echo '
1408 <p class="windowbg">', $ban['explanation'], '</p>';
1409
1410 }
1411
1412 echo '
1413
1414 <p class="titlebg">', $txt['additional_info'], '</p>';
1415
1416 if (!$context['user']['is_owner'] && $context['can_send_pm'])
1417 echo '
1418 <p class="windowbg"><a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], ';wap2">', $txt['wireless_profile_pm'], '.</a></p>';
1419
1420 if (!$context['user']['is_owner'] && !empty($context['can_edit_ban']))
1421 echo '
1422 <p class="windowbg"><a href="', $scripturl, '?action=admin;area=ban;sa=add;u=', $context['id_member'], ';wap2">', $txt['profileBanUser'], '.</a></p>';
1423
1424 echo '
1425 <p class="windowbg"><a href="', $scripturl, '?wap2">', $txt['wireless_error_home'], '.</a></p>';
1426
1427 }
1428
1429 function template_wap2_ban_edit()
1430 {
1431 global $context, $settings, $options, $scripturl, $board, $txt, $modSettings;
1432
1433 echo '
1434 <form action="', $scripturl, '?action=admin;area=ban;sa=add;wap2" method="post">
1435 <p class="catbg">', $context['ban']['is_new'] ? $txt['ban_add_new'] : $txt['ban_edit'] . ' \'' . $context['ban']['name'] . '\'', '</p>
1436 <p class="windowbg">
1437 <strong>', $txt['ban_name'], ': </strong>
1438 <input type="text" name="ban_name" value="', $context['ban']['name'], '" size="20" class="input_text" />
1439 </p>
1440 <p class="windowbg">
1441 <strong>', $txt['ban_expiration'], ': </strong><br />
1442 <input type="radio" name="expiration" value="never" ', $context['ban']['expiration']['status'] == 'never' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['never'], '<br />
1443 <input type="radio" name="expiration" value="one_day" ', $context['ban']['expiration']['status'] == 'still_active_but_we_re_counting_the_days' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_will_expire_within'], ' <input type="text" name="expire_date" size="3" value="', $context['ban']['expiration']['days'], '" /> ', $txt['ban_days'], '<br />
1444 <input type="radio" name="expiration" value="expired" ', $context['ban']['expiration']['status'] == 'expired' ? ' checked="checked"' : '', ' class="input_radio" /> ', $txt['ban_expired'], '<br />
1445 </p>
1446 <p class="windowbg">
1447 <strong>', $txt['ban_reason'], ': </strong>
1448 <input type="text" name="reason" value="', $context['ban']['reason'], '" size="20" class="input_text" />
1449 </p>
1450 <p class="windowbg">
1451 <strong>', $txt['ban_notes'], ': </strong><br />
1452 <textarea name="notes" cols="20" rows="3">', $context['ban']['notes'], '</textarea>
1453 </p>
1454 <p class="windowbg">
1455 <strong>', $txt['ban_restriction'], ': </strong><br />
1456 <input type="checkbox" name="full_ban" value="1"', $context['ban']['cannot']['access'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['ban_full_ban'], '<br />
1457 <input type="checkbox" name="cannot_post" value="1"', $context['ban']['cannot']['post'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['ban_cannot_post'], '<br />
1458 <input type="checkbox" name="cannot_register" value="1"', $context['ban']['cannot']['register'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['ban_cannot_register'], '<br />
1459 <input type="checkbox" name="cannot_login" value="1"', $context['ban']['cannot']['login'] ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['ban_cannot_login'], '
1460 </p>';
1461
1462 if (!empty($context['ban_suggestions']))
1463 {
1464 echo '
1465 <p class="titlebg">', $txt['ban_triggers'], '</p>
1466 <p class="windowbg">
1467 <input type="checkbox" name="ban_suggestion[]" value="main_ip" class="input_check" /> <strong>', $txt['wireless_ban_ip'], ':</strong><br />
1468 &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="20" class="input_text" />
1469 </p>';
1470
1471 if (empty($modSettings['disableHostnameLookup']))
1472 echo '
1473 <p class="windowbg">
1474 <input type="checkbox" name="ban_suggestion[]" value="hostname" class="input_check" /> <strong>', $txt['wireless_ban_hostname'], ':</strong><br />
1475 &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="20" class="input_text" />
1476 <p>';
1477
1478 echo '
1479 <p class="windowbg">
1480 <input type="checkbox" name="ban_suggestion[]" value="email" class="input_check" /> <strong>', $txt['wireless_ban_email'], ':</strong><br />
1481 &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="email" value="', $context['ban_suggestions']['email'], '" size="20" class="input_text" />
1482 </p>
1483 <p class="windowbg">
1484 <input type="checkbox" name="ban_suggestion[]" value="user" class="input_check" /> <strong>', $txt['ban_on_username'], ':</strong><br />';
1485
1486 if (empty($context['ban_suggestions']['member']['id']))
1487 echo '
1488 &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="user" value="" size="20" class="input_text" />';
1489 else
1490 echo '
1491 &nbsp;&nbsp;&nbsp;&nbsp;', $context['ban_suggestions']['member']['name'], '
1492 <input type="hidden" name="bannedUser" value="', $context['ban_suggestions']['member']['id'], '" />';
1493
1494 echo '
1495 </p>';
1496 }
1497
1498 echo '
1499
1500 <p class="windowbg"><input type="submit" name="', $context['ban']['is_new'] ? 'add_ban' : 'modify_ban', '" value="', $context['ban']['is_new'] ? $txt['ban_add'] : $txt['ban_modify'], '" class="button_submit" /></p>
1501 <p class="titlebg">', $txt['wireless_additional_info'], '</p>
1502 <p class="windowbg"><a href="', $scripturl, '?wap2">', $txt['wireless_error_home'], '.</a></p>';
1503
1504 echo '
1505 <input type="hidden" name="old_expire" value="', $context['ban']['expiration']['days'], '" />
1506 <input type="hidden" name="bg" value="', $context['ban']['id'], '" />
1507 <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
1508 </form>';
1509 }
1510
1511 function template_wap2_below()
1512 {
1513 global $context, $settings, $options, $txt;
1514
1515 echo '
1516 <a href="', $context['linktree'][count($context['linktree']) - 1]['url'], (count($context['linktree']) > 1 ? ';' : '?'), 'nowap" rel="nofollow">', $txt['wireless_go_to_full_version'], '</a>
1517 </body>
1518 </html>';
1519 }
1520
1521 ?>