[foundation-web] added support to generate the members list in JSON format
- From: Vinicius Scopel Depizzol <vdepizzol src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [foundation-web] added support to generate the members list in JSON format
- Date: Sat, 28 Jan 2012 13:47:09 +0000 (UTC)
commit b28307e1632acf7ef41b1ef2e10b0a3d6178d5cf
Author: Vinicius Depizzol <vdepizzol gmail com>
Date: Sat Jan 28 11:46:53 2012 -0200
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
foundation.gnome.org/membership/members.wml | 58 ++++++++++++++++++--------
1 files changed, 40 insertions(+), 18 deletions(-)
---
diff --git a/foundation.gnome.org/membership/members.wml b/foundation.gnome.org/membership/members.wml
index 15a188c..5c92d25 100644
--- a/foundation.gnome.org/membership/members.wml
+++ b/foundation.gnome.org/membership/members.wml
@@ -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 {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]