Added support for the terrestrial and mobile phone number
authorJoey Schulze <joey@infodrom.org>
Sat, 17 Jul 2004 17:38:14 +0000 (17:38 +0000)
committerJoey Schulze <joey@infodrom.org>
Sat, 17 Jul 2004 17:38:14 +0000 (17:38 +0000)
src/LinuxTag/2005/supporter/supporter.wml

index 9a0c1bc..85b5f65 100644 (file)
@@ -21,7 +21,7 @@
   pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
 
   if (isset ($oid)) {
-    $query = sprintf ("SELECT name,email,comment FROM person WHERE oid = %d", $oid);
+    $query = sprintf ("SELECT name,email,comment,mobile,phone FROM person WHERE oid = %d", $oid);
     $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
 
     if (pg_NumRows ($sth) > 0) {
       $name = $row['name'];
       $email = $row['email'];
       $comment = $row['comment'];
+      if (strlen ($row['mobile']) && ereg ("(\+[0-9]+ [0-9]+ [0-9]+)", $row['mobile'], $phone)) {
+        $phone = " (" . $phone[1] .")";
+      } elseif (strlen ($row['phone']) && ereg ("(\+[0-9]+ [0-9]+ [0-9]+)", $row['phone'], $phone)) {
+        $phone = " (" . $phone[1] .")";
+      }
     }
   }
 
     }
 
     if (strlen ($email) > 0) {
-      printf ("<h3>%s &lt;%s&gt;</h3>", $name, $email);
+      printf ("<h3>%s &lt;%s&gt;%s</h3>", $name, $email, $phone);
     } else {
-      printf ("<h3>%s</h3>", $name);
-    }
-    if (strlen ($comment) > 0) {
-      printf ("<p>Comment: %s</p>", $comment);
+      printf ("<h3>%s%s</h3>", $name, $phone);
     }
 
     $columns = '';