Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Fixe patch! #30

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a5806d3
applied changes taken from http://www.ip-phone-forum.de/showthread.ph…
jens-maus Aug 14, 2014
b792826
integrated changes from http://www.ip-phone-forum.de/showthread.php?t…
jens-maus Aug 15, 2014
1658c0e
fixed problem in case count($Parameter) > 2 and if there is no "," se…
jens-maus Aug 16, 2014
1b54761
Merge branch 'master' of https://github.com/jens-maus/vCard-parser
jens-maus Aug 16, 2014
c928b81
use count() instead of empty() since explode() returns an array.
jens-maus Aug 28, 2014
38ac2ea
Force all keys to be lowercase, and allow for lowercase use in __call.
jimjag Feb 9, 2015
5509cfa
no ending tag (PSR)
jimjag Feb 9, 2015
4b563ff
W/ suggestions from http://www.ip-phone-forum.de/showthread.php?t=267477
jimjag Feb 11, 2015
6422f36
Be aware of ',' and its lack thereof
jimjag Feb 11, 2015
cada664
Merge branch 'master' of https://github.com/jimjag/vCard-parser
jens-maus May 24, 2015
8cc4a9e
Merge pull request #1 from jens-maus/master
kai-c Aug 11, 2015
414eeb5
add getKeyList method
mcarbonneaux Nov 15, 2015
b5c5c85
add commentary
mcarbonneaux Nov 15, 2015
9be70ac
Bugfix for multiple-contact vCards with Agent data
mcarbonneaux Nov 15, 2015
1bd8fbe
add Magic isset method.
mcarbonneaux Nov 15, 2015
2f4e3c1
add test for getKetList method
mcarbonneaux Nov 15, 2015
095bea5
try to correct issue https://github.com/nuovo/vCard-parser/issues/20
mcarbonneaux Nov 15, 2015
e724a6f
fixe crlf false interpretation of the specification
mcarbonneaux Nov 15, 2015
3ca92a8
merged pr #1
h44z Jun 13, 2016
a45a656
Merge branch 'mcarbonneaux-mca-1'
h44z Jun 13, 2016
b0314eb
Merge pull request #1 from h44z/master
mcarbonneaux Jul 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Example3.0.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ PHOTO;VALUE=URL;TYPE=GIF:http://upload.wikimedia.org/wikipedia/commons/thumb/a/a
TEL;TYPE=WORK,VOICE:(111) 555-1212
TEL;TYPE=HOME,VOICE:(404) 555-1212
TEL;TYPE=HOME,TYPE=VOICE:(404) 555-1213
ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
ADR;TYPE=WORK:;extended;street 1;city;state;zip;country
ADR;TYPE=WORK:;appartement 1;100 Waters Edge;Baytown;LA;30314;United States of America
LABEL;TYPE=WORK:100 Waters Edge\nBaytown, LA 30314\nUnited States of America
ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
LABEL;TYPE=HOME:42 Plantation St.\nBaytown, LA 30314\nUnited States of America
Expand All @@ -33,4 +34,4 @@ AGENT:BEGIN:VCARD
REV:20080424T195243Z
END:VCARD
REV:20080424T195243Z
END:VCARD
END:VCARD
42 changes: 21 additions & 21 deletions test.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
Expand Down Expand Up @@ -40,13 +40,13 @@ function OutputvCard(vCard $vCard)
{
foreach ($vCard -> PHOTO as $Photo)
{
if ($Photo['Encoding'] == 'b')
if ($Photo['encoding'] == 'b')
{
echo '<img src="data:image/'.$Photo['Type'][0].';base64,'.$Photo['Value'].'" /><br />';
echo '<img src="data:image/'.$Photo['type'][0].';base64,'.$Photo['value'].'" /><br />';
}
else
{
echo '<img src="'.$Photo['Value'].'" /><br />';
echo '<img src="'.$Photo['value'].'" /><br />';
}

/*
Expand All @@ -69,14 +69,14 @@ function OutputvCard(vCard $vCard)

foreach ($vCard -> N as $Name)
{
echo '<h3>Name: '.$Name['FirstName'].' '.$Name['LastName'].'</h3>';
echo '<h3>Name: '.$Name['firstname'].' '.$Name['lastname'].'</h3>';
}

foreach ($vCard -> ORG as $Organization)
{
echo '<h3>Organization: '.$Organization['Name'].
($Organization['Unit1'] || $Organization['Unit2'] ?
' ('.implode(', ', array($Organization['Unit1'], $Organization['Unit2'])).')' :
echo '<h3>Organization: '.$Organization['name'].
($Organization['unit1'] || $Organization['unit2'] ?
' ('.implode(', ', array($Organization['unit1'], $Organization['unit2'])).')' :
''
).'</h3>';
}
Expand All @@ -92,7 +92,7 @@ function OutputvCard(vCard $vCard)
}
else
{
echo $Tel['Value'].' ('.implode(', ', $Tel['Type']).')<br />';
echo $Tel['value'].' ('.implode(', ', $Tel['type']).')<br />';
}
}
echo '</p>';
Expand All @@ -109,7 +109,7 @@ function OutputvCard(vCard $vCard)
}
else
{
echo $Email['Value'].' ('.implode(', ', $Email['Type']).')<br />';
echo $Email['value'].' ('.implode(', ', $Email['type']).')<br />';
}
}
echo '</p>';
Expand All @@ -126,7 +126,7 @@ function OutputvCard(vCard $vCard)
}
else
{
echo $URL['Value'].'<br />';
echo $URL['value'].'<br />';
}
}
echo '</p>';
Expand All @@ -143,7 +143,7 @@ function OutputvCard(vCard $vCard)
}
else
{
echo $IMPP['Value'].'<br/ >';
echo $IMPP['value'].'<br/ >';
}
}
echo '</p>';
Expand All @@ -153,14 +153,14 @@ function OutputvCard(vCard $vCard)
{
foreach ($vCard -> ADR as $Address)
{
echo '<p><h4>Address ('.implode(', ', $Address['Type']).')</h4>';
echo 'Street address: <strong>'.($Address['StreetAddress'] ? $Address['StreetAddress'] : '-').'</strong><br />'.
'PO Box: <strong>'.($Address['POBox'] ? $Address['POBox'] : '-').'</strong><br />'.
'Extended address: <strong>'.($Address['ExtendedAddress'] ? $Address['ExtendedAddress'] : '-').'</strong><br />'.
'Locality: <strong>'.($Address['Locality'] ? $Address['Locality'] : '-').'</strong><br />'.
'Region: <strong>'.($Address['Region'] ? $Address['Region'] : '-').'</strong><br />'.
'ZIP/Post code: <strong>'.($Address['PostalCode'] ? $Address['PostalCode'] : '-').'</strong><br />'.
'Country: <strong>'.($Address['Country'] ? $Address['Country'] : '-').'</strong>';
echo '<p><h4>Address ('.implode(', ', $Address['type']).')</h4>';
echo 'Street address: <strong>'.($Address['streetaddress'] ? $Address['streetaddress'] : '-').'</strong><br />'.
'PO Box: <strong>'.($Address['pobox'] ? $Address['pobox'] : '-').'</strong><br />'.
'Extended address: <strong>'.($Address['extendedaddress'] ? $Address['extendedaddress'] : '-').'</strong><br />'.
'Locality: <strong>'.($Address['locality'] ? $Address['locality'] : '-').'</strong><br />'.
'Region: <strong>'.($Address['region'] ? $Address['region'] : '-').'</strong><br />'.
'ZIP/Post code: <strong>'.($Address['postalcode'] ? $Address['postalcode'] : '-').'</strong><br />'.
'Country: <strong>'.($Address['country'] ? $Address['country'] : '-').'</strong>';
}
echo '</p>';
}
Expand Down Expand Up @@ -213,4 +213,4 @@ function OutputvCard(vCard $vCard)
}
?>
</body>
</html>
</html>
12 changes: 12 additions & 0 deletions test2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

include('vCard.php');
$vCard = new vCard('Example3.0.vcf');

printf("nb contact:%s\n",count($vCard));
$keylist=$vCard->getKeyList();
foreach($keylist as $key => $val)
{
printf("Properties:%s\n",$val);
print_r($vCard->$val);
}
Loading