No hassle at all.
I suppose I should look through the code and think. Up till now, I have just been mindlessly cutting and pasting because I want to quickly iron out any issues that may exist. Here is the entire "if statement" as I think you intended:
Text Formatted Code
if ($cat_count >= 1) {
$i = 1;
$cat_values = '';
foreach ($A['category'] AS $key => $cat_id) {
$cat_id = COM_applyFilter($cat_id);
if (!empty($cat_id)) {
if (!is_numeric($cat_id) && $_USER['uid'] > 1) {
//anon user cannot add new categories,
//but logged in members may and for now they are not moderated.
$cat_status = '1';
//insert new category
DB_query("INSERT INTO {$_TABLES['evlist_categories']} SET name = '$cat_id', status = '0'");
//$newcid = DB_insertID();
$newcid = DB_getItem($_TABLES['evlist_categories'], 'id', "name='$cat_id'");
if (!empty($newcid)) {
$cat_values .= "('{$A['eid']}','$newcid','$cat_status')";
if ($i < $cat_count) {
$cat_values .= ',';
}
}
} else {
$cat_values .= "('{$A['eid']}','$cat_id')";
if ($i < $cat_count) {
$cat_values .= ',';
}
}
}
$i++;
}
//save category info
if (!empty($cat_values)) {
//inserting categories for a new event
DB_query("INSERT IGNORE INTO {$_TABLES['evlist_lookup']} VALUES " . $cat_values);
}
}
if (isset ($_CONF['notification']) && (in_array ('evlist', $_CONF['notification'])
|| in_array('evList', $_CONF['notification']) || in_array('event', $_CONF['notification']))) {
evlist_sendNotification ($A);
}
COM_updateSpeedlimit('event');
$retval .= COM_refresh ($_CONF['site_url'] . '/evlist/index.php?msg=9');
}