if ($handle_errors == true) {
if ($response == "NO") {
- echo "<br><b><font color=$color[2]>";
+ echo "<br><b><font color=$color[2]>\n";
echo _("ERROR : Could not complete request.");
- echo "</b><br>";
+ echo "</b><br>\n";
echo _("Reason Given: ");
- echo "$message</font><br>";
+ echo "$message</font><br>\n";
exit;
} else if ($response == "BAD") {
- echo "<br><b><font color=$color[2]>";
+ echo "<br><b><font color=$color[2]>\n";
echo _("ERROR : Bad or malformed request.");
- echo "</b><br>";
+ echo "</b><br>\n";
echo _("Server responded: ");
- echo "$message</font><br>";
+ echo "$message</font><br>\n";
exit;
}
}
/******************************************************************************
** Selects a mailbox
******************************************************************************/
- function sqimap_mailbox_select ($imap_stream, $mailbox, $hide=true) {
+ function sqimap_mailbox_select ($imap_stream, $mailbox, $hide=true, $recent=false) {
fputs ($imap_stream, "a001 SELECT \"$mailbox\"\r\n");
$read = sqimap_read_data($imap_stream, "a001", true, $response, $message);
+ if ($recent) {
+ for ($i=0; $i<count($read); $i++) {
+ if (strpos(strtolower($read[$i]), "recent")) {
+ $r = explode(" ", $read[$i]);
+ }
+ }
+ return $r[1];
+ }
}
// $read = strtolower($bodystructure);
$read = $bodystructure;
- if ($debug_mime) echo "<tt>$read</tt><br><br>";
+ if ($debug_mime) echo "<tt>$read</tt><br><br>\n";
// isolate the body structure and remove beginning and end parenthesis
$read = trim(substr ($read, strpos(strtolower($read), "bodystructure") + 13));
$read = trim(substr ($read, 0, -1));
$end = mime_match_parenthesis(0, $read);
}
- if ($debug_mime) echo "<tt>$read</tt><br><br>";
+ if ($debug_mime) echo "<tt>$read</tt><br><br>\n";
$msg = mime_parse_structure ($read, 0);
$msg->header = $header;
// to mime_get_elements()
function mime_parse_structure ($structure, $ent_id) {
global $debug_mime;
- if ($debug_mime) echo "<font color=008800><tt>START: mime_parse_structure()</tt></font><br>";
+ if ($debug_mime) echo "<font color=008800><tt>START: mime_parse_structure()</tt></font><br>\n";
$msg = new message();
if (substr($structure, 0, 1) == "(") {
$ent_id = mime_new_element_level($ent_id);
do_hook ("generic_header");
- echo "<TITLE>$title</TITLE>";
+ echo "<TITLE>$title</TITLE>\n";
echo "</HEAD>\n\n";
}
echo "// --></SCRIPT>\n\n";
}
- echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST ENCTYPE=\"multipart/form-data\">\n";
- //echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST>\n";
+ //echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST ENCTYPE=\"multipart/form-data\">\n";
+ echo "\n<FORM name=compose action=\"compose.php\" METHOD=POST>\n";
if ($reply_id) {
echo "<input type=hidden name=reply_id value=$reply_id>\n";
}
else echo "<a href=\"../src/help.php?chapter=".($chapter-1)."\">Previous</a> | ";
echo "<a href=\"../src/help.php\">Table of Contents</a>";
if ($chapter >= count($helpdir)) echo " | <font color=\"$color[9]\">Next</font>";
- else echo " | <a href=\"../src/help.php?chapter=".($chapter+1)."\">Next</a>";
+ else echo " | <a href=\"../src/help.php?chapter=".($chapter+1)."\">Next</a>\n";
echo "</center></small><br>\n";
echo "<font size=5><b>$chapter - $help_info[0]</b></font><br><br>\n";
if ($help_info[1])
- echo "$help_info[1]";
+ echo "$help_info[1]\n";
else
- echo "<p>$help_info[2]</p>";
+ echo "<p>$help_info[2]</p>\n";
for ($n = $help_info[3]; $n < count($doc); $n++) {
$section++;
$n = $help_info[3];
}
- echo "<br><center><a href=\"#pagetop\">" . _("Top") . "</a></center>";
+ echo "<br><center><a href=\"#pagetop\">" . _("Top") . "</a></center>\n";
}
}
do_hook("help_bottom");
displayHtmlHeader();
+
function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $unseen) {
global $folder_prefix, $trash_folder, $sent_folder;
global $color, $move_to_sent, $move_to_trash;
echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"$left_refresh;URL=left_main.php\">\n";
}
- echo "\n<BODY BGCOLOR=\"$color[3]\" TEXT=\"$color[6]\" LINK=\"$color[6]\" VLINK=\"$color[6]\" ALINK=\"$color[6]\">\n\n";
+ echo "\n<BODY BGCOLOR=\"$color[3]\" TEXT=\"$color[6]\" LINK=\"$color[6]\" VLINK=\"$color[6]\" ALINK=\"$color[6]\">\n";
do_hook("left_main_before");
} else {
$line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
}
- echo "\n$line<BR>\n";
+ echo "$line<BR>\n";
}
sqimap_logout($imapConnection);
do_hook("left_main_after");
do_hook("right_main_after_header");
if ($just_logged_in == 1 && strlen(trim($motd)) > 0) {
- echo "<center><br>";
- echo "<table width=70% cellpadding=0 cellspacing=0 border=0><tr><td bgcolor=\"$color[9]\">";
- echo "<table width=100% cellpadding=5 cellspacing=1 border=0><tr><td bgcolor=\"$color[4]\">";
- echo "$motd";
- echo "</td></tr></table>";
- echo "</td></tr></table>";
- echo "</center><br>";
+ echo "<center><br>\n";
+ echo "<table width=70% cellpadding=0 cellspacing=0 border=0><tr><td bgcolor=\"$color[9]\">\n";
+ echo "<table width=100% cellpadding=5 cellspacing=1 border=0><tr><td bgcolor=\"$color[4]\">\n";
+ echo "$motd\n";
+ echo "</td></tr></table>\n";
+ echo "</td></tr></table>\n";
+ echo "</center><br>\n";
}
if (isset($newsort)) {