NAVIGATION
This shows you the differences between two versions of the page.
|
deutsch:ersetzer_rts:frontend_render:qr-code [2012/04/16 12:41] Knut Heermann (flip-flop) |
deutsch:ersetzer_rts:frontend_render:qr-code [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 25: | Line 25: | ||
| **Version:** V1.0 \\ | **Version:** V1.0 \\ | ||
| - | TAG: **{OR_CODE[][xxx]}**, wobei **xxx** die Kantenlänge des Bildes angibt z.B. **{OR_CODE}** oder **{QR_CODE 200}** oder **{QR_CODE175}** \\ | + | TAG: **{QR_CODE[][xxx]}**, wobei **xxx** die Kantenlänge des Bildes angibt z.B. **{QR_CODE}** oder **{QR_CODE 200}** oder **{QR_CODE175}** \\ |
| Dateiname: **rt_qr_code.php** | Dateiname: **rt_qr_code.php** | ||
| Line 92: | Line 92: | ||
| } | } | ||
| ?> | ?> | ||
| + | </code> | ||
| + | |||
| + | ==== Neu seit 2015 ==== | ||
| + | |||
| + | <code php |h rt_qr_code.php |h > | ||
| + | <?php | ||
| + | // ---------------------------------------------------------------- | ||
| + | // simple current url qr-code generator | ||
| + | // TAG {QR_CODE}, {QR_CODE 200}, {QR_CODE175} | ||
| + | // e.g. 200 or 175 are the dimensions of the image | ||
| + | // | ||
| + | // OG (Oliver Georgi): 16.02.2012 | ||
| + | // ---------------------------------------------------------------- | ||
| + | |||
| + | // ---------------------------------------------------------------- | ||
| + | // obligate check for phpwcms constants | ||
| + | if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");} | ||
| + | // ---------------------------------------------------------------- | ||
| + | |||
| + | if(preg_match('/\{QR_CODE(.*?)\}/', $content['all'], $qr_code)) { | ||
| + | |||
| + | $qr_code['size'] = abs(intval(trim($qr_code[1]))); | ||
| + | |||
| + | if(empty($qr_code['size'])) { | ||
| + | $qr_code['size'] = 150; // default size | ||
| + | } | ||
| + | |||
| + | $qr_code['url'] = rawurlencode( abs_url(array(),array(),'','') ); | ||
| + | |||
| + | $content['all'] = str_replace( | ||
| + | $qr_code[0], | ||
| + | '<img src="https://chart.googleapis.com/chart?chs='.$qr_code['size'].'x'.$qr_code['size'].'&cht=qr&chl='.$qr_code['url'].'" />', | ||
| + | $content['all'] | ||
| + | ); | ||
| + | |||
| + | } | ||
| + | ?> | ||
| </code> | </code> | ||
| \\ | \\ | ||