Adding a FAX field, or other simple field, to QR Code Generator Plugin
5 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: January 30, 2012 (RSS)
By Codee - January 30, 2012
Re: [equinox69] Adding a FAX field, or other simple field, to QR Code Generator Plugin
By (Deleted User) - January 30, 2012
The QR generator for contact details uses the MECARD standard which only defines one phone number. It can have more than one phone number added but it doesn't store the difference between numbers (ie work and fax would both come up as 'tel') and so the software reading the QR code would (hopefully!) ask to define which number goes where.
If you want to add an extra field then you can edit the plugin code directly to capture and then output the extra field (just rename the plugin 'QRCodeGeneratorCustom' so that it doesn't get overwritten if you upgrade).
Hope this helps,
Tom
Re: [Tom P] Adding a FAX field, or other simple field, to QR Code Generator Plugin
By Codee - January 30, 2012
Re: [equinox69] Adding a FAX field, or other simple field, to QR Code Generator Plugin
By (Deleted User) - January 30, 2012
My guess is that you have this line (49 in the r1.00):
elseif ($type == 'contact') { $data = 'MECARD:N:' . $options['lastName'] . "," . $options['firstName'] . ";ADR:" . $options['address'] . ";TEL:" . $options['phone'] . ";FAX:" . $options['fax'] . ";EMAIL:" . $options['email'] . ";;"; }
With the variable "FAX:" set to the fax number.
I forgot to mention that when calling the MECARD api, all telephone numbers are listed as TEL, so this version:
elseif ($type == 'contact') { $data = 'MECARD:N:' . $options['lastName'] . "," . $options['firstName'] . ";ADR:" . $options['address'] . ";TEL:" . $options['phone'] . ";TEL:" . $options['fax'] . ";EMAIL:" . $options['email'] . ";;"; }
should work
You'll also need to update the error checking on line 89:
'contact' => array('type', 'size', 'margin', 'mode', 'lastName', 'firstName', 'address', 'phone','fax', 'email'),
Hope this helps,
Tom
Re: [Tom P] Adding a FAX field, or other simple field, to QR Code Generator Plugin
By Codee - January 30, 2012