Added comments to javascript code #215
@@ -6,18 +6,23 @@ function getOldChatMessages($user2ID) {
|
|||||||
if (getFriendshipStatus($user2ID) == 1) {
|
if (getFriendshipStatus($user2ID) == 1) {
|
||||||
$stmt = prepareQuery("
|
$stmt = prepareQuery("
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
`private_message`
|
(SELECT
|
||||||
WHERE
|
*
|
||||||
`origin` = :user1 AND
|
FROM
|
||||||
`destination` = :user2 OR
|
`private_message`
|
||||||
`origin` = :user2 AND
|
WHERE
|
||||||
`destination` = :user1
|
`origin` = :user1 AND
|
||||||
|
`destination` = :user2 OR
|
||||||
|
`origin` = :user2 AND
|
||||||
|
`destination` = :user1
|
||||||
|
ORDER BY
|
||||||
|
`messageID` DESC
|
||||||
|
LIMIT
|
||||||
|
100) sub
|
||||||
ORDER BY
|
ORDER BY
|
||||||
`creationdate` ASC
|
`messageID` ASC
|
||||||
LIMIT
|
|
||||||
100
|
|
||||||
");
|
");
|
||||||
|
|
||||||
$stmt->bindParam(":user1", $user1ID);
|
$stmt->bindParam(":user1", $user1ID);
|
||||||
@@ -76,7 +81,7 @@ function getNewChatMessages($lastID, $destination) {
|
|||||||
`destination` = :user1) AND
|
`destination` = :user1) AND
|
||||||
`messageID` > :lastID
|
`messageID` > :lastID
|
||||||
ORDER BY
|
ORDER BY
|
||||||
`creationdate` ASC
|
`messageID` ASC
|
||||||
");
|
");
|
||||||
|
|
||||||
$stmt->bindParam(':user1', $_SESSION["userID"]);
|
$stmt->bindParam(':user1', $_SESSION["userID"]);
|
||||||
|
|||||||
Reference in New Issue
Block a user