summaryrefslogtreecommitdiff
path: root/inc/user.php
diff options
context:
space:
mode:
authorCarson Fleming <cflems@cflems.net>2017-02-16 23:59:34 -0500
committerCarson Fleming <cflems@cflems.net>2017-02-16 23:59:34 -0500
commit4f12fecebcd3f2a5bc6a0e7cdf9c420af4ed435a (patch)
treeedd91e33b95d48022bca9ce8c0626a7a7879af93 /inc/user.php
parent5564b3a9cb432f1f7eb76bd325251312904bb893 (diff)
downloadbulletin-4f12fecebcd3f2a5bc6a0e7cdf9c420af4ed435a.tar.gz
Did the profile
Diffstat (limited to 'inc/user.php')
-rw-r--r--inc/user.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/user.php b/inc/user.php
index 789586f..cf0dde8 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 * FROM users WHERE id = '.intval($matches[1]).' AND session = \''.hash('sha512', $matches[2]).'\' AND active = 1 LIMIT 1') or fatal($db->error);
+ $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 = \''.hash('sha512', $matches[2]).'\' AND users.active = 1 LIMIT 1') or fatal($db->error);
if ($result->num_rows < 1) $b_user = $guest_user;
else $b_user = $result->fetch_assoc();
$result->free();