35 $set = $ilDB->query(
"SELECT user_id FROM notification".
36 " WHERE type = ".$ilDB->quote(
$type,
"integer").
37 " AND user_id = ".$ilDB->quote($user_id,
"integer").
38 " AND id = ".$ilDB->quote($id,
"integer"));
39 return (
bool)$ilDB->numRows($set);
54 $sql .=
"SELECT user_id FROM notification".
55 " WHERE type = ".$ilDB->quote(
$type,
"integer").
56 " AND id = ".$ilDB->quote($id,
"integer").
57 " AND (last_mail < ".$ilDB->quote(date(
"Y-m-d H:i:s", strtotime(
"-".self::THRESHOLD.
"minutes")),
"timestamp").
58 " OR last_mail IS NULL";
61 $sql .=
" OR page_id <> ".$ilDB->quote($page_id,
"integer");
66 $set = $ilDB->query($sql);
67 while(
$row = $ilDB->fetchAssoc($set))
69 $user[] =
$row[
"user_id"];
89 $ilDB->query(
"DELETE FROM notification".
90 " WHERE type = ".$ilDB->quote(
$type,
"integer").
91 " AND user_id = ".$ilDB->quote($user_id,
"integer").
92 " AND id = ".$ilDB->quote($id,
"integer"));
96 $ilDB->query(
"REPLACE INTO notification (type, user_id, id)".
97 " VALUES(".$ilDB->quote(
$type,
"integer").
98 ", ".$ilDB->quote($user_id,
"integer").
99 ", ".$ilDB->quote($id,
"integer").
")");
115 $sql =
"UPDATE notification".
116 " SET last_mail = ".$ilDB->quote(date(
"Y-m-d H:i:s"),
"timestamp");
120 $sql .=
", page_id = ".$ilDB->quote($page_id,
"integer");
123 $sql .=
" WHERE type = ".$ilDB->quote(
$type,
"integer").
124 " AND id = ".$ilDB->quote($id,
"integer").
125 " AND ".$ilDB->in(
"user_id", $user_ids,
false,
"integer");
140 $ilDB->query(
"DELETE FROM notification".
141 " WHERE type = ".$ilDB->quote(
$type,
"integer").
142 " AND id = ".$ilDB->quote($id,
"integer"));
154 $ilDB->query(
"DELETE FROM notification".
155 " WHERE user_id = ".$ilDB->quote($user_id,
"integer"));