WoltLab Cloud "PHP-QR Code" - Library 1.0.3

This extension provides the "PHP-QR Code" library in WSC.

"PHP-QR Code" - Library - de.d1strict.wsc.plugin.chillerlan.php-qrcode

This extension provides the "PHP-QR Code" library in WSC.


To load the library, you can use the following code:

PHP
require_once WCF_DIR.'lib/system/api/php-qrcode/vendor/autoload.php';


More information & the documentation can be found in the corresponding GitHub repository: https://github.com/chillerlan/php-qrcode

Bugs & Support:

Support is provided only via:

  • Felix | D1strict Entwickelst du das Paket aktiv weiter?

    • Hallo,

      ja, das Paket wird noch weiter entwickelt.


      Sorry für die späte Antwort btw., aktuell viel um die Ohren gehabt.


      Viele Grüße,

      Felix

      Like 1
  • Guten Tag,


    kann man das auf einer eigenen Seite mit PHP Code benutzen?

    Ich habe das Plugin PHP-Code für Seiten installiert und dort dis einegtragen:


    PHP
    <?php
    require_once WCF_DIR.'lib/system/api/php-qrcode/autoload.php';
    $data = 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net';
    ?>

    Muss ich die URL anpassen und wie kann ich das ganze mit {@$page->getPhpContent()} im template ausgeben?

    • Hallo,


      du kannst folgenden Code verwenden:

      PHP
      <?php
      namespace chillerlan\QRCode;
      use chillerlan\QRCode\QRCode;
      require_once WCF_DIR.'lib/system/api/php-qrcode/autoload.php';
      
      $data = 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net';
      
      echo '<img src="'.(new QRCode)->render($data).'" alt="QR Code" />';


      Beachte aber, dass die aktuelle Version PHP 8.* nicht unterstützt. Ein Update ist aber schon eingereicht. Dann ändert sich der Code leicht:


      PHP
      <?php
      namespace chillerlan\QRCode;
      use chillerlan\QRCode\QRCode;
      require_once WCF_DIR.'lib/system/api/php-qrcode/vendor/autoload.php';
      
      $data = 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net';
      
      echo '<img src="'.(new QRCode)->render($data).'" alt="QR Code" />';


      Vielen Dank & herzliche Grüße,

      Felix

    • Vielen Dank, dass klappt hervorragend!

      Like 1
    • Darf ich dich einmal stören und hier einladen: RE: Eigene Seite mit einem Generator um Eingaben vorgefertigt auszuliefern ?

      Der Code hier alleine funktioniert hervorragend, aber sobald ich das hier dabei nutzen möchte

      Code
      use wcf\system\WCF;
      WCF::getTPL()->assign('qrcode', $getqr);

      funktioniert die Ausgabe nicht mehr.


      Danke für deine Hilfe.

      OK 1