This commit is contained in:
Michael Save 2012-04-13 22:00:40 +10:00
parent 761cb4feab
commit e49ece459e
5 changed files with 121 additions and 3 deletions

View file

@ -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;
}