// This program is released under the terms of the GNU General Public License.
//
// Fetch and display a message.
//
function display_message($msgnum) {
echo '
' ;
// 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) . " " ;
echo ' |
' ;
return;
}
// Begin header
echo "" ;
echo strftime("%b %d %Y %I:%M%p ", $fields["time"]) ;
echo " from " . htmlspecialchars($fields["from"]) ;
if (isset($fields["rfca"]) && strlen($fields["rfca"]) > 0) {
echo " <" . htmlspecialchars($fields["rfca"]) . ">" ;
}
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 "
\n" ;
// Subject
if (strlen($fields["subj"]) > 0) {
echo"Subject: " .
htmlspecialchars($fields["subj"]) .
"
\n" ;
}
// Do message text
if ($fields['formatet_text'] != "")
echo $fields['formatet_text'] . "
";
else
echo $fields["text"] . "
";
echo '
' ;
}
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) . "
" ;
return false;
}
if (isset($fields['part']))
{
$parts = explode('|', $fields['part']);
print_r($parts);
return $parts;
}
return false;
}
?>