Passed
Pull Request — master (#261)
by Viruthagiri
09:40
created
geodirectory_template_actions.php 3 patches
Braces   +31 added lines, -24 removed lines patch added patch discarded remove patch
@@ -714,8 +714,9 @@  discard block
 block discarded – undo
714 714
 
715 715
                         if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716 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'];
717
+                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') {
718
+                                                                    $term_icon = $term_icon_url['src'];
719
+                                }
719 720
                                 break;
720 721
                             }
721 722
                         }
@@ -1246,8 +1247,9 @@  discard block
 block discarded – undo
1246 1247
         echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1247 1248
     }
1248 1249
 
1249
-    if (isset($taxonomies[$post_type . '_tags']))
1250
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1250
+    if (isset($taxonomies[$post_type . '_tags'])) {
1251
+            echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1252
+    }
1251 1253
 
1252 1254
     ?>
1253 1255
     </p><?php
@@ -1598,23 +1600,21 @@  discard block
 block discarded – undo
1598 1600
     if(geodir_is_page('pt')){
1599 1601
         $gd_page = 'pt';
1600 1602
         $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1601
-    }
1602
-    elseif(geodir_is_page('listing')){
1603
+    } elseif(geodir_is_page('listing')){
1603 1604
         $gd_page = 'listing';
1604 1605
         global $wp_query;
1605 1606
         $current_term = $wp_query->get_queried_object();
1606 1607
         if (strpos($current_term->taxonomy,'_tags') !== false) {
1607 1608
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1608
-        }else{
1609
+        } else{
1609 1610
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1610 1611
         }
1611 1612
 
1612
-    }
1613
-    elseif(geodir_is_page('author')){
1613
+    } elseif(geodir_is_page('author')){
1614 1614
         $gd_page = 'author';
1615 1615
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1616 1616
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1617
-        }else{
1617
+        } else{
1618 1618
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1619 1619
         }
1620 1620
 
@@ -2025,8 +2025,9 @@  discard block
 block discarded – undo
2025 2025
  */
2026 2026
 function geodir_action_add_listing_page_title()
2027 2027
 {
2028
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2029
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2028
+    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') {
2029
+            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2030
+    }
2030 2031
     /** This action is documented in geodirectory_template_actions.php */
2031 2032
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2032 2033
     /** This action is documented in geodirectory_template_actions.php */
@@ -2038,7 +2039,7 @@  discard block
 block discarded – undo
2038 2039
         $gd_page = 'add-listing';
2039 2040
         if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2040 2041
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2041
-        }elseif(isset($listing_type)){
2042
+        } elseif(isset($listing_type)){
2042 2043
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2043 2044
         }
2044 2045
 
@@ -2321,8 +2322,9 @@  discard block
 block discarded – undo
2321 2322
         $totImg = 0;
2322 2323
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2323 2324
             $post = (object)$gd_session->get('listing');
2324
-            if (isset($post->post_images))
2325
-                $curImages = trim($post->post_images, ",");
2325
+            if (isset($post->post_images)) {
2326
+                            $curImages = trim($post->post_images, ",");
2327
+            }
2326 2328
 
2327 2329
 
2328 2330
             if ($curImages != '') {
@@ -2350,10 +2352,13 @@  discard block
 block discarded – undo
2350 2352
             $totImg = count((array)$thumb_img_arr);
2351 2353
         }
2352 2354
 
2353
-        if ($curImages != '')
2354
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2355
-        else
2356
-            $svalue = '';
2355
+        if ($curImages != '') {
2356
+                    $svalue = $curImages;
2357
+        }
2358
+        // this will be initial value of the above form field. Image urls.
2359
+        else {
2360
+                    $svalue = '';
2361
+        }
2357 2362
 
2358 2363
         $image_limit = $package_info->image_limit;
2359 2364
         $show_image_input_box = ($image_limit != '0');
@@ -2563,8 +2568,9 @@  discard block
 block discarded – undo
2563 2568
     </script><?php
2564 2569
 
2565 2570
     global $errors;
2566
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2567
-        $errors->add('claim_login', LOGIN_CLAIM);
2571
+    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') {
2572
+            $errors->add('claim_login', LOGIN_CLAIM);
2573
+    }
2568 2574
 
2569 2575
     if (!empty($errors)) {
2570 2576
         foreach ($errors as $errorsObj) {
@@ -2668,8 +2674,9 @@  discard block
 block discarded – undo
2668 2674
 
2669 2675
     if (!empty($term)) {
2670 2676
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2671
-        if (!empty($current_term))
2672
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2677
+        if (!empty($current_term)) {
2678
+                    $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2679
+        }
2673 2680
     }
2674 2681
 
2675 2682
 
@@ -2687,7 +2694,7 @@  discard block
 block discarded – undo
2687 2694
         $gd_page = 'author';
2688 2695
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2689 2696
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2690
-        }else{
2697
+        } else{
2691 2698
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2692 2699
         }
2693 2700
 
Please login to merge, or discard this patch.
Indentation   +1735 added lines, -1735 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
731
+	$srcharr = array("'", "/", "-", '"', '\\');
732
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,46 +1662,46 @@  discard block
 block discarded – undo
1662 1662
  */
1663 1663
 function geodir_action_listings_description()
1664 1664
 {
1665
-    global $wp_query;
1666
-    $current_term = $wp_query->get_queried_object();
1665
+	global $wp_query;
1666
+	$current_term = $wp_query->get_queried_object();
1667 1667
 
1668
-    $gd_post_type = geodir_get_current_posttype();
1669
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1668
+	$gd_post_type = geodir_get_current_posttype();
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');
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
-        }
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 1676
 
1677
-        // stop payment manager filtering content length
1678
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1679
-        if ( false !== $filter_priority ) {
1680
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1681
-        }
1677
+		// stop payment manager filtering content length
1678
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1679
+		if ( false !== $filter_priority ) {
1680
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1681
+		}
1682 1682
 
1683
-        /**
1684
-         * Apply the core filter `the_content` filter to the variable string.
1685
-         *
1686
-         * This is a WordPress core filter that does many things.
1687
-         *
1688
-         * @since 1.0.0
1689
-         * @param string $var The string to apply the filter to.
1690
-         */
1691
-        $cat_description = apply_filters('the_content', $saved_data);
1683
+		/**
1684
+		 * Apply the core filter `the_content` filter to the variable string.
1685
+		 *
1686
+		 * This is a WordPress core filter that does many things.
1687
+		 *
1688
+		 * @since 1.0.0
1689
+		 * @param string $var The string to apply the filter to.
1690
+		 */
1691
+		$cat_description = apply_filters('the_content', $saved_data);
1692 1692
 
1693 1693
 
1694
-        if ( false !== $filter_priority ) {
1695
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1696
-        }
1694
+		if ( false !== $filter_priority ) {
1695
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1696
+		}
1697 1697
 
1698
-        if ($cat_description) {
1699
-            ?>
1698
+		if ($cat_description) {
1699
+			?>
1700 1700
 
1701 1701
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1702
-        }
1702
+		}
1703 1703
 
1704
-    }
1704
+	}
1705 1705
 }
1706 1706
 
1707 1707
 // action for adding the listings page top widget area
@@ -1720,11 +1720,11 @@  discard block
 block discarded – undo
1720 1720
  */
1721 1721
 function geodir_action_geodir_sidebar_listings_top()
1722 1722
 {
1723
-    if (get_option('geodir_show_listing_top_section')) { ?>
1723
+	if (get_option('geodir_show_listing_top_section')) { ?>
1724 1724
         <div
1725 1725
             class="<?php
1726
-            /** This action is documented in geodirectory_template_actions.php */
1727
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1726
+			/** This action is documented in geodirectory_template_actions.php */
1727
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1728 1728
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1729 1729
         </div><!-- clearfix ends here-->
1730 1730
     <?php }
@@ -1747,35 +1747,35 @@  discard block
 block discarded – undo
1747 1747
  */
1748 1748
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1749 1749
 {
1750
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1751
-        $width_css = 'style="width:' . $width . '%;"';
1752
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1753
-        $width_css = 'style="width:' . $width . '%;"';
1754
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1755
-        $width_css = 'style="width:' . $width . '%;"';
1756
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1757
-        $width_css = 'style="width:' . $width . '%;"';
1758
-    } else {
1759
-        $width_css = '';
1760
-    }
1761
-
1762
-    $tc = get_option('theme_compatibility_setting');
1763
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1764
-        $text = $tc['geodir_sidebar_left_open_replace'];
1765
-    } else {
1766
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1767
-    }
1768
-
1769
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1770
-        $id = $tc['geodir_sidebar_left_open_id'];
1771
-    }
1772
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1773
-        $class = $tc['geodir_sidebar_left_open_class'];
1774
-    }
1775
-
1776
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1777
-
1778
-    echo $text;
1750
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1751
+		$width_css = 'style="width:' . $width . '%;"';
1752
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1753
+		$width_css = 'style="width:' . $width . '%;"';
1754
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1755
+		$width_css = 'style="width:' . $width . '%;"';
1756
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1757
+		$width_css = 'style="width:' . $width . '%;"';
1758
+	} else {
1759
+		$width_css = '';
1760
+	}
1761
+
1762
+	$tc = get_option('theme_compatibility_setting');
1763
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1764
+		$text = $tc['geodir_sidebar_left_open_replace'];
1765
+	} else {
1766
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1767
+	}
1768
+
1769
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1770
+		$id = $tc['geodir_sidebar_left_open_id'];
1771
+	}
1772
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1773
+		$class = $tc['geodir_sidebar_left_open_class'];
1774
+	}
1775
+
1776
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1777
+
1778
+	echo $text;
1779 1779
 }
1780 1780
 
1781 1781
 // action for adding the primary div closing tag
@@ -1791,13 +1791,13 @@  discard block
 block discarded – undo
1791 1791
  */
1792 1792
 function geodir_action_sidebar_left_close($type = '')
1793 1793
 {
1794
-    $tc = get_option('theme_compatibility_setting');
1795
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1796
-        $text = $tc['geodir_sidebar_left_close_replace'];
1797
-    } else {
1798
-        $text = '</aside><!-- sidebar ends here-->';
1799
-    }
1800
-    echo $text;
1794
+	$tc = get_option('theme_compatibility_setting');
1795
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1796
+		$text = $tc['geodir_sidebar_left_close_replace'];
1797
+	} else {
1798
+		$text = '</aside><!-- sidebar ends here-->';
1799
+	}
1800
+	echo $text;
1801 1801
 }
1802 1802
 
1803 1803
 /**
@@ -1810,7 +1810,7 @@  discard block
 block discarded – undo
1810 1810
  */
1811 1811
 function geodir_listing_left_section()
1812 1812
 {
1813
-    if (get_option('geodir_show_listing_left_section')) { ?>
1813
+	if (get_option('geodir_show_listing_left_section')) { ?>
1814 1814
         <div class="geodir-content-left geodir-sidebar-wrap">
1815 1815
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1816 1816
         </div><!-- end geodir-content-left -->
@@ -1828,20 +1828,20 @@  discard block
 block discarded – undo
1828 1828
  */
1829 1829
 function geodir_action_listings_sidebar_left()
1830 1830
 {
1831
-    if (get_option('geodir_show_listing_left_section')) {
1832
-        /** This action is documented in geodirectory_template_actions.php */
1833
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1834
-        /**
1835
-         * Calls the listings page (category) left sidebar content.
1836
-         *
1837
-         * All the content for the listings page left sidebar is added via this hook.
1838
-         *
1839
-         * @since 1.0.0
1840
-         */
1841
-        do_action('geodir_listings_sidebar_left_inside');
1842
-        /** This action is documented in geodirectory_template_actions.php */
1843
-        do_action('geodir_sidebar_left_close', 'listings-page');
1844
-    }
1831
+	if (get_option('geodir_show_listing_left_section')) {
1832
+		/** This action is documented in geodirectory_template_actions.php */
1833
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1834
+		/**
1835
+		 * Calls the listings page (category) left sidebar content.
1836
+		 *
1837
+		 * All the content for the listings page left sidebar is added via this hook.
1838
+		 *
1839
+		 * @since 1.0.0
1840
+		 */
1841
+		do_action('geodir_listings_sidebar_left_inside');
1842
+		/** This action is documented in geodirectory_template_actions.php */
1843
+		do_action('geodir_sidebar_left_close', 'listings-page');
1844
+	}
1845 1845
 }
1846 1846
 
1847 1847
 /**
@@ -1854,7 +1854,7 @@  discard block
 block discarded – undo
1854 1854
  */
1855 1855
 function geodir_listing_right_section()
1856 1856
 {
1857
-    if (get_option('geodir_show_listing_right_section')) { ?>
1857
+	if (get_option('geodir_show_listing_right_section')) { ?>
1858 1858
         <div class="geodir-content-right geodir-sidebar-wrap">
1859 1859
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1860 1860
         </div><!-- end geodir-content-right -->
@@ -1872,20 +1872,20 @@  discard block
 block discarded – undo
1872 1872
  */
1873 1873
 function geodir_action_listings_sidebar_right()
1874 1874
 {
1875
-    if (get_option('geodir_show_listing_right_section')) {
1876
-        /** This action is documented in geodirectory_template_actions.php */
1877
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1878
-        /**
1879
-         * Calls the listings page (category) right sidebar content.
1880
-         *
1881
-         * All the content for the listings page right sidebar is added via this hook.
1882
-         *
1883
-         * @since 1.0.0
1884
-         */
1885
-        do_action('geodir_listings_sidebar_right_inside');
1886
-        /** This action is documented in geodirectory_template_actions.php */
1887
-        do_action('geodir_sidebar_right_close', 'listings-page');
1888
-    }
1875
+	if (get_option('geodir_show_listing_right_section')) {
1876
+		/** This action is documented in geodirectory_template_actions.php */
1877
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1878
+		/**
1879
+		 * Calls the listings page (category) right sidebar content.
1880
+		 *
1881
+		 * All the content for the listings page right sidebar is added via this hook.
1882
+		 *
1883
+		 * @since 1.0.0
1884
+		 */
1885
+		do_action('geodir_listings_sidebar_right_inside');
1886
+		/** This action is documented in geodirectory_template_actions.php */
1887
+		do_action('geodir_sidebar_right_close', 'listings-page');
1888
+	}
1889 1889
 }
1890 1890
 
1891 1891
 
@@ -1902,23 +1902,23 @@  discard block
 block discarded – undo
1902 1902
  */
1903 1903
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1904 1904
 {
1905
-    $tc = get_option('theme_compatibility_setting');
1906
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1907
-        $text = $tc['geodir_main_content_open_replace'];
1908
-    } else {
1909
-        $text = '<main id="[id]" class="[class]" role="main">';
1910
-    }
1905
+	$tc = get_option('theme_compatibility_setting');
1906
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1907
+		$text = $tc['geodir_main_content_open_replace'];
1908
+	} else {
1909
+		$text = '<main id="[id]" class="[class]" role="main">';
1910
+	}
1911 1911
 
1912
-    if (!empty($tc['geodir_main_content_open_id'])) {
1913
-        $id = $tc['geodir_main_content_open_id'];
1914
-    }
1915
-    if (!empty($tc['geodir_main_content_open_class'])) {
1916
-        $class = $tc['geodir_main_content_open_class'];
1917
-    }
1912
+	if (!empty($tc['geodir_main_content_open_id'])) {
1913
+		$id = $tc['geodir_main_content_open_id'];
1914
+	}
1915
+	if (!empty($tc['geodir_main_content_open_class'])) {
1916
+		$class = $tc['geodir_main_content_open_class'];
1917
+	}
1918 1918
 
1919
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1919
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1920 1920
 
1921
-    echo $text;
1921
+	echo $text;
1922 1922
 }
1923 1923
 
1924 1924
 // action for adding the primary div closing tag
@@ -1931,13 +1931,13 @@  discard block
 block discarded – undo
1931 1931
  */
1932 1932
 function geodir_action_main_content_close()
1933 1933
 {
1934
-    $tc = get_option('theme_compatibility_setting');
1935
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1936
-        $text = $tc['geodir_main_content_close_replace'];
1937
-    } else {
1938
-        $text = '</main><!-- main ends here-->';
1939
-    }
1940
-    echo $text;
1934
+	$tc = get_option('theme_compatibility_setting');
1935
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1936
+		$text = $tc['geodir_main_content_close_replace'];
1937
+	} else {
1938
+		$text = '</main><!-- main ends here-->';
1939
+	}
1940
+	echo $text;
1941 1941
 }
1942 1942
 
1943 1943
 /**
@@ -1949,14 +1949,14 @@  discard block
 block discarded – undo
1949 1949
  */
1950 1950
 function geodir_action_listings_content_inside()
1951 1951
 {
1952
-    global $gridview_columns;
1953
-    $listing_view = get_option('geodir_listing_view');
1954
-    if (strstr($listing_view, 'gridview')) {
1955
-        $gridview_columns = $listing_view;
1956
-        $listing_view_exp = explode('_', $listing_view);
1957
-        $listing_view = $listing_view_exp[0];
1958
-    }
1959
-    geodir_get_template_part('listing', 'listview');
1952
+	global $gridview_columns;
1953
+	$listing_view = get_option('geodir_listing_view');
1954
+	if (strstr($listing_view, 'gridview')) {
1955
+		$gridview_columns = $listing_view;
1956
+		$listing_view_exp = explode('_', $listing_view);
1957
+		$listing_view = $listing_view_exp[0];
1958
+	}
1959
+	geodir_get_template_part('listing', 'listview');
1960 1960
 }
1961 1961
 
1962 1962
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1972,47 +1972,47 @@  discard block
 block discarded – undo
1972 1972
  */
1973 1973
 function geodir_action_listings_content()
1974 1974
 {
1975
-    /**
1976
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1977
-     *
1978
-     * @since 1.0.0
1979
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1980
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1981
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1982
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1983
-     */
1984
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1985
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1986
-    echo '<div class="clearfix '.$extra_class.'">';
1987
-    /**
1988
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1989
-     *
1990
-     * @since 1.0.0
1991
-     */
1992
-    do_action('geodir_before_listing');
1993
-    echo '</div>';
1994
-
1995
-    /**
1996
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
1997
-     *
1998
-     * @since 1.0.0
1999
-     */
2000
-    do_action('geodir_listings_content_inside');
2001
-
2002
-    /**
2003
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2004
-     *
2005
-     * @since 1.0.0
2006
-     */
2007
-    do_action('geodir_after_listing');
2008
-
2009
-    /**
2010
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2011
-     *
2012
-     * @since 1.0.0
2013
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2014
-     */
2015
-    do_action('geodir_main_content_close', 'listings-page');
1975
+	/**
1976
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1977
+	 *
1978
+	 * @since 1.0.0
1979
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1980
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1981
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1982
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1983
+	 */
1984
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1985
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1986
+	echo '<div class="clearfix '.$extra_class.'">';
1987
+	/**
1988
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1989
+	 *
1990
+	 * @since 1.0.0
1991
+	 */
1992
+	do_action('geodir_before_listing');
1993
+	echo '</div>';
1994
+
1995
+	/**
1996
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
1997
+	 *
1998
+	 * @since 1.0.0
1999
+	 */
2000
+	do_action('geodir_listings_content_inside');
2001
+
2002
+	/**
2003
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2004
+	 *
2005
+	 * @since 1.0.0
2006
+	 */
2007
+	do_action('geodir_after_listing');
2008
+
2009
+	/**
2010
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2011
+	 *
2012
+	 * @since 1.0.0
2013
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2014
+	 */
2015
+	do_action('geodir_main_content_close', 'listings-page');
2016 2016
 }
2017 2017
 
2018 2018
 
@@ -2027,10 +2027,10 @@  discard block
 block discarded – undo
2027 2027
  */
2028 2028
 function geodir_action_sidebar_listings_bottom_section()
2029 2029
 {
2030
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2030
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2031 2031
         <div class="<?php
2032
-            /** This action is documented in geodirectory_template_actions.php */
2033
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2032
+			/** This action is documented in geodirectory_template_actions.php */
2033
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2034 2034
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2035 2035
         </div><!-- clearfix ends here-->
2036 2036
     <?php }
@@ -2050,38 +2050,38 @@  discard block
 block discarded – undo
2050 2050
  */
2051 2051
 function geodir_action_add_listing_page_title()
2052 2052
 {
2053
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2054
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2055
-    /** This action is documented in geodirectory_template_actions.php */
2056
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2057
-    /** This action is documented in geodirectory_template_actions.php */
2058
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2059
-
2060
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2061
-
2062
-    if(geodir_is_page('add-listing')){
2063
-        $gd_page = 'add-listing';
2064
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2065
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2066
-        }elseif(isset($listing_type)){
2067
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2068
-        }
2053
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2054
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2055
+	/** This action is documented in geodirectory_template_actions.php */
2056
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2057
+	/** This action is documented in geodirectory_template_actions.php */
2058
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2059
+
2060
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2061
+
2062
+	if(geodir_is_page('add-listing')){
2063
+		$gd_page = 'add-listing';
2064
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2065
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2066
+		}elseif(isset($listing_type)){
2067
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2068
+		}
2069 2069
 
2070
-    }
2070
+	}
2071 2071
 
2072 2072
 
2073
-    /**
2074
-     * Filter page title to replace variables.
2075
-     *
2076
-     * @since 1.5.4
2077
-     * @param string $title The page title including variables.
2078
-     * @param string $gd_page The GeoDirectory page type if any.
2079
-     */
2080
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2073
+	/**
2074
+	 * Filter page title to replace variables.
2075
+	 *
2076
+	 * @since 1.5.4
2077
+	 * @param string $title The page title including variables.
2078
+	 * @param string $gd_page The GeoDirectory page type if any.
2079
+	 */
2080
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2081 2081
 
2082
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2083
-    echo $title;
2084
-    echo '</h1></header>';
2082
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2083
+	echo $title;
2084
+	echo '</h1></header>';
2085 2085
 }
2086 2086
 
2087 2087
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2112,59 +2112,59 @@  discard block
 block discarded – undo
2112 2112
  */
2113 2113
 function geodir_action_add_listing_form()
2114 2114
 {
2115
-    global $cat_display, $post_cat, $current_user, $gd_session;
2116
-    $page_id = get_the_ID();
2117
-    $post = '';
2118
-    $title = '';
2119
-    $desc = '';
2120
-    $kw_tags = '';
2121
-    $required_msg = '';
2122
-    $submit_button = '';
2123
-
2124
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2125
-
2126
-    $thumb_img_arr = array();
2127
-    $curImages = '';
2128
-
2129
-    if (isset($_REQUEST['backandedit'])) {
2130
-        global $post;
2131
-        $post = (object)$gd_session->get('listing');
2132
-        $listing_type = $post->listing_type;
2133
-        $title = $post->post_title;
2134
-        $desc = $post->post_desc;
2135
-        $post_cat = $post->post_category;
2136
-
2137
-        $kw_tags = $post->post_tags;
2138
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2139
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2140
-        global $post, $post_images;
2141
-
2142
-        $post = geodir_get_post_info($_REQUEST['pid']);
2143
-        $thumb_img_arr = geodir_get_images($post->ID);
2144
-        if ($thumb_img_arr) {
2145
-            foreach ($thumb_img_arr as $post_img) {
2146
-                $curImages .= $post_img->src . ',';
2147
-            }
2148
-        }
2115
+	global $cat_display, $post_cat, $current_user, $gd_session;
2116
+	$page_id = get_the_ID();
2117
+	$post = '';
2118
+	$title = '';
2119
+	$desc = '';
2120
+	$kw_tags = '';
2121
+	$required_msg = '';
2122
+	$submit_button = '';
2123
+
2124
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2125
+
2126
+	$thumb_img_arr = array();
2127
+	$curImages = '';
2128
+
2129
+	if (isset($_REQUEST['backandedit'])) {
2130
+		global $post;
2131
+		$post = (object)$gd_session->get('listing');
2132
+		$listing_type = $post->listing_type;
2133
+		$title = $post->post_title;
2134
+		$desc = $post->post_desc;
2135
+		$post_cat = $post->post_category;
2136
+
2137
+		$kw_tags = $post->post_tags;
2138
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2139
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2140
+		global $post, $post_images;
2141
+
2142
+		$post = geodir_get_post_info($_REQUEST['pid']);
2143
+		$thumb_img_arr = geodir_get_images($post->ID);
2144
+		if ($thumb_img_arr) {
2145
+			foreach ($thumb_img_arr as $post_img) {
2146
+				$curImages .= $post_img->src . ',';
2147
+			}
2148
+		}
2149 2149
 
2150
-        $listing_type = $post->post_type;
2151
-        $title = $post->post_title;
2152
-        $desc = $post->post_content;
2153
-        $kw_tags = $post->post_tags;
2154
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2155
-    } else {
2156
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2157
-    }
2150
+		$listing_type = $post->post_type;
2151
+		$title = $post->post_title;
2152
+		$desc = $post->post_content;
2153
+		$kw_tags = $post->post_tags;
2154
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2155
+	} else {
2156
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2157
+	}
2158 2158
 
2159
-    if ($current_user->ID != '0') {
2160
-        $user_login = true;
2161
-    }
2159
+	if ($current_user->ID != '0') {
2160
+		$user_login = true;
2161
+	}
2162 2162
 
2163
-    $post_type_info = geodir_get_posttype_info($listing_type);
2163
+	$post_type_info = geodir_get_posttype_info($listing_type);
2164 2164
 
2165
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2165
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2166 2166
 
2167
-    ?>
2167
+	?>
2168 2168
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2169 2169
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2170 2170
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2175,27 +2175,27 @@  discard block
 block discarded – undo
2175 2175
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2176 2176
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2177 2177
         <?php
2178
-        } 
2179
-        /**
2180
-         * Called at the very top of the add listing page form for frontend.
2181
-         *
2182
-         * This is called just before the "Enter Listing Details" text.
2183
-         *
2184
-         * @since 1.0.0
2185
-         */
2186
-        do_action('geodir_before_detail_fields');
2187
-        ?>
2178
+		} 
2179
+		/**
2180
+		 * Called at the very top of the add listing page form for frontend.
2181
+		 *
2182
+		 * This is called just before the "Enter Listing Details" text.
2183
+		 *
2184
+		 * @since 1.0.0
2185
+		 */
2186
+		do_action('geodir_before_detail_fields');
2187
+		?>
2188 2188
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2189 2189
         <?php
2190
-        /**
2191
-         * Called at the top of the add listing page form for frontend.
2192
-         *
2193
-         * This is called after the "Enter Listing Details" text.
2194
-         *
2195
-         * @since 1.0.0
2196
-         */
2197
-        do_action('geodir_before_main_form_fields');
2198
-        ?>
2190
+		/**
2191
+		 * Called at the top of the add listing page form for frontend.
2192
+		 *
2193
+		 * This is called after the "Enter Listing Details" text.
2194
+		 *
2195
+		 * @since 1.0.0
2196
+		 */
2197
+		do_action('geodir_before_main_form_fields');
2198
+		?>
2199 2199
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2200 2200
             <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label>
2201 2201
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
@@ -2203,57 +2203,57 @@  discard block
 block discarded – undo
2203 2203
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2204 2204
         </div>
2205 2205
         <?php
2206
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2207
-
2208
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2209
-        $desc_limit = '';
2210
-        /**
2211
-         * Filter the add listing description field character limit number.
2212
-         *
2213
-         * @since 1.0.0
2214
-         * @param int $desc_limit The amount of characters to limit the description to.
2215
-         */
2216
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2217
-        /**
2218
-         * Filter the add listing description field text.
2219
-         *
2220
-         * @since 1.0.0
2221
-         * @param string $desc The text for the description field.
2222
-         * @param int $desc_limit The character limit number if any.
2223
-         */
2224
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2225
-        $desc_limit_msg = '';
2226
-        /**
2227
-         * Filter the add listing description limit message.
2228
-         *
2229
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2230
-         *
2231
-         * @since 1.0.0
2232
-         * @param string $desc_limit_msg The limit message string if any.
2233
-         * @param int $desc_limit The character limit numer if any.
2234
-         */
2235
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2206
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2207
+
2208
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2209
+		$desc_limit = '';
2210
+		/**
2211
+		 * Filter the add listing description field character limit number.
2212
+		 *
2213
+		 * @since 1.0.0
2214
+		 * @param int $desc_limit The amount of characters to limit the description to.
2215
+		 */
2216
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2217
+		/**
2218
+		 * Filter the add listing description field text.
2219
+		 *
2220
+		 * @since 1.0.0
2221
+		 * @param string $desc The text for the description field.
2222
+		 * @param int $desc_limit The character limit number if any.
2223
+		 */
2224
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2225
+		$desc_limit_msg = '';
2226
+		/**
2227
+		 * Filter the add listing description limit message.
2228
+		 *
2229
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2230
+		 *
2231
+		 * @since 1.0.0
2232
+		 * @param string $desc_limit_msg The limit message string if any.
2233
+		 * @param int $desc_limit The character limit numer if any.
2234
+		 */
2235
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2236 2236
         
2237
-        $desc_class = '';
2238
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2239
-            /**
2240
-             * Called on the add listing page form for frontend just before the description field.
2241
-             *
2242
-             * @since 1.0.0
2243
-             */
2244
-            do_action('geodir_before_description_field');
2237
+		$desc_class = '';
2238
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2239
+			/**
2240
+			 * Called on the add listing page form for frontend just before the description field.
2241
+			 *
2242
+			 * @since 1.0.0
2243
+			 */
2244
+			do_action('geodir_before_description_field');
2245 2245
             
2246
-            $desc_class = ' required_field';
2247
-        } else {
2248
-            $desc_class = ' hidden';
2249
-        }
2250
-        ?>
2246
+			$desc_class = ' required_field';
2247
+		} else {
2248
+			$desc_class = ' hidden';
2249
+		}
2250
+		?>
2251 2251
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2252 2252
             <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2253 2253
             <?php
2254
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2255
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2256
-            ?>
2254
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2255
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2256
+			?>
2257 2257
                 <div class="editor" field_id="post_desc" field_type="editor">
2258 2258
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2259 2259
                 </div>
@@ -2267,56 +2267,56 @@  discard block
 block discarded – undo
2267 2267
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2268 2268
         </div>
2269 2269
         <?php
2270
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2271
-            /**
2272
-             * Called on the add listing page form for frontend just after the description field.
2273
-             *
2274
-             * @since 1.0.0
2275
-             */
2276
-            do_action('geodir_after_description_field');
2277
-        }
2270
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2271
+			/**
2272
+			 * Called on the add listing page form for frontend just after the description field.
2273
+			 *
2274
+			 * @since 1.0.0
2275
+			 */
2276
+			do_action('geodir_after_description_field');
2277
+		}
2278 2278
         
2279
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2280
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2281
-        $kw_tags_msg = TAGKW_MSG;
2282
-        /**
2283
-         * Filter the add listing tags character limit.
2284
-         *
2285
-         * @since 1.0.0
2286
-         * @param int $kw_tags_count The character count limit if any.
2287
-         */
2288
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2289
-        /**
2290
-         * Filter the add listing tags field value.
2291
-         *
2292
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2293
-         *
2294
-         * @since 1.0.0
2295
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2296
-         * @param int $kw_tags_count The character count limit if any.
2297
-         */
2298
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2299
-        /**
2300
-         * Filter the add listing tags field message text.
2301
-         *
2302
-         * @since 1.0.0
2303
-         * @param string $kw_tags_msg The message shown under the field.
2304
-         * @param int $kw_tags_count The character count limit if any.
2305
-         */
2306
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2279
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2280
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2281
+		$kw_tags_msg = TAGKW_MSG;
2282
+		/**
2283
+		 * Filter the add listing tags character limit.
2284
+		 *
2285
+		 * @since 1.0.0
2286
+		 * @param int $kw_tags_count The character count limit if any.
2287
+		 */
2288
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2289
+		/**
2290
+		 * Filter the add listing tags field value.
2291
+		 *
2292
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2293
+		 *
2294
+		 * @since 1.0.0
2295
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2296
+		 * @param int $kw_tags_count The character count limit if any.
2297
+		 */
2298
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2299
+		/**
2300
+		 * Filter the add listing tags field message text.
2301
+		 *
2302
+		 * @since 1.0.0
2303
+		 * @param string $kw_tags_msg The message shown under the field.
2304
+		 * @param int $kw_tags_count The character count limit if any.
2305
+		 */
2306
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2307 2307
         
2308
-        $tags_class = '';
2309
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2310
-            /**
2311
-             * Called on the add listing page form for frontend just before the tags field.
2312
-             *
2313
-             * @since 1.0.0
2314
-             */
2315
-            do_action('geodir_before_listing_tags_field');
2316
-        } else {
2317
-            $tags_class = ' hidden';
2318
-        }
2319
-        ?>
2308
+		$tags_class = '';
2309
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2310
+			/**
2311
+			 * Called on the add listing page form for frontend just before the tags field.
2312
+			 *
2313
+			 * @since 1.0.0
2314
+			 */
2315
+			do_action('geodir_before_listing_tags_field');
2316
+		} else {
2317
+			$tags_class = ' hidden';
2318
+		}
2319
+		?>
2320 2320
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2321 2321
             <label><?php echo TAGKW_TEXT; ?></label>
2322 2322
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2324,90 +2324,90 @@  discard block
 block discarded – undo
2324 2324
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2325 2325
         </div>
2326 2326
         <?php
2327
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2328
-            /**
2329
-             * Called on the add listing page form for frontend just after the tags field.
2330
-             *
2331
-             * @since 1.0.0
2332
-             */
2333
-            do_action('geodir_after_listing_tags_field');
2334
-        }
2327
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2328
+			/**
2329
+			 * Called on the add listing page form for frontend just after the tags field.
2330
+			 *
2331
+			 * @since 1.0.0
2332
+			 */
2333
+			do_action('geodir_after_listing_tags_field');
2334
+		}
2335 2335
         
2336
-        $package_info = array();
2337
-        $package_info = geodir_post_package_info($package_info, $post);
2336
+		$package_info = array();
2337
+		$package_info = geodir_post_package_info($package_info, $post);
2338 2338
         
2339
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2339
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2340 2340
         
2341
-        // adjust values here
2342
-        $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
2343
-
2344
-        $multiple = true; // allow multiple files upload
2341
+		// adjust values here
2342
+		$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
2345 2343
 
2346
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2344
+		$multiple = true; // allow multiple files upload
2347 2345
 
2348
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2346
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2349 2347
 
2350
-        $thumb_img_arr = array();
2351
-        $totImg = 0;
2352
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2353
-            $post = (object)$gd_session->get('listing');
2354
-            if (isset($post->post_images))
2355
-                $curImages = trim($post->post_images, ",");
2348
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2356 2349
 
2350
+		$thumb_img_arr = array();
2351
+		$totImg = 0;
2352
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2353
+			$post = (object)$gd_session->get('listing');
2354
+			if (isset($post->post_images))
2355
+				$curImages = trim($post->post_images, ",");
2357 2356
 
2358
-            if ($curImages != '') {
2359
-                $curImages_array = explode(',', $curImages);
2360
-                $totImg = count($curImages_array);
2361
-            }
2362 2357
 
2363
-            $listing_type = $post->listing_type;
2358
+			if ($curImages != '') {
2359
+				$curImages_array = explode(',', $curImages);
2360
+				$totImg = count($curImages_array);
2361
+			}
2364 2362
 
2365
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2366
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2367
-            $listing_type = $post->post_type;
2368
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2363
+			$listing_type = $post->listing_type;
2369 2364
 
2370
-        } else {
2371
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2372
-        }
2365
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2366
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2367
+			$listing_type = $post->post_type;
2368
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2373 2369
 
2370
+		} else {
2371
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2372
+		}
2374 2373
 
2375
-        if (!empty($thumb_img_arr)) {
2376
-            foreach ($thumb_img_arr as $img) {
2377
-                //$curImages = $img->src.",";
2378
-            }
2379 2374
 
2380
-            $totImg = count((array)$thumb_img_arr);
2381
-        }
2375
+		if (!empty($thumb_img_arr)) {
2376
+			foreach ($thumb_img_arr as $img) {
2377
+				//$curImages = $img->src.",";
2378
+			}
2382 2379
 
2383
-        if ($curImages != '')
2384
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2385
-        else
2386
-            $svalue = '';
2387
-
2388
-        $image_limit = $package_info->image_limit;
2389
-        $show_image_input_box = ($image_limit != '0');
2390
-        /**
2391
-         * Filter to be able to show/hide the image upload section of the add listing form.
2392
-         *
2393
-         * @since 1.0.0
2394
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2395
-         * @param string $listing_type The custom post type slug.
2396
-         */
2397
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2398
-        if ($show_image_input_box) {
2399
-            ?>
2380
+			$totImg = count((array)$thumb_img_arr);
2381
+		}
2382
+
2383
+		if ($curImages != '')
2384
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2385
+		else
2386
+			$svalue = '';
2387
+
2388
+		$image_limit = $package_info->image_limit;
2389
+		$show_image_input_box = ($image_limit != '0');
2390
+		/**
2391
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2392
+		 *
2393
+		 * @since 1.0.0
2394
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2395
+		 * @param string $listing_type The custom post type slug.
2396
+		 */
2397
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2398
+		if ($show_image_input_box) {
2399
+			?>
2400 2400
 
2401 2401
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2402 2402
                 <?php if ($image_limit == 1) {
2403
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2404
-                } ?>
2403
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2404
+				} ?>
2405 2405
                 <?php if ($image_limit > 1) {
2406
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2407
-                } ?>
2406
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2407
+				} ?>
2408 2408
                 <?php if ($image_limit == '') {
2409
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2410
-                } ?>
2409
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2410
+				} ?>
2411 2411
             </h5>
2412 2412
 
2413 2413
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2445,12 +2445,12 @@  discard block
 block discarded – undo
2445 2445
         <?php } ?>
2446 2446
 
2447 2447
         <?php
2448
-        /**
2449
-         * Called on the add listing page form for frontend just after the image upload field.
2450
-         *
2451
-         * @since 1.0.0
2452
-         */
2453
-        do_action('geodir_after_main_form_fields');?>
2448
+		/**
2449
+		 * Called on the add listing page form for frontend just after the image upload field.
2450
+		 *
2451
+		 * @since 1.0.0
2452
+		 */
2453
+		do_action('geodir_after_main_form_fields');?>
2454 2454
 
2455 2455
 
2456 2456
         <!-- add captcha code -->
@@ -2479,7 +2479,7 @@  discard block
 block discarded – undo
2479 2479
 
2480 2480
     </form>
2481 2481
     <?php
2482
-    wp_reset_query();
2482
+	wp_reset_query();
2483 2483
 }
2484 2484
 
2485 2485
 /**
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
  */
2491 2491
 function geodir_add_listing_sidebar_widget_area()
2492 2492
 {
2493
-    dynamic_sidebar('geodir_add_listing_sidebar');
2493
+	dynamic_sidebar('geodir_add_listing_sidebar');
2494 2494
 }
2495 2495
 
2496 2496
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2505,16 +2505,16 @@  discard block
 block discarded – undo
2505 2505
  */
2506 2506
 function geodir_action_add_listing_sidebar()
2507 2507
 {
2508
-    /** This action is documented in geodirectory_template_actions.php */
2509
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2510
-    /**
2511
-     * This is used to add the content to the add listing page sidebar.
2512
-     *
2513
-     * @since 1.0.0
2514
-     */
2515
-    do_action('geodir_add_listing_sidebar_inside');
2516
-    /** This action is documented in geodirectory_template_actions.php */
2517
-    do_action('geodir_sidebar_right_close', 'details-page');
2508
+	/** This action is documented in geodirectory_template_actions.php */
2509
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2510
+	/**
2511
+	 * This is used to add the content to the add listing page sidebar.
2512
+	 *
2513
+	 * @since 1.0.0
2514
+	 */
2515
+	do_action('geodir_add_listing_sidebar_inside');
2516
+	/** This action is documented in geodirectory_template_actions.php */
2517
+	do_action('geodir_sidebar_right_close', 'details-page');
2518 2518
 }
2519 2519
 
2520 2520
 ###############################################
@@ -2531,11 +2531,11 @@  discard block
 block discarded – undo
2531 2531
  */
2532 2532
 function geodir_action_geodir_sidebar_signup_top()
2533 2533
 {
2534
-    ?>
2534
+	?>
2535 2535
     <div
2536 2536
         class="<?php
2537
-        /** This action is documented in geodirectory_template_actions.php */
2538
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2537
+		/** This action is documented in geodirectory_template_actions.php */
2538
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2539 2539
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2540 2540
     </div><!-- clearfix ends here-->
2541 2541
 <?php
@@ -2554,9 +2554,9 @@  discard block
 block discarded – undo
2554 2554
 function geodir_action_signup_forms()
2555 2555
 {
2556 2556
 
2557
-    global $user_login;
2557
+	global $user_login;
2558 2558
 
2559
-    ?>
2559
+	?>
2560 2560
     <script type="text/javascript">
2561 2561
         <?php if ( $user_login ) { ?>
2562 2562
         setTimeout(function () {
@@ -2592,65 +2592,65 @@  discard block
 block discarded – undo
2592 2592
         <?php } ?>
2593 2593
     </script><?php
2594 2594
 
2595
-    global $errors;
2596
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2597
-        $errors->add('claim_login', LOGIN_CLAIM);
2598
-
2599
-    if (!empty($errors)) {
2600
-        foreach ($errors as $errorsObj) {
2601
-            foreach ($errorsObj as $key => $val) {
2602
-                for ($i = 0; $i < count($val); $i++) {
2603
-                    echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2604
-                    $registration_error_msg = 1;
2605
-                }
2606
-            }
2607
-        }
2608
-    }
2595
+	global $errors;
2596
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2597
+		$errors->add('claim_login', LOGIN_CLAIM);
2598
+
2599
+	if (!empty($errors)) {
2600
+		foreach ($errors as $errorsObj) {
2601
+			foreach ($errorsObj as $key => $val) {
2602
+				for ($i = 0; $i < count($val); $i++) {
2603
+					echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2604
+					$registration_error_msg = 1;
2605
+				}
2606
+			}
2607
+		}
2608
+	}
2609 2609
 
2610
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2611
-        ?>
2610
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2611
+		?>
2612 2612
 
2613 2613
         <div class="login_form">
2614 2614
             <?php
2615
-            /**
2616
-             * Contains login form template.
2617
-             *
2618
-             * @since 1.0.0
2619
-             */
2620
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2615
+			/**
2616
+			 * Contains login form template.
2617
+			 *
2618
+			 * @since 1.0.0
2619
+			 */
2620
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2621 2621
         </div>
2622 2622
 
2623 2623
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2624 2624
 
2625 2625
         <div class="registration_form">
2626 2626
             <?php
2627
-            /**
2628
-             * Contains registration form template.
2629
-             *
2630
-             * @since 1.0.0
2631
-             */
2632
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2627
+			/**
2628
+			 * Contains registration form template.
2629
+			 *
2630
+			 * @since 1.0.0
2631
+			 */
2632
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2633 2633
         </div>
2634 2634
 
2635 2635
     <?php } else { ?>
2636 2636
 
2637 2637
         <div class="login_form_l">
2638 2638
             <?php
2639
-            /**
2640
-             * Contains login form template.
2641
-             *
2642
-             * @since 1.0.0
2643
-             */
2644
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2639
+			/**
2640
+			 * Contains login form template.
2641
+			 *
2642
+			 * @since 1.0.0
2643
+			 */
2644
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2645 2645
         </div>
2646 2646
         <div class="registration_form_r">
2647 2647
             <?php
2648
-            /**
2649
-             * Contains registration form template.
2650
-             *
2651
-             * @since 1.0.0
2652
-             */
2653
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2648
+			/**
2649
+			 * Contains registration form template.
2650
+			 *
2651
+			 * @since 1.0.0
2652
+			 */
2653
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2654 2654
         </div>
2655 2655
 
2656 2656
     <?php }?>
@@ -2681,66 +2681,66 @@  discard block
 block discarded – undo
2681 2681
  */
2682 2682
 function geodir_action_author_page_title()
2683 2683
 {
2684
-    global $term;
2684
+	global $term;
2685 2685
 
2686
-    $gd_post_type = geodir_get_current_posttype();
2687
-    $post_type_info = get_post_type_object($gd_post_type);
2686
+	$gd_post_type = geodir_get_current_posttype();
2687
+	$post_type_info = get_post_type_object($gd_post_type);
2688 2688
 
2689
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2690
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2691
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2692
-    }
2689
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2690
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2691
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2692
+	}
2693 2693
 
2694
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2695
-    $single_name = $post_type_info->labels->singular_name;
2694
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2695
+	$single_name = $post_type_info->labels->singular_name;
2696 2696
 
2697
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2697
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2698 2698
 
2699
-    if (!empty($term)) {
2700
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2701
-        if (!empty($current_term))
2702
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2703
-    }
2699
+	if (!empty($term)) {
2700
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2701
+		if (!empty($current_term))
2702
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2703
+	}
2704 2704
 
2705 2705
 
2706
-    if (is_search()) {
2707
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2706
+	if (is_search()) {
2707
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2708 2708
 
2709
-    }
2710
-    /** This action is documented in geodirectory_template_actions.php */
2711
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2712
-    /** This action is documented in geodirectory_template_actions.php */
2713
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2709
+	}
2710
+	/** This action is documented in geodirectory_template_actions.php */
2711
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2712
+	/** This action is documented in geodirectory_template_actions.php */
2713
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2714 2714
 
2715
-    $title = $list_title;
2716
-    if(geodir_is_page('author')){
2717
-        $gd_page = 'author';
2718
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2719
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2720
-        }else{
2721
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2722
-        }
2715
+	$title = $list_title;
2716
+	if(geodir_is_page('author')){
2717
+		$gd_page = 'author';
2718
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2719
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2720
+		}else{
2721
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2722
+		}
2723 2723
 
2724
-    }
2724
+	}
2725 2725
 
2726 2726
 
2727
-    /**
2728
-     * Filter page title to replace variables.
2729
-     *
2730
-     * @since 1.5.4
2731
-     * @param string $title The page title including variables.
2732
-     * @param string $gd_page The GeoDirectory page type if any.
2733
-     */
2734
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2727
+	/**
2728
+	 * Filter page title to replace variables.
2729
+	 *
2730
+	 * @since 1.5.4
2731
+	 * @param string $title The page title including variables.
2732
+	 * @param string $gd_page The GeoDirectory page type if any.
2733
+	 */
2734
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2735 2735
 
2736
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2737
-        /**
2738
-         * Filter the author page title text.
2739
-         *
2740
-         * @since 1.0.0
2741
-         * @param string $list_title The title for the page.
2742
-         */
2743
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2736
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2737
+		/**
2738
+		 * Filter the author page title text.
2739
+		 *
2740
+		 * @since 1.0.0
2741
+		 * @param string $list_title The title for the page.
2742
+		 */
2743
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2744 2744
 }
2745 2745
 
2746 2746
 
@@ -2758,11 +2758,11 @@  discard block
 block discarded – undo
2758 2758
  */
2759 2759
 function geodir_action_geodir_sidebar_author_top()
2760 2760
 {
2761
-    if (get_option('geodir_show_author_top_section')) { ?>
2761
+	if (get_option('geodir_show_author_top_section')) { ?>
2762 2762
         <div
2763 2763
             class="<?php
2764
-            /** This action is documented in geodirectory_template_actions.php */
2765
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2764
+			/** This action is documented in geodirectory_template_actions.php */
2765
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2766 2766
             <?php dynamic_sidebar('geodir_author_top'); ?>
2767 2767
         </div><!-- clearfix ends here-->
2768 2768
     <?php }
@@ -2778,7 +2778,7 @@  discard block
 block discarded – undo
2778 2778
  */
2779 2779
 function geodir_author_left_section()
2780 2780
 {
2781
-    if (get_option('geodir_show_author_left_section')) { ?>
2781
+	if (get_option('geodir_show_author_left_section')) { ?>
2782 2782
         <div class="geodir-content-left geodir-sidebar-wrap">
2783 2783
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2784 2784
         </div><!-- end geodir-content-left -->
@@ -2799,19 +2799,19 @@  discard block
 block discarded – undo
2799 2799
  */
2800 2800
 function geodir_action_author_sidebar_left()
2801 2801
 {
2802
-    if (get_option('geodir_show_author_left_section')) {
2802
+	if (get_option('geodir_show_author_left_section')) {
2803 2803
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2804
-        /** This action is documented in geodirectory_template_actions.php */
2805
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2806
-        /**
2807
-         * This is used to add the content to the author page left sidebar (if active).
2808
-         *
2809
-         * @since 1.0.0
2810
-         */
2811
-        do_action('geodir_author_sidebar_left_inside');
2812
-        /** This action is documented in geodirectory_template_actions.php */
2813
-        do_action('geodir_sidebar_left_close', 'author-page');
2814
-    }
2804
+		/** This action is documented in geodirectory_template_actions.php */
2805
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2806
+		/**
2807
+		 * This is used to add the content to the author page left sidebar (if active).
2808
+		 *
2809
+		 * @since 1.0.0
2810
+		 */
2811
+		do_action('geodir_author_sidebar_left_inside');
2812
+		/** This action is documented in geodirectory_template_actions.php */
2813
+		do_action('geodir_sidebar_left_close', 'author-page');
2814
+	}
2815 2815
 }
2816 2816
 
2817 2817
 /**
@@ -2824,7 +2824,7 @@  discard block
 block discarded – undo
2824 2824
  */
2825 2825
 function geodir_author_right_section()
2826 2826
 {
2827
-    if (get_option('geodir_show_author_right_section')) { ?>
2827
+	if (get_option('geodir_show_author_right_section')) { ?>
2828 2828
         <div class="geodir-content-right geodir-sidebar-wrap">
2829 2829
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2830 2830
         </div><!-- end geodir-content-right -->
@@ -2844,18 +2844,18 @@  discard block
 block discarded – undo
2844 2844
  */
2845 2845
 function geodir_action_author_sidebar_right()
2846 2846
 {
2847
-    if (get_option('geodir_show_author_right_section')) {
2848
-        /** This action is documented in geodirectory_template_actions.php */
2849
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2850
-        /**
2851
-         * This is used to add the content to the author page right sidebar (if active).
2852
-         *
2853
-         * @since 1.0.0
2854
-         */
2855
-        do_action('geodir_author_sidebar_right_inside');
2856
-        /** This action is documented in geodirectory_template_actions.php */
2857
-        do_action('geodir_sidebar_right_close', 'author-page');
2858
-    }
2847
+	if (get_option('geodir_show_author_right_section')) {
2848
+		/** This action is documented in geodirectory_template_actions.php */
2849
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2850
+		/**
2851
+		 * This is used to add the content to the author page right sidebar (if active).
2852
+		 *
2853
+		 * @since 1.0.0
2854
+		 */
2855
+		do_action('geodir_author_sidebar_right_inside');
2856
+		/** This action is documented in geodirectory_template_actions.php */
2857
+		do_action('geodir_sidebar_right_close', 'author-page');
2858
+	}
2859 2859
 }
2860 2860
 
2861 2861
 /**
@@ -2867,14 +2867,14 @@  discard block
 block discarded – undo
2867 2867
  */
2868 2868
 function geodir_action_author_content_inside()
2869 2869
 {
2870
-    global $gridview_columns;
2871
-    $listing_view = get_option('geodir_author_view');
2872
-    if (strstr($listing_view, 'gridview')) {
2873
-        $gridview_columns = $listing_view;
2874
-        $listing_view_exp = explode('_', $listing_view);
2875
-        $listing_view = $listing_view_exp[0];
2876
-    }
2877
-    geodir_get_template_part('listing', 'listview');
2870
+	global $gridview_columns;
2871
+	$listing_view = get_option('geodir_author_view');
2872
+	if (strstr($listing_view, 'gridview')) {
2873
+		$gridview_columns = $listing_view;
2874
+		$listing_view_exp = explode('_', $listing_view);
2875
+		$listing_view = $listing_view_exp[0];
2876
+	}
2877
+	geodir_get_template_part('listing', 'listview');
2878 2878
 }
2879 2879
 
2880 2880
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2889,22 +2889,22 @@  discard block
 block discarded – undo
2889 2889
  */
2890 2890
 function geodir_action_author_content()
2891 2891
 {
2892
-    /** This action is documented in geodirectory_template_actions.php */
2893
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2894
-    echo '<div class="clearfix">';
2895
-    /** This action is documented in geodirectory_template_actions.php */
2896
-    do_action('geodir_before_listing');
2897
-    echo '</div>';
2898
-    /**
2899
-     * This is used to add the content to the author page main content.
2900
-     *
2901
-     * @since 1.0.0
2902
-     */
2903
-    do_action('geodir_author_content_inside');
2904
-    /** This action is documented in geodirectory_template_actions.php */
2905
-    do_action('geodir_after_listing');
2906
-    /** This action is documented in geodirectory_template_actions.php */
2907
-    do_action('geodir_main_content_close', 'author-page');
2892
+	/** This action is documented in geodirectory_template_actions.php */
2893
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2894
+	echo '<div class="clearfix">';
2895
+	/** This action is documented in geodirectory_template_actions.php */
2896
+	do_action('geodir_before_listing');
2897
+	echo '</div>';
2898
+	/**
2899
+	 * This is used to add the content to the author page main content.
2900
+	 *
2901
+	 * @since 1.0.0
2902
+	 */
2903
+	do_action('geodir_author_content_inside');
2904
+	/** This action is documented in geodirectory_template_actions.php */
2905
+	do_action('geodir_after_listing');
2906
+	/** This action is documented in geodirectory_template_actions.php */
2907
+	do_action('geodir_main_content_close', 'author-page');
2908 2908
 }
2909 2909
 
2910 2910
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2918,11 +2918,11 @@  discard block
 block discarded – undo
2918 2918
  */
2919 2919
 function geodir_action_sidebar_author_bottom_section()
2920 2920
 {
2921
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2921
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2922 2922
         <div
2923 2923
             class="<?php
2924
-            /** This action is documented in geodirectory_template_actions.php */
2925
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2924
+			/** This action is documented in geodirectory_template_actions.php */
2925
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2926 2926
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2927 2927
         </div><!-- clearfix ends here-->
2928 2928
     <?php }
@@ -2941,23 +2941,23 @@  discard block
 block discarded – undo
2941 2941
  */
2942 2942
 function geodir_action_search_page_title()
2943 2943
 {
2944
-    $gd_post_type = geodir_get_current_posttype();
2945
-    $post_type_info = get_post_type_object($gd_post_type);
2944
+	$gd_post_type = geodir_get_current_posttype();
2945
+	$post_type_info = get_post_type_object($gd_post_type);
2946 2946
 
2947
-    $pt_name = '';
2948
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2947
+	$pt_name = '';
2948
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2949 2949
 
2950
-    if (is_search()) {
2951
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2950
+	if (is_search()) {
2951
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2952 2952
 
2953
-    }
2954
-    /** This action is documented in geodirectory_template_actions.php */
2955
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2956
-    /** This action is documented in geodirectory_template_actions.php */
2957
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2958
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2959
-        /** This action is documented in geodirectory_template_actions.php */
2960
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2953
+	}
2954
+	/** This action is documented in geodirectory_template_actions.php */
2955
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2956
+	/** This action is documented in geodirectory_template_actions.php */
2957
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2958
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2959
+		/** This action is documented in geodirectory_template_actions.php */
2960
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2961 2961
 }
2962 2962
 
2963 2963
 // action for adding the listings page top widget area
@@ -2973,11 +2973,11 @@  discard block
 block discarded – undo
2973 2973
  */
2974 2974
 function geodir_action_geodir_sidebar_search_top()
2975 2975
 {
2976
-    if (get_option('geodir_show_search_top_section')) { ?>
2976
+	if (get_option('geodir_show_search_top_section')) { ?>
2977 2977
         <div
2978 2978
             class="<?php
2979
-            /** This action is documented in geodirectory_template_actions.php */
2980
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2979
+			/** This action is documented in geodirectory_template_actions.php */
2980
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2981 2981
             <?php dynamic_sidebar('geodir_search_top'); ?>
2982 2982
         </div><!-- clearfix ends here-->
2983 2983
     <?php }
@@ -2993,7 +2993,7 @@  discard block
 block discarded – undo
2993 2993
  */
2994 2994
 function geodir_search_left_section()
2995 2995
 {
2996
-    if (get_option('geodir_show_search_left_section')) { ?>
2996
+	if (get_option('geodir_show_search_left_section')) { ?>
2997 2997
         <div class="geodir-content-left geodir-sidebar-wrap">
2998 2998
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
2999 2999
         </div><!-- end geodir-content-left -->
@@ -3013,19 +3013,19 @@  discard block
 block discarded – undo
3013 3013
  */
3014 3014
 function geodir_action_search_sidebar_left()
3015 3015
 {
3016
-    if (get_option('geodir_show_search_left_section')) {
3016
+	if (get_option('geodir_show_search_left_section')) {
3017 3017
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3018
-        /** This action is documented in geodirectory_template_actions.php */
3019
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3020
-        /**
3021
-         * This is used to add the content to the search page left sidebar (if active).
3022
-         *
3023
-         * @since 1.0.0
3024
-         */
3025
-        do_action('geodir_search_sidebar_left_inside');
3026
-        /** This action is documented in geodirectory_template_actions.php */
3027
-        do_action('geodir_sidebar_left_close', 'search-page');
3028
-    }
3018
+		/** This action is documented in geodirectory_template_actions.php */
3019
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3020
+		/**
3021
+		 * This is used to add the content to the search page left sidebar (if active).
3022
+		 *
3023
+		 * @since 1.0.0
3024
+		 */
3025
+		do_action('geodir_search_sidebar_left_inside');
3026
+		/** This action is documented in geodirectory_template_actions.php */
3027
+		do_action('geodir_sidebar_left_close', 'search-page');
3028
+	}
3029 3029
 }
3030 3030
 
3031 3031
 /**
@@ -3038,7 +3038,7 @@  discard block
 block discarded – undo
3038 3038
  */
3039 3039
 function geodir_search_right_section()
3040 3040
 {
3041
-    if (get_option('geodir_show_search_right_section')) { ?>
3041
+	if (get_option('geodir_show_search_right_section')) { ?>
3042 3042
         <div class="geodir-content-right geodir-sidebar-wrap">
3043 3043
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3044 3044
         </div><!-- end geodir-content-right -->
@@ -3058,18 +3058,18 @@  discard block
 block discarded – undo
3058 3058
  */
3059 3059
 function geodir_action_search_sidebar_right()
3060 3060
 {
3061
-    if (get_option('geodir_show_search_right_section')) {
3062
-        /** This action is documented in geodirectory_template_actions.php */
3063
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3064
-        /**
3065
-         * This is used to add the content to the search page right sidebar (if active).
3066
-         *
3067
-         * @since 1.0.0
3068
-         */
3069
-        do_action('geodir_search_sidebar_right_inside');
3070
-        /** This action is documented in geodirectory_template_actions.php */
3071
-        do_action('geodir_sidebar_right_close', 'search-page');
3072
-    }
3061
+	if (get_option('geodir_show_search_right_section')) {
3062
+		/** This action is documented in geodirectory_template_actions.php */
3063
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3064
+		/**
3065
+		 * This is used to add the content to the search page right sidebar (if active).
3066
+		 *
3067
+		 * @since 1.0.0
3068
+		 */
3069
+		do_action('geodir_search_sidebar_right_inside');
3070
+		/** This action is documented in geodirectory_template_actions.php */
3071
+		do_action('geodir_sidebar_right_close', 'search-page');
3072
+	}
3073 3073
 }
3074 3074
 
3075 3075
 
@@ -3084,11 +3084,11 @@  discard block
 block discarded – undo
3084 3084
  */
3085 3085
 function geodir_action_sidebar_search_bottom_section()
3086 3086
 {
3087
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3087
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3088 3088
         <div
3089 3089
             class="<?php
3090
-            /** This action is documented in geodirectory_template_actions.php */
3091
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3090
+			/** This action is documented in geodirectory_template_actions.php */
3091
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3092 3092
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3093 3093
         </div><!-- clearfix ends here-->
3094 3094
     <?php }
@@ -3103,14 +3103,14 @@  discard block
 block discarded – undo
3103 3103
  */
3104 3104
 function geodir_action_search_content_inside()
3105 3105
 {
3106
-    global $gridview_columns;
3107
-    $listing_view = get_option('geodir_search_view');
3108
-    if (strstr($listing_view, 'gridview')) {
3109
-        $gridview_columns = $listing_view;
3110
-        $listing_view_exp = explode('_', $listing_view);
3111
-        $listing_view = $listing_view_exp[0];
3112
-    }
3113
-    geodir_get_template_part('listing', 'listview');
3106
+	global $gridview_columns;
3107
+	$listing_view = get_option('geodir_search_view');
3108
+	if (strstr($listing_view, 'gridview')) {
3109
+		$gridview_columns = $listing_view;
3110
+		$listing_view_exp = explode('_', $listing_view);
3111
+		$listing_view = $listing_view_exp[0];
3112
+	}
3113
+	geodir_get_template_part('listing', 'listview');
3114 3114
 }
3115 3115
 
3116 3116
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3126,22 +3126,22 @@  discard block
 block discarded – undo
3126 3126
  */
3127 3127
 function geodir_action_search_content()
3128 3128
 {
3129
-    /** This action is documented in geodirectory_template_actions.php */
3130
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3131
-    echo '<div class="clearfix">';
3132
-    /** This action is documented in geodirectory_template_actions.php */
3133
-    do_action('geodir_before_listing');
3134
-    echo '</div>';
3135
-    /**
3136
-     * This is used to add the content to the search page main content.
3137
-     *
3138
-     * @since 1.0.0
3139
-     */
3140
-    do_action('geodir_search_content_inside');
3141
-    /** This action is documented in geodirectory_template_actions.php */
3142
-    do_action('geodir_after_listing');
3143
-    /** This action is documented in geodirectory_template_actions.php */
3144
-    do_action('geodir_main_content_close', 'search-page');
3129
+	/** This action is documented in geodirectory_template_actions.php */
3130
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3131
+	echo '<div class="clearfix">';
3132
+	/** This action is documented in geodirectory_template_actions.php */
3133
+	do_action('geodir_before_listing');
3134
+	echo '</div>';
3135
+	/**
3136
+	 * This is used to add the content to the search page main content.
3137
+	 *
3138
+	 * @since 1.0.0
3139
+	 */
3140
+	do_action('geodir_search_content_inside');
3141
+	/** This action is documented in geodirectory_template_actions.php */
3142
+	do_action('geodir_after_listing');
3143
+	/** This action is documented in geodirectory_template_actions.php */
3144
+	do_action('geodir_main_content_close', 'search-page');
3145 3145
 }
3146 3146
 
3147 3147
 ###############################################
@@ -3164,11 +3164,11 @@  discard block
 block discarded – undo
3164 3164
  */
3165 3165
 function geodir_action_geodir_sidebar_home_top()
3166 3166
 {
3167
-    if (get_option('geodir_show_home_top_section')) { ?>
3167
+	if (get_option('geodir_show_home_top_section')) { ?>
3168 3168
         <div
3169 3169
             class="<?php
3170
-            /** This action is documented in geodirectory_template_actions.php */
3171
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3170
+			/** This action is documented in geodirectory_template_actions.php */
3171
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3172 3172
             <?php dynamic_sidebar('geodir_home_top'); ?>
3173 3173
         </div><!-- clearfix ends here-->
3174 3174
     <?php }
@@ -3184,7 +3184,7 @@  discard block
 block discarded – undo
3184 3184
  */
3185 3185
 function geodir_home_left_section()
3186 3186
 {
3187
-    if (get_option('geodir_show_home_left_section')) { ?>
3187
+	if (get_option('geodir_show_home_left_section')) { ?>
3188 3188
         <div class="geodir-content-left geodir-sidebar-wrap">
3189 3189
             <?php dynamic_sidebar('geodir_home_left'); ?>
3190 3190
         </div><!-- end geodir-content-left -->
@@ -3206,19 +3206,19 @@  discard block
 block discarded – undo
3206 3206
  */
3207 3207
 function geodir_action_home_sidebar_left()
3208 3208
 {
3209
-    if (get_option('geodir_show_home_left_section')) {
3209
+	if (get_option('geodir_show_home_left_section')) {
3210 3210
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3211
-        /** This action is documented in geodirectory_template_actions.php */
3212
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3213
-        /**
3214
-         * This is used to add the content to the home page left sidebar (if active).
3215
-         *
3216
-         * @since 1.0.0
3217
-         */
3218
-        do_action('geodir_home_sidebar_left_inside');
3219
-        /** This action is documented in geodirectory_template_actions.php */
3220
-        do_action('geodir_sidebar_left_close', 'home-page');
3221
-    }
3211
+		/** This action is documented in geodirectory_template_actions.php */
3212
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3213
+		/**
3214
+		 * This is used to add the content to the home page left sidebar (if active).
3215
+		 *
3216
+		 * @since 1.0.0
3217
+		 */
3218
+		do_action('geodir_home_sidebar_left_inside');
3219
+		/** This action is documented in geodirectory_template_actions.php */
3220
+		do_action('geodir_sidebar_left_close', 'home-page');
3221
+	}
3222 3222
 }
3223 3223
 
3224 3224
 /**
@@ -3231,7 +3231,7 @@  discard block
 block discarded – undo
3231 3231
  */
3232 3232
 function geodir_home_right_section()
3233 3233
 {
3234
-    if (get_option('geodir_show_home_right_section')) { ?>
3234
+	if (get_option('geodir_show_home_right_section')) { ?>
3235 3235
         <div class="geodir-content-right geodir-sidebar-wrap">
3236 3236
             <?php dynamic_sidebar('geodir_home_right'); ?>
3237 3237
         </div><!-- end geodir-content-right -->
@@ -3252,18 +3252,18 @@  discard block
 block discarded – undo
3252 3252
  */
3253 3253
 function geodir_action_home_sidebar_right()
3254 3254
 {
3255
-    if (get_option('geodir_show_home_right_section')) {
3256
-        /** This action is documented in geodirectory_template_actions.php */
3257
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3258
-        /**
3259
-         * This is used to add the content to the home page right sidebar (if active).
3260
-         *
3261
-         * @since 1.0.0
3262
-         */
3263
-        do_action('geodir_home_sidebar_right_inside');
3264
-        /** This action is documented in geodirectory_template_actions.php */
3265
-        do_action('geodir_sidebar_right_close', 'home-page');
3266
-    }
3255
+	if (get_option('geodir_show_home_right_section')) {
3256
+		/** This action is documented in geodirectory_template_actions.php */
3257
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3258
+		/**
3259
+		 * This is used to add the content to the home page right sidebar (if active).
3260
+		 *
3261
+		 * @since 1.0.0
3262
+		 */
3263
+		do_action('geodir_home_sidebar_right_inside');
3264
+		/** This action is documented in geodirectory_template_actions.php */
3265
+		do_action('geodir_sidebar_right_close', 'home-page');
3266
+	}
3267 3267
 }
3268 3268
 
3269 3269
 /**
@@ -3274,7 +3274,7 @@  discard block
 block discarded – undo
3274 3274
  */
3275 3275
 function geodir_action_home_content_inside()
3276 3276
 {
3277
-    dynamic_sidebar('geodir_home_content');
3277
+	dynamic_sidebar('geodir_home_content');
3278 3278
 }
3279 3279
 
3280 3280
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3289,28 +3289,28 @@  discard block
 block discarded – undo
3289 3289
  */
3290 3290
 function geodir_action_home_content()
3291 3291
 {
3292
-    /** This action is documented in geodirectory_template_actions.php */
3293
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3294
-    /**
3295
-     * This called before the home page main content.
3296
-     *
3297
-     * @since 1.0.0
3298
-     */
3299
-    do_action('geodir_before_home_content');
3300
-    /**
3301
-     * This is used to add the content to the home page main content.
3302
-     *
3303
-     * @since 1.0.0
3304
-     */
3305
-    do_action('geodir_home_content_inside');
3306
-    /**
3307
-     * This is called after the homepage main content.
3308
-     *
3309
-     * @since 1.0.0
3310
-     */
3311
-    do_action('geodir_after_home_content');
3312
-    /** This action is documented in geodirectory_template_actions.php */
3313
-    do_action('geodir_main_content_close', 'home-page');
3292
+	/** This action is documented in geodirectory_template_actions.php */
3293
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3294
+	/**
3295
+	 * This called before the home page main content.
3296
+	 *
3297
+	 * @since 1.0.0
3298
+	 */
3299
+	do_action('geodir_before_home_content');
3300
+	/**
3301
+	 * This is used to add the content to the home page main content.
3302
+	 *
3303
+	 * @since 1.0.0
3304
+	 */
3305
+	do_action('geodir_home_content_inside');
3306
+	/**
3307
+	 * This is called after the homepage main content.
3308
+	 *
3309
+	 * @since 1.0.0
3310
+	 */
3311
+	do_action('geodir_after_home_content');
3312
+	/** This action is documented in geodirectory_template_actions.php */
3313
+	do_action('geodir_main_content_close', 'home-page');
3314 3314
 }
3315 3315
 
3316 3316
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3325,11 +3325,11 @@  discard block
 block discarded – undo
3325 3325
  */
3326 3326
 function geodir_action_sidebar_home_bottom_section()
3327 3327
 {
3328
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3328
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3329 3329
         <div
3330 3330
             class="<?php
3331
-            /** This action is documented in geodirectory_template_actions.php */
3332
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3331
+			/** This action is documented in geodirectory_template_actions.php */
3332
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3333 3333
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3334 3334
         </div><!-- clearfix ends here-->
3335 3335
     <?php }
@@ -3357,13 +3357,13 @@  discard block
 block discarded – undo
3357 3357
  */
3358 3358
 function geodir_filter_listing_page_title($list_title)
3359 3359
 {
3360
-    if (is_search() && trim(get_search_query()) == '') {
3361
-        $gd_post_type = geodir_get_current_posttype();
3362
-        $post_type_info = get_post_type_object($gd_post_type);
3360
+	if (is_search() && trim(get_search_query()) == '') {
3361
+		$gd_post_type = geodir_get_current_posttype();
3362
+		$post_type_info = get_post_type_object($gd_post_type);
3363 3363
 
3364
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3365
-    }
3366
-    return $list_title;
3364
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3365
+	}
3366
+	return $list_title;
3367 3367
 }
3368 3368
 
3369 3369
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3378,61 +3378,61 @@  discard block
 block discarded – undo
3378 3378
  * @param string $gd_page The geodirectory page type. Default null.
3379 3379
  */
3380 3380
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3381
-    global $post;
3381
+	global $post;
3382 3382
         
3383
-    $gd_page_id = NULL;
3384
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3385
-        $gd_page_id = geodir_home_page_id();
3386
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3387
-        $gd_page_id = geodir_preview_page_id();
3388
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3389
-        $gd_page_id = geodir_add_listing_page_id();
3390
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3391
-        $gd_page_id = geodir_success_page_id();
3392
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3393
-        $gd_page_id = geodir_location_page_id();
3394
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3395
-        $gd_page_id = geodir_info_page_id();
3396
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3397
-        $gd_page_id = geodir_login_page_id();
3398
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3399
-        $gd_page_id = geodir_payment_checkout_page_id();
3400
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3401
-        $gd_page_id = geodir_payment_invoices_page_id();
3402
-    }
3383
+	$gd_page_id = NULL;
3384
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3385
+		$gd_page_id = geodir_home_page_id();
3386
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3387
+		$gd_page_id = geodir_preview_page_id();
3388
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3389
+		$gd_page_id = geodir_add_listing_page_id();
3390
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3391
+		$gd_page_id = geodir_success_page_id();
3392
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3393
+		$gd_page_id = geodir_location_page_id();
3394
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3395
+		$gd_page_id = geodir_info_page_id();
3396
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3397
+		$gd_page_id = geodir_login_page_id();
3398
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3399
+		$gd_page_id = geodir_payment_checkout_page_id();
3400
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3401
+		$gd_page_id = geodir_payment_invoices_page_id();
3402
+	}
3403 3403
     
3404
-    if (!$gd_page_id > 0) {
3405
-        return;
3406
-    }
3404
+	if (!$gd_page_id > 0) {
3405
+		return;
3406
+	}
3407 3407
     
3408
-    $display = 'before';
3409
-    /**
3410
-     * Filter the position to display the page content.
3411
-     *
3412
-     * @since 1.6.3
3413
-     *
3414
-     * @param string $display Position to add the post content.
3415
-     * @param string $gd_page The geodirectory page type.
3416
-     */
3417
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3408
+	$display = 'before';
3409
+	/**
3410
+	 * Filter the position to display the page content.
3411
+	 *
3412
+	 * @since 1.6.3
3413
+	 *
3414
+	 * @param string $display Position to add the post content.
3415
+	 * @param string $gd_page The geodirectory page type.
3416
+	 */
3417
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3418 3418
     
3419
-    if ($position !== $display) {
3420
-        return;
3421
-    }
3419
+	if ($position !== $display) {
3420
+		return;
3421
+	}
3422 3422
         
3423
-    $gd_post = $post;
3423
+	$gd_post = $post;
3424 3424
     
3425
-    setup_postdata(get_post($gd_page_id));
3425
+	setup_postdata(get_post($gd_page_id));
3426 3426
     
3427
-    if (get_the_content()) {
3428
-        ?>
3427
+	if (get_the_content()) {
3428
+		?>
3429 3429
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3430 3430
         <?php
3431
-    }
3431
+	}
3432 3432
     
3433
-    $post = $gd_post;
3434
-    if (!empty($gd_post) && is_object($gd_post)) {
3435
-        setup_postdata($gd_post);
3436
-    }
3433
+	$post = $gd_post;
3434
+	if (!empty($gd_post) && is_object($gd_post)) {
3435
+		setup_postdata($gd_post);
3436
+	}
3437 3437
 }
3438 3438
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3439 3439
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +163 added lines, -163 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,16 +1668,16 @@  discard block
 block discarded – undo
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;
1675 1675
         }
1676 1676
 
1677 1677
         // stop payment manager filtering content length
1678
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1679
-        if ( false !== $filter_priority ) {
1680
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1678
+        $filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1679
+        if (false !== $filter_priority) {
1680
+            remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1681 1681
         }
1682 1682
 
1683 1683
         /**
@@ -1691,14 +1691,14 @@  discard block
 block discarded – undo
1691 1691
         $cat_description = apply_filters('the_content', $saved_data);
1692 1692
 
1693 1693
 
1694
-        if ( false !== $filter_priority ) {
1695
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1694
+        if (false !== $filter_priority) {
1695
+            add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1696 1696
         }
1697 1697
 
1698 1698
         if ($cat_description) {
1699 1699
             ?>
1700 1700
 
1701
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1701
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1702 1702
         }
1703 1703
 
1704 1704
     }
@@ -1748,13 +1748,13 @@  discard block
 block discarded – undo
1748 1748
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1749 1749
 {
1750 1750
     if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1751
-        $width_css = 'style="width:' . $width . '%;"';
1751
+        $width_css = 'style="width:'.$width.'%;"';
1752 1752
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1753
-        $width_css = 'style="width:' . $width . '%;"';
1753
+        $width_css = 'style="width:'.$width.'%;"';
1754 1754
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1755
-        $width_css = 'style="width:' . $width . '%;"';
1755
+        $width_css = 'style="width:'.$width.'%;"';
1756 1756
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1757
-        $width_css = 'style="width:' . $width . '%;"';
1757
+        $width_css = 'style="width:'.$width.'%;"';
1758 1758
     } else {
1759 1759
         $width_css = '';
1760 1760
     }
@@ -2059,11 +2059,11 @@  discard block
 block discarded – undo
2059 2059
 
2060 2060
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2061 2061
 
2062
-    if(geodir_is_page('add-listing')){
2062
+    if (geodir_is_page('add-listing')) {
2063 2063
         $gd_page = 'add-listing';
2064
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2064
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2065 2065
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2066
-        }elseif(isset($listing_type)){
2066
+        }elseif (isset($listing_type)) {
2067 2067
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2068 2068
         }
2069 2069
 
@@ -2077,9 +2077,9 @@  discard block
 block discarded – undo
2077 2077
      * @param string $title The page title including variables.
2078 2078
      * @param string $gd_page The GeoDirectory page type if any.
2079 2079
      */
2080
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2080
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2081 2081
 
2082
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2082
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">';
2083 2083
     echo $title;
2084 2084
     echo '</h1></header>';
2085 2085
 }
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
  */
2094 2094
 function geodir_action_add_listing_page_mandatory()
2095 2095
 {?>
2096
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2096
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2097 2097
 <?php
2098 2098
 }
2099 2099
 
@@ -2128,7 +2128,7 @@  discard block
 block discarded – undo
2128 2128
 
2129 2129
     if (isset($_REQUEST['backandedit'])) {
2130 2130
         global $post;
2131
-        $post = (object)$gd_session->get('listing');
2131
+        $post = (object) $gd_session->get('listing');
2132 2132
         $listing_type = $post->listing_type;
2133 2133
         $title = $post->post_title;
2134 2134
         $desc = $post->post_desc;
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
         $thumb_img_arr = geodir_get_images($post->ID);
2144 2144
         if ($thumb_img_arr) {
2145 2145
             foreach ($thumb_img_arr as $post_img) {
2146
-                $curImages .= $post_img->src . ',';
2146
+                $curImages .= $post_img->src.',';
2147 2147
             }
2148 2148
         }
2149 2149
 
@@ -2151,7 +2151,7 @@  discard block
 block discarded – undo
2151 2151
         $title = $post->post_title;
2152 2152
         $desc = $post->post_content;
2153 2153
         $kw_tags = $post->post_tags;
2154
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2154
+        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
2155 2155
     } else {
2156 2156
         $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2157 2157
     }
@@ -2162,18 +2162,18 @@  discard block
 block discarded – undo
2162 2162
 
2163 2163
     $post_type_info = geodir_get_posttype_info($listing_type);
2164 2164
 
2165
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2165
+    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing', 'geodirectory');
2166 2166
 
2167 2167
     ?>
2168
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2169
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2170
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2168
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2169
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2170
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2171 2171
         <?php if ($page_id) { ?>
2172
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2172
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2173 2173
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2174
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2174
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2175 2175
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2176
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2176
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2177 2177
         <?php
2178 2178
         } 
2179 2179
         /**
@@ -2185,7 +2185,7 @@  discard block
 block discarded – undo
2185 2185
          */
2186 2186
         do_action('geodir_before_detail_fields');
2187 2187
         ?>
2188
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2188
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2189 2189
         <?php
2190 2190
         /**
2191 2191
          * Called at the top of the add listing page form for frontend.
@@ -2197,10 +2197,10 @@  discard block
 block discarded – undo
2197 2197
         do_action('geodir_before_main_form_fields');
2198 2198
         ?>
2199 2199
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2200
-            <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label>
2200
+            <label><?php echo sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name); ?><span>*</span> </label>
2201 2201
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2202 2202
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2203
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2203
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2204 2204
         </div>
2205 2205
         <?php
2206 2206
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2235,7 +2235,7 @@  discard block
 block discarded – undo
2235 2235
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2236 2236
         
2237 2237
         $desc_class = '';
2238
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2238
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2239 2239
             /**
2240 2240
              * Called on the add listing page form for frontend just before the description field.
2241 2241
              *
@@ -2248,8 +2248,8 @@  discard block
 block discarded – undo
2248 2248
             $desc_class = ' hidden';
2249 2249
         }
2250 2250
         ?>
2251
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2252
-            <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2251
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2252
+            <label><?php echo sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2253 2253
             <?php
2254 2254
             if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2255 2255
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2258,16 +2258,16 @@  discard block
 block discarded – undo
2258 2258
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2259 2259
                 </div>
2260 2260
             <?php if ($desc_limit != '') { ?>
2261
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2261
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2262 2262
             <?php } } else { ?>
2263 2263
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2264 2264
             <?php } if ($desc_limit_msg != '') { ?>
2265 2265
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2266 2266
             <?php } ?>
2267
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2267
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2268 2268
         </div>
2269 2269
         <?php
2270
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2270
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2271 2271
             /**
2272 2272
              * Called on the add listing page form for frontend just after the description field.
2273 2273
              *
@@ -2306,7 +2306,7 @@  discard block
 block discarded – undo
2306 2306
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2307 2307
         
2308 2308
         $tags_class = '';
2309
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2309
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2310 2310
             /**
2311 2311
              * Called on the add listing page form for frontend just before the tags field.
2312 2312
              *
@@ -2317,14 +2317,14 @@  discard block
 block discarded – undo
2317 2317
             $tags_class = ' hidden';
2318 2318
         }
2319 2319
         ?>
2320
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2320
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2321 2321
             <label><?php echo TAGKW_TEXT; ?></label>
2322 2322
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2323
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2324
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2323
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2324
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2325 2325
         </div>
2326 2326
         <?php
2327
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2327
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2328 2328
             /**
2329 2329
              * Called on the add listing page form for frontend just after the tags field.
2330 2330
              *
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
         $thumb_img_arr = array();
2351 2351
         $totImg = 0;
2352 2352
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2353
-            $post = (object)$gd_session->get('listing');
2353
+            $post = (object) $gd_session->get('listing');
2354 2354
             if (isset($post->post_images))
2355 2355
                 $curImages = trim($post->post_images, ",");
2356 2356
 
@@ -2363,7 +2363,7 @@  discard block
 block discarded – undo
2363 2363
             $listing_type = $post->listing_type;
2364 2364
 
2365 2365
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2366
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2366
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2367 2367
             $listing_type = $post->post_type;
2368 2368
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2369 2369
 
@@ -2377,7 +2377,7 @@  discard block
 block discarded – undo
2377 2377
                 //$curImages = $img->src.",";
2378 2378
             }
2379 2379
 
2380
-            $totImg = count((array)$thumb_img_arr);
2380
+            $totImg = count((array) $thumb_img_arr);
2381 2381
         }
2382 2382
 
2383 2383
         if ($curImages != '')
@@ -2398,15 +2398,15 @@  discard block
 block discarded – undo
2398 2398
         if ($show_image_input_box) {
2399 2399
             ?>
2400 2400
 
2401
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2401
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2402 2402
                 <?php if ($image_limit == 1) {
2403
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2403
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
2404 2404
                 } ?>
2405 2405
                 <?php if ($image_limit > 1) {
2406
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2406
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
2407 2407
                 } ?>
2408 2408
                 <?php if ($image_limit == '') {
2409
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2409
+                    echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
2410 2410
                 } ?>
2411 2411
             </h5>
2412 2412
 
@@ -2421,11 +2421,11 @@  discard block
 block discarded – undo
2421 2421
                 <div
2422 2422
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2423 2423
                     id="<?php echo $id; ?>plupload-upload-ui">
2424
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2424
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2425 2425
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2426 2426
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2427 2427
                     <span class="ajaxnonceplu"
2428
-                          id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span>
2428
+                          id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span>
2429 2429
                     <?php if ($width && $height): ?>
2430 2430
                         <span class="plupload-resize"></span>
2431 2431
                         <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span>
@@ -2438,7 +2438,7 @@  discard block
 block discarded – undo
2438 2438
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2439 2439
                 </div>
2440 2440
                 <span
2441
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2441
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2442 2442
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2443 2443
             </div>
2444 2444
 
@@ -2450,7 +2450,7 @@  discard block
 block discarded – undo
2450 2450
          *
2451 2451
          * @since 1.0.0
2452 2452
          */
2453
-        do_action('geodir_after_main_form_fields');?>
2453
+        do_action('geodir_after_main_form_fields'); ?>
2454 2454
 
2455 2455
 
2456 2456
         <!-- add captcha code -->
@@ -2461,7 +2461,7 @@  discard block
 block discarded – undo
2461 2461
         </script>
2462 2462
         <noscript>
2463 2463
             <div>
2464
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2464
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2465 2465
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2466 2466
             </div>
2467 2467
         </noscript>
@@ -2471,10 +2471,10 @@  discard block
 block discarded – undo
2471 2471
         <!-- end captcha code -->
2472 2472
 
2473 2473
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2474
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2475
-                   class="geodir_button" <?php echo $submit_button;?>/>
2474
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2475
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2476 2476
             <span class="geodir_message_note"
2477
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2477
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2478 2478
         </div>
2479 2479
 
2480 2480
     </form>
@@ -2536,7 +2536,7 @@  discard block
 block discarded – undo
2536 2536
         class="<?php
2537 2537
         /** This action is documented in geodirectory_template_actions.php */
2538 2538
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2539
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2539
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2540 2540
     </div><!-- clearfix ends here-->
2541 2541
 <?php
2542 2542
 }
@@ -2558,7 +2558,7 @@  discard block
 block discarded – undo
2558 2558
 
2559 2559
     ?>
2560 2560
     <script type="text/javascript">
2561
-        <?php if ( $user_login ) { ?>
2561
+        <?php if ($user_login) { ?>
2562 2562
         setTimeout(function () {
2563 2563
             try {
2564 2564
                 d = document.getElementById('user_pass');
@@ -2575,7 +2575,7 @@  discard block
 block discarded – undo
2575 2575
         <?php } ?>
2576 2576
     </script>
2577 2577
     <script type="text/javascript">
2578
-        <?php if ( $user_login ) { ?>
2578
+        <?php if ($user_login) { ?>
2579 2579
         setTimeout(function () {
2580 2580
             try {
2581 2581
                 d = document.getElementById('user_pass');
@@ -2600,7 +2600,7 @@  discard block
 block discarded – undo
2600 2600
         foreach ($errors as $errorsObj) {
2601 2601
             foreach ($errorsObj as $key => $val) {
2602 2602
                 for ($i = 0; $i < count($val); $i++) {
2603
-                    echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2603
+                    echo "<div class=sucess_msg>".$val[$i].'</div>';
2604 2604
                     $registration_error_msg = 1;
2605 2605
                 }
2606 2606
             }
@@ -2617,7 +2617,7 @@  discard block
 block discarded – undo
2617 2617
              *
2618 2618
              * @since 1.0.0
2619 2619
              */
2620
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2620
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2621 2621
         </div>
2622 2622
 
2623 2623
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
@@ -2629,7 +2629,7 @@  discard block
 block discarded – undo
2629 2629
              *
2630 2630
              * @since 1.0.0
2631 2631
              */
2632
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2632
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2633 2633
         </div>
2634 2634
 
2635 2635
     <?php } else { ?>
@@ -2641,7 +2641,7 @@  discard block
 block discarded – undo
2641 2641
              *
2642 2642
              * @since 1.0.0
2643 2643
              */
2644
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2644
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2645 2645
         </div>
2646 2646
         <div class="registration_form_r">
2647 2647
             <?php
@@ -2650,7 +2650,7 @@  discard block
 block discarded – undo
2650 2650
              *
2651 2651
              * @since 1.0.0
2652 2652
              */
2653
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2653
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2654 2654
         </div>
2655 2655
 
2656 2656
     <?php }?>
@@ -2686,12 +2686,12 @@  discard block
 block discarded – undo
2686 2686
     $gd_post_type = geodir_get_current_posttype();
2687 2687
     $post_type_info = get_post_type_object($gd_post_type);
2688 2688
 
2689
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2689
+    $add_string_in_title = __('All', 'geodirectory').' ';
2690 2690
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2691
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2691
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
2692 2692
     }
2693 2693
 
2694
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2694
+    $list_title = $add_string_in_title.$post_type_info->labels->name;
2695 2695
     $single_name = $post_type_info->labels->singular_name;
2696 2696
 
2697 2697
     $taxonomy = geodir_get_taxonomies($gd_post_type);
@@ -2699,12 +2699,12 @@  discard block
 block discarded – undo
2699 2699
     if (!empty($term)) {
2700 2700
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2701 2701
         if (!empty($current_term))
2702
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2702
+            $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
2703 2703
     }
2704 2704
 
2705 2705
 
2706 2706
     if (is_search()) {
2707
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2707
+        $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2708 2708
 
2709 2709
     }
2710 2710
     /** This action is documented in geodirectory_template_actions.php */
@@ -2713,11 +2713,11 @@  discard block
 block discarded – undo
2713 2713
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2714 2714
 
2715 2715
     $title = $list_title;
2716
-    if(geodir_is_page('author')){
2716
+    if (geodir_is_page('author')) {
2717 2717
         $gd_page = 'author';
2718
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2718
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2719 2719
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2720
-        }else{
2720
+        } else {
2721 2721
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2722 2722
         }
2723 2723
 
@@ -2731,16 +2731,16 @@  discard block
 block discarded – undo
2731 2731
      * @param string $title The page title including variables.
2732 2732
      * @param string $gd_page The GeoDirectory page type if any.
2733 2733
      */
2734
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2734
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2735 2735
 
2736
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2736
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2737 2737
         /**
2738 2738
          * Filter the author page title text.
2739 2739
          *
2740 2740
          * @since 1.0.0
2741 2741
          * @param string $list_title The title for the page.
2742 2742
          */
2743
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2743
+        apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
2744 2744
 }
2745 2745
 
2746 2746
 
@@ -2945,19 +2945,19 @@  discard block
 block discarded – undo
2945 2945
     $post_type_info = get_post_type_object($gd_post_type);
2946 2946
 
2947 2947
     $pt_name = '';
2948
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2948
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
2949 2949
 
2950 2950
     if (is_search()) {
2951
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2951
+        $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2952 2952
 
2953 2953
     }
2954 2954
     /** This action is documented in geodirectory_template_actions.php */
2955 2955
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2956 2956
     /** This action is documented in geodirectory_template_actions.php */
2957 2957
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2958
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2958
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2959 2959
         /** This action is documented in geodirectory_template_actions.php */
2960
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2960
+        apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
2961 2961
 }
2962 2962
 
2963 2963
 // action for adding the listings page top widget area
@@ -3361,7 +3361,7 @@  discard block
 block discarded – undo
3361 3361
         $gd_post_type = geodir_get_current_posttype();
3362 3362
         $post_type_info = get_post_type_object($gd_post_type);
3363 3363
 
3364
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3364
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
3365 3365
     }
3366 3366
     return $list_title;
3367 3367
 }
@@ -3377,7 +3377,7 @@  discard block
 block discarded – undo
3377 3377
  * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'.
3378 3378
  * @param string $gd_page The geodirectory page type. Default null.
3379 3379
  */
3380
-function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3380
+function geodir_add_page_content($position = 'before', $gd_page = '') {
3381 3381
     global $post;
3382 3382
         
3383 3383
     $gd_page_id = NULL;
Please login to merge, or discard this patch.
geodirectory-functions/listing_filters.php 3 patches
Braces   +30 added lines, -19 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_session_start()
18 18
 {
19
-    if (!session_id()) session_start();
19
+    if (!session_id()) {
20
+    	session_start();
21
+    }
20 22
     global $geodir_add_location_url;
21 23
 
22 24
     $geodir_add_location_url = NULL;
@@ -86,7 +88,9 @@  discard block
 block discarded – undo
86 88
 
87 89
     if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
88 90
 
89
-        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
91
+        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') {
92
+        	$_REQUEST['scat'] = '';
93
+        }
90 94
         //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
91 95
 
92 96
         if (isset($_REQUEST['sdist'])) {
@@ -198,8 +202,9 @@  discard block
 block discarded – undo
198 202
         add_filter('posts_fields', 'geodir_posts_fields', 1);
199 203
         add_filter('posts_join', 'geodir_posts_join', 1);
200 204
         geodir_post_where();
201
-        if (!is_admin())
202
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
205
+        if (!is_admin()) {
206
+                    add_filter('posts_orderby', 'geodir_posts_orderby', 1);
207
+        }
203 208
 
204 209
         // advanced filter for popular post view widget
205 210
         global $wp_query;
@@ -346,8 +351,9 @@  discard block
 block discarded – undo
346 351
     $sort_by = '';
347 352
     $orderby = ' ';
348 353
 
349
-    if (get_query_var('order_by'))
350
-        $sort_by = get_query_var('order_by');
354
+    if (get_query_var('order_by')) {
355
+            $sort_by = get_query_var('order_by');
356
+    }
351 357
 
352 358
     /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
353 359
         $current_term = $wp_query->get_queried_object();
@@ -367,14 +373,16 @@  discard block
 block discarded – undo
367 373
         $orderby .= " distance,";
368 374
     }
369 375
 
370
-    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
371
-        $sort_by = esc_attr($_REQUEST['sort_by']);
376
+    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) {
377
+            $sort_by = esc_attr($_REQUEST['sort_by']);
378
+    }
372 379
 
373 380
 
374 381
     if ($sort_by == '') {
375 382
         $default_sort = geodir_get_posts_default_sort($geodir_post_type);
376
-        if (!empty($default_sort))
377
-            $sort_by = $default_sort;
383
+        if (!empty($default_sort)) {
384
+                    $sort_by = $default_sort;
385
+        }
378 386
     }
379 387
 
380 388
     /*
@@ -562,8 +570,9 @@  discard block
 block discarded – undo
562 570
 
563 571
             add_filter('posts_where', 'searching_filter_where', 1);
564 572
 
565
-            if ($snear != '')
566
-                add_filter('posts_where', 'searching_filter_where', 1);
573
+            if ($snear != '') {
574
+                            add_filter('posts_where', 'searching_filter_where', 1);
575
+            }
567 576
 
568 577
             add_filter('posts_orderby', 'geodir_posts_orderby', 1);
569 578
 
@@ -731,10 +740,11 @@  discard block
 block discarded – undo
731 740
     }
732 741
 
733 742
     $better_search_terms = '';
734
-    if (isset($_REQUEST['stype']))
735
-        $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
736
-    else
737
-        $post_types = 'gd_place';
743
+    if (isset($_REQUEST['stype'])) {
744
+            $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
745
+    } else {
746
+            $post_types = 'gd_place';
747
+    }
738 748
 
739 749
     if ($s != '') {
740 750
         $keywords = explode(" ", $s);
@@ -762,7 +772,7 @@  discard block
 block discarded – undo
762 772
     if($taxonomies) {
763 773
         $taxonomies = implode("','", $taxonomies);
764 774
         $taxonomies = "'" . $taxonomies . "'";
765
-    }else{$taxonomies='';}
775
+    } else{$taxonomies='';}
766 776
 
767 777
     $content_where = $terms_where = '';
768 778
 	if ($s != '') {
@@ -878,8 +888,9 @@  discard block
 block discarded – undo
878 888
             $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
879 889
             $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
880 890
             $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
881
-        } else
882
-            $where .= " AND $wpdb->posts.post_author = $user_id";
891
+        } else {
892
+                    $where .= " AND $wpdb->posts.post_author = $user_id";
893
+        }
883 894
 
884 895
         if ($user_id == (int)get_current_user_id()) {
885 896
             $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
Please login to merge, or discard this patch.
Indentation   +516 added lines, -516 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_session_start()
18 18
 {
19
-    if (!session_id()) session_start();
20
-    global $geodir_add_location_url;
19
+	if (!session_id()) session_start();
20
+	global $geodir_add_location_url;
21 21
 
22
-    $geodir_add_location_url = NULL;
22
+	$geodir_add_location_url = NULL;
23 23
 }
24 24
 
25 25
 /**
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
  */
34 34
 function geodir_modified_query($query)
35 35
 {
36
-    if ($query->is_main_query() && (
37
-            (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
-            || geodir_is_page('listing')
39
-            || geodir_is_page('author')
40
-            || geodir_is_page('search')
41
-            || geodir_is_page('detail'))
42
-    ) {
43
-
44
-        $query->set('is_geodir_loop', true);
45
-    }
36
+	if ($query->is_main_query() && (
37
+			(geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
+			|| geodir_is_page('listing')
39
+			|| geodir_is_page('author')
40
+			|| geodir_is_page('search')
41
+			|| geodir_is_page('detail'))
42
+	) {
43
+
44
+		$query->set('is_geodir_loop', true);
45
+	}
46 46
 
47
-    return $query;
47
+	return $query;
48 48
 }
49 49
 
50 50
 /**
@@ -67,81 +67,81 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function set_listing_request()
69 69
 {
70
-    global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
70
+	global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
71 71
 
72 72
 
73
-    // fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
-    if (!geodir_is_geodir_page()) {
75
-        return;
76
-    }
73
+	// fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
+	if (!geodir_is_geodir_page()) {
75
+		return;
76
+	}
77 77
 
78
-    /* remove all pre filters */
79
-    remove_all_filters('query');
80
-    remove_all_filters('posts_search');
81
-    remove_all_filters('posts_fields');
82
-    remove_all_filters('posts_join');
83
-    remove_all_filters('posts_orderby');
84
-    remove_all_filters('posts_where');
78
+	/* remove all pre filters */
79
+	remove_all_filters('query');
80
+	remove_all_filters('posts_search');
81
+	remove_all_filters('posts_fields');
82
+	remove_all_filters('posts_join');
83
+	remove_all_filters('posts_orderby');
84
+	remove_all_filters('posts_where');
85 85
 
86 86
 
87
-    if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
87
+	if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
88 88
 
89
-        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
-        //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
89
+		if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
+		//if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
91 91
 
92
-        if (isset($_REQUEST['sdist'])) {
93
-            ($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
-        } elseif (get_option('geodir_search_dist') != '') {
95
-            $dist = get_option('geodir_search_dist');
92
+		if (isset($_REQUEST['sdist'])) {
93
+			($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
+		} elseif (get_option('geodir_search_dist') != '') {
95
+			$dist = get_option('geodir_search_dist');
96 96
 
97
-        } else {
98
-            $dist = 25000;
99
-        } //  Distance
97
+		} else {
98
+			$dist = 25000;
99
+		} //  Distance
100 100
 
101
-        if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
-        } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
105
-        } //  Latatude
101
+		if (isset($_REQUEST['sgeo_lat'])) {
102
+			$mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
+		} else {
104
+			$mylat = (float)geodir_get_current_city_lat();
105
+		} //  Latatude
106 106
 
107
-        if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
-        } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
111
-        } //  Distance
107
+		if (isset($_REQUEST['sgeo_lon'])) {
108
+			$mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
+		} else {
110
+			$mylon = (float)geodir_get_current_city_lng();
111
+		} //  Distance
112 112
 
113
-        if (isset($_REQUEST['snear'])) {
114
-            $snear = trim(esc_attr($_REQUEST['snear']));
115
-        }
113
+		if (isset($_REQUEST['snear'])) {
114
+			$snear = trim(esc_attr($_REQUEST['snear']));
115
+		}
116 116
 
117
-        if (isset($_REQUEST['s'])) {
118
-            $s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
-        }
117
+		if (isset($_REQUEST['s'])) {
118
+			$s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
+		}
120 120
 
121
-        if ($snear == 'NEAR ME') {
122
-            $ip = $_SERVER['REMOTE_ADDR'];
123
-            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
-            $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
-            $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
-        }
121
+		if ($snear == 'NEAR ME') {
122
+			$ip = $_SERVER['REMOTE_ADDR'];
123
+			$addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
+			$mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
+			$mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
+		}
127 127
 
128 128
 
129
-        if (strstr($s, ',')) {
130
-            $s_AA = str_replace(" ", "", $s);
131
-            $s_A = explode(",", $s_AA);
132
-            $s_A = implode('","', $s_A);
133
-            $s_A = '"' . $s_A . '"';
134
-        } else {
135
-            $s_A = '"' . $s . '"';
136
-        }
129
+		if (strstr($s, ',')) {
130
+			$s_AA = str_replace(" ", "", $s);
131
+			$s_A = explode(",", $s_AA);
132
+			$s_A = implode('","', $s_A);
133
+			$s_A = '"' . $s_A . '"';
134
+		} else {
135
+			$s_A = '"' . $s . '"';
136
+		}
137 137
 
138
-        if (strstr($s, ' ')) {
139
-            $s_SA = explode(" ", $s);
140
-        } else {
141
-            $s_SA = '';
142
-        }
138
+		if (strstr($s, ' ')) {
139
+			$s_SA = explode(" ", $s);
140
+		} else {
141
+			$s_SA = '';
142
+		}
143 143
 
144
-    endif;
144
+	endif;
145 145
 
146 146
 
147 147
 
@@ -162,56 +162,56 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function geodir_listing_loop_filter($query)
164 164
 {
165
-    global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
165
+	global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
166 166
 
167
-    // fix wp_reset_query for popular post view widget
168
-    if (!geodir_is_geodir_page()) {
169
-        return;
170
-    }
167
+	// fix wp_reset_query for popular post view widget
168
+	if (!geodir_is_geodir_page()) {
169
+		return;
170
+	}
171 171
 
172
-    $geodir_post_type = geodir_get_current_posttype();
173
-
174
-    if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
-        $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
-
177
-        if (isset($wp_query->query[$taxonomies[0]])) {
178
-            $request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
-            $request_term = end($request_term);
180
-            if (!term_exists($request_term)) {
181
-                $args = array('number' => '1',);
182
-                $terms_arr = get_terms($taxonomies[0], $args);
183
-                foreach ($terms_arr as $location_term) {
184
-                    $term_arr = $location_term;
185
-                    $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
-                }
187
-                $wp_query->queried_object_id = 1;
188
-                $wp_query->queried_object = $term_arr;
189
-                //print_r($wp_query) ;
190
-            }
191
-        }
172
+	$geodir_post_type = geodir_get_current_posttype();
173
+
174
+	if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
+		$taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
+
177
+		if (isset($wp_query->query[$taxonomies[0]])) {
178
+			$request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
+			$request_term = end($request_term);
180
+			if (!term_exists($request_term)) {
181
+				$args = array('number' => '1',);
182
+				$terms_arr = get_terms($taxonomies[0], $args);
183
+				foreach ($terms_arr as $location_term) {
184
+					$term_arr = $location_term;
185
+					$term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
+				}
187
+				$wp_query->queried_object_id = 1;
188
+				$wp_query->queried_object = $term_arr;
189
+				//print_r($wp_query) ;
190
+			}
191
+		}
192 192
 
193
-    }
194
-    if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
195
-
196
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
197
-
198
-        add_filter('posts_fields', 'geodir_posts_fields', 1);
199
-        add_filter('posts_join', 'geodir_posts_join', 1);
200
-        geodir_post_where();
201
-        if (!is_admin())
202
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
-
204
-        // advanced filter for popular post view widget
205
-        global $wp_query;
206
-        if (!is_admin()) {
207
-            if (!empty($wp_query->query['with_pics_only'])) {
208
-                add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
-            }
210
-            add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
-        }
193
+	}
194
+	if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
212 195
 
213
-    }
214
-    return $query;
196
+		$table = $plugin_prefix . $geodir_post_type . '_detail';
197
+
198
+		add_filter('posts_fields', 'geodir_posts_fields', 1);
199
+		add_filter('posts_join', 'geodir_posts_join', 1);
200
+		geodir_post_where();
201
+		if (!is_admin())
202
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
+
204
+		// advanced filter for popular post view widget
205
+		global $wp_query;
206
+		if (!is_admin()) {
207
+			if (!empty($wp_query->query['with_pics_only'])) {
208
+				add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
+			}
210
+			add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
+		}
212
+
213
+	}
214
+	return $query;
215 215
 }
216 216
 
217 217
 
@@ -230,67 +230,67 @@  discard block
 block discarded – undo
230 230
  * @return string Modified fields query string.
231 231
  */
232 232
 function geodir_posts_fields($fields) {
233
-    global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
233
+	global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
234 234
 
235
-    // Filter-Location-Manager to add location table.
236
-    $fields .= ", " . $table . ".* ";
235
+	// Filter-Location-Manager to add location table.
236
+	$fields .= ", " . $table . ".* ";
237 237
     
238 238
 	if ($snear != '' || $gd_session->get('all_near_me')) {
239
-        $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
239
+		$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
240 240
         
241 241
 		if ($gd_session->get('all_near_me')) {
242
-            $mylat = $gd_session->get('user_lat');
243
-            $mylon = $gd_session->get('user_lon');
244
-        }
245
-
246
-        $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
-    }
248
-
249
-    global $s;
250
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
-        $keywords = explode(" ", $s);
252
-
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
-                    unset($keywords[$kkey]);
257
-                }
258
-            }
259
-        }
242
+			$mylat = $gd_session->get('user_lat');
243
+			$mylon = $gd_session->get('user_lon');
244
+		}
260 245
 
246
+		$fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
+	}
261 248
 
262
-        if (count($keywords) > 1) {
263
-            $parts = array(
264
-                'AND' => 'gd_alltitlematch_part',
265
-                'OR' => 'gd_titlematch_part'
266
-            );
267
-            $gd_titlematch_part = "";
268
-            foreach ($parts as $key => $part) {
269
-                $gd_titlematch_part .= " CASE WHEN ";
270
-                $count = 0;
271
-                foreach ($keywords as $keyword) {
272
-                    $keyword = trim($keyword);
273
-                    $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
249
+	global $s;
250
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
+		$keywords = explode(" ", $s);
252
+
253
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
+			foreach($keywords as $kkey=>$kword){
255
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
+					unset($keywords[$kkey]);
257
+				}
258
+			}
259
+		}
260
+
261
+
262
+		if (count($keywords) > 1) {
263
+			$parts = array(
264
+				'AND' => 'gd_alltitlematch_part',
265
+				'OR' => 'gd_titlematch_part'
266
+			);
267
+			$gd_titlematch_part = "";
268
+			foreach ($parts as $key => $part) {
269
+				$gd_titlematch_part .= " CASE WHEN ";
270
+				$count = 0;
271
+				foreach ($keywords as $keyword) {
272
+					$keyword = trim($keyword);
273
+					$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
274 274
 					$count++;
275
-                    if ($count < count($keywords)) {
276
-                       // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
275
+					if ($count < count($keywords)) {
276
+					   // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
277 277
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
278
-                    } else {
279
-                        //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
278
+					} else {
279
+						//$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
280 280
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
281
-                    }
282
-                }
283
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
-            }
285
-        } else {
286
-            $gd_titlematch_part = "";
287
-        }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
281
+					}
282
+				}
283
+				$gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
+			}
285
+		} else {
286
+			$gd_titlematch_part = "";
287
+		}
288
+		$s = stripslashes_deep( $s );
289
+		$s = wp_specialchars_decode($s,ENT_QUOTES);
290 290
 		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
291
-    }
291
+	}
292 292
 
293
-    return $fields;
293
+	return $fields;
294 294
 }
295 295
 
296 296
 
@@ -307,26 +307,26 @@  discard block
 block discarded – undo
307 307
  */
308 308
 function geodir_posts_join($join)
309 309
 {
310
-    global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
310
+	global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
311 311
 
312
-    ########### WPML ###########
312
+	########### WPML ###########
313 313
 
314
-    if (function_exists('icl_object_id')) {
315
-        global $sitepress;
316
-        $lang_code = ICL_LANGUAGE_CODE;
317
-        $default_lang_code = $sitepress->get_default_language();
318
-        if ($lang_code) {
319
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
-        }
314
+	if (function_exists('icl_object_id')) {
315
+		global $sitepress;
316
+		$lang_code = ICL_LANGUAGE_CODE;
317
+		$default_lang_code = $sitepress->get_default_language();
318
+		if ($lang_code) {
319
+			$join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
+		}
321 321
 
322
-    }
323
-    ########### WPML ###########
322
+	}
323
+	########### WPML ###########
324 324
 
325
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
-    //===old code start
327
-    //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
325
+	$join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
+	//===old code start
327
+	//$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
328 328
 
329
-    return $join;
329
+	return $join;
330 330
 }
331 331
 
332 332
 
@@ -344,15 +344,15 @@  discard block
 block discarded – undo
344 344
  */
345 345
 function geodir_posts_orderby($orderby)
346 346
 {
347
-    global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
347
+	global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
348 348
 
349
-    $sort_by = '';
350
-    $orderby = ' ';
349
+	$sort_by = '';
350
+	$orderby = ' ';
351 351
 
352
-    if (get_query_var('order_by'))
353
-        $sort_by = get_query_var('order_by');
352
+	if (get_query_var('order_by'))
353
+		$sort_by = get_query_var('order_by');
354 354
 
355
-    /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
355
+	/*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
356 356
         $current_term = $wp_query->get_queried_object();
357 357
     }
358 358
 
@@ -366,116 +366,116 @@  discard block
 block discarded – undo
366 366
     }*/
367 367
 
368 368
 
369
-    if ($snear != '') {
370
-        $orderby .= " distance,";
371
-    }
369
+	if ($snear != '') {
370
+		$orderby .= " distance,";
371
+	}
372 372
 
373
-    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
-        $sort_by = esc_attr($_REQUEST['sort_by']);
373
+	if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
+		$sort_by = esc_attr($_REQUEST['sort_by']);
375 375
 
376 376
 
377
-    if ($sort_by == '') {
378
-        $default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
-        if (!empty($default_sort))
380
-            $sort_by = $default_sort;
381
-    }
377
+	if ($sort_by == '') {
378
+		$default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
+		if (!empty($default_sort))
380
+			$sort_by = $default_sort;
381
+	}
382 382
 
383
-    /*
383
+	/*
384 384
     if search by term & no location then order always "relevance"
385 385
     if search by location then order always "nearest"
386 386
     */
387
-    if (is_main_query() && geodir_is_page('search')) {
388
-        $search_term = get_query_var('s');
387
+	if (is_main_query() && geodir_is_page('search')) {
388
+		$search_term = get_query_var('s');
389 389
 
390
-        if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
-            $sort_by = 'az';
392
-        }
390
+		if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
+			$sort_by = 'az';
392
+		}
393 393
 
394
-        if ($snear != '') {
395
-            $sort_by = 'nearest';
396
-        }
397
-    }
394
+		if ($snear != '') {
395
+			$sort_by = 'nearest';
396
+		}
397
+	}
398 398
 
399
-    switch ($sort_by):
400
-        case 'newest':
401
-            $orderby = "$wpdb->posts.post_date desc, ";
402
-            break;
403
-        case 'oldest':
404
-            $orderby = "$wpdb->posts.post_date asc, ";
405
-            break;
406
-        case 'low_review':
407
-        case 'rating_count_asc':
408
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
-            break;
410
-        case 'high_review':
411
-        case 'rating_count_desc':
399
+	switch ($sort_by):
400
+		case 'newest':
401
+			$orderby = "$wpdb->posts.post_date desc, ";
402
+			break;
403
+		case 'oldest':
404
+			$orderby = "$wpdb->posts.post_date asc, ";
405
+			break;
406
+		case 'low_review':
407
+		case 'rating_count_asc':
408
+			$orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
+			break;
410
+		case 'high_review':
411
+		case 'rating_count_desc':
412 412
 			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
413
-            break;
414
-        case 'low_rating':
415
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
-            break;
417
-        case 'high_rating':
418
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
-            break;
420
-        case 'featured':
421
-            $orderby = $table . ".is_featured asc, ";
422
-            break;
423
-        case 'nearest':
424
-            $orderby = " distance asc, ";
425
-            break;
426
-        case 'farthest':
427
-            $orderby = " distance desc, ";
428
-            break;
429
-        case 'random':
430
-            $orderby = " rand(), ";
431
-            break;
432
-        case 'az':
433
-            $orderby = "$wpdb->posts.post_title asc, ";
434
-            break;
435
-        default:
436
-
437
-            break;
438
-    endswitch;
439
-
440
-    global $s;
441
-
442
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
443
-        $keywords = explode(" ", $s);
444
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
445
-            foreach($keywords as $kkey=>$kword){
446
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
447
-                    unset($keywords[$kkey]);
448
-                }
449
-            }
450
-        }
451
-        if ($sort_by == 'nearest' || $sort_by == 'farthest') {
452
-            if (count($keywords) > 1) {
453
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
454
-            } else {
455
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
456
-            }
457
-        } else {
458
-            if (count($keywords) > 1) {
459
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
460
-            } else {
461
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
462
-            }
463
-        }
464
-    }
413
+			break;
414
+		case 'low_rating':
415
+			$orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
+			break;
417
+		case 'high_rating':
418
+			$orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
+			break;
420
+		case 'featured':
421
+			$orderby = $table . ".is_featured asc, ";
422
+			break;
423
+		case 'nearest':
424
+			$orderby = " distance asc, ";
425
+			break;
426
+		case 'farthest':
427
+			$orderby = " distance desc, ";
428
+			break;
429
+		case 'random':
430
+			$orderby = " rand(), ";
431
+			break;
432
+		case 'az':
433
+			$orderby = "$wpdb->posts.post_title asc, ";
434
+			break;
435
+		default:
436
+
437
+			break;
438
+	endswitch;
439
+
440
+	global $s;
441
+
442
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
443
+		$keywords = explode(" ", $s);
444
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
445
+			foreach($keywords as $kkey=>$kword){
446
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
447
+					unset($keywords[$kkey]);
448
+				}
449
+			}
450
+		}
451
+		if ($sort_by == 'nearest' || $sort_by == 'farthest') {
452
+			if (count($keywords) > 1) {
453
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
454
+			} else {
455
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
456
+			}
457
+		} else {
458
+			if (count($keywords) > 1) {
459
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
460
+			} else {
461
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
462
+			}
463
+		}
464
+	}
465 465
 
466
-    /**
467
-     * Filter order by SQL.
468
-     *
469
-     * @since 1.0.0
470
-     * @param string $orderby The orderby query string.
471
-     * @param string $sort_by Sortby query string.
472
-     * @param string $table Listing table name.
473
-     */
474
-    $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
466
+	/**
467
+	 * Filter order by SQL.
468
+	 *
469
+	 * @since 1.0.0
470
+	 * @param string $orderby The orderby query string.
471
+	 * @param string $sort_by Sortby query string.
472
+	 * @param string $table Listing table name.
473
+	 */
474
+	$orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
475 475
 
476
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
476
+	$orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
477 477
 
478
-    return $orderby;
478
+	return $orderby;
479 479
 }
480 480
 
481 481
 
@@ -493,53 +493,53 @@  discard block
 block discarded – undo
493 493
 function geodir_posts_order_by_custom_sort($orderby, $sort_by, $table)
494 494
 {
495 495
 
496
-    global $wpdb;
496
+	global $wpdb;
497 497
 
498
-    if ($sort_by != '' && !is_search()) {
498
+	if ($sort_by != '' && !is_search()) {
499 499
 
500
-        $sort_array = explode('_', $sort_by);
500
+		$sort_array = explode('_', $sort_by);
501 501
 
502
-        $sort_by_count = count($sort_array);
502
+		$sort_by_count = count($sort_array);
503 503
 
504
-        $order = $sort_array[$sort_by_count - 1];
504
+		$order = $sort_array[$sort_by_count - 1];
505 505
 
506
-        if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
506
+		if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
507 507
 
508
-            $sort_by = str_replace('_' . $order, '', $sort_by);
508
+			$sort_by = str_replace('_' . $order, '', $sort_by);
509 509
 
510
-            switch ($sort_by):
510
+			switch ($sort_by):
511 511
 
512
-                case 'post_date':
513
-                case 'comment_count':
512
+				case 'post_date':
513
+				case 'comment_count':
514 514
 
515
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
516
-                    break;
515
+					$orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
516
+					break;
517 517
 
518
-                case 'distance':
519
-                    $orderby = $sort_by . " " . $order . ", ";
520
-                    break;
518
+				case 'distance':
519
+					$orderby = $sort_by . " " . $order . ", ";
520
+					break;
521 521
 
522 522
 
523
-                // sort by rating
524
-                case 'overall_rating':
525
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
523
+				// sort by rating
524
+				case 'overall_rating':
525
+					$orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
526 526
 
527
-                    break;
527
+					break;
528 528
 
529 529
 
530
-                default:
531
-                    if (geodir_column_exist($table, $sort_by)) {
530
+				default:
531
+					if (geodir_column_exist($table, $sort_by)) {
532 532
 						$orderby = $table . "." . $sort_by . " " . $order . ", ";
533 533
 					}
534
-                    break;
534
+					break;
535 535
 
536
-            endswitch;
536
+			endswitch;
537 537
 
538
-        }
538
+		}
539 539
 
540
-    }
540
+	}
541 541
 
542
-    return $orderby;
542
+	return $orderby;
543 543
 }
544 544
 
545 545
 /**
@@ -554,34 +554,34 @@  discard block
 block discarded – undo
554 554
 {
555 555
 
556 556
 
557
-    global $wpdb, $geodir_post_type, $table, $s, $snear;
557
+	global $wpdb, $geodir_post_type, $table, $s, $snear;
558 558
 
559
-    if (!is_admin()) {
559
+	if (!is_admin()) {
560 560
 
561
-        if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
562
-            add_filter('posts_where', 'geodir_edit_listing_where', 1);
561
+		if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
562
+			add_filter('posts_where', 'geodir_edit_listing_where', 1);
563 563
 
564
-        } elseif ((is_search() && $_REQUEST['geodir_search'])) {
564
+		} elseif ((is_search() && $_REQUEST['geodir_search'])) {
565 565
 
566
-            add_filter('posts_where', 'searching_filter_where', 1);
566
+			add_filter('posts_where', 'searching_filter_where', 1);
567 567
 
568
-            if ($snear != '')
569
-                add_filter('posts_where', 'searching_filter_where', 1);
568
+			if ($snear != '')
569
+				add_filter('posts_where', 'searching_filter_where', 1);
570 570
 
571
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
571
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
572 572
 
573
-        } elseif (geodir_is_page('author')) {
573
+		} elseif (geodir_is_page('author')) {
574 574
 
575
-            add_filter('posts_where', 'author_filter_where', 1);
575
+			add_filter('posts_where', 'author_filter_where', 1);
576 576
 
577
-        }
577
+		}
578 578
 
579
-        //if (!geodir_is_page('detail'))
580
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
579
+		//if (!geodir_is_page('detail'))
580
+			add_filter('posts_where', 'geodir_default_where', 1);/**/
581 581
 
582
-        //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
582
+		//add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
583 583
 
584
-    }
584
+	}
585 585
 }
586 586
 
587 587
 /**
@@ -596,13 +596,13 @@  discard block
 block discarded – undo
596 596
  */
597 597
 function geodir_preview_post_cap($allcaps, $caps, $args)
598 598
 {
599
-    $user_id = get_current_user_id();
600
-    if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
599
+	$user_id = get_current_user_id();
600
+	if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
601 601
 
602
-        $allcaps['edit_posts'] = true;
603
-    }
604
-    //print_r($allcaps);
605
-    return $allcaps;
602
+		$allcaps['edit_posts'] = true;
603
+	}
604
+	//print_r($allcaps);
605
+	return $allcaps;
606 606
 }
607 607
 
608 608
 
@@ -617,9 +617,9 @@  discard block
 block discarded – undo
617 617
  */
618 618
 function geodir_edit_listing_where($where)
619 619
 {
620
-    global $wpdb;
621
-    $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
622
-    return $where;
620
+	global $wpdb;
621
+	$where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
622
+	return $where;
623 623
 }
624 624
 
625 625
 
@@ -636,29 +636,29 @@  discard block
 block discarded – undo
636 636
  */
637 637
 function geodir_default_where($where)
638 638
 {
639
-    global $wp_query, $wpdb;
640
-
641
-    //print_r($wp_query);
642
-    ########### WPML ###########
643
-
644
-    if (function_exists('icl_object_id')) {
645
-        global $sitepress, $table_prefix;
646
-        $lang_code = ICL_LANGUAGE_CODE;
647
-        $default_lang_code = $sitepress->get_default_language();
648
-        $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
649
-        //echo '##########'.$q_post_type;
650
-        if ($lang_code && $q_post_type) {
651
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
652
-            //$where .= " AND icl_t.language_code = '$lang_code' ";
653
-        }
639
+	global $wp_query, $wpdb;
654 640
 
655
-    }
656
-    ########### WPML ###########
641
+	//print_r($wp_query);
642
+	########### WPML ###########
657 643
 
644
+	if (function_exists('icl_object_id')) {
645
+		global $sitepress, $table_prefix;
646
+		$lang_code = ICL_LANGUAGE_CODE;
647
+		$default_lang_code = $sitepress->get_default_language();
648
+		$q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
649
+		//echo '##########'.$q_post_type;
650
+		if ($lang_code && $q_post_type) {
651
+			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
652
+			//$where .= " AND icl_t.language_code = '$lang_code' ";
653
+		}
654
+
655
+	}
656
+	########### WPML ###########
658 657
 
659
-    return $where = str_replace("0 = 1", "1=1", $where);
660 658
 
661
-    /* ====== old code start ===
659
+	return $where = str_replace("0 = 1", "1=1", $where);
660
+
661
+	/* ====== old code start ===
662 662
     $where = str_replace("0 = 1", "1=1", $where);
663 663
     $country = get_query_var('gd_country');
664 664
     $region = get_query_var('gd_region');
@@ -699,108 +699,108 @@  discard block
 block discarded – undo
699 699
  * @return string Modified where query string.
700 700
  */
701 701
 function searching_filter_where($where) {
702
-    global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
702
+	global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
703 703
 	
704
-    $search_term = 'OR';
705
-    $search_term = 'AND';
706
-    $geodir_custom_search = '';
707
-    $category_search_range = '';
704
+	$search_term = 'OR';
705
+	$search_term = 'AND';
706
+	$geodir_custom_search = '';
707
+	$category_search_range = '';
708 708
 
709
-    if (is_single() && get_query_var('post_type')) {
709
+	if (is_single() && get_query_var('post_type')) {
710 710
 		return $where;
711 711
 	}
712 712
 
713
-    if (is_tax()) {
713
+	if (is_tax()) {
714 714
 		return $where;
715 715
 	}
716 716
 	
717 717
 	$s = trim($s);
718
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
719
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
720
-
721
-    $where = '';
722
-    $better_search_terms = '';
723
-    if (isset($_REQUEST['stype']))
724
-        $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
725
-    else
726
-        $post_types = 'gd_place';
727
-
728
-    if ($s != '') {
729
-        $keywords = explode(" ", $s);
730
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
731
-            foreach($keywords as $kkey=>$kword){
732
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
733
-                    unset($keywords[$kkey]);
734
-                }
735
-            }
736
-        }
718
+	$s  = wp_specialchars_decode($s ,ENT_QUOTES);
719
+	$s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
720
+
721
+	$where = '';
722
+	$better_search_terms = '';
723
+	if (isset($_REQUEST['stype']))
724
+		$post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
725
+	else
726
+		$post_types = 'gd_place';
737 727
 
738
-        if (!empty($keywords)) {
739
-            foreach ($keywords as $keyword) {
740
-                $keyword = trim($keyword);
741
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
742
-                if ($keyword != '') {
743
-                    /**
744
-                     * Filter the search query keywords SQL.
745
-                     *
746
-                     * @since 1.5.9
747
-                     * @package GeoDirectory
748
-                     * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
749
-                     * @param array $keywords The array of keywords for the query.
750
-                     * @param string $keyword The single keyword being searched.
751
-                     */
728
+	if ($s != '') {
729
+		$keywords = explode(" ", $s);
730
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
731
+			foreach($keywords as $kkey=>$kword){
732
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
733
+					unset($keywords[$kkey]);
734
+				}
735
+			}
736
+		}
737
+
738
+		if (!empty($keywords)) {
739
+			foreach ($keywords as $keyword) {
740
+				$keyword = trim($keyword);
741
+				$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
742
+				if ($keyword != '') {
743
+					/**
744
+					 * Filter the search query keywords SQL.
745
+					 *
746
+					 * @since 1.5.9
747
+					 * @package GeoDirectory
748
+					 * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
749
+					 * @param array $keywords The array of keywords for the query.
750
+					 * @param string $keyword The single keyword being searched.
751
+					 */
752 752
 					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
753
-                }
754
-            }
755
-        }
756
-    }
753
+				}
754
+			}
755
+		}
756
+	}
757 757
 
758
-    /* get taxonomy */
759
-    $taxonomies = geodir_get_taxonomies($post_types, true);
760
-    if($taxonomies) {
761
-        $taxonomies = implode("','", $taxonomies);
762
-        $taxonomies = "'" . $taxonomies . "'";
763
-    }else{$taxonomies='';}
758
+	/* get taxonomy */
759
+	$taxonomies = geodir_get_taxonomies($post_types, true);
760
+	if($taxonomies) {
761
+		$taxonomies = implode("','", $taxonomies);
762
+		$taxonomies = "'" . $taxonomies . "'";
763
+	}else{$taxonomies='';}
764 764
 
765
-    $content_where = $terms_where = '';
765
+	$content_where = $terms_where = '';
766 766
 	if ($s != '') {
767
-        /**
768
-         * Filter the search query content where values.
769
-         *
770
-         * @since 1.5.0
771
-         * @package GeoDirectory
772
-         * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773
-         */
767
+		/**
768
+		 * Filter the search query content where values.
769
+		 *
770
+		 * @since 1.5.0
771
+		 * @package GeoDirectory
772
+		 * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773
+		 */
774 774
 		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
775
-        /**
776
-         * Filter the search query term values.
777
-         *
778
-         * @since 1.5.0
779
-         * @package GeoDirectory
780
-         * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781
-         */
782
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
775
+		/**
776
+		 * Filter the search query term values.
777
+		 *
778
+		 * @since 1.5.0
779
+		 * @package GeoDirectory
780
+		 * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781
+		 */
782
+		$terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
783 783
 	}
784 784
 		
785
-    if ($snear != '') {
785
+	if ($snear != '') {
786 786
 
787 787
 
788
-        if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
789
-            $dist = $gd_session->get('near_me_range');
790
-        }
791
-        $lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
792
-        $lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
793
-        $lat1 = $mylat - ($dist / 69);
794
-        $lat2 = $mylat + ($dist / 69);
788
+		if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
789
+			$dist = $gd_session->get('near_me_range');
790
+		}
791
+		$lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
792
+		$lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
793
+		$lat1 = $mylat - ($dist / 69);
794
+		$lat2 = $mylat + ($dist / 69);
795 795
 
796
-        $rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
797
-        $rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
798
-        $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
799
-        $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
796
+		$rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
797
+		$rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
798
+		$rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
799
+		$rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
800 800
 
801 801
 
802 802
 
803
-	    $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
803
+		$where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
804 804
 			                    $content_where 
805 805
 								OR ($wpdb->posts.ID IN( 
806 806
 										SELECT $wpdb->term_relationships.object_id as post_id 
@@ -817,13 +817,13 @@  discard block
 block discarded – undo
817 817
 						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
818 818
 						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
819 819
 
820
-        if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
821
-            $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
822
-            $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
823
-        }
820
+		if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
821
+			$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
822
+			$where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
823
+		}
824 824
 
825
-    } else {
826
-        $where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
825
+	} else {
826
+		$where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
827 827
                             $content_where  
828 828
 							OR ( $wpdb->posts.ID IN(	
829 829
 									SELECT $wpdb->term_relationships.object_id as post_id                     
@@ -837,19 +837,19 @@  discard block
 block discarded – undo
837 837
 					) 
838 838
 				AND $wpdb->posts.post_type in ('$post_types')
839 839
 				AND ($wpdb->posts.post_status = 'publish') ";
840
-    }
840
+	}
841 841
 	
842 842
 	########### WPML ###########
843
-    if ( function_exists( 'icl_object_id' ) ) {       
843
+	if ( function_exists( 'icl_object_id' ) ) {       
844 844
 		$lang_code = ICL_LANGUAGE_CODE;
845 845
 		
846 846
 		if ($lang_code && $post_types) {
847
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
848
-        }
849
-    }
850
-    ########### WPML ###########
847
+			$where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
848
+		}
849
+	}
850
+	########### WPML ###########
851 851
 	
852
-    return $where;
852
+	return $where;
853 853
 }
854 854
 
855 855
 
@@ -864,45 +864,45 @@  discard block
 block discarded – undo
864 864
  * @return string Modified where query string.
865 865
  */
866 866
 function author_filter_where($where) {
867
-    global $wpdb, $geodir_post_type, $table, $curr;
867
+	global $wpdb, $geodir_post_type, $table, $curr;
868 868
 
869
-    $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
870
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
869
+	$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
870
+	$user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
871 871
     
872
-    if (isset($_REQUEST['stype'])) {
873
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
874
-    } else {
875
-        $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
876
-    }
872
+	if (isset($_REQUEST['stype'])) {
873
+		$where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
874
+	} else {
875
+		$where = " AND $wpdb->posts.post_type IN ('gd_place') ";
876
+	}
877 877
 
878
-    if ($user_id > 0) {
879
-        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
880
-            $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
881
-            $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
882
-            $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
883
-        } else
884
-            $where .= " AND $wpdb->posts.post_author = $user_id";
885
-
886
-        if ($user_id == (int)get_current_user_id()) {
887
-            $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
888
-        } else {
889
-            $where .= " AND $wpdb->posts.post_status = 'publish' ";
890
-        }
891
-    } else {
892
-        $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
893
-    }
878
+	if ($user_id > 0) {
879
+		if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
880
+			$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
881
+			$user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
882
+			$where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
883
+		} else
884
+			$where .= " AND $wpdb->posts.post_author = $user_id";
885
+
886
+		if ($user_id == (int)get_current_user_id()) {
887
+			$where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
888
+		} else {
889
+			$where .= " AND $wpdb->posts.post_status = 'publish' ";
890
+		}
891
+	} else {
892
+		$where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
893
+	}
894 894
 
895
-    ########### WPML ###########
896
-    if (function_exists('icl_object_id')) {
897
-        $lang_code = ICL_LANGUAGE_CODE;
898
-        if ($lang_code) {
899
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
900
-        }
895
+	########### WPML ###########
896
+	if (function_exists('icl_object_id')) {
897
+		$lang_code = ICL_LANGUAGE_CODE;
898
+		if ($lang_code) {
899
+			$where .= " AND icl_t.language_code='" . $lang_code . "' ";
900
+		}
901 901
 
902
-    }
903
-    ########### WPML ###########
902
+	}
903
+	########### WPML ###########
904 904
     
905
-    return $where;
905
+	return $where;
906 906
 }
907 907
 
908 908
 /**
@@ -917,11 +917,11 @@  discard block
 block discarded – undo
917 917
  */
918 918
 function geodir_filter_widget_join($join)
919 919
 {
920
-    global $wp_query, $table;
921
-    if (!empty($wp_query->query['with_pics_only'])) {
922
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
923
-    }
924
-    return $join;
920
+	global $wp_query, $table;
921
+	if (!empty($wp_query->query['with_pics_only'])) {
922
+		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
923
+	}
924
+	return $join;
925 925
 }
926 926
 
927 927
 /**
@@ -936,47 +936,47 @@  discard block
 block discarded – undo
936 936
  */
937 937
 function geodir_filter_widget_where($where)
938 938
 {
939
-    global $wp_query, $table;
940
-    if (!empty($wp_query->query['show_featured_only'])) {
941
-        $where .= " AND " . $table . ".is_featured = '1'";
942
-    }
943
-    if (!empty($wp_query->query['show_special_only'])) {
944
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
945
-    }
946
-    if (!empty($wp_query->query['with_pics_only'])) {
947
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
948
-    }
949
-    if (!empty($wp_query->query['with_videos_only'])) {
950
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
951
-    }
952
-    return $where;
939
+	global $wp_query, $table;
940
+	if (!empty($wp_query->query['show_featured_only'])) {
941
+		$where .= " AND " . $table . ".is_featured = '1'";
942
+	}
943
+	if (!empty($wp_query->query['show_special_only'])) {
944
+		$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
945
+	}
946
+	if (!empty($wp_query->query['with_pics_only'])) {
947
+		$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
948
+	}
949
+	if (!empty($wp_query->query['with_videos_only'])) {
950
+		$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
951
+	}
952
+	return $where;
953 953
 }
954 954
 
955 955
 
956 956
 function geodir_related_posts_fields($fields) {
957
-    global $wp_query, $wpdb, $table, $post;
957
+	global $wp_query, $wpdb, $table, $post;
958 958
 
959
-    $fields .= ", " . $table . ".* ";
959
+	$fields .= ", " . $table . ".* ";
960 960
 
961
-    $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
961
+	$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
962 962
 
963
-    $mylat = $post->post_latitude;
964
-    $mylon = $post->post_longitude;
963
+	$mylat = $post->post_latitude;
964
+	$mylon = $post->post_longitude;
965 965
 
966
-    $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
967
-    return $fields;
966
+	$fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
967
+	return $fields;
968 968
 }
969 969
 function geodir_related_posts_fields_filter($query) {
970
-    if (geodir_is_page('detail')) {
971
-        $arr_detail_page_tabs = geodir_detail_page_tabs_list();
972
-        $is_display = $arr_detail_page_tabs['related_listing']['is_display'];
973
-        if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
974
-            && isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
975
-            && isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
976
-            && $is_display
977
-        ) {
978
-            add_filter('posts_fields', 'geodir_related_posts_fields', 1);
979
-        }
980
-    }
970
+	if (geodir_is_page('detail')) {
971
+		$arr_detail_page_tabs = geodir_detail_page_tabs_list();
972
+		$is_display = $arr_detail_page_tabs['related_listing']['is_display'];
973
+		if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
974
+			&& isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
975
+			&& isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
976
+			&& $is_display
977
+		) {
978
+			add_filter('posts_fields', 'geodir_related_posts_fields', 1);
979
+		}
980
+	}
981 981
 }
982 982
 add_action('pre_get_posts', 'geodir_related_posts_fields_filter', 1);
983 983
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
         } //  Distance
100 100
 
101 101
         if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
102
+            $mylat = (float) esc_attr($_REQUEST['sgeo_lat']);
103 103
         } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
104
+            $mylat = (float) geodir_get_current_city_lat();
105 105
         } //  Latatude
106 106
 
107 107
         if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
108
+            $mylon = (float) esc_attr($_REQUEST['sgeo_lon']);
109 109
         } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
110
+            $mylon = (float) geodir_get_current_city_lng();
111 111
         } //  Distance
112 112
 
113 113
         if (isset($_REQUEST['snear'])) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         if ($snear == 'NEAR ME') {
122 122
             $ip = $_SERVER['REMOTE_ADDR'];
123
-            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
123
+            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip));
124 124
             $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125 125
             $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126 126
         }
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
             $s_AA = str_replace(" ", "", $s);
131 131
             $s_A = explode(",", $s_AA);
132 132
             $s_A = implode('","', $s_A);
133
-            $s_A = '"' . $s_A . '"';
133
+            $s_A = '"'.$s_A.'"';
134 134
         } else {
135
-            $s_A = '"' . $s . '"';
135
+            $s_A = '"'.$s.'"';
136 136
         }
137 137
 
138 138
         if (strstr($s, ' ')) {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     }
194 194
     if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
195 195
 
196
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
196
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
197 197
 
198 198
         add_filter('posts_fields', 'geodir_posts_fields', 1);
199 199
         add_filter('posts_join', 'geodir_posts_join', 1);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
234 234
 
235 235
     // Filter-Location-Manager to add location table.
236
-    $fields .= ", " . $table . ".* ";
236
+    $fields .= ", ".$table.".* ";
237 237
     
238 238
 	if ($snear != '' || $gd_session->get('all_near_me')) {
239 239
         $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
@@ -243,16 +243,16 @@  discard block
 block discarded – undo
243 243
             $mylon = $gd_session->get('user_lon');
244 244
         }
245 245
 
246
-        $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
246
+        $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247 247
     }
248 248
 
249 249
     global $s;
250 250
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251 251
         $keywords = explode(" ", $s);
252 252
 
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
253
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
254
+            foreach ($keywords as $kkey=>$kword) {
255
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
256 256
                     unset($keywords[$kkey]);
257 257
                 }
258 258
             }
@@ -270,24 +270,24 @@  discard block
 block discarded – undo
270 270
                 $count = 0;
271 271
                 foreach ($keywords as $keyword) {
272 272
                     $keyword = trim($keyword);
273
-                    $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
273
+                    $keyword = wp_specialchars_decode($keyword, ENT_QUOTES);
274 274
 					$count++;
275 275
                     if ($count < count($keywords)) {
276 276
                        // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
277
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
277
+						$gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ".$key." ";
278 278
                     } else {
279 279
                         //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
280
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
280
+						$gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ";
281 281
                     }
282 282
                 }
283
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
283
+                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS ".$part.",";
284 284
             }
285 285
         } else {
286 286
             $gd_titlematch_part = "";
287 287
         }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
290
-		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
288
+        $s = stripslashes_deep($s);
289
+        $s = wp_specialchars_decode($s, ENT_QUOTES);
290
+		$fields .= $wpdb->prepare(", CASE WHEN ".$table.".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN ".$wpdb->posts.".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle,".$gd_titlematch_part." CASE WHEN ( ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s.'%', '% '.$s.'%', $s, $s.' %', '% '.$s.' %', '% '.$s));
291 291
     }
292 292
 
293 293
     return $fields;
@@ -316,13 +316,13 @@  discard block
 block discarded – undo
316 316
         $lang_code = ICL_LANGUAGE_CODE;
317 317
         $default_lang_code = $sitepress->get_default_language();
318 318
         if ($lang_code) {
319
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
319
+            $join .= "JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID";
320 320
         }
321 321
 
322 322
     }
323 323
     ########### WPML ###########
324 324
 
325
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
325
+    $join .= " INNER JOIN ".$table." ON (".$table.".post_id = $wpdb->posts.ID)  ";
326 326
     //===old code start
327 327
     //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
328 328
 
@@ -405,20 +405,20 @@  discard block
 block discarded – undo
405 405
             break;
406 406
         case 'low_review':
407 407
         case 'rating_count_asc':
408
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
408
+            $orderby = $table.".rating_count ASC, ".$table.".overall_rating ASC, ";
409 409
             break;
410 410
         case 'high_review':
411 411
         case 'rating_count_desc':
412
-			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
412
+			$orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, ";
413 413
             break;
414 414
         case 'low_rating':
415
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
415
+            $orderby = "( ".$table.".overall_rating  ) ASC, ".$table.".rating_count ASC,  ";
416 416
             break;
417 417
         case 'high_rating':
418
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
418
+            $orderby = " ".$table.".overall_rating DESC, ".$table.".rating_count DESC, ";
419 419
             break;
420 420
         case 'featured':
421
-            $orderby = $table . ".is_featured asc, ";
421
+            $orderby = $table.".is_featured asc, ";
422 422
             break;
423 423
         case 'nearest':
424 424
             $orderby = " distance asc, ";
@@ -441,24 +441,24 @@  discard block
 block discarded – undo
441 441
 
442 442
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
443 443
         $keywords = explode(" ", $s);
444
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
445
-            foreach($keywords as $kkey=>$kword){
446
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
444
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
445
+            foreach ($keywords as $kkey=>$kword) {
446
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
447 447
                     unset($keywords[$kkey]);
448 448
                 }
449 449
             }
450 450
         }
451 451
         if ($sort_by == 'nearest' || $sort_by == 'farthest') {
452 452
             if (count($keywords) > 1) {
453
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
453
+                $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
454 454
             } else {
455
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
455
+                $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
456 456
             }
457 457
         } else {
458 458
             if (count($keywords) > 1) {
459
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
459
+                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ".$orderby;
460 460
             } else {
461
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
461
+                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ".$orderby;
462 462
             }
463 463
         }
464 464
     }
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
      */
474 474
     $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
475 475
 
476
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
476
+    $orderby .= $table.".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
477 477
 
478 478
     return $orderby;
479 479
 }
@@ -505,31 +505,31 @@  discard block
 block discarded – undo
505 505
 
506 506
         if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
507 507
 
508
-            $sort_by = str_replace('_' . $order, '', $sort_by);
508
+            $sort_by = str_replace('_'.$order, '', $sort_by);
509 509
 
510 510
             switch ($sort_by):
511 511
 
512 512
                 case 'post_date':
513 513
                 case 'comment_count':
514 514
 
515
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
515
+                    $orderby = "$wpdb->posts.".$sort_by." ".$order.", ".$table.".overall_rating ".$order.", ";
516 516
                     break;
517 517
 
518 518
                 case 'distance':
519
-                    $orderby = $sort_by . " " . $order . ", ";
519
+                    $orderby = $sort_by." ".$order.", ";
520 520
                     break;
521 521
 
522 522
 
523 523
                 // sort by rating
524 524
                 case 'overall_rating':
525
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
525
+                    $orderby = " ".$table.".".$sort_by."  ".$order.", ".$table.".rating_count ".$order.", ";
526 526
 
527 527
                     break;
528 528
 
529 529
 
530 530
                 default:
531 531
                     if (geodir_column_exist($table, $sort_by)) {
532
-						$orderby = $table . "." . $sort_by . " " . $order . ", ";
532
+						$orderby = $table.".".$sort_by." ".$order.", ";
533 533
 					}
534 534
                     break;
535 535
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
         }
578 578
 
579 579
         //if (!geodir_is_page('detail'))
580
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
580
+            add_filter('posts_where', 'geodir_default_where', 1); /**/
581 581
 
582 582
         //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
583 583
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
         $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
649 649
         //echo '##########'.$q_post_type;
650 650
         if ($lang_code && $q_post_type) {
651
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
651
+            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_".$q_post_type."') ";
652 652
             //$where .= " AND icl_t.language_code = '$lang_code' ";
653 653
         }
654 654
 
@@ -715,8 +715,8 @@  discard block
 block discarded – undo
715 715
 	}
716 716
 	
717 717
 	$s = trim($s);
718
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
719
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
718
+    $s = wp_specialchars_decode($s, ENT_QUOTES);
719
+    $s_A = wp_specialchars_decode($s_A, ENT_QUOTES);
720 720
 
721 721
     $where = '';
722 722
     $better_search_terms = '';
@@ -727,9 +727,9 @@  discard block
 block discarded – undo
727 727
 
728 728
     if ($s != '') {
729 729
         $keywords = explode(" ", $s);
730
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
731
-            foreach($keywords as $kkey=>$kword){
732
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
730
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
731
+            foreach ($keywords as $kkey=>$kword) {
732
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
733 733
                     unset($keywords[$kkey]);
734 734
                 }
735 735
             }
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
         if (!empty($keywords)) {
739 739
             foreach ($keywords as $keyword) {
740 740
                 $keyword = trim($keyword);
741
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
741
+                $keyword = wp_specialchars_decode($keyword, ENT_QUOTES);
742 742
                 if ($keyword != '') {
743 743
                     /**
744 744
                      * Filter the search query keywords SQL.
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
                      * @param array $keywords The array of keywords for the query.
750 750
                      * @param string $keyword The single keyword being searched.
751 751
                      */
752
-					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
752
+					$better_search_terms .= apply_filters("geodir_search_better_search_terms", ' OR ( '.$wpdb->posts.'.post_title LIKE "'.$keyword.'" OR '.$wpdb->posts.'.post_title LIKE "'.$keyword.'%" OR '.$wpdb->posts.'.post_title LIKE "% '.$keyword.'%" )', $keywords, $keyword);
753 753
                 }
754 754
             }
755 755
         }
@@ -757,10 +757,10 @@  discard block
 block discarded – undo
757 757
 
758 758
     /* get taxonomy */
759 759
     $taxonomies = geodir_get_taxonomies($post_types, true);
760
-    if($taxonomies) {
760
+    if ($taxonomies) {
761 761
         $taxonomies = implode("','", $taxonomies);
762
-        $taxonomies = "'" . $taxonomies . "'";
763
-    }else{$taxonomies='';}
762
+        $taxonomies = "'".$taxonomies."'";
763
+    } else {$taxonomies = ''; }
764 764
 
765 765
     $content_where = $terms_where = '';
766 766
 	if ($s != '') {
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
          * @package GeoDirectory
772 772
          * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773 773
          */
774
-		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
774
+		$content_where = apply_filters("geodir_search_content_where", " OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
775 775
         /**
776 776
          * Filter the search query term values.
777 777
          *
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
          * @package GeoDirectory
780 780
          * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781 781
          */
782
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
782
+        $terms_where = apply_filters("geodir_search_terms_where", " AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
783 783
 	}
784 784
 		
785 785
     if ($snear != '') {
@@ -814,12 +814,12 @@  discard block
 block discarded – undo
814 814
 							)
815 815
 						AND $wpdb->posts.post_type in ('{$post_types}')
816 816
 						AND ($wpdb->posts.post_status = 'publish')
817
-						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
818
-						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
817
+						AND ( ".$table.".post_latitude between $rlat1 and $rlat2 )
818
+						AND ( ".$table.".post_longitude between $rlon1 and $rlon2 ) ";
819 819
 
820 820
         if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
821 821
             $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
822
-            $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
822
+            $where .= " AND CONVERT((".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= ".$dist;
823 823
         }
824 824
 
825 825
     } else {
@@ -840,11 +840,11 @@  discard block
 block discarded – undo
840 840
     }
841 841
 	
842 842
 	########### WPML ###########
843
-    if ( function_exists( 'icl_object_id' ) ) {       
843
+    if (function_exists('icl_object_id')) {       
844 844
 		$lang_code = ICL_LANGUAGE_CODE;
845 845
 		
846 846
 		if ($lang_code && $post_types) {
847
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
847
+            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_".$post_types."') ";
848 848
         }
849 849
     }
850 850
     ########### WPML ###########
@@ -867,10 +867,10 @@  discard block
 block discarded – undo
867 867
     global $wpdb, $geodir_post_type, $table, $curr;
868 868
 
869 869
     $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
870
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
870
+    $user_id = !empty($curauth->ID) ? (int) $curauth->ID : 0;
871 871
     
872 872
     if (isset($_REQUEST['stype'])) {
873
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
873
+        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ", $_REQUEST['stype']);
874 874
     } else {
875 875
         $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
876 876
     }
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
         } else
884 884
             $where .= " AND $wpdb->posts.post_author = $user_id";
885 885
 
886
-        if ($user_id == (int)get_current_user_id()) {
886
+        if ($user_id == (int) get_current_user_id()) {
887 887
             $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
888 888
         } else {
889 889
             $where .= " AND $wpdb->posts.post_status = 'publish' ";
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
     if (function_exists('icl_object_id')) {
897 897
         $lang_code = ICL_LANGUAGE_CODE;
898 898
         if ($lang_code) {
899
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
899
+            $where .= " AND icl_t.language_code='".$lang_code."' ";
900 900
         }
901 901
 
902 902
     }
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 {
920 920
     global $wp_query, $table;
921 921
     if (!empty($wp_query->query['with_pics_only'])) {
922
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
922
+        $join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )";
923 923
     }
924 924
     return $join;
925 925
 }
@@ -938,16 +938,16 @@  discard block
 block discarded – undo
938 938
 {
939 939
     global $wp_query, $table;
940 940
     if (!empty($wp_query->query['show_featured_only'])) {
941
-        $where .= " AND " . $table . ".is_featured = '1'";
941
+        $where .= " AND ".$table.".is_featured = '1'";
942 942
     }
943 943
     if (!empty($wp_query->query['show_special_only'])) {
944
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
944
+        $where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )";
945 945
     }
946 946
     if (!empty($wp_query->query['with_pics_only'])) {
947
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
947
+        $where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL GROUP BY ".$table.".post_id";
948 948
     }
949 949
     if (!empty($wp_query->query['with_videos_only'])) {
950
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
950
+        $where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )";
951 951
     }
952 952
     return $where;
953 953
 }
@@ -956,21 +956,21 @@  discard block
 block discarded – undo
956 956
 function geodir_related_posts_fields($fields) {
957 957
     global $wp_query, $wpdb, $table, $post;
958 958
 
959
-    $fields .= ", " . $table . ".* ";
959
+    $fields .= ", ".$table.".* ";
960 960
 
961 961
     $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
962 962
 
963 963
     $mylat = $post->post_latitude;
964 964
     $mylon = $post->post_longitude;
965 965
 
966
-    $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
966
+    $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
967 967
     return $fields;
968 968
 }
969 969
 function geodir_related_posts_fields_filter($query) {
970 970
     if (geodir_is_page('detail')) {
971 971
         $arr_detail_page_tabs = geodir_detail_page_tabs_list();
972 972
         $is_display = $arr_detail_page_tabs['related_listing']['is_display'];
973
-        if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
973
+        if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
974 974
             && isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
975 975
             && isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
976 976
             && $is_display
Please login to merge, or discard this patch.
geodirectory-admin/admin_install.php 2 patches
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 function geodir_activation()
25 25
 {
26 26
 
27
-    geodir_install();
28
-    add_action('wp_loaded', 'geodir_flush_activation');
27
+	geodir_install();
28
+	add_action('wp_loaded', 'geodir_flush_activation');
29 29
 }
30 30
 
31 31
 /**
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function geodir_flush_activation()
38 38
 {
39
-    // Remove rewrite rules and then recreate rewrite rules.
40
-    // flush late so everything is loaded
41
-    flush_rewrite_rules();
39
+	// Remove rewrite rules and then recreate rewrite rules.
40
+	// flush late so everything is loaded
41
+	flush_rewrite_rules();
42 42
 }
43 43
 
44 44
 /**
@@ -50,44 +50,44 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function geodir_install()
52 52
 {
53
-    global $geodir_settings;
54
-
55
-    /**
56
-     * Called before the GD installation scripts have run.
57
-     *
58
-     * @since 1.0.0
59
-     * @see 'geodir_installation_end'
60
-     */
61
-    do_action('geodir_installation_start');
62
-
63
-    // Do install
64
-    if (!get_option('geodir_default_data_installed')) {
65
-        geodir_create_tables(); // in admin db install.php
66
-        geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
-        geodir_create_default_fields();
68
-        //geodir_default_taxonomies();
69
-        geodir_set_default_options();
70
-        geodir_create_pages();
71
-        geodir_set_default_widgets();
72
-        gd_install_theme_compat();
73
-
74
-        update_option('geodir_default_data_installed', 1);
75
-
76
-    }
77
-
78
-    if (!get_option('geodir_default_data_installed_1.2.8')) {
79
-        //geodir_create_tables(); // in admin db install.php
80
-        update_option('geodir_default_data_installed_1.2.8', 1);
81
-    }
82
-
83
-    geodir_installation_end();
84
-    /**
85
-     * Called after the GD installation scripts have run.
86
-     *
87
-     * @since 1.0.0
88
-     * @see 'geodir_installation_start'
89
-     */
90
-    do_action('geodir_installation_end');
53
+	global $geodir_settings;
54
+
55
+	/**
56
+	 * Called before the GD installation scripts have run.
57
+	 *
58
+	 * @since 1.0.0
59
+	 * @see 'geodir_installation_end'
60
+	 */
61
+	do_action('geodir_installation_start');
62
+
63
+	// Do install
64
+	if (!get_option('geodir_default_data_installed')) {
65
+		geodir_create_tables(); // in admin db install.php
66
+		geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
+		geodir_create_default_fields();
68
+		//geodir_default_taxonomies();
69
+		geodir_set_default_options();
70
+		geodir_create_pages();
71
+		geodir_set_default_widgets();
72
+		gd_install_theme_compat();
73
+
74
+		update_option('geodir_default_data_installed', 1);
75
+
76
+	}
77
+
78
+	if (!get_option('geodir_default_data_installed_1.2.8')) {
79
+		//geodir_create_tables(); // in admin db install.php
80
+		update_option('geodir_default_data_installed_1.2.8', 1);
81
+	}
82
+
83
+	geodir_installation_end();
84
+	/**
85
+	 * Called after the GD installation scripts have run.
86
+	 *
87
+	 * @since 1.0.0
88
+	 * @see 'geodir_installation_start'
89
+	 */
90
+	do_action('geodir_installation_end');
91 91
 
92 92
 
93 93
 }
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 function geodir_create_pages()
105 105
 {
106 106
 
107
-    //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
-    geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
-    geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
-    geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
-    geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
107
+	//geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
+	geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
+	geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
+	geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
+	geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
113 113
 
114
-    //New since 1.5.3
115
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
114
+	//New since 1.5.3
115
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
117 117
 
118 118
 
119 119
 }
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
  */
130 130
 function geodir_installation_end()
131 131
 {
132
-    //update_option( "geodir_db_version", GEODIRECTORY_VERSION );
132
+	//update_option( "geodir_db_version", GEODIRECTORY_VERSION );
133 133
 
134
-    update_option("geodir_installed", 1);
135
-    update_option("geodir_installation_redirect", 1);
136
-    update_option('skip_install_geodir_pages', 0);
134
+	update_option("geodir_installed", 1);
135
+	update_option("geodir_installation_redirect", 1);
136
+	update_option('skip_install_geodir_pages', 0);
137 137
 }
138 138
 
139 139
 /**
@@ -147,45 +147,45 @@  discard block
 block discarded – undo
147 147
  */
148 148
 function geodir_set_default_options()
149 149
 {
150
-    global $geodir_settings;
151
-    /**
152
-     * Contains settings array for general tab.
153
-     *
154
-     * @since 1.0.0
155
-     * @package GeoDirectory
156
-     */
157
-    include_once("option-pages/general_settings_array.php");
158
-    /**
159
-     * Contains settings array for design tab.
160
-     *
161
-     * @since 1.0.0
162
-     * @package GeoDirectory
163
-     */
164
-    include_once("option-pages/design_settings_array.php");
165
-    /**
166
-     * Contains settings array for notifications tab.
167
-     *
168
-     * @since 1.0.0
169
-     * @package GeoDirectory
170
-     */
171
-    include_once("option-pages/notifications_settings_array.php");
172
-    /**
173
-     * Contains settings array for permalink tab.
174
-     *
175
-     * @since 1.0.0
176
-     * @package GeoDirectory
177
-     */
178
-    include_once("option-pages/permalink_settings_array.php");
179
-    /**
180
-     * Contains settings array for title / meta tab.
181
-     *
182
-     * @since 1.5.4
183
-     * @package GeoDirectory
184
-     */
185
-    include_once("option-pages/title_meta_settings_array.php");
186
-    foreach ($geodir_settings as $value) {
187
-        geodir_update_options($value, true);
188
-    }
150
+	global $geodir_settings;
151
+	/**
152
+	 * Contains settings array for general tab.
153
+	 *
154
+	 * @since 1.0.0
155
+	 * @package GeoDirectory
156
+	 */
157
+	include_once("option-pages/general_settings_array.php");
158
+	/**
159
+	 * Contains settings array for design tab.
160
+	 *
161
+	 * @since 1.0.0
162
+	 * @package GeoDirectory
163
+	 */
164
+	include_once("option-pages/design_settings_array.php");
165
+	/**
166
+	 * Contains settings array for notifications tab.
167
+	 *
168
+	 * @since 1.0.0
169
+	 * @package GeoDirectory
170
+	 */
171
+	include_once("option-pages/notifications_settings_array.php");
172
+	/**
173
+	 * Contains settings array for permalink tab.
174
+	 *
175
+	 * @since 1.0.0
176
+	 * @package GeoDirectory
177
+	 */
178
+	include_once("option-pages/permalink_settings_array.php");
179
+	/**
180
+	 * Contains settings array for title / meta tab.
181
+	 *
182
+	 * @since 1.5.4
183
+	 * @package GeoDirectory
184
+	 */
185
+	include_once("option-pages/title_meta_settings_array.php");
186
+	foreach ($geodir_settings as $value) {
187
+		geodir_update_options($value, true);
188
+	}
189 189
 
190 190
 }
191 191
 
@@ -199,103 +199,103 @@  discard block
 block discarded – undo
199 199
 function geodir_set_default_widgets()
200 200
 {
201 201
 
202
-    $widget_option_list = array();
203
-    $widgetinfo = array();
204
-    $sidebarvalue_array = array();
205
-    $sidebars_widgets = array();
202
+	$widget_option_list = array();
203
+	$widgetinfo = array();
204
+	$sidebarvalue_array = array();
205
+	$sidebars_widgets = array();
206 206
 
207
-    /*===========================*/
208
-    /*  Widgets ON HOME PAGE     */
209
-    /*===========================*/
207
+	/*===========================*/
208
+	/*  Widgets ON HOME PAGE     */
209
+	/*===========================*/
210 210
 
211
-    $widget_option_list['geodir_home_top'] =
212
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
-            'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
-            'geodir_advance_search' => array());
211
+	$widget_option_list['geodir_home_top'] =
212
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
+			'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
+			'geodir_advance_search' => array());
215 215
 
216
-    $widget_option_list['geodir_home_content'] =
217
-        array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
216
+	$widget_option_list['geodir_home_content'] =
217
+		array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
218 218
 
219
-    $widget_option_list['geodir_home_right'] =
220
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
219
+	$widget_option_list['geodir_home_right'] =
220
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
222 222
 
223
-    /*===========================*/
224
-    /*  Widgets ON LISTING PAGE     */
225
-    /*===========================*/
223
+	/*===========================*/
224
+	/*  Widgets ON LISTING PAGE     */
225
+	/*===========================*/
226 226
 
227
-    $widget_option_list['geodir_listing_top'] =
228
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
-            'geodir_advance_search' => array());
227
+	$widget_option_list['geodir_listing_top'] =
228
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
+			'geodir_advance_search' => array());
230 230
 
231
-    $widget_option_list['geodir_listing_right_sidebar'] =
232
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
231
+	$widget_option_list['geodir_listing_right_sidebar'] =
232
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
235 235
 
236 236
 
237
-    /*===========================*/
238
-    /*  Widgets ON SEARCH PAGE     */
239
-    /*===========================*/
237
+	/*===========================*/
238
+	/*  Widgets ON SEARCH PAGE     */
239
+	/*===========================*/
240 240
 
241
-    $widget_option_list['geodir_search_top'] =
242
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
-            'geodir_advance_search' => array());
241
+	$widget_option_list['geodir_search_top'] =
242
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
+			'geodir_advance_search' => array());
244 244
 
245
-    $widget_option_list['geodir_search_right_sidebar'] =
246
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
245
+	$widget_option_list['geodir_search_right_sidebar'] =
246
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
249 249
 
250
-    /*===========================*/
251
-    /*  Widgets ON DETAIL/SINGLE PAGE     */
252
-    /*===========================*/
250
+	/*===========================*/
251
+	/*  Widgets ON DETAIL/SINGLE PAGE     */
252
+	/*===========================*/
253 253
 
254
-    $widget_option_list['geodir_detail_sidebar'] =
255
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
254
+	$widget_option_list['geodir_detail_sidebar'] =
255
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
258 258
 
259 259
 
260
-    /*===========================*/
261
-    /*  Widgets ON AUTHOR PAGE     */
262
-    /*===========================*/
260
+	/*===========================*/
261
+	/*  Widgets ON AUTHOR PAGE     */
262
+	/*===========================*/
263 263
 
264 264
 
265
-    $widget_option_list['geodir_author_right_sidebar'] =
266
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
265
+	$widget_option_list['geodir_author_right_sidebar'] =
266
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
267 267
 
268 268
 
269
-    $sidebars_widgets = get_option('sidebars_widgets');
269
+	$sidebars_widgets = get_option('sidebars_widgets');
270 270
 
271
-    foreach ($widget_option_list as $key => $widget_options) {
271
+	foreach ($widget_option_list as $key => $widget_options) {
272 272
 
273
-        foreach ($widget_options as $key2 => $widget_options_obj) {
274
-            $widgetid = 'widget_' . $key2;
273
+		foreach ($widget_options as $key2 => $widget_options_obj) {
274
+			$widgetid = 'widget_' . $key2;
275 275
 
276
-            $widgetinfo[$widgetid][] = $widget_options_obj;
276
+			$widgetinfo[$widgetid][] = $widget_options_obj;
277 277
 
278
-            $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
278
+			$sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
279 279
 
280
-            $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
280
+			$widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
281 281
 
282
-        }
282
+		}
283 283
 
284
-        if (!empty($sidebarvalue_array[$key])) {
284
+		if (!empty($sidebarvalue_array[$key])) {
285 285
 
286
-            $sidebars_widgets = get_option('sidebars_widgets');
287
-            $sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
-            update_option('sidebars_widgets', $sidebars_widgets);
286
+			$sidebars_widgets = get_option('sidebars_widgets');
287
+			$sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
+			update_option('sidebars_widgets', $sidebars_widgets);
289 289
 
290
-            foreach ($widget_update as $key => $value) {
290
+			foreach ($widget_update as $key => $value) {
291 291
 
292
-                update_option($key, $value);
292
+				update_option($key, $value);
293 293
 
294
-            }
294
+			}
295 295
 
296
-        }
296
+		}
297 297
 
298
-    }
298
+	}
299 299
 
300 300
 
301 301
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -271,11 +271,11 @@
 block discarded – undo
271 271
     foreach ($widget_option_list as $key => $widget_options) {
272 272
 
273 273
         foreach ($widget_options as $key2 => $widget_options_obj) {
274
-            $widgetid = 'widget_' . $key2;
274
+            $widgetid = 'widget_'.$key2;
275 275
 
276 276
             $widgetinfo[$widgetid][] = $widget_options_obj;
277 277
 
278
-            $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
278
+            $sidebarvalue_array[$key][] = $key2."-".(count($widgetinfo[$widgetid]));
279 279
 
280 280
             $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
281 281
 
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Jupiter.php 2 patches
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -16,28 +16,28 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function jupiter_action_calls()
18 18
 {
19
-    // REMOVE BREADCRUMB
20
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
-
27
-    // REMOVE PAGE TITLES
28
-    remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
29
-    remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
30
-    remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
31
-    remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
32
-    remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
33
-
34
-
35
-    // CAHNGE PAGE TITLES
36
-    remove_action('page_title', 'mk_page_title');
37
-    add_action('page_title', 'gd_mk_page_title');
38
-    // CHANGE BREADCRUMS FOR GD PAGES
39
-    remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs');
40
-    add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs');
19
+	// REMOVE BREADCRUMB
20
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
+
27
+	// REMOVE PAGE TITLES
28
+	remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
29
+	remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
30
+	remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
31
+	remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
32
+	remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
33
+
34
+
35
+	// CAHNGE PAGE TITLES
36
+	remove_action('page_title', 'mk_page_title');
37
+	add_action('page_title', 'gd_mk_page_title');
38
+	// CHANGE BREADCRUMS FOR GD PAGES
39
+	remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs');
40
+	add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs');
41 41
 
42 42
 
43 43
 }
@@ -52,19 +52,19 @@  discard block
 block discarded – undo
52 52
 function gd_mk_theme_breadcrumbs()
53 53
 {
54 54
 
55
-    if (is_page_geodir_home() || geodir_is_page('location')) {
56
-        jupiter_geodir_breadcrumb();
57
-    } elseif (geodir_is_page('listing')) {
58
-        jupiter_geodir_breadcrumb();
59
-    } elseif (geodir_is_page('detail')) {
60
-        jupiter_geodir_breadcrumb();
61
-    } elseif (geodir_is_page('search')) {
62
-        jupiter_geodir_breadcrumb();
63
-    } elseif (geodir_is_page('author')) {
64
-        jupiter_geodir_breadcrumb();
65
-    } else {
66
-        mk_theme_breadcrumbs();
67
-    }
55
+	if (is_page_geodir_home() || geodir_is_page('location')) {
56
+		jupiter_geodir_breadcrumb();
57
+	} elseif (geodir_is_page('listing')) {
58
+		jupiter_geodir_breadcrumb();
59
+	} elseif (geodir_is_page('detail')) {
60
+		jupiter_geodir_breadcrumb();
61
+	} elseif (geodir_is_page('search')) {
62
+		jupiter_geodir_breadcrumb();
63
+	} elseif (geodir_is_page('author')) {
64
+		jupiter_geodir_breadcrumb();
65
+	} else {
66
+		mk_theme_breadcrumbs();
67
+	}
68 68
 }
69 69
 
70 70
 /**
@@ -76,35 +76,35 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function gd_mk_page_title()
78 78
 {
79
-    global $wp;
80
-
81
-
82
-    if (is_page_geodir_home() || geodir_is_page('location')) {
83
-        jupiter_geodir_page_title();
84
-    } elseif (geodir_is_page('listing')) {
85
-        ob_start(); // Start buffering;
86
-        geodir_action_listings_title();
87
-        $gd_title = ob_get_clean();
88
-        $title_p = explode('">', $gd_title);
89
-        $title = str_replace('</h1></header>', "", $title_p[2]);
90
-        jupiter_geodir_page_title($title);
91
-    } elseif (geodir_is_page('search')) {
92
-        ob_start(); // Start buffering;
93
-        geodir_action_listings_title();
94
-        $gd_title = ob_get_clean();
95
-        $title_p = explode('">', $gd_title);
96
-        $title = str_replace('</h1></header>', "", $title_p[2]);
97
-        jupiter_geodir_page_title($title);
98
-    } elseif (geodir_is_page('author')) {
99
-        ob_start(); // Start buffering;
100
-        geodir_action_author_page_title();
101
-        $gd_title = ob_get_clean();
102
-        $gd_title = str_replace('<h1>', "", $gd_title);
103
-        $gd_title = str_replace('</h1>', "", $gd_title);
104
-        jupiter_geodir_page_title($gd_title);
105
-    } else {
106
-        mk_page_title();
107
-    }
79
+	global $wp;
80
+
81
+
82
+	if (is_page_geodir_home() || geodir_is_page('location')) {
83
+		jupiter_geodir_page_title();
84
+	} elseif (geodir_is_page('listing')) {
85
+		ob_start(); // Start buffering;
86
+		geodir_action_listings_title();
87
+		$gd_title = ob_get_clean();
88
+		$title_p = explode('">', $gd_title);
89
+		$title = str_replace('</h1></header>', "", $title_p[2]);
90
+		jupiter_geodir_page_title($title);
91
+	} elseif (geodir_is_page('search')) {
92
+		ob_start(); // Start buffering;
93
+		geodir_action_listings_title();
94
+		$gd_title = ob_get_clean();
95
+		$title_p = explode('">', $gd_title);
96
+		$title = str_replace('</h1></header>', "", $title_p[2]);
97
+		jupiter_geodir_page_title($title);
98
+	} elseif (geodir_is_page('author')) {
99
+		ob_start(); // Start buffering;
100
+		geodir_action_author_page_title();
101
+		$gd_title = ob_get_clean();
102
+		$gd_title = str_replace('<h1>', "", $gd_title);
103
+		$gd_title = str_replace('</h1>', "", $gd_title);
104
+		jupiter_geodir_page_title($gd_title);
105
+	} else {
106
+		mk_page_title();
107
+	}
108 108
 
109 109
 
110 110
 }
@@ -119,48 +119,48 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function jupiter_geodir_breadcrumb()
121 121
 {
122
-    $item = '';
123
-    ob_start(); // Start buffering;
124
-    geodir_breadcrumb();
125
-    $gd_crums = ob_get_clean();
126
-    if ($gd_crums) {
127
-        $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums);
128
-        $gd_crums = str_replace('</li></ul></div>', "", $gd_crums);
129
-        $gd_crums = str_replace('&nbsp;>&nbsp;', " > ", $gd_crums);
130
-        $gd_crums = str_replace('</li><li>', "", $gd_crums);
131
-        $gd_crums = explode(" > ", $gd_crums);
132
-        $trail_end = array_pop($gd_crums);
133
-        $gd_crums['trail_end'] = $trail_end;
134
-        //print_r($gd_crums);exit;
135
-        //print_r($trail);
136
-        $item = $gd_crums;
137
-
138
-    }
139
-    if (!$item) {
140
-        return;
141
-    }
142
-    global $mk_options, $post;
143
-    $post_id = global_get_post_id();
144
-
145
-    if ($post_id) {
146
-        $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true);
147
-        $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true);
148
-        if ($local_skining == 'true' && !empty($breadcrumb_skin)) {
149
-            $breadcrumb_skin_class = $breadcrumb_skin;
150
-        } else {
151
-            $breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
152
-        }
153
-    } else {
154
-        $breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
155
-    }
156
-
157
-
158
-    $delimiter = ' &#47; ';
159
-
160
-    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
161
-
162
-    echo implode($delimiter, $item);
163
-    echo "</div></div>";
122
+	$item = '';
123
+	ob_start(); // Start buffering;
124
+	geodir_breadcrumb();
125
+	$gd_crums = ob_get_clean();
126
+	if ($gd_crums) {
127
+		$gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums);
128
+		$gd_crums = str_replace('</li></ul></div>', "", $gd_crums);
129
+		$gd_crums = str_replace('&nbsp;>&nbsp;', " > ", $gd_crums);
130
+		$gd_crums = str_replace('</li><li>', "", $gd_crums);
131
+		$gd_crums = explode(" > ", $gd_crums);
132
+		$trail_end = array_pop($gd_crums);
133
+		$gd_crums['trail_end'] = $trail_end;
134
+		//print_r($gd_crums);exit;
135
+		//print_r($trail);
136
+		$item = $gd_crums;
137
+
138
+	}
139
+	if (!$item) {
140
+		return;
141
+	}
142
+	global $mk_options, $post;
143
+	$post_id = global_get_post_id();
144
+
145
+	if ($post_id) {
146
+		$local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true);
147
+		$breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true);
148
+		if ($local_skining == 'true' && !empty($breadcrumb_skin)) {
149
+			$breadcrumb_skin_class = $breadcrumb_skin;
150
+		} else {
151
+			$breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
152
+		}
153
+	} else {
154
+		$breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
155
+	}
156
+
157
+
158
+	$delimiter = ' &#47; ';
159
+
160
+	echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
161
+
162
+	echo implode($delimiter, $item);
163
+	echo "</div></div>";
164 164
 
165 165
 }
166 166
 
@@ -174,41 +174,41 @@  discard block
 block discarded – undo
174 174
  */
175 175
 function jupiter_geodir_page_title($title = '', $subtitle = '')
176 176
 {
177
-    global $mk_options;
178
-
179
-    $post_id = global_get_post_id();
180
-    $shadow_css = '';
181
-    if ($mk_options['page_title_shadow'] == 'true') {
182
-        $shadow_css = 'mk-drop-shadow';
183
-    }
184
-
185
-    $align = !empty($align) ? $align : 'left';
186
-
187
-    //$title = 'xxxx';
188
-    echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
189
-    echo '<div class="mk-grid">';
190
-    if (!empty($title)) {
191
-        echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
192
-
193
-    }
194
-
195
-    if (!empty($subtitle)) {
196
-        echo '<div class="page-introduce-subtitle">';
197
-        echo $subtitle;
198
-        echo '</div>';
199
-    }
200
-    if ($mk_options['disable_breadcrumb'] == 'true') {
201
-        if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') {
202
-            /**
203
-             * Calls the theme breadcrumbs for Jupiter theme.
204
-             *
205
-             * @since 1.4.0
206
-             */
207
-            do_action('theme_breadcrumbs', $post_id);
208
-        }
209
-    }
210
-
211
-    echo '<div class="clearboth"></div></div></section>';
177
+	global $mk_options;
178
+
179
+	$post_id = global_get_post_id();
180
+	$shadow_css = '';
181
+	if ($mk_options['page_title_shadow'] == 'true') {
182
+		$shadow_css = 'mk-drop-shadow';
183
+	}
184
+
185
+	$align = !empty($align) ? $align : 'left';
186
+
187
+	//$title = 'xxxx';
188
+	echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
189
+	echo '<div class="mk-grid">';
190
+	if (!empty($title)) {
191
+		echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
192
+
193
+	}
194
+
195
+	if (!empty($subtitle)) {
196
+		echo '<div class="page-introduce-subtitle">';
197
+		echo $subtitle;
198
+		echo '</div>';
199
+	}
200
+	if ($mk_options['disable_breadcrumb'] == 'true') {
201
+		if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') {
202
+			/**
203
+			 * Calls the theme breadcrumbs for Jupiter theme.
204
+			 *
205
+			 * @since 1.4.0
206
+			 */
207
+			do_action('theme_breadcrumbs', $post_id);
208
+		}
209
+	}
210
+
211
+	echo '<div class="clearboth"></div></div></section>';
212 212
 
213 213
 
214 214
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
     $delimiter = ' &#47; ';
159 159
 
160
-    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
160
+    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner '.$breadcrumb_skin_class.'-skin">';
161 161
 
162 162
     echo implode($delimiter, $item);
163 163
     echo "</div></div>";
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
     $align = !empty($align) ? $align : 'left';
186 186
 
187 187
     //$title = 'xxxx';
188
-    echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
188
+    echo '<section id="mk-page-introduce" class="intro-'.$align.'">';
189 189
     echo '<div class="mk-grid">';
190 190
     if (!empty($title)) {
191
-        echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
191
+        echo '<h1 class="page-introduce-title '.$shadow_css.'">'.$title.'</h1>';
192 192
 
193 193
     }
194 194
 
Please login to merge, or discard this patch.
upgrade.php 2 patches
Indentation   +505 added lines, -505 removed lines patch added patch discarded remove patch
@@ -10,46 +10,46 @@  discard block
 block discarded – undo
10 10
 global $wpdb;
11 11
 
12 12
 if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
13
-    /**
14
-     * Include custom database table related functions.
15
-     *
16
-     * @since 1.0.0
17
-     * @package GeoDirectory
18
-     */
19
-    include_once('geodirectory-admin/admin_db_install.php');
20
-    add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
21
-    if (GEODIRECTORY_VERSION <= '1.3.6') {
22
-        add_action('plugins_loaded', 'geodir_upgrade_136', 11);
23
-    }
13
+	/**
14
+	 * Include custom database table related functions.
15
+	 *
16
+	 * @since 1.0.0
17
+	 * @package GeoDirectory
18
+	 */
19
+	include_once('geodirectory-admin/admin_db_install.php');
20
+	add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
21
+	if (GEODIRECTORY_VERSION <= '1.3.6') {
22
+		add_action('plugins_loaded', 'geodir_upgrade_136', 11);
23
+	}
24 24
 
25
-    if (GEODIRECTORY_VERSION <= '1.4.6') {
26
-        add_action('init', 'geodir_upgrade_146', 11);
27
-    }
25
+	if (GEODIRECTORY_VERSION <= '1.4.6') {
26
+		add_action('init', 'geodir_upgrade_146', 11);
27
+	}
28 28
 
29
-    if (GEODIRECTORY_VERSION <= '1.4.8') {
30
-        add_action('init', 'geodir_upgrade_148', 11);
31
-    }
29
+	if (GEODIRECTORY_VERSION <= '1.4.8') {
30
+		add_action('init', 'geodir_upgrade_148', 11);
31
+	}
32 32
 
33
-    if (GEODIRECTORY_VERSION <= '1.5.0') {
34
-        add_action('init', 'geodir_upgrade_150', 11);
35
-    }
33
+	if (GEODIRECTORY_VERSION <= '1.5.0') {
34
+		add_action('init', 'geodir_upgrade_150', 11);
35
+	}
36 36
 
37
-    if (GEODIRECTORY_VERSION <= '1.5.2') {
38
-        add_action('init', 'geodir_upgrade_152', 11);
39
-    }
37
+	if (GEODIRECTORY_VERSION <= '1.5.2') {
38
+		add_action('init', 'geodir_upgrade_152', 11);
39
+	}
40 40
 
41
-    if (GEODIRECTORY_VERSION <= '1.5.3') {
42
-        add_action('init', 'geodir_upgrade_153', 11);
43
-    }
41
+	if (GEODIRECTORY_VERSION <= '1.5.3') {
42
+		add_action('init', 'geodir_upgrade_153', 11);
43
+	}
44 44
 
45
-    if (GEODIRECTORY_VERSION <= '1.5.4') {
46
-        add_action('init', 'geodir_upgrade_154', 11);
47
-    }
45
+	if (GEODIRECTORY_VERSION <= '1.5.4') {
46
+		add_action('init', 'geodir_upgrade_154', 11);
47
+	}
48 48
 
49 49
 
50
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
50
+	add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
51 51
 
52
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
52
+	update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
53 53
 
54 54
 }
55 55
 
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
  */
63 63
 function geodirectory_upgrade_all()
64 64
 {
65
-    geodir_create_tables();
66
-    geodir_update_review_db();
67
-    gd_install_theme_compat();
65
+	geodir_create_tables();
66
+	geodir_update_review_db();
67
+	gd_install_theme_compat();
68 68
 }
69 69
 
70 70
 /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_upgrade_136()
77 77
 {
78
-    geodir_fix_review_overall_rating();
78
+	geodir_fix_review_overall_rating();
79 79
 }
80 80
 
81 81
 /**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
  * @package GeoDirectory
86 86
  */
87 87
 function geodir_upgrade_146(){
88
-    gd_convert_virtual_pages();
88
+	gd_convert_virtual_pages();
89 89
 }
90 90
 
91 91
 /**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
  * @package GeoDirectory
96 96
  */
97 97
 function geodir_upgrade_150(){
98
-    gd_fix_cpt_rewrite_slug();
98
+	gd_fix_cpt_rewrite_slug();
99 99
 }
100 100
 
101 101
 
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
  * @package GeoDirectory
108 108
  */
109 109
 function geodir_upgrade_148(){
110
-    /*
110
+	/*
111 111
      * Blank the users google password if present as we now use oAuth 2.0
112 112
      */
113
-    update_option('geodir_ga_pass','');
114
-    update_option('geodir_ga_user','');
113
+	update_option('geodir_ga_pass','');
114
+	update_option('geodir_ga_user','');
115 115
 
116 116
 }
117 117
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
  * @package GeoDirectory
124 124
  */
125 125
 function geodir_upgrade_153(){
126
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
127
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
126
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
127
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
128 128
 }
129 129
 
130 130
 /**
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
  * @package GeoDirectory
135 135
  */
136 136
 function geodir_upgrade_154(){
137
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
137
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
138 138
 }
139 139
 
140 140
 /**
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
  * @package GeoDirectory
145 145
  */
146 146
 function geodir_upgrade_152(){
147
-    gd_fix_address_detail_table_limit();
147
+	gd_fix_address_detail_table_limit();
148 148
 }
149 149
 
150 150
 
@@ -158,12 +158,12 @@  discard block
 block discarded – undo
158 158
  */
159 159
 function geodir_update_review_db()
160 160
 {
161
-    global $wpdb, $plugin_prefix;
161
+	global $wpdb, $plugin_prefix;
162 162
 
163
-    geodir_fix_review_date();
164
-    geodir_fix_review_post_status();
165
-    geodir_fix_review_content();
166
-    geodir_fix_review_location();
163
+	geodir_fix_review_date();
164
+	geodir_fix_review_post_status();
165
+	geodir_fix_review_content();
166
+	geodir_fix_review_location();
167 167
 
168 168
 }
169 169
 
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
  */
177 177
 function geodir_fix_review_date()
178 178
 {
179
-    global $wpdb;
180
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
179
+	global $wpdb;
180
+	$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
181 181
 }
182 182
 
183 183
 /**
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
  */
190 190
 function geodir_fix_review_post_status()
191 191
 {
192
-    global $wpdb;
193
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
192
+	global $wpdb;
193
+	$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
194 194
 }
195 195
 
196 196
 /**
@@ -203,12 +203,12 @@  discard block
 block discarded – undo
203 203
  */
204 204
 function geodir_fix_review_content()
205 205
 {
206
-    global $wpdb;
207
-    if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
208
-        return true;
209
-    } else {
210
-        return false;
211
-    }
206
+	global $wpdb;
207
+	if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
208
+		return true;
209
+	} else {
210
+		return false;
211
+	}
212 212
 }
213 213
 
214 214
 /**
@@ -221,20 +221,20 @@  discard block
 block discarded – undo
221 221
  */
222 222
 function geodir_fix_review_location()
223 223
 {
224
-    global $wpdb;
224
+	global $wpdb;
225 225
 
226
-    $all_postypes = geodir_get_posttypes();
226
+	$all_postypes = geodir_get_posttypes();
227 227
 
228
-    if (!empty($all_postypes)) {
229
-        foreach ($all_postypes as $key) {
230
-            // update each GD CTP
228
+	if (!empty($all_postypes)) {
229
+		foreach ($all_postypes as $key) {
230
+			// update each GD CTP
231 231
 
232
-            $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
232
+			$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
233 233
 
234
-        }
235
-        return true;
236
-    }
237
-    return false;
234
+		}
235
+		return true;
236
+	}
237
+	return false;
238 238
 }
239 239
 
240 240
 /**
@@ -246,25 +246,25 @@  discard block
 block discarded – undo
246 246
  */
247 247
 function geodir_fix_review_overall_rating()
248 248
 {
249
-    global $wpdb;
249
+	global $wpdb;
250 250
 
251
-    $all_postypes = geodir_get_posttypes();
251
+	$all_postypes = geodir_get_posttypes();
252 252
 
253
-    if (!empty($all_postypes)) {
254
-        foreach ($all_postypes as $key) {
255
-            // update each GD CTP
256
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
253
+	if (!empty($all_postypes)) {
254
+		foreach ($all_postypes as $key) {
255
+			// update each GD CTP
256
+			$reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
257 257
 
258
-            if (!empty($reviews)) {
259
-                foreach ($reviews as $post_id) {
260
-                    geodir_update_postrating($post_id->post_id, $key);
261
-                }
258
+			if (!empty($reviews)) {
259
+				foreach ($reviews as $post_id) {
260
+					geodir_update_postrating($post_id->post_id, $key);
261
+				}
262 262
 
263
-            }
263
+			}
264 264
 
265
-        }
265
+		}
266 266
 
267
-    }
267
+	}
268 268
 }
269 269
 
270 270
 
@@ -281,367 +281,367 @@  discard block
 block discarded – undo
281 281
  */
282 282
 function gd_install_theme_compat()
283 283
 {
284
-    global $wpdb;
284
+	global $wpdb;
285 285
 
286
-    $theme_compat = array();
287
-    $theme_compat = get_option('gd_theme_compats');
286
+	$theme_compat = array();
287
+	$theme_compat = get_option('gd_theme_compats');
288 288
 //GDF
289
-    $theme_compat['GeoDirectory_Framework'] = array(
290
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
291
-        'geodir_wrapper_open_class' => '',
292
-        'geodir_wrapper_open_replace' => '',
293
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
294
-        'geodir_wrapper_content_open_id' => 'geodir_content',
295
-        'geodir_wrapper_content_open_class' => '',
296
-        'geodir_wrapper_content_open_replace' => '',
297
-        'geodir_wrapper_content_close_replace' => '',
298
-        'geodir_article_open_id' => '',
299
-        'geodir_article_open_class' => '',
300
-        'geodir_article_open_replace' => '',
301
-        'geodir_article_close_replace' => '',
302
-        'geodir_sidebar_right_open_id' => '',
303
-        'geodir_sidebar_right_open_class' => '',
304
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
305
-        'geodir_sidebar_right_close_replace' => '',
306
-        'geodir_sidebar_left_open_id' => '',
307
-        'geodir_sidebar_left_open_class' => '',
308
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
309
-        'geodir_sidebar_left_close_replace' => '',
310
-        'geodir_main_content_open_id' => '',
311
-        'geodir_main_content_open_class' => '',
312
-        'geodir_main_content_open_replace' => '<!-- removed -->',
313
-        'geodir_main_content_close_replace' => '<!-- removed -->',
314
-        'geodir_top_content_add' => '',
315
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
316
-        'geodir_before_widget_filter' => '',
317
-        'geodir_after_widget_filter' => '',
318
-        'geodir_theme_compat_css' => '',
319
-        'geodir_theme_compat_js' => '',
320
-        'geodir_theme_compat_default_options' => '',
321
-        'geodir_theme_compat_code' => ''
322
-    );
289
+	$theme_compat['GeoDirectory_Framework'] = array(
290
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
291
+		'geodir_wrapper_open_class' => '',
292
+		'geodir_wrapper_open_replace' => '',
293
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
294
+		'geodir_wrapper_content_open_id' => 'geodir_content',
295
+		'geodir_wrapper_content_open_class' => '',
296
+		'geodir_wrapper_content_open_replace' => '',
297
+		'geodir_wrapper_content_close_replace' => '',
298
+		'geodir_article_open_id' => '',
299
+		'geodir_article_open_class' => '',
300
+		'geodir_article_open_replace' => '',
301
+		'geodir_article_close_replace' => '',
302
+		'geodir_sidebar_right_open_id' => '',
303
+		'geodir_sidebar_right_open_class' => '',
304
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
305
+		'geodir_sidebar_right_close_replace' => '',
306
+		'geodir_sidebar_left_open_id' => '',
307
+		'geodir_sidebar_left_open_class' => '',
308
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
309
+		'geodir_sidebar_left_close_replace' => '',
310
+		'geodir_main_content_open_id' => '',
311
+		'geodir_main_content_open_class' => '',
312
+		'geodir_main_content_open_replace' => '<!-- removed -->',
313
+		'geodir_main_content_close_replace' => '<!-- removed -->',
314
+		'geodir_top_content_add' => '',
315
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
316
+		'geodir_before_widget_filter' => '',
317
+		'geodir_after_widget_filter' => '',
318
+		'geodir_theme_compat_css' => '',
319
+		'geodir_theme_compat_js' => '',
320
+		'geodir_theme_compat_default_options' => '',
321
+		'geodir_theme_compat_code' => ''
322
+	);
323 323
 
324 324
 //Directory Theme
325
-    $theme_compat['Directory_Starter'] = array(
326
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
327
-        'geodir_wrapper_open_class' => '',
328
-        'geodir_wrapper_open_replace' => '',
329
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
330
-        'geodir_wrapper_content_open_id' => 'geodir_content',
331
-        'geodir_wrapper_content_open_class' => '',
332
-        'geodir_wrapper_content_open_replace' => '',
333
-        'geodir_wrapper_content_close_replace' => '',
334
-        'geodir_article_open_id' => '',
335
-        'geodir_article_open_class' => '',
336
-        'geodir_article_open_replace' => '',
337
-        'geodir_article_close_replace' => '',
338
-        'geodir_sidebar_right_open_id' => '',
339
-        'geodir_sidebar_right_open_class' => '',
340
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
341
-        'geodir_sidebar_right_close_replace' => '',
342
-        'geodir_sidebar_left_open_id' => '',
343
-        'geodir_sidebar_left_open_class' => '',
344
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
345
-        'geodir_sidebar_left_close_replace' => '',
346
-        'geodir_main_content_open_id' => '',
347
-        'geodir_main_content_open_class' => '',
348
-        'geodir_main_content_open_replace' => '<!-- removed -->',
349
-        'geodir_main_content_close_replace' => '<!-- removed -->',
350
-        'geodir_top_content_add' => '',
351
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
352
-        'geodir_before_widget_filter' => '',
353
-        'geodir_after_widget_filter' => '',
354
-        'geodir_theme_compat_css' => '',
355
-        'geodir_theme_compat_js' => '',
356
-        'geodir_theme_compat_default_options' => '',
357
-        'geodir_theme_compat_code' => ''
358
-    );
325
+	$theme_compat['Directory_Starter'] = array(
326
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
327
+		'geodir_wrapper_open_class' => '',
328
+		'geodir_wrapper_open_replace' => '',
329
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
330
+		'geodir_wrapper_content_open_id' => 'geodir_content',
331
+		'geodir_wrapper_content_open_class' => '',
332
+		'geodir_wrapper_content_open_replace' => '',
333
+		'geodir_wrapper_content_close_replace' => '',
334
+		'geodir_article_open_id' => '',
335
+		'geodir_article_open_class' => '',
336
+		'geodir_article_open_replace' => '',
337
+		'geodir_article_close_replace' => '',
338
+		'geodir_sidebar_right_open_id' => '',
339
+		'geodir_sidebar_right_open_class' => '',
340
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
341
+		'geodir_sidebar_right_close_replace' => '',
342
+		'geodir_sidebar_left_open_id' => '',
343
+		'geodir_sidebar_left_open_class' => '',
344
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
345
+		'geodir_sidebar_left_close_replace' => '',
346
+		'geodir_main_content_open_id' => '',
347
+		'geodir_main_content_open_class' => '',
348
+		'geodir_main_content_open_replace' => '<!-- removed -->',
349
+		'geodir_main_content_close_replace' => '<!-- removed -->',
350
+		'geodir_top_content_add' => '',
351
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
352
+		'geodir_before_widget_filter' => '',
353
+		'geodir_after_widget_filter' => '',
354
+		'geodir_theme_compat_css' => '',
355
+		'geodir_theme_compat_js' => '',
356
+		'geodir_theme_compat_default_options' => '',
357
+		'geodir_theme_compat_code' => ''
358
+	);
359 359
 
360 360
 //Jobby
361
-    $theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
361
+	$theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
362 362
 
363 363
 //GeoProperty
364
-    $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
364
+	$theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
365 365
 
366 366
 //Avada
367
-    $theme_compat['Avada'] = array(
368
-        'geodir_wrapper_open_id' => '',
369
-        'geodir_wrapper_open_class' => '',
370
-        'geodir_wrapper_open_replace' => '<!-- removed -->',
371
-        'geodir_wrapper_close_replace' => '<!-- removed -->',
372
-        'geodir_wrapper_content_open_id' => 'content',
373
-        'geodir_wrapper_content_open_class' => '',
374
-        'geodir_wrapper_content_open_replace' => '',
375
-        'geodir_wrapper_content_close_replace' => '',
376
-        'geodir_article_open_id' => '',
377
-        'geodir_article_open_class' => '',
378
-        'geodir_article_open_replace' => '',
379
-        'geodir_article_close_replace' => '',
380
-        'geodir_sidebar_right_open_id' => '',
381
-        'geodir_sidebar_right_open_class' => '',
382
-        'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
383
-        'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
384
-        'geodir_sidebar_left_open_id' => '',
385
-        'geodir_sidebar_left_open_class' => '',
386
-        'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
387
-        'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
388
-        'geodir_main_content_open_id' => '',
389
-        'geodir_main_content_open_class' => '',
390
-        'geodir_main_content_open_replace' => '<!-- removed -->',
391
-        'geodir_main_content_close_replace' => '<!-- removed -->',
392
-        'geodir_top_content_add' => '',
393
-        'geodir_before_main_content_add' => '',
394
-        'geodir_before_widget_filter' => '',
395
-        'geodir_after_widget_filter' => '',
396
-        'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
397
-        'geodir_theme_compat_js' => '',
398
-        'geodir_theme_compat_default_options' => '',
399
-        'geodir_theme_compat_code' => 'Avada'
400
-    );
367
+	$theme_compat['Avada'] = array(
368
+		'geodir_wrapper_open_id' => '',
369
+		'geodir_wrapper_open_class' => '',
370
+		'geodir_wrapper_open_replace' => '<!-- removed -->',
371
+		'geodir_wrapper_close_replace' => '<!-- removed -->',
372
+		'geodir_wrapper_content_open_id' => 'content',
373
+		'geodir_wrapper_content_open_class' => '',
374
+		'geodir_wrapper_content_open_replace' => '',
375
+		'geodir_wrapper_content_close_replace' => '',
376
+		'geodir_article_open_id' => '',
377
+		'geodir_article_open_class' => '',
378
+		'geodir_article_open_replace' => '',
379
+		'geodir_article_close_replace' => '',
380
+		'geodir_sidebar_right_open_id' => '',
381
+		'geodir_sidebar_right_open_class' => '',
382
+		'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
383
+		'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
384
+		'geodir_sidebar_left_open_id' => '',
385
+		'geodir_sidebar_left_open_class' => '',
386
+		'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
387
+		'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
388
+		'geodir_main_content_open_id' => '',
389
+		'geodir_main_content_open_class' => '',
390
+		'geodir_main_content_open_replace' => '<!-- removed -->',
391
+		'geodir_main_content_close_replace' => '<!-- removed -->',
392
+		'geodir_top_content_add' => '',
393
+		'geodir_before_main_content_add' => '',
394
+		'geodir_before_widget_filter' => '',
395
+		'geodir_after_widget_filter' => '',
396
+		'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
397
+		'geodir_theme_compat_js' => '',
398
+		'geodir_theme_compat_default_options' => '',
399
+		'geodir_theme_compat_code' => 'Avada'
400
+	);
401 401
 
402 402
 //Enfold
403
-    $theme_compat['Enfold'] = array(
404
-        'geodir_wrapper_open_id' => '',
405
-        'geodir_wrapper_open_class' => '',
406
-        'geodir_wrapper_open_replace' => '',
407
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
408
-        'geodir_wrapper_content_open_id' => '',
409
-        'geodir_wrapper_content_open_class' => '',
410
-        'geodir_wrapper_content_open_replace' => '',
411
-        'geodir_wrapper_content_close_replace' => '</div></main>',
412
-        'geodir_article_open_id' => '',
413
-        'geodir_article_open_class' => '',
414
-        'geodir_article_open_replace' => '',
415
-        'geodir_article_close_replace' => '',
416
-        'geodir_sidebar_right_open_id' => '',
417
-        'geodir_sidebar_right_open_class' => '',
418
-        'geodir_sidebar_right_open_replace' => '',
419
-        'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
420
-        'geodir_sidebar_left_open_id' => '',
421
-        'geodir_sidebar_left_open_class' => '',
422
-        'geodir_sidebar_left_open_replace' => '',
423
-        'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
424
-        'geodir_main_content_open_id' => '',
425
-        'geodir_main_content_open_class' => '',
426
-        'geodir_main_content_open_replace' => '',
427
-        'geodir_main_content_close_replace' => '',
428
-        'geodir_top_content_add' => '',
429
-        'geodir_before_main_content_add' => '',
430
-        'geodir_before_widget_filter' => '',
431
-        'geodir_after_widget_filter' => '',
432
-        'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
433
-        'geodir_theme_compat_js' => '',
434
-        'geodir_theme_compat_default_options' => '',
435
-        'geodir_theme_compat_code' => 'Enfold'
436
-    );
403
+	$theme_compat['Enfold'] = array(
404
+		'geodir_wrapper_open_id' => '',
405
+		'geodir_wrapper_open_class' => '',
406
+		'geodir_wrapper_open_replace' => '',
407
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
408
+		'geodir_wrapper_content_open_id' => '',
409
+		'geodir_wrapper_content_open_class' => '',
410
+		'geodir_wrapper_content_open_replace' => '',
411
+		'geodir_wrapper_content_close_replace' => '</div></main>',
412
+		'geodir_article_open_id' => '',
413
+		'geodir_article_open_class' => '',
414
+		'geodir_article_open_replace' => '',
415
+		'geodir_article_close_replace' => '',
416
+		'geodir_sidebar_right_open_id' => '',
417
+		'geodir_sidebar_right_open_class' => '',
418
+		'geodir_sidebar_right_open_replace' => '',
419
+		'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
420
+		'geodir_sidebar_left_open_id' => '',
421
+		'geodir_sidebar_left_open_class' => '',
422
+		'geodir_sidebar_left_open_replace' => '',
423
+		'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
424
+		'geodir_main_content_open_id' => '',
425
+		'geodir_main_content_open_class' => '',
426
+		'geodir_main_content_open_replace' => '',
427
+		'geodir_main_content_close_replace' => '',
428
+		'geodir_top_content_add' => '',
429
+		'geodir_before_main_content_add' => '',
430
+		'geodir_before_widget_filter' => '',
431
+		'geodir_after_widget_filter' => '',
432
+		'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
433
+		'geodir_theme_compat_js' => '',
434
+		'geodir_theme_compat_default_options' => '',
435
+		'geodir_theme_compat_code' => 'Enfold'
436
+	);
437 437
 
438 438
 // X
439
-    $theme_compat['X'] = array(
440
-        'geodir_wrapper_open_id' => '',
441
-        'geodir_wrapper_open_class' => '',
442
-        'geodir_wrapper_open_replace' => '',
443
-        'geodir_wrapper_close_replace' => '',
444
-        'geodir_wrapper_content_open_id' => '',
445
-        'geodir_wrapper_content_open_class' => '',
446
-        'geodir_wrapper_content_open_replace' => '',
447
-        'geodir_wrapper_content_close_replace' => '',
448
-        'geodir_article_open_id' => '',
449
-        'geodir_article_open_class' => '',
450
-        'geodir_article_open_replace' => '',
451
-        'geodir_article_close_replace' => '',
452
-        'geodir_sidebar_right_open_id' => '',
453
-        'geodir_sidebar_right_open_class' => '',
454
-        'geodir_sidebar_right_open_replace' => '',
455
-        'geodir_sidebar_right_close_replace' => '',
456
-        'geodir_sidebar_left_open_id' => '',
457
-        'geodir_sidebar_left_open_class' => '',
458
-        'geodir_sidebar_left_open_replace' => '',
459
-        'geodir_sidebar_left_close_replace' => '',
460
-        'geodir_main_content_open_id' => '',
461
-        'geodir_main_content_open_class' => '',
462
-        'geodir_main_content_open_replace' => '',
463
-        'geodir_main_content_close_replace' => '',
464
-        'geodir_top_content_add' => '',
465
-        'geodir_before_main_content_add' => '',
466
-        'geodir_before_widget_filter' => '',
467
-        'geodir_after_widget_filter' => '',
468
-        'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
469
-        'geodir_theme_compat_js' => '',
470
-        'geodir_theme_compat_default_options' => '',
471
-        'geodir_theme_compat_code' => 'X'
472
-    );
439
+	$theme_compat['X'] = array(
440
+		'geodir_wrapper_open_id' => '',
441
+		'geodir_wrapper_open_class' => '',
442
+		'geodir_wrapper_open_replace' => '',
443
+		'geodir_wrapper_close_replace' => '',
444
+		'geodir_wrapper_content_open_id' => '',
445
+		'geodir_wrapper_content_open_class' => '',
446
+		'geodir_wrapper_content_open_replace' => '',
447
+		'geodir_wrapper_content_close_replace' => '',
448
+		'geodir_article_open_id' => '',
449
+		'geodir_article_open_class' => '',
450
+		'geodir_article_open_replace' => '',
451
+		'geodir_article_close_replace' => '',
452
+		'geodir_sidebar_right_open_id' => '',
453
+		'geodir_sidebar_right_open_class' => '',
454
+		'geodir_sidebar_right_open_replace' => '',
455
+		'geodir_sidebar_right_close_replace' => '',
456
+		'geodir_sidebar_left_open_id' => '',
457
+		'geodir_sidebar_left_open_class' => '',
458
+		'geodir_sidebar_left_open_replace' => '',
459
+		'geodir_sidebar_left_close_replace' => '',
460
+		'geodir_main_content_open_id' => '',
461
+		'geodir_main_content_open_class' => '',
462
+		'geodir_main_content_open_replace' => '',
463
+		'geodir_main_content_close_replace' => '',
464
+		'geodir_top_content_add' => '',
465
+		'geodir_before_main_content_add' => '',
466
+		'geodir_before_widget_filter' => '',
467
+		'geodir_after_widget_filter' => '',
468
+		'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
469
+		'geodir_theme_compat_js' => '',
470
+		'geodir_theme_compat_default_options' => '',
471
+		'geodir_theme_compat_code' => 'X'
472
+	);
473 473
 
474 474
 // Divi
475
-    $theme_compat['Divi'] = array(
476
-        'geodir_wrapper_open_id' => 'main-content',
477
-        'geodir_wrapper_open_class' => '',
478
-        'geodir_wrapper_open_replace' => '',
479
-        'geodir_wrapper_close_replace' => '',
480
-        'geodir_wrapper_content_open_id' => 'left-area',
481
-        'geodir_wrapper_content_open_class' => '',
482
-        'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
483
-        'geodir_wrapper_content_close_replace' => '',
484
-        'geodir_article_open_id' => '',
485
-        'geodir_article_open_class' => '',
486
-        'geodir_article_open_replace' => '',
487
-        'geodir_article_close_replace' => '',
488
-        'geodir_sidebar_right_open_id' => 'sidebar',
489
-        'geodir_sidebar_right_open_class' => '',
490
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
491
-        'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
492
-        'geodir_sidebar_left_open_id' => 'sidebar',
493
-        'geodir_sidebar_left_open_class' => '',
494
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
495
-        'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
496
-        'geodir_main_content_open_id' => '',
497
-        'geodir_main_content_open_class' => '',
498
-        'geodir_main_content_open_replace' => '',
499
-        'geodir_main_content_close_replace' => '',
500
-        'geodir_top_content_add' => '',
501
-        'geodir_before_main_content_add' => '',
502
-        'geodir_before_widget_filter' => '',
503
-        'geodir_after_widget_filter' => '',
504
-        'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
505
-        'geodir_theme_compat_js' => '',
506
-        'geodir_theme_compat_default_options' => '',
507
-        'geodir_theme_compat_code' => 'Divi'
508
-    );
475
+	$theme_compat['Divi'] = array(
476
+		'geodir_wrapper_open_id' => 'main-content',
477
+		'geodir_wrapper_open_class' => '',
478
+		'geodir_wrapper_open_replace' => '',
479
+		'geodir_wrapper_close_replace' => '',
480
+		'geodir_wrapper_content_open_id' => 'left-area',
481
+		'geodir_wrapper_content_open_class' => '',
482
+		'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
483
+		'geodir_wrapper_content_close_replace' => '',
484
+		'geodir_article_open_id' => '',
485
+		'geodir_article_open_class' => '',
486
+		'geodir_article_open_replace' => '',
487
+		'geodir_article_close_replace' => '',
488
+		'geodir_sidebar_right_open_id' => 'sidebar',
489
+		'geodir_sidebar_right_open_class' => '',
490
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
491
+		'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
492
+		'geodir_sidebar_left_open_id' => 'sidebar',
493
+		'geodir_sidebar_left_open_class' => '',
494
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
495
+		'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
496
+		'geodir_main_content_open_id' => '',
497
+		'geodir_main_content_open_class' => '',
498
+		'geodir_main_content_open_replace' => '',
499
+		'geodir_main_content_close_replace' => '',
500
+		'geodir_top_content_add' => '',
501
+		'geodir_before_main_content_add' => '',
502
+		'geodir_before_widget_filter' => '',
503
+		'geodir_after_widget_filter' => '',
504
+		'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
505
+		'geodir_theme_compat_js' => '',
506
+		'geodir_theme_compat_default_options' => '',
507
+		'geodir_theme_compat_code' => 'Divi'
508
+	);
509 509
 
510 510
 // Genesis
511
-    $theme_compat['Genesis'] = array(
512
-        'geodir_wrapper_open_id' => '',
513
-        'geodir_wrapper_open_class' => 'content-sidebar-wrap',
514
-        'geodir_wrapper_open_replace' => '',
515
-        'geodir_wrapper_close_replace' => '',
516
-        'geodir_wrapper_content_open_id' => '',
517
-        'geodir_wrapper_content_open_class' => 'content',
518
-        'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
519
-        'geodir_wrapper_content_close_replace' => '',
520
-        'geodir_article_open_id' => '',
521
-        'geodir_article_open_class' => '',
522
-        'geodir_article_open_replace' => '',
523
-        'geodir_article_close_replace' => '',
524
-        'geodir_sidebar_right_open_id' => '',
525
-        'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
526
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
527
-        'geodir_sidebar_right_close_replace' => '',
528
-        'geodir_sidebar_left_open_id' => '',
529
-        'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
530
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
531
-        'geodir_sidebar_left_close_replace' => '',
532
-        'geodir_main_content_open_id' => '',
533
-        'geodir_main_content_open_class' => '',
534
-        'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
535
-        'geodir_main_content_close_replace' => '',
536
-        'geodir_top_content_add' => '',
537
-        'geodir_before_main_content_add' => '',
538
-        'geodir_before_widget_filter' => '',
539
-        'geodir_after_widget_filter' => '',
540
-        'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
541
-        'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
542
-        'geodir_theme_compat_js' => '',
543
-        'geodir_theme_compat_default_options' => '',
544
-        'geodir_theme_compat_code' => 'Genesis'
545
-    );
511
+	$theme_compat['Genesis'] = array(
512
+		'geodir_wrapper_open_id' => '',
513
+		'geodir_wrapper_open_class' => 'content-sidebar-wrap',
514
+		'geodir_wrapper_open_replace' => '',
515
+		'geodir_wrapper_close_replace' => '',
516
+		'geodir_wrapper_content_open_id' => '',
517
+		'geodir_wrapper_content_open_class' => 'content',
518
+		'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
519
+		'geodir_wrapper_content_close_replace' => '',
520
+		'geodir_article_open_id' => '',
521
+		'geodir_article_open_class' => '',
522
+		'geodir_article_open_replace' => '',
523
+		'geodir_article_close_replace' => '',
524
+		'geodir_sidebar_right_open_id' => '',
525
+		'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
526
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
527
+		'geodir_sidebar_right_close_replace' => '',
528
+		'geodir_sidebar_left_open_id' => '',
529
+		'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
530
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
531
+		'geodir_sidebar_left_close_replace' => '',
532
+		'geodir_main_content_open_id' => '',
533
+		'geodir_main_content_open_class' => '',
534
+		'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
535
+		'geodir_main_content_close_replace' => '',
536
+		'geodir_top_content_add' => '',
537
+		'geodir_before_main_content_add' => '',
538
+		'geodir_before_widget_filter' => '',
539
+		'geodir_after_widget_filter' => '',
540
+		'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
541
+		'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
542
+		'geodir_theme_compat_js' => '',
543
+		'geodir_theme_compat_default_options' => '',
544
+		'geodir_theme_compat_code' => 'Genesis'
545
+	);
546 546
 
547 547
 // Jupiter
548
-    $theme_compat['Jupiter'] = array(
549
-        'geodir_wrapper_open_id' => '',
550
-        'geodir_wrapper_open_class' => '',
551
-        'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div  class="theme-page-wrapper mk-main-wrapper  mk-grid vc_row-fluid">',
552
-        'geodir_wrapper_close_replace' => '</div></div></div>',
553
-        'geodir_wrapper_content_open_id' => '',
554
-        'geodir_wrapper_content_open_class' => '',
555
-        'geodir_wrapper_content_open_replace' => '',
556
-        'geodir_wrapper_content_close_replace' => '',
557
-        'geodir_article_open_id' => '',
558
-        'geodir_article_open_class' => '',
559
-        'geodir_article_open_replace' => '',
560
-        'geodir_article_close_replace' => '',
561
-        'geodir_sidebar_right_open_id' => 'mk-sidebar',
562
-        'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
563
-        'geodir_sidebar_right_open_replace' => '',
564
-        'geodir_sidebar_right_close_replace' => '',
565
-        'geodir_sidebar_left_open_id' => 'mk-sidebar',
566
-        'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
567
-        'geodir_sidebar_left_open_replace' => '',
568
-        'geodir_sidebar_left_close_replace' => '',
569
-        'geodir_main_content_open_id' => '',
570
-        'geodir_main_content_open_class' => '',
571
-        'geodir_main_content_open_replace' => '',
572
-        'geodir_main_content_close_replace' => '',
573
-        'geodir_top_content_add' => '',
574
-        'geodir_before_main_content_add' => '',
575
-        'geodir_before_widget_filter' => '',
576
-        'geodir_after_widget_filter' => '',
577
-        'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
578
-        'geodir_after_title_filter' => '',
579
-        'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
580
-        'geodir_sub_menu_ul_class_filter' => '',
581
-        'geodir_sub_menu_li_class_filter' => '',
582
-        'geodir_menu_a_class_filter' => 'menu-item-link',
583
-        'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
584
-        'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu',
585
-        'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
586
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
587
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
588
-        'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
589
-        'geodir_theme_compat_js' => '',
590
-        'geodir_theme_compat_default_options' => '',
591
-        'geodir_theme_compat_code' => 'Jupiter'
592
-    );
548
+	$theme_compat['Jupiter'] = array(
549
+		'geodir_wrapper_open_id' => '',
550
+		'geodir_wrapper_open_class' => '',
551
+		'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div  class="theme-page-wrapper mk-main-wrapper  mk-grid vc_row-fluid">',
552
+		'geodir_wrapper_close_replace' => '</div></div></div>',
553
+		'geodir_wrapper_content_open_id' => '',
554
+		'geodir_wrapper_content_open_class' => '',
555
+		'geodir_wrapper_content_open_replace' => '',
556
+		'geodir_wrapper_content_close_replace' => '',
557
+		'geodir_article_open_id' => '',
558
+		'geodir_article_open_class' => '',
559
+		'geodir_article_open_replace' => '',
560
+		'geodir_article_close_replace' => '',
561
+		'geodir_sidebar_right_open_id' => 'mk-sidebar',
562
+		'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
563
+		'geodir_sidebar_right_open_replace' => '',
564
+		'geodir_sidebar_right_close_replace' => '',
565
+		'geodir_sidebar_left_open_id' => 'mk-sidebar',
566
+		'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
567
+		'geodir_sidebar_left_open_replace' => '',
568
+		'geodir_sidebar_left_close_replace' => '',
569
+		'geodir_main_content_open_id' => '',
570
+		'geodir_main_content_open_class' => '',
571
+		'geodir_main_content_open_replace' => '',
572
+		'geodir_main_content_close_replace' => '',
573
+		'geodir_top_content_add' => '',
574
+		'geodir_before_main_content_add' => '',
575
+		'geodir_before_widget_filter' => '',
576
+		'geodir_after_widget_filter' => '',
577
+		'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
578
+		'geodir_after_title_filter' => '',
579
+		'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
580
+		'geodir_sub_menu_ul_class_filter' => '',
581
+		'geodir_sub_menu_li_class_filter' => '',
582
+		'geodir_menu_a_class_filter' => 'menu-item-link',
583
+		'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
584
+		'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu',
585
+		'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
586
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
587
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
588
+		'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
589
+		'geodir_theme_compat_js' => '',
590
+		'geodir_theme_compat_default_options' => '',
591
+		'geodir_theme_compat_code' => 'Jupiter'
592
+	);
593 593
 
594 594
 // Multi News
595
-    $theme_compat['Multi_News'] = array(
596
-        'geodir_wrapper_open_id' => '',
597
-        'geodir_wrapper_open_class' => 'main-container clearfix',
598
-        'geodir_wrapper_open_replace' => '',
599
-        'geodir_wrapper_close_replace' => '',
600
-        'geodir_wrapper_content_open_id' => '',
601
-        'geodir_wrapper_content_open_class' => '',
602
-        'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
603
-        'geodir_wrapper_content_close_replace' => '</div></div></div>',
604
-        'geodir_article_open_id' => '',
605
-        'geodir_article_open_class' => '',
606
-        'geodir_article_open_replace' => '',
607
-        'geodir_article_close_replace' => '',
608
-        'geodir_sidebar_right_open_id' => '',
609
-        'geodir_sidebar_right_open_class' => '',
610
-        'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
611
-        'geodir_sidebar_right_close_replace' => '',
612
-        'geodir_sidebar_left_open_id' => '',
613
-        'geodir_sidebar_left_open_class' => '',
614
-        'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
615
-        'geodir_sidebar_left_close_replace' => '',
616
-        'geodir_main_content_open_id' => '',
617
-        'geodir_main_content_open_class' => '',
618
-        'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
619
-        'geodir_main_content_close_replace' => '</div>',
620
-        'geodir_top_content_add' => '',
621
-        'geodir_before_main_content_add' => '',
622
-        'geodir_full_page_class_filter' => 'section full-width-section',
623
-        'geodir_before_widget_filter' => '',
624
-        'geodir_after_widget_filter' => '',
625
-        'geodir_before_title_filter' => '<div class="widget-title"><h2>',
626
-        'geodir_after_title_filter' => '</h2></div>',
627
-        'geodir_menu_li_class_filter' => '',
628
-        'geodir_sub_menu_ul_class_filter' => '',
629
-        'geodir_sub_menu_li_class_filter' => '',
630
-        'geodir_menu_a_class_filter' => '',
631
-        'geodir_sub_menu_a_class_filter' => '',
632
-        'geodir_location_switcher_menu_li_class_filter' => '',
633
-        'geodir_location_switcher_menu_a_class_filter' => '',
634
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
635
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
636
-        'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
637
-        'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
638
-        'geodir_theme_compat_default_options' => '',
639
-        'geodir_theme_compat_code' => 'Multi_News'
640
-    );
641
-
642
-    update_option('gd_theme_compats', $theme_compat);
643
-
644
-    gd_set_theme_compat();// set the compat pack if avail
595
+	$theme_compat['Multi_News'] = array(
596
+		'geodir_wrapper_open_id' => '',
597
+		'geodir_wrapper_open_class' => 'main-container clearfix',
598
+		'geodir_wrapper_open_replace' => '',
599
+		'geodir_wrapper_close_replace' => '',
600
+		'geodir_wrapper_content_open_id' => '',
601
+		'geodir_wrapper_content_open_class' => '',
602
+		'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
603
+		'geodir_wrapper_content_close_replace' => '</div></div></div>',
604
+		'geodir_article_open_id' => '',
605
+		'geodir_article_open_class' => '',
606
+		'geodir_article_open_replace' => '',
607
+		'geodir_article_close_replace' => '',
608
+		'geodir_sidebar_right_open_id' => '',
609
+		'geodir_sidebar_right_open_class' => '',
610
+		'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
611
+		'geodir_sidebar_right_close_replace' => '',
612
+		'geodir_sidebar_left_open_id' => '',
613
+		'geodir_sidebar_left_open_class' => '',
614
+		'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
615
+		'geodir_sidebar_left_close_replace' => '',
616
+		'geodir_main_content_open_id' => '',
617
+		'geodir_main_content_open_class' => '',
618
+		'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
619
+		'geodir_main_content_close_replace' => '</div>',
620
+		'geodir_top_content_add' => '',
621
+		'geodir_before_main_content_add' => '',
622
+		'geodir_full_page_class_filter' => 'section full-width-section',
623
+		'geodir_before_widget_filter' => '',
624
+		'geodir_after_widget_filter' => '',
625
+		'geodir_before_title_filter' => '<div class="widget-title"><h2>',
626
+		'geodir_after_title_filter' => '</h2></div>',
627
+		'geodir_menu_li_class_filter' => '',
628
+		'geodir_sub_menu_ul_class_filter' => '',
629
+		'geodir_sub_menu_li_class_filter' => '',
630
+		'geodir_menu_a_class_filter' => '',
631
+		'geodir_sub_menu_a_class_filter' => '',
632
+		'geodir_location_switcher_menu_li_class_filter' => '',
633
+		'geodir_location_switcher_menu_a_class_filter' => '',
634
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
635
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
636
+		'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
637
+		'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
638
+		'geodir_theme_compat_default_options' => '',
639
+		'geodir_theme_compat_code' => 'Multi_News'
640
+	);
641
+
642
+	update_option('gd_theme_compats', $theme_compat);
643
+
644
+	gd_set_theme_compat();// set the compat pack if avail
645 645
 }
646 646
 
647 647
 
@@ -653,61 +653,61 @@  discard block
 block discarded – undo
653 653
  * @global object $wpdb WordPress Database object.
654 654
  */
655 655
 function gd_convert_virtual_pages(){
656
-    global $wpdb;
657
-
658
-    // Update the add listing page settings
659
-    $add_listing_page = $wpdb->get_var(
660
-        $wpdb->prepare(
661
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
662
-            array('add-listing')
663
-        )
664
-    );
665
-
666
-    if($add_listing_page){
667
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
668
-        update_option( 'geodir_add_listing_page', $add_listing_page);
669
-    }
670
-
671
-    // Update the listing preview page settings
672
-    $listing_preview_page = $wpdb->get_var(
673
-        $wpdb->prepare(
674
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
675
-            array('listing-preview')
676
-        )
677
-    );
678
-
679
-    if($listing_preview_page){
680
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
681
-        update_option( 'geodir_preview_page', $listing_preview_page);
682
-    }
683
-
684
-    // Update the listing success page settings
685
-    $listing_success_page = $wpdb->get_var(
686
-        $wpdb->prepare(
687
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
688
-            array('listing-success')
689
-        )
690
-    );
691
-
692
-    if($listing_success_page){
693
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
694
-        update_option( 'geodir_success_page', $listing_success_page);
695
-    }
696
-
697
-    // Update the listing success page settings
698
-    $location_page = $wpdb->get_var(
699
-        $wpdb->prepare(
700
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
701
-            array('location')
702
-        )
703
-    );
704
-
705
-    if($location_page){
706
-        $location_slug = get_option('geodir_location_prefix');
707
-        if(!$location_slug ){$location_slug  = 'location';}
708
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
709
-        update_option( 'geodir_location_page', $location_page);
710
-    }
656
+	global $wpdb;
657
+
658
+	// Update the add listing page settings
659
+	$add_listing_page = $wpdb->get_var(
660
+		$wpdb->prepare(
661
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
662
+			array('add-listing')
663
+		)
664
+	);
665
+
666
+	if($add_listing_page){
667
+		wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
668
+		update_option( 'geodir_add_listing_page', $add_listing_page);
669
+	}
670
+
671
+	// Update the listing preview page settings
672
+	$listing_preview_page = $wpdb->get_var(
673
+		$wpdb->prepare(
674
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
675
+			array('listing-preview')
676
+		)
677
+	);
678
+
679
+	if($listing_preview_page){
680
+		wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
681
+		update_option( 'geodir_preview_page', $listing_preview_page);
682
+	}
683
+
684
+	// Update the listing success page settings
685
+	$listing_success_page = $wpdb->get_var(
686
+		$wpdb->prepare(
687
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
688
+			array('listing-success')
689
+		)
690
+	);
691
+
692
+	if($listing_success_page){
693
+		wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
694
+		update_option( 'geodir_success_page', $listing_success_page);
695
+	}
696
+
697
+	// Update the listing success page settings
698
+	$location_page = $wpdb->get_var(
699
+		$wpdb->prepare(
700
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
701
+			array('location')
702
+		)
703
+	);
704
+
705
+	if($location_page){
706
+		$location_slug = get_option('geodir_location_prefix');
707
+		if(!$location_slug ){$location_slug  = 'location';}
708
+		wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
709
+		update_option( 'geodir_location_page', $location_page);
710
+	}
711 711
 
712 712
 }
713 713
 
@@ -721,31 +721,31 @@  discard block
 block discarded – undo
721 721
 function gd_fix_cpt_rewrite_slug()
722 722
 {
723 723
 
724
-    $alt_post_types = array();
725
-    $post_types = get_option('geodir_post_types');
724
+	$alt_post_types = array();
725
+	$post_types = get_option('geodir_post_types');
726 726
 
727 727
 
728
-    if (is_array($post_types)){
728
+	if (is_array($post_types)){
729 729
 
730
-        foreach ($post_types as $post_type => $args) {
730
+		foreach ($post_types as $post_type => $args) {
731 731
 
732 732
 
733
-            if(isset($args['rewrite']['slug'])){
734
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
735
-            }
733
+			if(isset($args['rewrite']['slug'])){
734
+				$args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
735
+			}
736 736
 
737
-                $alt_post_types[$post_type] = $args;
737
+				$alt_post_types[$post_type] = $args;
738 738
 
739
-        }
740
-    }
739
+		}
740
+	}
741 741
 
742
-    if(!empty($alt_post_types)) {
743
-        update_option('geodir_post_types',$alt_post_types);
744
-        }
742
+	if(!empty($alt_post_types)) {
743
+		update_option('geodir_post_types',$alt_post_types);
744
+		}
745 745
 
746 746
 
747
-    // flush the rewrite rules
748
-    flush_rewrite_rules();
747
+	// flush the rewrite rules
748
+	flush_rewrite_rules();
749 749
 }
750 750
 
751 751
 
@@ -758,18 +758,18 @@  discard block
 block discarded – undo
758 758
  */
759 759
 function gd_fix_address_detail_table_limit()
760 760
 {
761
-    global $wpdb;
762
-
763
-    $all_postypes = geodir_get_posttypes();
764
-
765
-    if (!empty($all_postypes)) {
766
-        foreach ($all_postypes as $key) {
767
-            // update each GD CTP
768
-            try {
769
-                $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
770
-            } catch(Exception $e) {
771
-                error_log( 'Error: ' . $e->getMessage() );
772
-            }
773
-        }
774
-    }
761
+	global $wpdb;
762
+
763
+	$all_postypes = geodir_get_posttypes();
764
+
765
+	if (!empty($all_postypes)) {
766
+		foreach ($all_postypes as $key) {
767
+			// update each GD CTP
768
+			try {
769
+				$wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
770
+			} catch(Exception $e) {
771
+				error_log( 'Error: ' . $e->getMessage() );
772
+			}
773
+		}
774
+	}
775 775
 }
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 global $wpdb;
11 11
 
12
-if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
12
+if (get_option('geodirectory'.'_db_version') != GEODIRECTORY_VERSION) {
13 13
     /**
14 14
      * Include custom database table related functions.
15 15
      *
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
     }
48 48
 
49 49
 
50
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
50
+    add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions
51 51
 
52
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
52
+    update_option('geodirectory'.'_db_version', GEODIRECTORY_VERSION);
53 53
 
54 54
 }
55 55
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
  * @since 1.0.0
85 85
  * @package GeoDirectory
86 86
  */
87
-function geodir_upgrade_146(){
87
+function geodir_upgrade_146() {
88 88
     gd_convert_virtual_pages();
89 89
 }
90 90
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
  * @since 1.5.0
95 95
  * @package GeoDirectory
96 96
  */
97
-function geodir_upgrade_150(){
97
+function geodir_upgrade_150() {
98 98
     gd_fix_cpt_rewrite_slug();
99 99
 }
100 100
 
@@ -106,12 +106,12 @@  discard block
 block discarded – undo
106 106
  * @since 1.4.8
107 107
  * @package GeoDirectory
108 108
  */
109
-function geodir_upgrade_148(){
109
+function geodir_upgrade_148() {
110 110
     /*
111 111
      * Blank the users google password if present as we now use oAuth 2.0
112 112
      */
113
-    update_option('geodir_ga_pass','');
114
-    update_option('geodir_ga_user','');
113
+    update_option('geodir_ga_pass', '');
114
+    update_option('geodir_ga_user', '');
115 115
 
116 116
 }
117 117
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
  * @since 1.5.3
123 123
  * @package GeoDirectory
124 124
  */
125
-function geodir_upgrade_153(){
125
+function geodir_upgrade_153() {
126 126
     geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
127 127
     geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
128 128
 }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
  * @since 1.5.3
134 134
  * @package GeoDirectory
135 135
  */
136
-function geodir_upgrade_154(){
136
+function geodir_upgrade_154() {
137 137
     geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
138 138
 }
139 139
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
  * @since 1.5.2
144 144
  * @package GeoDirectory
145 145
  */
146
-function geodir_upgrade_152(){
146
+function geodir_upgrade_152() {
147 147
     gd_fix_address_detail_table_limit();
148 148
 }
149 149
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 function geodir_fix_review_date()
178 178
 {
179 179
     global $wpdb;
180
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
180
+    $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
181 181
 }
182 182
 
183 183
 /**
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 function geodir_fix_review_post_status()
191 191
 {
192 192
     global $wpdb;
193
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
193
+    $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
194 194
 }
195 195
 
196 196
 /**
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 function geodir_fix_review_content()
205 205
 {
206 206
     global $wpdb;
207
-    if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
207
+    if ($wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
208 208
         return true;
209 209
     } else {
210 210
         return false;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         foreach ($all_postypes as $key) {
230 230
             // update each GD CTP
231 231
 
232
-            $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
232
+            $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN ".$wpdb->prefix."geodir_".$key."_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
233 233
 
234 234
         }
235 235
         return true;
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     if (!empty($all_postypes)) {
254 254
         foreach ($all_postypes as $key) {
255 255
             // update each GD CTP
256
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
256
+            $reviews = $wpdb->get_results("SELECT post_id FROM ".$wpdb->prefix."geodir_".$key."_detail d");
257 257
 
258 258
             if (!empty($reviews)) {
259 259
                 foreach ($reviews as $post_id) {
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 
642 642
     update_option('gd_theme_compats', $theme_compat);
643 643
 
644
-    gd_set_theme_compat();// set the compat pack if avail
644
+    gd_set_theme_compat(); // set the compat pack if avail
645 645
 }
646 646
 
647 647
 
@@ -652,61 +652,61 @@  discard block
 block discarded – undo
652 652
  * @package GeoDirectory
653 653
  * @global object $wpdb WordPress Database object.
654 654
  */
655
-function gd_convert_virtual_pages(){
655
+function gd_convert_virtual_pages() {
656 656
     global $wpdb;
657 657
 
658 658
     // Update the add listing page settings
659 659
     $add_listing_page = $wpdb->get_var(
660 660
         $wpdb->prepare(
661
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
661
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
662 662
             array('add-listing')
663 663
         )
664 664
     );
665 665
 
666
-    if($add_listing_page){
667
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
668
-        update_option( 'geodir_add_listing_page', $add_listing_page);
666
+    if ($add_listing_page) {
667
+        wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish'));
668
+        update_option('geodir_add_listing_page', $add_listing_page);
669 669
     }
670 670
 
671 671
     // Update the listing preview page settings
672 672
     $listing_preview_page = $wpdb->get_var(
673 673
         $wpdb->prepare(
674
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
674
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
675 675
             array('listing-preview')
676 676
         )
677 677
     );
678 678
 
679
-    if($listing_preview_page){
680
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
681
-        update_option( 'geodir_preview_page', $listing_preview_page);
679
+    if ($listing_preview_page) {
680
+        wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish'));
681
+        update_option('geodir_preview_page', $listing_preview_page);
682 682
     }
683 683
 
684 684
     // Update the listing success page settings
685 685
     $listing_success_page = $wpdb->get_var(
686 686
         $wpdb->prepare(
687
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
687
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
688 688
             array('listing-success')
689 689
         )
690 690
     );
691 691
 
692
-    if($listing_success_page){
693
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
694
-        update_option( 'geodir_success_page', $listing_success_page);
692
+    if ($listing_success_page) {
693
+        wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish'));
694
+        update_option('geodir_success_page', $listing_success_page);
695 695
     }
696 696
 
697 697
     // Update the listing success page settings
698 698
     $location_page = $wpdb->get_var(
699 699
         $wpdb->prepare(
700
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
700
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
701 701
             array('location')
702 702
         )
703 703
     );
704 704
 
705
-    if($location_page){
705
+    if ($location_page) {
706 706
         $location_slug = get_option('geodir_location_prefix');
707
-        if(!$location_slug ){$location_slug  = 'location';}
708
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
709
-        update_option( 'geodir_location_page', $location_page);
707
+        if (!$location_slug) {$location_slug = 'location'; }
708
+        wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug));
709
+        update_option('geodir_location_page', $location_page);
710 710
     }
711 711
 
712 712
 }
@@ -725,13 +725,13 @@  discard block
 block discarded – undo
725 725
     $post_types = get_option('geodir_post_types');
726 726
 
727 727
 
728
-    if (is_array($post_types)){
728
+    if (is_array($post_types)) {
729 729
 
730 730
         foreach ($post_types as $post_type => $args) {
731 731
 
732 732
 
733
-            if(isset($args['rewrite']['slug'])){
734
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
733
+            if (isset($args['rewrite']['slug'])) {
734
+                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']);
735 735
             }
736 736
 
737 737
                 $alt_post_types[$post_type] = $args;
@@ -739,8 +739,8 @@  discard block
 block discarded – undo
739 739
         }
740 740
     }
741 741
 
742
-    if(!empty($alt_post_types)) {
743
-        update_option('geodir_post_types',$alt_post_types);
742
+    if (!empty($alt_post_types)) {
743
+        update_option('geodir_post_types', $alt_post_types);
744 744
         }
745 745
 
746 746
 
@@ -766,9 +766,9 @@  discard block
 block discarded – undo
766 766
         foreach ($all_postypes as $key) {
767 767
             // update each GD CTP
768 768
             try {
769
-                $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
770
-            } catch(Exception $e) {
771
-                error_log( 'Error: ' . $e->getMessage() );
769
+                $wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_".$key."_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
770
+            } catch (Exception $e) {
771
+                error_log('Error: '.$e->getMessage());
772 772
             }
773 773
         }
774 774
     }
Please login to merge, or discard this patch.
geodirectory-templates/popup-forms.php 2 patches
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -29,23 +29,23 @@  discard block
 block discarded – undo
29 29
             <input type="hidden" id="send_to_Frnd_pid" name="pid" value="<?php echo $post_info->ID;?>"/>
30 30
 
31 31
             <h3><?php
32
-                /**
33
-                 * Filter the title for the send to friend popup form.
34
-                 *
35
-                 * @since 1.0.0
36
-                 * @param string $title The title for the form, defaults to global `SEND_TO_FRIEND` text.
37
-                 */
38
-                echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND);?></h3>
32
+				/**
33
+				 * Filter the title for the send to friend popup form.
34
+				 *
35
+				 * @since 1.0.0
36
+				 * @param string $title The title for the form, defaults to global `SEND_TO_FRIEND` text.
37
+				 */
38
+				echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND);?></h3>
39 39
 
40 40
             <p id="reply_send_success" class="sucess_msg" style="display:none;"></p>
41 41
             <?php
42
-            /**
43
-             * Called before each field in the send to friend popup template.
44
-             *
45
-             * @since 1.0.0
46
-             * @param string $field The field name the actions is called before.
47
-             */
48
-            do_action('geodir_before_stf_form_field', 'to_name');?>
42
+			/**
43
+			 * Called before each field in the send to friend popup template.
44
+			 *
45
+			 * @since 1.0.0
46
+			 * @param string $field The field name the actions is called before.
47
+			 */
48
+			do_action('geodir_before_stf_form_field', 'to_name');?>
49 49
             <div class="row clearfix">
50 50
                 <div class="geodir_popup_heading">
51 51
                     <label><?php _e('Friend Name', 'geodirectory');?> : <span>*</span></label></div>
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
54 54
                     <span class="message_error2" id="to_nameInfo"></span></div>
55 55
             </div>
56 56
             <?php
57
-            /**
58
-             * Called after each field in the send to friend popup template.
59
-             *
60
-             * @since 1.0.0
61
-             * @param string $field The field name the actions is called after.
62
-             */
63
-            do_action('geodir_after_stf_form_field', 'to_name');?>
57
+			/**
58
+			 * Called after each field in the send to friend popup template.
59
+			 *
60
+			 * @since 1.0.0
61
+			 * @param string $field The field name the actions is called after.
62
+			 */
63
+			do_action('geodir_after_stf_form_field', 'to_name');?>
64 64
             <?php
65
-            /** This action is documented in geodirectory-templates/popup-forms.php */
66
-            do_action('geodir_before_stf_form_field', 'to_email');?>
65
+			/** This action is documented in geodirectory-templates/popup-forms.php */
66
+			do_action('geodir_before_stf_form_field', 'to_email');?>
67 67
             <div class="row  clearfix">
68 68
                 <div class="geodir_popup_heading">
69 69
                     <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div>
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
                     <span class="message_error2" id="to_emailInfo"></span></div>
73 73
             </div>
74 74
             <?php
75
-            /** This action is documented in geodirectory-templates/popup-forms.php */
76
-            do_action('geodir_after_stf_form_field', 'to_email');?>
75
+			/** This action is documented in geodirectory-templates/popup-forms.php */
76
+			do_action('geodir_after_stf_form_field', 'to_email');?>
77 77
             <?php
78
-            /** This action is documented in geodirectory-templates/popup-forms.php */
79
-            do_action('geodir_before_stf_form_field', 'yourname');?>
78
+			/** This action is documented in geodirectory-templates/popup-forms.php */
79
+			do_action('geodir_before_stf_form_field', 'yourname');?>
80 80
             <div class="row  clearfix">
81 81
                 <div class="geodir_popup_heading">
82 82
                     <label><?php _e('Your Name', 'geodirectory');?> : <span>*</span></label></div>
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
                     <span class="message_error2" id="yournameInfo"></span></div>
86 86
             </div>
87 87
             <?php
88
-            /** This action is documented in geodirectory-templates/popup-forms.php */
89
-            do_action('geodir_after_stf_form_field', 'yourname');?>
88
+			/** This action is documented in geodirectory-templates/popup-forms.php */
89
+			do_action('geodir_after_stf_form_field', 'yourname');?>
90 90
             <?php
91
-            /** This action is documented in geodirectory-templates/popup-forms.php */
92
-            do_action('geodir_before_stf_form_field', 'youremail');?>
91
+			/** This action is documented in geodirectory-templates/popup-forms.php */
92
+			do_action('geodir_before_stf_form_field', 'youremail');?>
93 93
             <div class="row  clearfix">
94 94
                 <div class="geodir_popup_heading">
95 95
                     <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div>
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
                     <span class="message_error2" id="youremailInfo"></span></div>
99 99
             </div>
100 100
             <?php
101
-            /** This action is documented in geodirectory-templates/popup-forms.php */
102
-            do_action('geodir_after_stf_form_field', 'youremail');?>
101
+			/** This action is documented in geodirectory-templates/popup-forms.php */
102
+			do_action('geodir_after_stf_form_field', 'youremail');?>
103 103
             <?php
104
-            /** This action is documented in geodirectory-templates/popup-forms.php */
105
-            do_action('geodir_before_stf_form_field', 'frnd_subject');?>
104
+			/** This action is documented in geodirectory-templates/popup-forms.php */
105
+			do_action('geodir_before_stf_form_field', 'frnd_subject');?>
106 106
             <div class="row  clearfix">
107 107
                 <div class="geodir_popup_heading">
108 108
                     <label><?php _e('Subject', 'geodirectory');?> : <span>*</span></label></div>
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
                     <span class="message_error2" id="frnd_subjectInfo"></span></div>
114 114
             </div>
115 115
             <?php
116
-            /** This action is documented in geodirectory-templates/popup-forms.php */
117
-            do_action('geodir_after_stf_form_field', 'frnd_subject');?>
116
+			/** This action is documented in geodirectory-templates/popup-forms.php */
117
+			do_action('geodir_after_stf_form_field', 'frnd_subject');?>
118 118
             <?php
119
-            /** This action is documented in geodirectory-templates/popup-forms.php */
120
-            do_action('geodir_before_stf_form_field', 'frnd_comments');?>
119
+			/** This action is documented in geodirectory-templates/popup-forms.php */
120
+			do_action('geodir_before_stf_form_field', 'frnd_comments');?>
121 121
             <div class="row  clearfix">
122 122
                 <div class="geodir_popup_heading">
123 123
                     <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div>
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
                     <span class="message_error2" id="frnd_commentsInfo"></span></div>
128 128
             </div>
129 129
             <?php
130
-            /** This action is documented in geodirectory-templates/popup-forms.php */
131
-            do_action('geodir_after_stf_form_field', 'frnd_comments');?>
130
+			/** This action is documented in geodirectory-templates/popup-forms.php */
131
+			do_action('geodir_after_stf_form_field', 'frnd_comments');?>
132 132
             <?php if (function_exists('geodir_get_captch')) {
133
-                geodir_get_captch('-1');
134
-            }?>
133
+				geodir_get_captch('-1');
134
+			}?>
135 135
             <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory')?> " class="button "/>
136 136
         </form>
137 137
     </div> <?php
@@ -145,23 +145,23 @@  discard block
 block discarded – undo
145 145
             <input type="hidden" name="pid" value="<?php echo $post_info->ID;?>"/>
146 146
 
147 147
             <h3><?php
148
-                /**
149
-                 * Filter the title for the send inquiry popup form.
150
-                 *
151
-                 * @since 1.0.0
152
-                 * @param string $title The title for the form, defaults to global `SEND_INQUIRY` text.
153
-                 */
154
-                echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY);?> </h3>
148
+				/**
149
+				 * Filter the title for the send inquiry popup form.
150
+				 *
151
+				 * @since 1.0.0
152
+				 * @param string $title The title for the form, defaults to global `SEND_INQUIRY` text.
153
+				 */
154
+				echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY);?> </h3>
155 155
 
156 156
             <p id="inquiry_send_success" class="sucess_msg" style="display:none;"></p>
157 157
             <?php
158
-            /**
159
-             * Called before each field in the send to friend inquiry template.
160
-             *
161
-             * @since 1.0.0
162
-             * @param string $field The field name the actions is called before.
163
-             */
164
-            do_action('geodir_before_inquiry_form_field', 'inq_name');?>
158
+			/**
159
+			 * Called before each field in the send to friend inquiry template.
160
+			 *
161
+			 * @since 1.0.0
162
+			 * @param string $field The field name the actions is called before.
163
+			 */
164
+			do_action('geodir_before_inquiry_form_field', 'inq_name');?>
165 165
             <div class="row  clearfix">
166 166
                 <div class="geodir_popup_heading"><label><?php _e('Your Name', 'geodirectory');?> :
167 167
                         <span>*</span></label></div>
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
                     <span class="message_error2" id="span_agt_mail_name"></span></div>
171 171
             </div>
172 172
             <?php
173
-            /**
174
-             * Called after each field in the send to friend inquiry template.
175
-             *
176
-             * @since 1.0.0
177
-             * @param string $field The field name the actions is called after.
178
-             */
179
-            do_action('geodir_after_inquiry_form_field', 'inq_name');?>
173
+			/**
174
+			 * Called after each field in the send to friend inquiry template.
175
+			 *
176
+			 * @since 1.0.0
177
+			 * @param string $field The field name the actions is called after.
178
+			 */
179
+			do_action('geodir_after_inquiry_form_field', 'inq_name');?>
180 180
             <?php
181
-            /** This action is documented in geodirectory-templates/popup-forms.php */
182
-            do_action('geodir_before_inquiry_form_field', 'inq_email');?>
181
+			/** This action is documented in geodirectory-templates/popup-forms.php */
182
+			do_action('geodir_before_inquiry_form_field', 'inq_email');?>
183 183
             <div class="row  clearfix">
184 184
                 <div class="geodir_popup_heading">
185 185
                     <label><?php _e('Email', 'geodirectory');?> : <span>*</span></label></div>
@@ -189,11 +189,11 @@  discard block
 block discarded – undo
189 189
                 </div>
190 190
             </div>
191 191
             <?php
192
-            /** This action is documented in geodirectory-templates/popup-forms.php */
193
-            do_action('geodir_after_inquiry_form_field', 'inq_email');?>
192
+			/** This action is documented in geodirectory-templates/popup-forms.php */
193
+			do_action('geodir_after_inquiry_form_field', 'inq_email');?>
194 194
             <?php
195
-            /** This action is documented in geodirectory-templates/popup-forms.php */
196
-            do_action('geodir_before_inquiry_form_field', 'inq_phone');?>
195
+			/** This action is documented in geodirectory-templates/popup-forms.php */
196
+			do_action('geodir_before_inquiry_form_field', 'inq_phone');?>
197 197
             <div class="row  clearfix">
198 198
                 <div class="geodir_popup_heading">
199 199
                     <label><?php _e('Contact Info', 'geodirectory');?> :</label></div>
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
                 </div>
203 203
             </div>
204 204
             <?php
205
-            /** This action is documented in geodirectory-templates/popup-forms.php */
206
-            do_action('geodir_after_inquiry_form_field', 'inq_phone');?>
205
+			/** This action is documented in geodirectory-templates/popup-forms.php */
206
+			do_action('geodir_after_inquiry_form_field', 'inq_phone');?>
207 207
             <?php
208
-            /** This action is documented in geodirectory-templates/popup-forms.php */
209
-            do_action('geodir_before_inquiry_form_field', 'inq_msg');?>
208
+			/** This action is documented in geodirectory-templates/popup-forms.php */
209
+			do_action('geodir_before_inquiry_form_field', 'inq_msg');?>
210 210
             <div class="row  clearfix">
211 211
                 <div class="geodir_popup_heading">
212 212
                     <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div>
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
                     <span class="message_error2" id="span_agt_mail_msg"></span></div>
217 217
             </div>
218 218
             <?php
219
-            /** This action is documented in geodirectory-templates/popup-forms.php */
220
-            do_action('geodir_after_inquiry_form_field', 'inq_msg');?>
219
+			/** This action is documented in geodirectory-templates/popup-forms.php */
220
+			do_action('geodir_after_inquiry_form_field', 'inq_msg');?>
221 221
             <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory');?>"
222 222
                    class="button clearfix"/>
223 223
         </form>
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
  * @param int $post_id The post id requested by the popup.
20 20
  * @param object $post_info The post object requested by the popup.
21 21
  */
22
-do_action('geodir_popup_forms_template_start',$post_id,$post_info);
22
+do_action('geodir_popup_forms_template_start', $post_id, $post_info);
23 23
 
24 24
 if ($_REQUEST['popuptype'] == 'b_sendtofriend') { ?>
25 25
 
26 26
     <div id="basic-modal-content" class="clearfix">
27 27
         <form name="send_to_frnd" id="send_to_frnd" action="<?php echo get_permalink($post_info->ID); ?>" method="post">
28 28
             <input type="hidden" name="sendact" value="email_frnd"/>
29
-            <input type="hidden" id="send_to_Frnd_pid" name="pid" value="<?php echo $post_info->ID;?>"/>
29
+            <input type="hidden" id="send_to_Frnd_pid" name="pid" value="<?php echo $post_info->ID; ?>"/>
30 30
 
31 31
             <h3><?php
32 32
                 /**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                  * @since 1.0.0
36 36
                  * @param string $title The title for the form, defaults to global `SEND_TO_FRIEND` text.
37 37
                  */
38
-                echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND);?></h3>
38
+                echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND); ?></h3>
39 39
 
40 40
             <p id="reply_send_success" class="sucess_msg" style="display:none;"></p>
41 41
             <?php
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
              * @since 1.0.0
46 46
              * @param string $field The field name the actions is called before.
47 47
              */
48
-            do_action('geodir_before_stf_form_field', 'to_name');?>
48
+            do_action('geodir_before_stf_form_field', 'to_name'); ?>
49 49
             <div class="row clearfix">
50 50
                 <div class="geodir_popup_heading">
51
-                    <label><?php _e('Friend Name', 'geodirectory');?> : <span>*</span></label></div>
51
+                    <label><?php _e('Friend Name', 'geodirectory'); ?> : <span>*</span></label></div>
52 52
                 <div class="geodir_popup_field">
53 53
                     <input class="is_required" field_type="text" name="to_name" id="to_name" type="text" value=""/>
54 54
                     <span class="message_error2" id="to_nameInfo"></span></div>
@@ -60,75 +60,75 @@  discard block
 block discarded – undo
60 60
              * @since 1.0.0
61 61
              * @param string $field The field name the actions is called after.
62 62
              */
63
-            do_action('geodir_after_stf_form_field', 'to_name');?>
63
+            do_action('geodir_after_stf_form_field', 'to_name'); ?>
64 64
             <?php
65 65
             /** This action is documented in geodirectory-templates/popup-forms.php */
66
-            do_action('geodir_before_stf_form_field', 'to_email');?>
66
+            do_action('geodir_before_stf_form_field', 'to_email'); ?>
67 67
             <div class="row  clearfix">
68 68
                 <div class="geodir_popup_heading">
69
-                    <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div>
69
+                    <label> <?php _e('Email', 'geodirectory'); ?> : <span>*</span></label></div>
70 70
                 <div class="geodir_popup_field">
71 71
                     <input class="is_required" field_type="email" name="to_email" id="to_email" type="text" value=""/>
72 72
                     <span class="message_error2" id="to_emailInfo"></span></div>
73 73
             </div>
74 74
             <?php
75 75
             /** This action is documented in geodirectory-templates/popup-forms.php */
76
-            do_action('geodir_after_stf_form_field', 'to_email');?>
76
+            do_action('geodir_after_stf_form_field', 'to_email'); ?>
77 77
             <?php
78 78
             /** This action is documented in geodirectory-templates/popup-forms.php */
79
-            do_action('geodir_before_stf_form_field', 'yourname');?>
79
+            do_action('geodir_before_stf_form_field', 'yourname'); ?>
80 80
             <div class="row  clearfix">
81 81
                 <div class="geodir_popup_heading">
82
-                    <label><?php _e('Your Name', 'geodirectory');?> : <span>*</span></label></div>
82
+                    <label><?php _e('Your Name', 'geodirectory'); ?> : <span>*</span></label></div>
83 83
                 <div class="geodir_popup_field">
84 84
                     <input class="is_required" field_type="text" name="yourname" id="yourname" type="text" value=""/>
85 85
                     <span class="message_error2" id="yournameInfo"></span></div>
86 86
             </div>
87 87
             <?php
88 88
             /** This action is documented in geodirectory-templates/popup-forms.php */
89
-            do_action('geodir_after_stf_form_field', 'yourname');?>
89
+            do_action('geodir_after_stf_form_field', 'yourname'); ?>
90 90
             <?php
91 91
             /** This action is documented in geodirectory-templates/popup-forms.php */
92
-            do_action('geodir_before_stf_form_field', 'youremail');?>
92
+            do_action('geodir_before_stf_form_field', 'youremail'); ?>
93 93
             <div class="row  clearfix">
94 94
                 <div class="geodir_popup_heading">
95
-                    <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div>
95
+                    <label> <?php _e('Email', 'geodirectory'); ?> : <span>*</span></label></div>
96 96
                 <div class="geodir_popup_field">
97 97
                     <input class="is_required" field_type="email" name="youremail" id="youremail" type="text" value=""/>
98 98
                     <span class="message_error2" id="youremailInfo"></span></div>
99 99
             </div>
100 100
             <?php
101 101
             /** This action is documented in geodirectory-templates/popup-forms.php */
102
-            do_action('geodir_after_stf_form_field', 'youremail');?>
102
+            do_action('geodir_after_stf_form_field', 'youremail'); ?>
103 103
             <?php
104 104
             /** This action is documented in geodirectory-templates/popup-forms.php */
105
-            do_action('geodir_before_stf_form_field', 'frnd_subject');?>
105
+            do_action('geodir_before_stf_form_field', 'frnd_subject'); ?>
106 106
             <div class="row  clearfix">
107 107
                 <div class="geodir_popup_heading">
108
-                    <label><?php _e('Subject', 'geodirectory');?> : <span>*</span></label></div>
108
+                    <label><?php _e('Subject', 'geodirectory'); ?> : <span>*</span></label></div>
109 109
                 <div class="geodir_popup_field">
110 110
                     <input class="is_required" field_type="text" name="frnd_subject"
111
-                           value="<?php echo __('About', 'geodirectory') . ' ' . $post_info->post_title;?>"
111
+                           value="<?php echo __('About', 'geodirectory').' '.$post_info->post_title; ?>"
112 112
                            id="frnd_subject" type="text" value=""/>
113 113
                     <span class="message_error2" id="frnd_subjectInfo"></span></div>
114 114
             </div>
115 115
             <?php
116 116
             /** This action is documented in geodirectory-templates/popup-forms.php */
117
-            do_action('geodir_after_stf_form_field', 'frnd_subject');?>
117
+            do_action('geodir_after_stf_form_field', 'frnd_subject'); ?>
118 118
             <?php
119 119
             /** This action is documented in geodirectory-templates/popup-forms.php */
120
-            do_action('geodir_before_stf_form_field', 'frnd_comments');?>
120
+            do_action('geodir_before_stf_form_field', 'frnd_comments'); ?>
121 121
             <div class="row  clearfix">
122 122
                 <div class="geodir_popup_heading">
123
-                    <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div>
123
+                    <label><?php _e('Comments', 'geodirectory'); ?> : <span>*</span></label></div>
124 124
                 <div class="geodir_popup_field">
125 125
                     <textarea class="is_required" field_type="textarea" name="frnd_comments" id="frnd_comments" cols=""
126
-                              rows=""><?php echo SEND_TO_FRIEND_SAMPLE_CONTENT;?></textarea>
126
+                              rows=""><?php echo SEND_TO_FRIEND_SAMPLE_CONTENT; ?></textarea>
127 127
                     <span class="message_error2" id="frnd_commentsInfo"></span></div>
128 128
             </div>
129 129
             <?php
130 130
             /** This action is documented in geodirectory-templates/popup-forms.php */
131
-            do_action('geodir_after_stf_form_field', 'frnd_comments');?>
131
+            do_action('geodir_after_stf_form_field', 'frnd_comments'); ?>
132 132
             <?php if (function_exists('geodir_get_captch')) {
133 133
                 geodir_get_captch('-1');
134 134
             }?>
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         <form method="post" name="agt_mail_agent" id="agt_mail_agent"
143 143
               action="<?php echo get_permalink($post_info->ID); ?>">
144 144
             <input type="hidden" name="sendact" value="send_inqury"/>
145
-            <input type="hidden" name="pid" value="<?php echo $post_info->ID;?>"/>
145
+            <input type="hidden" name="pid" value="<?php echo $post_info->ID; ?>"/>
146 146
 
147 147
             <h3><?php
148 148
                 /**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                  * @since 1.0.0
152 152
                  * @param string $title The title for the form, defaults to global `SEND_INQUIRY` text.
153 153
                  */
154
-                echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY);?> </h3>
154
+                echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY); ?> </h3>
155 155
 
156 156
             <p id="inquiry_send_success" class="sucess_msg" style="display:none;"></p>
157 157
             <?php
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
              * @since 1.0.0
162 162
              * @param string $field The field name the actions is called before.
163 163
              */
164
-            do_action('geodir_before_inquiry_form_field', 'inq_name');?>
164
+            do_action('geodir_before_inquiry_form_field', 'inq_name'); ?>
165 165
             <div class="row  clearfix">
166
-                <div class="geodir_popup_heading"><label><?php _e('Your Name', 'geodirectory');?> :
166
+                <div class="geodir_popup_heading"><label><?php _e('Your Name', 'geodirectory'); ?> :
167 167
                         <span>*</span></label></div>
168 168
                 <div class="geodir_popup_field">
169 169
                     <input class="is_required" field_type="text" name="inq_name" type="text" value=""/>
@@ -176,13 +176,13 @@  discard block
 block discarded – undo
176 176
              * @since 1.0.0
177 177
              * @param string $field The field name the actions is called after.
178 178
              */
179
-            do_action('geodir_after_inquiry_form_field', 'inq_name');?>
179
+            do_action('geodir_after_inquiry_form_field', 'inq_name'); ?>
180 180
             <?php
181 181
             /** This action is documented in geodirectory-templates/popup-forms.php */
182
-            do_action('geodir_before_inquiry_form_field', 'inq_email');?>
182
+            do_action('geodir_before_inquiry_form_field', 'inq_email'); ?>
183 183
             <div class="row  clearfix">
184 184
                 <div class="geodir_popup_heading">
185
-                    <label><?php _e('Email', 'geodirectory');?> : <span>*</span></label></div>
185
+                    <label><?php _e('Email', 'geodirectory'); ?> : <span>*</span></label></div>
186 186
                 <div class="geodir_popup_field">
187 187
                     <input class="is_required" field_type="email" name="inq_email" type="text" value=""/>
188 188
                     <span class="message_error2" id="span_agt_mail_email"></span>
@@ -190,35 +190,35 @@  discard block
 block discarded – undo
190 190
             </div>
191 191
             <?php
192 192
             /** This action is documented in geodirectory-templates/popup-forms.php */
193
-            do_action('geodir_after_inquiry_form_field', 'inq_email');?>
193
+            do_action('geodir_after_inquiry_form_field', 'inq_email'); ?>
194 194
             <?php
195 195
             /** This action is documented in geodirectory-templates/popup-forms.php */
196
-            do_action('geodir_before_inquiry_form_field', 'inq_phone');?>
196
+            do_action('geodir_before_inquiry_form_field', 'inq_phone'); ?>
197 197
             <div class="row  clearfix">
198 198
                 <div class="geodir_popup_heading">
199
-                    <label><?php _e('Contact Info', 'geodirectory');?> :</label></div>
199
+                    <label><?php _e('Contact Info', 'geodirectory'); ?> :</label></div>
200 200
                 <div class="geodir_popup_field">
201 201
                     <input name="inq_phone" id="agt_mail_phone" type="text" value=""/>
202 202
                 </div>
203 203
             </div>
204 204
             <?php
205 205
             /** This action is documented in geodirectory-templates/popup-forms.php */
206
-            do_action('geodir_after_inquiry_form_field', 'inq_phone');?>
206
+            do_action('geodir_after_inquiry_form_field', 'inq_phone'); ?>
207 207
             <?php
208 208
             /** This action is documented in geodirectory-templates/popup-forms.php */
209
-            do_action('geodir_before_inquiry_form_field', 'inq_msg');?>
209
+            do_action('geodir_before_inquiry_form_field', 'inq_msg'); ?>
210 210
             <div class="row  clearfix">
211 211
                 <div class="geodir_popup_heading">
212
-                    <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div>
212
+                    <label><?php _e('Comments', 'geodirectory'); ?> : <span>*</span></label></div>
213 213
                 <div class="geodir_popup_field">
214 214
                     <textarea class="is_required" field_type="textarea" name="inq_msg" cols=""
215
-                              rows=""><?php echo SEND_INQUIRY_SAMPLE_CONTENT;?></textarea>
215
+                              rows=""><?php echo SEND_INQUIRY_SAMPLE_CONTENT; ?></textarea>
216 216
                     <span class="message_error2" id="span_agt_mail_msg"></span></div>
217 217
             </div>
218 218
             <?php
219 219
             /** This action is documented in geodirectory-templates/popup-forms.php */
220
-            do_action('geodir_after_inquiry_form_field', 'inq_msg');?>
221
-            <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory');?>"
220
+            do_action('geodir_after_inquiry_form_field', 'inq_msg'); ?>
221
+            <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory'); ?>"
222 222
                    class="button clearfix"/>
223 223
         </form>
224 224
     </div> <?php
Please login to merge, or discard this patch.
geodirectory-templates/add-listing.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 global $gd_session;
13 13
 
14 14
 if (!isset($_REQUEST['backandedit'])) {
15
-    $gd_session->un_set('listing');
15
+	$gd_session->un_set('listing');
16 16
 }
17 17
 // call header
18 18
 get_header();
Please login to merge, or discard this patch.
geodirectory-templates/reg_frm.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
  * @package GeoDirectory
10 10
  */
11 11
 if (isset($_GET['redirect_to']) && $_GET['redirect_to'] != '') {
12
-    $redirect_to = $_GET['redirect_to'];
12
+	$redirect_to = $_GET['redirect_to'];
13 13
 } else {
14
-    //echo $_SERVER['HTTP_HOST'] ;
15
-    $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
16
-    if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
17
-        $redirect_to = home_url();
18
-    }
14
+	//echo $_SERVER['HTTP_HOST'] ;
15
+	$redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
16
+	if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
17
+		$redirect_to = home_url();
18
+	}
19 19
 }
20 20
 ?>
21 21
 <div id="sign_up">
@@ -26,28 +26,28 @@  discard block
 block discarded – undo
26 26
         <h4>
27 27
             <?php
28 28
 
29
-            /**
30
-             * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template.
31
-             *
32
-             * @since 1.0.0
33
-             */
34
-            echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
29
+			/**
30
+			 * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template.
31
+			 *
32
+			 * @since 1.0.0
33
+			 */
34
+			echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
35 35
 
36
-            ?>
36
+			?>
37 37
         </h4>
38 38
         <?php
39
-        global $geodir_signup_error;
40
-        if ($geodir_signup_error != '') {
41
-            echo '<p class="error_msg">' . $geodir_signup_error . '</p>';
42
-            unset($geodir_signup_error);
43
-        } else {
44
-            if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
45
-                echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>';
46
-            } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
47
-                echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>';
48
-            }
49
-        }
50
-        ?>
39
+		global $geodir_signup_error;
40
+		if ($geodir_signup_error != '') {
41
+			echo '<p class="error_msg">' . $geodir_signup_error . '</p>';
42
+			unset($geodir_signup_error);
43
+		} else {
44
+			if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
45
+				echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>';
46
+			} else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
47
+				echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>';
48
+			}
49
+		}
50
+		?>
51 51
 
52 52
         <form name="cus_registerform" id="cus_registerform"
53 53
               action="<?php echo htmlspecialchars(geodir_curPageURL()); ?>" method="post">
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
             <div class="form_row clearfix">
58 58
                 <input placeholder='<?php echo EMAIL_TEXT; ?>' type="text" name="user_email" id="user_email"
59 59
                        class="textfield" value="<?php global $user_email;
60
-                if (!isset($user_email)) {
61
-                    $user_email = '';
62
-                }
63
-                echo esc_attr(stripslashes($user_email)); ?>" size="25"/>
60
+				if (!isset($user_email)) {
61
+					$user_email = '';
62
+				}
63
+				echo esc_attr(stripslashes($user_email)); ?>" size="25"/>
64 64
 
65 65
                 <?php if (!get_option('geodir_allow_cpass')) { ?>
66 66
 				<div id="reg_passmail">
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
                 <div class="form_row clearfix">
75 75
                     <input placeholder='<?php echo FIRST_NAME_TEXT; ?>' type="text" name="user_fname" id="user_fname"
76 76
                            class="textfield" value="<?php if (isset($user_fname)) {
77
-                        echo esc_attr(stripslashes($user_fname));
78
-                    } ?>" size="25"/>
77
+						echo esc_attr(stripslashes($user_fname));
78
+					} ?>" size="25"/>
79 79
                     <span id="user_fnameInfo"></span>
80 80
                 </div>
81 81
             </div>
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
             <?php } ?>
102 102
 
103 103
             <?php
104
-            /**
105
-             * Called just before the register new user button on the register form template.
106
-             *
107
-             * Also used by other plugins to add social connect buttons.
108
-             *
109
-             * @since 1.0.0
110
-             */
111
-            do_action('social_connect_form'); ?>
104
+			/**
105
+			 * Called just before the register new user button on the register form template.
106
+			 *
107
+			 * Also used by other plugins to add social connect buttons.
108
+			 *
109
+			 * @since 1.0.0
110
+			 */
111
+			do_action('social_connect_form'); ?>
112 112
             <input type="submit" name="registernow" value="<?php echo REGISTER_NOW_TEXT; ?>" class="geodir_button"/>
113 113
         </form>
114 114
     </div>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,13 +38,13 @@
 block discarded – undo
38 38
         <?php
39 39
         global $geodir_signup_error;
40 40
         if ($geodir_signup_error != '') {
41
-            echo '<p class="error_msg">' . $geodir_signup_error . '</p>';
41
+            echo '<p class="error_msg">'.$geodir_signup_error.'</p>';
42 42
             unset($geodir_signup_error);
43 43
         } else {
44 44
             if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
45
-                echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>';
45
+                echo '<p class="error_msg">'.EMAIL_USERNAME_EXIST_MSG.'</p>';
46 46
             } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
47
-                echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>';
47
+                echo '<p class="error_msg">'.REGISTRATION_DESABLED_MSG.'</p>';
48 48
             }
49 49
         }
50 50
         ?>
Please login to merge, or discard this patch.
geodirectory.php 3 patches
Braces   +27 added lines, -9 removed lines patch added patch discarded remove patch
@@ -76,29 +76,45 @@  discard block
 block discarded – undo
76 76
 /**
77 77
  * Do not store any revisions (except the one autosave per post).
78 78
  */
79
-if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 0);
79
+if (!defined('WP_POST_REVISIONS')) {
80
+	define('WP_POST_REVISIONS', 0);
81
+}
80 82
 
81 83
 /**
82 84
  * Define constants
83 85
  */
84
-if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
86
+if(!defined('GEODIRECTORY_PLUGIN_DIR')) {
87
+	define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
88
+}
85 89
 
86 90
 /*
87 91
  * Declare database table names. All since version 1.0.0
88 92
  */
89 93
 
90 94
 /** Define the database name for the countries table. */
91
-if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
95
+if (!defined('GEODIR_COUNTRIES_TABLE')) {
96
+	define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
97
+}
92 98
 /** Define the database name for the custom fields table. */
93
-if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
99
+if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) {
100
+	define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
101
+}
94 102
 /** Define the database name for the icons table. */
95
-if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
103
+if (!defined('GEODIR_ICON_TABLE')) {
104
+	define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
105
+}
96 106
 /** Define the database name for the attachments table. */
97
-if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
107
+if (!defined('GEODIR_ATTACHMENT_TABLE')) {
108
+	define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
109
+}
98 110
 /** Define the database name for the review table. */
99
-if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
111
+if (!defined('GEODIR_REVIEW_TABLE')) {
112
+	define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
113
+}
100 114
 /** Define the database name for the custom sort fields table. */
101
-if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
115
+if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) {
116
+	define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
117
+}
102 118
 
103 119
 
104 120
 if ($_SERVER['REQUEST_URI'] == '' || $_SERVER['REQUEST_URI'] == '/') {
@@ -113,7 +129,9 @@  discard block
 block discarded – undo
113 129
 /*
114 130
  * Localisation items.
115 131
  */
116
-if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
132
+if (!defined('GEODIRECTORY_TEXTDOMAIN')) {
133
+	define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
134
+}
117 135
 
118 136
 // Load geodirectory plugin textdomain.
119 137
 add_action( 'plugins_loaded', 'geodir_load_textdomain' );
Please login to merge, or discard this patch.
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -31,30 +31,30 @@  discard block
 block discarded – undo
31 31
  * CHECK FOR OLD COMPATIBILITY PACKS AND DISABLE IF THEY ARE ACTIVE
32 32
  */
33 33
 if (is_admin()) {
34
-    /**
35
-     * Include WordPress core file so we can use core functions to check for active plugins.
36
-     */
37
-    include_once(ABSPATH . 'wp-admin/includes/plugin.php');
34
+	/**
35
+	 * Include WordPress core file so we can use core functions to check for active plugins.
36
+	 */
37
+	include_once(ABSPATH . 'wp-admin/includes/plugin.php');
38 38
 
39
-    if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
40
-        deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
41
-    }
39
+	if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
40
+		deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
41
+	}
42 42
 
43
-    if (is_plugin_active('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php')) {
44
-        deactivate_plugins('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php');
45
-    }
43
+	if (is_plugin_active('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php')) {
44
+		deactivate_plugins('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php');
45
+	}
46 46
 
47
-    if (is_plugin_active('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php')) {
48
-        deactivate_plugins('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php');
49
-    }
47
+	if (is_plugin_active('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php')) {
48
+		deactivate_plugins('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php');
49
+	}
50 50
 
51
-    if (is_plugin_active('geodir_avada_compatibility/geodir_avada_compatibility.php')) {
52
-        deactivate_plugins('geodir_avada_compatibility/geodir_avada_compatibility.php');
53
-    }
51
+	if (is_plugin_active('geodir_avada_compatibility/geodir_avada_compatibility.php')) {
52
+		deactivate_plugins('geodir_avada_compatibility/geodir_avada_compatibility.php');
53
+	}
54 54
 
55
-    if (is_plugin_active('geodir_compat_pack_divi/geodir_divi_compatibility.php')) {
56
-        deactivate_plugins('geodir_compat_pack_divi/geodir_divi_compatibility.php');
57
-    }
55
+	if (is_plugin_active('geodir_compat_pack_divi/geodir_divi_compatibility.php')) {
56
+		deactivate_plugins('geodir_compat_pack_divi/geodir_divi_compatibility.php');
57
+	}
58 58
 
59 59
 }
60 60
 
@@ -122,19 +122,19 @@  discard block
 block discarded – undo
122 122
  * @package GeoDirectory
123 123
  */
124 124
 function geodir_error_log($log){
125
-    /*
125
+	/*
126 126
      * A filter to override the WP_DEBUG setting for function geodir_error_log().
127 127
      *
128 128
      * @since 1.5.7
129 129
      */
130
-    $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG);
131
-    if ( true === $should_log ) {
132
-        if ( is_array( $log ) || is_object( $log ) ) {
133
-            error_log( print_r( $log, true ) );
134
-        } else {
135
-            error_log( $log );
136
-        }
137
-    }
130
+	$should_log = apply_filters( 'geodir_log_errors', WP_DEBUG);
131
+	if ( true === $should_log ) {
132
+		if ( is_array( $log ) || is_object( $log ) ) {
133
+			error_log( print_r( $log, true ) );
134
+		} else {
135
+			error_log( $log );
136
+		}
137
+	}
138 138
 }
139 139
 /**
140 140
  * Include all plugin functions.
@@ -173,61 +173,61 @@  discard block
 block discarded – undo
173 173
  */
174 174
 if (is_admin() || defined( 'GD_TESTING_MODE' )) {
175 175
 
176
-    /**
177
-     * Include functions used in admin area only.
178
-     *
179
-     * @since 1.0.0
180
-     */
181
-    require_once('geodirectory-admin/admin_functions.php');
182
-    /**
183
-     * Most actions/hooks used in admin area only are called from here.
184
-     *
185
-     * @since 1.0.0
186
-     */
187
-    require_once('geodirectory-admin/admin_hooks_actions.php');
188
-    /**
189
-     * Most admin JS and CSS is called from here.
190
-     *
191
-     * @since 1.0.0
192
-     */
193
-    require_once('geodirectory-admin/admin_template_tags.php');
194
-    /**
195
-     * Include any functions needed for upgrades.
196
-     *
197
-     * @since 1.0.0
198
-     */
199
-    require_once(geodir_plugin_path() . '/upgrade.php');
200
-    if (get_option('geodir_installed') != 1) {
201
-        /**
202
-         * Define language constants, here as they are not loaded yet.
203
-         *
204
-         * @since 1.0.0
205
-         */
206
-        require_once(geodir_plugin_path() . '/language.php');
207
-        /**
208
-         * Include the plugin install file that sets up the databases and any options on first run.
209
-         *
210
-         * @since 1.0.0
211
-         */
212
-        require_once('geodirectory-admin/admin_install.php');
213
-        register_activation_hook(__FILE__, 'geodir_activation');
214
-    }
215
-    register_deactivation_hook(__FILE__, 'geodir_deactivation');
216
-    register_uninstall_hook(__FILE__, 'geodir_uninstall');
217
-
218
-    /*
176
+	/**
177
+	 * Include functions used in admin area only.
178
+	 *
179
+	 * @since 1.0.0
180
+	 */
181
+	require_once('geodirectory-admin/admin_functions.php');
182
+	/**
183
+	 * Most actions/hooks used in admin area only are called from here.
184
+	 *
185
+	 * @since 1.0.0
186
+	 */
187
+	require_once('geodirectory-admin/admin_hooks_actions.php');
188
+	/**
189
+	 * Most admin JS and CSS is called from here.
190
+	 *
191
+	 * @since 1.0.0
192
+	 */
193
+	require_once('geodirectory-admin/admin_template_tags.php');
194
+	/**
195
+	 * Include any functions needed for upgrades.
196
+	 *
197
+	 * @since 1.0.0
198
+	 */
199
+	require_once(geodir_plugin_path() . '/upgrade.php');
200
+	if (get_option('geodir_installed') != 1) {
201
+		/**
202
+		 * Define language constants, here as they are not loaded yet.
203
+		 *
204
+		 * @since 1.0.0
205
+		 */
206
+		require_once(geodir_plugin_path() . '/language.php');
207
+		/**
208
+		 * Include the plugin install file that sets up the databases and any options on first run.
209
+		 *
210
+		 * @since 1.0.0
211
+		 */
212
+		require_once('geodirectory-admin/admin_install.php');
213
+		register_activation_hook(__FILE__, 'geodir_activation');
214
+	}
215
+	register_deactivation_hook(__FILE__, 'geodir_deactivation');
216
+	register_uninstall_hook(__FILE__, 'geodir_uninstall');
217
+
218
+	/*
219 219
      * Show a upgrade warning message if applicable.
220 220
      *
221 221
      * @since 1.5.6
222 222
      */
223
-    global $pagenow;
223
+	global $pagenow;
224 224
    if ( 'plugins.php' === $pagenow )
225
-    {
226
-        // Better update message
227
-        $file   = basename( __FILE__ );
228
-        $folder = basename( dirname( __FILE__ ) );
229
-        $hook = "in_plugin_update_message-{$folder}/{$file}";
230
-        add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 );
231
-    }
225
+	{
226
+		// Better update message
227
+		$file   = basename( __FILE__ );
228
+		$folder = basename( dirname( __FILE__ ) );
229
+		$hook = "in_plugin_update_message-{$folder}/{$file}";
230
+		add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 );
231
+	}
232 232
 
233 233
 }
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     /**
35 35
      * Include WordPress core file so we can use core functions to check for active plugins.
36 36
      */
37
-    include_once(ABSPATH . 'wp-admin/includes/plugin.php');
37
+    include_once(ABSPATH.'wp-admin/includes/plugin.php');
38 38
 
39 39
     if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
40 40
         deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
  * @global string $plugin_file_name Base file name. 'geodirectory/geodirectory.php'.
69 69
  */
70 70
 global $wpdb, $plugin_prefix, $geodir_addon_list, $plugin_file_name;
71
-$plugin_prefix = $wpdb->prefix . 'geodir_';
72
-$plugin_file_name = basename(plugin_dir_path(__FILE__)) . '/' . basename(__FILE__);
71
+$plugin_prefix = $wpdb->prefix.'geodir_';
72
+$plugin_file_name = basename(plugin_dir_path(__FILE__)).'/'.basename(__FILE__);
73 73
 
74 74
 /*
75 75
  * This will store the cached post custom fields per package for each page load so not to run for each listing.
@@ -84,24 +84,24 @@  discard block
 block discarded – undo
84 84
 /**
85 85
  * Define constants
86 86
  */
87
-if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
87
+if (!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path(__FILE__));
88 88
 
89 89
 /*
90 90
  * Declare database table names. All since version 1.0.0
91 91
  */
92 92
 
93 93
 /** Define the database name for the countries table. */
94
-if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
94
+if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix.'countries');
95 95
 /** Define the database name for the custom fields table. */
96
-if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
96
+if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix.'custom_fields');
97 97
 /** Define the database name for the icons table. */
98
-if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
98
+if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix.'post_icon');
99 99
 /** Define the database name for the attachments table. */
100
-if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
100
+if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix.'attachments');
101 101
 /** Define the database name for the review table. */
102
-if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
102
+if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix.'post_review');
103 103
 /** Define the database name for the custom sort fields table. */
104
-if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
104
+if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix.'custom_sort_fields');
105 105
 
106 106
 
107 107
 /*
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
111 111
 
112 112
 // Load geodirectory plugin textdomain.
113
-add_action( 'init', 'geodir_load_textdomain' );
113
+add_action('init', 'geodir_load_textdomain');
114 114
 
115 115
 /*
116 116
  * A function to log GD errors no matter the type given.
@@ -121,18 +121,18 @@  discard block
 block discarded – undo
121 121
  * @param mixed $log The thing that should be logged.
122 122
  * @package GeoDirectory
123 123
  */
124
-function geodir_error_log($log){
124
+function geodir_error_log($log) {
125 125
     /*
126 126
      * A filter to override the WP_DEBUG setting for function geodir_error_log().
127 127
      *
128 128
      * @since 1.5.7
129 129
      */
130
-    $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG);
131
-    if ( true === $should_log ) {
132
-        if ( is_array( $log ) || is_object( $log ) ) {
133
-            error_log( print_r( $log, true ) );
130
+    $should_log = apply_filters('geodir_log_errors', WP_DEBUG);
131
+    if (true === $should_log) {
132
+        if (is_array($log) || is_object($log)) {
133
+            error_log(print_r($log, true));
134 134
         } else {
135
-            error_log( $log );
135
+            error_log($log);
136 136
         }
137 137
     }
138 138
 }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 /*
172 172
  * Admin init + activation hooks
173 173
  */
174
-if (is_admin() || defined( 'GD_TESTING_MODE' )) {
174
+if (is_admin() || defined('GD_TESTING_MODE')) {
175 175
 
176 176
     /**
177 177
      * Include functions used in admin area only.
@@ -196,14 +196,14 @@  discard block
 block discarded – undo
196 196
      *
197 197
      * @since 1.0.0
198 198
      */
199
-    require_once(geodir_plugin_path() . '/upgrade.php');
199
+    require_once(geodir_plugin_path().'/upgrade.php');
200 200
     if (get_option('geodir_installed') != 1) {
201 201
         /**
202 202
          * Define language constants, here as they are not loaded yet.
203 203
          *
204 204
          * @since 1.0.0
205 205
          */
206
-        require_once(geodir_plugin_path() . '/language.php');
206
+        require_once(geodir_plugin_path().'/language.php');
207 207
         /**
208 208
          * Include the plugin install file that sets up the databases and any options on first run.
209 209
          *
@@ -221,13 +221,13 @@  discard block
 block discarded – undo
221 221
      * @since 1.5.6
222 222
      */
223 223
     global $pagenow;
224
-   if ( 'plugins.php' === $pagenow )
224
+   if ('plugins.php' === $pagenow)
225 225
     {
226 226
         // Better update message
227
-        $file   = basename( __FILE__ );
228
-        $folder = basename( dirname( __FILE__ ) );
227
+        $file   = basename(__FILE__);
228
+        $folder = basename(dirname(__FILE__));
229 229
         $hook = "in_plugin_update_message-{$folder}/{$file}";
230
-        add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 );
230
+        add_action($hook, 'geodire_admin_upgrade_notice', 20, 2);
231 231
     }
232 232
 
233 233
 }
Please login to merge, or discard this patch.