1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-29 02:59:52 +02:00

fixing some language and style bugs...

git-svn-id: file:///svn/phpbb/trunk@8079 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2007-09-05 13:33:18 +00:00
parent e2863ca2a3
commit feee13f962
11 changed files with 42 additions and 23 deletions

View File

@@ -329,6 +329,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
$user_id = (int) $user->data['user_id'];
$action_ary = $move_into_folder = array();
$num_not_moved = $num_removed = 0;
// Newly processing on-hold messages
if ($release)
@@ -384,6 +385,17 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
$user_new_privmsg = (int) $user->data['user_new_privmsg'];
}
}
else
{
// If not relasing we need to check the number of not moved messages...
$sql = 'SELECT COUNT(msg_id) as num_messages
FROM ' . PRIVMSGS_TO_TABLE . "
WHERE user_id = $user_id
AND folder_id = " . PRIVMSGS_HOLD_BOX;
$result = $db->sql_query($sql);
$num_not_moved = (int) $db->sql_fetchfield('num_messages');
$db->sql_freeresult($result);
}
// Get those messages not yet placed into any box
$retrieve_sql = 'SELECT t.*, p.*, u.username, u.user_id, u.group_id
@@ -558,7 +570,6 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
// Do not change the order of processing
// The number of queries needed to be executed here highly depends on the defined rules and are
// only gone through if new messages arrive.
$num_not_moved = $num_removed = 0;
// Delete messages
if (sizeof($delete_ids))
@@ -619,12 +630,11 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
if (in_array(PRIVMSGS_INBOX, array_keys($move_into_folder)))
{
$sql = 'SELECT folder_id, COUNT(msg_id) as num_messages
$sql = 'SELECT COUNT(msg_id) as num_messages
FROM ' . PRIVMSGS_TO_TABLE . "
WHERE user_id = $user_id
AND folder_id = " . PRIVMSGS_INBOX . "
GROUP BY folder_id";
$result = $db->sql_query_limit($sql, 1);
AND folder_id = " . PRIVMSGS_INBOX;
$result = $db->sql_query($sql);
$folder[PRIVMSGS_INBOX] = (int) $db->sql_fetchfield('num_messages');
$db->sql_freeresult($result);
}
@@ -673,11 +683,12 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
delete_pm($user_id, $delete_ids, $dest_folder);
}
}
//
if ($full_folder_action == FULL_FOLDER_HOLD)
{
$num_not_moved += sizeof($msg_ary);
$num_new -= sizeof($msg_ary);
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
SET folder_id = ' . PRIVMSGS_HOLD_BOX . '

View File

@@ -245,10 +245,10 @@ class ucp_pm
if ($user->data['user_new_privmsg'] && $action == 'view_folder')
{
$return = place_pm_into_folder($global_privmsgs_rules, request_var('release', 0));
$num_not_moved = $user->data['user_new_privmsg'];
$num_not_moved = $return['not_moved'];
// Make sure num_not_moved is valid.
if ($num_not_moved < 0)
if ($user->data['user_new_privmsg'] < 0 || $num_not_moved < 0)
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_new_privmsg = 0, user_unread_privmsg = 0