@@ -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,106 +275,106 @@ discard block |
||
275 | 275 | function geodir_content_actions_dynamic() |
276 | 276 | { |
277 | 277 | |
278 | - $tc = get_option('theme_compatibility_setting'); |
|
279 | - if (empty($tc)) { |
|
280 | - return; |
|
281 | - } |
|
278 | + $tc = get_option('theme_compatibility_setting'); |
|
279 | + if (empty($tc)) { |
|
280 | + return; |
|
281 | + } |
|
282 | 282 | |
283 | - //php |
|
284 | - if (!empty($tc['geodir_theme_compat_code'])) { |
|
285 | - include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php'); |
|
286 | - } |
|
283 | + //php |
|
284 | + if (!empty($tc['geodir_theme_compat_code'])) { |
|
285 | + include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php'); |
|
286 | + } |
|
287 | 287 | |
288 | - //geodir_full_page_class |
|
289 | - if (!empty($tc['geodir_full_page_class_filter'])) { |
|
290 | - add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10); |
|
291 | - } |
|
288 | + //geodir_full_page_class |
|
289 | + if (!empty($tc['geodir_full_page_class_filter'])) { |
|
290 | + add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10); |
|
291 | + } |
|
292 | 292 | |
293 | - //widget before filter |
|
294 | - if (!empty($tc['geodir_before_widget_filter'])) { |
|
295 | - add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10); |
|
296 | - } |
|
293 | + //widget before filter |
|
294 | + if (!empty($tc['geodir_before_widget_filter'])) { |
|
295 | + add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10); |
|
296 | + } |
|
297 | 297 | |
298 | - //widget after filter |
|
299 | - if (!empty($tc['geodir_after_widget_filter'])) { |
|
300 | - add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10); |
|
301 | - } |
|
298 | + //widget after filter |
|
299 | + if (!empty($tc['geodir_after_widget_filter'])) { |
|
300 | + add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10); |
|
301 | + } |
|
302 | 302 | |
303 | - //widget before title filter |
|
304 | - if (!empty($tc['geodir_before_title_filter'])) { |
|
305 | - add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10); |
|
306 | - } |
|
303 | + //widget before title filter |
|
304 | + if (!empty($tc['geodir_before_title_filter'])) { |
|
305 | + add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10); |
|
306 | + } |
|
307 | 307 | |
308 | - //widget before title filter |
|
309 | - if (!empty($tc['geodir_after_title_filter'])) { |
|
310 | - add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10); |
|
311 | - } |
|
308 | + //widget before title filter |
|
309 | + if (!empty($tc['geodir_after_title_filter'])) { |
|
310 | + add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10); |
|
311 | + } |
|
312 | 312 | |
313 | - //menu li class |
|
314 | - if (!empty($tc['geodir_menu_li_class_filter'])) { |
|
315 | - add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10); |
|
316 | - } |
|
313 | + //menu li class |
|
314 | + if (!empty($tc['geodir_menu_li_class_filter'])) { |
|
315 | + add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10); |
|
316 | + } |
|
317 | 317 | |
318 | - //menu ul class |
|
319 | - if (!empty($tc['geodir_sub_menu_ul_class_filter'])) { |
|
320 | - add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10); |
|
321 | - } |
|
318 | + //menu ul class |
|
319 | + if (!empty($tc['geodir_sub_menu_ul_class_filter'])) { |
|
320 | + add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10); |
|
321 | + } |
|
322 | 322 | |
323 | - //menu sub li class |
|
324 | - if (!empty($tc['geodir_sub_menu_li_class_filter'])) { |
|
325 | - add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10); |
|
326 | - } |
|
323 | + //menu sub li class |
|
324 | + if (!empty($tc['geodir_sub_menu_li_class_filter'])) { |
|
325 | + add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10); |
|
326 | + } |
|
327 | 327 | |
328 | - //menu a class |
|
329 | - if (!empty($tc['geodir_menu_a_class_filter'])) { |
|
330 | - add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10); |
|
331 | - } |
|
328 | + //menu a class |
|
329 | + if (!empty($tc['geodir_menu_a_class_filter'])) { |
|
330 | + add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10); |
|
331 | + } |
|
332 | 332 | |
333 | - //menu sub a class |
|
334 | - if (!empty($tc['geodir_sub_menu_a_class_filter'])) { |
|
335 | - add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10); |
|
336 | - } |
|
333 | + //menu sub a class |
|
334 | + if (!empty($tc['geodir_sub_menu_a_class_filter'])) { |
|
335 | + add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10); |
|
336 | + } |
|
337 | 337 | |
338 | - //location menu li class |
|
339 | - if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) { |
|
340 | - add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10); |
|
341 | - } |
|
338 | + //location menu li class |
|
339 | + if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) { |
|
340 | + add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10); |
|
341 | + } |
|
342 | 342 | |
343 | - //location menu sub ul class |
|
344 | - if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) { |
|
345 | - add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10); |
|
346 | - } |
|
343 | + //location menu sub ul class |
|
344 | + if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) { |
|
345 | + add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10); |
|
346 | + } |
|
347 | 347 | |
348 | - //location menu sub li class |
|
349 | - if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) { |
|
350 | - add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10); |
|
351 | - } |
|
348 | + //location menu sub li class |
|
349 | + if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) { |
|
350 | + add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10); |
|
351 | + } |
|
352 | 352 | |
353 | - //location menu a class |
|
354 | - if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) { |
|
355 | - add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10); |
|
356 | - } |
|
353 | + //location menu a class |
|
354 | + if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) { |
|
355 | + add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10); |
|
356 | + } |
|
357 | 357 | |
358 | - // compat styles |
|
359 | - if (!empty($tc['geodir_theme_compat_css'])) { |
|
360 | - add_action('wp_head', 'gd_compat_styles'); |
|
361 | - } |
|
358 | + // compat styles |
|
359 | + if (!empty($tc['geodir_theme_compat_css'])) { |
|
360 | + add_action('wp_head', 'gd_compat_styles'); |
|
361 | + } |
|
362 | 362 | |
363 | - // compat js |
|
364 | - if (!empty($tc['geodir_theme_compat_js'])) { |
|
365 | - add_action('wp_footer', 'gd_compat_script'); |
|
366 | - } |
|
363 | + // compat js |
|
364 | + if (!empty($tc['geodir_theme_compat_js'])) { |
|
365 | + add_action('wp_footer', 'gd_compat_script'); |
|
366 | + } |
|
367 | 367 | |
368 | 368 | |
369 | - // geodir_top_content_add |
|
370 | - if (!empty($tc['geodir_top_content_add'])) { |
|
371 | - add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1); |
|
372 | - } |
|
369 | + // geodir_top_content_add |
|
370 | + if (!empty($tc['geodir_top_content_add'])) { |
|
371 | + add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1); |
|
372 | + } |
|
373 | 373 | |
374 | - // geodir_before_main_content_add |
|
375 | - if (!empty($tc['geodir_before_main_content_add'])) { |
|
376 | - add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1); |
|
377 | - } |
|
374 | + // geodir_before_main_content_add |
|
375 | + if (!empty($tc['geodir_before_main_content_add'])) { |
|
376 | + add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1); |
|
377 | + } |
|
378 | 378 | |
379 | 379 | |
380 | 380 | } |
@@ -397,23 +397,23 @@ discard block |
||
397 | 397 | */ |
398 | 398 | function geodir_action_wrapper_open($type = '', $id = '', $class = '') |
399 | 399 | { |
400 | - $tc = get_option('theme_compatibility_setting'); |
|
401 | - if (!empty($tc['geodir_wrapper_open_replace'])) { |
|
402 | - $text = $tc['geodir_wrapper_open_replace']; |
|
403 | - } else { |
|
404 | - $text = '<div id="[id]" class="[class]">'; |
|
405 | - } |
|
400 | + $tc = get_option('theme_compatibility_setting'); |
|
401 | + if (!empty($tc['geodir_wrapper_open_replace'])) { |
|
402 | + $text = $tc['geodir_wrapper_open_replace']; |
|
403 | + } else { |
|
404 | + $text = '<div id="[id]" class="[class]">'; |
|
405 | + } |
|
406 | 406 | |
407 | - if (!empty($tc['geodir_wrapper_open_id'])) { |
|
408 | - $id = $tc['geodir_wrapper_open_id']; |
|
409 | - } |
|
410 | - if (!empty($tc['geodir_wrapper_open_class'])) { |
|
411 | - $class = $tc['geodir_wrapper_open_class']; |
|
412 | - } |
|
407 | + if (!empty($tc['geodir_wrapper_open_id'])) { |
|
408 | + $id = $tc['geodir_wrapper_open_id']; |
|
409 | + } |
|
410 | + if (!empty($tc['geodir_wrapper_open_class'])) { |
|
411 | + $class = $tc['geodir_wrapper_open_class']; |
|
412 | + } |
|
413 | 413 | |
414 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text); |
|
414 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text); |
|
415 | 415 | |
416 | - echo $text; |
|
416 | + echo $text; |
|
417 | 417 | } |
418 | 418 | |
419 | 419 | // action for adding the wrapperdiv closing tag |
@@ -428,14 +428,14 @@ discard block |
||
428 | 428 | */ |
429 | 429 | function geodir_action_wrapper_close($type = '') |
430 | 430 | { |
431 | - $tc = get_option('theme_compatibility_setting'); |
|
432 | - if (!empty($tc['geodir_wrapper_close_replace'])) { |
|
433 | - $text = $tc['geodir_wrapper_close_replace']; |
|
434 | - } else { |
|
435 | - $text = '</div><!-- wrapper ends here-->'; |
|
436 | - } |
|
431 | + $tc = get_option('theme_compatibility_setting'); |
|
432 | + if (!empty($tc['geodir_wrapper_close_replace'])) { |
|
433 | + $text = $tc['geodir_wrapper_close_replace']; |
|
434 | + } else { |
|
435 | + $text = '</div><!-- wrapper ends here-->'; |
|
436 | + } |
|
437 | 437 | |
438 | - echo $text; |
|
438 | + echo $text; |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | // action for adding the content div opening tag |
@@ -451,35 +451,35 @@ discard block |
||
451 | 451 | */ |
452 | 452 | function geodir_action_wrapper_content_open($type = '', $id = '', $class = '') |
453 | 453 | { |
454 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) { |
|
455 | - $width_css = 'style="width:' . $width . '%;"'; |
|
456 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) { |
|
457 | - $width_css = 'style="width:' . $width . '%;"'; |
|
458 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) { |
|
459 | - $width_css = 'style="width:' . $width . '%;"'; |
|
460 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) { |
|
461 | - $width_css = 'style="width:' . $width . '%;"'; |
|
462 | - } else { |
|
463 | - $width_css = ''; |
|
464 | - } |
|
465 | - |
|
466 | - $tc = get_option('theme_compatibility_setting'); |
|
467 | - if (!empty($tc['geodir_wrapper_content_open_replace'])) { |
|
468 | - $text = $tc['geodir_wrapper_content_open_replace']; |
|
469 | - } else { |
|
470 | - $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
471 | - } |
|
472 | - |
|
473 | - if (!empty($tc['geodir_wrapper_content_open_id'])) { |
|
474 | - $id = $tc['geodir_wrapper_content_open_id']; |
|
475 | - } |
|
476 | - if (!empty($tc['geodir_wrapper_content_open_class'])) { |
|
477 | - $class = $tc['geodir_wrapper_content_open_class']; |
|
478 | - } |
|
479 | - |
|
480 | - $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text); |
|
481 | - |
|
482 | - echo $text; |
|
454 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) { |
|
455 | + $width_css = 'style="width:' . $width . '%;"'; |
|
456 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) { |
|
457 | + $width_css = 'style="width:' . $width . '%;"'; |
|
458 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) { |
|
459 | + $width_css = 'style="width:' . $width . '%;"'; |
|
460 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) { |
|
461 | + $width_css = 'style="width:' . $width . '%;"'; |
|
462 | + } else { |
|
463 | + $width_css = ''; |
|
464 | + } |
|
465 | + |
|
466 | + $tc = get_option('theme_compatibility_setting'); |
|
467 | + if (!empty($tc['geodir_wrapper_content_open_replace'])) { |
|
468 | + $text = $tc['geodir_wrapper_content_open_replace']; |
|
469 | + } else { |
|
470 | + $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
471 | + } |
|
472 | + |
|
473 | + if (!empty($tc['geodir_wrapper_content_open_id'])) { |
|
474 | + $id = $tc['geodir_wrapper_content_open_id']; |
|
475 | + } |
|
476 | + if (!empty($tc['geodir_wrapper_content_open_class'])) { |
|
477 | + $class = $tc['geodir_wrapper_content_open_class']; |
|
478 | + } |
|
479 | + |
|
480 | + $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text); |
|
481 | + |
|
482 | + echo $text; |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | // action for adding the primary div closing tag |
@@ -493,13 +493,13 @@ discard block |
||
493 | 493 | */ |
494 | 494 | function geodir_action_wrapper_content_close($type = '') |
495 | 495 | { |
496 | - $tc = get_option('theme_compatibility_setting'); |
|
497 | - if (!empty($tc['geodir_wrapper_content_close_replace'])) { |
|
498 | - $text = $tc['geodir_wrapper_content_close_replace']; |
|
499 | - } else { |
|
500 | - $text = '</div><!-- content ends here-->'; |
|
501 | - } |
|
502 | - echo $text; |
|
496 | + $tc = get_option('theme_compatibility_setting'); |
|
497 | + if (!empty($tc['geodir_wrapper_content_close_replace'])) { |
|
498 | + $text = $tc['geodir_wrapper_content_close_replace']; |
|
499 | + } else { |
|
500 | + $text = '</div><!-- content ends here-->'; |
|
501 | + } |
|
502 | + echo $text; |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | // action for adding the <article> opening tag |
@@ -517,24 +517,24 @@ discard block |
||
517 | 517 | */ |
518 | 518 | function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '') |
519 | 519 | { |
520 | - $class = implode(" ", $class); |
|
521 | - $tc = get_option('theme_compatibility_setting'); |
|
522 | - if (!empty($tc['geodir_article_open_replace'])) { |
|
523 | - $text = $tc['geodir_article_open_replace']; |
|
524 | - } else { |
|
525 | - $text = '<article id="[id]" class="[class]" >'; |
|
526 | - } |
|
520 | + $class = implode(" ", $class); |
|
521 | + $tc = get_option('theme_compatibility_setting'); |
|
522 | + if (!empty($tc['geodir_article_open_replace'])) { |
|
523 | + $text = $tc['geodir_article_open_replace']; |
|
524 | + } else { |
|
525 | + $text = '<article id="[id]" class="[class]" >'; |
|
526 | + } |
|
527 | 527 | |
528 | - if (!empty($tc['geodir_article_open_id'])) { |
|
529 | - $id = $tc['geodir_article_open_id']; |
|
530 | - } |
|
531 | - if (!empty($tc['geodir_article_open_class'])) { |
|
532 | - $class = $tc['geodir_article_open_class']; |
|
533 | - } |
|
528 | + if (!empty($tc['geodir_article_open_id'])) { |
|
529 | + $id = $tc['geodir_article_open_id']; |
|
530 | + } |
|
531 | + if (!empty($tc['geodir_article_open_class'])) { |
|
532 | + $class = $tc['geodir_article_open_class']; |
|
533 | + } |
|
534 | 534 | |
535 | - $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text); |
|
535 | + $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text); |
|
536 | 536 | |
537 | - echo $text; |
|
537 | + echo $text; |
|
538 | 538 | } |
539 | 539 | |
540 | 540 | // action for adding the primary div closing tag |
@@ -548,13 +548,13 @@ discard block |
||
548 | 548 | */ |
549 | 549 | function geodir_action_article_close($type = '') |
550 | 550 | { |
551 | - $tc = get_option('theme_compatibility_setting'); |
|
552 | - if (!empty($tc['geodir_article_close_replace'])) { |
|
553 | - $text = $tc['geodir_article_close_replace']; |
|
554 | - } else { |
|
555 | - $text = '</article><!-- article ends here-->'; |
|
556 | - } |
|
557 | - echo $text; |
|
551 | + $tc = get_option('theme_compatibility_setting'); |
|
552 | + if (!empty($tc['geodir_article_close_replace'])) { |
|
553 | + $text = $tc['geodir_article_close_replace']; |
|
554 | + } else { |
|
555 | + $text = '</article><!-- article ends here-->'; |
|
556 | + } |
|
557 | + echo $text; |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | // action for adding the sidebar opening tag |
@@ -571,35 +571,35 @@ discard block |
||
571 | 571 | */ |
572 | 572 | function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
573 | 573 | { |
574 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) { |
|
575 | - $width_css = 'style="width:' . $width . '%;"'; |
|
576 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) { |
|
577 | - $width_css = 'style="width:' . $width . '%;"'; |
|
578 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) { |
|
579 | - $width_css = 'style="width:' . $width . '%;"'; |
|
580 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) { |
|
581 | - $width_css = 'style="width:' . $width . '%;"'; |
|
582 | - } else { |
|
583 | - $width_css = ''; |
|
584 | - } |
|
585 | - |
|
586 | - $tc = get_option('theme_compatibility_setting'); |
|
587 | - if (!empty($tc['geodir_sidebar_right_open_replace'])) { |
|
588 | - $text = $tc['geodir_sidebar_right_open_replace']; |
|
589 | - } else { |
|
590 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
591 | - } |
|
592 | - |
|
593 | - if (!empty($tc['geodir_sidebar_right_open_id'])) { |
|
594 | - $id = $tc['geodir_sidebar_right_open_id']; |
|
595 | - } |
|
596 | - if (!empty($tc['geodir_sidebar_right_open_class'])) { |
|
597 | - $class = $tc['geodir_sidebar_right_open_class']; |
|
598 | - } |
|
599 | - |
|
600 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text); |
|
601 | - |
|
602 | - echo $text; |
|
574 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) { |
|
575 | + $width_css = 'style="width:' . $width . '%;"'; |
|
576 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) { |
|
577 | + $width_css = 'style="width:' . $width . '%;"'; |
|
578 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) { |
|
579 | + $width_css = 'style="width:' . $width . '%;"'; |
|
580 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) { |
|
581 | + $width_css = 'style="width:' . $width . '%;"'; |
|
582 | + } else { |
|
583 | + $width_css = ''; |
|
584 | + } |
|
585 | + |
|
586 | + $tc = get_option('theme_compatibility_setting'); |
|
587 | + if (!empty($tc['geodir_sidebar_right_open_replace'])) { |
|
588 | + $text = $tc['geodir_sidebar_right_open_replace']; |
|
589 | + } else { |
|
590 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
591 | + } |
|
592 | + |
|
593 | + if (!empty($tc['geodir_sidebar_right_open_id'])) { |
|
594 | + $id = $tc['geodir_sidebar_right_open_id']; |
|
595 | + } |
|
596 | + if (!empty($tc['geodir_sidebar_right_open_class'])) { |
|
597 | + $class = $tc['geodir_sidebar_right_open_class']; |
|
598 | + } |
|
599 | + |
|
600 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text); |
|
601 | + |
|
602 | + echo $text; |
|
603 | 603 | } |
604 | 604 | |
605 | 605 | // action for adding the primary div closing tag |
@@ -613,13 +613,13 @@ discard block |
||
613 | 613 | */ |
614 | 614 | function geodir_action_sidebar_right_close($type = '') |
615 | 615 | { |
616 | - $tc = get_option('theme_compatibility_setting'); |
|
617 | - if (!empty($tc['geodir_sidebar_right_close_replace'])) { |
|
618 | - $text = $tc['geodir_sidebar_right_close_replace']; |
|
619 | - } else { |
|
620 | - $text = '</aside><!-- sidebar ends here-->'; |
|
621 | - } |
|
622 | - echo $text; |
|
616 | + $tc = get_option('theme_compatibility_setting'); |
|
617 | + if (!empty($tc['geodir_sidebar_right_close_replace'])) { |
|
618 | + $text = $tc['geodir_sidebar_right_close_replace']; |
|
619 | + } else { |
|
620 | + $text = '</aside><!-- sidebar ends here-->'; |
|
621 | + } |
|
622 | + echo $text; |
|
623 | 623 | } |
624 | 624 | |
625 | 625 | |
@@ -640,121 +640,121 @@ discard block |
||
640 | 640 | */ |
641 | 641 | function geodir_action_geodir_set_preview_post() |
642 | 642 | { |
643 | - global $post, $preview, $gd_session; |
|
644 | - $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 |
|
645 | - if (!$preview || $is_backend_preview) { |
|
646 | - return; |
|
647 | - }// bail if not previewing |
|
648 | - |
|
649 | - $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
650 | - |
|
651 | - $fields_info = geodir_get_custom_fields_type($listing_type); |
|
652 | - |
|
653 | - foreach ($_REQUEST as $pkey => $pval) { |
|
654 | - if ($pkey == 'geodir_video') { |
|
655 | - $tags = '<iframe>'; |
|
656 | - } else if ($pkey == 'post_desc') { |
|
657 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
658 | - } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) { |
|
659 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
660 | - } else if (is_array($_REQUEST[$pkey])) { |
|
661 | - $tags = 'skip_field'; |
|
662 | - } else { |
|
663 | - $tags = ''; |
|
664 | - } |
|
665 | - /** |
|
666 | - * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
667 | - * |
|
668 | - * @since 1.0.0 |
|
669 | - * @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>'. |
|
670 | - * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
671 | - */ |
|
672 | - $tags = apply_filters('geodir_save_post_key', $tags, $pkey); |
|
673 | - |
|
674 | - if ($tags != 'skip_field') { |
|
675 | - $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
676 | - } |
|
677 | - } |
|
678 | - |
|
679 | - $post = (object)$_REQUEST; |
|
680 | - |
|
681 | - |
|
682 | - if (isset($post->video)) { |
|
683 | - $post->video = stripslashes($post->video); |
|
684 | - } |
|
685 | - |
|
686 | - if (isset($post->Video2)) { |
|
687 | - $post->Video2 = stripslashes($post->Video2); |
|
688 | - } |
|
689 | - |
|
690 | - $post_type = $post->listing_type; |
|
691 | - $post_type_info = get_post_type_object($post_type); |
|
692 | - |
|
693 | - $listing_label = $post_type_info->labels->singular_name; |
|
694 | - |
|
695 | - $term_icon = ''; |
|
696 | - |
|
697 | - if (!empty($post->post_category)) { |
|
698 | - foreach ($post->post_category as $post_taxonomy => $post_term) { |
|
699 | - |
|
700 | - if ($post_term != '' && !is_array($post_term)) { |
|
701 | - $post_term = explode(',', trim($post_term, ',')); |
|
702 | - } |
|
643 | + global $post, $preview, $gd_session; |
|
644 | + $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 |
|
645 | + if (!$preview || $is_backend_preview) { |
|
646 | + return; |
|
647 | + }// bail if not previewing |
|
648 | + |
|
649 | + $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
650 | + |
|
651 | + $fields_info = geodir_get_custom_fields_type($listing_type); |
|
652 | + |
|
653 | + foreach ($_REQUEST as $pkey => $pval) { |
|
654 | + if ($pkey == 'geodir_video') { |
|
655 | + $tags = '<iframe>'; |
|
656 | + } else if ($pkey == 'post_desc') { |
|
657 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
658 | + } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) { |
|
659 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
660 | + } else if (is_array($_REQUEST[$pkey])) { |
|
661 | + $tags = 'skip_field'; |
|
662 | + } else { |
|
663 | + $tags = ''; |
|
664 | + } |
|
665 | + /** |
|
666 | + * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
667 | + * |
|
668 | + * @since 1.0.0 |
|
669 | + * @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>'. |
|
670 | + * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
671 | + */ |
|
672 | + $tags = apply_filters('geodir_save_post_key', $tags, $pkey); |
|
673 | + |
|
674 | + if ($tags != 'skip_field') { |
|
675 | + $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
676 | + } |
|
677 | + } |
|
678 | + |
|
679 | + $post = (object)$_REQUEST; |
|
680 | + |
|
681 | + |
|
682 | + if (isset($post->video)) { |
|
683 | + $post->video = stripslashes($post->video); |
|
684 | + } |
|
685 | + |
|
686 | + if (isset($post->Video2)) { |
|
687 | + $post->Video2 = stripslashes($post->Video2); |
|
688 | + } |
|
689 | + |
|
690 | + $post_type = $post->listing_type; |
|
691 | + $post_type_info = get_post_type_object($post_type); |
|
692 | + |
|
693 | + $listing_label = $post_type_info->labels->singular_name; |
|
694 | + |
|
695 | + $term_icon = ''; |
|
696 | + |
|
697 | + if (!empty($post->post_category)) { |
|
698 | + foreach ($post->post_category as $post_taxonomy => $post_term) { |
|
699 | + |
|
700 | + if ($post_term != '' && !is_array($post_term)) { |
|
701 | + $post_term = explode(',', trim($post_term, ',')); |
|
702 | + } |
|
703 | 703 | |
704 | - if (is_array($post_term)) { |
|
705 | - $post_term = array_unique($post_term); |
|
706 | - } |
|
704 | + if (is_array($post_term)) { |
|
705 | + $post_term = array_unique($post_term); |
|
706 | + } |
|
707 | 707 | |
708 | - if (!empty($post_term)) { |
|
709 | - foreach ($post_term as $cat_id) { |
|
710 | - $cat_id = trim($cat_id); |
|
711 | - |
|
712 | - if ($cat_id != '') { |
|
713 | - $term_icon = get_option('geodir_default_marker_icon'); |
|
714 | - |
|
715 | - if (isset($post->post_default_category) && $post->post_default_category == $cat_id) { |
|
716 | - if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) { |
|
717 | - if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
718 | - $term_icon = $term_icon_url['src']; |
|
719 | - break; |
|
720 | - } |
|
721 | - } |
|
722 | - } |
|
723 | - } |
|
724 | - } |
|
725 | - } |
|
726 | - } |
|
708 | + if (!empty($post_term)) { |
|
709 | + foreach ($post_term as $cat_id) { |
|
710 | + $cat_id = trim($cat_id); |
|
711 | + |
|
712 | + if ($cat_id != '') { |
|
713 | + $term_icon = get_option('geodir_default_marker_icon'); |
|
714 | + |
|
715 | + if (isset($post->post_default_category) && $post->post_default_category == $cat_id) { |
|
716 | + if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) { |
|
717 | + if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
718 | + $term_icon = $term_icon_url['src']; |
|
719 | + break; |
|
720 | + } |
|
721 | + } |
|
722 | + } |
|
723 | + } |
|
724 | + } |
|
725 | + } |
|
726 | + } |
|
727 | 727 | |
728 | - $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
729 | - $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
728 | + $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
729 | + $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
730 | 730 | |
731 | - $srcharr = array("'", "/", "-", '"', '\\'); |
|
732 | - $replarr = array("′", "⁄", "–", "“", ''); |
|
731 | + $srcharr = array("'", "/", "-", '"', '\\'); |
|
732 | + $replarr = array("′", "⁄", "–", "“", ''); |
|
733 | 733 | |
734 | - $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
734 | + $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
735 | 735 | |
736 | - $json = '{'; |
|
737 | - $json .= '"post_preview": "1",'; |
|
738 | - $json .= '"t": "' . $json_title . '",'; |
|
739 | - $json .= '"lt": "' . $post_latitude . '",'; |
|
740 | - $json .= '"ln": "' . $post_longitude . '",'; |
|
741 | - $json .= '"i":"' . $term_icon . '"'; |
|
742 | - $json .= '}'; |
|
736 | + $json = '{'; |
|
737 | + $json .= '"post_preview": "1",'; |
|
738 | + $json .= '"t": "' . $json_title . '",'; |
|
739 | + $json .= '"lt": "' . $post_latitude . '",'; |
|
740 | + $json .= '"ln": "' . $post_longitude . '",'; |
|
741 | + $json .= '"i":"' . $term_icon . '"'; |
|
742 | + $json .= '}'; |
|
743 | 743 | |
744 | - $post->marker_json = $json; |
|
744 | + $post->marker_json = $json; |
|
745 | 745 | |
746 | - $gd_session->set('listing', $_REQUEST); |
|
746 | + $gd_session->set('listing', $_REQUEST); |
|
747 | 747 | |
748 | - // we need to define a few things to trick the setup_postdata |
|
749 | - if (!isset($post->ID)) { |
|
750 | - $post->ID = ''; |
|
751 | - $post->post_author = ''; |
|
752 | - $post->post_date = ''; |
|
753 | - $post->post_content = ''; |
|
754 | - $post->default_category = ''; |
|
755 | - $post->post_type = ''; |
|
756 | - } |
|
757 | - setup_postdata($post); |
|
748 | + // we need to define a few things to trick the setup_postdata |
|
749 | + if (!isset($post->ID)) { |
|
750 | + $post->ID = ''; |
|
751 | + $post->post_author = ''; |
|
752 | + $post->post_date = ''; |
|
753 | + $post->post_content = ''; |
|
754 | + $post->default_category = ''; |
|
755 | + $post->post_type = ''; |
|
756 | + } |
|
757 | + setup_postdata($post); |
|
758 | 758 | } |
759 | 759 | |
760 | 760 | /** |
@@ -766,15 +766,15 @@ discard block |
||
766 | 766 | */ |
767 | 767 | function geodir_action_geodir_preview_code() |
768 | 768 | { |
769 | - global $preview; |
|
769 | + global $preview; |
|
770 | 770 | |
771 | - $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 |
|
771 | + $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 | 772 | |
773 | - if (!$preview || $is_backend_preview) { |
|
774 | - return; |
|
775 | - }// bail if not previewing |
|
773 | + if (!$preview || $is_backend_preview) { |
|
774 | + return; |
|
775 | + }// bail if not previewing |
|
776 | 776 | |
777 | - geodir_get_template_part('preview', 'buttons'); |
|
777 | + geodir_get_template_part('preview', 'buttons'); |
|
778 | 778 | } |
779 | 779 | |
780 | 780 | // action for adding the details page top widget area |
@@ -790,20 +790,20 @@ discard block |
||
790 | 790 | */ |
791 | 791 | function geodir_action_geodir_sidebar_detail_top($class = '') |
792 | 792 | { |
793 | - if (get_option('geodir_show_detail_top_section')) { ?> |
|
793 | + if (get_option('geodir_show_detail_top_section')) { ?> |
|
794 | 794 | <div |
795 | 795 | class="<?php |
796 | - /** |
|
797 | - * Filter the div class for the wrapper of the full width widget areas. |
|
798 | - * |
|
799 | - * 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. |
|
800 | - * |
|
801 | - * @since 1.0.0 |
|
802 | - * @param string $class The class of the div. |
|
803 | - * @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', |
|
804 | - * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
805 | - */ |
|
806 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>"> |
|
796 | + /** |
|
797 | + * Filter the div class for the wrapper of the full width widget areas. |
|
798 | + * |
|
799 | + * 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. |
|
800 | + * |
|
801 | + * @since 1.0.0 |
|
802 | + * @param string $class The class of the div. |
|
803 | + * @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', |
|
804 | + * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
805 | + */ |
|
806 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>"> |
|
807 | 807 | <?php dynamic_sidebar('geodir_detail_top'); ?> |
808 | 808 | </div> |
809 | 809 | <?php } |
@@ -827,11 +827,11 @@ discard block |
||
827 | 827 | */ |
828 | 828 | function geodir_action_geodir_sidebar_detail_bottom_section($class = '') |
829 | 829 | { |
830 | - if (get_option('geodir_show_detail_bottom_section')) { ?> |
|
830 | + if (get_option('geodir_show_detail_bottom_section')) { ?> |
|
831 | 831 | <div |
832 | 832 | class="<?php |
833 | - /** This action is documented in geodirectory_template_actions.php */ |
|
834 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>"> |
|
833 | + /** This action is documented in geodirectory_template_actions.php */ |
|
834 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>"> |
|
835 | 835 | <?php dynamic_sidebar('geodir_detail_bottom'); ?> |
836 | 836 | </div><!-- clearfix ends here--> |
837 | 837 | <?php } |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | */ |
846 | 846 | function geodir_details_sidebar_widget_area() |
847 | 847 | { |
848 | - dynamic_sidebar('geodir_detail_sidebar'); |
|
848 | + dynamic_sidebar('geodir_detail_sidebar'); |
|
849 | 849 | } |
850 | 850 | |
851 | 851 | /** |
@@ -856,12 +856,12 @@ discard block |
||
856 | 856 | */ |
857 | 857 | function geodir_details_sidebar_place_details() |
858 | 858 | { |
859 | - /** |
|
860 | - * Used to add items to the details page sidebar. |
|
861 | - * |
|
862 | - * @since 1.0.0 |
|
863 | - */ |
|
864 | - do_action('geodir_detail_page_sidebar'); |
|
859 | + /** |
|
860 | + * Used to add items to the details page sidebar. |
|
861 | + * |
|
862 | + * @since 1.0.0 |
|
863 | + */ |
|
864 | + do_action('geodir_detail_page_sidebar'); |
|
865 | 865 | } |
866 | 866 | |
867 | 867 | add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10); |
@@ -876,68 +876,68 @@ discard block |
||
876 | 876 | */ |
877 | 877 | function geodir_action_details_sidebar() |
878 | 878 | { |
879 | - // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
880 | - if (get_option('geodir_detail_sidebar_left_section')) { |
|
881 | - /** |
|
882 | - * Called before the details page left sidebar is opened. |
|
883 | - * |
|
884 | - * This is used to add opening wrapper HTML to the details page left sidebar. |
|
885 | - * |
|
886 | - * @since 1.0.0 |
|
887 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
888 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
889 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
890 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
891 | - */ |
|
892 | - do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar'); |
|
893 | - ?> |
|
879 | + // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
880 | + if (get_option('geodir_detail_sidebar_left_section')) { |
|
881 | + /** |
|
882 | + * Called before the details page left sidebar is opened. |
|
883 | + * |
|
884 | + * This is used to add opening wrapper HTML to the details page left sidebar. |
|
885 | + * |
|
886 | + * @since 1.0.0 |
|
887 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
888 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
889 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
890 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
891 | + */ |
|
892 | + do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar'); |
|
893 | + ?> |
|
894 | 894 | <div class="geodir-content-left geodir-sidebar-wrap"><?php |
895 | - /** |
|
896 | - * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
897 | - * |
|
898 | - * This is used to add all info to the details page sidebars. |
|
899 | - * |
|
900 | - * @since 1.0.0 |
|
901 | - */ |
|
902 | - do_action('geodir_detail_sidebar_inside'); |
|
903 | - ?></div><!-- end geodir-content-left --><?php |
|
904 | - /** |
|
905 | - * Called after the details page left sidebar. |
|
906 | - * |
|
907 | - * This is used to add closing wrapper HTML to the details page left sidebar. |
|
908 | - * |
|
909 | - * @since 1.0.0 |
|
910 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
911 | - */ |
|
912 | - do_action('geodir_sidebar_left_close', 'details-page'); |
|
913 | - } else { |
|
914 | - /** |
|
915 | - * Called before the details page right sidebar is opened. |
|
916 | - * |
|
917 | - * This is used to add opening wrapper HTML to the details page right sidebar. |
|
918 | - * |
|
919 | - * @since 1.0.0 |
|
920 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
921 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
922 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
923 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
924 | - */ |
|
925 | - do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar'); |
|
926 | - ?> |
|
895 | + /** |
|
896 | + * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
897 | + * |
|
898 | + * This is used to add all info to the details page sidebars. |
|
899 | + * |
|
900 | + * @since 1.0.0 |
|
901 | + */ |
|
902 | + do_action('geodir_detail_sidebar_inside'); |
|
903 | + ?></div><!-- end geodir-content-left --><?php |
|
904 | + /** |
|
905 | + * Called after the details page left sidebar. |
|
906 | + * |
|
907 | + * This is used to add closing wrapper HTML to the details page left sidebar. |
|
908 | + * |
|
909 | + * @since 1.0.0 |
|
910 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
911 | + */ |
|
912 | + do_action('geodir_sidebar_left_close', 'details-page'); |
|
913 | + } else { |
|
914 | + /** |
|
915 | + * Called before the details page right sidebar is opened. |
|
916 | + * |
|
917 | + * This is used to add opening wrapper HTML to the details page right sidebar. |
|
918 | + * |
|
919 | + * @since 1.0.0 |
|
920 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
921 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
922 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
923 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
924 | + */ |
|
925 | + do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar'); |
|
926 | + ?> |
|
927 | 927 | <div class="geodir-content-right geodir-sidebar-wrap"><?php |
928 | - /** This action is documented in geodirectory_template_actions.php */ |
|
929 | - do_action('geodir_detail_sidebar_inside'); |
|
930 | - ?></div><!-- end geodir-content-right --><?php |
|
931 | - /** |
|
932 | - * Called after the details page right sidebar. |
|
933 | - * |
|
934 | - * This is used to add closing wrapper HTML to the details page right sidebar. |
|
935 | - * |
|
936 | - * @since 1.0.0 |
|
937 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
938 | - */ |
|
939 | - do_action('geodir_sidebar_right_close', 'details-page'); |
|
940 | - } |
|
928 | + /** This action is documented in geodirectory_template_actions.php */ |
|
929 | + do_action('geodir_detail_sidebar_inside'); |
|
930 | + ?></div><!-- end geodir-content-right --><?php |
|
931 | + /** |
|
932 | + * Called after the details page right sidebar. |
|
933 | + * |
|
934 | + * This is used to add closing wrapper HTML to the details page right sidebar. |
|
935 | + * |
|
936 | + * @since 1.0.0 |
|
937 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
938 | + */ |
|
939 | + do_action('geodir_sidebar_right_close', 'details-page'); |
|
940 | + } |
|
941 | 941 | } |
942 | 942 | |
943 | 943 | add_action('geodir_page_title', 'geodir_action_page_title', 10); |
@@ -951,21 +951,21 @@ discard block |
||
951 | 951 | */ |
952 | 952 | function geodir_action_page_title() |
953 | 953 | { |
954 | - /** |
|
955 | - * Filter the page title HTML h1 class. |
|
956 | - * |
|
957 | - * @since 1.0.0 |
|
958 | - * @param string $class The class to use. Default is 'entry-title fn'. |
|
959 | - */ |
|
960 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
961 | - /** |
|
962 | - * Filter the page title HTML header wrapper class. |
|
963 | - * |
|
964 | - * @since 1.0.0 |
|
965 | - * @param string $class The class to use. Default is 'entry-header'. |
|
966 | - */ |
|
967 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
968 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
954 | + /** |
|
955 | + * Filter the page title HTML h1 class. |
|
956 | + * |
|
957 | + * @since 1.0.0 |
|
958 | + * @param string $class The class to use. Default is 'entry-title fn'. |
|
959 | + */ |
|
960 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
961 | + /** |
|
962 | + * Filter the page title HTML header wrapper class. |
|
963 | + * |
|
964 | + * @since 1.0.0 |
|
965 | + * @param string $class The class to use. Default is 'entry-header'. |
|
966 | + */ |
|
967 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
968 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | |
@@ -982,87 +982,87 @@ discard block |
||
982 | 982 | */ |
983 | 983 | function geodir_action_details_slider() |
984 | 984 | { |
985 | - global $preview, $post; |
|
985 | + global $preview, $post; |
|
986 | 986 | |
987 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
987 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
988 | 988 | |
989 | - if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) { |
|
990 | - $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img')); |
|
989 | + if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) { |
|
990 | + $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img')); |
|
991 | 991 | |
992 | - $preview_post_images = array(); |
|
993 | - if ($preview_get_images) { |
|
994 | - foreach ($preview_get_images as $row) { |
|
995 | - $preview_post_images[] = $row->src; |
|
996 | - } |
|
997 | - } |
|
998 | - if (!empty($preview_post_images)) { |
|
999 | - $post->post_images = implode(',', $preview_post_images); |
|
1000 | - } |
|
1001 | - } |
|
1002 | - |
|
1003 | - if ($preview) { |
|
1004 | - $post_images = array(); |
|
1005 | - if (isset($post->post_images) && !empty($post->post_images)) { |
|
1006 | - $post->post_images = trim($post->post_images, ","); |
|
1007 | - $post_images = explode(",", $post->post_images); |
|
1008 | - } |
|
1009 | - |
|
1010 | - $main_slides = ''; |
|
1011 | - $nav_slides = ''; |
|
1012 | - $slides = 0; |
|
1013 | - |
|
1014 | - if (!empty($post_images)) { |
|
1015 | - foreach ($post_images as $image) { |
|
1016 | - if (!empty($image)) { |
|
1017 | - $sizes = getimagesize(trim($image)); |
|
1018 | - $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
1019 | - $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
1020 | - |
|
1021 | - if ($image && $width && $height) { |
|
1022 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height); |
|
1023 | - } |
|
1024 | - |
|
1025 | - if (isset($image->src)) { |
|
1026 | - if ($image->height >= 400) { |
|
1027 | - $spacer_height = 0; |
|
1028 | - } else { |
|
1029 | - $spacer_height = ((400 - $image->height) / 2); |
|
1030 | - } |
|
1031 | - |
|
1032 | - $image_title = isset($image->title) ? $image->title : ''; |
|
1033 | - |
|
1034 | - $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;" />'; |
|
1035 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
1036 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1037 | - $slides++; |
|
1038 | - } |
|
1039 | - } |
|
1040 | - }// endfore |
|
1041 | - } //end if |
|
1042 | - } else { |
|
1043 | - $main_slides = ''; |
|
1044 | - $nav_slides = ''; |
|
1045 | - $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page. |
|
1046 | - $slides = 0; |
|
1047 | - |
|
1048 | - if (!empty($post_images)) { |
|
1049 | - foreach ($post_images as $image) { |
|
1050 | - if ($image->height >= 400) { |
|
1051 | - $spacer_height = 0; |
|
1052 | - } else { |
|
1053 | - $spacer_height = ((400 - $image->height) / 2); |
|
1054 | - } |
|
1055 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
1056 | - $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;" />'; |
|
1057 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
1058 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1059 | - $slides++; |
|
1060 | - } |
|
1061 | - }// endfore |
|
1062 | - } |
|
992 | + $preview_post_images = array(); |
|
993 | + if ($preview_get_images) { |
|
994 | + foreach ($preview_get_images as $row) { |
|
995 | + $preview_post_images[] = $row->src; |
|
996 | + } |
|
997 | + } |
|
998 | + if (!empty($preview_post_images)) { |
|
999 | + $post->post_images = implode(',', $preview_post_images); |
|
1000 | + } |
|
1001 | + } |
|
1002 | + |
|
1003 | + if ($preview) { |
|
1004 | + $post_images = array(); |
|
1005 | + if (isset($post->post_images) && !empty($post->post_images)) { |
|
1006 | + $post->post_images = trim($post->post_images, ","); |
|
1007 | + $post_images = explode(",", $post->post_images); |
|
1008 | + } |
|
1009 | + |
|
1010 | + $main_slides = ''; |
|
1011 | + $nav_slides = ''; |
|
1012 | + $slides = 0; |
|
1013 | + |
|
1014 | + if (!empty($post_images)) { |
|
1015 | + foreach ($post_images as $image) { |
|
1016 | + if (!empty($image)) { |
|
1017 | + $sizes = getimagesize(trim($image)); |
|
1018 | + $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
1019 | + $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
1020 | + |
|
1021 | + if ($image && $width && $height) { |
|
1022 | + $image = (object)array('src' => $image, 'width' => $width, 'height' => $height); |
|
1023 | + } |
|
1024 | + |
|
1025 | + if (isset($image->src)) { |
|
1026 | + if ($image->height >= 400) { |
|
1027 | + $spacer_height = 0; |
|
1028 | + } else { |
|
1029 | + $spacer_height = ((400 - $image->height) / 2); |
|
1030 | + } |
|
1031 | + |
|
1032 | + $image_title = isset($image->title) ? $image->title : ''; |
|
1033 | + |
|
1034 | + $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;" />'; |
|
1035 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
1036 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1037 | + $slides++; |
|
1038 | + } |
|
1039 | + } |
|
1040 | + }// endfore |
|
1041 | + } //end if |
|
1042 | + } else { |
|
1043 | + $main_slides = ''; |
|
1044 | + $nav_slides = ''; |
|
1045 | + $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page. |
|
1046 | + $slides = 0; |
|
1047 | + |
|
1048 | + if (!empty($post_images)) { |
|
1049 | + foreach ($post_images as $image) { |
|
1050 | + if ($image->height >= 400) { |
|
1051 | + $spacer_height = 0; |
|
1052 | + } else { |
|
1053 | + $spacer_height = ((400 - $image->height) / 2); |
|
1054 | + } |
|
1055 | + $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
1056 | + $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;" />'; |
|
1057 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
1058 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1059 | + $slides++; |
|
1060 | + } |
|
1061 | + }// endfore |
|
1062 | + } |
|
1063 | 1063 | |
1064 | - if (!empty($post_images)) { |
|
1065 | - ?> |
|
1064 | + if (!empty($post_images)) { |
|
1065 | + ?> |
|
1066 | 1066 | <div class="geodir_flex-container"> |
1067 | 1067 | <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div> |
1068 | 1068 | <div id="geodir_slider" class="geodir_flexslider "> |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | <?php } ?> |
1076 | 1076 | </div> |
1077 | 1077 | <?php |
1078 | - } |
|
1078 | + } |
|
1079 | 1079 | } |
1080 | 1080 | |
1081 | 1081 | add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10); |
@@ -1090,177 +1090,177 @@ discard block |
||
1090 | 1090 | */ |
1091 | 1091 | function geodir_action_details_taxonomies() |
1092 | 1092 | { |
1093 | - global $preview, $post;?> |
|
1093 | + global $preview, $post;?> |
|
1094 | 1094 | <p class="geodir_post_taxomomies clearfix"> |
1095 | 1095 | <?php |
1096 | - $taxonomies = array(); |
|
1097 | - |
|
1098 | - $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 |
|
1099 | - |
|
1100 | - if ($preview && !$is_backend_preview) { |
|
1101 | - $post_type = $post->listing_type; |
|
1102 | - $post_taxonomy = $post_type . 'category'; |
|
1103 | - $post->{$post_taxonomy} = $post->post_category[$post_taxonomy]; |
|
1104 | - } else { |
|
1105 | - $post_type = $post->post_type; |
|
1106 | - $post_taxonomy = $post_type . 'category'; |
|
1107 | - } |
|
1096 | + $taxonomies = array(); |
|
1097 | + |
|
1098 | + $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 |
|
1099 | + |
|
1100 | + if ($preview && !$is_backend_preview) { |
|
1101 | + $post_type = $post->listing_type; |
|
1102 | + $post_taxonomy = $post_type . 'category'; |
|
1103 | + $post->{$post_taxonomy} = $post->post_category[$post_taxonomy]; |
|
1104 | + } else { |
|
1105 | + $post_type = $post->post_type; |
|
1106 | + $post_taxonomy = $post_type . 'category'; |
|
1107 | + } |
|
1108 | 1108 | //{ |
1109 | - $post_type_info = get_post_type_object($post_type); |
|
1110 | - $listing_label = __($post_type_info->labels->singular_name, 'geodirectory'); |
|
1111 | - |
|
1112 | - if (!empty($post->post_tags)) { |
|
1113 | - |
|
1114 | - if (taxonomy_exists($post_type . '_tags')): |
|
1115 | - $links = array(); |
|
1116 | - $terms = array(); |
|
1117 | - // to limit post tags |
|
1118 | - $post_tags = trim($post->post_tags, ","); |
|
1119 | - $post_id = isset($post->ID) ? $post->ID : ''; |
|
1120 | - /** |
|
1121 | - * Filter the post tags. |
|
1122 | - * |
|
1123 | - * Allows you to filter the post tags output on the details page of a post. |
|
1124 | - * |
|
1125 | - * @since 1.0.0 |
|
1126 | - * @param string $post_tags A comma seperated list of tags. |
|
1127 | - * @param int $post_id The current post id. |
|
1128 | - */ |
|
1129 | - $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id); |
|
1130 | - |
|
1131 | - $post->post_tags = $post_tags; |
|
1132 | - $post_tags = explode(",", trim($post->post_tags, ",")); |
|
1133 | - |
|
1134 | - |
|
1135 | - foreach ($post_tags as $post_term) { |
|
1136 | - |
|
1137 | - // fix slug creation order for tags & location |
|
1138 | - $post_term = trim($post_term); |
|
1139 | - |
|
1140 | - $priority_location = false; |
|
1141 | - if ($insert_term = term_exists($post_term, $post_type . '_tags')) { |
|
1142 | - $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags'); |
|
1143 | - } else { |
|
1144 | - $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
1145 | - $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
1146 | - $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
1147 | - $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
1148 | - $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
1149 | - $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
1150 | - if ($match_country || $match_region || $match_city) { |
|
1151 | - $priority_location = true; |
|
1152 | - $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1153 | - } else { |
|
1154 | - $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
1155 | - $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1156 | - } |
|
1157 | - } |
|
1158 | - |
|
1159 | - if (!is_wp_error($term) && is_object($term)) { |
|
1160 | - |
|
1161 | - // fix tag link on detail page |
|
1162 | - if ($priority_location) { |
|
1163 | - |
|
1164 | - $tag_link = "<a href=''>$post_term</a>"; |
|
1165 | - /** |
|
1166 | - * Filter the tag name on the details page. |
|
1167 | - * |
|
1168 | - * @since 1.5.6 |
|
1169 | - * @param string $tag_link The tag link html. |
|
1170 | - * @param object $term The tag term object. |
|
1171 | - */ |
|
1172 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1173 | - $links[] = $tag_link; |
|
1174 | - } else { |
|
1175 | - $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
1176 | - /** This action is documented in geodirectory-template_actions.php */ |
|
1177 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1178 | - $links[] = $tag_link; |
|
1179 | - } |
|
1180 | - $terms[] = $term; |
|
1181 | - } |
|
1182 | - // |
|
1183 | - } |
|
1184 | - if (!isset($listing_label)) { |
|
1185 | - $listing_label = ''; |
|
1186 | - } |
|
1187 | - $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1188 | - endif; |
|
1189 | - |
|
1190 | - } |
|
1191 | - |
|
1192 | - if (!empty($post->{$post_taxonomy})) { |
|
1193 | - $links = array(); |
|
1194 | - $terms = array(); |
|
1195 | - $termsOrdered = array(); |
|
1196 | - if (!is_array($post->{$post_taxonomy})) { |
|
1197 | - $post_term = explode(",", trim($post->{$post_taxonomy}, ",")); |
|
1198 | - } else { |
|
1199 | - $post_term = $post->{$post_taxonomy}; |
|
1109 | + $post_type_info = get_post_type_object($post_type); |
|
1110 | + $listing_label = __($post_type_info->labels->singular_name, 'geodirectory'); |
|
1111 | + |
|
1112 | + if (!empty($post->post_tags)) { |
|
1113 | + |
|
1114 | + if (taxonomy_exists($post_type . '_tags')): |
|
1115 | + $links = array(); |
|
1116 | + $terms = array(); |
|
1117 | + // to limit post tags |
|
1118 | + $post_tags = trim($post->post_tags, ","); |
|
1119 | + $post_id = isset($post->ID) ? $post->ID : ''; |
|
1120 | + /** |
|
1121 | + * Filter the post tags. |
|
1122 | + * |
|
1123 | + * Allows you to filter the post tags output on the details page of a post. |
|
1124 | + * |
|
1125 | + * @since 1.0.0 |
|
1126 | + * @param string $post_tags A comma seperated list of tags. |
|
1127 | + * @param int $post_id The current post id. |
|
1128 | + */ |
|
1129 | + $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id); |
|
1130 | + |
|
1131 | + $post->post_tags = $post_tags; |
|
1132 | + $post_tags = explode(",", trim($post->post_tags, ",")); |
|
1133 | + |
|
1134 | + |
|
1135 | + foreach ($post_tags as $post_term) { |
|
1136 | + |
|
1137 | + // fix slug creation order for tags & location |
|
1138 | + $post_term = trim($post_term); |
|
1139 | + |
|
1140 | + $priority_location = false; |
|
1141 | + if ($insert_term = term_exists($post_term, $post_type . '_tags')) { |
|
1142 | + $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags'); |
|
1143 | + } else { |
|
1144 | + $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
1145 | + $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
1146 | + $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
1147 | + $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
1148 | + $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
1149 | + $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
1150 | + if ($match_country || $match_region || $match_city) { |
|
1151 | + $priority_location = true; |
|
1152 | + $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1153 | + } else { |
|
1154 | + $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
1155 | + $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1156 | + } |
|
1157 | + } |
|
1158 | + |
|
1159 | + if (!is_wp_error($term) && is_object($term)) { |
|
1160 | + |
|
1161 | + // fix tag link on detail page |
|
1162 | + if ($priority_location) { |
|
1163 | + |
|
1164 | + $tag_link = "<a href=''>$post_term</a>"; |
|
1165 | + /** |
|
1166 | + * Filter the tag name on the details page. |
|
1167 | + * |
|
1168 | + * @since 1.5.6 |
|
1169 | + * @param string $tag_link The tag link html. |
|
1170 | + * @param object $term The tag term object. |
|
1171 | + */ |
|
1172 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1173 | + $links[] = $tag_link; |
|
1174 | + } else { |
|
1175 | + $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
1176 | + /** This action is documented in geodirectory-template_actions.php */ |
|
1177 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1178 | + $links[] = $tag_link; |
|
1179 | + } |
|
1180 | + $terms[] = $term; |
|
1181 | + } |
|
1182 | + // |
|
1183 | + } |
|
1184 | + if (!isset($listing_label)) { |
|
1185 | + $listing_label = ''; |
|
1186 | + } |
|
1187 | + $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1188 | + endif; |
|
1189 | + |
|
1190 | + } |
|
1191 | + |
|
1192 | + if (!empty($post->{$post_taxonomy})) { |
|
1193 | + $links = array(); |
|
1194 | + $terms = array(); |
|
1195 | + $termsOrdered = array(); |
|
1196 | + if (!is_array($post->{$post_taxonomy})) { |
|
1197 | + $post_term = explode(",", trim($post->{$post_taxonomy}, ",")); |
|
1198 | + } else { |
|
1199 | + $post_term = $post->{$post_taxonomy}; |
|
1200 | 1200 | |
1201 | 1201 | if ($preview && !$is_backend_preview) { |
1202 | 1202 | $post_term = geodir_add_parent_terms($post_term, $post_taxonomy); |
1203 | 1203 | } |
1204 | - } |
|
1205 | - |
|
1206 | - $post_term = array_unique($post_term); |
|
1207 | - if (!empty($post_term)) { |
|
1208 | - foreach ($post_term as $post_term) { |
|
1209 | - $post_term = trim($post_term); |
|
1210 | - |
|
1211 | - if ($post_term != ''): |
|
1212 | - $term = get_term_by('id', $post_term, $post_taxonomy); |
|
1213 | - |
|
1214 | - if (is_object($term)) { |
|
1215 | - $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
1216 | - /** |
|
1217 | - * Filter the category name on the details page. |
|
1218 | - * |
|
1219 | - * @since 1.5.6 |
|
1220 | - * @param string $term_link The link html to the category. |
|
1221 | - * @param object $term The category term object. |
|
1222 | - */ |
|
1223 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term); |
|
1224 | - $links[] = $term_link; |
|
1225 | - $terms[] = $term; |
|
1226 | - } |
|
1227 | - endif; |
|
1228 | - } |
|
1229 | - // order alphabetically |
|
1230 | - asort($links); |
|
1231 | - foreach (array_keys($links) as $key) { |
|
1232 | - $termsOrdered[$key] = $terms[$key]; |
|
1233 | - } |
|
1234 | - $terms = $termsOrdered; |
|
1204 | + } |
|
1205 | + |
|
1206 | + $post_term = array_unique($post_term); |
|
1207 | + if (!empty($post_term)) { |
|
1208 | + foreach ($post_term as $post_term) { |
|
1209 | + $post_term = trim($post_term); |
|
1210 | + |
|
1211 | + if ($post_term != ''): |
|
1212 | + $term = get_term_by('id', $post_term, $post_taxonomy); |
|
1213 | + |
|
1214 | + if (is_object($term)) { |
|
1215 | + $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
1216 | + /** |
|
1217 | + * Filter the category name on the details page. |
|
1218 | + * |
|
1219 | + * @since 1.5.6 |
|
1220 | + * @param string $term_link The link html to the category. |
|
1221 | + * @param object $term The category term object. |
|
1222 | + */ |
|
1223 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term); |
|
1224 | + $links[] = $term_link; |
|
1225 | + $terms[] = $term; |
|
1226 | + } |
|
1227 | + endif; |
|
1228 | + } |
|
1229 | + // order alphabetically |
|
1230 | + asort($links); |
|
1231 | + foreach (array_keys($links) as $key) { |
|
1232 | + $termsOrdered[$key] = $terms[$key]; |
|
1233 | + } |
|
1234 | + $terms = $termsOrdered; |
|
1235 | 1235 | |
1236 | - } |
|
1236 | + } |
|
1237 | 1237 | |
1238 | - if (!isset($listing_label)) { |
|
1239 | - $listing_label = ''; |
|
1240 | - } |
|
1241 | - $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1238 | + if (!isset($listing_label)) { |
|
1239 | + $listing_label = ''; |
|
1240 | + } |
|
1241 | + $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1242 | 1242 | |
1243 | - } |
|
1243 | + } |
|
1244 | 1244 | |
1245 | - /** |
|
1246 | - * Filter the taxonomies array before output. |
|
1247 | - * |
|
1248 | - * @since 1.5.9 |
|
1249 | - * @param array $taxonomies The array of cats and tags. |
|
1250 | - * @param string $post_type The post type being output. |
|
1251 | - * @param string $listing_label The post type label. |
|
1252 | - * @param string $listing_label The post type label with ucwords function. |
|
1253 | - */ |
|
1254 | - $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label)); |
|
1245 | + /** |
|
1246 | + * Filter the taxonomies array before output. |
|
1247 | + * |
|
1248 | + * @since 1.5.9 |
|
1249 | + * @param array $taxonomies The array of cats and tags. |
|
1250 | + * @param string $post_type The post type being output. |
|
1251 | + * @param string $listing_label The post type label. |
|
1252 | + * @param string $listing_label The post type label with ucwords function. |
|
1253 | + */ |
|
1254 | + $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label)); |
|
1255 | 1255 | |
1256 | - if (isset($taxonomies[$post_taxonomy])) { |
|
1257 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
1258 | - } |
|
1256 | + if (isset($taxonomies[$post_taxonomy])) { |
|
1257 | + echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
1258 | + } |
|
1259 | 1259 | |
1260 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
1261 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
1260 | + if (isset($taxonomies[$post_type . '_tags'])) |
|
1261 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
1262 | 1262 | |
1263 | - ?> |
|
1263 | + ?> |
|
1264 | 1264 | </p><?php |
1265 | 1265 | } |
1266 | 1266 | |
@@ -1282,127 +1282,127 @@ discard block |
||
1282 | 1282 | function geodir_action_details_micordata($post='') |
1283 | 1283 | { |
1284 | 1284 | |
1285 | - global $preview; |
|
1286 | - if(empty($post)){global $post;} |
|
1287 | - if ($preview || !geodir_is_page('detail')) { |
|
1288 | - return; |
|
1289 | - } |
|
1290 | - |
|
1291 | - // url |
|
1292 | - $c_url = geodir_curPageURL(); |
|
1293 | - |
|
1294 | - // post reviews |
|
1295 | - $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve')); |
|
1296 | - if (empty($post_reviews)) { |
|
1297 | - $reviews = ''; |
|
1298 | - } else { |
|
1299 | - foreach ($post_reviews as $review) { |
|
1300 | - $reviews[] = array( |
|
1301 | - "@type" => "Review", |
|
1302 | - "author" => $review->comment_author, |
|
1303 | - "datePublished" => $review->comment_date, |
|
1304 | - "description" => $review->comment_content, |
|
1305 | - "reviewRating" => array( |
|
1306 | - "@type" => "Rating", |
|
1307 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
1308 | - "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
1309 | - "worstRating" => "1" |
|
1310 | - ) |
|
1311 | - ); |
|
1312 | - } |
|
1313 | - |
|
1314 | - } |
|
1315 | - |
|
1316 | - // post images |
|
1317 | - $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img')); |
|
1318 | - if (empty($post_images)) { |
|
1319 | - $images = ''; |
|
1320 | - } else { |
|
1321 | - $i_arr = array(); |
|
1322 | - foreach ($post_images as $img) { |
|
1323 | - $i_arr[] = $img->src; |
|
1324 | - } |
|
1325 | - |
|
1326 | - if (count($i_arr) == 1) { |
|
1327 | - $images = $i_arr[0]; |
|
1328 | - } else { |
|
1329 | - $images = $i_arr; |
|
1330 | - } |
|
1331 | - |
|
1332 | - } |
|
1333 | - //print_r($post); |
|
1334 | - // external links |
|
1335 | - $external_links = array(); |
|
1336 | - $external_links[] = $post->geodir_website; |
|
1337 | - $external_links[] = $post->geodir_twitter; |
|
1338 | - $external_links[] = $post->geodir_facebook; |
|
1339 | - $external_links = array_filter($external_links); |
|
1340 | - |
|
1341 | - if(!empty($external_links)){ |
|
1342 | - $external_links = array_values($external_links); |
|
1343 | - } |
|
1344 | - |
|
1345 | - // reviews |
|
1346 | - $comment_count = geodir_get_review_count_total($post->ID); |
|
1347 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
1348 | - |
|
1349 | - // schema type |
|
1350 | - $schema_type = 'LocalBusiness'; |
|
1351 | - if(isset($post->default_category) && $post->default_category){ |
|
1352 | - $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
1353 | - if($cat_schema){$schema_type = $cat_schema;} |
|
1354 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';} |
|
1355 | - } |
|
1356 | - |
|
1357 | - $schema = array(); |
|
1358 | - $schema['@context'] = "http://schema.org"; |
|
1359 | - $schema['@type'] = $schema_type; |
|
1360 | - $schema['name'] = $post->post_name; |
|
1361 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
1362 | - $schema['telephone'] = $post->geodir_contact; |
|
1363 | - $schema['url'] = $c_url; |
|
1364 | - $schema['sameAs'] = $external_links; |
|
1365 | - $schema['image'] = $images; |
|
1366 | - $schema['address'] = array( |
|
1367 | - "@type" => "PostalAddress", |
|
1368 | - "streetAddress" => $post->post_address, |
|
1369 | - "addressLocality" => $post->post_city, |
|
1370 | - "addressRegion" => $post->post_region, |
|
1371 | - "addressCountry" => $post->post_country, |
|
1372 | - "postalCode" => $post->post_zip |
|
1373 | - ); |
|
1374 | - |
|
1375 | - if($post->post_latitude && $post->post_longitude) { |
|
1376 | - $schema['geo'] = array( |
|
1377 | - "@type" => "GeoCoordinates", |
|
1378 | - "latitude" => $post->post_latitude, |
|
1379 | - "longitude" => $post->post_longitude |
|
1380 | - ); |
|
1381 | - } |
|
1382 | - |
|
1383 | - if($post_avgratings) { |
|
1384 | - $schema['aggregateRating'] = array( |
|
1385 | - "@type" => "AggregateRating", |
|
1386 | - "ratingValue" => $post_avgratings, |
|
1387 | - "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
1388 | - "worstRating" => "1", |
|
1389 | - "ratingCount" => $comment_count |
|
1390 | - ); |
|
1391 | - } |
|
1392 | - $schema['review'] = $reviews; |
|
1393 | - |
|
1394 | - /** |
|
1395 | - * Allow the schema JSON-LD info to be filtered. |
|
1396 | - * |
|
1397 | - * @since 1.5.4 |
|
1398 | - * @since 1.5.7 Added $post variable. |
|
1399 | - * @param array $schema The array of schema data to be filtered. |
|
1400 | - * @param object $post The post object. |
|
1401 | - */ |
|
1402 | - $schema = apply_filters('geodir_details_schema', $schema,$post); |
|
1403 | - |
|
1404 | - |
|
1405 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
1285 | + global $preview; |
|
1286 | + if(empty($post)){global $post;} |
|
1287 | + if ($preview || !geodir_is_page('detail')) { |
|
1288 | + return; |
|
1289 | + } |
|
1290 | + |
|
1291 | + // url |
|
1292 | + $c_url = geodir_curPageURL(); |
|
1293 | + |
|
1294 | + // post reviews |
|
1295 | + $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve')); |
|
1296 | + if (empty($post_reviews)) { |
|
1297 | + $reviews = ''; |
|
1298 | + } else { |
|
1299 | + foreach ($post_reviews as $review) { |
|
1300 | + $reviews[] = array( |
|
1301 | + "@type" => "Review", |
|
1302 | + "author" => $review->comment_author, |
|
1303 | + "datePublished" => $review->comment_date, |
|
1304 | + "description" => $review->comment_content, |
|
1305 | + "reviewRating" => array( |
|
1306 | + "@type" => "Rating", |
|
1307 | + "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
1308 | + "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
1309 | + "worstRating" => "1" |
|
1310 | + ) |
|
1311 | + ); |
|
1312 | + } |
|
1313 | + |
|
1314 | + } |
|
1315 | + |
|
1316 | + // post images |
|
1317 | + $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img')); |
|
1318 | + if (empty($post_images)) { |
|
1319 | + $images = ''; |
|
1320 | + } else { |
|
1321 | + $i_arr = array(); |
|
1322 | + foreach ($post_images as $img) { |
|
1323 | + $i_arr[] = $img->src; |
|
1324 | + } |
|
1325 | + |
|
1326 | + if (count($i_arr) == 1) { |
|
1327 | + $images = $i_arr[0]; |
|
1328 | + } else { |
|
1329 | + $images = $i_arr; |
|
1330 | + } |
|
1331 | + |
|
1332 | + } |
|
1333 | + //print_r($post); |
|
1334 | + // external links |
|
1335 | + $external_links = array(); |
|
1336 | + $external_links[] = $post->geodir_website; |
|
1337 | + $external_links[] = $post->geodir_twitter; |
|
1338 | + $external_links[] = $post->geodir_facebook; |
|
1339 | + $external_links = array_filter($external_links); |
|
1340 | + |
|
1341 | + if(!empty($external_links)){ |
|
1342 | + $external_links = array_values($external_links); |
|
1343 | + } |
|
1344 | + |
|
1345 | + // reviews |
|
1346 | + $comment_count = geodir_get_review_count_total($post->ID); |
|
1347 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
1348 | + |
|
1349 | + // schema type |
|
1350 | + $schema_type = 'LocalBusiness'; |
|
1351 | + if(isset($post->default_category) && $post->default_category){ |
|
1352 | + $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
1353 | + if($cat_schema){$schema_type = $cat_schema;} |
|
1354 | + if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';} |
|
1355 | + } |
|
1356 | + |
|
1357 | + $schema = array(); |
|
1358 | + $schema['@context'] = "http://schema.org"; |
|
1359 | + $schema['@type'] = $schema_type; |
|
1360 | + $schema['name'] = $post->post_name; |
|
1361 | + $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
1362 | + $schema['telephone'] = $post->geodir_contact; |
|
1363 | + $schema['url'] = $c_url; |
|
1364 | + $schema['sameAs'] = $external_links; |
|
1365 | + $schema['image'] = $images; |
|
1366 | + $schema['address'] = array( |
|
1367 | + "@type" => "PostalAddress", |
|
1368 | + "streetAddress" => $post->post_address, |
|
1369 | + "addressLocality" => $post->post_city, |
|
1370 | + "addressRegion" => $post->post_region, |
|
1371 | + "addressCountry" => $post->post_country, |
|
1372 | + "postalCode" => $post->post_zip |
|
1373 | + ); |
|
1374 | + |
|
1375 | + if($post->post_latitude && $post->post_longitude) { |
|
1376 | + $schema['geo'] = array( |
|
1377 | + "@type" => "GeoCoordinates", |
|
1378 | + "latitude" => $post->post_latitude, |
|
1379 | + "longitude" => $post->post_longitude |
|
1380 | + ); |
|
1381 | + } |
|
1382 | + |
|
1383 | + if($post_avgratings) { |
|
1384 | + $schema['aggregateRating'] = array( |
|
1385 | + "@type" => "AggregateRating", |
|
1386 | + "ratingValue" => $post_avgratings, |
|
1387 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
1388 | + "worstRating" => "1", |
|
1389 | + "ratingCount" => $comment_count |
|
1390 | + ); |
|
1391 | + } |
|
1392 | + $schema['review'] = $reviews; |
|
1393 | + |
|
1394 | + /** |
|
1395 | + * Allow the schema JSON-LD info to be filtered. |
|
1396 | + * |
|
1397 | + * @since 1.5.4 |
|
1398 | + * @since 1.5.7 Added $post variable. |
|
1399 | + * @param array $schema The array of schema data to be filtered. |
|
1400 | + * @param object $post The post object. |
|
1401 | + */ |
|
1402 | + $schema = apply_filters('geodir_details_schema', $schema,$post); |
|
1403 | + |
|
1404 | + |
|
1405 | + echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
1406 | 1406 | |
1407 | 1407 | } |
1408 | 1408 | |
@@ -1420,7 +1420,7 @@ discard block |
||
1420 | 1420 | */ |
1421 | 1421 | function geodir_action_details_next_prev() |
1422 | 1422 | { |
1423 | - ?> |
|
1423 | + ?> |
|
1424 | 1424 | <div class="geodir-pos_navigation clearfix"> |
1425 | 1425 | <div |
1426 | 1426 | class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div> |
@@ -1438,15 +1438,15 @@ discard block |
||
1438 | 1438 | */ |
1439 | 1439 | function geodir_action_before_single_post() |
1440 | 1440 | { |
1441 | - global $post; |
|
1442 | - /** |
|
1443 | - * Called at the very start of the details page output, before the title section. |
|
1444 | - * |
|
1445 | - * @since 1.0.0 |
|
1446 | - * @param object $post The current post object. |
|
1447 | - * @global WP_Post|null $post The current post, if available. |
|
1448 | - */ |
|
1449 | - do_action('geodir_before_single_post', $post); // extra action |
|
1441 | + global $post; |
|
1442 | + /** |
|
1443 | + * Called at the very start of the details page output, before the title section. |
|
1444 | + * |
|
1445 | + * @since 1.0.0 |
|
1446 | + * @param object $post The current post object. |
|
1447 | + * @global WP_Post|null $post The current post, if available. |
|
1448 | + */ |
|
1449 | + do_action('geodir_before_single_post', $post); // extra action |
|
1450 | 1450 | } |
1451 | 1451 | |
1452 | 1452 | /** |
@@ -1457,13 +1457,13 @@ discard block |
||
1457 | 1457 | */ |
1458 | 1458 | function geodir_action_after_single_post($post) |
1459 | 1459 | { |
1460 | - /** |
|
1461 | - * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
1462 | - * |
|
1463 | - * @since 1.0.0 |
|
1464 | - * @param object $post The current post object. |
|
1465 | - */ |
|
1466 | - do_action('geodir_after_single_post', $post); // extra action |
|
1460 | + /** |
|
1461 | + * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
1462 | + * |
|
1463 | + * @since 1.0.0 |
|
1464 | + * @param object $post The current post object. |
|
1465 | + */ |
|
1466 | + do_action('geodir_after_single_post', $post); // extra action |
|
1467 | 1467 | } |
1468 | 1468 | |
1469 | 1469 | add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10); |
@@ -1489,167 +1489,167 @@ discard block |
||
1489 | 1489 | */ |
1490 | 1490 | function geodir_action_listings_title() |
1491 | 1491 | { |
1492 | - global $wp, $term; |
|
1492 | + global $wp, $term; |
|
1493 | 1493 | |
1494 | - $gd_post_type = geodir_get_current_posttype(); |
|
1495 | - $post_type_info = get_post_type_object($gd_post_type); |
|
1494 | + $gd_post_type = geodir_get_current_posttype(); |
|
1495 | + $post_type_info = get_post_type_object($gd_post_type); |
|
1496 | 1496 | |
1497 | - $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
1498 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
1499 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
1500 | - } |
|
1497 | + $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
1498 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
1499 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
1500 | + } |
|
1501 | 1501 | |
1502 | - $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
1503 | - $single_name = $post_type_info->labels->singular_name; |
|
1502 | + $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
1503 | + $single_name = $post_type_info->labels->singular_name; |
|
1504 | 1504 | |
1505 | - $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
1505 | + $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
1506 | 1506 | |
1507 | - $gd_country = get_query_var('gd_country'); |
|
1508 | - $gd_region = get_query_var('gd_region'); |
|
1509 | - $gd_city = get_query_var('gd_city'); |
|
1507 | + $gd_country = get_query_var('gd_country'); |
|
1508 | + $gd_region = get_query_var('gd_region'); |
|
1509 | + $gd_city = get_query_var('gd_city'); |
|
1510 | 1510 | |
1511 | - if (!empty($term)) { |
|
1512 | - $location_name = ''; |
|
1513 | - if ($gd_country != '' || $gd_region != '' || $gd_city != '') { |
|
1514 | - if ($gd_country != '') { |
|
1515 | - $location_name = geodir_sanitize_location_name('gd_country', $gd_country); |
|
1516 | - } |
|
1517 | - |
|
1518 | - if ($gd_region != '') { |
|
1519 | - $location_name = geodir_sanitize_location_name('gd_region', $gd_region); |
|
1520 | - } |
|
1521 | - |
|
1522 | - if ($gd_city != '') { |
|
1523 | - $location_name = geodir_sanitize_location_name('gd_city', $gd_city); |
|
1524 | - } |
|
1525 | - } |
|
1526 | - |
|
1527 | - $current_term = get_term_by('slug', $term, $taxonomy[0]); |
|
1528 | - if (!empty($current_term)) { |
|
1529 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
1530 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1531 | - $location_last_char = substr($location_name, -1); |
|
1532 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
|
1533 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1534 | - } else { |
|
1535 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1536 | - } |
|
1537 | - } else { |
|
1538 | - if (count($taxonomy) > 1) { |
|
1539 | - $current_term = get_term_by('slug', $term, $taxonomy[1]); |
|
1540 | - |
|
1541 | - if (!empty($current_term)) { |
|
1542 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
1543 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1544 | - $location_last_char = substr($location_name, -1); |
|
1545 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
|
1546 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1547 | - } else { |
|
1548 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1549 | - } |
|
1550 | - } |
|
1551 | - } |
|
1552 | - } |
|
1553 | - |
|
1554 | - } else { |
|
1555 | - $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
1556 | - $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
1557 | - $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
1558 | - |
|
1559 | - $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
1560 | - |
|
1561 | - if (function_exists('get_actual_location_name')) { |
|
1562 | - $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country; |
|
1563 | - $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region; |
|
1564 | - $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city; |
|
1565 | - } |
|
1566 | - |
|
1567 | - if ($gd_city != '') { |
|
1568 | - if ($gd_city_actual != '') { |
|
1569 | - $gd_city = $gd_city_actual; |
|
1570 | - } else { |
|
1571 | - $gd_city = preg_replace('/-(\d+)$/', '', $gd_city); |
|
1572 | - $gd_city = preg_replace('/[_-]/', ' ', $gd_city); |
|
1573 | - $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
1574 | - } |
|
1575 | - |
|
1576 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'"; |
|
1577 | - } else if ($gd_region != '') { |
|
1578 | - if ($gd_region_actual != '') { |
|
1579 | - $gd_region = $gd_region_actual; |
|
1580 | - } else { |
|
1581 | - $gd_region = preg_replace('/-(\d+)$/', '', $gd_region); |
|
1582 | - $gd_region = preg_replace('/[_-]/', ' ', $gd_region); |
|
1583 | - $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
1584 | - } |
|
1585 | - |
|
1586 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'"; |
|
1587 | - } else if ($gd_country != '') { |
|
1588 | - if ($gd_country_actual != '') { |
|
1589 | - $gd_country = $gd_country_actual; |
|
1590 | - } else { |
|
1591 | - $gd_country = preg_replace('/-(\d+)$/', '', $gd_country); |
|
1592 | - $gd_country = preg_replace('/[_-]/', ' ', $gd_country); |
|
1593 | - $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
1594 | - } |
|
1595 | - |
|
1596 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'"; |
|
1597 | - } |
|
1598 | - } |
|
1599 | - |
|
1600 | - if (is_search()) { |
|
1601 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
1602 | - } |
|
1603 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1604 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
1605 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1606 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
1607 | - |
|
1608 | - |
|
1609 | - $title = $list_title; |
|
1610 | - if(geodir_is_page('pt')){ |
|
1611 | - $gd_page = 'pt'; |
|
1612 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title; |
|
1613 | - } |
|
1614 | - elseif(geodir_is_page('listing')){ |
|
1615 | - $gd_page = 'listing'; |
|
1616 | - global $wp_query; |
|
1617 | - $current_term = $wp_query->get_queried_object(); |
|
1618 | - if (strpos($current_term->taxonomy,'_tags') !== false) { |
|
1619 | - $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title; |
|
1620 | - }else{ |
|
1621 | - $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title; |
|
1622 | - } |
|
1511 | + if (!empty($term)) { |
|
1512 | + $location_name = ''; |
|
1513 | + if ($gd_country != '' || $gd_region != '' || $gd_city != '') { |
|
1514 | + if ($gd_country != '') { |
|
1515 | + $location_name = geodir_sanitize_location_name('gd_country', $gd_country); |
|
1516 | + } |
|
1623 | 1517 | |
1624 | - } |
|
1625 | - elseif(geodir_is_page('author')){ |
|
1626 | - $gd_page = 'author'; |
|
1627 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
1628 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
|
1629 | - }else{ |
|
1630 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
|
1631 | - } |
|
1518 | + if ($gd_region != '') { |
|
1519 | + $location_name = geodir_sanitize_location_name('gd_region', $gd_region); |
|
1520 | + } |
|
1632 | 1521 | |
1633 | - } |
|
1522 | + if ($gd_city != '') { |
|
1523 | + $location_name = geodir_sanitize_location_name('gd_city', $gd_city); |
|
1524 | + } |
|
1525 | + } |
|
1526 | + |
|
1527 | + $current_term = get_term_by('slug', $term, $taxonomy[0]); |
|
1528 | + if (!empty($current_term)) { |
|
1529 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
1530 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1531 | + $location_last_char = substr($location_name, -1); |
|
1532 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
|
1533 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1534 | + } else { |
|
1535 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1536 | + } |
|
1537 | + } else { |
|
1538 | + if (count($taxonomy) > 1) { |
|
1539 | + $current_term = get_term_by('slug', $term, $taxonomy[1]); |
|
1540 | + |
|
1541 | + if (!empty($current_term)) { |
|
1542 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
1543 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1544 | + $location_last_char = substr($location_name, -1); |
|
1545 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
|
1546 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1547 | + } else { |
|
1548 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1549 | + } |
|
1550 | + } |
|
1551 | + } |
|
1552 | + } |
|
1553 | + |
|
1554 | + } else { |
|
1555 | + $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
1556 | + $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
1557 | + $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
1558 | + |
|
1559 | + $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
1560 | + |
|
1561 | + if (function_exists('get_actual_location_name')) { |
|
1562 | + $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country; |
|
1563 | + $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region; |
|
1564 | + $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city; |
|
1565 | + } |
|
1566 | + |
|
1567 | + if ($gd_city != '') { |
|
1568 | + if ($gd_city_actual != '') { |
|
1569 | + $gd_city = $gd_city_actual; |
|
1570 | + } else { |
|
1571 | + $gd_city = preg_replace('/-(\d+)$/', '', $gd_city); |
|
1572 | + $gd_city = preg_replace('/[_-]/', ' ', $gd_city); |
|
1573 | + $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
1574 | + } |
|
1634 | 1575 | |
1576 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'"; |
|
1577 | + } else if ($gd_region != '') { |
|
1578 | + if ($gd_region_actual != '') { |
|
1579 | + $gd_region = $gd_region_actual; |
|
1580 | + } else { |
|
1581 | + $gd_region = preg_replace('/-(\d+)$/', '', $gd_region); |
|
1582 | + $gd_region = preg_replace('/[_-]/', ' ', $gd_region); |
|
1583 | + $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
1584 | + } |
|
1635 | 1585 | |
1636 | - /** |
|
1637 | - * Filter page title to replace variables. |
|
1638 | - * |
|
1639 | - * @since 1.5.4 |
|
1640 | - * @param string $title The page title including variables. |
|
1641 | - * @param string $gd_page The GeoDirectory page type if any. |
|
1642 | - */ |
|
1643 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
1586 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'"; |
|
1587 | + } else if ($gd_country != '') { |
|
1588 | + if ($gd_country_actual != '') { |
|
1589 | + $gd_country = $gd_country_actual; |
|
1590 | + } else { |
|
1591 | + $gd_country = preg_replace('/-(\d+)$/', '', $gd_country); |
|
1592 | + $gd_country = preg_replace('/[_-]/', ' ', $gd_country); |
|
1593 | + $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
1594 | + } |
|
1644 | 1595 | |
1645 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
1646 | - /** |
|
1647 | - * Filter the listing page title. |
|
1648 | - * |
|
1649 | - * @since 1.0.0 |
|
1650 | - * @param string $list_title The title for the category page. |
|
1651 | - */ |
|
1652 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>'; |
|
1596 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'"; |
|
1597 | + } |
|
1598 | + } |
|
1599 | + |
|
1600 | + if (is_search()) { |
|
1601 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
1602 | + } |
|
1603 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1604 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
1605 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1606 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
1607 | + |
|
1608 | + |
|
1609 | + $title = $list_title; |
|
1610 | + if(geodir_is_page('pt')){ |
|
1611 | + $gd_page = 'pt'; |
|
1612 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title; |
|
1613 | + } |
|
1614 | + elseif(geodir_is_page('listing')){ |
|
1615 | + $gd_page = 'listing'; |
|
1616 | + global $wp_query; |
|
1617 | + $current_term = $wp_query->get_queried_object(); |
|
1618 | + if (strpos($current_term->taxonomy,'_tags') !== false) { |
|
1619 | + $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title; |
|
1620 | + }else{ |
|
1621 | + $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title; |
|
1622 | + } |
|
1623 | + |
|
1624 | + } |
|
1625 | + elseif(geodir_is_page('author')){ |
|
1626 | + $gd_page = 'author'; |
|
1627 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
1628 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
|
1629 | + }else{ |
|
1630 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
|
1631 | + } |
|
1632 | + |
|
1633 | + } |
|
1634 | + |
|
1635 | + |
|
1636 | + /** |
|
1637 | + * Filter page title to replace variables. |
|
1638 | + * |
|
1639 | + * @since 1.5.4 |
|
1640 | + * @param string $title The page title including variables. |
|
1641 | + * @param string $gd_page The GeoDirectory page type if any. |
|
1642 | + */ |
|
1643 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
1644 | + |
|
1645 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
1646 | + /** |
|
1647 | + * Filter the listing page title. |
|
1648 | + * |
|
1649 | + * @since 1.0.0 |
|
1650 | + * @param string $list_title The title for the category page. |
|
1651 | + */ |
|
1652 | + apply_filters('geodir_listing_page_title', $title) . '</h1></header>'; |
|
1653 | 1653 | } |
1654 | 1654 | |
1655 | 1655 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10); |
@@ -1662,33 +1662,33 @@ discard block |
||
1662 | 1662 | */ |
1663 | 1663 | function geodir_action_listings_description() |
1664 | 1664 | { |
1665 | - global $wp_query; |
|
1666 | - $current_term = $wp_query->get_queried_object(); |
|
1667 | - |
|
1668 | - $gd_post_type = geodir_get_current_posttype(); |
|
1669 | - if (isset($current_term->term_id) && $current_term->term_id != '') { |
|
1670 | - |
|
1671 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
1672 | - $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
1673 | - if ($term_desc && !$saved_data) { |
|
1674 | - $saved_data = $term_desc; |
|
1675 | - } |
|
1676 | - /** |
|
1677 | - * Apply the core filter `the_content` filter to the variable string. |
|
1678 | - * |
|
1679 | - * This is a WordPress core filter that does many things. |
|
1680 | - * |
|
1681 | - * @since 1.0.0 |
|
1682 | - * @param string $var The string to apply the filter to. |
|
1683 | - */ |
|
1684 | - $cat_description = apply_filters('the_content', $saved_data); |
|
1685 | - if ($cat_description) { |
|
1686 | - ?> |
|
1665 | + global $wp_query; |
|
1666 | + $current_term = $wp_query->get_queried_object(); |
|
1667 | + |
|
1668 | + $gd_post_type = geodir_get_current_posttype(); |
|
1669 | + if (isset($current_term->term_id) && $current_term->term_id != '') { |
|
1670 | + |
|
1671 | + $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
1672 | + $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
1673 | + if ($term_desc && !$saved_data) { |
|
1674 | + $saved_data = $term_desc; |
|
1675 | + } |
|
1676 | + /** |
|
1677 | + * Apply the core filter `the_content` filter to the variable string. |
|
1678 | + * |
|
1679 | + * This is a WordPress core filter that does many things. |
|
1680 | + * |
|
1681 | + * @since 1.0.0 |
|
1682 | + * @param string $var The string to apply the filter to. |
|
1683 | + */ |
|
1684 | + $cat_description = apply_filters('the_content', $saved_data); |
|
1685 | + if ($cat_description) { |
|
1686 | + ?> |
|
1687 | 1687 | |
1688 | 1688 | <div class="term_description"><?php echo $cat_description;?></div> <?php |
1689 | - } |
|
1689 | + } |
|
1690 | 1690 | |
1691 | - } |
|
1691 | + } |
|
1692 | 1692 | } |
1693 | 1693 | |
1694 | 1694 | // action for adding the listings page top widget area |
@@ -1707,11 +1707,11 @@ discard block |
||
1707 | 1707 | */ |
1708 | 1708 | function geodir_action_geodir_sidebar_listings_top() |
1709 | 1709 | { |
1710 | - if (get_option('geodir_show_listing_top_section')) { ?> |
|
1710 | + if (get_option('geodir_show_listing_top_section')) { ?> |
|
1711 | 1711 | <div |
1712 | 1712 | class="<?php |
1713 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1714 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>"> |
|
1713 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1714 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>"> |
|
1715 | 1715 | <?php dynamic_sidebar('geodir_listing_top'); ?> |
1716 | 1716 | </div><!-- clearfix ends here--> |
1717 | 1717 | <?php } |
@@ -1734,35 +1734,35 @@ discard block |
||
1734 | 1734 | */ |
1735 | 1735 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
1736 | 1736 | { |
1737 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) { |
|
1738 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1739 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) { |
|
1740 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1741 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) { |
|
1742 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1743 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) { |
|
1744 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1745 | - } else { |
|
1746 | - $width_css = ''; |
|
1747 | - } |
|
1748 | - |
|
1749 | - $tc = get_option('theme_compatibility_setting'); |
|
1750 | - if (!empty($tc['geodir_sidebar_left_open_replace'])) { |
|
1751 | - $text = $tc['geodir_sidebar_left_open_replace']; |
|
1752 | - } else { |
|
1753 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
1754 | - } |
|
1755 | - |
|
1756 | - if (!empty($tc['geodir_sidebar_left_open_id'])) { |
|
1757 | - $id = $tc['geodir_sidebar_left_open_id']; |
|
1758 | - } |
|
1759 | - if (!empty($tc['geodir_sidebar_left_open_class'])) { |
|
1760 | - $class = $tc['geodir_sidebar_left_open_class']; |
|
1761 | - } |
|
1762 | - |
|
1763 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text); |
|
1764 | - |
|
1765 | - echo $text; |
|
1737 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) { |
|
1738 | + $width_css = 'style="width:' . $width . '%;"'; |
|
1739 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) { |
|
1740 | + $width_css = 'style="width:' . $width . '%;"'; |
|
1741 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) { |
|
1742 | + $width_css = 'style="width:' . $width . '%;"'; |
|
1743 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) { |
|
1744 | + $width_css = 'style="width:' . $width . '%;"'; |
|
1745 | + } else { |
|
1746 | + $width_css = ''; |
|
1747 | + } |
|
1748 | + |
|
1749 | + $tc = get_option('theme_compatibility_setting'); |
|
1750 | + if (!empty($tc['geodir_sidebar_left_open_replace'])) { |
|
1751 | + $text = $tc['geodir_sidebar_left_open_replace']; |
|
1752 | + } else { |
|
1753 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
1754 | + } |
|
1755 | + |
|
1756 | + if (!empty($tc['geodir_sidebar_left_open_id'])) { |
|
1757 | + $id = $tc['geodir_sidebar_left_open_id']; |
|
1758 | + } |
|
1759 | + if (!empty($tc['geodir_sidebar_left_open_class'])) { |
|
1760 | + $class = $tc['geodir_sidebar_left_open_class']; |
|
1761 | + } |
|
1762 | + |
|
1763 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text); |
|
1764 | + |
|
1765 | + echo $text; |
|
1766 | 1766 | } |
1767 | 1767 | |
1768 | 1768 | // action for adding the primary div closing tag |
@@ -1778,13 +1778,13 @@ discard block |
||
1778 | 1778 | */ |
1779 | 1779 | function geodir_action_sidebar_left_close($type = '') |
1780 | 1780 | { |
1781 | - $tc = get_option('theme_compatibility_setting'); |
|
1782 | - if (!empty($tc['geodir_sidebar_left_close_replace'])) { |
|
1783 | - $text = $tc['geodir_sidebar_left_close_replace']; |
|
1784 | - } else { |
|
1785 | - $text = '</aside><!-- sidebar ends here-->'; |
|
1786 | - } |
|
1787 | - echo $text; |
|
1781 | + $tc = get_option('theme_compatibility_setting'); |
|
1782 | + if (!empty($tc['geodir_sidebar_left_close_replace'])) { |
|
1783 | + $text = $tc['geodir_sidebar_left_close_replace']; |
|
1784 | + } else { |
|
1785 | + $text = '</aside><!-- sidebar ends here-->'; |
|
1786 | + } |
|
1787 | + echo $text; |
|
1788 | 1788 | } |
1789 | 1789 | |
1790 | 1790 | /** |
@@ -1797,7 +1797,7 @@ discard block |
||
1797 | 1797 | */ |
1798 | 1798 | function geodir_listing_left_section() |
1799 | 1799 | { |
1800 | - if (get_option('geodir_show_listing_left_section')) { ?> |
|
1800 | + if (get_option('geodir_show_listing_left_section')) { ?> |
|
1801 | 1801 | <div class="geodir-content-left geodir-sidebar-wrap"> |
1802 | 1802 | <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?> |
1803 | 1803 | </div><!-- end geodir-content-left --> |
@@ -1815,20 +1815,20 @@ discard block |
||
1815 | 1815 | */ |
1816 | 1816 | function geodir_action_listings_sidebar_left() |
1817 | 1817 | { |
1818 | - if (get_option('geodir_show_listing_left_section')) { |
|
1819 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1820 | - do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
1821 | - /** |
|
1822 | - * Calls the listings page (category) left sidebar content. |
|
1823 | - * |
|
1824 | - * All the content for the listings page left sidebar is added via this hook. |
|
1825 | - * |
|
1826 | - * @since 1.0.0 |
|
1827 | - */ |
|
1828 | - do_action('geodir_listings_sidebar_left_inside'); |
|
1829 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1830 | - do_action('geodir_sidebar_left_close', 'listings-page'); |
|
1831 | - } |
|
1818 | + if (get_option('geodir_show_listing_left_section')) { |
|
1819 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1820 | + do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
1821 | + /** |
|
1822 | + * Calls the listings page (category) left sidebar content. |
|
1823 | + * |
|
1824 | + * All the content for the listings page left sidebar is added via this hook. |
|
1825 | + * |
|
1826 | + * @since 1.0.0 |
|
1827 | + */ |
|
1828 | + do_action('geodir_listings_sidebar_left_inside'); |
|
1829 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1830 | + do_action('geodir_sidebar_left_close', 'listings-page'); |
|
1831 | + } |
|
1832 | 1832 | } |
1833 | 1833 | |
1834 | 1834 | /** |
@@ -1841,7 +1841,7 @@ discard block |
||
1841 | 1841 | */ |
1842 | 1842 | function geodir_listing_right_section() |
1843 | 1843 | { |
1844 | - if (get_option('geodir_show_listing_right_section')) { ?> |
|
1844 | + if (get_option('geodir_show_listing_right_section')) { ?> |
|
1845 | 1845 | <div class="geodir-content-right geodir-sidebar-wrap"> |
1846 | 1846 | <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?> |
1847 | 1847 | </div><!-- end geodir-content-right --> |
@@ -1859,20 +1859,20 @@ discard block |
||
1859 | 1859 | */ |
1860 | 1860 | function geodir_action_listings_sidebar_right() |
1861 | 1861 | { |
1862 | - if (get_option('geodir_show_listing_right_section')) { |
|
1863 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1864 | - do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
1865 | - /** |
|
1866 | - * Calls the listings page (category) right sidebar content. |
|
1867 | - * |
|
1868 | - * All the content for the listings page right sidebar is added via this hook. |
|
1869 | - * |
|
1870 | - * @since 1.0.0 |
|
1871 | - */ |
|
1872 | - do_action('geodir_listings_sidebar_right_inside'); |
|
1873 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1874 | - do_action('geodir_sidebar_right_close', 'listings-page'); |
|
1875 | - } |
|
1862 | + if (get_option('geodir_show_listing_right_section')) { |
|
1863 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1864 | + do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
1865 | + /** |
|
1866 | + * Calls the listings page (category) right sidebar content. |
|
1867 | + * |
|
1868 | + * All the content for the listings page right sidebar is added via this hook. |
|
1869 | + * |
|
1870 | + * @since 1.0.0 |
|
1871 | + */ |
|
1872 | + do_action('geodir_listings_sidebar_right_inside'); |
|
1873 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1874 | + do_action('geodir_sidebar_right_close', 'listings-page'); |
|
1875 | + } |
|
1876 | 1876 | } |
1877 | 1877 | |
1878 | 1878 | |
@@ -1889,23 +1889,23 @@ discard block |
||
1889 | 1889 | */ |
1890 | 1890 | function geodir_action_main_content_open($type = '', $id = '', $class = '') |
1891 | 1891 | { |
1892 | - $tc = get_option('theme_compatibility_setting'); |
|
1893 | - if (!empty($tc['geodir_main_content_open_replace'])) { |
|
1894 | - $text = $tc['geodir_main_content_open_replace']; |
|
1895 | - } else { |
|
1896 | - $text = '<main id="[id]" class="[class]" role="main">'; |
|
1897 | - } |
|
1892 | + $tc = get_option('theme_compatibility_setting'); |
|
1893 | + if (!empty($tc['geodir_main_content_open_replace'])) { |
|
1894 | + $text = $tc['geodir_main_content_open_replace']; |
|
1895 | + } else { |
|
1896 | + $text = '<main id="[id]" class="[class]" role="main">'; |
|
1897 | + } |
|
1898 | 1898 | |
1899 | - if (!empty($tc['geodir_main_content_open_id'])) { |
|
1900 | - $id = $tc['geodir_main_content_open_id']; |
|
1901 | - } |
|
1902 | - if (!empty($tc['geodir_main_content_open_class'])) { |
|
1903 | - $class = $tc['geodir_main_content_open_class']; |
|
1904 | - } |
|
1899 | + if (!empty($tc['geodir_main_content_open_id'])) { |
|
1900 | + $id = $tc['geodir_main_content_open_id']; |
|
1901 | + } |
|
1902 | + if (!empty($tc['geodir_main_content_open_class'])) { |
|
1903 | + $class = $tc['geodir_main_content_open_class']; |
|
1904 | + } |
|
1905 | 1905 | |
1906 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text); |
|
1906 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text); |
|
1907 | 1907 | |
1908 | - echo $text; |
|
1908 | + echo $text; |
|
1909 | 1909 | } |
1910 | 1910 | |
1911 | 1911 | // action for adding the primary div closing tag |
@@ -1918,13 +1918,13 @@ discard block |
||
1918 | 1918 | */ |
1919 | 1919 | function geodir_action_main_content_close() |
1920 | 1920 | { |
1921 | - $tc = get_option('theme_compatibility_setting'); |
|
1922 | - if (!empty($tc['geodir_main_content_close_replace'])) { |
|
1923 | - $text = $tc['geodir_main_content_close_replace']; |
|
1924 | - } else { |
|
1925 | - $text = '</main><!-- main ends here-->'; |
|
1926 | - } |
|
1927 | - echo $text; |
|
1921 | + $tc = get_option('theme_compatibility_setting'); |
|
1922 | + if (!empty($tc['geodir_main_content_close_replace'])) { |
|
1923 | + $text = $tc['geodir_main_content_close_replace']; |
|
1924 | + } else { |
|
1925 | + $text = '</main><!-- main ends here-->'; |
|
1926 | + } |
|
1927 | + echo $text; |
|
1928 | 1928 | } |
1929 | 1929 | |
1930 | 1930 | /** |
@@ -1936,14 +1936,14 @@ discard block |
||
1936 | 1936 | */ |
1937 | 1937 | function geodir_action_listings_content_inside() |
1938 | 1938 | { |
1939 | - global $gridview_columns; |
|
1940 | - $listing_view = get_option('geodir_listing_view'); |
|
1941 | - if (strstr($listing_view, 'gridview')) { |
|
1942 | - $gridview_columns = $listing_view; |
|
1943 | - $listing_view_exp = explode('_', $listing_view); |
|
1944 | - $listing_view = $listing_view_exp[0]; |
|
1945 | - } |
|
1946 | - geodir_get_template_part('listing', 'listview'); |
|
1939 | + global $gridview_columns; |
|
1940 | + $listing_view = get_option('geodir_listing_view'); |
|
1941 | + if (strstr($listing_view, 'gridview')) { |
|
1942 | + $gridview_columns = $listing_view; |
|
1943 | + $listing_view_exp = explode('_', $listing_view); |
|
1944 | + $listing_view = $listing_view_exp[0]; |
|
1945 | + } |
|
1946 | + geodir_get_template_part('listing', 'listview'); |
|
1947 | 1947 | } |
1948 | 1948 | |
1949 | 1949 | add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10); |
@@ -1959,47 +1959,47 @@ discard block |
||
1959 | 1959 | */ |
1960 | 1960 | function geodir_action_listings_content() |
1961 | 1961 | { |
1962 | - /** |
|
1963 | - * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
1964 | - * |
|
1965 | - * @since 1.0.0 |
|
1966 | - * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
1967 | - * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
1968 | - * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
1969 | - * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
1970 | - */ |
|
1971 | - do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page'); |
|
1972 | - $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page'); |
|
1973 | - echo '<div class="clearfix '.$extra_class.'">'; |
|
1974 | - /** |
|
1975 | - * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
1976 | - * |
|
1977 | - * @since 1.0.0 |
|
1978 | - */ |
|
1979 | - do_action('geodir_before_listing'); |
|
1980 | - echo '</div>'; |
|
1981 | - |
|
1982 | - /** |
|
1983 | - * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
1984 | - * |
|
1985 | - * @since 1.0.0 |
|
1986 | - */ |
|
1987 | - do_action('geodir_listings_content_inside'); |
|
1988 | - |
|
1989 | - /** |
|
1990 | - * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
1991 | - * |
|
1992 | - * @since 1.0.0 |
|
1993 | - */ |
|
1994 | - do_action('geodir_after_listing'); |
|
1995 | - |
|
1996 | - /** |
|
1997 | - * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
1998 | - * |
|
1999 | - * @since 1.0.0 |
|
2000 | - * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
2001 | - */ |
|
2002 | - do_action('geodir_main_content_close', 'listings-page'); |
|
1962 | + /** |
|
1963 | + * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
1964 | + * |
|
1965 | + * @since 1.0.0 |
|
1966 | + * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
1967 | + * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
1968 | + * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
1969 | + * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
1970 | + */ |
|
1971 | + do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page'); |
|
1972 | + $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page'); |
|
1973 | + echo '<div class="clearfix '.$extra_class.'">'; |
|
1974 | + /** |
|
1975 | + * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
1976 | + * |
|
1977 | + * @since 1.0.0 |
|
1978 | + */ |
|
1979 | + do_action('geodir_before_listing'); |
|
1980 | + echo '</div>'; |
|
1981 | + |
|
1982 | + /** |
|
1983 | + * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
1984 | + * |
|
1985 | + * @since 1.0.0 |
|
1986 | + */ |
|
1987 | + do_action('geodir_listings_content_inside'); |
|
1988 | + |
|
1989 | + /** |
|
1990 | + * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
1991 | + * |
|
1992 | + * @since 1.0.0 |
|
1993 | + */ |
|
1994 | + do_action('geodir_after_listing'); |
|
1995 | + |
|
1996 | + /** |
|
1997 | + * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
1998 | + * |
|
1999 | + * @since 1.0.0 |
|
2000 | + * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
2001 | + */ |
|
2002 | + do_action('geodir_main_content_close', 'listings-page'); |
|
2003 | 2003 | } |
2004 | 2004 | |
2005 | 2005 | |
@@ -2014,10 +2014,10 @@ discard block |
||
2014 | 2014 | */ |
2015 | 2015 | function geodir_action_sidebar_listings_bottom_section() |
2016 | 2016 | { |
2017 | - if (get_option('geodir_show_listing_bottom_section')) { ?> |
|
2017 | + if (get_option('geodir_show_listing_bottom_section')) { ?> |
|
2018 | 2018 | <div class="<?php |
2019 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2020 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>"> |
|
2019 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2020 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>"> |
|
2021 | 2021 | <?php dynamic_sidebar('geodir_listing_bottom'); ?> |
2022 | 2022 | </div><!-- clearfix ends here--> |
2023 | 2023 | <?php } |
@@ -2037,38 +2037,38 @@ discard block |
||
2037 | 2037 | */ |
2038 | 2038 | function geodir_action_add_listing_page_title() |
2039 | 2039 | { |
2040 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
2041 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2042 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2043 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2044 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2045 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2046 | - |
|
2047 | - $title = apply_filters('geodir_add_listing_page_title_text', get_the_title()); |
|
2048 | - |
|
2049 | - if(geodir_is_page('add-listing')){ |
|
2050 | - $gd_page = 'add-listing'; |
|
2051 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){ |
|
2052 | - $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title; |
|
2053 | - }elseif(isset($listing_type)){ |
|
2054 | - $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title; |
|
2055 | - } |
|
2040 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
2041 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2042 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2043 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2044 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2045 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2046 | + |
|
2047 | + $title = apply_filters('geodir_add_listing_page_title_text', get_the_title()); |
|
2048 | + |
|
2049 | + if(geodir_is_page('add-listing')){ |
|
2050 | + $gd_page = 'add-listing'; |
|
2051 | + if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){ |
|
2052 | + $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title; |
|
2053 | + }elseif(isset($listing_type)){ |
|
2054 | + $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title; |
|
2055 | + } |
|
2056 | 2056 | |
2057 | - } |
|
2057 | + } |
|
2058 | 2058 | |
2059 | 2059 | |
2060 | - /** |
|
2061 | - * Filter page title to replace variables. |
|
2062 | - * |
|
2063 | - * @since 1.5.4 |
|
2064 | - * @param string $title The page title including variables. |
|
2065 | - * @param string $gd_page The GeoDirectory page type if any. |
|
2066 | - */ |
|
2067 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2060 | + /** |
|
2061 | + * Filter page title to replace variables. |
|
2062 | + * |
|
2063 | + * @since 1.5.4 |
|
2064 | + * @param string $title The page title including variables. |
|
2065 | + * @param string $gd_page The GeoDirectory page type if any. |
|
2066 | + */ |
|
2067 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2068 | 2068 | |
2069 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
2070 | - echo $title; |
|
2071 | - echo '</h1></header>'; |
|
2069 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
2070 | + echo $title; |
|
2071 | + echo '</h1></header>'; |
|
2072 | 2072 | } |
2073 | 2073 | |
2074 | 2074 | add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10); |
@@ -2099,59 +2099,59 @@ discard block |
||
2099 | 2099 | */ |
2100 | 2100 | function geodir_action_add_listing_form() |
2101 | 2101 | { |
2102 | - global $cat_display, $post_cat, $current_user, $gd_session; |
|
2103 | - $page_id = get_the_ID(); |
|
2104 | - $post = ''; |
|
2105 | - $title = ''; |
|
2106 | - $desc = ''; |
|
2107 | - $kw_tags = ''; |
|
2108 | - $required_msg = ''; |
|
2109 | - $submit_button = ''; |
|
2110 | - |
|
2111 | - $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
2112 | - |
|
2113 | - $thumb_img_arr = array(); |
|
2114 | - $curImages = ''; |
|
2115 | - |
|
2116 | - if (isset($_REQUEST['backandedit'])) { |
|
2117 | - global $post; |
|
2118 | - $post = (object)$gd_session->get('listing'); |
|
2119 | - $listing_type = $post->listing_type; |
|
2120 | - $title = $post->post_title; |
|
2121 | - $desc = $post->post_desc; |
|
2122 | - $post_cat = $post->post_category; |
|
2123 | - |
|
2124 | - $kw_tags = $post->post_tags; |
|
2125 | - $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
2126 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2127 | - global $post, $post_images; |
|
2128 | - |
|
2129 | - $post = geodir_get_post_info($_REQUEST['pid']); |
|
2130 | - $thumb_img_arr = geodir_get_images($post->ID); |
|
2131 | - if ($thumb_img_arr) { |
|
2132 | - foreach ($thumb_img_arr as $post_img) { |
|
2133 | - $curImages .= $post_img->src . ','; |
|
2134 | - } |
|
2135 | - } |
|
2102 | + global $cat_display, $post_cat, $current_user, $gd_session; |
|
2103 | + $page_id = get_the_ID(); |
|
2104 | + $post = ''; |
|
2105 | + $title = ''; |
|
2106 | + $desc = ''; |
|
2107 | + $kw_tags = ''; |
|
2108 | + $required_msg = ''; |
|
2109 | + $submit_button = ''; |
|
2110 | + |
|
2111 | + $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
2112 | + |
|
2113 | + $thumb_img_arr = array(); |
|
2114 | + $curImages = ''; |
|
2115 | + |
|
2116 | + if (isset($_REQUEST['backandedit'])) { |
|
2117 | + global $post; |
|
2118 | + $post = (object)$gd_session->get('listing'); |
|
2119 | + $listing_type = $post->listing_type; |
|
2120 | + $title = $post->post_title; |
|
2121 | + $desc = $post->post_desc; |
|
2122 | + $post_cat = $post->post_category; |
|
2123 | + |
|
2124 | + $kw_tags = $post->post_tags; |
|
2125 | + $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
2126 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2127 | + global $post, $post_images; |
|
2128 | + |
|
2129 | + $post = geodir_get_post_info($_REQUEST['pid']); |
|
2130 | + $thumb_img_arr = geodir_get_images($post->ID); |
|
2131 | + if ($thumb_img_arr) { |
|
2132 | + foreach ($thumb_img_arr as $post_img) { |
|
2133 | + $curImages .= $post_img->src . ','; |
|
2134 | + } |
|
2135 | + } |
|
2136 | 2136 | |
2137 | - $listing_type = $post->post_type; |
|
2138 | - $title = $post->post_title; |
|
2139 | - $desc = $post->post_content; |
|
2140 | - $kw_tags = $post->post_tags; |
|
2141 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names'))); |
|
2142 | - } else { |
|
2143 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2144 | - } |
|
2137 | + $listing_type = $post->post_type; |
|
2138 | + $title = $post->post_title; |
|
2139 | + $desc = $post->post_content; |
|
2140 | + $kw_tags = $post->post_tags; |
|
2141 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names'))); |
|
2142 | + } else { |
|
2143 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2144 | + } |
|
2145 | 2145 | |
2146 | - if ($current_user->ID != '0') { |
|
2147 | - $user_login = true; |
|
2148 | - } |
|
2146 | + if ($current_user->ID != '0') { |
|
2147 | + $user_login = true; |
|
2148 | + } |
|
2149 | 2149 | |
2150 | - $post_type_info = geodir_get_posttype_info($listing_type); |
|
2150 | + $post_type_info = geodir_get_posttype_info($listing_type); |
|
2151 | 2151 | |
2152 | - $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory'); |
|
2152 | + $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory'); |
|
2153 | 2153 | |
2154 | - ?> |
|
2154 | + ?> |
|
2155 | 2155 | <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
2156 | 2156 | <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
2157 | 2157 | <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
@@ -2162,27 +2162,27 @@ discard block |
||
2162 | 2162 | <?php } if (isset($_REQUEST['backandedit'])) { ?> |
2163 | 2163 | <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
2164 | 2164 | <?php |
2165 | - } |
|
2166 | - /** |
|
2167 | - * Called at the very top of the add listing page form for frontend. |
|
2168 | - * |
|
2169 | - * This is called just before the "Enter Listing Details" text. |
|
2170 | - * |
|
2171 | - * @since 1.0.0 |
|
2172 | - */ |
|
2173 | - do_action('geodir_before_detail_fields'); |
|
2174 | - ?> |
|
2165 | + } |
|
2166 | + /** |
|
2167 | + * Called at the very top of the add listing page form for frontend. |
|
2168 | + * |
|
2169 | + * This is called just before the "Enter Listing Details" text. |
|
2170 | + * |
|
2171 | + * @since 1.0.0 |
|
2172 | + */ |
|
2173 | + do_action('geodir_before_detail_fields'); |
|
2174 | + ?> |
|
2175 | 2175 | <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
2176 | 2176 | <?php |
2177 | - /** |
|
2178 | - * Called at the top of the add listing page form for frontend. |
|
2179 | - * |
|
2180 | - * This is called after the "Enter Listing Details" text. |
|
2181 | - * |
|
2182 | - * @since 1.0.0 |
|
2183 | - */ |
|
2184 | - do_action('geodir_before_main_form_fields'); |
|
2185 | - ?> |
|
2177 | + /** |
|
2178 | + * Called at the top of the add listing page form for frontend. |
|
2179 | + * |
|
2180 | + * This is called after the "Enter Listing Details" text. |
|
2181 | + * |
|
2182 | + * @since 1.0.0 |
|
2183 | + */ |
|
2184 | + do_action('geodir_before_main_form_fields'); |
|
2185 | + ?> |
|
2186 | 2186 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
2187 | 2187 | <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label> |
2188 | 2188 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
@@ -2190,57 +2190,57 @@ discard block |
||
2190 | 2190 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
2191 | 2191 | </div> |
2192 | 2192 | <?php |
2193 | - $show_editor = get_option('geodir_tiny_editor_on_add_listing'); |
|
2194 | - |
|
2195 | - $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
2196 | - $desc_limit = ''; |
|
2197 | - /** |
|
2198 | - * Filter the add listing description field character limit number. |
|
2199 | - * |
|
2200 | - * @since 1.0.0 |
|
2201 | - * @param int $desc_limit The amount of characters to limit the description to. |
|
2202 | - */ |
|
2203 | - $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit); |
|
2204 | - /** |
|
2205 | - * Filter the add listing description field text. |
|
2206 | - * |
|
2207 | - * @since 1.0.0 |
|
2208 | - * @param string $desc The text for the description field. |
|
2209 | - * @param int $desc_limit The character limit number if any. |
|
2210 | - */ |
|
2211 | - $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit); |
|
2212 | - $desc_limit_msg = ''; |
|
2213 | - /** |
|
2214 | - * Filter the add listing description limit message. |
|
2215 | - * |
|
2216 | - * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
2217 | - * |
|
2218 | - * @since 1.0.0 |
|
2219 | - * @param string $desc_limit_msg The limit message string if any. |
|
2220 | - * @param int $desc_limit The character limit numer if any. |
|
2221 | - */ |
|
2222 | - $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit); |
|
2193 | + $show_editor = get_option('geodir_tiny_editor_on_add_listing'); |
|
2194 | + |
|
2195 | + $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
2196 | + $desc_limit = ''; |
|
2197 | + /** |
|
2198 | + * Filter the add listing description field character limit number. |
|
2199 | + * |
|
2200 | + * @since 1.0.0 |
|
2201 | + * @param int $desc_limit The amount of characters to limit the description to. |
|
2202 | + */ |
|
2203 | + $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit); |
|
2204 | + /** |
|
2205 | + * Filter the add listing description field text. |
|
2206 | + * |
|
2207 | + * @since 1.0.0 |
|
2208 | + * @param string $desc The text for the description field. |
|
2209 | + * @param int $desc_limit The character limit number if any. |
|
2210 | + */ |
|
2211 | + $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit); |
|
2212 | + $desc_limit_msg = ''; |
|
2213 | + /** |
|
2214 | + * Filter the add listing description limit message. |
|
2215 | + * |
|
2216 | + * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
2217 | + * |
|
2218 | + * @since 1.0.0 |
|
2219 | + * @param string $desc_limit_msg The limit message string if any. |
|
2220 | + * @param int $desc_limit The character limit numer if any. |
|
2221 | + */ |
|
2222 | + $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit); |
|
2223 | 2223 | |
2224 | - $desc_class = ''; |
|
2225 | - if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2226 | - /** |
|
2227 | - * Called on the add listing page form for frontend just before the description field. |
|
2228 | - * |
|
2229 | - * @since 1.0.0 |
|
2230 | - */ |
|
2231 | - do_action('geodir_before_description_field'); |
|
2224 | + $desc_class = ''; |
|
2225 | + if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2226 | + /** |
|
2227 | + * Called on the add listing page form for frontend just before the description field. |
|
2228 | + * |
|
2229 | + * @since 1.0.0 |
|
2230 | + */ |
|
2231 | + do_action('geodir_before_description_field'); |
|
2232 | 2232 | |
2233 | - $desc_class = ' required_field'; |
|
2234 | - } else { |
|
2235 | - $desc_class = ' hidden'; |
|
2236 | - } |
|
2237 | - ?> |
|
2233 | + $desc_class = ' required_field'; |
|
2234 | + } else { |
|
2235 | + $desc_class = ' hidden'; |
|
2236 | + } |
|
2237 | + ?> |
|
2238 | 2238 | <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
2239 | 2239 | <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label> |
2240 | 2240 | <?php |
2241 | - if (!empty($show_editor) && in_array($listing_type, $show_editor)) { |
|
2242 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); |
|
2243 | - ?> |
|
2241 | + if (!empty($show_editor) && in_array($listing_type, $show_editor)) { |
|
2242 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); |
|
2243 | + ?> |
|
2244 | 2244 | <div class="editor" field_id="post_desc" field_type="editor"> |
2245 | 2245 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
2246 | 2246 | </div> |
@@ -2254,56 +2254,56 @@ discard block |
||
2254 | 2254 | <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
2255 | 2255 | </div> |
2256 | 2256 | <?php |
2257 | - if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2258 | - /** |
|
2259 | - * Called on the add listing page form for frontend just after the description field. |
|
2260 | - * |
|
2261 | - * @since 1.0.0 |
|
2262 | - */ |
|
2263 | - do_action('geodir_after_description_field'); |
|
2264 | - } |
|
2257 | + if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2258 | + /** |
|
2259 | + * Called on the add listing page form for frontend just after the description field. |
|
2260 | + * |
|
2261 | + * @since 1.0.0 |
|
2262 | + */ |
|
2263 | + do_action('geodir_after_description_field'); |
|
2264 | + } |
|
2265 | 2265 | |
2266 | - $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
2267 | - $kw_tags_count = TAGKW_TEXT_COUNT; |
|
2268 | - $kw_tags_msg = TAGKW_MSG; |
|
2269 | - /** |
|
2270 | - * Filter the add listing tags character limit. |
|
2271 | - * |
|
2272 | - * @since 1.0.0 |
|
2273 | - * @param int $kw_tags_count The character count limit if any. |
|
2274 | - */ |
|
2275 | - $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count); |
|
2276 | - /** |
|
2277 | - * Filter the add listing tags field value. |
|
2278 | - * |
|
2279 | - * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
2280 | - * |
|
2281 | - * @since 1.0.0 |
|
2282 | - * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
2283 | - * @param int $kw_tags_count The character count limit if any. |
|
2284 | - */ |
|
2285 | - $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count); |
|
2286 | - /** |
|
2287 | - * Filter the add listing tags field message text. |
|
2288 | - * |
|
2289 | - * @since 1.0.0 |
|
2290 | - * @param string $kw_tags_msg The message shown under the field. |
|
2291 | - * @param int $kw_tags_count The character count limit if any. |
|
2292 | - */ |
|
2293 | - $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count); |
|
2266 | + $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
2267 | + $kw_tags_count = TAGKW_TEXT_COUNT; |
|
2268 | + $kw_tags_msg = TAGKW_MSG; |
|
2269 | + /** |
|
2270 | + * Filter the add listing tags character limit. |
|
2271 | + * |
|
2272 | + * @since 1.0.0 |
|
2273 | + * @param int $kw_tags_count The character count limit if any. |
|
2274 | + */ |
|
2275 | + $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count); |
|
2276 | + /** |
|
2277 | + * Filter the add listing tags field value. |
|
2278 | + * |
|
2279 | + * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
2280 | + * |
|
2281 | + * @since 1.0.0 |
|
2282 | + * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
2283 | + * @param int $kw_tags_count The character count limit if any. |
|
2284 | + */ |
|
2285 | + $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count); |
|
2286 | + /** |
|
2287 | + * Filter the add listing tags field message text. |
|
2288 | + * |
|
2289 | + * @since 1.0.0 |
|
2290 | + * @param string $kw_tags_msg The message shown under the field. |
|
2291 | + * @param int $kw_tags_count The character count limit if any. |
|
2292 | + */ |
|
2293 | + $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count); |
|
2294 | 2294 | |
2295 | - $tags_class = ''; |
|
2296 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2297 | - /** |
|
2298 | - * Called on the add listing page form for frontend just before the tags field. |
|
2299 | - * |
|
2300 | - * @since 1.0.0 |
|
2301 | - */ |
|
2302 | - do_action('geodir_before_listing_tags_field'); |
|
2303 | - } else { |
|
2304 | - $tags_class = ' hidden'; |
|
2305 | - } |
|
2306 | - ?> |
|
2295 | + $tags_class = ''; |
|
2296 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2297 | + /** |
|
2298 | + * Called on the add listing page form for frontend just before the tags field. |
|
2299 | + * |
|
2300 | + * @since 1.0.0 |
|
2301 | + */ |
|
2302 | + do_action('geodir_before_listing_tags_field'); |
|
2303 | + } else { |
|
2304 | + $tags_class = ' hidden'; |
|
2305 | + } |
|
2306 | + ?> |
|
2307 | 2307 | <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
2308 | 2308 | <label><?php echo TAGKW_TEXT; ?></label> |
2309 | 2309 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
@@ -2311,90 +2311,90 @@ discard block |
||
2311 | 2311 | <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
2312 | 2312 | </div> |
2313 | 2313 | <?php |
2314 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2315 | - /** |
|
2316 | - * Called on the add listing page form for frontend just after the tags field. |
|
2317 | - * |
|
2318 | - * @since 1.0.0 |
|
2319 | - */ |
|
2320 | - do_action('geodir_after_listing_tags_field'); |
|
2321 | - } |
|
2314 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2315 | + /** |
|
2316 | + * Called on the add listing page form for frontend just after the tags field. |
|
2317 | + * |
|
2318 | + * @since 1.0.0 |
|
2319 | + */ |
|
2320 | + do_action('geodir_after_listing_tags_field'); |
|
2321 | + } |
|
2322 | 2322 | |
2323 | - $package_info = array(); |
|
2324 | - $package_info = geodir_post_package_info($package_info, $post); |
|
2323 | + $package_info = array(); |
|
2324 | + $package_info = geodir_post_package_info($package_info, $post); |
|
2325 | 2325 | |
2326 | - geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
2326 | + geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
2327 | 2327 | |
2328 | - // adjust values here |
|
2329 | - $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 |
|
2330 | - |
|
2331 | - $multiple = true; // allow multiple files upload |
|
2328 | + // adjust values here |
|
2329 | + $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 |
|
2332 | 2330 | |
2333 | - $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
2331 | + $multiple = true; // allow multiple files upload |
|
2334 | 2332 | |
2335 | - $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
2333 | + $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
2336 | 2334 | |
2337 | - $thumb_img_arr = array(); |
|
2338 | - $totImg = 0; |
|
2339 | - if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) { |
|
2340 | - $post = (object)$gd_session->get('listing'); |
|
2341 | - if (isset($post->post_images)) |
|
2342 | - $curImages = trim($post->post_images, ","); |
|
2335 | + $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
2343 | 2336 | |
2337 | + $thumb_img_arr = array(); |
|
2338 | + $totImg = 0; |
|
2339 | + if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) { |
|
2340 | + $post = (object)$gd_session->get('listing'); |
|
2341 | + if (isset($post->post_images)) |
|
2342 | + $curImages = trim($post->post_images, ","); |
|
2344 | 2343 | |
2345 | - if ($curImages != '') { |
|
2346 | - $curImages_array = explode(',', $curImages); |
|
2347 | - $totImg = count($curImages_array); |
|
2348 | - } |
|
2349 | 2344 | |
2350 | - $listing_type = $post->listing_type; |
|
2345 | + if ($curImages != '') { |
|
2346 | + $curImages_array = explode(',', $curImages); |
|
2347 | + $totImg = count($curImages_array); |
|
2348 | + } |
|
2351 | 2349 | |
2352 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2353 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
2354 | - $listing_type = $post->post_type; |
|
2355 | - $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
2350 | + $listing_type = $post->listing_type; |
|
2356 | 2351 | |
2357 | - } else { |
|
2358 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2359 | - } |
|
2352 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2353 | + $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
2354 | + $listing_type = $post->post_type; |
|
2355 | + $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
2360 | 2356 | |
2357 | + } else { |
|
2358 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
2359 | + } |
|
2361 | 2360 | |
2362 | - if (!empty($thumb_img_arr)) { |
|
2363 | - foreach ($thumb_img_arr as $img) { |
|
2364 | - //$curImages = $img->src.","; |
|
2365 | - } |
|
2366 | 2361 | |
2367 | - $totImg = count((array)$thumb_img_arr); |
|
2368 | - } |
|
2362 | + if (!empty($thumb_img_arr)) { |
|
2363 | + foreach ($thumb_img_arr as $img) { |
|
2364 | + //$curImages = $img->src.","; |
|
2365 | + } |
|
2369 | 2366 | |
2370 | - if ($curImages != '') |
|
2371 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
2372 | - else |
|
2373 | - $svalue = ''; |
|
2374 | - |
|
2375 | - $image_limit = $package_info->image_limit; |
|
2376 | - $show_image_input_box = ($image_limit != '0'); |
|
2377 | - /** |
|
2378 | - * Filter to be able to show/hide the image upload section of the add listing form. |
|
2379 | - * |
|
2380 | - * @since 1.0.0 |
|
2381 | - * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
2382 | - * @param string $listing_type The custom post type slug. |
|
2383 | - */ |
|
2384 | - $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type); |
|
2385 | - if ($show_image_input_box) { |
|
2386 | - ?> |
|
2367 | + $totImg = count((array)$thumb_img_arr); |
|
2368 | + } |
|
2369 | + |
|
2370 | + if ($curImages != '') |
|
2371 | + $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
2372 | + else |
|
2373 | + $svalue = ''; |
|
2374 | + |
|
2375 | + $image_limit = $package_info->image_limit; |
|
2376 | + $show_image_input_box = ($image_limit != '0'); |
|
2377 | + /** |
|
2378 | + * Filter to be able to show/hide the image upload section of the add listing form. |
|
2379 | + * |
|
2380 | + * @since 1.0.0 |
|
2381 | + * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
2382 | + * @param string $listing_type The custom post type slug. |
|
2383 | + */ |
|
2384 | + $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type); |
|
2385 | + if ($show_image_input_box) { |
|
2386 | + ?> |
|
2387 | 2387 | |
2388 | 2388 | <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
2389 | 2389 | <?php if ($image_limit == 1) { |
2390 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>'; |
|
2391 | - } ?> |
|
2390 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>'; |
|
2391 | + } ?> |
|
2392 | 2392 | <?php if ($image_limit > 1) { |
2393 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>'; |
|
2394 | - } ?> |
|
2393 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>'; |
|
2394 | + } ?> |
|
2395 | 2395 | <?php if ($image_limit == '') { |
2396 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>'; |
|
2397 | - } ?> |
|
2396 | + echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>'; |
|
2397 | + } ?> |
|
2398 | 2398 | </h5> |
2399 | 2399 | |
2400 | 2400 | <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox" |
@@ -2432,12 +2432,12 @@ discard block |
||
2432 | 2432 | <?php } ?> |
2433 | 2433 | |
2434 | 2434 | <?php |
2435 | - /** |
|
2436 | - * Called on the add listing page form for frontend just after the image upload field. |
|
2437 | - * |
|
2438 | - * @since 1.0.0 |
|
2439 | - */ |
|
2440 | - do_action('geodir_after_main_form_fields');?> |
|
2435 | + /** |
|
2436 | + * Called on the add listing page form for frontend just after the image upload field. |
|
2437 | + * |
|
2438 | + * @since 1.0.0 |
|
2439 | + */ |
|
2440 | + do_action('geodir_after_main_form_fields');?> |
|
2441 | 2441 | |
2442 | 2442 | |
2443 | 2443 | <!-- add captcha code --> |
@@ -2466,7 +2466,7 @@ discard block |
||
2466 | 2466 | |
2467 | 2467 | </form> |
2468 | 2468 | <?php |
2469 | - wp_reset_query(); |
|
2469 | + wp_reset_query(); |
|
2470 | 2470 | } |
2471 | 2471 | |
2472 | 2472 | /** |
@@ -2477,7 +2477,7 @@ discard block |
||
2477 | 2477 | */ |
2478 | 2478 | function geodir_add_listing_sidebar_widget_area() |
2479 | 2479 | { |
2480 | - dynamic_sidebar('geodir_add_listing_sidebar'); |
|
2480 | + dynamic_sidebar('geodir_add_listing_sidebar'); |
|
2481 | 2481 | } |
2482 | 2482 | |
2483 | 2483 | add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10); |
@@ -2492,16 +2492,16 @@ discard block |
||
2492 | 2492 | */ |
2493 | 2493 | function geodir_action_add_listing_sidebar() |
2494 | 2494 | { |
2495 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2496 | - do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar'); |
|
2497 | - /** |
|
2498 | - * This is used to add the content to the add listing page sidebar. |
|
2499 | - * |
|
2500 | - * @since 1.0.0 |
|
2501 | - */ |
|
2502 | - do_action('geodir_add_listing_sidebar_inside'); |
|
2503 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2504 | - do_action('geodir_sidebar_right_close', 'details-page'); |
|
2495 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2496 | + do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar'); |
|
2497 | + /** |
|
2498 | + * This is used to add the content to the add listing page sidebar. |
|
2499 | + * |
|
2500 | + * @since 1.0.0 |
|
2501 | + */ |
|
2502 | + do_action('geodir_add_listing_sidebar_inside'); |
|
2503 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2504 | + do_action('geodir_sidebar_right_close', 'details-page'); |
|
2505 | 2505 | } |
2506 | 2506 | |
2507 | 2507 | ############################################### |
@@ -2518,11 +2518,11 @@ discard block |
||
2518 | 2518 | */ |
2519 | 2519 | function geodir_action_geodir_sidebar_signup_top() |
2520 | 2520 | { |
2521 | - ?> |
|
2521 | + ?> |
|
2522 | 2522 | <div |
2523 | 2523 | class="<?php |
2524 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2525 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>"> |
|
2524 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2525 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>"> |
|
2526 | 2526 | <?php dynamic_sidebar('Reg/Login Top Section');?> |
2527 | 2527 | </div><!-- clearfix ends here--> |
2528 | 2528 | <?php |
@@ -2541,9 +2541,9 @@ discard block |
||
2541 | 2541 | function geodir_action_signup_forms() |
2542 | 2542 | { |
2543 | 2543 | |
2544 | - global $user_login; |
|
2544 | + global $user_login; |
|
2545 | 2545 | |
2546 | - ?> |
|
2546 | + ?> |
|
2547 | 2547 | <script type="text/javascript"> |
2548 | 2548 | <?php if ( $user_login ) { ?> |
2549 | 2549 | setTimeout(function () { |
@@ -2579,65 +2579,65 @@ discard block |
||
2579 | 2579 | <?php } ?> |
2580 | 2580 | </script><?php |
2581 | 2581 | |
2582 | - global $errors; |
|
2583 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
2584 | - $errors->add('claim_login', LOGIN_CLAIM); |
|
2585 | - |
|
2586 | - if (!empty($errors)) { |
|
2587 | - foreach ($errors as $errorsObj) { |
|
2588 | - foreach ($errorsObj as $key => $val) { |
|
2589 | - for ($i = 0; $i < count($val); $i++) { |
|
2590 | - echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
2591 | - $registration_error_msg = 1; |
|
2592 | - } |
|
2593 | - } |
|
2594 | - } |
|
2595 | - } |
|
2582 | + global $errors; |
|
2583 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
2584 | + $errors->add('claim_login', LOGIN_CLAIM); |
|
2585 | + |
|
2586 | + if (!empty($errors)) { |
|
2587 | + foreach ($errors as $errorsObj) { |
|
2588 | + foreach ($errorsObj as $key => $val) { |
|
2589 | + for ($i = 0; $i < count($val); $i++) { |
|
2590 | + echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
2591 | + $registration_error_msg = 1; |
|
2592 | + } |
|
2593 | + } |
|
2594 | + } |
|
2595 | + } |
|
2596 | 2596 | |
2597 | - if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') { |
|
2598 | - ?> |
|
2597 | + if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') { |
|
2598 | + ?> |
|
2599 | 2599 | |
2600 | 2600 | <div class="login_form"> |
2601 | 2601 | <?php |
2602 | - /** |
|
2603 | - * Contains login form template. |
|
2604 | - * |
|
2605 | - * @since 1.0.0 |
|
2606 | - */ |
|
2607 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2602 | + /** |
|
2603 | + * Contains login form template. |
|
2604 | + * |
|
2605 | + * @since 1.0.0 |
|
2606 | + */ |
|
2607 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2608 | 2608 | </div> |
2609 | 2609 | |
2610 | 2610 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?> |
2611 | 2611 | |
2612 | 2612 | <div class="registration_form"> |
2613 | 2613 | <?php |
2614 | - /** |
|
2615 | - * Contains registration form template. |
|
2616 | - * |
|
2617 | - * @since 1.0.0 |
|
2618 | - */ |
|
2619 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2614 | + /** |
|
2615 | + * Contains registration form template. |
|
2616 | + * |
|
2617 | + * @since 1.0.0 |
|
2618 | + */ |
|
2619 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2620 | 2620 | </div> |
2621 | 2621 | |
2622 | 2622 | <?php } else { ?> |
2623 | 2623 | |
2624 | 2624 | <div class="login_form_l"> |
2625 | 2625 | <?php |
2626 | - /** |
|
2627 | - * Contains login form template. |
|
2628 | - * |
|
2629 | - * @since 1.0.0 |
|
2630 | - */ |
|
2631 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2626 | + /** |
|
2627 | + * Contains login form template. |
|
2628 | + * |
|
2629 | + * @since 1.0.0 |
|
2630 | + */ |
|
2631 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2632 | 2632 | </div> |
2633 | 2633 | <div class="registration_form_r"> |
2634 | 2634 | <?php |
2635 | - /** |
|
2636 | - * Contains registration form template. |
|
2637 | - * |
|
2638 | - * @since 1.0.0 |
|
2639 | - */ |
|
2640 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2635 | + /** |
|
2636 | + * Contains registration form template. |
|
2637 | + * |
|
2638 | + * @since 1.0.0 |
|
2639 | + */ |
|
2640 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2641 | 2641 | </div> |
2642 | 2642 | |
2643 | 2643 | <?php }?> |
@@ -2668,66 +2668,66 @@ discard block |
||
2668 | 2668 | */ |
2669 | 2669 | function geodir_action_author_page_title() |
2670 | 2670 | { |
2671 | - global $term; |
|
2671 | + global $term; |
|
2672 | 2672 | |
2673 | - $gd_post_type = geodir_get_current_posttype(); |
|
2674 | - $post_type_info = get_post_type_object($gd_post_type); |
|
2673 | + $gd_post_type = geodir_get_current_posttype(); |
|
2674 | + $post_type_info = get_post_type_object($gd_post_type); |
|
2675 | 2675 | |
2676 | - $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
2677 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
2678 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
2679 | - } |
|
2676 | + $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
2677 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
2678 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
2679 | + } |
|
2680 | 2680 | |
2681 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
2682 | - $single_name = $post_type_info->labels->singular_name; |
|
2681 | + $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
2682 | + $single_name = $post_type_info->labels->singular_name; |
|
2683 | 2683 | |
2684 | - $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
2684 | + $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
2685 | 2685 | |
2686 | - if (!empty($term)) { |
|
2687 | - $current_term = get_term_by('slug', $term, $taxonomy[0]); |
|
2688 | - if (!empty($current_term)) |
|
2689 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
2690 | - } |
|
2686 | + if (!empty($term)) { |
|
2687 | + $current_term = get_term_by('slug', $term, $taxonomy[0]); |
|
2688 | + if (!empty($current_term)) |
|
2689 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
2690 | + } |
|
2691 | 2691 | |
2692 | 2692 | |
2693 | - if (is_search()) { |
|
2694 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2693 | + if (is_search()) { |
|
2694 | + $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2695 | 2695 | |
2696 | - } |
|
2697 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2698 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2699 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2700 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2696 | + } |
|
2697 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2698 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2699 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2700 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2701 | 2701 | |
2702 | - $title = $list_title; |
|
2703 | - if(geodir_is_page('author')){ |
|
2704 | - $gd_page = 'author'; |
|
2705 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
2706 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
|
2707 | - }else{ |
|
2708 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
|
2709 | - } |
|
2702 | + $title = $list_title; |
|
2703 | + if(geodir_is_page('author')){ |
|
2704 | + $gd_page = 'author'; |
|
2705 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
2706 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
|
2707 | + }else{ |
|
2708 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
|
2709 | + } |
|
2710 | 2710 | |
2711 | - } |
|
2711 | + } |
|
2712 | 2712 | |
2713 | 2713 | |
2714 | - /** |
|
2715 | - * Filter page title to replace variables. |
|
2716 | - * |
|
2717 | - * @since 1.5.4 |
|
2718 | - * @param string $title The page title including variables. |
|
2719 | - * @param string $gd_page The GeoDirectory page type if any. |
|
2720 | - */ |
|
2721 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2714 | + /** |
|
2715 | + * Filter page title to replace variables. |
|
2716 | + * |
|
2717 | + * @since 1.5.4 |
|
2718 | + * @param string $title The page title including variables. |
|
2719 | + * @param string $gd_page The GeoDirectory page type if any. |
|
2720 | + */ |
|
2721 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2722 | 2722 | |
2723 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2724 | - /** |
|
2725 | - * Filter the author page title text. |
|
2726 | - * |
|
2727 | - * @since 1.0.0 |
|
2728 | - * @param string $list_title The title for the page. |
|
2729 | - */ |
|
2730 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>'; |
|
2723 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2724 | + /** |
|
2725 | + * Filter the author page title text. |
|
2726 | + * |
|
2727 | + * @since 1.0.0 |
|
2728 | + * @param string $list_title The title for the page. |
|
2729 | + */ |
|
2730 | + apply_filters('geodir_author_page_title_text', $title) . '</h1></header>'; |
|
2731 | 2731 | } |
2732 | 2732 | |
2733 | 2733 | |
@@ -2745,11 +2745,11 @@ discard block |
||
2745 | 2745 | */ |
2746 | 2746 | function geodir_action_geodir_sidebar_author_top() |
2747 | 2747 | { |
2748 | - if (get_option('geodir_show_author_top_section')) { ?> |
|
2748 | + if (get_option('geodir_show_author_top_section')) { ?> |
|
2749 | 2749 | <div |
2750 | 2750 | class="<?php |
2751 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2752 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>"> |
|
2751 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2752 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>"> |
|
2753 | 2753 | <?php dynamic_sidebar('geodir_author_top'); ?> |
2754 | 2754 | </div><!-- clearfix ends here--> |
2755 | 2755 | <?php } |
@@ -2765,7 +2765,7 @@ discard block |
||
2765 | 2765 | */ |
2766 | 2766 | function geodir_author_left_section() |
2767 | 2767 | { |
2768 | - if (get_option('geodir_show_author_left_section')) { ?> |
|
2768 | + if (get_option('geodir_show_author_left_section')) { ?> |
|
2769 | 2769 | <div class="geodir-content-left geodir-sidebar-wrap"> |
2770 | 2770 | <?php dynamic_sidebar('geodir_author_left_sidebar'); ?> |
2771 | 2771 | </div><!-- end geodir-content-left --> |
@@ -2786,19 +2786,19 @@ discard block |
||
2786 | 2786 | */ |
2787 | 2787 | function geodir_action_author_sidebar_left() |
2788 | 2788 | { |
2789 | - if (get_option('geodir_show_author_left_section')) { |
|
2789 | + if (get_option('geodir_show_author_left_section')) { |
|
2790 | 2790 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
2791 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2792 | - do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
2793 | - /** |
|
2794 | - * This is used to add the content to the author page left sidebar (if active). |
|
2795 | - * |
|
2796 | - * @since 1.0.0 |
|
2797 | - */ |
|
2798 | - do_action('geodir_author_sidebar_left_inside'); |
|
2799 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2800 | - do_action('geodir_sidebar_left_close', 'author-page'); |
|
2801 | - } |
|
2791 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2792 | + do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
2793 | + /** |
|
2794 | + * This is used to add the content to the author page left sidebar (if active). |
|
2795 | + * |
|
2796 | + * @since 1.0.0 |
|
2797 | + */ |
|
2798 | + do_action('geodir_author_sidebar_left_inside'); |
|
2799 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2800 | + do_action('geodir_sidebar_left_close', 'author-page'); |
|
2801 | + } |
|
2802 | 2802 | } |
2803 | 2803 | |
2804 | 2804 | /** |
@@ -2811,7 +2811,7 @@ discard block |
||
2811 | 2811 | */ |
2812 | 2812 | function geodir_author_right_section() |
2813 | 2813 | { |
2814 | - if (get_option('geodir_show_author_right_section')) { ?> |
|
2814 | + if (get_option('geodir_show_author_right_section')) { ?> |
|
2815 | 2815 | <div class="geodir-content-right geodir-sidebar-wrap"> |
2816 | 2816 | <?php dynamic_sidebar('geodir_author_right_sidebar'); ?> |
2817 | 2817 | </div><!-- end geodir-content-right --> |
@@ -2831,18 +2831,18 @@ discard block |
||
2831 | 2831 | */ |
2832 | 2832 | function geodir_action_author_sidebar_right() |
2833 | 2833 | { |
2834 | - if (get_option('geodir_show_author_right_section')) { |
|
2835 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2836 | - do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
2837 | - /** |
|
2838 | - * This is used to add the content to the author page right sidebar (if active). |
|
2839 | - * |
|
2840 | - * @since 1.0.0 |
|
2841 | - */ |
|
2842 | - do_action('geodir_author_sidebar_right_inside'); |
|
2843 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2844 | - do_action('geodir_sidebar_right_close', 'author-page'); |
|
2845 | - } |
|
2834 | + if (get_option('geodir_show_author_right_section')) { |
|
2835 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2836 | + do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
2837 | + /** |
|
2838 | + * This is used to add the content to the author page right sidebar (if active). |
|
2839 | + * |
|
2840 | + * @since 1.0.0 |
|
2841 | + */ |
|
2842 | + do_action('geodir_author_sidebar_right_inside'); |
|
2843 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2844 | + do_action('geodir_sidebar_right_close', 'author-page'); |
|
2845 | + } |
|
2846 | 2846 | } |
2847 | 2847 | |
2848 | 2848 | /** |
@@ -2854,14 +2854,14 @@ discard block |
||
2854 | 2854 | */ |
2855 | 2855 | function geodir_action_author_content_inside() |
2856 | 2856 | { |
2857 | - global $gridview_columns; |
|
2858 | - $listing_view = get_option('geodir_author_view'); |
|
2859 | - if (strstr($listing_view, 'gridview')) { |
|
2860 | - $gridview_columns = $listing_view; |
|
2861 | - $listing_view_exp = explode('_', $listing_view); |
|
2862 | - $listing_view = $listing_view_exp[0]; |
|
2863 | - } |
|
2864 | - geodir_get_template_part('listing', 'listview'); |
|
2857 | + global $gridview_columns; |
|
2858 | + $listing_view = get_option('geodir_author_view'); |
|
2859 | + if (strstr($listing_view, 'gridview')) { |
|
2860 | + $gridview_columns = $listing_view; |
|
2861 | + $listing_view_exp = explode('_', $listing_view); |
|
2862 | + $listing_view = $listing_view_exp[0]; |
|
2863 | + } |
|
2864 | + geodir_get_template_part('listing', 'listview'); |
|
2865 | 2865 | } |
2866 | 2866 | |
2867 | 2867 | add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10); |
@@ -2876,22 +2876,22 @@ discard block |
||
2876 | 2876 | */ |
2877 | 2877 | function geodir_action_author_content() |
2878 | 2878 | { |
2879 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2880 | - do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page'); |
|
2881 | - echo '<div class="clearfix">'; |
|
2882 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2883 | - do_action('geodir_before_listing'); |
|
2884 | - echo '</div>'; |
|
2885 | - /** |
|
2886 | - * This is used to add the content to the author page main content. |
|
2887 | - * |
|
2888 | - * @since 1.0.0 |
|
2889 | - */ |
|
2890 | - do_action('geodir_author_content_inside'); |
|
2891 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2892 | - do_action('geodir_after_listing'); |
|
2893 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2894 | - do_action('geodir_main_content_close', 'author-page'); |
|
2879 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2880 | + do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page'); |
|
2881 | + echo '<div class="clearfix">'; |
|
2882 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2883 | + do_action('geodir_before_listing'); |
|
2884 | + echo '</div>'; |
|
2885 | + /** |
|
2886 | + * This is used to add the content to the author page main content. |
|
2887 | + * |
|
2888 | + * @since 1.0.0 |
|
2889 | + */ |
|
2890 | + do_action('geodir_author_content_inside'); |
|
2891 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2892 | + do_action('geodir_after_listing'); |
|
2893 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2894 | + do_action('geodir_main_content_close', 'author-page'); |
|
2895 | 2895 | } |
2896 | 2896 | |
2897 | 2897 | add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10); |
@@ -2905,11 +2905,11 @@ discard block |
||
2905 | 2905 | */ |
2906 | 2906 | function geodir_action_sidebar_author_bottom_section() |
2907 | 2907 | { |
2908 | - if (get_option('geodir_show_author_bottom_section')) { ?> |
|
2908 | + if (get_option('geodir_show_author_bottom_section')) { ?> |
|
2909 | 2909 | <div |
2910 | 2910 | class="<?php |
2911 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2912 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>"> |
|
2911 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2912 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>"> |
|
2913 | 2913 | <?php dynamic_sidebar('geodir_author_bottom'); ?> |
2914 | 2914 | </div><!-- clearfix ends here--> |
2915 | 2915 | <?php } |
@@ -2928,23 +2928,23 @@ discard block |
||
2928 | 2928 | */ |
2929 | 2929 | function geodir_action_search_page_title() |
2930 | 2930 | { |
2931 | - $gd_post_type = geodir_get_current_posttype(); |
|
2932 | - $post_type_info = get_post_type_object($gd_post_type); |
|
2931 | + $gd_post_type = geodir_get_current_posttype(); |
|
2932 | + $post_type_info = get_post_type_object($gd_post_type); |
|
2933 | 2933 | |
2934 | - $pt_name = ''; |
|
2935 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;} |
|
2934 | + $pt_name = ''; |
|
2935 | + if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;} |
|
2936 | 2936 | |
2937 | - if (is_search()) { |
|
2938 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2937 | + if (is_search()) { |
|
2938 | + $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2939 | 2939 | |
2940 | - } |
|
2941 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2942 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2943 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2944 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2945 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2946 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2947 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>'; |
|
2940 | + } |
|
2941 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2942 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
|
2943 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2944 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
|
2945 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2946 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2947 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>'; |
|
2948 | 2948 | } |
2949 | 2949 | |
2950 | 2950 | // action for adding the listings page top widget area |
@@ -2960,11 +2960,11 @@ discard block |
||
2960 | 2960 | */ |
2961 | 2961 | function geodir_action_geodir_sidebar_search_top() |
2962 | 2962 | { |
2963 | - if (get_option('geodir_show_search_top_section')) { ?> |
|
2963 | + if (get_option('geodir_show_search_top_section')) { ?> |
|
2964 | 2964 | <div |
2965 | 2965 | class="<?php |
2966 | - /** This action is documented in geodirectory_template_actions.php */ |
|
2967 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>"> |
|
2966 | + /** This action is documented in geodirectory_template_actions.php */ |
|
2967 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>"> |
|
2968 | 2968 | <?php dynamic_sidebar('geodir_search_top'); ?> |
2969 | 2969 | </div><!-- clearfix ends here--> |
2970 | 2970 | <?php } |
@@ -2980,7 +2980,7 @@ discard block |
||
2980 | 2980 | */ |
2981 | 2981 | function geodir_search_left_section() |
2982 | 2982 | { |
2983 | - if (get_option('geodir_show_search_left_section')) { ?> |
|
2983 | + if (get_option('geodir_show_search_left_section')) { ?> |
|
2984 | 2984 | <div class="geodir-content-left geodir-sidebar-wrap"> |
2985 | 2985 | <?php dynamic_sidebar('geodir_search_left_sidebar'); ?> |
2986 | 2986 | </div><!-- end geodir-content-left --> |
@@ -3000,19 +3000,19 @@ discard block |
||
3000 | 3000 | */ |
3001 | 3001 | function geodir_action_search_sidebar_left() |
3002 | 3002 | { |
3003 | - if (get_option('geodir_show_search_left_section')) { |
|
3003 | + if (get_option('geodir_show_search_left_section')) { |
|
3004 | 3004 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
3005 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3006 | - do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
3007 | - /** |
|
3008 | - * This is used to add the content to the search page left sidebar (if active). |
|
3009 | - * |
|
3010 | - * @since 1.0.0 |
|
3011 | - */ |
|
3012 | - do_action('geodir_search_sidebar_left_inside'); |
|
3013 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3014 | - do_action('geodir_sidebar_left_close', 'search-page'); |
|
3015 | - } |
|
3005 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3006 | + do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
3007 | + /** |
|
3008 | + * This is used to add the content to the search page left sidebar (if active). |
|
3009 | + * |
|
3010 | + * @since 1.0.0 |
|
3011 | + */ |
|
3012 | + do_action('geodir_search_sidebar_left_inside'); |
|
3013 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3014 | + do_action('geodir_sidebar_left_close', 'search-page'); |
|
3015 | + } |
|
3016 | 3016 | } |
3017 | 3017 | |
3018 | 3018 | /** |
@@ -3025,7 +3025,7 @@ discard block |
||
3025 | 3025 | */ |
3026 | 3026 | function geodir_search_right_section() |
3027 | 3027 | { |
3028 | - if (get_option('geodir_show_search_right_section')) { ?> |
|
3028 | + if (get_option('geodir_show_search_right_section')) { ?> |
|
3029 | 3029 | <div class="geodir-content-right geodir-sidebar-wrap"> |
3030 | 3030 | <?php dynamic_sidebar('geodir_search_right_sidebar'); ?> |
3031 | 3031 | </div><!-- end geodir-content-right --> |
@@ -3045,18 +3045,18 @@ discard block |
||
3045 | 3045 | */ |
3046 | 3046 | function geodir_action_search_sidebar_right() |
3047 | 3047 | { |
3048 | - if (get_option('geodir_show_search_right_section')) { |
|
3049 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3050 | - do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
3051 | - /** |
|
3052 | - * This is used to add the content to the search page right sidebar (if active). |
|
3053 | - * |
|
3054 | - * @since 1.0.0 |
|
3055 | - */ |
|
3056 | - do_action('geodir_search_sidebar_right_inside'); |
|
3057 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3058 | - do_action('geodir_sidebar_right_close', 'search-page'); |
|
3059 | - } |
|
3048 | + if (get_option('geodir_show_search_right_section')) { |
|
3049 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3050 | + do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
3051 | + /** |
|
3052 | + * This is used to add the content to the search page right sidebar (if active). |
|
3053 | + * |
|
3054 | + * @since 1.0.0 |
|
3055 | + */ |
|
3056 | + do_action('geodir_search_sidebar_right_inside'); |
|
3057 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3058 | + do_action('geodir_sidebar_right_close', 'search-page'); |
|
3059 | + } |
|
3060 | 3060 | } |
3061 | 3061 | |
3062 | 3062 | |
@@ -3071,11 +3071,11 @@ discard block |
||
3071 | 3071 | */ |
3072 | 3072 | function geodir_action_sidebar_search_bottom_section() |
3073 | 3073 | { |
3074 | - if (get_option('geodir_show_search_bottom_section')) { ?> |
|
3074 | + if (get_option('geodir_show_search_bottom_section')) { ?> |
|
3075 | 3075 | <div |
3076 | 3076 | class="<?php |
3077 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3078 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>"> |
|
3077 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3078 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>"> |
|
3079 | 3079 | <?php dynamic_sidebar('geodir_search_bottom'); ?> |
3080 | 3080 | </div><!-- clearfix ends here--> |
3081 | 3081 | <?php } |
@@ -3090,14 +3090,14 @@ discard block |
||
3090 | 3090 | */ |
3091 | 3091 | function geodir_action_search_content_inside() |
3092 | 3092 | { |
3093 | - global $gridview_columns; |
|
3094 | - $listing_view = get_option('geodir_search_view'); |
|
3095 | - if (strstr($listing_view, 'gridview')) { |
|
3096 | - $gridview_columns = $listing_view; |
|
3097 | - $listing_view_exp = explode('_', $listing_view); |
|
3098 | - $listing_view = $listing_view_exp[0]; |
|
3099 | - } |
|
3100 | - geodir_get_template_part('listing', 'listview'); |
|
3093 | + global $gridview_columns; |
|
3094 | + $listing_view = get_option('geodir_search_view'); |
|
3095 | + if (strstr($listing_view, 'gridview')) { |
|
3096 | + $gridview_columns = $listing_view; |
|
3097 | + $listing_view_exp = explode('_', $listing_view); |
|
3098 | + $listing_view = $listing_view_exp[0]; |
|
3099 | + } |
|
3100 | + geodir_get_template_part('listing', 'listview'); |
|
3101 | 3101 | } |
3102 | 3102 | |
3103 | 3103 | add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10); |
@@ -3113,22 +3113,22 @@ discard block |
||
3113 | 3113 | */ |
3114 | 3114 | function geodir_action_search_content() |
3115 | 3115 | { |
3116 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3117 | - do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page'); |
|
3118 | - echo '<div class="clearfix">'; |
|
3119 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3120 | - do_action('geodir_before_listing'); |
|
3121 | - echo '</div>'; |
|
3122 | - /** |
|
3123 | - * This is used to add the content to the search page main content. |
|
3124 | - * |
|
3125 | - * @since 1.0.0 |
|
3126 | - */ |
|
3127 | - do_action('geodir_search_content_inside'); |
|
3128 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3129 | - do_action('geodir_after_listing'); |
|
3130 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3131 | - do_action('geodir_main_content_close', 'search-page'); |
|
3116 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3117 | + do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page'); |
|
3118 | + echo '<div class="clearfix">'; |
|
3119 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3120 | + do_action('geodir_before_listing'); |
|
3121 | + echo '</div>'; |
|
3122 | + /** |
|
3123 | + * This is used to add the content to the search page main content. |
|
3124 | + * |
|
3125 | + * @since 1.0.0 |
|
3126 | + */ |
|
3127 | + do_action('geodir_search_content_inside'); |
|
3128 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3129 | + do_action('geodir_after_listing'); |
|
3130 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3131 | + do_action('geodir_main_content_close', 'search-page'); |
|
3132 | 3132 | } |
3133 | 3133 | |
3134 | 3134 | ############################################### |
@@ -3151,11 +3151,11 @@ discard block |
||
3151 | 3151 | */ |
3152 | 3152 | function geodir_action_geodir_sidebar_home_top() |
3153 | 3153 | { |
3154 | - if (get_option('geodir_show_home_top_section')) { ?> |
|
3154 | + if (get_option('geodir_show_home_top_section')) { ?> |
|
3155 | 3155 | <div |
3156 | 3156 | class="<?php |
3157 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3158 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>"> |
|
3157 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3158 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>"> |
|
3159 | 3159 | <?php dynamic_sidebar('geodir_home_top'); ?> |
3160 | 3160 | </div><!-- clearfix ends here--> |
3161 | 3161 | <?php } |
@@ -3171,7 +3171,7 @@ discard block |
||
3171 | 3171 | */ |
3172 | 3172 | function geodir_home_left_section() |
3173 | 3173 | { |
3174 | - if (get_option('geodir_show_home_left_section')) { ?> |
|
3174 | + if (get_option('geodir_show_home_left_section')) { ?> |
|
3175 | 3175 | <div class="geodir-content-left geodir-sidebar-wrap"> |
3176 | 3176 | <?php dynamic_sidebar('geodir_home_left'); ?> |
3177 | 3177 | </div><!-- end geodir-content-left --> |
@@ -3193,19 +3193,19 @@ discard block |
||
3193 | 3193 | */ |
3194 | 3194 | function geodir_action_home_sidebar_left() |
3195 | 3195 | { |
3196 | - if (get_option('geodir_show_home_left_section')) { |
|
3196 | + if (get_option('geodir_show_home_left_section')) { |
|
3197 | 3197 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
3198 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3199 | - do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
3200 | - /** |
|
3201 | - * This is used to add the content to the home page left sidebar (if active). |
|
3202 | - * |
|
3203 | - * @since 1.0.0 |
|
3204 | - */ |
|
3205 | - do_action('geodir_home_sidebar_left_inside'); |
|
3206 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3207 | - do_action('geodir_sidebar_left_close', 'home-page'); |
|
3208 | - } |
|
3198 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3199 | + do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar'); |
|
3200 | + /** |
|
3201 | + * This is used to add the content to the home page left sidebar (if active). |
|
3202 | + * |
|
3203 | + * @since 1.0.0 |
|
3204 | + */ |
|
3205 | + do_action('geodir_home_sidebar_left_inside'); |
|
3206 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3207 | + do_action('geodir_sidebar_left_close', 'home-page'); |
|
3208 | + } |
|
3209 | 3209 | } |
3210 | 3210 | |
3211 | 3211 | /** |
@@ -3218,7 +3218,7 @@ discard block |
||
3218 | 3218 | */ |
3219 | 3219 | function geodir_home_right_section() |
3220 | 3220 | { |
3221 | - if (get_option('geodir_show_home_right_section')) { ?> |
|
3221 | + if (get_option('geodir_show_home_right_section')) { ?> |
|
3222 | 3222 | <div class="geodir-content-right geodir-sidebar-wrap"> |
3223 | 3223 | <?php dynamic_sidebar('geodir_home_right'); ?> |
3224 | 3224 | </div><!-- end geodir-content-right --> |
@@ -3239,18 +3239,18 @@ discard block |
||
3239 | 3239 | */ |
3240 | 3240 | function geodir_action_home_sidebar_right() |
3241 | 3241 | { |
3242 | - if (get_option('geodir_show_home_right_section')) { |
|
3243 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3244 | - do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
3245 | - /** |
|
3246 | - * This is used to add the content to the home page right sidebar (if active). |
|
3247 | - * |
|
3248 | - * @since 1.0.0 |
|
3249 | - */ |
|
3250 | - do_action('geodir_home_sidebar_right_inside'); |
|
3251 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3252 | - do_action('geodir_sidebar_right_close', 'home-page'); |
|
3253 | - } |
|
3242 | + if (get_option('geodir_show_home_right_section')) { |
|
3243 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3244 | + do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar'); |
|
3245 | + /** |
|
3246 | + * This is used to add the content to the home page right sidebar (if active). |
|
3247 | + * |
|
3248 | + * @since 1.0.0 |
|
3249 | + */ |
|
3250 | + do_action('geodir_home_sidebar_right_inside'); |
|
3251 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3252 | + do_action('geodir_sidebar_right_close', 'home-page'); |
|
3253 | + } |
|
3254 | 3254 | } |
3255 | 3255 | |
3256 | 3256 | /** |
@@ -3261,7 +3261,7 @@ discard block |
||
3261 | 3261 | */ |
3262 | 3262 | function geodir_action_home_content_inside() |
3263 | 3263 | { |
3264 | - dynamic_sidebar('geodir_home_content'); |
|
3264 | + dynamic_sidebar('geodir_home_content'); |
|
3265 | 3265 | } |
3266 | 3266 | |
3267 | 3267 | add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10); |
@@ -3276,28 +3276,28 @@ discard block |
||
3276 | 3276 | */ |
3277 | 3277 | function geodir_action_home_content() |
3278 | 3278 | { |
3279 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3280 | - do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page'); |
|
3281 | - /** |
|
3282 | - * This called before the home page main content. |
|
3283 | - * |
|
3284 | - * @since 1.0.0 |
|
3285 | - */ |
|
3286 | - do_action('geodir_before_home_content'); |
|
3287 | - /** |
|
3288 | - * This is used to add the content to the home page main content. |
|
3289 | - * |
|
3290 | - * @since 1.0.0 |
|
3291 | - */ |
|
3292 | - do_action('geodir_home_content_inside'); |
|
3293 | - /** |
|
3294 | - * This is called after the homepage main content. |
|
3295 | - * |
|
3296 | - * @since 1.0.0 |
|
3297 | - */ |
|
3298 | - do_action('geodir_after_home_content'); |
|
3299 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3300 | - do_action('geodir_main_content_close', 'home-page'); |
|
3279 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3280 | + do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page'); |
|
3281 | + /** |
|
3282 | + * This called before the home page main content. |
|
3283 | + * |
|
3284 | + * @since 1.0.0 |
|
3285 | + */ |
|
3286 | + do_action('geodir_before_home_content'); |
|
3287 | + /** |
|
3288 | + * This is used to add the content to the home page main content. |
|
3289 | + * |
|
3290 | + * @since 1.0.0 |
|
3291 | + */ |
|
3292 | + do_action('geodir_home_content_inside'); |
|
3293 | + /** |
|
3294 | + * This is called after the homepage main content. |
|
3295 | + * |
|
3296 | + * @since 1.0.0 |
|
3297 | + */ |
|
3298 | + do_action('geodir_after_home_content'); |
|
3299 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3300 | + do_action('geodir_main_content_close', 'home-page'); |
|
3301 | 3301 | } |
3302 | 3302 | |
3303 | 3303 | add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10); |
@@ -3312,11 +3312,11 @@ discard block |
||
3312 | 3312 | */ |
3313 | 3313 | function geodir_action_sidebar_home_bottom_section() |
3314 | 3314 | { |
3315 | - if (get_option('geodir_show_home_bottom_section')) { ?> |
|
3315 | + if (get_option('geodir_show_home_bottom_section')) { ?> |
|
3316 | 3316 | <div |
3317 | 3317 | class="<?php |
3318 | - /** This action is documented in geodirectory_template_actions.php */ |
|
3319 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>"> |
|
3318 | + /** This action is documented in geodirectory_template_actions.php */ |
|
3319 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>"> |
|
3320 | 3320 | <?php dynamic_sidebar('geodir_home_bottom'); ?> |
3321 | 3321 | </div><!-- clearfix ends here--> |
3322 | 3322 | <?php } |
@@ -3344,13 +3344,13 @@ discard block |
||
3344 | 3344 | */ |
3345 | 3345 | function geodir_filter_listing_page_title($list_title) |
3346 | 3346 | { |
3347 | - if (is_search() && trim(get_search_query()) == '') { |
|
3348 | - $gd_post_type = geodir_get_current_posttype(); |
|
3349 | - $post_type_info = get_post_type_object($gd_post_type); |
|
3347 | + if (is_search() && trim(get_search_query()) == '') { |
|
3348 | + $gd_post_type = geodir_get_current_posttype(); |
|
3349 | + $post_type_info = get_post_type_object($gd_post_type); |
|
3350 | 3350 | |
3351 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory'); |
|
3352 | - } |
|
3353 | - return $list_title; |
|
3351 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory'); |
|
3352 | + } |
|
3353 | + return $list_title; |
|
3354 | 3354 | } |
3355 | 3355 | |
3356 | 3356 | add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing'); |
@@ -3365,61 +3365,61 @@ discard block |
||
3365 | 3365 | * @param string $gd_page The geodirectory page type. Default null. |
3366 | 3366 | */ |
3367 | 3367 | function geodir_add_page_content( $position = 'before', $gd_page = '' ) { |
3368 | - global $post; |
|
3368 | + global $post; |
|
3369 | 3369 | |
3370 | - $gd_page_id = NULL; |
|
3371 | - if ($gd_page == 'home-page' && geodir_is_page('home')) { |
|
3372 | - $gd_page_id = geodir_home_page_id(); |
|
3373 | - } else if ($gd_page == 'details-page' && geodir_is_page('preview')) { |
|
3374 | - $gd_page_id = geodir_preview_page_id(); |
|
3375 | - } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) { |
|
3376 | - $gd_page_id = geodir_add_listing_page_id(); |
|
3377 | - } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) { |
|
3378 | - $gd_page_id = geodir_success_page_id(); |
|
3379 | - } else if ($gd_page == 'location-page' && geodir_is_page('location')) { |
|
3380 | - $gd_page_id = geodir_location_page_id(); |
|
3381 | - } else if ($gd_page == 'info-page' && geodir_is_page('info')) { |
|
3382 | - $gd_page_id = geodir_info_page_id(); |
|
3383 | - } else if ($gd_page == 'signup-page' && geodir_is_page('login')) { |
|
3384 | - $gd_page_id = geodir_login_page_id(); |
|
3385 | - } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) { |
|
3386 | - $gd_page_id = geodir_payment_checkout_page_id(); |
|
3387 | - } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) { |
|
3388 | - $gd_page_id = geodir_payment_invoices_page_id(); |
|
3389 | - } |
|
3370 | + $gd_page_id = NULL; |
|
3371 | + if ($gd_page == 'home-page' && geodir_is_page('home')) { |
|
3372 | + $gd_page_id = geodir_home_page_id(); |
|
3373 | + } else if ($gd_page == 'details-page' && geodir_is_page('preview')) { |
|
3374 | + $gd_page_id = geodir_preview_page_id(); |
|
3375 | + } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) { |
|
3376 | + $gd_page_id = geodir_add_listing_page_id(); |
|
3377 | + } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) { |
|
3378 | + $gd_page_id = geodir_success_page_id(); |
|
3379 | + } else if ($gd_page == 'location-page' && geodir_is_page('location')) { |
|
3380 | + $gd_page_id = geodir_location_page_id(); |
|
3381 | + } else if ($gd_page == 'info-page' && geodir_is_page('info')) { |
|
3382 | + $gd_page_id = geodir_info_page_id(); |
|
3383 | + } else if ($gd_page == 'signup-page' && geodir_is_page('login')) { |
|
3384 | + $gd_page_id = geodir_login_page_id(); |
|
3385 | + } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) { |
|
3386 | + $gd_page_id = geodir_payment_checkout_page_id(); |
|
3387 | + } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) { |
|
3388 | + $gd_page_id = geodir_payment_invoices_page_id(); |
|
3389 | + } |
|
3390 | 3390 | |
3391 | - if (!$gd_page_id > 0) { |
|
3392 | - return; |
|
3393 | - } |
|
3391 | + if (!$gd_page_id > 0) { |
|
3392 | + return; |
|
3393 | + } |
|
3394 | 3394 | |
3395 | - $display = 'before'; |
|
3396 | - /** |
|
3397 | - * Filter the position to display the page content. |
|
3398 | - * |
|
3399 | - * @since 1.6.3 |
|
3400 | - * |
|
3401 | - * @param string $display Position to add the post content. |
|
3402 | - * @param string $gd_page The geodirectory page type. |
|
3403 | - */ |
|
3404 | - $display = apply_filters('geodir_add_page_content_position', $display, $gd_page); |
|
3395 | + $display = 'before'; |
|
3396 | + /** |
|
3397 | + * Filter the position to display the page content. |
|
3398 | + * |
|
3399 | + * @since 1.6.3 |
|
3400 | + * |
|
3401 | + * @param string $display Position to add the post content. |
|
3402 | + * @param string $gd_page The geodirectory page type. |
|
3403 | + */ |
|
3404 | + $display = apply_filters('geodir_add_page_content_position', $display, $gd_page); |
|
3405 | 3405 | |
3406 | - if ($position !== $display) { |
|
3407 | - return; |
|
3408 | - } |
|
3406 | + if ($position !== $display) { |
|
3407 | + return; |
|
3408 | + } |
|
3409 | 3409 | |
3410 | - $gd_post = $post; |
|
3410 | + $gd_post = $post; |
|
3411 | 3411 | |
3412 | - setup_postdata(get_post($gd_page_id)); |
|
3412 | + setup_postdata(get_post($gd_page_id)); |
|
3413 | 3413 | |
3414 | - if (get_the_content()) { |
|
3415 | - ?> |
|
3414 | + if (get_the_content()) { |
|
3415 | + ?> |
|
3416 | 3416 | <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section> |
3417 | 3417 | <?php |
3418 | - } |
|
3418 | + } |
|
3419 | 3419 | |
3420 | - $post = $gd_post; |
|
3421 | - if (!empty($gd_post) && is_object($gd_post)) { |
|
3422 | - setup_postdata($gd_post); |
|
3423 | - } |
|
3420 | + $post = $gd_post; |
|
3421 | + if (!empty($gd_post) && is_object($gd_post)) { |
|
3422 | + setup_postdata($gd_post); |
|
3423 | + } |
|
3424 | 3424 | } |
3425 | 3425 | add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2); |
3426 | 3426 | \ No newline at end of file |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | //php |
284 | 284 | if (!empty($tc['geodir_theme_compat_code'])) { |
285 | - include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php'); |
|
285 | + include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php'); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | //geodir_full_page_class |
@@ -452,13 +452,13 @@ discard block |
||
452 | 452 | function geodir_action_wrapper_content_open($type = '', $id = '', $class = '') |
453 | 453 | { |
454 | 454 | if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) { |
455 | - $width_css = 'style="width:' . $width . '%;"'; |
|
455 | + $width_css = 'style="width:'.$width.'%;"'; |
|
456 | 456 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) { |
457 | - $width_css = 'style="width:' . $width . '%;"'; |
|
457 | + $width_css = 'style="width:'.$width.'%;"'; |
|
458 | 458 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) { |
459 | - $width_css = 'style="width:' . $width . '%;"'; |
|
459 | + $width_css = 'style="width:'.$width.'%;"'; |
|
460 | 460 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) { |
461 | - $width_css = 'style="width:' . $width . '%;"'; |
|
461 | + $width_css = 'style="width:'.$width.'%;"'; |
|
462 | 462 | } else { |
463 | 463 | $width_css = ''; |
464 | 464 | } |
@@ -572,13 +572,13 @@ discard block |
||
572 | 572 | function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
573 | 573 | { |
574 | 574 | if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) { |
575 | - $width_css = 'style="width:' . $width . '%;"'; |
|
575 | + $width_css = 'style="width:'.$width.'%;"'; |
|
576 | 576 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) { |
577 | - $width_css = 'style="width:' . $width . '%;"'; |
|
577 | + $width_css = 'style="width:'.$width.'%;"'; |
|
578 | 578 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) { |
579 | - $width_css = 'style="width:' . $width . '%;"'; |
|
579 | + $width_css = 'style="width:'.$width.'%;"'; |
|
580 | 580 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) { |
581 | - $width_css = 'style="width:' . $width . '%;"'; |
|
581 | + $width_css = 'style="width:'.$width.'%;"'; |
|
582 | 582 | } else { |
583 | 583 | $width_css = ''; |
584 | 584 | } |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | } |
677 | 677 | } |
678 | 678 | |
679 | - $post = (object)$_REQUEST; |
|
679 | + $post = (object) $_REQUEST; |
|
680 | 680 | |
681 | 681 | |
682 | 682 | if (isset($post->video)) { |
@@ -735,10 +735,10 @@ discard block |
||
735 | 735 | |
736 | 736 | $json = '{'; |
737 | 737 | $json .= '"post_preview": "1",'; |
738 | - $json .= '"t": "' . $json_title . '",'; |
|
739 | - $json .= '"lt": "' . $post_latitude . '",'; |
|
740 | - $json .= '"ln": "' . $post_longitude . '",'; |
|
741 | - $json .= '"i":"' . $term_icon . '"'; |
|
738 | + $json .= '"t": "'.$json_title.'",'; |
|
739 | + $json .= '"lt": "'.$post_latitude.'",'; |
|
740 | + $json .= '"ln": "'.$post_longitude.'",'; |
|
741 | + $json .= '"i":"'.$term_icon.'"'; |
|
742 | 742 | $json .= '}'; |
743 | 743 | |
744 | 744 | $post->marker_json = $json; |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | * @param string $class The class to use. Default is 'entry-header'. |
966 | 966 | */ |
967 | 967 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
968 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
968 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>'; |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
1020 | 1020 | |
1021 | 1021 | if ($image && $width && $height) { |
1022 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height); |
|
1022 | + $image = (object) array('src' => $image, 'width' => $width, 'height' => $height); |
|
1023 | 1023 | } |
1024 | 1024 | |
1025 | 1025 | if (isset($image->src)) { |
@@ -1031,9 +1031,9 @@ discard block |
||
1031 | 1031 | |
1032 | 1032 | $image_title = isset($image->title) ? $image->title : ''; |
1033 | 1033 | |
1034 | - $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;" />'; |
|
1035 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
1036 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1034 | + $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;" />'; |
|
1035 | + $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>'; |
|
1036 | + $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1037 | 1037 | $slides++; |
1038 | 1038 | } |
1039 | 1039 | } |
@@ -1052,10 +1052,10 @@ discard block |
||
1052 | 1052 | } else { |
1053 | 1053 | $spacer_height = ((400 - $image->height) / 2); |
1054 | 1054 | } |
1055 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
1056 | - $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;" />'; |
|
1057 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
1058 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1055 | + $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
1056 | + $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;" />'; |
|
1057 | + $main_slides .= '<img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
1058 | + $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>'; |
|
1059 | 1059 | $slides++; |
1060 | 1060 | } |
1061 | 1061 | }// endfore |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | */ |
1091 | 1091 | function geodir_action_details_taxonomies() |
1092 | 1092 | { |
1093 | - global $preview, $post;?> |
|
1093 | + global $preview, $post; ?> |
|
1094 | 1094 | <p class="geodir_post_taxomomies clearfix"> |
1095 | 1095 | <?php |
1096 | 1096 | $taxonomies = array(); |
@@ -1099,11 +1099,11 @@ discard block |
||
1099 | 1099 | |
1100 | 1100 | if ($preview && !$is_backend_preview) { |
1101 | 1101 | $post_type = $post->listing_type; |
1102 | - $post_taxonomy = $post_type . 'category'; |
|
1102 | + $post_taxonomy = $post_type.'category'; |
|
1103 | 1103 | $post->{$post_taxonomy} = $post->post_category[$post_taxonomy]; |
1104 | 1104 | } else { |
1105 | 1105 | $post_type = $post->post_type; |
1106 | - $post_taxonomy = $post_type . 'category'; |
|
1106 | + $post_taxonomy = $post_type.'category'; |
|
1107 | 1107 | } |
1108 | 1108 | //{ |
1109 | 1109 | $post_type_info = get_post_type_object($post_type); |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | |
1112 | 1112 | if (!empty($post->post_tags)) { |
1113 | 1113 | |
1114 | - if (taxonomy_exists($post_type . '_tags')): |
|
1114 | + if (taxonomy_exists($post_type.'_tags')): |
|
1115 | 1115 | $links = array(); |
1116 | 1116 | $terms = array(); |
1117 | 1117 | // to limit post tags |
@@ -1138,8 +1138,8 @@ discard block |
||
1138 | 1138 | $post_term = trim($post_term); |
1139 | 1139 | |
1140 | 1140 | $priority_location = false; |
1141 | - if ($insert_term = term_exists($post_term, $post_type . '_tags')) { |
|
1142 | - $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags'); |
|
1141 | + if ($insert_term = term_exists($post_term, $post_type.'_tags')) { |
|
1142 | + $term = get_term_by('id', $insert_term['term_id'], $post_type.'_tags'); |
|
1143 | 1143 | } else { |
1144 | 1144 | $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
1145 | 1145 | $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
@@ -1149,10 +1149,10 @@ discard block |
||
1149 | 1149 | $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
1150 | 1150 | if ($match_country || $match_region || $match_city) { |
1151 | 1151 | $priority_location = true; |
1152 | - $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1152 | + $term = get_term_by('name', $post_term, $post_type.'_tags'); |
|
1153 | 1153 | } else { |
1154 | - $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
1155 | - $term = get_term_by('name', $post_term, $post_type . '_tags'); |
|
1154 | + $insert_term = wp_insert_term($post_term, $post_type.'_tags'); |
|
1155 | + $term = get_term_by('name', $post_term, $post_type.'_tags'); |
|
1156 | 1156 | } |
1157 | 1157 | } |
1158 | 1158 | |
@@ -1169,12 +1169,12 @@ discard block |
||
1169 | 1169 | * @param string $tag_link The tag link html. |
1170 | 1170 | * @param object $term The tag term object. |
1171 | 1171 | */ |
1172 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1172 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term); |
|
1173 | 1173 | $links[] = $tag_link; |
1174 | 1174 | } else { |
1175 | - $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
1175 | + $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>"; |
|
1176 | 1176 | /** This action is documented in geodirectory-template_actions.php */ |
1177 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term); |
|
1177 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term); |
|
1178 | 1178 | $links[] = $tag_link; |
1179 | 1179 | } |
1180 | 1180 | $terms[] = $term; |
@@ -1184,7 +1184,7 @@ discard block |
||
1184 | 1184 | if (!isset($listing_label)) { |
1185 | 1185 | $listing_label = ''; |
1186 | 1186 | } |
1187 | - $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1187 | + $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms); |
|
1188 | 1188 | endif; |
1189 | 1189 | |
1190 | 1190 | } |
@@ -1212,7 +1212,7 @@ discard block |
||
1212 | 1212 | $term = get_term_by('id', $post_term, $post_taxonomy); |
1213 | 1213 | |
1214 | 1214 | if (is_object($term)) { |
1215 | - $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
1215 | + $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>"; |
|
1216 | 1216 | /** |
1217 | 1217 | * Filter the category name on the details page. |
1218 | 1218 | * |
@@ -1220,7 +1220,7 @@ discard block |
||
1220 | 1220 | * @param string $term_link The link html to the category. |
1221 | 1221 | * @param object $term The category term object. |
1222 | 1222 | */ |
1223 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term); |
|
1223 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term); |
|
1224 | 1224 | $links[] = $term_link; |
1225 | 1225 | $terms[] = $term; |
1226 | 1226 | } |
@@ -1238,7 +1238,7 @@ discard block |
||
1238 | 1238 | if (!isset($listing_label)) { |
1239 | 1239 | $listing_label = ''; |
1240 | 1240 | } |
1241 | - $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms); |
|
1241 | + $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms); |
|
1242 | 1242 | |
1243 | 1243 | } |
1244 | 1244 | |
@@ -1251,14 +1251,14 @@ discard block |
||
1251 | 1251 | * @param string $listing_label The post type label. |
1252 | 1252 | * @param string $listing_label The post type label with ucwords function. |
1253 | 1253 | */ |
1254 | - $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label)); |
|
1254 | + $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label)); |
|
1255 | 1255 | |
1256 | 1256 | if (isset($taxonomies[$post_taxonomy])) { |
1257 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
1257 | + echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>'; |
|
1258 | 1258 | } |
1259 | 1259 | |
1260 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
1261 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
1260 | + if (isset($taxonomies[$post_type.'_tags'])) |
|
1261 | + echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>'; |
|
1262 | 1262 | |
1263 | 1263 | ?> |
1264 | 1264 | </p><?php |
@@ -1279,11 +1279,11 @@ discard block |
||
1279 | 1279 | * @param object $post Optional. The post object or blank. |
1280 | 1280 | * @package GeoDirectory |
1281 | 1281 | */ |
1282 | -function geodir_action_details_micordata($post='') |
|
1282 | +function geodir_action_details_micordata($post = '') |
|
1283 | 1283 | { |
1284 | 1284 | |
1285 | 1285 | global $preview; |
1286 | - if(empty($post)){global $post;} |
|
1286 | + if (empty($post)) {global $post; } |
|
1287 | 1287 | if ($preview || !geodir_is_page('detail')) { |
1288 | 1288 | return; |
1289 | 1289 | } |
@@ -1304,7 +1304,7 @@ discard block |
||
1304 | 1304 | "description" => $review->comment_content, |
1305 | 1305 | "reviewRating" => array( |
1306 | 1306 | "@type" => "Rating", |
1307 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
1307 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
1308 | 1308 | "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
1309 | 1309 | "worstRating" => "1" |
1310 | 1310 | ) |
@@ -1332,13 +1332,13 @@ discard block |
||
1332 | 1332 | } |
1333 | 1333 | //print_r($post); |
1334 | 1334 | // external links |
1335 | - $external_links = array(); |
|
1335 | + $external_links = array(); |
|
1336 | 1336 | $external_links[] = $post->geodir_website; |
1337 | 1337 | $external_links[] = $post->geodir_twitter; |
1338 | 1338 | $external_links[] = $post->geodir_facebook; |
1339 | 1339 | $external_links = array_filter($external_links); |
1340 | 1340 | |
1341 | - if(!empty($external_links)){ |
|
1341 | + if (!empty($external_links)) { |
|
1342 | 1342 | $external_links = array_values($external_links); |
1343 | 1343 | } |
1344 | 1344 | |
@@ -1348,17 +1348,17 @@ discard block |
||
1348 | 1348 | |
1349 | 1349 | // schema type |
1350 | 1350 | $schema_type = 'LocalBusiness'; |
1351 | - if(isset($post->default_category) && $post->default_category){ |
|
1351 | + if (isset($post->default_category) && $post->default_category) { |
|
1352 | 1352 | $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
1353 | - if($cat_schema){$schema_type = $cat_schema;} |
|
1354 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';} |
|
1353 | + if ($cat_schema) {$schema_type = $cat_schema; } |
|
1354 | + if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; } |
|
1355 | 1355 | } |
1356 | 1356 | |
1357 | 1357 | $schema = array(); |
1358 | 1358 | $schema['@context'] = "http://schema.org"; |
1359 | 1359 | $schema['@type'] = $schema_type; |
1360 | 1360 | $schema['name'] = $post->post_name; |
1361 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
1361 | + $schema['description'] = wp_strip_all_tags($post->post_content, true); |
|
1362 | 1362 | $schema['telephone'] = $post->geodir_contact; |
1363 | 1363 | $schema['url'] = $c_url; |
1364 | 1364 | $schema['sameAs'] = $external_links; |
@@ -1372,7 +1372,7 @@ discard block |
||
1372 | 1372 | "postalCode" => $post->post_zip |
1373 | 1373 | ); |
1374 | 1374 | |
1375 | - if($post->post_latitude && $post->post_longitude) { |
|
1375 | + if ($post->post_latitude && $post->post_longitude) { |
|
1376 | 1376 | $schema['geo'] = array( |
1377 | 1377 | "@type" => "GeoCoordinates", |
1378 | 1378 | "latitude" => $post->post_latitude, |
@@ -1380,7 +1380,7 @@ discard block |
||
1380 | 1380 | ); |
1381 | 1381 | } |
1382 | 1382 | |
1383 | - if($post_avgratings) { |
|
1383 | + if ($post_avgratings) { |
|
1384 | 1384 | $schema['aggregateRating'] = array( |
1385 | 1385 | "@type" => "AggregateRating", |
1386 | 1386 | "ratingValue" => $post_avgratings, |
@@ -1399,10 +1399,10 @@ discard block |
||
1399 | 1399 | * @param array $schema The array of schema data to be filtered. |
1400 | 1400 | * @param object $post The post object. |
1401 | 1401 | */ |
1402 | - $schema = apply_filters('geodir_details_schema', $schema,$post); |
|
1402 | + $schema = apply_filters('geodir_details_schema', $schema, $post); |
|
1403 | 1403 | |
1404 | 1404 | |
1405 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
1405 | + echo '<script type="application/ld+json">'.json_encode($schema).'</script>'; |
|
1406 | 1406 | |
1407 | 1407 | } |
1408 | 1408 | |
@@ -1423,9 +1423,9 @@ discard block |
||
1423 | 1423 | ?> |
1424 | 1424 | <div class="geodir-pos_navigation clearfix"> |
1425 | 1425 | <div |
1426 | - class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div> |
|
1426 | + class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div> |
|
1427 | 1427 | <div |
1428 | - class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div> |
|
1428 | + class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div> |
|
1429 | 1429 | </div><?php |
1430 | 1430 | } |
1431 | 1431 | |
@@ -1494,12 +1494,12 @@ discard block |
||
1494 | 1494 | $gd_post_type = geodir_get_current_posttype(); |
1495 | 1495 | $post_type_info = get_post_type_object($gd_post_type); |
1496 | 1496 | |
1497 | - $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
1497 | + $add_string_in_title = __('All', 'geodirectory').' '; |
|
1498 | 1498 | if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
1499 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
1499 | + $add_string_in_title = __('My Favorite', 'geodirectory').' '; |
|
1500 | 1500 | } |
1501 | 1501 | |
1502 | - $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
1502 | + $list_title = $add_string_in_title.__(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
1503 | 1503 | $single_name = $post_type_info->labels->singular_name; |
1504 | 1504 | |
1505 | 1505 | $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
@@ -1527,12 +1527,12 @@ discard block |
||
1527 | 1527 | $current_term = get_term_by('slug', $term, $taxonomy[0]); |
1528 | 1528 | if (!empty($current_term)) { |
1529 | 1529 | $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
1530 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1530 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') { |
|
1531 | 1531 | $location_last_char = substr($location_name, -1); |
1532 | 1532 | $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
1533 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1533 | + $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name; |
|
1534 | 1534 | } else { |
1535 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1535 | + $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'"; |
|
1536 | 1536 | } |
1537 | 1537 | } else { |
1538 | 1538 | if (count($taxonomy) > 1) { |
@@ -1540,12 +1540,12 @@ discard block |
||
1540 | 1540 | |
1541 | 1541 | if (!empty($current_term)) { |
1542 | 1542 | $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
1543 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') { |
|
1543 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') { |
|
1544 | 1544 | $location_last_char = substr($location_name, -1); |
1545 | 1545 | $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory'); |
1546 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name; |
|
1546 | + $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name; |
|
1547 | 1547 | } else { |
1548 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'"; |
|
1548 | + $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'"; |
|
1549 | 1549 | } |
1550 | 1550 | } |
1551 | 1551 | } |
@@ -1573,7 +1573,7 @@ discard block |
||
1573 | 1573 | $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
1574 | 1574 | } |
1575 | 1575 | |
1576 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'"; |
|
1576 | + $list_title .= __(' in', 'geodirectory')." '".$gd_city."'"; |
|
1577 | 1577 | } else if ($gd_region != '') { |
1578 | 1578 | if ($gd_region_actual != '') { |
1579 | 1579 | $gd_region = $gd_region_actual; |
@@ -1583,7 +1583,7 @@ discard block |
||
1583 | 1583 | $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
1584 | 1584 | } |
1585 | 1585 | |
1586 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'"; |
|
1586 | + $list_title .= __(' in', 'geodirectory')." '".$gd_region."'"; |
|
1587 | 1587 | } else if ($gd_country != '') { |
1588 | 1588 | if ($gd_country_actual != '') { |
1589 | 1589 | $gd_country = $gd_country_actual; |
@@ -1593,12 +1593,12 @@ discard block |
||
1593 | 1593 | $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
1594 | 1594 | } |
1595 | 1595 | |
1596 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'"; |
|
1596 | + $list_title .= __(' in', 'geodirectory')." '".$gd_country."'"; |
|
1597 | 1597 | } |
1598 | 1598 | } |
1599 | 1599 | |
1600 | 1600 | if (is_search()) { |
1601 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
1601 | + $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'"; |
|
1602 | 1602 | } |
1603 | 1603 | /** This action is documented in geodirectory_template_actions.php */ |
1604 | 1604 | $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
@@ -1607,26 +1607,26 @@ discard block |
||
1607 | 1607 | |
1608 | 1608 | |
1609 | 1609 | $title = $list_title; |
1610 | - if(geodir_is_page('pt')){ |
|
1610 | + if (geodir_is_page('pt')) { |
|
1611 | 1611 | $gd_page = 'pt'; |
1612 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title; |
|
1612 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title; |
|
1613 | 1613 | } |
1614 | - elseif(geodir_is_page('listing')){ |
|
1614 | + elseif (geodir_is_page('listing')) { |
|
1615 | 1615 | $gd_page = 'listing'; |
1616 | 1616 | global $wp_query; |
1617 | 1617 | $current_term = $wp_query->get_queried_object(); |
1618 | - if (strpos($current_term->taxonomy,'_tags') !== false) { |
|
1618 | + if (strpos($current_term->taxonomy, '_tags') !== false) { |
|
1619 | 1619 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title; |
1620 | - }else{ |
|
1620 | + } else { |
|
1621 | 1621 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title; |
1622 | 1622 | } |
1623 | 1623 | |
1624 | 1624 | } |
1625 | - elseif(geodir_is_page('author')){ |
|
1625 | + elseif (geodir_is_page('author')) { |
|
1626 | 1626 | $gd_page = 'author'; |
1627 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
1627 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
1628 | 1628 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
1629 | - }else{ |
|
1629 | + } else { |
|
1630 | 1630 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
1631 | 1631 | } |
1632 | 1632 | |
@@ -1640,16 +1640,16 @@ discard block |
||
1640 | 1640 | * @param string $title The page title including variables. |
1641 | 1641 | * @param string $gd_page The GeoDirectory page type if any. |
1642 | 1642 | */ |
1643 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
1643 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
1644 | 1644 | |
1645 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
1645 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
1646 | 1646 | /** |
1647 | 1647 | * Filter the listing page title. |
1648 | 1648 | * |
1649 | 1649 | * @since 1.0.0 |
1650 | 1650 | * @param string $list_title The title for the category page. |
1651 | 1651 | */ |
1652 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>'; |
|
1652 | + apply_filters('geodir_listing_page_title', $title).'</h1></header>'; |
|
1653 | 1653 | } |
1654 | 1654 | |
1655 | 1655 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10); |
@@ -1668,7 +1668,7 @@ discard block |
||
1668 | 1668 | $gd_post_type = geodir_get_current_posttype(); |
1669 | 1669 | if (isset($current_term->term_id) && $current_term->term_id != '') { |
1670 | 1670 | |
1671 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
1671 | + $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags'); |
|
1672 | 1672 | $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
1673 | 1673 | if ($term_desc && !$saved_data) { |
1674 | 1674 | $saved_data = $term_desc; |
@@ -1685,7 +1685,7 @@ discard block |
||
1685 | 1685 | if ($cat_description) { |
1686 | 1686 | ?> |
1687 | 1687 | |
1688 | - <div class="term_description"><?php echo $cat_description;?></div> <?php |
|
1688 | + <div class="term_description"><?php echo $cat_description; ?></div> <?php |
|
1689 | 1689 | } |
1690 | 1690 | |
1691 | 1691 | } |
@@ -1735,13 +1735,13 @@ discard block |
||
1735 | 1735 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
1736 | 1736 | { |
1737 | 1737 | if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) { |
1738 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1738 | + $width_css = 'style="width:'.$width.'%;"'; |
|
1739 | 1739 | } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) { |
1740 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1740 | + $width_css = 'style="width:'.$width.'%;"'; |
|
1741 | 1741 | } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) { |
1742 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1742 | + $width_css = 'style="width:'.$width.'%;"'; |
|
1743 | 1743 | } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) { |
1744 | - $width_css = 'style="width:' . $width . '%;"'; |
|
1744 | + $width_css = 'style="width:'.$width.'%;"'; |
|
1745 | 1745 | } else { |
1746 | 1746 | $width_css = ''; |
1747 | 1747 | } |
@@ -2046,11 +2046,11 @@ discard block |
||
2046 | 2046 | |
2047 | 2047 | $title = apply_filters('geodir_add_listing_page_title_text', get_the_title()); |
2048 | 2048 | |
2049 | - if(geodir_is_page('add-listing')){ |
|
2049 | + if (geodir_is_page('add-listing')) { |
|
2050 | 2050 | $gd_page = 'add-listing'; |
2051 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){ |
|
2051 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
2052 | 2052 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title; |
2053 | - }elseif(isset($listing_type)){ |
|
2053 | + }elseif (isset($listing_type)) { |
|
2054 | 2054 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title; |
2055 | 2055 | } |
2056 | 2056 | |
@@ -2064,9 +2064,9 @@ discard block |
||
2064 | 2064 | * @param string $title The page title including variables. |
2065 | 2065 | * @param string $gd_page The GeoDirectory page type if any. |
2066 | 2066 | */ |
2067 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2067 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2068 | 2068 | |
2069 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
2069 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'; |
|
2070 | 2070 | echo $title; |
2071 | 2071 | echo '</h1></header>'; |
2072 | 2072 | } |
@@ -2080,7 +2080,7 @@ discard block |
||
2080 | 2080 | */ |
2081 | 2081 | function geodir_action_add_listing_page_mandatory() |
2082 | 2082 | {?> |
2083 | - <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p> |
|
2083 | + <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p> |
|
2084 | 2084 | <?php |
2085 | 2085 | } |
2086 | 2086 | |
@@ -2115,7 +2115,7 @@ discard block |
||
2115 | 2115 | |
2116 | 2116 | if (isset($_REQUEST['backandedit'])) { |
2117 | 2117 | global $post; |
2118 | - $post = (object)$gd_session->get('listing'); |
|
2118 | + $post = (object) $gd_session->get('listing'); |
|
2119 | 2119 | $listing_type = $post->listing_type; |
2120 | 2120 | $title = $post->post_title; |
2121 | 2121 | $desc = $post->post_desc; |
@@ -2130,7 +2130,7 @@ discard block |
||
2130 | 2130 | $thumb_img_arr = geodir_get_images($post->ID); |
2131 | 2131 | if ($thumb_img_arr) { |
2132 | 2132 | foreach ($thumb_img_arr as $post_img) { |
2133 | - $curImages .= $post_img->src . ','; |
|
2133 | + $curImages .= $post_img->src.','; |
|
2134 | 2134 | } |
2135 | 2135 | } |
2136 | 2136 | |
@@ -2138,7 +2138,7 @@ discard block |
||
2138 | 2138 | $title = $post->post_title; |
2139 | 2139 | $desc = $post->post_content; |
2140 | 2140 | $kw_tags = $post->post_tags; |
2141 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names'))); |
|
2141 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names'))); |
|
2142 | 2142 | } else { |
2143 | 2143 | $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
2144 | 2144 | } |
@@ -2149,18 +2149,18 @@ discard block |
||
2149 | 2149 | |
2150 | 2150 | $post_type_info = geodir_get_posttype_info($listing_type); |
2151 | 2151 | |
2152 | - $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory'); |
|
2152 | + $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing', 'geodirectory'); |
|
2153 | 2153 | |
2154 | 2154 | ?> |
2155 | - <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
|
2156 | - <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
2157 | - <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
2155 | + <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data"> |
|
2156 | + <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
2157 | + <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
2158 | 2158 | <?php if ($page_id) { ?> |
2159 | - <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/> |
|
2159 | + <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/> |
|
2160 | 2160 | <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?> |
2161 | - <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/> |
|
2161 | + <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/> |
|
2162 | 2162 | <?php } if (isset($_REQUEST['backandedit'])) { ?> |
2163 | - <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
|
2163 | + <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/> |
|
2164 | 2164 | <?php |
2165 | 2165 | } |
2166 | 2166 | /** |
@@ -2172,7 +2172,7 @@ discard block |
||
2172 | 2172 | */ |
2173 | 2173 | do_action('geodir_before_detail_fields'); |
2174 | 2174 | ?> |
2175 | - <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
|
2175 | + <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5> |
|
2176 | 2176 | <?php |
2177 | 2177 | /** |
2178 | 2178 | * Called at the top of the add listing page form for frontend. |
@@ -2184,10 +2184,10 @@ discard block |
||
2184 | 2184 | do_action('geodir_before_main_form_fields'); |
2185 | 2185 | ?> |
2186 | 2186 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
2187 | - <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label> |
|
2187 | + <label><?php echo sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name); ?><span>*</span> </label> |
|
2188 | 2188 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
2189 | 2189 | value="<?php echo esc_attr(stripslashes($title)); ?>"/> |
2190 | - <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
|
2190 | + <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
|
2191 | 2191 | </div> |
2192 | 2192 | <?php |
2193 | 2193 | $show_editor = get_option('geodir_tiny_editor_on_add_listing'); |
@@ -2222,7 +2222,7 @@ discard block |
||
2222 | 2222 | $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit); |
2223 | 2223 | |
2224 | 2224 | $desc_class = ''; |
2225 | - if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2225 | + if ($desc_limit === '' || (int) $desc_limit > 0) { |
|
2226 | 2226 | /** |
2227 | 2227 | * Called on the add listing page form for frontend just before the description field. |
2228 | 2228 | * |
@@ -2235,8 +2235,8 @@ discard block |
||
2235 | 2235 | $desc_class = ' hidden'; |
2236 | 2236 | } |
2237 | 2237 | ?> |
2238 | - <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
|
2239 | - <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label> |
|
2238 | + <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>"> |
|
2239 | + <label><?php echo sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label> |
|
2240 | 2240 | <?php |
2241 | 2241 | if (!empty($show_editor) && in_array($listing_type, $show_editor)) { |
2242 | 2242 | $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); |
@@ -2245,16 +2245,16 @@ discard block |
||
2245 | 2245 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
2246 | 2246 | </div> |
2247 | 2247 | <?php if ($desc_limit != '') { ?> |
2248 | - <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script> |
|
2248 | + <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script> |
|
2249 | 2249 | <?php } } else { ?> |
2250 | 2250 | <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea> |
2251 | 2251 | <?php } if ($desc_limit_msg != '') { ?> |
2252 | 2252 | <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span> |
2253 | 2253 | <?php } ?> |
2254 | - <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
|
2254 | + <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span> |
|
2255 | 2255 | </div> |
2256 | 2256 | <?php |
2257 | - if ($desc_limit === '' || (int)$desc_limit > 0) { |
|
2257 | + if ($desc_limit === '' || (int) $desc_limit > 0) { |
|
2258 | 2258 | /** |
2259 | 2259 | * Called on the add listing page form for frontend just after the description field. |
2260 | 2260 | * |
@@ -2293,7 +2293,7 @@ discard block |
||
2293 | 2293 | $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count); |
2294 | 2294 | |
2295 | 2295 | $tags_class = ''; |
2296 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2296 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) { |
|
2297 | 2297 | /** |
2298 | 2298 | * Called on the add listing page form for frontend just before the tags field. |
2299 | 2299 | * |
@@ -2304,14 +2304,14 @@ discard block |
||
2304 | 2304 | $tags_class = ' hidden'; |
2305 | 2305 | } |
2306 | 2306 | ?> |
2307 | - <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
|
2307 | + <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>"> |
|
2308 | 2308 | <label><?php echo TAGKW_TEXT; ?></label> |
2309 | 2309 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
2310 | - maxlength="<?php echo $kw_tags_count;?>"/> |
|
2311 | - <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
|
2310 | + maxlength="<?php echo $kw_tags_count; ?>"/> |
|
2311 | + <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span> |
|
2312 | 2312 | </div> |
2313 | 2313 | <?php |
2314 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) { |
|
2314 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) { |
|
2315 | 2315 | /** |
2316 | 2316 | * Called on the add listing page form for frontend just after the tags field. |
2317 | 2317 | * |
@@ -2337,7 +2337,7 @@ discard block |
||
2337 | 2337 | $thumb_img_arr = array(); |
2338 | 2338 | $totImg = 0; |
2339 | 2339 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) { |
2340 | - $post = (object)$gd_session->get('listing'); |
|
2340 | + $post = (object) $gd_session->get('listing'); |
|
2341 | 2341 | if (isset($post->post_images)) |
2342 | 2342 | $curImages = trim($post->post_images, ","); |
2343 | 2343 | |
@@ -2350,7 +2350,7 @@ discard block |
||
2350 | 2350 | $listing_type = $post->listing_type; |
2351 | 2351 | |
2352 | 2352 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
2353 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
2353 | + $post = geodir_get_post_info((int) $_REQUEST['pid']); |
|
2354 | 2354 | $listing_type = $post->post_type; |
2355 | 2355 | $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
2356 | 2356 | |
@@ -2364,7 +2364,7 @@ discard block |
||
2364 | 2364 | //$curImages = $img->src.","; |
2365 | 2365 | } |
2366 | 2366 | |
2367 | - $totImg = count((array)$thumb_img_arr); |
|
2367 | + $totImg = count((array) $thumb_img_arr); |
|
2368 | 2368 | } |
2369 | 2369 | |
2370 | 2370 | if ($curImages != '') |
@@ -2385,15 +2385,15 @@ discard block |
||
2385 | 2385 | if ($show_image_input_box) { |
2386 | 2386 | ?> |
2387 | 2387 | |
2388 | - <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
|
2388 | + <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?> |
|
2389 | 2389 | <?php if ($image_limit == 1) { |
2390 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>'; |
|
2390 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>'; |
|
2391 | 2391 | } ?> |
2392 | 2392 | <?php if ($image_limit > 1) { |
2393 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>'; |
|
2393 | + echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>'; |
|
2394 | 2394 | } ?> |
2395 | 2395 | <?php if ($image_limit == '') { |
2396 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>'; |
|
2396 | + echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>'; |
|
2397 | 2397 | } ?> |
2398 | 2398 | </h5> |
2399 | 2399 | |
@@ -2408,11 +2408,11 @@ discard block |
||
2408 | 2408 | <div |
2409 | 2409 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
2410 | 2410 | id="<?php echo $id; ?>plupload-upload-ui"> |
2411 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/> |
|
2411 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/> |
|
2412 | 2412 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
2413 | 2413 | value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/> |
2414 | 2414 | <span class="ajaxnonceplu" |
2415 | - id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span> |
|
2415 | + id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span> |
|
2416 | 2416 | <?php if ($width && $height): ?> |
2417 | 2417 | <span class="plupload-resize"></span> |
2418 | 2418 | <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span> |
@@ -2425,7 +2425,7 @@ discard block |
||
2425 | 2425 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
2426 | 2426 | </div> |
2427 | 2427 | <span |
2428 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span> |
|
2428 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span> |
|
2429 | 2429 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
2430 | 2430 | </div> |
2431 | 2431 | |
@@ -2437,7 +2437,7 @@ discard block |
||
2437 | 2437 | * |
2438 | 2438 | * @since 1.0.0 |
2439 | 2439 | */ |
2440 | - do_action('geodir_after_main_form_fields');?> |
|
2440 | + do_action('geodir_after_main_form_fields'); ?> |
|
2441 | 2441 | |
2442 | 2442 | |
2443 | 2443 | <!-- add captcha code --> |
@@ -2448,7 +2448,7 @@ discard block |
||
2448 | 2448 | </script> |
2449 | 2449 | <noscript> |
2450 | 2450 | <div> |
2451 | - <label><?php _e('Type 64 into this box', 'geodirectory');?></label> |
|
2451 | + <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label> |
|
2452 | 2452 | <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/> |
2453 | 2453 | </div> |
2454 | 2454 | </noscript> |
@@ -2458,10 +2458,10 @@ discard block |
||
2458 | 2458 | <!-- end captcha code --> |
2459 | 2459 | |
2460 | 2460 | <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;"> |
2461 | - <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>" |
|
2462 | - class="geodir_button" <?php echo $submit_button;?>/> |
|
2461 | + <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>" |
|
2462 | + class="geodir_button" <?php echo $submit_button; ?>/> |
|
2463 | 2463 | <span class="geodir_message_note" |
2464 | - style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span> |
|
2464 | + style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span> |
|
2465 | 2465 | </div> |
2466 | 2466 | |
2467 | 2467 | </form> |
@@ -2523,7 +2523,7 @@ discard block |
||
2523 | 2523 | class="<?php |
2524 | 2524 | /** This action is documented in geodirectory_template_actions.php */ |
2525 | 2525 | echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>"> |
2526 | - <?php dynamic_sidebar('Reg/Login Top Section');?> |
|
2526 | + <?php dynamic_sidebar('Reg/Login Top Section'); ?> |
|
2527 | 2527 | </div><!-- clearfix ends here--> |
2528 | 2528 | <?php |
2529 | 2529 | } |
@@ -2545,7 +2545,7 @@ discard block |
||
2545 | 2545 | |
2546 | 2546 | ?> |
2547 | 2547 | <script type="text/javascript"> |
2548 | - <?php if ( $user_login ) { ?> |
|
2548 | + <?php if ($user_login) { ?> |
|
2549 | 2549 | setTimeout(function () { |
2550 | 2550 | try { |
2551 | 2551 | d = document.getElementById('user_pass'); |
@@ -2562,7 +2562,7 @@ discard block |
||
2562 | 2562 | <?php } ?> |
2563 | 2563 | </script> |
2564 | 2564 | <script type="text/javascript"> |
2565 | - <?php if ( $user_login ) { ?> |
|
2565 | + <?php if ($user_login) { ?> |
|
2566 | 2566 | setTimeout(function () { |
2567 | 2567 | try { |
2568 | 2568 | d = document.getElementById('user_pass'); |
@@ -2587,7 +2587,7 @@ discard block |
||
2587 | 2587 | foreach ($errors as $errorsObj) { |
2588 | 2588 | foreach ($errorsObj as $key => $val) { |
2589 | 2589 | for ($i = 0; $i < count($val); $i++) { |
2590 | - echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
2590 | + echo "<div class=sucess_msg>".$val[$i].'</div>'; |
|
2591 | 2591 | $registration_error_msg = 1; |
2592 | 2592 | } |
2593 | 2593 | } |
@@ -2604,7 +2604,7 @@ discard block |
||
2604 | 2604 | * |
2605 | 2605 | * @since 1.0.0 |
2606 | 2606 | */ |
2607 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2607 | + include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?> |
|
2608 | 2608 | </div> |
2609 | 2609 | |
2610 | 2610 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?> |
@@ -2616,7 +2616,7 @@ discard block |
||
2616 | 2616 | * |
2617 | 2617 | * @since 1.0.0 |
2618 | 2618 | */ |
2619 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2619 | + include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?> |
|
2620 | 2620 | </div> |
2621 | 2621 | |
2622 | 2622 | <?php } else { ?> |
@@ -2628,7 +2628,7 @@ discard block |
||
2628 | 2628 | * |
2629 | 2629 | * @since 1.0.0 |
2630 | 2630 | */ |
2631 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
2631 | + include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?> |
|
2632 | 2632 | </div> |
2633 | 2633 | <div class="registration_form_r"> |
2634 | 2634 | <?php |
@@ -2637,7 +2637,7 @@ discard block |
||
2637 | 2637 | * |
2638 | 2638 | * @since 1.0.0 |
2639 | 2639 | */ |
2640 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
2640 | + include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?> |
|
2641 | 2641 | </div> |
2642 | 2642 | |
2643 | 2643 | <?php }?> |
@@ -2673,12 +2673,12 @@ discard block |
||
2673 | 2673 | $gd_post_type = geodir_get_current_posttype(); |
2674 | 2674 | $post_type_info = get_post_type_object($gd_post_type); |
2675 | 2675 | |
2676 | - $add_string_in_title = __('All', 'geodirectory') . ' '; |
|
2676 | + $add_string_in_title = __('All', 'geodirectory').' '; |
|
2677 | 2677 | if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
2678 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' '; |
|
2678 | + $add_string_in_title = __('My Favorite', 'geodirectory').' '; |
|
2679 | 2679 | } |
2680 | 2680 | |
2681 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
2681 | + $list_title = $add_string_in_title.$post_type_info->labels->name; |
|
2682 | 2682 | $single_name = $post_type_info->labels->singular_name; |
2683 | 2683 | |
2684 | 2684 | $taxonomy = geodir_get_taxonomies($gd_post_type); |
@@ -2686,12 +2686,12 @@ discard block |
||
2686 | 2686 | if (!empty($term)) { |
2687 | 2687 | $current_term = get_term_by('slug', $term, $taxonomy[0]); |
2688 | 2688 | if (!empty($current_term)) |
2689 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
2689 | + $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'"; |
|
2690 | 2690 | } |
2691 | 2691 | |
2692 | 2692 | |
2693 | 2693 | if (is_search()) { |
2694 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2694 | + $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'"; |
|
2695 | 2695 | |
2696 | 2696 | } |
2697 | 2697 | /** This action is documented in geodirectory_template_actions.php */ |
@@ -2700,11 +2700,11 @@ discard block |
||
2700 | 2700 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
2701 | 2701 | |
2702 | 2702 | $title = $list_title; |
2703 | - if(geodir_is_page('author')){ |
|
2703 | + if (geodir_is_page('author')) { |
|
2704 | 2704 | $gd_page = 'author'; |
2705 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){ |
|
2705 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') { |
|
2706 | 2706 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title; |
2707 | - }else{ |
|
2707 | + } else { |
|
2708 | 2708 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title; |
2709 | 2709 | } |
2710 | 2710 | |
@@ -2718,16 +2718,16 @@ discard block |
||
2718 | 2718 | * @param string $title The page title including variables. |
2719 | 2719 | * @param string $gd_page The GeoDirectory page type if any. |
2720 | 2720 | */ |
2721 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2721 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page); |
|
2722 | 2722 | |
2723 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2723 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
2724 | 2724 | /** |
2725 | 2725 | * Filter the author page title text. |
2726 | 2726 | * |
2727 | 2727 | * @since 1.0.0 |
2728 | 2728 | * @param string $list_title The title for the page. |
2729 | 2729 | */ |
2730 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>'; |
|
2730 | + apply_filters('geodir_author_page_title_text', $title).'</h1></header>'; |
|
2731 | 2731 | } |
2732 | 2732 | |
2733 | 2733 | |
@@ -2932,19 +2932,19 @@ discard block |
||
2932 | 2932 | $post_type_info = get_post_type_object($gd_post_type); |
2933 | 2933 | |
2934 | 2934 | $pt_name = ''; |
2935 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;} |
|
2935 | + if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; } |
|
2936 | 2936 | |
2937 | 2937 | if (is_search()) { |
2938 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'"; |
|
2938 | + $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'"; |
|
2939 | 2939 | |
2940 | 2940 | } |
2941 | 2941 | /** This action is documented in geodirectory_template_actions.php */ |
2942 | 2942 | $class = apply_filters('geodir_page_title_class', 'entry-title fn'); |
2943 | 2943 | /** This action is documented in geodirectory_template_actions.php */ |
2944 | 2944 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header'); |
2945 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
2945 | + echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'. |
|
2946 | 2946 | /** This action is documented in geodirectory_template_actions.php */ |
2947 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>'; |
|
2947 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>'; |
|
2948 | 2948 | } |
2949 | 2949 | |
2950 | 2950 | // action for adding the listings page top widget area |
@@ -3348,7 +3348,7 @@ discard block |
||
3348 | 3348 | $gd_post_type = geodir_get_current_posttype(); |
3349 | 3349 | $post_type_info = get_post_type_object($gd_post_type); |
3350 | 3350 | |
3351 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory'); |
|
3351 | + $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory'); |
|
3352 | 3352 | } |
3353 | 3353 | return $list_title; |
3354 | 3354 | } |
@@ -3364,7 +3364,7 @@ discard block |
||
3364 | 3364 | * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'. |
3365 | 3365 | * @param string $gd_page The geodirectory page type. Default null. |
3366 | 3366 | */ |
3367 | -function geodir_add_page_content( $position = 'before', $gd_page = '' ) { |
|
3367 | +function geodir_add_page_content($position = 'before', $gd_page = '') { |
|
3368 | 3368 | global $post; |
3369 | 3369 | |
3370 | 3370 | $gd_page_id = NULL; |