finally. real code. no. not real code. some convert tool even not finished.
[squirrelmail.git] / src / abook2vcard.php
CommitLineData
97424ab0 1<?php
2
3/**
4 * read_body.php
5 *
6 * Copyright (c) 1999-2003 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * This file is used for reading the msgs array and displaying
10 * the resulting emails in the right frame.
11 *
12 * $Id$
13 */
14
15/* Path for SquirrelMail required files. */
16define('SM_PATH','../');
17
18/* SquirrelMail required files. */
19require_once(SM_PATH . 'include/validate.php');
20require_once(SM_PATH . 'functions/strings.php');
21require_once(SM_PATH . 'functions/prefs.php');
22require_once(SM_PATH . 'config/config.php');
23
24$abook_file=$data_dir.$username.".abook";
25$vcard_dir=$data_dir.$username."/";
26
27$fp = fopen ($abook_file,"r");
28while (!feof ($fp)) {
29 $buffer .= fgets($fp, 4096);
30}
31
32fclose ($fp);
33
34$abook=explode("|",$buffer);
35print_r($abook);
36echo "<p>".$buffer;
37
38while ( list($nick,$email,$fn,$ln,$email)=each($abook) ) {
39echo "
40BEGIN:VCARD
41VERSION:3.0
42N:$ln;$fn;
43NICKNAME:$nick
44EMAIL;INTERNET:$email
45END:VCARD<P>
46";
47}
48
49?>