Register.template.php 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  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="register_error">
  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.gif" alt="*" />
  95. </a>
  96. </span>
  97. </dd>
  98. <dt><strong><label for="smf_autov_reserve1">', $txt['email'], ':</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">', $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.gif" alt="*" />
  135. </span>
  136. </dd>
  137. </dl>
  138. <dl class="register_form" id="password2_group">
  139. <dt><strong><label for="smf_autov_pwverify">', $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.gif" 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. <script type="text/javascript"><!-- // --><![CDATA[
  294. var regTextStrings = {
  295. "username_valid": "', $txt['registration_username_available'], '",
  296. "username_invalid": "', $txt['registration_username_unavailable'], '",
  297. "username_check": "', $txt['registration_username_check'], '",
  298. "password_short": "', $txt['registration_password_short'], '",
  299. "password_reserved": "', $txt['registration_password_reserved'], '",
  300. "password_numbercase": "', $txt['registration_password_numbercase'], '",
  301. "password_no_match": "', $txt['registration_password_no_match'], '",
  302. "password_valid": "', $txt['registration_password_valid'], '"
  303. };
  304. var verificationHandle = new smfRegister("registration", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
  305. // Update the authentication status.
  306. updateAuthMethod();
  307. // ]]></script>';
  308. }
  309. // After registration... all done ;).
  310. function template_after()
  311. {
  312. global $context, $settings, $options, $txt, $scripturl;
  313. // Not much to see here, just a quick... "you're now registered!" or what have you.
  314. echo '
  315. <div id="registration_success">
  316. <div class="cat_bar">
  317. <h3 class="catbg">', $context['title'], '</h3>
  318. </div>
  319. <div class="windowbg">
  320. <span class="topslice"><span></span></span>
  321. <p class="content">', $context['description'], '</p>
  322. <span class="botslice"><span></span></span>
  323. </div>
  324. </div>';
  325. }
  326. // Template for giving instructions about COPPA activation.
  327. function template_coppa()
  328. {
  329. global $context, $settings, $options, $txt, $scripturl;
  330. // Formulate a nice complicated message!
  331. echo '
  332. <div class="title_bar">
  333. <h3 class="titlebg">', $context['page_title'], '</h3>
  334. </div>
  335. <div class="windowbg2">
  336. <span class="topslice"><span></span></span>
  337. <div class="content">
  338. <p>', $context['coppa']['body'], '</p>
  339. <p>
  340. <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>
  341. </p>
  342. <p>', $context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</p>';
  343. // Can they send by post?
  344. if (!empty($context['coppa']['post']))
  345. {
  346. echo '
  347. <h4>1) ', $txt['coppa_send_by_post'], '</h4>
  348. <div class="coppa_contact">
  349. ', $context['coppa']['post'], '
  350. </div>';
  351. }
  352. // Can they send by fax??
  353. if (!empty($context['coppa']['fax']))
  354. {
  355. echo '
  356. <h4>', !empty($context['coppa']['post']) ? '2' : '1', ') ', $txt['coppa_send_by_fax'], '</h4>
  357. <div class="coppa_contact">
  358. ', $context['coppa']['fax'], '
  359. </div>';
  360. }
  361. // Offer an alternative Phone Number?
  362. if ($context['coppa']['phone'])
  363. {
  364. echo '
  365. <p>', $context['coppa']['phone'], '</p>';
  366. }
  367. echo '
  368. </div>
  369. <span class="botslice"><span></span></span>
  370. </div>';
  371. }
  372. // An easily printable form for giving permission to access the forum for a minor.
  373. function template_coppa_form()
  374. {
  375. global $context, $settings, $options, $txt, $scripturl;
  376. // Show the form (As best we can)
  377. echo '
  378. <table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder" align="center">
  379. <tr>
  380. <td align="left">', $context['forum_contacts'], '</td>
  381. </tr><tr>
  382. <td align="right">
  383. <em>', $txt['coppa_form_address'], '</em>: ', $context['ul'], '<br />
  384. ', $context['ul'], '<br />
  385. ', $context['ul'], '<br />
  386. ', $context['ul'], '
  387. </td>
  388. </tr><tr>
  389. <td align="right">
  390. <em>', $txt['coppa_form_date'], '</em>: ', $context['ul'], '
  391. <br /><br />
  392. </td>
  393. </tr><tr>
  394. <td align="left">
  395. ', $context['coppa_body'], '
  396. </td>
  397. </tr>
  398. </table>
  399. <br />';
  400. }
  401. // Show a window containing the spoken verification code.
  402. function template_verification_sound()
  403. {
  404. global $context, $settings, $options, $txt, $scripturl;
  405. echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  406. <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
  407. <head>
  408. <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
  409. <title>', $context['page_title'], '</title>
  410. <meta name="robots" content="noindex" />
  411. <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index.css" />
  412. <style type="text/css">';
  413. // Just show the help text and a "close window" link.
  414. echo '
  415. </style>
  416. </head>
  417. <body style="margin: 1ex;">
  418. <div class="popuptext" style="text-align: center;">';
  419. if (isBrowser('is_ie'))
  420. echo '
  421. <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
  422. <param name="AutoStart" value="1" />
  423. <param name="FileName" value="', $context['verification_sound_href'], '" />
  424. </object>';
  425. else
  426. echo '
  427. <object type="audio/x-wav" data="', $context['verification_sound_href'], '">
  428. <a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a>
  429. </object>';
  430. echo '
  431. <br />
  432. <a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br />
  433. <a href="javascript:self.close();">', $txt['visual_verification_sound_close'], '</a><br />
  434. <a href="', $context['verification_sound_href'], '" rel="nofollow">', $txt['visual_verification_sound_direct'], '</a>
  435. </div>
  436. </body>
  437. </html>';
  438. }
  439. function template_admin_register()
  440. {
  441. global $context, $settings, $options, $scripturl, $txt, $modSettings;
  442. echo '
  443. <div id="admincenter">
  444. <div class="cat_bar">
  445. <h3 class="catbg">', $txt['admin_browse_register_new'], '</h3>
  446. </div>
  447. <form class="windowbg2" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '" name="postForm" id="postForm">
  448. <span class="topslice"><span></span></span>
  449. <div class="content" id="register_screen">';
  450. if (!empty($context['registration_done']))
  451. echo '
  452. <div class="windowbg" id="profile_success">
  453. ', $context['registration_done'], '
  454. </div>';
  455. echo '
  456. <dl class="register_form" id="admin_register_form">
  457. <dt>
  458. <strong><label for="user_input">', $txt['admin_register_username'], ':</label></strong>
  459. <span class="smalltext">', $txt['admin_register_username_desc'], '</span>
  460. </dt>
  461. <dd>
  462. <input type="text" name="user" id="user_input" tabindex="', $context['tabindex']++, '" size="30" maxlength="25" class="input_text" />
  463. </dd>
  464. <dt>
  465. <strong><label for="email_input">', $txt['admin_register_email'], ':</label></strong>
  466. <span class="smalltext">', $txt['admin_register_email_desc'], '</span>
  467. </dt>
  468. <dd>
  469. <input type="text" name="email" id="email_input" tabindex="', $context['tabindex']++, '" size="30" class="input_text" />
  470. </dd>
  471. <dt>
  472. <strong><label for="password_input">', $txt['admin_register_password'], ':</label></strong>
  473. <span class="smalltext">', $txt['admin_register_password_desc'], '</span>
  474. </dt>
  475. <dd>
  476. <input type="password" name="password" id="password_input" tabindex="', $context['tabindex']++, '" size="30" class="input_password" onchange="onCheckChange();" />
  477. </dd>';
  478. if (!empty($context['member_groups']))
  479. {
  480. echo '
  481. <dt>
  482. <strong><label for="group_select">', $txt['admin_register_group'], ':</label></strong>
  483. <span class="smalltext">', $txt['admin_register_group_desc'], '</span>
  484. </dt>
  485. <dd>
  486. <select name="group" id="group_select" tabindex="', $context['tabindex']++, '">';
  487. foreach ($context['member_groups'] as $id => $name)
  488. echo '
  489. <option value="', $id, '">', $name, '</option>';
  490. echo '
  491. </select>
  492. </dd>';
  493. }
  494. echo '
  495. <dt>
  496. <strong><label for="emailPassword_check">', $txt['admin_register_email_detail'], ':</label></strong>
  497. <span class="smalltext">', $txt['admin_register_email_detail_desc'], '</span>
  498. </dt>
  499. <dd>
  500. <input type="checkbox" name="emailPassword" id="emailPassword_check" tabindex="', $context['tabindex']++, '" checked="checked" disabled="disabled" class="input_check" />
  501. </dd>
  502. <dt>
  503. <strong><label for="emailActivate_check">', $txt['admin_register_email_activate'], ':</label></strong>
  504. </dt>
  505. <dd>
  506. <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" />
  507. </dd>
  508. </dl>
  509. <div class="righttext">
  510. <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button_submit" />
  511. <input type="hidden" name="sa" value="register" />
  512. </div>
  513. </div>
  514. <span class="botslice"><span></span></span>
  515. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  516. <input type="hidden" name="', $context['admin-regc_token_var'], '" value="', $context['admin-regc_token'], '" />
  517. </form>
  518. </div>
  519. <br class="clear" />';
  520. }
  521. // Form for editing the agreement shown for people registering to the forum.
  522. function template_edit_agreement()
  523. {
  524. global $context, $settings, $options, $scripturl, $txt;
  525. // Just a big box to edit the text file ;).
  526. echo '
  527. <div class="cat_bar">
  528. <h3 class="catbg">', $txt['registration_agreement'], '</h3>
  529. </div>';
  530. // Warning for if the file isn't writable.
  531. if (!empty($context['warning']))
  532. echo '
  533. <p class="error">', $context['warning'], '</p>';
  534. echo '
  535. <div class="windowbg2" id="registration_agreement">
  536. <span class="topslice"><span></span></span>
  537. <div class="content">';
  538. // Is there more than one language to choose from?
  539. if (count($context['editable_agreements']) > 1)
  540. {
  541. echo '
  542. <div class="information">
  543. <form action="', $scripturl, '?action=admin;area=regcenter" id="change_reg" method="post" accept-charset="', $context['character_set'], '" style="display: inline;">
  544. <strong>', $txt['admin_agreement_select_language'], ':</strong>&nbsp;
  545. <select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">';
  546. foreach ($context['editable_agreements'] as $file => $name)
  547. echo '
  548. <option value="', $file, '" ', $context['current_agreement'] == $file ? 'selected="selected"' : '', '>', $name, '</option>';
  549. echo '
  550. </select>
  551. <div class="righttext">
  552. <input type="hidden" name="sa" value="agreement" />
  553. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  554. <input type="submit" name="change" value="', $txt['admin_agreement_select_language_change'], '" tabindex="', $context['tabindex']++, '" class="button_submit" />
  555. </div>
  556. </form>
  557. </div>';
  558. }
  559. echo '
  560. <form action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">';
  561. // Show the actual agreement in an oversized text box.
  562. echo '
  563. <p class="agreement">
  564. <textarea cols="70" rows="20" name="agreement" id="agreement">', $context['agreement'], '</textarea>
  565. </p>
  566. <p>
  567. <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>
  568. </p>
  569. <div class="righttext">
  570. <input type="submit" value="', $txt['save'], '" tabindex="', $context['tabindex']++, '" class="button_submit" />
  571. <input type="hidden" name="agree_lang" value="', $context['current_agreement'], '" />
  572. <input type="hidden" name="sa" value="agreement" />
  573. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  574. <input type="hidden" name="', $context['admin-rega_token_var'], '" value="', $context['admin-rega_token'], '" />
  575. </div>
  576. </form>
  577. </div>
  578. <span class="botslice"><span></span></span>
  579. </div>
  580. <br class="clear" />';
  581. }
  582. function template_edit_reserved_words()
  583. {
  584. global $context, $settings, $options, $scripturl, $txt;
  585. echo '
  586. <div class="cat_bar">
  587. <h3 class="catbg">', $txt['admin_reserved_set'], '</h3>
  588. </div>
  589. <form id="registration_agreement" class="windowbg2" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
  590. <span class="topslice"><span></span></span>
  591. <div class="content">
  592. <h4>', $txt['admin_reserved_line'], '</h4>
  593. <p class="reserved_names">
  594. <textarea cols="30" rows="6" name="reserved" id="reserved">', implode("\n", $context['reserved_words']), '</textarea>
  595. </p>
  596. <ul class="reset">
  597. <li><label for="matchword"><input type="checkbox" name="matchword" id="matchword" tabindex="', $context['tabindex']++, '" ', $context['reserved_word_options']['match_word'] ? 'checked="checked"' : '', ' class="input_check" /> ', $txt['admin_match_whole'], '</label></li>
  598. <li><label for="matchcase"><input type="checkbox" name="matchcase" id="matchcase" tabindex="', $context['tabindex']++, '" ', $context['reserved_word_options']['match_case'] ? 'checked="checked"' : '', ' class="input_check" /> ', $txt['admin_match_case'], '</label></li>
  599. <li><label for="matchuser"><input type="checkbox" name="matchuser" id="matchuser" tabindex="', $context['tabindex']++, '" ', $context['reserved_word_options']['match_user'] ? 'checked="checked"' : '', ' class="input_check" /> ', $txt['admin_check_user'], '</label></li>
  600. <li><label for="matchname"><input type="checkbox" name="matchname" id="matchname" tabindex="', $context['tabindex']++, '" ', $context['reserved_word_options']['match_name'] ? 'checked="checked"' : '', ' class="input_check" /> ', $txt['admin_check_display'], '</label></li>
  601. </ul>
  602. <div class="righttext">
  603. <input type="submit" value="', $txt['save'], '" name="save_reserved_names" tabindex="', $context['tabindex']++, '" style="margin: 1ex;" class="button_submit" />
  604. </div>
  605. </div>
  606. <span class="botslice"><span></span></span>
  607. <input type="hidden" name="sa" value="reservednames" />
  608. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
  609. <input type="hidden" name="', $context['admin-regr_token_var'], '" value="', $context['admin-regr_token'], '" />
  610. </form>
  611. <br class="clear" />';
  612. }
  613. ?>