diff options
| author | Carson Fleming <cflems@cflems.net> | 2017-03-11 01:29:13 -0800 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2017-03-11 01:29:13 -0800 |
| commit | 3d0d3a86106ece4ea298ab2f262b3af5ff8a7728 (patch) | |
| tree | b75b297d980f5b061595cea8b29fe42503907684 /inc/user.php | |
| parent | a44a0e047a7582fe7e31743e1b03a17cf2987f73 (diff) | |
| download | bulletin-3d0d3a86106ece4ea298ab2f262b3af5ff8a7728.tar.gz | |
Almost there...
Diffstat (limited to 'inc/user.php')
| -rw-r--r-- | inc/user.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/user.php b/inc/user.php index 878a086..70bc646 100644 --- a/inc/user.php +++ b/inc/user.php @@ -9,7 +9,7 @@ if (empty($_COOKIE[$b_config['c_name']]) || !preg_match('/^(\d+);([0-9a-zA-Z\.]+ } else { $db = new bdb(); - $result = $db->query('SELECT users.*, SUM(ratings.stars) / COUNT(ratings.stars) AS rating FROM users LEFT JOIN ratings ON ratings.rated = users.id WHERE users.id = '.intval($matches[1]).' AND users.session = \''.bulletin_hash($matches[2]).'\' AND users.active = 1 LIMIT 1') or fatal($db->error); + $result = $db->query('SELECT users.*, SUM(ratings.stars) / COUNT(ratings.stars) AS rating, COUNT(notif.id) AS notif FROM users LEFT JOIN ratings ON ratings.rated = users.id LEFT JOIN notif ON notif.uid = users.id AND notif.seen = 0 WHERE users.id = '.intval($matches[1]).' AND users.session = \''.bulletin_hash($matches[2]).'\' AND users.active = 1 GROUP BY users.id LIMIT 1') or fatal($db->error); if ($result->num_rows < 1) $b_user = $guest_user; else $b_user = $result->fetch_assoc(); $result->free(); |
