home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / admin / contacts_commons.inc < prev    next >
Encoding:
Text File  |  2003-03-16  |  855 b   |  35 lines

  1. <?php
  2. /********************************************************
  3.     include/contacts_commons.inc
  4.     
  5.     (C)Copyright 2002 Ryo Chijiiwa <Ryo@IlohaMail.org>
  6.  
  7.     This file is part of IlohaMail, and released under GPL.
  8.     See COPYING, or http://www.fsf.org/copyleft/gpl.html
  9.     
  10.     PURPOSE:
  11.         Common functions used by source/contacts.php
  12.         and source/edit_contact.php
  13. ********************************************************/
  14.  
  15. function GetGroups($contacts){
  16.     if (!is_array($contacts)) return "";
  17.     
  18.     $grp_ka=array();
  19.     $result=array();
  20.     $i=0;
  21.     while ( list($key, $val) = each($contacts) ){
  22.         $group = $contacts[$key]["grp"];
  23.         $group = trim(chop($group));
  24.         if ((!empty($group))&&($grp_ka[$group]!=1)) $grp_ka[$group]=1;
  25.     }
  26.     reset($grp_ka);
  27.     while ( list($key, $val) = each($grp_ka) ){
  28.         $result[$i]=$key;
  29.         $i++;
  30.     }
  31.     
  32.     return base64_encode(implode(",", $result));
  33. }
  34.  
  35. ?>