Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2011-04-04 05:40:38

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,251
Website

Re: smd_qr_code: embed Quick Response barcodes on your site

I used Google Charts on my site to create a graph of plugin downloads. Very easy to use.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#22 2011-04-04 21:22:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,605
Website

Re: smd_qr_code: embed Quick Response barcodes on your site

Alrighty, try v0.30. Features:

  • A complete rewrite of the API interface, slimming it down to one multi-faceted function, plus some supporting methods
  • Define your own custom data formats via the layout attribute (subject to Google’s 2KB data limit)
  • Define your own custom transformations via the transform attribute (the new prefix attribute has a supporting role here)
  • Improvements to the validate attribute so you can now copy existing regexes, plus a shortcut for validating all fields when you’ve singled out one or two for special treatment

All in all, this is a huge rewrite so although it’s largely backwards compatible I’ve bumped the major version number. Adi, you can check out the plugin docs under ‘Custom types’ for an example that you can adapt to address your requirements.

Hope this version scratches more itches for everyone. Let me know how it goes and, specificaly, if I can add any custom transforms to the core plugin that you think are everyday useful.

shayne wrote:

margin doesn’t seem to be working

Hmmm, an odd one this. I hadn’t noticed, but I did some experimenting directly via the charts API wizard and it behaves erratically there too, so it’s not the plugin misbehaving. It seems that some margin/quality/size settings render the same image and only when the margin goes up significantly (e.g. at 3, 6, 11 and so on) does the margin actually change visually. Weird. I’ve made a note in the docs, thanks for bringing it to my attention.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#23 2011-04-05 00:02:55

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,225
Website

Re: smd_qr_code: embed Quick Response barcodes on your site

Bloke wrote:

Alrighty, try v0.30.

Thanks. I’ve sent you an email …

Offline

#24 2011-04-05 08:39:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,605
Website

Re: smd_qr_code: embed Quick Response barcodes on your site

Thanks to Adi’s feedback, here’s a bug fix release v0.31

  • Fixed double quote / newline issues so that \r\n works as advertised
  • Fixed plugin warning when no plugin callbacks are defined

Much hat tipping to Adi for testing this and helping make the plugin better.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#25 2011-05-01 03:11:31

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,225
Website

Re: smd_qr_code: embed Quick Response barcodes on your site

Hi Stef,

Here’s a funny one. If I use the following:

<txp:smd_qr_code type="custom" layout="BEGIN:VCARD\r\nFN:{name}\r\nEMAIL:{email}\r\nURL:{url}\r\nTEL:{phone}\r\nEND:VCARD" data="My name | me@example.com | www.greatoceanmedia.com.au | 123456789" />

then my QR Code scanner tells me that the END:VCARD line is missing.

But if I shorten the URL, e.g.

<txp:smd_qr_code type="custom" layout="BEGIN:VCARD\r\nFN:{name}\r\nEMAIL:{email}\r\nURL:{url}\r\nTEL:{phone}\r\nEND:VCARD" data="My name | me@example.com | www.greatoceanmedia.com | 123456789" />

then I see the END:VCARD line again.

Very odd … any idea what I’m doing wrong?

Offline

#26 2011-05-01 09:15:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,605
Website

Re: smd_qr_code: embed Quick Response barcodes on your site

Very strange. Using the zxing online decoder and the online barcode reader renders the END:VCARD in both cases.

Can’t think why it would omit it using your decoder but I’d hazard a guess it’s not the plugin but something in the decoder software. I may be wrong here, but is there any way you (or anyone else?) can prove this; perhaps by using a different bit of software to scan the resulting code and see if it does the same thing? I don’t have a hardware scanner so I have to rely on the web for my testing.

Sorry I can’t offer anything more at the moment. Would be good to figure out what’s going on.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#27 2011-05-01 10:20:51

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,225
Website

Re: smd_qr_code: embed Quick Response barcodes on your site

Bloke wrote:

Can’t think why it would omit it using your decoder but I’d hazard a guess it’s not the plugin but something in the decoder software. I may be wrong here, but is there any way you (or anyone else?) can prove this; perhaps by using a different bit of software to scan the resulting code and see if it does the same thing?

Yes, I was hesitant to cast nasturtiums but I’ve just tried a different app on my iPhone (that displays the raw data) & I get the same result. Having said that they all seem to be happy that they can interpret the email address & URL OK, so I wouldn’t worry about it too much.

Here’s the (possibly) offending QR code:

Offline

#28 2011-05-01 19:29:07

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,251
Website

Re: smd_qr_code: embed Quick Response barcodes on your site

gomedia wrote:

Here’s the (possibly) offending QR code:

Works for me using Android Barcode Scanner.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#29 2011-11-25 22:03:33

net-carver
Member
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: smd_qr_code: embed Quick Response barcodes on your site

Hi Stef,

just used this in anger to add qr codes for the organisations and shops on my latest site. I’m using the standard type of ‘text’ (the default setting) and setting ‘data’ to a string representing a vCard I’ve formatted up externally via some PHP. I had to make the following change to smd_qr code get the plugin to handle this case…

--- smd_qr_code-0.31.orig 2011-11-25 21:50:30.000000000 +0000
+++ smd_qr_code-0.31.new 2011-11-25 21:50:30.000000000 +0000
@@ -23,11 +23,11 @@
 		'debug'     => 0,
 	),$atts));

 	// Default layouts
 	$layouts = array(
-		'text'     => "{text}",
+		'text'     => "{data}",
 		'link'     => "{url}",
 		'bookmark' => "MEBKM:TITLE:{title};URL:{url};;",
 		'sms'      => "SMSTO:{phone}:{text}",
 		'phone'    => "TEL:{phone}",
 		'contact'  => "MECARD:N:{name};ADR:{address};TEL:{phone};EMAIL:{email};;",

…as the plugin was complaining about ‘text’ being missing from the attributes. I also have to call smd_qr with validate=“0” or it will also complain about a missing regex for type “text”.

With those two details out of the way all seems well.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#30 2011-11-26 20:35:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,605
Website

Re: smd_qr_code: embed Quick Response barcodes on your site

net-carver wrote:

the plugin was complaining about ‘text’ being missing from the attributes.

I can’t remember now why I chose text. It’s probably in the spec. If it’s not and it should be data then I’ll of course change it.

In the meantime if you want to silence the warning you should probably also consider altering the $regexes array a few lines later. The first entry should also be 'data' (and you may have to alter the ‘sms’ layout too since it uses {text}).


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB