@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function gd_compat_styles() |
19 | 19 | { |
20 | - $tc = get_option('theme_compatibility_setting'); |
|
21 | - echo "<style id='gd-compat-styles' type='text/css'>"; |
|
22 | - echo $tc['geodir_theme_compat_css']; |
|
23 | - echo "</style>"; |
|
20 | + $tc = get_option('theme_compatibility_setting'); |
|
21 | + echo "<style id='gd-compat-styles' type='text/css'>"; |
|
22 | + echo $tc['geodir_theme_compat_css']; |
|
23 | + echo "</style>"; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | */ |
32 | 32 | function gd_compat_script() |
33 | 33 | { |
34 | - $tc = get_option('theme_compatibility_setting'); |
|
35 | - echo "<script>"; |
|
36 | - echo $tc['geodir_theme_compat_js']; |
|
37 | - echo " </script>"; |
|
34 | + $tc = get_option('theme_compatibility_setting'); |
|
35 | + echo "<script>"; |
|
36 | + echo $tc['geodir_theme_compat_js']; |
|
37 | + echo " </script>"; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | */ |
48 | 48 | function geodir_top_content_add_dynamic() |
49 | 49 | { |
50 | - $tc = get_option('theme_compatibility_setting'); |
|
51 | - echo $tc['geodir_top_content_add']; |
|
50 | + $tc = get_option('theme_compatibility_setting'); |
|
51 | + echo $tc['geodir_top_content_add']; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | */ |
62 | 62 | function geodir_before_main_content_add_dynamic() |
63 | 63 | { |
64 | - $tc = get_option('theme_compatibility_setting'); |
|
65 | - echo $tc['geodir_before_main_content_add']; |
|
64 | + $tc = get_option('theme_compatibility_setting'); |
|
65 | + echo $tc['geodir_before_main_content_add']; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | */ |
76 | 76 | function geodir_full_page_class_dynamic() |
77 | 77 | { |
78 | - $tc = get_option('theme_compatibility_setting'); |
|
79 | - return $tc['geodir_full_page_class_filter']; |
|
78 | + $tc = get_option('theme_compatibility_setting'); |
|
79 | + return $tc['geodir_full_page_class_filter']; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | */ |
90 | 90 | function geodir_before_widget_dynamic() |
91 | 91 | { |
92 | - $tc = get_option('theme_compatibility_setting'); |
|
93 | - return $tc['geodir_before_widget_filter']; |
|
92 | + $tc = get_option('theme_compatibility_setting'); |
|
93 | + return $tc['geodir_before_widget_filter']; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | */ |
104 | 104 | function geodir_after_widget_dynamic() |
105 | 105 | { |
106 | - $tc = get_option('theme_compatibility_setting'); |
|
107 | - return $tc['geodir_after_widget_filter']; |
|
106 | + $tc = get_option('theme_compatibility_setting'); |
|
107 | + return $tc['geodir_after_widget_filter']; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | */ |
118 | 118 | function geodir_before_title_dynamic() |
119 | 119 | { |
120 | - $tc = get_option('theme_compatibility_setting'); |
|
121 | - return $tc['geodir_before_title_filter']; |
|
120 | + $tc = get_option('theme_compatibility_setting'); |
|
121 | + return $tc['geodir_before_title_filter']; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | */ |
132 | 132 | function geodir_after_title_dynamic() |
133 | 133 | { |
134 | - $tc = get_option('theme_compatibility_setting'); |
|
135 | - return $tc['geodir_after_title_filter']; |
|
134 | + $tc = get_option('theme_compatibility_setting'); |
|
135 | + return $tc['geodir_after_title_filter']; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | */ |
146 | 146 | function geodir_menu_li_class_dynamic() |
147 | 147 | { |
148 | - $tc = get_option('theme_compatibility_setting'); |
|
149 | - return $tc['geodir_menu_li_class_filter']; |
|
148 | + $tc = get_option('theme_compatibility_setting'); |
|
149 | + return $tc['geodir_menu_li_class_filter']; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | */ |
160 | 160 | function geodir_sub_menu_ul_class_dynamic() |
161 | 161 | { |
162 | - $tc = get_option('theme_compatibility_setting'); |
|
163 | - return $tc['geodir_sub_menu_ul_class_filter']; |
|
162 | + $tc = get_option('theme_compatibility_setting'); |
|
163 | + return $tc['geodir_sub_menu_ul_class_filter']; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | */ |
174 | 174 | function geodir_sub_menu_li_class_dynamic() |
175 | 175 | { |
176 | - $tc = get_option('theme_compatibility_setting'); |
|
177 | - return $tc['geodir_sub_menu_li_class_filter']; |
|
176 | + $tc = get_option('theme_compatibility_setting'); |
|
177 | + return $tc['geodir_sub_menu_li_class_filter']; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | */ |
188 | 188 | function geodir_menu_a_class_dynamic() |
189 | 189 | { |
190 | - $tc = get_option('theme_compatibility_setting'); |
|
191 | - return $tc['geodir_menu_a_class_filter']; |
|
190 | + $tc = get_option('theme_compatibility_setting'); |
|
191 | + return $tc['geodir_menu_a_class_filter']; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | */ |
202 | 202 | function geodir_sub_menu_a_class_dynamic() |
203 | 203 | { |
204 | - $tc = get_option('theme_compatibility_setting'); |
|
205 | - return $tc['geodir_sub_menu_a_class_filter']; |
|
204 | + $tc = get_option('theme_compatibility_setting'); |
|
205 | + return $tc['geodir_sub_menu_a_class_filter']; |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | /** |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | */ |
216 | 216 | function geodir_location_switcher_menu_li_class_dynamic() |
217 | 217 | { |
218 | - $tc = get_option('theme_compatibility_setting'); |
|
219 | - return $tc['geodir_location_switcher_menu_li_class_filter']; |
|
218 | + $tc = get_option('theme_compatibility_setting'); |
|
219 | + return $tc['geodir_location_switcher_menu_li_class_filter']; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
@@ -229,8 +229,8 @@ discard block |
||
229 | 229 | */ |
230 | 230 | function geodir_location_switcher_menu_a_class_dynamic() |
231 | 231 | { |
232 | - $tc = get_option('theme_compatibility_setting'); |
|
233 | - return $tc['geodir_location_switcher_menu_a_class_filter']; |
|
232 | + $tc = get_option('theme_compatibility_setting'); |
|
233 | + return $tc['geodir_location_switcher_menu_a_class_filter']; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | /** |
@@ -243,8 +243,8 @@ discard block |
||
243 | 243 | */ |
244 | 244 | function geodir_location_switcher_menu_sub_ul_class_dynamic() |
245 | 245 | { |
246 | - $tc = get_option('theme_compatibility_setting'); |
|
247 | - return $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
246 | + $tc = get_option('theme_compatibility_setting'); |
|
247 | + return $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | */ |
258 | 258 | function geodir_location_switcher_menu_sub_li_class_dynamic() |
259 | 259 | { |
260 | - $tc = get_option('theme_compatibility_setting'); |
|
261 | - return $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
260 | + $tc = get_option('theme_compatibility_setting'); |
|
261 | + return $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | |
@@ -275,107 +275,107 @@ discard block |
||
275 | 275 | function geodir_content_actions_dynamic() |
276 | 276 | { |
277 | 277 | |
278 | - $tc = get_option('theme_compatibility_setting'); |
|
278 | + $tc = get_option('theme_compatibility_setting'); |
|
279 | 279 | //print_r($tc); |
280 | - if (empty($tc)) { |
|
281 | - return; |
|
282 | - } |
|
283 | - |
|
284 | - //php |
|
285 | - if (!empty($tc['geodir_theme_compat_code'])) { |
|
286 | - include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php'); |
|
287 | - } |
|
288 | - |
|
289 | - //geodir_full_page_class |
|
290 | - if (!empty($tc['geodir_full_page_class_filter'])) { |
|
291 | - add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10); |
|
292 | - } |
|
293 | - |
|
294 | - //widget before filter |
|
295 | - if (!empty($tc['geodir_before_widget_filter'])) { |
|
296 | - add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10); |
|
297 | - } |
|
298 | - |
|
299 | - //widget after filter |
|
300 | - if (!empty($tc['geodir_after_widget_filter'])) { |
|
301 | - add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10); |
|
302 | - } |
|
303 | - |
|
304 | - //widget before title filter |
|
305 | - if (!empty($tc['geodir_before_title_filter'])) { |
|
306 | - add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10); |
|
307 | - } |
|
308 | - |
|
309 | - //widget before title filter |
|
310 | - if (!empty($tc['geodir_after_title_filter'])) { |
|
311 | - add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10); |
|
312 | - } |
|
313 | - |
|
314 | - //menu li class |
|
315 | - if (!empty($tc['geodir_menu_li_class_filter'])) { |
|
316 | - add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10); |
|
317 | - } |
|
318 | - |
|
319 | - //menu ul class |
|
320 | - if (!empty($tc['geodir_sub_menu_ul_class_filter'])) { |
|
321 | - add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10); |
|
322 | - } |
|
323 | - |
|
324 | - //menu sub li class |
|
325 | - if (!empty($tc['geodir_sub_menu_li_class_filter'])) { |
|
326 | - add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10); |
|
327 | - } |
|
328 | - |
|
329 | - //menu a class |
|
330 | - if (!empty($tc['geodir_menu_a_class_filter'])) { |
|
331 | - add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10); |
|
332 | - } |
|
333 | - |
|
334 | - //menu sub a class |
|
335 | - if (!empty($tc['geodir_sub_menu_a_class_filter'])) { |
|
336 | - add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10); |
|
337 | - } |
|
338 | - |
|
339 | - //location menu li class |
|
340 | - if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) { |
|
341 | - add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10); |
|
342 | - } |
|
343 | - |
|
344 | - //location menu sub ul class |
|
345 | - if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) { |
|
346 | - add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10); |
|
347 | - } |
|
348 | - |
|
349 | - //location menu sub li class |
|
350 | - if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) { |
|
351 | - add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10); |
|
352 | - } |
|
353 | - |
|
354 | - //location menu a class |
|
355 | - if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) { |
|
356 | - add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10); |
|
357 | - } |
|
358 | - |
|
359 | - // compat styles |
|
360 | - if (!empty($tc['geodir_theme_compat_css'])) { |
|
361 | - add_action('wp_head', 'gd_compat_styles'); |
|
362 | - } |
|
363 | - |
|
364 | - // compat js |
|
365 | - if (!empty($tc['geodir_theme_compat_js'])) { |
|
366 | - add_action('wp_footer', 'gd_compat_script'); |
|
367 | - } |
|
368 | - |
|
369 | - |
|
370 | - // geodir_top_content_add |
|
371 | - if (!empty($tc['geodir_top_content_add'])) { |
|
372 | - add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1); |
|
373 | - } |
|
374 | - |
|
375 | - // geodir_before_main_content_add |
|
376 | - if (!empty($tc['geodir_before_main_content_add'])) { |
|
377 | - add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1); |
|
378 | - } |
|
280 | + if (empty($tc)) { |
|
281 | + return; |
|
282 | + } |
|
283 | + |
|
284 | + //php |
|
285 | + if (!empty($tc['geodir_theme_compat_code'])) { |
|
286 | + include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php'); |
|
287 | + } |
|
288 | + |
|
289 | + //geodir_full_page_class |
|
290 | + if (!empty($tc['geodir_full_page_class_filter'])) { |
|
291 | + add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10); |
|
292 | + } |
|
293 | + |
|
294 | + //widget before filter |
|
295 | + if (!empty($tc['geodir_before_widget_filter'])) { |
|
296 | + add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10); |
|
297 | + } |
|
298 | + |
|
299 | + //widget after filter |
|
300 | + if (!empty($tc['geodir_after_widget_filter'])) { |
|
301 | + add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10); |
|
302 | + } |
|
303 | + |
|
304 | + //widget before title filter |
|
305 | + if (!empty($tc['geodir_before_title_filter'])) { |
|
306 | + add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10); |
|
307 | + } |
|
308 | + |
|
309 | + //widget before title filter |
|
310 | + if (!empty($tc['geodir_after_title_filter'])) { |
|
311 | + add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10); |
|
312 | + } |
|
313 | + |
|
314 | + //menu li class |
|
315 | + if (!empty($tc['geodir_menu_li_class_filter'])) { |
|
316 | + add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10); |
|
317 | + } |
|
318 | + |
|
319 | + //menu ul class |
|
320 | + if (!empty($tc['geodir_sub_menu_ul_class_filter'])) { |
|
321 | + add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10); |
|
322 | + } |
|
323 | + |
|
324 | + //menu sub li class |
|
325 | + if (!empty($tc['geodir_sub_menu_li_class_filter'])) { |
|
326 | + add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10); |
|
327 | + } |
|
328 | + |
|
329 | + //menu a class |
|
330 | + if (!empty($tc['geodir_menu_a_class_filter'])) { |
|
331 | + add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10); |
|
332 | + } |
|
333 | + |
|
334 | + //menu sub a class |
|
335 | + if (!empty($tc['geodir_sub_menu_a_class_filter'])) { |
|
336 | + add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10); |
|
337 | + } |
|
338 | + |
|
339 | + //location menu li class |
|
340 | + if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) { |
|
341 | + add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10); |
|
342 | + } |
|
343 | + |
|
344 | + //location menu sub ul class |
|
345 | + if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) { |
|
346 | + add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10); |
|
347 | + } |
|
348 | + |
|
349 | + //location menu sub li class |
|
350 | + if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) { |
|
351 | + add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10); |
|
352 | + } |
|
353 | + |
|
354 | + //location menu a class |
|
355 | + if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) { |
|
356 | + add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10); |
|
357 | + } |
|
358 | + |
|
359 | + // compat styles |
|
360 | + if (!empty($tc['geodir_theme_compat_css'])) { |
|
361 | + add_action('wp_head', 'gd_compat_styles'); |
|
362 | + } |
|
363 | + |
|
364 | + // compat js |
|
365 | + if (!empty($tc['geodir_theme_compat_js'])) { |
|
366 | + add_action('wp_footer', 'gd_compat_script'); |
|
367 | + } |
|
368 | + |
|
369 | + |
|
370 | + // geodir_top_content_add |
|
371 | + if (!empty($tc['geodir_top_content_add'])) { |
|
372 | + add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1); |
|
373 | + } |
|
374 | + |
|
375 | + // geodir_before_main_content_add |
|
376 | + if (!empty($tc['geodir_before_main_content_add'])) { |
|
377 | + add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1); |
|
378 | + } |
|
379 | 379 | |
380 | 380 | |
381 | 381 | } |
@@ -398,23 +398,23 @@ discard block |
||
398 | 398 | */ |
399 | 399 | function geodir_action_wrapper_open($type = '', $id = '', $class = '') |
400 | 400 | { |
401 | - $tc = get_option('theme_compatibility_setting'); |
|
402 | - if (!empty($tc['geodir_wrapper_open_replace'])) { |
|
403 | - $text = $tc['geodir_wrapper_open_replace']; |
|
404 | - } else { |
|
405 | - $text = '<div id="[id]" class="[class]">'; |
|
406 | - } |
|
401 | + $tc = get_option('theme_compatibility_setting'); |
|
402 | + if (!empty($tc['geodir_wrapper_open_replace'])) { |
|
403 | + $text = $tc['geodir_wrapper_open_replace']; |
|
404 | + } else { |
|
405 | + $text = '<div id="[id]" class="[class]">'; |
|
406 | + } |
|
407 | 407 | |
408 | - if (!empty($tc['geodir_wrapper_open_id'])) { |
|
409 | - $id = $tc['geodir_wrapper_open_id']; |
|
410 | - } |
|
411 | - if (!empty($tc['geodir_wrapper_open_class'])) { |
|
412 | - $class = $tc['geodir_wrapper_open_class']; |
|
413 | - } |
|
408 | + if (!empty($tc['geodir_wrapper_open_id'])) { |
|
409 | + $id = $tc['geodir_wrapper_open_id']; |
|
410 | + } |
|
411 | + if (!empty($tc['geodir_wrapper_open_class'])) { |
|
412 | + $class = $tc['geodir_wrapper_open_class']; |
|
413 | + } |
|
414 | 414 | |
415 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text); |
|
415 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text); |
|
416 | 416 | |
417 | - echo $text; |
|
417 | + echo $text; |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | // action for adding the wrapperdiv closing tag |
@@ -429,14 +429,14 @@ discard block |
||
429 | 429 | */ |
430 | 430 | function geodir_action_wrapper_close($type = '') |
431 | 431 | { |
432 | - $tc = get_option('theme_compatibility_setting'); |
|
433 | - if (!empty($tc['geodir_wrapper_close_replace'])) { |
|
434 | - $text = $tc['geodir_wrapper_close_replace']; |
|
435 | - } else { |
|
436 | - $text = '</div><!-- wrapper ends here-->'; |
|
437 | - } |
|
432 | + $tc = get_option('theme_compatibility_setting'); |
|
433 | + if (!empty($tc['geodir_wrapper_close_replace'])) { |
|
434 | + $text = $tc['geodir_wrapper_close_replace']; |
|
435 | + } else { |
|
436 | + $text = '</div><!-- wrapper ends here-->'; |
|
437 | + } |
|
438 | 438 | |
439 | - echo $text; |
|
439 | + echo $text; |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | // action for adding the content div opening tag |
@@ -452,35 +452,35 @@ discard block |
||
452 | 452 | */ |
453 | 453 | function geodir_action_wrapper_content_open($type = '', $id = '', $class = '') |
454 | 454 | { |
455 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) { |
|
456 | - $width_css = 'style="width:' . $width . '%;"'; |
|
457 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) { |
|
458 | - $width_css = 'style="width:' . $width . '%;"'; |
|
459 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) { |
|
460 | - $width_css = 'style="width:' . $width . '%;"'; |
|
461 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) { |
|
462 | - $width_css = 'style="width:' . $width . '%;"'; |
|
463 | - } else { |
|
464 | - $width_css = ''; |
|
465 | - } |
|
466 | - |
|
467 | - $tc = get_option('theme_compatibility_setting'); |
|
468 | - if (!empty($tc['geodir_wrapper_content_open_replace'])) { |
|
469 | - $text = $tc['geodir_wrapper_content_open_replace']; |
|
470 | - } else { |
|
471 | - $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
472 | - } |
|
473 | - |
|
474 | - if (!empty($tc['geodir_wrapper_content_open_id'])) { |
|
475 | - $id = $tc['geodir_wrapper_content_open_id']; |
|
476 | - } |
|
477 | - if (!empty($tc['geodir_wrapper_content_open_class'])) { |
|
478 | - $class = $tc['geodir_wrapper_content_open_class']; |
|
479 | - } |
|
480 | - |
|
481 | - $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text); |
|
482 | - |
|
483 | - echo $text; |
|
455 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) { |
|
456 | + $width_css = 'style="width:' . $width . '%;"'; |
|
457 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) { |
|
458 | + $width_css = 'style="width:' . $width . '%;"'; |
|
459 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) { |
|
460 | + $width_css = 'style="width:' . $width . '%;"'; |
|
461 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) { |
|
462 | + $width_css = 'style="width:' . $width . '%;"'; |
|
463 | + } else { |
|
464 | + $width_css = ''; |
|
465 | + } |
|
466 | + |
|
467 | + $tc = get_option('theme_compatibility_setting'); |
|
468 | + if (!empty($tc['geodir_wrapper_content_open_replace'])) { |
|
469 | + $text = $tc['geodir_wrapper_content_open_replace']; |
|
470 | + } else { |
|
471 | + $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
472 | + } |
|
473 | + |
|
474 | + if (!empty($tc['geodir_wrapper_content_open_id'])) { |
|
475 | + $id = $tc['geodir_wrapper_content_open_id']; |
|
476 | + } |
|
477 | + if (!empty($tc['geodir_wrapper_content_open_class'])) { |
|
478 | + $class = $tc['geodir_wrapper_content_open_class']; |
|
479 | + } |
|
480 | + |
|
481 | + $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text); |
|
482 | + |
|
483 | + echo $text; |
|
484 | 484 | } |
485 | 485 | |
486 | 486 | // action for adding the primary div closing tag |
@@ -494,13 +494,13 @@ discard block |
||
494 | 494 | */ |
495 | 495 | function geodir_action_wrapper_content_close($type = '') |
496 | 496 | { |
497 | - $tc = get_option('theme_compatibility_setting'); |
|
498 | - if (!empty($tc['geodir_wrapper_content_close_replace'])) { |
|
499 | - $text = $tc['geodir_wrapper_content_close_replace']; |
|
500 | - } else { |
|
501 | - $text = '</div><!-- content ends here-->'; |
|
502 | - } |
|
503 | - echo $text; |
|
497 | + $tc = get_option('theme_compatibility_setting'); |
|
498 | + if (!empty($tc['geodir_wrapper_content_close_replace'])) { |
|
499 | + $text = $tc['geodir_wrapper_content_close_replace']; |
|
500 | + } else { |
|
501 | + $text = '</div><!-- content ends here-->'; |
|
502 | + } |
|
503 | + echo $text; |
|
504 | 504 | } |
505 | 505 | |
506 | 506 | // action for adding the <article> opening tag |
@@ -518,24 +518,24 @@ discard block |
||
518 | 518 | */ |
519 | 519 | function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '') |
520 | 520 | { |
521 | - $class = implode(" ", $class); |
|
522 | - $tc = get_option('theme_compatibility_setting'); |
|
523 | - if (!empty($tc['geodir_article_open_replace'])) { |
|
524 | - $text = $tc['geodir_article_open_replace']; |
|
525 | - } else { |
|
526 | - $text = '<article id="[id]" class="[class]" >'; |
|
527 | - } |
|
521 | + $class = implode(" ", $class); |
|
522 | + $tc = get_option('theme_compatibility_setting'); |
|
523 | + if (!empty($tc['geodir_article_open_replace'])) { |
|
524 | + $text = $tc['geodir_article_open_replace']; |
|
525 | + } else { |
|
526 | + $text = '<article id="[id]" class="[class]" >'; |
|
527 | + } |
|
528 | 528 | |
529 | - if (!empty($tc['geodir_article_open_id'])) { |
|
530 | - $id = $tc['geodir_article_open_id']; |
|
531 | - } |
|
532 | - if (!empty($tc['geodir_article_open_class'])) { |
|
533 | - $class = $tc['geodir_article_open_class']; |
|
534 | - } |
|
529 | + if (!empty($tc['geodir_article_open_id'])) { |
|
530 | + $id = $tc['geodir_article_open_id']; |
|
531 | + } |
|
532 | + if (!empty($tc['geodir_article_open_class'])) { |
|
533 | + $class = $tc['geodir_article_open_class']; |
|
534 | + } |
|
535 | 535 | |
536 | - $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text); |
|
536 | + $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text); |
|
537 | 537 | |
538 | - echo $text; |
|
538 | + echo $text; |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | // action for adding the primary div closing tag |
@@ -549,13 +549,13 @@ discard block |
||
549 | 549 | */ |
550 | 550 | function geodir_action_article_close($type = '') |
551 | 551 | { |
552 | - $tc = get_option('theme_compatibility_setting'); |
|
553 | - if (!empty($tc['geodir_article_close_replace'])) { |
|
554 | - $text = $tc['geodir_article_close_replace']; |
|
555 | - } else { |
|
556 | - $text = '</article><!-- article ends here-->'; |
|
557 | - } |
|
558 | - echo $text; |
|
552 | + $tc = get_option('theme_compatibility_setting'); |
|
553 | + if (!empty($tc['geodir_article_close_replace'])) { |
|
554 | + $text = $tc['geodir_article_close_replace']; |
|
555 | + } else { |
|
556 | + $text = '</article><!-- article ends here-->'; |
|
557 | + } |
|
558 | + echo $text; |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | // action for adding the sidebar opening tag |
@@ -572,35 +572,35 @@ discard block |
||
572 | 572 | */ |
573 | 573 | function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
574 | 574 | { |
575 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) { |
|
576 | - $width_css = 'style="width:' . $width . '%;"'; |
|
577 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) { |
|
578 | - $width_css = 'style="width:' . $width . '%;"'; |
|
579 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) { |
|
580 | - $width_css = 'style="width:' . $width . '%;"'; |
|
581 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) { |
|
582 | - $width_css = 'style="width:' . $width . '%;"'; |
|
583 | - } else { |
|
584 | - $width_css = ''; |
|
585 | - } |
|
586 | - |
|
587 | - $tc = get_option('theme_compatibility_setting'); |
|
588 | - if (!empty($tc['geodir_sidebar_right_open_replace'])) { |
|
589 | - $text = $tc['geodir_sidebar_right_open_replace']; |
|
590 | - } else { |
|
591 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
592 | - } |
|
593 | - |
|
594 | - if (!empty($tc['geodir_sidebar_right_open_id'])) { |
|
595 | - $id = $tc['geodir_sidebar_right_open_id']; |
|
596 | - } |
|
597 | - if (!empty($tc['geodir_sidebar_right_open_class'])) { |
|
598 | - $class = $tc['geodir_sidebar_right_open_class']; |
|
599 | - } |
|
600 | - |
|
601 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text); |
|
602 | - |
|
603 | - echo $text; |
|
575 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) { |
|
576 | + $width_css = 'style="width:' . $width . '%;"'; |
|
577 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) { |
|
578 | + $width_css = 'style="width:' . $width . '%;"'; |
|
579 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) { |
|
580 | + $width_css = 'style="width:' . $width . '%;"'; |
|
581 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) { |
|
582 | + $width_css = 'style="width:' . $width . '%;"'; |
|
583 | + } else { |
|
584 | + $width_css = ''; |
|
585 | + } |
|
586 | + |
|
587 | + $tc = get_option('theme_compatibility_setting'); |
|
588 | + if (!empty($tc['geodir_sidebar_right_open_replace'])) { |
|
589 | + $text = $tc['geodir_sidebar_right_open_replace']; |
|
590 | + } else { |
|
591 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
592 | + } |
|
593 | + |
|
594 | + if (!empty($tc['geodir_sidebar_right_open_id'])) { |
|
595 | + $id = $tc['geodir_sidebar_right_open_id']; |
|
596 | + } |
|
597 | + if (!empty($tc['geodir_sidebar_right_open_class'])) { |
|
598 | + $class = $tc['geodir_sidebar_right_open_class']; |
|
599 | + } |
|
600 | + |
|
601 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text); |
|
602 | + |
|
603 | + echo $text; |
|
604 | 604 | } |
605 | 605 | |
606 | 606 | // action for adding the primary div closing tag |
@@ -614,13 +614,13 @@ discard block |
||
614 | 614 | */ |
615 | 615 | function geodir_action_sidebar_right_close($type = '') |
616 | 616 | { |
617 | - $tc = get_option('theme_compatibility_setting'); |
|
618 | - if (!empty($tc['geodir_sidebar_right_close_replace'])) { |
|
619 | - $text = $tc['geodir_sidebar_right_close_replace']; |
|
620 | - } else { |
|
621 | - $text = '</aside><!-- sidebar ends here-->'; |
|
622 | - } |
|
623 | - echo $text; |
|
617 | + $tc = get_option('theme_compatibility_setting'); |
|
618 | + if (!empty($tc['geodir_sidebar_right_close_replace'])) { |
|
619 | + $text = $tc['geodir_sidebar_right_close_replace']; |
|
620 | + } else { |
|
621 | + $text = '</aside><!-- sidebar ends here-->'; |
|
622 | + } |
|
623 | + echo $text; |
|
624 | 624 | } |
625 | 625 | |
626 | 626 | |
@@ -641,121 +641,121 @@ discard block |
||
641 | 641 | */ |
642 | 642 | function geodir_action_geodir_set_preview_post() |
643 | 643 | { |
644 | - global $post, $preview, $gd_session; |
|
645 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
646 | - if (!$preview || $is_backend_preview) { |
|
647 | - return; |
|
648 | - }// bail if not previewing |
|
649 | - |
|
650 | - $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
651 | - |
|
652 | - $fields_info = geodir_get_custom_fields_type($listing_type); |
|
653 | - |
|
654 | - foreach ($_REQUEST as $pkey => $pval) { |
|
655 | - if ($pkey == 'geodir_video') { |
|
656 | - $tags = '<iframe>'; |
|
657 | - } else if ($pkey == 'post_desc') { |
|
658 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
659 | - } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) { |
|
660 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
661 | - } else if (is_array($_REQUEST[$pkey])) { |
|
662 | - $tags = 'skip_field'; |
|
663 | - } else { |
|
664 | - $tags = ''; |
|
665 | - } |
|
666 | - /** |
|
667 | - * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
668 | - * |
|
669 | - * @since 1.0.0 |
|
670 | - * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'. |
|
671 | - * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
672 | - */ |
|
673 | - $tags = apply_filters('geodir_save_post_key', $tags, $pkey); |
|
674 | - |
|
675 | - if ($tags != 'skip_field') { |
|
676 | - $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
677 | - } |
|
678 | - } |
|
679 | - |
|
680 | - $post = (object)$_REQUEST; |
|
681 | - |
|
682 | - |
|
683 | - if (isset($post->video)) { |
|
684 | - $post->video = stripslashes($post->video); |
|
685 | - } |
|
686 | - |
|
687 | - if (isset($post->Video2)) { |
|
688 | - $post->Video2 = stripslashes($post->Video2); |
|
689 | - } |
|
690 | - |
|
691 | - $post_type = $post->listing_type; |
|
692 | - $post_type_info = get_post_type_object($post_type); |
|
693 | - |
|
694 | - $listing_label = $post_type_info->labels->singular_name; |
|
695 | - |
|
696 | - $term_icon = ''; |
|
697 | - |
|
698 | - if (!empty($post->post_category)) { |
|
699 | - foreach ($post->post_category as $post_taxonomy => $post_term) { |
|
700 | - |
|
701 | - if ($post_term != '' && !is_array($post_term)) { |
|
702 | - $post_term = explode(',', trim($post_term, ',')); |
|
703 | - } |
|
644 | + global $post, $preview, $gd_session; |
|
645 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
646 | + if (!$preview || $is_backend_preview) { |
|
647 | + return; |
|
648 | + }// bail if not previewing |
|
649 | + |
|
650 | + $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
651 | + |
|
652 | + $fields_info = geodir_get_custom_fields_type($listing_type); |
|
653 | + |
|
654 | + foreach ($_REQUEST as $pkey => $pval) { |
|
655 | + if ($pkey == 'geodir_video') { |
|
656 | + $tags = '<iframe>'; |
|
657 | + } else if ($pkey == 'post_desc') { |
|
658 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
659 | + } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) { |
|
660 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
661 | + } else if (is_array($_REQUEST[$pkey])) { |
|
662 | + $tags = 'skip_field'; |
|
663 | + } else { |
|
664 | + $tags = ''; |
|
665 | + } |
|
666 | + /** |
|
667 | + * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
668 | + * |
|
669 | + * @since 1.0.0 |
|
670 | + * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'. |
|
671 | + * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
672 | + */ |
|
673 | + $tags = apply_filters('geodir_save_post_key', $tags, $pkey); |
|
674 | + |
|
675 | + if ($tags != 'skip_field') { |
|
676 | + $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
677 | + } |
|
678 | + } |
|
679 | + |
|
680 | + $post = (object)$_REQUEST; |
|
681 | + |
|
682 | + |
|
683 | + if (isset($post->video)) { |
|
684 | + $post->video = stripslashes($post->video); |
|
685 | + } |
|
686 | + |
|
687 | + if (isset($post->Video2)) { |
|
688 | + $post->Video2 = stripslashes($post->Video2); |
|
689 | + } |
|
690 | + |
|
691 | + $post_type = $post->listing_type; |
|
692 | + $post_type_info = get_post_type_object($post_type); |
|
693 | + |
|
694 | + $listing_label = $post_type_info->labels->singular_name; |
|
695 | + |
|
696 | + $term_icon = ''; |
|
697 | + |
|
698 | + if (!empty($post->post_category)) { |
|
699 | + foreach ($post->post_category as $post_taxonomy => $post_term) { |
|
700 | + |
|
701 | + if ($post_term != '' && !is_array($post_term)) { |
|
702 | + $post_term = explode(',', trim($post_term, ',')); |
|
703 | + } |
|
704 | 704 | |
705 | - if (is_array($post_term)) { |
|
706 | - $post_term = array_unique($post_term); |
|
707 | - } |
|
705 | + if (is_array($post_term)) { |
|
706 | + $post_term = array_unique($post_term); |
|
707 | + } |
|
708 | 708 | |
709 | - if (!empty($post_term)) { |
|
710 | - foreach ($post_term as $cat_id) { |
|
711 | - $cat_id = trim($cat_id); |
|
712 | - |
|
713 | - if ($cat_id != '') { |
|
714 | - $term_icon = get_option('geodir_default_marker_icon'); |
|
715 | - |
|
716 | - if (isset($post->post_default_category) && $post->post_default_category == $cat_id) { |
|
717 | - if ($term_icon_url = geodir_get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) { |
|
718 | - if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
719 | - $term_icon = $term_icon_url['src']; |
|
720 | - break; |
|
721 | - } |
|
722 | - } |
|
723 | - } |
|
724 | - } |
|
725 | - } |
|
726 | - } |
|
727 | - } |
|
709 | + if (!empty($post_term)) { |
|
710 | + foreach ($post_term as $cat_id) { |
|
711 | + $cat_id = trim($cat_id); |
|
712 | + |
|
713 | + if ($cat_id != '') { |
|
714 | + $term_icon = get_option('geodir_default_marker_icon'); |
|
715 | + |
|
716 | + if (isset($post->post_default_category) && $post->post_default_category == $cat_id) { |
|
717 | + if ($term_icon_url = geodir_get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) { |
|
718 | + if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
719 | + $term_icon = $term_icon_url['src']; |
|
720 | + break; |
|
721 | + } |
|
722 | + } |
|
723 | + } |
|
724 | + } |
|
725 | + } |
|
726 | + } |
|
727 | + } |
|
728 | 728 | |
729 | - $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
730 | - $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
729 | + $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
730 | + $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
731 | 731 | |
732 | - $srcharr = array("'", "/", "-", '"', '\\'); |
|
733 | - $replarr = array("′", "⁄", "–", "“", ''); |
|
732 | + $srcharr = array("'", "/", "-", '"', '\\'); |
|
733 | + $replarr = array("′", "⁄", "–", "“", ''); |
|
734 | 734 | |
735 | - $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
735 | + $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
736 | 736 | |
737 | - $json = '{'; |
|
738 | - $json .= '"post_preview": "1",'; |
|
739 | - $json .= '"t": "' . $json_title . '",'; |
|
740 | - $json .= '"lt": "' . $post_latitude . '",'; |
|
741 | - $json .= '"ln": "' . $post_longitude . '",'; |
|
742 | - $json .= '"i":"' . $term_icon . '"'; |
|
743 | - $json .= '}'; |
|
737 | + $json = '{'; |
|
738 | + $json .= '"post_preview": "1",'; |
|
739 | + $json .= '"t": "' . $json_title . '",'; |
|
740 | + $json .= '"lt": "' . $post_latitude . '",'; |
|
741 | + $json .= '"ln": "' . $post_longitude . '",'; |
|
742 | + $json .= '"i":"' . $term_icon . '"'; |
|
743 | + $json .= '}'; |
|
744 | 744 | |
745 | - $post->marker_json = $json; |
|
745 | + $post->marker_json = $json; |
|
746 | 746 | |
747 | - $gd_session->set('listing', $_REQUEST); |
|
747 | + $gd_session->set('listing', $_REQUEST); |
|
748 | 748 | |
749 | - // we need to define a few things to trick the setup_postdata |
|
750 | - if (!isset($post->ID)) { |
|
751 | - $post->ID = ''; |
|
752 | - $post->post_author = ''; |
|
753 | - $post->post_date = ''; |
|
754 | - $post->post_content = ''; |
|
755 | - $post->default_category = ''; |
|
756 | - $post->post_type = ''; |
|
757 | - } |
|
758 | - setup_postdata($post); |
|
749 | + // we need to define a few things to trick the setup_postdata |
|
750 | + if (!isset($post->ID)) { |
|
751 | + $post->ID = ''; |
|
752 | + $post->post_author = ''; |
|
753 | + $post->post_date = ''; |
|
754 | + $post->post_content = ''; |
|
755 | + $post->default_category = ''; |
|
756 | + $post->post_type = ''; |
|
757 | + } |
|
758 | + setup_postdata($post); |
|
759 | 759 | } |
760 | 760 | |
761 | 761 | /** |
@@ -767,15 +767,15 @@ discard block |
||
767 | 767 | */ |
768 | 768 | function geodir_action_geodir_preview_code() |
769 | 769 | { |
770 | - global $preview; |
|
770 | + global $preview; |
|
771 | 771 | |
772 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
772 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
773 | 773 | |
774 | - if (!$preview || $is_backend_preview) { |
|
775 | - return; |
|
776 | - }// bail if not previewing |
|
774 | + if (!$preview || $is_backend_preview) { |
|
775 | + return; |
|
776 | + }// bail if not previewing |
|
777 | 777 | |
778 | - geodir_get_template_part('preview', 'buttons'); |
|
778 | + geodir_get_template_part('preview', 'buttons'); |
|
779 | 779 | } |
780 | 780 | |
781 | 781 | // action for adding the details page top widget area |
@@ -791,20 +791,20 @@ discard block |
||
791 | 791 | */ |
792 | 792 | function geodir_action_geodir_sidebar_detail_top($class = '') |
793 | 793 | { |
794 | - if (get_option('geodir_show_detail_top_section')) { ?> |
|
794 | + if (get_option('geodir_show_detail_top_section')) { ?> |
|
795 | 795 | <div |
796 | 796 | class="<?php |
797 | - /** |
|
798 | - * Filter the div class for the wrapper of the full width widget areas. |
|
799 | - * |
|
800 | - * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas. |
|
801 | - * |
|
802 | - * @since 1.0.0 |
|
803 | - * @param string $class The class of the div. |
|
804 | - * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section', |
|
805 | - * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
806 | - */ |
|
807 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>"> |
|
797 | + /** |
|
798 | + * Filter the div class for the wrapper of the full width widget areas. |
|
799 | + * |
|
800 | + * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas. |
|
801 | + * |
|
802 | + * @since 1.0.0 |
|
803 | + * @param string $class The class of the div. |
|
804 | + * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section', |
|
805 | + * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
806 | + */ |
|
807 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>"> |
|
808 | 808 | <?php dynamic_sidebar('geodir_detail_top'); ?> |
809 | 809 | </div> |
810 | 810 | <?php } |
@@ -828,11 +828,11 @@ discard block |
||
828 | 828 | */ |
829 | 829 | function geodir_action_geodir_sidebar_detail_bottom_section($class = '') |
830 | 830 | { |
831 | - if (get_option('geodir_show_detail_bottom_section')) { ?> |
|
831 | + if (get_option('geodir_show_detail_bottom_section')) { ?> |
|
832 | 832 | <div |
833 | 833 | class="<?php |
834 | - /** This action is documented in geodirectory_template_actions.php */ |
|
835 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>"> |
|
834 | + /** This action is documented in geodirectory_template_actions.php */ |
|
835 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>"> |
|
836 | 836 | <?php dynamic_sidebar('geodir_detail_bottom'); ?> |
837 | 837 | </div><!-- clearfix ends here--> |
838 | 838 | <?php } |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | */ |
847 | 847 | function geodir_details_sidebar_widget_area() |
848 | 848 | { |
849 | - dynamic_sidebar('geodir_detail_sidebar'); |
|
849 | + dynamic_sidebar('geodir_detail_sidebar'); |
|
850 | 850 | } |
851 | 851 | |
852 | 852 | /** |
@@ -857,12 +857,12 @@ discard block |
||
857 | 857 | */ |
858 | 858 | function geodir_details_sidebar_place_details() |
859 | 859 | { |
860 | - /** |
|
861 | - * Used to add items to the details page sidebar. |
|
862 | - * |
|
863 | - * @since 1.0.0 |
|
864 | - */ |
|
865 | - do_action('geodir_detail_page_sidebar'); |
|
860 | + /** |
|
861 | + * Used to add items to the details page sidebar. |
|
862 | + * |
|
863 | + * @since 1.0.0 |
|
864 | + */ |
|
865 | + do_action('geodir_detail_page_sidebar'); |
|
866 | 866 | } |
867 | 867 | |
868 | 868 | add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10); |
@@ -877,68 +877,68 @@ discard block |
||
877 | 877 | */ |
878 | 878 | function geodir_action_details_sidebar() |
879 | 879 | { |
880 | - // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
881 | - if (get_option('geodir_detail_sidebar_left_section')) { |
|
882 | - /** |
|
883 | - * Called before the details page left sidebar is opened. |
|
884 | - * |
|
885 | - * This is used to add opening wrapper HTML to the details page left sidebar. |
|
886 | - * |
|
887 | - * @since 1.0.0 |
|
888 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
889 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
890 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
891 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
892 | - */ |
|
893 | - do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar'); |
|
894 | - ?> |
|
880 | + // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
881 | + if (get_option('geodir_detail_sidebar_left_section')) { |
|
882 | + /** |
|
883 | + * Called before the details page left sidebar is opened. |
|
884 | + * |
|
885 | + * This is used to add opening wrapper HTML to the details page left sidebar. |
|
886 | + * |
|
887 | + * @since 1.0.0 |
|
888 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
889 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
890 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
891 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
892 | + */ |
|
893 | + do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar'); |
|
894 | + ?> |
|
895 | 895 | <div class="geodir-content-left geodir-sidebar-wrap"><?php |
896 | - /** |
|
897 | - * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
898 | - * |
|
899 | - * This is used to add all info to the details page sidebars. |
|
900 | - * |
|
901 | - * @since 1.0.0 |
|
902 | - */ |
|
903 | - do_action('geodir_detail_sidebar_inside'); |
|
904 | - ?></div><!-- end geodir-content-left --><?php |
|
905 | - /** |
|
906 | - * Called after the details page left sidebar. |
|
907 | - * |
|
908 | - * This is used to add closing wrapper HTML to the details page left sidebar. |
|
909 | - * |
|
910 | - * @since 1.0.0 |
|
911 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
912 | - */ |
|
913 | - do_action('geodir_sidebar_left_close', 'details-page'); |
|
914 | - } else { |
|
915 | - /** |
|
916 | - * Called before the details page right sidebar is opened. |
|
917 | - * |
|
918 | - * This is used to add opening wrapper HTML to the details page right sidebar. |
|
919 | - * |
|
920 | - * @since 1.0.0 |
|
921 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
922 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
923 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
924 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
925 | - */ |
|
926 | - do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar'); |
|
927 | - ?> |
|
896 | + /** |
|
897 | + * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
898 | + * |
|
899 | + * This is used to add all info to the details page sidebars. |
|
900 | + * |
|
901 | + * @since 1.0.0 |
|
902 | + */ |
|
903 | + do_action('geodir_detail_sidebar_inside'); |
|
904 | + ?></div><!-- end geodir-content-left --><?php |
|
905 | + /** |
|
906 | + * Called after the details page left sidebar. |
|
907 | + * |
|
908 | + * This is used to add closing wrapper HTML to the details page left sidebar. |
|
909 | + * |
|
910 | + * @since 1.0.0 |
|
911 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
912 | + */ |
|
913 | + do_action('geodir_sidebar_left_close', 'details-page'); |
|
914 | + } else { |
|
915 | + /** |
|
916 | + * Called before the details page right sidebar is opened. |
|
917 | + * |
|
918 | + * This is used to add opening wrapper HTML to the details page right sidebar. |
|
919 | + * |
|
920 | + * @since 1.0.0 |
|
921 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
922 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
923 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
924 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
925 | + */ |
|
926 | + do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar'); |
|
927 | + ?> |
|
928 | 928 | <div class="geodir-content-right geodir-sidebar-wrap"><?php |
929 | - /** This action is documented in geodirectory_template_actions.php */ |
|
930 | - do_action('geodir_detail_sidebar_inside'); |
|
931 | - ?></div><!-- end geodir-content-right --><?php |
|
932 | - /** |
|
933 | - * Called after the details page right sidebar. |
|
934 | - * |
|
935 | - * This is used to add closing wrapper HTML to the details page right sidebar. |
|
936 | - * |
|
937 | - * @since 1.0.0 |
|
938 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
939 | - */ |
|
940 | - do_action('geodir_sidebar_right_close', 'details-page'); |
|
941 | - } |
|
929 | + /** This action is documented in geodirectory_template_actions.php */ |
|
930 | + do_action('geodir_detail_sidebar_inside'); |
|
931 | + ?></div><!-- end geodir-content-right --><?php |
|
932 | + /** |
|
933 | + * Called after the details page right sidebar. |
|
934 | + * |
|
935 | + * This is used to add closing wrapper HTML to the details page right sidebar. |
|
936 | + * |
|
937 | + * @since 1.0.0 |
|
938 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
939 | + */ |
|
940 | + do_action('geodir_sidebar_right_close', 'details-page'); |
|
941 | + } |
|
942 | 942 | } |
943 | 943 | |
944 | 944 | add_action('geodir_page_title', 'geodir_action_page_title', 10); |
@@ -952,21 +952,21 @@ discard block |
||
952 | 952 | */ |
953 | 953 | function geodir_action_page_title() |
954 | 954 | { |
955 | - /** |
|
956 | - * Filter the page title HTML h1 class. |
|
957 | - * |
|
958 | - * @since 1.0.0 |
|
959 | - * @param string $class The class to use. Default is 'entry-title fn'. |
|
960 | - */ |
|
961 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
962 | - /** |
|
963 | - * Filter the page title HTML header wrapper class. |
|
964 | - * |
|
965 | - * @since 1.0.0 |
|
966 | - * @param string $class The class to use. Default is 'entry-header'. |
|
967 | - */ |
|
968 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
969 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
955 | + /** |
|
956 | + * Filter the page title HTML h1 class. |
|
957 | + * |
|
958 | + * @since 1.0.0 |
|
959 | + * @param string $class The class to use. Default is 'entry-title fn'. |
|
960 | + */ |
|
961 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
962 | + /** |
|
963 | + * Filter the page title HTML header wrapper class. |
|
964 | + * |
|
965 | + * @since 1.0.0 |
|
966 | + * @param string $class The class to use. Default is 'entry-header'. |
|
967 | + */ |
|
968 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
969 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
970 | 970 | } |
971 | 971 | |
972 | 972 | |
@@ -983,94 +983,94 @@ discard block |
||
983 | 983 | */ |
984 | 984 | function geodir_action_details_slider() |
985 | 985 | { |
986 | - global $preview, $post; |
|
986 | + global $preview, $post; |
|
987 | 987 | |
988 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
988 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
989 | 989 | |
990 | - if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) { |
|
991 | - $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img')); |
|
990 | + if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) { |
|
991 | + $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img')); |
|
992 | 992 | |
993 | - $preview_post_images = array(); |
|
994 | - if ($preview_get_images) { |
|
995 | - foreach ($preview_get_images as $row) { |
|
996 | - $preview_post_images[] = $row->src; |
|
997 | - } |
|
998 | - } |
|
999 | - if (!empty($preview_post_images)) { |
|
1000 | - $post->post_images = implode(',', $preview_post_images); |
|
1001 | - } |
|
1002 | - } |
|
1003 | - |
|
1004 | - if ($preview) { |
|
1005 | - $post_images = array(); |
|
1006 | - if (isset($post->post_images) && !empty($post->post_images)) { |
|
1007 | - $post->post_images = trim($post->post_images, ","); |
|
1008 | - $post_images = explode(",", $post->post_images); |
|
1009 | - } |
|
1010 | - |
|
1011 | - $main_slides = ''; |
|
1012 | - $nav_slides = ''; |
|
1013 | - $slides = 0; |
|
1014 | - |
|
1015 | - if (!empty($post_images)) { |
|
1016 | - foreach ($post_images as $image) { |
|
1017 | - if (!empty($image)) { |
|
1018 | - $sizes = getimagesize(trim($image)); |
|
1019 | - $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
1020 | - $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
1021 | - |
|
1022 | - if ($image && $width && $height) { |
|
1023 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height); |
|
1024 | - } |
|
1025 | - |
|
1026 | - if (isset($image->src)) { |
|
1027 | - if ($image->height >= 400) { |
|
1028 | - $spacer_height = 0; |
|
1029 | - } else { |
|
1030 | - $spacer_height = ((400 - $image->height) / 2); |
|
1031 | - } |
|
1032 | - |
|
1033 | - $image_title = isset($image->title) ? $image->title : ''; |
|
1034 | - |
|
1035 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
1036 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
1037 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1038 | - $slides++; |
|
1039 | - } |
|
1040 | - } |
|
1041 | - }// endfore |
|
1042 | - } //end if |
|
1043 | - } else { |
|
1044 | - $main_slides = ''; |
|
1045 | - $nav_slides = ''; |
|
1046 | - /** |
|
1047 | - * Filter if default images should show on the details page. |
|
1048 | - * |
|
1049 | - * @param bool $use_default_image Default false. |
|
1050 | - * @since 1.6.16 |
|
1051 | - */ |
|
1052 | - $use_default_image = apply_filters('geodir_details_default_image_show', false); |
|
1053 | - $post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page. |
|
1054 | - $slides = 0; |
|
1055 | - |
|
1056 | - if (!empty($post_images)) { |
|
1057 | - foreach ($post_images as $image) { |
|
1058 | - if ($image->height >= 400) { |
|
1059 | - $spacer_height = 0; |
|
1060 | - } else { |
|
1061 | - $spacer_height = ((400 - $image->height) / 2); |
|
1062 | - } |
|
1063 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
1064 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
1065 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
1066 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1067 | - $slides++; |
|
1068 | - } |
|
1069 | - }// endfore |
|
1070 | - } |
|
993 | + $preview_post_images = array(); |
|
994 | + if ($preview_get_images) { |
|
995 | + foreach ($preview_get_images as $row) { |
|
996 | + $preview_post_images[] = $row->src; |
|
997 | + } |
|
998 | + } |
|
999 | + if (!empty($preview_post_images)) { |
|
1000 | + $post->post_images = implode(',', $preview_post_images); |
|
1001 | + } |
|
1002 | + } |
|
1003 | + |
|
1004 | + if ($preview) { |
|
1005 | + $post_images = array(); |
|
1006 | + if (isset($post->post_images) && !empty($post->post_images)) { |
|
1007 | + $post->post_images = trim($post->post_images, ","); |
|
1008 | + $post_images = explode(",", $post->post_images); |
|
1009 | + } |
|
1010 | + |
|
1011 | + $main_slides = ''; |
|
1012 | + $nav_slides = ''; |
|
1013 | + $slides = 0; |
|
1014 | + |
|
1015 | + if (!empty($post_images)) { |
|
1016 | + foreach ($post_images as $image) { |
|
1017 | + if (!empty($image)) { |
|
1018 | + $sizes = getimagesize(trim($image)); |
|
1019 | + $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
1020 | + $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
1021 | + |
|
1022 | + if ($image && $width && $height) { |
|
1023 | + $image = (object)array('src' => $image, 'width' => $width, 'height' => $height); |
|
1024 | + } |
|
1025 | + |
|
1026 | + if (isset($image->src)) { |
|
1027 | + if ($image->height >= 400) { |
|
1028 | + $spacer_height = 0; |
|
1029 | + } else { |
|
1030 | + $spacer_height = ((400 - $image->height) / 2); |
|
1031 | + } |
|
1032 | + |
|
1033 | + $image_title = isset($image->title) ? $image->title : ''; |
|
1034 | + |
|
1035 | + $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
1036 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
1037 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1038 | + $slides++; |
|
1039 | + } |
|
1040 | + } |
|
1041 | + }// endfore |
|
1042 | + } //end if |
|
1043 | + } else { |
|
1044 | + $main_slides = ''; |
|
1045 | + $nav_slides = ''; |
|
1046 | + /** |
|
1047 | + * Filter if default images should show on the details page. |
|
1048 | + * |
|
1049 | + * @param bool $use_default_image Default false. |
|
1050 | + * @since 1.6.16 |
|
1051 | + */ |
|
1052 | + $use_default_image = apply_filters('geodir_details_default_image_show', false); |
|
1053 | + $post_images = geodir_get_images($post->ID, 'thumbnail', $use_default_image); // Hide default image on listing preview/detail page. |
|
1054 | + $slides = 0; |
|
1055 | + |
|
1056 | + if (!empty($post_images)) { |
|
1057 | + foreach ($post_images as $image) { |
|
1058 | + if ($image->height >= 400) { |
|
1059 | + $spacer_height = 0; |
|
1060 | + } else { |
|
1061 | + $spacer_height = ((400 - $image->height) / 2); |
|
1062 | + } |
|
1063 | + $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
1064 | + $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
1065 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
1066 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1067 | + $slides++; |
|
1068 | + } |
|
1069 | + }// endfore |
|
1070 | + } |
|
1071 | 1071 | |
1072 | - if (!empty($post_images)) { |
|
1073 | - ?> |
|
1072 | + if (!empty($post_images)) { |
|
1073 | + ?> |
|
1074 | 1074 | <div class="geodir_flex-container"> |
1075 | 1075 | <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div> |
1076 | 1076 | <div id="geodir_slider" class="geodir_flexslider "> |
@@ -1083,7 +1083,7 @@ discard block |
||
1083 | 1083 | <?php } ?> |
1084 | 1084 | </div> |
1085 | 1085 | <?php |
1086 | - } |
|
1086 | + } |
|
1087 | 1087 | } |
1088 | 1088 | |
1089 | 1089 | add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10); |
@@ -1098,177 +1098,177 @@ discard block |
||
1098 | 1098 | */ |
1099 | 1099 | function geodir_action_details_taxonomies() |
1100 | 1100 | { |
1101 | - global $preview, $post;?> |
|
1101 | + global $preview, $post;?> |
|
1102 | 1102 | <p class="geodir_post_taxomomies clearfix"> |
1103 | 1103 | <?php |
1104 | - $taxonomies = array(); |
|
1105 | - |
|
1106 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
1107 | - |
|
1108 | - if ($preview && !$is_backend_preview) { |
|
1109 | - $post_type = $post->listing_type; |
|
1110 | - $post_taxonomy = $post_type . 'category'; |
|
1111 | - $post->{$post_taxonomy} = $post->post_category[$post_taxonomy]; |
|
1112 | - } else { |
|
1113 | - $post_type = $post->post_type; |
|
1114 | - $post_taxonomy = $post_type . 'category'; |
|
1115 | - } |
|
1104 | + $taxonomies = array(); |
|
1105 | + |
|
1106 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
1107 | + |
|
1108 | + if ($preview && !$is_backend_preview) { |
|
1109 | + $post_type = $post->listing_type; |
|
1110 | + $post_taxonomy = $post_type . 'category'; |
|
1111 | + $post->{$post_taxonomy} = $post->post_category[$post_taxonomy]; |
|
1112 | + } else { |
|
1113 | + $post_type = $post->post_type; |
|
1114 | + $post_taxonomy = $post_type . 'category'; |
|
1115 | + } |
|
1116 | 1116 | //{ |
1117 | - $post_type_info = get_post_type_object($post_type); |
|
1118 | - $listing_label = __($post_type_info->labels->singular_name, 'geodirectory'); |
|
1119 | - |
|
1120 | - if (!empty($post->post_tags)) { |
|
1121 | - |
|
1122 | - if (taxonomy_exists($post_type . '_tags')): |
|
1123 | - $links = array(); |
|
1124 | - $terms = array(); |
|
1125 | - // to limit post tags |
|
1126 | - $post_tags = trim($post->post_tags, ","); |
|
1127 | - $post_id = isset($post->ID) ? $post->ID : ''; |
|
1128 | - /** |
|
1129 | - * Filter the post tags. |
|
1130 | - * |
|
1131 | - * Allows you to filter the post tags output on the details page of a post. |
|
1132 | - * |
|
1133 | - * @since 1.0.0 |
|
1134 | - * @param string $post_tags A comma seperated list of tags. |
|
1135 | - * @param int $post_id The current post id. |
|
1136 | - */ |
|
1137 | - $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id); |
|
1138 | - |
|
1139 | - $post->post_tags = $post_tags; |
|
1140 | - $post_tags = explode(",", trim($post->post_tags, ",")); |
|
1141 | - |
|
1142 | - |
|
1143 | - foreach ($post_tags as $post_term) { |
|
1144 | - |
|
1145 | - // fix slug creation order for tags & location |
|
1146 | - $post_term = trim($post_term); |
|
1147 | - |
|
1148 | - $priority_location = false; |
|
1149 | - if ($insert_term = term_exists($post_term, $post_type . '_tags')) { |
|
1150 | - $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags'); |
|
1151 | - } else { |
|
1152 | - $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
1153 | - $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
1154 | - $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
1155 | - $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
1156 | - $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
1157 | - $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
1158 | - if ($match_country || $match_region || $match_city) { |
|
1159 | - $priority_location = true; |
|
1160 | - $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1161 | - } else { |
|
1162 | - $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
1163 | - $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1164 | - } |
|
1165 | - } |
|
1166 | - |
|
1167 | - if (!is_wp_error($term) && is_object($term)) { |
|
1168 | - |
|
1169 | - // fix tag link on detail page |
|
1170 | - if ($priority_location) { |
|
1171 | - |
|
1172 | - $tag_link = "<a href=''>$post_term</a>"; |
|
1173 | - /** |
|
1174 | - * Filter the tag name on the details page. |
|
1175 | - * |
|
1176 | - * @since 1.5.6 |
|
1177 | - * @param string $tag_link The tag link html. |
|
1178 | - * @param object $term The tag term object. |
|
1179 | - */ |
|
1180 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1181 | - $links[] = $tag_link; |
|
1182 | - } else { |
|
1183 | - $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
1184 | - /** This action is documented in geodirectory-template_actions.php */ |
|
1185 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1186 | - $links[] = $tag_link; |
|
1187 | - } |
|
1188 | - $terms[] = $term; |
|
1189 | - } |
|
1190 | - // |
|
1191 | - } |
|
1192 | - if (!isset($listing_label)) { |
|
1193 | - $listing_label = ''; |
|
1194 | - } |
|
1195 | - $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1196 | - endif; |
|
1197 | - |
|
1198 | - } |
|
1199 | - |
|
1200 | - if (!empty($post->{$post_taxonomy})) { |
|
1201 | - $links = array(); |
|
1202 | - $terms = array(); |
|
1203 | - $termsOrdered = array(); |
|
1204 | - if (!is_array($post->{$post_taxonomy})) { |
|
1205 | - $post_term = explode(",", trim($post->{$post_taxonomy}, ",")); |
|
1206 | - } else { |
|
1207 | - $post_term = $post->{$post_taxonomy}; |
|
1117 | + $post_type_info = get_post_type_object($post_type); |
|
1118 | + $listing_label = __($post_type_info->labels->singular_name, 'geodirectory'); |
|
1119 | + |
|
1120 | + if (!empty($post->post_tags)) { |
|
1121 | + |
|
1122 | + if (taxonomy_exists($post_type . '_tags')): |
|
1123 | + $links = array(); |
|
1124 | + $terms = array(); |
|
1125 | + // to limit post tags |
|
1126 | + $post_tags = trim($post->post_tags, ","); |
|
1127 | + $post_id = isset($post->ID) ? $post->ID : ''; |
|
1128 | + /** |
|
1129 | + * Filter the post tags. |
|
1130 | + * |
|
1131 | + * Allows you to filter the post tags output on the details page of a post. |
|
1132 | + * |
|
1133 | + * @since 1.0.0 |
|
1134 | + * @param string $post_tags A comma seperated list of tags. |
|
1135 | + * @param int $post_id The current post id. |
|
1136 | + */ |
|
1137 | + $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id); |
|
1138 | + |
|
1139 | + $post->post_tags = $post_tags; |
|
1140 | + $post_tags = explode(",", trim($post->post_tags, ",")); |
|
1141 | + |
|
1142 | + |
|
1143 | + foreach ($post_tags as $post_term) { |
|
1144 | + |
|
1145 | + // fix slug creation order for tags & location |
|
1146 | + $post_term = trim($post_term); |
|
1147 | + |
|
1148 | + $priority_location = false; |
|
1149 | + if ($insert_term = term_exists($post_term, $post_type . '_tags')) { |
|
1150 | + $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags'); |
|
1151 | + } else { |
|
1152 | + $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
1153 | + $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
1154 | + $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
1155 | + $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
1156 | + $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
1157 | + $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
1158 | + if ($match_country || $match_region || $match_city) { |
|
1159 | + $priority_location = true; |
|
1160 | + $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1161 | + } else { |
|
1162 | + $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
1163 | + $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1164 | + } |
|
1165 | + } |
|
1166 | + |
|
1167 | + if (!is_wp_error($term) && is_object($term)) { |
|
1168 | + |
|
1169 | + // fix tag link on detail page |
|
1170 | + if ($priority_location) { |
|
1171 | + |
|
1172 | + $tag_link = "<a href=''>$post_term</a>"; |
|
1173 | + /** |
|
1174 | + * Filter the tag name on the details page. |
|
1175 | + * |
|
1176 | + * @since 1.5.6 |
|
1177 | + * @param string $tag_link The tag link html. |
|
1178 | + * @param object $term The tag term object. |
|
1179 | + */ |
|
1180 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1181 | + $links[] = $tag_link; |
|
1182 | + } else { |
|
1183 | + $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
1184 | + /** This action is documented in geodirectory-template_actions.php */ |
|
1185 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1186 | + $links[] = $tag_link; |
|
1187 | + } |
|
1188 | + $terms[] = $term; |
|
1189 | + } |
|
1190 | + // |
|
1191 | + } |
|
1192 | + if (!isset($listing_label)) { |
|
1193 | + $listing_label = ''; |
|
1194 | + } |
|
1195 | + $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1196 | + endif; |
|
1197 | + |
|
1198 | + } |
|
1199 | + |
|
1200 | + if (!empty($post->{$post_taxonomy})) { |
|
1201 | + $links = array(); |
|
1202 | + $terms = array(); |
|
1203 | + $termsOrdered = array(); |
|
1204 | + if (!is_array($post->{$post_taxonomy})) { |
|
1205 | + $post_term = explode(",", trim($post->{$post_taxonomy}, ",")); |
|
1206 | + } else { |
|
1207 | + $post_term = $post->{$post_taxonomy}; |
|
1208 | 1208 | |
1209 | 1209 | if ($preview && !$is_backend_preview) { |
1210 | 1210 | $post_term = geodir_add_parent_terms($post_term, $post_taxonomy); |
1211 | 1211 | } |
1212 | - } |
|
1213 | - |
|
1214 | - $post_term = array_unique($post_term); |
|
1215 | - if (!empty($post_term)) { |
|
1216 | - foreach ($post_term as $post_term) { |
|
1217 | - $post_term = trim($post_term); |
|
1218 | - |
|
1219 | - if ($post_term != ''): |
|
1220 | - $term = get_term_by('id', $post_term, $post_taxonomy); |
|
1221 | - |
|
1222 | - if (is_object($term)) { |
|
1223 | - $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
1224 | - /** |
|
1225 | - * Filter the category name on the details page. |
|
1226 | - * |
|
1227 | - * @since 1.5.6 |
|
1228 | - * @param string $term_link The link html to the category. |
|
1229 | - * @param object $term The category term object. |
|
1230 | - */ |
|
1231 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term); |
|
1232 | - $links[] = $term_link; |
|
1233 | - $terms[] = $term; |
|
1234 | - } |
|
1235 | - endif; |
|
1236 | - } |
|
1237 | - // order alphabetically |
|
1238 | - asort($links); |
|
1239 | - foreach (array_keys($links) as $key) { |
|
1240 | - $termsOrdered[$key] = $terms[$key]; |
|
1241 | - } |
|
1242 | - $terms = $termsOrdered; |
|
1212 | + } |
|
1213 | + |
|
1214 | + $post_term = array_unique($post_term); |
|
1215 | + if (!empty($post_term)) { |
|
1216 | + foreach ($post_term as $post_term) { |
|
1217 | + $post_term = trim($post_term); |
|
1218 | + |
|
1219 | + if ($post_term != ''): |
|
1220 | + $term = get_term_by('id', $post_term, $post_taxonomy); |
|
1221 | + |
|
1222 | + if (is_object($term)) { |
|
1223 | + $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
1224 | + /** |
|
1225 | + * Filter the category name on the details page. |
|
1226 | + * |
|
1227 | + * @since 1.5.6 |
|
1228 | + * @param string $term_link The link html to the category. |
|
1229 | + * @param object $term The category term object. |
|
1230 | + */ |
|
1231 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term); |
|
1232 | + $links[] = $term_link; |
|
1233 | + $terms[] = $term; |
|
1234 | + } |
|
1235 | + endif; |
|
1236 | + } |
|
1237 | + // order alphabetically |
|
1238 | + asort($links); |
|
1239 | + foreach (array_keys($links) as $key) { |
|
1240 | + $termsOrdered[$key] = $terms[$key]; |
|
1241 | + } |
|
1242 | + $terms = $termsOrdered; |
|
1243 | 1243 | |
1244 | - } |
|
1244 | + } |
|
1245 | 1245 | |
1246 | - if (!isset($listing_label)) { |
|
1247 | - $listing_label = ''; |
|
1248 | - } |
|
1249 | - $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1246 | + if (!isset($listing_label)) { |
|
1247 | + $listing_label = ''; |
|
1248 | + } |
|
1249 | + $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1250 | 1250 | |
1251 | - } |
|
1251 | + } |
|
1252 | 1252 | |
1253 | - /** |
|
1254 | - * Filter the taxonomies array before output. |
|
1255 | - * |
|
1256 | - * @since 1.5.9 |
|
1257 | - * @param array $taxonomies The array of cats and tags. |
|
1258 | - * @param string $post_type The post type being output. |
|
1259 | - * @param string $listing_label The post type label. |
|
1260 | - * @param string $listing_label The post type label with ucwords function. |
|
1261 | - */ |
|
1262 | - $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label)); |
|
1253 | + /** |
|
1254 | + * Filter the taxonomies array before output. |
|
1255 | + * |
|
1256 | + * @since 1.5.9 |
|
1257 | + * @param array $taxonomies The array of cats and tags. |
|
1258 | + * @param string $post_type The post type being output. |
|
1259 | + * @param string $listing_label The post type label. |
|
1260 | + * @param string $listing_label The post type label with ucwords function. |
|
1261 | + */ |
|
1262 | + $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label)); |
|
1263 | 1263 | |
1264 | - if (isset($taxonomies[$post_taxonomy])) { |
|
1265 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
1266 | - } |
|
1264 | + if (isset($taxonomies[$post_taxonomy])) { |
|
1265 | + echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
1266 | + } |
|
1267 | 1267 | |
1268 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
1269 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
1268 | + if (isset($taxonomies[$post_type . '_tags'])) |
|
1269 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
1270 | 1270 | |
1271 | - ?> |
|
1271 | + ?> |
|
1272 | 1272 | </p><?php |
1273 | 1273 | } |
1274 | 1274 | |
@@ -1290,140 +1290,140 @@ discard block |
||
1290 | 1290 | function geodir_action_details_micordata($post='') |
1291 | 1291 | { |
1292 | 1292 | |
1293 | - global $preview; |
|
1294 | - if(empty($post)){global $post;} |
|
1295 | - if ($preview || !geodir_is_page('detail')) { |
|
1296 | - return; |
|
1297 | - } |
|
1298 | - |
|
1299 | - // url |
|
1300 | - $c_url = geodir_curPageURL(); |
|
1301 | - |
|
1302 | - // post reviews |
|
1303 | - $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve')); |
|
1304 | - if (empty($post_reviews)) { |
|
1305 | - $reviews = ''; |
|
1306 | - } else { |
|
1307 | - foreach ($post_reviews as $review) { |
|
1308 | - $reviews[] = array( |
|
1309 | - "@type" => "Review", |
|
1310 | - "author" => $review->comment_author, |
|
1311 | - "datePublished" => $review->comment_date, |
|
1312 | - "description" => $review->comment_content, |
|
1313 | - "reviewRating" => array( |
|
1314 | - "@type" => "Rating", |
|
1315 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
1316 | - "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
1317 | - "worstRating" => "1" |
|
1318 | - ) |
|
1319 | - ); |
|
1320 | - } |
|
1321 | - |
|
1322 | - } |
|
1323 | - |
|
1324 | - // post images |
|
1325 | - $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img')); |
|
1326 | - if (empty($post_images)) { |
|
1327 | - $images = ''; |
|
1328 | - } else { |
|
1329 | - $i_arr = array(); |
|
1330 | - foreach ($post_images as $img) { |
|
1331 | - $i_arr[] = $img->src; |
|
1332 | - } |
|
1333 | - |
|
1334 | - if (count($i_arr) == 1) { |
|
1335 | - $images = $i_arr[0]; |
|
1336 | - } else { |
|
1337 | - $images = $i_arr; |
|
1338 | - } |
|
1339 | - |
|
1340 | - } |
|
1341 | - //print_r($post); |
|
1342 | - // external links |
|
1343 | - $external_links = array(); |
|
1344 | - $external_links[] = $post->geodir_website; |
|
1345 | - $external_links[] = $post->geodir_twitter; |
|
1346 | - $external_links[] = $post->geodir_facebook; |
|
1347 | - $external_links = array_filter($external_links); |
|
1348 | - |
|
1349 | - if(!empty($external_links)){ |
|
1350 | - $external_links = array_values($external_links); |
|
1351 | - } |
|
1352 | - |
|
1353 | - // reviews |
|
1354 | - $comment_count = geodir_get_review_count_total($post->ID); |
|
1355 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
1356 | - |
|
1357 | - // schema type |
|
1358 | - $schema_type = 'LocalBusiness'; |
|
1359 | - if(isset($post->default_category) && $post->default_category){ |
|
1360 | - $cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
1361 | - if($cat_schema){$schema_type = $cat_schema;} |
|
1362 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';} |
|
1363 | - } |
|
1364 | - |
|
1365 | - $schema = array(); |
|
1366 | - $schema['@context'] = "https://schema.org"; |
|
1367 | - $schema['@type'] = $schema_type; |
|
1368 | - $schema['name'] = $post->post_title; |
|
1369 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
1370 | - $schema['telephone'] = $post->geodir_contact; |
|
1371 | - $schema['url'] = $c_url; |
|
1372 | - $schema['sameAs'] = $external_links; |
|
1373 | - $schema['image'] = $images; |
|
1374 | - $schema['address'] = array( |
|
1375 | - "@type" => "PostalAddress", |
|
1376 | - "streetAddress" => $post->post_address, |
|
1377 | - "addressLocality" => $post->post_city, |
|
1378 | - "addressRegion" => $post->post_region, |
|
1379 | - "addressCountry" => $post->post_country, |
|
1380 | - "postalCode" => $post->post_zip |
|
1381 | - ); |
|
1382 | - |
|
1383 | - if($post->post_latitude && $post->post_longitude) { |
|
1384 | - $schema['geo'] = array( |
|
1385 | - "@type" => "GeoCoordinates", |
|
1386 | - "latitude" => $post->post_latitude, |
|
1387 | - "longitude" => $post->post_longitude |
|
1388 | - ); |
|
1389 | - } |
|
1390 | - |
|
1391 | - if($post_avgratings) { |
|
1392 | - $schema['aggregateRating'] = array( |
|
1393 | - "@type" => "AggregateRating", |
|
1394 | - "ratingValue" => $post_avgratings, |
|
1395 | - "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
1396 | - "worstRating" => "1", |
|
1397 | - "ratingCount" => $comment_count |
|
1398 | - ); |
|
1399 | - } |
|
1400 | - $schema['review'] = $reviews; |
|
1401 | - |
|
1402 | - /** |
|
1403 | - * Allow the schema JSON-LD info to be filtered. |
|
1404 | - * |
|
1405 | - * @since 1.5.4 |
|
1406 | - * @since 1.5.7 Added $post variable. |
|
1407 | - * @param array $schema The array of schema data to be filtered. |
|
1408 | - * @param object $post The post object. |
|
1409 | - */ |
|
1410 | - $schema = apply_filters('geodir_details_schema', $schema,$post); |
|
1411 | - |
|
1412 | - |
|
1413 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
1414 | - |
|
1415 | - |
|
1416 | - $uploads = wp_upload_dir(); |
|
1417 | - $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : ''; |
|
1418 | - |
|
1419 | - /** |
|
1420 | - * Show facebook open graph meta info |
|
1421 | - * |
|
1422 | - * @since 1.6.6 |
|
1423 | - * @param string $facebook_og The open graph html to be filtered. |
|
1424 | - * @param object $post The post object. |
|
1425 | - */ |
|
1426 | - echo apply_filters('geodir_details_facebook_og', $facebook_og,$post); |
|
1293 | + global $preview; |
|
1294 | + if(empty($post)){global $post;} |
|
1295 | + if ($preview || !geodir_is_page('detail')) { |
|
1296 | + return; |
|
1297 | + } |
|
1298 | + |
|
1299 | + // url |
|
1300 | + $c_url = geodir_curPageURL(); |
|
1301 | + |
|
1302 | + // post reviews |
|
1303 | + $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve')); |
|
1304 | + if (empty($post_reviews)) { |
|
1305 | + $reviews = ''; |
|
1306 | + } else { |
|
1307 | + foreach ($post_reviews as $review) { |
|
1308 | + $reviews[] = array( |
|
1309 | + "@type" => "Review", |
|
1310 | + "author" => $review->comment_author, |
|
1311 | + "datePublished" => $review->comment_date, |
|
1312 | + "description" => $review->comment_content, |
|
1313 | + "reviewRating" => array( |
|
1314 | + "@type" => "Rating", |
|
1315 | + "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
1316 | + "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
1317 | + "worstRating" => "1" |
|
1318 | + ) |
|
1319 | + ); |
|
1320 | + } |
|
1321 | + |
|
1322 | + } |
|
1323 | + |
|
1324 | + // post images |
|
1325 | + $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img')); |
|
1326 | + if (empty($post_images)) { |
|
1327 | + $images = ''; |
|
1328 | + } else { |
|
1329 | + $i_arr = array(); |
|
1330 | + foreach ($post_images as $img) { |
|
1331 | + $i_arr[] = $img->src; |
|
1332 | + } |
|
1333 | + |
|
1334 | + if (count($i_arr) == 1) { |
|
1335 | + $images = $i_arr[0]; |
|
1336 | + } else { |
|
1337 | + $images = $i_arr; |
|
1338 | + } |
|
1339 | + |
|
1340 | + } |
|
1341 | + //print_r($post); |
|
1342 | + // external links |
|
1343 | + $external_links = array(); |
|
1344 | + $external_links[] = $post->geodir_website; |
|
1345 | + $external_links[] = $post->geodir_twitter; |
|
1346 | + $external_links[] = $post->geodir_facebook; |
|
1347 | + $external_links = array_filter($external_links); |
|
1348 | + |
|
1349 | + if(!empty($external_links)){ |
|
1350 | + $external_links = array_values($external_links); |
|
1351 | + } |
|
1352 | + |
|
1353 | + // reviews |
|
1354 | + $comment_count = geodir_get_review_count_total($post->ID); |
|
1355 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
1356 | + |
|
1357 | + // schema type |
|
1358 | + $schema_type = 'LocalBusiness'; |
|
1359 | + if(isset($post->default_category) && $post->default_category){ |
|
1360 | + $cat_schema = geodir_get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
1361 | + if($cat_schema){$schema_type = $cat_schema;} |
|
1362 | + if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';} |
|
1363 | + } |
|
1364 | + |
|
1365 | + $schema = array(); |
|
1366 | + $schema['@context'] = "https://schema.org"; |
|
1367 | + $schema['@type'] = $schema_type; |
|
1368 | + $schema['name'] = $post->post_title; |
|
1369 | + $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
1370 | + $schema['telephone'] = $post->geodir_contact; |
|
1371 | + $schema['url'] = $c_url; |
|
1372 | + $schema['sameAs'] = $external_links; |
|
1373 | + $schema['image'] = $images; |
|
1374 | + $schema['address'] = array( |
|
1375 | + "@type" => "PostalAddress", |
|
1376 | + "streetAddress" => $post->post_address, |
|
1377 | + "addressLocality" => $post->post_city, |
|
1378 | + "addressRegion" => $post->post_region, |
|
1379 | + "addressCountry" => $post->post_country, |
|
1380 | + "postalCode" => $post->post_zip |
|
1381 | + ); |
|
1382 | + |
|
1383 | + if($post->post_latitude && $post->post_longitude) { |
|
1384 | + $schema['geo'] = array( |
|
1385 | + "@type" => "GeoCoordinates", |
|
1386 | + "latitude" => $post->post_latitude, |
|
1387 | + "longitude" => $post->post_longitude |
|
1388 | + ); |
|
1389 | + } |
|
1390 | + |
|
1391 | + if($post_avgratings) { |
|
1392 | + $schema['aggregateRating'] = array( |
|
1393 | + "@type" => "AggregateRating", |
|
1394 | + "ratingValue" => $post_avgratings, |
|
1395 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
1396 | + "worstRating" => "1", |
|
1397 | + "ratingCount" => $comment_count |
|
1398 | + ); |
|
1399 | + } |
|
1400 | + $schema['review'] = $reviews; |
|
1401 | + |
|
1402 | + /** |
|
1403 | + * Allow the schema JSON-LD info to be filtered. |
|
1404 | + * |
|
1405 | + * @since 1.5.4 |
|
1406 | + * @since 1.5.7 Added $post variable. |
|
1407 | + * @param array $schema The array of schema data to be filtered. |
|
1408 | + * @param object $post The post object. |
|
1409 | + */ |
|
1410 | + $schema = apply_filters('geodir_details_schema', $schema,$post); |
|
1411 | + |
|
1412 | + |
|
1413 | + echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
1414 | + |
|
1415 | + |
|
1416 | + $uploads = wp_upload_dir(); |
|
1417 | + $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : ''; |
|
1418 | + |
|
1419 | + /** |
|
1420 | + * Show facebook open graph meta info |
|
1421 | + * |
|
1422 | + * @since 1.6.6 |
|
1423 | + * @param string $facebook_og The open graph html to be filtered. |
|
1424 | + * @param object $post The post object. |
|
1425 | + */ |
|
1426 | + echo apply_filters('geodir_details_facebook_og', $facebook_og,$post); |
|
1427 | 1427 | |
1428 | 1428 | |
1429 | 1429 | |
@@ -1443,7 +1443,7 @@ discard block |
||
1443 | 1443 | */ |
1444 | 1444 | function geodir_action_details_next_prev() |
1445 | 1445 | { |
1446 | - ?> |
|
1446 | + ?> |
|
1447 | 1447 | <div class="geodir-pos_navigation clearfix"> |
1448 | 1448 | <div |
1449 | 1449 | class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div> |
@@ -1461,15 +1461,15 @@ discard block |
||
1461 | 1461 | */ |
1462 | 1462 | function geodir_action_before_single_post() |
1463 | 1463 | { |
1464 | - global $post; |
|
1465 | - /** |
|
1466 | - * Called at the very start of the details page output, before the title section. |
|
1467 | - * |
|
1468 | - * @since 1.0.0 |
|
1469 | - * @param object $post The current post object. |
|
1470 | - * @global WP_Post|null $post The current post, if available. |
|
1471 | - */ |
|
1472 | - do_action('geodir_before_single_post', $post); // extra action |
|
1464 | + global $post; |
|
1465 | + /** |
|
1466 | + * Called at the very start of the details page output, before the title section. |
|
1467 | + * |
|
1468 | + * @since 1.0.0 |
|
1469 | + * @param object $post The current post object. |
|
1470 | + * @global WP_Post|null $post The current post, if available. |
|
1471 | + */ |
|
1472 | + do_action('geodir_before_single_post', $post); // extra action |
|
1473 | 1473 | } |
1474 | 1474 | |
1475 | 1475 | /** |
@@ -1480,13 +1480,13 @@ discard block |
||
1480 | 1480 | */ |
1481 | 1481 | function geodir_action_after_single_post($post) |
1482 | 1482 | { |
1483 | - /** |
|
1484 | - * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
1485 | - * |
|
1486 | - * @since 1.0.0 |
|
1487 | - * @param object $post The current post object. |
|
1488 | - */ |
|
1489 | - do_action('geodir_after_single_post', $post); // extra action |
|
1483 | + /** |
|
1484 | + * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
1485 | + * |
|
1486 | + * @since 1.0.0 |
|
1487 | + * @param object $post The current post object. |
|
1488 | + */ |
|
1489 | + do_action('geodir_after_single_post', $post); // extra action |
|
1490 | 1490 | } |
1491 | 1491 | |
1492 | 1492 | add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10); |
@@ -1512,168 +1512,168 @@ discard block |
||
1512 | 1512 | */ |
1513 | 1513 | function geodir_action_listings_title() |
1514 | 1514 | { |
1515 | - global $wp, $term; |
|
1516 | - |
|
1517 | - $gd_post_type = geodir_get_current_posttype(); |
|
1518 | - $post_type_info = get_post_type_object($gd_post_type); |
|
1519 | - |
|
1520 | - $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
1521 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
1522 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
1523 | - } |
|
1524 | - |
|
1525 | - $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory'); |
|
1526 | - $single_name = $post_type_info->labels->singular_name; |
|
1527 | - |
|
1528 | - $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
1529 | - |
|
1530 | - $gd_country = get_query_var('gd_country'); |
|
1531 | - $gd_region = get_query_var('gd_region'); |
|
1532 | - $gd_city = get_query_var('gd_city'); |
|
1533 | - |
|
1534 | - if (!empty($term)) { |
|
1535 | - $location_name = ''; |
|
1536 | - if ($gd_country != '' || $gd_region != '' || $gd_city != '') { |
|
1537 | - if ($gd_country != '') { |
|
1538 | - $location_name = geodir_sanitize_location_name('gd_country', $gd_country); |
|
1539 | - } |
|
1540 | - |
|
1541 | - if ($gd_region != '') { |
|
1542 | - $location_name = geodir_sanitize_location_name('gd_region', $gd_region); |
|
1543 | - } |
|
1544 | - |
|
1545 | - if ($gd_city != '') { |
|
1546 | - $location_name = geodir_sanitize_location_name('gd_city', $gd_city); |
|
1547 | - } |
|
1548 | - } |
|
1549 | - |
|
1550 | - $current_term = get_term_by('slug', $term, $taxonomy[0]); |
|
1551 | - if (!empty($current_term)) { |
|
1552 | - $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory'); |
|
1553 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1554 | - $location_last_char = substr($location_name, -1); |
|
1555 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
|
1556 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1557 | - } else { |
|
1558 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1559 | - } |
|
1560 | - } else { |
|
1561 | - if (count($taxonomy) > 1) { |
|
1562 | - $current_term = get_term_by('slug', $term, $taxonomy[1]); |
|
1563 | - |
|
1564 | - if (!empty($current_term)) { |
|
1565 | - $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory'); |
|
1566 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1567 | - $location_last_char = substr($location_name, -1); |
|
1568 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
|
1569 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1570 | - } else { |
|
1571 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1572 | - } |
|
1573 | - } |
|
1574 | - } |
|
1575 | - } |
|
1515 | + global $wp, $term; |
|
1576 | 1516 | |
1577 | - } else { |
|
1578 | - $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
1579 | - $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
1580 | - $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
1517 | + $gd_post_type = geodir_get_current_posttype(); |
|
1518 | + $post_type_info = get_post_type_object($gd_post_type); |
|
1581 | 1519 | |
1582 | - $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
1520 | + $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
1521 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
1522 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
1523 | + } |
|
1583 | 1524 | |
1584 | - if (function_exists('get_actual_location_name')) { |
|
1585 | - $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country; |
|
1586 | - $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region; |
|
1587 | - $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city; |
|
1588 | - } |
|
1525 | + $list_title = $add_string_in_title . __($post_type_info->labels->name, 'geodirectory'); |
|
1526 | + $single_name = $post_type_info->labels->singular_name; |
|
1589 | 1527 | |
1590 | - if ($gd_city != '') { |
|
1591 | - if ($gd_city_actual != '') { |
|
1592 | - $gd_city = $gd_city_actual; |
|
1593 | - } else { |
|
1594 | - $gd_city = preg_replace('/-(\d+)$/', '', $gd_city); |
|
1595 | - $gd_city = preg_replace('/[_-]/', ' ', $gd_city); |
|
1596 | - $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
1597 | - } |
|
1528 | + $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
1598 | 1529 | |
1599 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'"; |
|
1600 | - } else if ($gd_region != '') { |
|
1601 | - if ($gd_region_actual != '') { |
|
1602 | - $gd_region = $gd_region_actual; |
|
1603 | - } else { |
|
1604 | - $gd_region = preg_replace('/-(\d+)$/', '', $gd_region); |
|
1605 | - $gd_region = preg_replace('/[_-]/', ' ', $gd_region); |
|
1606 | - $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
1607 | - } |
|
1530 | + $gd_country = get_query_var('gd_country'); |
|
1531 | + $gd_region = get_query_var('gd_region'); |
|
1532 | + $gd_city = get_query_var('gd_city'); |
|
1608 | 1533 | |
1609 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'"; |
|
1610 | - } else if ($gd_country != '') { |
|
1611 | - if ($gd_country_actual != '') { |
|
1612 | - $gd_country = $gd_country_actual; |
|
1613 | - } else { |
|
1614 | - $gd_country = preg_replace('/-(\d+)$/', '', $gd_country); |
|
1615 | - $gd_country = preg_replace('/[_-]/', ' ', $gd_country); |
|
1616 | - $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
1617 | - } |
|
1618 | - |
|
1619 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'"; |
|
1620 | - } |
|
1621 | - } |
|
1622 | - |
|
1623 | - if (is_search()) { |
|
1624 | - $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
1625 | - } |
|
1626 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1627 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
1628 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1629 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
1630 | - |
|
1631 | - |
|
1632 | - $title = $list_title; |
|
1633 | - $gd_page = ''; |
|
1634 | - if(geodir_is_page('pt')){ |
|
1635 | - $gd_page = 'pt'; |
|
1636 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title; |
|
1637 | - } |
|
1638 | - elseif(geodir_is_page('listing')){ |
|
1639 | - $gd_page = 'listing'; |
|
1640 | - global $wp_query; |
|
1641 | - $current_term = $wp_query->get_queried_object(); |
|
1642 | - if (strpos($current_term->taxonomy,'_tags') !== false) { |
|
1643 | - $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title; |
|
1644 | - }else{ |
|
1645 | - $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title; |
|
1646 | - } |
|
1534 | + if (!empty($term)) { |
|
1535 | + $location_name = ''; |
|
1536 | + if ($gd_country != '' || $gd_region != '' || $gd_city != '') { |
|
1537 | + if ($gd_country != '') { |
|
1538 | + $location_name = geodir_sanitize_location_name('gd_country', $gd_country); |
|
1539 | + } |
|
1647 | 1540 | |
1648 | - } |
|
1649 | - elseif(geodir_is_page('author')){ |
|
1650 | - $gd_page = 'author'; |
|
1651 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
1652 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
|
1653 | - }else{ |
|
1654 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
|
1655 | - } |
|
1541 | + if ($gd_region != '') { |
|
1542 | + $location_name = geodir_sanitize_location_name('gd_region', $gd_region); |
|
1543 | + } |
|
1656 | 1544 | |
1657 | - } |
|
1545 | + if ($gd_city != '') { |
|
1546 | + $location_name = geodir_sanitize_location_name('gd_city', $gd_city); |
|
1547 | + } |
|
1548 | + } |
|
1549 | + |
|
1550 | + $current_term = get_term_by('slug', $term, $taxonomy[0]); |
|
1551 | + if (!empty($current_term)) { |
|
1552 | + $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory'); |
|
1553 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1554 | + $location_last_char = substr($location_name, -1); |
|
1555 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
|
1556 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1557 | + } else { |
|
1558 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1559 | + } |
|
1560 | + } else { |
|
1561 | + if (count($taxonomy) > 1) { |
|
1562 | + $current_term = get_term_by('slug', $term, $taxonomy[1]); |
|
1563 | + |
|
1564 | + if (!empty($current_term)) { |
|
1565 | + $current_term_name = __(geodir_utf8_ucfirst($current_term->name), 'geodirectory'); |
|
1566 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1567 | + $location_last_char = substr($location_name, -1); |
|
1568 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
|
1569 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1570 | + } else { |
|
1571 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1572 | + } |
|
1573 | + } |
|
1574 | + } |
|
1575 | + } |
|
1576 | + |
|
1577 | + } else { |
|
1578 | + $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
1579 | + $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
1580 | + $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
1581 | + |
|
1582 | + $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
1583 | + |
|
1584 | + if (function_exists('get_actual_location_name')) { |
|
1585 | + $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country; |
|
1586 | + $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region; |
|
1587 | + $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city; |
|
1588 | + } |
|
1589 | + |
|
1590 | + if ($gd_city != '') { |
|
1591 | + if ($gd_city_actual != '') { |
|
1592 | + $gd_city = $gd_city_actual; |
|
1593 | + } else { |
|
1594 | + $gd_city = preg_replace('/-(\d+)$/', '', $gd_city); |
|
1595 | + $gd_city = preg_replace('/[_-]/', ' ', $gd_city); |
|
1596 | + $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
1597 | + } |
|
1658 | 1598 | |
1599 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'"; |
|
1600 | + } else if ($gd_region != '') { |
|
1601 | + if ($gd_region_actual != '') { |
|
1602 | + $gd_region = $gd_region_actual; |
|
1603 | + } else { |
|
1604 | + $gd_region = preg_replace('/-(\d+)$/', '', $gd_region); |
|
1605 | + $gd_region = preg_replace('/[_-]/', ' ', $gd_region); |
|
1606 | + $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
1607 | + } |
|
1659 | 1608 | |
1660 | - /** |
|
1661 | - * Filter page title to replace variables. |
|
1662 | - * |
|
1663 | - * @since 1.5.4 |
|
1664 | - * @param string $title The page title including variables. |
|
1665 | - * @param string $gd_page The GeoDirectory page type if any. |
|
1666 | - */ |
|
1667 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
1609 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'"; |
|
1610 | + } else if ($gd_country != '') { |
|
1611 | + if ($gd_country_actual != '') { |
|
1612 | + $gd_country = $gd_country_actual; |
|
1613 | + } else { |
|
1614 | + $gd_country = preg_replace('/-(\d+)$/', '', $gd_country); |
|
1615 | + $gd_country = preg_replace('/[_-]/', ' ', $gd_country); |
|
1616 | + $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
1617 | + } |
|
1668 | 1618 | |
1669 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
1670 | - /** |
|
1671 | - * Filter the listing page title. |
|
1672 | - * |
|
1673 | - * @since 1.0.0 |
|
1674 | - * @param string $list_title The title for the category page. |
|
1675 | - */ |
|
1676 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>'; |
|
1619 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'"; |
|
1620 | + } |
|
1621 | + } |
|
1622 | + |
|
1623 | + if (is_search()) { |
|
1624 | + $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
1625 | + } |
|
1626 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1627 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
1628 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1629 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
1630 | + |
|
1631 | + |
|
1632 | + $title = $list_title; |
|
1633 | + $gd_page = ''; |
|
1634 | + if(geodir_is_page('pt')){ |
|
1635 | + $gd_page = 'pt'; |
|
1636 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title; |
|
1637 | + } |
|
1638 | + elseif(geodir_is_page('listing')){ |
|
1639 | + $gd_page = 'listing'; |
|
1640 | + global $wp_query; |
|
1641 | + $current_term = $wp_query->get_queried_object(); |
|
1642 | + if (strpos($current_term->taxonomy,'_tags') !== false) { |
|
1643 | + $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title; |
|
1644 | + }else{ |
|
1645 | + $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title; |
|
1646 | + } |
|
1647 | + |
|
1648 | + } |
|
1649 | + elseif(geodir_is_page('author')){ |
|
1650 | + $gd_page = 'author'; |
|
1651 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
1652 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
|
1653 | + }else{ |
|
1654 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
|
1655 | + } |
|
1656 | + |
|
1657 | + } |
|
1658 | + |
|
1659 | + |
|
1660 | + /** |
|
1661 | + * Filter page title to replace variables. |
|
1662 | + * |
|
1663 | + * @since 1.5.4 |
|
1664 | + * @param string $title The page title including variables. |
|
1665 | + * @param string $gd_page The GeoDirectory page type if any. |
|
1666 | + */ |
|
1667 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
1668 | + |
|
1669 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
1670 | + /** |
|
1671 | + * Filter the listing page title. |
|
1672 | + * |
|
1673 | + * @since 1.0.0 |
|
1674 | + * @param string $list_title The title for the category page. |
|
1675 | + */ |
|
1676 | + apply_filters('geodir_listing_page_title', $title) . '</h1></header>'; |
|
1677 | 1677 | } |
1678 | 1678 | |
1679 | 1679 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10); |
@@ -1686,46 +1686,46 @@ discard block |
||
1686 | 1686 | */ |
1687 | 1687 | function geodir_action_listings_description() |
1688 | 1688 | { |
1689 | - global $wp_query; |
|
1690 | - $current_term = $wp_query->get_queried_object(); |
|
1689 | + global $wp_query; |
|
1690 | + $current_term = $wp_query->get_queried_object(); |
|
1691 | 1691 | |
1692 | - $gd_post_type = geodir_get_current_posttype(); |
|
1693 | - if (isset($current_term->term_id) && $current_term->term_id != '') { |
|
1692 | + $gd_post_type = geodir_get_current_posttype(); |
|
1693 | + if (isset($current_term->term_id) && $current_term->term_id != '') { |
|
1694 | 1694 | |
1695 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
1696 | - $saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
1697 | - if ($term_desc && !$saved_data) { |
|
1698 | - $saved_data = $term_desc; |
|
1699 | - } |
|
1695 | + $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
1696 | + $saved_data = stripslashes(geodir_get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
1697 | + if ($term_desc && !$saved_data) { |
|
1698 | + $saved_data = $term_desc; |
|
1699 | + } |
|
1700 | 1700 | |
1701 | - // stop payment manager filtering content length |
|
1702 | - $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' ); |
|
1703 | - if ( false !== $filter_priority ) { |
|
1704 | - remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority ); |
|
1705 | - } |
|
1701 | + // stop payment manager filtering content length |
|
1702 | + $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' ); |
|
1703 | + if ( false !== $filter_priority ) { |
|
1704 | + remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority ); |
|
1705 | + } |
|
1706 | 1706 | |
1707 | - /** |
|
1708 | - * Apply the core filter `the_content` filter to the variable string. |
|
1709 | - * |
|
1710 | - * This is a WordPress core filter that does many things. |
|
1711 | - * |
|
1712 | - * @since 1.0.0 |
|
1713 | - * @param string $var The string to apply the filter to. |
|
1714 | - */ |
|
1715 | - $cat_description = apply_filters('the_content', $saved_data); |
|
1707 | + /** |
|
1708 | + * Apply the core filter `the_content` filter to the variable string. |
|
1709 | + * |
|
1710 | + * This is a WordPress core filter that does many things. |
|
1711 | + * |
|
1712 | + * @since 1.0.0 |
|
1713 | + * @param string $var The string to apply the filter to. |
|
1714 | + */ |
|
1715 | + $cat_description = apply_filters('the_content', $saved_data); |
|
1716 | 1716 | |
1717 | 1717 | |
1718 | - if ( false !== $filter_priority ) { |
|
1719 | - add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority ); |
|
1720 | - } |
|
1718 | + if ( false !== $filter_priority ) { |
|
1719 | + add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority ); |
|
1720 | + } |
|
1721 | 1721 | |
1722 | - if ($cat_description) { |
|
1723 | - ?> |
|
1722 | + if ($cat_description) { |
|
1723 | + ?> |
|
1724 | 1724 | |
1725 | 1725 | <div class="term_description"><?php echo $cat_description;?></div> <?php |
1726 | - } |
|
1726 | + } |
|
1727 | 1727 | |
1728 | - } |
|
1728 | + } |
|
1729 | 1729 | } |
1730 | 1730 | |
1731 | 1731 | // action for adding the listings page top widget area |
@@ -1744,11 +1744,11 @@ discard block |
||
1744 | 1744 | */ |
1745 | 1745 | function geodir_action_geodir_sidebar_listings_top() |
1746 | 1746 | { |
1747 | - if (get_option('geodir_show_listing_top_section')) { ?> |
|
1747 | + if (get_option('geodir_show_listing_top_section')) { ?> |
|
1748 | 1748 | <div |
1749 | 1749 | class="<?php |
1750 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1751 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>"> |
|
1750 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1751 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>"> |
|
1752 | 1752 | <?php dynamic_sidebar('geodir_listing_top'); ?> |
1753 | 1753 | </div><!-- clearfix ends here--> |
1754 | 1754 | <?php } |
@@ -1771,35 +1771,35 @@ discard block |
||
1771 | 1771 | */ |
1772 | 1772 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
1773 | 1773 | { |
1774 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) { |
|
1775 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1776 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) { |
|
1777 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1778 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) { |
|
1779 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1780 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) { |
|
1781 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1782 | - } else { |
|
1783 | - $width_css = ''; |
|
1784 | - } |
|
1785 | - |
|
1786 | - $tc = get_option('theme_compatibility_setting'); |
|
1787 | - if (!empty($tc['geodir_sidebar_left_open_replace'])) { |
|
1788 | - $text = $tc['geodir_sidebar_left_open_replace']; |
|
1789 | - } else { |
|
1790 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
1791 | - } |
|
1792 | - |
|
1793 | - if (!empty($tc['geodir_sidebar_left_open_id'])) { |
|
1794 | - $id = $tc['geodir_sidebar_left_open_id']; |
|
1795 | - } |
|
1796 | - if (!empty($tc['geodir_sidebar_left_open_class'])) { |
|
1797 | - $class = $tc['geodir_sidebar_left_open_class']; |
|
1798 | - } |
|
1799 | - |
|
1800 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text); |
|
1801 | - |
|
1802 | - echo $text; |
|
1774 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) { |
|
1775 | + $width_css = 'style="width:' . $width . '%;"'; |
|
1776 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) { |
|
1777 | + $width_css = 'style="width:' . $width . '%;"'; |
|
1778 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) { |
|
1779 | + $width_css = 'style="width:' . $width . '%;"'; |
|
1780 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) { |
|
1781 | + $width_css = 'style="width:' . $width . '%;"'; |
|
1782 | + } else { |
|
1783 | + $width_css = ''; |
|
1784 | + } |
|
1785 | + |
|
1786 | + $tc = get_option('theme_compatibility_setting'); |
|
1787 | + if (!empty($tc['geodir_sidebar_left_open_replace'])) { |
|
1788 | + $text = $tc['geodir_sidebar_left_open_replace']; |
|
1789 | + } else { |
|
1790 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
1791 | + } |
|
1792 | + |
|
1793 | + if (!empty($tc['geodir_sidebar_left_open_id'])) { |
|
1794 | + $id = $tc['geodir_sidebar_left_open_id']; |
|
1795 | + } |
|
1796 | + if (!empty($tc['geodir_sidebar_left_open_class'])) { |
|
1797 | + $class = $tc['geodir_sidebar_left_open_class']; |
|
1798 | + } |
|
1799 | + |
|
1800 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text); |
|
1801 | + |
|
1802 | + echo $text; |
|
1803 | 1803 | } |
1804 | 1804 | |
1805 | 1805 | // action for adding the primary div closing tag |
@@ -1815,13 +1815,13 @@ discard block |
||
1815 | 1815 | */ |
1816 | 1816 | function geodir_action_sidebar_left_close($type = '') |
1817 | 1817 | { |
1818 | - $tc = get_option('theme_compatibility_setting'); |
|
1819 | - if (!empty($tc['geodir_sidebar_left_close_replace'])) { |
|
1820 | - $text = $tc['geodir_sidebar_left_close_replace']; |
|
1821 | - } else { |
|
1822 | - $text = '</aside><!-- sidebar ends here-->'; |
|
1823 | - } |
|
1824 | - echo $text; |
|
1818 | + $tc = get_option('theme_compatibility_setting'); |
|
1819 | + if (!empty($tc['geodir_sidebar_left_close_replace'])) { |
|
1820 | + $text = $tc['geodir_sidebar_left_close_replace']; |
|
1821 | + } else { |
|
1822 | + $text = '</aside><!-- sidebar ends here-->'; |
|
1823 | + } |
|
1824 | + echo $text; |
|
1825 | 1825 | } |
1826 | 1826 | |
1827 | 1827 | /** |
@@ -1834,7 +1834,7 @@ discard block |
||
1834 | 1834 | */ |
1835 | 1835 | function geodir_listing_left_section() |
1836 | 1836 | { |
1837 | - if (get_option('geodir_show_listing_left_section')) { ?> |
|
1837 | + if (get_option('geodir_show_listing_left_section')) { ?> |
|
1838 | 1838 | <div class="geodir-content-left geodir-sidebar-wrap"> |
1839 | 1839 | <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?> |
1840 | 1840 | </div><!-- end geodir-content-left --> |
@@ -1852,20 +1852,20 @@ discard block |
||
1852 | 1852 | */ |
1853 | 1853 | function geodir_action_listings_sidebar_left() |
1854 | 1854 | { |
1855 | - if (get_option('geodir_show_listing_left_section')) { |
|
1856 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1857 | - do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar'); |
|
1858 | - /** |
|
1859 | - * Calls the listings page (category) left sidebar content. |
|
1860 | - * |
|
1861 | - * All the content for the listings page left sidebar is added via this hook. |
|
1862 | - * |
|
1863 | - * @since 1.0.0 |
|
1864 | - */ |
|
1865 | - do_action('geodir_listings_sidebar_left_inside'); |
|
1866 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1867 | - do_action('geodir_sidebar_left_close', 'listings-page'); |
|
1868 | - } |
|
1855 | + if (get_option('geodir_show_listing_left_section')) { |
|
1856 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1857 | + do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar'); |
|
1858 | + /** |
|
1859 | + * Calls the listings page (category) left sidebar content. |
|
1860 | + * |
|
1861 | + * All the content for the listings page left sidebar is added via this hook. |
|
1862 | + * |
|
1863 | + * @since 1.0.0 |
|
1864 | + */ |
|
1865 | + do_action('geodir_listings_sidebar_left_inside'); |
|
1866 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1867 | + do_action('geodir_sidebar_left_close', 'listings-page'); |
|
1868 | + } |
|
1869 | 1869 | } |
1870 | 1870 | |
1871 | 1871 | /** |
@@ -1878,7 +1878,7 @@ discard block |
||
1878 | 1878 | */ |
1879 | 1879 | function geodir_listing_right_section() |
1880 | 1880 | { |
1881 | - if (get_option('geodir_show_listing_right_section')) { ?> |
|
1881 | + if (get_option('geodir_show_listing_right_section')) { ?> |
|
1882 | 1882 | <div class="geodir-content-right geodir-sidebar-wrap"> |
1883 | 1883 | <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?> |
1884 | 1884 | </div><!-- end geodir-content-right --> |
@@ -1896,20 +1896,20 @@ discard block |
||
1896 | 1896 | */ |
1897 | 1897 | function geodir_action_listings_sidebar_right() |
1898 | 1898 | { |
1899 | - if (get_option('geodir_show_listing_right_section')) { |
|
1900 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1901 | - do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
1902 | - /** |
|
1903 | - * Calls the listings page (category) right sidebar content. |
|
1904 | - * |
|
1905 | - * All the content for the listings page right sidebar is added via this hook. |
|
1906 | - * |
|
1907 | - * @since 1.0.0 |
|
1908 | - */ |
|
1909 | - do_action('geodir_listings_sidebar_right_inside'); |
|
1910 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1911 | - do_action('geodir_sidebar_right_close', 'listings-page'); |
|
1912 | - } |
|
1899 | + if (get_option('geodir_show_listing_right_section')) { |
|
1900 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1901 | + do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
1902 | + /** |
|
1903 | + * Calls the listings page (category) right sidebar content. |
|
1904 | + * |
|
1905 | + * All the content for the listings page right sidebar is added via this hook. |
|
1906 | + * |
|
1907 | + * @since 1.0.0 |
|
1908 | + */ |
|
1909 | + do_action('geodir_listings_sidebar_right_inside'); |
|
1910 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1911 | + do_action('geodir_sidebar_right_close', 'listings-page'); |
|
1912 | + } |
|
1913 | 1913 | } |
1914 | 1914 | |
1915 | 1915 | |
@@ -1926,23 +1926,23 @@ discard block |
||
1926 | 1926 | */ |
1927 | 1927 | function geodir_action_main_content_open($type = '', $id = '', $class = '') |
1928 | 1928 | { |
1929 | - $tc = get_option('theme_compatibility_setting'); |
|
1930 | - if (!empty($tc['geodir_main_content_open_replace'])) { |
|
1931 | - $text = $tc['geodir_main_content_open_replace']; |
|
1932 | - } else { |
|
1933 | - $text = '<main id="[id]" class="[class]" role="main">'; |
|
1934 | - } |
|
1929 | + $tc = get_option('theme_compatibility_setting'); |
|
1930 | + if (!empty($tc['geodir_main_content_open_replace'])) { |
|
1931 | + $text = $tc['geodir_main_content_open_replace']; |
|
1932 | + } else { |
|
1933 | + $text = '<main id="[id]" class="[class]" role="main">'; |
|
1934 | + } |
|
1935 | 1935 | |
1936 | - if (!empty($tc['geodir_main_content_open_id'])) { |
|
1937 | - $id = $tc['geodir_main_content_open_id']; |
|
1938 | - } |
|
1939 | - if (!empty($tc['geodir_main_content_open_class'])) { |
|
1940 | - $class = $tc['geodir_main_content_open_class']; |
|
1941 | - } |
|
1936 | + if (!empty($tc['geodir_main_content_open_id'])) { |
|
1937 | + $id = $tc['geodir_main_content_open_id']; |
|
1938 | + } |
|
1939 | + if (!empty($tc['geodir_main_content_open_class'])) { |
|
1940 | + $class = $tc['geodir_main_content_open_class']; |
|
1941 | + } |
|
1942 | 1942 | |
1943 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text); |
|
1943 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text); |
|
1944 | 1944 | |
1945 | - echo $text; |
|
1945 | + echo $text; |
|
1946 | 1946 | } |
1947 | 1947 | |
1948 | 1948 | // action for adding the primary div closing tag |
@@ -1955,13 +1955,13 @@ discard block |
||
1955 | 1955 | */ |
1956 | 1956 | function geodir_action_main_content_close() |
1957 | 1957 | { |
1958 | - $tc = get_option('theme_compatibility_setting'); |
|
1959 | - if (!empty($tc['geodir_main_content_close_replace'])) { |
|
1960 | - $text = $tc['geodir_main_content_close_replace']; |
|
1961 | - } else { |
|
1962 | - $text = '</main><!-- main ends here-->'; |
|
1963 | - } |
|
1964 | - echo $text; |
|
1958 | + $tc = get_option('theme_compatibility_setting'); |
|
1959 | + if (!empty($tc['geodir_main_content_close_replace'])) { |
|
1960 | + $text = $tc['geodir_main_content_close_replace']; |
|
1961 | + } else { |
|
1962 | + $text = '</main><!-- main ends here-->'; |
|
1963 | + } |
|
1964 | + echo $text; |
|
1965 | 1965 | } |
1966 | 1966 | |
1967 | 1967 | /** |
@@ -1973,14 +1973,14 @@ discard block |
||
1973 | 1973 | */ |
1974 | 1974 | function geodir_action_listings_content_inside() |
1975 | 1975 | { |
1976 | - global $gridview_columns; |
|
1977 | - $listing_view = get_option('geodir_listing_view'); |
|
1978 | - if (strstr($listing_view, 'gridview')) { |
|
1979 | - $gridview_columns = $listing_view; |
|
1980 | - $listing_view_exp = explode('_', $listing_view); |
|
1981 | - $listing_view = $listing_view_exp[0]; |
|
1982 | - } |
|
1983 | - geodir_get_template_part('listing', 'listview'); |
|
1976 | + global $gridview_columns; |
|
1977 | + $listing_view = get_option('geodir_listing_view'); |
|
1978 | + if (strstr($listing_view, 'gridview')) { |
|
1979 | + $gridview_columns = $listing_view; |
|
1980 | + $listing_view_exp = explode('_', $listing_view); |
|
1981 | + $listing_view = $listing_view_exp[0]; |
|
1982 | + } |
|
1983 | + geodir_get_template_part('listing', 'listview'); |
|
1984 | 1984 | } |
1985 | 1985 | |
1986 | 1986 | add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10); |
@@ -1996,47 +1996,47 @@ discard block |
||
1996 | 1996 | */ |
1997 | 1997 | function geodir_action_listings_content() |
1998 | 1998 | { |
1999 | - /** |
|
2000 | - * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
2001 | - * |
|
2002 | - * @since 1.0.0 |
|
2003 | - * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
2004 | - * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
2005 | - * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
2006 | - * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
2007 | - */ |
|
2008 | - do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page'); |
|
2009 | - $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page'); |
|
2010 | - echo '<div class="clearfix '.$extra_class.'">'; |
|
2011 | - /** |
|
2012 | - * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
2013 | - * |
|
2014 | - * @since 1.0.0 |
|
2015 | - */ |
|
2016 | - do_action('geodir_before_listing'); |
|
2017 | - echo '</div>'; |
|
2018 | - |
|
2019 | - /** |
|
2020 | - * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
2021 | - * |
|
2022 | - * @since 1.0.0 |
|
2023 | - */ |
|
2024 | - do_action('geodir_listings_content_inside'); |
|
2025 | - |
|
2026 | - /** |
|
2027 | - * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
2028 | - * |
|
2029 | - * @since 1.0.0 |
|
2030 | - */ |
|
2031 | - do_action('geodir_after_listing'); |
|
2032 | - |
|
2033 | - /** |
|
2034 | - * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
2035 | - * |
|
2036 | - * @since 1.0.0 |
|
2037 | - * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
2038 | - */ |
|
2039 | - do_action('geodir_main_content_close', 'listings-page'); |
|
1999 | + /** |
|
2000 | + * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
2001 | + * |
|
2002 | + * @since 1.0.0 |
|
2003 | + * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
2004 | + * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
2005 | + * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
2006 | + * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
2007 | + */ |
|
2008 | + do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page'); |
|
2009 | + $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page'); |
|
2010 | + echo '<div class="clearfix '.$extra_class.'">'; |
|
2011 | + /** |
|
2012 | + * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
2013 | + * |
|
2014 | + * @since 1.0.0 |
|
2015 | + */ |
|
2016 | + do_action('geodir_before_listing'); |
|
2017 | + echo '</div>'; |
|
2018 | + |
|
2019 | + /** |
|
2020 | + * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
2021 | + * |
|
2022 | + * @since 1.0.0 |
|
2023 | + */ |
|
2024 | + do_action('geodir_listings_content_inside'); |
|
2025 | + |
|
2026 | + /** |
|
2027 | + * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
2028 | + * |
|
2029 | + * @since 1.0.0 |
|
2030 | + */ |
|
2031 | + do_action('geodir_after_listing'); |
|
2032 | + |
|
2033 | + /** |
|
2034 | + * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
2035 | + * |
|
2036 | + * @since 1.0.0 |
|
2037 | + * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
2038 | + */ |
|
2039 | + do_action('geodir_main_content_close', 'listings-page'); |
|
2040 | 2040 | } |
2041 | 2041 | |
2042 | 2042 | |
@@ -2051,10 +2051,10 @@ discard block |
||
2051 | 2051 | */ |
2052 | 2052 | function geodir_action_sidebar_listings_bottom_section() |
2053 | 2053 | { |
2054 | - if (get_option('geodir_show_listing_bottom_section')) { ?> |
|
2054 | + if (get_option('geodir_show_listing_bottom_section')) { ?> |
|
2055 | 2055 | <div class="<?php |
2056 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2057 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>"> |
|
2056 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2057 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>"> |
|
2058 | 2058 | <?php dynamic_sidebar('geodir_listing_bottom'); ?> |
2059 | 2059 | </div><!-- clearfix ends here--> |
2060 | 2060 | <?php } |
@@ -2074,38 +2074,38 @@ discard block |
||
2074 | 2074 | */ |
2075 | 2075 | function geodir_action_add_listing_page_title() |
2076 | 2076 | { |
2077 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
2078 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2079 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2080 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2081 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2082 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2083 | - |
|
2084 | - $title = apply_filters('geodir_add_listing_page_title_text', get_the_title()); |
|
2085 | - |
|
2086 | - if(geodir_is_page('add-listing')){ |
|
2087 | - $gd_page = 'add-listing'; |
|
2088 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){ |
|
2089 | - $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title; |
|
2090 | - }elseif(isset($listing_type)){ |
|
2091 | - $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title; |
|
2092 | - } |
|
2077 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
2078 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2079 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2080 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2081 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2082 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2083 | + |
|
2084 | + $title = apply_filters('geodir_add_listing_page_title_text', get_the_title()); |
|
2085 | + |
|
2086 | + if(geodir_is_page('add-listing')){ |
|
2087 | + $gd_page = 'add-listing'; |
|
2088 | + if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){ |
|
2089 | + $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title; |
|
2090 | + }elseif(isset($listing_type)){ |
|
2091 | + $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title; |
|
2092 | + } |
|
2093 | 2093 | |
2094 | - } |
|
2094 | + } |
|
2095 | 2095 | |
2096 | 2096 | |
2097 | - /** |
|
2098 | - * Filter page title to replace variables. |
|
2099 | - * |
|
2100 | - * @since 1.5.4 |
|
2101 | - * @param string $title The page title including variables. |
|
2102 | - * @param string $gd_page The GeoDirectory page type if any. |
|
2103 | - */ |
|
2104 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2097 | + /** |
|
2098 | + * Filter page title to replace variables. |
|
2099 | + * |
|
2100 | + * @since 1.5.4 |
|
2101 | + * @param string $title The page title including variables. |
|
2102 | + * @param string $gd_page The GeoDirectory page type if any. |
|
2103 | + */ |
|
2104 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2105 | 2105 | |
2106 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
2107 | - echo $title; |
|
2108 | - echo '</h1></header>'; |
|
2106 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
2107 | + echo $title; |
|
2108 | + echo '</h1></header>'; |
|
2109 | 2109 | } |
2110 | 2110 | |
2111 | 2111 | add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10); |
@@ -2136,61 +2136,61 @@ discard block |
||
2136 | 2136 | */ |
2137 | 2137 | function geodir_action_add_listing_form() |
2138 | 2138 | { |
2139 | - global $cat_display, $post_cat, $current_user, $gd_session; |
|
2140 | - $page_id = get_the_ID(); |
|
2141 | - $post = ''; |
|
2142 | - $title = ''; |
|
2143 | - $desc = ''; |
|
2144 | - $kw_tags = ''; |
|
2145 | - $required_msg = ''; |
|
2146 | - $submit_button = ''; |
|
2147 | - |
|
2148 | - $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
2149 | - |
|
2150 | - $thumb_img_arr = array(); |
|
2151 | - $curImages = ''; |
|
2152 | - |
|
2153 | - if (isset($_REQUEST['backandedit'])) { |
|
2154 | - global $post; |
|
2155 | - $post = (object)$gd_session->get('listing'); |
|
2156 | - $listing_type = $post->listing_type; |
|
2157 | - $title = $post->post_title; |
|
2158 | - $desc = $post->post_desc; |
|
2159 | - $post_cat = isset($post->post_category) ? $post->post_category : ''; |
|
2160 | - |
|
2161 | - $kw_tags = $post->post_tags; |
|
2162 | - $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
2163 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2164 | - global $post, $post_images; |
|
2165 | - |
|
2166 | - $post = geodir_get_post_info($_REQUEST['pid']); |
|
2167 | - $thumb_img_arr = geodir_get_images($post->ID); |
|
2168 | - if ($thumb_img_arr) { |
|
2169 | - foreach ($thumb_img_arr as $post_img) { |
|
2170 | - $curImages .= $post_img->src . ','; |
|
2171 | - } |
|
2172 | - } |
|
2139 | + global $cat_display, $post_cat, $current_user, $gd_session; |
|
2140 | + $page_id = get_the_ID(); |
|
2141 | + $post = ''; |
|
2142 | + $title = ''; |
|
2143 | + $desc = ''; |
|
2144 | + $kw_tags = ''; |
|
2145 | + $required_msg = ''; |
|
2146 | + $submit_button = ''; |
|
2147 | + |
|
2148 | + $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
2149 | + |
|
2150 | + $thumb_img_arr = array(); |
|
2151 | + $curImages = ''; |
|
2152 | + |
|
2153 | + if (isset($_REQUEST['backandedit'])) { |
|
2154 | + global $post; |
|
2155 | + $post = (object)$gd_session->get('listing'); |
|
2156 | + $listing_type = $post->listing_type; |
|
2157 | + $title = $post->post_title; |
|
2158 | + $desc = $post->post_desc; |
|
2159 | + $post_cat = isset($post->post_category) ? $post->post_category : ''; |
|
2160 | + |
|
2161 | + $kw_tags = $post->post_tags; |
|
2162 | + $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
2163 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2164 | + global $post, $post_images; |
|
2165 | + |
|
2166 | + $post = geodir_get_post_info($_REQUEST['pid']); |
|
2167 | + $thumb_img_arr = geodir_get_images($post->ID); |
|
2168 | + if ($thumb_img_arr) { |
|
2169 | + foreach ($thumb_img_arr as $post_img) { |
|
2170 | + $curImages .= $post_img->src . ','; |
|
2171 | + } |
|
2172 | + } |
|
2173 | 2173 | |
2174 | - $listing_type = $post->post_type; |
|
2175 | - $title = $post->post_title; |
|
2176 | - $desc = $post->post_content; |
|
2177 | - $kw_tags = $post->post_tags; |
|
2178 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names'))); |
|
2179 | - } else { |
|
2180 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2181 | - } |
|
2174 | + $listing_type = $post->post_type; |
|
2175 | + $title = $post->post_title; |
|
2176 | + $desc = $post->post_content; |
|
2177 | + $kw_tags = $post->post_tags; |
|
2178 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names'))); |
|
2179 | + } else { |
|
2180 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2181 | + } |
|
2182 | 2182 | |
2183 | - if ($current_user->ID != '0') { |
|
2184 | - $user_login = true; |
|
2185 | - } |
|
2183 | + if ($current_user->ID != '0') { |
|
2184 | + $user_login = true; |
|
2185 | + } |
|
2186 | 2186 | |
2187 | - $post_type_info = geodir_get_posttype_info($listing_type); |
|
2187 | + $post_type_info = geodir_get_posttype_info($listing_type); |
|
2188 | 2188 | |
2189 | - $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory'); |
|
2189 | + $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? __($post_type_info['labels']['singular_name'], 'geodirectory') : __('Listing','geodirectory'); |
|
2190 | 2190 | |
2191 | - $package_info = array(); |
|
2192 | - $package_info = geodir_post_package_info($package_info, $post); |
|
2193 | - ?> |
|
2191 | + $package_info = array(); |
|
2192 | + $package_info = geodir_post_package_info($package_info, $post); |
|
2193 | + ?> |
|
2194 | 2194 | <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
2195 | 2195 | <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
2196 | 2196 | <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
@@ -2201,114 +2201,114 @@ discard block |
||
2201 | 2201 | <?php } if (isset($_REQUEST['backandedit'])) { ?> |
2202 | 2202 | <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
2203 | 2203 | <?php |
2204 | - } |
|
2205 | - /** |
|
2206 | - * Called at the very top of the add listing page form for frontend. |
|
2207 | - * |
|
2208 | - * This is called just before the "Enter Listing Details" text. |
|
2209 | - * |
|
2210 | - * @since 1.0.0 |
|
2211 | - */ |
|
2212 | - do_action('geodir_before_detail_fields'); |
|
2213 | - ?> |
|
2204 | + } |
|
2205 | + /** |
|
2206 | + * Called at the very top of the add listing page form for frontend. |
|
2207 | + * |
|
2208 | + * This is called just before the "Enter Listing Details" text. |
|
2209 | + * |
|
2210 | + * @since 1.0.0 |
|
2211 | + */ |
|
2212 | + do_action('geodir_before_detail_fields'); |
|
2213 | + ?> |
|
2214 | 2214 | <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
2215 | 2215 | <?php |
2216 | - /** |
|
2217 | - * Called at the top of the add listing page form for frontend. |
|
2218 | - * |
|
2219 | - * This is called after the "Enter Listing Details" text. |
|
2220 | - * |
|
2221 | - * @since 1.0.0 |
|
2222 | - */ |
|
2223 | - do_action('geodir_before_main_form_fields'); |
|
2224 | - ?> |
|
2216 | + /** |
|
2217 | + * Called at the top of the add listing page form for frontend. |
|
2218 | + * |
|
2219 | + * This is called after the "Enter Listing Details" text. |
|
2220 | + * |
|
2221 | + * @since 1.0.0 |
|
2222 | + */ |
|
2223 | + do_action('geodir_before_main_form_fields'); |
|
2224 | + ?> |
|
2225 | 2225 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
2226 | 2226 | <label><?php |
2227 | - /** |
|
2228 | - * Filter the add listing page title input label. |
|
2229 | - * |
|
2230 | - * @since 1.6.11 |
|
2231 | - * @param string $title The title to be output. |
|
2232 | - * @param string $cpt_singular_name The singular title of the curent CPT. |
|
2233 | - * @param string $listing_type The CPT being requested. ie: gd_place. |
|
2234 | - */ |
|
2235 | - echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label> |
|
2227 | + /** |
|
2228 | + * Filter the add listing page title input label. |
|
2229 | + * |
|
2230 | + * @since 1.6.11 |
|
2231 | + * @param string $title The title to be output. |
|
2232 | + * @param string $cpt_singular_name The singular title of the curent CPT. |
|
2233 | + * @param string $listing_type The CPT being requested. ie: gd_place. |
|
2234 | + */ |
|
2235 | + echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label> |
|
2236 | 2236 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
2237 | 2237 | value="<?php echo esc_attr(stripslashes($title)); ?>"/> |
2238 | 2238 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
2239 | 2239 | </div> |
2240 | 2240 | <?php |
2241 | - $show_editor = get_option('geodir_tiny_editor_on_add_listing'); |
|
2242 | - $show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false; |
|
2243 | - /** |
|
2244 | - * Filter whether to show or don't show the editor. |
|
2245 | - * |
|
2246 | - * @since 1.6.16 |
|
2247 | - * @param bool $show_editor If true the editor will be available for description field. |
|
2248 | - * @param object $package_info The listing package. |
|
2249 | - * @param string $listing_type The current post type. |
|
2250 | - * @param object $post The current post object. |
|
2251 | - */ |
|
2252 | - $show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post); |
|
2253 | - |
|
2254 | - $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
2255 | - $desc_limit = ''; |
|
2256 | - /** |
|
2257 | - * Filter the add listing description field character limit number. |
|
2258 | - * |
|
2259 | - * @since 1.0.0 |
|
2260 | - * @param int $desc_limit The amount of characters to limit the description to. |
|
2261 | - */ |
|
2262 | - $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit); |
|
2263 | - /** |
|
2264 | - * Filter the add listing description field text. |
|
2265 | - * |
|
2266 | - * @since 1.0.0 |
|
2267 | - * @param string $desc The text for the description field. |
|
2268 | - * @param int $desc_limit The character limit number if any. |
|
2269 | - */ |
|
2270 | - $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit); |
|
2271 | - $desc_limit_msg = ''; |
|
2272 | - /** |
|
2273 | - * Filter the add listing description limit message. |
|
2274 | - * |
|
2275 | - * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
2276 | - * |
|
2277 | - * @since 1.0.0 |
|
2278 | - * @param string $desc_limit_msg The limit message string if any. |
|
2279 | - * @param int $desc_limit The character limit numer if any. |
|
2280 | - */ |
|
2281 | - $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit); |
|
2241 | + $show_editor = get_option('geodir_tiny_editor_on_add_listing'); |
|
2242 | + $show_editor = !empty($show_editor) && in_array($listing_type, $show_editor) ? true : false; |
|
2243 | + /** |
|
2244 | + * Filter whether to show or don't show the editor. |
|
2245 | + * |
|
2246 | + * @since 1.6.16 |
|
2247 | + * @param bool $show_editor If true the editor will be available for description field. |
|
2248 | + * @param object $package_info The listing package. |
|
2249 | + * @param string $listing_type The current post type. |
|
2250 | + * @param object $post The current post object. |
|
2251 | + */ |
|
2252 | + $show_editor = apply_filters('geodir_description_field_show_editor', $show_editor, $package_info, $listing_type, $post); |
|
2253 | + |
|
2254 | + $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
2255 | + $desc_limit = ''; |
|
2256 | + /** |
|
2257 | + * Filter the add listing description field character limit number. |
|
2258 | + * |
|
2259 | + * @since 1.0.0 |
|
2260 | + * @param int $desc_limit The amount of characters to limit the description to. |
|
2261 | + */ |
|
2262 | + $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit); |
|
2263 | + /** |
|
2264 | + * Filter the add listing description field text. |
|
2265 | + * |
|
2266 | + * @since 1.0.0 |
|
2267 | + * @param string $desc The text for the description field. |
|
2268 | + * @param int $desc_limit The character limit number if any. |
|
2269 | + */ |
|
2270 | + $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit); |
|
2271 | + $desc_limit_msg = ''; |
|
2272 | + /** |
|
2273 | + * Filter the add listing description limit message. |
|
2274 | + * |
|
2275 | + * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
2276 | + * |
|
2277 | + * @since 1.0.0 |
|
2278 | + * @param string $desc_limit_msg The limit message string if any. |
|
2279 | + * @param int $desc_limit The character limit numer if any. |
|
2280 | + */ |
|
2281 | + $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit); |
|
2282 | 2282 | |
2283 | - $desc_class = ''; |
|
2284 | - if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2285 | - /** |
|
2286 | - * Called on the add listing page form for frontend just before the description field. |
|
2287 | - * |
|
2288 | - * @since 1.0.0 |
|
2289 | - */ |
|
2290 | - do_action('geodir_before_description_field'); |
|
2283 | + $desc_class = ''; |
|
2284 | + if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2285 | + /** |
|
2286 | + * Called on the add listing page form for frontend just before the description field. |
|
2287 | + * |
|
2288 | + * @since 1.0.0 |
|
2289 | + */ |
|
2290 | + do_action('geodir_before_description_field'); |
|
2291 | 2291 | |
2292 | - $desc_class = ' required_field'; |
|
2293 | - } else { |
|
2294 | - $desc_class = ' hidden'; |
|
2295 | - } |
|
2296 | - ?> |
|
2292 | + $desc_class = ' required_field'; |
|
2293 | + } else { |
|
2294 | + $desc_class = ' hidden'; |
|
2295 | + } |
|
2296 | + ?> |
|
2297 | 2297 | <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
2298 | 2298 | <label><?php |
2299 | - /** |
|
2300 | - * Filter the add listing page description input label. |
|
2301 | - * |
|
2302 | - * @since 1.6.11 |
|
2303 | - * @param string $title The title to be output. |
|
2304 | - * @param string $cpt_singular_name The singular title of the curent CPT. |
|
2305 | - * @param string $listing_type The CPT being requested. ie: gd_place. |
|
2306 | - */ |
|
2307 | - echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label> |
|
2299 | + /** |
|
2300 | + * Filter the add listing page description input label. |
|
2301 | + * |
|
2302 | + * @since 1.6.11 |
|
2303 | + * @param string $title The title to be output. |
|
2304 | + * @param string $cpt_singular_name The singular title of the curent CPT. |
|
2305 | + * @param string $listing_type The CPT being requested. ie: gd_place. |
|
2306 | + */ |
|
2307 | + echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label> |
|
2308 | 2308 | <?php |
2309 | - if ($show_editor) { |
|
2310 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); |
|
2311 | - ?> |
|
2309 | + if ($show_editor) { |
|
2310 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); |
|
2311 | + ?> |
|
2312 | 2312 | <div class="editor" field_id="post_desc" field_type="editor"> |
2313 | 2313 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
2314 | 2314 | </div> |
@@ -2322,56 +2322,56 @@ discard block |
||
2322 | 2322 | <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
2323 | 2323 | </div> |
2324 | 2324 | <?php |
2325 | - if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2326 | - /** |
|
2327 | - * Called on the add listing page form for frontend just after the description field. |
|
2328 | - * |
|
2329 | - * @since 1.0.0 |
|
2330 | - */ |
|
2331 | - do_action('geodir_after_description_field'); |
|
2332 | - } |
|
2325 | + if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2326 | + /** |
|
2327 | + * Called on the add listing page form for frontend just after the description field. |
|
2328 | + * |
|
2329 | + * @since 1.0.0 |
|
2330 | + */ |
|
2331 | + do_action('geodir_after_description_field'); |
|
2332 | + } |
|
2333 | 2333 | |
2334 | - $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
2335 | - $kw_tags_count = TAGKW_TEXT_COUNT; |
|
2336 | - $kw_tags_msg = TAGKW_MSG; |
|
2337 | - /** |
|
2338 | - * Filter the add listing tags character limit. |
|
2339 | - * |
|
2340 | - * @since 1.0.0 |
|
2341 | - * @param int $kw_tags_count The character count limit if any. |
|
2342 | - */ |
|
2343 | - $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count); |
|
2344 | - /** |
|
2345 | - * Filter the add listing tags field value. |
|
2346 | - * |
|
2347 | - * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
2348 | - * |
|
2349 | - * @since 1.0.0 |
|
2350 | - * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
2351 | - * @param int $kw_tags_count The character count limit if any. |
|
2352 | - */ |
|
2353 | - $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count); |
|
2354 | - /** |
|
2355 | - * Filter the add listing tags field message text. |
|
2356 | - * |
|
2357 | - * @since 1.0.0 |
|
2358 | - * @param string $kw_tags_msg The message shown under the field. |
|
2359 | - * @param int $kw_tags_count The character count limit if any. |
|
2360 | - */ |
|
2361 | - $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count); |
|
2334 | + $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
2335 | + $kw_tags_count = TAGKW_TEXT_COUNT; |
|
2336 | + $kw_tags_msg = TAGKW_MSG; |
|
2337 | + /** |
|
2338 | + * Filter the add listing tags character limit. |
|
2339 | + * |
|
2340 | + * @since 1.0.0 |
|
2341 | + * @param int $kw_tags_count The character count limit if any. |
|
2342 | + */ |
|
2343 | + $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count); |
|
2344 | + /** |
|
2345 | + * Filter the add listing tags field value. |
|
2346 | + * |
|
2347 | + * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
2348 | + * |
|
2349 | + * @since 1.0.0 |
|
2350 | + * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
2351 | + * @param int $kw_tags_count The character count limit if any. |
|
2352 | + */ |
|
2353 | + $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count); |
|
2354 | + /** |
|
2355 | + * Filter the add listing tags field message text. |
|
2356 | + * |
|
2357 | + * @since 1.0.0 |
|
2358 | + * @param string $kw_tags_msg The message shown under the field. |
|
2359 | + * @param int $kw_tags_count The character count limit if any. |
|
2360 | + */ |
|
2361 | + $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count); |
|
2362 | 2362 | |
2363 | - $tags_class = ''; |
|
2364 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2365 | - /** |
|
2366 | - * Called on the add listing page form for frontend just before the tags field. |
|
2367 | - * |
|
2368 | - * @since 1.0.0 |
|
2369 | - */ |
|
2370 | - do_action('geodir_before_listing_tags_field'); |
|
2371 | - } else { |
|
2372 | - $tags_class = ' hidden'; |
|
2373 | - } |
|
2374 | - ?> |
|
2363 | + $tags_class = ''; |
|
2364 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2365 | + /** |
|
2366 | + * Called on the add listing page form for frontend just before the tags field. |
|
2367 | + * |
|
2368 | + * @since 1.0.0 |
|
2369 | + */ |
|
2370 | + do_action('geodir_before_listing_tags_field'); |
|
2371 | + } else { |
|
2372 | + $tags_class = ' hidden'; |
|
2373 | + } |
|
2374 | + ?> |
|
2375 | 2375 | <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
2376 | 2376 | <label><?php echo TAGKW_TEXT; ?></label> |
2377 | 2377 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
@@ -2379,90 +2379,90 @@ discard block |
||
2379 | 2379 | <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
2380 | 2380 | </div> |
2381 | 2381 | <?php |
2382 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2383 | - /** |
|
2384 | - * Called on the add listing page form for frontend just after the tags field. |
|
2385 | - * |
|
2386 | - * @since 1.0.0 |
|
2387 | - */ |
|
2388 | - do_action('geodir_after_listing_tags_field'); |
|
2389 | - } |
|
2382 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2383 | + /** |
|
2384 | + * Called on the add listing page form for frontend just after the tags field. |
|
2385 | + * |
|
2386 | + * @since 1.0.0 |
|
2387 | + */ |
|
2388 | + do_action('geodir_after_listing_tags_field'); |
|
2389 | + } |
|
2390 | 2390 | |
2391 | - $package_info = array(); |
|
2392 | - $package_info = geodir_post_package_info($package_info, $post); |
|
2391 | + $package_info = array(); |
|
2392 | + $package_info = geodir_post_package_info($package_info, $post); |
|
2393 | 2393 | |
2394 | - geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
2394 | + geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
2395 | 2395 | |
2396 | - // adjust values here |
|
2397 | - $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
2396 | + // adjust values here |
|
2397 | + $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
2398 | 2398 | |
2399 | - $multiple = true; // allow multiple files upload |
|
2399 | + $multiple = true; // allow multiple files upload |
|
2400 | 2400 | |
2401 | - $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
2401 | + $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
2402 | 2402 | |
2403 | - $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
2403 | + $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
2404 | 2404 | |
2405 | - $thumb_img_arr = array(); |
|
2406 | - $totImg = 0; |
|
2407 | - if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) { |
|
2408 | - $post = (object)$gd_session->get('listing'); |
|
2409 | - if (isset($post->post_images)) |
|
2410 | - $curImages = trim($post->post_images, ","); |
|
2405 | + $thumb_img_arr = array(); |
|
2406 | + $totImg = 0; |
|
2407 | + if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) { |
|
2408 | + $post = (object)$gd_session->get('listing'); |
|
2409 | + if (isset($post->post_images)) |
|
2410 | + $curImages = trim($post->post_images, ","); |
|
2411 | 2411 | |
2412 | 2412 | |
2413 | - if ($curImages != '') { |
|
2414 | - $curImages_array = explode(',', $curImages); |
|
2415 | - $totImg = count($curImages_array); |
|
2416 | - } |
|
2413 | + if ($curImages != '') { |
|
2414 | + $curImages_array = explode(',', $curImages); |
|
2415 | + $totImg = count($curImages_array); |
|
2416 | + } |
|
2417 | 2417 | |
2418 | - $listing_type = $post->listing_type; |
|
2418 | + $listing_type = $post->listing_type; |
|
2419 | 2419 | |
2420 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2421 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
2422 | - $listing_type = $post->post_type; |
|
2423 | - $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
2420 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2421 | + $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
2422 | + $listing_type = $post->post_type; |
|
2423 | + $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
2424 | 2424 | |
2425 | - } else { |
|
2426 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2427 | - } |
|
2425 | + } else { |
|
2426 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2427 | + } |
|
2428 | 2428 | |
2429 | 2429 | |
2430 | - if (!empty($thumb_img_arr)) { |
|
2431 | - foreach ($thumb_img_arr as $img) { |
|
2432 | - //$curImages = $img->src.","; |
|
2433 | - } |
|
2434 | - |
|
2435 | - $totImg = count((array)$thumb_img_arr); |
|
2436 | - } |
|
2430 | + if (!empty($thumb_img_arr)) { |
|
2431 | + foreach ($thumb_img_arr as $img) { |
|
2432 | + //$curImages = $img->src.","; |
|
2433 | + } |
|
2437 | 2434 | |
2438 | - if ($curImages != '') |
|
2439 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
2440 | - else |
|
2441 | - $svalue = ''; |
|
2442 | - |
|
2443 | - $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0'; |
|
2444 | - $show_image_input_box = ($image_limit != '0'); |
|
2445 | - /** |
|
2446 | - * Filter to be able to show/hide the image upload section of the add listing form. |
|
2447 | - * |
|
2448 | - * @since 1.0.0 |
|
2449 | - * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
2450 | - * @param string $listing_type The custom post type slug. |
|
2451 | - */ |
|
2452 | - $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type); |
|
2453 | - if ($show_image_input_box) { |
|
2454 | - ?> |
|
2435 | + $totImg = count((array)$thumb_img_arr); |
|
2436 | + } |
|
2437 | + |
|
2438 | + if ($curImages != '') |
|
2439 | + $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
2440 | + else |
|
2441 | + $svalue = ''; |
|
2442 | + |
|
2443 | + $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0'; |
|
2444 | + $show_image_input_box = ($image_limit != '0'); |
|
2445 | + /** |
|
2446 | + * Filter to be able to show/hide the image upload section of the add listing form. |
|
2447 | + * |
|
2448 | + * @since 1.0.0 |
|
2449 | + * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
2450 | + * @param string $listing_type The custom post type slug. |
|
2451 | + */ |
|
2452 | + $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type); |
|
2453 | + if ($show_image_input_box) { |
|
2454 | + ?> |
|
2455 | 2455 | |
2456 | 2456 | <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
2457 | 2457 | <?php if ($image_limit == 1) { |
2458 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>'; |
|
2459 | - } ?> |
|
2458 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>'; |
|
2459 | + } ?> |
|
2460 | 2460 | <?php if ($image_limit > 1) { |
2461 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>'; |
|
2462 | - } ?> |
|
2461 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>'; |
|
2462 | + } ?> |
|
2463 | 2463 | <?php if ($image_limit == '') { |
2464 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>'; |
|
2465 | - } ?> |
|
2464 | + echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>'; |
|
2465 | + } ?> |
|
2466 | 2466 | </h5> |
2467 | 2467 | |
2468 | 2468 | <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox" |
@@ -2500,12 +2500,12 @@ discard block |
||
2500 | 2500 | <?php } ?> |
2501 | 2501 | |
2502 | 2502 | <?php |
2503 | - /** |
|
2504 | - * Called on the add listing page form for frontend just after the image upload field. |
|
2505 | - * |
|
2506 | - * @since 1.0.0 |
|
2507 | - */ |
|
2508 | - do_action('geodir_after_main_form_fields');?> |
|
2503 | + /** |
|
2504 | + * Called on the add listing page form for frontend just after the image upload field. |
|
2505 | + * |
|
2506 | + * @since 1.0.0 |
|
2507 | + */ |
|
2508 | + do_action('geodir_after_main_form_fields');?> |
|
2509 | 2509 | |
2510 | 2510 | |
2511 | 2511 | <!-- add captcha code --> |
@@ -2534,7 +2534,7 @@ discard block |
||
2534 | 2534 | |
2535 | 2535 | </form> |
2536 | 2536 | <?php |
2537 | - wp_reset_query(); |
|
2537 | + wp_reset_query(); |
|
2538 | 2538 | } |
2539 | 2539 | |
2540 | 2540 | /** |
@@ -2545,7 +2545,7 @@ discard block |
||
2545 | 2545 | */ |
2546 | 2546 | function geodir_add_listing_sidebar_widget_area() |
2547 | 2547 | { |
2548 | - dynamic_sidebar('geodir_add_listing_sidebar'); |
|
2548 | + dynamic_sidebar('geodir_add_listing_sidebar'); |
|
2549 | 2549 | } |
2550 | 2550 | |
2551 | 2551 | add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10); |
@@ -2560,16 +2560,16 @@ discard block |
||
2560 | 2560 | */ |
2561 | 2561 | function geodir_action_add_listing_sidebar() |
2562 | 2562 | { |
2563 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2564 | - do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar'); |
|
2565 | - /** |
|
2566 | - * This is used to add the content to the add listing page sidebar. |
|
2567 | - * |
|
2568 | - * @since 1.0.0 |
|
2569 | - */ |
|
2570 | - do_action('geodir_add_listing_sidebar_inside'); |
|
2571 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2572 | - do_action('geodir_sidebar_right_close', 'details-page'); |
|
2563 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2564 | + do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar'); |
|
2565 | + /** |
|
2566 | + * This is used to add the content to the add listing page sidebar. |
|
2567 | + * |
|
2568 | + * @since 1.0.0 |
|
2569 | + */ |
|
2570 | + do_action('geodir_add_listing_sidebar_inside'); |
|
2571 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2572 | + do_action('geodir_sidebar_right_close', 'details-page'); |
|
2573 | 2573 | } |
2574 | 2574 | |
2575 | 2575 | ############################################### |
@@ -2586,11 +2586,11 @@ discard block |
||
2586 | 2586 | */ |
2587 | 2587 | function geodir_action_geodir_sidebar_signup_top() |
2588 | 2588 | { |
2589 | - ?> |
|
2589 | + ?> |
|
2590 | 2590 | <div |
2591 | 2591 | class="<?php |
2592 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2593 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>"> |
|
2592 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2593 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>"> |
|
2594 | 2594 | <?php dynamic_sidebar('Reg/Login Top Section');?> |
2595 | 2595 | </div><!-- clearfix ends here--> |
2596 | 2596 | <?php |
@@ -2609,11 +2609,11 @@ discard block |
||
2609 | 2609 | function geodir_action_signup_forms() |
2610 | 2610 | { |
2611 | 2611 | |
2612 | - global $user_login; |
|
2612 | + global $user_login; |
|
2613 | 2613 | |
2614 | - $is_enable_signup = get_option( 'users_can_register' ); |
|
2614 | + $is_enable_signup = get_option( 'users_can_register' ); |
|
2615 | 2615 | |
2616 | - ?> |
|
2616 | + ?> |
|
2617 | 2617 | <script type="text/javascript"> |
2618 | 2618 | <?php if ( $user_login ) { ?> |
2619 | 2619 | setTimeout(function () { |
@@ -2649,67 +2649,67 @@ discard block |
||
2649 | 2649 | <?php } ?> |
2650 | 2650 | </script><?php |
2651 | 2651 | |
2652 | - global $errors; |
|
2653 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
2654 | - $errors->add('claim_login', LOGIN_CLAIM); |
|
2655 | - |
|
2656 | - if (!empty($errors)) { |
|
2657 | - foreach ($errors as $errorsObj) { |
|
2658 | - foreach ($errorsObj as $key => $val) { |
|
2659 | - for ($i = 0; $i < count($val); $i++) { |
|
2660 | - echo "<div class=error_msg_fix>" . $val[$i] . '</div>'; |
|
2661 | - $registration_error_msg = 1; |
|
2662 | - } |
|
2663 | - } |
|
2664 | - } |
|
2665 | - } |
|
2652 | + global $errors; |
|
2653 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
2654 | + $errors->add('claim_login', LOGIN_CLAIM); |
|
2655 | + |
|
2656 | + if (!empty($errors)) { |
|
2657 | + foreach ($errors as $errorsObj) { |
|
2658 | + foreach ($errorsObj as $key => $val) { |
|
2659 | + for ($i = 0; $i < count($val); $i++) { |
|
2660 | + echo "<div class=error_msg_fix>" . $val[$i] . '</div>'; |
|
2661 | + $registration_error_msg = 1; |
|
2662 | + } |
|
2663 | + } |
|
2664 | + } |
|
2665 | + } |
|
2666 | 2666 | |
2667 | - if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') { |
|
2668 | - ?> |
|
2667 | + if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') { |
|
2668 | + ?> |
|
2669 | 2669 | |
2670 | 2670 | <div class="login_form"> |
2671 | 2671 | <?php |
2672 | - /** |
|
2673 | - * Contains login form template. |
|
2674 | - * |
|
2675 | - * @since 1.0.0 |
|
2676 | - */ |
|
2677 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2672 | + /** |
|
2673 | + * Contains login form template. |
|
2674 | + * |
|
2675 | + * @since 1.0.0 |
|
2676 | + */ |
|
2677 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2678 | 2678 | </div> |
2679 | 2679 | |
2680 | 2680 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up' && $is_enable_signup ) { ?> |
2681 | 2681 | |
2682 | 2682 | <div class="registration_form"> |
2683 | 2683 | <?php |
2684 | - /** |
|
2685 | - * Contains registration form template. |
|
2686 | - * |
|
2687 | - * @since 1.0.0 |
|
2688 | - */ |
|
2689 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2684 | + /** |
|
2685 | + * Contains registration form template. |
|
2686 | + * |
|
2687 | + * @since 1.0.0 |
|
2688 | + */ |
|
2689 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2690 | 2690 | </div> |
2691 | 2691 | |
2692 | 2692 | <?php } else { ?> |
2693 | 2693 | |
2694 | 2694 | <div class="login_form_l"> |
2695 | 2695 | <?php |
2696 | - /** |
|
2697 | - * Contains login form template. |
|
2698 | - * |
|
2699 | - * @since 1.0.0 |
|
2700 | - */ |
|
2701 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2696 | + /** |
|
2697 | + * Contains login form template. |
|
2698 | + * |
|
2699 | + * @since 1.0.0 |
|
2700 | + */ |
|
2701 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2702 | 2702 | </div> |
2703 | 2703 | |
2704 | 2704 | <?php if ( $is_enable_signup ) { ?> |
2705 | 2705 | <div class="registration_form_r"> |
2706 | 2706 | <?php |
2707 | - /** |
|
2708 | - * Contains registration form template. |
|
2709 | - * |
|
2710 | - * @since 1.0.0 |
|
2711 | - */ |
|
2712 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2707 | + /** |
|
2708 | + * Contains registration form template. |
|
2709 | + * |
|
2710 | + * @since 1.0.0 |
|
2711 | + */ |
|
2712 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2713 | 2713 | </div> |
2714 | 2714 | <?php } ?> |
2715 | 2715 | |
@@ -2741,66 +2741,66 @@ discard block |
||
2741 | 2741 | */ |
2742 | 2742 | function geodir_action_author_page_title() |
2743 | 2743 | { |
2744 | - global $term; |
|
2744 | + global $term; |
|
2745 | 2745 | |
2746 | - $gd_post_type = geodir_get_current_posttype(); |
|
2747 | - $post_type_info = get_post_type_object($gd_post_type); |
|
2746 | + $gd_post_type = geodir_get_current_posttype(); |
|
2747 | + $post_type_info = get_post_type_object($gd_post_type); |
|
2748 | 2748 | |
2749 | - $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
2750 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
2751 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
2752 | - } |
|
2749 | + $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
2750 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
2751 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
2752 | + } |
|
2753 | 2753 | |
2754 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
2755 | - $single_name = $post_type_info->labels->singular_name; |
|
2754 | + $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
2755 | + $single_name = $post_type_info->labels->singular_name; |
|
2756 | 2756 | |
2757 | - $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
2757 | + $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
2758 | 2758 | |
2759 | - if (!empty($term)) { |
|
2760 | - $current_term = get_term_by('slug', $term, $taxonomy[0]); |
|
2761 | - if (!empty($current_term)) |
|
2762 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
2763 | - } |
|
2759 | + if (!empty($term)) { |
|
2760 | + $current_term = get_term_by('slug', $term, $taxonomy[0]); |
|
2761 | + if (!empty($current_term)) |
|
2762 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
2763 | + } |
|
2764 | 2764 | |
2765 | 2765 | |
2766 | - if (is_search()) { |
|
2767 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2766 | + if (is_search()) { |
|
2767 | + $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2768 | 2768 | |
2769 | - } |
|
2770 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2771 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2772 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2773 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2769 | + } |
|
2770 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2771 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2772 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2773 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2774 | 2774 | |
2775 | - $title = $list_title; |
|
2776 | - if(geodir_is_page('author')){ |
|
2777 | - $gd_page = 'author'; |
|
2778 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
2779 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
|
2780 | - }else{ |
|
2781 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
|
2782 | - } |
|
2775 | + $title = $list_title; |
|
2776 | + if(geodir_is_page('author')){ |
|
2777 | + $gd_page = 'author'; |
|
2778 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
2779 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
|
2780 | + }else{ |
|
2781 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
|
2782 | + } |
|
2783 | 2783 | |
2784 | - } |
|
2784 | + } |
|
2785 | 2785 | |
2786 | 2786 | |
2787 | - /** |
|
2788 | - * Filter page title to replace variables. |
|
2789 | - * |
|
2790 | - * @since 1.5.4 |
|
2791 | - * @param string $title The page title including variables. |
|
2792 | - * @param string $gd_page The GeoDirectory page type if any. |
|
2793 | - */ |
|
2794 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2787 | + /** |
|
2788 | + * Filter page title to replace variables. |
|
2789 | + * |
|
2790 | + * @since 1.5.4 |
|
2791 | + * @param string $title The page title including variables. |
|
2792 | + * @param string $gd_page The GeoDirectory page type if any. |
|
2793 | + */ |
|
2794 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2795 | 2795 | |
2796 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2797 | - /** |
|
2798 | - * Filter the author page title text. |
|
2799 | - * |
|
2800 | - * @since 1.0.0 |
|
2801 | - * @param string $list_title The title for the page. |
|
2802 | - */ |
|
2803 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>'; |
|
2796 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2797 | + /** |
|
2798 | + * Filter the author page title text. |
|
2799 | + * |
|
2800 | + * @since 1.0.0 |
|
2801 | + * @param string $list_title The title for the page. |
|
2802 | + */ |
|
2803 | + apply_filters('geodir_author_page_title_text', $title) . '</h1></header>'; |
|
2804 | 2804 | } |
2805 | 2805 | |
2806 | 2806 | |
@@ -2818,11 +2818,11 @@ discard block |
||
2818 | 2818 | */ |
2819 | 2819 | function geodir_action_geodir_sidebar_author_top() |
2820 | 2820 | { |
2821 | - if (get_option('geodir_show_author_top_section')) { ?> |
|
2821 | + if (get_option('geodir_show_author_top_section')) { ?> |
|
2822 | 2822 | <div |
2823 | 2823 | class="<?php |
2824 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2825 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>"> |
|
2824 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2825 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>"> |
|
2826 | 2826 | <?php dynamic_sidebar('geodir_author_top'); ?> |
2827 | 2827 | </div><!-- clearfix ends here--> |
2828 | 2828 | <?php } |
@@ -2838,7 +2838,7 @@ discard block |
||
2838 | 2838 | */ |
2839 | 2839 | function geodir_author_left_section() |
2840 | 2840 | { |
2841 | - if (get_option('geodir_show_author_left_section')) { ?> |
|
2841 | + if (get_option('geodir_show_author_left_section')) { ?> |
|
2842 | 2842 | <div class="geodir-content-left geodir-sidebar-wrap"> |
2843 | 2843 | <?php dynamic_sidebar('geodir_author_left_sidebar'); ?> |
2844 | 2844 | </div><!-- end geodir-content-left --> |
@@ -2859,19 +2859,19 @@ discard block |
||
2859 | 2859 | */ |
2860 | 2860 | function geodir_action_author_sidebar_left() |
2861 | 2861 | { |
2862 | - if (get_option('geodir_show_author_left_section')) { |
|
2862 | + if (get_option('geodir_show_author_left_section')) { |
|
2863 | 2863 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
2864 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2865 | - do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
2866 | - /** |
|
2867 | - * This is used to add the content to the author page left sidebar (if active). |
|
2868 | - * |
|
2869 | - * @since 1.0.0 |
|
2870 | - */ |
|
2871 | - do_action('geodir_author_sidebar_left_inside'); |
|
2872 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2873 | - do_action('geodir_sidebar_left_close', 'author-page'); |
|
2874 | - } |
|
2864 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2865 | + do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
2866 | + /** |
|
2867 | + * This is used to add the content to the author page left sidebar (if active). |
|
2868 | + * |
|
2869 | + * @since 1.0.0 |
|
2870 | + */ |
|
2871 | + do_action('geodir_author_sidebar_left_inside'); |
|
2872 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2873 | + do_action('geodir_sidebar_left_close', 'author-page'); |
|
2874 | + } |
|
2875 | 2875 | } |
2876 | 2876 | |
2877 | 2877 | /** |
@@ -2884,7 +2884,7 @@ discard block |
||
2884 | 2884 | */ |
2885 | 2885 | function geodir_author_right_section() |
2886 | 2886 | { |
2887 | - if (get_option('geodir_show_author_right_section')) { ?> |
|
2887 | + if (get_option('geodir_show_author_right_section')) { ?> |
|
2888 | 2888 | <div class="geodir-content-right geodir-sidebar-wrap"> |
2889 | 2889 | <?php dynamic_sidebar('geodir_author_right_sidebar'); ?> |
2890 | 2890 | </div><!-- end geodir-content-right --> |
@@ -2904,18 +2904,18 @@ discard block |
||
2904 | 2904 | */ |
2905 | 2905 | function geodir_action_author_sidebar_right() |
2906 | 2906 | { |
2907 | - if (get_option('geodir_show_author_right_section')) { |
|
2908 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2909 | - do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
2910 | - /** |
|
2911 | - * This is used to add the content to the author page right sidebar (if active). |
|
2912 | - * |
|
2913 | - * @since 1.0.0 |
|
2914 | - */ |
|
2915 | - do_action('geodir_author_sidebar_right_inside'); |
|
2916 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2917 | - do_action('geodir_sidebar_right_close', 'author-page'); |
|
2918 | - } |
|
2907 | + if (get_option('geodir_show_author_right_section')) { |
|
2908 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2909 | + do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
2910 | + /** |
|
2911 | + * This is used to add the content to the author page right sidebar (if active). |
|
2912 | + * |
|
2913 | + * @since 1.0.0 |
|
2914 | + */ |
|
2915 | + do_action('geodir_author_sidebar_right_inside'); |
|
2916 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2917 | + do_action('geodir_sidebar_right_close', 'author-page'); |
|
2918 | + } |
|
2919 | 2919 | } |
2920 | 2920 | |
2921 | 2921 | /** |
@@ -2927,14 +2927,14 @@ discard block |
||
2927 | 2927 | */ |
2928 | 2928 | function geodir_action_author_content_inside() |
2929 | 2929 | { |
2930 | - global $gridview_columns; |
|
2931 | - $listing_view = get_option('geodir_author_view'); |
|
2932 | - if (strstr($listing_view, 'gridview')) { |
|
2933 | - $gridview_columns = $listing_view; |
|
2934 | - $listing_view_exp = explode('_', $listing_view); |
|
2935 | - $listing_view = $listing_view_exp[0]; |
|
2936 | - } |
|
2937 | - geodir_get_template_part('listing', 'listview'); |
|
2930 | + global $gridview_columns; |
|
2931 | + $listing_view = get_option('geodir_author_view'); |
|
2932 | + if (strstr($listing_view, 'gridview')) { |
|
2933 | + $gridview_columns = $listing_view; |
|
2934 | + $listing_view_exp = explode('_', $listing_view); |
|
2935 | + $listing_view = $listing_view_exp[0]; |
|
2936 | + } |
|
2937 | + geodir_get_template_part('listing', 'listview'); |
|
2938 | 2938 | } |
2939 | 2939 | |
2940 | 2940 | add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10); |
@@ -2949,22 +2949,22 @@ discard block |
||
2949 | 2949 | */ |
2950 | 2950 | function geodir_action_author_content() |
2951 | 2951 | { |
2952 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2953 | - do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page'); |
|
2954 | - echo '<div class="clearfix">'; |
|
2955 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2956 | - do_action('geodir_before_listing'); |
|
2957 | - echo '</div>'; |
|
2958 | - /** |
|
2959 | - * This is used to add the content to the author page main content. |
|
2960 | - * |
|
2961 | - * @since 1.0.0 |
|
2962 | - */ |
|
2963 | - do_action('geodir_author_content_inside'); |
|
2964 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2965 | - do_action('geodir_after_listing'); |
|
2966 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2967 | - do_action('geodir_main_content_close', 'author-page'); |
|
2952 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2953 | + do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page'); |
|
2954 | + echo '<div class="clearfix">'; |
|
2955 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2956 | + do_action('geodir_before_listing'); |
|
2957 | + echo '</div>'; |
|
2958 | + /** |
|
2959 | + * This is used to add the content to the author page main content. |
|
2960 | + * |
|
2961 | + * @since 1.0.0 |
|
2962 | + */ |
|
2963 | + do_action('geodir_author_content_inside'); |
|
2964 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2965 | + do_action('geodir_after_listing'); |
|
2966 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2967 | + do_action('geodir_main_content_close', 'author-page'); |
|
2968 | 2968 | } |
2969 | 2969 | |
2970 | 2970 | add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10); |
@@ -2978,11 +2978,11 @@ discard block |
||
2978 | 2978 | */ |
2979 | 2979 | function geodir_action_sidebar_author_bottom_section() |
2980 | 2980 | { |
2981 | - if (get_option('geodir_show_author_bottom_section')) { ?> |
|
2981 | + if (get_option('geodir_show_author_bottom_section')) { ?> |
|
2982 | 2982 | <div |
2983 | 2983 | class="<?php |
2984 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2985 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>"> |
|
2984 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2985 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>"> |
|
2986 | 2986 | <?php dynamic_sidebar('geodir_author_bottom'); ?> |
2987 | 2987 | </div><!-- clearfix ends here--> |
2988 | 2988 | <?php } |
@@ -3001,23 +3001,23 @@ discard block |
||
3001 | 3001 | */ |
3002 | 3002 | function geodir_action_search_page_title() |
3003 | 3003 | { |
3004 | - $gd_post_type = geodir_get_current_posttype(); |
|
3005 | - $post_type_info = get_post_type_object($gd_post_type); |
|
3004 | + $gd_post_type = geodir_get_current_posttype(); |
|
3005 | + $post_type_info = get_post_type_object($gd_post_type); |
|
3006 | 3006 | |
3007 | - $pt_name = ''; |
|
3008 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;} |
|
3007 | + $pt_name = ''; |
|
3008 | + if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;} |
|
3009 | 3009 | |
3010 | - if (is_search()) { |
|
3011 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
3010 | + if (is_search()) { |
|
3011 | + $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
3012 | 3012 | |
3013 | - } |
|
3014 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3015 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
3016 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3017 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
3018 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
3019 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3020 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>'; |
|
3013 | + } |
|
3014 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3015 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
3016 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3017 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
3018 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
3019 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3020 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>'; |
|
3021 | 3021 | } |
3022 | 3022 | |
3023 | 3023 | // action for adding the listings page top widget area |
@@ -3033,11 +3033,11 @@ discard block |
||
3033 | 3033 | */ |
3034 | 3034 | function geodir_action_geodir_sidebar_search_top() |
3035 | 3035 | { |
3036 | - if (get_option('geodir_show_search_top_section')) { ?> |
|
3036 | + if (get_option('geodir_show_search_top_section')) { ?> |
|
3037 | 3037 | <div |
3038 | 3038 | class="<?php |
3039 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3040 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>"> |
|
3039 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3040 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>"> |
|
3041 | 3041 | <?php dynamic_sidebar('geodir_search_top'); ?> |
3042 | 3042 | </div><!-- clearfix ends here--> |
3043 | 3043 | <?php } |
@@ -3053,7 +3053,7 @@ discard block |
||
3053 | 3053 | */ |
3054 | 3054 | function geodir_search_left_section() |
3055 | 3055 | { |
3056 | - if (get_option('geodir_show_search_left_section')) { ?> |
|
3056 | + if (get_option('geodir_show_search_left_section')) { ?> |
|
3057 | 3057 | <div class="geodir-content-left geodir-sidebar-wrap"> |
3058 | 3058 | <?php dynamic_sidebar('geodir_search_left_sidebar'); ?> |
3059 | 3059 | </div><!-- end geodir-content-left --> |
@@ -3073,19 +3073,19 @@ discard block |
||
3073 | 3073 | */ |
3074 | 3074 | function geodir_action_search_sidebar_left() |
3075 | 3075 | { |
3076 | - if (get_option('geodir_show_search_left_section')) { |
|
3076 | + if (get_option('geodir_show_search_left_section')) { |
|
3077 | 3077 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
3078 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3079 | - do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
3080 | - /** |
|
3081 | - * This is used to add the content to the search page left sidebar (if active). |
|
3082 | - * |
|
3083 | - * @since 1.0.0 |
|
3084 | - */ |
|
3085 | - do_action('geodir_search_sidebar_left_inside'); |
|
3086 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3087 | - do_action('geodir_sidebar_left_close', 'search-page'); |
|
3088 | - } |
|
3078 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3079 | + do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
3080 | + /** |
|
3081 | + * This is used to add the content to the search page left sidebar (if active). |
|
3082 | + * |
|
3083 | + * @since 1.0.0 |
|
3084 | + */ |
|
3085 | + do_action('geodir_search_sidebar_left_inside'); |
|
3086 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3087 | + do_action('geodir_sidebar_left_close', 'search-page'); |
|
3088 | + } |
|
3089 | 3089 | } |
3090 | 3090 | |
3091 | 3091 | /** |
@@ -3098,7 +3098,7 @@ discard block |
||
3098 | 3098 | */ |
3099 | 3099 | function geodir_search_right_section() |
3100 | 3100 | { |
3101 | - if (get_option('geodir_show_search_right_section')) { ?> |
|
3101 | + if (get_option('geodir_show_search_right_section')) { ?> |
|
3102 | 3102 | <div class="geodir-content-right geodir-sidebar-wrap"> |
3103 | 3103 | <?php dynamic_sidebar('geodir_search_right_sidebar'); ?> |
3104 | 3104 | </div><!-- end geodir-content-right --> |
@@ -3118,18 +3118,18 @@ discard block |
||
3118 | 3118 | */ |
3119 | 3119 | function geodir_action_search_sidebar_right() |
3120 | 3120 | { |
3121 | - if (get_option('geodir_show_search_right_section')) { |
|
3122 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3123 | - do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
3124 | - /** |
|
3125 | - * This is used to add the content to the search page right sidebar (if active). |
|
3126 | - * |
|
3127 | - * @since 1.0.0 |
|
3128 | - */ |
|
3129 | - do_action('geodir_search_sidebar_right_inside'); |
|
3130 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3131 | - do_action('geodir_sidebar_right_close', 'search-page'); |
|
3132 | - } |
|
3121 | + if (get_option('geodir_show_search_right_section')) { |
|
3122 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3123 | + do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
3124 | + /** |
|
3125 | + * This is used to add the content to the search page right sidebar (if active). |
|
3126 | + * |
|
3127 | + * @since 1.0.0 |
|
3128 | + */ |
|
3129 | + do_action('geodir_search_sidebar_right_inside'); |
|
3130 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3131 | + do_action('geodir_sidebar_right_close', 'search-page'); |
|
3132 | + } |
|
3133 | 3133 | } |
3134 | 3134 | |
3135 | 3135 | |
@@ -3144,11 +3144,11 @@ discard block |
||
3144 | 3144 | */ |
3145 | 3145 | function geodir_action_sidebar_search_bottom_section() |
3146 | 3146 | { |
3147 | - if (get_option('geodir_show_search_bottom_section')) { ?> |
|
3147 | + if (get_option('geodir_show_search_bottom_section')) { ?> |
|
3148 | 3148 | <div |
3149 | 3149 | class="<?php |
3150 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3151 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>"> |
|
3150 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3151 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>"> |
|
3152 | 3152 | <?php dynamic_sidebar('geodir_search_bottom'); ?> |
3153 | 3153 | </div><!-- clearfix ends here--> |
3154 | 3154 | <?php } |
@@ -3163,14 +3163,14 @@ discard block |
||
3163 | 3163 | */ |
3164 | 3164 | function geodir_action_search_content_inside() |
3165 | 3165 | { |
3166 | - global $gridview_columns; |
|
3167 | - $listing_view = get_option('geodir_search_view'); |
|
3168 | - if (strstr($listing_view, 'gridview')) { |
|
3169 | - $gridview_columns = $listing_view; |
|
3170 | - $listing_view_exp = explode('_', $listing_view); |
|
3171 | - $listing_view = $listing_view_exp[0]; |
|
3172 | - } |
|
3173 | - geodir_get_template_part('listing', 'listview'); |
|
3166 | + global $gridview_columns; |
|
3167 | + $listing_view = get_option('geodir_search_view'); |
|
3168 | + if (strstr($listing_view, 'gridview')) { |
|
3169 | + $gridview_columns = $listing_view; |
|
3170 | + $listing_view_exp = explode('_', $listing_view); |
|
3171 | + $listing_view = $listing_view_exp[0]; |
|
3172 | + } |
|
3173 | + geodir_get_template_part('listing', 'listview'); |
|
3174 | 3174 | } |
3175 | 3175 | |
3176 | 3176 | add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10); |
@@ -3186,22 +3186,22 @@ discard block |
||
3186 | 3186 | */ |
3187 | 3187 | function geodir_action_search_content() |
3188 | 3188 | { |
3189 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3190 | - do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page'); |
|
3191 | - echo '<div class="clearfix">'; |
|
3192 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3193 | - do_action('geodir_before_listing'); |
|
3194 | - echo '</div>'; |
|
3195 | - /** |
|
3196 | - * This is used to add the content to the search page main content. |
|
3197 | - * |
|
3198 | - * @since 1.0.0 |
|
3199 | - */ |
|
3200 | - do_action('geodir_search_content_inside'); |
|
3201 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3202 | - do_action('geodir_after_listing'); |
|
3203 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3204 | - do_action('geodir_main_content_close', 'search-page'); |
|
3189 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3190 | + do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page'); |
|
3191 | + echo '<div class="clearfix">'; |
|
3192 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3193 | + do_action('geodir_before_listing'); |
|
3194 | + echo '</div>'; |
|
3195 | + /** |
|
3196 | + * This is used to add the content to the search page main content. |
|
3197 | + * |
|
3198 | + * @since 1.0.0 |
|
3199 | + */ |
|
3200 | + do_action('geodir_search_content_inside'); |
|
3201 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3202 | + do_action('geodir_after_listing'); |
|
3203 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3204 | + do_action('geodir_main_content_close', 'search-page'); |
|
3205 | 3205 | } |
3206 | 3206 | |
3207 | 3207 | ############################################### |
@@ -3224,11 +3224,11 @@ discard block |
||
3224 | 3224 | */ |
3225 | 3225 | function geodir_action_geodir_sidebar_home_top() |
3226 | 3226 | { |
3227 | - if (get_option('geodir_show_home_top_section')) { ?> |
|
3227 | + if (get_option('geodir_show_home_top_section')) { ?> |
|
3228 | 3228 | <div |
3229 | 3229 | class="<?php |
3230 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3231 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>"> |
|
3230 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3231 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>"> |
|
3232 | 3232 | <?php dynamic_sidebar('geodir_home_top'); ?> |
3233 | 3233 | </div><!-- clearfix ends here--> |
3234 | 3234 | <?php } |
@@ -3244,7 +3244,7 @@ discard block |
||
3244 | 3244 | */ |
3245 | 3245 | function geodir_home_left_section() |
3246 | 3246 | { |
3247 | - if (get_option('geodir_show_home_left_section')) { ?> |
|
3247 | + if (get_option('geodir_show_home_left_section')) { ?> |
|
3248 | 3248 | <div class="geodir-content-left geodir-sidebar-wrap"> |
3249 | 3249 | <?php dynamic_sidebar('geodir_home_left'); ?> |
3250 | 3250 | </div><!-- end geodir-content-left --> |
@@ -3266,19 +3266,19 @@ discard block |
||
3266 | 3266 | */ |
3267 | 3267 | function geodir_action_home_sidebar_left() |
3268 | 3268 | { |
3269 | - if (get_option('geodir_show_home_left_section')) { |
|
3269 | + if (get_option('geodir_show_home_left_section')) { |
|
3270 | 3270 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
3271 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3272 | - do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
3273 | - /** |
|
3274 | - * This is used to add the content to the home page left sidebar (if active). |
|
3275 | - * |
|
3276 | - * @since 1.0.0 |
|
3277 | - */ |
|
3278 | - do_action('geodir_home_sidebar_left_inside'); |
|
3279 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3280 | - do_action('geodir_sidebar_left_close', 'home-page'); |
|
3281 | - } |
|
3271 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3272 | + do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
3273 | + /** |
|
3274 | + * This is used to add the content to the home page left sidebar (if active). |
|
3275 | + * |
|
3276 | + * @since 1.0.0 |
|
3277 | + */ |
|
3278 | + do_action('geodir_home_sidebar_left_inside'); |
|
3279 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3280 | + do_action('geodir_sidebar_left_close', 'home-page'); |
|
3281 | + } |
|
3282 | 3282 | } |
3283 | 3283 | |
3284 | 3284 | /** |
@@ -3291,7 +3291,7 @@ discard block |
||
3291 | 3291 | */ |
3292 | 3292 | function geodir_home_right_section() |
3293 | 3293 | { |
3294 | - if (get_option('geodir_show_home_right_section')) { ?> |
|
3294 | + if (get_option('geodir_show_home_right_section')) { ?> |
|
3295 | 3295 | <div class="geodir-content-right geodir-sidebar-wrap"> |
3296 | 3296 | <?php dynamic_sidebar('geodir_home_right'); ?> |
3297 | 3297 | </div><!-- end geodir-content-right --> |
@@ -3312,18 +3312,18 @@ discard block |
||
3312 | 3312 | */ |
3313 | 3313 | function geodir_action_home_sidebar_right() |
3314 | 3314 | { |
3315 | - if (get_option('geodir_show_home_right_section')) { |
|
3316 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3317 | - do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
3318 | - /** |
|
3319 | - * This is used to add the content to the home page right sidebar (if active). |
|
3320 | - * |
|
3321 | - * @since 1.0.0 |
|
3322 | - */ |
|
3323 | - do_action('geodir_home_sidebar_right_inside'); |
|
3324 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3325 | - do_action('geodir_sidebar_right_close', 'home-page'); |
|
3326 | - } |
|
3315 | + if (get_option('geodir_show_home_right_section')) { |
|
3316 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3317 | + do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
3318 | + /** |
|
3319 | + * This is used to add the content to the home page right sidebar (if active). |
|
3320 | + * |
|
3321 | + * @since 1.0.0 |
|
3322 | + */ |
|
3323 | + do_action('geodir_home_sidebar_right_inside'); |
|
3324 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3325 | + do_action('geodir_sidebar_right_close', 'home-page'); |
|
3326 | + } |
|
3327 | 3327 | } |
3328 | 3328 | |
3329 | 3329 | /** |
@@ -3334,7 +3334,7 @@ discard block |
||
3334 | 3334 | */ |
3335 | 3335 | function geodir_action_home_content_inside() |
3336 | 3336 | { |
3337 | - dynamic_sidebar('geodir_home_content'); |
|
3337 | + dynamic_sidebar('geodir_home_content'); |
|
3338 | 3338 | } |
3339 | 3339 | |
3340 | 3340 | add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10); |
@@ -3349,28 +3349,28 @@ discard block |
||
3349 | 3349 | */ |
3350 | 3350 | function geodir_action_home_content() |
3351 | 3351 | { |
3352 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3353 | - do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page'); |
|
3354 | - /** |
|
3355 | - * This called before the home page main content. |
|
3356 | - * |
|
3357 | - * @since 1.0.0 |
|
3358 | - */ |
|
3359 | - do_action('geodir_before_home_content'); |
|
3360 | - /** |
|
3361 | - * This is used to add the content to the home page main content. |
|
3362 | - * |
|
3363 | - * @since 1.0.0 |
|
3364 | - */ |
|
3365 | - do_action('geodir_home_content_inside'); |
|
3366 | - /** |
|
3367 | - * This is called after the homepage main content. |
|
3368 | - * |
|
3369 | - * @since 1.0.0 |
|
3370 | - */ |
|
3371 | - do_action('geodir_after_home_content'); |
|
3372 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3373 | - do_action('geodir_main_content_close', 'home-page'); |
|
3352 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3353 | + do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page'); |
|
3354 | + /** |
|
3355 | + * This called before the home page main content. |
|
3356 | + * |
|
3357 | + * @since 1.0.0 |
|
3358 | + */ |
|
3359 | + do_action('geodir_before_home_content'); |
|
3360 | + /** |
|
3361 | + * This is used to add the content to the home page main content. |
|
3362 | + * |
|
3363 | + * @since 1.0.0 |
|
3364 | + */ |
|
3365 | + do_action('geodir_home_content_inside'); |
|
3366 | + /** |
|
3367 | + * This is called after the homepage main content. |
|
3368 | + * |
|
3369 | + * @since 1.0.0 |
|
3370 | + */ |
|
3371 | + do_action('geodir_after_home_content'); |
|
3372 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3373 | + do_action('geodir_main_content_close', 'home-page'); |
|
3374 | 3374 | } |
3375 | 3375 | |
3376 | 3376 | add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10); |
@@ -3385,11 +3385,11 @@ discard block |
||
3385 | 3385 | */ |
3386 | 3386 | function geodir_action_sidebar_home_bottom_section() |
3387 | 3387 | { |
3388 | - if (get_option('geodir_show_home_bottom_section')) { ?> |
|
3388 | + if (get_option('geodir_show_home_bottom_section')) { ?> |
|
3389 | 3389 | <div |
3390 | 3390 | class="<?php |
3391 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3392 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>"> |
|
3391 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3392 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>"> |
|
3393 | 3393 | <?php dynamic_sidebar('geodir_home_bottom'); ?> |
3394 | 3394 | </div><!-- clearfix ends here--> |
3395 | 3395 | <?php } |
@@ -3417,13 +3417,13 @@ discard block |
||
3417 | 3417 | */ |
3418 | 3418 | function geodir_filter_listing_page_title($list_title) |
3419 | 3419 | { |
3420 | - if (is_search() && trim(get_search_query()) == '') { |
|
3421 | - $gd_post_type = geodir_get_current_posttype(); |
|
3422 | - $post_type_info = get_post_type_object($gd_post_type); |
|
3420 | + if (is_search() && trim(get_search_query()) == '') { |
|
3421 | + $gd_post_type = geodir_get_current_posttype(); |
|
3422 | + $post_type_info = get_post_type_object($gd_post_type); |
|
3423 | 3423 | |
3424 | - $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory'); |
|
3425 | - } |
|
3426 | - return $list_title; |
|
3424 | + $list_title = __('Search', 'geodirectory') . ' ' . __(geodir_utf8_ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory'); |
|
3425 | + } |
|
3426 | + return $list_title; |
|
3427 | 3427 | } |
3428 | 3428 | |
3429 | 3429 | add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing'); |
@@ -3438,62 +3438,62 @@ discard block |
||
3438 | 3438 | * @param string $gd_page The geodirectory page type. Default null. |
3439 | 3439 | */ |
3440 | 3440 | function geodir_add_page_content( $position = 'before', $gd_page = '' ) { |
3441 | - global $post; |
|
3442 | - |
|
3443 | - $gd_page_id = NULL; |
|
3444 | - if ($gd_page == 'home-page' && geodir_is_page('home')) { |
|
3445 | - $gd_page_id = geodir_home_page_id(); |
|
3446 | - } else if ($gd_page == 'details-page' && geodir_is_page('preview')) { |
|
3447 | - $gd_page_id = geodir_preview_page_id(); |
|
3448 | - } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) { |
|
3449 | - $gd_page_id = geodir_add_listing_page_id(); |
|
3450 | - } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) { |
|
3451 | - $gd_page_id = geodir_success_page_id(); |
|
3452 | - } else if ($gd_page == 'location-page' && geodir_is_page('location')) { |
|
3453 | - $gd_page_id = geodir_location_page_id(); |
|
3454 | - } else if ($gd_page == 'info-page' && geodir_is_page('info')) { |
|
3455 | - $gd_page_id = geodir_info_page_id(); |
|
3456 | - } else if ($gd_page == 'signup-page' && geodir_is_page('login')) { |
|
3457 | - $gd_page_id = geodir_login_page_id(); |
|
3458 | - } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) { |
|
3459 | - $gd_page_id = geodir_payment_checkout_page_id(); |
|
3460 | - } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) { |
|
3461 | - $gd_page_id = geodir_payment_invoices_page_id(); |
|
3462 | - } |
|
3463 | - |
|
3464 | - if (!$gd_page_id > 0) { |
|
3465 | - return; |
|
3466 | - } |
|
3441 | + global $post; |
|
3442 | + |
|
3443 | + $gd_page_id = NULL; |
|
3444 | + if ($gd_page == 'home-page' && geodir_is_page('home')) { |
|
3445 | + $gd_page_id = geodir_home_page_id(); |
|
3446 | + } else if ($gd_page == 'details-page' && geodir_is_page('preview')) { |
|
3447 | + $gd_page_id = geodir_preview_page_id(); |
|
3448 | + } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) { |
|
3449 | + $gd_page_id = geodir_add_listing_page_id(); |
|
3450 | + } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) { |
|
3451 | + $gd_page_id = geodir_success_page_id(); |
|
3452 | + } else if ($gd_page == 'location-page' && geodir_is_page('location')) { |
|
3453 | + $gd_page_id = geodir_location_page_id(); |
|
3454 | + } else if ($gd_page == 'info-page' && geodir_is_page('info')) { |
|
3455 | + $gd_page_id = geodir_info_page_id(); |
|
3456 | + } else if ($gd_page == 'signup-page' && geodir_is_page('login')) { |
|
3457 | + $gd_page_id = geodir_login_page_id(); |
|
3458 | + } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) { |
|
3459 | + $gd_page_id = geodir_payment_checkout_page_id(); |
|
3460 | + } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) { |
|
3461 | + $gd_page_id = geodir_payment_invoices_page_id(); |
|
3462 | + } |
|
3463 | + |
|
3464 | + if (!$gd_page_id > 0) { |
|
3465 | + return; |
|
3466 | + } |
|
3467 | 3467 | |
3468 | - $display = 'before'; |
|
3469 | - /** |
|
3470 | - * Filter the position to display the page content. |
|
3471 | - * |
|
3472 | - * @since 1.6.3 |
|
3473 | - * |
|
3474 | - * @param string $display Position to add the post content. |
|
3475 | - * @param string $gd_page The geodirectory page type. |
|
3476 | - */ |
|
3477 | - $display = apply_filters('geodir_add_page_content_position', $display, $gd_page); |
|
3478 | - |
|
3479 | - if ($position !== $display) { |
|
3480 | - return; |
|
3481 | - } |
|
3482 | - |
|
3483 | - $gd_post = $post; |
|
3468 | + $display = 'before'; |
|
3469 | + /** |
|
3470 | + * Filter the position to display the page content. |
|
3471 | + * |
|
3472 | + * @since 1.6.3 |
|
3473 | + * |
|
3474 | + * @param string $display Position to add the post content. |
|
3475 | + * @param string $gd_page The geodirectory page type. |
|
3476 | + */ |
|
3477 | + $display = apply_filters('geodir_add_page_content_position', $display, $gd_page); |
|
3478 | + |
|
3479 | + if ($position !== $display) { |
|
3480 | + return; |
|
3481 | + } |
|
3482 | + |
|
3483 | + $gd_post = $post; |
|
3484 | 3484 | |
3485 | - setup_postdata(get_post($gd_page_id)); |
|
3485 | + setup_postdata(get_post($gd_page_id)); |
|
3486 | 3486 | |
3487 | - if (get_the_content()) { |
|
3488 | - ?> |
|
3487 | + if (get_the_content()) { |
|
3488 | + ?> |
|
3489 | 3489 | <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section> |
3490 | 3490 | <?php |
3491 | - } |
|
3491 | + } |
|
3492 | 3492 | |
3493 | - $post = $gd_post; |
|
3494 | - if (!empty($gd_post) && is_object($gd_post)) { |
|
3495 | - setup_postdata($gd_post); |
|
3496 | - } |
|
3493 | + $post = $gd_post; |
|
3494 | + if (!empty($gd_post) && is_object($gd_post)) { |
|
3495 | + setup_postdata($gd_post); |
|
3496 | + } |
|
3497 | 3497 | |
3498 | 3498 | } |
3499 | 3499 | add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2); |
@@ -3514,13 +3514,13 @@ discard block |
||
3514 | 3514 | * @return string Filtered SQL JOIN clause. |
3515 | 3515 | */ |
3516 | 3516 | function geodir_previous_next_post_join( $join, $in_same_term, $excluded_terms, $taxonomy, $post ) { |
3517 | - global $plugin_prefix; |
|
3517 | + global $plugin_prefix; |
|
3518 | 3518 | |
3519 | - if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) { |
|
3520 | - $join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID"; |
|
3521 | - } |
|
3519 | + if ( !empty($post->post_type) && in_array( $post->post_type, geodir_get_posttypes() ) ) { |
|
3520 | + $join .= " INNER JOIN " . $plugin_prefix . $post->post_type . "_detail AS gd ON gd.post_id = p.ID"; |
|
3521 | + } |
|
3522 | 3522 | |
3523 | - return $join; |
|
3523 | + return $join; |
|
3524 | 3524 | } |
3525 | 3525 | add_filter( 'get_previous_post_join', 'geodir_previous_next_post_join', 10, 5 ); |
3526 | 3526 | add_filter( 'get_next_post_join', 'geodir_previous_next_post_join', 10, 5 ); |
@@ -3542,31 +3542,31 @@ discard block |
||
3542 | 3542 | * @return string Filtered SQL WHERE clause. |
3543 | 3543 | */ |
3544 | 3544 | function geodir_previous_next_post_where( $where, $in_same_term, $excluded_terms, $taxonomy, $post ) { |
3545 | - global $wpdb, $plugin_prefix; |
|
3545 | + global $wpdb, $plugin_prefix; |
|
3546 | 3546 | |
3547 | - if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) { |
|
3548 | - $post_locations = ''; |
|
3549 | - $post_locations_var = array(); |
|
3547 | + if ( !empty($post->post_type) && ( !empty( $post->country_slug ) || !empty( $post->region_slug ) || !empty( $post->city_slug ) ) && in_array( $post->post_type, geodir_get_posttypes() ) ) { |
|
3548 | + $post_locations = ''; |
|
3549 | + $post_locations_var = array(); |
|
3550 | 3550 | |
3551 | - if ( !empty( $post->country_slug ) ) { |
|
3552 | - $post_locations .= " AND post_locations LIKE %s"; |
|
3553 | - $post_locations_var[] = "%,[" . $post->country_slug . "]"; |
|
3554 | - } |
|
3555 | - |
|
3556 | - if ( !empty( $post->region_slug ) ) { |
|
3557 | - $post_locations .= " AND post_locations LIKE %s"; |
|
3558 | - $post_locations_var[] = "%,[" . $post->region_slug . "],%"; |
|
3559 | - } |
|
3560 | - |
|
3561 | - if ( !empty( $post->city_slug ) ) { |
|
3562 | - $post_locations .= " AND post_locations LIKE %s"; |
|
3563 | - $post_locations_var[] = "[" . $post->city_slug . "],%"; |
|
3564 | - } |
|
3551 | + if ( !empty( $post->country_slug ) ) { |
|
3552 | + $post_locations .= " AND post_locations LIKE %s"; |
|
3553 | + $post_locations_var[] = "%,[" . $post->country_slug . "]"; |
|
3554 | + } |
|
3555 | + |
|
3556 | + if ( !empty( $post->region_slug ) ) { |
|
3557 | + $post_locations .= " AND post_locations LIKE %s"; |
|
3558 | + $post_locations_var[] = "%,[" . $post->region_slug . "],%"; |
|
3559 | + } |
|
3560 | + |
|
3561 | + if ( !empty( $post->city_slug ) ) { |
|
3562 | + $post_locations .= " AND post_locations LIKE %s"; |
|
3563 | + $post_locations_var[] = "[" . $post->city_slug . "],%"; |
|
3564 | + } |
|
3565 | 3565 | |
3566 | - $where .= $wpdb->prepare( $post_locations, $post_locations_var ); |
|
3567 | - } |
|
3566 | + $where .= $wpdb->prepare( $post_locations, $post_locations_var ); |
|
3567 | + } |
|
3568 | 3568 | |
3569 | - return $where; |
|
3569 | + return $where; |
|
3570 | 3570 | } |
3571 | 3571 | add_filter( 'get_previous_post_where', 'geodir_previous_next_post_where', 10, 5 ); |
3572 | 3572 | add_filter( 'get_next_post_where', 'geodir_previous_next_post_where', 10, 5 ); |
3573 | 3573 | \ No newline at end of file |
@@ -19,35 +19,35 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function geodir_cfi_fieldset($html,$cf){ |
21 | 21 | |
22 | - $html_var = $cf['htmlvar_name']; |
|
23 | - |
|
24 | - // Check if there is a custom field specific filter. |
|
25 | - if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){ |
|
26 | - /** |
|
27 | - * Filter the fieldset html by individual custom field. |
|
28 | - * |
|
29 | - * @param string $html The html to filter. |
|
30 | - * @param array $cf The custom field array. |
|
31 | - * @since 1.6.6 |
|
32 | - */ |
|
33 | - $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf); |
|
34 | - } |
|
35 | - |
|
36 | - // If no html then we run the standard output. |
|
37 | - if(empty($html)) { |
|
38 | - |
|
39 | - ob_start(); // Start buffering; |
|
40 | - ?> |
|
22 | + $html_var = $cf['htmlvar_name']; |
|
23 | + |
|
24 | + // Check if there is a custom field specific filter. |
|
25 | + if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){ |
|
26 | + /** |
|
27 | + * Filter the fieldset html by individual custom field. |
|
28 | + * |
|
29 | + * @param string $html The html to filter. |
|
30 | + * @param array $cf The custom field array. |
|
31 | + * @since 1.6.6 |
|
32 | + */ |
|
33 | + $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf); |
|
34 | + } |
|
35 | + |
|
36 | + // If no html then we run the standard output. |
|
37 | + if(empty($html)) { |
|
38 | + |
|
39 | + ob_start(); // Start buffering; |
|
40 | + ?> |
|
41 | 41 | <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row" |
42 | 42 | gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo __( $cf['site_title'], 'geodirectory' ); ?> |
43 | 43 | <?php if ( $cf['desc'] != '' ) { |
44 | - echo '<small>( ' . __( $cf['desc'], 'geodirectory' ) . ' )</small>'; |
|
45 | - } ?></h5> |
|
44 | + echo '<small>( ' . __( $cf['desc'], 'geodirectory' ) . ' )</small>'; |
|
45 | + } ?></h5> |
|
46 | 46 | <?php |
47 | - $html = ob_get_clean(); |
|
48 | - } |
|
47 | + $html = ob_get_clean(); |
|
48 | + } |
|
49 | 49 | |
50 | - return $html; |
|
50 | + return $html; |
|
51 | 51 | } |
52 | 52 | add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2); |
53 | 53 | |
@@ -64,47 +64,47 @@ discard block |
||
64 | 64 | */ |
65 | 65 | function geodir_cfi_text($html,$cf){ |
66 | 66 | |
67 | - $html_var = $cf['htmlvar_name']; |
|
68 | - |
|
69 | - // Check if there is a custom field specific filter. |
|
70 | - if(has_filter("geodir_custom_field_input_text_{$html_var}")){ |
|
71 | - /** |
|
72 | - * Filter the text html by individual custom field. |
|
73 | - * |
|
74 | - * @param string $html The html to filter. |
|
75 | - * @param array $cf The custom field array. |
|
76 | - * @since 1.6.6 |
|
77 | - */ |
|
78 | - $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf); |
|
79 | - } |
|
80 | - |
|
81 | - // If no html then we run the standard output. |
|
82 | - if(empty($html)) { |
|
83 | - |
|
84 | - ob_start(); // Start buffering; |
|
85 | - |
|
86 | - $value = geodir_get_cf_value($cf); |
|
87 | - $type = $cf['type']; |
|
88 | - //number and float validation $validation_pattern |
|
89 | - if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';} |
|
90 | - elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';} |
|
91 | - |
|
92 | - //validation |
|
93 | - if(isset($cf['validation_pattern']) && $cf['validation_pattern']){ |
|
94 | - $validation = 'pattern="'.$cf['validation_pattern'].'"'; |
|
95 | - }else{$validation='';} |
|
96 | - |
|
97 | - // validation message |
|
98 | - if(isset($cf['validation_msg']) && $cf['validation_msg']){ |
|
99 | - $validation_msg = 'title="'.$cf['validation_msg'].'"'; |
|
100 | - }else{$validation_msg='';} |
|
101 | - ?> |
|
67 | + $html_var = $cf['htmlvar_name']; |
|
68 | + |
|
69 | + // Check if there is a custom field specific filter. |
|
70 | + if(has_filter("geodir_custom_field_input_text_{$html_var}")){ |
|
71 | + /** |
|
72 | + * Filter the text html by individual custom field. |
|
73 | + * |
|
74 | + * @param string $html The html to filter. |
|
75 | + * @param array $cf The custom field array. |
|
76 | + * @since 1.6.6 |
|
77 | + */ |
|
78 | + $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf); |
|
79 | + } |
|
80 | + |
|
81 | + // If no html then we run the standard output. |
|
82 | + if(empty($html)) { |
|
83 | + |
|
84 | + ob_start(); // Start buffering; |
|
85 | + |
|
86 | + $value = geodir_get_cf_value($cf); |
|
87 | + $type = $cf['type']; |
|
88 | + //number and float validation $validation_pattern |
|
89 | + if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';} |
|
90 | + elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';} |
|
91 | + |
|
92 | + //validation |
|
93 | + if(isset($cf['validation_pattern']) && $cf['validation_pattern']){ |
|
94 | + $validation = 'pattern="'.$cf['validation_pattern'].'"'; |
|
95 | + }else{$validation='';} |
|
96 | + |
|
97 | + // validation message |
|
98 | + if(isset($cf['validation_msg']) && $cf['validation_msg']){ |
|
99 | + $validation_msg = 'title="'.$cf['validation_msg'].'"'; |
|
100 | + }else{$validation_msg='';} |
|
101 | + ?> |
|
102 | 102 | |
103 | 103 | <div id="<?php echo $cf['name'];?>_row" |
104 | 104 | class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
105 | 105 | <label> |
106 | 106 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
107 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
107 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
108 | 108 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
109 | 109 | </label> |
110 | 110 | <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | </div> |
117 | 117 | |
118 | 118 | <?php |
119 | - $html = ob_get_clean(); |
|
120 | - } |
|
119 | + $html = ob_get_clean(); |
|
120 | + } |
|
121 | 121 | |
122 | - return $html; |
|
122 | + return $html; |
|
123 | 123 | } |
124 | 124 | add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2); |
125 | 125 | |
@@ -135,35 +135,35 @@ discard block |
||
135 | 135 | */ |
136 | 136 | function geodir_cfi_email($html,$cf){ |
137 | 137 | |
138 | - $html_var = $cf['htmlvar_name']; |
|
138 | + $html_var = $cf['htmlvar_name']; |
|
139 | 139 | |
140 | - // Check if there is a custom field specific filter. |
|
141 | - if(has_filter("geodir_custom_field_input_email_{$html_var}")){ |
|
142 | - /** |
|
143 | - * Filter the email html by individual custom field. |
|
144 | - * |
|
145 | - * @param string $html The html to filter. |
|
146 | - * @param array $cf The custom field array. |
|
147 | - * @since 1.6.6 |
|
148 | - */ |
|
149 | - $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf); |
|
150 | - } |
|
140 | + // Check if there is a custom field specific filter. |
|
141 | + if(has_filter("geodir_custom_field_input_email_{$html_var}")){ |
|
142 | + /** |
|
143 | + * Filter the email html by individual custom field. |
|
144 | + * |
|
145 | + * @param string $html The html to filter. |
|
146 | + * @param array $cf The custom field array. |
|
147 | + * @since 1.6.6 |
|
148 | + */ |
|
149 | + $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf); |
|
150 | + } |
|
151 | 151 | |
152 | - // If no html then we run the standard output. |
|
153 | - if(empty($html)) { |
|
152 | + // If no html then we run the standard output. |
|
153 | + if(empty($html)) { |
|
154 | 154 | |
155 | - ob_start(); // Start buffering; |
|
156 | - $value = geodir_get_cf_value($cf); |
|
155 | + ob_start(); // Start buffering; |
|
156 | + $value = geodir_get_cf_value($cf); |
|
157 | 157 | |
158 | - if ($value == $cf['default']) { |
|
159 | - $value = ''; |
|
160 | - }?> |
|
158 | + if ($value == $cf['default']) { |
|
159 | + $value = ''; |
|
160 | + }?> |
|
161 | 161 | |
162 | 162 | <div id="<?php echo $cf['name'];?>_row" |
163 | 163 | class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
164 | 164 | <label> |
165 | 165 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
166 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
166 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
167 | 167 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
168 | 168 | </label> |
169 | 169 | <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | </div> |
176 | 176 | |
177 | 177 | <?php |
178 | - $html = ob_get_clean(); |
|
179 | - } |
|
178 | + $html = ob_get_clean(); |
|
179 | + } |
|
180 | 180 | |
181 | - return $html; |
|
181 | + return $html; |
|
182 | 182 | } |
183 | 183 | add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2); |
184 | 184 | |
@@ -195,35 +195,35 @@ discard block |
||
195 | 195 | */ |
196 | 196 | function geodir_cfi_phone($html,$cf){ |
197 | 197 | |
198 | - $html_var = $cf['htmlvar_name']; |
|
198 | + $html_var = $cf['htmlvar_name']; |
|
199 | 199 | |
200 | - // Check if there is a custom field specific filter. |
|
201 | - if(has_filter("geodir_custom_field_input_phone_{$html_var}")){ |
|
202 | - /** |
|
203 | - * Filter the phone html by individual custom field. |
|
204 | - * |
|
205 | - * @param string $html The html to filter. |
|
206 | - * @param array $cf The custom field array. |
|
207 | - * @since 1.6.6 |
|
208 | - */ |
|
209 | - $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf); |
|
210 | - } |
|
200 | + // Check if there is a custom field specific filter. |
|
201 | + if(has_filter("geodir_custom_field_input_phone_{$html_var}")){ |
|
202 | + /** |
|
203 | + * Filter the phone html by individual custom field. |
|
204 | + * |
|
205 | + * @param string $html The html to filter. |
|
206 | + * @param array $cf The custom field array. |
|
207 | + * @since 1.6.6 |
|
208 | + */ |
|
209 | + $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf); |
|
210 | + } |
|
211 | 211 | |
212 | - // If no html then we run the standard output. |
|
213 | - if(empty($html)) { |
|
212 | + // If no html then we run the standard output. |
|
213 | + if(empty($html)) { |
|
214 | 214 | |
215 | - ob_start(); // Start buffering; |
|
216 | - $value = geodir_get_cf_value($cf); |
|
215 | + ob_start(); // Start buffering; |
|
216 | + $value = geodir_get_cf_value($cf); |
|
217 | 217 | |
218 | - if ($value == $cf['default']) { |
|
219 | - $value = ''; |
|
220 | - }?> |
|
218 | + if ($value == $cf['default']) { |
|
219 | + $value = ''; |
|
220 | + }?> |
|
221 | 221 | |
222 | 222 | <div id="<?php echo $cf['name'];?>_row" |
223 | 223 | class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
224 | 224 | <label> |
225 | 225 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
226 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
226 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
227 | 227 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
228 | 228 | </label> |
229 | 229 | <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" |
@@ -235,10 +235,10 @@ discard block |
||
235 | 235 | </div> |
236 | 236 | |
237 | 237 | <?php |
238 | - $html = ob_get_clean(); |
|
239 | - } |
|
238 | + $html = ob_get_clean(); |
|
239 | + } |
|
240 | 240 | |
241 | - return $html; |
|
241 | + return $html; |
|
242 | 242 | } |
243 | 243 | add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2); |
244 | 244 | |
@@ -255,35 +255,35 @@ discard block |
||
255 | 255 | */ |
256 | 256 | function geodir_cfi_url($html,$cf){ |
257 | 257 | |
258 | - $html_var = $cf['htmlvar_name']; |
|
258 | + $html_var = $cf['htmlvar_name']; |
|
259 | 259 | |
260 | - // Check if there is a custom field specific filter. |
|
261 | - if(has_filter("geodir_custom_field_input_url_{$html_var}")){ |
|
262 | - /** |
|
263 | - * Filter the url html by individual custom field. |
|
264 | - * |
|
265 | - * @param string $html The html to filter. |
|
266 | - * @param array $cf The custom field array. |
|
267 | - * @since 1.6.6 |
|
268 | - */ |
|
269 | - $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf); |
|
270 | - } |
|
260 | + // Check if there is a custom field specific filter. |
|
261 | + if(has_filter("geodir_custom_field_input_url_{$html_var}")){ |
|
262 | + /** |
|
263 | + * Filter the url html by individual custom field. |
|
264 | + * |
|
265 | + * @param string $html The html to filter. |
|
266 | + * @param array $cf The custom field array. |
|
267 | + * @since 1.6.6 |
|
268 | + */ |
|
269 | + $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf); |
|
270 | + } |
|
271 | 271 | |
272 | - // If no html then we run the standard output. |
|
273 | - if(empty($html)) { |
|
272 | + // If no html then we run the standard output. |
|
273 | + if(empty($html)) { |
|
274 | 274 | |
275 | - ob_start(); // Start buffering; |
|
276 | - $value = geodir_get_cf_value($cf); |
|
275 | + ob_start(); // Start buffering; |
|
276 | + $value = geodir_get_cf_value($cf); |
|
277 | 277 | |
278 | - if ($value == $cf['default']) { |
|
279 | - $value = ''; |
|
280 | - }?> |
|
278 | + if ($value == $cf['default']) { |
|
279 | + $value = ''; |
|
280 | + }?> |
|
281 | 281 | |
282 | 282 | <div id="<?php echo $cf['name'];?>_row" |
283 | 283 | class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
284 | 284 | <label> |
285 | 285 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
286 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
286 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
287 | 287 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
288 | 288 | </label> |
289 | 289 | <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" |
@@ -298,10 +298,10 @@ discard block |
||
298 | 298 | </div> |
299 | 299 | |
300 | 300 | <?php |
301 | - $html = ob_get_clean(); |
|
302 | - } |
|
301 | + $html = ob_get_clean(); |
|
302 | + } |
|
303 | 303 | |
304 | - return $html; |
|
304 | + return $html; |
|
305 | 305 | } |
306 | 306 | add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2); |
307 | 307 | |
@@ -317,48 +317,48 @@ discard block |
||
317 | 317 | */ |
318 | 318 | function geodir_cfi_radio($html,$cf){ |
319 | 319 | |
320 | - $html_var = $cf['htmlvar_name']; |
|
320 | + $html_var = $cf['htmlvar_name']; |
|
321 | 321 | |
322 | - // Check if there is a custom field specific filter. |
|
323 | - if(has_filter("geodir_custom_field_input_radio_{$html_var}")){ |
|
324 | - /** |
|
325 | - * Filter the radio html by individual custom field. |
|
326 | - * |
|
327 | - * @param string $html The html to filter. |
|
328 | - * @param array $cf The custom field array. |
|
329 | - * @since 1.6.6 |
|
330 | - */ |
|
331 | - $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf); |
|
332 | - } |
|
322 | + // Check if there is a custom field specific filter. |
|
323 | + if(has_filter("geodir_custom_field_input_radio_{$html_var}")){ |
|
324 | + /** |
|
325 | + * Filter the radio html by individual custom field. |
|
326 | + * |
|
327 | + * @param string $html The html to filter. |
|
328 | + * @param array $cf The custom field array. |
|
329 | + * @since 1.6.6 |
|
330 | + */ |
|
331 | + $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf); |
|
332 | + } |
|
333 | 333 | |
334 | - // If no html then we run the standard output. |
|
335 | - if(empty($html)) { |
|
334 | + // If no html then we run the standard output. |
|
335 | + if(empty($html)) { |
|
336 | 336 | |
337 | - ob_start(); // Start buffering; |
|
338 | - $value = geodir_get_cf_value($cf); |
|
337 | + ob_start(); // Start buffering; |
|
338 | + $value = geodir_get_cf_value($cf); |
|
339 | 339 | |
340 | - ?> |
|
340 | + ?> |
|
341 | 341 | <div id="<?php echo $cf['name'];?>_row" |
342 | 342 | class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
343 | 343 | <label> |
344 | 344 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
345 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
345 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
346 | 346 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
347 | 347 | </label> |
348 | 348 | <?php if ($cf['option_values']) { |
349 | - $option_values = geodir_string_values_to_options($cf['option_values'], true); |
|
349 | + $option_values = geodir_string_values_to_options($cf['option_values'], true); |
|
350 | 350 | |
351 | - if (!empty($option_values)) { |
|
352 | - foreach ($option_values as $option_value) { |
|
353 | - if (empty($option_value['optgroup'])) { |
|
354 | - ?> |
|
351 | + if (!empty($option_values)) { |
|
352 | + foreach ($option_values as $option_value) { |
|
353 | + if (empty($option_value['optgroup'])) { |
|
354 | + ?> |
|
355 | 355 | <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked(stripslashes($value), $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span> |
356 | 356 | <?php |
357 | - } |
|
358 | - } |
|
359 | - } |
|
360 | - } |
|
361 | - ?> |
|
357 | + } |
|
358 | + } |
|
359 | + } |
|
360 | + } |
|
361 | + ?> |
|
362 | 362 | <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span> |
363 | 363 | <?php if ($cf['is_required']) { ?> |
364 | 364 | <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span> |
@@ -366,10 +366,10 @@ discard block |
||
366 | 366 | </div> |
367 | 367 | |
368 | 368 | <?php |
369 | - $html = ob_get_clean(); |
|
370 | - } |
|
369 | + $html = ob_get_clean(); |
|
370 | + } |
|
371 | 371 | |
372 | - return $html; |
|
372 | + return $html; |
|
373 | 373 | } |
374 | 374 | add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2); |
375 | 375 | |
@@ -385,46 +385,46 @@ discard block |
||
385 | 385 | */ |
386 | 386 | function geodir_cfi_checkbox($html,$cf){ |
387 | 387 | |
388 | - $html_var = $cf['htmlvar_name']; |
|
388 | + $html_var = $cf['htmlvar_name']; |
|
389 | 389 | |
390 | - // Check if there is a custom field specific filter. |
|
391 | - if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){ |
|
392 | - /** |
|
393 | - * Filter the checkbox html by individual custom field. |
|
394 | - * |
|
395 | - * @param string $html The html to filter. |
|
396 | - * @param array $cf The custom field array. |
|
397 | - * @since 1.6.6 |
|
398 | - */ |
|
399 | - $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf); |
|
400 | - } |
|
390 | + // Check if there is a custom field specific filter. |
|
391 | + if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){ |
|
392 | + /** |
|
393 | + * Filter the checkbox html by individual custom field. |
|
394 | + * |
|
395 | + * @param string $html The html to filter. |
|
396 | + * @param array $cf The custom field array. |
|
397 | + * @since 1.6.6 |
|
398 | + */ |
|
399 | + $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf); |
|
400 | + } |
|
401 | 401 | |
402 | - // If no html then we run the standard output. |
|
403 | - if(empty($html)) { |
|
402 | + // If no html then we run the standard output. |
|
403 | + if(empty($html)) { |
|
404 | 404 | |
405 | - ob_start(); // Start buffering; |
|
406 | - $value = geodir_get_cf_value($cf); |
|
405 | + ob_start(); // Start buffering; |
|
406 | + $value = geodir_get_cf_value($cf); |
|
407 | 407 | |
408 | 408 | |
409 | - if ($value == '' && $cf['default']) { |
|
410 | - $value = '1'; |
|
411 | - } |
|
412 | - ?> |
|
409 | + if ($value == '' && $cf['default']) { |
|
410 | + $value = '1'; |
|
411 | + } |
|
412 | + ?> |
|
413 | 413 | |
414 | 414 | <div id="<?php echo $cf['name'];?>_row" |
415 | 415 | class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
416 | 416 | <label> |
417 | 417 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
418 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
418 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
419 | 419 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
420 | 420 | </label> |
421 | 421 | <?php if ($value != '1') { |
422 | - $value = '0'; |
|
423 | - }?> |
|
422 | + $value = '0'; |
|
423 | + }?> |
|
424 | 424 | <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/> |
425 | 425 | <input <?php if ($value == '1') { |
426 | - echo 'checked="checked"'; |
|
427 | - }?> value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox" |
|
426 | + echo 'checked="checked"'; |
|
427 | + }?> value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox" |
|
428 | 428 | onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/> |
429 | 429 | <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span> |
430 | 430 | <?php if ($cf['is_required']) { ?> |
@@ -433,10 +433,10 @@ discard block |
||
433 | 433 | </div> |
434 | 434 | |
435 | 435 | <?php |
436 | - $html = ob_get_clean(); |
|
437 | - } |
|
436 | + $html = ob_get_clean(); |
|
437 | + } |
|
438 | 438 | |
439 | - return $html; |
|
439 | + return $html; |
|
440 | 440 | } |
441 | 441 | add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2); |
442 | 442 | |
@@ -452,52 +452,52 @@ discard block |
||
452 | 452 | */ |
453 | 453 | function geodir_cfi_textarea($html,$cf){ |
454 | 454 | |
455 | - $html_var = $cf['htmlvar_name']; |
|
455 | + $html_var = $cf['htmlvar_name']; |
|
456 | 456 | |
457 | - // Check if there is a custom field specific filter. |
|
458 | - if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){ |
|
459 | - /** |
|
460 | - * Filter the textarea html by individual custom field. |
|
461 | - * |
|
462 | - * @param string $html The html to filter. |
|
463 | - * @param array $cf The custom field array. |
|
464 | - * @since 1.6.6 |
|
465 | - */ |
|
466 | - $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf); |
|
467 | - } |
|
457 | + // Check if there is a custom field specific filter. |
|
458 | + if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){ |
|
459 | + /** |
|
460 | + * Filter the textarea html by individual custom field. |
|
461 | + * |
|
462 | + * @param string $html The html to filter. |
|
463 | + * @param array $cf The custom field array. |
|
464 | + * @since 1.6.6 |
|
465 | + */ |
|
466 | + $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf); |
|
467 | + } |
|
468 | 468 | |
469 | - // If no html then we run the standard output. |
|
470 | - if(empty($html)) { |
|
469 | + // If no html then we run the standard output. |
|
470 | + if(empty($html)) { |
|
471 | 471 | |
472 | - ob_start(); // Start buffering; |
|
473 | - $value = geodir_get_cf_value($cf); |
|
472 | + ob_start(); // Start buffering; |
|
473 | + $value = geodir_get_cf_value($cf); |
|
474 | 474 | |
475 | - $extra_fields = unserialize($cf['extra_fields']); |
|
476 | - ?> |
|
475 | + $extra_fields = unserialize($cf['extra_fields']); |
|
476 | + ?> |
|
477 | 477 | |
478 | 478 | <div id="<?php echo $cf['name'];?>_row" |
479 | 479 | class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
480 | 480 | <label> |
481 | 481 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
482 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
482 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
483 | 483 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
484 | 484 | </label><?php |
485 | 485 | |
486 | 486 | |
487 | - if (is_array($extra_fields) && in_array('1', $extra_fields)) { |
|
487 | + if (is_array($extra_fields) && in_array('1', $extra_fields)) { |
|
488 | 488 | |
489 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?> |
|
489 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?> |
|
490 | 490 | |
491 | 491 | <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor"> |
492 | 492 | <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?> |
493 | 493 | </div><?php |
494 | 494 | |
495 | - } else { |
|
495 | + } else { |
|
496 | 496 | |
497 | - ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>" |
|
497 | + ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>" |
|
498 | 498 | id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php |
499 | 499 | |
500 | - }?> |
|
500 | + }?> |
|
501 | 501 | |
502 | 502 | |
503 | 503 | <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span> |
@@ -507,10 +507,10 @@ discard block |
||
507 | 507 | </div> |
508 | 508 | |
509 | 509 | <?php |
510 | - $html = ob_get_clean(); |
|
511 | - } |
|
510 | + $html = ob_get_clean(); |
|
511 | + } |
|
512 | 512 | |
513 | - return $html; |
|
513 | + return $html; |
|
514 | 514 | } |
515 | 515 | add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2); |
516 | 516 | |
@@ -526,53 +526,53 @@ discard block |
||
526 | 526 | */ |
527 | 527 | function geodir_cfi_select($html,$cf){ |
528 | 528 | |
529 | - $html_var = $cf['htmlvar_name']; |
|
529 | + $html_var = $cf['htmlvar_name']; |
|
530 | 530 | |
531 | - // Check if there is a custom field specific filter. |
|
532 | - if(has_filter("geodir_custom_field_input_select_{$html_var}")){ |
|
533 | - /** |
|
534 | - * Filter the select html by individual custom field. |
|
535 | - * |
|
536 | - * @param string $html The html to filter. |
|
537 | - * @param array $cf The custom field array. |
|
538 | - * @since 1.6.6 |
|
539 | - */ |
|
540 | - $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf); |
|
541 | - } |
|
531 | + // Check if there is a custom field specific filter. |
|
532 | + if(has_filter("geodir_custom_field_input_select_{$html_var}")){ |
|
533 | + /** |
|
534 | + * Filter the select html by individual custom field. |
|
535 | + * |
|
536 | + * @param string $html The html to filter. |
|
537 | + * @param array $cf The custom field array. |
|
538 | + * @since 1.6.6 |
|
539 | + */ |
|
540 | + $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf); |
|
541 | + } |
|
542 | 542 | |
543 | - // If no html then we run the standard output. |
|
544 | - if(empty($html)) { |
|
543 | + // If no html then we run the standard output. |
|
544 | + if(empty($html)) { |
|
545 | 545 | |
546 | - ob_start(); // Start buffering; |
|
547 | - $value = geodir_get_cf_value($cf); |
|
546 | + ob_start(); // Start buffering; |
|
547 | + $value = geodir_get_cf_value($cf); |
|
548 | 548 | |
549 | - ?> |
|
549 | + ?> |
|
550 | 550 | <div id="<?php echo $cf['name'];?>_row" |
551 | 551 | class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details"> |
552 | 552 | <label> |
553 | 553 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
554 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
554 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
555 | 555 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
556 | 556 | </label> |
557 | 557 | <?php |
558 | - $option_values_arr = geodir_string_values_to_options($cf['option_values'], true); |
|
559 | - $select_options = ''; |
|
560 | - if (!empty($option_values_arr)) { |
|
561 | - foreach ($option_values_arr as $option_row) { |
|
562 | - if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) { |
|
563 | - $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
|
564 | - |
|
565 | - $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>'; |
|
566 | - } else { |
|
567 | - $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
|
568 | - $option_value = isset($option_row['value']) ? $option_row['value'] : ''; |
|
569 | - $selected = $option_value == stripslashes($value) ? 'selected="selected"' : ''; |
|
570 | - |
|
571 | - $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
|
572 | - } |
|
573 | - } |
|
574 | - } |
|
575 | - ?> |
|
558 | + $option_values_arr = geodir_string_values_to_options($cf['option_values'], true); |
|
559 | + $select_options = ''; |
|
560 | + if (!empty($option_values_arr)) { |
|
561 | + foreach ($option_values_arr as $option_row) { |
|
562 | + if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) { |
|
563 | + $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
|
564 | + |
|
565 | + $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>'; |
|
566 | + } else { |
|
567 | + $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
|
568 | + $option_value = isset($option_row['value']) ? $option_row['value'] : ''; |
|
569 | + $selected = $option_value == stripslashes($value) ? 'selected="selected"' : ''; |
|
570 | + |
|
571 | + $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
|
572 | + } |
|
573 | + } |
|
574 | + } |
|
575 | + ?> |
|
576 | 576 | <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" |
577 | 577 | class="geodir_textfield textfield_x chosen_select" |
578 | 578 | data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '…';?>" |
@@ -584,10 +584,10 @@ discard block |
||
584 | 584 | </div> |
585 | 585 | |
586 | 586 | <?php |
587 | - $html = ob_get_clean(); |
|
588 | - } |
|
587 | + $html = ob_get_clean(); |
|
588 | + } |
|
589 | 589 | |
590 | - return $html; |
|
590 | + return $html; |
|
591 | 591 | } |
592 | 592 | add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2); |
593 | 593 | |
@@ -603,36 +603,36 @@ discard block |
||
603 | 603 | */ |
604 | 604 | function geodir_cfi_multiselect($html,$cf){ |
605 | 605 | |
606 | - $html_var = $cf['htmlvar_name']; |
|
607 | - |
|
608 | - // Check if there is a custom field specific filter. |
|
609 | - if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){ |
|
610 | - /** |
|
611 | - * Filter the multiselect html by individual custom field. |
|
612 | - * |
|
613 | - * @param string $html The html to filter. |
|
614 | - * @param array $cf The custom field array. |
|
615 | - * @since 1.6.6 |
|
616 | - */ |
|
617 | - $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf); |
|
618 | - } |
|
619 | - |
|
620 | - // If no html then we run the standard output. |
|
621 | - if(empty($html)) { |
|
622 | - |
|
623 | - ob_start(); // Start buffering; |
|
624 | - $value = geodir_get_cf_value($cf); |
|
625 | - |
|
626 | - $multi_display = 'select'; |
|
627 | - if (!empty($cf['extra_fields'])) { |
|
628 | - $multi_display = unserialize($cf['extra_fields']); |
|
629 | - } |
|
630 | - ?> |
|
606 | + $html_var = $cf['htmlvar_name']; |
|
607 | + |
|
608 | + // Check if there is a custom field specific filter. |
|
609 | + if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){ |
|
610 | + /** |
|
611 | + * Filter the multiselect html by individual custom field. |
|
612 | + * |
|
613 | + * @param string $html The html to filter. |
|
614 | + * @param array $cf The custom field array. |
|
615 | + * @since 1.6.6 |
|
616 | + */ |
|
617 | + $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf); |
|
618 | + } |
|
619 | + |
|
620 | + // If no html then we run the standard output. |
|
621 | + if(empty($html)) { |
|
622 | + |
|
623 | + ob_start(); // Start buffering; |
|
624 | + $value = geodir_get_cf_value($cf); |
|
625 | + |
|
626 | + $multi_display = 'select'; |
|
627 | + if (!empty($cf['extra_fields'])) { |
|
628 | + $multi_display = unserialize($cf['extra_fields']); |
|
629 | + } |
|
630 | + ?> |
|
631 | 631 | <div id="<?php echo $cf['name']; ?>_row" |
632 | 632 | class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details"> |
633 | 633 | <label> |
634 | 634 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
635 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
635 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
636 | 636 | <?php if ($cf['is_required']) echo '<span>*</span>'; ?> |
637 | 637 | </label> |
638 | 638 | <input type="hidden" name="gd_field_<?php echo $cf['name']; ?>" value="1"/> |
@@ -643,63 +643,63 @@ discard block |
||
643 | 643 | data-placeholder="<?php _e('Select', 'geodirectory'); ?>" |
644 | 644 | option-ajaxchosen="false"> |
645 | 645 | <?php |
646 | - } else { |
|
647 | - echo '<ul class="gd_multi_choice">'; |
|
648 | - } |
|
649 | - |
|
650 | - $option_values_arr = geodir_string_values_to_options($cf['option_values'], true); |
|
651 | - $select_options = ''; |
|
652 | - if (!empty($option_values_arr)) { |
|
653 | - foreach ($option_values_arr as $option_row) { |
|
654 | - if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) { |
|
655 | - $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
|
656 | - |
|
657 | - if ($multi_display == 'select') { |
|
658 | - $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>'; |
|
659 | - } else { |
|
660 | - $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : ''; |
|
661 | - } |
|
662 | - } else { |
|
663 | - if (!is_array($value) && $value != '') { |
|
664 | - $value = trim($value); |
|
665 | - } |
|
646 | + } else { |
|
647 | + echo '<ul class="gd_multi_choice">'; |
|
648 | + } |
|
649 | + |
|
650 | + $option_values_arr = geodir_string_values_to_options($cf['option_values'], true); |
|
651 | + $select_options = ''; |
|
652 | + if (!empty($option_values_arr)) { |
|
653 | + foreach ($option_values_arr as $option_row) { |
|
654 | + if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) { |
|
655 | + $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
|
656 | + |
|
657 | + if ($multi_display == 'select') { |
|
658 | + $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>'; |
|
659 | + } else { |
|
660 | + $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : ''; |
|
661 | + } |
|
662 | + } else { |
|
663 | + if (!is_array($value) && $value != '') { |
|
664 | + $value = trim($value); |
|
665 | + } |
|
666 | 666 | |
667 | - $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
|
668 | - $option_value = isset($option_row['value']) ? $option_row['value'] : ''; |
|
669 | - $selected = $option_value == $value ? 'selected="selected"' : ''; |
|
670 | - $selected = ''; |
|
671 | - $checked = ''; |
|
672 | - |
|
673 | - if ((!is_array($value) && trim($value) != '') || (is_array($value) && !empty($value))) { |
|
674 | - if (!is_array($value)) { |
|
675 | - $value_array = explode(',', $value); |
|
676 | - } else { |
|
677 | - $value_array = $value; |
|
678 | - } |
|
667 | + $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
|
668 | + $option_value = isset($option_row['value']) ? $option_row['value'] : ''; |
|
669 | + $selected = $option_value == $value ? 'selected="selected"' : ''; |
|
670 | + $selected = ''; |
|
671 | + $checked = ''; |
|
672 | + |
|
673 | + if ((!is_array($value) && trim($value) != '') || (is_array($value) && !empty($value))) { |
|
674 | + if (!is_array($value)) { |
|
675 | + $value_array = explode(',', $value); |
|
676 | + } else { |
|
677 | + $value_array = $value; |
|
678 | + } |
|
679 | 679 | |
680 | - $value_array = stripslashes_deep($value_array); |
|
680 | + $value_array = stripslashes_deep($value_array); |
|
681 | 681 | |
682 | - if (is_array($value_array)) { |
|
683 | - $value_array = array_map('trim', $value_array); |
|
682 | + if (is_array($value_array)) { |
|
683 | + $value_array = array_map('trim', $value_array); |
|
684 | 684 | |
685 | - if (in_array($option_value, $value_array)) { |
|
686 | - $selected = 'selected="selected"'; |
|
687 | - $checked = 'checked="checked"'; |
|
688 | - } |
|
689 | - } |
|
690 | - } |
|
691 | - |
|
692 | - if ($multi_display == 'select') { |
|
693 | - $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
|
694 | - } else { |
|
695 | - $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" /> ' . $option_label . ' </li>'; |
|
696 | - } |
|
697 | - } |
|
698 | - } |
|
699 | - } |
|
700 | - echo $select_options; |
|
701 | - |
|
702 | - if ($multi_display == 'select') { ?></select></div> |
|
685 | + if (in_array($option_value, $value_array)) { |
|
686 | + $selected = 'selected="selected"'; |
|
687 | + $checked = 'checked="checked"'; |
|
688 | + } |
|
689 | + } |
|
690 | + } |
|
691 | + |
|
692 | + if ($multi_display == 'select') { |
|
693 | + $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
|
694 | + } else { |
|
695 | + $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" /> ' . $option_label . ' </li>'; |
|
696 | + } |
|
697 | + } |
|
698 | + } |
|
699 | + } |
|
700 | + echo $select_options; |
|
701 | + |
|
702 | + if ($multi_display == 'select') { ?></select></div> |
|
703 | 703 | <?php } else { ?></ul><?php } ?> |
704 | 704 | <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span> |
705 | 705 | <?php if ($cf['is_required']) { ?> |
@@ -707,10 +707,10 @@ discard block |
||
707 | 707 | <?php } ?> |
708 | 708 | </div> |
709 | 709 | <?php |
710 | - $html = ob_get_clean(); |
|
711 | - } |
|
710 | + $html = ob_get_clean(); |
|
711 | + } |
|
712 | 712 | |
713 | - return $html; |
|
713 | + return $html; |
|
714 | 714 | } |
715 | 715 | add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2); |
716 | 716 | |
@@ -726,32 +726,32 @@ discard block |
||
726 | 726 | */ |
727 | 727 | function geodir_cfi_html($html,$cf){ |
728 | 728 | |
729 | - $html_var = $cf['htmlvar_name']; |
|
729 | + $html_var = $cf['htmlvar_name']; |
|
730 | 730 | |
731 | - // Check if there is a custom field specific filter. |
|
732 | - if(has_filter("geodir_custom_field_input_html_{$html_var}")){ |
|
733 | - /** |
|
734 | - * Filter the html html by individual custom field. |
|
735 | - * |
|
736 | - * @param string $html The html to filter. |
|
737 | - * @param array $cf The custom field array. |
|
738 | - * @since 1.6.6 |
|
739 | - */ |
|
740 | - $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf); |
|
741 | - } |
|
731 | + // Check if there is a custom field specific filter. |
|
732 | + if(has_filter("geodir_custom_field_input_html_{$html_var}")){ |
|
733 | + /** |
|
734 | + * Filter the html html by individual custom field. |
|
735 | + * |
|
736 | + * @param string $html The html to filter. |
|
737 | + * @param array $cf The custom field array. |
|
738 | + * @since 1.6.6 |
|
739 | + */ |
|
740 | + $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf); |
|
741 | + } |
|
742 | 742 | |
743 | - // If no html then we run the standard output. |
|
744 | - if(empty($html)) { |
|
743 | + // If no html then we run the standard output. |
|
744 | + if(empty($html)) { |
|
745 | 745 | |
746 | - ob_start(); // Start buffering; |
|
747 | - $value = geodir_get_cf_value($cf); |
|
748 | - ?> |
|
746 | + ob_start(); // Start buffering; |
|
747 | + $value = geodir_get_cf_value($cf); |
|
748 | + ?> |
|
749 | 749 | |
750 | 750 | <div id="<?php echo $cf['name']; ?>_row" |
751 | 751 | class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details"> |
752 | 752 | <label> |
753 | 753 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
754 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
754 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
755 | 755 | <?php if ($cf['is_required']) echo '<span>*</span>'; ?> |
756 | 756 | </label> |
757 | 757 | |
@@ -769,10 +769,10 @@ discard block |
||
769 | 769 | </div> |
770 | 770 | |
771 | 771 | <?php |
772 | - $html = ob_get_clean(); |
|
773 | - } |
|
772 | + $html = ob_get_clean(); |
|
773 | + } |
|
774 | 774 | |
775 | - return $html; |
|
775 | + return $html; |
|
776 | 776 | } |
777 | 777 | add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2); |
778 | 778 | |
@@ -789,68 +789,68 @@ discard block |
||
789 | 789 | */ |
790 | 790 | function geodir_cfi_datepicker($html,$cf){ |
791 | 791 | |
792 | - $html_var = $cf['htmlvar_name']; |
|
792 | + $html_var = $cf['htmlvar_name']; |
|
793 | 793 | |
794 | - // Check if there is a custom field specific filter. |
|
795 | - if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){ |
|
796 | - /** |
|
797 | - * Filter the datepicker html by individual custom field. |
|
798 | - * |
|
799 | - * @param string $html The html to filter. |
|
800 | - * @param array $cf The custom field array. |
|
801 | - * @since 1.6.6 |
|
802 | - */ |
|
803 | - $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf); |
|
804 | - } |
|
794 | + // Check if there is a custom field specific filter. |
|
795 | + if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){ |
|
796 | + /** |
|
797 | + * Filter the datepicker html by individual custom field. |
|
798 | + * |
|
799 | + * @param string $html The html to filter. |
|
800 | + * @param array $cf The custom field array. |
|
801 | + * @since 1.6.6 |
|
802 | + */ |
|
803 | + $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf); |
|
804 | + } |
|
805 | 805 | |
806 | - // If no html then we run the standard output. |
|
807 | - if(empty($html)) { |
|
806 | + // If no html then we run the standard output. |
|
807 | + if(empty($html)) { |
|
808 | 808 | |
809 | - ob_start(); // Start buffering; |
|
810 | - $value = geodir_get_cf_value($cf); |
|
809 | + ob_start(); // Start buffering; |
|
810 | + $value = geodir_get_cf_value($cf); |
|
811 | 811 | |
812 | - $extra_fields = unserialize($cf['extra_fields']); |
|
813 | - $name = $cf['name']; |
|
812 | + $extra_fields = unserialize($cf['extra_fields']); |
|
813 | + $name = $cf['name']; |
|
814 | 814 | |
815 | - if ($extra_fields['date_format'] == '') |
|
816 | - $extra_fields['date_format'] = 'yy-mm-dd'; |
|
815 | + if ($extra_fields['date_format'] == '') |
|
816 | + $extra_fields['date_format'] = 'yy-mm-dd'; |
|
817 | 817 | |
818 | - $date_format = $extra_fields['date_format']; |
|
819 | - $jquery_date_format = $date_format; |
|
818 | + $date_format = $extra_fields['date_format']; |
|
819 | + $jquery_date_format = $date_format; |
|
820 | 820 | |
821 | 821 | |
822 | - // check if we need to change the format or not |
|
823 | - $date_format_len = strlen(str_replace(' ', '', $date_format)); |
|
824 | - if($date_format_len>5){// if greater then 5 then it's the old style format. |
|
822 | + // check if we need to change the format or not |
|
823 | + $date_format_len = strlen(str_replace(' ', '', $date_format)); |
|
824 | + if($date_format_len>5){// if greater then 5 then it's the old style format. |
|
825 | 825 | |
826 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
827 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
826 | + $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
827 | + $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
828 | 828 | |
829 | - $date_format = str_replace($search, $replace, $date_format); |
|
830 | - }else{ |
|
831 | - $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format ); |
|
832 | - } |
|
829 | + $date_format = str_replace($search, $replace, $date_format); |
|
830 | + }else{ |
|
831 | + $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format ); |
|
832 | + } |
|
833 | 833 | |
834 | - if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty |
|
835 | - if($value && !isset($_REQUEST['backandedit'])) { |
|
836 | - //$time = strtotime($value); |
|
837 | - //$value = date_i18n($date_format, $time); |
|
838 | - } |
|
839 | - $value = geodir_date($value, 'Y-m-d', $date_format); |
|
834 | + if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty |
|
835 | + if($value && !isset($_REQUEST['backandedit'])) { |
|
836 | + //$time = strtotime($value); |
|
837 | + //$value = date_i18n($date_format, $time); |
|
838 | + } |
|
839 | + $value = geodir_date($value, 'Y-m-d', $date_format); |
|
840 | 840 | |
841 | - ?> |
|
841 | + ?> |
|
842 | 842 | <script type="text/javascript"> |
843 | 843 | |
844 | 844 | jQuery(function () { |
845 | 845 | |
846 | 846 | jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php |
847 | - /** |
|
848 | - * Used to add extra option to datepicker per custom field. |
|
849 | - * |
|
850 | - * @since 1.5.7 |
|
851 | - * @param string $name The custom field name. |
|
852 | - */ |
|
853 | - echo apply_filters("gd_datepicker_extra_{$name}",'');?>}); |
|
847 | + /** |
|
848 | + * Used to add extra option to datepicker per custom field. |
|
849 | + * |
|
850 | + * @since 1.5.7 |
|
851 | + * @param string $name The custom field name. |
|
852 | + */ |
|
853 | + echo apply_filters("gd_datepicker_extra_{$name}",'');?>}); |
|
854 | 854 | |
855 | 855 | jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>'); |
856 | 856 | |
@@ -866,7 +866,7 @@ discard block |
||
866 | 866 | <label> |
867 | 867 | |
868 | 868 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
869 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
869 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
870 | 870 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
871 | 871 | </label> |
872 | 872 | |
@@ -880,10 +880,10 @@ discard block |
||
880 | 880 | </div> |
881 | 881 | |
882 | 882 | <?php |
883 | - $html = ob_get_clean(); |
|
884 | - } |
|
883 | + $html = ob_get_clean(); |
|
884 | + } |
|
885 | 885 | |
886 | - return $html; |
|
886 | + return $html; |
|
887 | 887 | } |
888 | 888 | add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2); |
889 | 889 | |
@@ -899,31 +899,31 @@ discard block |
||
899 | 899 | */ |
900 | 900 | function geodir_cfi_time($html,$cf){ |
901 | 901 | |
902 | - $html_var = $cf['htmlvar_name']; |
|
902 | + $html_var = $cf['htmlvar_name']; |
|
903 | 903 | |
904 | - // Check if there is a custom field specific filter. |
|
905 | - if(has_filter("geodir_custom_field_input_time_{$html_var}")){ |
|
906 | - /** |
|
907 | - * Filter the time html by individual custom field. |
|
908 | - * |
|
909 | - * @param string $html The html to filter. |
|
910 | - * @param array $cf The custom field array. |
|
911 | - * @since 1.6.6 |
|
912 | - */ |
|
913 | - $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf); |
|
914 | - } |
|
904 | + // Check if there is a custom field specific filter. |
|
905 | + if(has_filter("geodir_custom_field_input_time_{$html_var}")){ |
|
906 | + /** |
|
907 | + * Filter the time html by individual custom field. |
|
908 | + * |
|
909 | + * @param string $html The html to filter. |
|
910 | + * @param array $cf The custom field array. |
|
911 | + * @since 1.6.6 |
|
912 | + */ |
|
913 | + $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf); |
|
914 | + } |
|
915 | 915 | |
916 | - // If no html then we run the standard output. |
|
917 | - if(empty($html)) { |
|
916 | + // If no html then we run the standard output. |
|
917 | + if(empty($html)) { |
|
918 | 918 | |
919 | - ob_start(); // Start buffering; |
|
920 | - $value = geodir_get_cf_value($cf); |
|
919 | + ob_start(); // Start buffering; |
|
920 | + $value = geodir_get_cf_value($cf); |
|
921 | 921 | |
922 | - $name = $cf['name']; |
|
922 | + $name = $cf['name']; |
|
923 | 923 | |
924 | - if ($value != '') |
|
925 | - $value = date('H:i', strtotime($value)); |
|
926 | - ?> |
|
924 | + if ($value != '') |
|
925 | + $value = date('H:i', strtotime($value)); |
|
926 | + ?> |
|
927 | 927 | <script type="text/javascript"> |
928 | 928 | jQuery(document).ready(function () { |
929 | 929 | |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | <label> |
940 | 940 | |
941 | 941 | <?php $site_title = __($cf['site_title'], 'geodirectory'); |
942 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
942 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
943 | 943 | <?php if ($cf['is_required']) echo '<span>*</span>';?> |
944 | 944 | </label> |
945 | 945 | <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" |
@@ -951,10 +951,10 @@ discard block |
||
951 | 951 | <?php } ?> |
952 | 952 | </div> |
953 | 953 | <?php |
954 | - $html = ob_get_clean(); |
|
955 | - } |
|
954 | + $html = ob_get_clean(); |
|
955 | + } |
|
956 | 956 | |
957 | - return $html; |
|
957 | + return $html; |
|
958 | 958 | } |
959 | 959 | add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2); |
960 | 960 | |
@@ -970,102 +970,102 @@ discard block |
||
970 | 970 | */ |
971 | 971 | function geodir_cfi_address($html,$cf){ |
972 | 972 | |
973 | - $html_var = $cf['htmlvar_name']; |
|
974 | - |
|
975 | - // Check if there is a custom field specific filter. |
|
976 | - if(has_filter("geodir_custom_field_input_address_{$html_var}")){ |
|
977 | - /** |
|
978 | - * Filter the address html by individual custom field. |
|
979 | - * |
|
980 | - * @param string $html The html to filter. |
|
981 | - * @param array $cf The custom field array. |
|
982 | - * @since 1.6.6 |
|
983 | - */ |
|
984 | - $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf); |
|
985 | - } |
|
986 | - |
|
987 | - // If no html then we run the standard output. |
|
988 | - if(empty($html)) { |
|
989 | - |
|
990 | - global $gd_session; |
|
991 | - ob_start(); // Start buffering; |
|
992 | - $value = geodir_get_cf_value($cf); |
|
993 | - $name = $cf['name']; |
|
994 | - $type = $cf['type']; |
|
995 | - $admin_desc = $cf['desc']; |
|
996 | - $is_required = $cf['is_required']; |
|
997 | - $required_msg = $cf['required_msg']; |
|
998 | - $site_title = $cf['site_title']; |
|
999 | - $is_admin = $cf['is_admin']; |
|
1000 | - $extra_fields = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
1001 | - $prefix = $name . '_'; |
|
1002 | - |
|
1003 | - ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address'); |
|
1004 | - ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code '); |
|
1005 | - ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map'); |
|
1006 | - ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview'); |
|
1007 | - |
|
1008 | - $address = ''; |
|
1009 | - $zip = ''; |
|
1010 | - $mapview = ''; |
|
1011 | - $mapzoom = ''; |
|
1012 | - $lat = ''; |
|
1013 | - $lng = ''; |
|
1014 | - |
|
1015 | - if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) { |
|
1016 | - $post = $gd_ses_listing; |
|
1017 | - $address = $post[$prefix . 'address']; |
|
1018 | - $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : ''; |
|
1019 | - $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : ''; |
|
1020 | - $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : ''; |
|
1021 | - $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : ''; |
|
1022 | - $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : ''; |
|
1023 | - } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) { |
|
1024 | - $post_info = (array)$post_info; |
|
1025 | - |
|
1026 | - $address = $post_info[$prefix . 'address']; |
|
1027 | - $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : ''; |
|
1028 | - $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : ''; |
|
1029 | - $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : ''; |
|
1030 | - $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : ''; |
|
1031 | - $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : ''; |
|
1032 | - } |
|
1033 | - |
|
1034 | - $location = geodir_get_default_location(); |
|
1035 | - if (empty($city)) $city = isset($location->city) ? $location->city : ''; |
|
1036 | - if (empty($region)) $region = isset($location->region) ? $location->region : ''; |
|
1037 | - if (empty($country)) $country = isset($location->country) ? $location->country : ''; |
|
1038 | - |
|
1039 | - $lat_lng_blank = false; |
|
1040 | - if (empty($lat) && empty($lng)) { |
|
1041 | - $lat_lng_blank = true; |
|
1042 | - } |
|
1043 | - |
|
1044 | - if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : ''; |
|
1045 | - if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : ''; |
|
1046 | - |
|
1047 | - /** |
|
1048 | - * Filter the default latitude. |
|
1049 | - * |
|
1050 | - * @since 1.0.0 |
|
1051 | - * |
|
1052 | - * @param float $lat Default latitude. |
|
1053 | - * @param bool $is_admin For admin use only?. |
|
1054 | - */ |
|
1055 | - $lat = apply_filters('geodir_default_latitude', $lat, $is_admin); |
|
1056 | - /** |
|
1057 | - * Filter the default longitude. |
|
1058 | - * |
|
1059 | - * @since 1.0.0 |
|
1060 | - * |
|
1061 | - * @param float $lat Default longitude. |
|
1062 | - * @param bool $is_admin For admin use only?. |
|
1063 | - */ |
|
1064 | - $lng = apply_filters('geodir_default_longitude', $lng, $is_admin); |
|
1065 | - |
|
1066 | - $locate_me = !empty($extra_fields['show_map']) && geodir_map_name() != 'none' ? true : false; |
|
1067 | - $locate_me_class = $locate_me ? ' gd-form-control' : ''; |
|
1068 | - ?> |
|
973 | + $html_var = $cf['htmlvar_name']; |
|
974 | + |
|
975 | + // Check if there is a custom field specific filter. |
|
976 | + if(has_filter("geodir_custom_field_input_address_{$html_var}")){ |
|
977 | + /** |
|
978 | + * Filter the address html by individual custom field. |
|
979 | + * |
|
980 | + * @param string $html The html to filter. |
|
981 | + * @param array $cf The custom field array. |
|
982 | + * @since 1.6.6 |
|
983 | + */ |
|
984 | + $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf); |
|
985 | + } |
|
986 | + |
|
987 | + // If no html then we run the standard output. |
|
988 | + if(empty($html)) { |
|
989 | + |
|
990 | + global $gd_session; |
|
991 | + ob_start(); // Start buffering; |
|
992 | + $value = geodir_get_cf_value($cf); |
|
993 | + $name = $cf['name']; |
|
994 | + $type = $cf['type']; |
|
995 | + $admin_desc = $cf['desc']; |
|
996 | + $is_required = $cf['is_required']; |
|
997 | + $required_msg = $cf['required_msg']; |
|
998 | + $site_title = $cf['site_title']; |
|
999 | + $is_admin = $cf['is_admin']; |
|
1000 | + $extra_fields = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
1001 | + $prefix = $name . '_'; |
|
1002 | + |
|
1003 | + ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address'); |
|
1004 | + ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code '); |
|
1005 | + ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map'); |
|
1006 | + ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview'); |
|
1007 | + |
|
1008 | + $address = ''; |
|
1009 | + $zip = ''; |
|
1010 | + $mapview = ''; |
|
1011 | + $mapzoom = ''; |
|
1012 | + $lat = ''; |
|
1013 | + $lng = ''; |
|
1014 | + |
|
1015 | + if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) { |
|
1016 | + $post = $gd_ses_listing; |
|
1017 | + $address = $post[$prefix . 'address']; |
|
1018 | + $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : ''; |
|
1019 | + $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : ''; |
|
1020 | + $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : ''; |
|
1021 | + $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : ''; |
|
1022 | + $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : ''; |
|
1023 | + } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) { |
|
1024 | + $post_info = (array)$post_info; |
|
1025 | + |
|
1026 | + $address = $post_info[$prefix . 'address']; |
|
1027 | + $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : ''; |
|
1028 | + $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : ''; |
|
1029 | + $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : ''; |
|
1030 | + $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : ''; |
|
1031 | + $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : ''; |
|
1032 | + } |
|
1033 | + |
|
1034 | + $location = geodir_get_default_location(); |
|
1035 | + if (empty($city)) $city = isset($location->city) ? $location->city : ''; |
|
1036 | + if (empty($region)) $region = isset($location->region) ? $location->region : ''; |
|
1037 | + if (empty($country)) $country = isset($location->country) ? $location->country : ''; |
|
1038 | + |
|
1039 | + $lat_lng_blank = false; |
|
1040 | + if (empty($lat) && empty($lng)) { |
|
1041 | + $lat_lng_blank = true; |
|
1042 | + } |
|
1043 | + |
|
1044 | + if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : ''; |
|
1045 | + if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : ''; |
|
1046 | + |
|
1047 | + /** |
|
1048 | + * Filter the default latitude. |
|
1049 | + * |
|
1050 | + * @since 1.0.0 |
|
1051 | + * |
|
1052 | + * @param float $lat Default latitude. |
|
1053 | + * @param bool $is_admin For admin use only?. |
|
1054 | + */ |
|
1055 | + $lat = apply_filters('geodir_default_latitude', $lat, $is_admin); |
|
1056 | + /** |
|
1057 | + * Filter the default longitude. |
|
1058 | + * |
|
1059 | + * @since 1.0.0 |
|
1060 | + * |
|
1061 | + * @param float $lat Default longitude. |
|
1062 | + * @param bool $is_admin For admin use only?. |
|
1063 | + */ |
|
1064 | + $lng = apply_filters('geodir_default_longitude', $lng, $is_admin); |
|
1065 | + |
|
1066 | + $locate_me = !empty($extra_fields['show_map']) && geodir_map_name() != 'none' ? true : false; |
|
1067 | + $locate_me_class = $locate_me ? ' gd-form-control' : ''; |
|
1068 | + ?> |
|
1069 | 1069 | <div id="geodir_<?php echo $prefix . 'address';?>_row" |
1070 | 1070 | class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
1071 | 1071 | <label><?php _e($address_title, 'geodirectory'); ?> <?php if ($is_required) echo '<span>*</span>';?></label> |
@@ -1084,17 +1084,17 @@ discard block |
||
1084 | 1084 | </div> |
1085 | 1085 | |
1086 | 1086 | <?php |
1087 | - /** |
|
1088 | - * Called after the address input on the add listings. |
|
1089 | - * |
|
1090 | - * This is used by the location manage to add further locations info etc. |
|
1091 | - * |
|
1092 | - * @since 1.0.0 |
|
1093 | - * @param array $cf The array of setting for the custom field. {@see geodir_custom_field_save()}. |
|
1094 | - */ |
|
1095 | - do_action('geodir_address_extra_listing_fields', $cf); |
|
1096 | - |
|
1097 | - if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?> |
|
1087 | + /** |
|
1088 | + * Called after the address input on the add listings. |
|
1089 | + * |
|
1090 | + * This is used by the location manage to add further locations info etc. |
|
1091 | + * |
|
1092 | + * @since 1.0.0 |
|
1093 | + * @param array $cf The array of setting for the custom field. {@see geodir_custom_field_save()}. |
|
1094 | + */ |
|
1095 | + do_action('geodir_address_extra_listing_fields', $cf); |
|
1096 | + |
|
1097 | + if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?> |
|
1098 | 1098 | |
1099 | 1099 | <div id="geodir_<?php echo $prefix . 'zip'; ?>_row" |
1100 | 1100 | class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details"> |
@@ -1115,22 +1115,22 @@ discard block |
||
1115 | 1115 | |
1116 | 1116 | <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details"> |
1117 | 1117 | <?php |
1118 | - /** |
|
1119 | - * Contains add listing page map functions. |
|
1120 | - * |
|
1121 | - * @since 1.0.0 |
|
1122 | - */ |
|
1123 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php"); |
|
1124 | - if ($lat_lng_blank) { |
|
1125 | - $lat = ''; |
|
1126 | - $lng = ''; |
|
1127 | - } |
|
1128 | - ?> |
|
1118 | + /** |
|
1119 | + * Contains add listing page map functions. |
|
1120 | + * |
|
1121 | + * @since 1.0.0 |
|
1122 | + */ |
|
1123 | + include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php"); |
|
1124 | + if ($lat_lng_blank) { |
|
1125 | + $lat = ''; |
|
1126 | + $lng = ''; |
|
1127 | + } |
|
1128 | + ?> |
|
1129 | 1129 | <span class="geodir_message_note"><?php echo stripslashes(GET_MAP_MSG); ?></span> |
1130 | 1130 | </div> |
1131 | 1131 | <?php |
1132 | - /* show lat lng */ |
|
1133 | - $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?> |
|
1132 | + /* show lat lng */ |
|
1133 | + $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?> |
|
1134 | 1134 | <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row" |
1135 | 1135 | class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>> |
1136 | 1136 | <label> |
@@ -1171,27 +1171,27 @@ discard block |
||
1171 | 1171 | class="gd-checkbox" |
1172 | 1172 | name="<?php echo $prefix . 'mapview'; ?>" |
1173 | 1173 | id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') { |
1174 | - echo 'checked="checked"'; |
|
1175 | - } ?> value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span> |
|
1174 | + echo 'checked="checked"'; |
|
1175 | + } ?> value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span> |
|
1176 | 1176 | <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio" |
1177 | 1177 | class="gd-checkbox" |
1178 | 1178 | name="<?php echo $prefix . 'mapview'; ?>" |
1179 | 1179 | id="map_view1" <?php if ($mapview == 'SATELLITE') { |
1180 | - echo 'checked="checked"'; |
|
1181 | - } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span> |
|
1180 | + echo 'checked="checked"'; |
|
1181 | + } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span> |
|
1182 | 1182 | |
1183 | 1183 | <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio" |
1184 | 1184 | class="gd-checkbox" |
1185 | 1185 | name="<?php echo $prefix . 'mapview'; ?>" |
1186 | 1186 | id="map_view2" <?php if ($mapview == 'HYBRID') { |
1187 | - echo 'checked="checked"'; |
|
1188 | - } ?> value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span> |
|
1187 | + echo 'checked="checked"'; |
|
1188 | + } ?> value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span> |
|
1189 | 1189 | <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio" |
1190 | 1190 | class="gd-checkbox" |
1191 | 1191 | name="<?php echo $prefix . 'mapview'; ?>" |
1192 | 1192 | id="map_view3" <?php if ($mapview == 'TERRAIN') { |
1193 | - echo 'checked="checked"'; |
|
1194 | - } ?> value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span> |
|
1193 | + echo 'checked="checked"'; |
|
1194 | + } ?> value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span> |
|
1195 | 1195 | |
1196 | 1196 | |
1197 | 1197 | </div> |
@@ -1199,14 +1199,14 @@ discard block |
||
1199 | 1199 | |
1200 | 1200 | <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?> |
1201 | 1201 | <input type="hidden" value="<?php if (isset($mapzoom)) { |
1202 | - echo esc_attr($mapzoom); |
|
1203 | - } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/> |
|
1202 | + echo esc_attr($mapzoom); |
|
1203 | + } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/> |
|
1204 | 1204 | <?php } |
1205 | 1205 | |
1206 | - $html = ob_get_clean(); |
|
1207 | - } |
|
1206 | + $html = ob_get_clean(); |
|
1207 | + } |
|
1208 | 1208 | |
1209 | - return $html; |
|
1209 | + return $html; |
|
1210 | 1210 | } |
1211 | 1211 | add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2); |
1212 | 1212 | |
@@ -1223,135 +1223,135 @@ discard block |
||
1223 | 1223 | */ |
1224 | 1224 | function geodir_cfi_taxonomy($html,$cf){ |
1225 | 1225 | |
1226 | - $html_var = $cf['htmlvar_name']; |
|
1227 | - |
|
1228 | - // Check if there is a custom field specific filter. |
|
1229 | - if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){ |
|
1230 | - /** |
|
1231 | - * Filter the taxonomy html by individual custom field. |
|
1232 | - * |
|
1233 | - * @param string $html The html to filter. |
|
1234 | - * @param array $cf The custom field array. |
|
1235 | - * @since 1.6.6 |
|
1236 | - */ |
|
1237 | - $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf); |
|
1238 | - } |
|
1239 | - |
|
1240 | - // If no html then we run the standard output. |
|
1241 | - if(empty($html)) { |
|
1242 | - |
|
1243 | - ob_start(); // Start buffering; |
|
1244 | - $value = geodir_get_cf_value($cf); |
|
1245 | - |
|
1246 | - $name = $cf['name']; |
|
1247 | - $site_title = $cf['site_title']; |
|
1248 | - $admin_desc = $cf['desc']; |
|
1249 | - $is_required = $cf['is_required']; |
|
1250 | - $is_admin = $cf['is_admin']; |
|
1251 | - $required_msg = $cf['required_msg']; |
|
1252 | - |
|
1253 | - if ($value == $cf['default']) { |
|
1254 | - $value = ''; |
|
1255 | - } ?> |
|
1226 | + $html_var = $cf['htmlvar_name']; |
|
1227 | + |
|
1228 | + // Check if there is a custom field specific filter. |
|
1229 | + if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){ |
|
1230 | + /** |
|
1231 | + * Filter the taxonomy html by individual custom field. |
|
1232 | + * |
|
1233 | + * @param string $html The html to filter. |
|
1234 | + * @param array $cf The custom field array. |
|
1235 | + * @since 1.6.6 |
|
1236 | + */ |
|
1237 | + $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf); |
|
1238 | + } |
|
1239 | + |
|
1240 | + // If no html then we run the standard output. |
|
1241 | + if(empty($html)) { |
|
1242 | + |
|
1243 | + ob_start(); // Start buffering; |
|
1244 | + $value = geodir_get_cf_value($cf); |
|
1245 | + |
|
1246 | + $name = $cf['name']; |
|
1247 | + $site_title = $cf['site_title']; |
|
1248 | + $admin_desc = $cf['desc']; |
|
1249 | + $is_required = $cf['is_required']; |
|
1250 | + $is_admin = $cf['is_admin']; |
|
1251 | + $required_msg = $cf['required_msg']; |
|
1252 | + |
|
1253 | + if ($value == $cf['default']) { |
|
1254 | + $value = ''; |
|
1255 | + } ?> |
|
1256 | 1256 | <div id="<?php echo $name;?>_row" |
1257 | 1257 | class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
1258 | 1258 | <label> |
1259 | 1259 | <?php $site_title = __($site_title, 'geodirectory'); |
1260 | - echo (trim($site_title)) ? $site_title : ' '; ?> |
|
1260 | + echo (trim($site_title)) ? $site_title : ' '; ?> |
|
1261 | 1261 | <?php if ($is_required) echo '<span>*</span>';?> |
1262 | 1262 | </label> |
1263 | 1263 | |
1264 | 1264 | <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;"> |
1265 | 1265 | <?php |
1266 | - global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats; |
|
1266 | + global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats; |
|
1267 | 1267 | |
1268 | - $exclude_cats = array(); |
|
1268 | + $exclude_cats = array(); |
|
1269 | 1269 | |
1270 | - if ($is_admin == '1') { |
|
1270 | + if ($is_admin == '1') { |
|
1271 | 1271 | |
1272 | - $post_type = get_post_type(); |
|
1272 | + $post_type = get_post_type(); |
|
1273 | 1273 | |
1274 | - $package_info = array(); |
|
1274 | + $package_info = array(); |
|
1275 | 1275 | |
1276 | - $package_info = (array)geodir_post_package_info($package_info, $post, $post_type); |
|
1276 | + $package_info = (array)geodir_post_package_info($package_info, $post, $post_type); |
|
1277 | 1277 | |
1278 | - if (!empty($package_info)) { |
|
1278 | + if (!empty($package_info)) { |
|
1279 | 1279 | |
1280 | - if (isset($package_info['cat']) && $package_info['cat'] != '') { |
|
1280 | + if (isset($package_info['cat']) && $package_info['cat'] != '') { |
|
1281 | 1281 | |
1282 | - $exclude_cats = explode(',', $package_info['cat']); |
|
1282 | + $exclude_cats = explode(',', $package_info['cat']); |
|
1283 | 1283 | |
1284 | - } |
|
1285 | - } |
|
1286 | - } |
|
1284 | + } |
|
1285 | + } |
|
1286 | + } |
|
1287 | 1287 | |
1288 | - $cat_display = unserialize($cf['extra_fields']); |
|
1288 | + $cat_display = unserialize($cf['extra_fields']); |
|
1289 | 1289 | |
1290 | - if (isset($_REQUEST['backandedit']) && !empty($post_cat[$name]) && is_array($post_cat[$name])) { |
|
1291 | - $post_cat = implode(",", $post_cat[$name]); |
|
1292 | - } else { |
|
1293 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
1294 | - $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true); |
|
1295 | - } |
|
1290 | + if (isset($_REQUEST['backandedit']) && !empty($post_cat[$name]) && is_array($post_cat[$name])) { |
|
1291 | + $post_cat = implode(",", $post_cat[$name]); |
|
1292 | + } else { |
|
1293 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
1294 | + $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true); |
|
1295 | + } |
|
1296 | 1296 | |
1297 | 1297 | |
1298 | - global $geodir_addon_list; |
|
1299 | - if (!empty($geodir_addon_list) && array_key_exists('geodir_payment_manager', $geodir_addon_list) && $geodir_addon_list['geodir_payment_manager'] == 'yes') { |
|
1298 | + global $geodir_addon_list; |
|
1299 | + if (!empty($geodir_addon_list) && array_key_exists('geodir_payment_manager', $geodir_addon_list) && $geodir_addon_list['geodir_payment_manager'] == 'yes') { |
|
1300 | 1300 | |
1301 | - $catadd_limit = $wpdb->get_var( |
|
1302 | - $wpdb->prepare( |
|
1303 | - "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d", |
|
1304 | - array($package_id) |
|
1305 | - ) |
|
1306 | - ); |
|
1301 | + $catadd_limit = $wpdb->get_var( |
|
1302 | + $wpdb->prepare( |
|
1303 | + "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d", |
|
1304 | + array($package_id) |
|
1305 | + ) |
|
1306 | + ); |
|
1307 | 1307 | |
1308 | 1308 | |
1309 | - } else { |
|
1310 | - $catadd_limit = 0; |
|
1311 | - } |
|
1309 | + } else { |
|
1310 | + $catadd_limit = 0; |
|
1311 | + } |
|
1312 | 1312 | |
1313 | 1313 | |
1314 | - if ($cat_display != '' && $cat_display != 'ajax_chained') { |
|
1314 | + if ($cat_display != '' && $cat_display != 'ajax_chained') { |
|
1315 | 1315 | |
1316 | - $required_limit_msg = ''; |
|
1317 | - if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') { |
|
1316 | + $required_limit_msg = ''; |
|
1317 | + if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') { |
|
1318 | 1318 | |
1319 | - $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory'); |
|
1319 | + $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory'); |
|
1320 | 1320 | |
1321 | - } else { |
|
1322 | - $required_limit_msg = $required_msg; |
|
1323 | - } |
|
1321 | + } else { |
|
1322 | + $required_limit_msg = $required_msg; |
|
1323 | + } |
|
1324 | 1324 | |
1325 | - echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']" />'; |
|
1325 | + echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']" />'; |
|
1326 | 1326 | |
1327 | 1327 | |
1328 | - if ($cat_display == 'select' || $cat_display == 'multiselect') { |
|
1328 | + if ($cat_display == 'select' || $cat_display == 'multiselect') { |
|
1329 | 1329 | |
1330 | - $cat_display == ''; |
|
1331 | - $multiple = ''; |
|
1332 | - if ($cat_display == 'multiselect') |
|
1333 | - $multiple = 'multiple="multiple"'; |
|
1330 | + $cat_display == ''; |
|
1331 | + $multiple = ''; |
|
1332 | + if ($cat_display == 'multiselect') |
|
1333 | + $multiple = 'multiple="multiple"'; |
|
1334 | 1334 | |
1335 | - echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">'; |
|
1335 | + echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">'; |
|
1336 | 1336 | |
1337 | 1337 | |
1338 | - if ($cat_display == 'select') |
|
1339 | - echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>'; |
|
1338 | + if ($cat_display == 'select') |
|
1339 | + echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>'; |
|
1340 | 1340 | |
1341 | - } |
|
1341 | + } |
|
1342 | 1342 | |
1343 | - echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0); |
|
1343 | + echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0); |
|
1344 | 1344 | |
1345 | - if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
1346 | - echo '</select>'; |
|
1345 | + if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
1346 | + echo '</select>'; |
|
1347 | 1347 | |
1348 | - } else { |
|
1348 | + } else { |
|
1349 | 1349 | |
1350 | - echo geodir_custom_taxonomy_walker2($name, $catadd_limit); |
|
1350 | + echo geodir_custom_taxonomy_walker2($name, $catadd_limit); |
|
1351 | 1351 | |
1352 | - } |
|
1352 | + } |
|
1353 | 1353 | |
1354 | - ?> |
|
1354 | + ?> |
|
1355 | 1355 | </div> |
1356 | 1356 | |
1357 | 1357 | <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
@@ -1361,10 +1361,10 @@ discard block |
||
1361 | 1361 | </div> |
1362 | 1362 | |
1363 | 1363 | <?php |
1364 | - $html = ob_get_clean(); |
|
1365 | - } |
|
1364 | + $html = ob_get_clean(); |
|
1365 | + } |
|
1366 | 1366 | |
1367 | - return $html; |
|
1367 | + return $html; |
|
1368 | 1368 | } |
1369 | 1369 | add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2); |
1370 | 1370 | |
@@ -1380,74 +1380,74 @@ discard block |
||
1380 | 1380 | */ |
1381 | 1381 | function geodir_cfi_file($html,$cf){ |
1382 | 1382 | |
1383 | - $html_var = $cf['htmlvar_name']; |
|
1383 | + $html_var = $cf['htmlvar_name']; |
|
1384 | 1384 | |
1385 | - // Check if there is a custom field specific filter. |
|
1386 | - if(has_filter("geodir_custom_field_input_file_{$html_var}")){ |
|
1387 | - /** |
|
1388 | - * Filter the file html by individual custom field. |
|
1389 | - * |
|
1390 | - * @param string $html The html to filter. |
|
1391 | - * @param array $cf The custom field array. |
|
1392 | - * @since 1.6.6 |
|
1393 | - */ |
|
1394 | - $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf); |
|
1395 | - } |
|
1385 | + // Check if there is a custom field specific filter. |
|
1386 | + if(has_filter("geodir_custom_field_input_file_{$html_var}")){ |
|
1387 | + /** |
|
1388 | + * Filter the file html by individual custom field. |
|
1389 | + * |
|
1390 | + * @param string $html The html to filter. |
|
1391 | + * @param array $cf The custom field array. |
|
1392 | + * @since 1.6.6 |
|
1393 | + */ |
|
1394 | + $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf); |
|
1395 | + } |
|
1396 | 1396 | |
1397 | - // If no html then we run the standard output. |
|
1398 | - if(empty($html)) { |
|
1397 | + // If no html then we run the standard output. |
|
1398 | + if(empty($html)) { |
|
1399 | 1399 | |
1400 | - ob_start(); // Start buffering; |
|
1401 | - $value = geodir_get_cf_value($cf); |
|
1400 | + ob_start(); // Start buffering; |
|
1401 | + $value = geodir_get_cf_value($cf); |
|
1402 | 1402 | |
1403 | - $name = $cf['name']; |
|
1404 | - $site_title = $cf['site_title']; |
|
1405 | - $admin_desc = $cf['desc']; |
|
1406 | - $is_required = $cf['is_required']; |
|
1407 | - $required_msg = $cf['required_msg']; |
|
1408 | - $extra_fields = unserialize($cf['extra_fields']); |
|
1403 | + $name = $cf['name']; |
|
1404 | + $site_title = $cf['site_title']; |
|
1405 | + $admin_desc = $cf['desc']; |
|
1406 | + $is_required = $cf['is_required']; |
|
1407 | + $required_msg = $cf['required_msg']; |
|
1408 | + $extra_fields = unserialize($cf['extra_fields']); |
|
1409 | 1409 | |
1410 | 1410 | |
1411 | - // adjust values here |
|
1412 | - $file_id = $name; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
1411 | + // adjust values here |
|
1412 | + $file_id = $name; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
1413 | 1413 | |
1414 | - if ($value != '') { |
|
1414 | + if ($value != '') { |
|
1415 | 1415 | |
1416 | - $file_value = trim($value, ","); // this will be initial value of the above form field. Image urls. |
|
1416 | + $file_value = trim($value, ","); // this will be initial value of the above form field. Image urls. |
|
1417 | 1417 | |
1418 | - } else |
|
1419 | - $file_value = ''; |
|
1418 | + } else |
|
1419 | + $file_value = ''; |
|
1420 | 1420 | |
1421 | - if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple']) |
|
1422 | - $file_multiple = true; // allow multiple files upload |
|
1423 | - else |
|
1424 | - $file_multiple = false; |
|
1421 | + if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple']) |
|
1422 | + $file_multiple = true; // allow multiple files upload |
|
1423 | + else |
|
1424 | + $file_multiple = false; |
|
1425 | 1425 | |
1426 | - if (isset($extra_fields['image_limit']) && $extra_fields['image_limit']) |
|
1427 | - $file_image_limit = $extra_fields['image_limit']; |
|
1428 | - else |
|
1429 | - $file_image_limit = 1; |
|
1426 | + if (isset($extra_fields['image_limit']) && $extra_fields['image_limit']) |
|
1427 | + $file_image_limit = $extra_fields['image_limit']; |
|
1428 | + else |
|
1429 | + $file_image_limit = 1; |
|
1430 | 1430 | |
1431 | - $file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
1431 | + $file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
1432 | 1432 | |
1433 | - $file_height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
1433 | + $file_height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
1434 | 1434 | |
1435 | - if (!empty($file_value)) { |
|
1436 | - $curImages = explode(',', $file_value); |
|
1437 | - if (!empty($curImages)) |
|
1438 | - $file_totImg = count($curImages); |
|
1439 | - } |
|
1435 | + if (!empty($file_value)) { |
|
1436 | + $curImages = explode(',', $file_value); |
|
1437 | + if (!empty($curImages)) |
|
1438 | + $file_totImg = count($curImages); |
|
1439 | + } |
|
1440 | 1440 | |
1441 | - $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : ''; |
|
1442 | - $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : ''; |
|
1441 | + $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : ''; |
|
1442 | + $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : ''; |
|
1443 | 1443 | |
1444 | - ?> |
|
1444 | + ?> |
|
1445 | 1445 | <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?> |
1446 | 1446 | <?php if($file_image_limit!=0 && $file_image_limit==1 ){echo '<br /><small>('.__('You can upload').' '.$file_image_limit.' '.__('image with this package').')</small>';} ?> |
1447 | 1447 | <?php if($file_image_limit!=0 && $file_image_limit>1 ){echo '<br /><small>('.__('You can upload').' '.$file_image_limit.' '.__('images with this package').')</small>';} ?> |
1448 | 1448 | <?php if($file_image_limit==0){echo '<br /><small>('.__('You can upload unlimited images with this package').')</small>';} ?> |
1449 | 1449 | </h5> <?php */ |
1450 | - ?> |
|
1450 | + ?> |
|
1451 | 1451 | |
1452 | 1452 | <div id="<?php echo $name;?>_row" |
1453 | 1453 | class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details"> |
@@ -1455,7 +1455,7 @@ discard block |
||
1455 | 1455 | <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;"> |
1456 | 1456 | <label |
1457 | 1457 | style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory'); |
1458 | - echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label> |
|
1458 | + echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label> |
|
1459 | 1459 | <input class="geodir-custom-file-upload" field_type="file" type="hidden" |
1460 | 1460 | name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>" |
1461 | 1461 | value="<?php echo esc_attr($file_value); ?>"/> |
@@ -1467,17 +1467,17 @@ discard block |
||
1467 | 1467 | <?php } ?> |
1468 | 1468 | <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg" |
1469 | 1469 | value="<?php if (isset($file_totImg)) { |
1470 | - echo esc_attr($file_totImg); |
|
1471 | - } else { |
|
1472 | - echo '0'; |
|
1473 | - } ?>"/> |
|
1470 | + echo esc_attr($file_totImg); |
|
1471 | + } else { |
|
1472 | + echo '0'; |
|
1473 | + } ?>"/> |
|
1474 | 1474 | |
1475 | 1475 | <div style="float:left; width:55%;"> |
1476 | 1476 | <div |
1477 | 1477 | class="plupload-upload-uic hide-if-no-js <?php if ($file_multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
1478 | 1478 | id="<?php echo $file_id; ?>plupload-upload-ui" style="float:left; width:30%;"> |
1479 | 1479 | <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */ |
1480 | - ?> |
|
1480 | + ?> |
|
1481 | 1481 | <input id="<?php echo $file_id; ?>plupload-browse-button" type="button" |
1482 | 1482 | value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>" |
1483 | 1483 | class="geodir_button" style="margin-top:10px;"/> |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | style=" clear:inherit; margin-top:0; margin-left:15px; padding-top:10px; float:left; width:50%;"> |
1497 | 1497 | </div> |
1498 | 1498 | <?php /*?><span id="upload-msg" ><?php _e('Please drag & drop the images to rearrange the order');?></span><?php */ |
1499 | - ?> |
|
1499 | + ?> |
|
1500 | 1500 | |
1501 | 1501 | <span id="<?php echo $file_id; ?>upload-error" style="display:none"></span> |
1502 | 1502 | |
@@ -1510,9 +1510,9 @@ discard block |
||
1510 | 1510 | |
1511 | 1511 | |
1512 | 1512 | <?php |
1513 | - $html = ob_get_clean(); |
|
1514 | - } |
|
1513 | + $html = ob_get_clean(); |
|
1514 | + } |
|
1515 | 1515 | |
1516 | - return $html; |
|
1516 | + return $html; |
|
1517 | 1517 | } |
1518 | 1518 | add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2); |
1519 | 1519 | \ No newline at end of file |