Completed
Pull Request — master (#314)
by Thomas
07:26
created
htdocs/lib2/search/search.txt.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
 
117 117
         if ($r['html'] == 0) {
118 118
             $thisline = mb_ereg_replace('{htmlwarn}', '', $thisline);
119
-            $thisline = mb_ereg_replace('{desc}', decodeEntities(strip_tags($r['desc'])) . $license, $thisline);
119
+            $thisline = mb_ereg_replace('{desc}', decodeEntities(strip_tags($r['desc'])).$license, $thisline);
120 120
         } else {
121 121
             $thisline = mb_ereg_replace('{htmlwarn}', " ($converted_from_html)", $thisline);
122
-            $thisline = mb_ereg_replace('{desc}', html2txt($r['desc']) . $license, $thisline);
122
+            $thisline = mb_ereg_replace('{desc}', html2txt($r['desc']).$license, $thisline);
123 123
         }
124 124
 
125 125
         $thisline = mb_ereg_replace('{type}', $r['type'], $thisline);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                 $thislog = mb_ereg_replace('{text}', html2txt($rLog['text']), $thislog);
198 198
             }
199 199
 
200
-            $logentries .= $thislog . "\n";
200
+            $logentries .= $thislog."\n";
201 201
         }
202 202
         $thisline = mb_ereg_replace('{logs}', $logentries, $thisline);
203 203
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         if (!$bUseZip) {
206 206
             echo $thisline;
207 207
         } else {
208
-            $phpzip->add_data($r['waypoint'] . '.txt', $thisline);
208
+            $phpzip->add_data($r['waypoint'].'.txt', $thisline);
209 209
         }
210 210
     }
211 211
     mysql_free_result($rs);
Please login to merge, or discard this patch.
htdocs/lib2/search/search.kml.inc.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     $kmlLine =
22 22
         '
23 23
 <Placemark>
24
-  <description><![CDATA[' . $t_by . ' {username}<br><br><a href="' . $opt['page']['default_absolute_url'] . 'viewcache.php?cacheid={cacheid}">' . $t_showdesc . '</a><br>&nbsp;<br><table cellspacing="0" cellpadding="0" border="0"><tr><td>{typeimgurl} </td><td>' . $t_type . ' {type}<br>' . $t_size . ' {size}</td></tr><tr><td colspan="2">' . $t_difficulty . '<br>' . $t_terrain . '</td></tr></table>]]></description>
24
+  <description><![CDATA[' . $t_by.' {username}<br><br><a href="'.$opt['page']['default_absolute_url'].'viewcache.php?cacheid={cacheid}">'.$t_showdesc.'</a><br>&nbsp;<br><table cellspacing="0" cellpadding="0" border="0"><tr><td>{typeimgurl} </td><td>'.$t_type.' {type}<br>'.$t_size.' {size}</td></tr><tr><td colspan="2">'.$t_difficulty.'<br>'.$t_terrain.'</td></tr></table>]]></description>
25 25
   <name>{name}{archivedflag}</name>
26 26
   <LookAt>
27 27
     <longitude>{lon}</longitude>
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
   <Point>
35 35
     <coordinates>{lon},{lat},0</coordinates>
36 36
   </Point>
37
-  <Snippet>D: {difficulty}/T: {terrain} {size}  ' . $t_by . ' {username}</Snippet>
37
+  <Snippet>D: {difficulty}/T: {terrain} {size}  ' . $t_by.' {username}</Snippet>
38 38
 </Placemark>
39 39
 ';
40 40
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
     while ($r = sql_fetch_array($rs)) {
95 95
         $thisline = $kmlLine;
96
-        $typeimgurl = '<img src="{urlbase}resource2/' . $style . '/images/cacheicon/' . $r['icon_large'] . '" alt="' . $r['typedesc'] . '" title="' . $r['typedesc'] . '" />';
96
+        $typeimgurl = '<img src="{urlbase}resource2/'.$style.'/images/cacheicon/'.$r['icon_large'].'" alt="'.$r['typedesc'].'" title="'.$r['typedesc'].'" />';
97 97
 
98 98
         $thisline = mb_ereg_replace('{icon}', $r['kml_name'], $thisline);
99 99
         $thisline = mb_ereg_replace('{typeimgurl}', $typeimgurl, $thisline);
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
 
112 112
         if (($r['status'] == 2) || ($r['status'] == 3) || ($r['status'] == 6)) {
113 113
             if ($r['status'] == 2) {
114
-                $thisline = mb_ereg_replace('{archivedflag}', ' (' . $state_temporarily_na . ')', $thisline);
114
+                $thisline = mb_ereg_replace('{archivedflag}', ' ('.$state_temporarily_na.')', $thisline);
115 115
             } elseif ($r['status'] == 3) {
116
-                $thisline = mb_ereg_replace('{archivedflag}', ' (' . $state_archived . ')', $thisline);
116
+                $thisline = mb_ereg_replace('{archivedflag}', ' ('.$state_archived.')', $thisline);
117 117
             } else {
118
-                $thisline = mb_ereg_replace('{archivedflag}', ' (' . $state_locked . ')', $thisline);
118
+                $thisline = mb_ereg_replace('{archivedflag}', ' ('.$state_locked.')', $thisline);
119 119
             }
120 120
         } else {
121 121
             $thisline = mb_ereg_replace('{archivedflag}', '', $thisline);
Please login to merge, or discard this patch.
htdocs/lib2/search/search.loc.inc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     $server_domain = $opt['page']['domain'];
20 20
     $server_address = $opt['page']['default_absolute_url'];
21 21
 
22
-    $locHead = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><loc version="1.0" src="' . $server_domain . '">' . "\n";
22
+    $locHead = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><loc version="1.0" src="'.$server_domain.'">'."\n";
23 23
 
24 24
     $locLine =
25 25
         '
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     <name id="{waypoint}"><![CDATA[{archivedflag}{name} by {username}]]></name>
28 28
     <coord lat="{lat}" lon="{lon}"/>
29 29
     <type>Geocache</type>
30
-    <link text="Beschreibung">' . $server_address . 'viewcache.php?cacheid={cacheid}</link>
30
+    <link text="Beschreibung">' . $server_address.'viewcache.php?cacheid={cacheid}</link>
31 31
 </waypoint>
32 32
 ';
33 33
 
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 
79 79
         if (($r['status'] == 2) || ($r['status'] == 3) || ($r['status'] == 6)) {
80 80
             if ($r['status'] == 2) {
81
-                $thisline = mb_ereg_replace('{archivedflag}', $state_temporarily_na . '!, ', $thisline);
81
+                $thisline = mb_ereg_replace('{archivedflag}', $state_temporarily_na.'!, ', $thisline);
82 82
             } elseif ($r['status'] == 3) {
83
-                $thisline = mb_ereg_replace('{archivedflag}', $state_archived . '!, ', $thisline);
83
+                $thisline = mb_ereg_replace('{archivedflag}', $state_archived.'!, ', $thisline);
84 84
             } else {
85
-                $thisline = mb_ereg_replace('{archivedflag}', $state_locked . '!, ', $thisline);
85
+                $thisline = mb_ereg_replace('{archivedflag}', $state_locked.'!, ', $thisline);
86 86
             }
87 87
         } else {
88 88
             $thisline = mb_ereg_replace('{archivedflag}', '', $thisline);
Please login to merge, or discard this patch.
htdocs/lib2/search/ftsearch.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
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,11 +237,11 @@  discard block
 block discarded – undo
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;
244
-            $str = mb_ereg_replace(chr($c) . chr($c), chr($c), $str);
244
+            $str = mb_ereg_replace(chr($c).chr($c), chr($c), $str);
245 245
         }
246 246
         $old_str = '';
247 247
     }
Please login to merge, or discard this patch.
htdocs/lib2/search/search.html.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
                     LEFT JOIN `caches_attributes` AS `tbloconly`
25 25
                            ON `caches`.`cache_id`=`tbloconly`.`cache_id` AND `tbloconly`.`attrib_id`=6
26 26
                     LEFT JOIN `sys_trans_text` `stt` ON `stt`.`trans_id`=`cache_type`.`trans_id`
27
-                          AND `stt`.`lang`=\'' . sql_escape($opt['template']['locale']) . '\'';
27
+                          AND `stt`.`lang`=\'' . sql_escape($opt['template']['locale']).'\'';
28 28
 
29 29
 
30 30
 function search_output()
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
     $tpl->menuitem = MNU_CACHES_SEARCH_RESULT;
39 39
 
40 40
     $startat = floor($startat / $caches_per_page) * $caches_per_page;
41
-    $sql .= ' LIMIT ' . $startat . ', ' . $caches_per_page;
41
+    $sql .= ' LIMIT '.$startat.', '.$caches_per_page;
42 42
 
43 43
     // run SQL query
44 44
     sql_enable_foundrows();
45
-    $rs_caches = sql_slave("SELECT SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS " . $sql);
45
+    $rs_caches = sql_slave("SELECT SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS ".$sql);
46 46
     $resultcount = sql_value_slave('SELECT FOUND_ROWS()', 0);
47 47
     sql_foundrows_done();
48 48
     $tpl->assign('results_count', $resultcount);
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
         if ($options['sort'] != 'bymylastlog' || !$login->logged_in()) {
96 96
             $ownlogs = "";
97 97
         } else {
98
-            $ownlogs = " AND `cache_logs`.`user_id`='" . sql_escape($login->userid) . "'";
98
+            $ownlogs = " AND `cache_logs`.`user_id`='".sql_escape($login->userid)."'";
99 99
         }
100 100
         $sql = "
101 101
                 SELECT `cache_logs`.`id`, `cache_logs`.`type`, `cache_logs`.`date`, `log_types`.`icon_small`
102 102
                 FROM `cache_logs`, `log_types`
103
-                WHERE `cache_logs`.`cache_id`='" . sql_escape($rCache['cache_id']) . "'
104
-                      AND `log_types`.`id`=`cache_logs`.`type`" . $ownlogs . "
103
+                WHERE `cache_logs`.`cache_id`='" . sql_escape($rCache['cache_id'])."'
104
+                      AND `log_types`.`id`=`cache_logs`.`type`" . $ownlogs."
105 105
                 ORDER BY `cache_logs`.`order_date` DESC, `cache_logs`.`date_created` DESC, `cache_logs`.`id` DESC
106 106
                 LIMIT 6";
107 107
         $rs = sql_slave($sql);
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
 
139 139
     $tpl->assign('caches', $caches);
140 140
 
141
-    $page = 'search.php?queryid=' . $options['queryid'] . '&startat={offset}&sortby=' . $options['sort'];
141
+    $page = 'search.php?queryid='.$options['queryid'].'&startat={offset}&sortby='.$options['sort'];
142 142
     if (isset($options['sortorder']) && $options['sortorder']) {
143
-        $page .= "&sortorder=" . $options['sortorder'];
143
+        $page .= "&sortorder=".$options['sortorder'];
144 144
     }
145 145
     if (isset($options['creationdate']) && $options['creationdate']) {
146
-        $page .= "&creationdate=" . $options['creationdate'];
146
+        $page .= "&creationdate=".$options['creationdate'];
147 147
     }
148 148
     $pager = new pager($page, 2, 9);
149 149
     $pager->make_from_offset($startat, $resultcount, $caches_per_page);
Please login to merge, or discard this patch.
htdocs/lib2/search/search.xml.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
         <status id=\"{statusid}\">{status}</status>
36 36
         <lon value=\"{lonvalue}\">{lon}</lon>
37 37
         <lat value=\"{latvalue}\">{lat}</lat>
38
-        <distance unit=\"" . $distance_unit . "\">{distance}</distance>
38
+        <distance unit=\"" . $distance_unit."\">{distance}</distance>
39 39
         <type id=\"{typeid}\">{type}</type>
40 40
         <difficulty>{difficulty}</difficulty>
41 41
         <terrain>{terrain}</terrain>
42 42
         <size id=\"{sizeid}\">{container}</size>
43 43
         <country id=\"{countryid}\">{country}</country>
44
-        <link><![CDATA[" . $opt['page']['default_absolute_url'] . "viewcache.php?wp={waypoint}]]></link>
44
+        <link><![CDATA[" . $opt['page']['default_absolute_url']."viewcache.php?wp={waypoint}]]></link>
45 45
         <desc><![CDATA[{shortdesc}]]></desc>
46 46
         <hints><![CDATA[{hints}]]></hints>
47 47
     </cache>
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     // create temporary table
51 51
     sql_temp_table_slave('searchtmp');
52
-    sql_slave('CREATE TEMPORARY TABLE &searchtmp SELECT SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS ' . $sql . $sqlLimit);
52
+    sql_slave('CREATE TEMPORARY TABLE &searchtmp SELECT SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS '.$sql.$sqlLimit);
53 53
 
54 54
     $resultcount = sql_value_slave('SELECT FOUND_ROWS()', 0);
55 55
 
@@ -59,17 +59,17 @@  discard block
 block discarded – undo
59 59
 
60 60
     // start output
61 61
     if (!$db['debug']) {
62
-        header("Content-type: application/xml; charset=" . $encoding);
62
+        header("Content-type: application/xml; charset=".$encoding);
63 63
         //header("Content-Disposition: attachment; filename=" . $sFilebasename . ".txt");
64 64
 
65
-        echo "<?xml version=\"1.0\" encoding=\"" . $encoding . "\"?>\n";
65
+        echo "<?xml version=\"1.0\" encoding=\"".$encoding."\"?>\n";
66 66
         echo "<result>\n";
67 67
 
68 68
         echo "    <docinfo>\n";
69
-        echo "        <results>" . $rCount['count'] . "</results>\n";
70
-        echo "        <startat>" . $startat . "</startat>\n";
71
-        echo "        <perpage>" . $count . "</perpage>\n";
72
-        echo "        <total>" . $resultcount . "</total>\n";
69
+        echo "        <results>".$rCount['count']."</results>\n";
70
+        echo "        <startat>".$startat."</startat>\n";
71
+        echo "        <perpage>".$count."</perpage>\n";
72
+        echo "        <total>".$resultcount."</total>\n";
73 73
         echo "    </docinfo>\n";
74 74
     }
75 75
 
Please login to merge, or discard this patch.
htdocs/lib2/search/search.inc.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
     }
157 157
 
158 158
     // doppelte chars ersetzen
159
-    for ($c = ord('a'); $c <= ord('z'); $c ++) {
160
-        $str = mb_ereg_replace(chr($c) . chr($c), chr($c), $str);
159
+    for ($c = ord('a'); $c <= ord('z'); $c++) {
160
+        $str = mb_ereg_replace(chr($c).chr($c), chr($c), $str);
161 161
     }
162 162
 
163 163
     return $str;
@@ -257,14 +257,14 @@  discard block
 block discarded – undo
257 257
 {
258 258
     global $opt;
259 259
 
260
-    $desclangs = ',' . $rCache['desc_languages'] . ',';
260
+    $desclangs = ','.$rCache['desc_languages'].',';
261 261
     $desclang = $rCache['desc_language'];
262 262
 
263
-    if (strpos($desclangs, ',' . $opt['template']['locale'] . ',') !== false) {
263
+    if (strpos($desclangs, ','.$opt['template']['locale'].',') !== false) {
264 264
         $desclang = $opt['template']['locale'];
265
-    } elseif (strpos($desclangs, ',' . $opt['template']['default']['locale'] . ',') !== false) {
265
+    } elseif (strpos($desclangs, ','.$opt['template']['default']['locale'].',') !== false) {
266 266
         $desclang = $opt['template']['default']['locale'];
267
-    } elseif (strpos($desclangs, ',' . $opt['template']['default']['fallback_locale'] . ',') !== false) {
267
+    } elseif (strpos($desclangs, ','.$opt['template']['default']['fallback_locale'].',') !== false) {
268 268
         $desclang = $opt['template']['default']['fallback_locale'];
269 269
     } elseif (strpos($desclangs, ',EN,') !== false) {
270 270
         $desclang = 'EN';
Please login to merge, or discard this patch.
htdocs/lib2/search/search.map2.inc.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     $tpl->error(ERROR_INVALID_OPERATION);
13 13
 }
14 14
 
15
-$sqlchecksum = sprintf('%u', crc32($cachesFilter . "\n" . $sqlFilter));
15
+$sqlchecksum = sprintf('%u', crc32($cachesFilter."\n".$sqlFilter));
16 16
 
17 17
 // check if query was already executed within the cache period
18 18
 $rsMapCache = sql(
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 );
29 29
 if ($rMapCache = sql_fetch_assoc($rsMapCache)) {
30 30
     $resultId = $rMapCache['result_id'];
31
-    sql("UPDATE `map2_result` SET `shared_counter`=`shared_counter`+1 WHERE `result_id`='" . ($resultId + 0) . "'");
31
+    sql("UPDATE `map2_result` SET `shared_counter`=`shared_counter`+1 WHERE `result_id`='".($resultId + 0)."'");
32 32
 } else {
33 33
     // ensure that query is performed without errors before reserving the result_id
34 34
     sql_temp_table_slave('tmpmapresult');
35 35
     sql_slave("CREATE TEMPORARY TABLE &tmpmapresult (`cache_id` INT UNSIGNED NOT NULL, PRIMARY KEY (`cache_id`)) ENGINE=MEMORY");
36
-    sql_slave("INSERT INTO &tmpmapresult (`cache_id`) " . $sqlFilter);
36
+    sql_slave("INSERT INTO &tmpmapresult (`cache_id`) ".$sqlFilter);
37 37
 
38 38
     sql(
39 39
         "
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         VALUES ('&1', '&2', '&3', NOW(), NOW())",
42 42
         $db['slave_id'],
43 43
         $sqlchecksum,
44
-        $cachesFilter . "\n" . $sqlFilter
44
+        $cachesFilter."\n".$sqlFilter
45 45
     );
46 46
     $resultId = sql_insert_id();
47 47
 
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
             $rBounds['lon_min'] -= $halfwin;
75 75
             $rBounds['lon_max'] += $halfwin;
76 76
         }
77
-        $bounds_param = "&lat_min=" . round($rBounds['lat_min'], 5) . "&lat_max=" . round($rBounds['lat_max'], 5) . '&lon_min=' . round($rBounds['lon_min'], 5) . '&lon_max=' . round($rBounds['lon_max'], 5);
77
+        $bounds_param = "&lat_min=".round($rBounds['lat_min'], 5)."&lat_max=".round($rBounds['lat_max'], 5).'&lon_min='.round($rBounds['lon_min'], 5).'&lon_max='.round($rBounds['lon_max'], 5);
78 78
     }
79 79
     sql_free_result($rs);
80 80
 
81
-    $tpl->redirect('map2.php?queryid=' . $options['queryid'] . '&resultid=' . $resultId . $bounds_param);
81
+    $tpl->redirect('map2.php?queryid='.$options['queryid'].'&resultid='.$resultId.$bounds_param);
82 82
 } else {
83 83
     echo $resultId;
84 84
 }
Please login to merge, or discard this patch.
htdocs/lib2/search/search.ovl.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  * OVL search output for TOP25, TOP50 etc.
8 8
  ****************************************************************************/
9 9
 
10
-require_once $opt['rootpath'] . 'lib2/charset.inc.php';
10
+require_once $opt['rootpath'].'lib2/charset.inc.php';
11 11
 
12 12
 $search_output_file_download = true;
13 13
 $content_type_plain = 'application/ovl';
Please login to merge, or discard this patch.