E-PARLOR : Document

HomePage :: Blog :: Gallery :: Library :: Forum :: Categories :: Index
Document

QRCODEの表示

  • フリーウェアのQRCODEクラスライブラリを利用します。

関連サイト

設置について

  • クラスライブラリの下記ファイルを、OpenPNE/qrcode/ ディレクトリに設置
  • qrcode.php
  • qrcode_img.php
  • qrcode_data

qrcode.php の編集

  • データフォルダの指定
<?php
define ("QRCODE_DATA_PATH","/ここにデータフォルダの絶対バスを/qrcode_data");
/*
#
# QRcode class library for PHP4  version 0.50beta9 (C)2002-2004,Y.Swetake
#
# This version supports QRcode model2 version 1-40.
# Several functions are not supported.
#
*/
 
class Qrcode{
 
var $qrcode_error_correct;
var $qrcode_version;
 
~

表示用ファイルの作成

  • openpne_qrcode.php
<?php
$d = $_GET['d'];
$s = $_GET['s'];
//$e = $_GET['e'];
 
require("./qrcode_img.php");
 
Header("Content-type: image/png");
 
$z=new Qrcode_image;
 
/*
#$z->set_qrcode_version(1);           # set qrcode version 1
#$z->set_qrcode_error_correct("H");   # set ecc level H
#$z->set_quietzone(5);                # set quietzone width 5 modules
*/
 
$z->set_module_size(s);              # set module size
$z->qrcode_image_out($d,"jpeg");
?>

利用方法

  • 表示サンプル
  • 左から、s=1(33×33) , s=2(66×66) , s=3(99×99) , s=4(132×132) , s=5(165×165)
  • 指定方法は、
<img src="http://ドメイン名/OPENPNEDIR/qrcode/openpne_qrcode.php?s=3&d=URLを指定/">

プラグイン化

  • 設置の自由度を確保するためプラグイン化はしておりません。
  • OpenPNE内のページで動的なQRコード表示が必要がある場合、smartyプラグインにしてもいいですね。
  • OpenPNEにおける用途は、携帯版の勧誘用など。
 
openpne/qrcode.txt · 最終更新: 2006/10/05 06:36 by admin
 
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki