...

View Full Version : Add new form field into complex website template... Any ideas?



new_to_this
05-28-2011, 06:00 AM
Hi

I am new to complex coding.

I am trying to add an extra field to a website that is a complex template.

It appears that each field in the sign up form has a php page. Here is the 'Your name' coding that i think is for the form field that is driven through php.



<?php

class field_i_am extends fieldType_select
{
/**
* Constructor.
*
* @param string $name
*/
public function __construct( $name = 'i_am' ) {
parent::__construct($name);
}


public function setup( SK_Form $from )
{
// TODO: getting values from database
$this->values = array(1, 2, 4, 8);

$this->setValue(current($this->values));

parent::setup($from);
}

}

And the code that calls it:



<?php

class component_SignUp extends component_FieldForm
{

public function __construct( array $params = null )
{
if (SK_Config::section('profile_registration')->type == 'invite') {
$this->annul();
}

parent::__construct('sign_up');

$this->enable_sections = false;
//$this->cache_lifetime = 10;
}

public function fields(){
return array('username', 'password','email','i_agree_with_tos');
}

}

I think it appears to be a very complex and confusing system.

If someone knows, how would i add a new field to this template in the sign up form? I want to add a 'Surname', and use this current code as listed above as a 'First Name' field.

I'm really baffled on this. Any input would be great!

If you have a thought and would like to see other code from the template then easy, just ask...

thanks
steve

Old Pedant
05-28-2011, 09:16 PM
And how is this related to MySQL?

new_to_this
05-29-2011, 01:22 PM
yes you are right, sorry for any inconvenience
sc



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum