@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $message = ''; |
| 130 | 130 | |
| 131 | 131 | if (!is_array($this->errors)) { |
| 132 | - $this->errors = array((string) $this->errors); |
|
| 132 | + $this->errors = array((string)$this->errors); |
|
| 133 | 133 | } |
| 134 | 134 | foreach ($this->errors as $error) { |
| 135 | 135 | $message .= $error."\n"; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | $oldreadOnly = $this->readOnly; |
| 192 | - $this->readOnly = (bool) $readOnly; |
|
| 192 | + $this->readOnly = (bool)$readOnly; |
|
| 193 | 193 | |
| 194 | 194 | return $oldreadOnly; |
| 195 | 195 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | if (false !== $this->ldap->getDn($login)) { |
| 218 | - $this->activeServer = (int) $key; |
|
| 218 | + $this->activeServer = (int)$key; |
|
| 219 | 219 | break; |
| 220 | 220 | } |
| 221 | 221 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | if (false !== $this->ldap->getDn($login)) { |
| 291 | - $this->activeServer = (int) $key; |
|
| 291 | + $this->activeServer = (int)$key; |
|
| 292 | 292 | break; |
| 293 | 293 | } |
| 294 | 294 | } |
@@ -479,8 +479,8 @@ |
||
| 479 | 479 | %sfaqcaptcha |
| 480 | 480 | WHERE |
| 481 | 481 | id = '%s'", |
| 482 | - PMF_Db::getTablePrefix(), |
|
| 483 | - $this->code |
|
| 482 | + PMF_Db::getTablePrefix(), |
|
| 483 | + $this->code |
|
| 484 | 484 | ); |
| 485 | 485 | |
| 486 | 486 | $result = $this->_config->getDb()->query($select); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $this->drawText(); |
| 210 | 210 | if (function_exists('imagejpeg')) { |
| 211 | 211 | header('Content-Type: image/jpeg'); |
| 212 | - imagejpeg($this->img, null, (int) $this->quality); |
|
| 212 | + imagejpeg($this->img, null, (int)$this->quality); |
|
| 213 | 213 | } elseif (function_exists('imagegif')) { |
| 214 | 214 | header('Content-Type: image/gif'); |
| 215 | 215 | imagegif($this->img); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $w1 = 0; |
| 318 | 318 | $w2 = 0; |
| 319 | 319 | |
| 320 | - for ($x = 0; $x < $this->width; $x += (int) $nextline) { |
|
| 320 | + for ($x = 0; $x < $this->width; $x += (int)$nextline) { |
|
| 321 | 321 | if ($x < $this->width) { |
| 322 | 322 | imageline($this->img, $x + $w1, 0, $x + $w2, $this->height - 1, rand($color1, $color2)); |
| 323 | 323 | } |
@@ -348,18 +348,18 @@ discard block |
||
| 348 | 348 | { |
| 349 | 349 | $len = PMF_String::strlen($this->code); |
| 350 | 350 | $w1 = 15; |
| 351 | - $w2 = $this->width / ($len + 1); |
|
| 351 | + $w2 = $this->width/($len + 1); |
|
| 352 | 352 | |
| 353 | 353 | for ($p = 0; $p < $len; ++$p) { |
| 354 | 354 | $letter = $this->code[$p]; |
| 355 | 355 | if (count($this->fonts) > 0) { |
| 356 | 356 | $font = $this->fonts[rand(0, count($this->fonts) - 1)]; |
| 357 | 357 | } |
| 358 | - $size = rand(20, $this->height / 2.2); |
|
| 358 | + $size = rand(20, $this->height/2.2); |
|
| 359 | 359 | $rotation = rand(-23, 23); |
| 360 | 360 | $y = rand($size + 3, $this->height - 5); |
| 361 | 361 | // $w1 += rand(- $this->width / 90, $this->width / 40 ); |
| 362 | - $x = $w1 + $w2 * $p; |
|
| 362 | + $x = $w1 + $w2*$p; |
|
| 363 | 363 | $c1 = []; // fore char color |
| 364 | 364 | $c2 = []; // back char color |
| 365 | 365 | do { |
@@ -373,28 +373,28 @@ discard block |
||
| 373 | 373 | } while ($c1['b'] == $this->_backgroundColor['b']); |
| 374 | 374 | $c1 = imagecolorallocate($this->img, $c1['r'], $c1['g'], $c1['b']); |
| 375 | 375 | do { |
| 376 | - $c2['r'] = ($c1['r'] < 100 ? $c1['r'] * 2 : mt_rand(30, 199)); |
|
| 376 | + $c2['r'] = ($c1['r'] < 100 ? $c1['r']*2 : mt_rand(30, 199)); |
|
| 377 | 377 | } while (($c2['r'] == $this->_backgroundColor['r']) && ($c2['r'] == $c1['r'])); |
| 378 | 378 | do { |
| 379 | - $c2['g'] = ($c1['g'] < 100 ? $c1['g'] * 2 : mt_rand(30, 199)); |
|
| 379 | + $c2['g'] = ($c1['g'] < 100 ? $c1['g']*2 : mt_rand(30, 199)); |
|
| 380 | 380 | } while (($c2['g'] == $this->_backgroundColor['g']) && ($c2['g'] == $c1['g'])); |
| 381 | 381 | do { |
| 382 | - $c2['b'] = ($c1['b'] < 100 ? $c1['b'] * 2 : mt_rand(30, 199)); |
|
| 382 | + $c2['b'] = ($c1['b'] < 100 ? $c1['b']*2 : mt_rand(30, 199)); |
|
| 383 | 383 | } while (($c2['b'] == $this->_backgroundColor['b']) && ($c2['b'] == $c1['b'])); |
| 384 | 384 | $c2 = imagecolorallocate($this->img, $c2['r'], $c2['g'], $c2['b']); |
| 385 | 385 | // Add the letter |
| 386 | 386 | if (function_exists('imagettftext') && (count($this->fonts) > 0)) { |
| 387 | - imagettftext($this->img, $size, $rotation, $x + 2, $y, $c2, $font, $letter); |
|
| 387 | + imagettftext($this->img, $size, $rotation, $x + 2, $y, $c2, $font, $letter); |
|
| 388 | 388 | imagettftext($this->img, $size, $rotation, $x + 1, $y + 1, $c2, $font, $letter); |
| 389 | - imagettftext($this->img, $size, $rotation, $x, $y - 2, $c1, $font, $letter); |
|
| 389 | + imagettftext($this->img, $size, $rotation, $x, $y - 2, $c1, $font, $letter); |
|
| 390 | 390 | } else { |
| 391 | 391 | $size = 5; |
| 392 | 392 | $c3 = imagecolorallocate($this->img, 0, 0, 255); |
| 393 | 393 | $x = 20; |
| 394 | 394 | $y = 12; |
| 395 | 395 | $s = 30; |
| 396 | - imagestring($this->img, $size, $x + 1 + ($s * $p), $y + 1, $letter, $c3); |
|
| 397 | - imagestring($this->img, $size, $x + ($s * $p), $y, $letter, $c1); |
|
| 396 | + imagestring($this->img, $size, $x + 1 + ($s*$p), $y + 1, $letter, $c3); |
|
| 397 | + imagestring($this->img, $size, $x + ($s*$p), $y, $letter, $c1); |
|
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | |
@@ -1353,9 +1353,9 @@ discard block |
||
| 1353 | 1353 | id = %d |
| 1354 | 1354 | AND |
| 1355 | 1355 | lang = '%s'", |
| 1356 | - PMF_Db::getTablePrefix(), |
|
| 1357 | - $category_id, |
|
| 1358 | - $language); |
|
| 1356 | + PMF_Db::getTablePrefix(), |
|
| 1357 | + $category_id, |
|
| 1358 | + $language); |
|
| 1359 | 1359 | $result = $this->_config->getDb()->query($query); |
| 1360 | 1360 | if ($row = $this->_config->getDb()->fetchArray($result)) { |
| 1361 | 1361 | $translated[$languageCodes[strtoupper($language)]] = $row['name'].('' == $row['description'] ? '' : ' ('.$row['description'].')'); |
@@ -1614,8 +1614,8 @@ discard block |
||
| 1614 | 1614 | fd.lang = fcr.category_lang |
| 1615 | 1615 | ORDER BY |
| 1616 | 1616 | fcr.category_id, fd.id', |
| 1617 | - PMF_Db::getTablePrefix(), |
|
| 1618 | - PMF_Db::getTablePrefix()); |
|
| 1617 | + PMF_Db::getTablePrefix(), |
|
| 1618 | + PMF_Db::getTablePrefix()); |
|
| 1619 | 1619 | $result = $this->_config->getDb()->query($query); |
| 1620 | 1620 | |
| 1621 | 1621 | if ($this->_config->getDb()->numRows($result) > 0) { |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | 'minus' => '-', |
| 123 | 123 | 'space' => ' ', |
| 124 | 124 | 'angle' => '-', |
| 125 | - 'medium' => '|-', ); |
|
| 125 | + 'medium' => '|-',); |
|
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * Constructor. |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $result = $this->_config->getDb()->query($query); |
| 328 | 328 | |
| 329 | 329 | while ($row = $this->_config->getDb()->fetchArray($result)) { |
| 330 | - $categories[] = (int) $row['id']; |
|
| 330 | + $categories[] = (int)$row['id']; |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | return $categories; |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | $open = 0; |
| 650 | 650 | $this->expandAll(); |
| 651 | 651 | |
| 652 | - for ($y = 0;$y < $this->height(); $y = $this->getNextLineTree($y)) { |
|
| 652 | + for ($y = 0; $y < $this->height(); $y = $this->getNextLineTree($y)) { |
|
| 653 | 653 | list($hasChild, $categoryName, $parent, $description) = $this->getLineDisplay($y); |
| 654 | 654 | $level = $this->treeTab[$y]['level']; |
| 655 | 655 | $leveldiff = $open - $level; |
@@ -925,7 +925,7 @@ discard block |
||
| 925 | 925 | while ($row = $this->_config->getDb()->fetchObject($result)) { |
| 926 | 926 | $categories[$row->category_id] = array( |
| 927 | 927 | 'category_id' => $row->category_id, |
| 928 | - 'category_lang' => $row->category_lang, ); |
|
| 928 | + 'category_lang' => $row->category_lang,); |
|
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | return $categories; |
@@ -1221,7 +1221,7 @@ discard block |
||
| 1221 | 1221 | array('faqcategories' => 'parent_id'), |
| 1222 | 1222 | array('faqcategoryrelations' => 'category_id'), |
| 1223 | 1223 | array('faqcategory_group' => 'category_id'), |
| 1224 | - array('faqcategory_user' => 'category_id'), ); |
|
| 1224 | + array('faqcategory_user' => 'category_id'),); |
|
| 1225 | 1225 | |
| 1226 | 1226 | $result = true; |
| 1227 | 1227 | foreach ($tables as $pair) { |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | if ($lang == $selected_lang) { |
| 1416 | 1416 | $output .= ' selected="selected"'; |
| 1417 | 1417 | } |
| 1418 | - $output .= '>'.$langname."</option>\n"; |
|
| 1418 | + $output .= '>'.$langname."</option>\n"; |
|
| 1419 | 1419 | } |
| 1420 | 1420 | } |
| 1421 | 1421 | |
@@ -102,10 +102,10 @@ discard block |
||
| 102 | 102 | private function setConnectionOptions($user, $passwd, $database) |
| 103 | 103 | { |
| 104 | 104 | $this->connectionOptions = array( |
| 105 | - 'UID' => $user, |
|
| 106 | - 'PWD' => $passwd, |
|
| 107 | - 'Database' => $database, |
|
| 108 | - 'CharacterSet' => 'UTF-8', ); |
|
| 105 | + 'UID' => $user, |
|
| 106 | + 'PWD' => $passwd, |
|
| 107 | + 'Database' => $database, |
|
| 108 | + 'CharacterSet' => 'UTF-8', ); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -262,8 +262,8 @@ discard block |
||
| 262 | 262 | max(%s) as current_id |
| 263 | 263 | FROM |
| 264 | 264 | %s', |
| 265 | - $id, |
|
| 266 | - $table); |
|
| 265 | + $id, |
|
| 266 | + $table); |
|
| 267 | 267 | |
| 268 | 268 | $result = $this->query($select); |
| 269 | 269 | sqlsrv_fetch($result); |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | 'UID' => $user, |
| 106 | 106 | 'PWD' => $passwd, |
| 107 | 107 | 'Database' => $database, |
| 108 | - 'CharacterSet' => 'UTF-8', ); |
|
| 108 | + 'CharacterSet' => 'UTF-8',); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -139,7 +139,7 @@ |
||
| 139 | 139 | public function error() |
| 140 | 140 | { |
| 141 | 141 | if (!is_array($this->errors)) { |
| 142 | - $this->errors = array((string) $this->errors); |
|
| 142 | + $this->errors = array((string)$this->errors); |
|
| 143 | 143 | } |
| 144 | 144 | $message = ''; |
| 145 | 145 | foreach ($this->errors as $error) { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | /* |
| 184 | 184 | * reduction factor for small font |
| 185 | 185 | */ |
| 186 | -define('K_SMALL_RATIO', 2 / 3); |
|
| 186 | +define('K_SMALL_RATIO', 2/3); |
|
| 187 | 187 | |
| 188 | 188 | require K_PATH_MAIN.'/tcpdf.php'; |
| 189 | 189 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | // Set font |
| 309 | 309 | if (array_key_exists($PMF_LANG['metaLanguage'], $this->fontFiles)) { |
| 310 | - $this->currentFont = (string) $this->fontFiles[$PMF_LANG['metaLanguage']]; |
|
| 310 | + $this->currentFont = (string)$this->fontFiles[$PMF_LANG['metaLanguage']]; |
|
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
@@ -82,13 +82,13 @@ |
||
| 82 | 82 | $faqdata = $this->faq->get(FAQ_QUERY_TYPE_EXPORT_XHTML, $categoryId, $downwards, $language); |
| 83 | 83 | $version = $this->_config->get('main.currentVersion'); |
| 84 | 84 | $comment = sprintf('XHTML output by phpMyFAQ %s | Date: %s', |
| 85 | - $version, |
|
| 86 | - PMF_Date::createIsoDate(date('YmdHis'))); |
|
| 85 | + $version, |
|
| 86 | + PMF_Date::createIsoDate(date('YmdHis'))); |
|
| 87 | 87 | |
| 88 | 88 | $this->xml->startDocument('1.0', 'utf-8'); |
| 89 | 89 | $this->xml->writeDtd('html', |
| 90 | - '-//W3C//DTD XHTML 1.0 Transitional//EN', |
|
| 91 | - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'); |
|
| 90 | + '-//W3C//DTD XHTML 1.0 Transitional//EN', |
|
| 91 | + 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'); |
|
| 92 | 92 | $this->xml->startElement('html'); |
| 93 | 93 | $this->xml->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml'); |
| 94 | 94 | $this->xml->writeAttribute('xml:lang', $language); |
@@ -80,8 +80,8 @@ |
||
| 80 | 80 | $faqdata = $this->faq->get(FAQ_QUERY_TYPE_EXPORT_XML, $categoryId, $downwards, $language); |
| 81 | 81 | $version = $this->_config->get('main.currentVersion'); |
| 82 | 82 | $comment = sprintf('XML output by phpMyFAQ %s | Date: %s', |
| 83 | - $version, |
|
| 84 | - PMF_Date::createIsoDate(date('YmdHis'))); |
|
| 83 | + $version, |
|
| 84 | + PMF_Date::createIsoDate(date('YmdHis'))); |
|
| 85 | 85 | |
| 86 | 86 | $this->xml->startDocument('1.0', 'utf-8', 'yes'); |
| 87 | 87 | $this->xml->writeComment($comment); |