[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] CVS: squirrelmail/plugins/message_details message_details_bottom.php,1.29,1.30
From:       Tomas Kuliavas <tokul () users ! sourceforge ! net>
Date:       2006-04-23 13:16:20
Message-ID: E1FXeRo-0001gw-Fg () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/squirrelmail/squirrelmail/plugins/message_details
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3802

Modified Files:
	message_details_bottom.php 
Log Message:
removed debug function
message body is placed in <pre></pre> instead of <code></code> in order to
display tabs in headers. rtrim function is used instead of trim in order to 
strip writespace only from the end of line.


Index: message_details_bottom.php
===================================================================
RCS file: /cvsroot/squirrelmail/squirrelmail/plugins/message_details/message_details_bottom.php,v
 retrieving revision 1.29
retrieving revision 1.30
diff -u -w -r1.29 -r1.30
--- message_details_bottom.php	19 Apr 2006 18:03:24 -0000	1.29
+++ message_details_bottom.php	23 Apr 2006 13:16:18 -0000	1.30
@@ -31,10 +31,13 @@
 global $msgd_8bit_in_hex;
 $msgd_8bit_in_hex=false;
 
-if (!empty($md_action))
-{
+if (!empty($md_action)) {
     sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
     sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
+    /* 
+     * add third function argument, if you want to see 
+     * message source without formating
+     */
     echo get_message_details($mailbox, $passed_id);
 }
 
@@ -93,22 +96,6 @@
 }
 
 
-
-/**
- * Returns time in microseconds between selected and current timestamp
- *
- * @param array $start see details about array format at \
                http://www.php.net/gettimeofday
- * @return integer time in microseconds
- * @access private
- */
-function returnTime($start) {
- $stop = gettimeofday();
- $timepassed =  1000000 * ($stop['sec'] - $start['sec']) + $stop['usec'] - \
                $start['usec'];
- return $timepassed;
-}
-
-
-
 /**
  * Returns actual message details
  * @param string $mailbox
@@ -120,7 +107,6 @@
  * @access public
  */
 function get_message_details($mailbox, $passed_id, $stripHTML=FALSE) {
-
 global $imapServerAddress, $imapPort, $color,$msgd_8bit_in_hex;
 
 $returnValue = '';
@@ -129,7 +115,6 @@
 
 $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
 $read = sqimap_mailbox_select($imapConnection, $mailbox);
-$start = gettimeofday();
 $body = sqimap_run_command($imapConnection, "FETCH $passed_id RFC822",true, \
$response, $readmessage, TRUE);  $message_body = '';
 $header = false;
@@ -151,7 +136,7 @@
 $count=count($body);
 $body[$count-1] = substr($body[$count-1], -1);
 for ($i=1; $i < $count; $i++) {
-    $line = trim($body[$i]);
+        $line = rtrim($body[$i]);
     if ($line == '') {
         $pre = '';
         $end = '';
@@ -161,7 +146,7 @@
         } else if ($messageheader) {
             if ($header) {
                 $header=false;
-                $end = "\n \n".'</div>'."\n \n".'<div class="ent_body" \
id="'.$entStr.'B">'."\n \n"; +                    $end = '</div><div class="ent_body" \
id="'.$entStr.'B">';  }
             $mimepart = -$header;
             $bnd_end = false;
@@ -173,7 +158,7 @@
         } else {
             if ($header) {
                 $pre = '';
-                $end = "\n \n".'</div>'."\n \n".'<div class="ent_body" \
id="'.$entStr.'B">'."\n \n"; +                    $end = '</div><div class="ent_body" \
id="'.$entStr.'B">';  }
             $header = false;
             $mimepart=true;
@@ -248,9 +233,9 @@
                 $content_indx++;
                 $content[$content_indx]=array();
                 $content[$content_indx]['ent'] = '<a href="#'."$entStr \
                \">$entStr".'</a>';
-                $pre .= "\n \n".'</div>'."\n \n".'<div class="entheader" id="'.
+                    $pre .= '</div><div class="entheader" id="'.
                     $entStr.'H"><a name="'."$entStr".'"><b><font \
                color="'.$color[2].'">';
-                $end .= '</font></b>'."\n";
+                    $end .= '</font></b>';
                 $header = true;
                 $mimepart = false;
                 $encoding = '';
@@ -290,22 +275,13 @@
             }
         }
     }
-/*
-    if ($mimepart) {
-            if (isset($entities["$entStr"])) {
-            if (isset($encoding) && $encoding == 'base64') {
-                    if (!isset( $entities["$entStr"]['content'])) \
                $entities[$entStr]['content'] = '';
-                $entities["$entStr"]['content'] .= $line;
-            }
-        }
-    }
-*/
+
     if ($stripHTML) {
         $message_body .= $line . "\r\n";
     } else {
         $line = htmlspecialchars($line);
         if ($msgd_8bit_in_hex) $line = msgd_convert_to_hex($line);
-        $message_body .= "$pre"."$line"."$end".'<br />'."\r\n";
+            $message_body .= "$pre"."$line"."$end"."\r\n";
     }
 }
 
@@ -343,26 +319,10 @@
 /* body */
 if (!$stripHTML) {
     $returnValue .= "<body text=\"$color[8]\" bgcolor=\"$color[4]\" \
                link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n";
-    $returnValue .= '<code>'."\n";
     $returnValue .= '<font face="monospace">'."\n";
     $returnValue .= '<br />'."\n";
 }
 
-
-//session_register("entities");
-//$keys = array_keys($entities);
-//$start = gettimeofday();
-//foreach ($keys as $key) {
-//    if (isset($entities[$key])) {
-//    if ($entities[$key]['encoding'] == 'base64') {
-//        if (!$stripHTML) {
-//            $returnValue .= 'img \
src="message_viewentity.php?ent='.$entities[$key]['entity'].'&amp;name='.$entities[$key]['name'].'"><br \
                />';
-//        }
-//    }
-//    }
-//}
-//session_unregister("entities");
-
 if (count($content) > 0 && !$stripHTML) {
     $returnValue .= '<h2>'._("Bodystructure")."</h2>\n\n";
     $returnValue .= '<table border="1" width="98%"><thead>'.
@@ -394,16 +354,18 @@
 
 if (!$stripHTML) {
     $returnValue .= '<h2>'._("RFC822 Message body")."</h2>\n\n";
-    $returnValue .= '<div><div class="header">'."\n\n";
+        $returnValue .= '<pre><div><div class="header">';
+    } else {
+        $returnValue .= '<pre>';
 }
 
 $returnValue .= $message_body;
 
-if (!$stripHTML)
-    $returnValue .= '</div></div></font></code></body></html>';
-
+    if (!$stripHTML) {
+        $returnValue .= '</div></div></pre></font></body></html>';
+    } else {
+        $returnValue .= '</pre>';
+    }
 return $returnValue;
-
 }
-
 ?>
\ No newline at end of file



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
--
squirrelmail-cvs mailing list
List Address: squirrelmail-cvs@lists.sourceforge.net
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
http://squirrelmail.org/cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic