@@ -179,12 +179,12 @@ |
||
179 | 179 | $b1_rad = (90 - $latFrom) * 3.14159 / 180; |
180 | 180 | $l1_deg = $lonFrom; |
181 | 181 | |
182 | - $lonField = '`' . sql_escape_backtick($tableName) . '`.`' . sql_escape_backtick($lonField) . '`'; |
|
183 | - $latField = '`' . sql_escape_backtick($tableName) . '`.`' . sql_escape_backtick($latField) . '`'; |
|
182 | + $lonField = '`'.sql_escape_backtick($tableName).'`.`'.sql_escape_backtick($lonField).'`'; |
|
183 | + $latField = '`'.sql_escape_backtick($tableName).'`.`'.sql_escape_backtick($latField).'`'; |
|
184 | 184 | |
185 | 185 | $r = 6370 * $distanceMultiplier; |
186 | 186 | |
187 | - $retval = 'acos(cos(' . $b1_rad . ') * cos((90-' . $latField . ') * 3.14159 / 180) + sin(' . $b1_rad . ') * sin((90-' . $latField . ') * 3.14159 / 180) * cos((' . $l1_deg . '-' . $lonField . ') * 3.14159 / 180)) * ' . $r; |
|
187 | + $retval = 'acos(cos('.$b1_rad.') * cos((90-'.$latField.') * 3.14159 / 180) + sin('.$b1_rad.') * sin((90-'.$latField.') * 3.14159 / 180) * cos(('.$l1_deg.'-'.$lonField.') * 3.14159 / 180)) * '.$r; |
|
188 | 188 | |
189 | 189 | return $retval; |
190 | 190 | } |
@@ -6,11 +6,11 @@ discard block |
||
6 | 6 | ***************************************************************************/ |
7 | 7 | |
8 | 8 | // try to include cache file |
9 | -if (!file_exists($opt['rootpath'] . 'cache2/labels-' . $opt['template']['locale'] . '.inc.php')) { |
|
9 | +if (!file_exists($opt['rootpath'].'cache2/labels-'.$opt['template']['locale'].'.inc.php')) { |
|
10 | 10 | labels::CreateCacheFile(); |
11 | 11 | } |
12 | 12 | |
13 | -require $opt['rootpath'] . 'cache2/labels-' . $opt['template']['locale'] . '.inc.php'; |
|
13 | +require $opt['rootpath'].'cache2/labels-'.$opt['template']['locale'].'.inc.php'; |
|
14 | 14 | |
15 | 15 | class labels |
16 | 16 | { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | global $opt; |
22 | 22 | |
23 | - $f = fopen($opt['rootpath'] . 'cache2/labels-' . $opt['template']['locale'] . '.inc.php', 'w'); |
|
23 | + $f = fopen($opt['rootpath'].'cache2/labels-'.$opt['template']['locale'].'.inc.php', 'w'); |
|
24 | 24 | fwrite($f, "<?php\n"); |
25 | 25 | |
26 | 26 | $a = array(); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $a[$r['id']] = $r['name']; |
43 | 43 | } |
44 | 44 | sql_free_result($rs); |
45 | - fwrite($f, 'labels::addLabels("cache_attrib", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n"); |
|
45 | + fwrite($f, 'labels::addLabels("cache_attrib", "'.str_replace('"', '\\"', serialize($a)).'");'."\n"); |
|
46 | 46 | |
47 | 47 | $a = []; |
48 | 48 | $rs = sql( |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $a[$r['id']] = $r['name']; |
64 | 64 | } |
65 | 65 | sql_free_result($rs); |
66 | - fwrite($f, 'labels::addLabels("cache_size", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n"); |
|
66 | + fwrite($f, 'labels::addLabels("cache_size", "'.str_replace('"', '\\"', serialize($a)).'");'."\n"); |
|
67 | 67 | |
68 | 68 | $a = []; |
69 | 69 | $rs = sql( |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $a[$r['id']] = $r['name']; |
85 | 85 | } |
86 | 86 | sql_free_result($rs); |
87 | - fwrite($f, 'labels::addLabels("cache_status", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n"); |
|
87 | + fwrite($f, 'labels::addLabels("cache_status", "'.str_replace('"', '\\"', serialize($a)).'");'."\n"); |
|
88 | 88 | |
89 | 89 | $a = []; |
90 | 90 | $rs = sql( |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $a[$r['id']] = $r['name']; |
106 | 106 | } |
107 | 107 | sql_free_result($rs); |
108 | - fwrite($f, 'labels::addLabels("cache_type", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n"); |
|
108 | + fwrite($f, 'labels::addLabels("cache_type", "'.str_replace('"', '\\"', serialize($a)).'");'."\n"); |
|
109 | 109 | |
110 | 110 | $a = []; |
111 | 111 | $rs = sql( |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $a[$r['id']] = $r['name']; |
127 | 127 | } |
128 | 128 | sql_free_result($rs); |
129 | - fwrite($f, 'labels::addLabels("log_types", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n"); |
|
129 | + fwrite($f, 'labels::addLabels("log_types", "'.str_replace('"', '\\"', serialize($a)).'");'."\n"); |
|
130 | 130 | |
131 | 131 | $nLastGroup = 1; |
132 | 132 | $a = array(); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $a[] = $r; |
156 | 156 | } |
157 | 157 | sql_free_result($rs); |
158 | - fwrite($f, 'labels::addLabels("usercountrieslist", "' . str_replace('"', '\\"', serialize($a)) . '");' . "\n"); |
|
158 | + fwrite($f, 'labels::addLabels("usercountrieslist", "'.str_replace('"', '\\"', serialize($a)).'");'."\n"); |
|
159 | 159 | |
160 | 160 | fwrite($f, "?>"); |
161 | 161 | fclose($f); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * add/remove etc. is executed instantly |
9 | 9 | ***************************************************************************/ |
10 | 10 | |
11 | -require_once __DIR__ . '/logtypes.inc.php'; |
|
11 | +require_once __DIR__.'/logtypes.inc.php'; |
|
12 | 12 | |
13 | 13 | class cachelog |
14 | 14 | { |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | // return array(); |
356 | 356 | // Logic Error - log types are still valid when no NEW logs are allowed for the cache. |
357 | 357 | // (Would e.g. block admin logs and log-type restoring for locked caches.) |
358 | - return get_cache_log_types($this->getCacheId(), $this->getType()); // depends on userid |
|
358 | + return get_cache_log_types($this->getCacheId(), $this->getType()); // depends on userid |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | public static function isDuplicate($cacheId, $userId, $logType, $logDate, $logText) |
@@ -71,8 +71,8 @@ |
||
71 | 71 | global $opt; |
72 | 72 | |
73 | 73 | // if data changed - delete statpic of user, if exists - will be recreated on next request |
74 | - if (file_exists($opt['rootpath'] . 'images/statpics/statpic' . $this->nUserId . '.jpg')) { |
|
75 | - unlink($opt['rootpath'] . 'images/statpics/statpic' . $this->nUserId . '.jpg'); |
|
74 | + if (file_exists($opt['rootpath'].'images/statpics/statpic'.$this->nUserId.'.jpg')) { |
|
75 | + unlink($opt['rootpath'].'images/statpics/statpic'.$this->nUserId.'.jpg'); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | } |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | const FOR_STARTPAGE_GALLERY = 1; |
18 | 18 | const FOR_NEWPICS_GALLERY = 2; |
19 | 19 | const FOR_USER_STAT = 3; |
20 | - const FOR_USER_GALLERY = 4; // params: userid |
|
20 | + const FOR_USER_GALLERY = 4; // params: userid |
|
21 | 21 | const FOR_MYHOME_GALLERY = 5; |
22 | - const FOR_CACHE_STAT = 6; // params: cacheid |
|
23 | - const FOR_CACHE_GALLERY = 7; // params: cacheid |
|
22 | + const FOR_CACHE_STAT = 6; // params: cacheid |
|
23 | + const FOR_CACHE_GALLERY = 7; // params: cacheid |
|
24 | 24 | |
25 | - const MAX_PICTURES_PER_GALLERY_PAGE = 48; // must be multiple of 6 |
|
25 | + const MAX_PICTURES_PER_GALLERY_PAGE = 48; // must be multiple of 6 |
|
26 | 26 | |
27 | 27 | |
28 | 28 | public static function get($purpose, $userid = 0, $cacheid = 0) |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $pictures = self::get($purpose, $userid, $cacheid); |
233 | 233 | $tpl->assign('pictures', array_slice($pictures, $startat, self::MAX_PICTURES_PER_GALLERY_PAGE)); |
234 | 234 | |
235 | - $pager = new pager($url . "&startat={offset}"); |
|
235 | + $pager = new pager($url."&startat={offset}"); |
|
236 | 236 | $pager->make_from_offset($startat, count($pictures), self::MAX_PICTURES_PER_GALLERY_PAGE); |
237 | 237 | } |
238 | 238 |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | * add/remove etc. is executed instantly |
9 | 9 | ***************************************************************************/ |
10 | 10 | |
11 | -require_once __DIR__ . '/cracklib.inc.php'; |
|
12 | -require_once __DIR__ . '/../translate.class.php'; |
|
11 | +require_once __DIR__.'/cracklib.inc.php'; |
|
12 | +require_once __DIR__.'/../translate.class.php'; |
|
13 | 13 | |
14 | 14 | class user |
15 | 15 | { |
@@ -760,8 +760,8 @@ discard block |
||
760 | 760 | $mail->to = $this->getEMail(); |
761 | 761 | $mail->subject = $translate->t('Registration confirmation', '', basename(__FILE__), __LINE__); |
762 | 762 | $mail->assign('domain', $opt['page']['domain']); |
763 | - $mail->assign('activation_page', $opt['page']['absolute_url'] . 'activation.php'); |
|
764 | - $mail->assign('short_activation_page', $opt['page']['absolute_url'] . 'a.php'); |
|
763 | + $mail->assign('activation_page', $opt['page']['absolute_url'].'activation.php'); |
|
764 | + $mail->assign('short_activation_page', $opt['page']['absolute_url'].'a.php'); |
|
765 | 765 | $mail->assign('username', $this->getUsername()); |
766 | 766 | $mail->assign('userid', $this->getUserId()); |
767 | 767 | $mail->assign('last_name', $this->getLastName()); |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | $mail->returnPath = $fromUser->getEMail(); |
835 | 835 | } |
836 | 836 | |
837 | - $mail->subject = $translate->t('E-Mail from', '', basename(__FILE__), __LINE__, '', 1, $language) . ' ' . $fromUser->getUsername() . ': ' . $sSubject; |
|
837 | + $mail->subject = $translate->t('E-Mail from', '', basename(__FILE__), __LINE__, '', 1, $language).' '.$fromUser->getUsername().': '.$sSubject; |
|
838 | 838 | $mail->assign('usersubject', $sSubject); |
839 | 839 | $mail->assign('text', $sText); |
840 | 840 | $mail->assign('username', $this->getUsername()); |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | $login->userid, |
907 | 907 | $this->nUserId, |
908 | 908 | 0, |
909 | - 'User ' . sql_escape($this->getUsername()) . ' disabled', |
|
909 | + 'User '.sql_escape($this->getUsername()).' disabled', |
|
910 | 910 | serialize($backup) |
911 | 911 | ); |
912 | 912 | |
@@ -1026,9 +1026,9 @@ discard block |
||
1026 | 1026 | if ($num_caches > 0) { |
1027 | 1027 | $cache_descs = array(); |
1028 | 1028 | $rs = sql( |
1029 | - "SELECT `id`, `language`, `desc`, `hint` " . |
|
1030 | - "FROM `cache_desc`,`caches` " . |
|
1031 | - "WHERE `caches`.`cache_id`=`cache_desc`.`cache_id` " . |
|
1029 | + "SELECT `id`, `language`, `desc`, `hint` ". |
|
1030 | + "FROM `cache_desc`,`caches` ". |
|
1031 | + "WHERE `caches`.`cache_id`=`cache_desc`.`cache_id` ". |
|
1032 | 1032 | "AND `caches`.`user_id`='&1'", |
1033 | 1033 | $this->getUserId() |
1034 | 1034 | ); |
@@ -1073,10 +1073,10 @@ discard block |
||
1073 | 1073 | } |
1074 | 1074 | |
1075 | 1075 | sql( |
1076 | - "UPDATE `cache_desc` " . |
|
1077 | - "SET `desc`='&1',`hint`='&2' " . |
|
1076 | + "UPDATE `cache_desc` ". |
|
1077 | + "SET `desc`='&1',`hint`='&2' ". |
|
1078 | 1078 | "WHERE `id`='&3'", |
1079 | - "<em>" . $descmsg . "</em>", |
|
1079 | + "<em>".$descmsg."</em>", |
|
1080 | 1080 | '', |
1081 | 1081 | $desc['id'] |
1082 | 1082 | ); |
@@ -1175,7 +1175,7 @@ discard block |
||
1175 | 1175 | global $opt; |
1176 | 1176 | |
1177 | 1177 | // load bmp-support |
1178 | - require_once $opt['rootpath'] . 'lib2/imagebmp.inc.php'; |
|
1178 | + require_once $opt['rootpath'].'lib2/imagebmp.inc.php'; |
|
1179 | 1179 | |
1180 | 1180 | // paths cleared by trailing '/' |
1181 | 1181 | if (substr($opt['logic']['pictures']['dir'], - 1) != '/') { |
@@ -1221,18 +1221,18 @@ discard block |
||
1221 | 1221 | */ |
1222 | 1222 | if ($object_type == OBJECT_CACHE) {// get filenames of the pictures of $this' caches |
1223 | 1223 | $rs = sql( |
1224 | - "SELECT `pictures`.`url` " . |
|
1225 | - "FROM `pictures`,`caches` " . |
|
1226 | - "WHERE `caches`.`cache_id`=`pictures`.`object_id`" . |
|
1224 | + "SELECT `pictures`.`url` ". |
|
1225 | + "FROM `pictures`,`caches` ". |
|
1226 | + "WHERE `caches`.`cache_id`=`pictures`.`object_id`". |
|
1227 | 1227 | " AND `pictures`.`object_type`='&1' AND `caches`.`user_id`='&2'", |
1228 | 1228 | OBJECT_CACHE, |
1229 | 1229 | $this->getUserId() |
1230 | 1230 | ); |
1231 | 1231 | } elseif ($object_type == OBJECT_CACHELOG) {// get filenames of the pictures of $this' logs |
1232 | 1232 | $rs = sql( |
1233 | - "SELECT `pictures`.`url` " . |
|
1234 | - "FROM `pictures`,`cache_logs` " . |
|
1235 | - "WHERE `cache_logs`.`id`=`pictures`.`object_id`" . |
|
1233 | + "SELECT `pictures`.`url` ". |
|
1234 | + "FROM `pictures`,`cache_logs` ". |
|
1235 | + "WHERE `cache_logs`.`id`=`pictures`.`object_id`". |
|
1236 | 1236 | " AND `pictures`.`object_type`='&1' AND `cache_logs`.`user_id`='&2'", |
1237 | 1237 | OBJECT_CACHELOG, |
1238 | 1238 | $this->getUserId() |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | |
1285 | 1285 | // check for replacement-image |
1286 | 1286 | if ($pdummy && isset($opt['logic']['pictures']['dummy']['replacepic']) |
1287 | - && $opt['logic']['pictures']['dummy']['replacepic'] != $opt['rootpath'] . 'images/' |
|
1287 | + && $opt['logic']['pictures']['dummy']['replacepic'] != $opt['rootpath'].'images/' |
|
1288 | 1288 | && file_exists($opt['logic']['pictures']['dummy']['replacepic']) |
1289 | 1289 | ) { |
1290 | 1290 | |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | $login->userid, |
1461 | 1461 | $this->nUserId, |
1462 | 1462 | 0, |
1463 | - 'User ' . sql_escape($this->getUsername()) . ' deleted', |
|
1463 | + 'User '.sql_escape($this->getUsername()).' deleted', |
|
1464 | 1464 | serialize($backup) |
1465 | 1465 | ); |
1466 | 1466 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | private static function setCacheLocation($cache_id) |
34 | 34 | { |
35 | - echo $cache_id . "\n"; |
|
35 | + echo $cache_id."\n"; |
|
36 | 36 | $rs = sqll( |
37 | 37 | "SELECT `latitude`, `longitude`, `last_modified` |
38 | 38 | FROM `caches` |
@@ -95,16 +95,16 @@ discard block |
||
95 | 95 | $rs = sqll( |
96 | 96 | "SELECT |
97 | 97 | `geodb_coordinates`.`loc_id` `loc_id`, |
98 | - (( " . $lon . " - `geodb_coordinates`.`lon` ) * ( " . $lon . " - `geodb_coordinates`.`lon` ) + |
|
99 | - ( " . $lat . " - `geodb_coordinates`.`lat` ) * ( " . $lat . " - `geodb_coordinates`.`lat` )) `dist` |
|
98 | + (( " . $lon." - `geodb_coordinates`.`lon` ) * ( ".$lon." - `geodb_coordinates`.`lon` ) + |
|
99 | + ( " . $lat." - `geodb_coordinates`.`lat` ) * ( ".$lat." - `geodb_coordinates`.`lat` )) `dist` |
|
100 | 100 | FROM `geodb_coordinates` |
101 | 101 | INNER JOIN `geodb_locations` ON `geodb_coordinates`.`loc_id`=`geodb_locations`.`loc_id` |
102 | 102 | WHERE |
103 | 103 | `geodb_locations`.`loc_type`=100700000 |
104 | - AND `geodb_coordinates`.`lon` > " . ($lon - 0.15) . " |
|
105 | - AND `geodb_coordinates`.`lon` < " . ($lon + 0.15) . " |
|
106 | - AND `geodb_coordinates`.`lat` > " . ($lat - 0.15) . " |
|
107 | - AND `geodb_coordinates`.`lat` < " . ($lat + 0.15) . " |
|
104 | + AND `geodb_coordinates`.`lon` > " . ($lon - 0.15)." |
|
105 | + AND `geodb_coordinates`.`lon` < " . ($lon + 0.15)." |
|
106 | + AND `geodb_coordinates`.`lat` > " . ($lat - 0.15)." |
|
107 | + AND `geodb_coordinates`.`lat` < " . ($lat + 0.15)." |
|
108 | 108 | ORDER BY `dist` ASC |
109 | 109 | LIMIT 1" |
110 | 110 | ); |
@@ -34,10 +34,10 @@ |
||
34 | 34 | |
35 | 35 | $npas = get_npas($cache_id); |
36 | 36 | if ($npas) { |
37 | - $desc = "<p>" . str_replace('%1', helppagelink('npa'), _('This geocache is probably placed within the following protected areas (%1Info</a>):')) . "</p>\n" . |
|
37 | + $desc = "<p>".str_replace('%1', helppagelink('npa'), _('This geocache is probably placed within the following protected areas (%1Info</a>):'))."</p>\n". |
|
38 | 38 | "<ul>\n"; |
39 | 39 | foreach ($npas as $npa) { |
40 | - $desc .= "<li>" . $npa['npaTypeName'] . ": <a href='http://www.google.de/search?q=" . urlencode($npa['npaTypeName'] . ' ' . $npa['npaName']) . "' target='_blank'>" . $npa['npaName'] . "</a></li>\n"; |
|
40 | + $desc .= "<li>".$npa['npaTypeName'].": <a href='http://www.google.de/search?q=".urlencode($npa['npaTypeName'].' '.$npa['npaName'])."' target='_blank'>".$npa['npaName']."</a></li>\n"; |
|
41 | 41 | } |
42 | 42 | $desc .= "</ul>\n"; |
43 | 43 | } else { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | LEFT JOIN `sys_trans_text` AS `tt2` |
80 | 80 | ON `t2`.`id`=`tt2`.`trans_id` |
81 | 81 | AND `tt2`.`lang`='&1' |
82 | - WHERE `cache_attrib`.`group_id`='&2'" . $sAddWhereSql . " |
|
82 | + WHERE `cache_attrib`.`group_id`='&2'" . $sAddWhereSql." |
|
83 | 83 | AND NOT IFNULL(`cache_attrib`.`hidden`, 0)=1 |
84 | 84 | ORDER BY `cache_attrib`.`group_id` ASC", |
85 | 85 | $opt['template']['locale'], |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | while ($rAttr = sql_fetch_assoc($rsAttr)) { |
118 | 118 | if ($firstLetterUppercase) { |
119 | - $rAttr['name'] = mb_strtoupper(mb_substr($rAttr['name'], 0, 1)) . mb_substr($rAttr['name'], 1); |
|
119 | + $rAttr['name'] = mb_strtoupper(mb_substr($rAttr['name'], 0, 1)).mb_substr($rAttr['name'], 1); |
|
120 | 120 | } |
121 | 121 | $attr[] = $rAttr; |
122 | 122 | if ($rAttr['search_default']) { |