forked from leftypol/leftypol
Beta PM system
This commit is contained in:
parent
83194c4218
commit
9c9ead2b08
5 changed files with 151 additions and 13 deletions
16
inc/mod.php
16
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)");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue