Commit dec31de1b848ef80338d4f884bb762e25a9e3b4e
1 parent
2f892e51
Exists in
master
and in
7 other branches
Inclusão de qrcode nos links da página inicial
Showing
2 changed files
with
21 additions
and
17 deletions
Show diff stats
init/index.php
| ... | ... | @@ -233,7 +233,7 @@ include "head.php"; |
| 233 | 233 | placement: "auto", |
| 234 | 234 | trigger: "click focus", |
| 235 | 235 | content: function(){ |
| 236 | - var urlqr = "../pacotes/qrcode/php/qr_img.php?host=" + window.location.host + "&d=" + $(this).attr("data-url"); | |
| 236 | + var urlqr = "../pacotes/qrcode/php/qr_img.php?host=" + window.location.host + "&u=" + $(this).attr("data-url"); | |
| 237 | 237 | return "<img style='width:200px; height: 200px;' src='" + urlqr + "' '>"; |
| 238 | 238 | } |
| 239 | 239 | }); | ... | ... |
pacotes/qrcode/php/qr_img.php
| ... | ... | @@ -4,8 +4,8 @@ |
| 4 | 4 | # QRcode image PHP scripts version 0.50g (C)2000-2005,Y.Swetake |
| 5 | 5 | # |
| 6 | 6 | # |
| 7 | -# This program outputs a png image of "QRcode model 2". | |
| 8 | -# You cannot use a several functions of QRcode in this version. | |
| 7 | +# This program outputs a png image of "QRcode model 2". | |
| 8 | +# You cannot use a several functions of QRcode in this version. | |
| 9 | 9 | # See README.txt . |
| 10 | 10 | # |
| 11 | 11 | # This version supports QRcode model2 version 1-40. |
| ... | ... | @@ -38,9 +38,9 @@ |
| 38 | 38 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 39 | 39 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 40 | 40 | # IN NO EVENT SHALL Y.Swetake OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| 41 | -# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 41 | +# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 42 | 42 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 43 | -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
| 43 | +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
| 44 | 44 | # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 45 | 45 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
| 46 | 46 | # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| ... | ... | @@ -67,12 +67,16 @@ if($_GET["host"] != $_SERVER["HTTP_HOST"]){ |
| 67 | 67 | $path="./../data"; /* You must set path to data files. */ |
| 68 | 68 | $image_path="./../image"; /* You must set path to QRcode frame images. */ |
| 69 | 69 | |
| 70 | -$version_ul=40; /* upper limit for version */ | |
| 70 | +$version_ul=40; /* upper limit for version */ | |
| 71 | 71 | /* ------ setting area end ------ */ |
| 72 | 72 | |
| 73 | - | |
| 74 | -$qrcode_data_string=@$_GET["d"]; | |
| 75 | -$qrcode_data_string .= "&temasa=".$_GET["temasa"]."&layers=".$_GET["layers"]; | |
| 73 | +if($_GET["d"]){ | |
| 74 | + $qrcode_data_string=@$_GET["d"]; | |
| 75 | + $qrcode_data_string .= "&temasa=".$_GET["temasa"]."&layers=".$_GET["layers"]; | |
| 76 | +} | |
| 77 | +if($_GET["u"]){ | |
| 78 | + $qrcode_data_string=@$_GET["u"]; | |
| 79 | +} | |
| 76 | 80 | $qrcode_error_correct=@$_GET["e"]; |
| 77 | 81 | $qrcode_module_size=@$_GET["s"]; |
| 78 | 82 | $qrcode_version=@$_GET["v"]; |
| ... | ... | @@ -251,7 +255,7 @@ $ecc_character_hash=array("L"=>"1", |
| 251 | 255 | "H"=>"2", |
| 252 | 256 | "h"=>"2"); |
| 253 | 257 | |
| 254 | - $ec=@$ecc_character_hash[$qrcode_error_correct]; | |
| 258 | + $ec=@$ecc_character_hash[$qrcode_error_correct]; | |
| 255 | 259 | |
| 256 | 260 | if (!$ec){$ec=0;} |
| 257 | 261 | |
| ... | ... | @@ -283,7 +287,7 @@ if (!$qrcode_version){ |
| 283 | 287 | /* #--- auto version select */ |
| 284 | 288 | $i=1+40*$ec; |
| 285 | 289 | $j=$i+39; |
| 286 | - $qrcode_version=1; | |
| 290 | + $qrcode_version=1; | |
| 287 | 291 | while ($i<=$j){ |
| 288 | 292 | if (($max_data_bits_array[$i])>=$total_data_bits+$codeword_num_plus[$qrcode_version] ){ |
| 289 | 293 | $max_data_bits=$max_data_bits_array[$i]; |
| ... | ... | @@ -380,7 +384,7 @@ while ($i<=$data_counter) { |
| 380 | 384 | |
| 381 | 385 | $flag=1; |
| 382 | 386 | while ($flag) { |
| 383 | - if ($remaining_bits>$buffer_bits){ | |
| 387 | + if ($remaining_bits>$buffer_bits){ | |
| 384 | 388 | $codewords[$codewords_counter]=((@$codewords[$codewords_counter]<<$buffer_bits) | $buffer); |
| 385 | 389 | $remaining_bits-=$buffer_bits; |
| 386 | 390 | $flag=0; |
| ... | ... | @@ -392,7 +396,7 @@ while ($i<=$data_counter) { |
| 392 | 396 | $flag=0; |
| 393 | 397 | } else { |
| 394 | 398 | $buffer= ($buffer & ((1 << $buffer_bits)-1) ); |
| 395 | - $flag=1; | |
| 399 | + $flag=1; | |
| 396 | 400 | } |
| 397 | 401 | |
| 398 | 402 | $codewords_counter++; |
| ... | ... | @@ -503,7 +507,7 @@ while ($i<$max_codewords){ |
| 503 | 507 | $j=8; |
| 504 | 508 | while ($j>=1){ |
| 505 | 509 | $codeword_bits_number=($i << 3) + $j; |
| 506 | - $matrix_content[ $matrix_x_array[$codeword_bits_number] ][ $matrix_y_array[$codeword_bits_number] ]=((255*($codeword_i & 1)) ^ $mask_array[$codeword_bits_number] ); | |
| 510 | + $matrix_content[ $matrix_x_array[$codeword_bits_number] ][ $matrix_y_array[$codeword_bits_number] ]=((255*($codeword_i & 1)) ^ $mask_array[$codeword_bits_number] ); | |
| 507 | 511 | $codeword_i= $codeword_i >> 1; |
| 508 | 512 | $j--; |
| 509 | 513 | } |
| ... | ... | @@ -533,7 +537,7 @@ $min_demerit_score=0; |
| 533 | 537 | $k++; |
| 534 | 538 | } |
| 535 | 539 | $i=0; |
| 536 | -$all_matrix=$max_modules_1side * $max_modules_1side; | |
| 540 | +$all_matrix=$max_modules_1side * $max_modules_1side; | |
| 537 | 541 | while ($i<8){ |
| 538 | 542 | $demerit_n1=0; |
| 539 | 543 | $ptn_temp=array(); |
| ... | ... | @@ -574,7 +578,7 @@ while ($i<8){ |
| 574 | 578 | $demerit_n2+=(strlen($str_temp)-1); |
| 575 | 579 | } |
| 576 | 580 | $demerit_n2*=3; |
| 577 | - | |
| 581 | + | |
| 578 | 582 | $ptn_temp=array(); |
| 579 | 583 | |
| 580 | 584 | preg_match_all($n1_search,$hor,$ptn_temp); |
| ... | ... | @@ -638,7 +642,7 @@ while ($i<$mxe){ |
| 638 | 642 | $jj=0; |
| 639 | 643 | while ($j<$mxe){ |
| 640 | 644 | if ($matrix_content[$ii][$jj] & $mask_content){ |
| 641 | - ImageSetPixel($base_image,$i,$j,$col[1]); | |
| 645 | + ImageSetPixel($base_image,$i,$j,$col[1]); | |
| 642 | 646 | } |
| 643 | 647 | $j++; |
| 644 | 648 | $jj++; | ... | ... |