neumannon wrote:I was able to mod the download.php file to show a qr code for downloading the file on a mobile device. It was actually quite simple using the google qr code api. When I have a chance, I will post the code with a screenshot of the result. I am a noob to php so there may have been a better way to implement but it works and I'm happy . Stay tuned...
function generateQRwithGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0')
{
$url = urlencode($url);
echo '<img src="http://chart.apis.google.com/chart?chs='.$widhtHeight.
'x'.$widhtHeight.'&cht=qr&chld='.$EC_level.'|'.$margin.
'&chl='.$chl.'" alt="QR code" widhtHeight="'.$size.
'" widhtHeight="'.$size.'"/>';
}
function currPageURL()
{
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
<?php
$urlToEncode=currPageURL();
?>
<tr><td align=left valign=top bgcolor=#F4F4F4 background="img/button03.gif\">QR Code: </td><td bgcolor=#EEF4FB background="img/button03.gif"><?php generateQRwithGoogle($urlToEncode);?></td></tr>
Return to Hacks and Modifications
Users browsing this forum: No registered users and 3 guests