На локальной машине поставил для теста мод
Custom profile fields.
В админке создал группу чекбоксов. Зашел в свой профиль, отметил некоторые из этих новых, сохранил. В форуме все отображается прекрасно. Вновь зашел в свой профиль, оставил отмеченным только один чекбокс, успешно сохранил изменения. Ещё раз вошел в профиль, убрал оставшуюся отметку (т.о. все чекбоксы этой группы не отмечены), при попытке сохранения выводится сообщение:
Could not update custom profile fields
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE user_id = 6' at line 3
UPDATE forum_users SE WHERE user_id = 6
Line : 614
File : usercp_register.php
Подозрение вызывает
Залез в usercp_register.php, там такой код:
//
// Custom Profile Fields MOD
//
$profile_data = get_fields('WHERE users_can_view = '.ALLOW_VIEW);
$profile_names = array();
$semaphore = 0;
$sql2 = "UPDATE " . USERS_TABLE . "
SET ";
foreach($profile_data as $fields)
{
$name = text_to_column($fields['field_name']);
$type = $fields['field_type'];
$required = $fields['is_required'] == REQUIRED ? true : false;
if(isset($HTTP_POST_VARS[$name]))
{
$temp = (isset($HTTP_POST_VARS[$name])) ? $HTTP_POST_VARS[$name] : array();
if($type == CHECKBOX)
{
$temp2 = '';
foreach($temp as $temp3)
$temp2 .= htmlspecialchars($temp3) . ',';
$temp2 = substr($temp2,0,strlen($temp2)-1);
$temp = $temp2;
}
else
$temp = htmlspecialchars($temp);
$profile_names[$name] = $temp;
$sql2 .= $name . " = '".str_replace("\'","''",$profile_names[$name])."', ";
}
$semaphore++;
}
$sql2 = substr($sql2,0,strlen($sql2)-2)."
WHERE user_id = ".$userdata['user_id'];
if(!$db->sql_query($sql2) && ($semaphore))
message_die(GENERAL_ERROR,'Could not update custom profile fields','',__LINE__,__FILE__,$sql2);
//
// END Custom Profile Fields MOD
//
Помогите, плиз, разобраться в чём проблема.
Добавлено спустя 10 минут 21 секунду:
В самой админке, при редакции профиля, такой ошибки не происходит.