Register.template.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  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.1 Alpha 1
  11. */
  12. /**
  13. * Before showing users a registration form, show them the registration agreement.
  14. */
  15. function template_registration_agreement()
  16. {
  17. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  18. echo '
  19. <form action="', $scripturl, '?action=register" method="post" accept-charset="', $context['character_set'], '" id="registration">
  20. <div class="cat_bar">
  21. <h3 class="catbg">', $txt['registration_agreement'], '</h3>
  22. </div>
  23. <span class="upperframe"><span></span></span>
  24. <div class="roundframe">
  25. <p>', $context['agreement'], '</p>
  26. </div>
  27. <span class="lowerframe"><span></span></span>
  28. <div id="confirm_buttons">';
  29. // Age restriction in effect?
  30. if ($context['show_coppa'])
  31. echo '
  32. <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit" /><br /><br />
  33. <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit" />';
  34. else
  35. echo '
  36. <input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button_submit" />';
  37. echo '
  38. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  39. <input type="hidden" name="', $context['register_token_var'], '" value="', $context['register_token'], '" />
  40. </div>
  41. <input type="hidden" name="step" value="1" />
  42. </form>';
  43. }
  44. // Before registering - get their information.
  45. function template_registration_form()
  46. {
  47. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  48. echo '
  49. <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/register.js"></script>
  50. <script type="text/javascript"><!-- // --><![CDATA[
  51. function verifyAgree()
  52. {
  53. if (currentAuthMethod == \'passwd\' && document.forms.registration.smf_autov_pwmain.value != document.forms.registration.smf_autov_pwverify.value)
  54. {
  55. alert("', $txt['register_passwords_differ_js'], '");
  56. return false;
  57. }
  58. return true;
  59. }
  60. var currentAuthMethod = \'passwd\';
  61. // ]]></script>';
  62. // Any errors?
  63. if (!empty($context['registration_errors']))
  64. {
  65. echo '
  66. <div class="errorbox">
  67. <span>', $txt['registration_errors_occurred'], '</span>
  68. <ul class="reset">';
  69. // Cycle through each error and display an error message.
  70. foreach ($context['registration_errors'] as $error)
  71. echo '
  72. <li>', $error, '</li>';
  73. echo '
  74. </ul>
  75. </div>';
  76. }
  77. echo '
  78. <form action="', $scripturl, '?action=register2" method="post" accept-charset="', $context['character_set'], '" name="registration" id="registration" onsubmit="return verifyAgree();">
  79. <div class="cat_bar">
  80. <h3 class="catbg">', $txt['registration_form'], '</h3>
  81. </div>
  82. <div class="title_bar">
  83. <h4 class="titlebg">', $txt['required_info'], '</h4>
  84. </div>
  85. <div class="windowbg2">
  86. <span class="topslice"><span></span></span>
  87. <fieldset class="content">
  88. <dl class="register_form">
  89. <dt><strong><label for="smf_autov_username">', $txt['username'], ':</label></strong></dt>
  90. <dd>
  91. <input type="text" name="user" id="smf_autov_username" size="30" tabindex="', $context['tabindex']++, '" maxlength="25" value="', isset($context['username']) ? $context['username'] : '', '" class="input_text" />
  92. <span id="smf_autov_username_div" style="display: none;">
  93. <a id="smf_autov_username_link" href="#">
  94. <img id="smf_autov_username_img" src="', $settings['images_url'], '/icons/field_check.png" alt="*" />
  95. </a>
  96. </span>
  97. </dd>
  98. <dt><strong><label for="smf_autov_reserve1">', $txt['user_email_address'], ':</label></strong></dt>
  99. <dd>
  100. <input type="text" name="email" id="smf_autov_reserve1" size="30" tabindex="', $context['tabindex']++, '" value="', isset($context['email']) ? $context['email'] : '', '" class="input_text" />
  101. </dd>
  102. <dt><strong><label for="allow_email">', $txt['allow_user_email'], ':</label></strong></dt>
  103. <dd>
  104. <input type="checkbox" name="allow_email" id="allow_email" tabindex="', $context['tabindex']++, '" class="input_check" />
  105. </dd>
  106. </dl>';
  107. // If OpenID is enabled, give the user a choice between password and OpenID.
  108. if (!empty($modSettings['enableOpenID']))
  109. {
  110. echo '
  111. <dl class="register_form" id="authentication_group">
  112. <dt>
  113. <strong>', $txt['authenticate_label'], ':</strong>
  114. <a href="', $scripturl, '?action=helpadmin;help=register_openid" onclick="return reqWin(this.href);" class="help">(?)</a>
  115. </dt>
  116. <dd>
  117. <label for="auth_pass" id="option_auth_pass">
  118. <input type="radio" name="authenticate" value="passwd" id="auth_pass" tabindex="', $context['tabindex']++, '" ', empty($context['openid']) ? 'checked="checked" ' : '', ' onclick="updateAuthMethod();" class="input_radio" />
  119. ', $txt['authenticate_password'], '
  120. </label>
  121. <label for="auth_openid" id="option_auth_openid">
  122. <input type="radio" name="authenticate" value="openid" id="auth_openid" tabindex="', $context['tabindex']++, '" ', !empty($context['openid']) ? 'checked="checked" ' : '', ' onclick="updateAuthMethod();" class="input_radio" />
  123. ', $txt['authenticate_openid'], '
  124. </label>
  125. </dd>
  126. </dl>';
  127. }
  128. echo '
  129. <dl class="register_form" id="password1_group">
  130. <dt><strong><label for="smf_autov_pwmain">', ucwords($txt['choose_pass']), ':</label></strong></dt>
  131. <dd>
  132. <input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
  133. <span id="smf_autov_pwmain_div" style="display: none;">
  134. <img id="smf_autov_pwmain_img" src="', $settings['images_url'], '/icons/field_invalid.png" alt="*" />
  135. </span>
  136. </dd>
  137. </dl>
  138. <dl class="register_form" id="password2_group">
  139. <dt><strong><label for="smf_autov_pwverify">', ucwords($txt['verify_pass']), ':</label></strong></dt>
  140. <dd>
  141. <input type="password" name="passwrd2" id="smf_autov_pwverify" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
  142. <span id="smf_autov_pwverify_div" style="display: none;">
  143. <img id="smf_autov_pwverify_img" src="', $settings['images_url'], '/icons/field_valid.png" alt="*" />
  144. </span>
  145. </dd>
  146. </dl>';
  147. // If OpenID is enabled, give the user a choice between password and OpenID.
  148. if (!empty($modSettings['enableOpenID']))
  149. {
  150. echo '
  151. <dl class="register_form" id="openid_group">
  152. <dt><strong>', $txt['authenticate_openid_url'], ':</strong></dt>
  153. <dd>
  154. <input type="text" name="openid_identifier" id="openid_url" size="30" tabindex="', $context['tabindex']++, '" value="', isset($context['openid']) ? $context['openid'] : '', '" class="input_text openid_login" />
  155. </dd>
  156. </dl>';
  157. }
  158. echo '
  159. </fieldset>
  160. <span class="botslice"><span></span></span>
  161. </div>';
  162. // If we have either of these, show the extra group.
  163. if (!empty($context['profile_fields']) || !empty($context['custom_fields']))
  164. {
  165. echo '
  166. <div class="title_bar">
  167. <h4 class="titlebg">', $txt['additional_information'], '</h4>
  168. </div>
  169. <div class="windowbg2">
  170. <span class="topslice"><span></span></span>
  171. <fieldset class="content">
  172. <dl class="register_form" id="custom_group">';
  173. }
  174. if (!empty($context['profile_fields']))
  175. {
  176. // Any fields we particularly want?
  177. foreach ($context['profile_fields'] as $key => $field)
  178. {
  179. if ($field['type'] == 'callback')
  180. {
  181. if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
  182. {
  183. $callback_func = 'template_profile_' . $field['callback_func'];
  184. $callback_func();
  185. }
  186. }
  187. else
  188. {
  189. echo '
  190. <dt>
  191. <strong', !empty($field['is_error']) ? ' style="color: red;"' : '', '>', $field['label'], ':</strong>';
  192. // Does it have any subtext to show?
  193. if (!empty($field['subtext']))
  194. echo '
  195. <span class="smalltext">', $field['subtext'], '</span>';
  196. echo '
  197. </dt>
  198. <dd>';
  199. // Want to put something infront of the box?
  200. if (!empty($field['preinput']))
  201. echo '
  202. ', $field['preinput'];
  203. // What type of data are we showing?
  204. if ($field['type'] == 'label')
  205. echo '
  206. ', $field['value'];
  207. // Maybe it's a text box - very likely!
  208. elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
  209. echo '
  210. <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '" />';
  211. // You "checking" me out? ;)
  212. elseif ($field['type'] == 'check')
  213. echo '
  214. <input type="hidden" name="', $key, '" value="0" /><input type="checkbox" name="', $key, '" id="', $key, '" ', !empty($field['value']) ? ' checked="checked"' : '', ' value="1" tabindex="', $context['tabindex']++, '" class="input_check" ', $field['input_attr'], ' />';
  215. // Always fun - select boxes!
  216. elseif ($field['type'] == 'select')
  217. {
  218. echo '
  219. <select name="', $key, '" id="', $key, '" tabindex="', $context['tabindex']++, '">';
  220. if (isset($field['options']))
  221. {
  222. // Is this some code to generate the options?
  223. if (!is_array($field['options']))
  224. $field['options'] = eval($field['options']);
  225. // Assuming we now have some!
  226. if (is_array($field['options']))
  227. foreach ($field['options'] as $value => $name)
  228. echo '
  229. <option value="', $value, '" ', $value == $field['value'] ? 'selected="selected"' : '', '>', $name, '</option>';
  230. }
  231. echo '
  232. </select>';
  233. }
  234. // Something to end with?
  235. if (!empty($field['postinput']))
  236. echo '
  237. ', $field['postinput'];
  238. echo '
  239. </dd>';
  240. }
  241. }
  242. }
  243. // Are there any custom fields?
  244. if (!empty($context['custom_fields']))
  245. {
  246. foreach ($context['custom_fields'] as $field)
  247. echo '
  248. <dt>
  249. <strong', !empty($field['is_error']) ? ' style="color: red;"' : '', '>', $field['name'], ':</strong>
  250. <span class="smalltext">', $field['desc'], '</span>
  251. </dt>
  252. <dd>', $field['input_html'], '</dd>';
  253. }
  254. // If we have either of these, close the list like a proper gent.
  255. if (!empty($context['profile_fields']) || !empty($context['custom_fields']))
  256. {
  257. echo '
  258. </dl>
  259. </fieldset>
  260. <span class="botslice"><span></span></span>
  261. </div>';
  262. }
  263. if ($context['visual_verification'])
  264. {
  265. echo '
  266. <div class="title_bar">
  267. <h4 class="titlebg">', $txt['verification'], '</h4>
  268. </div>
  269. <div class="windowbg2">
  270. <span class="topslice"><span></span></span>
  271. <fieldset class="content centertext">
  272. ', template_control_verification($context['visual_verification_id'], 'all'), '
  273. </fieldset>
  274. <span class="botslice"><span></span></span>
  275. </div>';
  276. }
  277. echo '
  278. <div id="confirm_buttons">';
  279. // Age restriction in effect?
  280. if (!$context['require_agreement'] && $context['show_coppa'])
  281. echo '
  282. <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit" /><br /><br />
  283. <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit" />';
  284. else
  285. echo '
  286. <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button_submit" />';
  287. echo '
  288. </div>
  289. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  290. <input type="hidden" name="', $context['register_token_var'], '" value="', $context['register_token'], '" />
  291. <input type="hidden" name="step" value="2" />
  292. </form>
  293. <br class="clear" />
  294. <script type="text/javascript"><!-- // --><![CDATA[
  295. var regTextStrings = {
  296. "username_valid": "', $txt['registration_username_available'], '",
  297. "username_invalid": "', $txt['registration_username_unavailable'], '",
  298. "username_check": "', $txt['registration_username_check'], '",
  299. "password_short": "', $txt['registration_password_short'], '",
  300. "password_reserved": "', $txt['registration_password_reserved'], '",
  301. "password_numbercase": "', $txt['registration_password_numbercase'], '",
  302. "password_no_match": "', $txt['registration_password_no_match'], '",
  303. "password_valid": "', $txt['registration_password_valid'], '"
  304. };
  305. var verificationHandle = new smfRegister("registration", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
  306. // Update the authentication status.
  307. updateAuthMethod();
  308. // ]]></script>';
  309. }
  310. // After registration... all done ;).
  311. function template_after()
  312. {
  313. global $context, $settings, $options, $txt, $scripturl;
  314. // Not much to see here, just a quick... "you're now registered!" or what have you.
  315. echo '
  316. <div id="registration_success">
  317. <div class="cat_bar">
  318. <h3 class="catbg">', $context['title'], '</h3>
  319. </div>
  320. <div class="windowbg">
  321. <span class="topslice"><span></span></span>
  322. <p class="content">', $context['description'], '</p>
  323. <span class="botslice"><span></span></span>
  324. </div>
  325. </div>';
  326. }
  327. // Template for giving instructions about COPPA activation.
  328. function template_coppa()
  329. {
  330. global $context, $settings, $options, $txt, $scripturl;
  331. // Formulate a nice complicated message!
  332. echo '
  333. <div class="title_bar">
  334. <h3 class="titlebg">', $context['page_title'], '</h3>
  335. </div>
  336. <div class="windowbg2">
  337. <span class="topslice"><span></span></span>
  338. <div class="content">
  339. <p>', $context['coppa']['body'], '</p>
  340. <p>
  341. <span><a href="', $scripturl, '?action=coppa;form;member=', $context['coppa']['id'], '" target="_blank" class="new_win">', $txt['coppa_form_link_popup'], '</a> | <a href="', $scripturl, '?action=coppa;form;dl;member=', $context['coppa']['id'], '">', $txt['coppa_form_link_download'], '</a></span>
  342. </p>
  343. <p>', $context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</p>';
  344. // Can they send by post?
  345. if (!empty($context['coppa']['post']))
  346. {
  347. echo '
  348. <h4>1) ', $txt['coppa_send_by_post'], '</h4>
  349. <div class="coppa_contact">
  350. ', $context['coppa']['post'], '
  351. </div>';
  352. }
  353. // Can they send by fax??
  354. if (!empty($context['coppa']['fax']))
  355. {
  356. echo '
  357. <h4>', !empty($context['coppa']['post']) ? '2' : '1', ') ', $txt['coppa_send_by_fax'], '</h4>
  358. <div class="coppa_contact">
  359. ', $context['coppa']['fax'], '
  360. </div>';
  361. }
  362. // Offer an alternative Phone Number?
  363. if ($context['coppa']['phone'])
  364. {
  365. echo '
  366. <p>', $context['coppa']['phone'], '</p>';
  367. }
  368. echo '
  369. </div>
  370. <span class="botslice"><span></span></span>
  371. </div>';
  372. }
  373. // An easily printable form for giving permission to access the forum for a minor.
  374. function template_coppa_form()
  375. {
  376. global $context, $settings, $options, $txt, $scripturl;
  377. // Show the form (As best we can)
  378. echo '
  379. <table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder" align="center">
  380. <tr>
  381. <td align="left">', $context['forum_contacts'], '</td>
  382. </tr><tr>
  383. <td align="right">
  384. <em>', $txt['coppa_form_address'], '</em>: ', $context['ul'], '<br />
  385. ', $context['ul'], '<br />
  386. ', $context['ul'], '<br />
  387. ', $context['ul'], '
  388. </td>
  389. </tr><tr>
  390. <td align="right">
  391. <em>', $txt['coppa_form_date'], '</em>: ', $context['ul'], '
  392. <br /><br />
  393. </td>
  394. </tr><tr>
  395. <td align="left">
  396. ', $context['coppa_body'], '
  397. </td>
  398. </tr>
  399. </table>
  400. <br />';
  401. }
  402. // Show a window containing the spoken verification code.
  403. function template_verification_sound()
  404. {
  405. global $context, $settings, $options, $txt, $scripturl;
  406. echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  407. <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
  408. <head>
  409. <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
  410. <title>', $txt['visual_verification_sound'], '</title>
  411. <meta name="robots" content="noindex" />
  412. <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?alp21" />
  413. <style type="text/css">';
  414. // Just show the help text and a "close window" link.
  415. echo '
  416. </style>
  417. </head>
  418. <body style="margin: 1ex;">
  419. <div class="windowbg description" style="text-align: center;">';
  420. if (isBrowser('is_ie'))
  421. echo '
  422. <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
  423. <param name="AutoStart" value="1" />
  424. <param name="FileName" value="', $context['verification_sound_href'], '" />
  425. </object>';
  426. else
  427. echo '
  428. <object type="audio/x-wav" data="', $context['verification_sound_href'], '">
  429. <a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a>
  430. </object>';
  431. echo '
  432. <br />
  433. <a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br />
  434. <a href="', $context['verification_sound_href'], '" rel="nofollow">', $txt['visual_verification_sound_direct'], '</a><br /><br />
  435. <a href="javascript:self.close();">', $txt['visual_verification_sound_close'], '</a><br />
  436. </div>
  437. </body>
  438. </html>';
  439. }
  440. function template_admin_register()
  441. {
  442. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  443. echo '
  444. <div id="admincenter">
  445. <div class="cat_bar">
  446. <h3 class="catbg">', $txt['admin_browse_register_new'], '</h3>
  447. </div>
  448. <form class="windowbg2" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '" name="postForm" id="postForm">
  449. <span class="topslice"><span></span></span>
  450. <div class="content" id="register_screen">';
  451. if (!empty($context['registration_done']))
  452. echo '
  453. <div class="infobox">
  454. ', $context['registration_done'], '
  455. </div>';
  456. echo '
  457. <dl class="register_form" id="admin_register_form">
  458. <dt>
  459. <strong><label for="user_input">', $txt['admin_register_username'], ':</label></strong>
  460. <span class="smalltext">', $txt['admin_register_username_desc'], '</span>
  461. </dt>
  462. <dd>
  463. <input type="text" name="user" id="user_input" tabindex="', $context['tabindex']++, '" size="30" maxlength="25" class="input_text" />
  464. </dd>
  465. <dt>
  466. <strong><label for="email_input">', $txt['admin_register_email'], ':</label></strong>
  467. <span class="smalltext">', $txt['admin_register_email_desc'], '</span>
  468. </dt>
  469. <dd>
  470. <input type="text" name="email" id="email_input" tabindex="', $context['tabindex']++, '" size="30" class="input_text" />
  471. </dd>
  472. <dt>
  473. <strong><label for="password_input">', $txt['admin_register_password'], ':</label></strong>
  474. <span class="smalltext">', $txt['admin_register_password_desc'], '</span>
  475. </dt>
  476. <dd>
  477. <input type="password" name="password" id="password_input" tabindex="', $context['tabindex']++, '" size="30" class="input_password" onchange="onCheckChange();" />
  478. </dd>';
  479. if (!empty($context['member_groups']))
  480. {
  481. echo '
  482. <dt>
  483. <strong><label for="group_select">', $txt['admin_register_group'], ':</label></strong>
  484. <span class="smalltext">', $txt['admin_register_group_desc'], '</span>
  485. </dt>
  486. <dd>
  487. <select name="group" id="group_select" tabindex="', $context['tabindex']++, '">';
  488. foreach ($context['member_groups'] as $id => $name)
  489. echo '
  490. <option value="', $id, '">', $name, '</option>';
  491. echo '
  492. </select>
  493. </dd>';
  494. }
  495. echo '
  496. <dt>
  497. <strong><label for="emailPassword_check">', $txt['admin_register_email_detail'], ':</label></strong>
  498. <span class="smalltext">', $txt['admin_register_email_detail_desc'], '</span>
  499. </dt>
  500. <dd>
  501. <input type="checkbox" name="emailPassword" id="emailPassword_check" tabindex="', $context['tabindex']++, '" checked="checked" disabled="disabled" class="input_check" />
  502. </dd>
  503. <dt>
  504. <strong><label for="emailActivate_check">', $txt['admin_register_email_activate'], ':</label></strong>
  505. </dt>
  506. <dd>
  507. <input type="checkbox" name="emailActivate" id="emailActivate_check" tabindex="', $context['tabindex']++, '"', !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' checked="checked"' : '', ' onclick="onCheckChange();" class="input_check" />
  508. </dd>
  509. </dl>
  510. <hr class="hrcolor" />
  511. <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button_submit" />
  512. <input type="hidden" name="sa" value="register" />
  513. <br class="clear_right" />
  514. </div>
  515. <span class="botslice"><span></span></span>
  516. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  517. <input type="hidden" name="', $context['admin-regc_token_var'], '" value="', $context['admin-regc_token'], '" />
  518. </form>
  519. </div>
  520. <br class="clear" />';
  521. }
  522. // Form for editing the agreement shown for people registering to the forum.
  523. function template_edit_agreement()
  524. {
  525. global $context, $settings, $options, $scripturl, $txt;
  526. // Just a big box to edit the text file ;).
  527. echo '
  528. <div class="cat_bar">
  529. <h3 class="catbg">', $txt['registration_agreement'], '</h3>
  530. </div>';
  531. // Warning for if the file isn't writable.
  532. if (!empty($context['warning']))
  533. echo '
  534. <p class="error">', $context['warning'], '</p>';
  535. echo '
  536. <div class="windowbg2" id="registration_agreement">
  537. <span class="topslice"><span></span></span>
  538. <div class="content">';
  539. // Is there more than one language to choose from?
  540. if (count($context['editable_agreements']) > 1)
  541. {
  542. echo '
  543. <div class="information">
  544. <form action="', $scripturl, '?action=admin;area=regcenter" id="change_reg" method="post" accept-charset="', $context['character_set'], '" style="display: inline;">
  545. <strong>', $txt['admin_agreement_select_language'], ':</strong>&nbsp;
  546. <select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">';
  547. foreach ($context['editable_agreements'] as $file => $name)
  548. echo '
  549. <option value="', $file, '" ', $context['current_agreement'] == $file ? 'selected="selected"' : '', '>', $name, '</option>';
  550. echo '
  551. </select>
  552. <div class="righttext">
  553. <input type="hidden" name="sa" value="agreement" />
  554. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  555. <input type="submit" name="change" value="', $txt['admin_agreement_select_language_change'], '" tabindex="', $context['tabindex']++, '" class="button_submit" />
  556. </div>
  557. </form>
  558. </div>';
  559. }
  560. echo '
  561. <form action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">';
  562. // Show the actual agreement in an oversized text box.
  563. echo '
  564. <p class="agreement">
  565. <textarea cols="70" rows="20" name="agreement" id="agreement">', $context['agreement'], '</textarea>
  566. </p>
  567. <p>
  568. <label for="requireAgreement"><input type="checkbox" name="requireAgreement" id="requireAgreement"', $context['require_agreement'] ? ' checked="checked"' : '', ' tabindex="', $context['tabindex']++, '" value="1" class="input_check" /> ', $txt['admin_agreement'], '.</label>
  569. </p>
  570. <hr class="hrcolor" />
  571. <input type="submit" value="', $txt['save'], '" tabindex="', $context['tabindex']++, '" class="button_submit" />
  572. <input type="hidden" name="agree_lang" value="', $context['current_agreement'], '" />
  573. <input type="hidden" name="sa" value="agreement" />
  574. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  575. <input type="hidden" name="', $context['admin-rega_token_var'], '" value="', $context['admin-rega_token'], '" />
  576. <br class="clear_right" />
  577. </form>
  578. </div>
  579. <span class="botslice"><span></span></span>
  580. </div>
  581. <br class="clear" />';
  582. }
  583. function template_edit_reserved_words()
  584. {
  585. global $context, $settings, $options, $scripturl, $txt;
  586. echo '
  587. <div class="cat_bar">
  588. <h3 class="catbg">', $txt['admin_reserved_set'], '</h3>
  589. </div>
  590. <form id="registration_agreement" class="windowbg2" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
  591. <span class="topslice"><span></span></span>
  592. <div class="content">
  593. <h4>', $txt['admin_reserved_line'], '</h4>
  594. <p class="reserved_names">
  595. <textarea cols="30" rows="6" name="reserved" id="reserved">', implode("\n", $context['reserved_words']), '</textarea>
  596. </p>
  597. <dl class="settings">
  598. <dt>
  599. <label for="matchword">', $txt['admin_match_whole'], '</label>
  600. </dt>
  601. <dd>
  602. <input type="checkbox" name="matchword" id="matchword" tabindex="', $context['tabindex']++, '" ', $context['reserved_word_options']['match_word'] ? 'checked="checked"' : '', ' class="input_check" />
  603. </dd>
  604. <dt>
  605. <label for="matchcase">', $txt['admin_match_case'], '</label>
  606. </dt>
  607. <dd>
  608. <input type="checkbox" name="matchcase" id="matchcase" tabindex="', $context['tabindex']++, '" ', $context['reserved_word_options']['match_case'] ? 'checked="checked"' : '', ' class="input_check" />
  609. </dd>
  610. <dt>
  611. <label for="matchuser">', $txt['admin_check_user'], '</label>
  612. </dt>
  613. <dd>
  614. <input type="checkbox" name="matchuser" id="matchuser" tabindex="', $context['tabindex']++, '" ', $context['reserved_word_options']['match_user'] ? 'checked="checked"' : '', ' class="input_check" />
  615. </dd>
  616. <dt>
  617. <label for="matchname">', $txt['admin_check_display'], '</label>
  618. </dt>
  619. <dd>
  620. <input type="checkbox" name="matchname" id="matchname" tabindex="', $context['tabindex']++, '" ', $context['reserved_word_options']['match_name'] ? 'checked="checked"' : '', ' class="input_check" />
  621. </dd>
  622. </dl>
  623. <hr class="hrcolor" />
  624. <input type="submit" value="', $txt['save'], '" name="save_reserved_names" tabindex="', $context['tabindex']++, '" style="margin: 1ex;" class="button_submit" />
  625. <br class="clear_right" />
  626. </div>
  627. <span class="botslice"><span></span></span>
  628. <input type="hidden" name="sa" value="reservednames" />
  629. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  630. <input type="hidden" name="', $context['admin-regr_token_var'], '" value="', $context['admin-regr_token'], '" />
  631. </form>
  632. <br class="clear" />';
  633. }
  634. ?>