summaryrefslogtreecommitdiff
path: root/inc/mod.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-03-17 16:52:43 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-03-17 16:52:43 +1100
commit9c9ead2b082c82a28febfdd409551bc647c50ab3 (patch)
treec81fdb217b7a6d8b10756d1aeacfb44c93ce1349 /inc/mod.php
parent83194c42183cbbcd86c9347cb536148ad09ac966 (diff)
Beta PM system
Diffstat (limited to 'inc/mod.php')
-rw-r--r--inc/mod.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/inc/mod.php b/inc/mod.php
index 51ff7785..bc54a23a 100644
--- a/inc/mod.php
+++ b/inc/mod.php
@@ -56,6 +56,22 @@
unset($_SESSION['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 'You have <a href="?/PM/' . $pm['id'] . '">an unread PM</a>' .
+ ($query->rowCount() > 1 ?
+ ', plus ' . ($query->rowCount()-1) . ' more waiting'
+ : '') . '.';
+ }
+
+ return false;
+ }
+
function modLog($action) {
global $mod;
$query = prepare("INSERT INTO `modlogs` VALUES (:id, :ip, :time, :text)");