QR Code

Any hacks and modifications will be in here...

Re: QR Code

Postby SamEA » Sat Nov 12, 2011 7:17 am

Excellent, well done Neumannon. I will look into this when I have the time and possibly implement this into future DFH releases.
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

Re: QR Code

Postby neumannon » Sat Nov 12, 2011 10:58 pm

Thanks! I'm glad you liked the mod.
neumannon
Standard Member
 
Posts: 9
Joined: Thu Nov 03, 2011 1:29 pm

Re: QR Code

Postby bosanci28 » Sun Nov 27, 2011 8:28 am

nice,so this works for mobile phones i guess only?
thanks
bosanci28
Newbie Member
 
Posts: 3
Joined: Tue Mar 22, 2011 5:38 am

Re: QR Code

Postby neumannon » Sun Nov 27, 2011 1:59 pm

It will work for any device that has an app and camera for scanning qr codes. It is mainly intented for mobile devices (android, iPhone, ipad, etc).
neumannon
Standard Member
 
Posts: 9
Joined: Thu Nov 03, 2011 1:29 pm

Re: QR Code

Postby bosanci28 » Sun Nov 27, 2011 11:45 pm

thank you.
bosanci28
Newbie Member
 
Posts: 3
Joined: Tue Mar 22, 2011 5:38 am

Re: QR Code

Postby DrInternet » Sun Feb 05, 2012 5:08 am

neumannon wrote:Alright! I am testing the image upload feature of the site. For some reason when I tried uploading a png file, it said the file wasn't allowed even though png is in the list of allowed image formats. Must not have support for png images yet. No biggie though. I just removed .png as a possible image format for upload. I was able to get the jpg screenshot uploaded.

So here is the download.php screenshot modded for qr code...
Image

I added the below code to the [root]/download.php file. There are various parameters for the google function which can be adjusted. I left the defaults alone and seems to work well. There may be an easier way to get the current URL for encoding but that was the one I was able to find.
Code: Select all
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;
}


Then I added this line to [root]/styles/Indigo/download.php at the bottom of the table. Of course it can be put anywhere on the page.
Code: Select all
<?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>


I hope that helps out anyone interested in doing the same thing. If there is an easier/simpler way to do any of this, please let me know and I'll make the change.

And this was done on the 1.2.3 DFH release.



hello neumannon

where to i put the code function generateQRwithGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0')
{ ......
thanks
DrInternet
Newbie Member
 
Posts: 1
Joined: Sun Feb 05, 2012 4:18 am

Re: QR Code

Postby Webmasterxl » Sun Feb 12, 2012 6:27 am

Does this work in 2.0.1 release? get error when I implemented? Or did something wrong? Thanks!
Webmasterxl
Premium
 
Posts: 4
Joined: Sun Feb 12, 2012 2:01 am

Re: QR Code

Postby SamEA » Sun Feb 12, 2012 4:00 pm

If the MOD works on v1.2.X, it should work on v2 without any problems.
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

Re: QR Code

Postby X-disturbed-x » Tue Mar 13, 2012 7:18 pm

Can anybody be so nice and tell me where at the download php files i have to put the two code snippets?
X-disturbed-x
Newbie Member
 
Posts: 4
Joined: Mon Mar 12, 2012 10:53 pm

Re: QR Code

Postby SamEA » Tue Mar 13, 2012 9:52 pm

Follow the instructions listed in this topic at: viewtopic.php?f=9&t=347&p=1373#p1373
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

PreviousNext

Return to Hacks and Modifications

Who is online

Users browsing this forum: No registered users and 2 guests

cron