2011-03-28 14:21:28 +00:00
|
|
|
<?
|
|
|
|
authorize();
|
|
|
|
|
|
|
|
$UserID = $LoggedUser['ID'];
|
|
|
|
$ConvID = $_POST['convid'];
|
2013-05-05 08:00:31 +00:00
|
|
|
if (!is_number($ConvID)) {
|
|
|
|
error(404);
|
|
|
|
}
|
|
|
|
$DB->query("
|
|
|
|
SELECT UserID
|
|
|
|
FROM pm_conversations_users
|
|
|
|
WHERE UserID='$UserID' AND ConvID='$ConvID'");
|
2013-07-10 00:08:53 +00:00
|
|
|
if (!$DB->has_results()) {
|
2013-05-05 08:00:31 +00:00
|
|
|
error(403);
|
|
|
|
}
|
2011-03-28 14:21:28 +00:00
|
|
|
|
2013-05-05 08:00:31 +00:00
|
|
|
if (isset($_POST['delete'])) {
|
|
|
|
$DB->query("
|
|
|
|
UPDATE pm_conversations_users
|
|
|
|
SET
|
|
|
|
InInbox='0',
|
|
|
|
InSentbox='0',
|
|
|
|
Sticky='0'
|
2011-03-28 14:21:28 +00:00
|
|
|
WHERE ConvID='$ConvID' AND UserID='$UserID'");
|
|
|
|
} else {
|
2013-05-05 08:00:31 +00:00
|
|
|
if (isset($_POST['sticky'])) {
|
|
|
|
$DB->query("
|
|
|
|
UPDATE pm_conversations_users
|
|
|
|
SET Sticky='1'
|
2011-03-28 14:21:28 +00:00
|
|
|
WHERE ConvID='$ConvID' AND UserID='$UserID'");
|
|
|
|
} else {
|
2013-05-05 08:00:31 +00:00
|
|
|
$DB->query("
|
|
|
|
UPDATE pm_conversations_users
|
|
|
|
SET Sticky='0'
|
2011-03-28 14:21:28 +00:00
|
|
|
WHERE ConvID='$ConvID' AND UserID='$UserID'");
|
|
|
|
}
|
2013-05-05 08:00:31 +00:00
|
|
|
if (isset($_POST['mark_unread'])) {
|
|
|
|
$DB->query("
|
|
|
|
UPDATE pm_conversations_users
|
|
|
|
SET Unread='1'
|
2011-03-28 14:21:28 +00:00
|
|
|
WHERE ConvID='$ConvID' AND UserID='$UserID'");
|
|
|
|
$Cache->increment('inbox_new_'.$UserID);
|
|
|
|
}
|
|
|
|
}
|
2013-06-12 08:00:46 +00:00
|
|
|
header('Location: ' . Inbox::get_inbox_link());
|
2011-03-28 14:21:28 +00:00
|
|
|
?>
|