aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2004-10-08 11:04:18 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2004-10-08 11:04:18 +0000
commit3f85d0134174a453d707de1a1b6975c6bf54ae14 (patch)
treea29406c44cb5fea3d5587981acf8f89694f06e16 /phpBB
parent2ac2d296e0581bcee218e8e06e734691b016e577 (diff)
downloadforums-3f85d0134174a453d707de1a1b6975c6bf54ae14.tar
forums-3f85d0134174a453d707de1a1b6975c6bf54ae14.tar.gz
forums-3f85d0134174a453d707de1a1b6975c6bf54ae14.tar.bz2
forums-3f85d0134174a453d707de1a1b6975c6bf54ae14.tar.xz
forums-3f85d0134174a453d707de1a1b6975c6bf54ae14.zip
- fixed move_pm and delete_pm
git-svn-id: file:///svn/phpbb/trunk@4997 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_posting.php2
-rw-r--r--phpBB/includes/functions_privmsgs.php39
2 files changed, 27 insertions, 14 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 61a2620e74..7d4849b4e8 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -35,7 +35,7 @@ function generate_smilies($mode, $forum_id)
$user->setup('posting');
}
- page_header($user->lang['SMILIES']);
+ page_header($user->lang['EMOTICONS']);
$template->set_filenames(array(
'body' => 'posting_smilies.html')
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index ab4c244e62..0284071fa4 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -11,7 +11,7 @@
//
// -------------------------------------------------------------
-// Define Rule processing scheme
+// Define Rule processing schema
// NOTE: might change
/*
@@ -20,7 +20,7 @@
2) Add a new check array to the global_privmsgs_rules variable and the condition array (if one is required)
3) Add a new language variable to ucp.php
- The user is then able to select the new rule. It will be checked agains and handled as specified.
+ The user is then able to select the new rule. It will be checked against and handled as specified.
To add new actions (yes, checks can be added here too) to the rule management, the core code has to be modified.
*/
@@ -70,7 +70,7 @@ $global_privmsgs_rules = array(
RULE_IS_FRIEND => array('check0' => 'friend', 'function' => '{CHECK0} == 1'),
RULE_IS_FOE => array('check0' => 'foe', 'function' => '{CHECK0} == 1'),
RULE_IS_USER => array('check0' => 'author_id', 'function' => '{CHECK0} == {USER_ID}'),
- RULE_IS_GROUP => array('check0' => 'author_in_group', 'function' => '{CHECK0} == {GROUP_ID}')),
+ RULE_IS_GROUP => array('check0' => 'author_in_group', 'function' => 'in_array({GROUP_ID}, {CHECK0})')),
CHECK_MESSAGE => array(
RULE_IS_LIKE => array('check0' => 'message_text', 'function' => 'preg_match("/" . preg_quote({STRING}) . "/i", {CHECK0})'),
@@ -566,16 +566,17 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
}
// Move PM from one to another folder
-function move_pm($user_id, $message_limit)
+function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_folder_id)
{
global $db, $user;
- global $_POST, $phpbb_root_path, $phpEx, $SID;
+ global $phpbb_root_path, $phpEx, $SID;
- $move_msg_ids = (isset($_POST['marked_msg_id'])) ? array_map('intval', $_POST['marked_msg_id']) : array();
- $dest_folder = request_var('dest_folder', PRIVMSGS_NO_BOX);
- $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX);
+ $num_moved = 0;
- $num_moved = 0;
+ if (!is_array($move_msg_ids))
+ {
+ $move_msg_ids = array($move_msg_ids);
+ }
if (sizeof($move_msg_ids) && !in_array($dest_folder, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX)) &&
!in_array($cur_folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX, PRIVMSGS_SENTBOX)) && $cur_folder_id != $dest_folder)
@@ -804,11 +805,24 @@ function delete_pm($user_id, $msg_ids, $folder_id)
// then mark the message as deleted...
if ($folder_id == PRIVMSGS_OUTBOX)
{
- // TODO: Recipients will see the message as deleted later
+ // Remove PM from Outbox
+ $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . "
+ WHERE user_id = $user_id AND folder_id = " . PRIVMSGS_OUTBOX . '
+ AND msg_id IN (' . implode(', ', array_keys($delete_rows)) . ')';
+ $db->sql_query($sql);
+
+ // Update PM Information for safety
+ $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET message_text = ''
+ WHERE msg_id IN (" . implode(', ', array_keys($delete_rows)) . ')';
+ $db->sql_query($sql);
+
+ // Set delete flag for those intended to receive the PM
+ // We do not remove the message actually, to retain some basic informations (sent time for example)
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
- SET deleted = 1, msg_id = 0
+ SET deleted = 1
WHERE msg_id IN (' . implode(', ', array_keys($delete_rows)) . ')';
$db->sql_query($sql);
+
$num_deleted = $db->sql_affectedrows();
}
else
@@ -856,7 +870,7 @@ function delete_pm($user_id, $msg_ids, $folder_id)
}
$db->sql_freeresult($result);
- $delete_ids = implode(', ', $delete_rows);
+ $delete_ids = implode(', ', array_keys($delete_rows));
if ($delete_ids)
{
@@ -1411,5 +1425,4 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
unset($messenger);
}
-
?> \ No newline at end of file