From 70af7c7d5c5945039f494ca5f9e435bc515db18e Mon Sep 17 00:00:00 2001 From: simo Date: Sun, 27 Nov 2005 04:05:27 +0000 Subject: add search by submitter functionality --- web/lib/aur.inc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'web/lib/aur.inc') diff --git a/web/lib/aur.inc b/web/lib/aur.inc index ed2ff646..81e5a458 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -542,5 +542,24 @@ function rm_rf($dirname="") { return; } +# obtain the uid given a Users.Username +# +function uid_from_username($username="") +{ + if (!$username) { + return ""; + } + $dbh = db_connect(); + $q = "SELECT ID FROM Users WHERE Username = '".mysql_escape_string($username) + ."'"; + $result = db_query($q, $dbh); + if (!$result) { + return "None"; + } + $row = mysql_fetch_row($result); + + return $row[0]; +} + # vim: ts=2 sw=2 noet ft=php ?> -- cgit v1.2.3-24-g4f1b