Hi ...
suche:
Code: Alles auswählen
$sql = "UPDATE " . USERS_TABLE . "
SET user_unread_privmsg = " . $sql . ", user_new_privmsg = 0, user_last_privmsg = " . $userdata['session_start'] . "
WHERE user_id = " . $userdata['user_id'];
ersetze mit:
Code: Alles auswählen
// fix phpbb bug (user_unread_privmsg and user_new_privmsg are unreliable if > 0)
$check_total = $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'];
if ( $check_total )
{
$sql = "SELECT COUNT(privmsgs_id) AS total
FROM " . PRIVMSGS_TABLE . "
WHERE privmsgs_to_userid = " . $userdata['user_id'] . "
AND privmsgs_type = " . PRIVMSGS_UNREAD_MAIL;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query private message information', '', __LINE__, __FILE__, $sql);
}
$userdata['user_unread_privmsg'] = ( $row = $db->sql_fetchrow($result) ) ? $row['total'] : 0;
$sql = "SELECT COUNT(privmsgs_id) AS total
FROM " . PRIVMSGS_TABLE . "
WHERE privmsgs_to_userid = " . $userdata['user_id'] . "
AND privmsgs_type = " . PRIVMSGS_NEW_MAIL;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query private message information', '', __LINE__, __FILE__, $sql);
}
$userdata['user_new_privmsg'] = ( $row = $db->sql_fetchrow($result) ) ? $row['total'] : 0;
}
$sql = $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'];
$sql = ( $check_total == $sql ) ? "user_unread_privmsg + user_new_privmsg" : $sql;
$sql = "UPDATE " . USERS_TABLE . "
SET user_unread_privmsg = " . $sql . ", user_new_privmsg = 0, user_last_privmsg = " . $userdata['session_start'] . "
WHERE user_id = " . $userdata['user_id'];
suche:
Code: Alles auswählen
// fix phpbb bug (user_unread_privmsg and user_new_privmsg are unreliable if > 0)
$check_total = $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'];
if ( $check_total )
{
$sql = "SELECT COUNT(privmsgs_id) AS total
FROM " . PRIVMSGS_TABLE . "
WHERE privmsgs_to_userid = " . $userdata['user_id'] . "
AND privmsgs_type = " . PRIVMSGS_UNREAD_MAIL;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query private message information', '', __LINE__, __FILE__, $sql);
}
$userdata['user_unread_privmsg'] = ( $row = $db->sql_fetchrow($result) ) ? $row['total'] : 0;
$sql = "SELECT COUNT(privmsgs_id) AS total
FROM " . PRIVMSGS_TABLE . "
WHERE privmsgs_to_userid = " . $userdata['user_id'] . "
AND privmsgs_type = " . PRIVMSGS_NEW_MAIL;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query private message information', '', __LINE__, __FILE__, $sql);
}
$userdata['user_new_privmsg'] = ( $row = $db->sql_fetchrow($result) ) ? $row['total'] : 0;
}
$sql = $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'];
$sql = ( $check_total == $sql ) ? "user_unread_privmsg + user_new_privmsg" : $sql;
$sql = "UPDATE " . USERS_TABLE . "
SET user_unread_privmsg = " . $sql . ", user_new_privmsg = 0, user_last_privmsg = " . $userdata['session_start'] . "
WHERE user_id = " . $userdata['user_id'];
ersetze mit:
Code: Alles auswählen
$sql = "UPDATE " . USERS_TABLE . "
SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . "
WHERE user_id = " . $to_userdata['user_id'];
Du hast beim Einbau die falsche Stelle erwischt
Markus