summaryrefslogtreecommitdiff
path: root/inc/mod/auth.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/mod/auth.php')
-rw-r--r--inc/mod/auth.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/inc/mod/auth.php b/inc/mod/auth.php
index 2e90b757..f9b863c8 100644
--- a/inc/mod/auth.php
+++ b/inc/mod/auth.php
@@ -122,3 +122,16 @@ if (isset($_COOKIE[$config['cookies']['mod']])) {
);
}
+function create_pm_header() {
+ global $mod;
+ $query = prepare("SELECT `id` FROM `pms` WHERE `to` = :id AND `unread` = 1");
+ $query->bindValue(':id', $mod['id'], PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+
+ if ($pm = $query->fetch()) {
+ return Array('id' => $pm['id'], 'waiting' => $query->rowCount() - 1);
+ }
+
+ return false;
+}
+