From cf2e2eb6dbf53c7d10b03203a0781e9bc914c081 Mon Sep 17 00:00:00 2001 From: jacob Date: Tue, 16 Nov 2010 20:42:40 +0000 Subject: [PATCH] Modified some of the user preference data as it's stored in the user array --- user.inc.php | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/user.inc.php b/user.inc.php index b553ede..7ba8189 100644 --- a/user.inc.php +++ b/user.inc.php @@ -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; }