'', // user can specify a separate URL ), $atts)); // declare and specify the variables // if a separate url is not specified, the url is the content of the shortcode enclosed in [qr] [/qr] if (empty($url)){$url = $content;} // not sure what this does exactly, either. it obviously has something to do with the language pack(s) $theqrcode = new qrgenerator(); // calls the main function that will return an Android Market QR code if (strlen ($url) > 4){ return $theqrcode->create_qr_code($url);} } // if the current wordpress version supports shortcodes, register the shortcode: // the name of the shortcode used in wordpress, and the name of the function that handles it if ( !function_exists('add_shortcode') ) return; add_shortcode('qr', 'qr_creator'); // "init" is the name of the WordPress action we want this plug-in to hook onto, and it // runs after WordPress has finished loading - but before any headers are sent. // the second value should be the name of the function we want to add, i.e. our own main plug-in function, but // I had to create a function based on the class in order for it to work. add_action( 'init', create_function( '', 'global $QRc; $QRc = new qrgenerator();' ) ); // a lot of settings bullshit (had a terrible time coding it since the WordPress documentation for it sucked: // it was just a complete mess of different and sometimes downright incorrect instructions // if the user has the proper rights if ( is_admin() ){ // add options menu in WordPress, and call the function that registers the settings add_action('admin_menu', 'qr_plugin_menu'); // ad an options page and register settings function qr_plugin_menu() { add_options_page('Android Market QR Codes Options', 'Android Market QR Codes', 'manage_options', 'android-qr-codes', 'qr_plugin_options'); register_setting( 'qr-code-options', 'qrcalign' ); register_setting( 'qr-code-options', 'qrcsize' ); register_setting( 'qr-code-options', 'qrcborderc' ); register_setting( 'qr-code-options', 'qrctitle' ); register_setting( 'qr-code-options', 'qrcandroidimg' ); } // the function that shows the actual settings function qr_plugin_options() { if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } // we don't want PHP now unless we need to ?>

Android Market QR Codes Options

Settings

QR code alignment. Either "left", "right", "top" or "bottom" (without quotation marks). Leave blank for no alignment.
QR code size in pixels. Must be a square, for example: 150x150
QR code border. For no border, leave blank. It must be a valid single line CSS value, for example: 1px solid #dedcdc
QR code title. The text that is shown when you hover over the QR codes with a mouse cursor.
Download icon for Android devices. If you want a custom icon to be displayed on Android devices instead of a QR code, enter the full URL to that image here. All other options except title and alignment will be ignored for that image.

How to use the plugin

This plugin automatically creates clickable QR codes that point to apps in the Android Market.

To use it, simply surround any link to an app in the Android Web Market or AppBrain.com with [qr] [/qr].
Put the link in the page or post where you want it to appear. That's it! Example:
[qr]https://market.android.com/details?id=com.halfbrick.fruitninja[/qr]

For more information, please visit the Android Market QR Code Plugin page at TechCredo.com
Please report comments, suggestions and any possible issues at the plugin page above. Thanks!