My Statistics instead of User Statistics. For TUs show number of packages they flagged safe, not number of their packages that were flagged safe.

This commit is contained in:
swiergot 2007-02-22 15:11:54 +00:00
parent 500f44abd9
commit e793e25823

View file

@ -233,16 +233,11 @@ if (!empty($user)) {
$row = mysql_fetch_row($result); $row = mysql_fetch_row($result);
$flagged_outdated = $row[0]; $flagged_outdated = $row[0];
$q = "SELECT count(*) FROM Packages,Users WHERE Packages.Safe = 1 AND Packages.MaintainerUID = Users.ID AND Users.Username='$user'";
$result = db_query($q, $dbh);
$row = mysql_fetch_row($result);
$flagged_safe = $row[0];
print "<table class='boxSoft'>"; print "<table class='boxSoft'>";
print "<tr>"; print "<tr>";
print "<th colspan='2' class='boxSoftTitle' style='text-align: right'>"; print "<th colspan='2' class='boxSoftTitle' style='text-align: right'>";
print "<span class='f3'>".__("User Statistics")."</span>"; print "<span class='f3'>".__("My Statistics")."</span>";
print "</th>"; print "</th>";
print "</tr>"; print "</tr>";
@ -282,7 +277,23 @@ if (!empty($user)) {
# Number of safe packages # Number of safe packages
print "<tr>"; print "<tr>";
print "<td class='boxSoft'>"; print "<td class='boxSoft'>";
print "<span class='f4'>".__("Safe")."</span>"; if ($atype == 'Trusted User') {
$q = "SELECT count(*) FROM Packages,Users WHERE Packages.Safe = 1 AND Packages.VerifiedBy = Users.ID AND Users.Username='$user'";
$result = db_query($q, $dbh);
$row = mysql_fetch_row($result);
$flagged_safe = $row[0];
print "<span class='f4'>".__("Flagged as safe by me")."</span>";
}
else
{
$q = "SELECT count(*) FROM Packages,Users WHERE Packages.Safe = 1 AND Packages.MaintainerUID = Users.ID AND Users.Username='$user'";
$result = db_query($q, $dbh);
$row = mysql_fetch_row($result);
$flagged_safe = $row[0];
print "<span class='f4'>".__("Flagged as safe")."</span>";
}
print "</td>"; print "</td>";
print "<td class='boxSoft'><span class='f4'>$flagged_safe</span></td>"; print "<td class='boxSoft'><span class='f4'>$flagged_safe</span></td>";
print "</tr>"; print "</tr>";