@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | * Data import functions are in util2/cron/modules/geokrety.class.php. |
11 | 11 | ***************************************************************************/ |
12 | 12 | |
13 | -$opt['rootpath'] = __DIR__ . '/../../'; |
|
14 | -require_once $opt['rootpath'] . 'lib2/cli.inc.php'; |
|
13 | +$opt['rootpath'] = __DIR__.'/../../'; |
|
14 | +require_once $opt['rootpath'].'lib2/cli.inc.php'; |
|
15 | 15 | |
16 | 16 | $itemwps = []; |
17 | 17 | |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | $wp |
64 | 64 | ) == 0 |
65 | 65 | ) { |
66 | - echo "item " . $itemid . ": " . $wp . " is missing in gk_move_waypoint\n"; |
|
66 | + echo "item ".$itemid.": ".$wp." is missing in gk_move_waypoint\n"; |
|
67 | 67 | } else { |
68 | - echo "item " . $itemid . ": " . $wp . " is not the current wp in gk_move_waypoint\n"; |
|
68 | + echo "item ".$itemid.": ".$wp." is not the current wp in gk_move_waypoint\n"; |
|
69 | 69 | } |
70 | 70 | } elseif (isset($flags['movewp']) && !isset($flags['itemwp'])) { |
71 | - echo "item " . $itemid . ": " . $wp . " is missing in gk_item_waypoint\n"; |
|
71 | + echo "item ".$itemid.": ".$wp." is missing in gk_item_waypoint\n"; |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | } |
@@ -8,23 +8,23 @@ discard block |
||
8 | 8 | * creates backups of gk_ tables and initializes archive directory. |
9 | 9 | ***************************************************************************/ |
10 | 10 | |
11 | -$opt['rootpath'] = __DIR__ . '/../../'; |
|
12 | -require_once $opt['rootpath'] . 'lib2/cli.inc.php'; |
|
11 | +$opt['rootpath'] = __DIR__.'/../../'; |
|
12 | +require_once $opt['rootpath'].'lib2/cli.inc.php'; |
|
13 | 13 | |
14 | 14 | if (count($argv) != 2 || ($argv[1] != 'init' && $argv[1] != 'discard')) { |
15 | - die("\n" . |
|
16 | - "Please verify that runcron.php is disabled in crontab;\n" . |
|
17 | - "then run this script with\n" . |
|
18 | - "\n" . |
|
19 | - " php save-gkstate.php init to initialize or reset GK archive\n" . |
|
20 | - " php save-gkstate.php discard to discard GK archive\n" . |
|
21 | - "\n" . |
|
22 | - "Don't forget to re-enable cronjobs afterwards!\n" . |
|
15 | + die("\n". |
|
16 | + "Please verify that runcron.php is disabled in crontab;\n". |
|
17 | + "then run this script with\n". |
|
18 | + "\n". |
|
19 | + " php save-gkstate.php init to initialize or reset GK archive\n". |
|
20 | + " php save-gkstate.php discard to discard GK archive\n". |
|
21 | + "\n". |
|
22 | + "Don't forget to re-enable cronjobs afterwards!\n". |
|
23 | 23 | "\n"); |
24 | 24 | } |
25 | 25 | |
26 | 26 | if ($opt['cron']['geokrety']['xml_archive'] != ($argv[1] == 'init')) { |
27 | - die("Error: Geokrety XML archiving is " . ($opt['cron']['geokrety']['xml_archive'] ? 'enabled' : 'disabled') . " in settings\n"); |
|
27 | + die("Error: Geokrety XML archiving is ".($opt['cron']['geokrety']['xml_archive'] ? 'enabled' : 'disabled')." in settings\n"); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | echo "deleting old archive if exists\n"; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | sql("DROP TABLE IF EXISTS _backup_gk_move_waypoint"); |
36 | 36 | sql("DROP TABLE IF EXISTS _backup_gk_user"); |
37 | 37 | |
38 | -foreach (glob($opt['rootpath'] . "cache2/geokrety/import-*.xml") as $f) { |
|
38 | +foreach (glob($opt['rootpath']."cache2/geokrety/import-*.xml") as $f) { |
|
39 | 39 | unlink($f); |
40 | 40 | } |
41 | 41 |
@@ -10,14 +10,14 @@ |
||
10 | 10 | * version 9 on, as newcache.php and editcache.php now trim the names. |
11 | 11 | ***************************************************************************/ |
12 | 12 | |
13 | -$opt['rootpath'] = __DIR__ . '/../../'; |
|
14 | -require __DIR__ . '/../../lib2/cli.inc.php'; |
|
13 | +$opt['rootpath'] = __DIR__.'/../../'; |
|
14 | +require __DIR__.'/../../lib2/cli.inc.php'; |
|
15 | 15 | |
16 | 16 | $rs = sql("SELECT `cache_id`, `name` FROM `caches` WHERE `name`<'\"' ORDER BY `name` ASC"); |
17 | 17 | while ($r = sql_fetch_array($rs)) { |
18 | 18 | $name = trim($r['name']); |
19 | 19 | if ($name != $r['name'] && $name != "") { |
20 | - echo "ID " . $r['cache_id'] . ": trimmed cache name to '" . $name . "'\n"; |
|
20 | + echo "ID ".$r['cache_id'].": trimmed cache name to '".$name."'\n"; |
|
21 | 21 | sql("UPDATE `caches` SET `name`='&1' WHERE `cache_id`=&2", $name, $r['cache_id']); |
22 | 22 | } |
23 | 23 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use Oc\Libse\ChildWp\ControllerChildWp; |
10 | 10 | use Oc\Libse\ChildWp\HandlerChildWp; |
11 | 11 | |
12 | -require __DIR__ . '/lib2/web.inc.php'; |
|
12 | +require __DIR__.'/lib2/web.inc.php'; |
|
13 | 13 | |
14 | 14 | $tpl->name = 'childwp'; |
15 | 15 | $tpl->menuitem = MNU_CACHES_HIDE; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | if ($redirect) { |
37 | - $tpl->redirect('editcache.php?cacheid=' . $presenter->getCacheId()); |
|
37 | + $tpl->redirect('editcache.php?cacheid='.$presenter->getCacheId()); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $presenter->prepare($tpl); |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * Unicode Reminder メモ |
6 | 6 | ***************************************************************************/ |
7 | 7 | |
8 | -require __DIR__ . '/lib2/web.inc.php'; |
|
8 | +require __DIR__.'/lib2/web.inc.php'; |
|
9 | 9 | |
10 | 10 | $tpl->name = 'newcachesrest'; |
11 | 11 | $tpl->menuitem = MNU_START_NEWCACHES; |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | $tpl->caching = true; |
15 | 15 | $tpl->cache_lifetime = 3600; |
16 | 16 | |
17 | -$country = isset($_REQUEST['usercountry']) ? $_REQUEST['usercountry'] : |
|
18 | - (isset($_REQUEST['country']) ? $_REQUEST['country'] : $opt['page']['main_country']); |
|
17 | +$country = isset($_REQUEST['usercountry']) ? $_REQUEST['usercountry'] : (isset($_REQUEST['country']) ? $_REQUEST['country'] : $opt['page']['main_country']); |
|
19 | 18 | |
20 | 19 | if (!$tpl->is_cached()) { |
21 | 20 | $newCaches = array(); |
@@ -27,7 +26,7 @@ discard block |
||
27 | 26 | FROM `caches` |
28 | 27 | INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` |
29 | 28 | WHERE `cache_status`.`allow_user_view`=1 |
30 | - AND `country`!='" . sql_escape($country) . "' |
|
29 | + AND `country`!='" . sql_escape($country)."' |
|
31 | 30 | ORDER BY `date_created` DESC LIMIT 200" |
32 | 31 | ); |
33 | 32 |
@@ -5,15 +5,15 @@ discard block |
||
5 | 5 | * Unicode Reminder メモ |
6 | 6 | ***************************************************************************/ |
7 | 7 | |
8 | -require __DIR__ . '/lib2/web.inc.php'; |
|
9 | -require_once __DIR__ . '/lib2/edithelper.inc.php'; |
|
8 | +require __DIR__.'/lib2/web.inc.php'; |
|
9 | +require_once __DIR__.'/lib2/edithelper.inc.php'; |
|
10 | 10 | |
11 | 11 | $tpl->name = 'mylists'; |
12 | 12 | $tpl->menuitem = MNU_MYPROFILE_LISTS; |
13 | 13 | |
14 | 14 | $login->verify(); |
15 | 15 | if ($login->userid == 0) { |
16 | - $tpl->redirect('login.php?target=' . urlencode($tpl->target)); |
|
16 | + $tpl->redirect('login.php?target='.urlencode($tpl->target)); |
|
17 | 17 | } |
18 | 18 | $user = new user($login->userid); |
19 | 19 | |
@@ -152,14 +152,14 @@ discard block |
||
152 | 152 | |
153 | 153 | // redirect to list search output after editing a list from the search output page |
154 | 154 | if ($fromsearch && !$switchDescMode && !$name_error && isset($_REQUEST['listid'])) { |
155 | - $iwp = ($invalid_waypoints ? '&invalidwp=' . urlencode($invalid_waypoints) : ''); |
|
156 | - $tpl->redirect('cachelist.php?id=' . ($_REQUEST['listid'] + 0) . $iwp); |
|
155 | + $iwp = ($invalid_waypoints ? '&invalidwp='.urlencode($invalid_waypoints) : ''); |
|
156 | + $tpl->redirect('cachelist.php?id='.($_REQUEST['listid'] + 0).$iwp); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | // prepare editor and editing |
160 | 160 | if ($descMode == 3) { |
161 | 161 | $tpl->add_header_javascript('resource2/tinymce/tiny_mce_gzip.js'); |
162 | - $tpl->add_header_javascript('resource2/tinymce/config/list.js.php?lang=' . strtolower($opt['template']['locale'])); |
|
162 | + $tpl->add_header_javascript('resource2/tinymce/config/list.js.php?lang='.strtolower($opt['template']['locale'])); |
|
163 | 163 | } |
164 | 164 | $tpl->add_header_javascript(editorJsPath()); |
165 | 165 | if ($edit_list) { |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | if (isset($_REQUEST['SESSION']) && $_REQUEST['SESSION'] != '') { |
25 | 25 | $this->init_session(); |
26 | 26 | } |
27 | - } elseif (isset($_COOKIE[$opt['session']['cookiename'] . 'data'])) { |
|
27 | + } elseif (isset($_COOKIE[$opt['session']['cookiename'].'data'])) { |
|
28 | 28 | //get the cookievars-array |
29 | - $decoded = base64_decode($_COOKIE[$opt['session']['cookiename'] . 'data']); |
|
29 | + $decoded = base64_decode($_COOKIE[$opt['session']['cookiename'].'data']); |
|
30 | 30 | |
31 | 31 | if ($decoded !== false) { |
32 | 32 | $this->values = @unserialize($decoded); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | if ($opt['session']['check_referer']) { |
53 | 53 | if (isset($_SERVER['REFERER'])) { |
54 | - if (strtolower(substr('http' + strstr($_SERVER['REFERER'], '://'), 0, strlen($opt['page']['absolute_http_url']))) != strtolower($opt['page']['absolute_http_url'])) { |
|
54 | + if (strtolower(substr('http' +strstr($_SERVER['REFERER'], '://'), 0, strlen($opt['page']['absolute_http_url']))) != strtolower($opt['page']['absolute_http_url'])) { |
|
55 | 55 | $this->createNewSession(); |
56 | 56 | } |
57 | 57 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | if ($this->changed == true) { |
169 | 169 | if (count($this->values) == 0) { |
170 | 170 | setcookie( |
171 | - $opt['session']['cookiename'] . 'data', |
|
171 | + $opt['session']['cookiename'].'data', |
|
172 | 172 | false, |
173 | 173 | time() + 31536000, |
174 | 174 | $opt['session']['path'], |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | ); |
178 | 178 | } else { |
179 | 179 | setcookie( |
180 | - $opt['session']['cookiename'] . 'data', |
|
180 | + $opt['session']['cookiename'].'data', |
|
181 | 181 | base64_encode(serialize($this->values)), |
182 | 182 | time() + 31536000, |
183 | 183 | $opt['session']['path'], |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | |
11 | 11 | // replacement table for Unicode 0x100 to 0x1FF |
12 | -$utf_xlatin = "A a A a A a C c C c C c C c D d D d E e E e E e E e E e G g G g " . |
|
13 | - "G g G g H h H h I i I i I i I i I i IJijJ j K k K L l L l L l L " . |
|
14 | - "l L l N n N n N n n n n O o O o Ö ö OEoeR r R r R r S s S s S s " . |
|
12 | +$utf_xlatin = "A a A a A a C c C c C c C c D d D d E e E e E e E e E e G g G g ". |
|
13 | + "G g G g H h H h I i I i I i I i I i IJijJ j K k K L l L l L l L ". |
|
14 | + "l L l N n N n N n n n n O o O o Ö ö OEoeR r R r R r S s S s S s ". |
|
15 | 15 | "S s T t T t T t U u U u U u U u Ü ü U u W w Y y Y Z z Z z Z z "; |
16 | 16 | |
17 | 17 | // replacement table for Unicode 0x2000 to 0x203F |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | $result = ""; |
29 | 29 | |
30 | 30 | while ($pos < strlen($s)) { |
31 | - $c1 = ord($s[$pos ++]); |
|
31 | + $c1 = ord($s[$pos++]); |
|
32 | 32 | if ($c1 < 0xC0) { |
33 | 33 | $result .= chr($c1); |
34 | 34 | } elseif ($pos < strlen($s)) { |
35 | - $c2 = ord($s[$pos ++]); |
|
35 | + $c2 = ord($s[$pos++]); |
|
36 | 36 | if ($c1 < 0xE0) { |
37 | 37 | $code = 0x40 * ($c1 & 0x1F) + ($c2 & 0x3F); |
38 | 38 | if ($code < 0x100) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $result .= "?"; |
47 | 47 | } |
48 | 48 | } elseif ($pos < strlen($s)) { |
49 | - $c3 = ord($s[$pos ++]); |
|
49 | + $c3 = ord($s[$pos++]); |
|
50 | 50 | $code = 0x1000 * ($c1 & 0x0F) + 0x40 * ($c2 & 0x3F) + ($c3 & 0x3F); |
51 | 51 | switch ($code) { |
52 | 52 | case 0x2026: |
@@ -7,7 +7,7 @@ |
||
7 | 7 | * Constant definitions |
8 | 8 | ***************************************************************************/ |
9 | 9 | |
10 | -require_once __DIR__ . '/../lib/consts-common.inc.php'; |
|
10 | +require_once __DIR__.'/../lib/consts-common.inc.php'; |
|
11 | 11 | |
12 | 12 | define('DEBUG_NO', 0); |
13 | 13 | define('DEBUG_DEVELOPER', 1); |