[aur-dev] [PATCH] Show popularity in package base details

Lukas Fleischer lfleischer at archlinux.org
Tue Jul 21 13:02:55 UTC 2015


Fixes FS#45600.

Signed-off-by: Lukas Fleischer <lfleischer at archlinux.org>
---
 web/lib/pkgbasefuncs.inc.php     | 2 +-
 web/lib/pkgfuncs.inc.php         | 4 ++--
 web/template/pkg_details.php     | 5 +++++
 web/template/pkgbase_details.php | 5 +++++
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 6057d10..2d1969b 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -140,7 +140,7 @@ function pkgbase_get_details($base_id) {
 	$dbh = DB::connect();
 
 	$q = "SELECT PackageBases.ID, PackageBases.Name, ";
-	$q.= "PackageBases.NumVotes, ";
+	$q.= "PackageBases.NumVotes, PackageBases.Popularity, ";
 	$q.= "PackageBases.OutOfDateTS, PackageBases.SubmittedTS, ";
 	$q.= "PackageBases.ModifiedTS, PackageBases.SubmitterUID, ";
 	$q.= "PackageBases.MaintainerUID, PackageBases.PackagerUID, ";
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index de57c3e..bcadf54 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -431,8 +431,8 @@ function pkg_get_details($id=0) {
 	$dbh = DB::connect();
 
 	$q = "SELECT Packages.*, PackageBases.ID AS BaseID, ";
-	$q.= "PackageBases.Name AS BaseName, ";
-	$q.= "PackageBases.NumVotes, PackageBases.OutOfDateTS, ";
+	$q.= "PackageBases.Name AS BaseName, PackageBases.NumVotes, ";
+	$q.= "PackageBases.Popularity, PackageBases.OutOfDateTS, ";
 	$q.= "PackageBases.SubmittedTS, PackageBases.ModifiedTS, ";
 	$q.= "PackageBases.SubmitterUID, PackageBases.MaintainerUID, ";
 	$q.= "PackageBases.PackagerUID, ";
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index ae8d084..9730d7e 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -25,6 +25,7 @@ if ($row["MaintainerUID"] !== NULL) {
 }
 
 $votes = $row['NumVotes'];
+$popularity = $row['Popularity'];
 
 # In case of wanting to put a custom message
 $msg = __('unknown');
@@ -254,6 +255,10 @@ endif;
 			<?php endif; ?>
 		</tr>
 		<tr>
+			<th><?= __('Popularity') . ': ' ?></th>
+			<td><?= number_format($popularity, 6) ?></td>
+		</tr>
+		<tr>
 			<th><?= __('First Submitted') . ': ' ?></th>
 			<td><?= $submitted_time ?></td>
 		</tr>
diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php
index 667b3f7..d4304e3 100644
--- a/web/template/pkgbase_details.php
+++ b/web/template/pkgbase_details.php
@@ -24,6 +24,7 @@ if ($row["MaintainerUID"] !== NULL) {
 }
 
 $votes = $row['NumVotes'];
+$popularity = $row['Popularity'];
 
 # In case of wanting to put a custom message
 $msg = __('unknown');
@@ -105,6 +106,10 @@ endif;
 			<?php endif; ?>
 		</tr>
 		<tr>
+			<th><?= __('Popularity') . ': ' ?></th>
+			<td><?= number_format($popularity, 6) ?></td>
+		</tr>
+		<tr>
 			<th><?= __('First Submitted') . ': ' ?></th>
 			<td><?= $submitted_time ?></td>
 		</tr>
-- 
2.4.6


More information about the aur-dev mailing list