- Timestamp:
- 09/09/10 15:34:47 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php
r3192 r3223 727 727 728 728 $return = ""; 729 if( (!isset($this->pref erences['preview_msg_subject']) || ($this->preferences['preview_msg_subject'] != "1")) &&730 (!isset($this->pref erences['preview_msg_tip'] ) || ($this->preferences['preview_msg_tip'] != "1")) )729 if( (!isset($this->prefs['preview_msg_subject']) || ($this->prefs['preview_msg_subject'] != "1")) && 730 (!isset($this->prefs['preview_msg_tip'] ) || ($this->prefs['preview_msg_tip'] != "1")) ) 731 731 { 732 732 $return['body'] = ""; … … 3237 3237 function search_msg($params = ''){ 3238 3238 $mbox_stream = ""; 3239 if(strpos($params['condition'],"#")===false) { //local messages 3239 if(strpos($params['condition'],"#")===false) { //local messages? It shouldn't be necessary, should it? FIXME 3240 3240 $search=false; 3241 3241 } 3242 3242 else { 3243 3243 $search = explode(",",$params['condition']); 3244 } 3244 } 3245 $params['page'] = $params['page']*1; 3245 3246 3246 3247 if(is_array($search)){ … … 3311 3312 $search_criteria = imap_search($mbox_stream, $_filter, SE_UID); 3312 3313 3313 if(is_array($search_criteria)) //&& count($search_criteria) < 50)3314 if(is_array($search_criteria)) 3314 3315 { 3315 3316 foreach($search_criteria as $new_search) … … 3319 3320 $elem['uid'] = $new_search; 3320 3321 $retorno[] = $elem; 3321 3322 /* NOTE: This code was lost on 2.2 merge 3323 if ($search_result_number != '65536' && $sum == $search_result_number) 3324 { 3325 return $retorno ? $sum . "=sumResults=" . $retorno : "none"; 3326 } 3327 3328 $m_token = trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n"); 3329 if(!@strstr($retorno,$m_token)) 3330 { 3331 $retorno .= $m_token; 3332 $sum ++; 3333 } 3334 */ 3335 } 3336 } 3322 } 3323 } 3337 3324 } 3338 3325 } … … 3346 3333 $elem['boxname'] = mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ); 3347 3334 $elem['uid'] = $new_search; 3348 $retorno[] = $elem; 3349 // NOTE: This code was lost on 2.2 merge 3350 /*if ($search_result_number != '65536' && $sum == $search_result_number) 3351 { 3352 return $retorno ? $sum . "=sumResults=" . $retorno : "none"; 3353 } 3354 $retorno .= trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--" . $new_search."##"."\n"); 3355 $sum++;*/ 3335 $retorno[] = $elem; 3356 3336 } 3357 3337 } 3358 3338 } 3359 3339 } 3360 3340 } … … 3362 3342 { 3363 3343 imap_close($mbox_stream); 3364 } 3365 3366 if ($retorno) 3344 } 3345 $num_msgs = count($retorno); 3346 3347 /* Comparison functions, descendent is ascendent with parms inverted */ 3348 function SORTDATE($a, $b) { return ($a['udate'] < $b['udate']); } 3349 function SORTDATE_REVERSE($b, $a) { return SORTDATE($a,$b); } 3350 3351 function SORTWHO($a, $b) { return (strtoupper($a['from']) > strtoupper($b['from'])); } 3352 function SORTWHO_REVERSE($b, $a) { return SORTWHO($a,$b); } 3353 3354 function SORTSUBJECT($a, $b) { return (strtoupper($a['subject']) > strtoupper($b['subject'])); } 3355 function SORTSUBJECT_REVERSE($b, $a) { return SORTSUBJECT($a,$b); } 3356 3357 function SORTBOX($a, $b) { return ($a['boxname'] > $b['boxname']); } 3358 function SORTBOX_REVERSE($b, $a) { return SORTBOX($a,$b); } 3359 3360 function SORTSIZE($a, $b) { return ($a['size'] > $b['size']); } 3361 function SORTSIZE_REVERSE($b, $a) { return SORTSIZE($a,$b); } 3362 3363 usort($retorno, $params['sort_type']); 3364 $pageret = array_slice($retorno, $params['page'] * $this->prefs['max_email_per_page'], $this->prefs['max_email_per_page']); 3365 $arrayRetorno['num_msgs'] = $num_msgs; 3366 $arrayRetorno['data'] = $pageret; 3367 3368 if ($pageret) 3367 3369 { 3368 return $ retorno;3370 return $arrayRetorno; 3369 3371 } 3370 3372 else
Note: See TracChangeset
for help on using the changeset viewer.