summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/html/index.php72
-rw-r--r--web/lang/en/index_po.inc4
-rw-r--r--web/lang/pt/index_po.inc4
-rw-r--r--web/lang/pt/pkgfuncs_po.inc2
-rw-r--r--web/lib/pkgfuncs.inc6
5 files changed, 86 insertions, 2 deletions
diff --git a/web/html/index.php b/web/html/index.php
index 65fa564..462d3bb 100644
--- a/web/html/index.php
+++ b/web/html/index.php
@@ -218,6 +218,78 @@ $result = db_query($q, $dbh);
$row = mysql_fetch_row($result);
$safe_count = $row[0];
+# Added the user statistcs.
+# Added by: dsa <dsandrade@gmail.com>
+$user = username_from_sid($_COOKIE["AURSID"]);
+
+if (!empty($user)) {
+ $q = "SELECT count(*) FROM Packages,PackageLocations,Users WHERE Packages.MaintainerUID = Users.ID AND Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'unsupported' AND Users.Username='$user'";
+ $result = db_query($q, $dbh);
+ $row = mysql_fetch_row($result);
+ $maintainer_unsupported_count = $row[0];
+
+ $q = "SELECT count(*) FROM Packages,Users WHERE Packages.OutOfDate = 1 AND Packages.MaintainerUID = Users.ID AND Users.Username='$user'";
+ $result = db_query($q, $dbh);
+ $row = mysql_fetch_row($result);
+ $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 "<tr>";
+ print "<th colspan='2' class='boxSoftTitle' style='text-align: right'>";
+ print "<span class='f3'>".__("User Statistics")."</span>";
+ print "</th>";
+ print "</tr>";
+
+ # Number of packages in unsupported
+ print "<tr>";
+ print "<td class='boxSoft'>";
+ print "<span class='f4'>".__("Packages in unsupported")."</span>";
+ print "</td>";
+ print "<td class='boxSoft'><span class='f4'>$maintainer_unsupported_count</span></td>";
+ print "</tr>";
+
+ # If the user is a TU calculate the number of the packages
+ $atype = account_from_sid($_COOKIE["AURSID"]);
+
+ if ($atype == 'Trusted User') {
+ $q = "SELECT count(*) FROM Packages,PackageLocations,Users WHERE Packages.MaintainerUID = Users.ID AND Packages.LocationID = PackageLocations.ID AND PackageLocations.Location = 'community' AND Users.Username='$user'";
+ $result = db_query($q, $dbh);
+ $row = mysql_fetch_row($result);
+ $maintainer_community_count = $row[0];
+
+ print "<tr>";
+ print "<td class='boxSoft'>";
+ print "<span class='f4'>".__("Packages in [community]")."</span>";
+ print "</td>";
+ print "<td class='boxSoft'><span class='f4'>$maintainer_community_count</span></td>";
+ print "</tr>";
+ }
+
+ # Number of outdated packages
+ print "<tr>";
+ print "<td class='boxSoft'>";
+ print "<span class='f4'>".__("Out-of-date")."</span>";
+ print "</td>";
+ print "<td class='boxSoft'><span class='f4'>$flagged_outdated</span></td>";
+ print "</tr>";
+
+ # Number of safe packages
+ print "<tr>";
+ print "<td class='boxSoft'>";
+ print "<span class='f4'>".__("Safe")."</span>";
+ print "</td>";
+ print "<td class='boxSoft'><span class='f4'>$flagged_safe</span></td>";
+ print "</tr>";
+
+ print "</table><br />";
+}
+
print "<table class='boxSoft'>";
print "<tr>";
diff --git a/web/lang/en/index_po.inc b/web/lang/en/index_po.inc
index 0d26e56..d988bfa 100644
--- a/web/lang/en/index_po.inc
+++ b/web/lang/en/index_po.inc
@@ -67,6 +67,8 @@ $_t["en"]["Contributed PKGBUILDs <b>must</b> conform to the %hArch Packaging Sta
$_t["en"]["Statistics"] = "Statistics";
+$_t["en"]["User Statistics"] = "User Statistics";
+
$_t["en"]["Registered Users"] = "Registered Users";
$_t["en"]["Trusted Users"] = "Trusted Users";
@@ -85,4 +87,6 @@ $_t["en"]["The most popular packages will be provided as binary packages in [com
$_t["en"]["Packages added or updated in the past 7 days"] = "Packages added or updated in the past 7 days";
+$_t["en"]["Out-of-date"] = "Out-of-date";
+
?> \ No newline at end of file
diff --git a/web/lang/pt/index_po.inc b/web/lang/pt/index_po.inc
index 872d647..2a00106 100644
--- a/web/lang/pt/index_po.inc
+++ b/web/lang/pt/index_po.inc
@@ -67,6 +67,8 @@ $_t["pt"]["Contributed PKGBUILDs <b>must</b> conform to the %hArch Packaging Sta
$_t["pt"]["Statistics"] = "Estatísticas";
+$_t["pt"]["User Statistics"] = "Estatísticas do Usuário";
+
$_t["pt"]["Registered Users"] = "Usuários Registrados";
$_t["pt"]["Trusted Users"] = "Usuários Confiáveis";
@@ -85,4 +87,6 @@ $_t["pt"]["The most popular packages will be provided as binary packages in [com
$_t["pt"]["Packages added or updated in the past 7 days"] = "Pacotes adicionados ou atualizados nos últimos 7 dias";
+$_t["pt"]["Out-of-date"] = "Desatualizados";
+
?> \ No newline at end of file
diff --git a/web/lang/pt/pkgfuncs_po.inc b/web/lang/pt/pkgfuncs_po.inc
index 6e42399..4c08a0f 100644
--- a/web/lang/pt/pkgfuncs_po.inc
+++ b/web/lang/pt/pkgfuncs_po.inc
@@ -25,7 +25,7 @@ $_t["pt"]["Go"] = "Ir";
$_t["pt"]["Unflag Out-of-date"] = "Retirar marcador de Desatualizado";
-$_t["pt"]["Go back to %hpackage details view%h."] = "Retornar para a %visualização dos detalhes do pacote%h.";
+$_t["pt"]["Go back to %hpackage details view%h."] = "Retornar para a %hvisualização dos detalhes do pacote%h.";
$_t["pt"]["Error retrieving package details."] = "Erro ao retornar os detalhes do pacote.";
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index 0d86ee4..e57ceba 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -1075,7 +1075,11 @@ function pkg_search_page($SID="") {
# if (isset($tus[$row["MaintainerUID"]])) {
# print $tus[$row["MaintainerUID"]]["Username"];
if (isset($users[$row["MaintainerUID"]])) {
- print $users[$row["MaintainerUID"]]["Username"];
+ # Add a link to the user packages, e.g, if you click on the Solve the sorting problem, so we can force the
+ # maintainer name, you will be redirected to a page with the user packages.
+ # Added by: dsa <dsandrade@gmail.com>
+ $user = $users[$row["MaintainerUID"]]["Username"];
+ print "<a href='packages.php?K=".$user."&SeB=m'>".$users[$row["MaintainerUID"]]["Username"]."</a>";
} else {
print "<span style='color: blue; font-style: italic;'>";
print __("orphan");