phpScheduleIt
June 20, 2013, 02:09:53 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Add field to registration page  (Read 6961 times)
gmarcom
Newbie
*

Karma: 0
Posts: 3


« on: March 30, 2006, 10:23:08 AM »

I was wondering if there is an easy way to add a field to the registration page?  I was thinking a required box for account numbers, etc.

Thanks,

Greg
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #1 on: March 30, 2006, 11:37:54 AM »

The basic logic is the same as adding a field to the reservation, which there is a document for in the SourceForge downloads.  This will be much easier to do in a future version of phpScheduleIt, though.
Logged
emonsta
Newbie
*

Karma: 0
Posts: 13


« Reply #2 on: April 18, 2006, 10:18:13 PM »

Hi
I've the same question really. I posted a thread to the old forums, so if you've read those, this is the same.
I am trying to add fields to the registration/profile screen. I've added the field to the database, made all the changes according to the Extending phpScheduleIt doc, except adding a field to the AuthDB.class.php and a function to get the value of the property - step 3.  this is because i can't find anywhere where I would do that. the code doesn't look the same, and I can't find anything i understand that would do the same job - i'm very much a beginner.
What happens:
The field shows up on the form, the value I enter in a new or existing profile gets entered into the database, but its not reading the record from the database to the form. the form field appears blank.  
I'm sure its something really really simple. can you point me to which bit of code I should be looking at to fix it?
thanks

e
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #3 on: April 19, 2006, 10:17:40 AM »

You're right, this ends up going down a different path.  If you are able to insert the data into the database, all you'll need to change is the function on line 148 of lib/User.class.php to this:

Code:

function get_user_data() {
return array (
'memberid' => $this->userid,
'email' => $this->email,
'fname' => $this->fname,
'lname' => $this->lname,
'phone' => $this->phone,
'institution'=> $this->inst,
'position' => $this->position,
'perms' => $this->perms,
'logon_name'=> $this->logon_name,
'new_field_name' => $this->new_field_value
);
}


And change the load_by_id() function on line 57 to set the class variable (you'll need to declare it up at the top just like the rest of them).  So..

Code:
$this->new_field_value = $u['new_field_name'];
Logged
emonsta
Newbie
*

Karma: 0
Posts: 13


« Reply #4 on: April 20, 2006, 07:01:26 PM »

Thanks Nick!
that's fabulous. all working well now  Cheesy
one more question for you...

at the moment we're in the middle of editing the menu buttons and adding fields, and we seem to have done something odd because the link names aren't appearing on screen. all we're getting is a ? where the word should be. See screenshot http://www.chewlog.com/phpScheduleIt/development_notes/screenshot.doc We've updated the language file (english-GB, which we set to default), and we don't know what else could be wrong. do you have any ideas?

thanks again Smiley

e

ps. i've narrowed it down a bit. it seems that the application is not returning en_GB as the default language even though we've specified it in the config file. is there anything else we need to do to make it stay put?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #5 on: April 21, 2006, 09:46:59 AM »

You just need to make sure that there is an entry in each of the language files that you are going to use.  For example, if you have

Code:
translate('Some text');


You need to have a:

Code:
$strings['Some text'] = 'Some text';


element in all of the language files that you use.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!