Completed
Push — master ( 182b8c...09455a )
by Thomas
07:02
created
htdocs/restorecaches.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 
133 133
 */
134 134
 
135
-require __DIR__ . '/lib2/web.inc.php';
136
-require_once __DIR__ . '/lib2/logic/labels.inc.php';
135
+require __DIR__.'/lib2/web.inc.php';
136
+require_once __DIR__.'/lib2/logic/labels.inc.php';
137 137
 
138 138
 $tpl->name = 'restorecaches';
139 139
 $tpl->menuitem = MNU_ADMIN_RESTORE;
@@ -308,12 +308,12 @@  discard block
 block discarded – undo
308 308
 
309 309
 function get_archive_data($caches)
310 310
 {
311
-    $cachelist = "(" . implode(",", $caches) . ")";
311
+    $cachelist = "(".implode(",", $caches).")";
312 312
     $data = array();
313 313
     $admins = array();
314 314
 
315 315
     // make waypoint index
316
-    $rs = sql("SELECT `cache_id`, `wp_oc` FROM `caches` WHERE `cache_id` IN " . $cachelist);
316
+    $rs = sql("SELECT `cache_id`, `wp_oc` FROM `caches` WHERE `cache_id` IN ".$cachelist);
317 317
     while ($r = sql_fetch_assoc($rs)) {
318 318
         $wp_oc[$r['cache_id']] = $r['wp_oc'];
319 319
     }
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
             `latitude`,
329 329
             `restored_by`
330 330
         FROM `cache_coordinates`
331
-        WHERE `cache_id` IN " . $cachelist . "
331
+        WHERE `cache_id` IN " . $cachelist."
332 332
         ORDER BY `date_created` ASC"
333 333
     );
334 334
     // order is relevant, because multiple changes per day possible
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
     while ($r = sql_fetch_assoc($rs)) {
337 337
         $coord = new coordinate($r['latitude'], $r['longitude']);
338 338
         $coord = $coord->getDecimalMinutes();
339
-        $coord = $coord['lat'] . " " . $coord['lon'];
339
+        $coord = $coord['lat']." ".$coord['lon'];
340 340
         if (isset($lastcoord[$r['cache_id']]) && $coord != $lastcoord[$r['cache_id']]) {
341 341
             // the database contains lots of old coord records with unchanged coords, wtf?
342 342
             append_data($data, $admins, $wp_oc, $r, "coord", $lastcoord[$r['cache_id']], $coord);
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
     // cache country
349 349
     $rs = sql("SELECT `cache_id`, LEFT(`date_created`,10) AS `date_modified`, `country`, `restored_by`
350 350
                FROM `cache_countries`
351
-                         WHERE `cache_id` IN " . $cachelist . "
351
+                         WHERE `cache_id` IN " . $cachelist."
352 352
                          ORDER BY `date_created` ASC");
353 353
     // order is relevant, because multiple changes per day possible
354 354
     $lastcountry = array();
@@ -364,17 +364,17 @@  discard block
 block discarded – undo
364 364
     // all other cache data
365 365
     // first the current data ...
366 366
     $nextcd = array();
367
-    $rs = sql("SELECT * FROM `caches` WHERE `cache_id` IN " . $cachelist);
367
+    $rs = sql("SELECT * FROM `caches` WHERE `cache_id` IN ".$cachelist);
368 368
     while ($r = sql_fetch_assoc($rs)) {
369 369
         $nextcd[$r['wp_oc']] = $r;
370
-        $user_id = $r['user_id'];     // is used later for logs
370
+        $user_id = $r['user_id']; // is used later for logs
371 371
     }
372 372
     sql_free_result($rs);
373 373
 
374 374
     // .. and then the changes
375 375
     $rs = sql(
376 376
         "SELECT * FROM `caches_modified`
377
-        WHERE `cache_id` IN " . $cachelist . "
377
+        WHERE `cache_id` IN " . $cachelist."
378 378
         ORDER BY `date_modified` DESC"
379 379
     );
380 380
     while ($r = sql_fetch_assoc($rs)) {
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
                 $wp_oc,
418 418
                 $r,
419 419
                 "time",
420
-                $r['search_time'] . ' h',
421
-                $nextcd[$wp]['search_time'] . ' h'
420
+                $r['search_time'].' h',
421
+                $nextcd[$wp]['search_time'].' h'
422 422
             );
423 423
         }
424 424
         if ($r['way_length'] != $nextcd[$wp]['way_length']) {
@@ -428,8 +428,8 @@  discard block
 block discarded – undo
428 428
                 $wp_oc,
429 429
                 $r,
430 430
                 "way",
431
-                $r['way_length'] . ' km',
432
-                $nextcd[$wp]['way_length'] . ' km'
431
+                $r['way_length'].' km',
432
+                $nextcd[$wp]['way_length'].' km'
433 433
             );
434 434
         }
435 435
         if ($r['wp_gc'] != $nextcd[$wp]['wp_gc']) {
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
     // attributes
466 466
     $rs = sql(
467 467
         "SELECT * FROM `caches_attributes_modified`
468
-        WHERE `cache_id` IN " . $cachelist . "  /* OConly attrib is shown, but not restorable */
469
-        ORDER BY `date_modified` ASC");   // order doesn't matter as long it is date only
468
+        WHERE `cache_id` IN " . $cachelist."  /* OConly attrib is shown, but not restorable */
469
+        ORDER BY `date_modified` ASC"); // order doesn't matter as long it is date only
470 470
     while ($r = sql_fetch_assoc($rs)) {
471 471
         append_data(
472 472
             $data,
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
             $wp_oc,
475 475
             $r,
476 476
             "attrib",
477
-            ($r['was_set'] ? "-" : "+") . labels::getLabelValue('cache_attrib', $r['attrib_id']),
477
+            ($r['was_set'] ? "-" : "+").labels::getLabelValue('cache_attrib', $r['attrib_id']),
478 478
             ''
479 479
         );
480 480
     }
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
             LENGTH(`short_desc`) AS `sdl`,
513 513
             `restored_by`
514 514
         FROM `cache_desc_modified`
515
-        WHERE `cache_id` IN " . $cachelist . "
515
+        WHERE `cache_id` IN " . $cachelist."
516 516
         ORDER BY `date_modified` DESC"
517 517
     );
518 518
     // order doesn't matter as long only one change per day is recorded
@@ -534,8 +534,8 @@  discard block
 block discarded – undo
534 534
                 $admins,
535 535
                 $wp_oc,
536 536
                 $r,
537
-                "desc(" . $r['language'] . ")",
538
-                $r['dl'] + 0, $next['dl'] + 0 . " bytes"
537
+                "desc(".$r['language'].")",
538
+                $r['dl'] + 0, $next['dl'] + 0." bytes"
539 539
             );
540 540
         }
541 541
         if ($r['hl'] + 0 != $next['hl'] + 0) {
@@ -544,9 +544,9 @@  discard block
 block discarded – undo
544 544
                 $admins,
545 545
                 $wp_oc,
546 546
                 $r,
547
-                "hint(" . $r['language'] . ")",
547
+                "hint(".$r['language'].")",
548 548
                 $r['hl'] + 0,
549
-                $next['hl'] + 0 . " bytes"
549
+                $next['hl'] + 0." bytes"
550 550
             );
551 551
         }
552 552
         if ($r['sdl'] + 0 != $next['sdl'] + 0) {
@@ -555,9 +555,9 @@  discard block
 block discarded – undo
555 555
                 $admins,
556 556
                 $wp_oc,
557 557
                 $r,
558
-                "shortdesc(" . $r['language'] . ")",
558
+                "shortdesc(".$r['language'].")",
559 559
                 $r['sdl'] + 0,
560
-                $next['sdl'] + 0 . " bytes"
560
+                $next['sdl'] + 0." bytes"
561 561
             );
562 562
         }
563 563
 
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
               (SELECT 1 AS `op`, `deletion_date` AS `date_modified`, `cache_id`,
581 581
                     `user_id`, `type`, `date`, `restored_by`
582 582
                    FROM `cache_logs_archived`
583
-                  WHERE `cache_id` IN " . $cachelist . "AND `deleted_by`='&1' AND `user_id`<>'&1'
583
+                  WHERE `cache_id` IN " . $cachelist."AND `deleted_by`='&1' AND `user_id`<>'&1'
584 584
                   UNION
585 585
                   SELECT 2 AS `op`, `date_modified`, `cache_id`,
586 586
                        (SELECT `user_id` FROM `cache_logs_archived` WHERE `id`=`original_id`),
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
                        (SELECT `date` FROM `cache_logs_archived` WHERE `id`=`original_id`),
589 589
                        `restored_by`
590 590
                  FROM `cache_logs_restored`
591
-                  WHERE `cache_id` IN " . $cachelist . ") `logs`
591
+                  WHERE `cache_id` IN " . $cachelist.") `logs`
592 592
                 INNER JOIN `user` ON `user`.`user_id`=`logs`.`user_id`
593 593
               ORDER BY `logs`.`date_modified` ASC",
594 594
         // order may not be exact when redoing reverts, because delete and insert
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
             $wp_oc,
603 603
             $r,
604 604
             $r["op"] == 1 ? "dellog" : "restorelog",
605
-            "<a href='viewprofile.php?userid=" . $r['user_id'] . "' target='_blank'>" . $r['username'] . "</a>/" . $r['date'],
605
+            "<a href='viewprofile.php?userid=".$r['user_id']."' target='_blank'>".$r['username']."</a>/".$r['date'],
606 606
             ''
607 607
         );
608 608
     }
@@ -618,9 +618,9 @@  discard block
 block discarded – undo
618 618
 
619 619
     $piccacheid = "IF(`object_type`=2, `object_id`, IF(`object_type`=1, IFNULL((SELECT `cache_id` FROM `cache_logs` WHERE `id`=`object_id`),(SELECT `cache_id` FROM `cache_logs_archived` WHERE `id`=`object_id`)), 0))";
620 620
     $rs = sql(
621
-        "SELECT *, " . $piccacheid . "AS `cache_id` FROM `pictures_modified`
622
-        WHERE " . $piccacheid . " IN " . $cachelist . "
623
-        ORDER BY `date_modified` ASC");  // order is relevant for the case of restore-reverts
621
+        "SELECT *, ".$piccacheid."AS `cache_id` FROM `pictures_modified`
622
+        WHERE " . $piccacheid." IN ".$cachelist."
623
+        ORDER BY `date_modified` ASC"); // order is relevant for the case of restore-reverts
624 624
     while ($r = sql_fetch_assoc($rs)) {
625 625
         $r['date_modified'] = substr($r['date_modified'], 0, 10);
626 626
         switch ($r['operation']) {
@@ -642,14 +642,14 @@  discard block
 block discarded – undo
642 642
                 $picchange .= "-cache";
643 643
                 break;
644 644
         }
645
-        append_data($data, $admins, $wp_oc, $r, $picchange . "pic", $r['title'], '');
645
+        append_data($data, $admins, $wp_oc, $r, $picchange."pic", $r['title'], '');
646 646
     }
647 647
     sql_free_result($rs);
648 648
 
649 649
     // admins
650 650
     foreach ($admins as $adate => $adata) {
651 651
         foreach ($adata as $awp => $alist) {
652
-            $data[$adate][$awp] .= "<br /><strong class='adminrestore'>admins:</strong> " . implode(',', $alist);
652
+            $data[$adate][$awp] .= "<br /><strong class='adminrestore'>admins:</strong> ".implode(',', $alist);
653 653
         }
654 654
     }
655 655
 
@@ -698,9 +698,9 @@  discard block
 block discarded – undo
698 698
     } else {
699 699
         $text .= " class='userchange'";
700 700
     }
701
-    $text .= ">$field</strong>: $oldvalue" . ($newvalue != "" ? " &rarr; $newvalue" : "");
701
+    $text .= ">$field</strong>: $oldvalue".($newvalue != "" ? " &rarr; $newvalue" : "");
702 702
     if (isset($data[$mdate][$wp])) {
703
-        $data[$mdate][$wp] .= ", " . $text;
703
+        $data[$mdate][$wp] .= ", ".$text;
704 704
     } else {
705 705
         $data[$mdate][$wp] = $text;
706 706
     }
@@ -713,8 +713,8 @@  discard block
 block discarded – undo
713 713
             $admins[$mdate][$wp] = [];
714 714
         }
715 715
         $admins[$mdate][$wp][$r['restored_by'] + 0]
716
-            = "<a href='viewprofile.php?userid=" . $r['restored_by'] . "' target='_blank'>" .
717
-            sql_value("SELECT `username` FROM `user` WHERE `user_id`='&1'", "", $r['restored_by']) .
716
+            = "<a href='viewprofile.php?userid=".$r['restored_by']."' target='_blank'>".
717
+            sql_value("SELECT `username` FROM `user` WHERE `user_id`='&1'", "", $r['restored_by']).
718 718
             "</a>";
719 719
     }
720 720
 }
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 {
725 725
     global $opt, $login;
726 726
 
727
-    sql("SET @restoredby='&1'", $login->userid);         // is evaluated by trigger functions
727
+    sql("SET @restoredby='&1'", $login->userid); // is evaluated by trigger functions
728 728
     sql_slave("SET @restoredby='&1'", $login->userid);
729 729
 
730 730
     $restored = array();
@@ -834,12 +834,12 @@  discard block
 block discarded – undo
834 834
                     if ($setfields != "") {
835 835
                         $setfields .= ",";
836 836
                     }
837
-                    $setfields .= "`$field`='" . sql_escape($r[$field]) . "'";
837
+                    $setfields .= "`$field`='".sql_escape($r[$field])."'";
838 838
                     $restored[$wp][$field] = true;
839 839
                 }
840 840
             }
841 841
             if ($setfields != "" && !$simulate) {
842
-                sql("UPDATE `caches` SET " . $setfields . " WHERE `cache_id`='&1'", $cacheid);
842
+                sql("UPDATE `caches` SET ".$setfields." WHERE `cache_id`='&1'", $cacheid);
843 843
             }
844 844
         }
845 845
         sql_free_result($rs);
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
                         // id, uuid, date_created and last_modified are set automatically;
1017 1017
                         // picture will be updated automatically on picture-restore
1018 1018
                         $log = new cachelog();
1019
-                        $log->setNode($r['node']);  // cachelog class currently does not initialize node field
1019
+                        $log->setNode($r['node']); // cachelog class currently does not initialize node field
1020 1020
                         $log->setCacheId($r['cache_id']);
1021 1021
                         $log->setUserId($r['user_id']);
1022 1022
                         $log->setType($r['type'], true);
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
                 }  // not already processed
1069 1069
 
1070 1070
                 if ($error != "") {
1071
-                    $restored[$wp]['internal error - could not $error log ' + $r['id'] + "/" + $logid];
1071
+                    $restored[$wp]['internal error - could not $error log ' +$r['id'] + "/" +$logid];
1072 1072
                 }
1073 1073
                 if ($logs_restored) {
1074 1074
                     $restored[$wp]['logs'] = true;
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
                 }  // not already processed
1203 1203
 
1204 1204
                 if ($error != "") {
1205
-                    $restored[$wp]['internal error - could not $error picture ' . $r['id'] + "/" + $picid] = true;
1205
+                    $restored[$wp]['internal error - could not $error picture '.$r['id'] + "/" +$picid] = true;
1206 1206
                 }
1207 1207
                 if ($pics_restored) {
1208 1208
                     $restored[$wp]['pictures'] = true;
Please login to merge, or discard this patch.
htdocs/api/email_problems.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@  discard block
 block discarded – undo
5 5
  *  Unicode Reminder メモ
6 6
  ***************************************************************************/
7 7
 
8
-$opt['rootpath'] = __DIR__ . '/../';
9
-require $opt['rootpath'] . 'lib2/web.inc.php';
8
+$opt['rootpath'] = __DIR__.'/../';
9
+require $opt['rootpath'].'lib2/web.inc.php';
10 10
 
11 11
 header('Content-type: text/plain; charset=utf-8');
12 12
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 ) {
17 17
     $rs = sql('SELECT `user_id`, `email_problems` FROM `user` WHERE `email_problems`');
18 18
     while ($r = sql_fetch_assoc($rs)) {
19
-        echo $r['user_id'] . ' ' . $r['email_problems'] . "\n";
19
+        echo $r['user_id'].' '.$r['email_problems']."\n";
20 20
     }
21 21
     sql_free_result($rs);
22 22
 }
Please login to merge, or discard this patch.
htdocs/api/hidden_caches.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
  *  replicated system than the XML interface.
10 10
  ***************************************************************************/
11 11
 
12
-$opt['rootpath'] = __DIR__ . '/../';
13
-require $opt['rootpath'] . 'lib2/web.inc.php';
12
+$opt['rootpath'] = __DIR__.'/../';
13
+require $opt['rootpath'].'lib2/web.inc.php';
14 14
 
15 15
 header('Content-type: text/plain; charset=utf-8');
16 16
 
@@ -24,5 +24,5 @@  discard block
 block discarded – undo
24 24
 );
25 25
 $wp_ocs = sql_fetch_column($rs);
26 26
 foreach ($wp_ocs as $wp_oc) {
27
-    echo $wp_oc . "\n";
27
+    echo $wp_oc."\n";
28 28
 }
Please login to merge, or discard this patch.
htdocs/api/gc2oc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
  *
14 14
  ***************************************************************************/
15 15
 
16
-$opt['rootpath'] = __DIR__ . '/../';
17
-require $opt['rootpath'] . 'lib2/web.inc.php';
16
+$opt['rootpath'] = __DIR__.'/../';
17
+require $opt['rootpath'].'lib2/web.inc.php';
18 18
 
19 19
 if (isset($_REQUEST['report']) && $_REQUEST['report']) {
20 20
     header('Content-type: text/plain');
Please login to merge, or discard this patch.
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 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@  discard block
 block discarded – undo
13 13
 use Oc\Libse\ChildWp\HandlerChildWp;
14 14
 use Oc\Libse\Coordinate\FormatterCoordinate;
15 15
 
16
-require_once __DIR__ . '/lib/consts.inc.php';
16
+require_once __DIR__.'/lib/consts.inc.php';
17 17
 $opt['gui'] = GUI_HTML;
18
-require_once __DIR__ . '/lib/common.inc.php';
18
+require_once __DIR__.'/lib/common.inc.php';
19 19
 
20 20
 function getWaypoints($cacheid)
21 21
 {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $tplname = 'login';
86 86
 
87 87
         tpl_set_var('username', '');
88
-        tpl_set_var('target', 'editcache.php?cacheid=' . urlencode($cache_id));
88
+        tpl_set_var('target', 'editcache.php?cacheid='.urlencode($cache_id));
89 89
         tpl_set_var('message_start', "");
90 90
         tpl_set_var('message_end', "");
91 91
         tpl_set_var('message', $login_required);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             if ($cache_record['user_id'] == $usr['userid'] || $login->listingAdmin()) {
132 132
                 $tplname = 'editcache';
133 133
 
134
-                require $stylepath . '/editcache.inc.php';
134
+                require $stylepath.'/editcache.inc.php';
135 135
 
136 136
                 if ($cache_record['node'] != $oc_nodeid) {
137 137
                     tpl_errorMsg('editcache', $error_wrong_node);
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 }
140 140
 
141 141
                 //here we read all used information from the form if submitted, otherwise from DB
142
-                $cache_name = trim(isset($_POST['name']) ? $_POST['name'] : $cache_record['name']);  // Ocprop
142
+                $cache_name = trim(isset($_POST['name']) ? $_POST['name'] : $cache_record['name']); // Ocprop
143 143
                 $cache_type = isset($_POST['type']) ? $_POST['type'] : $cache_record['type'];
144 144
                 if (!isset($_POST['size'])) {
145 145
                     if ($cache_type == 4 || $cache_type == 5) {
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
                 $cache_hidden_day = isset($_POST['hidden_day']) ? $_POST['hidden_day'] : date(
154 154
                     'd',
155 155
                     strtotime($cache_record['date_hidden'])
156
-                );  // Ocprop
156
+                ); // Ocprop
157 157
                 $cache_hidden_month = isset($_POST['hidden_month']) ? $_POST['hidden_month'] : date(
158 158
                     'm',
159 159
                     strtotime($cache_record['date_hidden'])
160
-                );  // Ocprop
160
+                ); // Ocprop
161 161
                 $cache_hidden_year = isset($_POST['hidden_year']) ? $_POST['hidden_year'] : date(
162 162
                     'Y',
163 163
                     strtotime($cache_record['date_hidden'])
164
-                );  // Ocprop
164
+                ); // Ocprop
165 165
 
166 166
                 if (is_null($cache_record['date_activate'])) {
167 167
                     $cache_activate_day = isset($_POST['activate_day']) ? $_POST['activate_day'] : date('d');
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
                     );
188 188
                 }
189 189
 
190
-                $cache_difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : $cache_record['difficulty'];  // Ocprop
191
-                $cache_terrain = isset($_POST['terrain']) ? $_POST['terrain'] : $cache_record['terrain'];  // Ocprop
192
-                $cache_country = isset($_POST['country']) ? $_POST['country'] : $cache_record['country'];  // Ocprop
190
+                $cache_difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : $cache_record['difficulty']; // Ocprop
191
+                $cache_terrain = isset($_POST['terrain']) ? $_POST['terrain'] : $cache_record['terrain']; // Ocprop
192
+                $cache_country = isset($_POST['country']) ? $_POST['country'] : $cache_record['country']; // Ocprop
193 193
                 $show_all_countries = isset($_POST['show_all_countries']) ? $_POST['show_all_countries'] : 0;
194
-                $status = isset($_POST['status']) ? $_POST['status'] : $cache_record['status'];  // Ocprop
194
+                $status = isset($_POST['status']) ? $_POST['status'] : $cache_record['status']; // Ocprop
195 195
                 $status_old = $cache_record['status'];
196 196
                 $search_time = isset($_POST['search_time']) ? $_POST['search_time'] : $cache_record['search_time'];
197 197
                 $way_length = isset($_POST['way_length']) ? $_POST['way_length'] : $cache_record['way_length'];
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
                 $log_pw = isset($_POST['log_pw']) ? mb_substr($_POST['log_pw'], 0, 20) : $cache_record['logpw'];
255 255
                 // fix #4356: gc waypoints are frequently copy&pasted with leading spaces
256
-                $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : $cache_record['wp_gc'];  // Ocprop
256
+                $wp_gc = isset($_POST['wp_gc']) ? strtoupper(trim($_POST['wp_gc'])) : $cache_record['wp_gc']; // Ocprop
257 257
                 $showlists = isset($_POST['showlists']) ? 1 : $cache_record['show_cachelists'] + 0;
258 258
                 $protect_old_coords = isset($_POST['protect_old_coords']) ? 1 : $cache_record['protect_old_coords'] + 0;
259 259
 
@@ -265,12 +265,12 @@  discard block
 block discarded – undo
265 265
 
266 266
                 if (isset($_POST['latNS'])) {
267 267
                     //get coords from post-form
268
-                    $coords_latNS = $_POST['latNS'];  // Ocprop
269
-                    $coords_lonEW = $_POST['lonEW'];  // Ocprop
270
-                    $coords_lat_h = $_POST['lat_h'];  // Ocprop
271
-                    $coords_lon_h = $_POST['lon_h'];  // Ocprop
272
-                    $coords_lat_min = $_POST['lat_min'];  // Ocprop
273
-                    $coords_lon_min = $_POST['lon_min'];  // Ocprop
268
+                    $coords_latNS = $_POST['latNS']; // Ocprop
269
+                    $coords_lonEW = $_POST['lonEW']; // Ocprop
270
+                    $coords_lat_h = $_POST['lat_h']; // Ocprop
271
+                    $coords_lon_h = $_POST['lon_h']; // Ocprop
272
+                    $coords_lat_min = $_POST['lat_min']; // Ocprop
273
+                    $coords_lon_min = $_POST['lon_min']; // Ocprop
274 274
                 } else {
275 275
                     //get coords from DB
276 276
                     $coords_lon = $cache_record['longitude'];
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                             $activation_date = 'NULL';
458 458
                         } elseif ($publish == 'later') {
459 459
                             $status = 5;
460
-                            $activation_date = "'" . sql_escape(
460
+                            $activation_date = "'".sql_escape(
461 461
                                     date(
462 462
                                         'Y-m-d H:i:s',
463 463
                                         mktime(
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
                                             $cache_activate_year
470 470
                                         )
471 471
                                     )
472
-                                ) . "'";
472
+                                )."'";
473 473
                         } elseif ($publish == 'notnow') {
474 474
                             $status = 5;
475 475
                             $activation_date = 'NULL';
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
                                     $logtype = 13;
565 565
                                     break;
566 566
                                 default:
567
-                                    $logtype = 0;  // ???
567
+                                    $logtype = 0; // ???
568 568
                             }
569 569
                             if ($logtype > 0) {
570 570
                                 sql(
@@ -585,25 +585,25 @@  discard block
 block discarded – undo
585 585
 
586 586
                         // update cache attributes
587 587
                         $attriblist = "999";
588
-                        for ($i = 0; $i < count($cache_attribs); $i ++) {
588
+                        for ($i = 0; $i < count($cache_attribs); $i++) {
589 589
                             if ($cache_attribs[$i] + 0 > 0) {
590 590
                                 sql(
591 591
                                     "INSERT IGNORE INTO `caches_attributes` (`cache_id`, `attrib_id`) VALUES('&1', '&2')",
592 592
                                     $cache_id,
593 593
                                     $cache_attribs[$i] + 0
594 594
                                 );
595
-                                $attriblist .= "," . ($cache_attribs[$i] + 0);
595
+                                $attriblist .= ",".($cache_attribs[$i] + 0);
596 596
                             }
597 597
                         }
598 598
 
599 599
                         sql(
600
-                            "DELETE FROM `caches_attributes` WHERE `cache_id`='&1' AND `attrib_id` NOT IN (" . $attriblist . ")",
600
+                            "DELETE FROM `caches_attributes` WHERE `cache_id`='&1' AND `attrib_id` NOT IN (".$attriblist.")",
601 601
                             // SQL injections in $attriblist prevented by adding 0 above
602 602
                             $cache_id
603 603
                         );
604 604
 
605 605
                         //call eventhandler
606
-                        require_once $opt['rootpath'] . 'lib/eventhandler.inc.php';
606
+                        require_once $opt['rootpath'].'lib/eventhandler.inc.php';
607 607
                         event_edit_cache($cache_id, $usr['userid'] + 0);
608 608
 
609 609
                         // if old status is not yet published and new status is published => notify-event
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
                         }
613 613
 
614 614
                         //display cache-page
615
-                        tpl_redirect('viewcache.php?cacheid=' . urlencode($cache_id));
615
+                        tpl_redirect('viewcache.php?cacheid='.urlencode($cache_id));
616 616
                         // Ocprop: Location:\s*$viewcacheUrl\?cacheid=([0-9]+)
617 617
                         // (s.a. tpl_redirect() in common.inc.php
618 618
                         exit;
@@ -654,15 +654,15 @@  discard block
 block discarded – undo
654 654
 
655 655
                 while ($record = sql_fetch_assoc($rs)) {
656 656
                     $sSelected = ($record['short'] == $cache_country) ? ' selected="selected"' : '';
657
-                    $countriesoptions .= '<option value="' . htmlspecialchars(
657
+                    $countriesoptions .= '<option value="'.htmlspecialchars(
658 658
                             $record['short'],
659 659
                             ENT_COMPAT,
660 660
                             'UTF-8'
661
-                        ) . '"' . $sSelected . '>' . htmlspecialchars(
661
+                        ).'"'.$sSelected.'>'.htmlspecialchars(
662 662
                             $record['name'],
663 663
                             ENT_COMPAT,
664 664
                             'UTF-8'
665
-                        ) . '</option>' . "\n";
665
+                        ).'</option>'."\n";
666 666
                 }
667 667
                 tpl_set_var('countryoptions', $countriesoptions);
668 668
                 sql_free_result($rs);
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
                         $line = mb_ereg_replace('{name}', escape_javascript($record['name']), $line);
720 720
                         $line = mb_ereg_replace('{color}', $rAttrGroup['color'], $line);
721 721
                         $group_line .= $line;
722
-                        $nLineAttrCount ++;
722
+                        $nLineAttrCount++;
723 723
 
724 724
                         $line = $cache_attrib_js;
725 725
                         $line = mb_ereg_replace('{id}', $record['id'], $line);
@@ -776,11 +776,11 @@  discard block
 block discarded – undo
776 776
 
777 777
                 //difficulty
778 778
                 $difficulty_options = '';
779
-                for ($i = 2; $i <= 10; $i ++) {
779
+                for ($i = 2; $i <= 10; $i++) {
780 780
                     if ($cache_difficulty == $i) {
781
-                        $difficulty_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</option>';
781
+                        $difficulty_options .= '<option value="'.$i.'" selected="selected">'.$i / 2.'</option>';
782 782
                     } else {
783
-                        $difficulty_options .= '<option value="' . $i . '">' . $i / 2 . '</option>';
783
+                        $difficulty_options .= '<option value="'.$i.'">'.$i / 2.'</option>';
784 784
                     }
785 785
                     $difficulty_options .= "\n";
786 786
                 }
@@ -788,11 +788,11 @@  discard block
 block discarded – undo
788 788
 
789 789
                 //build terrain options
790 790
                 $terrain_options = '';
791
-                for ($i = 2; $i <= 10; $i ++) {
791
+                for ($i = 2; $i <= 10; $i++) {
792 792
                     if ($cache_terrain == $i) {
793
-                        $terrain_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</option>';
793
+                        $terrain_options .= '<option value="'.$i.'" selected="selected">'.$i / 2.'</option>';
794 794
                     } else {
795
-                        $terrain_options .= '<option value="' . $i . '">' . $i / 2 . '</option>';
795
+                        $terrain_options .= '<option value="'.$i.'">'.$i / 2.'</option>';
796 796
                     }
797 797
                     $terrain_options .= "\n";
798 798
                 }
@@ -805,16 +805,16 @@  discard block
 block discarded – undo
805 805
                                                         FROM `cache_type`
806 806
                                              LEFT JOIN `sys_trans` ON `cache_type`.`trans_id`=`sys_trans`.`id`
807 807
                                              LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND
808
-                                                                 `sys_trans_text`.`lang`='" . sql_escape($locale) . "'
808
+                                                                 `sys_trans_text`.`lang`='" . sql_escape($locale)."'
809 809
                                                 ORDER BY `cache_type`.`ordinal` ASC"
810 810
                 );
811 811
                 while ($rType = sql_fetch_assoc($rsTypes)) {
812 812
                     $sSelected = ($rType['id'] == $cache_type) ? ' selected="selected"' : '';
813
-                    $types .= '<option value="' . $rType['id'] . '"' . $sSelected . '>' . htmlspecialchars(
813
+                    $types .= '<option value="'.$rType['id'].'"'.$sSelected.'>'.htmlspecialchars(
814 814
                             $rType['name'],
815 815
                             ENT_COMPAT,
816 816
                             'UTF-8'
817
-                        ) . '</option>';
817
+                        ).'</option>';
818 818
                 }
819 819
                 sql_free_result($rsTypes);
820 820
                 tpl_set_var('typeoptions', $types);
@@ -826,16 +826,16 @@  discard block
 block discarded – undo
826 826
                                                         FROM `cache_size`
827 827
                                              LEFT JOIN `sys_trans` ON `cache_size`.`trans_id`=`sys_trans`.`id`
828 828
                                              LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND
829
-                                                                 `sys_trans_text`.`lang`='" . sql_escape($locale) . "'
829
+                                                                 `sys_trans_text`.`lang`='" . sql_escape($locale)."'
830 830
                                                 ORDER BY `cache_size`.`ordinal` ASC"
831 831
                 );
832 832
                 while ($rSize = sql_fetch_assoc($rsSizes)) {
833 833
                     $sSelected = ($rSize['id'] == $sel_size) ? ' selected="selected"' : '';
834
-                    $sizes .= '<option value="' . $rSize['id'] . '"' . $sSelected . '>' . htmlspecialchars(
834
+                    $sizes .= '<option value="'.$rSize['id'].'"'.$sSelected.'>'.htmlspecialchars(
835 835
                             $rSize['name'],
836 836
                             ENT_COMPAT,
837 837
                             'UTF-8'
838
-                        ) . '</option>';
838
+                        ).'</option>';
839 839
                 }
840 840
                 sql_free_result($rsSizes);
841 841
                 tpl_set_var('sizeoptions', $sizes);
@@ -846,14 +846,14 @@  discard block
 block discarded – undo
846 846
                 $gc_com_refs = false;
847 847
                 foreach ($desclangs AS $desclang) {
848 848
                     if (count($desclangs) > 1) {
849
-                        $remove_url = 'removedesc.php?cacheid=' . urlencode($cache_id) . '&desclang=' . urlencode(
849
+                        $remove_url = 'removedesc.php?cacheid='.urlencode($cache_id).'&desclang='.urlencode(
850 850
                                 $desclang
851 851
                             );
852
-                        $removedesc = '&nbsp;[<a href="' . htmlspecialchars(
852
+                        $removedesc = '&nbsp;[<a href="'.htmlspecialchars(
853 853
                                 $remove_url,
854 854
                                 ENT_COMPAT,
855 855
                                 'UTF-8'
856
-                            ) . '">' . $remove . '</a>]';
856
+                            ).'">'.$remove.'</a>]';
857 857
                     } else {
858 858
                         $removedesc = '';
859 859
                     }
@@ -869,17 +869,17 @@  discard block
 block discarded – undo
869 869
                     }
870 870
                     sql_free_result($resp);
871 871
 
872
-                    $edit_url = 'editdesc.php?cacheid=' . urlencode($cache_id) . '&desclang=' . urlencode($desclang);
872
+                    $edit_url = 'editdesc.php?cacheid='.urlencode($cache_id).'&desclang='.urlencode($desclang);
873 873
 
874
-                    $cache_descs .= '<tr><td colspan="2">' . htmlspecialchars(
874
+                    $cache_descs .= '<tr><td colspan="2">'.htmlspecialchars(
875 875
                             db_LanguageFromShort($desclang),
876 876
                             ENT_COMPAT,
877 877
                             'UTF-8'
878
-                        ) . ' [<a href="' . htmlspecialchars(
878
+                        ).' [<a href="'.htmlspecialchars(
879 879
                             $edit_url,
880 880
                             ENT_COMPAT,
881 881
                             'UTF-8'
882
-                        ) . '">' . $edit . '</a>]' . $removedesc . '</td></tr>';
882
+                        ).'">'.$edit.'</a>]'.$removedesc.'</td></tr>';
883 883
                 }
884 884
                 tpl_set_var('cache_descs', $cache_descs);
885 885
 
@@ -899,33 +899,33 @@  discard block
 block discarded – undo
899 899
                                                              FROM `cache_status`
900 900
                                                   LEFT JOIN `sys_trans` ON `cache_status`.`trans_id`=`sys_trans`.`id`
901 901
                                                   LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND
902
-                                                                      `sys_trans_text`.`lang`='" . sql_escape($locale) . "'
902
+                                                                      `sys_trans_text`.`lang`='" . sql_escape($locale)."'
903 903
                                                           WHERE `cache_status`.`id` NOT IN (4, 5, 7) OR `cache_status`.`id`='" . sql_escape(
904 904
                             $status_old + 0
905
-                        ) . "'
905
+                        )."'
906 906
                                                      ORDER BY `cache_status`.`id` ASC"
907 907
                     );
908 908
                     while ($rStatus = sql_fetch_assoc($rsStatus)) {
909 909
                         $sSelected = ($rStatus['id'] == $status) ? ' selected="selected"' : '';
910 910
                         if ($sSelected != '' || $status_old == 5) {
911
-                            $statusoptions .= '<option value="' . htmlspecialchars(
911
+                            $statusoptions .= '<option value="'.htmlspecialchars(
912 912
                                     $rStatus['id'],
913 913
                                     ENT_COMPAT,
914 914
                                     'UTF-8'
915
-                                ) . '"' . $sSelected . '>' . htmlspecialchars(
915
+                                ).'"'.$sSelected.'>'.htmlspecialchars(
916 916
                                     $rStatus['name'],
917 917
                                     ENT_COMPAT,
918 918
                                     'UTF-8'
919
-                                ) . '</option>';
919
+                                ).'</option>';
920 920
                         }
921 921
                     }
922 922
                     sql_free_result($rsStatus);
923 923
                 } else {
924
-                    $statusoptions .= '<option value="7" selected="selected">' . htmlspecialchars(
924
+                    $statusoptions .= '<option value="7" selected="selected">'.htmlspecialchars(
925 925
                             t("Locked, invisible"),
926 926
                             ENT_COMPAT,
927 927
                             'UTF-8'
928
-                        ) . '</option>';
928
+                        ).'</option>';
929 929
                 }
930 930
                 tpl_set_var('statusoptions', $statusoptions);
931 931
                 tpl_set_var('statuschange', $status_old == 5 ? '' : mb_ereg_replace('%1', $cache_id, $status_change));
@@ -955,11 +955,11 @@  discard block
 block discarded – undo
955 955
                     $tmp = mb_ereg_replace('{publish_notnow_checked}', ($publish == 'notnow') ? 'checked' : '', $tmp);
956 956
 
957 957
                     $activation_hours = '';
958
-                    for ($i = 0; $i <= 23; $i ++) {
958
+                    for ($i = 0; $i <= 23; $i++) {
959 959
                         if ($cache_activate_hour == $i) {
960
-                            $activation_hours .= '<option value="' . $i . '" selected="selected">' . $i . '</option>';
960
+                            $activation_hours .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
961 961
                         } else {
962
-                            $activation_hours .= '<option value="' . $i . '">' . $i . '</option>';
962
+                            $activation_hours .= '<option value="'.$i.'">'.$i.'</option>';
963 963
                         }
964 964
                         $activation_hours .= "\n";
965 965
                     }
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
                         $cache_id
984 984
                     );
985 985
 
986
-                    for ($i = 0; $i < mysql_num_rows($rspictures); $i ++) {
986
+                    for ($i = 0; $i < mysql_num_rows($rspictures); $i++) {
987 987
                         $tmpline = ($i == 0 ? $pictureline0 : $pictureline);
988 988
                         $pic_record = sql_fetch_array($rspictures);
989 989
 
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
                 $st_hours = floor($search_time);
1059 1059
                 $st_minutes = sprintf('%02.0F', ($search_time - $st_hours) * 60);
1060 1060
 
1061
-                tpl_set_var('search_time', $st_hours . ':' . $st_minutes);
1061
+                tpl_set_var('search_time', $st_hours.':'.$st_minutes);
1062 1062
 
1063 1063
                 tpl_set_var('way_length', $way_length);
1064 1064
                 tpl_set_var('log_pw', htmlspecialchars($log_pw, ENT_COMPAT, 'UTF-8'));
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
                 tpl_set_var('showlists_checked', $showlists ? 'checked="checked"' : '');
1067 1067
                 tpl_set_var('protectcoords_checked', $protect_old_coords ? 'checked="checked"' : '');
1068 1068
 
1069
-                tpl_set_var('reset', $reset);  // obsolete
1069
+                tpl_set_var('reset', $reset); // obsolete
1070 1070
                 tpl_set_var('submit', $submit);
1071 1071
             } else {
1072 1072
                 //TODO: not the owner
Please login to merge, or discard this patch.
htdocs/translate.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
  *  Unicode Reminder メモ
6 6
  ***************************************************************************/
7 7
 
8
-require __DIR__ . '/lib2/web.inc.php';
9
-require_once __DIR__ . '/lib2/translate.class.php';
10
-require_once __DIR__ . '/lib2/translationHandler.class.php';
8
+require __DIR__.'/lib2/web.inc.php';
9
+require_once __DIR__.'/lib2/translate.class.php';
10
+require_once __DIR__.'/lib2/translationHandler.class.php';
11 11
 
12 12
 /* config section
13 13
  */
@@ -249,11 +249,11 @@  discard block
 block discarded – undo
249 249
 {
250 250
     global $opt;
251 251
 
252
-    if (!file_exists($opt['rootpath'] . '../sql/static-data/data.sql')) {
252
+    if (!file_exists($opt['rootpath'].'../sql/static-data/data.sql')) {
253 253
         return '';
254 254
     }
255 255
 
256
-    $content = file_get_contents($opt['rootpath'] . '../sql/static-data/data.sql');
256
+    $content = file_get_contents($opt['rootpath'].'../sql/static-data/data.sql');
257 257
 
258 258
     // at the end is an INSERT of the current checksum
259 259
     // to calculate this checksum, we have to trim the end before that statement and the linefeed before
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     sql("DELETE FROM `sys_trans_text` WHERE `trans_id`='&1'", $id);
283 283
     sql("DELETE FROM `sys_trans_ref` WHERE `trans_id`='&1'", $id);
284 284
 
285
-    $tpl->redirect('translate.php?translang=' . $translang);
285
+    $tpl->redirect('translate.php?translang='.$translang);
286 286
 }
287 287
 
288 288
 function edit()
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
             );
312 312
         }
313 313
         sql_free_result($rs);
314
-        $tpl->redirect('translate.php?translang=' . $translang . '&action=edit&id=' . $id);
314
+        $tpl->redirect('translate.php?translang='.$translang.'&action=edit&id='.$id);
315 315
     } else {
316 316
         if (isset($_REQUEST['submit'])) {
317 317
             $transText = isset($_REQUEST['transText']) ? $_REQUEST['transText'] : '';
@@ -347,14 +347,14 @@  discard block
 block discarded – undo
347 347
 
348 348
     // built sql string to search for texts with little difference (levensthein() would be better, but not available in MYSQL)
349 349
     $sWhereSql =
350
-        "SOUNDEX('" . sql_escape($r['text']) . "')=SOUNDEX(`sys_trans`.`text`)
351
-         OR SOUNDEX('" . sql_escape($r['text']) . "')=SOUNDEX(`sys_trans_text`.`text`)";
350
+        "SOUNDEX('".sql_escape($r['text'])."')=SOUNDEX(`sys_trans`.`text`)
351
+         OR SOUNDEX('" . sql_escape($r['text'])."')=SOUNDEX(`sys_trans_text`.`text`)";
352 352
 
353 353
     $trans = sql(
354 354
         "SELECT DISTINCT `sys_trans`.`id`, `sys_trans`.`text`
355 355
          FROM `sys_trans`
356 356
          INNER JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id`
357
-         WHERE `sys_trans`.`id`!='&1' AND (" . $sWhereSql . ")",
357
+         WHERE `sys_trans`.`id`!='&1' AND (" . $sWhereSql.")",
358 358
         $id
359 359
     );
360 360
     $tpl->assign_rs('trans', $trans);
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
     $translationHandler->createMessageFiles();
389 389
 
390
-    $tpl->redirect('translate.php?translang=' . $translang);
390
+    $tpl->redirect('translate.php?translang='.$translang);
391 391
 }
392 392
 
393 393
 function unlinkFiles($relbasedir, $ext)
@@ -398,12 +398,12 @@  discard block
 block discarded – undo
398 398
         $relbasedir .= '/';
399 399
     }
400 400
 
401
-    if ($opt['rootpath'] . $relbasedir) {
402
-        if ($dh = opendir($opt['rootpath'] . $relbasedir)) {
401
+    if ($opt['rootpath'].$relbasedir) {
402
+        if ($dh = opendir($opt['rootpath'].$relbasedir)) {
403 403
             while (($file = readdir($dh)) !== false) {
404
-                if ($file != '.' && $file != '..' && is_file($opt['rootpath'] . $relbasedir . $file)) {
405
-                    if (substr($file, - (strlen($ext) + 1), strlen($ext) + 1) == '.' . $ext) {
406
-                        unlink($opt['rootpath'] . $relbasedir . $file);
404
+                if ($file != '.' && $file != '..' && is_file($opt['rootpath'].$relbasedir.$file)) {
405
+                    if (substr($file, - (strlen($ext) + 1), strlen($ext) + 1) == '.'.$ext) {
406
+                        unlink($opt['rootpath'].$relbasedir.$file);
407 407
                     }
408 408
                 }
409 409
             }
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
     $lastId = sql_value("SELECT MAX(`id`) FROM `sys_trans`", 0);
479 479
     sql("ALTER TABLE `sys_trans` AUTO_INCREMENT = &1", $lastId + 1);
480 480
 
481
-    $tpl->redirect('translate.php?translang=' . $translang);
481
+    $tpl->redirect('translate.php?translang='.$translang);
482 482
 }
483 483
 
484 484
 function useId($freeId)
@@ -500,9 +500,9 @@  discard block
 block discarded – undo
500 500
 
501 501
     foreach ($transIdCols as $col) {
502 502
         sql(
503
-            "UPDATE `" . $col['table'] . "`
504
-             SET `" . $col['trans_id'] . "`='&1'
505
-             WHERE `" . $col['trans_id'] . "`='&2'",
503
+            "UPDATE `".$col['table']."`
504
+             SET `" . $col['trans_id']."`='&1'
505
+             WHERE `" . $col['trans_id']."`='&2'",
506 506
             $newId,
507 507
             $oldId
508 508
         );
@@ -513,9 +513,9 @@  discard block
 block discarded – undo
513 513
 {
514 514
     global $opt, $tpl, $translang;
515 515
 
516
-    $structure = enumSqlFiles($opt['rootpath'] . '../sql/tables');
516
+    $structure = enumSqlFiles($opt['rootpath'].'../sql/tables');
517 517
     foreach ($structure AS $sTable) {
518
-        sql_export_structure_to_file($opt['rootpath'] . '../sql/tables/' . $sTable . '.sql', $sTable);
518
+        sql_export_structure_to_file($opt['rootpath'].'../sql/tables/'.$sTable.'.sql', $sTable);
519 519
     }
520 520
 
521 521
     // static data tables
@@ -551,21 +551,21 @@  discard block
 block discarded – undo
551 551
     $stab[] = 'towns';
552 552
     $stab[] = 'watches_waitingtypes';
553 553
 
554
-    sql_export_tables_to_file($opt['rootpath'] . '../sql/static-data/data.sql', $stab);
554
+    sql_export_tables_to_file($opt['rootpath'].'../sql/static-data/data.sql', $stab);
555 555
 
556 556
     $checksum = calcDataSqlChecksum(false);
557
-    $f = fopen($opt['rootpath'] . '../sql/static-data/data.sql', 'a');
557
+    $f = fopen($opt['rootpath'].'../sql/static-data/data.sql', 'a');
558 558
     fwrite(
559 559
         $f,
560 560
         "INSERT INTO `sysconfig` (`name`, `value`)"
561
-        . " VALUES ('datasql_checksum', '" . sql_escape($checksum) . "')"
562
-        . " ON DUPLICATE KEY UPDATE `value`='" . sql_escape($checksum) . "';\n"
561
+        . " VALUES ('datasql_checksum', '".sql_escape($checksum)."')"
562
+        . " ON DUPLICATE KEY UPDATE `value`='".sql_escape($checksum)."';\n"
563 563
     );
564 564
     fclose($f);
565 565
 
566 566
     setSysConfig('datasql_checksum', $checksum);
567 567
 
568
-    $tpl->redirect('translate.php?translang=' . $translang);
568
+    $tpl->redirect('translate.php?translang='.$translang);
569 569
 }
570 570
 
571 571
 function enumSqlFiles($dir)
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
         $hDir = opendir($dir);
595 595
         if ($hDir !== false) {
596 596
             while (($file = readdir($hDir)) !== false) {
597
-                if (is_file($dir . '/' . $file)) {
597
+                if (is_file($dir.'/'.$file)) {
598 598
                     if ((substr($file, - 4) == '.tpl') || (substr($file, - 4) == '.php')) {
599
-                        $files[] = $dir . '/' . $file;
599
+                        $files[] = $dir.'/'.$file;
600 600
                     }
601 601
                 }
602 602
             }
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
         $writer->writeAttribute('id', $r['id']);
691 691
 
692 692
         $writer->writeElement('code', $r['text']);
693
-        for ($n = 0; $n < count($lang); $n ++) {
693
+        for ($n = 0; $n < count($lang); $n++) {
694 694
             $writer->writeElement(
695 695
                 $lang[$n],
696 696
                 sql_value(
@@ -712,9 +712,9 @@  discard block
 block discarded – undo
712 712
         while ($rUsage = sql_fetch_assoc($rsUsage)) {
713 713
             $line = '';
714 714
             if ($rUsage['line'] != 0) {
715
-                $line = ' (' . $rUsage['line'] . ')';
715
+                $line = ' ('.$rUsage['line'].')';
716 716
             }
717
-            $writer->writeElement('usage', $rUsage['resource_name'] . $line);
717
+            $writer->writeElement('usage', $rUsage['resource_name'].$line);
718 718
         }
719 719
         sql_free_result($rsUsage);
720 720
 
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 
739 739
     $scanlang = [];
740 740
     foreach ($opt['locale'] AS $k => $v) {
741
-        if (isset($_REQUEST['lang' . $k]) && ($_REQUEST['lang' . $k] == '1')) {
741
+        if (isset($_REQUEST['lang'.$k]) && ($_REQUEST['lang'.$k] == '1')) {
742 742
             $scanlang[] = $k;
743 743
         }
744 744
     }
@@ -818,15 +818,15 @@  discard block
 block discarded – undo
818 818
 
819 819
     $nCount = isset($_REQUEST['count']) ? $_REQUEST['count'] + 0 : 0;
820 820
 
821
-    for ($nIndex = 1; $nIndex <= $nCount; $nIndex ++) {
822
-        if (isset($_REQUEST['useitem' . $nIndex]) && ($_REQUEST['useitem' . $nIndex] == '1')) {
823
-            $sCode = base64_decode($_REQUEST['code' . $nIndex]);
821
+    for ($nIndex = 1; $nIndex <= $nCount; $nIndex++) {
822
+        if (isset($_REQUEST['useitem'.$nIndex]) && ($_REQUEST['useitem'.$nIndex] == '1')) {
823
+            $sCode = base64_decode($_REQUEST['code'.$nIndex]);
824 824
             $transId = sql_value("SELECT `id` FROM `sys_trans` WHERE `text`='&1'", 0, $sCode);
825 825
 
826 826
             if ($transId != 0) {
827 827
                 foreach ($opt['locale'] AS $k => $v) {
828
-                    if (isset($_REQUEST[$k . $nIndex . 'new'])) {
829
-                        $sText = base64_decode($_REQUEST[$k . $nIndex . 'new']);
828
+                    if (isset($_REQUEST[$k.$nIndex.'new'])) {
829
+                        $sText = base64_decode($_REQUEST[$k.$nIndex.'new']);
830 830
 
831 831
                         sql(
832 832
                             "INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`)
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
         }
843 843
     }
844 844
 
845
-    $tpl->redirect('translate.php?translang=' . $translang);
845
+    $tpl->redirect('translate.php?translang='.$translang);
846 846
 }
847 847
 
848 848
 function textexport($translang, $all)
@@ -872,9 +872,9 @@  discard block
 block discarded – undo
872 872
             $translang
873 873
         );
874 874
         if (($all) || (mb_strlen($translated) == 0)) {
875
-            $thisline = $r['id'] . "\r\n";
876
-            $thisline .= $r['text'] . "\r\n";
877
-            $thisline .= $translated . "\r\n";
875
+            $thisline = $r['id']."\r\n";
876
+            $thisline .= $r['text']."\r\n";
877
+            $thisline .= $translated."\r\n";
878 878
             $thisline .= "\r\n";
879 879
             echo($thisline);
880 880
         }
@@ -1010,8 +1010,8 @@  discard block
 block discarded – undo
1010 1010
     }
1011 1011
 
1012 1012
     while (($file = readdir($hDir)) !== false) {
1013
-        if ($file != '.' && $file != '..' && is_dir($basedir . $file)) {
1014
-            addClassesDirectoriesToDirlist($basedir . $file);
1013
+        if ($file != '.' && $file != '..' && is_dir($basedir.$file)) {
1014
+            addClassesDirectoriesToDirlist($basedir.$file);
1015 1015
         }
1016 1016
     }
1017 1017
     closedir($hDir);
@@ -1026,9 +1026,9 @@  discard block
 block discarded – undo
1026 1026
         if (!isset($col['verify']) || $col['verify']) {
1027 1027
             $rs = sql(
1028 1028
                 "SELECT
1029
-                    `" . $col['text'] . "` `text`,
1030
-                    `" . $col['trans_id'] . "` `trans_id`
1031
-                 FROM `" . $col['table'] . "`"
1029
+                    `" . $col['text']."` `text`,
1030
+                    `" . $col['trans_id']."` `trans_id`
1031
+                 FROM `" . $col['table']."`"
1032 1032
             );
1033 1033
             while ($r = sql_fetch_assoc($rs)) {
1034 1034
                 $st = sql_value(
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
                 if ($en != $r['text'] || $st != $r['text']) {
1049 1049
                     $inconsistencies[] = [
1050 1050
                         'id' => $r['trans_id'],
1051
-                        'col' => $col['table'] . '.' . $col['text'],
1051
+                        'col' => $col['table'].'.'.$col['text'],
1052 1052
                         'org_text' => $r['text'],
1053 1053
                         'sys_trans' => $st,
1054 1054
                         'en_text' => $en,
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.