Changeset 1752 for trunk/expressoMail1_2/inc/class.imap_functions.inc.php
- Timestamp:
- 12/04/09 15:14:45 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r1751 r1752 90 90 { 91 91 $temp = $this->get_info_head_msg($msg_number); 92 $temp['msg_sample'] = $this->get_msg_sample($msg_number,$folder); 92 93 if(!$temp) 94 { 93 95 return false; 96 } 94 97 95 98 $return[$i] = $temp; … … 704 707 $return['login'] = $_SESSION['phpgw_info']['expressomail']['user']['account_id'];//$GLOBALS['phpgw_info']['user']['account_id']; 705 708 $return['reply_toaddress'] = $header->reply_toaddress; 709 return $return; 710 } 711 712 function get_msg_sample($msg_number,$folder) 713 { 714 715 716 include_once("class.message_components.inc.php"); 717 $msg = &new message_components($this->mbox); 718 $msg->fetch_structure($msg_number); 719 $return = ""; 720 721 if( (isset($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['preview_msg_subject']) && ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['preview_msg_subject'] == "0")) && (isset($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['preview_msg_tip']) && ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['preview_msg_tip'] == "0")) ) 722 { 723 // $return['preview_msg_subject'] = ""; 724 // $return['preview_msg_tip'] = ""; 725 $return['body'] = ""; 726 return $return; 727 /*} else{ 728 if( isset($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['preview_msg_subject']) && ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['preview_msg_subject'] == "0") ) 729 { 730 $return['preview_msg_subject'] = ""; 731 } 732 733 if( isset($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['preview_msg_tip']) && ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['preview_msg_tip'] == "0") ) 734 { 735 $return['preview_msg_tip'] = ""; 736 } 737 */ 738 } 739 740 741 742 if(!$msg->structure[$msg_number]->parts) 743 { 744 $content = ''; 745 if (strtolower($msg->structure[$msg_number]->subtype) == "plain" || strtolower($msg->structure[$msg_number]->subtype) == "html") 746 { 747 $content = $this->decodeBody(imap_body($this->mbox, $msg_number, FT_UID|FT_PEEK), $msg->encoding[$msg_number][0], $msg->charset[$msg_number][0]); 748 } 749 } 750 else 751 { 752 foreach($msg->pid[$msg_number] as $values => $msg_part) 753 { 754 755 $file_type = strtolower($msg->file_type[$msg_number][$values]); 756 if($file_type == "text/plain" || $file_type == "text/html") { 757 $content = $this->decodeBody(imap_fetchbody($this->mbox, $msg_number, $msg_part, FT_UID|FT_PEEK), $msg->encoding[$msg_number][$values], $msg->charset[$msg_number][$values]); 758 break; 759 } 760 } 761 } 762 $content = $this->replace_special_characters($content); 763 $tags_replace = array("<br>","<br/>","<br />"); 764 $content = str_replace($tags_replace," ", $content); 765 $content = strip_tags($content); 766 $content = str_replace(array("{","}"," "), " ", $content); 767 $content = trim($content); 768 $content = substr($content,0,300); 769 $content != "" ? $return['body'] = " - " . $content: $return['body'] = ""; 706 770 return $return; 707 771 } … … 1374 1438 $flag = preg_match('/importance *: *(.*)\r/i', $tempHeader, $importance); 1375 1439 $return[$i]['Importance'] = $flag==0?"Normal":$importance[1]; 1440 1441 $msg_sample = $this->get_msg_sample($msg_number); 1442 $return[$i]['msg_sample'] = $msg_sample; 1376 1443 1377 1444 $header = $this->get_header($msg_number);
Note: See TracChangeset
for help on using the changeset viewer.