bug-1052: new points calc for includes/loggedin.php
authorFelix Dörre <felix@dogcraft.de>
Tue, 7 Apr 2015 19:13:25 +0000 (21:13 +0200)
committerBenny Baumann <BenBE@geshi.org>
Wed, 29 Apr 2015 18:35:40 +0000 (20:35 +0200)
includes/loggedin.php

index c14f8c2..8a1dab3 100644 (file)
 
        if($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] && $_SESSION['profile']['id'] > 0 && $_SESSION['profile']['loggedin'] > 0)
        {
-               $query = "select sum(`points`) as `total` from `notary` where `to`='".intval($_SESSION['profile']['id'])."' and `deleted` = 0 group by `to`";
-               $res = mysql_query($query);
-               $row = mysql_fetch_assoc($res);
-               $_SESSION['profile']['points'] = $row['total'];
+               update_points_in_profile();
 
-               if($_SESSION['profile']['language'] == "")
+               If($_SESSION['profile']['language'] == "")
                {
                        $query = "update `users` set `language`='".L10n::get_translation()."'
                                                        where `id`='".intval($_SESSION['profile']['id'])."'";