Leiserson Posted December 2, 2008 Report Share Posted December 2, 2008 (edited) Ok so I am adding a pilot country field to the registration form and have already edited the registration_mainform.tpl, RegistrationData.class.php and the registration.php files. How I edited - The template- I added a drop down box, set the value of the box as country and entered the country data and the values aswell. The registration.php- <?php function ProcessRegistration() { // Yes, there was an error if(!$this->VerifyData()) { Template::Show('registration_mainform.tpl'); } else { $firstname = $this->post->firstname; $lastname = $this->post->lastname; $email = $this->post->email; $code = $this->post->code; $country = $this->post->country; $location = $this->post->location; $hub = $this->post->hub; $password = $this->post->password1; if(CodonEvent::Dispatch('registration_precomplete', 'Registration', $_POST) == false) { return false; } if(RegistrationData::AddUser($firstname, $lastname, $email, $code, $location, $country, $hub, $password) == false) ?> I haven't added the check to see if valid yet but i will do that later on. I also edited the RegistrationData.class.php as follows- <?php /** * Add a User */ public function AddUser($firstname, $lastname, $email, $code, $country, $location, $hub, $password, $confirm=false) { //Set the password, add some salt $salt = md5(date('His')); $password = md5($password . $salt); //Stuff it into here, the confirmation email will use it. self::$salt = $salt; $firstname = ucwords($firstname); $lastname = ucwords($lastname); //Add this stuff in if($confirm == true) $confirm = 1; else $confirm = 0; $sql = "INSERT INTO ".TABLE_PREFIX."pilots (firstname, lastname, email, code, country, location, hub, password, salt, confirmed) VALUES ('$firstname', '$lastname', '$email', '$code', '$country', '$location', '$hub', '$password', '$salt', $confirm)"; $res = DB::query($sql); if(DB::errno() != 0) { if(DB::errno() == 1062) { self::$error = 'This E-mail address has a;ready been used before'; return false; } return false; } ?> Now my question Nabeel is, are there any more files i must edit for the data to become vaild and what must i add to be able to retrieve the country and an icon representing the flag and display it on the pilots profile. Edited August 7, 2023 by Leiserson Personal info Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 2, 2008 Administrators Report Share Posted December 2, 2008 You don't need to do all this. In the admin panel, under settings, there's "Custom Fields", you can add it there.http://www.phpvms.net/docs/managing_you ... ile_fieldsAfter adding it, to show it in the profile, you have to call it (assuming you named it "Country"): echo PilotData::GetFieldValue($pilot->pilotid, 'Country'); As for showing icons, that'd be a bit trickier. But if this seems like something everyone wants, I can add it in, that way there's no hassle during updates. I'm not quite sure where to get the icons as well. Quote Link to comment Share on other sites More sharing options...
Leiserson Posted December 2, 2008 Author Report Share Posted December 2, 2008 Hmmm well the problem with custom fields as you said...Is i can call up the icons which is something im wanting. But if you are considering adding it to an update i can give you a source for the icons and maybe even help out abit with the process. You can add me on Im (msn:jacob.krustchinsky@live.com yahoo:jakewestward gmail:jakewestward) and we can talk if you like!Cheers!Jacob Allen KrustchinskyChief Executive OfficerFlyZen Virtual Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted December 3, 2008 Administrators Report Share Posted December 3, 2008 I'll add it in. I'll also add in birthday, to check the age. I'll IM you. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted November 13, 2009 Report Share Posted November 13, 2009 You don't need to do all this. In the admin panel, under settings, there's "Custom Fields", you can add it there. http://www.phpvms.net/docs/managing_you ... ile_fields After adding it, to show it in the profile, you have to call it (assuming you named it "Country"): echo PilotData::GetFieldValue($pilot->pilotid, 'Country'); As for showing icons, that'd be a bit trickier. But if this seems like something everyone wants, I can add it in, that way there's no hassle during updates. I'm not quite sure where to get the icons as well. Hey Nabeel, I know this is old as can be and then some, but I have a COMPLETE set of flags from every country in the world that would work perfect. If you ever need them for something like this, please feel free to give me a shout and I will gladly share with you. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted November 17, 2009 Administrators Report Share Posted November 17, 2009 Haha! This is old. The whole set is under lib/images/countries, but thanks Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted November 18, 2009 Report Share Posted November 18, 2009 Ok. I never looked in there. ;-) Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted November 18, 2009 Administrators Report Share Posted November 18, 2009 It's all good!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.