| 1 | <?php |
|---|
| 2 | // $Id: registerform.php,v 1.6 2005/09/04 20:46:09 onokazu Exp $ |
|---|
| 3 | // ------------------------------------------------------------------------ // |
|---|
| 4 | // XOOPS - PHP Content Management System // |
|---|
| 5 | // Copyright (c) 2000 XOOPS.org // |
|---|
| 6 | // <http://www.xoops.org/> // |
|---|
| 7 | // ------------------------------------------------------------------------ // |
|---|
| 8 | // This program is free software; you can redistribute it and/or modify // |
|---|
| 9 | // it under the terms of the GNU General Public License as published by // |
|---|
| 10 | // the Free Software Foundation; either version 2 of the License, or // |
|---|
| 11 | // (at your option) any later version. // |
|---|
| 12 | // // |
|---|
| 13 | // You may not change or alter any portion of this comment or credits // |
|---|
| 14 | // of supporting developers from this source code or any supporting // |
|---|
| 15 | // source code which is considered copyrighted (c) material of the // |
|---|
| 16 | // original comment or credit authors. // |
|---|
| 17 | // // |
|---|
| 18 | // This program is distributed in the hope that it will be useful, // |
|---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|---|
| 21 | // GNU General Public License for more details. // |
|---|
| 22 | // // |
|---|
| 23 | // You should have received a copy of the GNU General Public License // |
|---|
| 24 | // along with this program; if not, write to the Free Software // |
|---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|---|
| 26 | // ------------------------------------------------------------------------ // |
|---|
| 27 | |
|---|
| 28 | if (!defined('XOOPS_ROOT_PATH')) { |
|---|
| 29 | exit(); |
|---|
| 30 | } |
|---|
| 31 | include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; |
|---|
| 32 | include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | $email_tray = new XoopsFormElementTray(_US_EMAIL, "<br />"); |
|---|
| 36 | $email_text = new XoopsFormText("", "email", 25, 60, $myts->htmlSpecialChars($email)); |
|---|
| 37 | $email_option = new XoopsFormCheckBox("", "user_viewemail", $user_viewemail); |
|---|
| 38 | $email_option->addOption(1, _US_ALLOWVIEWEMAIL); |
|---|
| 39 | $email_tray->addElement($email_text); |
|---|
| 40 | $email_tray->addElement($email_option); |
|---|
| 41 | |
|---|
| 42 | //$avatar_select = new XoopsFormSelect("", "user_avatar", $user_avatar); |
|---|
| 43 | //$avatar_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/"); |
|---|
| 44 | //$avatar_select->addOptionArray($avatar_array); |
|---|
| 45 | //$a_dirlist =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/images/avatar/"); |
|---|
| 46 | //$a_dir_labels = array(); |
|---|
| 47 | //$a_count = 0; |
|---|
| 48 | //$a_dir_link = "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&type=avatars&start=".$a_count."','avatars',600,400);\">XOOPS</a>"; |
|---|
| 49 | //$a_count = $a_count + count($avatar_array); |
|---|
| 50 | //$a_dir_labels[] = new XoopsFormLabel("", $a_dir_link); |
|---|
| 51 | //foreach ($a_dirlist as $a_dir) { |
|---|
| 52 | // if ( $a_dir == "users" ) { |
|---|
| 53 | // continue; |
|---|
| 54 | // } |
|---|
| 55 | // $avatars_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/".$a_dir."/", $a_dir."/"); |
|---|
| 56 | // $avatar_select->addOptionArray($avatars_array); |
|---|
| 57 | // $a_dir_link = "<a href=\"javascript:openWithSelfMain('".XOOPS_URL."/misc.php?action=showpopups&type=avatars&subdir=".$a_dir."&start=".$a_count."','avatars',600,400);\">".$a_dir."</a>"; |
|---|
| 58 | // $a_dir_labels[] = new XoopsFormLabel("", $a_dir_link); |
|---|
| 59 | // $a_count = $a_count + count($avatars_array); |
|---|
| 60 | //} |
|---|
| 61 | //$avatar_select->setExtra("onchange='showImgSelected(\"avatar\", \"user_avatar\", \"images/avatar\", \"\", \"".XOOPS_URL."\")'"); |
|---|
| 62 | //$avatar_label = new XoopsFormLabel("", "<img src='images/avatar/blank.gif' name='avatar' id='avatar' alt='' />"); |
|---|
| 63 | //$avatar_tray = new XoopsFormElementTray(_US_AVATAR, " "); |
|---|
| 64 | //$avatar_tray->addElement($avatar_select); |
|---|
| 65 | //$avatar_tray->addElement($avatar_label); |
|---|
| 66 | //foreach ($a_dir_labels as $a_dir_label) { |
|---|
| 67 | // $avatar_tray->addElement($a_dir_label); |
|---|
| 68 | //} |
|---|
| 69 | |
|---|
| 70 | $reg_form = new XoopsThemeForm(_US_USERREG, "userinfo", "register.php"); |
|---|
| 71 | $uname_size = $xoopsConfigUser['maxuname'] < 25 ? $xoopsConfigUser['maxuname'] : 25; |
|---|
| 72 | $reg_form->addElement(new XoopsFormText(_US_NICKNAME, "uname", $uname_size, $uname_size, $myts->htmlSpecialChars($uname)), true); |
|---|
| 73 | $reg_form->addElement($email_tray); |
|---|
| 74 | $reg_form->addElement(new XoopsFormText(_US_WEBSITE, "url", 25, 255, $myts->htmlSpecialChars($url))); |
|---|
| 75 | $tzselected = ($timezone_offset != "") ? $timezone_offset : $xoopsConfig['default_TZ']; |
|---|
| 76 | //$reg_form->addElement(new XoopsFormSelectTimezone(_US_TIMEZONE, "timezone_offset", $tzselected)); |
|---|
| 77 | //$reg_form->addElement($avatar_tray); |
|---|
| 78 | $reg_form->addElement(new XoopsFormPassword(_US_PASSWORD, "pass", 10, 32, $myts->htmlSpecialChars($pass)), true); |
|---|
| 79 | $reg_form->addElement(new XoopsFormPassword(_US_VERIFYPASS, "vpass", 10, 32, $myts->htmlSpecialChars($vpass)), true); |
|---|
| 80 | $reg_form->addElement(new XoopsFormRadioYN(_US_MAILOK, 'user_mailok', $user_mailok)); |
|---|
| 81 | /* ¥Æ¥¥¹¥È¥¨¥ê¥¢Èóɽ¼¨ |
|---|
| 82 | if ($xoopsConfigUser['reg_dispdsclmr'] != 0 && $xoopsConfigUser['reg_disclaimer'] != '') { |
|---|
| 83 | $disc_tray = new XoopsFormElementTray(_US_DISCLAIMER, '<br />'); |
|---|
| 84 | $disc_text = new XoopsFormTextarea('', 'disclaimer', $xoopsConfigUser['reg_disclaimer'], 8); |
|---|
| 85 | $disc_text->setExtra('readonly="readonly"'); |
|---|
| 86 | $disc_tray->addElement($disc_text); |
|---|
| 87 | $agree_chk = new XoopsFormCheckBox('', 'agree_disc', $agree_disc); |
|---|
| 88 | $agree_chk->addOption(1, _US_IAGREE); |
|---|
| 89 | $disc_tray->addElement($agree_chk); |
|---|
| 90 | $reg_form->addElement($disc_tray); |
|---|
| 91 | } |
|---|
| 92 | */ |
|---|
| 93 | $reg_form->addElement(new XoopsFormHidden("op", "newuser")); |
|---|
| 94 | $reg_form->addElement(new XoopsFormToken(XoopsSingleTokenHandler::quickCreate('register_newuser'))); |
|---|
| 95 | $reg_form->addElement(new XoopsFormButton("", "submit", _US_SUBMIT, "submit")); |
|---|
| 96 | $reg_form->setRequired($email_text); |
|---|
| 97 | ?> |
|---|