summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-14 11:26:48 +0200
committerErich Eckner <git@eckner.net>2018-04-14 11:26:48 +0200
commit58218c6f5dffff90c5f3103b8daa9e322643af6d (patch)
treea3ee25ee393cc24e31c11ca5fc9e27f7ae283795 /packages
parentfe6d0fe699202978b00191ab6803b67badc7ddae (diff)
downloadarchweb32-58218c6f5dffff90c5f3103b8daa9e322643af6d.tar.xz
packages/pkginfo.php: include "elsewhere information"
Diffstat (limited to 'packages')
-rw-r--r--packages/pkginfo.php42
1 files changed, 41 insertions, 1 deletions
diff --git a/packages/pkginfo.php b/packages/pkginfo.php
index e71951f..fac10df 100644
--- a/packages/pkginfo.php
+++ b/packages/pkginfo.php
@@ -169,6 +169,31 @@
$content = array_merge($mysql_content,$json_content);
+ if (! $mysql_result = $mysql -> query(
+ "SELECT " .
+ "`binary_packages`.`pkgname` AS `pkgname`," .
+ "`repositories`.`name` AS `repo`," .
+ "`architectures`.`name` AS `arch`," .
+ "CONCAT(" .
+ "IF(`binary_packages`.`epoch`=\"0\",\"\",CONCAT(`binary_packages`.`epoch`,\":\"))," .
+ "`binary_packages`.`pkgver`,\"-\"," .
+ "`binary_packages`.`pkgrel`,\".\"," .
+ "`binary_packages`.`sub_pkgrel`" .
+ ") AS `version`" .
+ " FROM `binary_packages` " .
+ " JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id`" .
+ " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" .
+ " JOIN `binary_packages` AS `original`" .
+ " ON `binary_packages`.`pkgname`=`original`.`pkgname`" .
+ " AND `binary_packages`.`id`!=`original`.`id`" .
+ " WHERE `original`.`id`=" . $mysql_content["id"]
+ ))
+ die_500("Query failed: " . $mysql->error);
+
+ $elsewhere = array();
+ while ($row = $mysql_result -> fetch_assoc())
+ $elsewhere[] = $row;
+
?>
<!DOCTYPE html>
@@ -236,7 +261,22 @@
</div>
-
+<?php
+
+if (count($elsewhere)>0) {
+ print "<div id=\"elsewhere\" class=\"widget\">\n";
+ print "<h4>Versions Elsewhere</h4>\n";
+ foreach ($elsewhere as $subst) {
+ print "<ul>\n";
+ print "<li><a href=\"/" . $subst["repo"] . "/" . $subst["arch"] . "/" . $subst["pkgname"] ."/\"";
+ print " title=\"Package details for " . $subst["pkgname"] ."\">";
+ print $subst["pkgname"] . "-" . $subst["version"] . " [" . $subst["repo"] . "] (" . $subst["arch"] . ")</a></li>\n";
+ print "</ul>\n";
+ }
+ print "</div>\n";
+}
+
+?>
</div>
<div itemscope itemtype="http://schema.org/SoftwareApplication">