Hi!
Bei mir kommt folgendes Problem, wenn man sich registrieren will, oder wenn man sein Profil ändern will
Could not update/insert custom canned message
DEBUG MODE
SQL Error : 1062 Duplicate entry '0' for key 1
INSERT INTO phpbb_custom_canned (group_id,user_id,custom_canned_title,custom_canned_message,sortorder) VALUES(9,2,'','',1)
Line : 794
File : usercp_register.php
Im PHPMyAdmin ist der Eintrag schon vorhanden.
Die Zeile 794 ist die folgende
ROTE:
if ($board_config['birthday_required'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_require']);
}
$birthday = 999999;
}
// End add - Birthday MOD
if ( !$error )
{
// Canned MOD Begin
$canned_id = isset($HTTP_POST_VARS['canned_id']) ? $HTTP_POST_VARS['canned_id'] : 0;
$canned_title = isset($HTTP_POST_VARS['canned_title']) ? $HTTP_POST_VARS['canned_title'] : "";
$canned_message = isset($HTTP_POST_VARS['canned_message']) ? $HTTP_POST_VARS['canned_message'] : "";
$group = isset($HTTP_POST_VARS['group']) ? $HTTP_POST_VARS['group'] : 0;
for($i=0;$i<count($canned_id);$i++)
{
for($j=0;$j<count($canned_id[$i]);$j++)
{
if($canned_id[$i][$j] == 0)
{
$sql = "INSERT INTO " . CUSTOM_CANNED_TABLE . "
(group_id,user_id,custom_canned_title,custom_canned_message,sortorder)
VALUES(" . $group[$i][$j] . "," . $userdata['user_id'] . ",'" . str_replace("\'", "''", $canned_title[$i][$j]) . "','" . str_replace("\'", "''", $canned_message[$i][$j]) . "'," . ($j+1) . ")";
}
else
{
$sql = "UPDATE " . CUSTOM_CANNED_TABLE . "
SET custom_canned_title = '" . str_replace("\'", "''", $canned_title[$i][$j]) . "', custom_canned_message = '" . str_replace("\'", "''", $canned_message[$i][$j]) . "'
WHERE custom_canned_id = " . $canned_id[$i][$j];
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update/insert custom canned message', '', __LINE__, __FILE__, $sql);
}
}
}
// Canned MOD End
if ( $avatar_sql == '' )
{
$avatar_sql = ( $mode == 'editprofile' ) ? '' : "'', " . USER_AVATAR_NONE;
}
Was ist falsch?
mfg Pingu