@@ -13,6 +13,7 @@ |
||
| 13 | 13 | * |
| 14 | 14 | * @param int $items number of feeditems to parse from feed |
| 15 | 15 | * @param string $url url of the feed to parse |
| 16 | + * @param boolean $includetext |
|
| 16 | 17 | * |
| 17 | 18 | * @return string $item feeditems as HTML-string |
| 18 | 19 | */ |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | 'description' => $item->description |
| 67 | 67 | ); |
| 68 | 68 | // increment counter |
| 69 | - $i ++; |
|
| 69 | + $i++; |
|
| 70 | 70 | // htmlspecialchars_decode() works around inconsistent HTML encoding |
| 71 | 71 | // e.g. in SMF Forum Threads |
| 72 | 72 | } elseif (!in_array(htmlspecialchars_decode($item->title), $headlines) && |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ); |
| 81 | 81 | $headlines[] = "" . htmlspecialchars_decode($item->title); |
| 82 | 82 | // increment counter |
| 83 | - $i ++; |
|
| 83 | + $i++; |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -159,6 +159,9 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | // str = long text |
| 162 | +/** |
|
| 163 | + * @param boolean $simple |
|
| 164 | + */ |
|
| 162 | 165 | function ftsearch_split(&$str, $simple) |
| 163 | 166 | { |
| 164 | 167 | global $ftsearch_ignores; |
@@ -488,6 +491,9 @@ discard block |
||
| 488 | 491 | sql("DELETE FROM `search_index_times` WHERE `object_type`='&1' AND `object_id`='&2'", $object_type, $object_id); |
| 489 | 492 | } |
| 490 | 493 | |
| 494 | +/** |
|
| 495 | + * @param integer $object_type |
|
| 496 | + */ |
|
| 491 | 497 | function ftsearch_set_entries($object_type, $object_id, $cache_id, &$text, $last_modified) |
| 492 | 498 | { |
| 493 | 499 | ftsearch_delete_entries($object_type, $object_id, $cache_id); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $str = ''; |
| 189 | 189 | |
| 190 | 190 | ftsearch_load_ignores(); |
| 191 | - for ($i = count($astr) - 1; $i >= 0; $i --) { |
|
| 191 | + for ($i = count($astr) - 1; $i >= 0; $i--) { |
|
| 192 | 192 | // ignore? |
| 193 | 193 | if (array_search(mb_strtolower($astr[$i]), $ftsearch_ignores) !== false) { |
| 194 | 194 | unset($astr[$i]); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | // doppelte chars ersetzen |
| 240 | - for ($c = ord('a'); $c <= ord('z'); $c ++) { |
|
| 240 | + for ($c = ord('a'); $c <= ord('z'); $c++) { |
|
| 241 | 241 | $old_str = ''; |
| 242 | 242 | while ($old_str != $str) { |
| 243 | 243 | $old_str = $str; |
@@ -569,6 +569,9 @@ |
||
| 569 | 569 | return $str; |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | +/** |
|
| 573 | + * @return string |
|
| 574 | + */ |
|
| 572 | 575 | function changePlaceholder($str, $inverse = false) |
| 573 | 576 | { |
| 574 | 577 | static $translate = array( |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | $thislog = mb_ereg_replace('{username}', text_xmlentities($rLog['username']), $thislog); |
| 391 | 391 | |
| 392 | 392 | if ($rLog['type'] == 3 && $rLog['needs_maintenance'] == 2) { |
| 393 | - $logtype = 'Needs Maintenance'; // with capital M, other than cache attribute |
|
| 393 | + $logtype = 'Needs Maintenance'; // with capital M, other than cache attribute |
|
| 394 | 394 | } elseif (isset($gpxLogType[$rLog['type']])) { |
| 395 | 395 | $logtype = $gpxLogType[$rLog['type']]; |
| 396 | 396 | } else { |
@@ -511,28 +511,28 @@ discard block |
||
| 511 | 511 | switch ($childWaypoint['type']) { |
| 512 | 512 | case 1: |
| 513 | 513 | $wp_typename = "Parking Area"; |
| 514 | - break; // well-known garmin symbols |
|
| 514 | + break; // well-known garmin symbols |
|
| 515 | 515 | case 2: |
| 516 | 516 | $wp_typename = "Flag, Green"; |
| 517 | - break; // stage / ref point |
|
| 517 | + break; // stage / ref point |
|
| 518 | 518 | case 3: |
| 519 | 519 | $wp_typename = "Flag, Blue"; |
| 520 | - break; // path |
|
| 520 | + break; // path |
|
| 521 | 521 | case 4: |
| 522 | 522 | $wp_typename = "Circle with X"; |
| 523 | 523 | break; // final |
| 524 | 524 | case 5: |
| 525 | 525 | $wp_typename = "Diamond, Green"; |
| 526 | - break; // point of interest |
|
| 526 | + break; // point of interest |
|
| 527 | 527 | default: |
| 528 | 528 | $wp_typename = "Flag, Blue"; |
| 529 | - break; // for the case new types are forgotten here .. |
|
| 529 | + break; // for the case new types are forgotten here .. |
|
| 530 | 530 | } |
| 531 | 531 | $thiswp = mb_ereg_replace('{type}', text_xmlentities($wp_typename), $thiswp); |
| 532 | 532 | $thiswp = mb_ereg_replace('{parent}', $r['waypoint'], $thiswp); |
| 533 | 533 | $thiswp = mb_ereg_replace('{cacheid}', $r['cacheid'], $thiswp); |
| 534 | 534 | $waypoints .= $thiswp; |
| 535 | - ++ $n; |
|
| 535 | + ++$n; |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | if ($cacheNote && !empty($cacheNote['latitude']) && !empty($cacheNote['longitude'])) { |
@@ -202,6 +202,10 @@ |
||
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| 205 | +/** |
|
| 206 | + * @param string $interval |
|
| 207 | + * @param string $dateTimeEnd |
|
| 208 | + */ |
|
| 205 | 209 | function dateDiff($interval, $dateTimeBegin, $dateTimeEnd) |
| 206 | 210 | { |
| 207 | 211 | //Parse about any English textual datetime |
@@ -203,6 +203,9 @@ |
||
| 203 | 203 | return $str; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | +/** |
|
| 207 | + * @param string $str |
|
| 208 | + */ |
|
| 206 | 209 | function lf2crlf($str) |
| 207 | 210 | { |
| 208 | 211 | return str_replace("\r\r\n", "\r\n", str_replace("\n", "\r\n", $str)); |
@@ -107,6 +107,9 @@ discard block |
||
| 107 | 107 | return $rsResult; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | + /** |
|
| 111 | + * @param string $sql |
|
| 112 | + */ |
|
| 110 | 113 | public function strip_temptable($sql) |
| 111 | 114 | { |
| 112 | 115 | $start = stripos($sql, 'SELECT '); |
@@ -118,6 +121,9 @@ discard block |
||
| 118 | 121 | return substr($sql, $start); |
| 119 | 122 | } |
| 120 | 123 | |
| 124 | + /** |
|
| 125 | + * @param string $sql |
|
| 126 | + */ |
|
| 121 | 127 | public function strip_from($sql) |
| 122 | 128 | { |
| 123 | 129 | $start = stripos($sql, 'FROM '); |
@@ -129,6 +135,9 @@ discard block |
||
| 129 | 135 | return 'SELECT * ' . substr($sql, $start); |
| 130 | 136 | } |
| 131 | 137 | |
| 138 | + /** |
|
| 139 | + * @param string $sql |
|
| 140 | + */ |
|
| 132 | 141 | public function insert_nocache($sql) |
| 133 | 142 | { |
| 134 | 143 | if (strtoupper(substr($sql, 0, 7)) == 'SELECT ') { |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | break; |
| 75 | 75 | } |
| 76 | 76 | $command['result'][] = $r; |
| 77 | - $c ++; |
|
| 77 | + $c++; |
|
| 78 | 78 | } |
| 79 | 79 | sql_free_result($rs); |
| 80 | 80 | |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | /** Removes entry from the archive. |
| 284 | 284 | * please be very carefull with this function, there is no undo after you save the archive |
| 285 | 285 | * |
| 286 | - * @return bool true on success or false on failure |
|
| 286 | + * @return boolean|null true on success or false on failure |
|
| 287 | 287 | * |
| 288 | 288 | * @param int $idx |
| 289 | 289 | */ |
@@ -334,6 +334,10 @@ discard block |
||
| 334 | 334 | return $idx >= 0 and $idx < $this->cnt; |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | + /** |
|
| 338 | + * @param string $name |
|
| 339 | + * @param string $data |
|
| 340 | + */ |
|
| 337 | 341 | public function _write($name, $data) |
| 338 | 342 | { |
| 339 | 343 | $fp = fopen($name, "w"); |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | } |
| 145 | 145 | $fnl = strlen($filename); |
| 146 | - $fh = "\x14\x00"; // ver needed to extract |
|
| 147 | - $fh .= "\x00\x00"; // gen purpose bit flag |
|
| 148 | - $fh .= "\x08\x00"; // compression method |
|
| 146 | + $fh = "\x14\x00"; // ver needed to extract |
|
| 147 | + $fh .= "\x00\x00"; // gen purpose bit flag |
|
| 148 | + $fh .= "\x08\x00"; // compression method |
|
| 149 | 149 | $fh .= "\x00\x00\x00\x00"; // last mod time and date |
| 150 | 150 | $fh .= pack( |
| 151 | 151 | "V3v2", |
@@ -170,16 +170,16 @@ discard block |
||
| 170 | 170 | "va*v3V2", |
| 171 | 171 | 0, |
| 172 | 172 | $fh, |
| 173 | - 0, // file comment length |
|
| 174 | - 0, // disk number start |
|
| 175 | - 0, // internal file attributes |
|
| 176 | - $attr, // external file attributes - 'archive/directory' bit set |
|
| 173 | + 0, // file comment length |
|
| 174 | + 0, // disk number start |
|
| 175 | + 0, // internal file attributes |
|
| 176 | + $attr, // external file attributes - 'archive/directory' bit set |
|
| 177 | 177 | $this->offset |
| 178 | 178 | ) . $filename; |
| 179 | 179 | |
| 180 | 180 | $this->offset += 42 + $fnl + $gzsize; |
| 181 | 181 | $this->cdir[] = $cdir; |
| 182 | - $this->cnt ++; |
|
| 182 | + $this->cnt++; |
|
| 183 | 183 | $this->idx = $this->cnt - 1; |
| 184 | 184 | } |
| 185 | 185 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $cdsl, // size of central dir |
| 229 | 229 | $zdsl, // offset to start of central dir |
| 230 | 230 | 0 |
| 231 | - ); // .zip file comment length |
|
| 231 | + ); // .zip file comment length |
|
| 232 | 232 | return $this->zipfile; |
| 233 | 233 | } |
| 234 | 234 | |
@@ -84,6 +84,9 @@ |
||
| 84 | 84 | return $text; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | + /** |
|
| 88 | + * @return string |
|
| 89 | + */ |
|
| 87 | 90 | public function v($message) |
| 88 | 91 | { |
| 89 | 92 | if ($message) { |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | public function t($message, $style, $resource_name, $line, $plural = '', $count = 1, $lang = null) |
| 34 | 34 | { |
| 35 | - global $opt, $locale; // $locale is for lib1 compatibility |
|
| 35 | + global $opt, $locale; // $locale is for lib1 compatibility |
|
| 36 | 36 | |
| 37 | 37 | if ($message == '') { |
| 38 | 38 | return ''; |
@@ -76,6 +76,10 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | + /** |
|
| 80 | + * @param string $sCode |
|
| 81 | + * @param integer $nStartSearch |
|
| 82 | + */ |
|
| 79 | 83 | public function findEndOfPHPString($sCode, $nStartSearch) |
| 80 | 84 | { |
| 81 | 85 | $nEnd = 0; |
@@ -116,6 +120,10 @@ discard block |
||
| 116 | 120 | } |
| 117 | 121 | |
| 118 | 122 | // TODO: performance ... scan once at __construct and store line positions |
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * @param integer $nPos |
|
| 126 | + */ |
|
| 119 | 127 | public function findLineOfPos($nPos) |
| 120 | 128 | { |
| 121 | 129 | $nLine = 1; |
@@ -120,9 +120,9 @@ |
||
| 120 | 120 | { |
| 121 | 121 | $nLine = 1; |
| 122 | 122 | |
| 123 | - for ($n = 0; $n < $nPos; $n ++) { |
|
| 123 | + for ($n = 0; $n < $nPos; $n++) { |
|
| 124 | 124 | if (substr($this->msContent, $n, 1) == "\n") { |
| 125 | - $nLine ++; |
|
| 125 | + $nLine++; |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |