QR Code

20 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 28, 2011   (RSS)

By Toledoh - June 8, 2011

Hey guys,

How do I put the current page full URL into the following;

<?php echo qrCode(array(
'type' => 'url',
'url' => 'http://www.example.com/',
'size' => '100',
)); ?>


I want to place this code on a product page.
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] QR Code

By Toledoh - June 8, 2011

Also, is it possible to tie in css classes to the produced image?

ie.

<img width="100" height="100" src="http://chart.apis.google.com/chart?cht=qr&chs=100x100&chl=http%3A%2F%2Fwww.example.com%2F&chld=%7C0"> is currently the output, but I want to add class="qrCode"
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] QR Code

By Toledoh - June 9, 2011

AND...

The "type" field in the plugin examples are great, but there are other functions like maps, SMS, phone etc.

Are there ways of adding these functions?
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] QR Code

By robin - June 9, 2011

Hey Tim,

1.
Here is a simple example of how put the current page in the qr generator:
'url' => "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"],

2.
If you want a custom image tag you can use the 'mode' option. If mode is set to url, then it just returns the image url instead of an image tag.
'mode' => 'url'

3.
If there are more qr code functions you would like to see added it doesn't hurt to send us what they are maybe with some documentation.
Otherwise you can manually emulate other qr code types with the text type.

Hope that helps,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] QR Code

By Toledoh - June 9, 2011

Thanks Robin!

I've seen (ie. http://5sec-qrcodes.webfactoryltd.com/documentation) that you can have tel and sms that will call the function on your phone...

For instance, a competiton may be to "TXT "chocolate" to 1123456 for your chance to win"

The php code should be something like;
<?php echo qrCode(array( 'type' => 'sms', 'number' => 'user@example.com' )); ?>
Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] QR Code

By robin - June 10, 2011

Thanks Tim,

I'll add SMS to the to-do.

Robin
Robin
Programmer
interactivetools.com

Re: [robin] QR Code

By Toledoh - June 10, 2011

Great Robin - thanks.

Could you do tel as well? It generates a phone call the the identified number.

<?php echo qrCode(array( 'type' => 'tel', 'number' => '123456789' )); ?>
Cheers,

Tim (toledoh.com.au)

Re: [robin] QR Code

By gkornbluth - June 11, 2011 - edited: October 20, 2011

Hi Robin,

Excellent thread.

In an implementation using the QR code plugin, I’ve need to generate large QR Code images, so that my client can easily include the codes in their printed materials.

WHAT I FOUND
There's a maximum allowed value for the “size” parameter of 547 pixels. According to Google, anything over that would exceed their generator’s 300,000 pixel maximum size design parameter. (548 x 548 = 300,304)

http://code.google.com/apis/chart/image/docs/chart_params.html

A 547 px image allows for a 2.75" x 2.75", high resolution print to be created directly from the image. 200 ppi is pretty much the minimum resolution required for quality printing without too many jaggies, so this size is usually adequate for most print applications.

THE CHALLENGE
A 547 x 547 pixel image is a bit large for display as a thumbnail on a list page of QR Codes and corresponding titles/URLs.

WHAT’S NEEDED
Does anyone know a way to generate thumbnails of the larger generated QR codes that when clicked would display the full sized image for copying and download, similar to the way CMSB thumbnails work.

Thanks,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] QR Code

By Toledoh - June 11, 2011

Hi Jerry.

If I understand correctly, couldn't you simply create the full sized QR Code using the "mode" function above. Then in the HTML use height and width in the img tag to make a smaller version? then link to the full size?

Or, if you can't shrink it, use the size option to create a small version and link it to a large version?

ie. <a href="[php for big version]">[php for small version]</a>

Maybe I'm missing something?
Cheers,

Tim (toledoh.com.au)