Use QR Code plugin to create vcards as a QR Code

3 posts by 3 authors in: Forums > CMS Builder
Last Post: October 11, 2013   (RSS)

By Mikey - August 17, 2013

I'm trying to create a vcard powered by the QR Code plugin, but can seem to get this figured out and I'm not even sure if it's possible to make this work. Below is my code I've got worked up so far. Anyone have any suggestions on how to get this working?

<?php
  // load viewer library
  $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
  $dirsToCheck = array('','../','../../','../../../', '../../../../', '../../../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
?>
<?php
  echo qrCode(array(
    'type'                            =>'BEGIN:VCARD',
    'VERSION:3.0',
    'N:Firstname;Lastname;Surname'    => $memberRecord['first_name'] . "," . $memberRecord['last_name'] . "," . $memberRecord['surname'],
    'FN:Displayname'                => $memberRecord['first_name'] . "," . $memberRecord['last_name'],
    'ORG:'                            => $memberRecord['business_name'],
    'TITLE:'                        => $memberRecord['business_title'],
    'ROLE:'                            => $memberRecord['business_category'],
    'URL:'                            => urlencode(thisPageUrl()),
    'EMAIL:'                        => $memberRecord['email'],
    'TEL;TYPE=work'                    => $memberRecord['phone'],
    'TEL;TYPE=cell'                    => $memberRecord['mobile_phone'],
    'TEL;TYPE=fax'                    => $memberRecord['fax'],
    'ADR;TYPE=work:'                => $memberRecord['work_address'],
    'ADR;TYPE=postal:'                => $memberRecord['po_box_address'],
    'GEO:'                            => $memberRecord['latitude'] . "," . $memberRecord['Longitude'],
    'BDAY:'                            => $memberRecord['birth_day'],
    'END:VCARD'
  ));
?>

Thanks, Zick

By Dave - October 11, 2013

Hi Guys,

We've been getting a few spam posts on this thread so I'm going to lock it.  Just post a new thread if you need anything.

Cheers!

Dave Edis - Senior Developer
interactivetools.com