Modified some of the user preference data as it's stored in the user array

This commit is contained in:
jacob 2010-11-16 20:42:40 +00:00
parent 1e2340beb1
commit cf2e2eb6db

View File

@ -192,14 +192,7 @@ function user_load($users_id, $accounts_id = false)
while($r = mysql_fetch_assoc($q)){
$selected[] = $r['aaid'];
}
$u['special_awards'] = get_special_awards($u['conferences_id']);
foreach($u['special_awards'] as $id => $text){
if(in_array($id, $selected)){
$u['special_awards'][$id] = 'yes';
}else{
$u['special_awards'][$id] = 'no';
}
}
$u['special_awards'] = $selected;
break;
case 'available_times':
@ -218,11 +211,8 @@ function user_load($users_id, $accounts_id = false)
foreach($times as $t) {
$st = substr($t['starttime'], 0, 5);
$end = substr($t['endtime'], 0, 5);
$items[$t['id']] = trim("{$t['name']} ({$t['date']} $st - $end)");
if(in_array($t['id'], $sel)){
$items[$t['id']] = 'yes';
}else{
$items[$t['id']] = 'no';
$items[] = $t['id'];
}
}
$u['available_times'] = $items;
@ -234,16 +224,7 @@ function user_load($users_id, $accounts_id = false)
while($row = mysql_fetch_assoc($q1)){
$ids[] = $row['schedule_id'];
}
$q2 = mysql_query("SELECT id FROM schedule WHERE schedule.conferences_id='{$u['conferences_id']}'");
$items = array();
while($row = mysql_fetch_assoc($q2)){
if(in_array($row['id'], $ids)){
$items[$row['id']] = 'yes';
}else{
$items[$row['id']] = 'no';
}
}
$u['available_events'] = $items;
$u['available_events'] = $ids;
break;
case 'volunteer_positions':
@ -252,16 +233,7 @@ function user_load($users_id, $accounts_id = false)
while($row = mysql_fetch_assoc($q1)){
$ids[] = $row['vpid'];
}
$q2 = mysql_query("SELECT id FROM volunteer_positions WHERE conferences_id = {$u['conferences_id']}");
$items = array();
while($row = mysql_fetch_assoc($q2)){
if(in_array($row['id'], $ids)){
$items[$row['id']] = 'yes';
}else{
$items[$row['id']] = 'no';
}
}
$u['volunteer_positions'] = $items;
$u['volunteer_positions'] = $ids;
break;
}