Wireless.template.php 75 KB

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