X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fvcard.php;h=14d9166008d6a86a2b3b75e7c25a1471e6a89edb;hp=b070dd58ba81018c55dc621acb340ee70beaf32a;hb=0f8a1ce94ff62c4a6022969cf2b3e8fb695282f4;hpb=15e6162eacc97158393bc75aed3afeb7b19c24a6
diff --git a/src/vcard.php b/src/vcard.php
index b070dd58..14d91660 100644
--- a/src/vcard.php
+++ b/src/vcard.php
@@ -11,138 +11,113 @@
* $Id$
*/
-/*****************************************************************/
-/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/
-/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/
-/*** + Base level indent should begin at left margin, as ***/
-/*** the require_once below looks. ***/
-/*** + All identation should consist of four space blocks ***/
-/*** + Tab characters are evil. ***/
-/*** + all comments should use "slash-star ... star-slash" ***/
-/*** style -- no pound characters, no slash-slash style ***/
-/*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/
-/*** ALWAYS USE { AND } CHARACTERS!!! ***/
-/*** + Please use ' instead of ", when possible. Note " ***/
-/*** should always be used in _( ) function calls. ***/
-/*** Thank you for your help making the SM code more readable. ***/
-/*****************************************************************/
-
require_once('../src/validate.php');
require_once('../functions/date.php');
require_once('../functions/page_header.php');
require_once('../functions/mime.php');
require_once('../src/load_prefs.php');
- $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
- sqimap_mailbox_select($imapConnection, $mailbox);
+$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+sqimap_mailbox_select($imapConnection, $mailbox);
- displayPageHeader($color, 'None');
+displayPageHeader($color, 'None');
- echo '
' .
' | ||||
vCard Version ' . $vcard_nice['version'] . - ' is not supported. Some information might not be converted ' . - "correctly. | ||||
' . + } + + $v = str_replace(';', "\n", $v); + $vcard_nice[$k] = $v; +} + +if ($vcard_nice['version'] == '2.1') { + // get firstname and lastname for sm addressbook + $vcard_nice["firstname"] = substr($vcard_nice["n"], + strpos($vcard_nice["n"], "\n") + 1, strlen($vcard_nice["n"])); + $vcard_nice["lastname"] = substr($vcard_nice["n"], 0, + strpos($vcard_nice["n"], "\n")); +} else { + echo ' | ||||
vCard Version ' . $vcard_nice['version'] . + ' is not supported. Some information might not be converted ' . + "correctly. | ||||
' . '
|
' .
'Note Field Contains: | ' .
'' .
+if (isset($vcard_nice['url'])) {
+ echo '\n";
+}
+if (isset($vcard_nice['adr'])) {
+ echo '\n";
+}
+if (isset($vcard_nice['title'])) {
+ echo '\n";
+}
+if (isset($vcard_nice['org'])) {
+ echo '\n";
+}
+if (isset($vcard_nice['title'])) {
+ echo '\n";
+}
+if (isset($vcard_nice['tel;work'])) {
+ echo '\n";
+}
+if (isset($vcard_nice['tel;home'])) {
+ echo '\n";
+}
+if (isset($vcard_nice['tel;cell'])) {
+ echo '\n";
+}
+if (isset($vcard_nice['tel;fax'])) {
+ echo '\n";
+}
+if (isset($vcard_nice['note'])) {
+ echo '\n";
+}
+echo '' .
' | ' .
'' .
+ htmlspecialchars($vcard_nice['email;internet']) . '">' .
'' .
+ $vcard_safe['firstname'] . '">' .
'' .
+ $vcard_safe['lastname'] . '">' .
'' .
+ 'VALUE="Add to Address Book">' .
' | |