]> code.citadel.org Git - citadel.git/blobdiff - ctdlphp/myinfo.php
* stat the socket before we try to open it, looks better like that in the log.
[citadel.git] / ctdlphp / myinfo.php
index a473318f6b23e8ca45303c41df75a3868d3a01f0..a58c150a0cdaadc36dc81ea0919cd1b972ad77c1 100644 (file)
@@ -1,52 +1,62 @@
 <?PHP
+$vcard="";
+include "ctdlheader.php";
+bbs_page_header();
 
-       include "ctdlheader.php";
-       bbs_page_header();
+echo   "This is an example of the use of " .
+"ctdl_get_registration_info() to display " .
+"your personal data.<BR><BR>\n" ;
 
-       echo    "This is an example of the use of " .
-               "ctdl_get_registration_info() to display " .
-               "your personal data.<BR><BR>\n" ;
+echo   "<TABLE border=1>" .
+"<TR>" .
+"<TD><B>User</B></TD>" .
+"<TD><B>Room</B></TD>" .
+"<TD><B>Host</B></TD>" .
+"</TR>" ;
 
-       echo    "<TABLE border=1>" .
-               "<TR>" .
-               "<TD><B>User</B></TD>" .
-               "<TD><B>Room</B></TD>" .
-               "<TD><B>Host</B></TD>" .
-               "</TR>" ;
+ctdl_goto("My Citadel Config");
+list($num_msgs, $response, $msgs) = ctdl_msgs("", "");
 
-        ctdl_goto("My Citadel Config");
-       list($num_msgs, $response, $msgs) = ctdl_msgs($_REQUEST["mode"],
-                                                       $_REQUEST["count"] );
+echo "num_msgs: " . $num_msgs . "<BR>\n" ;
+echo "response: " . htmlspecialchars($response) . "<BR>\n" ;
 
-       echo "num_msgs: " . $num_msgs . "<BR>\n" ;
-       echo "response: " . htmlspecialchars($response) . "<BR>\n" ;
-
-        if ($num_msgs > 0) foreach ($msgs as $msgnum) {
-               print_r($msgnum);
-               $result = get_message_partlist($msgnum);
-               if (is_array($result) &&
-                   ($result[4]=="text/vcard"))
-               {
-                       $vcard = downoad_attachment($msgnum, $result[2]);
-
-
-               }
+if ($num_msgs > 0) foreach ($msgs as $msgnum) {
+       print_r($msgnum);
+       $result = get_message_partlist($msgnum);
+       if (is_array($result) &&
+           ($result[4]=="text/x-vcard"))
+       {
+               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>";
+
+echo "putting it back in!";
 
+$vcard = 
+"begin:vcard
+n:Surename;CName;mitte;Mrs;IV
+title:master
+fn:CName Surename
+org:citadel.org
+adr:blarg;Road To nowhere ;10;Metropolis;NRW;12345;Country
+tel;home:888888888
+tel;work:99999999999
+email;internet:user@samplecitadel.org
+email;internet:me@samplecitadel.org
+email;internet:myself@samplecitadel.org
+email;internet:i@samplecitadel.org
+FBURL;PREF:http://samplecitadel.org/Cname_Lastname.vfb
+UID:Citadel vCard: personal card for Cname Lastname at samplecitadel.org
+end:vcard
+";
+preg_replace('/Sir/', 'Mrs',$vcard);
+echo "Now its: <pre>\n".$vcard."</pre>";
+$entearray=array();
+$entarray['post']=1;
+$entarray['format_type']=FMT_RFC822;
+enter_message_0($entarray, "text/x-vcard; charset=UTF-8", $vcard);
 ?>
 
 <BR>Sample links<BR>