Log in

View Full Version : Foreach code


wolfe
04-16-2007, 12:12 PM
im still converting the mod over to vb3.6.x and im stuck on sumthing

im trying to get it to show each item in the datastore as a option in a select list can anyone help and if people want to know what mod im converting its the vB Bug Tracker its nearly complete just sorting a few probs out.



// Grab the cache
$bugcache = unserialize($datastore['bugcache']);

foreach ($bugcache['severity'] as $key => $entry) {
$selected = iif($vbug_severityid == $key, HTML_SELECTED);
$val = $entry['severityname'];
eval('$severitybits .= "' . fetch_template('userfield_select_option') . '";');
}
foreach ($bugcache['type'] as $key => $entry) {
$selected = iif($vbug_typeid == $key, HTML_SELECTED);
$val = $entry['typename'];
eval('$typebits .= "' . fetch_template('userfield_select_option') . '";');
}
foreach ($bugcache['version'] as $key => $entry) {
$selected = iif($vbug_versionid == $key, HTML_SELECTED);
$val = $entry['versionname'];
eval('$versionbits .= "' . fetch_template('userfield_select_option') . '";');
}
foreach ($bugcache['status'] as $key => $entry)
{
$selected = iif($vbug_statusid == $key, HTML_SELECTED);
$val = $entry['statusname'];
eval('$statusbits .= "' . fetch_template('userfield_select_option') . '";');
}