@@ -26,164 +26,164 @@ discard block |
||
26 | 26 | * Returns: if $file specified - true if OK |
27 | 27 | if $file not specified - image data |
28 | 28 | */ |
29 | -function imagebmp($img,$file="",$RLE=0) |
|
29 | +function imagebmp($img, $file = "", $RLE = 0) |
|
30 | 30 | { |
31 | 31 | |
32 | 32 | |
33 | -$ColorCount=imagecolorstotal($img); |
|
33 | +$ColorCount = imagecolorstotal($img); |
|
34 | 34 | |
35 | -$Transparent=imagecolortransparent($img); |
|
36 | -$IsTransparent=$Transparent!=-1; |
|
35 | +$Transparent = imagecolortransparent($img); |
|
36 | +$IsTransparent = $Transparent != -1; |
|
37 | 37 | |
38 | 38 | |
39 | -if($IsTransparent) $ColorCount--; |
|
39 | +if ($IsTransparent) $ColorCount--; |
|
40 | 40 | |
41 | -if($ColorCount==0) {$ColorCount=0; $BitCount=24;}; |
|
42 | -if(($ColorCount>0)and($ColorCount<=2)) {$ColorCount=2; $BitCount=1;}; |
|
43 | -if(($ColorCount>2)and($ColorCount<=16)) { $ColorCount=16; $BitCount=4;}; |
|
44 | -if(($ColorCount>16)and($ColorCount<=256)) { $ColorCount=0; $BitCount=8;}; |
|
41 | +if ($ColorCount == 0) {$ColorCount = 0; $BitCount = 24; }; |
|
42 | +if (($ColorCount > 0) and ($ColorCount <= 2)) {$ColorCount = 2; $BitCount = 1; }; |
|
43 | +if (($ColorCount > 2) and ($ColorCount <= 16)) { $ColorCount = 16; $BitCount = 4; }; |
|
44 | +if (($ColorCount > 16) and ($ColorCount <= 256)) { $ColorCount = 0; $BitCount = 8; }; |
|
45 | 45 | |
46 | 46 | |
47 | - $Width=imagesx($img); |
|
48 | - $Height=imagesy($img); |
|
47 | + $Width = imagesx($img); |
|
48 | + $Height = imagesy($img); |
|
49 | 49 | |
50 | - $Zbytek=(4-($Width/(8/$BitCount))%4)%4; |
|
50 | + $Zbytek = (4 - ($Width / (8 / $BitCount)) % 4) % 4; |
|
51 | 51 | |
52 | - if($BitCount<24) $palsize=pow(2,$BitCount)*4; |
|
52 | + if ($BitCount < 24) $palsize = pow(2, $BitCount) * 4; |
|
53 | 53 | |
54 | - $size=(floor($Width/(8/$BitCount))+$Zbytek)*$Height+54; |
|
55 | - $size+=$palsize; |
|
56 | - $offset=54+$palsize; |
|
54 | + $size = (floor($Width / (8 / $BitCount)) + $Zbytek) * $Height + 54; |
|
55 | + $size += $palsize; |
|
56 | + $offset = 54 + $palsize; |
|
57 | 57 | |
58 | 58 | // Bitmap File Header |
59 | - $ret = 'BM'; // header (2b) |
|
60 | - $ret .= int_to_dword($size); // size of file (4b) |
|
61 | - $ret .= int_to_dword(0); // reserved (4b) |
|
62 | - $ret .= int_to_dword($offset); // byte location in the file which is first byte of IMAGE (4b) |
|
59 | + $ret = 'BM'; // header (2b) |
|
60 | + $ret .= int_to_dword($size); // size of file (4b) |
|
61 | + $ret .= int_to_dword(0); // reserved (4b) |
|
62 | + $ret .= int_to_dword($offset); // byte location in the file which is first byte of IMAGE (4b) |
|
63 | 63 | // Bitmap Info Header |
64 | - $ret .= int_to_dword(40); // Size of BITMAPINFOHEADER (4b) |
|
65 | - $ret .= int_to_dword($Width); // width of bitmap (4b) |
|
66 | - $ret .= int_to_dword($Height); // height of bitmap (4b) |
|
67 | - $ret .= int_to_word(1); // biPlanes = 1 (2b) |
|
68 | - $ret .= int_to_word($BitCount); // biBitCount = {1 (mono) or 4 (16 clr ) or 8 (256 clr) or 24 (16 Mil)} (2b) |
|
69 | - $ret .= int_to_dword($RLE); // RLE COMPRESSION (4b) |
|
70 | - $ret .= int_to_dword(0); // width x height (4b) |
|
71 | - $ret .= int_to_dword(0); // biXPelsPerMeter (4b) |
|
72 | - $ret .= int_to_dword(0); // biYPelsPerMeter (4b) |
|
73 | - $ret .= int_to_dword(0); // Number of palettes used (4b) |
|
74 | - $ret .= int_to_dword(0); // Number of important colour (4b) |
|
64 | + $ret .= int_to_dword(40); // Size of BITMAPINFOHEADER (4b) |
|
65 | + $ret .= int_to_dword($Width); // width of bitmap (4b) |
|
66 | + $ret .= int_to_dword($Height); // height of bitmap (4b) |
|
67 | + $ret .= int_to_word(1); // biPlanes = 1 (2b) |
|
68 | + $ret .= int_to_word($BitCount); // biBitCount = {1 (mono) or 4 (16 clr ) or 8 (256 clr) or 24 (16 Mil)} (2b) |
|
69 | + $ret .= int_to_dword($RLE); // RLE COMPRESSION (4b) |
|
70 | + $ret .= int_to_dword(0); // width x height (4b) |
|
71 | + $ret .= int_to_dword(0); // biXPelsPerMeter (4b) |
|
72 | + $ret .= int_to_dword(0); // biYPelsPerMeter (4b) |
|
73 | + $ret .= int_to_dword(0); // Number of palettes used (4b) |
|
74 | + $ret .= int_to_dword(0); // Number of important colour (4b) |
|
75 | 75 | // image data |
76 | 76 | |
77 | - $CC=$ColorCount; |
|
78 | - $sl1=strlen($ret); |
|
79 | - if($CC==0) $CC=256; |
|
80 | - if($BitCount<24) |
|
77 | + $CC = $ColorCount; |
|
78 | + $sl1 = strlen($ret); |
|
79 | + if ($CC == 0) $CC = 256; |
|
80 | + if ($BitCount < 24) |
|
81 | 81 | { |
82 | - $ColorTotal=imagecolorstotal($img); |
|
83 | - if($IsTransparent) $ColorTotal--; |
|
82 | + $ColorTotal = imagecolorstotal($img); |
|
83 | + if ($IsTransparent) $ColorTotal--; |
|
84 | 84 | |
85 | - for($p=0;$p<$ColorTotal;$p++) |
|
85 | + for ($p = 0; $p < $ColorTotal; $p++) |
|
86 | 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 |
|
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 | 92 | }; |
93 | 93 | |
94 | - $CT=$ColorTotal; |
|
95 | - for($p=$ColorTotal;$p<$CC;$p++) |
|
94 | + $CT = $ColorTotal; |
|
95 | + for ($p = $ColorTotal; $p < $CC; $p++) |
|
96 | 96 | { |
97 | - $ret.=inttobyte(0); |
|
98 | - $ret.=inttobyte(0); |
|
99 | - $ret.=inttobyte(0); |
|
100 | - $ret.=inttobyte(0); //RESERVED |
|
97 | + $ret .= inttobyte(0); |
|
98 | + $ret .= inttobyte(0); |
|
99 | + $ret .= inttobyte(0); |
|
100 | + $ret .= inttobyte(0); //RESERVED |
|
101 | 101 | }; |
102 | 102 | }; |
103 | 103 | |
104 | 104 | |
105 | -if($BitCount<=8) |
|
105 | +if ($BitCount <= 8) |
|
106 | 106 | { |
107 | 107 | |
108 | - for($y=$Height-1;$y>=0;$y--) |
|
108 | + for ($y = $Height - 1; $y >= 0; $y--) |
|
109 | 109 | { |
110 | - $bWrite=""; |
|
111 | - for($x=0;$x<$Width;$x++) |
|
110 | + $bWrite = ""; |
|
111 | + for ($x = 0; $x < $Width; $x++) |
|
112 | 112 | { |
113 | - $color=imagecolorat($img,$x,$y); |
|
114 | - $bWrite.=decbinx($color,$BitCount); |
|
115 | - if(strlen($bWrite)==8) |
|
113 | + $color = imagecolorat($img, $x, $y); |
|
114 | + $bWrite .= decbinx($color, $BitCount); |
|
115 | + if (strlen($bWrite) == 8) |
|
116 | 116 | { |
117 | - $retd.=inttobyte(bindec($bWrite)); |
|
118 | - $bWrite=""; |
|
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 | 128 | }; |
129 | - for($z=0;$z<$Zbytek;$z++) |
|
130 | - $retd.=inttobyte(0); |
|
129 | + for ($z = 0; $z < $Zbytek; $z++) |
|
130 | + $retd .= inttobyte(0); |
|
131 | 131 | }; |
132 | 132 | }; |
133 | 133 | |
134 | -if(($RLE==1)and($BitCount==8)) |
|
134 | +if (($RLE == 1) and ($BitCount == 8)) |
|
135 | 135 | { |
136 | - for($t=0;$t<strlen($retd);$t+=4) |
|
136 | + for ($t = 0; $t < strlen($retd); $t += 4) |
|
137 | 137 | { |
138 | - if($t!=0) |
|
139 | - if(($t)%$Width==0) |
|
140 | - $ret.=chr(0).chr(0); |
|
138 | + if ($t != 0) |
|
139 | + if (($t) % $Width == 0) |
|
140 | + $ret .= chr(0).chr(0); |
|
141 | 141 | |
142 | - if(($t+5)%$Width==0) |
|
142 | + if (($t + 5) % $Width == 0) |
|
143 | 143 | { |
144 | - $ret.=chr(0).chr(5).substr($retd,$t,5).chr(0); |
|
145 | - $t+=1; |
|
144 | + $ret .= chr(0).chr(5).substr($retd, $t, 5).chr(0); |
|
145 | + $t += 1; |
|
146 | 146 | } |
147 | - if(($t+6)%$Width==0) |
|
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 | { |
161 | -$ret.=$retd; |
|
161 | +$ret .= $retd; |
|
162 | 162 | }; |
163 | 163 | |
164 | 164 | |
165 | - if($BitCount==24) |
|
165 | + if ($BitCount == 24) |
|
166 | 166 | { |
167 | - for($z=0;$z<$Zbytek;$z++) |
|
168 | - $Dopl.=chr(0); |
|
167 | + for ($z = 0; $z < $Zbytek; $z++) |
|
168 | + $Dopl .= chr(0); |
|
169 | 169 | |
170 | - for($y=$Height-1;$y>=0;$y--) |
|
170 | + for ($y = $Height - 1; $y >= 0; $y--) |
|
171 | 171 | { |
172 | - for($x=0;$x<$Width;$x++) |
|
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; |
|
177 | + $ret .= $Dopl; |
|
178 | 178 | }; |
179 | 179 | |
180 | 180 | }; |
181 | 181 | |
182 | - if($file!="") |
|
182 | + if ($file != "") |
|
183 | 183 | { |
184 | - $r=($f=fopen($file,"w")); |
|
185 | - $r=$r and fwrite($f,$ret); |
|
186 | - $r=$r and fclose($f); |
|
184 | + $r = ($f = fopen($file, "w")); |
|
185 | + $r = $r and fwrite($f, $ret); |
|
186 | + $r = $r and fclose($f); |
|
187 | 187 | return $r; |
188 | 188 | } |
189 | 189 | else |
@@ -208,58 +208,58 @@ discard block |
||
208 | 208 | { |
209 | 209 | global $CurrentBit, $echoMode; |
210 | 210 | |
211 | -$f=fopen($file,"r"); |
|
212 | -$Header=fread($f,2); |
|
211 | +$f = fopen($file, "r"); |
|
212 | +$Header = fread($f, 2); |
|
213 | 213 | |
214 | -if($Header=="BM") |
|
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); |
|
232 | - |
|
233 | -if($biBitCount<24) |
|
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 | + |
|
233 | +if ($biBitCount < 24) |
|
234 | 234 | { |
235 | - $img=imagecreate($Width,$Height); |
|
236 | - $Colors=pow(2,$biBitCount); |
|
237 | - for($p=0;$p<$Colors;$p++) |
|
235 | + $img = imagecreate($Width, $Height); |
|
236 | + $Colors = pow(2, $biBitCount); |
|
237 | + for ($p = 0; $p < $Colors; $p++) |
|
238 | 238 | { |
239 | - $B=freadbyte($f); |
|
240 | - $G=freadbyte($f); |
|
241 | - $R=freadbyte($f); |
|
242 | - $Reserved=freadbyte($f); |
|
243 | - $Palette[]=imagecolorallocate($img,$R,$G,$B); |
|
239 | + $B = freadbyte($f); |
|
240 | + $G = freadbyte($f); |
|
241 | + $R = freadbyte($f); |
|
242 | + $Reserved = freadbyte($f); |
|
243 | + $Palette[] = imagecolorallocate($img, $R, $G, $B); |
|
244 | 244 | }; |
245 | 245 | |
246 | 246 | |
247 | 247 | |
248 | 248 | |
249 | -if($RLECompression==0) |
|
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 | -for($y=$Height-1;$y>=0;$y--) |
|
253 | +for ($y = $Height - 1; $y >= 0; $y--) |
|
254 | 254 | { |
255 | - $CurrentBit=0; |
|
256 | - for($x=0;$x<$Width;$x++) |
|
255 | + $CurrentBit = 0; |
|
256 | + for ($x = 0; $x < $Width; $x++) |
|
257 | 257 | { |
258 | - $C=freadbits($f,$biBitCount); |
|
259 | - imagesetpixel($img,$x,$y,$Palette[$C]); |
|
258 | + $C = freadbits($f, $biBitCount); |
|
259 | + imagesetpixel($img, $x, $y, $Palette[$C]); |
|
260 | 260 | }; |
261 | - if($CurrentBit!=0) {freadbyte($f);}; |
|
262 | - for($g=0;$g<$Zbytek;$g++) |
|
261 | + if ($CurrentBit != 0) {freadbyte($f); }; |
|
262 | + for ($g = 0; $g < $Zbytek; $g++) |
|
263 | 263 | freadbyte($f); |
264 | 264 | }; |
265 | 265 | |
@@ -267,142 +267,142 @@ discard block |
||
267 | 267 | }; |
268 | 268 | |
269 | 269 | |
270 | -if($RLECompression==1) //$BI_RLE8 |
|
270 | +if ($RLECompression == 1) //$BI_RLE8 |
|
271 | 271 | { |
272 | -$y=$Height; |
|
272 | +$y = $Height; |
|
273 | 273 | |
274 | -$pocetb=0; |
|
274 | +$pocetb = 0; |
|
275 | 275 | |
276 | -while(true) |
|
276 | +while (true) |
|
277 | 277 | { |
278 | 278 | $y--; |
279 | -$prefix=freadbyte($f); |
|
280 | -$suffix=freadbyte($f); |
|
281 | -$pocetb+=2; |
|
279 | +$prefix = freadbyte($f); |
|
280 | +$suffix = freadbyte($f); |
|
281 | +$pocetb += 2; |
|
282 | 282 | |
283 | -$echoit=false; |
|
283 | +$echoit = false; |
|
284 | 284 | |
285 | -if($echoit)echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
286 | -if(($prefix==0)and($suffix==1)) break; |
|
287 | -if(feof($f)) break; |
|
285 | +if ($echoit)echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
286 | +if (($prefix == 0) and ($suffix == 1)) break; |
|
287 | +if (feof($f)) break; |
|
288 | 288 | |
289 | -while(!(($prefix==0)and($suffix==0))) |
|
289 | +while (!(($prefix == 0) and ($suffix == 0))) |
|
290 | 290 | { |
291 | - if($prefix==0) |
|
291 | + if ($prefix == 0) |
|
292 | 292 | { |
293 | - $pocet=$suffix; |
|
294 | - $Data.=fread($f,$pocet); |
|
295 | - $pocetb+=$pocet; |
|
296 | - if($pocetb%2==1) {freadbyte($f); $pocetb++;}; |
|
293 | + $pocet = $suffix; |
|
294 | + $Data .= fread($f, $pocet); |
|
295 | + $pocetb += $pocet; |
|
296 | + if ($pocetb % 2 == 1) {freadbyte($f); $pocetb++; }; |
|
297 | 297 | }; |
298 | - if($prefix>0) |
|
298 | + if ($prefix > 0) |
|
299 | 299 | { |
300 | - $pocet=$prefix; |
|
301 | - for($r=0;$r<$pocet;$r++) |
|
302 | - $Data.=chr($suffix); |
|
300 | + $pocet = $prefix; |
|
301 | + for ($r = 0; $r < $pocet; $r++) |
|
302 | + $Data .= chr($suffix); |
|
303 | 303 | }; |
304 | - $prefix=freadbyte($f); |
|
305 | - $suffix=freadbyte($f); |
|
306 | - $pocetb+=2; |
|
307 | - if($echoit) echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
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 | -for($x=0;$x<strlen($Data);$x++) |
|
310 | +for ($x = 0; $x < strlen($Data); $x++) |
|
311 | 311 | { |
312 | - imagesetpixel($img,$x,$y,$Palette[ord($Data[$x])]); |
|
312 | + imagesetpixel($img, $x, $y, $Palette[ord($Data[$x])]); |
|
313 | 313 | }; |
314 | -$Data=""; |
|
314 | +$Data = ""; |
|
315 | 315 | |
316 | 316 | }; |
317 | 317 | |
318 | 318 | }; |
319 | 319 | |
320 | 320 | |
321 | -if($RLECompression==2) //$BI_RLE4 |
|
321 | +if ($RLECompression == 2) //$BI_RLE4 |
|
322 | 322 | { |
323 | -$y=$Height; |
|
324 | -$pocetb=0; |
|
323 | +$y = $Height; |
|
324 | +$pocetb = 0; |
|
325 | 325 | |
326 | 326 | /*while(!feof($f)) |
327 | 327 | echo freadbyte($f)."_".freadbyte($f)."<BR>";*/ |
328 | -while(true) |
|
328 | +while (true) |
|
329 | 329 | { |
330 | 330 | //break; |
331 | 331 | $y--; |
332 | -$prefix=freadbyte($f); |
|
333 | -$suffix=freadbyte($f); |
|
334 | -$pocetb+=2; |
|
332 | +$prefix = freadbyte($f); |
|
333 | +$suffix = freadbyte($f); |
|
334 | +$pocetb += 2; |
|
335 | 335 | |
336 | -$echoit=false; |
|
336 | +$echoit = false; |
|
337 | 337 | |
338 | -if($echoit)echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
339 | -if(($prefix==0)and($suffix==1)) break; |
|
340 | -if(feof($f)) break; |
|
338 | +if ($echoit)echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
339 | +if (($prefix == 0) and ($suffix == 1)) break; |
|
340 | +if (feof($f)) break; |
|
341 | 341 | |
342 | -while(!(($prefix==0)and($suffix==0))) |
|
342 | +while (!(($prefix == 0) and ($suffix == 0))) |
|
343 | 343 | { |
344 | - if($prefix==0) |
|
344 | + if ($prefix == 0) |
|
345 | 345 | { |
346 | - $pocet=$suffix; |
|
347 | - |
|
348 | - $CurrentBit=0; |
|
349 | - for($h=0;$h<$pocet;$h++) |
|
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++;}; |
|
346 | + $pocet = $suffix; |
|
347 | + |
|
348 | + $CurrentBit = 0; |
|
349 | + for ($h = 0; $h < $pocet; $h++) |
|
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 | 354 | }; |
355 | - if($prefix>0) |
|
355 | + if ($prefix > 0) |
|
356 | 356 | { |
357 | - $pocet=$prefix; |
|
358 | - $i=0; |
|
359 | - for($r=0;$r<$pocet;$r++) |
|
357 | + $pocet = $prefix; |
|
358 | + $i = 0; |
|
359 | + for ($r = 0; $r < $pocet; $r++) |
|
360 | 360 | { |
361 | - if($i%2==0) |
|
361 | + if ($i % 2 == 0) |
|
362 | 362 | { |
363 | - $Data.=chr($suffix%16); |
|
363 | + $Data .= chr($suffix % 16); |
|
364 | 364 | } |
365 | 365 | else |
366 | 366 | { |
367 | - $Data.=chr(floor($suffix/16)); |
|
367 | + $Data .= chr(floor($suffix / 16)); |
|
368 | 368 | }; |
369 | 369 | $i++; |
370 | 370 | }; |
371 | 371 | }; |
372 | - $prefix=freadbyte($f); |
|
373 | - $suffix=freadbyte($f); |
|
374 | - $pocetb+=2; |
|
375 | - if($echoit) echo "Prefix: $prefix Suffix: $suffix<BR>"; |
|
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 | -for($x=0;$x<strlen($Data);$x++) |
|
378 | +for ($x = 0; $x < strlen($Data); $x++) |
|
379 | 379 | { |
380 | - imagesetpixel($img,$x,$y,$Palette[ord($Data[$x])]); |
|
380 | + imagesetpixel($img, $x, $y, $Palette[ord($Data[$x])]); |
|
381 | 381 | }; |
382 | -$Data=""; |
|
382 | +$Data = ""; |
|
383 | 383 | |
384 | 384 | }; |
385 | 385 | |
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++) |
|
396 | + for ($x = 0; $x < $Width; $x++) |
|
397 | 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); |
|
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 | 404 | } |
405 | - for($z=0;$z<$Zbytek;$z++) |
|
405 | + for ($z = 0; $z < $Zbytek; $z++) |
|
406 | 406 | freadbyte($f); |
407 | 407 | }; |
408 | 408 | }; |
@@ -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,48 +456,48 @@ 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 | |
465 | 465 | |
466 | -function RetBits($byte,$start,$len) |
|
466 | +function RetBits($byte, $start, $len) |
|
467 | 467 | { |
468 | -$bin=decbin8($byte); |
|
469 | -$r=bindec(substr($bin,$start,$len)); |
|
468 | +$bin = decbin8($byte); |
|
469 | +$r = bindec(substr($bin, $start, $len)); |
|
470 | 470 | return $r; |
471 | 471 | |
472 | 472 | }; |
473 | 473 | |
474 | 474 | |
475 | 475 | |
476 | -$CurrentBit=0; |
|
477 | -function freadbits($f,$count) |
|
476 | +$CurrentBit = 0; |
|
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) |
|
479 | + global $CurrentBit, $SMode; |
|
480 | + $Byte = freadbyte($f); |
|
481 | + $LastCBit = $CurrentBit; |
|
482 | + $CurrentBit += $count; |
|
483 | + if ($CurrentBit == 8) |
|
484 | 484 | { |
485 | - $CurrentBit=0; |
|
485 | + $CurrentBit = 0; |
|
486 | 486 | } |
487 | 487 | else |
488 | 488 | { |
489 | - fseek($f,ftell($f)-1); |
|
489 | + fseek($f, ftell($f) - 1); |
|
490 | 490 | }; |
491 | - return RetBits($Byte,$LastCBit,$count); |
|
491 | + return RetBits($Byte, $LastCBit, $count); |
|
492 | 492 | }; |
493 | 493 | |
494 | 494 | |
495 | 495 | |
496 | -function RGBToHex($Red,$Green,$Blue) |
|
496 | +function RGBToHex($Red, $Green, $Blue) |
|
497 | 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"; |
|
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 | 501 | return($hRed.$hGreen.$hBlue); |
502 | 502 | }; |
503 | 503 | |
@@ -513,15 +513,15 @@ discard block |
||
513 | 513 | |
514 | 514 | function decbin8($d) |
515 | 515 | { |
516 | -return decbinx($d,8); |
|
516 | +return decbinx($d, 8); |
|
517 | 517 | }; |
518 | 518 | |
519 | -function decbinx($d,$n) |
|
519 | +function decbinx($d, $n) |
|
520 | 520 | { |
521 | -$bin=decbin($d); |
|
522 | -$sbin=strlen($bin); |
|
523 | -for($j=0;$j<$n-$sbin;$j++) |
|
524 | - $bin="0$bin"; |
|
521 | +$bin = decbin($d); |
|
522 | +$sbin = strlen($bin); |
|
523 | +for ($j = 0; $j < $n - $sbin; $j++) |
|
524 | + $bin = "0$bin"; |
|
525 | 525 | return $bin; |
526 | 526 | }; |
527 | 527 |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | if (isset($_REQUEST['SESSION']) && $_REQUEST['SESSION'] != '') { |
25 | 25 | $this->init_session(); |
26 | 26 | } |
27 | - } elseif (isset($_COOKIE[$opt['session']['cookiename'] . 'data'])) { |
|
27 | + } elseif (isset($_COOKIE[$opt['session']['cookiename'].'data'])) { |
|
28 | 28 | //get the cookievars-array |
29 | - $decoded = base64_decode($_COOKIE[$opt['session']['cookiename'] . 'data']); |
|
29 | + $decoded = base64_decode($_COOKIE[$opt['session']['cookiename'].'data']); |
|
30 | 30 | |
31 | 31 | if ($decoded !== false) { |
32 | 32 | $this->values = @unserialize($decoded); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | if ($opt['session']['check_referer']) { |
53 | 53 | if (isset($_SERVER['REFERER'])) { |
54 | - if (strtolower(substr('http' + strstr($_SERVER['REFERER'], '://'), 0, strlen($opt['page']['absolute_http_url']))) != strtolower($opt['page']['absolute_http_url'])) { |
|
54 | + if (strtolower(substr('http' +strstr($_SERVER['REFERER'], '://'), 0, strlen($opt['page']['absolute_http_url']))) != strtolower($opt['page']['absolute_http_url'])) { |
|
55 | 55 | $this->createNewSession(); |
56 | 56 | } |
57 | 57 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | if ($this->changed == true) { |
169 | 169 | if (count($this->values) == 0) { |
170 | 170 | setcookie( |
171 | - $opt['session']['cookiename'] . 'data', |
|
171 | + $opt['session']['cookiename'].'data', |
|
172 | 172 | false, |
173 | 173 | time() + 31536000, |
174 | 174 | $opt['session']['path'], |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | ); |
178 | 178 | } else { |
179 | 179 | setcookie( |
180 | - $opt['session']['cookiename'] . 'data', |
|
180 | + $opt['session']['cookiename'].'data', |
|
181 | 181 | base64_encode(serialize($this->values)), |
182 | 182 | time() + 31536000, |
183 | 183 | $opt['session']['path'], |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | |
11 | 11 | // replacement table for Unicode 0x100 to 0x1FF |
12 | -$utf_xlatin = "A a A a A a C c C c C c C c D d D d E e E e E e E e E e G g G g " . |
|
13 | - "G g G g H h H h I i I i I i I i I i IJijJ j K k K L l L l L l L " . |
|
14 | - "l L l N n N n N n n n n O o O o Ö ö OEoeR r R r R r S s S s S s " . |
|
12 | +$utf_xlatin = "A a A a A a C c C c C c C c D d D d E e E e E e E e E e G g G g ". |
|
13 | + "G g G g H h H h I i I i I i I i I i IJijJ j K k K L l L l L l L ". |
|
14 | + "l L l N n N n N n n n n O o O o Ö ö OEoeR r R r R r S s S s S s ". |
|
15 | 15 | "S s T t T t T t U u U u U u U u Ü ü U u W w Y y Y Z z Z z Z z "; |
16 | 16 | |
17 | 17 | // replacement table for Unicode 0x2000 to 0x203F |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | $result = ""; |
29 | 29 | |
30 | 30 | while ($pos < strlen($s)) { |
31 | - $c1 = ord($s[$pos ++]); |
|
31 | + $c1 = ord($s[$pos++]); |
|
32 | 32 | if ($c1 < 0xC0) { |
33 | 33 | $result .= chr($c1); |
34 | 34 | } elseif ($pos < strlen($s)) { |
35 | - $c2 = ord($s[$pos ++]); |
|
35 | + $c2 = ord($s[$pos++]); |
|
36 | 36 | if ($c1 < 0xE0) { |
37 | 37 | $code = 0x40 * ($c1 & 0x1F) + ($c2 & 0x3F); |
38 | 38 | if ($code < 0x100) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $result .= "?"; |
47 | 47 | } |
48 | 48 | } elseif ($pos < strlen($s)) { |
49 | - $c3 = ord($s[$pos ++]); |
|
49 | + $c3 = ord($s[$pos++]); |
|
50 | 50 | $code = 0x1000 * ($c1 & 0x0F) + 0x40 * ($c2 & 0x3F) + ($c3 & 0x3F); |
51 | 51 | switch ($code) { |
52 | 52 | case 0x2026: |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * Constant definitions |
8 | 8 | ***************************************************************************/ |
9 | 9 | |
10 | -require_once __DIR__ . '/../lib/consts-common.inc.php'; |
|
10 | +require_once __DIR__.'/../lib/consts-common.inc.php'; |
|
11 | 11 | |
12 | 12 | define('DEBUG_NO', 0); |
13 | 13 | define('DEBUG_DEVELOPER', 1); |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | - if (!is_dir($opt['rootpath'] . 'cache2/translate/' . $language_lower)) { |
|
36 | - mkdir($opt['rootpath'] . 'cache2/translate/' . $language_lower); |
|
35 | + if (!is_dir($opt['rootpath'].'cache2/translate/'.$language_lower)) { |
|
36 | + mkdir($opt['rootpath'].'cache2/translate/'.$language_lower); |
|
37 | 37 | } |
38 | - if (!is_dir($opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES')) { |
|
39 | - mkdir($opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES'); |
|
38 | + if (!is_dir($opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES')) { |
|
39 | + mkdir($opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES'); |
|
40 | 40 | } |
41 | 41 | |
42 | - $f = fopen($opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES/messages.po', 'w'); |
|
42 | + $f = fopen($opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES/messages.po', 'w'); |
|
43 | 43 | |
44 | - fwrite($f, 'msgid ""' . "\n"); |
|
45 | - fwrite($f, 'msgstr ""' . "\n"); |
|
46 | - fwrite($f, '"MIME-Version: 1.0\n"' . "\n"); |
|
47 | - fwrite($f, '"Content-Type: text/plain; charset=UTF-8\n"' . "\n"); |
|
48 | - fwrite($f, '"Content-Transfer-Encoding: 8bit\n"' . "\n"); |
|
44 | + fwrite($f, 'msgid ""'."\n"); |
|
45 | + fwrite($f, 'msgstr ""'."\n"); |
|
46 | + fwrite($f, '"MIME-Version: 1.0\n"'."\n"); |
|
47 | + fwrite($f, '"Content-Type: text/plain; charset=UTF-8\n"'."\n"); |
|
48 | + fwrite($f, '"Content-Transfer-Encoding: 8bit\n"'."\n"); |
|
49 | 49 | fwrite($f, "\n"); |
50 | 50 | |
51 | 51 | // English texts in sys_trans_text are more up-to-date than the original translation |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | ); |
67 | 67 | |
68 | 68 | $variables = array(); |
69 | - $this->loadNodeTextFile($variables, $opt['logic']['node']['id'] . '.txt', $language_lower); |
|
69 | + $this->loadNodeTextFile($variables, $opt['logic']['node']['id'].'.txt', $language_lower); |
|
70 | 70 | $this->loadNodeTextFile( |
71 | 71 | $variables, |
72 | - $opt['logic']['node']['id'] . '-' . $language_lower . '.txt', |
|
72 | + $opt['logic']['node']['id'].'-'.$language_lower.'.txt', |
|
73 | 73 | $language_lower |
74 | 74 | ); |
75 | 75 | |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | if ($trans !== null && $trans != $r['text']) { |
79 | 79 | $trans = $this->substitueVariables($variables, $language_lower, $trans); |
80 | 80 | |
81 | - fwrite($f, 'msgid "' . $this->escape_text($r['text']) . '"' . "\n"); |
|
82 | - fwrite($f, 'msgstr "' . $this->escape_text($trans) . '"' . "\n"); |
|
81 | + fwrite($f, 'msgid "'.$this->escape_text($r['text']).'"'."\n"); |
|
82 | + fwrite($f, 'msgstr "'.$this->escape_text($trans).'"'."\n"); |
|
83 | 83 | fwrite($f, "\n"); |
84 | 84 | } |
85 | 85 | } |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | |
90 | 90 | try { |
91 | 91 | exec( |
92 | - 'msgfmt -o ' . escapeshellcmd( |
|
93 | - $opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES/messages.mo' |
|
94 | - ) . ' ' . escapeshellcmd( |
|
95 | - $opt['rootpath'] . 'cache2/translate/' . $language_lower . '/LC_MESSAGES/messages.po' |
|
92 | + 'msgfmt -o '.escapeshellcmd( |
|
93 | + $opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES/messages.mo' |
|
94 | + ).' '.escapeshellcmd( |
|
95 | + $opt['rootpath'].'cache2/translate/'.$language_lower.'/LC_MESSAGES/messages.po' |
|
96 | 96 | ) |
97 | 97 | ); |
98 | 98 | } catch (Exception $e) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | sqlf( |
190 | 190 | "INSERT IGNORE INTO `sys_trans_ref` (`trans_id`, `resource_name`, `line`) VALUES ('&1', '&2', 0)", |
191 | 191 | $lastId, |
192 | - 'table:' . $table . ';field=' . $fname |
|
192 | + 'table:'.$table.';field='.$fname |
|
193 | 193 | ); |
194 | 194 | } |
195 | 195 | sql_free_result($rs); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | // generic load |
212 | 212 | global $opt; |
213 | 213 | |
214 | - $filename = $opt['rootpath'] . '/config2/nodetext/' . $file; |
|
214 | + $filename = $opt['rootpath'].'/config2/nodetext/'.$file; |
|
215 | 215 | if (file_exists($filename)) { |
216 | 216 | $fhandle = fopen($filename, 'r'); |
217 | 217 |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8'); |
84 | 84 | } else { |
85 | 85 | // convert smilies ... |
86 | - for ($n = 0; $n < count($smiley['image']); $n ++) { |
|
86 | + for ($n = 0; $n < count($smiley['image']); $n++) { |
|
87 | 87 | $text = mb_ereg_replace( |
88 | - "<img [^>]*?src=[^>]+?" . str_replace('.', '\.', $smiley['file'][$n]) . "[^>]+?>", |
|
89 | - "[s![" . $smiley['text'][$n] . "]!s]", |
|
88 | + "<img [^>]*?src=[^>]+?".str_replace('.', '\.', $smiley['file'][$n])."[^>]+?>", |
|
89 | + "[s![".$smiley['text'][$n]."]!s]", |
|
90 | 90 | $text |
91 | 91 | ); |
92 | 92 | // the [s[ ]s] is needed to protect the spaces around the smileys |
@@ -118,5 +118,5 @@ discard block |
||
118 | 118 | |
119 | 119 | function editorJsPath() |
120 | 120 | { |
121 | - return 'resource2/ocstyle/js/editor.js?ft=' . filemtime('resource2/ocstyle/js/editor.js'); |
|
121 | + return 'resource2/ocstyle/js/editor.js?ft='.filemtime('resource2/ocstyle/js/editor.js'); |
|
122 | 122 | } |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * Unicode Reminder メモ |
6 | 6 | ***************************************************************************/ |
7 | 7 | |
8 | -require_once __DIR__ . '/logic/const.inc.php'; |
|
8 | +require_once __DIR__.'/logic/const.inc.php'; |
|
9 | 9 | |
10 | 10 | class translateAccess |
11 | 11 | { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * TODO: accept-language des Browser auswerten |
11 | 11 | ***************************************************************************/ |
12 | 12 | |
13 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
13 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
14 | 14 | |
15 | 15 | function __autoload($class_name) |
16 | 16 | { |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | return; |
21 | 21 | } |
22 | 22 | |
23 | - $file1 = $opt['rootpath'] . 'lib2/' . $class_name . '.class.php'; |
|
24 | - $file2 = $opt['rootpath'] . 'lib2/logic/' . $class_name . '.class.php'; |
|
23 | + $file1 = $opt['rootpath'].'lib2/'.$class_name.'.class.php'; |
|
24 | + $file2 = $opt['rootpath'].'lib2/logic/'.$class_name.'.class.php'; |
|
25 | 25 | if (file_exists($file1)) { |
26 | 26 | require_once $file1; |
27 | 27 | } elseif (file_exists($file2)) { |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | mb_regex_encoding('UTF-8'); |
44 | 44 | |
45 | 45 | // set options |
46 | -require_once $opt['rootpath'] . 'config2/settings-dist.inc.php'; |
|
47 | -require_once $opt['rootpath'] . 'config2/settings.inc.php'; |
|
48 | -require_once $opt['rootpath'] . 'config2/verify-settings.inc.php'; |
|
46 | +require_once $opt['rootpath'].'config2/settings-dist.inc.php'; |
|
47 | +require_once $opt['rootpath'].'config2/settings.inc.php'; |
|
48 | +require_once $opt['rootpath'].'config2/verify-settings.inc.php'; |
|
49 | 49 | |
50 | 50 | foreach ($opt['page']['banned_user_agents'] as $ua) { |
51 | 51 | if (strpos($useragent, $ua) !== false) { |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | -require_once $opt['rootpath'] . 'lib2/errorhandler.inc.php'; |
|
72 | +require_once $opt['rootpath'].'lib2/errorhandler.inc.php'; |
|
73 | 73 | configure_php(); |
74 | 74 | |
75 | -require $opt['rootpath'] . 'lib2/cookie.class.php'; |
|
75 | +require $opt['rootpath'].'lib2/cookie.class.php'; |
|
76 | 76 | normalize_settings(); |
77 | 77 | set_language(); |
78 | 78 | set_usercountry(); |
@@ -85,30 +85,30 @@ discard block |
||
85 | 85 | $opt['template']['style'] = $opt['template']['default']['style']; |
86 | 86 | } |
87 | 87 | |
88 | - if (!is_dir($opt['rootpath'] . 'templates2/' . $opt['template']['style'])) { |
|
88 | + if (!is_dir($opt['rootpath'].'templates2/'.$opt['template']['style'])) { |
|
89 | 89 | $opt['template']['style'] = $opt['template']['default']['style']; |
90 | 90 | } |
91 | 91 | } else { |
92 | 92 | $opt['template']['style'] = $opt['template']['default']['style']; |
93 | 93 | } |
94 | -$opt['stylepath'] = $opt['rootpath'] . 'templates2/' . $opt['template']['style'] . '/'; |
|
94 | +$opt['stylepath'] = $opt['rootpath'].'templates2/'.$opt['template']['style'].'/'; |
|
95 | 95 | |
96 | 96 | check_useragent(); |
97 | 97 | |
98 | 98 | /* setup smarty |
99 | 99 | * |
100 | 100 | */ |
101 | -require $opt['rootpath'] . 'lib2/OcSmarty.class.php'; |
|
101 | +require $opt['rootpath'].'lib2/OcSmarty.class.php'; |
|
102 | 102 | $tpl = new OcSmarty(); |
103 | 103 | |
104 | 104 | // include all we need |
105 | -require_once $opt['rootpath'] . 'lib2/logic/const.inc.php'; |
|
106 | -require_once $opt['rootpath'] . 'lib2/error.inc.php'; |
|
107 | -require_once $opt['rootpath'] . 'lib2/util.inc.php'; |
|
108 | -require_once $opt['rootpath'] . 'lib2/db.inc.php'; |
|
109 | -require_once $opt['rootpath'] . 'lib2/login.class.php'; |
|
110 | -require_once $opt['rootpath'] . 'lib2/menu.class.php'; |
|
111 | -require_once $opt['rootpath'] . 'lib2/logic/labels.inc.php'; |
|
105 | +require_once $opt['rootpath'].'lib2/logic/const.inc.php'; |
|
106 | +require_once $opt['rootpath'].'lib2/error.inc.php'; |
|
107 | +require_once $opt['rootpath'].'lib2/util.inc.php'; |
|
108 | +require_once $opt['rootpath'].'lib2/db.inc.php'; |
|
109 | +require_once $opt['rootpath'].'lib2/login.class.php'; |
|
110 | +require_once $opt['rootpath'].'lib2/menu.class.php'; |
|
111 | +require_once $opt['rootpath'].'lib2/logic/labels.inc.php'; |
|
112 | 112 | // require_once $opt['rootpath'] . 'lib2/throttle.inc.php'; |
113 | 113 | |
114 | 114 | // apply post configuration |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $login->userid > 0 && |
124 | 124 | sql_value("SELECT `email_problems` FROM `user` WHERE `user_id`='&1'", 0, $login->userid) != 0 |
125 | 125 | ) { |
126 | - header("Location: verifyemail.php?page=" . basename($_SERVER['REQUEST_URI'])); |
|
126 | + header("Location: verifyemail.php?page=".basename($_SERVER['REQUEST_URI'])); |
|
127 | 127 | exit; |
128 | 128 | } |
129 | 129 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | if (isset($opt['logic']['cachemaps']['wmsurl']) && strstr($opt['logic']['cachemaps']['wmsurl'], '://')) { |
151 | - $opt['logic']['cachemaps']['wmsurl'] = $opt['page']['protocol'] . strstr( |
|
151 | + $opt['logic']['cachemaps']['wmsurl'] = $opt['page']['protocol'].strstr( |
|
152 | 152 | $opt['logic']['cachemaps']['wmsurl'], |
153 | 153 | '://' |
154 | 154 | ); |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $cookie->set('locale', $opt['template']['locale'], $opt['template']['default']['locale']); |
237 | 237 | } |
238 | 238 | |
239 | - bindtextdomain('messages', $opt['rootpath'] . 'cache2/translate'); |
|
239 | + bindtextdomain('messages', $opt['rootpath'].'cache2/translate'); |
|
240 | 240 | set_php_locale(); |
241 | 241 | textdomain('messages'); |
242 | 242 | } |
@@ -277,13 +277,13 @@ discard block |
||
277 | 277 | if (strtolower(substr($url, 0, strlen($opt['page']['absolute_http_url']))) == $opt['page']['absolute_http_url'] |
278 | 278 | && $opt['page']['https']['active'] |
279 | 279 | ) { |
280 | - return 'https' . strstr($url, '://'); |
|
280 | + return 'https'.strstr($url, '://'); |
|
281 | 281 | } elseif (strtolower( |
282 | 282 | substr($url, 0, strlen($opt['page']['absolute_https_url'])) |
283 | 283 | ) == $opt['page']['absolute_https_url'] |
284 | 284 | && !$opt['page']['https']['active'] |
285 | 285 | ) { |
286 | - return 'http' . strstr($url, '://'); |
|
286 | + return 'http'.strstr($url, '://'); |
|
287 | 287 | } else { |
288 | 288 | return $url; |
289 | 289 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * This modules gives you a very usefull SQL debugger for MySQL ... |
8 | 8 | ***************************************************************************/ |
9 | 9 | |
10 | -require_once $opt['rootpath'] . 'lib2/bench.inc.php'; |
|
10 | +require_once $opt['rootpath'].'lib2/bench.inc.php'; |
|
11 | 11 | |
12 | 12 | $sqldebugger = new sqldebugger(); |
13 | 13 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $command['mode'] = $db['mode']; |
49 | 49 | $command['slave'] = $bQuerySlave; |
50 | 50 | $command['server'] = $sServer; |
51 | - $command['dblink'] = '' . $dblink; |
|
51 | + $command['dblink'] = ''.$dblink; |
|
52 | 52 | |
53 | 53 | $bUseExplain = false; |
54 | 54 | $sql = trim($sql); |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | break; |
75 | 75 | } |
76 | 76 | $command['result'][] = $r; |
77 | - $c ++; |
|
77 | + $c++; |
|
78 | 78 | } |
79 | 79 | sql_free_result($rs); |
80 | 80 | |
81 | - $rs = mysql_query('EXPLAIN EXTENDED ' . $sqlexplain, $dblink); |
|
81 | + $rs = mysql_query('EXPLAIN EXTENDED '.$sqlexplain, $dblink); |
|
82 | 82 | while ($r = sql_fetch_assoc($rs)) { |
83 | 83 | $command['explain'][] = $r; |
84 | 84 | } |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | return ''; |
127 | 127 | } |
128 | 128 | |
129 | - return 'SELECT * ' . substr($sql, $start); |
|
129 | + return 'SELECT * '.substr($sql, $start); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | public function insert_nocache($sql) |
133 | 133 | { |
134 | 134 | if (strtoupper(substr($sql, 0, 7)) == 'SELECT ') { |
135 | - $sql = 'SELECT SQL_NO_CACHE ' . substr($sql, 7); |
|
135 | + $sql = 'SELECT SQL_NO_CACHE '.substr($sql, 7); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | return $sql; |