QR Code

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

By gkornbluth - June 20, 2011

Hi Robin,

Any way to name the generated QR Code files based on a "title" field in the requesting record instead of them all being called chart.png?

One of my clients has already gotten confused and put the wrong codes in the wrong places.

(Hope I didn't just overlook this in the documentation)

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 robin - June 21, 2011

Hey Jerry,

The google api that the chart generator uses always names the images as "chart.png". Without resorting to something fancy like using jquery to rename the images after the fact I think you're stuck with chart.png.

Robin
Robin
Programmer
interactivetools.com

By gkornbluth - June 21, 2011

Hi Robin,

What do you think it would take to solve this issue using Jquery?

I think this naming thing could be a real stumbling block as QR codes become more widely used.

Thanks,

Jerry
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 robin - June 22, 2011

Hey Jerry,

This method might help:
http://api.jquery.com/attr/

I wonder - why does your client care about the file name? Are they generating them just to save the image to use elsewhere?

Thanks,
Robin
Robin
Programmer
interactivetools.com

By gkornbluth - June 22, 2011

Hi Robin,

Appreciate your looking into this.

We're generating a list of QR codes for a potentially long series of records, and then copying individual codes from that list into documents for various print media campaigns.

A few codes are easy to keep track of and even manually rename, but if one gets out of place in a longer list, it's near impossible to sort them out.

I hate to admit it, but I’ve stared at the http://api.jquery.com/attr/ docs for quite a while, and I still haven’t a clue how to implement it in the following, to change the file names of the generated QR codes from chart.png to <?php echo$record['title'] ?>.png:

Thanks for any help you can offer,

Jerry

<table border="0">
<tr>
<td align="center"><hr /></td>
</tr>
<?php foreach ($my_list_Records as $record): ?>
<?php $num = $record['num'] ?>
<tr>
<td align="center">
<?php echo strtoupper($record['title']) ?>
</td>
</tr>
<tr>
<td align="center" valign="top">
<!--Show QR code with title and record number-->
<?php
echo qrCode(array(
'type' => 'url',
'size' => '547', // thumbnail height & width in pixels
'url' => 'http://www.mysite.com/my_detail.php?' . $num
));
?>
<br />
<br />
URL to the target for this record: http://www.mysite.com/my_detail.php?<?php echo $num ?>
<hr />
</td>
</tr>
<?php endforeach ?>
</table>
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 24, 2011

Hey Guys.

QR Codes are great, as they can hold a lot of data. However, the more data they hold, the more complex they become. The less data, the faster the response is, especially with smart-phone apps.

There's a plethora of URL shortening such as http://goo.gl/

I've attached a sample image. It's of 2 QR codes pointing to the same address - one of the full URL, one of a shortened URL. The difference is quite dramatic.

So... is there the ability to automatically shorten URL's and use that shortened URL to generate the QR Code?
Cheers,

Tim (toledoh.com.au)
Attachments:

sample.png 3K

Re: [Toledoh] QR Code

By gkornbluth - June 24, 2011 - edited: June 24, 2011

Hi Tim,

Interesting that you should bring that up.

I'm exploring the same question right now.

Here are s few things that I found so far (I haven"t got a clue how to use them, but they may give someone an idea or two)

http://www.mdj.us/snews-cms/hacks-mods/automatically-add-autogenerated-short-urls-to-your-snews-cms/ a now defunct sourceforge project http://lilurl.sourceforge.net/,

and then do a Google search for open source short url generator.

I'll post what else I find and hope you'll do the same.

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 28, 2011

Re: [Toledoh] QR Code

By Toledoh - June 28, 2011

Hi All,

Would someone with more knowledge than myself be able to incorproate this into the QRCode plugin? Or should it be a plugin by itself?

http://www.phpriot.com/articles/google-url-shorening-api

Each install of the plugin would then require an API Key... but they are free.
Cheers,

Tim (toledoh.com.au)