5 // Translates Citadel protocol data to insertable HTML snippets. You can
6 // use these directly, or you can bypass them completely.
8 // Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
9 // This program is released under the terms of the GNU General Public License.
13 // Fetch and display a message.
15 function display_message($msgnum) {
17 echo '<TABLE border=0 width=100% bgcolor="#DDDDDD"><TR><TD>' ;
18 // Fetch the message from the server
19 list($ok, $response, $fields) = ctdl_fetch_message($msgnum);
21 // Bail out gracefully if the message isn't there.
23 echo "Error: " . htmlspecialchars($response) . "<BR>" ;
24 echo '</TD></TR></TABLE>' ;
30 echo strftime("%b %d %Y %I:%M%p ", $fields["time"]) ;
31 echo " from " . htmlspecialchars($fields["from"]) ;
33 if (isset($fields["rfca"]) && strlen($fields["rfca"]) > 0) {
34 echo " <" . htmlspecialchars($fields["rfca"]) . ">" ;
36 else if ( (strlen($fields["node"]) > 0)
37 && (strcasecmp($fields["node"], $_SESSION["serv_nodename"])) ) {
38 echo " @" . htmlspecialchars($fields["node"]) ;
39 if (strlen($fields["hnod"]) > 0) {
40 echo " (" . htmlspecialchars($fields["hnod"]) . ")" ;
44 if (isset($fields["rcpt"]) && strlen($fields["rcpt"]) > 0) {
45 echo " to " . htmlspecialchars($fields["rcpt"]) ;
47 echo "</I></B><BR>\n" ;
50 if (strlen($fields["subj"]) > 0) {
52 htmlspecialchars($fields["subj"]) .
57 if ($fields['formatet_text'] != "")
58 echo $fields['formatet_text'] . "<BR>";
60 echo $fields["text"] . "<BR>";
62 echo '</TD></TR></TABLE><BR>' ;
65 function get_message_partlist($msgnum) {
67 // Fetch the message from the server
68 list($ok, $response, $fields) = ctdl_fetch_message($msgnum);
70 // Bail out gracefully if the message isn't there.
72 echo "Error: " . htmlspecialchars($response) . "<BR>" ;
75 if (isset($fields['part']))
77 $parts = explode('|', $fields['part']);