- small improvement: don't use implode to check array elements
| | |
| | | function iil_C_CountUnseen(&$conn, $folder) { |
| | | $index = iil_C_Search($conn, $folder, 'ALL UNSEEN'); |
| | | if (is_array($index)) { |
| | | $str = implode(',', $index); |
| | | if (empty($str)) { |
| | | return false; |
| | | if (($cnt = count($index)) && $index[0] != '') { |
| | | return $cnt; |
| | | } |
| | | return count($index); |
| | | } |
| | | return false; |
| | | } |
| | |
| | | function iil_C_UID2ID(&$conn, $folder, $uid) { |
| | | if ($uid > 0) { |
| | | $id_a = iil_C_Search($conn, $folder, "UID $uid"); |
| | | if (is_array($id_a)) { |
| | | $count = count($id_a); |
| | | if ($count > 1) { |
| | | return false; |
| | | } |
| | | if (is_array($id_a) && count($id_a) == 1) { |
| | | return $id_a[0]; |
| | | } |
| | | } |