2 Questions about registration form

Now you can make it easyer for new users, with a shorter registration form

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

2 Questions about registration form

Postby Pagico on Sat 09. Oct, 2004 17:26

Hi there, I have two questions about registration form.

I have a multilanguage board (thanks Nils for the help on phpbbhacks.com) and would like to install the Custom Registration.
Now:

1) Is it possible to setup a registration form for each language?
I mean, I'd like to have a page like register_it.php where italian users can register filling in the form in their custom language, and the same for spanish users.

2) In the custom registration form MOD, how do I set the "Location" field to be required to register?

Thanks!
Pagico
Poster
Poster
 
Posts: 9
Joined: Sat 09. Oct, 2004 01:09

Postby Niels on Sat 09. Oct, 2004 21:06

answers
1: it should be posible if you install the "select default language" MOD

any file inside phpbb2 may be called with a optional language parameter, witch will change the language...

e.g.
www.yoursite.com/profile.php?mode=regis ... age=german
www.yoursite.com/profile.php?mode=regis ... ge=italian


2: to make a field in the registration form (the original or the moded it doesen't matter) required - e.g. the location

in file usercp_register.php
Code: Select all
[FIND]
if ( isset($HTTP_POST_VARS['submit']) )
{

[AFTER ADD]
// validate required fields
if (strlen($location)<2)
{
   $error=TRUE;
   $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Location_required'];
}


in lang_main.php (for each language)
add a line like
Code: Select all
$lang['Location_required'] = "You need to inform about your location";


The verification of a filled location is "only" that a text of atleast 2 chars are pressent, this could be different. e.g. only chars allowed....

FYI: I haven't tested this, but it should work
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Pagico on Sat 09. Oct, 2004 23:40

Hi Nils
I have understood the answer number 2, and will try to do it.
But I still do not understand the answer n. 1 ;)

Do you mean that I can create the registration form in each language only after installing the select language mod? why?
I have already installed, as you know, the new mod "Language based on forum id" wich works well for me, and I do not know if the select default language mod would go against that Mod.
I saw the agreement text is present in the spanish and italian main language files. But, how do I recall that page?
Would you mind trying to explain how to do it to a poor phpbber? :D
Pagico
Poster
Poster
 
Posts: 9
Joined: Sat 09. Oct, 2004 01:09

Postby Niels on Sun 10. Oct, 2004 00:24

phpBB" already support showing the registration form in different languages - this includes both the coopa info, and the registration form it self.
this have basically nothing to do with the "custom registration MOD" - witch basically adds the ability to shorten the registration form (custom template)

what you need is the ability to switch the phpBB2 language, in order to show the registration form in a specific language (if I have understood correctly)
this is infact exactly what the "select default language" mod makes posible + the ability for guests to manually change iit from the index page

usually a link like this
www.yourdoimain.com/profile.php?mode=register - will show registration page in the boards default language
after the "select default language" mod is installed you may link to multiple registration pages, as described in my previous post
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Pagico on Sun 10. Oct, 2004 13:25

thanks Nils for the kind suggestions.
I installed both the select default language and custom registration form.
Now, I have also birthday installed and have modified the bod_register.tpl to include the field of the birthday, besides, I have put the location as a required field too.

Code: Select all

<form action="{S_PROFILE_ACTION}" {S_FORM_ENCTYPE} method="post">

{ERROR_BOX}

<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
   <tr>
      <td align="left"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
   </tr>
</table>

<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
   <tr>
      <th class="thHead" colspan="2" height="25" valign="middle">{L_REGISTRATION_INFO}</th>
   </tr>
   <tr>
      <td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
   </tr>
   <tr>
      <td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</span></td>
      <td class="row2"><input type="text" class="post" style="width:200px" name="username" size="25" maxlength="40" value="{USERNAME}" /></td>
   </tr>
   <tr>
      <td class="row1"><span class="gen">{L_EMAIL_ADDRESS}: *</span></td>
      <td class="row2"><input type="text" class="post" style="width:200px" name="email" size="25" maxlength="255" value="{EMAIL}" /></td>
   </tr>
   <tr>
     <td class="row1"><span class="gen">{L_NEW_PASSWORD}: *</span><br />
      <span class="gensmall">{L_PASSWORD_IF_CHANGED}</span></td>
     <td class="row2">
      <input type="password" class="post" style="width: 200px" name="new_password" size="25" maxlength="100" value="{PASSWORD}" />
     </td>
   </tr>
   <tr>
     <td class="row1"><span class="gen">{L_CONFIRM_PASSWORD}: * </span><br />
      <span class="gensmall">{L_PASSWORD_CONFIRM_IF_CHANGED}</span></td>
     <td class="row2">
      <input type="password" class="post" style="width: 200px" name="password_confirm" size="25" maxlength="100" value="{PASSWORD_CONFIRM}" />
     </td>
   </tr>
<tr>
      <td class="row1"><span class="gen">{L_LOCATION}: *</span></td>
      <td class="row2"><input type="text" class="post" style="width:200px" name="username" size="25" maxlength="40" value="{LOCATION}" /></td>
   </tr>
   <tr>
     <td class="catSides" colspan="2" height="28">&nbsp;</td>
   </tr>
   <tr>
     <th class="thSides" colspan="2" height="25" valign="middle">{L_PREFERENCES}</th>
   </tr>
   <tr>
     <td class="row1"><span class="gen">{L_BOARD_LANGUAGE}:</span></td>
     <td class="row2"><span class="gensmall">{LANGUAGE_SELECT}</span></td>
   </tr>
<tr>
     <td class="row1"><span class="gen">{L_BIRTHDAY}&nbsp;{BIRTHDAY_REQUIRED}:</span></td>
     <td class="row2"><span class="gen">{S_BIRTHDAY}</span></td>
   </tr>
        <td class="catSides" colspan="2" height="28">&nbsp;</td>
   </tr>
   <tr>
      <td class="catBottom" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="{L_RESET}" name="reset" class="liteoption" /></td>
   </tr>
</table>

</form>


Now, the problem is that if a user fill in the registration form and do not insert the birthday, the supposed
Code: Select all
$error_msg .= sprintf($lang['Birthday_require']);

error message does not display :(

Any idea?
Pagico
Poster
Poster
 
Posts: 9
Joined: Sat 09. Oct, 2004 01:09

Postby Niels on Sun 10. Oct, 2004 13:51

go into ACP - general config
from there you may control if birthday are mandatory (fill a minimum user age)
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Pagico on Sun 10. Oct, 2004 14:44

I see :D
But after installing the custom registration form, If I go in the "profile" page, I cannot see anymore the other fields. :(
This way people won't be able to use an avatar, or change advanced preferences.

On the contrary, on your site if I click on "profile" I correctly see all the fields (also optionals).

:(

It seems the profile icons recall the form of the profile_register_body.tpl :?:
Last edited by Pagico on Sun 10. Oct, 2004 14:48, edited 1 time in total.
Pagico
Poster
Poster
 
Posts: 9
Joined: Sat 09. Oct, 2004 01:09

Postby Niels on Sun 10. Oct, 2004 14:47

no that is not normal.

the old profile template, will still be used by the "edit profile part" while the new template will be used while register

some of the changes into usercp_register.php must have gone wrong, most likely the placement of the code.
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Next

Return to Custom registration form [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron