bug-1053: new points calculation in includes/account.php bug-1053
authorFelix Dörre <felix@dogcraft.de>
Tue, 7 Apr 2015 19:17:19 +0000 (21:17 +0200)
committerBenny Baumann <BenBE@geshi.org>
Wed, 29 Apr 2015 18:36:37 +0000 (20:36 +0200)
includes/account.php

index 6dacf2d..843dbe6 100644 (file)
@@ -1275,10 +1275,7 @@ function buildSubjectFromSession() {
 
        if($oldid == 13 && $process != "")
        {
-               $ddquery = "select sum(`points`) as `total` from `notary` where `to`='".intval($_SESSION['profile']['id'])."' and `deleted` = 0 group by `to`";
-               $ddres = mysql_query($ddquery);
-               $ddrow = mysql_fetch_assoc($ddres);
-               $_SESSION['profile']['points'] = $ddrow['total'];
+               update_points_in_profile();
 
                if($_SESSION['profile']['points'] == 0)
                {
@@ -1337,10 +1334,7 @@ function buildSubjectFromSession() {
                $_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($_SESSION['profile']['id'])."'"));
                $_SESSION['profile']['loggedin'] = 1;
 
-               $ddquery = "select sum(`points`) as `total` from `notary` where `to`='".intval($_SESSION['profile']['id'])."' and `deleted` = 0 group by `to`";
-               $ddres = mysql_query($ddquery);
-               $ddrow = mysql_fetch_assoc($ddres);
-               $_SESSION['profile']['points'] = $ddrow['total'];
+               update_points_in_profile();
 
 
                $id = 13;