big update

This commit is contained in:
unknown
2012-05-13 18:51:08 +03:00
parent 185227c5d2
commit 10df3e2068
24 changed files with 336 additions and 115 deletions
+25 -3
View File
@@ -1424,7 +1424,7 @@
function sendMessage($client, $owner, $topic, $message, $send) {
$time = time();
$q = "INSERT INTO " . TB_PREFIX . "mdata values (0,$client,$owner,'$topic',\"$message\",0,0,$send,$time)";
$q = "INSERT INTO " . TB_PREFIX . "mdata values (0,$client,$owner,'$topic',\"$message\",0,0,$send,$time,0,0)";
return mysql_query($q, $this->connection);
}
@@ -1455,7 +1455,6 @@
$q = "SELECT * FROM " . TB_PREFIX . "mdata WHERE target = $id and send = 0 and archived = 0 ORDER BY time DESC";
break;
case 2:
// removed send no longer needed as we dont send 2 messages any more just 1
$q = "SELECT * FROM " . TB_PREFIX . "mdata WHERE owner = $id ORDER BY time DESC";
break;
case 3:
@@ -1465,11 +1464,17 @@
$q = "UPDATE " . TB_PREFIX . "mdata set viewed = 1 where id = $id AND target = $session->uid";
break;
case 5:
$q = "DELETE FROM " . TB_PREFIX . "mdata where id = $id";
$q = "UPDATE " . TB_PREFIX . "mdata set deltarget = 1,viewed = 1 where id = $id";
break;
case 6:
$q = "SELECT * FROM " . TB_PREFIX . "mdata where target = $id and send = 0 and archived = 1";
break;
case 7:
$q = "UPDATE " . TB_PREFIX . "mdata set delowner = 1 where id = $id";
break;
case 8:
$q = "UPDATE " . TB_PREFIX . "mdata set deltarget = 1,delowner = 1,viewed = 1 where id = $id";
break;
}
if($mode <= 3 || $mode == 6) {
$result = mysql_query($q, $this->connection);
@@ -1479,6 +1484,23 @@
}
}
function getDelSent($uid) {
$q = "SELECT * FROM " . TB_PREFIX . "mdata WHERE owner = $uid and delowner = 1 ORDER BY time DESC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getDelInbox($uid) {
$q = "SELECT * FROM " . TB_PREFIX . "mdata WHERE target = $uid and deltarget = 1 ORDER BY time DESC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getDelArchive($uid) {
$q = "SELECT * FROM " . TB_PREFIX . "mdata WHERE target = $uid and archived = 1 and deltarget = 1 OR owner = $uid and archived = 1 and delowner = 1 ORDER BY time DESC";
return mysql_query($q, $this->connection);
}
function unarchiveNotice($id) {
$q = "UPDATE " . TB_PREFIX . "ndata set ntype = archive, archive = 0 where id = $id";
return mysql_query($q, $this->connection);