forked from science-ation/science-ation
Modified some of the user preference data as it's stored in the user array
This commit is contained in:
parent
1e2340beb1
commit
cf2e2eb6db
36
user.inc.php
36
user.inc.php
@ -192,14 +192,7 @@ function user_load($users_id, $accounts_id = false)
|
|||||||
while($r = mysql_fetch_assoc($q)){
|
while($r = mysql_fetch_assoc($q)){
|
||||||
$selected[] = $r['aaid'];
|
$selected[] = $r['aaid'];
|
||||||
}
|
}
|
||||||
$u['special_awards'] = get_special_awards($u['conferences_id']);
|
$u['special_awards'] = $selected;
|
||||||
foreach($u['special_awards'] as $id => $text){
|
|
||||||
if(in_array($id, $selected)){
|
|
||||||
$u['special_awards'][$id] = 'yes';
|
|
||||||
}else{
|
|
||||||
$u['special_awards'][$id] = 'no';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'available_times':
|
case 'available_times':
|
||||||
@ -218,11 +211,8 @@ function user_load($users_id, $accounts_id = false)
|
|||||||
foreach($times as $t) {
|
foreach($times as $t) {
|
||||||
$st = substr($t['starttime'], 0, 5);
|
$st = substr($t['starttime'], 0, 5);
|
||||||
$end = substr($t['endtime'], 0, 5);
|
$end = substr($t['endtime'], 0, 5);
|
||||||
$items[$t['id']] = trim("{$t['name']} ({$t['date']} $st - $end)");
|
|
||||||
if(in_array($t['id'], $sel)){
|
if(in_array($t['id'], $sel)){
|
||||||
$items[$t['id']] = 'yes';
|
$items[] = $t['id'];
|
||||||
}else{
|
|
||||||
$items[$t['id']] = 'no';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$u['available_times'] = $items;
|
$u['available_times'] = $items;
|
||||||
@ -234,16 +224,7 @@ function user_load($users_id, $accounts_id = false)
|
|||||||
while($row = mysql_fetch_assoc($q1)){
|
while($row = mysql_fetch_assoc($q1)){
|
||||||
$ids[] = $row['schedule_id'];
|
$ids[] = $row['schedule_id'];
|
||||||
}
|
}
|
||||||
$q2 = mysql_query("SELECT id FROM schedule WHERE schedule.conferences_id='{$u['conferences_id']}'");
|
$u['available_events'] = $ids;
|
||||||
$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;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'volunteer_positions':
|
case 'volunteer_positions':
|
||||||
@ -252,16 +233,7 @@ function user_load($users_id, $accounts_id = false)
|
|||||||
while($row = mysql_fetch_assoc($q1)){
|
while($row = mysql_fetch_assoc($q1)){
|
||||||
$ids[] = $row['vpid'];
|
$ids[] = $row['vpid'];
|
||||||
}
|
}
|
||||||
$q2 = mysql_query("SELECT id FROM volunteer_positions WHERE conferences_id = {$u['conferences_id']}");
|
$u['volunteer_positions'] = $ids;
|
||||||
$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;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user