Announcement

  •  » Extensions
  •  » registration form - new fields

#1 2009-08-25 15:34:15

andi
Member
2009-08-25
1

registration form - new fields

Hey,

I would like to add some more information in the registration form.

For example:

- first name
- last name

So... I added the fields in the register.tpl file and I can see the fields on my site. In the database I added the fields (firstname, lastname) as well, no problem, but I have no idea how can I fill the fields in the database?!?

I already changed these files:

register.tpl

      <li>
        <span class="property">
          <label for="firstname">* {'Firstname'|@translate}</label>
        </span>
        <input type="text" name="firstname" id="firstname" value="{$F_FIRSTNAME}" >
      </li>

and the same for lastname.

register.php (line 79-82)

  'F_ACTION' => 'register.php',
  'F_LOGIN' => $login,
  'F_FIRSTNAME' => $firstname, 
  'F_LASTNAME' => $lastname, 
  'F_EMAIL' => $email

functions_user.inc.php (line 116-123)

    $insert =
      array(
        $conf['user_fields']['id'] => $next_id,
        $conf['user_fields']['username'] => mysql_real_escape_string($login),
        $conf['user_fields']['firstname'] => mysql_real_escape_string($firstname),   
        $conf['user_fields']['lastname'] => mysql_real_escape_string($lastname),   
        $conf['user_fields']['password'] => $conf['pass_convert']($password),
        $conf['user_fields']['email'] => $mail_address
        );

In the registration form I get the notice Undefined variable: firstname and lastname, but why? Where can I find the declaration for the variables?

Greets andi

Offline

 

#2 2009-12-10 06:49:01

Sam40
Guest

Re: registration form - new fields

I am having the same problem can someone help us please. thanks

 

#3 2009-12-10 07:57:53

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: registration form - new fields

The problem is these fields have NOTHING to do in the users table.
We have a user_infos table to describe role/levels in Piwigo and user interface.
These fields could be there but they will better be in a separated table.


So they can't be inserted in the same insert statement than id, username, password and email as proposed.

The real right solution is not to modifiy register.php which could be upgraded by next release but to write a plugin to do it correctly.
A bit more complex at the starting point, much more efficient later.

You need to know some php coding basis and we could help you to code it.


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#4 2014-01-22 20:33:42

sege
Member
2014-01-22
21

Re: registration form - new fields

Sorry to wake an old thread but I have the same thing here. I'd love to have first/last name on my users and I kind find any plugin which enabled this?

Am I looking poor or do I have to develop one?

Offline

 

#5 2014-01-22 21:11:16

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7228

Re: registration form - new fields

Hi :-)

For piwigo 2.5 -> [extension by ddtddt] Add Info Users

For piwigo 2.6, you must develop one
  http://piwigo.org/releases/2.6.0#user_manager


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#6 2014-01-23 00:18:42

flop25
Piwigo Team
2006-07-06
7037

Re: registration form - new fields

Hi
I have made such a system on my family gallery.  I will give you tomorrow the trick
Don't hesitate to bump the thread


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2014-01-23 16:22:28

flop25
Piwigo Team
2006-07-06
7037

Re: registration form - new fields

sege wrote:

Sorry to wake an old thread but I have the same thing here. I'd love to have first/last name on my users and I kind find any plugin which enabled this?

Am I looking poor or do I have to develop one?

if your goal is to replace the simple 'username' by First and Last name to log-in/register, here a tutorial in our Doc based on what I made : http://piwigo.org/doc/doku.php?id=user_ … last_names
If what you want is to add first and last name as a complementary of info, so in addition but keep the username/nickname , the plugin of ddtddt is what you need


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#8 2014-01-23 21:02:21

sege
Member
2014-01-22
21

Re: registration form - new fields

How the heck did I miss that? I have search for user, last first name and so on. Lucky for me I'm just blind, if not this wouldn't exist. Or something like that. Thanks, seem to do exactly what I want! :)

You won't upgrade it to 2.6? I'll probably develop and stick to 2.5 at the moment and roll to 2.6 later, maybe I'll have to do something about this then.

Offline

 

#9 2014-02-08 09:40:13

sege
Member
2014-01-22
21

Re: registration form - new fields

ddtddt, will you upgrade your extension to work with 2.6 or do I have to find another solution to move on to 2.6? Didn't think it would be out this soon and it feels wrong to build around 2.5 when 2.6 is out.

Offline

 

#10 2014-02-08 10:58:04

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7228

Re: registration form - new fields

sege wrote:

ddtddt, will you upgrade your extension to work with 2.6 or do I have to find another solution to move on to 2.6? Didn't think it would be out this soon and it feels wrong to build around 2.5 when 2.6 is out.

Hi :-)

Admin part gestion user is change for Piwigo 2.6

I haven't planned yet to update


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#11 2014-02-08 12:04:54

sege
Member
2014-01-22
21

Re: registration form - new fields

Can I somehow convince you to update? A beer? Two? 50 translated lines? ;)

Offline

 

#12 2014-02-08 13:31:25

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7228

Re: registration form - new fields

sege wrote:

Can I somehow convince you to update? A beer? Two? 50 translated lines? ;)

Hi :-)

2 week in sweden :-D

Seriously time to find a solution for the admin part

I thinks (but i don't test) public part and register works


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#13 2014-02-08 13:36:32

sege
Member
2014-01-22
21

Re: registration form - new fields

Hmm, it'll do for me actually. I'll give it a try. The admin part I can handle in SQL or something instead.

I just wan't to register first/last name and use it automatically as photographer when uploading.

Offline

 

#14 2014-02-09 18:46:56

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7228

Re: registration form - new fields

Hi :-)

I just take the time to test

I make change

you can test new release plugin 2.6.a -> [extension by ddtddt] Add Info Users


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#15 2014-02-09 20:48:39

sege
Member
2014-01-22
21

Re: registration form - new fields

I think it works, I used the 2.5 version for 2.6 and it worked as well. At least registration and getting the info into the database.

I can't change info in admin GUI but maybe you didn't fix that? I really don't need it so I don't care.. :)

I have a few questions also;
Q1: I would like to change the textbox in registration page, can I do that with CSS? It's hard coded in the profile_add.tpl so I changed there but that isn't a very good idea.

Q2: Is it possible to require the boxes to be filled at registration?

Offline

 
  •  » Extensions
  •  » registration form - new fields

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact