From 89a74c7137855d6abbeca9f712f12708717e7a3e Mon Sep 17 00:00:00 2001 From: Tom Slominski Date: Sun, 1 Mar 2015 21:41:26 +0000 Subject: [PATCH] Actually check if the QR code is enabled before generating it --- public/style.css | 5 +++++ result.php | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/public/style.css b/public/style.css index 408028a..2fca136 100644 --- a/public/style.css +++ b/public/style.css @@ -228,6 +228,11 @@ input[type="radio"] { color:#013F6D; } +svg#url-qr-code { + width: 50%; + height: 50%; +} + /* Footer */ .footer { text-align: center; diff --git a/result.php b/result.php index 8c3a9ba..9cb56bb 100644 --- a/result.php +++ b/result.php @@ -19,13 +19,18 @@ if ($recaptcha_json['success'] != 'true') { } // QR code shenanigans -include('public/phpqrcode/qrlib.php'); +if ( ISQ::$general['qr'] ) { -$qrContainerId = 'url-qr-code'; -$saveToFile = false; -$imageWidth = 600; // in pixels + include('public/phpqrcode/qrlib.php'); + + $qrContainerId = 'url-qr-code'; + $saveToFile = false; + $imageWidth = 600; // in pixels + + $qrCode = QRcode::svg($url, $qrContainerId, $saveToFile, QR_ECLEVEL_L, $imageWidth); + +}; -$qrCode = QRcode::svg($url, $qrContainerId, $saveToFile, QR_ECLEVEL_L, $imageWidth); ?> @@ -42,7 +47,7 @@ $qrCode = QRcode::svg($url, $qrContainerId, $saveToFile, QR_ECLEVEL_L, $imageWid -' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your link with external devices', 'isq-translation' ) . '

' . $qrCode; } ?> +' . yourls__( 'QR code', 'isq-translation' ) . '

' . yourls__( 'Share your link with external devices', 'isq-translation' ) . '

' . $qrCode; } ?>