vCard in QRCode?

(6 posts) (2 voices)

Tags:

  1. duane, Member

    Hi!

    I'm trying to use the QRCode generator to embed vCards. I've done it before on other sites (and not with a URL linking to a vCard file), but I can't figure out how to make it work with mydbr. My code is like:

    SELECT 'dbr.subtitle', 'vCard as QR Code'; SELECT 'dbr.qrcode'; SELECT CONCAT( "BEGIN:VCARD\n", "VERSION:4.0\n", "KIND:", "individual", "\n", "FN:", name_given, " ", name_family, "\n", "N:", name_family, ";", name_given, ";;;", "\n", "EMAIL;", "TYPE=WORK:", email, "\n", "ORG:", orgname, "\n", "TITLE:", title, "\n", "TEL:", phone, "\n", "URL;", "TYPE=LinkedIn:", linkedin, "\n", "URL;", "TYPE=Twitter:", twitter, "\n", "ADR;", "TYPE=WORK:", ";;;", city, ";;;", country, ";", "\n", "CATEGORIES:", "my-category1,my-category-2", "\n", "END:VCARD" ) AS vCard

    I've got it working for other QR codes, but can't figure it out for this one despite playing with encapsulating it in single quotes, removing the 'text' prefix/curly brackets and more.

    Any suggestions?

  2. myDBR Team, Key Master

    The QR code string is being attached as a JavaScript string. In order to pass newline to a JavaScript string you need to keep the newline character.
    Try changing the "\n" to "\\n"

    --
    myDBR Team.

  3. duane, Member

    I seem to have got it working! I had tried that and it didn't seem to work, but this time it does. Thanks for checking it for me.

  4. duane, Member

    A vCard related question (seems better to add it here than start a new thread):

    Is there a way to make an export format just text? Essentially I wish to provide a downloadable vcard format that doesn't just load the text on the screen but rather prompt so face the file. So I'd need to set the format (txt), and the filename and extension (.vcard or .vcf).

    Have I missed an existing way of doing this as the existing export formats down't include a plain text file. I've been trying the dbr.blob method with:

    SELECT 'dbr.blob', '.vcard', 'test.vcard'; SELECT vCardMulti;

    Where vCardMulti is a plain text string with multiple vCards separated by two new lines. But it produces the error:
    Warning: Cannot modify header information - headers already sent by (output started at <my path>/apps/showReport.php:9052) in <my path>/apps/showReport.php on line 5963

  5. myDBR Team, Key Master

    If you update to the latest build, you can use the following to generate a downloadable vcard from plain text. Use export type text for the export.

    select 'dbr.export.options', 'filename', 'test.vcard';
    select 'dbr.hideheader'; select "BEGIN:VCARD
    VERSION:3.0
    FN:John Doe
    N:John;Doe;D;MR;JR
    nNICKNAME:Test User
    GENDER:M
    BDAY:20140112
    ANNIVERSARY:20140112
    EMAIL;type=HOME,INTERNET:john.doe@homemail.com
    EMAIL;type=WORK,INTERNET:john.doe@workmail.com
    TEL;TYPE=CELL:312-555-1234567
    TEL;TYPE=PAGER:312-555-1234568
    TEL;TYPE=HOME,VOICE:312-555-1234569
    TEL;TYPE=WORK,VOICE:312-555-1234566
    TEL;TYPE=HOME,FAX:312-555-1234
    TEL;TYPE=WORK,FAX:312-555-1235
    LABEL;TYPE=HOME:Home Address
    ADR;TYPE=HOME:;;123 My Street;Chicago;IL;12345;United States of America
    TITLE:Test user
    ROLE:Testing
    ORG:ACME Corporation
    URL:http://johndoe
    URL;type=WORK:http://acemecompany/johndoe
    X-SOCIALPROFILE;TYPE=facebook;x-user=johndoe:https://facebook.com/johndoe
    X-SOCIALPROFILE;TYPE=skype;x-user=test_skype:x-apple:test_skype
    X-SOCIALPROFILE;TYPE=custom;x-user=johndoe:https://www.custom.com/
    END:VCARD";

    --
    myDBR Team

  6. duane, Member

    Fantastic! That works like a charm (and also means any other plain text export formats I wish to generate will as well).

    Thanks for adding this - as usual it is the best support of any tool I use and that keeps me using (and mis-using!) it.

    Cheers


Reply

You must log in to post.