* parse function reply properly
authorWilfried Göesgens <willi@citadel.org>
Tue, 12 Jun 2007 19:32:26 +0000 (19:32 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 12 Jun 2007 19:32:26 +0000 (19:32 +0000)
* use text/x-vcard
* print the vcard.

ctdlphp/ctdlelements.php
ctdlphp/ctdlprotocol.php
ctdlphp/myinfo.php

index e165b71eb2500bde159c69cb38590661e962c7ad..a0d422f4652d0bb7141f048007782d484af0704a 100644 (file)
@@ -72,6 +72,7 @@ function get_message_partlist($msgnum) {
        if (isset($fields['part']))
        {
                $parts = explode('|', $fields['part']);
+               print_r($parts);
                return $parts;
 
        }
index 93ff6f7d4f9c7381f005e3637901d18dbb3447f2..4b921f223580f36b81a5d05354cf3ca07ba76525 100644 (file)
@@ -708,7 +708,7 @@ function ctdl_msg4_from_server() {
 
 
 
-function downoad_attachment($msgnum, $attindex)
+function download_attachment($msgnum, $attindex)
 {
        $command = "DLAT ".$msgnum."|".$attindex;
        serv_puts($command);
index a473318f6b23e8ca45303c41df75a3868d3a01f0..41007e27ea04a111ca3f27b54d1612f3a93532df 100644 (file)
@@ -1,5 +1,5 @@
 <?PHP
-
+$vcard="";
        include "ctdlheader.php";
        bbs_page_header();
 
@@ -15,8 +15,7 @@
                "</TR>" ;
 
         ctdl_goto("My Citadel Config");
-       list($num_msgs, $response, $msgs) = ctdl_msgs($_REQUEST["mode"],
-                                                       $_REQUEST["count"] );
+       list($num_msgs, $response, $msgs) = ctdl_msgs("", "");
 
        echo "num_msgs: " . $num_msgs . "<BR>\n" ;
        echo "response: " . htmlspecialchars($response) . "<BR>\n" ;
                print_r($msgnum);
                $result = get_message_partlist($msgnum);
                if (is_array($result) &&
-                   ($result[4]=="text/vcard"))
+                   ($result[4]=="text/x-vcard"))
                {
-                       $vcard = downoad_attachment($msgnum, $result[2]);
-
-
+                       list($size, $vcard) = download_attachment($msgnum, $result[2]);
                }
        }
 
-///phpinfo();
-///    list($num_users, $wholist) =
-// ctdl_get_registration_info();
-/*
-       if ($num_users > 0) foreach ($wholist as $x) {
-               echo "<TR>";
-               echo "<TD>", htmlspecialchars($x["user"]), "</TD>";
-               echo "<TD>", htmlspecialchars($x["room"]), "</TD>";
-               echo "<TD>", htmlspecialchars($x["host"]), "</TD>";
-               echo "</TR>\n";
-       }
-*/
-       echo "</TABLE>\n";
+       echo "</TABLE>\n <pre>\n".$vcard."</pre>";
 
 ?>