notif
This commit is contained in:
parent
f9154b632a
commit
e14497a06b
3 changed files with 35 additions and 1 deletions
|
@ -45,9 +45,31 @@
|
|||
}
|
||||
}
|
||||
|
||||
$poid = bin2hex(random_bytes(16));
|
||||
|
||||
$stmt = $db->prepare("INSERT INTO main.comment (username, targetType, targetId, date, content, id) VALUES (?,?,?,?,?,?)");
|
||||
$stmt->execute([$username,$postType,$postId,microtime(true) - $ref,$postie,bin2hex(random_bytes(16))]);
|
||||
$stmt->execute([$username,$postType,$postId,microtime(true) - $ref,$postie,$poid]);
|
||||
|
||||
$postieP = "https://nbg.dervland.net/comment.php?id=" . $poid;
|
||||
|
||||
$user10 = '%system';
|
||||
if ($postType == 'user') {
|
||||
$postie = "A user commented on your wall: " . $postieP;
|
||||
$stmt = $db->prepare("INSERT INTO main.comment (username, targetType, targetId, date, content, id) VALUES (?,?,?,?,?,?)");
|
||||
$stmt->execute([$user10,'notification',$postId,microtime(true) - $ref,$postie,bin2hex(random_bytes(16))]);
|
||||
} else if ($postType == 'comment') {
|
||||
$stmt = $db->prepare("SELECT * FROM comment WHERE id = ? ORDER BY date DESC");
|
||||
$stmt->execute([
|
||||
$poid
|
||||
]);
|
||||
$posts1 = $stmt->fetchAll(PDO::FETCH_DEFAULT);
|
||||
|
||||
$posts2 = $posts1[0]['username'];
|
||||
|
||||
$postie = "A user replied to your post: " . $postieP;
|
||||
$stmt = $db->prepare("INSERT INTO main.comment (username, targetType, targetId, date, content, id) VALUES (?,?,?,?,?,?)");
|
||||
$stmt->execute([$user10,'notification',$posts2,microtime(true) - $ref,$postie,bin2hex(random_bytes(16))]);
|
||||
}
|
||||
|
||||
getOut($postType,$postId);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue