@@ -76,6 +76,12 @@ discard block |
||
| 76 | 76 | // prepare EMail-From |
| 77 | 77 | $emailheaders = 'From: "' . $emailaddr . '" <' . $emailaddr . '>'; |
| 78 | 78 | |
| 79 | +/** |
|
| 80 | + * @param string $module |
|
| 81 | + * @param integer $eventid |
|
| 82 | + * @param integer $objectid2 |
|
| 83 | + * @param string $logtext |
|
| 84 | + */ |
|
| 79 | 85 | function logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details) |
| 80 | 86 | { |
| 81 | 87 | sql( |
@@ -148,6 +154,9 @@ discard block |
||
| 148 | 154 | return $start; |
| 149 | 155 | } |
| 150 | 156 | |
| 157 | +/** |
|
| 158 | + * @return string |
|
| 159 | + */ |
|
| 151 | 160 | function escape_javascript($text) |
| 152 | 161 | { |
| 153 | 162 | return str_replace('\'', '\\\'', str_replace('"', '"', $text)); |
@@ -159,6 +168,9 @@ discard block |
||
| 159 | 168 | sql_error(); |
| 160 | 169 | } |
| 161 | 170 | |
| 171 | +/** |
|
| 172 | + * @param string $sql |
|
| 173 | + */ |
|
| 162 | 174 | function sqlValue($sql, $default) |
| 163 | 175 | { |
| 164 | 176 | $rs = sql($sql); |
@@ -187,11 +199,21 @@ discard block |
||
| 187 | 199 | } |
| 188 | 200 | } |
| 189 | 201 | |
| 202 | +/** |
|
| 203 | + * @param string $name |
|
| 204 | + * @param string $default |
|
| 205 | + * |
|
| 206 | + * @return string |
|
| 207 | + */ |
|
| 190 | 208 | function getSysConfig($name, $default) |
| 191 | 209 | { |
| 192 | 210 | return sqlValue('SELECT `value` FROM `sysconfig` WHERE `name`=\'' . sql_escape($name) . '\'', $default); |
| 193 | 211 | } |
| 194 | 212 | |
| 213 | +/** |
|
| 214 | + * @param string $name |
|
| 215 | + * @param string $value |
|
| 216 | + */ |
|
| 195 | 217 | function setSysConfig($name, $value) |
| 196 | 218 | { |
| 197 | 219 | if (sqlValue('SELECT COUNT(*) FROM sysconfig WHERE name=\'' . sql_escape($name) . '\'', 0) == 1) { |
@@ -516,6 +538,9 @@ discard block |
||
| 516 | 538 | die('sql_error'); |
| 517 | 539 | } |
| 518 | 540 | |
| 541 | +/** |
|
| 542 | + * @param string $warnmessage |
|
| 543 | + */ |
|
| 519 | 544 | function sql_warn($warnmessage) |
| 520 | 545 | { |
| 521 | 546 | global $sql_errormail; |
@@ -549,6 +574,9 @@ discard block |
||
| 549 | 574 | return mysql_fetch_row($rs); |
| 550 | 575 | } |
| 551 | 576 | |
| 577 | +/** |
|
| 578 | + * @param resource $rs |
|
| 579 | + */ |
|
| 552 | 580 | function sql_fetch_column($rs) |
| 553 | 581 | { |
| 554 | 582 | $col = []; |
@@ -758,6 +786,9 @@ discard block |
||
| 758 | 786 | ]; |
| 759 | 787 | } |
| 760 | 788 | |
| 789 | +/** |
|
| 790 | + * @param string $filename |
|
| 791 | + */ |
|
| 761 | 792 | function fetch_email_template($filename, $language, $domain) |
| 762 | 793 | { |
| 763 | 794 | global $opt, $rootpath; |
@@ -323,6 +323,9 @@ discard block |
||
| 323 | 323 | //set no_eval true to prevent this contents from php-parsing. |
| 324 | 324 | //Important when replacing something that the user has posted |
| 325 | 325 | //in HTML code and could contain \<\? php-Code \?\> |
| 326 | +/** |
|
| 327 | + * @param string $name |
|
| 328 | + */ |
|
| 326 | 329 | function tpl_set_var($name, $value, $no_eval = true) |
| 327 | 330 | { |
| 328 | 331 | global $vars, $no_eval_vars; |
@@ -543,6 +546,9 @@ discard block |
||
| 543 | 546 | } |
| 544 | 547 | |
| 545 | 548 | //redirect to another site to display, i.e. to view a cache after logging |
| 549 | +/** |
|
| 550 | + * @param string $page |
|
| 551 | + */ |
|
| 546 | 552 | function tpl_redirect($page) |
| 547 | 553 | { |
| 548 | 554 | global $absolute_server_URI; |
@@ -562,6 +568,9 @@ discard block |
||
| 562 | 568 | //process the template replacements |
| 563 | 569 | //no_eval_replace - if true, variables will be replaced that are |
| 564 | 570 | // marked as "no_eval" |
| 571 | +/** |
|
| 572 | + * @param string $str |
|
| 573 | + */ |
|
| 565 | 574 | function tpl_do_replace($str) |
| 566 | 575 | { |
| 567 | 576 | global $vars, $no_eval_vars; |
@@ -589,6 +598,10 @@ discard block |
||
| 589 | 598 | return $str; |
| 590 | 599 | } |
| 591 | 600 | |
| 601 | +/** |
|
| 602 | + * @param string $tplnameError |
|
| 603 | + * @param string $msg |
|
| 604 | + */ |
|
| 592 | 605 | function tpl_errorMsg($tplnameError, $msg) |
| 593 | 606 | { |
| 594 | 607 | global $tplname; |
@@ -617,6 +630,9 @@ discard block |
||
| 617 | 630 | textdomain('messages'); |
| 618 | 631 | } |
| 619 | 632 | |
| 633 | +/** |
|
| 634 | + * @param string $sCode |
|
| 635 | + */ |
|
| 620 | 636 | function tpl_do_translation($sCode) |
| 621 | 637 | { |
| 622 | 638 | global $opt, $style, $tplname; |
@@ -645,6 +661,9 @@ discard block |
||
| 645 | 661 | return $sResultCode; |
| 646 | 662 | } |
| 647 | 663 | |
| 664 | +/** |
|
| 665 | + * @param string $sCode |
|
| 666 | + */ |
|
| 648 | 667 | function gettext_do_html($sCode) |
| 649 | 668 | { |
| 650 | 669 | $sResultCode = ''; |
@@ -674,6 +693,9 @@ discard block |
||
| 674 | 693 | return $sResultCode; |
| 675 | 694 | } |
| 676 | 695 | |
| 696 | +/** |
|
| 697 | + * @return string |
|
| 698 | + */ |
|
| 677 | 699 | function t($str) |
| 678 | 700 | { |
| 679 | 701 | global $translate; |
@@ -149,6 +149,9 @@ |
||
| 149 | 149 | <?php |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | +/** |
|
| 153 | + * @param string $sql |
|
| 154 | + */ |
|
| 152 | 155 | function sqldbg_execute($sql, $bSlave) |
| 153 | 156 | { |
| 154 | 157 | global $dblink; |
@@ -106,6 +106,10 @@ |
||
| 106 | 106 | // throttle admin error mails; |
| 107 | 107 | // currently used only for SQL errors and warnings |
| 108 | 108 | |
| 109 | +/** |
|
| 110 | + * @param string $errortype |
|
| 111 | + * @param string $message |
|
| 112 | + */ |
|
| 109 | 113 | function admin_errormail($to, $errortype, $message, $headers) |
| 110 | 114 | { |
| 111 | 115 | global $opt; |
@@ -26,6 +26,9 @@ discard block |
||
| 26 | 26 | * Returns: if $file specified - true if OK |
| 27 | 27 | if $file not specified - image data |
| 28 | 28 | */ |
| 29 | +/** |
|
| 30 | + * @param resource $img |
|
| 31 | + */ |
|
| 29 | 32 | function imagebmp($img,$file="",$RLE=0) |
| 30 | 33 | { |
| 31 | 34 | |
@@ -463,6 +466,9 @@ discard block |
||
| 463 | 466 | |
| 464 | 467 | |
| 465 | 468 | |
| 469 | +/** |
|
| 470 | + * @param integer $byte |
|
| 471 | + */ |
|
| 466 | 472 | function RetBits($byte,$start,$len) |
| 467 | 473 | { |
| 468 | 474 | $bin=decbin8($byte); |
@@ -474,6 +480,10 @@ discard block |
||
| 474 | 480 | |
| 475 | 481 | |
| 476 | 482 | $CurrentBit=0; |
| 483 | +/** |
|
| 484 | + * @param resource $f |
|
| 485 | + * @param integer $count |
|
| 486 | + */ |
|
| 477 | 487 | function freadbits($f,$count) |
| 478 | 488 | { |
| 479 | 489 | global $CurrentBit,$SMode; |
@@ -505,6 +515,10 @@ discard block |
||
| 505 | 515 | { |
| 506 | 516 | return chr($n & 255).chr(($n >> 8) & 255).chr(($n >> 16) & 255).chr(($n >> 24) & 255); |
| 507 | 517 | } |
| 518 | + |
|
| 519 | + /** |
|
| 520 | + * @param integer $n |
|
| 521 | + */ |
|
| 508 | 522 | function int_to_word($n) |
| 509 | 523 | { |
| 510 | 524 | return chr($n & 255).chr(($n >> 8) & 255); |
@@ -516,6 +530,9 @@ discard block |
||
| 516 | 530 | return decbinx($d,8); |
| 517 | 531 | }; |
| 518 | 532 | |
| 533 | +/** |
|
| 534 | + * @param integer $n |
|
| 535 | + */ |
|
| 519 | 536 | function decbinx($d,$n) |
| 520 | 537 | { |
| 521 | 538 | $bin=decbin($d); |
@@ -78,83 +78,83 @@ discard block |
||
| 78 | 78 | $sl1=strlen($ret); |
| 79 | 79 | if($CC==0) $CC=256; |
| 80 | 80 | if($BitCount<24) |
| 81 | - { |
|
| 81 | + { |
|
| 82 | 82 | $ColorTotal=imagecolorstotal($img); |
| 83 | - if($IsTransparent) $ColorTotal--; |
|
| 83 | + if($IsTransparent) $ColorTotal--; |
|
| 84 | 84 | |
| 85 | - for($p=0;$p<$ColorTotal;$p++) |
|
| 86 | - { |
|
| 87 | - $color=imagecolorsforindex($img,$p); |
|
| 88 | - $ret.=inttobyte($color["blue"]); |
|
| 89 | - $ret.=inttobyte($color["green"]); |
|
| 90 | - $ret.=inttobyte($color["red"]); |
|
| 91 | - $ret.=inttobyte(0); //RESERVED |
|
| 92 | - }; |
|
| 85 | + for($p=0;$p<$ColorTotal;$p++) |
|
| 86 | + { |
|
| 87 | + $color=imagecolorsforindex($img,$p); |
|
| 88 | + $ret.=inttobyte($color["blue"]); |
|
| 89 | + $ret.=inttobyte($color["green"]); |
|
| 90 | + $ret.=inttobyte($color["red"]); |
|
| 91 | + $ret.=inttobyte(0); //RESERVED |
|
| 92 | + }; |
|
| 93 | 93 | |
| 94 | 94 | $CT=$ColorTotal; |
| 95 | - for($p=$ColorTotal;$p<$CC;$p++) |
|
| 96 | - { |
|
| 97 | - $ret.=inttobyte(0); |
|
| 98 | - $ret.=inttobyte(0); |
|
| 99 | - $ret.=inttobyte(0); |
|
| 100 | - $ret.=inttobyte(0); //RESERVED |
|
| 101 | - }; |
|
| 102 | - }; |
|
| 95 | + for($p=$ColorTotal;$p<$CC;$p++) |
|
| 96 | + { |
|
| 97 | + $ret.=inttobyte(0); |
|
| 98 | + $ret.=inttobyte(0); |
|
| 99 | + $ret.=inttobyte(0); |
|
| 100 | + $ret.=inttobyte(0); //RESERVED |
|
| 101 | + }; |
|
| 102 | + }; |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | if($BitCount<=8) |
| 106 | 106 | { |
| 107 | 107 | |
| 108 | - for($y=$Height-1;$y>=0;$y--) |
|
| 109 | - { |
|
| 110 | - $bWrite=""; |
|
| 111 | - for($x=0;$x<$Width;$x++) |
|
| 112 | - { |
|
| 113 | - $color=imagecolorat($img,$x,$y); |
|
| 114 | - $bWrite.=decbinx($color,$BitCount); |
|
| 115 | - if(strlen($bWrite)==8) |
|
| 108 | + for($y=$Height-1;$y>=0;$y--) |
|
| 109 | + { |
|
| 110 | + $bWrite=""; |
|
| 111 | + for($x=0;$x<$Width;$x++) |
|
| 116 | 112 | { |
| 117 | - $retd.=inttobyte(bindec($bWrite)); |
|
| 118 | - $bWrite=""; |
|
| 113 | + $color=imagecolorat($img,$x,$y); |
|
| 114 | + $bWrite.=decbinx($color,$BitCount); |
|
| 115 | + if(strlen($bWrite)==8) |
|
| 116 | + { |
|
| 117 | + $retd.=inttobyte(bindec($bWrite)); |
|
| 118 | + $bWrite=""; |
|
| 119 | + }; |
|
| 119 | 120 | }; |
| 120 | - }; |
|
| 121 | 121 | |
| 122 | - if((strlen($bWrite)<8)and(strlen($bWrite)!=0)) |
|
| 122 | + if((strlen($bWrite)<8)and(strlen($bWrite)!=0)) |
|
| 123 | 123 | { |
| 124 | - $sl=strlen($bWrite); |
|
| 125 | - for($t=0;$t<8-$sl;$t++) |
|
| 126 | - $sl.="0"; |
|
| 127 | - $retd.=inttobyte(bindec($bWrite)); |
|
| 124 | + $sl=strlen($bWrite); |
|
| 125 | + for($t=0;$t<8-$sl;$t++) |
|
| 126 | + $sl.="0"; |
|
| 127 | + $retd.=inttobyte(bindec($bWrite)); |
|
| 128 | + }; |
|
| 129 | + for($z=0;$z<$Zbytek;$z++) |
|
| 130 | + $retd.=inttobyte(0); |
|
| 128 | 131 | }; |
| 129 | - for($z=0;$z<$Zbytek;$z++) |
|
| 130 | - $retd.=inttobyte(0); |
|
| 131 | - }; |
|
| 132 | 132 | }; |
| 133 | 133 | |
| 134 | 134 | if(($RLE==1)and($BitCount==8)) |
| 135 | 135 | { |
| 136 | - for($t=0;$t<strlen($retd);$t+=4) |
|
| 137 | - { |
|
| 138 | - if($t!=0) |
|
| 139 | - if(($t)%$Width==0) |
|
| 136 | + for($t=0;$t<strlen($retd);$t+=4) |
|
| 137 | + { |
|
| 138 | + if($t!=0) |
|
| 139 | + if(($t)%$Width==0) |
|
| 140 | 140 | $ret.=chr(0).chr(0); |
| 141 | 141 | |
| 142 | - if(($t+5)%$Width==0) |
|
| 143 | - { |
|
| 144 | - $ret.=chr(0).chr(5).substr($retd,$t,5).chr(0); |
|
| 145 | - $t+=1; |
|
| 146 | - } |
|
| 147 | - if(($t+6)%$Width==0) |
|
| 142 | + if(($t+5)%$Width==0) |
|
| 143 | + { |
|
| 144 | + $ret.=chr(0).chr(5).substr($retd,$t,5).chr(0); |
|
| 145 | + $t+=1; |
|
| 146 | + } |
|
| 147 | + if(($t+6)%$Width==0) |
|
| 148 | 148 | { |
| 149 | - $ret.=chr(0).chr(6).substr($retd,$t,6); |
|
| 150 | - $t+=2; |
|
| 149 | + $ret.=chr(0).chr(6).substr($retd,$t,6); |
|
| 150 | + $t+=2; |
|
| 151 | 151 | } |
| 152 | 152 | else |
| 153 | 153 | { |
| 154 | - $ret.=chr(0).chr(4).substr($retd,$t,4); |
|
| 154 | + $ret.=chr(0).chr(4).substr($retd,$t,4); |
|
| 155 | + }; |
|
| 155 | 156 | }; |
| 156 | - }; |
|
| 157 | - $ret.=chr(0).chr(1); |
|
| 157 | + $ret.=chr(0).chr(1); |
|
| 158 | 158 | } |
| 159 | 159 | else |
| 160 | 160 | { |
@@ -165,31 +165,31 @@ discard block |
||
| 165 | 165 | if($BitCount==24) |
| 166 | 166 | { |
| 167 | 167 | for($z=0;$z<$Zbytek;$z++) |
| 168 | - $Dopl.=chr(0); |
|
| 168 | + $Dopl.=chr(0); |
|
| 169 | 169 | |
| 170 | 170 | for($y=$Height-1;$y>=0;$y--) |
| 171 | - { |
|
| 172 | - for($x=0;$x<$Width;$x++) |
|
| 171 | + { |
|
| 172 | + for($x=0;$x<$Width;$x++) |
|
| 173 | 173 | { |
| 174 | - $color=imagecolorsforindex($img,ImageColorAt($img,$x,$y)); |
|
| 175 | - $ret.=chr($color["blue"]).chr($color["green"]).chr($color["red"]); |
|
| 174 | + $color=imagecolorsforindex($img,ImageColorAt($img,$x,$y)); |
|
| 175 | + $ret.=chr($color["blue"]).chr($color["green"]).chr($color["red"]); |
|
| 176 | 176 | } |
| 177 | - $ret.=$Dopl; |
|
| 178 | - }; |
|
| 177 | + $ret.=$Dopl; |
|
| 178 | + }; |
|
| 179 | 179 | |
| 180 | - }; |
|
| 180 | + }; |
|
| 181 | 181 | |
| 182 | - if($file!="") |
|
| 183 | - { |
|
| 182 | + if($file!="") |
|
| 183 | + { |
|
| 184 | 184 | $r=($f=fopen($file,"w")); |
| 185 | 185 | $r=$r and fwrite($f,$ret); |
| 186 | 186 | $r=$r and fclose($f); |
| 187 | 187 | return $r; |
| 188 | - } |
|
| 189 | - else |
|
| 190 | - { |
|
| 191 | - echo $ret; |
|
| 192 | - }; |
|
| 188 | + } |
|
| 189 | + else |
|
| 190 | + { |
|
| 191 | + echo $ret; |
|
| 192 | + }; |
|
| 193 | 193 | }; |
| 194 | 194 | |
| 195 | 195 | |
@@ -213,57 +213,57 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | if($Header=="BM") |
| 215 | 215 | { |
| 216 | - $Size=freaddword($f); |
|
| 217 | - $Reserved1=freadword($f); |
|
| 218 | - $Reserved2=freadword($f); |
|
| 219 | - $FirstByteOfImage=freaddword($f); |
|
| 220 | - |
|
| 221 | - $SizeBITMAPINFOHEADER=freaddword($f); |
|
| 222 | - $Width=freaddword($f); |
|
| 223 | - $Height=freaddword($f); |
|
| 224 | - $biPlanes=freadword($f); |
|
| 225 | - $biBitCount=freadword($f); |
|
| 226 | - $RLECompression=freaddword($f); |
|
| 227 | - $WidthxHeight=freaddword($f); |
|
| 228 | - $biXPelsPerMeter=freaddword($f); |
|
| 229 | - $biYPelsPerMeter=freaddword($f); |
|
| 230 | - $NumberOfPalettesUsed=freaddword($f); |
|
| 231 | - $NumberOfImportantColors=freaddword($f); |
|
| 216 | + $Size=freaddword($f); |
|
| 217 | + $Reserved1=freadword($f); |
|
| 218 | + $Reserved2=freadword($f); |
|
| 219 | + $FirstByteOfImage=freaddword($f); |
|
| 220 | + |
|
| 221 | + $SizeBITMAPINFOHEADER=freaddword($f); |
|
| 222 | + $Width=freaddword($f); |
|
| 223 | + $Height=freaddword($f); |
|
| 224 | + $biPlanes=freadword($f); |
|
| 225 | + $biBitCount=freadword($f); |
|
| 226 | + $RLECompression=freaddword($f); |
|
| 227 | + $WidthxHeight=freaddword($f); |
|
| 228 | + $biXPelsPerMeter=freaddword($f); |
|
| 229 | + $biYPelsPerMeter=freaddword($f); |
|
| 230 | + $NumberOfPalettesUsed=freaddword($f); |
|
| 231 | + $NumberOfImportantColors=freaddword($f); |
|
| 232 | 232 | |
| 233 | 233 | if($biBitCount<24) |
| 234 | - { |
|
| 235 | - $img=imagecreate($Width,$Height); |
|
| 236 | - $Colors=pow(2,$biBitCount); |
|
| 237 | - for($p=0;$p<$Colors;$p++) |
|
| 238 | - { |
|
| 234 | + { |
|
| 235 | + $img=imagecreate($Width,$Height); |
|
| 236 | + $Colors=pow(2,$biBitCount); |
|
| 237 | + for($p=0;$p<$Colors;$p++) |
|
| 238 | + { |
|
| 239 | 239 | $B=freadbyte($f); |
| 240 | 240 | $G=freadbyte($f); |
| 241 | 241 | $R=freadbyte($f); |
| 242 | 242 | $Reserved=freadbyte($f); |
| 243 | 243 | $Palette[]=imagecolorallocate($img,$R,$G,$B); |
| 244 | - }; |
|
| 244 | + }; |
|
| 245 | 245 | |
| 246 | 246 | |
| 247 | 247 | |
| 248 | 248 | |
| 249 | 249 | if($RLECompression==0) |
| 250 | 250 | { |
| 251 | - $Zbytek=(4-ceil(($Width/(8/$biBitCount)))%4)%4; |
|
| 251 | + $Zbytek=(4-ceil(($Width/(8/$biBitCount)))%4)%4; |
|
| 252 | 252 | |
| 253 | 253 | for($y=$Height-1;$y>=0;$y--) |
| 254 | 254 | { |
| 255 | - $CurrentBit=0; |
|
| 256 | - for($x=0;$x<$Width;$x++) |
|
| 257 | - { |
|
| 258 | - $C=freadbits($f,$biBitCount); |
|
| 259 | - imagesetpixel($img,$x,$y,$Palette[$C]); |
|
| 260 | - }; |
|
| 255 | + $CurrentBit=0; |
|
| 256 | + for($x=0;$x<$Width;$x++) |
|
| 257 | + { |
|
| 258 | + $C=freadbits($f,$biBitCount); |
|
| 259 | + imagesetpixel($img,$x,$y,$Palette[$C]); |
|
| 260 | + }; |
|
| 261 | 261 | if($CurrentBit!=0) {freadbyte($f);}; |
| 262 | 262 | for($g=0;$g<$Zbytek;$g++) |
| 263 | - freadbyte($f); |
|
| 264 | - }; |
|
| 263 | + freadbyte($f); |
|
| 264 | + }; |
|
| 265 | 265 | |
| 266 | - }; |
|
| 266 | + }; |
|
| 267 | 267 | }; |
| 268 | 268 | |
| 269 | 269 | |
@@ -288,29 +288,29 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | while(!(($prefix==0)and($suffix==0))) |
| 290 | 290 | { |
| 291 | - if($prefix==0) |
|
| 292 | - { |
|
| 293 | - $pocet=$suffix; |
|
| 294 | - $Data.=fread($f,$pocet); |
|
| 295 | - $pocetb+=$pocet; |
|
| 296 | - if($pocetb%2==1) {freadbyte($f); $pocetb++;}; |
|
| 297 | - }; |
|
| 298 | - if($prefix>0) |
|
| 299 | - { |
|
| 300 | - $pocet=$prefix; |
|
| 301 | - for($r=0;$r<$pocet;$r++) |
|
| 291 | + if($prefix==0) |
|
| 292 | + { |
|
| 293 | + $pocet=$suffix; |
|
| 294 | + $Data.=fread($f,$pocet); |
|
| 295 | + $pocetb+=$pocet; |
|
| 296 | + if($pocetb%2==1) {freadbyte($f); $pocetb++;}; |
|
| 297 | + }; |
|
| 298 | + if($prefix>0) |
|
| 299 | + { |
|
| 300 | + $pocet=$prefix; |
|
| 301 | + for($r=0;$r<$pocet;$r++) |
|
| 302 | 302 | $Data.=chr($suffix); |
| 303 | - }; |
|
| 304 | - $prefix=freadbyte($f); |
|
| 305 | - $suffix=freadbyte($f); |
|
| 306 | - $pocetb+=2; |
|
| 307 | - if($echoit) echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
| 303 | + }; |
|
| 304 | + $prefix=freadbyte($f); |
|
| 305 | + $suffix=freadbyte($f); |
|
| 306 | + $pocetb+=2; |
|
| 307 | + if($echoit) echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
| 308 | 308 | }; |
| 309 | 309 | |
| 310 | 310 | for($x=0;$x<strlen($Data);$x++) |
| 311 | - { |
|
| 312 | - imagesetpixel($img,$x,$y,$Palette[ord($Data[$x])]); |
|
| 313 | - }; |
|
| 311 | + { |
|
| 312 | + imagesetpixel($img,$x,$y,$Palette[ord($Data[$x])]); |
|
| 313 | + }; |
|
| 314 | 314 | $Data=""; |
| 315 | 315 | |
| 316 | 316 | }; |
@@ -341,44 +341,44 @@ discard block |
||
| 341 | 341 | |
| 342 | 342 | while(!(($prefix==0)and($suffix==0))) |
| 343 | 343 | { |
| 344 | - if($prefix==0) |
|
| 345 | - { |
|
| 346 | - $pocet=$suffix; |
|
| 344 | + if($prefix==0) |
|
| 345 | + { |
|
| 346 | + $pocet=$suffix; |
|
| 347 | 347 | |
| 348 | - $CurrentBit=0; |
|
| 349 | - for($h=0;$h<$pocet;$h++) |
|
| 348 | + $CurrentBit=0; |
|
| 349 | + for($h=0;$h<$pocet;$h++) |
|
| 350 | 350 | $Data.=chr(freadbits($f,4)); |
| 351 | - if($CurrentBit!=0) freadbits($f,4); |
|
| 352 | - $pocetb+=ceil(($pocet/2)); |
|
| 353 | - if($pocetb%2==1) {freadbyte($f); $pocetb++;}; |
|
| 354 | - }; |
|
| 355 | - if($prefix>0) |
|
| 356 | - { |
|
| 357 | - $pocet=$prefix; |
|
| 358 | - $i=0; |
|
| 359 | - for($r=0;$r<$pocet;$r++) |
|
| 351 | + if($CurrentBit!=0) freadbits($f,4); |
|
| 352 | + $pocetb+=ceil(($pocet/2)); |
|
| 353 | + if($pocetb%2==1) {freadbyte($f); $pocetb++;}; |
|
| 354 | + }; |
|
| 355 | + if($prefix>0) |
|
| 356 | + { |
|
| 357 | + $pocet=$prefix; |
|
| 358 | + $i=0; |
|
| 359 | + for($r=0;$r<$pocet;$r++) |
|
| 360 | 360 | { |
| 361 | 361 | if($i%2==0) |
| 362 | - { |
|
| 363 | - $Data.=chr($suffix%16); |
|
| 364 | - } |
|
| 365 | - else |
|
| 366 | - { |
|
| 367 | - $Data.=chr(floor($suffix/16)); |
|
| 368 | - }; |
|
| 362 | + { |
|
| 363 | + $Data.=chr($suffix%16); |
|
| 364 | + } |
|
| 365 | + else |
|
| 366 | + { |
|
| 367 | + $Data.=chr(floor($suffix/16)); |
|
| 368 | + }; |
|
| 369 | 369 | $i++; |
| 370 | 370 | }; |
| 371 | - }; |
|
| 372 | - $prefix=freadbyte($f); |
|
| 373 | - $suffix=freadbyte($f); |
|
| 374 | - $pocetb+=2; |
|
| 375 | - if($echoit) echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
| 371 | + }; |
|
| 372 | + $prefix=freadbyte($f); |
|
| 373 | + $suffix=freadbyte($f); |
|
| 374 | + $pocetb+=2; |
|
| 375 | + if($echoit) echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
| 376 | 376 | }; |
| 377 | 377 | |
| 378 | 378 | for($x=0;$x<strlen($Data);$x++) |
| 379 | - { |
|
| 380 | - imagesetpixel($img,$x,$y,$Palette[ord($Data[$x])]); |
|
| 381 | - }; |
|
| 379 | + { |
|
| 380 | + imagesetpixel($img,$x,$y,$Palette[ord($Data[$x])]); |
|
| 381 | + }; |
|
| 382 | 382 | $Data=""; |
| 383 | 383 | |
| 384 | 384 | }; |
@@ -386,25 +386,25 @@ discard block |
||
| 386 | 386 | }; |
| 387 | 387 | |
| 388 | 388 | |
| 389 | - if($biBitCount==24) |
|
| 389 | + if($biBitCount==24) |
|
| 390 | 390 | { |
| 391 | - $img=imagecreatetruecolor($Width,$Height); |
|
| 392 | - $Zbytek=$Width%4; |
|
| 391 | + $img=imagecreatetruecolor($Width,$Height); |
|
| 392 | + $Zbytek=$Width%4; |
|
| 393 | 393 | |
| 394 | - for($y=$Height-1;$y>=0;$y--) |
|
| 394 | + for($y=$Height-1;$y>=0;$y--) |
|
| 395 | 395 | { |
| 396 | - for($x=0;$x<$Width;$x++) |
|
| 397 | - { |
|
| 398 | - $B=freadbyte($f); |
|
| 399 | - $G=freadbyte($f); |
|
| 400 | - $R=freadbyte($f); |
|
| 401 | - $color=imagecolorexact($img,$R,$G,$B); |
|
| 402 | - if($color==-1) $color=imagecolorallocate($img,$R,$G,$B); |
|
| 403 | - imagesetpixel($img,$x,$y,$color); |
|
| 404 | - } |
|
| 396 | + for($x=0;$x<$Width;$x++) |
|
| 397 | + { |
|
| 398 | + $B=freadbyte($f); |
|
| 399 | + $G=freadbyte($f); |
|
| 400 | + $R=freadbyte($f); |
|
| 401 | + $color=imagecolorexact($img,$R,$G,$B); |
|
| 402 | + if($color==-1) $color=imagecolorallocate($img,$R,$G,$B); |
|
| 403 | + imagesetpixel($img,$x,$y,$color); |
|
| 404 | + } |
|
| 405 | 405 | for($z=0;$z<$Zbytek;$z++) |
| 406 | - freadbyte($f); |
|
| 407 | - }; |
|
| 406 | + freadbyte($f); |
|
| 407 | + }; |
|
| 408 | 408 | }; |
| 409 | 409 | return $img; |
| 410 | 410 | |
@@ -438,14 +438,14 @@ discard block |
||
| 438 | 438 | |
| 439 | 439 | function freadbyte($f) |
| 440 | 440 | { |
| 441 | - return ord(fread($f,1)); |
|
| 441 | + return ord(fread($f,1)); |
|
| 442 | 442 | }; |
| 443 | 443 | |
| 444 | 444 | function freadword($f) |
| 445 | 445 | { |
| 446 | - $b1=freadbyte($f); |
|
| 447 | - $b2=freadbyte($f); |
|
| 448 | - return $b2*256+$b1; |
|
| 446 | + $b1=freadbyte($f); |
|
| 447 | + $b2=freadbyte($f); |
|
| 448 | + return $b2*256+$b1; |
|
| 449 | 449 | }; |
| 450 | 450 | |
| 451 | 451 | |
@@ -456,9 +456,9 @@ discard block |
||
| 456 | 456 | |
| 457 | 457 | function freaddword($f) |
| 458 | 458 | { |
| 459 | - $b1=freadword($f); |
|
| 460 | - $b2=freadword($f); |
|
| 461 | - return $b2*65536+$b1; |
|
| 459 | + $b1=freadword($f); |
|
| 460 | + $b2=freadword($f); |
|
| 461 | + return $b2*65536+$b1; |
|
| 462 | 462 | }; |
| 463 | 463 | |
| 464 | 464 | |
@@ -476,30 +476,30 @@ discard block |
||
| 476 | 476 | $CurrentBit=0; |
| 477 | 477 | function freadbits($f,$count) |
| 478 | 478 | { |
| 479 | - global $CurrentBit,$SMode; |
|
| 480 | - $Byte=freadbyte($f); |
|
| 481 | - $LastCBit=$CurrentBit; |
|
| 482 | - $CurrentBit+=$count; |
|
| 483 | - if($CurrentBit==8) |
|
| 484 | - { |
|
| 485 | - $CurrentBit=0; |
|
| 486 | - } |
|
| 487 | - else |
|
| 488 | - { |
|
| 489 | - fseek($f,ftell($f)-1); |
|
| 490 | - }; |
|
| 491 | - return RetBits($Byte,$LastCBit,$count); |
|
| 479 | + global $CurrentBit,$SMode; |
|
| 480 | + $Byte=freadbyte($f); |
|
| 481 | + $LastCBit=$CurrentBit; |
|
| 482 | + $CurrentBit+=$count; |
|
| 483 | + if($CurrentBit==8) |
|
| 484 | + { |
|
| 485 | + $CurrentBit=0; |
|
| 486 | + } |
|
| 487 | + else |
|
| 488 | + { |
|
| 489 | + fseek($f,ftell($f)-1); |
|
| 490 | + }; |
|
| 491 | + return RetBits($Byte,$LastCBit,$count); |
|
| 492 | 492 | }; |
| 493 | 493 | |
| 494 | 494 | |
| 495 | 495 | |
| 496 | 496 | function RGBToHex($Red,$Green,$Blue) |
| 497 | - { |
|
| 498 | - $hRed=dechex($Red);if(strlen($hRed)==1) $hRed="0$hRed"; |
|
| 499 | - $hGreen=dechex($Green);if(strlen($hGreen)==1) $hGreen="0$hGreen"; |
|
| 500 | - $hBlue=dechex($Blue);if(strlen($hBlue)==1) $hBlue="0$hBlue"; |
|
| 501 | - return($hRed.$hGreen.$hBlue); |
|
| 502 | - }; |
|
| 497 | + { |
|
| 498 | + $hRed=dechex($Red);if(strlen($hRed)==1) $hRed="0$hRed"; |
|
| 499 | + $hGreen=dechex($Green);if(strlen($hGreen)==1) $hGreen="0$hGreen"; |
|
| 500 | + $hBlue=dechex($Blue);if(strlen($hBlue)==1) $hBlue="0$hBlue"; |
|
| 501 | + return($hRed.$hGreen.$hBlue); |
|
| 502 | + }; |
|
| 503 | 503 | |
| 504 | 504 | function int_to_dword($n) |
| 505 | 505 | { |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | $bin=decbin($d); |
| 522 | 522 | $sbin=strlen($bin); |
| 523 | 523 | for($j=0;$j<$n-$sbin;$j++) |
| 524 | - $bin="0$bin"; |
|
| 524 | + $bin="0$bin"; |
|
| 525 | 525 | return $bin; |
| 526 | 526 | }; |
| 527 | 527 | |
@@ -23,6 +23,10 @@ |
||
| 23 | 23 | return self::getAttrbutesListArrayInternal($cacheId, false, $firstLetterUppercase); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param boolean $bOnlySelectable |
|
| 28 | + * @param boolean $firstLetterUppercase |
|
| 29 | + */ |
|
| 26 | 30 | public static function getAttrbutesListArrayInternal($cacheId, $bOnlySelectable, $firstLetterUppercase) |
| 27 | 31 | { |
| 28 | 32 | global $opt; |
@@ -411,9 +411,9 @@ |
||
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | /** |
| 414 | - * @param $cacheId |
|
| 415 | - * @param $start |
|
| 416 | - * @param $count |
|
| 414 | + * @param integer $cacheId |
|
| 415 | + * @param integer $start |
|
| 416 | + * @param integer $count |
|
| 417 | 417 | * @param bool $deleted |
| 418 | 418 | * @param bool $protect_old_coords |
| 419 | 419 | * |
@@ -262,6 +262,9 @@ |
||
| 262 | 262 | return $this->reCacheLog->getValue('owner_notified') != 0; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | + /** |
|
| 266 | + * @param integer $value |
|
| 267 | + */ |
|
| 265 | 268 | public function setOwnerNotified($value) |
| 266 | 269 | { |
| 267 | 270 | return $this->reCacheLog->setValue('owner_notified', $value ? 1 : 0); |
@@ -303,6 +303,10 @@ discard block |
||
| 303 | 303 | return 'R ' . floor($result[0]) . ' H ' . floor($result[1]); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | + /** |
|
| 307 | + * @param integer $bw |
|
| 308 | + * @param integer $lw |
|
| 309 | + */ |
|
| 306 | 310 | public function wgs2pot($bw, $lw) |
| 307 | 311 | { |
| 308 | 312 | /* Copyright (c) 2006, HELMUT H. HEIMEIER |
@@ -602,6 +606,9 @@ discard block |
||
| 602 | 606 | ]; |
| 603 | 607 | } |
| 604 | 608 | |
| 609 | + /** |
|
| 610 | + * @param string $name |
|
| 611 | + */ |
|
| 605 | 612 | public static function parseRequestLat($name) |
| 606 | 613 | { |
| 607 | 614 | if (!isset($_REQUEST[$name . 'NS']) || !isset($_REQUEST[$name . 'Lat']) || !isset($_REQUEST[$name . 'LatMin'])) { |
@@ -620,6 +627,9 @@ discard block |
||
| 620 | 627 | return $lat; |
| 621 | 628 | } |
| 622 | 629 | |
| 630 | + /** |
|
| 631 | + * @param string $name |
|
| 632 | + */ |
|
| 623 | 633 | public static function parseRequestLon($name) |
| 624 | 634 | { |
| 625 | 635 | if (!isset($_REQUEST[$name . 'EW']) || !isset($_REQUEST[$name . 'Lon']) || !isset($_REQUEST[$name . 'LonMin'])) { |