Version Description
- Added marker category functionality
- Added Google Map Mashup functionality
- Fixed small bugs
- Added backwards compatibility for older versions of WordPress
- Replaced deprecated WordPress function calls
- Added Spanish translation - Thank you Fernando!
Download this release
Release Info
Developer | WPGMaps |
Plugin | WP Google Maps |
Version | 5.15 |
Comparing to | |
See all releases |
Code changes from version 5.14 to 5.15
- languages/wp-google-maps-es_ES.mo +0 -0
- languages/wp-google-maps-es_ES.po +622 -0
- readme.txt +12 -2
- upload.js +46 -0
- wpGoogleMaps.php +947 -865
languages/wp-google-maps-es_ES.mo
ADDED
Binary file
|
languages/wp-google-maps-es_ES.po
ADDED
@@ -0,0 +1,622 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: \n"
|
4 |
+
"POT-Creation-Date: \n"
|
5 |
+
"PO-Revision-Date: \n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: \n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"X-Generator: Poedit 1.5.5\n"
|
12 |
+
|
13 |
+
#: wpGoogleMaps.php:882
|
14 |
+
msgid "Your settings have been saved."
|
15 |
+
msgstr ""
|
16 |
+
|
17 |
+
#: wpGoogleMaps.php:910
|
18 |
+
msgid "Your marker location has been saved."
|
19 |
+
msgstr ""
|
20 |
+
|
21 |
+
#: wpGoogleMaps.php:956
|
22 |
+
msgid "There was a problem deleting the map."
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
#: wpGoogleMaps.php:960
|
26 |
+
msgid "Delete your map"
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#: wpGoogleMaps.php:960
|
30 |
+
msgid "Are you sure you want to delete the map"
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: wpGoogleMaps.php:960
|
34 |
+
msgid "Yes"
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: wpGoogleMaps.php:960
|
38 |
+
msgid "No"
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
+
#: wpGoogleMaps.php:1005 wpGoogleMaps.php:1009
|
42 |
+
msgid "Your Maps"
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
#: wpGoogleMaps.php:1005
|
46 |
+
msgid "Add New"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: wpGoogleMaps.php:1010
|
50 |
+
msgid "Pro Version"
|
51 |
+
msgstr ""
|
52 |
+
|
53 |
+
#: wpGoogleMaps.php:1010
|
54 |
+
msgid "Create unlimited maps"
|
55 |
+
msgstr ""
|
56 |
+
|
57 |
+
#: wpGoogleMaps.php:1010
|
58 |
+
msgid "with the"
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: wpGoogleMaps.php:1010
|
62 |
+
msgid "of WP Google Maps for only"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: wpGoogleMaps.php:1041 wpGoogleMaps.php:1290 wpGoogleMaps.php:1385
|
66 |
+
msgid "ID"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: wpGoogleMaps.php:1042 wpGoogleMaps.php:1204 wpGoogleMaps.php:1387
|
70 |
+
msgid "Title"
|
71 |
+
msgstr "Nombre"
|
72 |
+
|
73 |
+
#: wpGoogleMaps.php:1043 wpGoogleMaps.php:1153
|
74 |
+
msgid "Width"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: wpGoogleMaps.php:1044 wpGoogleMaps.php:1157
|
78 |
+
msgid "Height"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: wpGoogleMaps.php:1045
|
82 |
+
msgid "Type"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: wpGoogleMaps.php:1056
|
86 |
+
msgid "Trash"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: wpGoogleMaps.php:1060 wpGoogleMaps.php:1420
|
90 |
+
msgid "Edit"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: wpGoogleMaps.php:1102
|
94 |
+
msgid ""
|
95 |
+
"Add custom icons, titles, descriptions, pictures and links to your markers "
|
96 |
+
"with the"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
+
#: wpGoogleMaps.php:1102 wpGoogleMaps.php:1103 wpGoogleMaps.php:1163
|
100 |
+
#: wpGoogleMaps.php:1256
|
101 |
+
msgid "Pro Edition"
|
102 |
+
msgstr ""
|
103 |
+
|
104 |
+
#: wpGoogleMaps.php:1102
|
105 |
+
msgid "of this plugin for just"
|
106 |
+
msgstr ""
|
107 |
+
|
108 |
+
#: wpGoogleMaps.php:1103
|
109 |
+
msgid "Purchase the Pro Edition"
|
110 |
+
msgstr ""
|
111 |
+
|
112 |
+
#: wpGoogleMaps.php:1103
|
113 |
+
msgid "of WP Google Maps and save your markers to a CSV file!"
|
114 |
+
msgstr ""
|
115 |
+
|
116 |
+
#: wpGoogleMaps.php:1113
|
117 |
+
msgid "Map Settings"
|
118 |
+
msgstr ""
|
119 |
+
|
120 |
+
#: wpGoogleMaps.php:1145
|
121 |
+
msgid "Short code"
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
+
#: wpGoogleMaps.php:1146
|
125 |
+
msgid "copy this into your post or page to display the map"
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: wpGoogleMaps.php:1149
|
129 |
+
msgid "Map Name"
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
+
#: wpGoogleMaps.php:1162
|
133 |
+
msgid "Default Marker Image"
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
#: wpGoogleMaps.php:1163 wpGoogleMaps.php:1215 wpGoogleMaps.php:1217
|
137 |
+
msgid "Upload Image"
|
138 |
+
msgstr ""
|
139 |
+
|
140 |
+
#: wpGoogleMaps.php:1163
|
141 |
+
msgid "available in the"
|
142 |
+
msgstr ""
|
143 |
+
|
144 |
+
#: wpGoogleMaps.php:1163
|
145 |
+
msgid "only"
|
146 |
+
msgstr ""
|
147 |
+
|
148 |
+
#: wpGoogleMaps.php:1166
|
149 |
+
msgid "Map type"
|
150 |
+
msgstr ""
|
151 |
+
|
152 |
+
#: wpGoogleMaps.php:1168
|
153 |
+
msgid "Roadmap"
|
154 |
+
msgstr ""
|
155 |
+
|
156 |
+
#: wpGoogleMaps.php:1169
|
157 |
+
msgid "Satellite"
|
158 |
+
msgstr ""
|
159 |
+
|
160 |
+
#: wpGoogleMaps.php:1170
|
161 |
+
msgid "Hybrid"
|
162 |
+
msgstr ""
|
163 |
+
|
164 |
+
#: wpGoogleMaps.php:1171
|
165 |
+
msgid "Terrain"
|
166 |
+
msgstr ""
|
167 |
+
|
168 |
+
#: wpGoogleMaps.php:1176
|
169 |
+
msgid "Map Alignment"
|
170 |
+
msgstr ""
|
171 |
+
|
172 |
+
#: wpGoogleMaps.php:1178
|
173 |
+
msgid "Left"
|
174 |
+
msgstr ""
|
175 |
+
|
176 |
+
#: wpGoogleMaps.php:1179
|
177 |
+
msgid "Center"
|
178 |
+
msgstr ""
|
179 |
+
|
180 |
+
#: wpGoogleMaps.php:1180
|
181 |
+
msgid "Right"
|
182 |
+
msgstr ""
|
183 |
+
|
184 |
+
#: wpGoogleMaps.php:1181 wpGoogleMaps.php:1222
|
185 |
+
msgid "None"
|
186 |
+
msgstr ""
|
187 |
+
|
188 |
+
#: wpGoogleMaps.php:1189
|
189 |
+
msgid "Remember to save your map!"
|
190 |
+
msgstr ""
|
191 |
+
|
192 |
+
#: wpGoogleMaps.php:1191
|
193 |
+
msgid "Save Map"
|
194 |
+
msgstr ""
|
195 |
+
|
196 |
+
#: wpGoogleMaps.php:1193
|
197 |
+
msgid ""
|
198 |
+
"Tip: Use your mouse to change the layout of your map. When you have "
|
199 |
+
"positioned the map to your desired location, press \"Save Map\" to keep your "
|
200 |
+
"settings."
|
201 |
+
msgstr ""
|
202 |
+
|
203 |
+
#: wpGoogleMaps.php:1199
|
204 |
+
msgid "Add a marker"
|
205 |
+
msgstr ""
|
206 |
+
|
207 |
+
#: wpGoogleMaps.php:1209
|
208 |
+
msgid "Address/GPS"
|
209 |
+
msgstr ""
|
210 |
+
|
211 |
+
#: wpGoogleMaps.php:1214 wpGoogleMaps.php:1389
|
212 |
+
msgid "Description"
|
213 |
+
msgstr "Descripción"
|
214 |
+
|
215 |
+
#: wpGoogleMaps.php:1215
|
216 |
+
msgid "Pic URL"
|
217 |
+
msgstr ""
|
218 |
+
|
219 |
+
#: wpGoogleMaps.php:1216
|
220 |
+
msgid "Link URL"
|
221 |
+
msgstr ""
|
222 |
+
|
223 |
+
#: wpGoogleMaps.php:1217
|
224 |
+
msgid "Custom Marker"
|
225 |
+
msgstr ""
|
226 |
+
|
227 |
+
#: wpGoogleMaps.php:1219
|
228 |
+
msgid "Animation"
|
229 |
+
msgstr ""
|
230 |
+
|
231 |
+
#: wpGoogleMaps.php:1229
|
232 |
+
msgid "Add Marker"
|
233 |
+
msgstr ""
|
234 |
+
|
235 |
+
#: wpGoogleMaps.php:1229
|
236 |
+
msgid "Adding"
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: wpGoogleMaps.php:1230
|
240 |
+
msgid "Save Marker"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
#: wpGoogleMaps.php:1230
|
244 |
+
msgid "Saving"
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
+
#: wpGoogleMaps.php:1238
|
248 |
+
msgid "Your Markers"
|
249 |
+
msgstr ""
|
250 |
+
|
251 |
+
#: wpGoogleMaps.php:1247
|
252 |
+
msgid "Add detailed information to your markers!"
|
253 |
+
msgstr ""
|
254 |
+
|
255 |
+
#: wpGoogleMaps.php:1247 wpGoogleMaps.php:1251 wpGoogleMaps.php:1255
|
256 |
+
msgid "Add custom markers to your map!"
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: wpGoogleMaps.php:1248
|
260 |
+
msgid "Add detailed information to your markers for only"
|
261 |
+
msgstr ""
|
262 |
+
|
263 |
+
#: wpGoogleMaps.php:1248 wpGoogleMaps.php:1256
|
264 |
+
msgid "Click"
|
265 |
+
msgstr ""
|
266 |
+
|
267 |
+
#: wpGoogleMaps.php:1248 wpGoogleMaps.php:1256
|
268 |
+
msgid "here"
|
269 |
+
msgstr ""
|
270 |
+
|
271 |
+
#: wpGoogleMaps.php:1252
|
272 |
+
msgid ""
|
273 |
+
"Add different marker icons, or your own icons to make your map really stand "
|
274 |
+
"out!"
|
275 |
+
msgstr ""
|
276 |
+
|
277 |
+
#: wpGoogleMaps.php:1256
|
278 |
+
msgid "Allow your visitors to get directions to your markers!"
|
279 |
+
msgstr ""
|
280 |
+
|
281 |
+
#: wpGoogleMaps.php:1262
|
282 |
+
msgid ""
|
283 |
+
"WP Google Maps encourages you to make use of the amazing icons created by "
|
284 |
+
"Nicolas Mollet's Maps Icons Collection"
|
285 |
+
msgstr ""
|
286 |
+
|
287 |
+
#: wpGoogleMaps.php:1262
|
288 |
+
msgid "and to credit him when doing so."
|
289 |
+
msgstr ""
|
290 |
+
|
291 |
+
#: wpGoogleMaps.php:1290
|
292 |
+
msgid "Edit Marker Location"
|
293 |
+
msgstr ""
|
294 |
+
|
295 |
+
#: wpGoogleMaps.php:1299
|
296 |
+
msgid "Marker Latitude"
|
297 |
+
msgstr ""
|
298 |
+
|
299 |
+
#: wpGoogleMaps.php:1303
|
300 |
+
msgid "Marker Longitude"
|
301 |
+
msgstr ""
|
302 |
+
|
303 |
+
#: wpGoogleMaps.php:1308
|
304 |
+
msgid "Save Marker Location"
|
305 |
+
msgstr ""
|
306 |
+
|
307 |
+
#: wpGoogleMaps.php:1309
|
308 |
+
msgid ""
|
309 |
+
"Tip: Use your mouse to change the location of the marker. Simply click and "
|
310 |
+
"drag it to your desired location."
|
311 |
+
msgstr ""
|
312 |
+
|
313 |
+
#: wpGoogleMaps.php:1371
|
314 |
+
msgid ""
|
315 |
+
"There are too many markers to make use of the live edit function. The "
|
316 |
+
"maximum amount for this functionality is 2000 markers. Anything more than "
|
317 |
+
"that number would crash your browser. In order to edit your markers, you "
|
318 |
+
"would need to download the table in CSV format, edit it and re-upload it."
|
319 |
+
msgstr ""
|
320 |
+
|
321 |
+
#: wpGoogleMaps.php:1386
|
322 |
+
msgid "Icon"
|
323 |
+
msgstr ""
|
324 |
+
|
325 |
+
#: wpGoogleMaps.php:1388
|
326 |
+
msgid "Address"
|
327 |
+
msgstr "Dirección"
|
328 |
+
|
329 |
+
#: wpGoogleMaps.php:1390
|
330 |
+
msgid "Image"
|
331 |
+
msgstr ""
|
332 |
+
|
333 |
+
#: wpGoogleMaps.php:1391
|
334 |
+
msgid "Link"
|
335 |
+
msgstr ""
|
336 |
+
|
337 |
+
#: wpGoogleMaps.php:1392
|
338 |
+
msgid "Action"
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#: wpGoogleMaps.php:1409
|
342 |
+
msgid "View this link"
|
343 |
+
msgstr ""
|
344 |
+
|
345 |
+
#: wpGoogleMaps.php:1420 wpGoogleMaps.php:1421
|
346 |
+
msgid "Edit this marker"
|
347 |
+
msgstr ""
|
348 |
+
|
349 |
+
#: wpGoogleMaps.php:1421
|
350 |
+
msgid "Edit Location"
|
351 |
+
msgstr ""
|
352 |
+
|
353 |
+
#: wpGoogleMaps.php:1422
|
354 |
+
msgid "Delete this marker"
|
355 |
+
msgstr ""
|
356 |
+
|
357 |
+
#: wpGoogleMaps.php:1422
|
358 |
+
msgid "Delete"
|
359 |
+
msgstr ""
|
360 |
+
|
361 |
+
#: wpGoogleMaps.php:1539
|
362 |
+
msgid ""
|
363 |
+
"The plugin directory does not have 'write' permissions. Please enable "
|
364 |
+
"'write' permissions (755) for "
|
365 |
+
msgstr ""
|
366 |
+
|
367 |
+
#: wpGoogleMaps.php:1541
|
368 |
+
msgid "in order for this plugin to work! Please see "
|
369 |
+
msgstr ""
|
370 |
+
|
371 |
+
#: wpGoogleMaps.php:1543
|
372 |
+
msgid "this page"
|
373 |
+
msgstr ""
|
374 |
+
|
375 |
+
#: wpGoogleMaps.php:1545
|
376 |
+
msgid "for help on how to do it."
|
377 |
+
msgstr ""
|
378 |
+
|
379 |
+
msgid ""
|
380 |
+
"Get great map markers <a href='http://mapicons.nicolasmollet.com/' "
|
381 |
+
"target='_BLANK' title='Great Google Map Markers'>here</a>"
|
382 |
+
msgstr ""
|
383 |
+
|
384 |
+
msgid "Bounce"
|
385 |
+
msgstr ""
|
386 |
+
|
387 |
+
msgid "Drop"
|
388 |
+
msgstr ""
|
389 |
+
|
390 |
+
msgid "Or paste image URL"
|
391 |
+
msgstr ""
|
392 |
+
|
393 |
+
msgid "ignore if you want to use the defaul marker"
|
394 |
+
msgstr ""
|
395 |
+
|
396 |
+
msgid "Format: http://www.domain.com"
|
397 |
+
msgstr ""
|
398 |
+
|
399 |
+
msgid "More details"
|
400 |
+
msgstr "Más detalles"
|
401 |
+
|
402 |
+
msgid "Get directions"
|
403 |
+
msgstr "Cómo llegar"
|
404 |
+
|
405 |
+
msgid "From"
|
406 |
+
msgstr ""
|
407 |
+
|
408 |
+
msgid "To"
|
409 |
+
msgstr ""
|
410 |
+
|
411 |
+
msgid "Go"
|
412 |
+
msgstr ""
|
413 |
+
|
414 |
+
msgid "Please fill out both the 'from' and 'to' fields"
|
415 |
+
msgstr ""
|
416 |
+
|
417 |
+
msgid "Geocode was not successful for the following reason"
|
418 |
+
msgstr ""
|
419 |
+
|
420 |
+
msgid "Header 1 should be 'id', not"
|
421 |
+
msgstr ""
|
422 |
+
|
423 |
+
msgid "Header 2 should be 'map_id', not"
|
424 |
+
msgstr ""
|
425 |
+
|
426 |
+
msgid "Header 3 should be 'address', not"
|
427 |
+
msgstr ""
|
428 |
+
|
429 |
+
msgid "Header 4 should be 'desc', not"
|
430 |
+
msgstr ""
|
431 |
+
|
432 |
+
msgid "Header 5 should be 'pic', not"
|
433 |
+
msgstr ""
|
434 |
+
|
435 |
+
msgid "Header 6 should be 'link', not"
|
436 |
+
msgstr ""
|
437 |
+
|
438 |
+
msgid "Header 7 should be 'icon', not"
|
439 |
+
msgstr ""
|
440 |
+
|
441 |
+
msgid "Header 8 should be 'lat', not"
|
442 |
+
msgstr ""
|
443 |
+
|
444 |
+
msgid "Header 9 should be 'lng', not"
|
445 |
+
msgstr ""
|
446 |
+
|
447 |
+
msgid "Header 10 should be 'anim', not"
|
448 |
+
msgstr ""
|
449 |
+
|
450 |
+
msgid "Header 11 should be 'title', not"
|
451 |
+
msgstr ""
|
452 |
+
|
453 |
+
msgid "CSV import failed"
|
454 |
+
msgstr ""
|
455 |
+
|
456 |
+
msgid "Your CSV file has been successfully imported"
|
457 |
+
msgstr ""
|
458 |
+
|
459 |
+
msgid "Download ALL marker data to a CSV file"
|
460 |
+
msgstr ""
|
461 |
+
|
462 |
+
msgid "Advanced Options"
|
463 |
+
msgstr ""
|
464 |
+
|
465 |
+
msgid "Upload File"
|
466 |
+
msgstr ""
|
467 |
+
|
468 |
+
msgid "Upload CSV File"
|
469 |
+
msgstr ""
|
470 |
+
|
471 |
+
msgid "Replace existing data with data in file"
|
472 |
+
msgstr ""
|
473 |
+
|
474 |
+
msgid "OR"
|
475 |
+
msgstr ""
|
476 |
+
|
477 |
+
msgid "including Pro add-on"
|
478 |
+
msgstr ""
|
479 |
+
|
480 |
+
msgid "including Pro & Gold add-ons"
|
481 |
+
msgstr ""
|
482 |
+
|
483 |
+
msgid "Download this data as a CSV file"
|
484 |
+
msgstr ""
|
485 |
+
|
486 |
+
msgid "Advanced Map Styling"
|
487 |
+
msgstr ""
|
488 |
+
|
489 |
+
msgid ""
|
490 |
+
"Use the <a href='http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/"
|
491 |
+
"wizard/index.html' target='_BLANK'>Google Maps API Styled Map Wizard</a> to "
|
492 |
+
"get your style settings"
|
493 |
+
msgstr ""
|
494 |
+
|
495 |
+
msgid "Enable Advanced Styling"
|
496 |
+
msgstr ""
|
497 |
+
|
498 |
+
msgid "Paste the JSON data here"
|
499 |
+
msgstr ""
|
500 |
+
|
501 |
+
msgid "Save Style Settings"
|
502 |
+
msgstr ""
|
503 |
+
|
504 |
+
msgid "Maps"
|
505 |
+
msgstr ""
|
506 |
+
|
507 |
+
msgid "Advanced"
|
508 |
+
msgstr ""
|
509 |
+
|
510 |
+
msgid "Create your Map"
|
511 |
+
msgstr ""
|
512 |
+
|
513 |
+
msgid "Show advanced options"
|
514 |
+
msgstr ""
|
515 |
+
|
516 |
+
msgid "Hide advanced options"
|
517 |
+
msgstr ""
|
518 |
+
|
519 |
+
msgid "List all Markers"
|
520 |
+
msgstr ""
|
521 |
+
|
522 |
+
msgid "List all markers below the map"
|
523 |
+
msgstr ""
|
524 |
+
|
525 |
+
msgid "Directions Box Open by Default?"
|
526 |
+
msgstr ""
|
527 |
+
|
528 |
+
msgid "Yes, on the left"
|
529 |
+
msgstr ""
|
530 |
+
|
531 |
+
msgid "Yes, on the right"
|
532 |
+
msgstr ""
|
533 |
+
|
534 |
+
msgid "Yes, above"
|
535 |
+
msgstr ""
|
536 |
+
|
537 |
+
msgid "Yes, below"
|
538 |
+
msgstr ""
|
539 |
+
|
540 |
+
msgid "Directions Box Width"
|
541 |
+
msgstr ""
|
542 |
+
|
543 |
+
msgid "InfoWindow open by default"
|
544 |
+
msgstr ""
|
545 |
+
|
546 |
+
msgid "Disable StreetView"
|
547 |
+
msgstr ""
|
548 |
+
|
549 |
+
msgid "Disable Zoom Controls"
|
550 |
+
msgstr ""
|
551 |
+
|
552 |
+
msgid "Disable Pan Controls"
|
553 |
+
msgstr ""
|
554 |
+
|
555 |
+
msgid "Disable Map Type Controls"
|
556 |
+
msgstr ""
|
557 |
+
|
558 |
+
msgid "Disable Mouse Wheel Zoom"
|
559 |
+
msgstr ""
|
560 |
+
|
561 |
+
msgid "Open links in a new window"
|
562 |
+
msgstr ""
|
563 |
+
|
564 |
+
msgid "(Tick this if you want to open your links in a new window)"
|
565 |
+
msgstr ""
|
566 |
+
|
567 |
+
msgid "Hide the address field"
|
568 |
+
msgstr ""
|
569 |
+
|
570 |
+
msgid "Other settings"
|
571 |
+
msgstr ""
|
572 |
+
|
573 |
+
msgid "Max InfoWindow Width"
|
574 |
+
msgstr ""
|
575 |
+
|
576 |
+
msgid "(Minimum: 200px)"
|
577 |
+
msgstr ""
|
578 |
+
|
579 |
+
msgid "Image Thumbnails"
|
580 |
+
msgstr ""
|
581 |
+
|
582 |
+
msgid "(Tick this if you are having problems viewing your thumbnail images)"
|
583 |
+
msgstr ""
|
584 |
+
|
585 |
+
msgid "Default Image Height"
|
586 |
+
msgstr ""
|
587 |
+
|
588 |
+
msgid "Default Image Width"
|
589 |
+
msgstr ""
|
590 |
+
|
591 |
+
msgid "InfoWindow Settings"
|
592 |
+
msgstr ""
|
593 |
+
|
594 |
+
msgid "General Map Settings"
|
595 |
+
msgstr ""
|
596 |
+
|
597 |
+
msgid "Do not use TimThumb"
|
598 |
+
msgstr ""
|
599 |
+
|
600 |
+
msgid "WP Google Map Settings"
|
601 |
+
msgstr ""
|
602 |
+
|
603 |
+
msgid "Enable Directions?"
|
604 |
+
msgstr ""
|
605 |
+
|
606 |
+
msgid "Enable Bicycle Layer?"
|
607 |
+
msgstr ""
|
608 |
+
|
609 |
+
msgid "Enable Traffic Layer?"
|
610 |
+
msgstr ""
|
611 |
+
|
612 |
+
msgid "The KML/GeoRSS layer will over-ride most of your map settings"
|
613 |
+
msgstr ""
|
614 |
+
|
615 |
+
msgid "KML/GeoRSS URL"
|
616 |
+
msgstr ""
|
617 |
+
|
618 |
+
msgid "Map Dimensions"
|
619 |
+
msgstr ""
|
620 |
+
|
621 |
+
msgid "Settings"
|
622 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -3,11 +3,11 @@ Contributors: WPGMaps
|
|
3 |
Donate link: http://www.wpgmaps.com
|
4 |
Tags: google maps, maps, map, map markers, google, google map, maps api, wp maps, wp google maps, easy map
|
5 |
Requires at least: 3.4
|
6 |
-
Tested up to: 3.5.
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2
|
9 |
|
10 |
-
The easiest to use map plugin! Create custom maps with high quality markers containing locations, descriptions, images and links.
|
11 |
|
12 |
== Description ==
|
13 |
|
@@ -32,6 +32,8 @@ The easiest to use google maps plugin! Create custom maps with high quality mark
|
|
32 |
= Professional Edition =
|
33 |
* Create multiple Google maps!
|
34 |
* Add descriptions, links and images to your Google Map markers.
|
|
|
|
|
35 |
* Add different marker icons, or your own icons to make your map really stand out!
|
36 |
* Add animations to your markers and let them stand out!
|
37 |
* Allow your visitors to get directions to your markers.
|
@@ -83,6 +85,14 @@ Previous versions may cause your blog to slow down. Upgrading to 4.5 will get ri
|
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
= 5.14 =
|
87 |
* The map plugin now uses the new media manager
|
88 |
* Fixed some styling conflicts
|
3 |
Donate link: http://www.wpgmaps.com
|
4 |
Tags: google maps, maps, map, map markers, google, google map, maps api, wp maps, wp google maps, easy map
|
5 |
Requires at least: 3.4
|
6 |
+
Tested up to: 3.5.2
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2
|
9 |
|
10 |
+
The easiest to use map plugin! Create custom maps with high quality markers containing locations, categories, descriptions, images and links.
|
11 |
|
12 |
== Description ==
|
13 |
|
32 |
= Professional Edition =
|
33 |
* Create multiple Google maps!
|
34 |
* Add descriptions, links and images to your Google Map markers.
|
35 |
+
* Add categories to your map markers
|
36 |
+
* Mashup multiple Google maps
|
37 |
* Add different marker icons, or your own icons to make your map really stand out!
|
38 |
* Add animations to your markers and let them stand out!
|
39 |
* Allow your visitors to get directions to your markers.
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
+
= 5.15 =
|
89 |
+
* Added marker category functionality
|
90 |
+
* Added Google Map Mashup functionality
|
91 |
+
* Fixed small bugs
|
92 |
+
* Added backwards compatibility for older versions of WordPress
|
93 |
+
* Replaced deprecated WordPress function calls
|
94 |
+
* Added Spanish translation - Thank you Fernando!
|
95 |
+
|
96 |
= 5.14 =
|
97 |
* The map plugin now uses the new media manager
|
98 |
* Fixed some styling conflicts
|
upload.js
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function() {
|
2 |
+
|
3 |
+
var clicked_on_imgbtn = false;
|
4 |
+
var clicked_on_markerbtn = false;
|
5 |
+
var clicked_on_custommarkerbtn = false;
|
6 |
+
|
7 |
+
jQuery('#upload_image_button').click(function() {
|
8 |
+
formfield = jQuery('#wpgmza_add_pic').attr('name');
|
9 |
+
clicked_on_imgbtn = true;
|
10 |
+
clicked_on_markerbtn = false;
|
11 |
+
clicked_on_custommarkerbtn = false;
|
12 |
+
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
|
13 |
+
return false;
|
14 |
+
});
|
15 |
+
|
16 |
+
|
17 |
+
jQuery('#upload_default_marker_btn').click(function() {
|
18 |
+
formfield = jQuery('#upload_default_marker').attr('name');
|
19 |
+
clicked_on_imgbtn = false;
|
20 |
+
clicked_on_markerbtn = true;
|
21 |
+
clicked_on_custommarkerbtn = false;
|
22 |
+
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
|
23 |
+
return false;
|
24 |
+
});
|
25 |
+
|
26 |
+
jQuery('#upload_custom_marker_button').click(function() {
|
27 |
+
formfield = jQuery('#wpgmza_add_custom_marker').attr('name');
|
28 |
+
clicked_on_imgbtn = false;
|
29 |
+
clicked_on_markerbtn = false;
|
30 |
+
clicked_on_custommarkerbtn = true;
|
31 |
+
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
|
32 |
+
return false;
|
33 |
+
});
|
34 |
+
|
35 |
+
|
36 |
+
window.send_to_editor = function(html) {
|
37 |
+
imgurl = jQuery('img',html).attr('src');
|
38 |
+
if (clicked_on_imgbtn) { jQuery('#wpgmza_add_pic').val(imgurl); }
|
39 |
+
if (clicked_on_markerbtn) { jQuery('#upload_default_marker').val(imgurl); jQuery("#wpgmza_mm").html("<img src=\""+imgurl+"\" />"); }
|
40 |
+
if (clicked_on_custommarkerbtn) { jQuery('#wpgmza_add_custom_marker').val(imgurl); jQuery("#wpgmza_cmm").html("<img src=\""+imgurl+"\" />"); }
|
41 |
+
tb_remove();
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
});
|
wpGoogleMaps.php
CHANGED
@@ -3,12 +3,12 @@
|
|
3 |
Plugin Name: WP Google Maps
|
4 |
Plugin URI: http://www.wpgmaps.com
|
5 |
Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
|
6 |
-
Version: 5.
|
7 |
Author: WP Google Maps
|
8 |
Author URI: http://www.wpgmaps.com
|
9 |
*/
|
10 |
|
11 |
-
error_reporting(
|
12 |
global $wpgmza_version;
|
13 |
global $wpgmza_p_version;
|
14 |
global $wpgmza_t;
|
@@ -16,11 +16,14 @@ global $wpgmza_tblname;
|
|
16 |
global $wpgmza_tblname_maps;
|
17 |
global $wpgmza_tblname_poly;
|
18 |
global $wpgmza_tblname_polylines;
|
|
|
19 |
global $wpdb;
|
20 |
global $wpgmza_p;
|
21 |
global $wpgmza_g;
|
22 |
global $short_code_active;
|
23 |
global $wpgmza_current_map_id;
|
|
|
|
|
24 |
global $debug;
|
25 |
global $debug_step;
|
26 |
global $debug_start;
|
@@ -33,8 +36,9 @@ $wpgmza_tblname = $wpdb->prefix . "wpgmza";
|
|
33 |
$wpgmza_tblname_maps = $wpdb->prefix . "wpgmza_maps";
|
34 |
$wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
|
35 |
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
|
36 |
-
$
|
37 |
-
$
|
|
|
38 |
$wpgmza_t = "basic";
|
39 |
|
40 |
add_action('admin_head', 'wpgmaps_head');
|
@@ -57,7 +61,6 @@ function wpgmaps_activate() {
|
|
57 |
global $wpgmza_version;
|
58 |
$table_name = $wpdb->prefix . "wpgmza";
|
59 |
$table_name_maps = $wpdb->prefix . "wpgmza_maps";
|
60 |
-
|
61 |
delete_option("WPGMZA");
|
62 |
|
63 |
wpgmaps_handle_db();
|
@@ -66,72 +69,73 @@ function wpgmaps_activate() {
|
|
66 |
if (!$wpgmza_data) {
|
67 |
// load first map as an example map (i.e. if the user has not installed this plugin before, this must run
|
68 |
$res_maps = $wpdb->get_results("SELECT * FROM $table_name_maps");
|
69 |
-
$wpdb->show_errors();
|
70 |
if (!$res_maps) { $rows_affected = $wpdb->insert( $table_name_maps, array(
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
102 |
} else {
|
103 |
$rows_affected = $wpdb->insert( $table_name_maps, array( "map_start_lat" => "".$wpgmza_data['map_start_lat']."",
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
135 |
delete_option("WPGMZA");
|
136 |
|
137 |
}
|
@@ -151,11 +155,11 @@ function wpgmaps_init() {
|
|
151 |
wp_enqueue_script("jquery");
|
152 |
$plugin_dir = basename(dirname(__FILE__))."/languages/";
|
153 |
load_plugin_textdomain( 'wp-google-maps', false, $plugin_dir );
|
154 |
-
|
155 |
|
156 |
function wpgmaps_reload_map_on_post() {
|
157 |
if (isset($_POST['wpgmza_savemap'])){
|
158 |
-
|
159 |
$res = wpgmza_get_map_data($_GET['map_id']);
|
160 |
$wpgmza_lat = $res->map_start_lat;
|
161 |
$wpgmza_lng = $res->map_start_lng;
|
@@ -175,26 +179,25 @@ function wpgmaps_reload_map_on_post() {
|
|
175 |
|
176 |
?>
|
177 |
<script type="text/javascript" >
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
|
189 |
-
|
190 |
</script>
|
191 |
-
|
192 |
}
|
193 |
|
194 |
|
195 |
}
|
196 |
function wpgmaps_get_marker_url($mapid = false) {
|
197 |
-
|
198 |
if (!$mapid) {
|
199 |
$mapid = $_POST['map_id'];
|
200 |
}
|
@@ -229,70 +232,70 @@ function wpgmaps_get_marker_url($mapid = false) {
|
|
229 |
function wpgmaps_admin_edit_marker_javascript() {
|
230 |
|
231 |
$res = wpgmza_get_marker_data($_GET['id']);
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
237 |
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
});
|
|
|
|
|
258 |
|
259 |
-
|
260 |
-
|
261 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
}
|
263 |
-
|
264 |
-
|
265 |
-
zoom:zoom,
|
266 |
-
center: latLng,
|
267 |
-
zoomControl: <?php if ($wpgmza_settings['wpgmza_settings_map_zoom'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
268 |
-
panControl: <?php if ($wpgmza_settings['wpgmza_settings_map_pan'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
269 |
-
mapTypeControl: <?php if ($wpgmza_settings['wpgmza_settings_map_type'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
270 |
-
streetViewControl: <?php if ($wpgmza_settings['wpgmza_settings_map_streetview'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
271 |
-
mapTypeId: google.maps.MapTypeId.<?php echo $wpgmza_map_type; ?>
|
272 |
-
}
|
273 |
-
this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
|
274 |
-
this.bounds = new google.maps.LatLngBounds();
|
275 |
|
276 |
-
|
277 |
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
|
293 |
|
294 |
-
|
295 |
-
|
296 |
|
297 |
|
298 |
}
|
@@ -308,15 +311,13 @@ function wpgmaps_admin_javascript_basic() {
|
|
308 |
|
309 |
else if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit") {
|
310 |
|
311 |
-
if (
|
312 |
-
|
313 |
-
if (!$_GET['map_id']) { break; }
|
314 |
wpgmaps_update_xml_file($_GET['map_id']);
|
315 |
//$wpgmza_data = get_option('WPGMZA');
|
316 |
|
317 |
$res = wpgmza_get_map_data($_GET['map_id']);
|
318 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
319 |
-
|
320 |
$wpgmza_lat = $res->map_start_lat;
|
321 |
$wpgmza_lng = $res->map_start_lng;
|
322 |
$wpgmza_width = $res->map_width;
|
@@ -330,286 +331,287 @@ function wpgmaps_admin_javascript_basic() {
|
|
330 |
else if ($wpgmza_map_type == "4") { $wpgmza_map_type = "TERRAIN"; }
|
331 |
else { $wpgmza_map_type = "ROADMAP"; }
|
332 |
$start_zoom = $res->map_start_zoom;
|
333 |
-
if ($start_zoom < 1 || !$start_zoom) {
|
334 |
$start_zoom = 5;
|
335 |
}
|
336 |
-
if (!$wpgmza_lat || !$wpgmza_lng) {
|
337 |
$wpgmza_lat = "51.5081290";
|
338 |
$wpgmza_lng = "-0.1280050";
|
339 |
}
|
340 |
|
341 |
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
|
|
353 |
if ('undefined' == typeof window.jQuery) {
|
354 |
alert("jQuery is not installed. WP Google Maps requires jQuery in order to function properly. Please ensure you have jQuery installed.")
|
355 |
} else {
|
356 |
// all good.. continue...
|
357 |
-
}
|
358 |
-
|
359 |
jQuery(function() {
|
360 |
|
361 |
|
362 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
wpgmzaTable = jQuery('#wpgmza_table').dataTable({
|
364 |
-
"bProcessing": true
|
365 |
-
"aaSorting": [[ 0, "desc" ]]
|
366 |
});
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
|
375 |
-
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
376 |
-
UniqueCode=Math.round(Math.random()*10000);
|
377 |
-
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($_GET['map_id']); ?>?u='+UniqueCode,<?php echo $_GET['map_id']; ?>);
|
378 |
-
}
|
379 |
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
});
|
385 |
-
var geocoder = new google.maps.Geocoder();
|
386 |
-
wpgmza_InitMap();
|
387 |
|
388 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
|
|
|
|
|
|
|
|
|
|
|
390 |
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
security: '<?php echo $ajax_nonce; ?>',
|
398 |
map_id: wpgm_map_id,
|
399 |
-
|
400 |
-
|
401 |
-
|
|
|
|
|
|
|
402 |
wpgmza_InitMap();
|
403 |
jQuery("#wpgmza_marker_holder").html(response);
|
|
|
|
|
404 |
wpgmza_reinitialisetbl();
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
|
|
|
|
|
|
|
409 |
});
|
410 |
|
411 |
|
412 |
-
|
413 |
-
var cur_id = jQuery(this).attr("id");
|
414 |
-
var wpgmza_edit_address = jQuery("#wpgmza_hid_marker_address_"+cur_id).val();
|
415 |
-
var wpgmza_edit_title = jQuery("#wpgmza_hid_marker_title_"+cur_id).val();
|
416 |
-
jQuery("#wpgmza_edit_id").val(cur_id);
|
417 |
-
jQuery("#wpgmza_add_address").val(wpgmza_edit_address);
|
418 |
-
jQuery("#wpgmza_add_title").val(wpgmza_edit_title);
|
419 |
-
jQuery("#wpgmza_addmarker_div").hide();
|
420 |
-
jQuery("#wpgmza_editmarker_div").show();
|
421 |
-
});
|
422 |
|
423 |
|
|
|
424 |
|
425 |
-
jQuery("#
|
426 |
-
|
427 |
-
jQuery("#wpgmza_addmarker_loading").show();
|
428 |
-
|
429 |
-
var wpgm_address = "0";
|
430 |
-
var wpgm_gps = "0";
|
431 |
-
var wpgm_map_id = "0";
|
432 |
-
if (document.getElementsByName("wpgmza_add_address").length > 0) { wpgm_address = jQuery("#wpgmza_add_address").val(); }
|
433 |
-
if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }
|
434 |
-
|
435 |
-
|
436 |
-
geocoder.geocode( { 'address': wpgm_address }, function(results, status) {
|
437 |
-
if (status == google.maps.GeocoderStatus.OK) {
|
438 |
-
wpgm_gps = String(results[0].geometry.location);
|
439 |
-
var latlng1 = wpgm_gps.replace("(","");
|
440 |
-
var latlng2 = latlng1.replace(")","");
|
441 |
-
var latlngStr = latlng2.split(",",2);
|
442 |
-
var wpgm_lat = parseFloat(latlngStr[0]);
|
443 |
-
var wpgm_lng = parseFloat(latlngStr[1]);
|
444 |
-
|
445 |
-
var data = {
|
446 |
-
action: 'add_marker',
|
447 |
-
security: '<?php echo $ajax_nonce; ?>',
|
448 |
-
map_id: wpgm_map_id,
|
449 |
-
address: wpgm_address,
|
450 |
-
lat: wpgm_lat,
|
451 |
-
lng: wpgm_lng
|
452 |
-
};
|
453 |
-
|
454 |
-
jQuery.post(ajaxurl, data, function(response) {
|
455 |
-
wpgmza_InitMap();
|
456 |
-
jQuery("#wpgmza_marker_holder").html(response);
|
457 |
-
jQuery("#wpgmza_addmarker").show();
|
458 |
-
jQuery("#wpgmza_addmarker_loading").hide();
|
459 |
-
wpgmza_reinitialisetbl();
|
460 |
-
var myLatLng = new google.maps.LatLng(wpgm_lat,wpgm_lng);
|
461 |
-
MYMAP.map.setCenter(myLatLng);
|
462 |
-
});
|
463 |
-
|
464 |
-
} else {
|
465 |
-
alert("Geocode was not successful for the following reason: " + status);
|
466 |
-
}
|
467 |
-
});
|
468 |
|
469 |
|
470 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
|
472 |
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
var wpgm_address = "0";
|
482 |
-
var wpgm_map_id = "0";
|
483 |
-
var wpgm_gps = "0";
|
484 |
-
if (document.getElementsByName("wpgmza_add_address").length > 0) { wpgm_address = jQuery("#wpgmza_add_address").val(); }
|
485 |
-
if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }
|
486 |
-
|
487 |
-
|
488 |
-
geocoder.geocode( { 'address': wpgm_address}, function(results, status) {
|
489 |
-
if (status == google.maps.GeocoderStatus.OK) {
|
490 |
-
wpgm_gps = String(results[0].geometry.location);
|
491 |
-
var latlng1 = wpgm_gps.replace("(","");
|
492 |
-
var latlng2 = latlng1.replace(")","");
|
493 |
-
var latlngStr = latlng2.split(",",2);
|
494 |
-
var wpgm_lat = parseFloat(latlngStr[0]);
|
495 |
-
var wpgm_lng = parseFloat(latlngStr[1]);
|
496 |
-
|
497 |
-
var data = {
|
498 |
-
action: 'edit_marker',
|
499 |
-
security: '<?php echo $ajax_nonce; ?>',
|
500 |
-
map_id: wpgm_map_id,
|
501 |
-
edit_id: wpgm_edit_id,
|
502 |
-
address: wpgm_address,
|
503 |
-
lat: wpgm_lat,
|
504 |
-
lng: wpgm_lng
|
505 |
-
};
|
506 |
-
|
507 |
-
jQuery.post(ajaxurl, data, function(response) {
|
508 |
-
wpgmza_InitMap();
|
509 |
-
jQuery("#wpgmza_add_address").val("");
|
510 |
-
jQuery("#wpgmza_add_title").val("");
|
511 |
-
jQuery("#wpgmza_marker_holder").html(response);
|
512 |
-
jQuery("#wpgmza_addmarker_div").show();
|
513 |
-
jQuery("#wpgmza_editmarker_loading").hide();
|
514 |
-
jQuery("#wpgmza_edit_id").val("");
|
515 |
-
wpgmza_reinitialisetbl();
|
516 |
-
});
|
517 |
-
|
518 |
-
} else {
|
519 |
-
alert("Geocode was not successful for the following reason: " + status);
|
520 |
-
}
|
521 |
-
});
|
522 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
|
|
|
|
|
|
|
525 |
});
|
526 |
-
});
|
527 |
|
|
|
|
|
|
|
528 |
});
|
529 |
|
|
|
530 |
|
531 |
|
532 |
-
|
533 |
-
|
534 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
535 |
}
|
536 |
-
|
537 |
-
|
538 |
-
zoom:zoom,
|
539 |
-
center: latLng,
|
540 |
-
zoomControl: <?php if ($wpgmza_settings['wpgmza_settings_map_zoom'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
541 |
-
panControl: <?php if ($wpgmza_settings['wpgmza_settings_map_pan'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
542 |
-
mapTypeControl: <?php if ($wpgmza_settings['wpgmza_settings_map_type'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
543 |
-
streetViewControl: <?php if ($wpgmza_settings['wpgmza_settings_map_streetview'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
544 |
-
mapTypeId: google.maps.MapTypeId.<?php echo $wpgmza_map_type; ?>
|
545 |
-
}
|
546 |
-
this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
|
547 |
-
this.bounds = new google.maps.LatLngBounds();
|
548 |
|
549 |
|
550 |
-
|
551 |
zoomLevel = MYMAP.map.getZoom();
|
552 |
|
553 |
jQuery("#wpgmza_start_zoom").val(zoomLevel);
|
554 |
if (zoomLevel == 0) {
|
555 |
-
|
556 |
}
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
|
568 |
|
569 |
-
|
570 |
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
|
579 |
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
|
595 |
|
596 |
-
|
597 |
|
598 |
-
|
599 |
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
|
606 |
-
|
607 |
|
608 |
-
|
609 |
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
|
614 |
|
615 |
|
@@ -617,8 +619,8 @@ function wpgmaps_admin_javascript_basic() {
|
|
617 |
|
618 |
|
619 |
</script>
|
620 |
-
<?php
|
621 |
-
}
|
622 |
|
623 |
}
|
624 |
|
@@ -631,7 +633,7 @@ function wpgmaps_user_javascript_basic() {
|
|
631 |
|
632 |
$ajax_nonce = wp_create_nonce("wpgmza");
|
633 |
|
634 |
-
|
635 |
$res = wpgmza_get_map_data($wpgmza_current_map_id);
|
636 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
637 |
|
@@ -653,49 +655,44 @@ function wpgmaps_user_javascript_basic() {
|
|
653 |
|
654 |
?>
|
655 |
<script type="text/javascript">
|
656 |
-
|
657 |
-
|
658 |
</script>
|
659 |
<script type="text/javascript" >
|
660 |
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
jQuery(function() {
|
668 |
|
|
|
669 |
|
670 |
-
jQuery(document).ready(function(){
|
671 |
|
|
|
|
|
|
|
|
|
672 |
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
|
|
|
|
679 |
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
UniqueCode=Math.round(Math.random()*10000);
|
687 |
-
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>);
|
688 |
|
689 |
-
|
690 |
-
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
691 |
-
UniqueCode=Math.round(Math.random()*10000);
|
692 |
-
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>);
|
693 |
-
});
|
694 |
-
}
|
695 |
|
696 |
});
|
697 |
-
|
698 |
-
});
|
699 |
|
700 |
|
701 |
var MYMAP = {
|
@@ -704,20 +701,20 @@ function wpgmaps_user_javascript_basic() {
|
|
704 |
}
|
705 |
|
706 |
MYMAP.init = function(selector, latLng, zoom) {
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
|
717 |
-
|
718 |
-
|
719 |
google.maps.event.addListener(MYMAP.map, 'click', function() {
|
720 |
-
|
721 |
});
|
722 |
}
|
723 |
|
@@ -747,9 +744,9 @@ function wpgmaps_user_javascript_basic() {
|
|
747 |
var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
|
748 |
MYMAP.bounds.extend(point);
|
749 |
var marker = new google.maps.Marker({
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
var html='<strong>'+wpmgza_address+'</strong>';
|
754 |
|
755 |
google.maps.event.addListener(marker, 'click', function(evt) {
|
@@ -763,11 +760,11 @@ function wpgmaps_user_javascript_basic() {
|
|
763 |
|
764 |
});
|
765 |
}
|
766 |
-
|
767 |
-
|
768 |
|
769 |
</script>
|
770 |
-
<?php
|
771 |
}
|
772 |
}
|
773 |
|
@@ -793,27 +790,27 @@ function wpgmaps_update_xml_file($mapid = false) {
|
|
793 |
|
794 |
// PREVIOUS VERSION HANDLING
|
795 |
if (function_exists('wpgmza_register_pro_version')) {
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
SELECT *
|
801 |
FROM $table_name
|
802 |
WHERE `map_id` = '$mapid'
|
803 |
|
804 |
"
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
SELECT *
|
811 |
FROM $table_name
|
812 |
WHERE `map_id` = '$mapid'
|
813 |
|
814 |
"
|
815 |
-
|
816 |
-
|
817 |
|
818 |
|
819 |
|
@@ -832,6 +829,7 @@ function wpgmaps_update_xml_file($mapid = false) {
|
|
832 |
$lat = $result->lat;
|
833 |
$lng = $result->lng;
|
834 |
$anim = $result->anim;
|
|
|
835 |
$infoopen = $result->infoopen;
|
836 |
$mtitle = stripslashes($result->title);
|
837 |
$map_id = $result->map_id;
|
@@ -859,6 +857,8 @@ function wpgmaps_update_xml_file($mapid = false) {
|
|
859 |
$bd->appendChild($dom->CreateTextNode($lng));
|
860 |
$bd = $channel->appendChild($dom->createElement('anim'));
|
861 |
$bd->appendChild($dom->CreateTextNode($anim));
|
|
|
|
|
862 |
$bd = $channel->appendChild($dom->createElement('infoopen'));
|
863 |
$bd->appendChild($dom->CreateTextNode($infoopen));
|
864 |
|
@@ -899,42 +899,42 @@ function wpgmaps_update_all_xml_file() {
|
|
899 |
|
900 |
|
901 |
function wpgmaps_action_callback_basic() {
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
DELETE FROM $wpgmza_tblname
|
927 |
WHERE `id` = '$marker_id'
|
928 |
LIMIT 1
|
929 |
"
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
|
934 |
-
}
|
935 |
}
|
|
|
936 |
|
937 |
-
|
938 |
|
939 |
}
|
940 |
|
@@ -943,37 +943,38 @@ function wpgmaps_load_maps_api() {
|
|
943 |
}
|
944 |
|
945 |
function wpgmaps_tag_basic( $atts ) {
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
|
|
957 |
|
958 |
|
959 |
-
|
960 |
-
|
961 |
|
962 |
-
|
963 |
-
|
964 |
|
965 |
|
966 |
-
|
967 |
-
|
968 |
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
|
975 |
|
976 |
-
|
977 |
<style>
|
978 |
#wpgmza_map img { max-width:none !important; }
|
979 |
</style>
|
@@ -981,13 +982,13 @@ function wpgmaps_tag_basic( $atts ) {
|
|
981 |
|
982 |
|
983 |
";
|
984 |
-
|
985 |
}
|
986 |
|
987 |
function wpgmaps_get_plugin_url() {
|
988 |
if ( !function_exists('plugins_url') )
|
989 |
return get_option('siteurl') . '/wp-content/plugins/' . plugin_basename(dirname(__FILE__));
|
990 |
-
|
991 |
}
|
992 |
|
993 |
function wpgmaps_head() {
|
@@ -1001,13 +1002,17 @@ function wpgmaps_head() {
|
|
1001 |
|
1002 |
//var_dump($_POST);
|
1003 |
|
1004 |
-
$map_id =
|
1005 |
-
$map_title =
|
1006 |
-
$map_height =
|
1007 |
-
$map_width =
|
1008 |
-
|
1009 |
-
|
1010 |
-
$
|
|
|
|
|
|
|
|
|
1011 |
$map_start_zoom = intval($_POST['wpgmza_start_zoom']);
|
1012 |
$type = intval($_POST['wpgmza_map_type']);
|
1013 |
$alignment = intval($_POST['wpgmza_map_align']);
|
@@ -1018,17 +1023,18 @@ function wpgmaps_head() {
|
|
1018 |
$bicycle_enabled = intval($_POST['wpgmza_bicycle']);
|
1019 |
$traffic_enabled = intval($_POST['wpgmza_traffic']);
|
1020 |
$dbox = intval($_POST['wpgmza_dbox']);
|
1021 |
-
$dbox_width =
|
1022 |
$listmarkers = intval($_POST['wpgmza_listmarkers']);
|
1023 |
$listmarkers_advanced = intval($_POST['wpgmza_listmarkers_advanced']);
|
|
|
1024 |
|
1025 |
|
1026 |
$gps = explode(",",$map_start_location);
|
1027 |
$map_start_lat = $gps[0];
|
1028 |
$map_start_lng = $gps[1];
|
1029 |
$map_default_marker = $_POST['upload_default_marker'];
|
1030 |
-
$kml =
|
1031 |
-
$fusion =
|
1032 |
|
1033 |
$data['map_default_starting_lat'] = $map_start_lat;
|
1034 |
$data['map_default_starting_lng'] = $map_start_lng;
|
@@ -1047,12 +1053,15 @@ function wpgmaps_head() {
|
|
1047 |
$data['map_default_dbox_width'] = $dbox_width;
|
1048 |
$data['map_default_listmarkers'] = $listmarkers;
|
1049 |
$data['map_default_listmarkers_advanced'] = $listmarkers_advanced;
|
|
|
1050 |
$data['map_default_marker'] = $map_default_marker;
|
1051 |
$data['map_default_width_type'] = $map_width_type;
|
1052 |
$data['map_default_height_type'] = $map_height_type;
|
1053 |
|
1054 |
|
1055 |
|
|
|
|
|
1056 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1057 |
"UPDATE $wpgmza_tblname_maps SET
|
1058 |
map_title = %s,
|
@@ -1076,6 +1085,7 @@ function wpgmaps_head() {
|
|
1076 |
dbox_width = %s,
|
1077 |
listmarkers = %d,
|
1078 |
listmarkers_advanced = %d,
|
|
|
1079 |
fusion = %s,
|
1080 |
map_width_type = %s,
|
1081 |
map_height_type = %s
|
@@ -1102,6 +1112,7 @@ function wpgmaps_head() {
|
|
1102 |
$dbox_width,
|
1103 |
$listmarkers,
|
1104 |
$listmarkers_advanced,
|
|
|
1105 |
$fusion,
|
1106 |
$map_width_type,
|
1107 |
$map_height_type,
|
@@ -1112,20 +1123,20 @@ function wpgmaps_head() {
|
|
1112 |
|
1113 |
|
1114 |
update_option('WPGMZA_SETTINGS', $data);
|
1115 |
-
|
1116 |
|
1117 |
echo "<div class='updated'>";
|
1118 |
_e("Your settings have been saved.","wp-google-maps");
|
1119 |
echo "</div>";
|
1120 |
|
1121 |
-
|
1122 |
|
1123 |
-
|
1124 |
global $wpdb;
|
1125 |
global $wpgmza_tblname;
|
1126 |
-
$mid =
|
1127 |
-
$wpgmaps_marker_lat =
|
1128 |
-
$wpgmaps_marker_lng =
|
1129 |
|
1130 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1131 |
"UPDATE $wpgmza_tblname SET
|
@@ -1138,7 +1149,7 @@ function wpgmaps_head() {
|
|
1138 |
$mid)
|
1139 |
);
|
1140 |
|
1141 |
-
|
1142 |
|
1143 |
|
1144 |
|
@@ -1148,16 +1159,16 @@ function wpgmaps_head() {
|
|
1148 |
echo "</div>";
|
1149 |
|
1150 |
|
1151 |
-
|
1152 |
-
|
1153 |
global $wpdb;
|
1154 |
global $wpgmza_tblname_poly;
|
1155 |
-
$mid =
|
1156 |
-
$wpgmaps_polydata =
|
1157 |
-
$linecolor =
|
1158 |
-
$fillcolor =
|
1159 |
-
$opacity =
|
1160 |
-
|
1161 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1162 |
"INSERT INTO $wpgmza_tblname_poly SET
|
1163 |
map_id = %d,
|
@@ -1172,24 +1183,24 @@ function wpgmaps_head() {
|
|
1172 |
$linecolor,
|
1173 |
$fillcolor,
|
1174 |
$opacity
|
1175 |
-
|
1176 |
);
|
1177 |
echo "<div class='updated'>";
|
1178 |
_e("Your polygon has been created.","wp-google-maps");
|
1179 |
echo "</div>";
|
1180 |
|
1181 |
|
1182 |
-
|
1183 |
-
|
1184 |
global $wpdb;
|
1185 |
global $wpgmza_tblname_poly;
|
1186 |
-
$mid =
|
1187 |
-
$pid =
|
1188 |
-
$wpgmaps_polydata =
|
1189 |
-
$linecolor =
|
1190 |
-
$fillcolor =
|
1191 |
-
$opacity =
|
1192 |
-
|
1193 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1194 |
"UPDATE $wpgmza_tblname_poly SET
|
1195 |
polydata = %s,
|
@@ -1204,23 +1215,23 @@ function wpgmaps_head() {
|
|
1204 |
$fillcolor,
|
1205 |
$opacity,
|
1206 |
$pid
|
1207 |
-
|
1208 |
);
|
1209 |
echo "<div class='updated'>";
|
1210 |
_e("Your polygon has been saved.","wp-google-maps");
|
1211 |
echo "</div>";
|
1212 |
|
1213 |
|
1214 |
-
|
1215 |
-
|
1216 |
global $wpdb;
|
1217 |
global $wpgmza_tblname_polylines;
|
1218 |
-
$mid =
|
1219 |
-
$wpgmaps_polydata =
|
1220 |
-
$linecolor =
|
1221 |
-
$linethickness =
|
1222 |
-
$opacity =
|
1223 |
-
|
1224 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1225 |
"INSERT INTO $wpgmza_tblname_polylines SET
|
1226 |
map_id = %d,
|
@@ -1235,24 +1246,24 @@ function wpgmaps_head() {
|
|
1235 |
$linecolor,
|
1236 |
$linethickness,
|
1237 |
$opacity
|
1238 |
-
|
1239 |
);
|
1240 |
echo "<div class='updated'>";
|
1241 |
_e("Your polyline has been created.","wp-google-maps");
|
1242 |
echo "</div>";
|
1243 |
|
1244 |
|
1245 |
-
|
1246 |
-
|
1247 |
global $wpdb;
|
1248 |
global $wpgmza_tblname_polylines;
|
1249 |
-
$mid =
|
1250 |
-
$pid =
|
1251 |
-
$wpgmaps_polydata =
|
1252 |
-
$linecolor =
|
1253 |
-
$linethickness =
|
1254 |
-
$opacity =
|
1255 |
-
|
1256 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1257 |
"UPDATE $wpgmza_tblname_polylines SET
|
1258 |
polydata = %s,
|
@@ -1267,38 +1278,38 @@ function wpgmaps_head() {
|
|
1267 |
$linethickness,
|
1268 |
$opacity,
|
1269 |
$pid
|
1270 |
-
|
1271 |
);
|
1272 |
echo "<div class='updated'>";
|
1273 |
_e("Your polyline has been saved.","wp-google-maps");
|
1274 |
echo "</div>";
|
1275 |
|
1276 |
|
1277 |
-
|
1278 |
-
|
1279 |
global $wpdb;
|
1280 |
-
$wpgmza_data['wpgmza_settings_image_width'] =
|
1281 |
-
$wpgmza_data['wpgmza_settings_image_height'] =
|
1282 |
-
$wpgmza_data['wpgmza_settings_use_timthumb'] =
|
1283 |
-
$wpgmza_data['wpgmza_settings_infowindow_width'] =
|
1284 |
-
$wpgmza_data['wpgmza_settings_infowindow_links'] =
|
1285 |
-
$wpgmza_data['wpgmza_settings_infowindow_address'] =
|
1286 |
-
$wpgmza_data['wpgmza_settings_map_streetview'] =
|
1287 |
-
$wpgmza_data['wpgmza_settings_map_zoom'] =
|
1288 |
-
$wpgmza_data['wpgmza_settings_map_pan'] =
|
1289 |
-
$wpgmza_data['wpgmza_settings_map_type'] =
|
1290 |
-
$wpgmza_data['wpgmza_settings_map_scroll'] =
|
1291 |
-
$wpgmza_data['wpgmza_settings_map_draggable'] =
|
1292 |
-
$wpgmza_data['wpgmza_settings_map_clickzoom'] =
|
1293 |
-
$wpgmza_data['wpgmza_settings_ugm_striptags'] =
|
1294 |
-
$wpgmza_data['wpgmza_settings_force_jquery'] =
|
1295 |
update_option('WPGMZA_OTHER_SETTINGS', $wpgmza_data);
|
1296 |
echo "<div class='updated'>";
|
1297 |
_e("Your settings have been saved.","wp-google-maps");
|
1298 |
echo "</div>";
|
1299 |
|
1300 |
|
1301 |
-
|
1302 |
|
1303 |
|
1304 |
|
@@ -1314,9 +1325,10 @@ function wpgmaps_admin_menu() {
|
|
1314 |
//add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Markers', __('Markers','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-markers', 'wpgmaps_menu_marker_layout');
|
1315 |
|
1316 |
if (function_exists('wpgmza_pro_advanced_menu')) {
|
|
|
1317 |
add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Advanced Options', __('Advanced','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-advanced', 'wpgmaps_menu_advanced_layout');
|
1318 |
}
|
1319 |
-
|
1320 |
|
1321 |
// add_options_page('WP Google Maps', 'WP Google Maps', 'manage_options', 'wp-google-maps-menu', 'wpgmaps_menu_layout');
|
1322 |
}
|
@@ -1380,14 +1392,14 @@ function wpgmaps_menu_layout() {
|
|
1380 |
|
1381 |
if (function_exists('wpgmza_register_pro_version')) {
|
1382 |
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
|
1392 |
|
1393 |
} else {
|
@@ -1498,12 +1510,15 @@ function wpgmaps_settings_page_basic() {
|
|
1498 |
<p class='submit'><input type='submit' name='wpgmza_save_settings' class='button-primary' value='".__("Save Settings","wp-google-maps")." »' /></p>
|
1499 |
|
1500 |
|
|
|
|
|
|
|
1501 |
</form>
|
1502 |
";
|
1503 |
|
1504 |
echo "</div>";
|
1505 |
|
1506 |
-
|
1507 |
}
|
1508 |
|
1509 |
function wpgmaps_menu_advanced_layout() {
|
@@ -1512,7 +1527,6 @@ function wpgmaps_menu_advanced_layout() {
|
|
1512 |
}
|
1513 |
|
1514 |
}
|
1515 |
-
|
1516 |
function wpgmza_map_page() {
|
1517 |
if (function_exists('wpgmza_register_pro_version')) {
|
1518 |
echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>".__("My Maps","wp-google-maps")." <a href=\"admin.php?page=wp-google-maps-menu&action=new\" class=\"add-new-h2\">".__("Add New","wp-google-maps")."</a></h2>";
|
@@ -1538,7 +1552,7 @@ function wpgmaps_list_maps() {
|
|
1538 |
|
1539 |
|
1540 |
$results = $wpdb->get_results(
|
1541 |
-
|
1542 |
SELECT *
|
1543 |
FROM $table_name
|
1544 |
WHERE `active` = 0
|
@@ -1596,7 +1610,7 @@ function wpgmaps_list_markers() {
|
|
1596 |
global $wpgmza_tblname;
|
1597 |
|
1598 |
$results = $wpdb->get_results(
|
1599 |
-
|
1600 |
SELECT *
|
1601 |
FROM $wpgmza_tblname
|
1602 |
ORDER BY `address` DESC
|
@@ -1634,7 +1648,7 @@ function wpgmaps_list_markers() {
|
|
1634 |
|
1635 |
}
|
1636 |
echo "</table>";
|
1637 |
-
|
1638 |
}
|
1639 |
|
1640 |
|
@@ -1656,19 +1670,19 @@ function wpgmza_basic_menu() {
|
|
1656 |
$res = wpgmza_get_map_data($_GET['map_id']);
|
1657 |
|
1658 |
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
|
1663 |
-
|
1664 |
-
|
1665 |
|
1666 |
|
1667 |
$wpgmza_act = "disabled readonly";
|
1668 |
$wpgmza_act_msg = "<span style=\"font-size:16px; color:#666;\">".__("Add custom icons, titles, descriptions, pictures and links to your markers with the","wp-google-maps")." \"<a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=below_marker\" title=\"".__("Pro Edition","wp-google-maps")."\" target=\"_BLANK\">".__("Pro Edition","wp-google-maps")."</a>\" ".__("of this plugin for just","wp-google-maps")." <strong>$14.99</strong></span>";
|
1669 |
$wpgmza_csv = "<p><a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=csv_link\" title=\"".__("Pro Edition","wp-google-maps")."\">".__("Purchase the Pro Edition","wp-google-maps")."</a> ".__("of WP Google Maps and save your markers to a CSV file!","wp-google-maps")."</p>";
|
1670 |
}
|
1671 |
-
|
1672 |
|
1673 |
<div class='wrap'>
|
1674 |
<h1>WP Google Maps</h1>
|
@@ -1679,203 +1693,207 @@ function wpgmza_basic_menu() {
|
|
1679 |
<h2>".__("Map Settings","wp-google-maps")."</h2>
|
1680 |
<form action='' method='post' id='wpgmaps_options'>
|
1681 |
<p></p>
|
1682 |
-
|
1683 |
-
|
1684 |
<div id=\"wpgmaps_tabs\">
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
<
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
<
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
<
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
</select>
|
1768 |
-
</td>
|
1769 |
-
</tr>
|
1770 |
|
1771 |
-
|
1772 |
</div>
|
|
|
1773 |
<div id=\"tabs-2\">
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
<option>".__("ID","wp-google-maps")."</option>
|
1797 |
-
<option>".__("Title","wp-google-maps")."</option>
|
1798 |
-
<option>".__("Address","wp-google-maps")."</option>
|
1799 |
-
<option>".__("Description","wp-google-maps")."</option>
|
1800 |
-
</select>
|
1801 |
-
<select class='postform' disabled readonly>
|
1802 |
-
<option>".__("Descending","wp-google-maps")."</option>
|
1803 |
-
<option>".__("Ascending","wp-google-maps")."</option>
|
1804 |
-
</select>
|
1805 |
-
|
1806 |
-
</td>
|
1807 |
-
</tr>
|
1808 |
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
<option>".__("Yes, on the left","wp-google-maps")."</option>
|
1828 |
-
<option>".__("Yes, on the right","wp-google-maps")."</option>
|
1829 |
-
<option>".__("Yes, above","wp-google-maps")."</option>
|
1830 |
-
<option>".__("Yes, below","wp-google-maps")."</option>
|
1831 |
-
</select>
|
1832 |
-
|
1833 |
-
".__("Directions Box Width","wp-google-maps").":
|
1834 |
-
<input type='text' size='4' maxlength='4' class='small-text' readonly disabled /> px
|
1835 |
-
</td>
|
1836 |
-
</tr>
|
1837 |
-
<tr>
|
1838 |
-
<td>".__("Enable Bicycle Layer?","wp-google-maps").":</td>
|
1839 |
-
<td><select class='postform' readonly disabled>
|
1840 |
-
<option >".__("No","wp-google-maps")."</option>
|
1841 |
-
<option >".__("Yes","wp-google-maps")."</option>
|
1842 |
-
</select>
|
1843 |
-
|
1844 |
-
|
1845 |
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1853 |
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
|
|
|
1871 |
|
|
|
1872 |
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
</span></div>
|
1879 |
|
1880 |
<p class='submit'><input type='submit' name='wpgmza_savemap' class='button-primary' value='".__("Save Map","wp-google-maps")." »' /></p>
|
1881 |
<p style=\"width:600px; color:#808080;\">
|
@@ -1896,7 +1914,7 @@ function wpgmza_basic_menu() {
|
|
1896 |
<li><a href=\"#tabs-m-3\" class=\"tabs-m-3\">".__("Polylines","wp-google-maps")."</a></li>
|
1897 |
</ul>
|
1898 |
<div id=\"tabs-m-1\">
|
1899 |
-
|
1900 |
|
1901 |
|
1902 |
<h2 style=\"padding-top:0; margin-top:0;\">".__("Add a marker","wp-google-maps")."</h2>
|
@@ -1922,6 +1940,13 @@ function wpgmza_basic_menu() {
|
|
1922 |
<td><input id='wpgmza_link_url' name='wpgmza_link_url' type='text' size='35' maxlength='700' value='' ".$wpgmza_act." /></td></tr>
|
1923 |
<tr><td>".__("Custom Marker","wp-google-maps").": </td>
|
1924 |
<td><input id='wpgmza_add_custom_marker' name=\"wpgmza_add_custom_marker\" type='hidden' size='35' maxlength='700' value='' ".$wpgmza_act."/> <input id=\"upload_custom_marker_button\" type=\"button\" value=\"".__("Upload Image","wp-google-maps")."\" $wpgmza_act /> </td></tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1925 |
<tr>
|
1926 |
<td>".__("Animation","wp-google-maps").": </td>
|
1927 |
<td>
|
@@ -1946,9 +1971,9 @@ function wpgmza_basic_menu() {
|
|
1946 |
".wpgmza_return_marker_list($_GET['map_id'])."
|
1947 |
</div>
|
1948 |
<br /><br />$wpgmza_csv
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
<h2 style=\"padding-top:0; margin-top:0;\">".__("Add a Polygon","wp-google-maps")."</h2>
|
1953 |
<table>
|
1954 |
<tr>
|
@@ -1956,8 +1981,8 @@ function wpgmza_basic_menu() {
|
|
1956 |
<td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">".__("Add Polygons to your maps for only","wp-google-maps")." <strong>$14.99</strong>. ".__("Click","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=polygon\" title=\"Pro Edition\" target=\"_BLANK\">".__("here","wp-google-maps")."</a></span></td>
|
1957 |
</tr>
|
1958 |
</table>
|
1959 |
-
|
1960 |
-
|
1961 |
<h2 style=\"padding-top:0; margin-top:0;\">".__("Add a Polyline","wp-google-maps")."</h2>
|
1962 |
<table>
|
1963 |
<tr>
|
@@ -1965,8 +1990,8 @@ function wpgmza_basic_menu() {
|
|
1965 |
<td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">".__("Add Polyline and routes to your maps for only","wp-google-maps")." <strong>$14.99</strong>. ".__("Click","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=polyline\" title=\"Pro Edition\" target=\"_BLANK\">".__("here","wp-google-maps")."</a></span></td>
|
1966 |
</tr>
|
1967 |
</table>
|
|
|
1968 |
</div>
|
1969 |
-
</div>
|
1970 |
|
1971 |
|
1972 |
|
@@ -2062,12 +2087,21 @@ function wpgmza_edit_marker($mid) {
|
|
2062 |
|
2063 |
|
2064 |
function wpgmaps_admin_scripts() {
|
2065 |
-
wp_enqueue_script('
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2071 |
if ($_GET['action'] == "add_poly" || $_GET['action'] == "edit_poly" || $_GET['action'] == "add_polyline" || $_GET['action'] == "edit_polyline") {
|
2072 |
wp_register_script('my-wpgmaps-color', plugins_url('js/jscolor.js',__FILE__), false, '1.4.1', false);
|
2073 |
wp_enqueue_script('my-wpgmaps-color');
|
@@ -2076,17 +2110,17 @@ function wpgmaps_admin_scripts() {
|
|
2076 |
wp_enqueue_script( 'jquery-ui-tabs');
|
2077 |
wp_register_script('my-wpgmaps-tabs', plugins_url('js/wpgmaps_tabs.js',__FILE__), array('jquery-ui-core'), '1.0.1', true);
|
2078 |
wp_enqueue_script('my-wpgmaps-tabs');
|
2079 |
-
}
|
2080 |
}
|
2081 |
function wpgmaps_user_styles() {
|
2082 |
wp_register_style( 'wpgmaps-style', plugins_url('css/wpgmza_style.css', __FILE__) );
|
2083 |
wp_enqueue_style( 'wpgmaps-style' );
|
2084 |
-
|
2085 |
-
|
2086 |
}
|
2087 |
|
2088 |
function wpgmaps_admin_styles() {
|
2089 |
-
|
2090 |
|
2091 |
}
|
2092 |
|
@@ -2094,35 +2128,68 @@ if (isset($_GET['page']) && $_GET['page'] == 'wp-google-maps-menu') {
|
|
2094 |
add_action('admin_print_scripts', 'wpgmaps_admin_scripts');
|
2095 |
add_action('admin_print_styles', 'wpgmaps_admin_styles');
|
2096 |
}
|
2097 |
-
|
2098 |
-
add_action('wp_print_styles', 'wpgmaps_user_styles');
|
2099 |
|
2100 |
|
|
|
2101 |
|
2102 |
-
function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%") {
|
2103 |
global $wpdb;
|
2104 |
global $wpgmza_tblname;
|
2105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2106 |
$marker_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpgmza_tblname WHERE `map_id` = '$map_id';" ) );
|
2107 |
if ($marker_count > 2000) {
|
2108 |
-
return __("There are too many markers to make use of the live edit function. The maximum amount for this functionality is 2000 markers. Anything more than that
|
2109 |
} else {
|
2110 |
|
2111 |
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
FROM $wpgmza_tblname
|
2116 |
-
WHERE `map_id` = '$map_id' ORDER BY `id` DESC
|
2117 |
-
");
|
2118 |
-
if ($admin) {
|
2119 |
-
$wpgmza_tmp .= "
|
2120 |
<table id=\"wpgmza_table\" class=\"display\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:$width;\">
|
2121 |
<thead>
|
2122 |
<tr>
|
2123 |
<th><strong>".__("ID","wp-google-maps")."</strong></th>
|
2124 |
<th><strong>".__("Icon","wp-google-maps")."</strong></th>
|
2125 |
<th><strong>".__("Title","wp-google-maps")."</strong></th>
|
|
|
2126 |
<th><strong>".__("Address","wp-google-maps")."</strong></th>
|
2127 |
<th><strong>".__("Description","wp-google-maps")."</strong></th>
|
2128 |
<th><strong>".__("Image","wp-google-maps")."</strong></th>
|
@@ -2132,8 +2199,8 @@ function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%") {
|
|
2132 |
</thead>
|
2133 |
<tbody>
|
2134 |
";
|
2135 |
-
|
2136 |
-
|
2137 |
<div id=\"wpgmza_marker_holder_".$map_id."\">
|
2138 |
<table id=\"wpgmza_table_".$map_id."\" class=\"wpgmza_table\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:$width;\">
|
2139 |
<thead>
|
@@ -2141,34 +2208,38 @@ function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%") {
|
|
2141 |
<th></th>
|
2142 |
<th class='wpgmza_table_marker'><strong></strong></th>
|
2143 |
<th class='wpgmza_table_title'><strong>".__("Title","wp-google-maps")."</strong></th>
|
|
|
2144 |
<th class='wpgmza_table_address'><strong>".__("Address","wp-google-maps")."</strong></th>
|
2145 |
<th class='wpgmza_table_description'><strong>".__("Description","wp-google-maps")."</strong></th>
|
2146 |
</tr>
|
2147 |
</thead>
|
2148 |
<tbody>
|
2149 |
";
|
2150 |
-
|
2151 |
|
2152 |
$res = wpgmza_get_map_data($map_id);
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
|
|
|
2157 |
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
|
|
2168 |
<tr id=\"wpgmza_tr_".$result->id."\">
|
2169 |
<td height=\"40\">".$result->id."</td>
|
2170 |
-
<td height=\"40\">".$icon."<input type=\"hidden\" id=\"wpgmza_hid_marker_icon_".$result->id."\" value=\"".$result->icon."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_anim_".$result->id."\" value=\"".$result->anim."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_infoopen_".$result->id."\" value=\"".$result->infoopen."\" /></td>
|
2171 |
<td>".$result->title."<input type=\"hidden\" id=\"wpgmza_hid_marker_title_".$result->id."\" value=\"".$result->title."\" /></td>
|
|
|
2172 |
<td>".$result->address."<input type=\"hidden\" id=\"wpgmza_hid_marker_address_".$result->id."\" value=\"".$result->address."\" /></td>
|
2173 |
<td>".$result->description."<input type=\"hidden\" id=\"wpgmza_hid_marker_desc_".$result->id."\" value=\"".$result->description."\" /></td>
|
2174 |
<td>$pic<input type=\"hidden\" id=\"wpgmza_hid_marker_pic_".$result->id."\" value=\"".$result->pic."\" /></td>
|
@@ -2179,28 +2250,39 @@ function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%") {
|
|
2179 |
<a href=\"javascript:void(0);\" title=\"".__("Delete this marker","wp-google-maps")."\" class=\"wpgmza_del_btn\" id=\"".$result->id."\">".__("Delete","wp-google-maps")."</a>
|
2180 |
</td>
|
2181 |
</tr>";
|
2182 |
-
|
2183 |
-
|
2184 |
<tr id=\"wpgmza_marker_".$result->id."\" mid=\"".$result->id."\" mapid=\"".$result->map_id."\" class=\"wpgmaps_mlist_row\">
|
2185 |
<td><span style='display:none;'>".sprintf('%02d', $result->id)."</span></td>
|
2186 |
-
|
2187 |
<td>".$result->title."</td>
|
|
|
2188 |
<td>".$result->address."</td>
|
2189 |
<td>".$result->description."</td>
|
2190 |
</tr>";
|
|
|
|
|
|
|
|
|
|
|
|
|
2191 |
}
|
2192 |
-
}
|
2193 |
-
if ($admin) {
|
2194 |
-
$wpgmza_tmp .= "</tbody></table>";
|
2195 |
-
} else {
|
2196 |
-
$wpgmza_tmp .= "</tbody></table></div>";
|
2197 |
-
}
|
2198 |
|
2199 |
-
|
2200 |
}
|
2201 |
}
|
2202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2203 |
|
|
|
2204 |
|
2205 |
|
2206 |
function wpgmaps_chmodr($path, $filemode) {
|
@@ -2214,7 +2296,7 @@ function wpgmaps_chmodr($path, $filemode) {
|
|
2214 |
if(is_link($fullpath))
|
2215 |
return FALSE;
|
2216 |
elseif(!is_dir($fullpath) && !chmod($fullpath, $filemode))
|
2217 |
-
|
2218 |
elseif(!wpgmaps_chmodr($fullpath, $filemode))
|
2219 |
return FALSE;
|
2220 |
}
|
@@ -2270,19 +2352,19 @@ function wpgmaps_check_shortcode() {
|
|
2270 |
global $posts;
|
2271 |
global $short_code_active;
|
2272 |
$short_code_active = false;
|
2273 |
-
|
2274 |
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
if (is_array($match)) {
|
2279 |
foreach($match as $key => $val) {
|
2280 |
$pos = strpos($val, "wpgmza");
|
2281 |
if ($pos === false) { } else { $short_code_active = true; }
|
2282 |
}
|
2283 |
}
|
2284 |
-
|
2285 |
-
|
2286 |
}
|
2287 |
|
2288 |
function wpgmaps_check_permissions() {
|
@@ -2334,34 +2416,28 @@ add_action('plugins_loaded', 'wpgmaps_update_db_check');
|
|
2334 |
|
2335 |
|
2336 |
function wpgmaps_handle_db() {
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
$table_name = $wpdb->prefix . "wpgmza";
|
2344 |
-
|
2345 |
|
|
|
2346 |
|
2347 |
// check for previous versions containing 'desc' instead of 'description'
|
2348 |
$results = $wpdb->get_results("DESC $wpgmza_tblname");
|
|
|
2349 |
foreach ($results as $row ) {
|
2350 |
if ($row->Field == "desc") {
|
2351 |
-
$founded++;
|
2352 |
}
|
2353 |
}
|
2354 |
-
if ($founded>0) {
|
2355 |
-
$wpdb->query(
|
2356 |
-
"
|
2357 |
-
ALTER TABLE $wpgmza_tblname CHANGE `desc` `description` MEDIUMTEXT
|
2358 |
-
"
|
2359 |
-
);
|
2360 |
-
}
|
2361 |
// end check
|
2362 |
-
|
2363 |
-
|
2364 |
-
|
2365 |
$sql = "
|
2366 |
CREATE TABLE `".$table_name."` (
|
2367 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
@@ -2376,16 +2452,17 @@ function wpgmaps_handle_db() {
|
|
2376 |
`anim` varchar(3) NOT NULL,
|
2377 |
`title` varchar(700) NOT NULL,
|
2378 |
`infoopen` varchar(3) NOT NULL,
|
|
|
2379 |
PRIMARY KEY (`id`)
|
2380 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
2381 |
";
|
2382 |
|
2383 |
-
|
2384 |
-
|
|
|
|
|
2385 |
|
2386 |
-
|
2387 |
-
|
2388 |
-
$sql = "
|
2389 |
CREATE TABLE `".$wpgmza_tblname_poly."` (
|
2390 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
2391 |
`map_id` int(11) NOT NULL,
|
@@ -2397,9 +2474,9 @@ function wpgmaps_handle_db() {
|
|
2397 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
2398 |
";
|
2399 |
|
2400 |
-
|
|
|
2401 |
|
2402 |
-
|
2403 |
$sql = "
|
2404 |
CREATE TABLE `".$wpgmza_tblname_polylines."` (
|
2405 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
@@ -2412,9 +2489,22 @@ function wpgmaps_handle_db() {
|
|
2412 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
2413 |
";
|
2414 |
|
2415 |
-
|
2416 |
-
|
2417 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2418 |
$table_name = $wpdb->prefix . "wpgmza_maps";
|
2419 |
$sql = "
|
2420 |
CREATE TABLE `".$table_name."` (
|
@@ -2440,6 +2530,7 @@ function wpgmaps_handle_db() {
|
|
2440 |
`dbox_width` varchar(10) NOT NULL,
|
2441 |
`listmarkers` INT(10) NOT NULL,
|
2442 |
`listmarkers_advanced` INT(10) NOT NULL,
|
|
|
2443 |
`ugm_enabled` INT(10) NOT NULL,
|
2444 |
`fusion` VARCHAR(100) NOT NULL,
|
2445 |
`map_width_type` VARCHAR(3) NOT NULL,
|
@@ -2453,12 +2544,12 @@ function wpgmaps_handle_db() {
|
|
2453 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
2454 |
";
|
2455 |
|
2456 |
-
|
2457 |
|
2458 |
|
2459 |
|
2460 |
-
|
2461 |
-
|
2462 |
}
|
2463 |
|
2464 |
function wpgmza_get_map_data($map_id) {
|
@@ -2470,9 +2561,9 @@ function wpgmza_get_map_data($map_id) {
|
|
2470 |
FROM $wpgmza_tblname_maps
|
2471 |
WHERE `id` = '".$map_id."' LIMIT 1
|
2472 |
");
|
2473 |
-
|
2474 |
$res = $result[0];
|
2475 |
-
|
2476 |
return $result[0];
|
2477 |
|
2478 |
}
|
@@ -2493,27 +2584,18 @@ function wpgmza_get_marker_data($mid) {
|
|
2493 |
function wpgmaps_upgrade_notice() {
|
2494 |
global $wpgmza_pro_version;
|
2495 |
echo "<div class='error below-h1'>
|
2496 |
-
|
2497 |
<p>Dear Pro User<br /></p>
|
2498 |
|
2499 |
<p>We have recently added new functionality to the Pro version of this plugin. You are currently using the latest
|
2500 |
Basic version which needs the latest Pro version for all functionality to work. Your current Pro version is
|
2501 |
-
$wpgmza_pro_version - The latest Pro version is 4.
|
2502 |
-
|
2503 |
-
<p>
|
2504 |
-
<a href='
|
2505 |
-
<small>
|
2506 |
-
<p><strong>Installation Instructions:</strong><br />
|
2507 |
-
<ul>
|
2508 |
-
<li>- Once downloaded, please <strong>deactivate</strong> and <strong>delete</strong> your old Pro plugin (your marker and map information wont be affected at all).</li>
|
2509 |
-
<li>- <a href=\"".get_option('siteurl')."/wp-admin/plugin-install.php?tab=upload\" target=\"_BLANK\">Upload the new</a> plugin ZIP file.</li>
|
2510 |
-
</ul>
|
2511 |
-
</p>
|
2512 |
-
</small>
|
2513 |
-
<p>If you experience any bugs, please let me know so that I can get it sorted out ASAP.</p>
|
2514 |
|
2515 |
<p>Kind regards,<br /><a href='http://www.wpgmaps.com/'>WP Google Maps</a></p>
|
2516 |
-
|
2517 |
</div>";
|
2518 |
}
|
2519 |
function wpgmaps_trash_map($map_id) {
|
@@ -2558,11 +2640,11 @@ function wpgmaps_debugger($section) {
|
|
2558 |
|
2559 |
function wpgmaps_load_jquery() {
|
2560 |
if (!is_admin()) {
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
|
2566 |
wp_enqueue_script('jquery');
|
2567 |
}
|
2568 |
}
|
3 |
Plugin Name: WP Google Maps
|
4 |
Plugin URI: http://www.wpgmaps.com
|
5 |
Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
|
6 |
+
Version: 5.15
|
7 |
Author: WP Google Maps
|
8 |
Author URI: http://www.wpgmaps.com
|
9 |
*/
|
10 |
|
11 |
+
error_reporting(0);
|
12 |
global $wpgmza_version;
|
13 |
global $wpgmza_p_version;
|
14 |
global $wpgmza_t;
|
16 |
global $wpgmza_tblname_maps;
|
17 |
global $wpgmza_tblname_poly;
|
18 |
global $wpgmza_tblname_polylines;
|
19 |
+
global $wpgmza_tblname_categories;
|
20 |
global $wpdb;
|
21 |
global $wpgmza_p;
|
22 |
global $wpgmza_g;
|
23 |
global $short_code_active;
|
24 |
global $wpgmza_current_map_id;
|
25 |
+
global $wpgmza_current_mashup;
|
26 |
+
global $wpgmza_mashup_ids;
|
27 |
global $debug;
|
28 |
global $debug_step;
|
29 |
global $debug_start;
|
36 |
$wpgmza_tblname_maps = $wpdb->prefix . "wpgmza_maps";
|
37 |
$wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
|
38 |
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
|
39 |
+
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
|
40 |
+
$wpgmza_version = "5.15";
|
41 |
+
$wpgmza_p_version = "5.15";
|
42 |
$wpgmza_t = "basic";
|
43 |
|
44 |
add_action('admin_head', 'wpgmaps_head');
|
61 |
global $wpgmza_version;
|
62 |
$table_name = $wpdb->prefix . "wpgmza";
|
63 |
$table_name_maps = $wpdb->prefix . "wpgmza_maps";
|
|
|
64 |
delete_option("WPGMZA");
|
65 |
|
66 |
wpgmaps_handle_db();
|
69 |
if (!$wpgmza_data) {
|
70 |
// load first map as an example map (i.e. if the user has not installed this plugin before, this must run
|
71 |
$res_maps = $wpdb->get_results("SELECT * FROM $table_name_maps");
|
|
|
72 |
if (!$res_maps) { $rows_affected = $wpdb->insert( $table_name_maps, array(
|
73 |
+
"map_title" => "My first map",
|
74 |
+
"map_start_lat" => "51.5081290",
|
75 |
+
"map_start_lng" => "-0.1280050",
|
76 |
+
"map_width" => "600",
|
77 |
+
"map_height" => "400",
|
78 |
+
"map_width_type" => "px",
|
79 |
+
"map_height_type" => "px",
|
80 |
+
"map_start_location" => "51.5081290,-0.1280050",
|
81 |
+
"map_start_zoom" => "1",
|
82 |
+
"directions_enabled" => '1',
|
83 |
+
"default_marker" => "0",
|
84 |
+
"alignment" => "0",
|
85 |
+
"styling_enabled" => "0",
|
86 |
+
"styling_json" => "",
|
87 |
+
"active" => "0",
|
88 |
+
"type" => "1",
|
89 |
+
"kml" => "",
|
90 |
+
"fusion" => "",
|
91 |
+
"bicycle" => "2",
|
92 |
+
"traffic" => "2",
|
93 |
+
"dbox" => "1",
|
94 |
+
"dbox_width" => "250",
|
95 |
+
"listmarkers" => "0",
|
96 |
+
"listmarkers_advanced" => "0",
|
97 |
+
"filterbycat" => "0",
|
98 |
+
"order_markers_by" => "1",
|
99 |
+
"order_markers_choice" => "2",
|
100 |
+
"show_user_location" => "0",
|
101 |
+
"ugm_enabled" => "0",
|
102 |
+
"ugm_access" => "0",
|
103 |
+
"mass_marker_support" => "1")
|
104 |
+
); }
|
105 |
} else {
|
106 |
$rows_affected = $wpdb->insert( $table_name_maps, array( "map_start_lat" => "".$wpgmza_data['map_start_lat']."",
|
107 |
+
"map_start_lng" => "".$wpgmza_data['map_start_lng']."",
|
108 |
+
"map_title" => "My Map",
|
109 |
+
"map_width" => "".$wpgmza_data['map_width']."",
|
110 |
+
"map_height" => "".$wpgmza_data['map_height']."",
|
111 |
+
"map_width_type" => "".$wpgmza_data['map_width_type']."",
|
112 |
+
"map_height_type" => "".$wpgmza_data['map_height_type']."",
|
113 |
+
"map_start_location" => "".$wpgmza_data['map_start_lat'].",".$wpgmza_data['map_start_lng']."",
|
114 |
+
"map_start_zoom" => "".$wpgmza_data['map_start_zoom']."",
|
115 |
+
"default_marker" => "".$wpgmza_data['map_default_marker']."",
|
116 |
+
"type" => "".$wpgmza_data['map_type']."",
|
117 |
+
"alignment" => "".$wpgmza_data['map_align']."",
|
118 |
+
"styling_enabled" => "0",
|
119 |
+
"styling_json" => "",
|
120 |
+
"active" => "0",
|
121 |
+
"kml" => "",
|
122 |
+
"fusion" => "",
|
123 |
+
"directions_enabled" => "".$wpgmza_data['directions_enabled']."",
|
124 |
+
"bicycle" => "".$wpgmza_data['bicycle']."",
|
125 |
+
"traffic" => "".$wpgmza_data['traffic']."",
|
126 |
+
"dbox" => "".$wpgmza_data['dbox']."",
|
127 |
+
"dbox_width" => "".$wpgmza_data['dbox_width']."",
|
128 |
+
"listmarkers" => "".$wpgmza_data['listmarkers']."",
|
129 |
+
"listmarkers_advanced" => "".$wpgmza_data['listmarkers_advanced']."",
|
130 |
+
"filterbycat" => "".$wpgmza_data['filterbycat']."",
|
131 |
+
"order_markers_by" => "".$wpgmza_data['order_markers_by']."",
|
132 |
+
"order_markers_choice" => "".$wpgmza_data['order_markers_choice']."",
|
133 |
+
"show_user_location" => "".$wpgmza_data['show_user_location']."",
|
134 |
+
"ugm_enabled" => "".$wpgmza_data['ugm_enabled']."",
|
135 |
+
"ugm_access" => "".$wpgmza_data['ugm_access']."",
|
136 |
+
"mass_marker_support" => "1"
|
137 |
+
|
138 |
+
) );
|
139 |
delete_option("WPGMZA");
|
140 |
|
141 |
}
|
155 |
wp_enqueue_script("jquery");
|
156 |
$plugin_dir = basename(dirname(__FILE__))."/languages/";
|
157 |
load_plugin_textdomain( 'wp-google-maps', false, $plugin_dir );
|
158 |
+
}
|
159 |
|
160 |
function wpgmaps_reload_map_on_post() {
|
161 |
if (isset($_POST['wpgmza_savemap'])){
|
162 |
+
|
163 |
$res = wpgmza_get_map_data($_GET['map_id']);
|
164 |
$wpgmza_lat = $res->map_start_lat;
|
165 |
$wpgmza_lng = $res->map_start_lng;
|
179 |
|
180 |
?>
|
181 |
<script type="text/javascript" >
|
182 |
+
jQuery(function() {
|
183 |
+
jQuery("#wpgmza_map").css({
|
184 |
+
height:'<?php echo $wpgmza_height; ?><?php echo $wpgmza_height_type; ?>',
|
185 |
+
width:'<?php echo $wpgmza_width; ?><?php echo $wpgmza_width_type; ?>'
|
186 |
|
187 |
+
});
|
188 |
+
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
|
189 |
+
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
190 |
+
UniqueCode=Math.round(Math.random()*10010);
|
191 |
+
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($_GET['map_id']); ?>?u='+UniqueCode,<?php echo $_GET['map_id']; ?>);
|
192 |
|
193 |
+
});
|
194 |
</script>
|
195 |
+
<?php
|
196 |
}
|
197 |
|
198 |
|
199 |
}
|
200 |
function wpgmaps_get_marker_url($mapid = false) {
|
|
|
201 |
if (!$mapid) {
|
202 |
$mapid = $_POST['map_id'];
|
203 |
}
|
232 |
function wpgmaps_admin_edit_marker_javascript() {
|
233 |
|
234 |
$res = wpgmza_get_marker_data($_GET['id']);
|
235 |
+
$wpgmza_lat = $res->lat;
|
236 |
+
$wpgmza_lng = $res->lng;
|
237 |
+
$wpgmza_map_type = "ROADMAP";
|
|
|
|
|
238 |
|
239 |
+
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
240 |
+
|
241 |
+
?>
|
242 |
+
<script type="text/javascript">
|
243 |
+
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
|
244 |
+
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
|
245 |
+
</script>
|
246 |
+
<link rel='stylesheet' id='wpgooglemaps-css' href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
|
247 |
+
<link rel="stylesheet" type="text/css" media="all" href="<?php echo wpgmaps_get_plugin_url(); ?>/css/data_table.css" />
|
248 |
+
<script type="text/javascript" src="<?php echo wpgmaps_get_plugin_url(); ?>/js/jquery.dataTables.js"></script>
|
249 |
+
<script type="text/javascript" >
|
250 |
+
jQuery(document).ready(function(){
|
251 |
+
function wpgmza_InitMap() {
|
252 |
+
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
|
253 |
+
MYMAP.init('#wpgmza_map', myLatLng, 15);
|
254 |
+
}
|
255 |
+
jQuery("#wpgmza_map").css({
|
256 |
+
height:400,
|
257 |
+
width:400
|
258 |
});
|
259 |
+
wpgmza_InitMap();
|
260 |
+
});
|
261 |
|
262 |
+
var MYMAP = {
|
263 |
+
map: null,
|
264 |
+
bounds: null
|
265 |
+
}
|
266 |
+
MYMAP.init = function(selector, latLng, zoom) {
|
267 |
+
var myOptions = {
|
268 |
+
zoom:zoom,
|
269 |
+
center: latLng,
|
270 |
+
zoomControl: <?php if ($wpgmza_settings['wpgmza_settings_map_zoom'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
271 |
+
panControl: <?php if ($wpgmza_settings['wpgmza_settings_map_pan'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
272 |
+
mapTypeControl: <?php if ($wpgmza_settings['wpgmza_settings_map_type'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
273 |
+
streetViewControl: <?php if ($wpgmza_settings['wpgmza_settings_map_streetview'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
274 |
+
mapTypeId: google.maps.MapTypeId.<?php echo $wpgmza_map_type; ?>
|
275 |
}
|
276 |
+
this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
|
277 |
+
this.bounds = new google.maps.LatLngBounds();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
|
279 |
+
updateMarkerPosition(latLng);
|
280 |
|
281 |
|
282 |
+
var marker = new google.maps.Marker({
|
283 |
+
position: latLng,
|
284 |
+
map: this.map,
|
285 |
+
draggable: true
|
286 |
+
});
|
287 |
+
google.maps.event.addListener(marker, 'drag', function() {
|
288 |
+
updateMarkerPosition(marker.getPosition());
|
289 |
+
});
|
290 |
+
}
|
291 |
+
function updateMarkerPosition(latLng) {
|
292 |
+
jQuery("#wpgmaps_marker_lat").val(latLng.lat());
|
293 |
+
jQuery("#wpgmaps_marker_lng").val(latLng.lng());
|
294 |
+
}
|
295 |
|
296 |
|
297 |
+
</script>
|
298 |
+
<?php
|
299 |
|
300 |
|
301 |
}
|
311 |
|
312 |
else if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit") {
|
313 |
|
314 |
+
if (!$_GET['map_id']) { return; }
|
|
|
|
|
315 |
wpgmaps_update_xml_file($_GET['map_id']);
|
316 |
//$wpgmza_data = get_option('WPGMZA');
|
317 |
|
318 |
$res = wpgmza_get_map_data($_GET['map_id']);
|
319 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
320 |
+
|
321 |
$wpgmza_lat = $res->map_start_lat;
|
322 |
$wpgmza_lng = $res->map_start_lng;
|
323 |
$wpgmza_width = $res->map_width;
|
331 |
else if ($wpgmza_map_type == "4") { $wpgmza_map_type = "TERRAIN"; }
|
332 |
else { $wpgmza_map_type = "ROADMAP"; }
|
333 |
$start_zoom = $res->map_start_zoom;
|
334 |
+
if ($start_zoom < 1 || !$start_zoom) {
|
335 |
$start_zoom = 5;
|
336 |
}
|
337 |
+
if (!$wpgmza_lat || !$wpgmza_lng) {
|
338 |
$wpgmza_lat = "51.5081290";
|
339 |
$wpgmza_lng = "-0.1280050";
|
340 |
}
|
341 |
|
342 |
|
343 |
+
?>
|
344 |
+
<script type="text/javascript">
|
345 |
+
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
|
346 |
+
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
|
347 |
+
</script>
|
348 |
+
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.24/themes/smoothness/jquery-ui.css" />
|
349 |
+
|
350 |
+
<link rel='stylesheet' id='wpgooglemaps-css' href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
|
351 |
+
<link rel="stylesheet" type="text/css" media="all" href="<?php echo wpgmaps_get_plugin_url(); ?>/css/data_table.css" />
|
352 |
+
<script type="text/javascript" src="<?php echo wpgmaps_get_plugin_url(); ?>/js/jquery.dataTables.js"></script>
|
353 |
+
<script type="text/javascript" >
|
354 |
+
|
355 |
if ('undefined' == typeof window.jQuery) {
|
356 |
alert("jQuery is not installed. WP Google Maps requires jQuery in order to function properly. Please ensure you have jQuery installed.")
|
357 |
} else {
|
358 |
// all good.. continue...
|
359 |
+
}
|
360 |
+
|
361 |
jQuery(function() {
|
362 |
|
363 |
|
364 |
+
jQuery(document).ready(function(){
|
365 |
+
wpgmzaTable = jQuery('#wpgmza_table').dataTable({
|
366 |
+
"bProcessing": true,
|
367 |
+
"aaSorting": [[ 0, "desc" ]]
|
368 |
+
});
|
369 |
+
function wpgmza_reinitialisetbl() {
|
370 |
+
wpgmzaTable.fnClearTable( 0 );
|
371 |
wpgmzaTable = jQuery('#wpgmza_table').dataTable({
|
372 |
+
"bProcessing": true
|
|
|
373 |
});
|
374 |
+
}
|
375 |
+
function wpgmza_InitMap() {
|
376 |
+
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
|
377 |
+
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
378 |
+
UniqueCode=Math.round(Math.random()*10000);
|
379 |
+
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($_GET['map_id']); ?>?u='+UniqueCode,<?php echo $_GET['map_id']; ?>);
|
380 |
+
}
|
|
|
|
|
|
|
|
|
|
|
381 |
|
382 |
+
jQuery("#wpgmza_map").css({
|
383 |
+
height:'<?php echo $wpgmza_height; ?><?php echo $wpgmza_height_type; ?>',
|
384 |
+
width:'<?php echo $wpgmza_width; ?><?php echo $wpgmza_width_type; ?>'
|
385 |
|
386 |
+
});
|
387 |
+
var geocoder = new google.maps.Geocoder();
|
388 |
+
wpgmza_InitMap();
|
389 |
+
|
390 |
+
|
391 |
+
|
392 |
+
|
393 |
+
jQuery("body").on("click", ".wpgmza_del_btn", function() {
|
394 |
+
var cur_id = jQuery(this).attr("id");
|
395 |
+
var wpgm_map_id = "0";
|
396 |
+
if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }
|
397 |
+
var data = {
|
398 |
+
action: 'delete_marker',
|
399 |
+
security: '<?php echo $ajax_nonce; ?>',
|
400 |
+
map_id: wpgm_map_id,
|
401 |
+
marker_id: cur_id
|
402 |
+
};
|
403 |
+
jQuery.post(ajaxurl, data, function(response) {
|
404 |
+
wpgmza_InitMap();
|
405 |
+
jQuery("#wpgmza_marker_holder").html(response);
|
406 |
+
wpgmza_reinitialisetbl();
|
407 |
+
//jQuery("#wpgmza_tr_"+cur_id).css("display","none");
|
408 |
});
|
|
|
|
|
409 |
|
410 |
|
411 |
+
});
|
412 |
+
|
413 |
+
|
414 |
+
jQuery("body").on("click", ".wpgmza_edit_btn", function() {
|
415 |
+
var cur_id = jQuery(this).attr("id");
|
416 |
+
var wpgmza_edit_address = jQuery("#wpgmza_hid_marker_address_"+cur_id).val();
|
417 |
+
var wpgmza_edit_title = jQuery("#wpgmza_hid_marker_title_"+cur_id).val();
|
418 |
+
jQuery("#wpgmza_edit_id").val(cur_id);
|
419 |
+
jQuery("#wpgmza_add_address").val(wpgmza_edit_address);
|
420 |
+
jQuery("#wpgmza_add_title").val(wpgmza_edit_title);
|
421 |
+
jQuery("#wpgmza_addmarker_div").hide();
|
422 |
+
jQuery("#wpgmza_editmarker_div").show();
|
423 |
+
});
|
424 |
+
|
425 |
+
|
426 |
+
|
427 |
+
jQuery("#wpgmza_addmarker").click(function(){
|
428 |
+
jQuery("#wpgmza_addmarker").hide();
|
429 |
+
jQuery("#wpgmza_addmarker_loading").show();
|
430 |
|
431 |
+
var wpgm_address = "0";
|
432 |
+
var wpgm_gps = "0";
|
433 |
+
var wpgm_map_id = "0";
|
434 |
+
if (document.getElementsByName("wpgmza_add_address").length > 0) { wpgm_address = jQuery("#wpgmza_add_address").val(); }
|
435 |
+
if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }
|
436 |
|
437 |
+
|
438 |
+
geocoder.geocode( { 'address': wpgm_address }, function(results, status) {
|
439 |
+
if (status == google.maps.GeocoderStatus.OK) {
|
440 |
+
wpgm_gps = String(results[0].geometry.location);
|
441 |
+
var latlng1 = wpgm_gps.replace("(","");
|
442 |
+
var latlng2 = latlng1.replace(")","");
|
443 |
+
var latlngStr = latlng2.split(",",2);
|
444 |
+
var wpgm_lat = parseFloat(latlngStr[0]);
|
445 |
+
var wpgm_lng = parseFloat(latlngStr[1]);
|
446 |
+
|
447 |
+
var data = {
|
448 |
+
action: 'add_marker',
|
449 |
security: '<?php echo $ajax_nonce; ?>',
|
450 |
map_id: wpgm_map_id,
|
451 |
+
address: wpgm_address,
|
452 |
+
lat: wpgm_lat,
|
453 |
+
lng: wpgm_lng
|
454 |
+
};
|
455 |
+
|
456 |
+
jQuery.post(ajaxurl, data, function(response) {
|
457 |
wpgmza_InitMap();
|
458 |
jQuery("#wpgmza_marker_holder").html(response);
|
459 |
+
jQuery("#wpgmza_addmarker").show();
|
460 |
+
jQuery("#wpgmza_addmarker_loading").hide();
|
461 |
wpgmza_reinitialisetbl();
|
462 |
+
var myLatLng = new google.maps.LatLng(wpgm_lat,wpgm_lng);
|
463 |
+
MYMAP.map.setCenter(myLatLng);
|
464 |
+
});
|
465 |
|
466 |
+
} else {
|
467 |
+
alert("Geocode was not successful for the following reason: " + status);
|
468 |
+
}
|
469 |
});
|
470 |
|
471 |
|
472 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
473 |
|
474 |
|
475 |
+
jQuery("#wpgmza_editmarker").click(function(){
|
476 |
|
477 |
+
jQuery("#wpgmza_editmarker_div").hide();
|
478 |
+
jQuery("#wpgmza_editmarker_loading").show();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
|
480 |
|
481 |
+
var wpgm_edit_id;
|
482 |
+
wpgm_edit_id = parseInt(jQuery("#wpgmza_edit_id").val());
|
483 |
+
var wpgm_address = "0";
|
484 |
+
var wpgm_map_id = "0";
|
485 |
+
var wpgm_gps = "0";
|
486 |
+
if (document.getElementsByName("wpgmza_add_address").length > 0) { wpgm_address = jQuery("#wpgmza_add_address").val(); }
|
487 |
+
if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }
|
488 |
|
489 |
|
490 |
+
geocoder.geocode( { 'address': wpgm_address}, function(results, status) {
|
491 |
+
if (status == google.maps.GeocoderStatus.OK) {
|
492 |
+
wpgm_gps = String(results[0].geometry.location);
|
493 |
+
var latlng1 = wpgm_gps.replace("(","");
|
494 |
+
var latlng2 = latlng1.replace(")","");
|
495 |
+
var latlngStr = latlng2.split(",",2);
|
496 |
+
var wpgm_lat = parseFloat(latlngStr[0]);
|
497 |
+
var wpgm_lng = parseFloat(latlngStr[1]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
498 |
|
499 |
+
var data = {
|
500 |
+
action: 'edit_marker',
|
501 |
+
security: '<?php echo $ajax_nonce; ?>',
|
502 |
+
map_id: wpgm_map_id,
|
503 |
+
edit_id: wpgm_edit_id,
|
504 |
+
address: wpgm_address,
|
505 |
+
lat: wpgm_lat,
|
506 |
+
lng: wpgm_lng
|
507 |
+
};
|
508 |
|
509 |
+
jQuery.post(ajaxurl, data, function(response) {
|
510 |
+
wpgmza_InitMap();
|
511 |
+
jQuery("#wpgmza_add_address").val("");
|
512 |
+
jQuery("#wpgmza_add_title").val("");
|
513 |
+
jQuery("#wpgmza_marker_holder").html(response);
|
514 |
+
jQuery("#wpgmza_addmarker_div").show();
|
515 |
+
jQuery("#wpgmza_editmarker_loading").hide();
|
516 |
+
jQuery("#wpgmza_edit_id").val("");
|
517 |
+
wpgmza_reinitialisetbl();
|
518 |
+
});
|
519 |
|
520 |
+
} else {
|
521 |
+
alert("Geocode was not successful for the following reason: " + status);
|
522 |
+
}
|
523 |
});
|
|
|
524 |
|
525 |
+
|
526 |
+
|
527 |
+
});
|
528 |
});
|
529 |
|
530 |
+
});
|
531 |
|
532 |
|
533 |
+
|
534 |
+
var MYMAP = {
|
535 |
+
map: null,
|
536 |
+
bounds: null
|
537 |
+
}
|
538 |
+
MYMAP.init = function(selector, latLng, zoom) {
|
539 |
+
var myOptions = {
|
540 |
+
zoom:zoom,
|
541 |
+
center: latLng,
|
542 |
+
zoomControl: <?php if ($wpgmza_settings['wpgmza_settings_map_zoom'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
543 |
+
panControl: <?php if ($wpgmza_settings['wpgmza_settings_map_pan'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
544 |
+
mapTypeControl: <?php if ($wpgmza_settings['wpgmza_settings_map_type'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
545 |
+
streetViewControl: <?php if ($wpgmza_settings['wpgmza_settings_map_streetview'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
546 |
+
mapTypeId: google.maps.MapTypeId.<?php echo $wpgmza_map_type; ?>
|
547 |
}
|
548 |
+
this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
|
549 |
+
this.bounds = new google.maps.LatLngBounds();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
|
551 |
|
552 |
+
google.maps.event.addListener(MYMAP.map, 'zoom_changed', function() {
|
553 |
zoomLevel = MYMAP.map.getZoom();
|
554 |
|
555 |
jQuery("#wpgmza_start_zoom").val(zoomLevel);
|
556 |
if (zoomLevel == 0) {
|
557 |
+
MYMAP.map.setZoom(10);
|
558 |
}
|
559 |
+
});
|
560 |
+
google.maps.event.addListener(MYMAP.map, 'center_changed', function() {
|
561 |
+
var location = MYMAP.map.getCenter();
|
562 |
+
jQuery("#wpgmza_start_location").val(location.lat()+","+location.lng());
|
563 |
+
jQuery("#wpgmaps_save_reminder").show();
|
564 |
+
});
|
565 |
|
566 |
+
google.maps.event.addListener(MYMAP.map, 'click', function() {
|
567 |
+
infoWindow.close();
|
568 |
+
});
|
569 |
|
570 |
|
571 |
+
}
|
572 |
|
573 |
+
var infoWindow = new google.maps.InfoWindow();
|
574 |
+
<?php
|
575 |
+
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
576 |
+
$wpgmza_settings_infowindow_width = $wpgmza_settings['wpgmza_settings_infowindow_width'];
|
577 |
+
if (!$wpgmza_settings_infowindow_width || !isset($wpgmza_settings_infowindow_width)) { $wpgmza_settings_infowindow_width = "200"; }
|
578 |
+
?>
|
579 |
+
infoWindow.setOptions({maxWidth:<?php echo $wpgmza_settings_infowindow_width; ?>});
|
580 |
|
581 |
|
582 |
+
MYMAP.placeMarkers = function(filename,map_id) {
|
583 |
+
marker_array = [];
|
584 |
+
jQuery.get(filename, function(xml){
|
585 |
+
jQuery(xml).find("marker").each(function(){
|
586 |
+
var wpmgza_map_id = jQuery(this).find('map_id').text();
|
587 |
+
if (wpmgza_map_id == map_id) {
|
588 |
+
var wpmgza_address = jQuery(this).find('address').text();
|
589 |
+
var lat = jQuery(this).find('lat').text();
|
590 |
+
var lng = jQuery(this).find('lng').text();
|
591 |
+
var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
|
592 |
+
MYMAP.bounds.extend(point);
|
593 |
+
var marker = new google.maps.Marker({
|
594 |
+
position: point,
|
595 |
+
map: MYMAP.map
|
596 |
|
597 |
|
598 |
+
});
|
599 |
|
600 |
+
var html='<strong>'+wpmgza_address+'</strong>';
|
601 |
|
602 |
+
google.maps.event.addListener(marker, 'click', function() {
|
603 |
+
infoWindow.close();
|
604 |
+
infoWindow.setContent(html);
|
605 |
+
infoWindow.open(MYMAP.map, marker);
|
606 |
+
//MYMAP.map.setCenter(this.position);
|
607 |
|
608 |
+
});
|
609 |
|
610 |
+
}
|
611 |
|
612 |
+
});
|
613 |
+
});
|
614 |
+
}
|
615 |
|
616 |
|
617 |
|
619 |
|
620 |
|
621 |
</script>
|
622 |
+
<?php
|
623 |
+
}
|
624 |
|
625 |
}
|
626 |
|
633 |
|
634 |
$ajax_nonce = wp_create_nonce("wpgmza");
|
635 |
|
636 |
+
|
637 |
$res = wpgmza_get_map_data($wpgmza_current_map_id);
|
638 |
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
639 |
|
655 |
|
656 |
?>
|
657 |
<script type="text/javascript">
|
658 |
+
var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
|
659 |
+
document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
|
660 |
</script>
|
661 |
<script type="text/javascript" >
|
662 |
|
663 |
+
if ('undefined' == typeof window.jQuery) {
|
664 |
+
document.getElementById('wpgmza_map').innerHTML = 'Error: In order for WP Google Maps to work, jQuery must be installed. A check was done and jQuery was not present. Please see the <a href="http://www.wpgmaps.com/documentation/troubleshooting/jquery-troubleshooting/" title="WP Google Maps - jQuery Troubleshooting">jQuery troubleshooting section of our site</a> for more information.';
|
665 |
+
} else {
|
666 |
+
// all good.. continue...
|
667 |
+
}
|
|
|
|
|
668 |
|
669 |
+
jQuery(function() {
|
670 |
|
|
|
671 |
|
672 |
+
jQuery(document).ready(function(){
|
673 |
+
if (/1\.(0|1|2|3|4|5|6|7)\.(0|1|2|3|4|5|6|7|8|9)/.test(jQuery.fn.jquery)) {
|
674 |
+
document.getElementById('wpgmza_map').innerHTML = 'Error: Your version of jQuery is outdated. WP Google Maps requires jQuery version 1.7+ to function correctly. Go to Maps->Settings and check the box that allows you to over-ride your current jQuery to try eliminate this problem.';
|
675 |
+
} else {
|
676 |
|
677 |
+
jQuery("#wpgmza_map").css({
|
678 |
+
height:'<?php echo $wpgmza_height; ?><?php echo $wpgmza_height_type; ?>',
|
679 |
+
width:'<?php echo $wpgmza_width; ?><?php echo $wpgmza_width_type; ?>'
|
680 |
+
});
|
681 |
+
var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
|
682 |
+
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
683 |
+
UniqueCode=Math.round(Math.random()*10000);
|
684 |
+
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>);
|
685 |
|
686 |
+
jQuery('body').on('tabsshow', function(event, ui) {
|
687 |
+
MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
|
688 |
+
UniqueCode=Math.round(Math.random()*10000);
|
689 |
+
MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>);
|
690 |
+
});
|
691 |
+
}
|
|
|
|
|
692 |
|
693 |
+
});
|
|
|
|
|
|
|
|
|
|
|
694 |
|
695 |
});
|
|
|
|
|
696 |
|
697 |
|
698 |
var MYMAP = {
|
701 |
}
|
702 |
|
703 |
MYMAP.init = function(selector, latLng, zoom) {
|
704 |
+
var myOptions = {
|
705 |
+
zoom:zoom,
|
706 |
+
center: latLng,
|
707 |
+
zoomControl: <?php if ($wpgmza_settings['wpgmza_settings_map_zoom'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
708 |
+
panControl: <?php if ($wpgmza_settings['wpgmza_settings_map_pan'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
709 |
+
mapTypeControl: <?php if ($wpgmza_settings['wpgmza_settings_map_type'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
710 |
+
streetViewControl: <?php if ($wpgmza_settings['wpgmza_settings_map_streetview'] == "yes") { echo "false"; } else { echo "true"; } ?>,
|
711 |
+
mapTypeId: google.maps.MapTypeId.<?php echo $wpgmza_map_type; ?>
|
712 |
+
}
|
713 |
|
714 |
+
this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
|
715 |
+
this.bounds = new google.maps.LatLngBounds();
|
716 |
google.maps.event.addListener(MYMAP.map, 'click', function() {
|
717 |
+
infoWindow.close();
|
718 |
});
|
719 |
}
|
720 |
|
744 |
var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
|
745 |
MYMAP.bounds.extend(point);
|
746 |
var marker = new google.maps.Marker({
|
747 |
+
position: point,
|
748 |
+
map: MYMAP.map
|
749 |
+
});
|
750 |
var html='<strong>'+wpmgza_address+'</strong>';
|
751 |
|
752 |
google.maps.event.addListener(marker, 'click', function(evt) {
|
760 |
|
761 |
});
|
762 |
}
|
763 |
+
|
764 |
+
|
765 |
|
766 |
</script>
|
767 |
+
<?php
|
768 |
}
|
769 |
}
|
770 |
|
790 |
|
791 |
// PREVIOUS VERSION HANDLING
|
792 |
if (function_exists('wpgmza_register_pro_version')) {
|
793 |
+
$prov = get_option("WPGMZA_PRO");
|
794 |
+
$wpgmza_pro_version = $prov['version'];
|
795 |
+
$results = $wpdb->get_results(
|
796 |
+
"
|
797 |
SELECT *
|
798 |
FROM $table_name
|
799 |
WHERE `map_id` = '$mapid'
|
800 |
|
801 |
"
|
802 |
+
);
|
803 |
+
}
|
804 |
+
else {
|
805 |
+
$results = $wpdb->get_results(
|
806 |
+
"
|
807 |
SELECT *
|
808 |
FROM $table_name
|
809 |
WHERE `map_id` = '$mapid'
|
810 |
|
811 |
"
|
812 |
+
);
|
813 |
+
}
|
814 |
|
815 |
|
816 |
|
829 |
$lat = $result->lat;
|
830 |
$lng = $result->lng;
|
831 |
$anim = $result->anim;
|
832 |
+
$category = $result->category;
|
833 |
$infoopen = $result->infoopen;
|
834 |
$mtitle = stripslashes($result->title);
|
835 |
$map_id = $result->map_id;
|
857 |
$bd->appendChild($dom->CreateTextNode($lng));
|
858 |
$bd = $channel->appendChild($dom->createElement('anim'));
|
859 |
$bd->appendChild($dom->CreateTextNode($anim));
|
860 |
+
$bd = $channel->appendChild($dom->createElement('category'));
|
861 |
+
$bd->appendChild($dom->CreateTextNode($category));
|
862 |
$bd = $channel->appendChild($dom->createElement('infoopen'));
|
863 |
$bd->appendChild($dom->CreateTextNode($infoopen));
|
864 |
|
899 |
|
900 |
|
901 |
function wpgmaps_action_callback_basic() {
|
902 |
+
global $wpdb;
|
903 |
+
global $wpgmza_tblname;
|
904 |
+
global $wpgmza_p;
|
905 |
+
$check = check_ajax_referer( 'wpgmza', 'security' );
|
906 |
+
$table_name = $wpdb->prefix . "wpgmza";
|
907 |
+
|
908 |
+
if ($check == 1) {
|
909 |
+
|
910 |
+
if ($_POST['action'] == "add_marker") {
|
911 |
+
$rows_affected = $wpdb->insert( $table_name, array( 'map_id' => $_POST['map_id'], 'address' => $_POST['address'], 'lat' => $_POST['lat'], 'lng' => $_POST['lng'], 'infoopen' => '', 'description' => '', 'title' => '', 'anim' => '', 'link' => '', 'icon' => '', 'pic' => '' ) );
|
912 |
+
//exit( var_dump( $wpdb->last_query ) );
|
913 |
+
wpgmaps_update_xml_file($_POST['map_id']);
|
914 |
+
echo wpgmza_return_marker_list($_POST['map_id']);
|
915 |
+
}
|
916 |
+
if ($_POST['action'] == "edit_marker") {
|
917 |
+
$cur_id = $_POST['edit_id'];
|
918 |
+
$rows_affected = $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET address = %s, lat = %f, lng = %f WHERE id = %d", $_POST['address'], $_POST['lat'], $_POST['lng'], $cur_id) );
|
919 |
+
wpgmaps_update_xml_file($_POST['map_id']);
|
920 |
+
echo wpgmza_return_marker_list($_POST['map_id']);
|
921 |
+
}
|
922 |
+
if ($_POST['action'] == "delete_marker") {
|
923 |
+
$marker_id = $_POST['marker_id'];
|
924 |
+
$wpdb->query(
|
925 |
+
"
|
926 |
DELETE FROM $wpgmza_tblname
|
927 |
WHERE `id` = '$marker_id'
|
928 |
LIMIT 1
|
929 |
"
|
930 |
+
);
|
931 |
+
wpgmaps_update_xml_file($_POST['map_id']);
|
932 |
+
echo wpgmza_return_marker_list($_POST['map_id']);
|
933 |
|
|
|
934 |
}
|
935 |
+
}
|
936 |
|
937 |
+
die(); // this is required to return a proper result
|
938 |
|
939 |
}
|
940 |
|
943 |
}
|
944 |
|
945 |
function wpgmaps_tag_basic( $atts ) {
|
946 |
+
global $wpgmza_current_map_id;
|
947 |
+
extract( shortcode_atts( array(
|
948 |
+
'id' => '1'
|
949 |
+
), $atts ) );
|
950 |
+
$ret_msg = "";
|
951 |
+
global $short_code_active;
|
952 |
+
$wpgmza_current_map_id = $atts['id'];
|
953 |
+
|
954 |
+
$res = wpgmza_get_map_data($atts['id']);
|
955 |
+
$short_code_active = true;
|
956 |
+
//$wpgmza_data = get_option('WPGMZA');
|
957 |
+
$map_align = $res->alignment;
|
958 |
|
959 |
|
960 |
+
$map_width_type = $res->map_width_type;
|
961 |
+
$map_height_type = $res->map_height_type;
|
962 |
|
963 |
+
if (!isset($map_width_type)) { $map_width_type == "px"; }
|
964 |
+
if (!isset($map_height_type)) { $map_height_type == "px"; }
|
965 |
|
966 |
|
967 |
+
if ($map_width_type == "%" && intval($res->map_width) > 100) { $res->map_width = 100; }
|
968 |
+
if ($map_height_type == "%" && intval($res->map_height) > 100) { $res->map_height = 100; }
|
969 |
|
970 |
+
if (!$map_align || $map_align == "" || $map_align == "1") { $map_align = "float:left;"; }
|
971 |
+
else if ($map_align == "2") { $map_align = "margin-left:auto !important; margin-right:auto; !important; align:center;"; }
|
972 |
+
else if ($map_align == "3") { $map_align = "float:right;"; }
|
973 |
+
else if ($map_align == "4") { $map_align = ""; }
|
974 |
+
$map_style = "style=\"display:block; overflow:auto; width:".$res->map_width."".$map_width_type."; height:".$res->map_height."".$map_height_type."; $map_align\"";
|
975 |
|
976 |
|
977 |
+
$ret_msg .= "
|
978 |
<style>
|
979 |
#wpgmza_map img { max-width:none !important; }
|
980 |
</style>
|
982 |
|
983 |
|
984 |
";
|
985 |
+
return $ret_msg;
|
986 |
}
|
987 |
|
988 |
function wpgmaps_get_plugin_url() {
|
989 |
if ( !function_exists('plugins_url') )
|
990 |
return get_option('siteurl') . '/wp-content/plugins/' . plugin_basename(dirname(__FILE__));
|
991 |
+
return plugins_url(plugin_basename(dirname(__FILE__)));
|
992 |
}
|
993 |
|
994 |
function wpgmaps_head() {
|
1002 |
|
1003 |
//var_dump($_POST);
|
1004 |
|
1005 |
+
$map_id = esc_attr($_POST['wpgmza_id']);
|
1006 |
+
$map_title = esc_attr($_POST['wpgmza_title']);
|
1007 |
+
$map_height = esc_attr($_POST['wpgmza_height']);
|
1008 |
+
$map_width = esc_attr($_POST['wpgmza_width']);
|
1009 |
+
|
1010 |
+
|
1011 |
+
$map_width_type = esc_attr($_POST['wpgmza_map_width_type']);
|
1012 |
+
if ($map_width_type == "%") { $map_width_type = "\%"; }
|
1013 |
+
$map_height_type = esc_attr($_POST['wpgmza_map_height_type']);
|
1014 |
+
if ($map_height_type == "%") { $map_height_type = "\%"; }
|
1015 |
+
$map_start_location = esc_attr($_POST['wpgmza_start_location']);
|
1016 |
$map_start_zoom = intval($_POST['wpgmza_start_zoom']);
|
1017 |
$type = intval($_POST['wpgmza_map_type']);
|
1018 |
$alignment = intval($_POST['wpgmza_map_align']);
|
1023 |
$bicycle_enabled = intval($_POST['wpgmza_bicycle']);
|
1024 |
$traffic_enabled = intval($_POST['wpgmza_traffic']);
|
1025 |
$dbox = intval($_POST['wpgmza_dbox']);
|
1026 |
+
$dbox_width = esc_attr($_POST['wpgmza_dbox_width']);
|
1027 |
$listmarkers = intval($_POST['wpgmza_listmarkers']);
|
1028 |
$listmarkers_advanced = intval($_POST['wpgmza_listmarkers_advanced']);
|
1029 |
+
$filterbycat = intval($_POST['wpgmza_filterbycat']);
|
1030 |
|
1031 |
|
1032 |
$gps = explode(",",$map_start_location);
|
1033 |
$map_start_lat = $gps[0];
|
1034 |
$map_start_lng = $gps[1];
|
1035 |
$map_default_marker = $_POST['upload_default_marker'];
|
1036 |
+
$kml = esc_attr($_POST['wpgmza_kml']);
|
1037 |
+
$fusion = esc_attr($_POST['wpgmza_fusion']);
|
1038 |
|
1039 |
$data['map_default_starting_lat'] = $map_start_lat;
|
1040 |
$data['map_default_starting_lng'] = $map_start_lng;
|
1053 |
$data['map_default_dbox_width'] = $dbox_width;
|
1054 |
$data['map_default_listmarkers'] = $listmarkers;
|
1055 |
$data['map_default_listmarkers_advanced'] = $listmarkers_advanced;
|
1056 |
+
$data['map_default_filterbycat'] = $filterbycat;
|
1057 |
$data['map_default_marker'] = $map_default_marker;
|
1058 |
$data['map_default_width_type'] = $map_width_type;
|
1059 |
$data['map_default_height_type'] = $map_height_type;
|
1060 |
|
1061 |
|
1062 |
|
1063 |
+
|
1064 |
+
|
1065 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1066 |
"UPDATE $wpgmza_tblname_maps SET
|
1067 |
map_title = %s,
|
1085 |
dbox_width = %s,
|
1086 |
listmarkers = %d,
|
1087 |
listmarkers_advanced = %d,
|
1088 |
+
filterbycat = %d,
|
1089 |
fusion = %s,
|
1090 |
map_width_type = %s,
|
1091 |
map_height_type = %s
|
1112 |
$dbox_width,
|
1113 |
$listmarkers,
|
1114 |
$listmarkers_advanced,
|
1115 |
+
$filterbycat,
|
1116 |
$fusion,
|
1117 |
$map_width_type,
|
1118 |
$map_height_type,
|
1123 |
|
1124 |
|
1125 |
update_option('WPGMZA_SETTINGS', $data);
|
1126 |
+
|
1127 |
|
1128 |
echo "<div class='updated'>";
|
1129 |
_e("Your settings have been saved.","wp-google-maps");
|
1130 |
echo "</div>";
|
1131 |
|
1132 |
+
}
|
1133 |
|
1134 |
+
else if (isset($_POST['wpgmza_save_maker_location'])){
|
1135 |
global $wpdb;
|
1136 |
global $wpgmza_tblname;
|
1137 |
+
$mid = esc_attr($_POST['wpgmaps_marker_id']);
|
1138 |
+
$wpgmaps_marker_lat = esc_attr($_POST['wpgmaps_marker_lat']);
|
1139 |
+
$wpgmaps_marker_lng = esc_attr($_POST['wpgmaps_marker_lng']);
|
1140 |
|
1141 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1142 |
"UPDATE $wpgmza_tblname SET
|
1149 |
$mid)
|
1150 |
);
|
1151 |
|
1152 |
+
|
1153 |
|
1154 |
|
1155 |
|
1159 |
echo "</div>";
|
1160 |
|
1161 |
|
1162 |
+
}
|
1163 |
+
else if (isset($_POST['wpgmza_save_poly'])){
|
1164 |
global $wpdb;
|
1165 |
global $wpgmza_tblname_poly;
|
1166 |
+
$mid = esc_attr($_POST['wpgmaps_map_id']);
|
1167 |
+
$wpgmaps_polydata = esc_attr($_POST['wpgmza_polygon']);
|
1168 |
+
$linecolor = esc_attr($_POST['poly_line']);
|
1169 |
+
$fillcolor = esc_attr($_POST['poly_fill']);
|
1170 |
+
$opacity = esc_attr($_POST['poly_opacity']);
|
1171 |
+
|
1172 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1173 |
"INSERT INTO $wpgmza_tblname_poly SET
|
1174 |
map_id = %d,
|
1183 |
$linecolor,
|
1184 |
$fillcolor,
|
1185 |
$opacity
|
1186 |
+
)
|
1187 |
);
|
1188 |
echo "<div class='updated'>";
|
1189 |
_e("Your polygon has been created.","wp-google-maps");
|
1190 |
echo "</div>";
|
1191 |
|
1192 |
|
1193 |
+
}
|
1194 |
+
else if (isset($_POST['wpgmza_edit_poly'])){
|
1195 |
global $wpdb;
|
1196 |
global $wpgmza_tblname_poly;
|
1197 |
+
$mid = esc_attr($_POST['wpgmaps_map_id']);
|
1198 |
+
$pid = esc_attr($_POST['wpgmaps_poly_id']);
|
1199 |
+
$wpgmaps_polydata = esc_attr($_POST['wpgmza_polygon']);
|
1200 |
+
$linecolor = esc_attr($_POST['poly_line']);
|
1201 |
+
$fillcolor = esc_attr($_POST['poly_fill']);
|
1202 |
+
$opacity = esc_attr($_POST['poly_opacity']);
|
1203 |
+
|
1204 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1205 |
"UPDATE $wpgmza_tblname_poly SET
|
1206 |
polydata = %s,
|
1215 |
$fillcolor,
|
1216 |
$opacity,
|
1217 |
$pid
|
1218 |
+
)
|
1219 |
);
|
1220 |
echo "<div class='updated'>";
|
1221 |
_e("Your polygon has been saved.","wp-google-maps");
|
1222 |
echo "</div>";
|
1223 |
|
1224 |
|
1225 |
+
}
|
1226 |
+
else if (isset($_POST['wpgmza_save_polyline'])){
|
1227 |
global $wpdb;
|
1228 |
global $wpgmza_tblname_polylines;
|
1229 |
+
$mid = esc_attr($_POST['wpgmaps_map_id']);
|
1230 |
+
$wpgmaps_polydata = esc_attr($_POST['wpgmza_polyline']);
|
1231 |
+
$linecolor = esc_attr($_POST['poly_line']);
|
1232 |
+
$linethickness = esc_attr($_POST['poly_thickness']);
|
1233 |
+
$opacity = esc_attr($_POST['poly_opacity']);
|
1234 |
+
|
1235 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1236 |
"INSERT INTO $wpgmza_tblname_polylines SET
|
1237 |
map_id = %d,
|
1246 |
$linecolor,
|
1247 |
$linethickness,
|
1248 |
$opacity
|
1249 |
+
)
|
1250 |
);
|
1251 |
echo "<div class='updated'>";
|
1252 |
_e("Your polyline has been created.","wp-google-maps");
|
1253 |
echo "</div>";
|
1254 |
|
1255 |
|
1256 |
+
}
|
1257 |
+
else if (isset($_POST['wpgmza_edit_polyline'])){
|
1258 |
global $wpdb;
|
1259 |
global $wpgmza_tblname_polylines;
|
1260 |
+
$mid = esc_attr($_POST['wpgmaps_map_id']);
|
1261 |
+
$pid = esc_attr($_POST['wpgmaps_poly_id']);
|
1262 |
+
$wpgmaps_polydata = esc_attr($_POST['wpgmza_polyline']);
|
1263 |
+
$linecolor = esc_attr($_POST['poly_line']);
|
1264 |
+
$linethickness = esc_attr($_POST['poly_thickness']);
|
1265 |
+
$opacity = esc_attr($_POST['poly_opacity']);
|
1266 |
+
|
1267 |
$rows_affected = $wpdb->query( $wpdb->prepare(
|
1268 |
"UPDATE $wpgmza_tblname_polylines SET
|
1269 |
polydata = %s,
|
1278 |
$linethickness,
|
1279 |
$opacity,
|
1280 |
$pid
|
1281 |
+
)
|
1282 |
);
|
1283 |
echo "<div class='updated'>";
|
1284 |
_e("Your polyline has been saved.","wp-google-maps");
|
1285 |
echo "</div>";
|
1286 |
|
1287 |
|
1288 |
+
}
|
1289 |
+
else if (isset($_POST['wpgmza_save_settings'])){
|
1290 |
global $wpdb;
|
1291 |
+
$wpgmza_data['wpgmza_settings_image_width'] = esc_attr($_POST['wpgmza_settings_image_width']);
|
1292 |
+
$wpgmza_data['wpgmza_settings_image_height'] = esc_attr($_POST['wpgmza_settings_image_height']);
|
1293 |
+
$wpgmza_data['wpgmza_settings_use_timthumb'] = esc_attr($_POST['wpgmza_settings_use_timthumb']);
|
1294 |
+
$wpgmza_data['wpgmza_settings_infowindow_width'] = esc_attr($_POST['wpgmza_settings_infowindow_width']);
|
1295 |
+
$wpgmza_data['wpgmza_settings_infowindow_links'] = esc_attr($_POST['wpgmza_settings_infowindow_links']);
|
1296 |
+
$wpgmza_data['wpgmza_settings_infowindow_address'] = esc_attr($_POST['wpgmza_settings_infowindow_address']);
|
1297 |
+
$wpgmza_data['wpgmza_settings_map_streetview'] = esc_attr($_POST['wpgmza_settings_map_streetview']);
|
1298 |
+
$wpgmza_data['wpgmza_settings_map_zoom'] = esc_attr($_POST['wpgmza_settings_map_zoom']);
|
1299 |
+
$wpgmza_data['wpgmza_settings_map_pan'] = esc_attr($_POST['wpgmza_settings_map_pan']);
|
1300 |
+
$wpgmza_data['wpgmza_settings_map_type'] = esc_attr($_POST['wpgmza_settings_map_type']);
|
1301 |
+
$wpgmza_data['wpgmza_settings_map_scroll'] = esc_attr($_POST['wpgmza_settings_map_scroll']);
|
1302 |
+
$wpgmza_data['wpgmza_settings_map_draggable'] = esc_attr($_POST['wpgmza_settings_map_draggable']);
|
1303 |
+
$wpgmza_data['wpgmza_settings_map_clickzoom'] = esc_attr($_POST['wpgmza_settings_map_clickzoom']);
|
1304 |
+
$wpgmza_data['wpgmza_settings_ugm_striptags'] = esc_attr($_POST['wpgmza_settings_map_striptags']);
|
1305 |
+
$wpgmza_data['wpgmza_settings_force_jquery'] = esc_attr($_POST['wpgmza_settings_force_jquery']);
|
1306 |
update_option('WPGMZA_OTHER_SETTINGS', $wpgmza_data);
|
1307 |
echo "<div class='updated'>";
|
1308 |
_e("Your settings have been saved.","wp-google-maps");
|
1309 |
echo "</div>";
|
1310 |
|
1311 |
|
1312 |
+
}
|
1313 |
|
1314 |
|
1315 |
|
1325 |
//add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Markers', __('Markers','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-markers', 'wpgmaps_menu_marker_layout');
|
1326 |
|
1327 |
if (function_exists('wpgmza_pro_advanced_menu')) {
|
1328 |
+
add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Categories', __('Categories','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-categories', 'wpgmaps_menu_category_layout');
|
1329 |
add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Advanced Options', __('Advanced','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-advanced', 'wpgmaps_menu_advanced_layout');
|
1330 |
}
|
1331 |
+
add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Settings', __('Settings','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-settings', 'wpgmaps_menu_settings_layout');
|
1332 |
|
1333 |
// add_options_page('WP Google Maps', 'WP Google Maps', 'manage_options', 'wp-google-maps-menu', 'wpgmaps_menu_layout');
|
1334 |
}
|
1392 |
|
1393 |
if (function_exists('wpgmza_register_pro_version')) {
|
1394 |
|
1395 |
+
$prov = get_option("WPGMZA_PRO");
|
1396 |
+
$wpgmza_pro_version = $prov['version'];
|
1397 |
+
if (floatval($wpgmza_pro_version) == 4.12 || floatval($wpgmza_pro_version) == 4.11 || floatval($wpgmza_pro_version) == 4.10 || floatval($wpgmza_pro_version) == 4.09 || floatval($wpgmza_pro_version) == 4.08 || floatval($wpgmza_pro_version) == 4.08) {
|
1398 |
+
wpgmaps_upgrade_notice();
|
1399 |
+
wpgmza_pro_menu();
|
1400 |
+
} else {
|
1401 |
+
wpgmza_pro_menu();
|
1402 |
+
}
|
1403 |
|
1404 |
|
1405 |
} else {
|
1510 |
<p class='submit'><input type='submit' name='wpgmza_save_settings' class='button-primary' value='".__("Save Settings","wp-google-maps")." »' /></p>
|
1511 |
|
1512 |
|
1513 |
+
|
1514 |
+
|
1515 |
+
|
1516 |
</form>
|
1517 |
";
|
1518 |
|
1519 |
echo "</div>";
|
1520 |
|
1521 |
+
|
1522 |
}
|
1523 |
|
1524 |
function wpgmaps_menu_advanced_layout() {
|
1527 |
}
|
1528 |
|
1529 |
}
|
|
|
1530 |
function wpgmza_map_page() {
|
1531 |
if (function_exists('wpgmza_register_pro_version')) {
|
1532 |
echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>".__("My Maps","wp-google-maps")." <a href=\"admin.php?page=wp-google-maps-menu&action=new\" class=\"add-new-h2\">".__("Add New","wp-google-maps")."</a></h2>";
|
1552 |
|
1553 |
|
1554 |
$results = $wpdb->get_results(
|
1555 |
+
"
|
1556 |
SELECT *
|
1557 |
FROM $table_name
|
1558 |
WHERE `active` = 0
|
1610 |
global $wpgmza_tblname;
|
1611 |
|
1612 |
$results = $wpdb->get_results(
|
1613 |
+
"
|
1614 |
SELECT *
|
1615 |
FROM $wpgmza_tblname
|
1616 |
ORDER BY `address` DESC
|
1648 |
|
1649 |
}
|
1650 |
echo "</table>";
|
1651 |
+
|
1652 |
}
|
1653 |
|
1654 |
|
1670 |
$res = wpgmza_get_map_data($_GET['map_id']);
|
1671 |
|
1672 |
|
1673 |
+
if ($res->map_start_zoom) { $wpgmza_zoom[intval($res->map_start_zoom)] = "SELECTED"; } else { $wpgmza_zoom[8] = "SELECTED"; }
|
1674 |
+
if ($res->type) { $wpgmza_map_type[intval($res->type)] = "SELECTED"; } else { $wpgmza_map_type[1] = "SELECTED"; }
|
1675 |
+
if ($res->alignment) { $wpgmza_map_align[intval($res->alignment)] = "SELECTED"; } else { $wpgmza_map_align[1] = "SELECTED"; }
|
1676 |
|
1677 |
+
if ($res->map_width_type == "%") { $wpgmza_map_width_type_percentage = "SELECTED"; } else { $wpgmza_map_width_type_px = "SELECTED"; }
|
1678 |
+
if ($res->map_height_type == "%") { $wpgmza_map_height_type_percentage = "SELECTED"; } else { $wpgmza_map_height_type_px = "SELECTED"; }
|
1679 |
|
1680 |
|
1681 |
$wpgmza_act = "disabled readonly";
|
1682 |
$wpgmza_act_msg = "<span style=\"font-size:16px; color:#666;\">".__("Add custom icons, titles, descriptions, pictures and links to your markers with the","wp-google-maps")." \"<a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=below_marker\" title=\"".__("Pro Edition","wp-google-maps")."\" target=\"_BLANK\">".__("Pro Edition","wp-google-maps")."</a>\" ".__("of this plugin for just","wp-google-maps")." <strong>$14.99</strong></span>";
|
1683 |
$wpgmza_csv = "<p><a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=csv_link\" title=\"".__("Pro Edition","wp-google-maps")."\">".__("Purchase the Pro Edition","wp-google-maps")."</a> ".__("of WP Google Maps and save your markers to a CSV file!","wp-google-maps")."</p>";
|
1684 |
}
|
1685 |
+
echo "
|
1686 |
|
1687 |
<div class='wrap'>
|
1688 |
<h1>WP Google Maps</h1>
|
1693 |
<h2>".__("Map Settings","wp-google-maps")."</h2>
|
1694 |
<form action='' method='post' id='wpgmaps_options'>
|
1695 |
<p></p>
|
|
|
|
|
1696 |
<div id=\"wpgmaps_tabs\">
|
1697 |
+
<ul>
|
1698 |
+
<li><a href=\"#tabs-1\">General Settings</a></li>
|
1699 |
+
<li><a href=\"#tabs-2\">Advanced Settings</a></li>
|
1700 |
+
</ul>
|
1701 |
+
<div id=\"tabs-1\">
|
1702 |
+
<p></p>
|
1703 |
+
<input type='hidden' name='http_referer' value='".$_SERVER['PHP_SELF']."' />
|
1704 |
+
<input type='hidden' name='wpgmza_id' id='wpgmza_id' value='".$res->id."' />
|
1705 |
+
<input id='wpgmza_start_location' name='wpgmza_start_location' type='hidden' size='40' maxlength='100' value='".$res->map_start_location."' />
|
1706 |
+
<select id='wpgmza_start_zoom' name='wpgmza_start_zoom' style=\"display:none;\">
|
1707 |
+
<option value=\"1\" ".$wpgmza_zoom[1].">1</option>
|
1708 |
+
<option value=\"2\" ".$wpgmza_zoom[2].">2</option>
|
1709 |
+
<option value=\"3\" ".$wpgmza_zoom[3].">3</option>
|
1710 |
+
<option value=\"4\" ".$wpgmza_zoom[4].">4</option>
|
1711 |
+
<option value=\"5\" ".$wpgmza_zoom[5].">5</option>
|
1712 |
+
<option value=\"6\" ".$wpgmza_zoom[6].">6</option>
|
1713 |
+
<option value=\"7\" ".$wpgmza_zoom[7].">7</option>
|
1714 |
+
<option value=\"8\" ".$wpgmza_zoom[8].">8</option>
|
1715 |
+
<option value=\"9\" ".$wpgmza_zoom[9].">9</option>
|
1716 |
+
<option value=\"10\" ".$wpgmza_zoom[10].">10</option>
|
1717 |
+
<option value=\"11\" ".$wpgmza_zoom[11].">11</option>
|
1718 |
+
<option value=\"12\" ".$wpgmza_zoom[12].">12</option>
|
1719 |
+
<option value=\"13\" ".$wpgmza_zoom[13].">13</option>
|
1720 |
+
<option value=\"14\" ".$wpgmza_zoom[14].">14</option>
|
1721 |
+
<option value=\"15\" ".$wpgmza_zoom[15].">15</option>
|
1722 |
+
<option value=\"16\" ".$wpgmza_zoom[16].">16</option>
|
1723 |
+
<option value=\"17\" ".$wpgmza_zoom[17].">17</option>
|
1724 |
+
<option value=\"18\" ".$wpgmza_zoom[18].">18</option>
|
1725 |
+
<option value=\"19\" ".$wpgmza_zoom[19].">19</option>
|
1726 |
+
<option value=\"20\" ".$wpgmza_zoom[20].">20</option>
|
1727 |
+
<option value=\"21\" ".$wpgmza_zoom[21].">21</option>
|
1728 |
+
</select>
|
1729 |
+
<table>
|
1730 |
+
<tr>
|
1731 |
+
<td>".__("Short code","wp-google-maps").":</td>
|
1732 |
+
<td><input type='text' readonly name='shortcode' style='font-size:18px; text-align:center;' onclick=\"this.select()\" value='[wpgmza id=\"".$res->id."\"]' /> <small><i>".__("copy this into your post or page to display the map","wp-google-maps")."</i></td>
|
1733 |
+
</tr>
|
1734 |
+
<tr>
|
1735 |
+
<td>".__("Map Name","wp-google-maps").":</td>
|
1736 |
+
<td><input id='wpgmza_title' name='wpgmza_title' type='text' size='20' maxlength='50' value='".$res->map_title."' /></td>
|
1737 |
+
</tr>
|
1738 |
+
<tr>
|
1739 |
+
<td>".__("Width","wp-google-maps").":</td>
|
1740 |
+
<td>
|
1741 |
+
<input id='wpgmza_width' name='wpgmza_width' type='text' size='4' maxlength='4' value='".$res->map_width."' />
|
1742 |
+
<select id='wpgmza_map_width_type' name='wpgmza_map_width_type'>
|
1743 |
+
<option value=\"px\" $wpgmza_map_width_type_px>px</option>
|
1744 |
+
<option value=\"%\" $wpgmza_map_width_type_percentage>%</option>
|
1745 |
+
</select>
|
1746 |
+
|
1747 |
+
</td>
|
1748 |
+
</tr>
|
1749 |
+
<tr>
|
1750 |
+
<td>".__("Height","wp-google-maps").":</td>
|
1751 |
+
<td><input id='wpgmza_height' name='wpgmza_height' type='text' size='4' maxlength='4' value='".$res->map_height."' />
|
1752 |
+
<select id='wpgmza_map_height_type' name='wpgmza_map_height_type'>
|
1753 |
+
<option value=\"px\" $wpgmza_map_height_type_px>px</option>
|
1754 |
+
<option value=\"%\" $wpgmza_map_height_type_percentage>%</option>
|
1755 |
+
</select>
|
1756 |
+
|
1757 |
+
</td>
|
1758 |
+
</tr>
|
1759 |
+
<tr>
|
1760 |
+
<td>".__("Map Alignment","wp-google-maps").":</td>
|
1761 |
+
<td><select id='wpgmza_map_align' name='wpgmza_map_align'>
|
1762 |
+
<option value=\"1\" ".$wpgmza_map_align[1].">".__("Left","wp-google-maps")."</option>
|
1763 |
+
<option value=\"2\" ".$wpgmza_map_align[2].">".__("Center","wp-google-maps")."</option>
|
1764 |
+
<option value=\"3\" ".$wpgmza_map_align[3].">".__("Right","wp-google-maps")."</option>
|
1765 |
+
<option value=\"4\" ".$wpgmza_map_align[4].">".__("None","wp-google-maps")."</option>
|
1766 |
+
</select>
|
1767 |
+
</td>
|
1768 |
+
</tr>
|
1769 |
+
<tr>
|
1770 |
+
<td>".__("Map type","wp-google-maps").":</td>
|
1771 |
+
<td><select id='wpgmza_map_type' name='wpgmza_map_type'>
|
1772 |
+
<option value=\"1\" ".$wpgmza_map_type[1].">".__("Roadmap","wp-google-maps")."</option>
|
1773 |
+
<option value=\"2\" ".$wpgmza_map_type[2].">".__("Satellite","wp-google-maps")."</option>
|
1774 |
+
<option value=\"3\" ".$wpgmza_map_type[3].">".__("Hybrid","wp-google-maps")."</option>
|
1775 |
+
<option value=\"4\" ".$wpgmza_map_type[4].">".__("Terrain","wp-google-maps")."</option>
|
1776 |
+
</select>
|
1777 |
+
</td>
|
1778 |
+
</tr>
|
|
|
|
|
|
|
1779 |
|
1780 |
+
</table>
|
1781 |
</div>
|
1782 |
+
|
1783 |
<div id=\"tabs-2\">
|
1784 |
+
<div id=\"wpgmaps_save_reminder\" style=\"margin-top:20px;\" class=\"update-nag\" >
|
1785 |
+
".__("Get all of these advanced features with the Pro version for only <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$14.99 once off</a>. Support and updates included forever.","wp-google-maps")."
|
1786 |
+
</div>
|
1787 |
|
1788 |
+
<table class='form-table' id='wpgmaps_advanced_options'>
|
1789 |
+
<tr>
|
1790 |
+
<td>".__("Default Marker Image","wp-google-maps").":</td>
|
1791 |
+
<td><span id=\"wpgmza_mm\">$display_marker</span> <input id=\"upload_default_marker\" name=\"upload_default_marker\" type='hidden' size='35' class='regular-text' maxlength='700' value='".$res->default_marker."' ".$wpgmza_act."/> <input id=\"upload_default_marker_btn\" type=\"button\" value=\"".__("Upload Image","wp-google-maps")."\" $wpgmza_act /> <a href=\"javascript:void(0);\" onClick=\"document.forms['wpgmza_map_form'].upload_default_marker.value = ''; var span = document.getElementById('wpgmza_mm'); while( span.firstChild ) { span.removeChild( span.firstChild ); } span.appendChild( document.createTextNode('')); return false;\" title=\"Reset to default\">-reset-</a></td>
|
1792 |
+
</tr>
|
1793 |
|
1794 |
+
<tr>
|
1795 |
+
<td>".__("List all Markers","wp-google-maps").":</td>
|
1796 |
+
<td>
|
1797 |
+
<input type='checkbox' readonly disabled /> ".__("List all markers below the map","wp-google-maps")."
|
1798 |
+
<br /><input type='checkbox' readonly disabled /> ".__("Select this for the advanced listing functionality","wp-google-maps")."
|
1799 |
|
1800 |
+
</td>
|
1801 |
+
</tr>
|
1802 |
+
<tr>
|
1803 |
+
<td>".__("Filter by Category","wp-google-maps").":</td>
|
1804 |
+
<td>
|
1805 |
+
<input type='checkbox' readonly disabled /> ".__("Allow users to filter by category?","wp-google-maps")."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1806 |
|
1807 |
+
</td>
|
1808 |
+
</tr>
|
1809 |
+
<tr>
|
1810 |
+
<td>".__("Order markers by","wp-google-maps").":</td>
|
1811 |
+
<td>
|
1812 |
+
<select class='postform' disabled readonly>
|
1813 |
+
<option>".__("ID","wp-google-maps")."</option>
|
1814 |
+
<option>".__("Title","wp-google-maps")."</option>
|
1815 |
+
<option>".__("Address","wp-google-maps")."</option>
|
1816 |
+
<option>".__("Description","wp-google-maps")."</option>
|
1817 |
+
</select>
|
1818 |
+
<select class='postform' disabled readonly>
|
1819 |
+
<option>".__("Descending","wp-google-maps")."</option>
|
1820 |
+
<option>".__("Ascending","wp-google-maps")."</option>
|
1821 |
+
</select>
|
1822 |
+
|
1823 |
+
</td>
|
1824 |
+
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1825 |
|
1826 |
+
<tr>
|
1827 |
+
<td>".__("Show User's Location?","wp-google-maps").":</td>
|
1828 |
+
<td><select class='postform' readonly disabled>
|
1829 |
+
<option >".__("No","wp-google-maps")."</option>
|
1830 |
+
<option >".__("Yes","wp-google-maps")."</option>
|
1831 |
+
</select>
|
1832 |
+
</td>
|
1833 |
+
</tr>
|
1834 |
+
<tr>
|
1835 |
+
<td>".__("Enable Directions?","wp-google-maps").":</td>
|
1836 |
+
<td><select class='postform' readonly disabled>
|
1837 |
+
<option>".__("No","wp-google-maps")."</option>
|
1838 |
+
<option>".__("Yes","wp-google-maps")."</option>
|
1839 |
+
</select>
|
1840 |
+
|
1841 |
+
".__("Directions Box Open by Default?","wp-google-maps").":
|
1842 |
+
<select class='postform' readonly disabled>
|
1843 |
+
<option>".__("No","wp-google-maps")."</option>
|
1844 |
+
<option>".__("Yes, on the left","wp-google-maps")."</option>
|
1845 |
+
<option>".__("Yes, on the right","wp-google-maps")."</option>
|
1846 |
+
<option>".__("Yes, above","wp-google-maps")."</option>
|
1847 |
+
<option>".__("Yes, below","wp-google-maps")."</option>
|
1848 |
+
</select>
|
1849 |
+
|
1850 |
+
".__("Directions Box Width","wp-google-maps").":
|
1851 |
+
<input type='text' size='4' maxlength='4' class='small-text' readonly disabled /> px
|
1852 |
+
</td>
|
1853 |
+
</tr>
|
1854 |
+
<tr>
|
1855 |
+
<td>".__("Enable Bicycle Layer?","wp-google-maps").":</td>
|
1856 |
+
<td><select class='postform' readonly disabled>
|
1857 |
+
<option >".__("No","wp-google-maps")."</option>
|
1858 |
+
<option >".__("Yes","wp-google-maps")."</option>
|
1859 |
+
</select>
|
1860 |
+
|
1861 |
+
|
1862 |
+
|
1863 |
+
".__("Enable Traffic Layer?","wp-google-maps").":
|
1864 |
+
<select class='postform' readonly disabled>
|
1865 |
+
<option >".__("No","wp-google-maps")."</option>
|
1866 |
+
<option >".__("Yes","wp-google-maps")."</option>
|
1867 |
+
</select></td>
|
1868 |
+
</tr>
|
1869 |
+
<tr>
|
1870 |
|
1871 |
+
</tr>
|
1872 |
+
<tr>
|
1873 |
+
<td></td>
|
1874 |
+
</tr>
|
1875 |
+
<tr>
|
1876 |
+
<td>".__("KML/GeoRSS URL","wp-google-maps").":</td>
|
1877 |
+
<td>
|
1878 |
+
<input type='text' size='100' maxlength='700' class='regular-text' readonly disabled /> <em><small>".__("The KML/GeoRSS layer will over-ride most of your map settings","wp-google-maps")."</small></em></td>
|
1879 |
+
</td>
|
1880 |
+
</tr>
|
1881 |
+
<tr>
|
1882 |
+
<td>".__("Fusion table ID","wp-google-maps").":</td>
|
1883 |
+
<td>
|
1884 |
+
<input type='text' size='20' maxlength='200' class='small-text' readonly disabled /> <em><small>".__("Read data directly from your Fusion Table.","wp-google-maps")."</small></em></td>
|
1885 |
+
</td>
|
1886 |
+
</tr>
|
1887 |
+
</table>
|
1888 |
+
</div><!-- end of tab2 -->
|
1889 |
|
1890 |
+
</div><!-- end of tabs -->
|
1891 |
|
1892 |
+
<div id=\"wpgmaps_save_reminder\" style=\"display:none;\">
|
1893 |
+
<span style=\"font-size:16px; color:#1C62B9;\">
|
1894 |
+
".__("Remember to save your map!","wp-google-maps")."
|
1895 |
+
</span>
|
1896 |
+
</div>
|
|
|
1897 |
|
1898 |
<p class='submit'><input type='submit' name='wpgmza_savemap' class='button-primary' value='".__("Save Map","wp-google-maps")." »' /></p>
|
1899 |
<p style=\"width:600px; color:#808080;\">
|
1914 |
<li><a href=\"#tabs-m-3\" class=\"tabs-m-3\">".__("Polylines","wp-google-maps")."</a></li>
|
1915 |
</ul>
|
1916 |
<div id=\"tabs-m-1\">
|
1917 |
+
|
1918 |
|
1919 |
|
1920 |
<h2 style=\"padding-top:0; margin-top:0;\">".__("Add a marker","wp-google-maps")."</h2>
|
1940 |
<td><input id='wpgmza_link_url' name='wpgmza_link_url' type='text' size='35' maxlength='700' value='' ".$wpgmza_act." /></td></tr>
|
1941 |
<tr><td>".__("Custom Marker","wp-google-maps").": </td>
|
1942 |
<td><input id='wpgmza_add_custom_marker' name=\"wpgmza_add_custom_marker\" type='hidden' size='35' maxlength='700' value='' ".$wpgmza_act."/> <input id=\"upload_custom_marker_button\" type=\"button\" value=\"".__("Upload Image","wp-google-maps")."\" $wpgmza_act /> </td></tr>
|
1943 |
+
<tr>
|
1944 |
+
<td>".__("Category","wp-google-maps").": </td>
|
1945 |
+
<td>
|
1946 |
+
<select readonly disabled>
|
1947 |
+
<option value=\"0\">".__("Select","wp-google-maps")."</option>
|
1948 |
+
</td>
|
1949 |
+
</tr>
|
1950 |
<tr>
|
1951 |
<td>".__("Animation","wp-google-maps").": </td>
|
1952 |
<td>
|
1971 |
".wpgmza_return_marker_list($_GET['map_id'])."
|
1972 |
</div>
|
1973 |
<br /><br />$wpgmza_csv
|
1974 |
+
</div>
|
1975 |
+
|
1976 |
+
<div id=\"tabs-m-2\">
|
1977 |
<h2 style=\"padding-top:0; margin-top:0;\">".__("Add a Polygon","wp-google-maps")."</h2>
|
1978 |
<table>
|
1979 |
<tr>
|
1981 |
<td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">".__("Add Polygons to your maps for only","wp-google-maps")." <strong>$14.99</strong>. ".__("Click","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=polygon\" title=\"Pro Edition\" target=\"_BLANK\">".__("here","wp-google-maps")."</a></span></td>
|
1982 |
</tr>
|
1983 |
</table>
|
1984 |
+
</div>
|
1985 |
+
<div id=\"tabs-m-3\">
|
1986 |
<h2 style=\"padding-top:0; margin-top:0;\">".__("Add a Polyline","wp-google-maps")."</h2>
|
1987 |
<table>
|
1988 |
<tr>
|
1990 |
<td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">".__("Add Polyline and routes to your maps for only","wp-google-maps")." <strong>$14.99</strong>. ".__("Click","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=polyline\" title=\"Pro Edition\" target=\"_BLANK\">".__("here","wp-google-maps")."</a></span></td>
|
1991 |
</tr>
|
1992 |
</table>
|
1993 |
+
</div>
|
1994 |
</div>
|
|
|
1995 |
|
1996 |
|
1997 |
|
2087 |
|
2088 |
|
2089 |
function wpgmaps_admin_scripts() {
|
2090 |
+
wp_enqueue_script( 'jquery' );
|
2091 |
+
wp_enqueue_script('jquery-ui-core');
|
2092 |
+
|
2093 |
+
if (function_exists('wp_enqueue_media')) {
|
2094 |
+
wp_enqueue_media();
|
2095 |
+
wp_register_script('my-wpgmaps-upload', plugins_url('js/media.js', __FILE__), array('jquery'), '1.0', true);
|
2096 |
+
wp_enqueue_script('my-wpgmaps-upload');
|
2097 |
+
} else {
|
2098 |
+
wp_enqueue_script('media-upload');
|
2099 |
+
wp_enqueue_script('thickbox');
|
2100 |
+
wp_register_script('my-wpgmaps-upload', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/upload.js', array('jquery','media-upload','thickbox'));
|
2101 |
+
wp_enqueue_script('my-wpgmaps-upload');
|
2102 |
+
}
|
2103 |
+
|
2104 |
+
|
2105 |
if ($_GET['action'] == "add_poly" || $_GET['action'] == "edit_poly" || $_GET['action'] == "add_polyline" || $_GET['action'] == "edit_polyline") {
|
2106 |
wp_register_script('my-wpgmaps-color', plugins_url('js/jscolor.js',__FILE__), false, '1.4.1', false);
|
2107 |
wp_enqueue_script('my-wpgmaps-color');
|
2110 |
wp_enqueue_script( 'jquery-ui-tabs');
|
2111 |
wp_register_script('my-wpgmaps-tabs', plugins_url('js/wpgmaps_tabs.js',__FILE__), array('jquery-ui-core'), '1.0.1', true);
|
2112 |
wp_enqueue_script('my-wpgmaps-tabs');
|
2113 |
+
}
|
2114 |
}
|
2115 |
function wpgmaps_user_styles() {
|
2116 |
wp_register_style( 'wpgmaps-style', plugins_url('css/wpgmza_style.css', __FILE__) );
|
2117 |
wp_enqueue_style( 'wpgmaps-style' );
|
2118 |
+
|
2119 |
+
|
2120 |
}
|
2121 |
|
2122 |
function wpgmaps_admin_styles() {
|
2123 |
+
wp_enqueue_style('thickbox');
|
2124 |
|
2125 |
}
|
2126 |
|
2128 |
add_action('admin_print_scripts', 'wpgmaps_admin_scripts');
|
2129 |
add_action('admin_print_styles', 'wpgmaps_admin_styles');
|
2130 |
}
|
2131 |
+
add_action('wp_print_styles', 'wpgmaps_user_styles');
|
|
|
2132 |
|
2133 |
|
2134 |
+
function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%",$mashup = false,$mashup_ids = false) {
|
2135 |
|
|
|
2136 |
global $wpdb;
|
2137 |
global $wpgmza_tblname;
|
2138 |
|
2139 |
+
if ($mashup) {
|
2140 |
+
// map mashup
|
2141 |
+
$map_ids = $mashup_ids;
|
2142 |
+
$wpgmza_cnt = 0;
|
2143 |
+
|
2144 |
+
if ($mashup_ids[0] == "ALL") {
|
2145 |
+
|
2146 |
+
$wpgmza_sql1 = "
|
2147 |
+
SELECT *
|
2148 |
+
FROM $wpgmza_tblname
|
2149 |
+
ORDER BY `id` DESC
|
2150 |
+
";
|
2151 |
+
}
|
2152 |
+
else {
|
2153 |
+
$wpgmza_id_cnt = count($map_ids);
|
2154 |
+
$sql_string1 = "";
|
2155 |
+
foreach ($map_ids as $wpgmza_map_id) {
|
2156 |
+
$wpgmza_cnt++;
|
2157 |
+
if ($wpgmza_cnt == 1) { $sql_string1 .= "`map_id` = '$wpgmza_map_id' "; }
|
2158 |
+
elseif ($wpgmza_cnt > 1 && $wpgmza_cnt < $wpgmza_id_cnt) { $sql_string1 .= "OR `map_id` = '$wpgmza_map_id' "; }
|
2159 |
+
else { $sql_string1 .= "OR `map_id` = '$wpgmza_map_id' "; }
|
2160 |
+
|
2161 |
+
}
|
2162 |
+
$wpgmza_sql1 = "
|
2163 |
+
SELECT *
|
2164 |
+
FROM $wpgmza_tblname
|
2165 |
+
WHERE $sql_string1 ORDER BY `id` DESC
|
2166 |
+
";
|
2167 |
+
}
|
2168 |
+
|
2169 |
+
} else {
|
2170 |
+
$wpgmza_sql1 = "
|
2171 |
+
SELECT *
|
2172 |
+
FROM $wpgmza_tblname
|
2173 |
+
WHERE `map_id` = '$map_id' ORDER BY `id` DESC
|
2174 |
+
";
|
2175 |
+
}
|
2176 |
+
|
2177 |
$marker_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpgmza_tblname WHERE `map_id` = '$map_id';" ) );
|
2178 |
if ($marker_count > 2000) {
|
2179 |
+
return __("There are too many markers to make use of the live edit function. The maximum amount for this functionality is 2000 markers. Anything more than that could crash your browser. In order to edit your markers, you would need to download the table in CSV format, edit it and re-upload it.","wp-google-maps");
|
2180 |
} else {
|
2181 |
|
2182 |
|
2183 |
+
$results = $wpdb->get_results($wpgmza_sql1);
|
2184 |
+
if ($admin) {
|
2185 |
+
$wpgmza_tmp .= "
|
|
|
|
|
|
|
|
|
|
|
2186 |
<table id=\"wpgmza_table\" class=\"display\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:$width;\">
|
2187 |
<thead>
|
2188 |
<tr>
|
2189 |
<th><strong>".__("ID","wp-google-maps")."</strong></th>
|
2190 |
<th><strong>".__("Icon","wp-google-maps")."</strong></th>
|
2191 |
<th><strong>".__("Title","wp-google-maps")."</strong></th>
|
2192 |
+
<th><strong>".__("Category","wp-google-maps")."</strong></th>
|
2193 |
<th><strong>".__("Address","wp-google-maps")."</strong></th>
|
2194 |
<th><strong>".__("Description","wp-google-maps")."</strong></th>
|
2195 |
<th><strong>".__("Image","wp-google-maps")."</strong></th>
|
2199 |
</thead>
|
2200 |
<tbody>
|
2201 |
";
|
2202 |
+
} else {
|
2203 |
+
$wpgmza_tmp .= "
|
2204 |
<div id=\"wpgmza_marker_holder_".$map_id."\">
|
2205 |
<table id=\"wpgmza_table_".$map_id."\" class=\"wpgmza_table\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:$width;\">
|
2206 |
<thead>
|
2208 |
<th></th>
|
2209 |
<th class='wpgmza_table_marker'><strong></strong></th>
|
2210 |
<th class='wpgmza_table_title'><strong>".__("Title","wp-google-maps")."</strong></th>
|
2211 |
+
<th class='wpgmza_table_category'><strong>".__("Category","wp-google-maps")."</strong></th>
|
2212 |
<th class='wpgmza_table_address'><strong>".__("Address","wp-google-maps")."</strong></th>
|
2213 |
<th class='wpgmza_table_description'><strong>".__("Description","wp-google-maps")."</strong></th>
|
2214 |
</tr>
|
2215 |
</thead>
|
2216 |
<tbody>
|
2217 |
";
|
2218 |
+
}
|
2219 |
|
2220 |
$res = wpgmza_get_map_data($map_id);
|
2221 |
+
if (!$res->default_marker) {
|
2222 |
+
$default_marker = "<img src='".wpgmaps_get_plugin_url()."/images/marker.png' />";
|
2223 |
+
} else {
|
2224 |
+
$default_marker = "<img src='".$res->default_marker."' />";
|
2225 |
+
}
|
2226 |
|
2227 |
+
foreach ( $results as $result ) {
|
2228 |
+
$img = $result->pic;
|
2229 |
+
$link = $result->link;
|
2230 |
+
$icon = $result->icon;
|
2231 |
|
2232 |
+
if (!$img) { $pic = ""; } else { $pic = "<img src=\"".$result->pic."\" width=\"40\" />"; }
|
2233 |
+
if (!$icon) { $icon = $default_marker; } else { $icon = "<img src='".$result->icon."' />"; }
|
2234 |
+
if (!$link) { $linktd = ""; } else { $linktd = "<a href=\"".$result->link."\" target=\"_BLANK\" title=\"".__("View this link","wp-google-maps")."\">>></a>"; }
|
2235 |
+
|
2236 |
+
if ($admin) {
|
2237 |
+
$wpgmza_tmp .= "
|
2238 |
<tr id=\"wpgmza_tr_".$result->id."\">
|
2239 |
<td height=\"40\">".$result->id."</td>
|
2240 |
+
<td height=\"40\">".$icon."<input type=\"hidden\" id=\"wpgmza_hid_marker_icon_".$result->id."\" value=\"".$result->icon."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_anim_".$result->id."\" value=\"".$result->anim."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_category_".$result->id."\" value=\"".$result->category."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_infoopen_".$result->id."\" value=\"".$result->infoopen."\" /></td>
|
2241 |
<td>".$result->title."<input type=\"hidden\" id=\"wpgmza_hid_marker_title_".$result->id."\" value=\"".$result->title."\" /></td>
|
2242 |
+
<td>".wpgmza_return_category_name($result->category)."<input type=\"hidden\" id=\"wpgmza_hid_marker_category_".$result->id."\" value=\"".$result->category."\" /></td>
|
2243 |
<td>".$result->address."<input type=\"hidden\" id=\"wpgmza_hid_marker_address_".$result->id."\" value=\"".$result->address."\" /></td>
|
2244 |
<td>".$result->description."<input type=\"hidden\" id=\"wpgmza_hid_marker_desc_".$result->id."\" value=\"".$result->description."\" /></td>
|
2245 |
<td>$pic<input type=\"hidden\" id=\"wpgmza_hid_marker_pic_".$result->id."\" value=\"".$result->pic."\" /></td>
|
2250 |
<a href=\"javascript:void(0);\" title=\"".__("Delete this marker","wp-google-maps")."\" class=\"wpgmza_del_btn\" id=\"".$result->id."\">".__("Delete","wp-google-maps")."</a>
|
2251 |
</td>
|
2252 |
</tr>";
|
2253 |
+
} else {
|
2254 |
+
$wpgmza_tmp .= "
|
2255 |
<tr id=\"wpgmza_marker_".$result->id."\" mid=\"".$result->id."\" mapid=\"".$result->map_id."\" class=\"wpgmaps_mlist_row\">
|
2256 |
<td><span style='display:none;'>".sprintf('%02d', $result->id)."</span></td>
|
2257 |
+
<td height=\"40\">".$icon."</td>
|
2258 |
<td>".$result->title."</td>
|
2259 |
+
<td>".wpgmza_return_category_name($result->category)."</td>
|
2260 |
<td>".$result->address."</td>
|
2261 |
<td>".$result->description."</td>
|
2262 |
</tr>";
|
2263 |
+
}
|
2264 |
+
}
|
2265 |
+
if ($admin) {
|
2266 |
+
$wpgmza_tmp .= "</tbody></table>";
|
2267 |
+
} else {
|
2268 |
+
$wpgmza_tmp .= "</tbody></table></div>";
|
2269 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2270 |
|
2271 |
+
return $wpgmza_tmp;
|
2272 |
}
|
2273 |
}
|
2274 |
|
2275 |
+
function wpgmza_return_category_name($cid) {
|
2276 |
+
|
2277 |
+
global $wpdb;
|
2278 |
+
global $wpgmza_tblname_categories;
|
2279 |
+
$results = $wpdb->get_results("SELECT * FROM `$wpgmza_tblname_categories` WHERE `id` = '$cid' LIMIT 1");
|
2280 |
+
foreach ( $results as $result ) {
|
2281 |
+
return $result->category_name;
|
2282 |
+
}
|
2283 |
+
|
2284 |
|
2285 |
+
}
|
2286 |
|
2287 |
|
2288 |
function wpgmaps_chmodr($path, $filemode) {
|
2296 |
if(is_link($fullpath))
|
2297 |
return FALSE;
|
2298 |
elseif(!is_dir($fullpath) && !chmod($fullpath, $filemode))
|
2299 |
+
return FALSE;
|
2300 |
elseif(!wpgmaps_chmodr($fullpath, $filemode))
|
2301 |
return FALSE;
|
2302 |
}
|
2352 |
global $posts;
|
2353 |
global $short_code_active;
|
2354 |
$short_code_active = false;
|
2355 |
+
$pattern = get_shortcode_regex();
|
2356 |
|
2357 |
+
foreach ($posts as $wpgmpost) {
|
2358 |
+
preg_match_all('/'.$pattern.'/s', $wpgmpost->post_content, $matches);
|
2359 |
+
foreach ($matches as $match) {
|
2360 |
if (is_array($match)) {
|
2361 |
foreach($match as $key => $val) {
|
2362 |
$pos = strpos($val, "wpgmza");
|
2363 |
if ($pos === false) { } else { $short_code_active = true; }
|
2364 |
}
|
2365 |
}
|
2366 |
+
}
|
2367 |
+
}
|
2368 |
}
|
2369 |
|
2370 |
function wpgmaps_check_permissions() {
|
2416 |
|
2417 |
|
2418 |
function wpgmaps_handle_db() {
|
2419 |
+
global $wpdb;
|
2420 |
+
global $wpgmza_version;
|
2421 |
+
global $wpgmza_tblname_poly;
|
2422 |
+
global $wpgmza_tblname_polylines;
|
2423 |
+
global $wpgmza_tblname_categories;
|
2424 |
+
global $wpgmza_tblname;
|
|
|
|
|
2425 |
|
2426 |
+
$table_name = $wpdb->prefix . "wpgmza";
|
2427 |
|
2428 |
// check for previous versions containing 'desc' instead of 'description'
|
2429 |
$results = $wpdb->get_results("DESC $wpgmza_tblname");
|
2430 |
+
$founded = 0;
|
2431 |
foreach ($results as $row ) {
|
2432 |
if ($row->Field == "desc") {
|
2433 |
+
$founded++;
|
2434 |
}
|
2435 |
}
|
2436 |
+
if ($founded>0) { $wpdb->query("ALTER TABLE $wpgmza_tblname CHANGE `desc` `description` MEDIUMTEXT"); }
|
|
|
|
|
|
|
|
|
|
|
|
|
2437 |
// end check
|
2438 |
+
|
2439 |
+
|
2440 |
+
|
2441 |
$sql = "
|
2442 |
CREATE TABLE `".$table_name."` (
|
2443 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
2452 |
`anim` varchar(3) NOT NULL,
|
2453 |
`title` varchar(700) NOT NULL,
|
2454 |
`infoopen` varchar(3) NOT NULL,
|
2455 |
+
`category` int(11) NOT NULL,
|
2456 |
PRIMARY KEY (`id`)
|
2457 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
2458 |
";
|
2459 |
|
2460 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
2461 |
+
dbDelta($sql);
|
2462 |
+
|
2463 |
+
|
2464 |
|
2465 |
+
$sql = "
|
|
|
|
|
2466 |
CREATE TABLE `".$wpgmza_tblname_poly."` (
|
2467 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
2468 |
`map_id` int(11) NOT NULL,
|
2474 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
2475 |
";
|
2476 |
|
2477 |
+
dbDelta($sql);
|
2478 |
+
|
2479 |
|
|
|
2480 |
$sql = "
|
2481 |
CREATE TABLE `".$wpgmza_tblname_polylines."` (
|
2482 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
2489 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
2490 |
";
|
2491 |
|
2492 |
+
dbDelta($sql);
|
2493 |
+
|
2494 |
+
|
2495 |
+
$sql = "
|
2496 |
+
CREATE TABLE `".$wpgmza_tblname_categories."` (
|
2497 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
2498 |
+
`active` TINYINT(1) NOT NULL,
|
2499 |
+
`category_name` VARCHAR(50) NOT NULL,
|
2500 |
+
`category_icon` VARCHAR(700) NOT NULL,
|
2501 |
+
PRIMARY KEY (`id`)
|
2502 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
2503 |
+
";
|
2504 |
+
|
2505 |
+
dbDelta($sql);
|
2506 |
+
|
2507 |
+
|
2508 |
$table_name = $wpdb->prefix . "wpgmza_maps";
|
2509 |
$sql = "
|
2510 |
CREATE TABLE `".$table_name."` (
|
2530 |
`dbox_width` varchar(10) NOT NULL,
|
2531 |
`listmarkers` INT(10) NOT NULL,
|
2532 |
`listmarkers_advanced` INT(10) NOT NULL,
|
2533 |
+
`filterbycat` TINYINT(1) NOT NULL,
|
2534 |
`ugm_enabled` INT(10) NOT NULL,
|
2535 |
`fusion` VARCHAR(100) NOT NULL,
|
2536 |
`map_width_type` VARCHAR(3) NOT NULL,
|
2544 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
2545 |
";
|
2546 |
|
2547 |
+
dbDelta($sql);
|
2548 |
|
2549 |
|
2550 |
|
2551 |
+
add_option("wpgmza_db_version", $wpgmza_version);
|
2552 |
+
update_option("wpgmza_db_version",$wpgmza_version);
|
2553 |
}
|
2554 |
|
2555 |
function wpgmza_get_map_data($map_id) {
|
2561 |
FROM $wpgmza_tblname_maps
|
2562 |
WHERE `id` = '".$map_id."' LIMIT 1
|
2563 |
");
|
2564 |
+
|
2565 |
$res = $result[0];
|
2566 |
+
|
2567 |
return $result[0];
|
2568 |
|
2569 |
}
|
2584 |
function wpgmaps_upgrade_notice() {
|
2585 |
global $wpgmza_pro_version;
|
2586 |
echo "<div class='error below-h1'>
|
2587 |
+
|
2588 |
<p>Dear Pro User<br /></p>
|
2589 |
|
2590 |
<p>We have recently added new functionality to the Pro version of this plugin. You are currently using the latest
|
2591 |
Basic version which needs the latest Pro version for all functionality to work. Your current Pro version is
|
2592 |
+
$wpgmza_pro_version - The latest Pro version is 4.13<br /></p>
|
2593 |
+
|
2594 |
+
<p>You should be able to update your Pro version the same way you <a href='update-core.php'>update all other WordPress plugins</a>. </p>
|
2595 |
+
<p>If you run into any problems, please <a href='mailto:nick@wpgmaps.com'>contact me</a>.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2596 |
|
2597 |
<p>Kind regards,<br /><a href='http://www.wpgmaps.com/'>WP Google Maps</a></p>
|
2598 |
+
|
2599 |
</div>";
|
2600 |
}
|
2601 |
function wpgmaps_trash_map($map_id) {
|
2640 |
|
2641 |
function wpgmaps_load_jquery() {
|
2642 |
if (!is_admin()) {
|
2643 |
+
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
|
2644 |
+
if ($wpgmza_settings['wpgmza_settings_force_jquery'] == "yes") {
|
2645 |
+
wp_deregister_script('jquery');
|
2646 |
+
wp_register_script('jquery', plugins_url("js/jquery.min.js",__FILE__), false, "1.8.3");
|
2647 |
+
}
|
2648 |
wp_enqueue_script('jquery');
|
2649 |
}
|
2650 |
}
|