YOURLS version 1.8.2 is available. Please update!
Plugin: Success: U-SRV is installed and enabled.
srv.php
satus: srv.php is not in the "pages" directory!
QR Codes will automatically appear in the share box and stats pages. You can expand on this and place the codes on your custom pages, or even call them remotely.
You can use a simple GET request to retrieve a code from U-SRV at the following address:
http://www.dvsvri.gov.my/form/srv/
With the following parameters:
U-SRV uses this id to know where to look for the actual QRCode images. This should always be the same.
A key is valid for, at most, one minute, and is determined by hashing a unique timestamp concatenated with the ID. The following PHP produces a valid key:
$now = round(time()/60); $key = md5($now . 'iqrcodes');
Which gives the following live value:
38137d792eb7458db3ea85f701d27ba3
The file name, determined by hashing the short url and prepending that with 'qrc_', can be accomplished with the follwoing PHP:
$fn = 'qrc_' . md5(http://www.dvsvri.gov.my/form/$var) . '.png';
If $var = 'V', the filename is:
qrc_5de99b8f81fd8f80b6c797947fab02a0.png
.
In the context of a PHP file, the following code will utilize the values from above and fetch a QR Code:
<img src="http://www.dvsvri.gov.my/form/srv/?id=iqrcodes&key=$key&fn=$fn" />
QR Codes can be called locally via IQRCodes's javascript functions. Try putting something like the following in your public index.php file. This would be at line 67 in the sample-public-front-page.txt
file in the YOURLS root:
<?php if (isset($return['qrcimg'])) echo $return['qrcimg']; ?>
Or try the following example:
<img src="<?php if (isset($return['qrcimg'])) echo $return['qrcimg']; ?>" alt="QRCode">