Ignore:
Timestamp:
11/26/09 10:27:48 (14 years ago)
Author:
eduardoalex
Message:

Ticket #787 - Adicionada funcao mobile_search em imapfunctions para busca de emails no mobile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r1707 r1709  
    29342934                return $return; 
    29352935        } 
     2936         
     2937         
     2938        function mobile_search($params) 
     2939        { 
     2940                include("class.imap_attachment.inc.php"); 
     2941                $imap_attachment = new imap_attachment(); 
     2942                $criterias = array ("TO","SUBJECT","FROM","CC"); 
     2943                $return = array(); 
     2944                $folders = $this->get_folders_list(); 
     2945                $num_msgs = 0; 
     2946                                           
     2947                foreach($folders as $id =>$folder) 
     2948                { 
     2949                        if(strpos($folder['folder_id'],'user')===false && is_array($folder)) { 
     2950                                foreach($criterias as $criteria_fixed) 
     2951                    { 
     2952                        $_filter = $criteria_fixed . ' "'.$params['filter'].'"'; 
     2953                                        $mbox_stream = $this->open_mbox($folder['folder_name']); 
     2954         
     2955                                        $messages = imap_search($mbox_stream, $_filter, SE_UID); 
     2956                                         
     2957                                        if ($messages == ''){ 
     2958                                                if($mbox_stream) 
     2959                                                        imap_close($mbox_stream); 
     2960                                                continue;        
     2961                                        } 
     2962                                                                         
     2963                                        foreach($messages as $msg_number) 
     2964                                        {                                        
     2965                                                $temp = $this->get_info_head_msg($msg_number); 
     2966                                                if(!$temp) 
     2967                                                        return false; 
     2968                 
     2969                                                $return[$num_msgs] = $temp; 
     2970                                                $num_msgs++; 
     2971                                        } 
     2972                                        $return['num_msgs'] = $num_msgs; 
     2973                                         
     2974                                        if($mbox_stream) 
     2975                                                imap_close($mbox_stream); 
     2976                                } 
     2977                        } 
     2978                                 
     2979                } 
     2980                return $return; 
     2981        } 
    29362982 
    29372983        function delete_and_show_previous_message($params) 
Note: See TracChangeset for help on using the changeset viewer.