added support to generate the members list in JSON format
this will be used by the w.g.o website so it can get the list of members trough HTTP
This commit is contained in:
parent
f67737017a
commit
b28307e163
1 changed files with 40 additions and 18 deletions
|
@ -1,22 +1,5 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>GNOME Foundation Membership List</title>
|
||||
<meta name="cvsdate" content="$Date$" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>GNOME Foundation Membership List</h1>
|
||||
|
||||
<p>
|
||||
Send comments, questions, and updates to <a
|
||||
href="mailto:membership-committee@gnome.org">membership-committee@gnome.org</a>.
|
||||
</p>
|
||||
|
||||
<?php
|
||||
|
||||
$error = null;
|
||||
|
||||
function get_members_from_sql () {
|
||||
|
@ -71,6 +54,45 @@ function get_members_from_sql () {
|
|||
|
||||
$members = get_members_from_sql ();
|
||||
|
||||
|
||||
if (isset ($_GET['format'])) {
|
||||
$format = $_GET['format'];
|
||||
} else {
|
||||
$format = 'html';
|
||||
}
|
||||
|
||||
|
||||
if ($format == 'json') {
|
||||
if ($members === FALSE) {
|
||||
echo json_encode (array ('error' => $error));
|
||||
} else {
|
||||
echo json_encode ($members);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>GNOME Foundation Membership List</title>
|
||||
<meta name="cvsdate" content="$Date$" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>GNOME Foundation Membership List</h1>
|
||||
|
||||
<p>
|
||||
Send comments, questions, and updates to <a
|
||||
href="mailto:membership-committee@gnome.org">membership-committee@gnome.org</a>.
|
||||
</p>
|
||||
|
||||
<?php
|
||||
|
||||
if ($members === FALSE) {
|
||||
echo "<p>Error: ".$error.".</p>\n";
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue