Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QRCodes
Author Message
n00dles101 Offline
Administrator

Posts: 971
Joined: Aug 2009
2012-06-26 01:51:17
QRCodes
A small script that uses Google Chart API to generate QRCodes for your site pages.

Copy the following script to your themes 'functions.php'

Code:
function google_qr($url,$size ='150',$EC_level='L',$margin='0') {
    $url = urlencode($url);
    echo '<img src="https://chart.googleapis.com/chart?chs='.$size.'x'.$size.'&cht=qr&chld='.$EC_level.'|'.$margin.'&chl='.$url.'" alt="QR code" width="'.$size.'" height="'.$size.'"/>';
}


to use just call it like so in your theme:

Code:
google_qr(url);

// other options are:
// google_qr(url, size, ECLevel, margin);
// url is the URL for your QRCode
// size, size in pixels for image
// ECLevel, Error Correction Level
// margin, margin around image

See it in action here: http://www.digimute.com

My Github Repos: Github
Website: DigiMute
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)

Generate Leads from Documents vCard Hosting