forked from opencaching/opencaching-pl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgarmin.php
90 lines (78 loc) · 2.99 KB
/
garmin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
//prepare the templates and include all neccessary
function convert($str)
{
$str = mb_ereg_replace('ę', 'e', $str);
$str = mb_ereg_replace('ó', 'o', $str);
$str = mb_ereg_replace('ą', 'a', $str);
$str = mb_ereg_replace('ś', 's', $str);
$str = mb_ereg_replace('ł', 'l', $str);
$str = mb_ereg_replace('ż', 'z', $str);
$str = mb_ereg_replace('ź', 'z', $str);
$str = mb_ereg_replace('ć', 'c', $str);
$str = mb_ereg_replace('ń', 'n', $str);
$str = mb_ereg_replace('Ę', 'E', $str);
$str = mb_ereg_replace('Ó', 'O', $str);
$str = mb_ereg_replace('Ą', 'A', $str);
$str = mb_ereg_replace('Ś', 'S', $str);
$str = mb_ereg_replace('Ł', 'L', $str);
$str = mb_ereg_replace('Ż', 'Z', $str);
$str = mb_ereg_replace('Ź', 'Z', $str);
$str = mb_ereg_replace('Ć', 'C', $str);
$str = mb_ereg_replace('Ń', 'N', $str);
$str = mb_ereg_replace('ä', 'a', $str);
$str = mb_ereg_replace('Ä', 'A', $str);
// romanian characters
$str = mb_ereg_replace('ă', 'a', $str);
$str = mb_ereg_replace('î', 'i', $str);
$str = mb_ereg_replace('ş', 's', $str);
$str = mb_ereg_replace('ţ', 't', $str);
$str = mb_ereg_replace('â', 'a', $str);
$str = mb_ereg_replace('Ă', 'A', $str);
$str = mb_ereg_replace('Î', 'I', $str);
$str = mb_ereg_replace('Ş', 'S', $str);
$str = mb_ereg_replace('Ţ', 'T', $str);
$str = mb_ereg_replace('Â', 'A', $str);
// romanian new keyboard
$str = mb_ereg_replace('ș', 's', $str);
$str = mb_ereg_replace('ț', 't', $str);
$str = mb_ereg_replace('Ș', 'S', $str);
$str = mb_ereg_replace('Ț', 'T', $str);
// hungarian characters
$str = mb_ereg_replace('é', 'e', $str);
$str = mb_ereg_replace('á', 'a', $str);
$str = mb_ereg_replace('ö', 'o', $str);
$str = mb_ereg_replace('ő', 'o', $str);
$str = mb_ereg_replace('ü', 'u', $str);
$str = mb_ereg_replace('ű', 'u', $str);
$str = mb_ereg_replace('ó', 'o', $str);
$str = mb_ereg_replace('ú', 'u', $str);
$str = mb_ereg_replace('É', 'E', $str);
$str = mb_ereg_replace('Á', 'A', $str);
$str = mb_ereg_replace('Ö', 'O', $str);
$str = mb_ereg_replace('Ő', 'O', $str);
$str = mb_ereg_replace('Ü', 'U', $str);
$str = mb_ereg_replace('Ű', 'U', $str);
$str = mb_ereg_replace('Ó', 'O', $str);
$str = mb_ereg_replace('Ú', 'U', $str);
return $str;
}
$tplname = 'garmin';
require_once('./lib/common.inc.php');
require($stylepath . '/garmin.inc.php');
if ($usr == false && $hide_coords) {
tpl_errorMsg($tplname, tr('login_message_09'));
exit;
}
$lat = isset($_REQUEST['lat']) ? $_REQUEST['lat'] : '';
$long = isset($_REQUEST['long']) ? $_REQUEST['long'] : '';
$wp = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : '';
$name = isset($_REQUEST['name']) ? $_REQUEST['name'] : '';
$str = convert($name);
tpl_set_var('lat', $lat);
tpl_set_var('long', $long);
tpl_set_var('wp_oc', $wp);
tpl_set_var('cachename', $str);
//make the template and send it out
tpl_BuildTemplate();
?>