55 lines
1.6 KiB
Plaintext
55 lines
1.6 KiB
Plaintext
<%@language = "javascript" %>
|
|
<% /*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: shared/qrcode.asp
|
|
Parameters:
|
|
text De text
|
|
-- optioneel --
|
|
version -1 is auto of 1-40
|
|
autoextend 1 is ja, 0 is nee
|
|
level error level 0=7%, 1=15%, 2=25%, 3=30%
|
|
masking masking algoritme -1 is auto of 0 to 7
|
|
size pixels/module, default 8
|
|
*/ %>
|
|
|
|
<%
|
|
DOCTYPE_Disable = true;
|
|
if (getQParamInt("nocache", 0) != 1) {
|
|
var FCLTEXPIRES = 8*60; // 8 uur kan al flink schelen
|
|
}
|
|
%>
|
|
<!-- #include file="../Shared/common.inc" -->
|
|
<%
|
|
var xc = Server.CreateObject("SLNKDWF.QRCode");
|
|
var proto = (Request.ServerVariables("SERVER_PORT") == "443")?"https":"http";
|
|
var sitenoroot = proto + "://" + Request.ServerVariables("SERVER_NAME");
|
|
var site = sitenoroot + rooturl;
|
|
// url must start with forward slash (/)
|
|
xc.text = getQParam("text");
|
|
if (xc.text.charAt(0) == "\/")
|
|
{
|
|
xc.text = site + xc.text;
|
|
}
|
|
else if (xc.text.indexOf(".") > -1)
|
|
{
|
|
INTERNAL_ERROR_PARAMETER_text_IS_BAD;
|
|
}
|
|
|
|
xc.Version = getQParamInt("version", -1);
|
|
xc.Autoextend = getQParamInt("autoextend", 1)==1;
|
|
xc.Level = getQParamInt("level", 1);
|
|
xc.Masking = getQParamInt("masking", -1);
|
|
xc.Size = getQParamInt("size", 8);
|
|
xc.Color = getQParamInt("color", S("qr_color"));
|
|
//xc.Logo = getQParamInt("logo", "FACILITOR");
|
|
//xc.LogoSize = getQParamInt("logosize", 0);
|
|
|
|
// unsafe Response.AddHeader("QRCode",xc.Text);
|
|
|
|
Response.clear;
|
|
Response.contenttype = "image/png";
|
|
Response.BinaryWrite(xc.GetAsPNG());
|
|
%><% ASPPAGE_END(); %>
|