]> code.citadel.org Git - citadel.git/blobdiff - ctdlphp/ctdlelements.php
* wait a second so the session proxy has time to start, and become responsive.
[citadel.git] / ctdlphp / ctdlelements.php
index efee340007e14695e77e351c35eba94428d286a3..a0d422f4652d0bb7141f048007782d484af0704a 100644 (file)
@@ -26,10 +26,32 @@ function display_message($msgnum) {
        }
 
        // Begin header
-       echo "<B><I>" .
-               strftime("%b %d %Y %I:%M%p ", $fields["time"]) .
-               " from " . htmlspecialchars($fields["from"]) .
-               "</I></B><BR>\n" ;
+       echo "<B><I>" ;
+       echo strftime("%b %d %Y %I:%M%p ", $fields["time"]) ;
+       echo " from " . htmlspecialchars($fields["from"]) ;
+       
+       if (isset($fields["rfca"]) && strlen($fields["rfca"]) > 0) {
+               echo " &lt;" . htmlspecialchars($fields["rfca"]) . "&gt;" ;
+       }
+       else if ( (strlen($fields["node"]) > 0) 
+            && (strcasecmp($fields["node"], $_SESSION["serv_nodename"])) ) {
+               echo " @" . htmlspecialchars($fields["node"]) ;
+               if (strlen($fields["hnod"]) > 0) {
+                       echo " (" . htmlspecialchars($fields["hnod"]) . ")" ;
+               }
+       }
+
+       if (isset($fields["rcpt"]) && strlen($fields["rcpt"]) > 0) {
+               echo " to " . htmlspecialchars($fields["rcpt"]) ;
+       }
+       echo "</I></B><BR>\n" ;
+
+       // Subject
+       if (strlen($fields["subj"]) > 0) {
+               echo"<i>Subject: " .
+                       htmlspecialchars($fields["subj"]) .
+                       "</i><BR>\n" ;
+       }
 
        // Do message text
        echo $fields["text"] . "<BR>";
@@ -37,6 +59,26 @@ function display_message($msgnum) {
        echo '</TD></TR></TABLE><BR>' ;
 }
 
+function get_message_partlist($msgnum) {
+
+       // Fetch the message from the server
+       list($ok, $response, $fields) = ctdl_fetch_message($msgnum);
+
+       // Bail out gracefully if the message isn't there.
+       if (!$ok) {
+               echo "Error: " . htmlspecialchars($response) . "<BR>" ;
+               return false;
+       }
+       if (isset($fields['part']))
+       {
+               $parts = explode('|', $fields['part']);
+               print_r($parts);
+               return $parts;
+
+       }
+       return false;
+}
+
 
 
 ?>