Gazelle/sections/inbox/takeedit.php

47 lines
1020 B
PHP
Raw Normal View History

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'");
if ($DB->record_count() == 0) {
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-04 08:00:34 +00:00
header('Location: ' . Inbox::get_inbox_link($LoggedUser['ListUnreadPMsFirst']));
2011-03-28 14:21:28 +00:00
?>