[gst-cvs] CVS: www/dev admin.php,NONE,1.1 whoswho.sql,NONE,1.1 whoswho.php,1.1.1.1,1.2

Andy Wingo wingo at users.sourceforge.net
Sun Nov 11 17:42:02 PST 2001


Update of /cvsroot/gstreamer/www/dev
In directory usw-pr-cvs1:/tmp/cvs-serv18614

Modified Files:
	whoswho.php 
Added Files:
	admin.php whoswho.sql 
Log Message:
databasified the whoswho listing

--- NEW FILE: admin.php ---
<?php
  include ('../lib/template.php');
  include ('../lib/db_setup.php');
  
  $top = get_header('GStreamer: Who\'s Who: Admin', '..');

  if(!isset($PHP_AUTH_USER)) {
      Header("WWW-Authenticate: Basic realm=\"gstreamer-admin\"");
      Header("HTTP/1.0 401 Unauthorized");
      echo $top;
      echo <<<EOF
<p>You must be an authorized user to access the GStreamer administration pages. Sorry.</p>
EOF;
      echo get_footer();
      exit;
  } else if (strcmp($PHP_AUTH_USER, $admin_user)!=0 ||
             strcmp($PHP_AUTH_PW,   $admin_pass)!=0) {
      Header("WWW-Authenticate: Basic realm=\"gstreamer-admin\"");
      Header("HTTP/1.0 401 Unauthorized");
      echo $top;
      echo <<<EOF
<p>You must be an authorized user to access the GStreamer administration pages. Sorry.</p>
EOF;
      echo get_footer();
      exit;
  }
  
  echo $top;
  
  $link = mysql_pconnect ($mysql_host, $mysql_user, $mysql_pass);
  mysql_select_db ($mysql_database);
  
  echo "<h1>GStreamer who's who administration page</h1>\n";
  
  if ($op) {
    switch($op) {
      case "edit":
        if (!isset($id)) {
          echo "<p> you must choose an item to act on first. </p>\n";
          break;
        }
        echo "<form action=\"./admin.php\" method=\"post\">\n";
        echo "<input type=\"hidden\" name=\"op\" value=\"edit2\">\n";
        echo "<input type=\"hidden\" name=\"id\" value=\"$id\">\n";
        echo "<table border=\"1\" width=\"100%\">\n";
        echo " <tr><th>nick</th><th>name</th><th>link name</th><th>link href</th><th>location</th></tr>\n";
        $query = mysql_query("select * from whoswho where id=$id");
        $row= mysql_fetch_array($query);
        echo "<tr>";
        echo "<td><input type=\"text\" name=\"nick\" value=\"", htmlspecialchars($row['nick']), "\" size=\"25\"></td>";
        echo "<td><input type=\"text\" name=\"name\" value=\"", htmlspecialchars($row['name']), "\" size=\"25\"></td>";
        echo "<td><input type=\"text\" name=\"linkname\" value=\"", htmlspecialchars($row['linkname']), "\" size=\"25\"></td>";
        echo "<td><input type=\"text\" name=\"href\" value=\"", htmlspecialchars($row['href']), "\" size=\"25\"></td>";
        echo "<td><input type=\"text\" name=\"location\" value=\"", htmlspecialchars($row['location']), "\" size=\"25\"></td>";
        echo "</tr>\n";
        echo "</table>\n";
        echo "<input type=\"submit\" value=\"edit whoswho entry item\">\n";
        print "</form>\n";
        break;
      case "edit2":
        $query = mysql_query("update whoswho set nick='$nick', name='$name', linkname='$linkname', href='$href', location='$location' where id=$id");
        echo "<p>Who's who item edited.</p>";
        break;
      case "add":
        echo "<form action=\"./admin.php\" method=\"get\">\n";
        echo "<input type=\"hidden\" name=\"op\" value=\"add2\">\n";
        echo "<table border=\"1\" width=\"100%\">\n";
        echo " <tr><th>nick</th><th>name</th><th>link name</th><th>link href</th><th>location</th></tr>\n";
        echo "<tr>";
        echo "<td><input type=\"text\" name=\"nick\" value=\"\" size=\"25\"></td>";
        echo "<td><input type=\"text\" name=\"name\" value=\"\" size=\"25\"></td>";
        echo "<td><input type=\"text\" name=\"linkname\" value=\"\" size=\"25\"></td>";
        echo "<td><input type=\"text\" name=\"href\" value=\"\" size=\"25\"></td>";
        echo "<td><input type=\"text\" name=\"location\" value=\"\" size=\"25\"></td>";
        echo "</tr>\n";
        echo "</table>\n";
        echo "<input type=\"submit\" value=\"add whoswho entry item\">\n";
        print "</form>\n";
        echo "<form action=\"./admin.php\" method=\"post\">\n";
        break;
      case "add2":
        $query = mysql_query("insert into whoswho (nick, name, linkname, href, location) values ('$nick', '$name', '$linkname', '$href', '$location')");
        echo "<p>Who's who item added.</p>";
        break;
      case "remove":
        if (!isset($id)) {
          echo "<p> you must choose an item to act on first. </p>\n";
          break;
        }
        echo "<form action=\"./admin.php\" method=\"post\">\n";
        echo "<p>Are you sure you want to do this?</p>\n";
        echo "<input type=\"hidden\" name=\"op\" value=\"remove2\">\n";
        echo "<input type=\"hidden\" name=\"id\" value=\"$id\">\n";
        echo "<table border=\"1\" width=\"100%\">\n";
        echo " <tr><th>nick</th><th>name</th><th>link</th><th>location</th></tr>\n";
        $query = mysql_query("select * from whoswho where id=$id");
        $row = mysql_fetch_array($query);
        echo "<tr><td>", $row['nick'], "</td><td>", $row['name'], "</td><td>", $row['linkname'], ": <a href=\"", 
          $row['href'], "\">", $row['href'], "</a></td><td>", $row['location'], "</td></tr>\n";
        echo "</table>\n";
        echo "<input type=\"submit\" value=\"really remove this whos who item\">\n";
        print "</form>\n";
        break;
      case "remove2":
	$query = mysql_query("delete from whoswho where id=$id");
        echo "<p>Item deleted.</p>\n";
        break;
    }
    echo "<a href=\"./admin.php\">back to main who's who admin page</a>\n";
    echo get_footer();
    exit;
  }
?>

<?php
  print "<form action=\"./admin.php\" method=\"post\"><table>\n";
  echo "<table border=\"1\" width=\"100%\">\n";
  echo " <tr><th>&nbsp;</th><th>nick</th><th>name</th><th>link</th><th>location</th></tr>\n";
  $query = mysql_query("select * from whoswho order by nick");
  while ($row = mysql_fetch_array($query)) {
    echo "<tr><td><input type=\"radio\" name=\"id\" value=\"", $row['id'], "\"></td><td>", $row['nick'], 
        "</td><td>", $row['name'], "</td><td>", $row['linkname'], ": <a href=\"",
        $row['href'], "\">", $row['href'], "</a></td><td>", $row['location'], "</td></tr>\n";
  }
  echo "</table>\n";
  print "<input type=\"submit\" name=\"op\" value=\"edit\">\n";
  print "<input type=\"submit\" name=\"op\" value=\"add\">\n";
  print "<input type=\"submit\" name=\"op\" value=\"remove\">\n";
  print "</form>\n";
?>


<?php echo get_footer(); ?>
 

--- NEW FILE: whoswho.sql ---
CREATE TABLE whoswho (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
  nick varchar(255),
  name varchar(255),
  linkname varchar(255),
  href varchar(255),
  location varchar(255),
  PRIMARY KEY (id)
);

Index: whoswho.php
===================================================================
RCS file: /cvsroot/gstreamer/www/dev/whoswho.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- whoswho.php	2001/10/13 19:32:58	1.1.1.1
+++ whoswho.php	2001/11/12 01:41:48	1.2
@@ -1,44 +1,29 @@
 <?php
- include ('../lib/template.php');
- echo get_header('GStreamer: Who\'s Who', '..');
-?>
+  include ('../lib/template.php');
+  echo get_header ('GStreamer: Who\'s Who', '..');
 
-<H1>Who's who on irc.openprojects.net #gstreamer (in Alphabetical order)</H1>
-<p>This list is not complete, but it should help you find out who is hidding behind
-the nicks on IRC so you can take contact about emails, plugins, CVS commits or whatever.
+  include ('../lib/db_setup.php');
+  $link = mysql_pconnect ($mysql_host, $mysql_user, $mysql_pass);
+  mysql_select_db ($mysql_database);
+  
+  echo <<<EOF
+<h1>who's who in gstreamer-land</h1>
+<p>
+We here at GStreamer are proud of our community. We do most of our
+business on IRC (<code>irc.openprojects.net</code>, in the <code>#gstreamer</code>
+channel), and it's good to put together a list of who we are. If you hang
+out in <code>#gstreamer</code> and aren't on here, or if you are on and want
+to change your info, drop me (wingo) a line.
 </p>
-
-
-<TABLE>
-<TR><td>ajmitch</td><td>Andrew Mitchell</td></tr>
-<tr><td>Apoc</td><td>Jérémy SIMON</td></tr>
-<tr><td>asmod</td><td>Steve Crouse (<A HREF="http://www.oeone.com/">oeOne</A>)</td></tr>
-<tr><td>BBB</td><td>Ronald Bultje</td></tr>
-<tr><td>BeNOW</td><td>Andrew Taylor (<A HREF="http://www.benow.ca">BeNOW</A>)</td></tr>
-<tr><td>Arik</td><td>Arik Devens (GNOME)</td></tr>
-<tr><td>Cactus</td><td>Erdi Gergo (GNOME)</td></tr>
-<tr><td>ChiefHighWater</td><td>Paul Flood</td></tr>
-<tr><td>Chillywilly</td><td>Daniel Baumann</td></tr>
-<tr><td>Company</td><td>Benjamin Otte</td><tr>
-<tr><td>dobey</td><td>Rodney Dawes (<A HREF="http://www.ximian.com">Ximian</A>)</td></tr>
-<tr><td>hadess</td><td>Bastien Nocera (GNOME)</td></tr>
-<tr><td>Jacmet</td><td>Peter Korsgaard</td></tr>
-<TR><td>Omega</td><td>Erik Walthinsen (<A HREF="http://www.ridgerun.com/">RidgeRun</A>)</td></TR>
-<tr><td>parapraxis</td><td>Jamie Gennis</td></tr>
-<tr><td>richardb</td><td>Richard Boulton</td></tr>
-<tr><td>Shitowax</td><td>Yann (<A HREF="http://www.3ivx.com/">3ivx</A>)</td></tr>
-<tr><td>ShrimpX</td><td>Marius Nita</td></tr>
-<tr><td>Sopwith</td><td>Elliot Lee (GNOME)</td></tr>
-<tr><td>steveb</td><td>Steve Baker</td></tr>
-<tr><td>Sienap</td><td>Dennis Smit (GNOME)</td></tr>
-<TR><td>wtay</td><td>Wim Taymans</td></tr><TR>
-<tr><td>taaz</td><td>David I. Lehn</td></tr>
-<tr><td>thomasvs</td><td>Thomas Vander Stichele</td></tr>
-<tr><td>uraeus</td><td>Christian Schaller (GNOME)</td></tr>
-<tr><td>vektor</td><td>Billy Biggs</td></tr>
-<tr><td>Vishnu</td><td>Joshua N. Pritkin</td></tr>
-<tr><td>Wingo</td><td>Andy Wingo</td></tr>
-<tr><td>Zeenix</td><td>Zeeshan Ali</td></tr>
-</TABLE>
+EOF;
 
-<?php echo get_footer(); ?>
+  echo "<table border=\"1\" width=\"100%\">\n";
+  echo " <tr><th>nick</th><th>name</th><th>link</th><th>location</th></tr>\n";
+  $query = mysql_query("select * from whoswho order by nick");
+  while ($row = mysql_fetch_array($query)) {
+    echo "<tr><td>", $row['nick'], "</td><td>", $row['name'], "</td><td>", $row['linkname'], ": <a href=\"", 
+        $row['href'], "\">", $row['href'], "</a></td><td>", $row['location'], "</td></tr>\n";
+  }
+  echo "</table>\n";
+  echo get_footer(); 
+?>





More information about the Gstreamer-commits mailing list