I would like to give my users the option to display
the body of the message there reading in an iFrame. I
have personly have played with this in other web based
e-mail clients and have found that having the body
displayed in an iFrame realy helps in displaying HTML
formated messages.
Logged In: NO
I have hacked Squirrelmail to display in an iframe, but
there is no user options to turn it on or off.
You will need to edit read_body.php
Comment out echo $body; or just remove it.
// echo $body;
afer that line add this code. This code also adds a link
to open the iframe page in a new window for a cleaner print
out. Also if the broser dose not support iFrames it should
still display the message.
session_register("body");
print "<center><iframe src=\&quot;iframe.php\&quot; width=\&quot;709\&quot;
height=\&quot;341\&quot; scrolling=\&quot;yes\&quot; frameborder=\&quot;0
\&quot;>body</IFRAME>";
print "<br><a href='iframe.php' target='_new'>Printable
Version</a></center>";
Then you need to create new page. Call it iframe.php and
put it under src.
in this new file place this code.
<?
session_start();
print "$body";
?>
its that easy.
Logged In: YES
user_id=500638
This seems like a good idea, as a lot of HTML mail isn't
so nice and screws up the look of the right hand pane
(although sometimes the SM stylesheet in use has an
adverse affect on the message body.
Anyhow, the annonymous message dated 2001-08-24 looks
likes it must be from an older version of SM than I have
as I don't see code sections like this.
However, using version 1.2.5 I have had succeess getting
inline frames to work by modifying read_body.php, and then
mime.php. The change to mime.php was required as the
formatBody function returns not only the main contents,
but attachment links, etc. I made it return these in an
array (body, with separate link HTML). When iframes are
not in use then both parts can be concatenated, but when
they are one, or the other will be discarded.
I added a section to build a frame much like the older
message (this is near the bottom of read_body.php), but
made the content URL read_body.php with a body_only=1
variable, then trap that variable just after the session
starts with something like this in that code:
if (isset($body_only) && $body_only) {
$message = sqimap_get_message($imapConnection,
$passed_id, $mailbox);
// formatBody now returns two parts
list ($body, $after_body) = formatBody($imapConnection,
$message, $color, $wrap_at);
echo $body;
sqimap_logout($imapConnection);
exit;
}
I made the iframe attributes:
width=100% height=500 frameborder=0 scrolling=auto
marginwidth=0 marginheight=0
This all works very well, but could do with a little tidy
up. For example, I don't see a way to make the frame to
veritcally auto size to it's contents/parent frame, anyone
know how to make this look nicer than a fixed height?).
I think it might also be nice to make the 'View unsafe
images' link javascript so it just did a reload of the
iframe, and not the whole page.
Any comments?
Logged In: YES
user_id=225877
Implemented in 1.5cvs. Moving to stable 1.4.x and setting
lowest priority.