include "config_ctdlclient.php";
+define("FMT_CITADEL", 0);
+define("FMT_FIXED", 1);
+define("FMT_RFC822", 4);
+
//--------------------------------------------------------------------------------
// internal functions for server communication
//--------------------------------------------------------------------------------
}
+function enter_message_0($msgHdr, $contentType, $data)
+{
+ $send = array();
+
+ if (isset($msgHdr['newusermail']))
+ array_unshift($send, $msgHdr['newusermail']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['supplied_euid']))
+ array_unshift($send, $msgHdr['supplied_euid']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['bcc']))
+ array_unshift($send, $msgHdr['bcc']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['cc']))
+ array_unshift($send, $msgHdr['cc']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['do_confirm']))
+ array_unshift($send, $msgHdr['do_confirm']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['newusername']))
+ array_unshift($send, $msgHdr['newusername']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['subject']))
+ array_unshift($send, $msgHdr['subject']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['format_type']))
+ array_unshift($send, $msgHdr['format_type']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['anon_flag']))
+ array_unshift($send, $msgHdr['anon_flag']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['recp']))
+ array_unshift($send, $msgHdr['recp']);
+ else
+ array_unshift($send, "");
+
+ if (isset($msgHdr['post']))
+ array_unshift($send, $msgHdr['post']);
+ else
+ array_unshift($send, "");
+
+ $params = implode('|', $send);
+ serv_puts("ENT0 ".$params);
+
+ $reply=serv_gets();
+ if (substr($reply, 0, 1) != 4)
+ return array(false, array(), array());
+ serv_puts("Content-type: ".$contentType);
+ serv_puts("");
+ serv_puts($data."\r\n");
+ serv_puts("000");
+}
+
?>
<?PHP
$vcard="";
- 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 "<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("", "");
-
- 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/x-vcard"))
- {
- list($size, $vcard) = download_attachment($msgnum, $result[2]);
- }
+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 "<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("", "");
+
+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/x-vcard"))
+ {
+ list($size, $vcard) = download_attachment($msgnum, $result[2]);
}
+}
- echo "</TABLE>\n <pre>\n".$vcard."</pre>";
+echo "</TABLE>\n <pre>\n".$vcard."</pre>";
+echo "putting it back in!";
+$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>