summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordirk <beliebige_email_adresse@fidocon.de>2011-10-25 13:40:03 +0200
committerdirk <beliebige_email_adresse@fidocon.de>2011-10-25 13:40:03 +0200
commitc01f05a3b9f56b9f757902650e865f347e8f0cae (patch)
tree270c38912cff82086d0bf2969851838c4c37777e
parent5006e53c624eb0723833704c0769cea4badfba25 (diff)
downloadcacert-devel-c01f05a3b9f56b9f757902650e865f347e8f0cae.tar.gz
cacert-devel-c01f05a3b9f56b9f757902650e865f347e8f0cae.tar.xz
cacert-devel-c01f05a3b9f56b9f757902650e865f347e8f0cae.zip
bug-827 added points/awarded logic for given assurances
-rw-r--r--includes/wot.inc.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/includes/wot.inc.php b/includes/wot.inc.php
index 497c569..275b3a0 100644
--- a/includes/wot.inc.php
+++ b/includes/wot.inc.php
@@ -106,14 +106,20 @@
function calc_experience ($row,&$points,&$experience,&$sum_experience)
{
- $points += $row['awarded'];
+ if ($row['awarded'] < $row['points'])
+ $apoints += $row['points'];
+ else
+ $apoints += $row['awarded'];
+
+ $points += $apoints;
+
$experience = "&nbsp;";
if ($row['method'] == "Face to Face Meeting")
{
$sum_experience = $sum_experience +2;
$experience = "2";
}
- return $row['awarded'];
+ return $apoints;
}
function calc_assurances ($row,&$points,&$experience,&$sumexperience,&$awarded)
@@ -308,9 +314,9 @@
while($row = mysql_fetch_assoc($res))
{
$fromuser = get_user (intval($row['to']));
- calc_experience ($row,$points,$experience,$sum_experience);
+ $apoints = calc_experience ($row,$points,$experience,$sum_experience);
$name = show_user_link ($fromuser['fname']." ".$fromuser['lname'],intval($row['to']));
- output_assurances_row (intval($row['id']),$row['date'],$row['when'],$name,intval($row['awarded']),intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience);
+ output_assurances_row (intval($row['id']),$row['date'],$row['when'],$name,$apoints,intval($row['points']),$row['location'],$row['method']==""?"":_(sprintf("%s", $row['method'])),$experience);
}
}