Commit: b26ad823e768a9f0aa14623bdd29e43e5b6a8286 Author: Kalle Sommer Nielsen <[email protected]> Sat, 19 Nov 2016 12:16:09 +0100 Parents: 9fc2f8ce480d24c817fb6de2386e077e19386d7a Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=b26ad823e768a9f0aa14623bdd29e43e5b6a8286 Log: Make /admin/?action=list_lists (index) a little nicer with some mailto: links Changed paths: M include/functions.php M www/admin/index.php Diff: diff --git a/include/functions.php b/include/functions.php index 64f26a7..4c0ef54 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1936,3 +1936,18 @@ function inline_content_menu($base_url, $current_action, array $menu) echo rtrim($buffer, ' | '); echo "</p>\n"; } + +function mailto_list(array $mails) +{ + if(!$mails) { + return; + } + + $buffer = ''; + + foreach ($mails as $mail) { + $buffer .= sprintf('<a href="mailto:%1$s">%1$s</a>, ', $mail); + } + + echo rtrim($buffer, ', '); +} diff --git a/www/admin/index.php b/www/admin/index.php index 6e3d74c..543d36a 100644 --- a/www/admin/index.php +++ b/www/admin/index.php @@ -38,7 +38,7 @@ if ($action === 'list_lists') { echo "<dl>\n"; while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) { - echo "<dt>", $row['name'], ": </dt>\n<dd>", $row['list_email'], "</dd>\n"; + echo "<dt>", $row['name'], ": </dt>\n<dd>", mailto_list(explode(',', $row['list_email'])), "</dd>\n"; } echo "</dl>\n"; } -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
