6 * Copyright (c) 1999-2003 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * This file is used for reading the msgs array and displaying
10 * the resulting emails in the right frame.
15 /* Path for SquirrelMail required files. */
16 define('SM_PATH','../');
18 /* SquirrelMail required files. */
19 require_once(SM_PATH
. 'include/validate.php');
20 require_once(SM_PATH
. 'functions/strings.php');
21 require_once(SM_PATH
. 'functions/prefs.php');
22 require_once(SM_PATH
. 'config/config.php');
24 $abook_file=$data_dir.$username.".abook";
25 $vcard_base=$data_dir.$username;
28 $fp = fopen ($abook_file,"r");
30 $buffer = fgets($fp, 8096);
31 $line=explode("|",$buffer);
40 function write_vcard($abook) {
41 global $vcard_base,$i;
44 // FIXME check if filename is ok
45 $vcard_fn = $vcard_base.".".$abook[0].".vcard";
47 $fp0 = fopen ($vcard_fn,"w");
49 fputs($fp0, "BEGIN:VCARD
51 N:$abook[1];$abook[2];
53 EMAIL;INTERNET:$abook[3];
61 echo "done ;) seem to have written $i files.";