I'm trying to implement a DOB option for user profiles using 3 select fields instead of the single text imput field (3 select fields seems to be the standard with most social networking sites). I've run into a bit of a brick wall and I want to know if what I'm trying to do is even possible. The 3 select fields show up just fine in the profile page (month, date, and year). The problem is that the DOB data is not written to the database. I think that the problem is probably related to the fact that there are 3 different "name" attributes that correspond to each of the three fields (i.e. "1st_dob_month", "2nd_dob_day", "3rd_dob_year"), and none of them are equal to the "internal_name" given in profile.config.php (i.e. "dob"). Most other profile field options only have one "name" attribute that is equal to the "internal_name" value. Is what I'm trying to do, use a select tag with multiple options in a user profile, possible?
// This is in profile.config.php
$data['profile:details'][] = (object)(array(
"name" => __gettext("Date of Birth"), "internal_name" => "dob",
"field_type" => "dob",
"description" => __gettext("When were you born, fella?"),
"user_type" => "person",
"category" => __gettext("Basic details"),
"invisible" => false,
"required" => false,
));
// This is under display_input_field() in displaylib.php
case "dob":
if (!isset($data['profile:preload'][$parameter[3]])) {
$months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
$datedata = "";
$month = "";
$day = "";
$year = "";
$i = 1;
if ($datedata = get_recordset_select("elggprofile_data", "owner=" . $parameter[5] . " name='dob_month' AND name ='dob_day' AND name='dob_year'", "ORDER BY value", "value", '', '')) {
$month = $datedata[0];
$day = $datedata[1];
$year = $datedata[2];
}
// Generate the html tags for months
$run_result .= "";
foreach ($months as $m){
$run_result .= "" . $m . "";
$i++;
}
$run_result .= "";
// Generate the html tags for days
$run_result .= "";
for ($i=1; $i
Keywords: profile.config.php profile displaylib.php