From 993fcb7811d763368a6940730d3870b0013623c0 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 1 Jul 2004 22:20:09 +0000 Subject: still working on pkgsearch.php::do_Details --- web/lib/aur.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'web/lib/aur.inc') diff --git a/web/lib/aur.inc b/web/lib/aur.inc index f97a1312..bdec6435 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -140,6 +140,24 @@ function new_sid() { } +# obtain the username if given their Users.ID +# +function username_from_id($id="") { + if (!$id) { + return ""; + } + $dbh = db_connect(); + $q = "SELECT Username FROM Users WHERE ID = " . mysql_escape_string($id); + $result = db_query($q, $dbh); + if (!$result) { + return "None"; + } + $row = mysql_fetch_row($result); + + return $row[0]; +} + + # obtain the username if given their current SID # function username_from_sid($sid="") { -- cgit v1.2.3-24-g4f1b