Plugin Directory

Changeset 1455698


Ignore:
Timestamp:
07/16/2016 11:04:40 AM (10 years ago)
Author:
mhallmann
Message:

v0.2

Location:
sepa-girocode/trunk
Files:
441 added
2 edited

Legend:

Unmodified
Added
Removed
  • sepa-girocode/trunk/readme.txt

    r1454329 r1455698  
    1212
    1313== Installation ==
    14 1. Upload the plugin files to the `/wp-content/plugins/plugin-name` directory, or install the plugin through the WordPress plugins screen directly.
     141. Upload the plugin files to the `/wp-content/plugins/sepa-girocode` directory, or install the plugin through the WordPress plugins screen directly.
    15151. Activate the plugin through the 'Plugins' screen in WordPress.
    16161. Here you are!
     
    4444== Screenshots ==
    4545
     46
     47
    4648== Changelog ==
     49= 0.2 =
     50* Changed QR-Code-Enginge from google api to local lib (http://phpqrcode.sourceforge.net/)
    4751
    4852= 0.1 =
  • sepa-girocode/trunk/sepa-girocode.php

    r1454205 r1455698  
    9393    $url .= "chld=M|4&";
    9494    $url .= "chl=";
     95
     96    return $url . urlencode( $this->getQrPayload() );
     97}
     98
     99
     100public function getQrPayload() {
     101    $nl = chr(13) . chr(10);
    95102   
    96103    $qrdata  = "BCD" . $nl;  // Service Tag
     
    105112    $qrdata .= $this->purpose;  // remittance information unstructured
    106113
    107     return $url . urlencode($qrdata);
     114    return $qrdata;
    108115}
    109116
    110117}  // end class
    111 
    112 
    113 
    114118
    115119
     
    127131}
    128132
    129 
     133   
     134   
     135   
    130136function sepa_girocode_shortcode( $atts ) {
     137   
    131138    $sgc = new sepa_girocode_class();
    132139    $output = "";
     
    140147    }
    141148   
    142     $gurl =  $sgc->getGoogleUrl();
    143     $key =  "sgc_" . md5( $gurl );
     149    //$gurl =  $sgc->getGoogleUrl();
     150    $newvalue =  $sgc->getQrPayload();
     151    $key =  "sgc_" . md5( $newvalue );
    144152   
    145153    if ( false === ( $value = get_transient($key) ) ) {
    146         $newvalue =  base64_encode(file_get_contents($gurl));
    147154        set_transient($key, $newvalue, YEAR_IN_SECONDS);
    148155    }
     
    153160     
    154161    return $output;
    155 }
    156 
     162}   
     163   
    157164
    158165
    159166function sepa_girocode_parse_request($wp) {
    160167    // only process requests with "halli-girocode=show-code"
     168    require_once("includes/phpqrcode/qrlib.php");
    161169    if (array_key_exists('sepa-girocode', $wp->query_vars) && $wp->query_vars['sepa-girocode'] == 'show-code') {
    162         $cached_png = get_transient($wp->query_vars['key']);
    163         header('Content-Type: image/png');
    164         echo base64_decode($cached_png);
     170        QRcode::png( get_transient($wp->query_vars['key']) );
    165171    }
    166172}
     173
     174
    167175
    168176
Note: See TracChangeset for help on using the changeset viewer.