This module generates version 4.0 vCards from Drupal 7 user profile information.
It provides an admin page where mappings from Drupal's own user data
to vCard entries can be defined to control what data is output to the vcard.
A vcard for any registered user can then be obtained programmatically using the
vcardmap_getvcard() function.
Obvious uses are to export user data in vCard format to be used for all the
things a vCard is intended for.
Once installed, access /admin/settings/vcardmap to configure the way that
your user's data is mapped to the vCard fields.
Typically, to make this module useful, you will first need to add some suitable
profile fields - address, phone nunmbers etc. - for your users to fill in. This
module doesnt do that. You can call them anything you like and this module's
admin page will find them and map them.
Once you have the necessary profile fields and a mapping set up for them,
a vCard for any registered user can then be obtained using the
vcardmap_getvcard($account) function, which takes a user account as a
parameter and returns a vCard for that user.
In your code,
global $user;
$vcardstring = vcardmap_getvcard($user);
Will get you a string like this:
BEGIN:VCARD
VERSION:4.0
BDAY:19320910
ORG;work:Unified Technology Ltd
TEL;work,voice:0161 881 5225