Completed
Pull Request — master (#314)
by Thomas
07:14
created
htdocs/api/coord.ch/newest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 
8 8
 header('Content-type: text/html; charset=utf-8');
9 9
 
10
-$opt['rootpath'] = __DIR__ . '/../../';
11
-require $opt['rootpath'] . 'lib2/web.inc.php';
10
+$opt['rootpath'] = __DIR__.'/../../';
11
+require $opt['rootpath'].'lib2/web.inc.php';
12 12
 
13 13
 $bFirstRow = true;
14 14
 
@@ -52,5 +52,5 @@  discard block
 block discarded – undo
52 52
 // renamed function from "str_getcsv" to avoid collision with PHP 5.3 str_getcsv()
53 53
 function strGetCsv($str)
54 54
 {
55
-    return '"' . mb_ereg_replace('"', '\"', $str) . '"';
55
+    return '"'.mb_ereg_replace('"', '\"', $str).'"';
56 56
 }
Please login to merge, or discard this patch.
htdocs/removedesc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *  Unicode Reminder メモ
8 8
  ***************************************************************************/
9 9
 
10
-require_once __DIR__ . '/lib/common.inc.php';
10
+require_once __DIR__.'/lib/common.inc.php';
11 11
 
12 12
 //Preprocessing
13 13
 if ($error == false) {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         tpl_set_var(
33 33
             'target',
34 34
             htmlspecialchars(
35
-                'removedesc.php?cacheid=' . urlencode($cache_id) . '&desclang=' . urlencode($desclang),
35
+                'removedesc.php?cacheid='.urlencode($cache_id).'&desclang='.urlencode($desclang),
36 36
                 ENT_COMPAT,
37 37
                 'UTF-8'
38 38
             )
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                 if (mysql_num_rows($desc_rs) == 1) {
57 57
                     $desc_record = sql_fetch_array($desc_rs);
58 58
                     mysql_free_result($desc_rs);
59
-                    require $stylepath . '/removedesc.inc.php';
59
+                    require $stylepath.'/removedesc.inc.php';
60 60
 
61 61
                     if ($desc_record['node'] != $oc_nodeid) {
62 62
                         tpl_errorMsg('removedesc', $error_wrong_node);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                         // do not use slave server for the next time ...
71 71
                         db_slave_exclude();
72 72
 
73
-                        tpl_redirect('editcache.php?cacheid=' . urlencode($cache_id));
73
+                        tpl_redirect('editcache.php?cacheid='.urlencode($cache_id));
74 74
                         exit;
75 75
                     } else {
76 76
                         //commit the removement
Please login to merge, or discard this patch.
htdocs/editcache.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -844,7 +844,7 @@
 block discarded – undo
844 844
                 $desclangs = mb_split(',', $cache_record['desc_languages']);
845 845
                 $cache_descs = '';
846 846
                 $gc_com_refs = false;
847
-                foreach ($desclangs AS $desclang) {
847
+                foreach ($desclangs as $desclang) {
848 848
                     if (count($desclangs) > 1) {
849 849
                         $remove_url = 'removedesc.php?cacheid=' . urlencode($cache_id) . '&desclang=' . urlencode(
850 850
                                 $desclang
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $tplname = 'login';
85 85
 
86 86
         tpl_set_var('username', '');
87
-        tpl_set_var('target', 'editcache.php?cacheid=' . urlencode($cache_id));
87
+        tpl_set_var('target', 'editcache.php?cacheid='.urlencode($cache_id));
88 88
         tpl_set_var('message_start', "");
89 89
         tpl_set_var('message_end', "");
90 90
         tpl_set_var('message', $login_required);
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             if ($cache_record['user_id'] == $usr['userid'] || $login->listingAdmin()) {
131 131
                 $tplname = 'editcache';
132 132
 
133
-                require $stylepath . '/editcache.inc.php';
133
+                require $stylepath.'/editcache.inc.php';
134 134
 
135 135
                 if ($cache_record['node'] != $oc_nodeid) {
136 136
                     tpl_errorMsg('editcache', $error_wrong_node);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 }
139 139
 
140 140
                 //here we read all used information from the form if submitted, otherwise from DB
141
-                $cache_name = trim(isset($_POST['name']) ? $_POST['name'] : $cache_record['name']);  // Ocprop
141
+                $cache_name = trim(isset($_POST['name']) ? $_POST['name'] : $cache_record['name']); // Ocprop
142 142
                 $cache_type = isset($_POST['type']) ? $_POST['type'] : $cache_record['type'];
143 143
                 if (!isset($_POST['size'])) {
144 144
                     if ($cache_type == 4 || $cache_type == 5) {
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
                 $cache_hidden_day = isset($_POST['hidden_day']) ? $_POST['hidden_day'] : date(
153 153
                     'd',
154 154
                     strtotime($cache_record['date_hidden'])
155
-                );  // Ocprop
155
+                ); // Ocprop
156 156
                 $cache_hidden_month = isset($_POST['hidden_month']) ? $_POST['hidden_month'] : date(
157 157
                     'm',
158 158
                     strtotime($cache_record['date_hidden'])
159
-                );  // Ocprop
159
+                ); // Ocprop
160 160
                 $cache_hidden_year = isset($_POST['hidden_year']) ? $_POST['hidden_year'] : date(
161 161
                     'Y',
162 162
                     strtotime($cache_record['date_hidden'])
163
-                );  // Ocprop
163
+                ); // Ocprop
164 164
 
165 165
                 if (is_null($cache_record['date_activate'])) {
166 166
                     $cache_activate_day = isset($_POST['activate_day']) ? $_POST['activate_day'] : date('d');
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
                     );
187 187
                 }
188 188
 
189
-                $cache_difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : $cache_record['difficulty'];  // Ocprop
190
-                $cache_terrain = isset($_POST['terrain']) ? $_POST['terrain'] : $cache_record['terrain'];  // Ocprop
191
-                $cache_country = isset($_POST['country']) ? $_POST['country'] : $cache_record['country'];  // Ocprop
189
+                $cache_difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : $cache_record['difficulty']; // Ocprop
190
+                $cache_terrain = isset($_POST['terrain']) ? $_POST['terrain'] : $cache_record['terrain']; // Ocprop
191
+                $cache_country = isset($_POST['country']) ? $_POST['country'] : $cache_record['country']; // Ocprop
192 192
                 $show_all_countries = isset($_POST['show_all_countries']) ? $_POST['show_all_countries'] : 0;
193
-                $status = isset($_POST['status']) ? $_POST['status'] : $cache_record['status'];  // Ocprop
193
+                $status = isset($_POST['status']) ? $_POST['status'] : $cache_record['status']; // Ocprop
194 194
                 $status_old = $cache_record['status'];
195 195
                 $search_time = isset($_POST['search_time']) ? $_POST['search_time'] : $cache_record['search_time'];
196 196
                 $way_length = isset($_POST['way_length']) ? $_POST['way_length'] : $cache_record['way_length'];
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
                 $log_pw = isset($_POST['log_pw']) ? mb_substr($_POST['log_pw'], 0, 20) : $cache_record['logpw'];
253 253
                 // fix #4356: gc waypoints are frequently copy&pasted with leading spaces
254
-                $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : $cache_record['wp_gc'];  // Ocprop
254
+                $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : $cache_record['wp_gc']; // Ocprop
255 255
                 $showlists = isset($_POST['showlists']) ? 1 : $cache_record['show_cachelists'] + 0;
256 256
                 $protect_old_coords = isset($_POST['protect_old_coords']) ? 1 : $cache_record['protect_old_coords'] + 0;
257 257
 
@@ -263,12 +263,12 @@  discard block
 block discarded – undo
263 263
 
264 264
                 if (isset($_POST['latNS'])) {
265 265
                     //get coords from post-form
266
-                    $coords_latNS = $_POST['latNS'];  // Ocprop
267
-                    $coords_lonEW = $_POST['lonEW'];  // Ocprop
268
-                    $coords_lat_h = $_POST['lat_h'];  // Ocprop
269
-                    $coords_lon_h = $_POST['lon_h'];  // Ocprop
270
-                    $coords_lat_min = $_POST['lat_min'];  // Ocprop
271
-                    $coords_lon_min = $_POST['lon_min'];  // Ocprop
266
+                    $coords_latNS = $_POST['latNS']; // Ocprop
267
+                    $coords_lonEW = $_POST['lonEW']; // Ocprop
268
+                    $coords_lat_h = $_POST['lat_h']; // Ocprop
269
+                    $coords_lon_h = $_POST['lon_h']; // Ocprop
270
+                    $coords_lat_min = $_POST['lat_min']; // Ocprop
271
+                    $coords_lon_min = $_POST['lon_min']; // Ocprop
272 272
                 } else {
273 273
                     //get coords from DB
274 274
                     $coords_lon = $cache_record['longitude'];
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
                             $activation_date = 'NULL';
455 455
                         } elseif ($publish == 'later') {
456 456
                             $status = 5;
457
-                            $activation_date = "'" . sql_escape(
457
+                            $activation_date = "'".sql_escape(
458 458
                                     date(
459 459
                                         'Y-m-d H:i:s',
460 460
                                         mktime(
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
                                             $cache_activate_year
467 467
                                         )
468 468
                                     )
469
-                                ) . "'";
469
+                                )."'";
470 470
                         } elseif ($publish == 'notnow') {
471 471
                             $status = 5;
472 472
                             $activation_date = 'NULL';
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
                                     $logtype = 13;
562 562
                                     break;
563 563
                                 default:
564
-                                    $logtype = 0;  // ???
564
+                                    $logtype = 0; // ???
565 565
                             }
566 566
                             if ($logtype > 0) {
567 567
                                 sql(
@@ -582,25 +582,25 @@  discard block
 block discarded – undo
582 582
 
583 583
                         // update cache attributes
584 584
                         $attriblist = "999";
585
-                        for ($i = 0; $i < count($cache_attribs); $i ++) {
585
+                        for ($i = 0; $i < count($cache_attribs); $i++) {
586 586
                             if ($cache_attribs[$i] + 0 > 0) {
587 587
                                 sql(
588 588
                                     "INSERT IGNORE INTO `caches_attributes` (`cache_id`, `attrib_id`) VALUES('&1', '&2')",
589 589
                                     $cache_id,
590 590
                                     $cache_attribs[$i] + 0
591 591
                                 );
592
-                                $attriblist .= "," . ($cache_attribs[$i] + 0);
592
+                                $attriblist .= ",".($cache_attribs[$i] + 0);
593 593
                             }
594 594
                         }
595 595
 
596 596
                         sql(
597
-                            "DELETE FROM `caches_attributes` WHERE `cache_id`='&1' AND `attrib_id` NOT IN (" . $attriblist . ")",
597
+                            "DELETE FROM `caches_attributes` WHERE `cache_id`='&1' AND `attrib_id` NOT IN (".$attriblist.")",
598 598
                             // SQL injections in $attriblist prevented by adding 0 above
599 599
                             $cache_id
600 600
                         );
601 601
 
602 602
                         //call eventhandler
603
-                        require_once $opt['rootpath'] . 'lib/eventhandler.inc.php';
603
+                        require_once $opt['rootpath'].'lib/eventhandler.inc.php';
604 604
                         event_edit_cache($cache_id, $usr['userid'] + 0);
605 605
 
606 606
                         // if old status is not yet published and new status is published => notify-event
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
                         }
610 610
 
611 611
                         //display cache-page
612
-                        tpl_redirect('viewcache.php?cacheid=' . urlencode($cache_id));
612
+                        tpl_redirect('viewcache.php?cacheid='.urlencode($cache_id));
613 613
                         // Ocprop: Location:\s*$viewcacheUrl\?cacheid=([0-9]+) (s.a. tpl_redirect() in common.inc.php
614 614
                         exit;
615 615
                     }
@@ -650,15 +650,15 @@  discard block
 block discarded – undo
650 650
 
651 651
                 while ($record = sql_fetch_assoc($rs)) {
652 652
                     $sSelected = ($record['short'] == $cache_country) ? ' selected="selected"' : '';
653
-                    $countriesoptions .= '<option value="' . htmlspecialchars(
653
+                    $countriesoptions .= '<option value="'.htmlspecialchars(
654 654
                             $record['short'],
655 655
                             ENT_COMPAT,
656 656
                             'UTF-8'
657
-                        ) . '"' . $sSelected . '>' . htmlspecialchars(
657
+                        ).'"'.$sSelected.'>'.htmlspecialchars(
658 658
                             $record['name'],
659 659
                             ENT_COMPAT,
660 660
                             'UTF-8'
661
-                        ) . '</option>' . "\n";
661
+                        ).'</option>'."\n";
662 662
                 }
663 663
                 tpl_set_var('countryoptions', $countriesoptions);
664 664
                 sql_free_result($rs);
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
                         $line = mb_ereg_replace('{name}', escape_javascript($record['name']), $line);
716 716
                         $line = mb_ereg_replace('{color}', $rAttrGroup['color'], $line);
717 717
                         $group_line .= $line;
718
-                        $nLineAttrCount ++;
718
+                        $nLineAttrCount++;
719 719
 
720 720
                         $line = $cache_attrib_js;
721 721
                         $line = mb_ereg_replace('{id}', $record['id'], $line);
@@ -772,11 +772,11 @@  discard block
 block discarded – undo
772 772
 
773 773
                 //difficulty
774 774
                 $difficulty_options = '';
775
-                for ($i = 2; $i <= 10; $i ++) {
775
+                for ($i = 2; $i <= 10; $i++) {
776 776
                     if ($cache_difficulty == $i) {
777
-                        $difficulty_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</option>';
777
+                        $difficulty_options .= '<option value="'.$i.'" selected="selected">'.$i / 2.'</option>';
778 778
                     } else {
779
-                        $difficulty_options .= '<option value="' . $i . '">' . $i / 2 . '</option>';
779
+                        $difficulty_options .= '<option value="'.$i.'">'.$i / 2.'</option>';
780 780
                     }
781 781
                     $difficulty_options .= "\n";
782 782
                 }
@@ -784,11 +784,11 @@  discard block
 block discarded – undo
784 784
 
785 785
                 //build terrain options
786 786
                 $terrain_options = '';
787
-                for ($i = 2; $i <= 10; $i ++) {
787
+                for ($i = 2; $i <= 10; $i++) {
788 788
                     if ($cache_terrain == $i) {
789
-                        $terrain_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</option>';
789
+                        $terrain_options .= '<option value="'.$i.'" selected="selected">'.$i / 2.'</option>';
790 790
                     } else {
791
-                        $terrain_options .= '<option value="' . $i . '">' . $i / 2 . '</option>';
791
+                        $terrain_options .= '<option value="'.$i.'">'.$i / 2.'</option>';
792 792
                     }
793 793
                     $terrain_options .= "\n";
794 794
                 }
@@ -801,16 +801,16 @@  discard block
 block discarded – undo
801 801
                                                         FROM `cache_type`
802 802
                                              LEFT JOIN `sys_trans` ON `cache_type`.`trans_id`=`sys_trans`.`id`
803 803
                                              LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND
804
-                                                                 `sys_trans_text`.`lang`='" . sql_escape($locale) . "'
804
+                                                                 `sys_trans_text`.`lang`='" . sql_escape($locale)."'
805 805
                                                 ORDER BY `cache_type`.`ordinal` ASC"
806 806
                 );
807 807
                 while ($rType = sql_fetch_assoc($rsTypes)) {
808 808
                     $sSelected = ($rType['id'] == $cache_type) ? ' selected="selected"' : '';
809
-                    $types .= '<option value="' . $rType['id'] . '"' . $sSelected . '>' . htmlspecialchars(
809
+                    $types .= '<option value="'.$rType['id'].'"'.$sSelected.'>'.htmlspecialchars(
810 810
                             $rType['name'],
811 811
                             ENT_COMPAT,
812 812
                             'UTF-8'
813
-                        ) . '</option>';
813
+                        ).'</option>';
814 814
                 }
815 815
                 sql_free_result($rsTypes);
816 816
                 tpl_set_var('typeoptions', $types);
@@ -822,16 +822,16 @@  discard block
 block discarded – undo
822 822
                                                         FROM `cache_size`
823 823
                                              LEFT JOIN `sys_trans` ON `cache_size`.`trans_id`=`sys_trans`.`id`
824 824
                                              LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND
825
-                                                                 `sys_trans_text`.`lang`='" . sql_escape($locale) . "'
825
+                                                                 `sys_trans_text`.`lang`='" . sql_escape($locale)."'
826 826
                                                 ORDER BY `cache_size`.`ordinal` ASC"
827 827
                 );
828 828
                 while ($rSize = sql_fetch_assoc($rsSizes)) {
829 829
                     $sSelected = ($rSize['id'] == $sel_size) ? ' selected="selected"' : '';
830
-                    $sizes .= '<option value="' . $rSize['id'] . '"' . $sSelected . '>' . htmlspecialchars(
830
+                    $sizes .= '<option value="'.$rSize['id'].'"'.$sSelected.'>'.htmlspecialchars(
831 831
                             $rSize['name'],
832 832
                             ENT_COMPAT,
833 833
                             'UTF-8'
834
-                        ) . '</option>';
834
+                        ).'</option>';
835 835
                 }
836 836
                 sql_free_result($rsSizes);
837 837
                 tpl_set_var('sizeoptions', $sizes);
@@ -842,14 +842,14 @@  discard block
 block discarded – undo
842 842
                 $gc_com_refs = false;
843 843
                 foreach ($desclangs AS $desclang) {
844 844
                     if (count($desclangs) > 1) {
845
-                        $remove_url = 'removedesc.php?cacheid=' . urlencode($cache_id) . '&desclang=' . urlencode(
845
+                        $remove_url = 'removedesc.php?cacheid='.urlencode($cache_id).'&desclang='.urlencode(
846 846
                                 $desclang
847 847
                             );
848
-                        $removedesc = '&nbsp;[<a href="' . htmlspecialchars(
848
+                        $removedesc = '&nbsp;[<a href="'.htmlspecialchars(
849 849
                                 $remove_url,
850 850
                                 ENT_COMPAT,
851 851
                                 'UTF-8'
852
-                            ) . '">' . $remove . '</a>]';
852
+                            ).'">'.$remove.'</a>]';
853 853
                     } else {
854 854
                         $removedesc = '';
855 855
                     }
@@ -865,17 +865,17 @@  discard block
 block discarded – undo
865 865
                     }
866 866
                     sql_free_result($resp);
867 867
 
868
-                    $edit_url = 'editdesc.php?cacheid=' . urlencode($cache_id) . '&desclang=' . urlencode($desclang);
868
+                    $edit_url = 'editdesc.php?cacheid='.urlencode($cache_id).'&desclang='.urlencode($desclang);
869 869
 
870
-                    $cache_descs .= '<tr><td colspan="2">' . htmlspecialchars(
870
+                    $cache_descs .= '<tr><td colspan="2">'.htmlspecialchars(
871 871
                             db_LanguageFromShort($desclang),
872 872
                             ENT_COMPAT,
873 873
                             'UTF-8'
874
-                        ) . ' [<a href="' . htmlspecialchars(
874
+                        ).' [<a href="'.htmlspecialchars(
875 875
                             $edit_url,
876 876
                             ENT_COMPAT,
877 877
                             'UTF-8'
878
-                        ) . '">' . $edit . '</a>]' . $removedesc . '</td></tr>';
878
+                        ).'">'.$edit.'</a>]'.$removedesc.'</td></tr>';
879 879
                 }
880 880
                 tpl_set_var('cache_descs', $cache_descs);
881 881
 
@@ -895,33 +895,33 @@  discard block
 block discarded – undo
895 895
                                                              FROM `cache_status`
896 896
                                                   LEFT JOIN `sys_trans` ON `cache_status`.`trans_id`=`sys_trans`.`id`
897 897
                                                   LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND
898
-                                                                      `sys_trans_text`.`lang`='" . sql_escape($locale) . "'
898
+                                                                      `sys_trans_text`.`lang`='" . sql_escape($locale)."'
899 899
                                                           WHERE `cache_status`.`id` NOT IN (4, 5, 7) OR `cache_status`.`id`='" . sql_escape(
900 900
                             $status_old + 0
901
-                        ) . "'
901
+                        )."'
902 902
                                                      ORDER BY `cache_status`.`id` ASC"
903 903
                     );
904 904
                     while ($rStatus = sql_fetch_assoc($rsStatus)) {
905 905
                         $sSelected = ($rStatus['id'] == $status) ? ' selected="selected"' : '';
906 906
                         if ($sSelected != '' || $status_old == 5) {
907
-                            $statusoptions .= '<option value="' . htmlspecialchars(
907
+                            $statusoptions .= '<option value="'.htmlspecialchars(
908 908
                                     $rStatus['id'],
909 909
                                     ENT_COMPAT,
910 910
                                     'UTF-8'
911
-                                ) . '"' . $sSelected . '>' . htmlspecialchars(
911
+                                ).'"'.$sSelected.'>'.htmlspecialchars(
912 912
                                     $rStatus['name'],
913 913
                                     ENT_COMPAT,
914 914
                                     'UTF-8'
915
-                                ) . '</option>';
915
+                                ).'</option>';
916 916
                         }
917 917
                     }
918 918
                     sql_free_result($rsStatus);
919 919
                 } else {
920
-                    $statusoptions .= '<option value="7" selected="selected">' . htmlspecialchars(
920
+                    $statusoptions .= '<option value="7" selected="selected">'.htmlspecialchars(
921 921
                             t("Locked, invisible"),
922 922
                             ENT_COMPAT,
923 923
                             'UTF-8'
924
-                        ) . '</option>';
924
+                        ).'</option>';
925 925
                 }
926 926
                 tpl_set_var('statusoptions', $statusoptions);
927 927
                 tpl_set_var('statuschange', $status_old == 5 ? '' : mb_ereg_replace('%1', $cache_id, $status_change));
@@ -951,11 +951,11 @@  discard block
 block discarded – undo
951 951
                     $tmp = mb_ereg_replace('{publish_notnow_checked}', ($publish == 'notnow') ? 'checked' : '', $tmp);
952 952
 
953 953
                     $activation_hours = '';
954
-                    for ($i = 0; $i <= 23; $i ++) {
954
+                    for ($i = 0; $i <= 23; $i++) {
955 955
                         if ($cache_activate_hour == $i) {
956
-                            $activation_hours .= '<option value="' . $i . '" selected="selected">' . $i . '</option>';
956
+                            $activation_hours .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
957 957
                         } else {
958
-                            $activation_hours .= '<option value="' . $i . '">' . $i . '</option>';
958
+                            $activation_hours .= '<option value="'.$i.'">'.$i.'</option>';
959 959
                         }
960 960
                         $activation_hours .= "\n";
961 961
                     }
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
                         $cache_id
980 980
                     );
981 981
 
982
-                    for ($i = 0; $i < mysql_num_rows($rspictures); $i ++) {
982
+                    for ($i = 0; $i < mysql_num_rows($rspictures); $i++) {
983 983
                         $tmpline = ($i == 0 ? $pictureline0 : $pictureline);
984 984
                         $pic_record = sql_fetch_array($rspictures);
985 985
 
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
                 $st_hours = floor($search_time);
1055 1055
                 $st_minutes = sprintf('%02.0F', ($search_time - $st_hours) * 60);
1056 1056
 
1057
-                tpl_set_var('search_time', $st_hours . ':' . $st_minutes);
1057
+                tpl_set_var('search_time', $st_hours.':'.$st_minutes);
1058 1058
 
1059 1059
                 tpl_set_var('way_length', $way_length);
1060 1060
                 tpl_set_var('log_pw', htmlspecialchars($log_pw, ENT_COMPAT, 'UTF-8'));
@@ -1062,7 +1062,7 @@  discard block
 block discarded – undo
1062 1062
                 tpl_set_var('showlists_checked', $showlists ? 'checked="checked"' : '');
1063 1063
                 tpl_set_var('protectcoords_checked', $protect_old_coords ? 'checked="checked"' : '');
1064 1064
 
1065
-                tpl_set_var('reset', $reset);  // obsolete
1065
+                tpl_set_var('reset', $reset); // obsolete
1066 1066
                 tpl_set_var('submit', $submit);
1067 1067
             } else {
1068 1068
                 //TODO: not the owner
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -76,7 +76,8 @@  discard block
 block discarded – undo
76 76
 if ($error == false) {
77 77
     //cacheid
78 78
     $cache_id = 0;
79
-    if (isset($_REQUEST['cacheid'])) { // Ocprop
79
+    if (isset($_REQUEST['cacheid'])) {
80
+// Ocprop
80 81
         $cache_id = $_REQUEST['cacheid'];
81 82
     }
82 83
 
@@ -196,7 +197,8 @@  discard block
 block discarded – undo
196 197
                 $way_length = isset($_POST['way_length']) ? $_POST['way_length'] : $cache_record['way_length'];
197 198
 
198 199
                 if ($status_old == 5 && $status == 5) {
199
-                    if (isset($_POST['publish'])) { // Ocprop
200
+                    if (isset($_POST['publish'])) {
201
+// Ocprop
200 202
                         $publish = $_POST['publish'];
201 203
                         if (!($publish == 'now' || $publish == 'later' || $publish == 'notnow')) {
202 204
                             // somebody messed up the POST-data, so we do not publish the cache, since he isn't published right now (status=5)
@@ -226,12 +228,14 @@  discard block
 block discarded – undo
226 228
                     $status = $status_old;
227 229
                 }
228 230
 
229
-                if ($status_old == 7) // cache is locked
231
+                if ($status_old == 7) {
232
+                    // cache is locked
230 233
                 {
231 234
                     // only admins can change status of locked caches
232 235
                     if (($bAdmin & ADMIN_USER) != ADMIN_USER) {
233 236
                         // no status change allowed for normal user
234 237
                         $status = $status_old;
238
+                }
235 239
                     }
236 240
                 }
237 241
 
@@ -437,7 +441,8 @@  discard block
 block discarded – undo
437 441
                 }
438 442
 
439 443
                 //try to save to DB?
440
-                if (isset($_POST['submit'])) { // Ocprop
444
+                if (isset($_POST['submit'])) {
445
+// Ocprop
441 446
                     //all validations ok?
442 447
                     if (!($hidden_date_not_ok || $lat_not_ok || $lon_not_ok || $name_not_ok || $time_not_ok || $way_length_not_ok || $size_not_ok || $activate_date_not_ok || $status_not_ok || $diff_not_ok || $attribs_not_ok || $wpgc_not_ok)) {
443 448
                         $cache_lat = $coords_lat_h + $coords_lat_min / 60;
@@ -927,9 +932,11 @@  discard block
 block discarded – undo
927 932
                 tpl_set_var('statuschange', $status_old == 5 ? '' : mb_ereg_replace('%1', $cache_id, $status_change));
928 933
 
929 934
                 // show activation form?
930
-                if ($status_old == 5) // status = not yet published
935
+                if ($status_old == 5) {
936
+                    // status = not yet published
931 937
                 {
932 938
                     $tmp = $activation_form;
939
+                }
933 940
 
934 941
                     $tmp = mb_ereg_replace(
935 942
                         '{activate_day}',
Please login to merge, or discard this patch.
htdocs/util2/stats/rank.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 header('Content-type: text/html; charset=utf-8');
9 9
 
10 10
 $opt['rootpath'] = '../../';
11
-require $opt['rootpath'] . 'lib2/web.inc.php';
11
+require $opt['rootpath'].'lib2/web.inc.php';
12 12
 
13 13
 $n = 1;
14 14
 $rs = sql('SELECT `user`.`username`, `stat_user`.`found`
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
            ORDER BY `stat_user`.`found` DESC
19 19
               LIMIT 100');
20 20
 while ($r = sql_fetch_assoc($rs)) {
21
-    echo $n . ' ' . $r['username'] . ': ' . $r['found'] . "\n";
22
-    $n ++;
21
+    echo $n.' '.$r['username'].': '.$r['found']."\n";
22
+    $n++;
23 23
 }
24 24
 sql_free_result($rs);
Please login to merge, or discard this patch.
htdocs/util2/stats/owner.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 header('Content-type: text/html; charset=utf-8');
9 9
 
10 10
 $opt['rootpath'] = '../../';
11
-require $opt['rootpath'] . 'lib2/web.inc.php';
11
+require $opt['rootpath'].'lib2/web.inc.php';
12 12
 
13 13
 echo "<h2>Top-Owner</h2>\n";
14 14
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         FROM `caches`
29 29
         LEFT JOIN `user` ON `user`.`user_id`=`caches`.`user_id`
30 30
         LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6
31
-        WHERE status=1 AND " . $condition . "
31
+        WHERE status=1 AND " . $condition."
32 32
         GROUP BY `caches`.`user_id`
33 33
         HAVING COUNT(*) >= $limit
34 34
         ORDER BY COUNT(*) DESC"
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     $n = 1;
38 38
     while ($r = sql_fetch_assoc($rs)) {
39
-        echo "  <tr><td style='text-align:right'>&nbsp;&nbsp;" . ($n ++) . ".&nbsp;&nbsp;&nbsp;</td><td style='text-align:right'>" . $r['count'] . "</td><td>&nbsp;&nbsp;" . $r['name'] . "</td></tr>\n";
39
+        echo "  <tr><td style='text-align:right'>&nbsp;&nbsp;".($n++).".&nbsp;&nbsp;&nbsp;</td><td style='text-align:right'>".$r['count']."</td><td>&nbsp;&nbsp;".$r['name']."</td></tr>\n";
40 40
     }
41 41
     sql_free_result($rs);
42 42
 
Please login to merge, or discard this patch.
htdocs/util2/license/process-old-disabled-users.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
  ***************************************************************************/
13 13
 
14 14
 $opt['rootpath'] = '../../';
15
-require_once $opt['rootpath'] . 'lib2/cli.inc.php';
16
-require_once $opt['rootpath'] . 'lib2/logic/user.class.php';
15
+require_once $opt['rootpath'].'lib2/cli.inc.php';
16
+require_once $opt['rootpath'].'lib2/logic/user.class.php';
17 17
 
18 18
 $login->admin = ADMIN_USER;
19 19
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 $n = 0;
26 26
 while ($r = sql_fetch_assoc($rs)) {
27
-    echo "purging content of user '" . $r['username'] . "'\n";
27
+    echo "purging content of user '".$r['username']."'\n";
28 28
 
29 29
     $user = new user($r['user_id']);
30 30
     $result = $user->disduelicense(true);
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         die($result);
33 33
     }
34 34
 
35
-    ++ $n;
35
+    ++$n;
36 36
 }
37 37
 sql_free_result($rs);
38 38
 
Please login to merge, or discard this patch.
htdocs/util2/gns/gns_import.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     $file = fopen($filename, "r");
45 45
     $cnt = 0;
46 46
     while ($line = fgets($file, 4096)) {
47
-        if ($cnt ++ == 0) {// skip first line
47
+        if ($cnt++ == 0) {// skip first line
48 48
             continue;
49 49
         }
50 50
 
@@ -52,31 +52,31 @@  discard block
 block discarded – undo
52 52
 
53 53
         sql(
54 54
             "INSERT IGNORE INTO gns_locations SET
55
-                    rc = '" . sql_escape($gns[0]) . "',
56
-                    ufi = '" . sql_escape($gns[1]) . "',
57
-                    uni = '" . sql_escape($gns[2]) . "',
58
-                    lat = '" . sql_escape($gns[3]) . "',
59
-                    lon = '" . sql_escape($gns[4]) . "',
60
-                    dms_lat = '" . sql_escape($gns[5]) . "',
61
-                    dms_lon = '" . sql_escape($gns[6]) . "',
62
-                    utm = '" . sql_escape($gns[7]) . "',
63
-                    jog = '" . sql_escape($gns[8]) . "',
64
-                    fc = '" . sql_escape($gns[9]) . "',
65
-                    dsg = '" . sql_escape($gns[10]) . "',
66
-                    pc = '" . sql_escape($gns[11]) . "',
67
-                    cc1 = '" . sql_escape($gns[12]) . "',
68
-                    adm1 = '" . sql_escape($gns[13]) . "',
69
-                    adm2 = _utf8'" . sql_escape($gns[14]) . "',
70
-                    dim = '" . sql_escape($gns[15]) . "',
71
-                    cc2 = '" . sql_escape($gns[16]) . "',
72
-                    nt = '" . sql_escape($gns[17]) . "',
73
-                    lc = '" . sql_escape($gns[18]) . "',
74
-                    SHORT_FORM = _utf8'" . sql_escape($gns[19]) . "',
75
-                    GENERIC = _utf8'" . sql_escape($gns[20]) . "',
76
-                    SORT_NAME = _utf8'" . sql_escape($gns[21]) . "',
77
-                    FULL_NAME = _utf8'" . sql_escape($gns[22]) . "',
78
-                    FULL_NAME_ND = _utf8'" . sql_escape($gns[23]) . "',
79
-                    MOD_DATE = '" . sql_escape($gns[24]) . "'"
55
+                    rc = '" . sql_escape($gns[0])."',
56
+                    ufi = '" . sql_escape($gns[1])."',
57
+                    uni = '" . sql_escape($gns[2])."',
58
+                    lat = '" . sql_escape($gns[3])."',
59
+                    lon = '" . sql_escape($gns[4])."',
60
+                    dms_lat = '" . sql_escape($gns[5])."',
61
+                    dms_lon = '" . sql_escape($gns[6])."',
62
+                    utm = '" . sql_escape($gns[7])."',
63
+                    jog = '" . sql_escape($gns[8])."',
64
+                    fc = '" . sql_escape($gns[9])."',
65
+                    dsg = '" . sql_escape($gns[10])."',
66
+                    pc = '" . sql_escape($gns[11])."',
67
+                    cc1 = '" . sql_escape($gns[12])."',
68
+                    adm1 = '" . sql_escape($gns[13])."',
69
+                    adm2 = _utf8'" . sql_escape($gns[14])."',
70
+                    dim = '" . sql_escape($gns[15])."',
71
+                    cc2 = '" . sql_escape($gns[16])."',
72
+                    nt = '" . sql_escape($gns[17])."',
73
+                    lc = '" . sql_escape($gns[18])."',
74
+                    SHORT_FORM = _utf8'" . sql_escape($gns[19])."',
75
+                    GENERIC = _utf8'" . sql_escape($gns[20])."',
76
+                    SORT_NAME = _utf8'" . sql_escape($gns[21])."',
77
+                    FULL_NAME = _utf8'" . sql_escape($gns[22])."',
78
+                    FULL_NAME_ND = _utf8'" . sql_escape($gns[23])."',
79
+                    MOD_DATE = '" . sql_escape($gns[24])."'"
80 80
         );
81 81
     }
82 82
     fclose($file);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,8 @@
 block discarded – undo
44 44
     $file = fopen($filename, "r");
45 45
     $cnt = 0;
46 46
     while ($line = fgets($file, 4096)) {
47
-        if ($cnt ++ == 0) {// skip first line
47
+        if ($cnt ++ == 0) {
48
+// skip first line
48 49
             continue;
49 50
         }
50 51
 
Please login to merge, or discard this patch.
htdocs/util2/gns/mksearchindex.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
  ***************************************************************************/
11 11
 
12 12
 $opt['rootpath'] = '../../';
13
-require_once $opt['rootpath'] . 'lib2/cli.inc.php';
14
-require_once $opt['rootpath'] . 'lib2/search/search.inc.php';
13
+require_once $opt['rootpath'].'lib2/cli.inc.php';
14
+require_once $opt['rootpath'].'lib2/search/search.inc.php';
15 15
 
16 16
 
17 17
 $doubleindex['sankt'] = 'st';
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     foreach ($simpletextsarray as $text) {
28 28
         if ($text != '') {
29 29
             if (nonalpha($text)) {
30
-                die($r['uni'] . ' ' . $text . "\n");// obsolete for the same reason as above
30
+                die($r['uni'].' '.$text."\n"); // obsolete for the same reason as above
31 31
             }
32 32
 
33 33
             $simpletext = search_text2simple($text);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 function nonalpha($str)
61 61
 {
62
-    for ($i = 0; $i < mb_strlen($str); $i ++) {
62
+    for ($i = 0; $i < mb_strlen($str); $i++) {
63 63
         if (!((ord(mb_substr($str, $i, 1)) >= ord('a')) && (ord(mb_substr($str, $i, 1)) <= ord('z')))) {
64 64
             return true;
65 65
         }
Please login to merge, or discard this patch.
htdocs/util2/gns/mkadmtxt.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
  ***************************************************************************/
11 11
 
12 12
 $opt['rootpath'] = '../../';
13
-require_once $opt['rootpath'] . 'lib2/cli.inc.php';
14
-require_once $opt['rootpath'] . 'lib2/search/search.inc.php';
13
+require_once $opt['rootpath'].'lib2/cli.inc.php';
14
+require_once $opt['rootpath'].'lib2/search/search.inc.php';
15 15
 
16 16
 
17 17
 $rsLocations = sql("SELECT `uni`, `lat`, `lon`, `rc`, `cc1`, `adm1` FROM `gns_locations` WHERE `dsg` LIKE 'PPL%'");
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     $maxlon = geomath::getMaxLon($rLocations['lon'], $rLocations['lat'], 10, 1);
23 23
 
24 24
     // den nächsgelegenen Ort in den geodb ermitteln
25
-    $sql = 'SELECT ' . geomath::getSqlDistanceFormula(
25
+    $sql = 'SELECT '.geomath::getSqlDistanceFormula(
26 26
             $rLocations['lon'],
27 27
             $rLocations['lat'],
28 28
             10,
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
             'lon',
31 31
             'lat',
32 32
             'geodb_coordinates'
33
-        ) . ' `distance`,
33
+        ).' `distance`,
34 34
                             `geodb_coordinates`.`loc_id` `loc_id`
35 35
                       FROM `geodb_coordinates`
36
-                      WHERE `lon` > ' . $minlon . ' AND
37
-                            `lon` < ' . $maxlon . ' AND
38
-                            `lat` > ' . $minlat . ' AND
39
-                            `lat` < ' . $maxlat . '
36
+                      WHERE `lon` > ' . $minlon.' AND
37
+                            `lon` < ' . $maxlon.' AND
38
+                            `lat` > ' . $minlat.' AND
39
+                            `lat` < ' . $maxlat.'
40 40
                       HAVING `distance` < 10
41 41
                       ORDER BY `distance` ASC
42 42
                       LIMIT 1';
Please login to merge, or discard this patch.