diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-10-08 14:12:07 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-10-08 14:08:06 +0200 |
commit | 14b237ac53f13bc99d1f64f2e0cc21cd30b517b0 (patch) | |
tree | 0fe3ff8435bc22263c4bcc8d00373013a5055d46 /web/lib/acctfuncs.inc.php | |
parent | eb7efe33caff4d4493168d3db138d26884a85f77 (diff) | |
download | aurweb-14b237ac53f13bc99d1f64f2e0cc21cd30b517b0.tar.xz |
Refactor TU voters list
* Change voters_list() to return an array of voters instead of
generating HTML code in the library call.
* Change the template to generate HTML code for the list of voters
instead of displaying the library's return value.
* Use HTML lists.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/acctfuncs.inc.php')
-rw-r--r-- | web/lib/acctfuncs.inc.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index bce00f8..3fd23ae 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -969,14 +969,14 @@ function vote_details($voteid, $dbh=NULL) { * @param string $voteid The ID of the Trusted User proposal * @param \PDO $dbh An already established database connection * - * @return array All users (and HTML links) who voted for a specific proposal + * @return array All users who voted for a specific proposal */ function voter_list($voteid, $dbh=NULL) { if (!$dbh) { $dbh = db_connect(); } - $whovoted = ''; + $whovoted = array(); $q = "SELECT tv.UserID,U.Username "; $q.= "FROM TU_Votes tv, Users U "; @@ -987,7 +987,7 @@ function voter_list($voteid, $dbh=NULL) { $result = $dbh->query($q); if ($result) { while ($row = $result->fetch(PDO::FETCH_ASSOC)) { - $whovoted.= '<a href="' . get_user_uri($row['Username']) . '">'.$row['Username'].'</a> '; + $whovoted[] = $row['Username']; } } return $whovoted; |