Test Failed
Push — master ( a37e7d...1a7ae9 )
by Stiofan
09:20
created
geodirectory-templates/geodir-information.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,27 +12,27 @@
 block discarded – undo
12 12
         <div class="clearfix">
13 13
             <div id="geodir_content">
14 14
                 <?php
15
-                /** This action is documented in geodirectory-templates/geodir-home.php */
16
-                do_action('geodir_add_page_content', 'before', 'info-page');
17
-                global $information;
18
-                echo '<h5 class="geodir_information">';
19
-                echo $information;
20
-                echo '</h5>';
21
-                /** This action is documented in geodirectory-templates/geodir-home.php */
22
-                do_action('geodir_add_page_content', 'after', 'info-page');
23
-                ?>
15
+				/** This action is documented in geodirectory-templates/geodir-home.php */
16
+				do_action('geodir_add_page_content', 'before', 'info-page');
17
+				global $information;
18
+				echo '<h5 class="geodir_information">';
19
+				echo $information;
20
+				echo '</h5>';
21
+				/** This action is documented in geodirectory-templates/geodir-home.php */
22
+				do_action('geodir_add_page_content', 'after', 'info-page');
23
+				?>
24 24
             </div>
25 25
             <!-- geodir_content ends here-->
26 26
             <div id="gd-sidebar-wrapper">
27 27
                 <div class="geodir-sidebar-main">
28 28
                     <div class="geodir-gd-sidebar">
29 29
                         <?php
30
-                        /**
31
-                         * Calls the standard sidebar.
32
-                         *
33
-                         * @since 1.0.0
34
-                         */
35
-                        do_action('geodir_sidebar'); ?>
30
+						/**
31
+						 * Calls the standard sidebar.
32
+						 *
33
+						 * @since 1.0.0
34
+						 */
35
+						do_action('geodir_sidebar'); ?>
36 36
                     </div>
37 37
                 </div>
38 38
             </div>
Please login to merge, or discard this patch.
geodirectory_template_tags.php 3 patches
Braces   +37 added lines, -19 removed lines patch added patch discarded remove patch
@@ -245,13 +245,14 @@  discard block
 block discarded – undo
245 245
  */
246 246
 function geodir_add_async_forscript($url)
247 247
 {
248
-    if (strpos($url, '#asyncload')===false)
249
-        return $url;
250
-    else if (is_admin())
251
-        return str_replace('#asyncload', '', $url);
252
-    else
253
-        return str_replace('#asyncload', '', $url)."' async='async";
254
-}
248
+    if (strpos($url, '#asyncload')===false) {
249
+            return $url;
250
+    } else if (is_admin()) {
251
+            return str_replace('#asyncload', '', $url);
252
+    } else {
253
+            return str_replace('#asyncload', '', $url)."' async='async";
254
+    }
255
+    }
255 256
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
256 257
 
257 258
 /**
@@ -318,8 +319,10 @@  discard block
 block discarded – undo
318 319
 
319 320
     $half_pages_to_show = round($pages_to_show / 2);
320 321
 
321
-    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
322
-        return;
322
+    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) {
323
+    	// dont apply default  pagination for geodirectory home page.
324
+        return;
325
+    }
323 326
 
324 327
     if (!is_single()) {
325 328
         if (function_exists('geodir_location_geo_home_link')) {
@@ -439,11 +442,21 @@  discard block
 block discarded – undo
439 442
     }
440 443
     $dist_dif = 1000;
441 444
 
442
-    if ($dist <= 5000) $dist_dif = 500;
443
-    if ($dist <= 1000) $dist_dif = 100;
444
-    if ($dist <= 500) $dist_dif = 50;
445
-    if ($dist <= 100) $dist_dif = 10;
446
-    if ($dist <= 50) $dist_dif = 5;
445
+    if ($dist <= 5000) {
446
+    	$dist_dif = 500;
447
+    }
448
+    if ($dist <= 1000) {
449
+    	$dist_dif = 100;
450
+    }
451
+    if ($dist <= 500) {
452
+    	$dist_dif = 50;
453
+    }
454
+    if ($dist <= 100) {
455
+    	$dist_dif = 10;
456
+    }
457
+    if ($dist <= 50) {
458
+    	$dist_dif = 5;
459
+    }
447 460
 
448 461
     ?>
449 462
     <script type="text/javascript">
@@ -505,18 +518,23 @@  discard block
 block discarded – undo
505 518
 {
506 519
 
507 520
     $default_search_for_text = SEARCH_FOR_TEXT;
508
-    if (get_option('geodir_search_field_default_text'))
509
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
521
+    if (get_option('geodir_search_field_default_text')) {
522
+            $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
523
+    }
510 524
 
511 525
     $default_near_text = NEAR_TEXT;
512
-    if (get_option('geodir_near_field_default_text'))
513
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
526
+    if (get_option('geodir_near_field_default_text')) {
527
+            $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
528
+    }
514 529
 
515 530
     ?>
516 531
 
517 532
 
518 533
     <script type="text/javascript">
519
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
534
+        var default_location = '<?php if($search_location = geodir_get_default_location()) {
535
+	echo $search_location->city ;
536
+}
537
+?>';
520 538
         var latlng;
521 539
         var address;
522 540
         var dist = 0;
Please login to merge, or discard this patch.
Indentation   +328 added lines, -328 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function geodir_core_dequeue_script()
24 24
 {
25
-    wp_dequeue_script('flexslider');
25
+	wp_dequeue_script('flexslider');
26 26
 }
27 27
 
28 28
 add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100);
@@ -35,168 +35,168 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_templates_scripts()
37 37
 {
38
-    $is_detail_page = false;
39
-    $geodir_map_name = geodir_map_name();
40
-
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
-        $is_detail_page = true;
43
-    }
44
-
45
-    wp_enqueue_script('jquery');
46
-
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
-    wp_enqueue_script('geodirectory-script');
49
-
50
-    $geodir_vars_data = array(
51
-        'siteurl' => get_option('siteurl'),
52
-        'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
-        'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
-        'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
-    );
58
-
59
-    /**
60
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
-     *
62
-     * This is used by addons to add JS translatable variables.
63
-     *
64
-     * @since 1.4.4
65
-     * @param array $geodir_vars_data {
66
-     *    geodir var data used by addons to add JS translatable variables.
67
-     *
68
-     *    @type string $siteurl Site url.
69
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
-     *    @type int $is_rtl Checks if current locale is RTL.
73
-     *
74
-     * }
75
-     */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
-
78
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
-
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
-
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
-    wp_enqueue_script('geodirectory-lightbox-jquery');
85
-
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
-    if ($is_detail_page) {
88
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
89
-    }
90
-
91
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        $map_key = "&key=" . geodir_get_map_api_key();
94
-        /**
95
-         * Filter the variables that are added to the end of the google maps script call.
96
-         *
97
-         * This i used to change things like google maps language etc.
98
-         *
99
-         * @since 1.0.0
100
-         * @param string $var The string to filter, default is empty string.
101
-         */
102
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
-        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
104
-    }
38
+	$is_detail_page = false;
39
+	$geodir_map_name = geodir_map_name();
40
+
41
+	if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
+		$is_detail_page = true;
43
+	}
44
+
45
+	wp_enqueue_script('jquery');
46
+
47
+	wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
+	wp_enqueue_script('geodirectory-script');
49
+
50
+	$geodir_vars_data = array(
51
+		'siteurl' => get_option('siteurl'),
52
+		'geodir_plugin_url' => geodir_plugin_url(),
53
+		'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
+		'geodir_ajax_url' => geodir_get_ajax_url(),
55
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
+		'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
+	);
58
+
59
+	/**
60
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
+	 *
62
+	 * This is used by addons to add JS translatable variables.
63
+	 *
64
+	 * @since 1.4.4
65
+	 * @param array $geodir_vars_data {
66
+	 *    geodir var data used by addons to add JS translatable variables.
67
+	 *
68
+	 *    @type string $siteurl Site url.
69
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
+	 *    @type int $is_rtl Checks if current locale is RTL.
73
+	 *
74
+	 * }
75
+	 */
76
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
+
78
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
+
80
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
+
83
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
+	wp_enqueue_script('geodirectory-lightbox-jquery');
85
+
86
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
+	if ($is_detail_page) {
88
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
89
+	}
90
+
91
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
92
+		$map_lang = "&language=" . geodir_get_map_default_language();
93
+		$map_key = "&key=" . geodir_get_map_api_key();
94
+		/**
95
+		 * Filter the variables that are added to the end of the google maps script call.
96
+		 *
97
+		 * This i used to change things like google maps language etc.
98
+		 *
99
+		 * @since 1.0.0
100
+		 * @param string $var The string to filter, default is empty string.
101
+		 */
102
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
+		wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
104
+	}
105 105
     
106
-    if ($geodir_map_name == 'osm') {
107
-        // Leaflet OpenStreetMap
108
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109
-        wp_enqueue_style('geodirectory-leaflet-style');
106
+	if ($geodir_map_name == 'osm') {
107
+		// Leaflet OpenStreetMap
108
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109
+		wp_enqueue_style('geodirectory-leaflet-style');
110 110
             
111
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112
-        wp_enqueue_script('geodirectory-leaflet-script');
111
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112
+		wp_enqueue_script('geodirectory-leaflet-script');
113 113
         
114
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
114
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
116 116
         
117
-        if ($is_detail_page) {
118
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119
-            wp_enqueue_style('geodirectory-leaflet-routing-style');
117
+		if ($is_detail_page) {
118
+			wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119
+			wp_enqueue_style('geodirectory-leaflet-routing-style');
120 120
                 
121
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122
-            wp_enqueue_script('geodirectory-leaflet-routing-script');
123
-        }
124
-    }
125
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
121
+			wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122
+			wp_enqueue_script('geodirectory-leaflet-routing-script');
123
+		}
124
+	}
125
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
126 126
     
127
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
128
-    wp_enqueue_script('geodirectory-goMap-script');
129
-
130
-
131
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132
-    wp_enqueue_script('chosen');
133
-
134
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135
-    wp_enqueue_script('geodirectory-choose-ajax');
136
-
137
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138
-
139
-    if (is_page() && geodir_is_page('add-listing')) {
140
-        // SCRIPT FOR UPLOAD
141
-        wp_enqueue_script('plupload-all');
142
-        wp_enqueue_script('jquery-ui-sortable');
143
-
144
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
145
-        wp_enqueue_script('geodirectory-plupload-script');
146
-        // SCRIPT FOR UPLOAD END
147
-
148
-        // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
149
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
150
-            $ajax_url = admin_url('admin-ajax.php');
151
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
152
-            $ajax_url = admin_url('admin-ajax.php');
153
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
154
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
155
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
156
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
157
-        } else {
158
-            $ajax_url = admin_url('admin-ajax.php');
159
-        }
127
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
128
+	wp_enqueue_script('geodirectory-goMap-script');
129
+
130
+
131
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132
+	wp_enqueue_script('chosen');
133
+
134
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135
+	wp_enqueue_script('geodirectory-choose-ajax');
136
+
137
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138
+
139
+	if (is_page() && geodir_is_page('add-listing')) {
140
+		// SCRIPT FOR UPLOAD
141
+		wp_enqueue_script('plupload-all');
142
+		wp_enqueue_script('jquery-ui-sortable');
143
+
144
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
145
+		wp_enqueue_script('geodirectory-plupload-script');
146
+		// SCRIPT FOR UPLOAD END
147
+
148
+		// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
149
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
150
+			$ajax_url = admin_url('admin-ajax.php');
151
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
152
+			$ajax_url = admin_url('admin-ajax.php');
153
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
154
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
155
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
156
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
157
+		} else {
158
+			$ajax_url = admin_url('admin-ajax.php');
159
+		}
160 160
 
161
-        // place js config array for plupload
162
-        $plupload_init = array(
163
-            'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
164
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
165
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
166
-            'drop_element' => 'dropbox', // will be adjusted per uploader
167
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
168
-            'multiple_queues' => true,
169
-            'max_file_size' => geodir_max_upload_size(),
170
-            'url' => $ajax_url,
171
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
172
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
173
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
174
-            'multipart' => true,
175
-            'urlstream_upload' => true,
176
-            'multi_selection' => false, // will be added per uploader
177
-            // additional post data to send to our ajax hook
178
-            'multipart_params' => array(
179
-                '_ajax_nonce' => "", // will be added per uploader
180
-                'action' => 'plupload_action', // the ajax action name
181
-                'imgid' => 0 // will be added per uploader
182
-            )
183
-        );
184
-        $base_plupload_config = json_encode($plupload_init);
185
-
186
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
187
-            'upload_img_size' => geodir_max_upload_size());
188
-
189
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190
-
191
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
192
-    } // End if for add place page
193
-
194
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195
-    if ($is_detail_page) {
161
+		// place js config array for plupload
162
+		$plupload_init = array(
163
+			'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
164
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
165
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
166
+			'drop_element' => 'dropbox', // will be adjusted per uploader
167
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
168
+			'multiple_queues' => true,
169
+			'max_file_size' => geodir_max_upload_size(),
170
+			'url' => $ajax_url,
171
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
172
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
173
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
174
+			'multipart' => true,
175
+			'urlstream_upload' => true,
176
+			'multi_selection' => false, // will be added per uploader
177
+			// additional post data to send to our ajax hook
178
+			'multipart_params' => array(
179
+				'_ajax_nonce' => "", // will be added per uploader
180
+				'action' => 'plupload_action', // the ajax action name
181
+				'imgid' => 0 // will be added per uploader
182
+			)
183
+		);
184
+		$base_plupload_config = json_encode($plupload_init);
185
+
186
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
187
+			'upload_img_size' => geodir_max_upload_size());
188
+
189
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190
+
191
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
192
+	} // End if for add place page
193
+
194
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195
+	if ($is_detail_page) {
196 196
 		wp_enqueue_script('geodirectory-post-custom-js');
197 197
 	}
198 198
 
199
-    // font awesome rating script
199
+	// font awesome rating script
200 200
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
201 201
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
202 202
 		wp_enqueue_script('geodir-barrating-js');
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
 		wp_enqueue_script('geodir-jRating-js');
206 206
 	}
207 207
 
208
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209
-    wp_enqueue_script('geodir-on-document-load');
208
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209
+	wp_enqueue_script('geodir-on-document-load');
210 210
 
211
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212
-    wp_enqueue_script('google-geometa');
211
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212
+	wp_enqueue_script('google-geometa');
213 213
 }
214 214
 
215 215
 /**
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
  */
224 224
 function geodir_header_scripts()
225 225
 {
226
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
227
-    echo stripslashes(get_option('geodir_header_scripts'));
226
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
227
+	echo stripslashes(get_option('geodir_header_scripts'));
228 228
 }
229 229
 
230 230
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 function geodir_footer_scripts()
241 241
 {	
242 242
 	echo stripslashes(get_option('geodir_ga_tracking_code'));
243
-    echo stripslashes(get_option('geodir_footer_scripts'));
243
+	echo stripslashes(get_option('geodir_footer_scripts'));
244 244
 }
245 245
 
246 246
 
@@ -254,12 +254,12 @@  discard block
 block discarded – undo
254 254
  */
255 255
 function geodir_add_async_forscript($url)
256 256
 {
257
-    if (strpos($url, '#asyncload')===false)
258
-        return $url;
259
-    else if (is_admin())
260
-        return str_replace('#asyncload', '', $url);
261
-    else
262
-        return str_replace('#asyncload', '', $url)."' async='async";
257
+	if (strpos($url, '#asyncload')===false)
258
+		return $url;
259
+	else if (is_admin())
260
+		return str_replace('#asyncload', '', $url);
261
+	else
262
+		return str_replace('#asyncload', '', $url)."' async='async";
263 263
 }
264 264
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
265 265
 
@@ -272,17 +272,17 @@  discard block
 block discarded – undo
272 272
 function geodir_templates_styles()
273 273
 {
274 274
 
275
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
276
-    wp_enqueue_style('geodir-core-scss');
277
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
275
+	wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
276
+	wp_enqueue_style('geodir-core-scss');
277
+	wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
278 278
 
279
-    if(is_rtl()){
280
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
281
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
282
-    }
279
+	if(is_rtl()){
280
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
281
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
282
+	}
283 283
 
284
-    wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
285
-    wp_enqueue_style('font-awesome');
284
+	wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
285
+	wp_enqueue_style('font-awesome');
286 286
 
287 287
 
288 288
 }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
  */
297 297
 function geodir_get_sidebar()
298 298
 {
299
-    get_sidebar('geodirectory');
299
+	get_sidebar('geodirectory');
300 300
 }
301 301
 
302 302
 /**
@@ -315,122 +315,122 @@  discard block
 block discarded – undo
315 315
  * @param bool $always_show Do you want to show the pagination always? Default: false.
316 316
  */
317 317
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
318
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
318
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
319 319
 
320
-    if (empty($prelabel)) {
321
-        $prelabel = '<strong>&laquo;</strong>';
322
-    }
320
+	if (empty($prelabel)) {
321
+		$prelabel = '<strong>&laquo;</strong>';
322
+	}
323 323
 
324
-    if (empty($nxtlabel)) {
325
-        $nxtlabel = '<strong>&raquo;</strong>';
326
-    }
324
+	if (empty($nxtlabel)) {
325
+		$nxtlabel = '<strong>&raquo;</strong>';
326
+	}
327 327
 
328
-    $half_pages_to_show = round($pages_to_show / 2);
328
+	$half_pages_to_show = round($pages_to_show / 2);
329 329
 
330
-    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
331
-        return;
330
+	if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
331
+		return;
332 332
 
333
-    if (!is_single()) {
334
-        if (function_exists('geodir_location_geo_home_link')) {
335
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
336
-        }
337
-        $numposts = $wp_query->found_posts;
333
+	if (!is_single()) {
334
+		if (function_exists('geodir_location_geo_home_link')) {
335
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
336
+		}
337
+		$numposts = $wp_query->found_posts;
338 338
 
339
-        $max_page = ceil($numposts / $posts_per_page);
339
+		$max_page = ceil($numposts / $posts_per_page);
340 340
 
341
-        if (empty($paged)) {
342
-            $paged = 1;
343
-        }
341
+		if (empty($paged)) {
342
+			$paged = 1;
343
+		}
344 344
         
345
-        $post_type = geodir_get_current_posttype();
346
-        $listing_type_name = get_post_type_plural_label($post_type);
347
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
348
-            $term = array();
345
+		$post_type = geodir_get_current_posttype();
346
+		$listing_type_name = get_post_type_plural_label($post_type);
347
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
348
+			$term = array();
349 349
             
350
-            if (is_tax()) {
351
-                $term_id = get_queried_object_id();
352
-                $taxonomy = get_query_var('taxonomy');
350
+			if (is_tax()) {
351
+				$term_id = get_queried_object_id();
352
+				$taxonomy = get_query_var('taxonomy');
353 353
 
354
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
355
-                    $term = get_term($term_id, $post_type . 'category');
356
-                }
357
-            }
354
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
355
+					$term = get_term($term_id, $post_type . 'category');
356
+				}
357
+			}
358 358
             
359
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
360
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
359
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
360
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
361 361
                 
362
-                if (!is_array($taxonomy_search)) {
363
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
364
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
365
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
366
-                }
367
-            }
362
+				if (!is_array($taxonomy_search)) {
363
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
364
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
365
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
366
+				}
367
+			}
368 368
             
369
-            if (!empty($term) && !is_wp_error($term)) {
370
-                $listing_type_name = $term->name;
371
-            }
372
-        }
369
+			if (!empty($term) && !is_wp_error($term)) {
370
+				$listing_type_name = $term->name;
371
+			}
372
+		}
373 373
 
374
-        if ($max_page > 1 || $always_show) {            
375
-            // Extra pagination info
376
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
377
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
378
-            $end_no = min($paged * $posts_per_page, $numposts);
374
+		if ($max_page > 1 || $always_show) {            
375
+			// Extra pagination info
376
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
377
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
378
+			$end_no = min($paged * $posts_per_page, $numposts);
379 379
 
380
-            if ($geodir_pagination_more_info != '') {
381
-                if ($listing_type_name) {
382
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
383
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
384
-                } else {
385
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
386
-                }
387
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
388
-                /**
389
-                 * Adds an extra pagination info above/under pagination.
390
-                 *
391
-                 * @since 1.5.9
392
-                 *
393
-                 * @param string $pagination_info Extra pagination info content.
394
-                 * @param string $listing_type_name Listing results type.
395
-                 * @param string $start_no First result number.
396
-                 * @param string $end_no Last result number.
397
-                 * @param string $numposts Total number of listings.
398
-                 * @param string $post_type The post type.
399
-                 */
400
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
380
+			if ($geodir_pagination_more_info != '') {
381
+				if ($listing_type_name) {
382
+					$listing_type_name = __($listing_type_name, 'geodirectory');
383
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
384
+				} else {
385
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
386
+				}
387
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
388
+				/**
389
+				 * Adds an extra pagination info above/under pagination.
390
+				 *
391
+				 * @since 1.5.9
392
+				 *
393
+				 * @param string $pagination_info Extra pagination info content.
394
+				 * @param string $listing_type_name Listing results type.
395
+				 * @param string $start_no First result number.
396
+				 * @param string $end_no Last result number.
397
+				 * @param string $numposts Total number of listings.
398
+				 * @param string $post_type The post type.
399
+				 */
400
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
401 401
                 
402
-                if ($geodir_pagination_more_info == 'before') {
403
-                    $before = $before . $pagination_info;
404
-                } else if ($geodir_pagination_more_info == 'after') {
405
-                    $after = $pagination_info . $after;
406
-                }
407
-            }
402
+				if ($geodir_pagination_more_info == 'before') {
403
+					$before = $before . $pagination_info;
404
+				} else if ($geodir_pagination_more_info == 'after') {
405
+					$after = $pagination_info . $after;
406
+				}
407
+			}
408 408
             
409
-            echo "$before <div class='Navi gd-navi'>";
410
-            if ($paged >= ($pages_to_show - 1)) {
411
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
412
-            }
413
-            previous_posts_link($prelabel);
414
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
415
-                if ($i >= 1 && $i <= $max_page) {
416
-                    if ($i == $paged) {
417
-                        echo "<strong class='on'>$i</strong>";
418
-                    } else {
419
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
420
-                    }
421
-                }
422
-            }
423
-            next_posts_link($nxtlabel, $max_page);
424
-            if (($paged + $half_pages_to_show) < ($max_page)) {
425
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
426
-            }
427
-            echo "</div> $after";
428
-        }
409
+			echo "$before <div class='Navi gd-navi'>";
410
+			if ($paged >= ($pages_to_show - 1)) {
411
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
412
+			}
413
+			previous_posts_link($prelabel);
414
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
415
+				if ($i >= 1 && $i <= $max_page) {
416
+					if ($i == $paged) {
417
+						echo "<strong class='on'>$i</strong>";
418
+					} else {
419
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
420
+					}
421
+				}
422
+			}
423
+			next_posts_link($nxtlabel, $max_page);
424
+			if (($paged + $half_pages_to_show) < ($max_page)) {
425
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
426
+			}
427
+			echo "</div> $after";
428
+		}
429 429
         
430
-        if (function_exists('geodir_location_geo_home_link')) {
431
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
432
-        }
433
-    }
430
+		if (function_exists('geodir_location_geo_home_link')) {
431
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
432
+		}
433
+	}
434 434
 }
435 435
 
436 436
 /**
@@ -441,20 +441,20 @@  discard block
 block discarded – undo
441 441
  */
442 442
 function geodir_listingsearch_scripts()
443 443
 {
444
-    if (get_option('gd_search_dist') != '') {
445
-        $dist = get_option('gd_search_dist');
446
-    } else {
447
-        $dist = 500;
448
-    }
449
-    $dist_dif = 1000;
450
-
451
-    if ($dist <= 5000) $dist_dif = 500;
452
-    if ($dist <= 1000) $dist_dif = 100;
453
-    if ($dist <= 500) $dist_dif = 50;
454
-    if ($dist <= 100) $dist_dif = 10;
455
-    if ($dist <= 50) $dist_dif = 5;
456
-
457
-    ?>
444
+	if (get_option('gd_search_dist') != '') {
445
+		$dist = get_option('gd_search_dist');
446
+	} else {
447
+		$dist = 500;
448
+	}
449
+	$dist_dif = 1000;
450
+
451
+	if ($dist <= 5000) $dist_dif = 500;
452
+	if ($dist <= 1000) $dist_dif = 100;
453
+	if ($dist <= 500) $dist_dif = 50;
454
+	if ($dist <= 100) $dist_dif = 10;
455
+	if ($dist <= 50) $dist_dif = 5;
456
+
457
+	?>
458 458
     <script type="text/javascript">
459 459
 
460 460
         jQuery(function ($) {
@@ -513,15 +513,15 @@  discard block
 block discarded – undo
513 513
 function geodir_add_sharelocation_scripts()
514 514
 {
515 515
 
516
-    $default_search_for_text = SEARCH_FOR_TEXT;
517
-    if (get_option('geodir_search_field_default_text'))
518
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
516
+	$default_search_for_text = SEARCH_FOR_TEXT;
517
+	if (get_option('geodir_search_field_default_text'))
518
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
519 519
 
520
-    $default_near_text = NEAR_TEXT;
521
-    if (get_option('geodir_near_field_default_text'))
522
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
520
+	$default_near_text = NEAR_TEXT;
521
+	if (get_option('geodir_near_field_default_text'))
522
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
523 523
 
524
-    ?>
524
+	?>
525 525
 
526 526
 
527 527
     <script type="text/javascript">
@@ -602,14 +602,14 @@  discard block
 block discarded – undo
602 602
                     initialise2();
603 603
                 } else {
604 604
                     <?php
605
-                    $near_add = get_option('geodir_search_near_addition');
606
-                    /**
607
-                     * Adds any extra info to the near search box query when trying to geolocate it via google api.
608
-                     *
609
-                     * @since 1.0.0
610
-                     */
611
-                    $near_add2 = apply_filters('geodir_search_near_addition', '');
612
-                    ?>
605
+					$near_add = get_option('geodir_search_near_addition');
606
+					/**
607
+					 * Adds any extra info to the near search box query when trying to geolocate it via google api.
608
+					 *
609
+					 * @since 1.0.0
610
+					 */
611
+					$near_add2 = apply_filters('geodir_search_near_addition', '');
612
+					?>
613 613
                     if (window.gdMaps === 'google') {
614 614
                         Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
615 615
                             function (results, status) {
@@ -712,30 +712,30 @@  discard block
 block discarded – undo
712 712
  */
713 713
 function geodir_show_badges_on_image($which, $post, $link)
714 714
 {
715
-    $return = '';
716
-    switch ($which) {
717
-        case 'featured':
718
-            /**
719
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
720
-             *
721
-             * @since 1.0.0
722
-             * @param object $post The post object.
723
-             * @param string $link The link to the post.
724
-             */
725
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
726
-            break;
727
-        case 'new' :
728
-            /**
729
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
730
-             *
731
-             * @since 1.0.0
732
-             * @param object $post The post object.
733
-             * @param string $link The link to the post.
734
-             */
735
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
736
-            break;
737
-
738
-    }
715
+	$return = '';
716
+	switch ($which) {
717
+		case 'featured':
718
+			/**
719
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
720
+			 *
721
+			 * @since 1.0.0
722
+			 * @param object $post The post object.
723
+			 * @param string $link The link to the post.
724
+			 */
725
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
726
+			break;
727
+		case 'new' :
728
+			/**
729
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
730
+			 *
731
+			 * @since 1.0.0
732
+			 * @param object $post The post object.
733
+			 * @param string $link The link to the post.
734
+			 */
735
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
736
+			break;
737
+
738
+	}
739 739
     
740
-    return $return;
740
+	return $return;
741 741
 }
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
     $is_detail_page = false;
39 39
     $geodir_map_name = geodir_map_name();
40 40
 
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
41
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
42 42
         $is_detail_page = true;
43 43
     }
44 44
 
45 45
     wp_enqueue_script('jquery');
46 46
 
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
47
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48 48
     wp_enqueue_script('geodirectory-script');
49 49
 
50 50
     $geodir_vars_data = array(
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
53
+        'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
54 54
         'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
56 56
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57 57
     );
58 58
 
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * }
75 75
      */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
77 77
 
78 78
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79 79
 
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
80
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
81
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
82 82
 
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
84 84
     wp_enqueue_script('geodirectory-lightbox-jquery');
85 85
 
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
87 87
     if ($is_detail_page) {
88 88
         wp_enqueue_script('geodirectory-jquery-simplemodal');
89 89
     }
90 90
 
91 91
     if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        $map_key = "&key=" . geodir_get_map_api_key();
92
+        $map_lang = "&language=".geodir_get_map_default_language();
93
+        $map_key = "&key=".geodir_get_map_api_key();
94 94
         /**
95 95
          * Filter the variables that are added to the end of the google maps script call.
96 96
          *
@@ -100,48 +100,48 @@  discard block
 block discarded – undo
100 100
          * @param string $var The string to filter, default is empty string.
101 101
          */
102 102
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
-        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
103
+        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
104 104
     }
105 105
     
106 106
     if ($geodir_map_name == 'osm') {
107 107
         // Leaflet OpenStreetMap
108
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
108
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109 109
         wp_enqueue_style('geodirectory-leaflet-style');
110 110
             
111
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
111
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112 112
         wp_enqueue_script('geodirectory-leaflet-script');
113 113
         
114
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
114
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115 115
         wp_enqueue_script('geodirectory-leaflet-geo-script');
116 116
         
117 117
         if ($is_detail_page) {
118
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
118
+            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119 119
             wp_enqueue_style('geodirectory-leaflet-routing-style');
120 120
                 
121
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
121
+            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122 122
             wp_enqueue_script('geodirectory-leaflet-routing-script');
123 123
         }
124 124
     }
125
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
125
+    wp_enqueue_script('jquery-ui-autocomplete');
126 126
     
127
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
127
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
128 128
     wp_enqueue_script('geodirectory-goMap-script');
129 129
 
130 130
 
131
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
131
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132 132
     wp_enqueue_script('chosen');
133 133
 
134
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
134
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135 135
     wp_enqueue_script('geodirectory-choose-ajax');
136 136
 
137
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
137
+    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138 138
 
139 139
     if (is_page() && geodir_is_page('add-listing')) {
140 140
         // SCRIPT FOR UPLOAD
141 141
         wp_enqueue_script('plupload-all');
142 142
         wp_enqueue_script('jquery-ui-sortable');
143 143
 
144
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
144
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
145 145
         wp_enqueue_script('geodirectory-plupload-script');
146 146
         // SCRIPT FOR UPLOAD END
147 147
 
@@ -188,27 +188,27 @@  discard block
 block discarded – undo
188 188
 
189 189
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190 190
 
191
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
191
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
192 192
     } // End if for add place page
193 193
 
194
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
194
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195 195
     if ($is_detail_page) {
196 196
 		wp_enqueue_script('geodirectory-post-custom-js');
197 197
 	}
198 198
 
199 199
     // font awesome rating script
200 200
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
201
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
201
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
202 202
 		wp_enqueue_script('geodir-barrating-js');
203 203
 	} else { // default rating script
204
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
204
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
205 205
 		wp_enqueue_script('geodir-jRating-js');
206 206
 	}
207 207
 
208
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
208
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209 209
     wp_enqueue_script('geodir-on-document-load');
210 210
 
211
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
211
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212 212
     wp_enqueue_script('google-geometa');
213 213
 }
214 214
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
  */
224 224
 function geodir_header_scripts()
225 225
 {
226
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
226
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
227 227
     echo stripslashes(get_option('geodir_header_scripts'));
228 228
 }
229 229
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
  */
255 255
 function geodir_add_async_forscript($url)
256 256
 {
257
-    if (strpos($url, '#asyncload')===false)
257
+    if (strpos($url, '#asyncload') === false)
258 258
         return $url;
259 259
     else if (is_admin())
260 260
         return str_replace('#asyncload', '', $url);
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
 function geodir_templates_styles()
273 273
 {
274 274
 
275
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
275
+    wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
276 276
     wp_enqueue_style('geodir-core-scss');
277
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
277
+    wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
278 278
 
279
-    if(is_rtl()){
280
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
279
+    if (is_rtl()) {
280
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
281 281
     wp_enqueue_style('geodirectory-frontend-rtl-style');
282 282
     }
283 283
 
@@ -351,18 +351,18 @@  discard block
 block discarded – undo
351 351
                 $term_id = get_queried_object_id();
352 352
                 $taxonomy = get_query_var('taxonomy');
353 353
 
354
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
355
-                    $term = get_term($term_id, $post_type . 'category');
354
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
355
+                    $term = get_term($term_id, $post_type.'category');
356 356
                 }
357 357
             }
358 358
             
359
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
360
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
359
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
360
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
361 361
                 
362 362
                 if (!is_array($taxonomy_search)) {
363
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
364
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
365
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
363
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
364
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
365
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
366 366
                 }
367 367
             }
368 368
             
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
         if ($max_page > 1 || $always_show) {            
375 375
             // Extra pagination info
376 376
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
377
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
377
+            $start_no = ($paged - 1) * $posts_per_page + 1;
378 378
             $end_no = min($paged * $posts_per_page, $numposts);
379 379
 
380 380
             if ($geodir_pagination_more_info != '') {
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
                 } else {
385 385
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
386 386
                 }
387
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
387
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
388 388
                 /**
389 389
                  * Adds an extra pagination info above/under pagination.
390 390
                  *
@@ -400,15 +400,15 @@  discard block
 block discarded – undo
400 400
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
401 401
                 
402 402
                 if ($geodir_pagination_more_info == 'before') {
403
-                    $before = $before . $pagination_info;
403
+                    $before = $before.$pagination_info;
404 404
                 } else if ($geodir_pagination_more_info == 'after') {
405
-                    $after = $pagination_info . $after;
405
+                    $after = $pagination_info.$after;
406 406
                 }
407 407
             }
408 408
             
409 409
             echo "$before <div class='Navi gd-navi'>";
410 410
             if ($paged >= ($pages_to_show - 1)) {
411
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
411
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
412 412
             }
413 413
             previous_posts_link($prelabel);
414 414
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -416,13 +416,13 @@  discard block
 block discarded – undo
416 416
                     if ($i == $paged) {
417 417
                         echo "<strong class='on'>$i</strong>";
418 418
                     } else {
419
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
419
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
420 420
                     }
421 421
                 }
422 422
             }
423 423
             next_posts_link($nxtlabel, $max_page);
424 424
             if (($paged + $half_pages_to_show) < ($max_page)) {
425
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
425
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
426 426
             }
427 427
             echo "</div> $after";
428 428
         }
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
         jQuery(function ($) {
461 461
             $("#distance_slider").slider({
462 462
                 range: true,
463
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
463
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
464 464
                 min: 0,
465 465
                 max: <?php echo $dist; ?>,
466 466
                 step: <?php echo $dist_dif; ?>,
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 
526 526
 
527 527
     <script type="text/javascript">
528
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
528
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
529 529
         var latlng;
530 530
         var address;
531 531
         var dist = 0;
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 				var $form = jQuery(this).closest('form');
539 539
 				
540 540
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
541
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
541
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
542 542
 				
543 543
 				// Disable location based search for disabled location post type.
544 544
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 					}
553 553
 				}
554 554
 				
555
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
555
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
556 556
 					geodir_setsearch($form);
557 557
 				} else {
558 558
 					jQuery(".snear", $form).val('');
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
         });
572 572
         
573 573
 		function geodir_setsearch($form) {
574
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
574
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
575 575
 			geocodeAddress($form);
576 576
 		}
577 577
 
@@ -590,15 +590,15 @@  discard block
 block discarded – undo
590 590
             // Call the geocode function
591 591
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
592 592
 
593
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
594
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
593
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
594
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
595 595
                     jQuery(".snear", $form).val('');
596 596
                 }
597 597
                 jQuery($form).submit();
598 598
             } else {
599 599
                 var address = jQuery(".snear", $form).val();
600 600
 
601
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
601
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
602 602
                     initialise2();
603 603
                 } else {
604 604
                     <?php
@@ -611,12 +611,12 @@  discard block
 block discarded – undo
611 611
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
612 612
                     ?>
613 613
                     if (window.gdMaps === 'google') {
614
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
614
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
615 615
                             function (results, status) {
616 616
                                 if (status == google.maps.GeocoderStatus.OK) {
617 617
                                     updateSearchPosition(results[0].geometry.location, $form);
618 618
                                 } else {
619
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory');?>" + status);
619
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
620 620
                                 }
621 621
                             });
622 622
                     } else if (window.gdMaps === 'osm') {
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
626 626
                                     updateSearchPosition(geo, $form);
627 627
                                 } else {
628
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
628
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
629 629
                                 }
630 630
                             });
631 631
                     } else {
@@ -671,19 +671,19 @@  discard block
 block discarded – undo
671 671
             var msg;
672 672
             switch (err.code) {
673 673
                 case err.UNKNOWN_ERROR:
674
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
674
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
675 675
                     break;
676 676
                 case err.PERMISSION_DENINED:
677
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
677
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
678 678
                     break;
679 679
                 case err.POSITION_UNAVAILABLE:
680
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
680
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
681 681
                     break;
682 682
                 case err.BREAK:
683
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
683
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
684 684
                     break;
685 685
                 default:
686
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
686
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
687 687
             }
688 688
             jQuery('#info').html(msg);
689 689
         }
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
              * @param object $post The post object.
723 723
              * @param string $link The link to the post.
724 724
              */
725
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
725
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
726 726
             break;
727 727
         case 'new' :
728 728
             /**
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
              * @param object $post The post object.
733 733
              * @param string $link The link to the post.
734 734
              */
735
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
735
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
736 736
             break;
737 737
 
738 738
     }
Please login to merge, or discard this patch.
language.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 define('LISTING_DETAILS_TEXT', __('Enter Listing Details', 'geodirectory'));
42 42
 
43 43
 define('PLACE_TITLE_TEXT', __('Listing Title', 'geodirectory')); // depreciated @since 1.6.3
44
-define('PLACE_DESC_TEXT', __('Listing Description', 'geodirectory'));// depreciated @since 1.6.3
44
+define('PLACE_DESC_TEXT', __('Listing Description', 'geodirectory')); // depreciated @since 1.6.3
45 45
 
46 46
 define('LISTING_ADDRESS_TEXT', __('Listing Address:', 'geodirectory'));
47 47
 define('PLACE_ADDRESS', __('Address:', 'geodirectory'));
Please login to merge, or discard this patch.
geodirectory_shortcodes.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
 	// Add marker cluster
203 203
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
204 204
         $map_args['enable_marker_cluster'] = true;
205
-        if(get_option('geodir_marker_cluster_type')) {
205
+        if (get_option('geodir_marker_cluster_type')) {
206 206
             if ($map_args['autozoom']) {
207 207
                 $map_args['enable_marker_cluster_no_reposition'] = false;
208 208
             } else {
209 209
                 $map_args['enable_marker_cluster_no_reposition'] = true;
210 210
             }
211 211
 
212
-            $map_args['enable_marker_cluster_server'] = true ;
212
+            $map_args['enable_marker_cluster_server'] = true;
213 213
 
214 214
         }
215 215
 	} else {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	}
218 218
 
219 219
     // if lat and long set in shortcode, hack it so the map is not repositioned
220
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
220
+    if (!empty($params['latitude']) && !empty($params['longitude'])) {
221 221
         $map_args['enable_marker_cluster_no_reposition'] = true;
222 222
     }
223 223
 
@@ -890,20 +890,20 @@  discard block
 block discarded – undo
890 890
 	
891 891
 	$show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : '';
892 892
 	
893
-	if ($show_adv_search != '' ) {
894
-		$show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' ';
893
+	if ($show_adv_search != '') {
894
+		$show_adv_class = 'geodir-advance-search-'.$show_adv_search.' ';
895 895
 		if ($show_adv_search == 'searched' && geodir_is_page('search')) {
896 896
 			$show_adv_search = 'search';
897 897
 		}
898
-		$show_adv_attrs = 'data-show-adv="' . $show_adv_search . '"';
898
+		$show_adv_attrs = 'data-show-adv="'.$show_adv_search.'"';
899 899
 		
900
-		$params['before_widget'] = str_replace('class="', $show_adv_attrs . ' class="' . $show_adv_class, $params['before_widget']);
900
+		$params['before_widget'] = str_replace('class="', $show_adv_attrs.' class="'.$show_adv_class, $params['before_widget']);
901 901
 	}
902 902
 	
903 903
 	ob_start();
904 904
 	
905 905
 	//geodir_get_template_part('listing', 'filter-form');
906
-	the_widget('geodir_advance_search_widget', $params, $params );
906
+	the_widget('geodir_advance_search_widget', $params, $params);
907 907
 	
908 908
 	$output = ob_get_contents();
909 909
     ob_end_clean();
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 
1104 1104
     // Validate character_count
1105 1105
     //todo: is this necessary?
1106
-    $params['character_count']  = $params['character_count'];
1106
+    $params['character_count'] = $params['character_count'];
1107 1107
 
1108 1108
     // Validate our layout choice
1109 1109
     // Outside of the norm, I added some more simple terms to match the existing
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
 
1116 1116
     // Validate Listing width, used in the template widget-listing-listview.php
1117 1117
     // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1118
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1118
+    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
1119 1119
 
1120 1120
     // Validate the checkboxes used on the widget
1121 1121
     $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
     if (!empty($params['tags'])) {
1132 1132
         if (!is_array($params['tags'])) {
1133 1133
             $comma = _x(',', 'tag delimiter');
1134
-            if ( ',' !== $comma ) {
1134
+            if (',' !== $comma) {
1135 1135
                 $params['tags'] = str_replace($comma, ',', $params['tags']);
1136 1136
             }
1137 1137
             $params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
@@ -1153,13 +1153,13 @@  discard block
 block discarded – undo
1153 1153
         unset($atts['pageno']);
1154 1154
     }
1155 1155
 
1156
-    if ( !empty($atts['shortcode_content']) ) {
1156
+    if (!empty($atts['shortcode_content'])) {
1157 1157
         $content = $atts['shortcode_content'];
1158 1158
     }
1159 1159
     $params['shortcode_content'] = trim($content);
1160 1160
     $atts['shortcode_content'] = trim($content);
1161 1161
     
1162
-    $params['shortcode_atts']       = $atts;
1162
+    $params['shortcode_atts'] = $atts;
1163 1163
 
1164 1164
     $output = geodir_sc_gd_listings_output($params);
1165 1165
 
@@ -1226,8 +1226,8 @@  discard block
 block discarded – undo
1226 1226
 	// Validate the checkboxes used on the widget
1227 1227
     $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1228 1228
     $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1229
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1230
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1229
+    $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']);
1230
+    $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']);
1231 1231
 	
1232 1232
 	if ($params['max_count'] != 'all') {
1233 1233
 		$params['max_count'] = absint($params['max_count']);
Please login to merge, or discard this patch.
Indentation   +710 added lines, -710 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 // If this file is called directly, abort.
9 9
 if (!defined('WPINC')) {
10
-    die;
10
+	die;
11 11
 }
12 12
 require_once('geodirectory-functions/shortcode_functions.php');
13 13
 
@@ -32,43 +32,43 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function geodir_sc_add_listing($atts)
34 34
 {
35
-    ob_start();
36
-    $defaults = array(
37
-        'pid' => '',
38
-        'listing_type' => 'gd_place',
39
-        'login_msg' => __('You must login to post.', 'geodirectory'),
40
-        'show_login' => false,
41
-    );
42
-    $params = shortcode_atts($defaults, $atts);
43
-
44
-    foreach ($params as $key => $value) {
45
-        $_REQUEST[$key] = $value;
46
-    }
47
-
48
-    $user_id = get_current_user_id();
49
-    if (!$user_id) {
50
-        echo $params['login_msg'];
51
-        if ($params['show_login']) {
52
-            echo "<br />";
53
-            $defaults = array(
54
-                'before_widget' => '',
55
-                'after_widget' => '',
56
-                'before_title' => '',
57
-                'after_title' => '',
58
-            );
59
-
60
-            geodir_loginwidget_output($defaults, $defaults);
61
-        }
62
-
63
-
64
-    } else {
65
-       // Add listing page will be used if shortcode is detected in page content, no need to call it here
66
-    }
67
-    $output = ob_get_contents();
68
-
69
-    ob_end_clean();
70
-
71
-    return $output;
35
+	ob_start();
36
+	$defaults = array(
37
+		'pid' => '',
38
+		'listing_type' => 'gd_place',
39
+		'login_msg' => __('You must login to post.', 'geodirectory'),
40
+		'show_login' => false,
41
+	);
42
+	$params = shortcode_atts($defaults, $atts);
43
+
44
+	foreach ($params as $key => $value) {
45
+		$_REQUEST[$key] = $value;
46
+	}
47
+
48
+	$user_id = get_current_user_id();
49
+	if (!$user_id) {
50
+		echo $params['login_msg'];
51
+		if ($params['show_login']) {
52
+			echo "<br />";
53
+			$defaults = array(
54
+				'before_widget' => '',
55
+				'after_widget' => '',
56
+				'before_title' => '',
57
+				'after_title' => '',
58
+			);
59
+
60
+			geodir_loginwidget_output($defaults, $defaults);
61
+		}
62
+
63
+
64
+	} else {
65
+	   // Add listing page will be used if shortcode is detected in page content, no need to call it here
66
+	}
67
+	$output = ob_get_contents();
68
+
69
+	ob_end_clean();
70
+
71
+	return $output;
72 72
 }
73 73
 
74 74
 /**
@@ -96,136 +96,136 @@  discard block
 block discarded – undo
96 96
  */
97 97
 function geodir_sc_home_map($atts)
98 98
 {
99
-    ob_start();
100
-    $defaults = array(
101
-        'width' => '960',
102
-        'height' => '425',
103
-        'maptype' => 'ROADMAP',
104
-        'zoom' => '13',
105
-        'autozoom' => '',
106
-        'child_collapse' => '0',
107
-        'scrollwheel' => '0',
99
+	ob_start();
100
+	$defaults = array(
101
+		'width' => '960',
102
+		'height' => '425',
103
+		'maptype' => 'ROADMAP',
104
+		'zoom' => '13',
105
+		'autozoom' => '',
106
+		'child_collapse' => '0',
107
+		'scrollwheel' => '0',
108 108
 		'marker_cluster' => false,
109
-        'latitude' => '',
110
-        'longitude' => ''
111
-    );
112
-
113
-    $params = shortcode_atts($defaults, $atts);
114
-
115
-    $params = gdsc_validate_map_args($params);
116
-
117
-    $map_args = array(
118
-        'map_canvas_name' => 'gd_home_map',
119
-        'latitude' => $params['latitude'],
120
-        'longitude' => $params['longitude'],
121
-
122
-        /**
123
-         * Filter the widget width of the map on home/listings page.
124
-         *
125
-         * @since 1.0.0
126
-         * @param mixed(string|int|float) $params['width'] The map width.
127
-         */
128
-        'width' => apply_filters('widget_width', $params['width']),
129
-        /**
130
-         * Filter the widget height of the map on home/listings page.
131
-         *
132
-         * @since 1.0.0
133
-         * @param mixed(string|int|float) $params['height'] The map height.
134
-         */
135
-        'height' => apply_filters('widget_heigh', $params['height']),
136
-        /**
137
-         * Filter the widget maptype of the map on home/listings page.
138
-         *
139
-         * @since 1.0.0
109
+		'latitude' => '',
110
+		'longitude' => ''
111
+	);
112
+
113
+	$params = shortcode_atts($defaults, $atts);
114
+
115
+	$params = gdsc_validate_map_args($params);
116
+
117
+	$map_args = array(
118
+		'map_canvas_name' => 'gd_home_map',
119
+		'latitude' => $params['latitude'],
120
+		'longitude' => $params['longitude'],
121
+
122
+		/**
123
+		 * Filter the widget width of the map on home/listings page.
124
+		 *
125
+		 * @since 1.0.0
126
+		 * @param mixed(string|int|float) $params['width'] The map width.
127
+		 */
128
+		'width' => apply_filters('widget_width', $params['width']),
129
+		/**
130
+		 * Filter the widget height of the map on home/listings page.
131
+		 *
132
+		 * @since 1.0.0
133
+		 * @param mixed(string|int|float) $params['height'] The map height.
134
+		 */
135
+		'height' => apply_filters('widget_heigh', $params['height']),
136
+		/**
137
+		 * Filter the widget maptype of the map on home/listings page.
138
+		 *
139
+		 * @since 1.0.0
140 140
 		 * @since 1.5.2 Added TERRAIN map type.
141
-         * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
142
-         */
143
-        'maptype' => apply_filters('widget_maptype', $params['maptype']),
144
-        /**
145
-         * Filter the widget scrollwheel value of the map on home/listings page.
146
-         *
147
-         * Should the scrollwheel zoom the map or not.
148
-         *
149
-         * @since 1.0.0
150
-         * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
151
-         */
152
-        'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
153
-        /**
154
-         * Filter the widget zoom level of the map on home/listings page.
155
-         *
156
-         * @since 1.0.0
157
-         * @param int $params['zoom'] The zoom level of the map. Between 1-19.
158
-         */
159
-        'zoom' => apply_filters('widget_zoom', $params['zoom']),
160
-        /**
161
-         * Filter the widget auto zoom value of the map on home/listings page.
162
-         *
163
-         * If the map should autozoom to fit the markers shown.
164
-         *
165
-         * @since 1.0.0
166
-         * @param bool $params['autozoom'] True if the map should autozoom, false if not.
167
-         */
168
-        'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
169
-        /**
170
-         * Filter the widget child_collapse value of the map on home/listings page.
171
-         *
172
-         * If the map should auto collapse the child categories if the category bar is present.
173
-         *
174
-         * @since 1.0.0
175
-         * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
176
-         */
177
-        'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
178
-        'enable_cat_filters' => true,
179
-        'enable_text_search' => true,
180
-        'enable_post_type_filters' => true,
181
-        /**
182
-         * Filter the widget enable_location_filters value of the map on home/listings page.
183
-         *
184
-         * This is used when the location addon is used.
185
-         *
186
-         * @since 1.0.0
187
-         * @param bool $val True if location filters should be used, false if not.
188
-         */
189
-        'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
190
-        'enable_jason_on_load' => false,
191
-        'enable_marker_cluster' => false,
192
-        'enable_map_resize_button' => true,
193
-        'map_class_name' => 'geodir-map-home-page',
194
-        'is_geodir_home_map_widget' => true,
195
-    );
141
+		 * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
142
+		 */
143
+		'maptype' => apply_filters('widget_maptype', $params['maptype']),
144
+		/**
145
+		 * Filter the widget scrollwheel value of the map on home/listings page.
146
+		 *
147
+		 * Should the scrollwheel zoom the map or not.
148
+		 *
149
+		 * @since 1.0.0
150
+		 * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
151
+		 */
152
+		'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
153
+		/**
154
+		 * Filter the widget zoom level of the map on home/listings page.
155
+		 *
156
+		 * @since 1.0.0
157
+		 * @param int $params['zoom'] The zoom level of the map. Between 1-19.
158
+		 */
159
+		'zoom' => apply_filters('widget_zoom', $params['zoom']),
160
+		/**
161
+		 * Filter the widget auto zoom value of the map on home/listings page.
162
+		 *
163
+		 * If the map should autozoom to fit the markers shown.
164
+		 *
165
+		 * @since 1.0.0
166
+		 * @param bool $params['autozoom'] True if the map should autozoom, false if not.
167
+		 */
168
+		'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
169
+		/**
170
+		 * Filter the widget child_collapse value of the map on home/listings page.
171
+		 *
172
+		 * If the map should auto collapse the child categories if the category bar is present.
173
+		 *
174
+		 * @since 1.0.0
175
+		 * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
176
+		 */
177
+		'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
178
+		'enable_cat_filters' => true,
179
+		'enable_text_search' => true,
180
+		'enable_post_type_filters' => true,
181
+		/**
182
+		 * Filter the widget enable_location_filters value of the map on home/listings page.
183
+		 *
184
+		 * This is used when the location addon is used.
185
+		 *
186
+		 * @since 1.0.0
187
+		 * @param bool $val True if location filters should be used, false if not.
188
+		 */
189
+		'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
190
+		'enable_jason_on_load' => false,
191
+		'enable_marker_cluster' => false,
192
+		'enable_map_resize_button' => true,
193
+		'map_class_name' => 'geodir-map-home-page',
194
+		'is_geodir_home_map_widget' => true,
195
+	);
196 196
 
197 197
 	// Add marker cluster
198 198
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
199
-        $map_args['enable_marker_cluster'] = true;
200
-        if(get_option('geodir_marker_cluster_type')) {
201
-            if ($map_args['autozoom']) {
202
-                $map_args['enable_marker_cluster_no_reposition'] = false;
203
-            } else {
204
-                $map_args['enable_marker_cluster_no_reposition'] = true;
205
-            }
199
+		$map_args['enable_marker_cluster'] = true;
200
+		if(get_option('geodir_marker_cluster_type')) {
201
+			if ($map_args['autozoom']) {
202
+				$map_args['enable_marker_cluster_no_reposition'] = false;
203
+			} else {
204
+				$map_args['enable_marker_cluster_no_reposition'] = true;
205
+			}
206 206
 
207
-            $map_args['enable_marker_cluster_server'] = true ;
207
+			$map_args['enable_marker_cluster_server'] = true ;
208 208
 
209
-        }
209
+		}
210 210
 	} else {
211 211
 		$map_args['enable_marker_cluster'] = false;
212 212
 	}
213 213
 
214
-    // if lat and long set in shortcode, hack it so the map is not repositioned
215
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
216
-        $map_args['enable_marker_cluster_no_reposition'] = true;
217
-    }
214
+	// if lat and long set in shortcode, hack it so the map is not repositioned
215
+	if(!empty($params['latitude']) && !empty($params['longitude']) ){
216
+		$map_args['enable_marker_cluster_no_reposition'] = true;
217
+	}
218 218
 
219 219
 
220
-    geodir_draw_map($map_args);
220
+	geodir_draw_map($map_args);
221 221
 
222
-    add_action('wp_footer', 'geodir_home_map_add_script', 100);
222
+	add_action('wp_footer', 'geodir_home_map_add_script', 100);
223 223
 
224
-    $output = ob_get_contents();
224
+	$output = ob_get_contents();
225 225
 
226
-    ob_end_clean();
226
+	ob_end_clean();
227 227
 
228
-    return $output;
228
+	return $output;
229 229
 }
230 230
 add_shortcode('gd_homepage_map', 'geodir_sc_home_map');
231 231
 
@@ -259,77 +259,77 @@  discard block
 block discarded – undo
259 259
  */
260 260
 function geodir_sc_listing_map($atts)
261 261
 {
262
-    ob_start();
263
-    add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
264
-
265
-    add_action('the_post', 'create_list_jsondata'); // Add marker in json array
266
-
267
-    add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
268
-
269
-    $defaults = array(
270
-        'width' => '294',
271
-        'height' => '370',
272
-        'zoom' => '13',
273
-        'autozoom' => '',
274
-        'sticky' => '',
275
-        'showall' => '0',
276
-        'scrollwheel' => '0',
277
-        'maptype' => 'ROADMAP',
278
-        'child_collapse' => 0,
262
+	ob_start();
263
+	add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
264
+
265
+	add_action('the_post', 'create_list_jsondata'); // Add marker in json array
266
+
267
+	add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
268
+
269
+	$defaults = array(
270
+		'width' => '294',
271
+		'height' => '370',
272
+		'zoom' => '13',
273
+		'autozoom' => '',
274
+		'sticky' => '',
275
+		'showall' => '0',
276
+		'scrollwheel' => '0',
277
+		'maptype' => 'ROADMAP',
278
+		'child_collapse' => 0,
279 279
 		'marker_cluster' => false
280
-    );
281
-
282
-    $params = shortcode_atts($defaults, $atts);
283
-
284
-    $params = gdsc_validate_map_args($params);
285
-
286
-    $map_args = array(
287
-        'map_canvas_name' => 'gd_listing_map',
288
-        'width' => $params['width'],
289
-        'height' => $params['height'],
290
-        'zoom' => $params['zoom'],
291
-        'autozoom' => $params['autozoom'],
292
-        'sticky' => $params['sticky'],
293
-        'showall' => $params['showall'],
294
-        'scrollwheel' => $params['scrollwheel'],
295
-        'child_collapse' => 0,
296
-        'enable_cat_filters' => false,
297
-        'enable_text_search' => false,
298
-        'enable_post_type_filters' => false,
299
-        'enable_location_filters' => false,
300
-        'enable_jason_on_load' => true,
301
-    );
302
-
303
-    if (is_single()) {
304
-
305
-        global $post;
306
-        $map_default_lat = $address_latitude = $post->post_latitude;
307
-        $map_default_lng = $address_longitude = $post->post_longitude;
308
-        $mapview = $post->post_mapview;
309
-        $map_args['zoom'] = $post->post_mapzoom;
310
-        $map_args['map_class_name'] = 'geodir-map-listing-page-single';
311
-
312
-    } else {
313
-        $default_location = geodir_get_default_location();
314
-
315
-        $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
316
-        $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
317
-        $map_args['map_class_name'] = 'geodir-map-listing-page';
318
-    }
319
-
320
-    if (empty($mapview)) {
321
-        $mapview = 'ROADMAP';
322
-    }
323
-
324
-    // Set default map options
325
-    $map_args['ajax_url'] = geodir_get_ajax_url();
326
-    $map_args['latitude'] = $map_default_lat;
327
-    $map_args['longitude'] = $map_default_lng;
328
-    $map_args['streetViewControl'] = true;
329
-    $map_args['maptype'] = $mapview;
330
-    $map_args['showPreview'] = '0';
331
-    $map_args['maxZoom'] = 21;
332
-    $map_args['bubble_size'] = 'small';
280
+	);
281
+
282
+	$params = shortcode_atts($defaults, $atts);
283
+
284
+	$params = gdsc_validate_map_args($params);
285
+
286
+	$map_args = array(
287
+		'map_canvas_name' => 'gd_listing_map',
288
+		'width' => $params['width'],
289
+		'height' => $params['height'],
290
+		'zoom' => $params['zoom'],
291
+		'autozoom' => $params['autozoom'],
292
+		'sticky' => $params['sticky'],
293
+		'showall' => $params['showall'],
294
+		'scrollwheel' => $params['scrollwheel'],
295
+		'child_collapse' => 0,
296
+		'enable_cat_filters' => false,
297
+		'enable_text_search' => false,
298
+		'enable_post_type_filters' => false,
299
+		'enable_location_filters' => false,
300
+		'enable_jason_on_load' => true,
301
+	);
302
+
303
+	if (is_single()) {
304
+
305
+		global $post;
306
+		$map_default_lat = $address_latitude = $post->post_latitude;
307
+		$map_default_lng = $address_longitude = $post->post_longitude;
308
+		$mapview = $post->post_mapview;
309
+		$map_args['zoom'] = $post->post_mapzoom;
310
+		$map_args['map_class_name'] = 'geodir-map-listing-page-single';
311
+
312
+	} else {
313
+		$default_location = geodir_get_default_location();
314
+
315
+		$map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
316
+		$map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
317
+		$map_args['map_class_name'] = 'geodir-map-listing-page';
318
+	}
319
+
320
+	if (empty($mapview)) {
321
+		$mapview = 'ROADMAP';
322
+	}
323
+
324
+	// Set default map options
325
+	$map_args['ajax_url'] = geodir_get_ajax_url();
326
+	$map_args['latitude'] = $map_default_lat;
327
+	$map_args['longitude'] = $map_default_lng;
328
+	$map_args['streetViewControl'] = true;
329
+	$map_args['maptype'] = $mapview;
330
+	$map_args['showPreview'] = '0';
331
+	$map_args['maxZoom'] = 21;
332
+	$map_args['bubble_size'] = 'small';
333 333
 	
334 334
 	// Add marker cluster
335 335
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
@@ -338,13 +338,13 @@  discard block
 block discarded – undo
338 338
 		$map_args['enable_marker_cluster'] = false;
339 339
 	}
340 340
 
341
-    geodir_draw_map($map_args);
341
+	geodir_draw_map($map_args);
342 342
 
343
-    $output = ob_get_contents();
343
+	$output = ob_get_contents();
344 344
 
345
-    ob_end_clean();
345
+	ob_end_clean();
346 346
 
347
-    return $output;
347
+	return $output;
348 348
 }
349 349
 
350 350
 add_shortcode('gd_listing_slider', 'geodir_sc_listing_slider');
@@ -377,120 +377,120 @@  discard block
 block discarded – undo
377 377
  */
378 378
 function geodir_sc_listing_slider($atts)
379 379
 {
380
-    ob_start();
381
-    $defaults = array(
382
-        'post_type' => 'gd_place',
383
-        'category' => '0',
384
-        'post_number' => '5',
385
-        'slideshow' => '0',
386
-        'animation_loop' => 0,
387
-        'direction_nav' => 0,
388
-        'slideshow_speed' => 5000,
389
-        'animation_speed' => 600,
390
-        'animation' => 'slide',
391
-        'order_by' => 'latest',
392
-        'show_title' => '',
393
-        'show_featured_only' => '',
394
-        'title' => '',
395
-    );
396
-
397
-    $params = shortcode_atts($defaults, $atts);
398
-
399
-
400
-    /*
380
+	ob_start();
381
+	$defaults = array(
382
+		'post_type' => 'gd_place',
383
+		'category' => '0',
384
+		'post_number' => '5',
385
+		'slideshow' => '0',
386
+		'animation_loop' => 0,
387
+		'direction_nav' => 0,
388
+		'slideshow_speed' => 5000,
389
+		'animation_speed' => 600,
390
+		'animation' => 'slide',
391
+		'order_by' => 'latest',
392
+		'show_title' => '',
393
+		'show_featured_only' => '',
394
+		'title' => '',
395
+	);
396
+
397
+	$params = shortcode_atts($defaults, $atts);
398
+
399
+
400
+	/*
401 401
      *
402 402
      * Now we begin the validation of the attributes.
403 403
      */
404
-    // Check we have a valid post_type
405
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
406
-        $params['post_type'] = 'gd_place';
407
-    }
408
-
409
-    // Check we have a valid sort_order
410
-    $params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
411
-
412
-    // Match the chosen animation to our options
413
-    $animation_list = array('slide', 'fade');
414
-    if (!(in_array($params['animation'], $animation_list))) {
415
-        $params['animation'] = 'slide';
416
-    }
417
-
418
-    // Post_number needs to be a positive integer
419
-    $params['post_number'] = absint($params['post_number']);
420
-    if (0 == $params['post_number']) {
421
-        $params['post_number'] = 1;
422
-    }
423
-
424
-    // Manage the entered categories
425
-    if (0 != $params['category'] || '' != $params['category']) {
426
-        $params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
427
-    }
428
-    // Convert show_title to a bool
429
-    $params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
430
-
431
-    // Convert show_featured_only to a bool
432
-    $params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
433
-
434
-    /*
404
+	// Check we have a valid post_type
405
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
406
+		$params['post_type'] = 'gd_place';
407
+	}
408
+
409
+	// Check we have a valid sort_order
410
+	$params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
411
+
412
+	// Match the chosen animation to our options
413
+	$animation_list = array('slide', 'fade');
414
+	if (!(in_array($params['animation'], $animation_list))) {
415
+		$params['animation'] = 'slide';
416
+	}
417
+
418
+	// Post_number needs to be a positive integer
419
+	$params['post_number'] = absint($params['post_number']);
420
+	if (0 == $params['post_number']) {
421
+		$params['post_number'] = 1;
422
+	}
423
+
424
+	// Manage the entered categories
425
+	if (0 != $params['category'] || '' != $params['category']) {
426
+		$params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
427
+	}
428
+	// Convert show_title to a bool
429
+	$params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
430
+
431
+	// Convert show_featured_only to a bool
432
+	$params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
433
+
434
+	/*
435 435
      * Hopefully all attributes are now valid, and safe to pass forward
436 436
      */
437 437
 
438
-    // redeclare vars after validation
439
-
440
-    if (isset($params['direction_nav'])) {
441
-        $params['directionNav'] = $params['direction_nav'];
442
-    }
443
-    if (isset($params['animation_loop'])) {
444
-        $params['animationLoop'] = $params['animation_loop'];
445
-    }
446
-    if (isset($params['slideshow_speed'])) {
447
-        $params['slideshowSpeed'] = $params['slideshow_speed'];
448
-    }
449
-    if (isset($params['animation_speed'])) {
450
-        $params['animationSpeed'] = $params['animation_speed'];
451
-    }
452
-    if (isset($params['order_by'])) {
453
-        $params['list_sort'] = $params['order_by'];
454
-    }
455
-
456
-    $query_args = array(
457
-        'post_number' => $params['post_number'],
458
-        'is_geodir_loop' => true,
459
-        'post_type' => $params['post_type'],
460
-        'order_by' => $params['order_by']
461
-    );
462
-
463
-    if (1 == $params['show_featured_only']) {
464
-        $query_args['show_featured_only'] = 1;
465
-    }
466
-
467
-    if (0 != $params['category'] && '' != $params['category']) {
468
-        $category_taxonomy = geodir_get_taxonomies($params['post_type']);
469
-        $tax_query = array(
470
-            'taxonomy' => $category_taxonomy[0],
471
-            'field' => 'id',
472
-            'terms' => $params['category'],
473
-        );
474
-
475
-        $query_args['tax_query'] = array($tax_query);
476
-    }
477
-
478
-    $defaults = array(
479
-        'before_widget' => '',
480
-        'after_widget' => '',
481
-        'before_title' => '',
482
-        'after_title' => '',
483
-    );
484
-
485
-    $query_args = array_merge($query_args, $params);
486
-
487
-    geodir_listing_slider_widget_output($defaults, $query_args);
488
-
489
-    $output = ob_get_contents();
490
-
491
-    ob_end_clean();
492
-
493
-    return $output;
438
+	// redeclare vars after validation
439
+
440
+	if (isset($params['direction_nav'])) {
441
+		$params['directionNav'] = $params['direction_nav'];
442
+	}
443
+	if (isset($params['animation_loop'])) {
444
+		$params['animationLoop'] = $params['animation_loop'];
445
+	}
446
+	if (isset($params['slideshow_speed'])) {
447
+		$params['slideshowSpeed'] = $params['slideshow_speed'];
448
+	}
449
+	if (isset($params['animation_speed'])) {
450
+		$params['animationSpeed'] = $params['animation_speed'];
451
+	}
452
+	if (isset($params['order_by'])) {
453
+		$params['list_sort'] = $params['order_by'];
454
+	}
455
+
456
+	$query_args = array(
457
+		'post_number' => $params['post_number'],
458
+		'is_geodir_loop' => true,
459
+		'post_type' => $params['post_type'],
460
+		'order_by' => $params['order_by']
461
+	);
462
+
463
+	if (1 == $params['show_featured_only']) {
464
+		$query_args['show_featured_only'] = 1;
465
+	}
466
+
467
+	if (0 != $params['category'] && '' != $params['category']) {
468
+		$category_taxonomy = geodir_get_taxonomies($params['post_type']);
469
+		$tax_query = array(
470
+			'taxonomy' => $category_taxonomy[0],
471
+			'field' => 'id',
472
+			'terms' => $params['category'],
473
+		);
474
+
475
+		$query_args['tax_query'] = array($tax_query);
476
+	}
477
+
478
+	$defaults = array(
479
+		'before_widget' => '',
480
+		'after_widget' => '',
481
+		'before_title' => '',
482
+		'after_title' => '',
483
+	);
484
+
485
+	$query_args = array_merge($query_args, $params);
486
+
487
+	geodir_listing_slider_widget_output($defaults, $query_args);
488
+
489
+	$output = ob_get_contents();
490
+
491
+	ob_end_clean();
492
+
493
+	return $output;
494 494
 }
495 495
 
496 496
 add_shortcode('gd_login_box', 'geodir_sc_login_box');
@@ -514,22 +514,22 @@  discard block
 block discarded – undo
514 514
  */
515 515
 function geodir_sc_login_box($atts)
516 516
 {
517
-    ob_start();
517
+	ob_start();
518 518
 
519
-    $defaults = array(
520
-        'before_widget' => '',
521
-        'after_widget' => '',
522
-        'before_title' => '',
523
-        'after_title' => '',
524
-    );
519
+	$defaults = array(
520
+		'before_widget' => '',
521
+		'after_widget' => '',
522
+		'before_title' => '',
523
+		'after_title' => '',
524
+	);
525 525
 
526
-    geodir_loginwidget_output($defaults, $defaults);
526
+	geodir_loginwidget_output($defaults, $defaults);
527 527
 
528
-    $output = ob_get_contents();
528
+	$output = ob_get_contents();
529 529
 
530
-    ob_end_clean();
530
+	ob_end_clean();
531 531
 
532
-    return $output;
532
+	return $output;
533 533
 }
534 534
 
535 535
 add_shortcode('gd_popular_post_category', 'geodir_sc_popular_post_category');
@@ -560,30 +560,30 @@  discard block
 block discarded – undo
560 560
  */
561 561
 function geodir_sc_popular_post_category($atts)
562 562
 {
563
-    ob_start();
564
-    global $geodir_post_category_str;
565
-    $defaults = array(
566
-        'category_limit' => 15,
567
-        'before_widget' => '',
568
-        'after_widget' => '',
569
-        'before_title' => '',
570
-        'after_title' => '',
571
-        'title' => '',
572
-        'default_post_type' => '',
573
-        'parent_only' => false,
574
-    );
575
-
576
-    $params = shortcode_atts($defaults, $atts, 'popular_post_category');
577
-    $params['category_limit'] = absint($params['category_limit']);
578
-    $params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : '';
579
-    $params['parent_only'] = gdsc_to_bool_val($params['parent_only']);
580
-    geodir_popular_post_category_output($params, $params);
581
-
582
-    $output = ob_get_contents();
583
-
584
-    ob_end_clean();
585
-
586
-    return $output;
563
+	ob_start();
564
+	global $geodir_post_category_str;
565
+	$defaults = array(
566
+		'category_limit' => 15,
567
+		'before_widget' => '',
568
+		'after_widget' => '',
569
+		'before_title' => '',
570
+		'after_title' => '',
571
+		'title' => '',
572
+		'default_post_type' => '',
573
+		'parent_only' => false,
574
+	);
575
+
576
+	$params = shortcode_atts($defaults, $atts, 'popular_post_category');
577
+	$params['category_limit'] = absint($params['category_limit']);
578
+	$params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : '';
579
+	$params['parent_only'] = gdsc_to_bool_val($params['parent_only']);
580
+	geodir_popular_post_category_output($params, $params);
581
+
582
+	$output = ob_get_contents();
583
+
584
+	ob_end_clean();
585
+
586
+	return $output;
587 587
 }
588 588
 
589 589
 add_shortcode('gd_popular_post_view', 'geodir_sc_popular_post_view');
@@ -623,97 +623,97 @@  discard block
 block discarded – undo
623 623
  */
624 624
 function geodir_sc_popular_post_view($atts)
625 625
 {
626
-    ob_start();
627
-    $defaults = array(
628
-        'post_type' => 'gd_place',
629
-        'category' => '0',
630
-        'post_number' => '5',
631
-        'layout' => 'gridview_onehalf',
632
-        'add_location_filter' => '0',
633
-        'list_sort' => 'latest',
634
-        'use_viewing_post_type' => '1',
635
-        'character_count' => '20',
636
-        'listing_width' => '',
637
-        'show_featured_only' => '0',
638
-        'show_special_only' => '0',
639
-        'with_pics_only' => '0',
640
-        'with_videos_only' => '0',
641
-        'before_widget' => '',
642
-        'after_widget' => '',
643
-        'before_title' => '<h3 class="widget-title">',
644
-        'after_title' => '</h3>',
645
-        'title' => '',
646
-        'category_title' => '',
647
-    );
648
-
649
-    $params = shortcode_atts($defaults, $atts);
650
-
651
-    /**
652
-     * Validate our incoming params
653
-     */
626
+	ob_start();
627
+	$defaults = array(
628
+		'post_type' => 'gd_place',
629
+		'category' => '0',
630
+		'post_number' => '5',
631
+		'layout' => 'gridview_onehalf',
632
+		'add_location_filter' => '0',
633
+		'list_sort' => 'latest',
634
+		'use_viewing_post_type' => '1',
635
+		'character_count' => '20',
636
+		'listing_width' => '',
637
+		'show_featured_only' => '0',
638
+		'show_special_only' => '0',
639
+		'with_pics_only' => '0',
640
+		'with_videos_only' => '0',
641
+		'before_widget' => '',
642
+		'after_widget' => '',
643
+		'before_title' => '<h3 class="widget-title">',
644
+		'after_title' => '</h3>',
645
+		'title' => '',
646
+		'category_title' => '',
647
+	);
654 648
 
655
-    // Validate the selected post type, default to gd_place on fail
656
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
657
-        $params['post_type'] = 'gd_place';
658
-    }
659
-
660
-    // Validate the selected category/ies - Grab the current list based on post_type
661
-    $category_taxonomy = geodir_get_taxonomies($params['post_type']);
662
-    $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
663
-
664
-    // Make sure we have an array
665
-    if (!(is_array($params['category']))) {
666
-        $params['category'] = explode(',', $params['category']);
667
-    }
668
-
669
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
670
-    // Otherwise it becomes empty and later on that will mean "All"
671
-    $params['category'] = array_intersect($params['category'], $categories);
672
-
673
-    // Post_number needs to be a positive integer
674
-    $params['post_number'] = absint($params['post_number']);
675
-    if (0 == $params['post_number']) {
676
-        $params['post_number'] = 1;
677
-    }
678
-
679
-    // Validate our layout choice
680
-    // Outside of the norm, I added some more simple terms to match the existing
681
-    // So now I just run the switch to set it properly.
682
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
683
-
684
-    // Validate our sorting choice
685
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
686
-
687
-    // Validate character_count
688
-    $params['character_count'] = absint($params['character_count']);
689
-    if (20 > $params['character_count']) {
690
-        $params['character_count'] = 20;
691
-    }
692
-
693
-    // Validate Listing width, used in the template widget-listing-listview.php
694
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
695
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
696
-
697
-    // Validate the checkboxes used on the widget
698
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
699
-    $params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
700
-    $params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
701
-    $params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
702
-    $params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
703
-    $params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
704
-
705
-    /**
706
-     * End of validation
707
-     */
649
+	$params = shortcode_atts($defaults, $atts);
650
+
651
+	/**
652
+	 * Validate our incoming params
653
+	 */
654
+
655
+	// Validate the selected post type, default to gd_place on fail
656
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
657
+		$params['post_type'] = 'gd_place';
658
+	}
659
+
660
+	// Validate the selected category/ies - Grab the current list based on post_type
661
+	$category_taxonomy = geodir_get_taxonomies($params['post_type']);
662
+	$categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
708 663
 
709
-    geodir_popular_postview_output($params, $params);
664
+	// Make sure we have an array
665
+	if (!(is_array($params['category']))) {
666
+		$params['category'] = explode(',', $params['category']);
667
+	}
668
+
669
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
670
+	// Otherwise it becomes empty and later on that will mean "All"
671
+	$params['category'] = array_intersect($params['category'], $categories);
672
+
673
+	// Post_number needs to be a positive integer
674
+	$params['post_number'] = absint($params['post_number']);
675
+	if (0 == $params['post_number']) {
676
+		$params['post_number'] = 1;
677
+	}
710 678
 
679
+	// Validate our layout choice
680
+	// Outside of the norm, I added some more simple terms to match the existing
681
+	// So now I just run the switch to set it properly.
682
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
711 683
 
712
-    $output = ob_get_contents();
684
+	// Validate our sorting choice
685
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
713 686
 
714
-    ob_end_clean();
687
+	// Validate character_count
688
+	$params['character_count'] = absint($params['character_count']);
689
+	if (20 > $params['character_count']) {
690
+		$params['character_count'] = 20;
691
+	}
715 692
 
716
-    return $output;
693
+	// Validate Listing width, used in the template widget-listing-listview.php
694
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
695
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
696
+
697
+	// Validate the checkboxes used on the widget
698
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
699
+	$params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
700
+	$params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
701
+	$params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
702
+	$params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
703
+	$params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
704
+
705
+	/**
706
+	 * End of validation
707
+	 */
708
+
709
+	geodir_popular_postview_output($params, $params);
710
+
711
+
712
+	$output = ob_get_contents();
713
+
714
+	ob_end_clean();
715
+
716
+	return $output;
717 717
 }
718 718
 
719 719
 add_shortcode('gd_recent_reviews', 'geodir_sc_recent_reviews');
@@ -735,37 +735,37 @@  discard block
 block discarded – undo
735 735
  * @return string Recent reviews HTML.
736 736
  */
737 737
 function geodir_sc_recent_reviews($atts) {
738
-    ob_start();
739
-    $defaults = array(
738
+	ob_start();
739
+	$defaults = array(
740 740
 		'title' => '',
741 741
 		'count' => 5,
742
-    );
742
+	);
743 743
 
744
-    $params = shortcode_atts($defaults, $atts);
744
+	$params = shortcode_atts($defaults, $atts);
745 745
 
746
-    $count = absint($params['count']);
747
-    if (0 == $count) {
748
-        $count = 1;
749
-    }
746
+	$count = absint($params['count']);
747
+	if (0 == $count) {
748
+		$count = 1;
749
+	}
750 750
 	
751 751
 	$title = !empty($params['title']) ? __($params['title'], 'geodirectory') : '';
752 752
 
753
-    $comments_li = geodir_get_recent_reviews(30, $count, 100, false);
753
+	$comments_li = geodir_get_recent_reviews(30, $count, 100, false);
754 754
 
755
-    if ($comments_li) {
756
-        if ($title != '') { ?>
755
+	if ($comments_li) {
756
+		if ($title != '') { ?>
757 757
 		<h3 class="geodir-sc-recent-reviews-title widget-title"><?php echo $title; ?></h3>
758 758
 		<?php } ?>
759 759
         <div class="geodir_sc_recent_reviews_section">
760 760
             <ul class="geodir_sc_recent_reviews"><?php echo $comments_li; ?></ul>
761 761
         </div>
762 762
     <?php
763
-    }
764
-    $output = ob_get_contents();
763
+	}
764
+	$output = ob_get_contents();
765 765
 
766
-    ob_end_clean();
766
+	ob_end_clean();
767 767
 
768
-    return $output;
768
+	return $output;
769 769
 }
770 770
 
771 771
 add_shortcode('gd_related_listings', 'geodir_sc_related_listings');
@@ -795,64 +795,64 @@  discard block
 block discarded – undo
795 795
  */
796 796
 function geodir_sc_related_listings($atts)
797 797
 {
798
-    ob_start();
799
-    $defaults = array(
800
-        'post_number' => 5,
801
-        'relate_to' => 'category',
802
-        'layout' => 'gridview_onehalf',
803
-        'add_location_filter' => 0,
804
-        'listing_width' => '',
805
-        'list_sort' => 'latest',
806
-        'character_count' => 20,
807
-        'is_widget' => 1,
808
-        'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
809
-    );
810
-    // The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
811
-
812
-    $params = shortcode_atts($defaults, $atts);
813
-
814
-    /**
815
-     * Begin validating parameters
816
-     */
798
+	ob_start();
799
+	$defaults = array(
800
+		'post_number' => 5,
801
+		'relate_to' => 'category',
802
+		'layout' => 'gridview_onehalf',
803
+		'add_location_filter' => 0,
804
+		'listing_width' => '',
805
+		'list_sort' => 'latest',
806
+		'character_count' => 20,
807
+		'is_widget' => 1,
808
+		'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
809
+	);
810
+	// The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
811
+
812
+	$params = shortcode_atts($defaults, $atts);
813
+
814
+	/**
815
+	 * Begin validating parameters
816
+	 */
817 817
 
818
-    // Validate that post_number is a number and is 1 or higher
819
-    $params['post_number'] = absint($params['post_number']);
820
-    if (0 === $params['post_number']) {
821
-        $params['post_number'] = 1;
822
-    }
818
+	// Validate that post_number is a number and is 1 or higher
819
+	$params['post_number'] = absint($params['post_number']);
820
+	if (0 === $params['post_number']) {
821
+		$params['post_number'] = 1;
822
+	}
823 823
 
824
-    // Validate relate_to - only category or tags
825
-    $params['relate_to'] = geodir_strtolower($params['relate_to']);
826
-    if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
827
-        $params['relate_to'] = 'category';
828
-    }
824
+	// Validate relate_to - only category or tags
825
+	$params['relate_to'] = geodir_strtolower($params['relate_to']);
826
+	if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
827
+		$params['relate_to'] = 'category';
828
+	}
829 829
 
830
-    // Validate layout selection
831
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
830
+	// Validate layout selection
831
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
832 832
 
833
-    // Validate sorting option
834
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
833
+	// Validate sorting option
834
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
835 835
 
836
-    // Validate add_location_filter
837
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
836
+	// Validate add_location_filter
837
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
838 838
 
839
-    // Validate listing_width
840
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
839
+	// Validate listing_width
840
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
841 841
 
842
-    // Validate character_count
843
-    $params['character_count'] = absint($params['character_count']);
844
-    if (20 > $params['character_count']) {
845
-        $params['character_count'] = 20;
846
-    }
842
+	// Validate character_count
843
+	$params['character_count'] = absint($params['character_count']);
844
+	if (20 > $params['character_count']) {
845
+		$params['character_count'] = 20;
846
+	}
847 847
 
848
-    if ($related_display = geodir_related_posts_display($params)) {
849
-        echo $related_display;
850
-    }
851
-    $output = ob_get_contents();
848
+	if ($related_display = geodir_related_posts_display($params)) {
849
+		echo $related_display;
850
+	}
851
+	$output = ob_get_contents();
852 852
 
853
-    ob_end_clean();
853
+	ob_end_clean();
854 854
 
855
-    return $output;
855
+	return $output;
856 856
 }
857 857
 
858 858
 /**
@@ -876,12 +876,12 @@  discard block
 block discarded – undo
876 876
  * @return string Advanced search widget HTML.
877 877
  */
878 878
 function geodir_sc_advanced_search($atts) {
879
-    $defaults = array(
879
+	$defaults = array(
880 880
 		'title' => '',
881 881
 		'before_widget' => '<section id="geodir_advanced_search-1" class="widget geodir-widget geodir_advance_search_widget">',
882
-        'after_widget' => '</section>',
883
-        'before_title' => '<h3 class="widget-title">',
884
-        'after_title' => '</h3>',
882
+		'after_widget' => '</section>',
883
+		'before_title' => '<h3 class="widget-title">',
884
+		'after_title' => '</h3>',
885 885
 		'show_adv_search' => 'default'
886 886
 	);
887 887
 	
@@ -905,9 +905,9 @@  discard block
 block discarded – undo
905 905
 	the_widget('geodir_advance_search_widget', $params, $params );
906 906
 	
907 907
 	$output = ob_get_contents();
908
-    ob_end_clean();
908
+	ob_end_clean();
909 909
 
910
-    return $output;
910
+	return $output;
911 911
 }
912 912
 add_shortcode('gd_advanced_search', 'geodir_sc_advanced_search');
913 913
 
@@ -953,48 +953,48 @@  discard block
 block discarded – undo
953 953
 		'add_location_filter' => '1',
954 954
 		'tab_layout' => 'bestof-tabs-on-top',
955 955
 		'before_widget' => '<section id="bestof_widget-1" class="widget geodir-widget geodir_bestof_widget geodir_sc_bestof_widget">',
956
-        'after_widget' => '</section>',
957
-        'before_title' => '<h3 class="widget-title">',
958
-        'after_title' => '</h3>',
956
+		'after_widget' => '</section>',
957
+		'before_title' => '<h3 class="widget-title">',
958
+		'after_title' => '</h3>',
959 959
 	);
960 960
 	$params = shortcode_atts($defaults, $atts);
961 961
 
962
-    /**
963
-     * Validate our incoming params
964
-     */
962
+	/**
963
+	 * Validate our incoming params
964
+	 */
965 965
 
966
-    // Validate the selected post type, default to gd_place on fail
967
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
968
-        $params['post_type'] = 'gd_place';
969
-    }
966
+	// Validate the selected post type, default to gd_place on fail
967
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
968
+		$params['post_type'] = 'gd_place';
969
+	}
970 970
 	
971 971
 	// Post limit needs to be a positive integer
972
-    $params['post_limit'] = absint($params['post_limit']);
973
-    if (0 == $params['post_limit']) {
974
-        $params['post_limit'] = 5;
975
-    }
972
+	$params['post_limit'] = absint($params['post_limit']);
973
+	if (0 == $params['post_limit']) {
974
+		$params['post_limit'] = 5;
975
+	}
976 976
 	
977 977
 	// Category limit needs to be a positive integer
978
-    $params['categ_limit'] = absint($params['categ_limit']);
979
-    if (0 == $params['categ_limit']) {
980
-        $params['categ_limit'] = 3;
981
-    }
978
+	$params['categ_limit'] = absint($params['categ_limit']);
979
+	if (0 == $params['categ_limit']) {
980
+		$params['categ_limit'] = 3;
981
+	}
982 982
 	
983 983
 	// Tab layout validation
984
-    $params['tab_layout'] = $params['tab_layout'];
985
-    if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
986
-        $params['tab_layout'] = 'bestof-tabs-on-top';
987
-    }
984
+	$params['tab_layout'] = $params['tab_layout'];
985
+	if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
986
+		$params['tab_layout'] = 'bestof-tabs-on-top';
987
+	}
988 988
 	
989 989
 	// Validate character_count
990
-    $params['character_count'] = $params['character_count'];
990
+	$params['character_count'] = $params['character_count'];
991 991
 
992 992
 	ob_start();
993 993
 	the_widget('geodir_bestof_widget', $params, $params);
994
-    $output = ob_get_contents();
995
-    ob_end_clean();
994
+	$output = ob_get_contents();
995
+	ob_end_clean();
996 996
 
997
-    return $output;
997
+	return $output;
998 998
 }
999 999
 add_shortcode('gd_bestof_widget', 'geodir_sc_bestof_widget');
1000 1000
 
@@ -1042,127 +1042,127 @@  discard block
 block discarded – undo
1042 1042
  * @return string HTML content to display geodirectory listings.
1043 1043
  */
1044 1044
 function geodir_sc_gd_listings($atts, $content = '') {
1045
-    global $post;
1046
-    $defaults = array(
1047
-        'title'                 => '',
1048
-        'post_type'             => 'gd_place',
1049
-        'category'              => 0,
1050
-        'list_sort'             => 'latest',
1051
-        'event_type'            => '',
1052
-        'post_number'           => 10,
1053
-        'post_author'           => '',
1054
-        'layout'                => 'gridview_onehalf',
1055
-        'listing_width'         => '',
1056
-        'character_count'       => 20,
1057
-        'add_location_filter'   => 1,
1058
-        'show_featured_only'    => '',
1059
-        'show_special_only'     => '',
1060
-        'with_pics_only'        => '',
1061
-        'with_videos_only'      => '',
1062
-        'with_pagination'       => '1',
1063
-        'top_pagination'        => '0',
1064
-        'bottom_pagination'     => '1',
1065
-        'without_no_results'    => 0,
1066
-        'tags'                  => ''
1067
-    );
1068
-    $params = shortcode_atts($defaults, $atts);
1069
-
1070
-    $params['title']        = wp_strip_all_tags($params['title']);
1071
-    $params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1072
-
1073
-    // Validate the selected category/ies - Grab the current list based on post_type
1074
-    $category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1075
-    $categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
1076
-
1077
-    // Make sure we have an array
1078
-    if (!(is_array($params['category']))) {
1079
-        $params['category'] = explode(',', $params['category']);
1080
-    }
1081
-
1082
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
1083
-    // Otherwise it becomes empty and later on that will mean "All"
1084
-    $params['category']     = array_intersect($params['category'], $categories);
1085
-
1086
-    // Post_number needs to be a positive integer
1087
-    $params['post_number']  = absint($params['post_number']);
1088
-    $params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1045
+	global $post;
1046
+	$defaults = array(
1047
+		'title'                 => '',
1048
+		'post_type'             => 'gd_place',
1049
+		'category'              => 0,
1050
+		'list_sort'             => 'latest',
1051
+		'event_type'            => '',
1052
+		'post_number'           => 10,
1053
+		'post_author'           => '',
1054
+		'layout'                => 'gridview_onehalf',
1055
+		'listing_width'         => '',
1056
+		'character_count'       => 20,
1057
+		'add_location_filter'   => 1,
1058
+		'show_featured_only'    => '',
1059
+		'show_special_only'     => '',
1060
+		'with_pics_only'        => '',
1061
+		'with_videos_only'      => '',
1062
+		'with_pagination'       => '1',
1063
+		'top_pagination'        => '0',
1064
+		'bottom_pagination'     => '1',
1065
+		'without_no_results'    => 0,
1066
+		'tags'                  => ''
1067
+	);
1068
+	$params = shortcode_atts($defaults, $atts);
1069
+
1070
+	$params['title']        = wp_strip_all_tags($params['title']);
1071
+	$params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1072
+
1073
+	// Validate the selected category/ies - Grab the current list based on post_type
1074
+	$category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1075
+	$categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
1076
+
1077
+	// Make sure we have an array
1078
+	if (!(is_array($params['category']))) {
1079
+		$params['category'] = explode(',', $params['category']);
1080
+	}
1081
+
1082
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
1083
+	// Otherwise it becomes empty and later on that will mean "All"
1084
+	$params['category']     = array_intersect($params['category'], $categories);
1085
+
1086
+	// Post_number needs to be a positive integer
1087
+	$params['post_number']  = absint($params['post_number']);
1088
+	$params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1089 1089
     
1090
-    // Post_number needs to be a positive integer
1091
-    if (!empty($atts['post_author'])) {
1092
-        if ($atts['post_author'] == 'current' && !empty($post) && isset($post->post_author) && $post->post_type != 'page') {
1093
-            $params['post_author'] = $post->post_author;
1094
-        } else if ($atts['post_author'] != 'current' && absint($atts['post_author']) > 0) {
1095
-            $params['post_author'] = absint($atts['post_author']);
1096
-        } else {
1097
-            unset($params['post_author']);
1098
-        }
1099
-    } else {
1100
-        unset($params['post_author']);
1101
-    }
1102
-
1103
-    // Validate character_count
1104
-    //todo: is this necessary?
1105
-    $params['character_count']  = $params['character_count'];
1106
-
1107
-    // Validate our layout choice
1108
-    // Outside of the norm, I added some more simple terms to match the existing
1109
-    // So now I just run the switch to set it properly.
1110
-    $params['layout']           = gdsc_validate_layout_choice($params['layout']);
1111
-
1112
-    // Validate our sorting choice
1113
-    $params['list_sort']        = gdsc_validate_sort_choice($params['list_sort']);
1114
-
1115
-    // Validate Listing width, used in the template widget-listing-listview.php
1116
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1117
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1118
-
1119
-    // Validate the checkboxes used on the widget
1120
-    $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1121
-    $params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1122
-    $params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1123
-    $params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1124
-    $params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1125
-    $params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1126
-    $params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1127
-    $params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1128
-
1129
-    // Clean tags
1130
-    if (!empty($params['tags'])) {
1131
-        if (!is_array($params['tags'])) {
1132
-            $comma = _x(',', 'tag delimiter');
1133
-            if ( ',' !== $comma ) {
1134
-                $params['tags'] = str_replace($comma, ',', $params['tags']);
1135
-            }
1136
-            $params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
1137
-            $params['tags'] = array_map('trim', $params['tags']);
1138
-        }
1139
-    } else {
1140
-        $params['tags'] = array();
1141
-    }
1142
-
1143
-    /**
1144
-     * End of validation
1145
-     */
1146
-    if (isset($atts['geodir_ajax'])) {
1147
-        $params['geodir_ajax'] = $atts['geodir_ajax'];
1148
-        unset($atts['geodir_ajax']);
1149
-    }
1150
-    if (isset($atts['pageno'])) {
1151
-        $params['pageno'] = $atts['pageno'];
1152
-        unset($atts['pageno']);
1153
-    }
1154
-
1155
-    if ( !empty($atts['shortcode_content']) ) {
1156
-        $content = $atts['shortcode_content'];
1157
-    }
1158
-    $params['shortcode_content'] = trim($content);
1159
-    $atts['shortcode_content'] = trim($content);
1090
+	// Post_number needs to be a positive integer
1091
+	if (!empty($atts['post_author'])) {
1092
+		if ($atts['post_author'] == 'current' && !empty($post) && isset($post->post_author) && $post->post_type != 'page') {
1093
+			$params['post_author'] = $post->post_author;
1094
+		} else if ($atts['post_author'] != 'current' && absint($atts['post_author']) > 0) {
1095
+			$params['post_author'] = absint($atts['post_author']);
1096
+		} else {
1097
+			unset($params['post_author']);
1098
+		}
1099
+	} else {
1100
+		unset($params['post_author']);
1101
+	}
1102
+
1103
+	// Validate character_count
1104
+	//todo: is this necessary?
1105
+	$params['character_count']  = $params['character_count'];
1106
+
1107
+	// Validate our layout choice
1108
+	// Outside of the norm, I added some more simple terms to match the existing
1109
+	// So now I just run the switch to set it properly.
1110
+	$params['layout']           = gdsc_validate_layout_choice($params['layout']);
1111
+
1112
+	// Validate our sorting choice
1113
+	$params['list_sort']        = gdsc_validate_sort_choice($params['list_sort']);
1114
+
1115
+	// Validate Listing width, used in the template widget-listing-listview.php
1116
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
1117
+	$params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1118
+
1119
+	// Validate the checkboxes used on the widget
1120
+	$params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1121
+	$params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1122
+	$params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1123
+	$params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1124
+	$params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1125
+	$params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1126
+	$params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1127
+	$params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1128
+
1129
+	// Clean tags
1130
+	if (!empty($params['tags'])) {
1131
+		if (!is_array($params['tags'])) {
1132
+			$comma = _x(',', 'tag delimiter');
1133
+			if ( ',' !== $comma ) {
1134
+				$params['tags'] = str_replace($comma, ',', $params['tags']);
1135
+			}
1136
+			$params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
1137
+			$params['tags'] = array_map('trim', $params['tags']);
1138
+		}
1139
+	} else {
1140
+		$params['tags'] = array();
1141
+	}
1142
+
1143
+	/**
1144
+	 * End of validation
1145
+	 */
1146
+	if (isset($atts['geodir_ajax'])) {
1147
+		$params['geodir_ajax'] = $atts['geodir_ajax'];
1148
+		unset($atts['geodir_ajax']);
1149
+	}
1150
+	if (isset($atts['pageno'])) {
1151
+		$params['pageno'] = $atts['pageno'];
1152
+		unset($atts['pageno']);
1153
+	}
1154
+
1155
+	if ( !empty($atts['shortcode_content']) ) {
1156
+		$content = $atts['shortcode_content'];
1157
+	}
1158
+	$params['shortcode_content'] = trim($content);
1159
+	$atts['shortcode_content'] = trim($content);
1160 1160
     
1161
-    $params['shortcode_atts']       = $atts;
1161
+	$params['shortcode_atts']       = $atts;
1162 1162
 
1163
-    $output = geodir_sc_gd_listings_output($params);
1163
+	$output = geodir_sc_gd_listings_output($params);
1164 1164
 
1165
-    return $output;
1165
+	return $output;
1166 1166
 }
1167 1167
 add_shortcode('gd_listings', 'geodir_sc_gd_listings');
1168 1168
 
@@ -1202,56 +1202,56 @@  discard block
 block discarded – undo
1202 1202
  * @return string HTML content to display CPT categories.
1203 1203
  */
1204 1204
 function geodir_sc_cpt_categories_widget($atts, $content = '') {
1205
-    $defaults = array(
1206
-        'title' => '',
1207
-        'post_type' => '', // NULL for all
1208
-        'hide_empty' => '',
1209
-        'show_count' => '',
1210
-        'hide_icon' => '',
1211
-        'cpt_left' => '',
1212
-        'sort_by' => 'count',
1213
-        'max_count' => 'all',
1214
-        'max_level' => '1',
1215
-        'no_cpt_filter' => '',
1216
-        'no_cat_filter' => '',
1217
-        'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">',
1218
-        'after_widget' => '</section>',
1219
-        'before_title' => '<h3 class="widget-title">',
1220
-        'after_title' => '</h3>',
1221
-    );
1222
-    $params = shortcode_atts($defaults, $atts);
1223
-
1224
-    /**
1225
-     * Validate our incoming params
1226
-     */
1227
-    // Make sure we have an array
1228
-    $params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1229
-     
1230
-    // Validate the checkboxes used on the widget
1231
-    $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1232
-    $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1233
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1234
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1205
+	$defaults = array(
1206
+		'title' => '',
1207
+		'post_type' => '', // NULL for all
1208
+		'hide_empty' => '',
1209
+		'show_count' => '',
1210
+		'hide_icon' => '',
1211
+		'cpt_left' => '',
1212
+		'sort_by' => 'count',
1213
+		'max_count' => 'all',
1214
+		'max_level' => '1',
1215
+		'no_cpt_filter' => '',
1216
+		'no_cat_filter' => '',
1217
+		'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">',
1218
+		'after_widget' => '</section>',
1219
+		'before_title' => '<h3 class="widget-title">',
1220
+		'after_title' => '</h3>',
1221
+	);
1222
+	$params = shortcode_atts($defaults, $atts);
1235 1223
 
1236
-    if ($params['max_count'] != 'all') {
1237
-        $params['max_count'] = absint($params['max_count']);
1238
-    }
1224
+	/**
1225
+	 * Validate our incoming params
1226
+	 */
1227
+	// Make sure we have an array
1228
+	$params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1229
+     
1230
+	// Validate the checkboxes used on the widget
1231
+	$params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1232
+	$params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1233
+	$params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1234
+	$params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1235
+
1236
+	if ($params['max_count'] != 'all') {
1237
+		$params['max_count'] = absint($params['max_count']);
1238
+	}
1239 1239
 
1240
-    if ($params['max_level'] != 'all') {
1241
-        $params['max_level'] = absint($params['max_level']);
1242
-    }
1240
+	if ($params['max_level'] != 'all') {
1241
+		$params['max_level'] = absint($params['max_level']);
1242
+	}
1243 1243
 
1244
-    $params['no_cpt_filter'] = gdsc_to_bool_val($params['no_cpt_filter']);
1245
-    $params['no_cat_filter'] = gdsc_to_bool_val($params['no_cat_filter']);
1244
+	$params['no_cpt_filter'] = gdsc_to_bool_val($params['no_cpt_filter']);
1245
+	$params['no_cat_filter'] = gdsc_to_bool_val($params['no_cat_filter']);
1246 1246
 
1247
-    $params['sort_by'] = $params['sort_by'] == 'az' ? 'az' : 'count';
1247
+	$params['sort_by'] = $params['sort_by'] == 'az' ? 'az' : 'count';
1248 1248
 
1249
-    ob_start();
1250
-    the_widget('geodir_cpt_categories_widget', $params, $params);
1251
-    $output = ob_get_contents();
1252
-    ob_end_clean();
1249
+	ob_start();
1250
+	the_widget('geodir_cpt_categories_widget', $params, $params);
1251
+	$output = ob_get_contents();
1252
+	ob_end_clean();
1253 1253
 
1254
-    return $output;
1254
+	return $output;
1255 1255
 }
1256 1256
 add_shortcode('gd_cpt_categories', 'geodir_sc_cpt_categories_widget');
1257 1257
 
@@ -1266,7 +1266,7 @@  discard block
 block discarded – undo
1266 1266
  * @return string HTML code.
1267 1267
  */
1268 1268
 function geodir_sc_responsive_videos($atts, $content) {
1269
-    return '<div class="geodir-video-wrapper">'.$content.'</div>';
1269
+	return '<div class="geodir-video-wrapper">'.$content.'</div>';
1270 1270
 }
1271 1271
 add_shortcode('gd_video', 'geodir_sc_responsive_videos');
1272 1272
 ?>
1273 1273
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-admin/place_dummy_post.php 3 patches
Indentation   +1220 added lines, -1220 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@  discard block
 block discarded – undo
12 12
 $post_meta = array();
13 13
 
14 14
 if (geodir_dummy_folder_exists())
15
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
15
+	$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
16 16
 else
17
-    $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
17
+	$dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
18 18
 
19 19
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
20 20
 
21 21
 switch ($dummy_post_index) {
22 22
 
23
-    case(1):
24
-        $image_array[] = "$dummy_image_url/a1.jpg";
25
-        $image_array[] = "$dummy_image_url/a2.jpg";
26
-        $image_array[] = "$dummy_image_url/a3.jpg";
27
-        $image_array[] = "$dummy_image_url/a4.jpg";
28
-        $image_array[] = "$dummy_image_url/a5.jpg";
29
-        $image_array[] = "$dummy_image_url/a6.jpg";
30
-        $image_array[] = "$dummy_image_url/a7.jpg";
31
-        $image_array[] = "$dummy_image_url/a8.jpg";
32
-        $image_array[] = "$dummy_image_url/a9.jpg";
33
-        $image_array[] = "$dummy_image_url/a10.jpg";
34
-        $image_array[] = "$dummy_image_url/a11.jpg";
35
-
36
-
37
-        $post_info[] = array(
38
-            "listing_type" => 'gd_place',
39
-            "post_title" => 'Franklin Square',
40
-            "post_desc" => ' <h3> Location </h3>
23
+	case(1):
24
+		$image_array[] = "$dummy_image_url/a1.jpg";
25
+		$image_array[] = "$dummy_image_url/a2.jpg";
26
+		$image_array[] = "$dummy_image_url/a3.jpg";
27
+		$image_array[] = "$dummy_image_url/a4.jpg";
28
+		$image_array[] = "$dummy_image_url/a5.jpg";
29
+		$image_array[] = "$dummy_image_url/a6.jpg";
30
+		$image_array[] = "$dummy_image_url/a7.jpg";
31
+		$image_array[] = "$dummy_image_url/a8.jpg";
32
+		$image_array[] = "$dummy_image_url/a9.jpg";
33
+		$image_array[] = "$dummy_image_url/a10.jpg";
34
+		$image_array[] = "$dummy_image_url/a11.jpg";
35
+
36
+
37
+		$post_info[] = array(
38
+			"listing_type" => 'gd_place',
39
+			"post_title" => 'Franklin Square',
40
+			"post_desc" => ' <h3> Location </h3>
41 41
 		
42 42
 		6th and Race Streets in Historic Philadelphia
43 43
 		<h3>The Experience</h3>
@@ -72,42 +72,42 @@  discard block
 block discarded – undo
72 72
 		Just in time for summer, Franklin Square has opened SquareBurger, a Stephen Starr-run “burger shack” selling summer staples: hot dogs, fries, milkshakes (made with Tasty Kakes) and, of course, hamburgers and cheeseburgers.
73 73
 		
74 74
 		SquareBurger is open until October - perfect for a couple bites between rounds of miniature golf!',
75
-            "post_images" => $image_array,
76
-            "post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
77
-            "post_tags" => array('Tags', 'Sample Tags'),
78
-            "geodir_video" => '',
79
-            "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
80
-            "geodir_contact" => '(111) 677-4444',
81
-            "geodir_email" => '[email protected]',
82
-            "geodir_website" => 'http://franklinsquare.com',
83
-            "geodir_twitter" => 'http://twitter.com/franklinsquare',
84
-            "geodir_facebook" => 'http://facebook.com/franklinsquare',
85
-            "post_dummy" => '1'
86
-        );
87
-
88
-
89
-        break;
90
-    case 2:
91
-        $image_array = array();
92
-        $post_meta = array();
93
-
94
-        /// Attractions ////post start 2///
95
-        $image_array[] = "$dummy_image_url/a6.jpg";
96
-        $image_array[] = "$dummy_image_url/a1.jpg";
97
-        $image_array[] = "$dummy_image_url/a3.jpg";
98
-        $image_array[] = "$dummy_image_url/a4.jpg";
99
-        $image_array[] = "$dummy_image_url/a5.jpg";
100
-        $image_array[] = "$dummy_image_url/a2.jpg";
101
-        $image_array[] = "$dummy_image_url/a7.jpg";
102
-        $image_array[] = "$dummy_image_url/a8.jpg";
103
-        $image_array[] = "$dummy_image_url/a9.jpg";
104
-        $image_array[] = "$dummy_image_url/a10.jpg";
105
-        $image_array[] = "$dummy_image_url/a11.jpg";
106
-
107
-        $post_info[] = array(
108
-            "listing_type" => 'gd_place',
109
-            "post_title" => 'Please Touch Museum',
110
-            "post_desc" => '<h3>New Location! </h3>
75
+			"post_images" => $image_array,
76
+			"post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
77
+			"post_tags" => array('Tags', 'Sample Tags'),
78
+			"geodir_video" => '',
79
+			"geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
80
+			"geodir_contact" => '(111) 677-4444',
81
+			"geodir_email" => '[email protected]',
82
+			"geodir_website" => 'http://franklinsquare.com',
83
+			"geodir_twitter" => 'http://twitter.com/franklinsquare',
84
+			"geodir_facebook" => 'http://facebook.com/franklinsquare',
85
+			"post_dummy" => '1'
86
+		);
87
+
88
+
89
+		break;
90
+	case 2:
91
+		$image_array = array();
92
+		$post_meta = array();
93
+
94
+		/// Attractions ////post start 2///
95
+		$image_array[] = "$dummy_image_url/a6.jpg";
96
+		$image_array[] = "$dummy_image_url/a1.jpg";
97
+		$image_array[] = "$dummy_image_url/a3.jpg";
98
+		$image_array[] = "$dummy_image_url/a4.jpg";
99
+		$image_array[] = "$dummy_image_url/a5.jpg";
100
+		$image_array[] = "$dummy_image_url/a2.jpg";
101
+		$image_array[] = "$dummy_image_url/a7.jpg";
102
+		$image_array[] = "$dummy_image_url/a8.jpg";
103
+		$image_array[] = "$dummy_image_url/a9.jpg";
104
+		$image_array[] = "$dummy_image_url/a10.jpg";
105
+		$image_array[] = "$dummy_image_url/a11.jpg";
106
+
107
+		$post_info[] = array(
108
+			"listing_type" => 'gd_place',
109
+			"post_title" => 'Please Touch Museum',
110
+			"post_desc" => '<h3>New Location! </h3>
111 111
 		
112 112
 		Who doesn&acute;t love the Please Touch Museum? And now, taking kids to the Museum is better than ever. The nation&acute;s premier children&acute;s museum - which has been a beloved landmark since it opened in 1976 - has a new home in Fairmount Park, opening its doors to a world of educational, hands-on fun.
113 113
 		
@@ -139,42 +139,42 @@  discard block
 block discarded – undo
139 139
 		
140 140
 		You can buy admission tickets to the Please Touch Museum online through our partners at the Independence Visitor Center. Just click the button below.',
141 141
 
142
-            "post_images" => $image_array,
143
-            "post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
144
-            "post_tags" => array('Tags', 'Sample Tags'),
145
-            "geodir_video" => '',
146
-            "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
147
-            "geodir_contact" => '(222) 777-1111',
148
-            "geodir_email" => '[email protected]',
149
-            "geodir_website" => 'http://pleasetouchmuseum.com',
150
-            "geodir_twitter" => 'http://twitter.com/pleasetouchmuseum',
151
-            "geodir_facebook" => 'http://facebook.com/pleasetouchmuseum',
152
-            "post_dummy" => '1'
153
-        );
154
-
155
-        break;
156
-    case 3:
157
-        $image_array = array();
158
-        $post_meta = array();
159
-
160
-        ////post end///
161
-        /// Attractions ////post start 3///
162
-        $image_array[] = "$dummy_image_url/a9.jpg";
163
-        $image_array[] = "$dummy_image_url/a10.jpg";
164
-        $image_array[] = "$dummy_image_url/a3.jpg";
165
-        $image_array[] = "$dummy_image_url/a4.jpg";
166
-        $image_array[] = "$dummy_image_url/a5.jpg";
167
-        $image_array[] = "$dummy_image_url/a2.jpg";
168
-        $image_array[] = "$dummy_image_url/a7.jpg";
169
-        $image_array[] = "$dummy_image_url/a8.jpg";
170
-        $image_array[] = "$dummy_image_url/a6.jpg";
171
-        $image_array[] = "$dummy_image_url/a1.jpg";
172
-        $image_array[] = "$dummy_image_url/a11.jpg";
173
-
174
-        $post_info[] = array(
175
-            "listing_type" => 'gd_place',
176
-            "post_title" => 'Longwood Gardens',
177
-            "post_desc" => '<h3>The Experience </h3>
142
+			"post_images" => $image_array,
143
+			"post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
144
+			"post_tags" => array('Tags', 'Sample Tags'),
145
+			"geodir_video" => '',
146
+			"geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
147
+			"geodir_contact" => '(222) 777-1111',
148
+			"geodir_email" => '[email protected]',
149
+			"geodir_website" => 'http://pleasetouchmuseum.com',
150
+			"geodir_twitter" => 'http://twitter.com/pleasetouchmuseum',
151
+			"geodir_facebook" => 'http://facebook.com/pleasetouchmuseum',
152
+			"post_dummy" => '1'
153
+		);
154
+
155
+		break;
156
+	case 3:
157
+		$image_array = array();
158
+		$post_meta = array();
159
+
160
+		////post end///
161
+		/// Attractions ////post start 3///
162
+		$image_array[] = "$dummy_image_url/a9.jpg";
163
+		$image_array[] = "$dummy_image_url/a10.jpg";
164
+		$image_array[] = "$dummy_image_url/a3.jpg";
165
+		$image_array[] = "$dummy_image_url/a4.jpg";
166
+		$image_array[] = "$dummy_image_url/a5.jpg";
167
+		$image_array[] = "$dummy_image_url/a2.jpg";
168
+		$image_array[] = "$dummy_image_url/a7.jpg";
169
+		$image_array[] = "$dummy_image_url/a8.jpg";
170
+		$image_array[] = "$dummy_image_url/a6.jpg";
171
+		$image_array[] = "$dummy_image_url/a1.jpg";
172
+		$image_array[] = "$dummy_image_url/a11.jpg";
173
+
174
+		$post_info[] = array(
175
+			"listing_type" => 'gd_place',
176
+			"post_title" => 'Longwood Gardens',
177
+			"post_desc" => '<h3>The Experience </h3>
178 178
 		
179 179
 		When you&acute;re at Longwood Gardens, it&acute;s easy to imagine that you&acute;re at a giant, royal garden in Europe. Stroll along the many paths through acres of exquisitely maintained grounds featuring 11,000 different types of plants.
180 180
 		
@@ -199,42 +199,42 @@  discard block
 block discarded – undo
199 199
 		<h3>Buy Tickets Online In Advance </h3>
200 200
 		
201 201
 		You can buy admission tickets to Longwood Gardens online through our partners at the Independence Visitor Center. Just click the button below.',
202
-            "post_images" => $image_array,
203
-            "post_category" => array('gd_placecategory' => array('Attractions')),
204
-            "post_tags" => array('wood', 'garden'),
205
-            "geodir_video" => '',
206
-            "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
207
-            "geodir_contact" => '(111) 888-1111',
208
-            "geodir_email" => '[email protected]',
209
-            "geodir_website" => 'http://longwoodgardens.com',
210
-            "geodir_twitter" => 'http://twitter.com/longwoodgardens',
211
-            "geodir_facebook" => 'http://facebook.com/longwoodgardens',
212
-            "post_dummy" => '1'
213
-        );
214
-        break;
215
-    ////post end///
216
-    /// Attractions ////post start 4///
217
-
218
-    case 4:
219
-
220
-        $image_array = array();
221
-        $post_meta = array();
222
-        $image_array[] = "$dummy_image_url/a11.jpg";
223
-        $image_array[] = "$dummy_image_url/a10.jpg";
224
-        $image_array[] = "$dummy_image_url/a3.jpg";
225
-        $image_array[] = "$dummy_image_url/a4.jpg";
226
-        $image_array[] = "$dummy_image_url/a5.jpg";
227
-        $image_array[] = "$dummy_image_url/a2.jpg";
228
-        $image_array[] = "$dummy_image_url/a7.jpg";
229
-        $image_array[] = "$dummy_image_url/a8.jpg";
230
-        $image_array[] = "$dummy_image_url/a6.jpg";
231
-        $image_array[] = "$dummy_image_url/a1.jpg";
232
-        $image_array[] = "$dummy_image_url/a9.jpg";
233
-
234
-        $post_info[] = array(
235
-            "listing_type" => 'gd_place',
236
-            "post_title" => 'The Philadelphia Zoo',
237
-            "post_desc" => '<h3>The Zoo 150th Birthday</h3>
202
+			"post_images" => $image_array,
203
+			"post_category" => array('gd_placecategory' => array('Attractions')),
204
+			"post_tags" => array('wood', 'garden'),
205
+			"geodir_video" => '',
206
+			"geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
207
+			"geodir_contact" => '(111) 888-1111',
208
+			"geodir_email" => '[email protected]',
209
+			"geodir_website" => 'http://longwoodgardens.com',
210
+			"geodir_twitter" => 'http://twitter.com/longwoodgardens',
211
+			"geodir_facebook" => 'http://facebook.com/longwoodgardens',
212
+			"post_dummy" => '1'
213
+		);
214
+		break;
215
+	////post end///
216
+	/// Attractions ////post start 4///
217
+
218
+	case 4:
219
+
220
+		$image_array = array();
221
+		$post_meta = array();
222
+		$image_array[] = "$dummy_image_url/a11.jpg";
223
+		$image_array[] = "$dummy_image_url/a10.jpg";
224
+		$image_array[] = "$dummy_image_url/a3.jpg";
225
+		$image_array[] = "$dummy_image_url/a4.jpg";
226
+		$image_array[] = "$dummy_image_url/a5.jpg";
227
+		$image_array[] = "$dummy_image_url/a2.jpg";
228
+		$image_array[] = "$dummy_image_url/a7.jpg";
229
+		$image_array[] = "$dummy_image_url/a8.jpg";
230
+		$image_array[] = "$dummy_image_url/a6.jpg";
231
+		$image_array[] = "$dummy_image_url/a1.jpg";
232
+		$image_array[] = "$dummy_image_url/a9.jpg";
233
+
234
+		$post_info[] = array(
235
+			"listing_type" => 'gd_place',
236
+			"post_title" => 'The Philadelphia Zoo',
237
+			"post_desc" => '<h3>The Zoo 150th Birthday</h3>
238 238
 		
239 239
 		The Philadelphia Zoo celebrated its 150th anniversary in 2009. So stop by and celebrate this major achievement at America&acute;s first zoo!
240 240
 		
@@ -269,45 +269,45 @@  discard block
 block discarded – undo
269 269
 		The nation&acute;s oldest zoo was chartered in 1859, but the impending Civil War delayed its opening until 1874. In addition to its animals, the zoo is known for its historic architecture, which includes the country home of William Penn&acute;s grandson; its botanical collections of over 500 plant species; its groundbreaking research and its fine veterinary facilities.
270 270
 		
271 271
 		The Primate Reserve, Carnivore Kingdom, and Rare Animal Conservation Center, with its tree kangaroos and blue-eyed lemurs, are brand new, but there&acute;s still fun to be had in the historic, old-style bird, pachyderm and carnivore houses. In the Treehouse, kids can investigate the world from an animal&acute;s perspective; outdoors, the Zoo Balloon lifts passengers 400 feet into the air for a bird&acute;s-eye view of the zoo.',
272
-            "post_images" => $image_array,
273
-            "post_category" => array('gd_placecategory' => array('Attractions')),
274
-            "post_tags" => array('wood', 'garden'),
275
-            "geodir_video" => '',
276
-            "geodir_timing" => 'Open today until 11.30 a.m., Sunday 11 am to 7 pm',
277
-            "geodir_contact" => '(211) 143-1900',
278
-            "geodir_email" => '[email protected]',
279
-            "geodir_website" => 'http://philadelphiazoo.com',
280
-            "geodir_twitter" => 'http://twitter.com/philadelphiazoo',
281
-            "geodir_facebook" => 'http://facebook.com/philadelphiazoo',
282
-            "post_dummy" => '1'
283
-        );
284
-
285
-        ////post end///
286
-        /// Attractions ////post start 4///
287
-        break;
288
-    case 5:
289
-
290
-
291
-        $image_array = array();
292
-        $post_meta = array();
293
-
294
-        /// Attractions ////post start 5///
295
-        $image_array[] = "$dummy_image_url/a12.jpg";
296
-        $image_array[] = "$dummy_image_url/a13.jpg";
297
-        $image_array[] = "$dummy_image_url/a3.jpg";
298
-        $image_array[] = "$dummy_image_url/a4.jpg";
299
-        $image_array[] = "$dummy_image_url/a5.jpg";
300
-        $image_array[] = "$dummy_image_url/a2.jpg";
301
-        $image_array[] = "$dummy_image_url/a7.jpg";
302
-        $image_array[] = "$dummy_image_url/a8.jpg";
303
-        $image_array[] = "$dummy_image_url/a6.jpg";
304
-        $image_array[] = "$dummy_image_url/a1.jpg";
305
-        $image_array[] = "$dummy_image_url/a9.jpg";
306
-
307
-        $post_info[] = array(
308
-            "listing_type" => 'gd_place',
309
-            "post_title" => 'National Constitution Center',
310
-            "post_desc" => '<h3>The Experience</h3>
272
+			"post_images" => $image_array,
273
+			"post_category" => array('gd_placecategory' => array('Attractions')),
274
+			"post_tags" => array('wood', 'garden'),
275
+			"geodir_video" => '',
276
+			"geodir_timing" => 'Open today until 11.30 a.m., Sunday 11 am to 7 pm',
277
+			"geodir_contact" => '(211) 143-1900',
278
+			"geodir_email" => '[email protected]',
279
+			"geodir_website" => 'http://philadelphiazoo.com',
280
+			"geodir_twitter" => 'http://twitter.com/philadelphiazoo',
281
+			"geodir_facebook" => 'http://facebook.com/philadelphiazoo',
282
+			"post_dummy" => '1'
283
+		);
284
+
285
+		////post end///
286
+		/// Attractions ////post start 4///
287
+		break;
288
+	case 5:
289
+
290
+
291
+		$image_array = array();
292
+		$post_meta = array();
293
+
294
+		/// Attractions ////post start 5///
295
+		$image_array[] = "$dummy_image_url/a12.jpg";
296
+		$image_array[] = "$dummy_image_url/a13.jpg";
297
+		$image_array[] = "$dummy_image_url/a3.jpg";
298
+		$image_array[] = "$dummy_image_url/a4.jpg";
299
+		$image_array[] = "$dummy_image_url/a5.jpg";
300
+		$image_array[] = "$dummy_image_url/a2.jpg";
301
+		$image_array[] = "$dummy_image_url/a7.jpg";
302
+		$image_array[] = "$dummy_image_url/a8.jpg";
303
+		$image_array[] = "$dummy_image_url/a6.jpg";
304
+		$image_array[] = "$dummy_image_url/a1.jpg";
305
+		$image_array[] = "$dummy_image_url/a9.jpg";
306
+
307
+		$post_info[] = array(
308
+			"listing_type" => 'gd_place',
309
+			"post_title" => 'National Constitution Center',
310
+			"post_desc" => '<h3>The Experience</h3>
311 311
 	
312 312
 	It only four pages long, but the U.S. Constitution is among the most influential and important documents in the history of the world.
313 313
 	
@@ -329,45 +329,45 @@  discard block
 block discarded – undo
329 329
 	<h3>Kids Stuff </h3>
330 330
 	
331 331
 	The Center frequently hosts special events with a focus on children that include informative and engaging hands-on activities. For specific information, check out the Center website.',
332
-            "post_images" => $image_array,
333
-            "post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
334
-            "post_tags" => array('Tag', 'Center'),
335
-            "geodir_video" => '',
336
-            "geodir_timing" => 'Open today until 9.30 a.m., Sunday 11 am to 7 pm',
337
-            "geodir_contact" => '(111) 111-1111',
338
-            "geodir_email" => '[email protected]',
339
-            "geodir_website" => 'http://ncc.com',
340
-            "geodir_twitter" => 'http://twitter.com/ncc',
341
-            "geodir_facebook" => 'http://facebook.com/ncc',
342
-            "post_dummy" => '1'
343
-        );
344
-
345
-        ////post end///
346
-        /// Attractions ////post start 5///
347
-        break;
348
-    case 6:
349
-
350
-
351
-        $image_array = array();
352
-        $post_meta = array();
353
-
354
-        /// Attractions ////post start 6///
355
-        $image_array[] = "$dummy_image_url/a14.jpg";
356
-        $image_array[] = "$dummy_image_url/a13.jpg";
357
-        $image_array[] = "$dummy_image_url/a3.jpg";
358
-        $image_array[] = "$dummy_image_url/a4.jpg";
359
-        $image_array[] = "$dummy_image_url/a5.jpg";
360
-        $image_array[] = "$dummy_image_url/a2.jpg";
361
-        $image_array[] = "$dummy_image_url/a7.jpg";
362
-        $image_array[] = "$dummy_image_url/a8.jpg";
363
-        $image_array[] = "$dummy_image_url/a6.jpg";
364
-        $image_array[] = "$dummy_image_url/a1.jpg";
365
-        $image_array[] = "$dummy_image_url/a9.jpg";
366
-
367
-        $post_info[] = array(
368
-            "listing_type" => 'gd_place',
369
-            "post_title" => 'Sadsbury Woods Preserve',
370
-            "post_desc" => 'A more than 500-acre nature preserve ideal for walking and hiking, Sadsbury Woods is also an important habitat for interior nesting birds and small mammals. An increasingly rare area of interior woodlands, defined as an area at least 300 feet from any road, lawn or meadow, provides a critical habitat for many species of birds, especially neo-tropical migrant songbirds.
332
+			"post_images" => $image_array,
333
+			"post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
334
+			"post_tags" => array('Tag', 'Center'),
335
+			"geodir_video" => '',
336
+			"geodir_timing" => 'Open today until 9.30 a.m., Sunday 11 am to 7 pm',
337
+			"geodir_contact" => '(111) 111-1111',
338
+			"geodir_email" => '[email protected]',
339
+			"geodir_website" => 'http://ncc.com',
340
+			"geodir_twitter" => 'http://twitter.com/ncc',
341
+			"geodir_facebook" => 'http://facebook.com/ncc',
342
+			"post_dummy" => '1'
343
+		);
344
+
345
+		////post end///
346
+		/// Attractions ////post start 5///
347
+		break;
348
+	case 6:
349
+
350
+
351
+		$image_array = array();
352
+		$post_meta = array();
353
+
354
+		/// Attractions ////post start 6///
355
+		$image_array[] = "$dummy_image_url/a14.jpg";
356
+		$image_array[] = "$dummy_image_url/a13.jpg";
357
+		$image_array[] = "$dummy_image_url/a3.jpg";
358
+		$image_array[] = "$dummy_image_url/a4.jpg";
359
+		$image_array[] = "$dummy_image_url/a5.jpg";
360
+		$image_array[] = "$dummy_image_url/a2.jpg";
361
+		$image_array[] = "$dummy_image_url/a7.jpg";
362
+		$image_array[] = "$dummy_image_url/a8.jpg";
363
+		$image_array[] = "$dummy_image_url/a6.jpg";
364
+		$image_array[] = "$dummy_image_url/a1.jpg";
365
+		$image_array[] = "$dummy_image_url/a9.jpg";
366
+
367
+		$post_info[] = array(
368
+			"listing_type" => 'gd_place',
369
+			"post_title" => 'Sadsbury Woods Preserve',
370
+			"post_desc" => 'A more than 500-acre nature preserve ideal for walking and hiking, Sadsbury Woods is also an important habitat for interior nesting birds and small mammals. An increasingly rare area of interior woodlands, defined as an area at least 300 feet from any road, lawn or meadow, provides a critical habitat for many species of birds, especially neo-tropical migrant songbirds.
371 371
 	
372 372
 	Situated on the western edge of Chester County, the land remains much as it did centuries ago, and now serves as a permanent refuge in an area facing dramatically increasing development pressure.
373 373
 	
@@ -383,45 +383,45 @@  discard block
 block discarded – undo
383 383
 	Outsider Tip
384 384
 	
385 385
 	The deep forest is a great place for spotting neo-tropical songbirds in the spring and summer months',
386
-            "post_images" => $image_array,
387
-            "post_category" => array('gd_placecategory' => array('Attractions')),
388
-            "post_tags" => array('sample', 'tags'),
389
-            "geodir_video" => '',
390
-            "geodir_timing" => 'Open today until 12.30 p.m., Sunday 12 pm to 7 pm',
391
-            "geodir_contact" => '(222) 999-9999',
392
-            "geodir_email" => '[email protected]',
393
-            "geodir_website" => 'http://swp.com',
394
-            "geodir_twitter" => 'http://twitter.com/swp',
395
-            "geodir_facebook" => 'http://facebook.com/swp',
396
-            "post_dummy" => '1'
397
-        );
398
-
399
-        ////post end///
400
-        /// Attractions ////post start 6///
401
-
402
-        break;
403
-    case 7:
404
-
405
-        $image_array = array();
406
-        $post_meta = array();
407
-
408
-        /// Attractions ////post start 7///
409
-        $image_array[] = "$dummy_image_url/a15.jpg";
410
-        $image_array[] = "$dummy_image_url/a16.jpg";
411
-        $image_array[] = "$dummy_image_url/a17.jpg";
412
-        $image_array[] = "$dummy_image_url/a4.jpg";
413
-        $image_array[] = "$dummy_image_url/a5.jpg";
414
-        $image_array[] = "$dummy_image_url/a2.jpg";
415
-        $image_array[] = "$dummy_image_url/a7.jpg";
416
-        $image_array[] = "$dummy_image_url/a8.jpg";
417
-        $image_array[] = "$dummy_image_url/a6.jpg";
418
-        $image_array[] = "$dummy_image_url/a1.jpg";
419
-        $image_array[] = "$dummy_image_url/a9.jpg";
420
-
421
-        $post_info[] = array(
422
-            "listing_type" => 'gd_place',
423
-            "post_title" => 'Museum Without Walls',
424
-            "post_desc" => '<h3>The Experience </h3>
386
+			"post_images" => $image_array,
387
+			"post_category" => array('gd_placecategory' => array('Attractions')),
388
+			"post_tags" => array('sample', 'tags'),
389
+			"geodir_video" => '',
390
+			"geodir_timing" => 'Open today until 12.30 p.m., Sunday 12 pm to 7 pm',
391
+			"geodir_contact" => '(222) 999-9999',
392
+			"geodir_email" => '[email protected]',
393
+			"geodir_website" => 'http://swp.com',
394
+			"geodir_twitter" => 'http://twitter.com/swp',
395
+			"geodir_facebook" => 'http://facebook.com/swp',
396
+			"post_dummy" => '1'
397
+		);
398
+
399
+		////post end///
400
+		/// Attractions ////post start 6///
401
+
402
+		break;
403
+	case 7:
404
+
405
+		$image_array = array();
406
+		$post_meta = array();
407
+
408
+		/// Attractions ////post start 7///
409
+		$image_array[] = "$dummy_image_url/a15.jpg";
410
+		$image_array[] = "$dummy_image_url/a16.jpg";
411
+		$image_array[] = "$dummy_image_url/a17.jpg";
412
+		$image_array[] = "$dummy_image_url/a4.jpg";
413
+		$image_array[] = "$dummy_image_url/a5.jpg";
414
+		$image_array[] = "$dummy_image_url/a2.jpg";
415
+		$image_array[] = "$dummy_image_url/a7.jpg";
416
+		$image_array[] = "$dummy_image_url/a8.jpg";
417
+		$image_array[] = "$dummy_image_url/a6.jpg";
418
+		$image_array[] = "$dummy_image_url/a1.jpg";
419
+		$image_array[] = "$dummy_image_url/a9.jpg";
420
+
421
+		$post_info[] = array(
422
+			"listing_type" => 'gd_place',
423
+			"post_title" => 'Museum Without Walls',
424
+			"post_desc" => '<h3>The Experience </h3>
425 425
 	
426 426
 	Museum Without Walls: AUDIO is a multi-platform, interactive audio tour, designed to allow locals and visitors alike to experience Philadelphia extensive collection of public art and outdoor sculpture along the Benjamin Franklin Parkway and Kelly Drive. This innovative program invites passersby to stop, look, listen and see this city public art in a new way. Discover the untold histories of the 51 outdoor sculptures at 35 stops through these professionally produced three-minute interpretive audio segments. The many narratives have been spoken by more than 100 individuals, all with personal connections to the pieces of art.
427 427
 	
@@ -431,45 +431,45 @@  discard block
 block discarded – undo
431 431
 	<h3>History </h3>
432 432
 	
433 433
 	Philadelphia has more outdoor sculpture than any other American city, yet this extensive collection often goes unnoticed. This program is intended to reveal the distinct stories behind each of these works, that have become visual white noise for so many of the city residents and visitors. ',
434
-            "post_images" => $image_array,
435
-            "post_category" => array('gd_placecategory' => array('Attractions')),
436
-            "post_tags" => array('Museum'),
437
-            "geodir_video" => '',
438
-            "geodir_timing" => 'Open today until 10.30 a.m., Sunday 10 am to 7 pm',
439
-            "geodir_contact" => '(222) 999-9999',
440
-            "geodir_email" => '[email protected]',
441
-            "geodir_website" => 'http://museumwithoutwallsaudio.org/',
442
-            "geodir_twitter" => 'http://twitter.com/mwwalls',
443
-            "geodir_facebook" => 'http://facebook.com/mwwalls',
444
-            "post_dummy" => '1'
445
-        );
446
-
447
-        ////post end///
448
-        /// Attractions ////post start 7///
449
-
450
-        break;
451
-    case 8:
452
-
453
-        $image_array = array();
454
-        $post_meta = array();
455
-
456
-        /// Attractions ////post start 8///
457
-        $image_array[] = "$dummy_image_url/a18.jpg";
458
-        $image_array[] = "$dummy_image_url/a10.jpg";
459
-        $image_array[] = "$dummy_image_url/a3.jpg";
460
-        $image_array[] = "$dummy_image_url/a4.jpg";
461
-        $image_array[] = "$dummy_image_url/a5.jpg";
462
-        $image_array[] = "$dummy_image_url/a2.jpg";
463
-        $image_array[] = "$dummy_image_url/a7.jpg";
464
-        $image_array[] = "$dummy_image_url/a8.jpg";
465
-        $image_array[] = "$dummy_image_url/a6.jpg";
466
-        $image_array[] = "$dummy_image_url/a1.jpg";
467
-        $image_array[] = "$dummy_image_url/a9.jpg";
468
-
469
-        $post_info[] = array(
470
-            "listing_type" => 'gd_place',
471
-            "post_title" => 'Audacious Freedom',
472
-            "post_desc" => 'Audacious Freedom, the major, new exhibit at the African American Museum in Philadelphia , explores the lives of people of African descent living in Philadelphia between 1776 and 1876.
434
+			"post_images" => $image_array,
435
+			"post_category" => array('gd_placecategory' => array('Attractions')),
436
+			"post_tags" => array('Museum'),
437
+			"geodir_video" => '',
438
+			"geodir_timing" => 'Open today until 10.30 a.m., Sunday 10 am to 7 pm',
439
+			"geodir_contact" => '(222) 999-9999',
440
+			"geodir_email" => '[email protected]',
441
+			"geodir_website" => 'http://museumwithoutwallsaudio.org/',
442
+			"geodir_twitter" => 'http://twitter.com/mwwalls',
443
+			"geodir_facebook" => 'http://facebook.com/mwwalls',
444
+			"post_dummy" => '1'
445
+		);
446
+
447
+		////post end///
448
+		/// Attractions ////post start 7///
449
+
450
+		break;
451
+	case 8:
452
+
453
+		$image_array = array();
454
+		$post_meta = array();
455
+
456
+		/// Attractions ////post start 8///
457
+		$image_array[] = "$dummy_image_url/a18.jpg";
458
+		$image_array[] = "$dummy_image_url/a10.jpg";
459
+		$image_array[] = "$dummy_image_url/a3.jpg";
460
+		$image_array[] = "$dummy_image_url/a4.jpg";
461
+		$image_array[] = "$dummy_image_url/a5.jpg";
462
+		$image_array[] = "$dummy_image_url/a2.jpg";
463
+		$image_array[] = "$dummy_image_url/a7.jpg";
464
+		$image_array[] = "$dummy_image_url/a8.jpg";
465
+		$image_array[] = "$dummy_image_url/a6.jpg";
466
+		$image_array[] = "$dummy_image_url/a1.jpg";
467
+		$image_array[] = "$dummy_image_url/a9.jpg";
468
+
469
+		$post_info[] = array(
470
+			"listing_type" => 'gd_place',
471
+			"post_title" => 'Audacious Freedom',
472
+			"post_desc" => 'Audacious Freedom, the major, new exhibit at the African American Museum in Philadelphia , explores the lives of people of African descent living in Philadelphia between 1776 and 1876.
473 473
 	
474 474
 	Discover how African Americans in Philadelphia lived and worked while helping to shape the young nation in its formative stages.
475 475
 	
@@ -477,45 +477,45 @@  discard block
 block discarded – undo
477 477
 	
478 478
 	The groundbreaking exhibit allows visitors to “walk the streets” of Historic Philadelphia using a large-scale map. Young children can join the action with Children&acute;s Corner, which highlights the daily lives of children during that period.
479 479
 	',
480
-            "post_images" => $image_array,
481
-            "post_category" => array('gd_placecategory' => array('Attractions')),
482
-            "post_tags" => array('Tag1'),
483
-            "geodir_video" => '',
484
-            "geodir_timing" => 'Open today until 11.30 a.m., Sunday 1 pm to 7 pm',
485
-            "geodir_contact" => '(777) 777-7777',
486
-            "geodir_email" => '[email protected]',
487
-            "geodir_website" => 'http://www.aampmuseum.org/',
488
-            "geodir_twitter" => 'http://twitter.com/aampmuseum',
489
-            "geodir_facebook" => 'http://facebook.com/aampmuseum',
490
-            "post_dummy" => '1'
491
-        );
492
-
493
-        ////post end///
494
-        /// Attractions ////post start 8///
495
-
496
-
497
-        break;
498
-    case 9:
499
-        $image_array = array();
500
-        $post_meta = array();
501
-
502
-        /// Attractions ////post start 9///
503
-        $image_array[] = "$dummy_image_url/a19.jpg";
504
-        $image_array[] = "$dummy_image_url/a20.jpg";
505
-        $image_array[] = "$dummy_image_url/a3.jpg";
506
-        $image_array[] = "$dummy_image_url/a4.jpg";
507
-        $image_array[] = "$dummy_image_url/a5.jpg";
508
-        $image_array[] = "$dummy_image_url/a2.jpg";
509
-        $image_array[] = "$dummy_image_url/a7.jpg";
510
-        $image_array[] = "$dummy_image_url/a8.jpg";
511
-        $image_array[] = "$dummy_image_url/a6.jpg";
512
-        $image_array[] = "$dummy_image_url/a1.jpg";
513
-        $image_array[] = "$dummy_image_url/a9.jpg";
514
-
515
-        $post_info[] = array(
516
-            "listing_type" => 'gd_place',
517
-            "post_title" => 'The Liberty Bell Center',
518
-            "post_desc" => '<h3>The Experience </h3>
480
+			"post_images" => $image_array,
481
+			"post_category" => array('gd_placecategory' => array('Attractions')),
482
+			"post_tags" => array('Tag1'),
483
+			"geodir_video" => '',
484
+			"geodir_timing" => 'Open today until 11.30 a.m., Sunday 1 pm to 7 pm',
485
+			"geodir_contact" => '(777) 777-7777',
486
+			"geodir_email" => '[email protected]',
487
+			"geodir_website" => 'http://www.aampmuseum.org/',
488
+			"geodir_twitter" => 'http://twitter.com/aampmuseum',
489
+			"geodir_facebook" => 'http://facebook.com/aampmuseum',
490
+			"post_dummy" => '1'
491
+		);
492
+
493
+		////post end///
494
+		/// Attractions ////post start 8///
495
+
496
+
497
+		break;
498
+	case 9:
499
+		$image_array = array();
500
+		$post_meta = array();
501
+
502
+		/// Attractions ////post start 9///
503
+		$image_array[] = "$dummy_image_url/a19.jpg";
504
+		$image_array[] = "$dummy_image_url/a20.jpg";
505
+		$image_array[] = "$dummy_image_url/a3.jpg";
506
+		$image_array[] = "$dummy_image_url/a4.jpg";
507
+		$image_array[] = "$dummy_image_url/a5.jpg";
508
+		$image_array[] = "$dummy_image_url/a2.jpg";
509
+		$image_array[] = "$dummy_image_url/a7.jpg";
510
+		$image_array[] = "$dummy_image_url/a8.jpg";
511
+		$image_array[] = "$dummy_image_url/a6.jpg";
512
+		$image_array[] = "$dummy_image_url/a1.jpg";
513
+		$image_array[] = "$dummy_image_url/a9.jpg";
514
+
515
+		$post_info[] = array(
516
+			"listing_type" => 'gd_place',
517
+			"post_title" => 'The Liberty Bell Center',
518
+			"post_desc" => '<h3>The Experience </h3>
519 519
 	
520 520
 	The Liberty Bell has a new home, and it is as powerful and dramatic as the Bell itself. Throughout the expansive, light-filled Center, larger-than-life historic documents and graphic images explore the facts and the myths surrounding the Bell.
521 521
 	
@@ -536,45 +536,45 @@  discard block
 block discarded – undo
536 536
 	The Bell is suspended from what is believed to be its original yoke, made of American elm.
537 537
 	
538 538
 	The Liberty Bell weighs 2,080 pounds. The yoke weighs about 100 pounds.',
539
-            "post_images" => $image_array,
540
-            "post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
541
-            "post_tags" => array(''),
542
-            "geodir_video" => '',
543
-            "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
544
-            "geodir_contact" => '(777) 666-6666',
545
-            "geodir_email" => '[email protected]',
546
-            "geodir_website" => 'http://www.nps.gov/inde',
547
-            "geodir_twitter" => 'http://twitter.com/nps',
548
-            "geodir_facebook" => 'http://facebook.com/nps',
549
-            "post_dummy" => '1'
550
-        );
551
-
552
-        ////post end///
553
-        /// Attractions ////post start 9///
554
-        break;
555
-    case 10:
556
-
557
-
558
-        $image_array = array();
559
-        $post_meta = array();
560
-
561
-        /// Attractions ////post start 10///
562
-        $image_array[] = "$dummy_image_url/a19.jpg";
563
-        $image_array[] = "$dummy_image_url/a20.jpg";
564
-        $image_array[] = "$dummy_image_url/a3.jpg";
565
-        $image_array[] = "$dummy_image_url/a4.jpg";
566
-        $image_array[] = "$dummy_image_url/a5.jpg";
567
-        $image_array[] = "$dummy_image_url/a2.jpg";
568
-        $image_array[] = "$dummy_image_url/a7.jpg";
569
-        $image_array[] = "$dummy_image_url/a8.jpg";
570
-        $image_array[] = "$dummy_image_url/a6.jpg";
571
-        $image_array[] = "$dummy_image_url/a1.jpg";
572
-        $image_array[] = "$dummy_image_url/a9.jpg";
573
-
574
-        $post_info[] = array(
575
-            "listing_type" => 'gd_place',
576
-            "post_title" => 'Rittenhouse Square',
577
-            "post_desc" => '
539
+			"post_images" => $image_array,
540
+			"post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
541
+			"post_tags" => array(''),
542
+			"geodir_video" => '',
543
+			"geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
544
+			"geodir_contact" => '(777) 666-6666',
545
+			"geodir_email" => '[email protected]',
546
+			"geodir_website" => 'http://www.nps.gov/inde',
547
+			"geodir_twitter" => 'http://twitter.com/nps',
548
+			"geodir_facebook" => 'http://facebook.com/nps',
549
+			"post_dummy" => '1'
550
+		);
551
+
552
+		////post end///
553
+		/// Attractions ////post start 9///
554
+		break;
555
+	case 10:
556
+
557
+
558
+		$image_array = array();
559
+		$post_meta = array();
560
+
561
+		/// Attractions ////post start 10///
562
+		$image_array[] = "$dummy_image_url/a19.jpg";
563
+		$image_array[] = "$dummy_image_url/a20.jpg";
564
+		$image_array[] = "$dummy_image_url/a3.jpg";
565
+		$image_array[] = "$dummy_image_url/a4.jpg";
566
+		$image_array[] = "$dummy_image_url/a5.jpg";
567
+		$image_array[] = "$dummy_image_url/a2.jpg";
568
+		$image_array[] = "$dummy_image_url/a7.jpg";
569
+		$image_array[] = "$dummy_image_url/a8.jpg";
570
+		$image_array[] = "$dummy_image_url/a6.jpg";
571
+		$image_array[] = "$dummy_image_url/a1.jpg";
572
+		$image_array[] = "$dummy_image_url/a9.jpg";
573
+
574
+		$post_info[] = array(
575
+			"listing_type" => 'gd_place',
576
+			"post_title" => 'Rittenhouse Square',
577
+			"post_desc" => '
578 578
 	
579 579
 	Unlike the other squares, the early Southwest Square was never used as a burial ground, although it offered pasturage for local livestock and a convenient dumping spot for “night soil”.
580 580
 	<h3> History </h3>
@@ -607,45 +607,45 @@  discard block
 block discarded – undo
607 607
 	
608 608
 	Meanwhile, several more restaurants, bars and clubs have opened along the surrounding blocks in recent years, like Parc, Tria, Continental Midtown, Alfa, Walnut Room, and Twenty Manning just to name a few.
609 609
 	',
610
-            "post_images" => $image_array,
611
-            "post_category" => array('gd_placecategory' => array('Attractions')),
612
-            "post_tags" => array('Museum'),
613
-            "geodir_video" => '',
614
-            "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
615
-            "geodir_contact" => '(777) 666-6666',
616
-            "geodir_email" => '[email protected]',
617
-            "geodir_website" => 'http://www.fairmountpark.org/rittenhousesquare.asp',
618
-            "geodir_twitter" => 'http://twitter.com/fairmountpark',
619
-            "geodir_facebook" => 'http://facebook.com/fairmountpark',
620
-            "post_dummy" => '1'
621
-        );
622
-
623
-        ////post end///
624
-        /// Attractions ////post start 10///
625
-        break;
626
-    case 11:
627
-
628
-
629
-        $image_array = array();
630
-        $post_meta = array();
631
-
632
-        /// Hotels ////post start 1///
633
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
634
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
635
-        $image_array[] = "$dummy_image_url/hotels3.jpg";
636
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
637
-        $image_array[] = "$dummy_image_url/hotels5.jpg";
638
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
639
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
640
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
641
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
642
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
643
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
644
-
645
-        $post_info[] = array(
646
-            "listing_type" => 'gd_place',
647
-            "post_title" => 'Loews Philadelphia Hotel',
648
-            "post_desc" => '
610
+			"post_images" => $image_array,
611
+			"post_category" => array('gd_placecategory' => array('Attractions')),
612
+			"post_tags" => array('Museum'),
613
+			"geodir_video" => '',
614
+			"geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
615
+			"geodir_contact" => '(777) 666-6666',
616
+			"geodir_email" => '[email protected]',
617
+			"geodir_website" => 'http://www.fairmountpark.org/rittenhousesquare.asp',
618
+			"geodir_twitter" => 'http://twitter.com/fairmountpark',
619
+			"geodir_facebook" => 'http://facebook.com/fairmountpark',
620
+			"post_dummy" => '1'
621
+		);
622
+
623
+		////post end///
624
+		/// Attractions ////post start 10///
625
+		break;
626
+	case 11:
627
+
628
+
629
+		$image_array = array();
630
+		$post_meta = array();
631
+
632
+		/// Hotels ////post start 1///
633
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
634
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
635
+		$image_array[] = "$dummy_image_url/hotels3.jpg";
636
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
637
+		$image_array[] = "$dummy_image_url/hotels5.jpg";
638
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
639
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
640
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
641
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
642
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
643
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
644
+
645
+		$post_info[] = array(
646
+			"listing_type" => 'gd_place',
647
+			"post_title" => 'Loews Philadelphia Hotel',
648
+			"post_desc" => '
649 649
 	
650 650
 	<h3>OVERVIEW </h3>
651 651
 	
@@ -712,45 +712,45 @@  discard block
 block discarded – undo
712 712
 	
713 713
 	SoleFood Restaurant is proud to be serving Starbucks. Come in and enjoy a fresh cup of coffee during your morning rush. The Coffee Bar also offer small breakfast items for your enjoyment.
714 714
 	',
715
-            "post_images" => $image_array,
716
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
717
-            "post_tags" => array(''),
718
-            "geodir_video" => '',
719
-            "geodir_timing" => 'Daily, 6:30 am – 12:00 pm',
720
-            "geodir_contact" => '(111) 111-0000',
721
-            "geodir_email" => '[email protected]',
722
-            "geodir_website" => 'http://www.loewshotels.com/en/hotels/philadelphia-hotel/overview.aspx',
723
-            "geodir_twitter" => 'http://twitter.com/loewshotels',
724
-            "geodir_facebook" => 'http://facebook.com/loewshotels',
725
-            "post_dummy" => '1'
726
-        );
727
-
728
-        ////post end///
729
-        /// Hotels ////post start 1///
730
-        break;
731
-    case 12:
732
-
733
-
734
-        $image_array = array();
735
-        $post_meta = array();
736
-
737
-        /// Hotels ////post start 2///
738
-        $image_array[] = "$dummy_image_url/hotels5.jpg";
739
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
740
-        $image_array[] = "$dummy_image_url/hotels3.jpg";
741
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
742
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
743
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
744
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
745
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
746
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
747
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
748
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
749
-
750
-        $post_info[] = array(
751
-            "listing_type" => 'gd_place',
752
-            "post_title" => 'Embassy Suites Philadelphia',
753
-            "post_desc" => '
715
+			"post_images" => $image_array,
716
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
717
+			"post_tags" => array(''),
718
+			"geodir_video" => '',
719
+			"geodir_timing" => 'Daily, 6:30 am – 12:00 pm',
720
+			"geodir_contact" => '(111) 111-0000',
721
+			"geodir_email" => '[email protected]',
722
+			"geodir_website" => 'http://www.loewshotels.com/en/hotels/philadelphia-hotel/overview.aspx',
723
+			"geodir_twitter" => 'http://twitter.com/loewshotels',
724
+			"geodir_facebook" => 'http://facebook.com/loewshotels',
725
+			"post_dummy" => '1'
726
+		);
727
+
728
+		////post end///
729
+		/// Hotels ////post start 1///
730
+		break;
731
+	case 12:
732
+
733
+
734
+		$image_array = array();
735
+		$post_meta = array();
736
+
737
+		/// Hotels ////post start 2///
738
+		$image_array[] = "$dummy_image_url/hotels5.jpg";
739
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
740
+		$image_array[] = "$dummy_image_url/hotels3.jpg";
741
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
742
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
743
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
744
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
745
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
746
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
747
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
748
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
749
+
750
+		$post_info[] = array(
751
+			"listing_type" => 'gd_place',
752
+			"post_title" => 'Embassy Suites Philadelphia',
753
+			"post_desc" => '
754 754
 	The newly renovated Embassy Suites Philadelphia – Center City hotel is conveniently situated in the heart of downtown Philadelphia, Pennsylvania and Philadelphia&acute;s Center City business district. This hotel in Philadelphia is located only eight miles from Philadelphia International Airport and just minutes from top Philadelphia attractions, including:
755 755
 	
756 756
 	Philadelphia Museum of Art
@@ -766,45 +766,45 @@  discard block
 block discarded – undo
766 766
 	
767 767
 	A delicious, complimentary cooked-to-order breakfast is offered each morning, and a hotel Manager&acute;s Reception every night – featuring complimentary refreshments and great company.
768 768
 	',
769
-            "post_images" => $image_array,
770
-            "post_category" => array('gd_placecategory' => array('Hotels')),
771
-            "post_tags" => array(''),
772
-            "geodir_video" => '',
773
-            "geodir_timing" => 'Daily, 10:30 am – 10 pm',
774
-            "geodir_contact" => '(111) 111-0000',
775
-            "geodir_email" => '[email protected]',
776
-            "geodir_website" => 'http://embassysuites1.hilton.com/en_US/es/hotel/PHLDTES-Embassy-Suites-Philadelphia-Center-City-Pennsylvania/index.do',
777
-            "geodir_twitter" => 'http://twitter.com/embassysuites1',
778
-            "geodir_facebook" => 'http://facebook.com/embassysuites1',
779
-            "post_dummy" => '1'
780
-        );
781
-
782
-        ////post end///
783
-        /// Hotels ////post start 2///
784
-
785
-        break;
786
-    case 13:
787
-
788
-        $image_array = array();
789
-        $post_meta = array();
790
-
791
-        /// Hotels ////post start 3///
792
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
793
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
794
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
795
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
796
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
797
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
798
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
799
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
800
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
801
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
802
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
803
-
804
-        $post_info[] = array(
805
-            "listing_type" => 'gd_place',
806
-            "post_title" => 'Doubletree Hotel Philadelphia',
807
-            "post_desc" => '
769
+			"post_images" => $image_array,
770
+			"post_category" => array('gd_placecategory' => array('Hotels')),
771
+			"post_tags" => array(''),
772
+			"geodir_video" => '',
773
+			"geodir_timing" => 'Daily, 10:30 am – 10 pm',
774
+			"geodir_contact" => '(111) 111-0000',
775
+			"geodir_email" => '[email protected]',
776
+			"geodir_website" => 'http://embassysuites1.hilton.com/en_US/es/hotel/PHLDTES-Embassy-Suites-Philadelphia-Center-City-Pennsylvania/index.do',
777
+			"geodir_twitter" => 'http://twitter.com/embassysuites1',
778
+			"geodir_facebook" => 'http://facebook.com/embassysuites1',
779
+			"post_dummy" => '1'
780
+		);
781
+
782
+		////post end///
783
+		/// Hotels ////post start 2///
784
+
785
+		break;
786
+	case 13:
787
+
788
+		$image_array = array();
789
+		$post_meta = array();
790
+
791
+		/// Hotels ////post start 3///
792
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
793
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
794
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
795
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
796
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
797
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
798
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
799
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
800
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
801
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
802
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
803
+
804
+		$post_info[] = array(
805
+			"listing_type" => 'gd_place',
806
+			"post_title" => 'Doubletree Hotel Philadelphia',
807
+			"post_desc" => '
808 808
 	With 434 rooms, the Doubletree Hotel is a great option for your upcoming stay in Philadelphia.
809 809
 	
810 810
 	<h3>Location </h3>
@@ -834,47 +834,47 @@  discard block
 block discarded – undo
834 834
 	Stop in the restaurant - which serves lunch and dinner daily - for a drink and some light fare. With its location right on Broad Street, you&acute;re close to everything you could ever want in a night on the town.
835 835
 	',
836 836
 
837
-            "post_images" => $image_array,
838
-
839
-            "post_category" => array('gd_placecategory' => array('Hotels')),
840
-            "post_tags" => array(''),
841
-            "geodir_video" => '',
842
-            "geodir_timing" => 'Daily, 10:30 am – 10 pm',
843
-            "geodir_contact" => '(111) 111-0000',
844
-            "geodir_email" => '[email protected]',
845
-            "geodir_website" => 'http://doubletree1.hilton.com/en_US/dt/hotel/PHLBLDT-Doubletree-Hotel-Philadelphia-Pennsylvania/index.do',
846
-            "geodir_twitter" => 'http://twitter.com/doubletree1',
847
-            "geodir_facebook" => 'http://facebook.com/doubletree1',
848
-            "post_dummy" => '1'
849
-        );
850
-
851
-        ////post end///
852
-        /// Hotels ////post start 3///
853
-
854
-        break;
855
-    case 14:
856
-
857
-
858
-        $image_array = array();
859
-        $post_meta = array();
860
-
861
-        /// Hotels ////post start 4///
862
-        $image_array[] = "$dummy_image_url/hotels15.jpg";
863
-        $image_array[] = "$dummy_image_url/hotels16.jpg";
864
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
865
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
866
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
867
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
868
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
869
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
870
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
871
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
872
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
873
-
874
-        $post_info[] = array(
875
-            "listing_type" => 'gd_place',
876
-            "post_title" => 'Philadelphia Marriott Downtown',
877
-            "post_desc" => '
837
+			"post_images" => $image_array,
838
+
839
+			"post_category" => array('gd_placecategory' => array('Hotels')),
840
+			"post_tags" => array(''),
841
+			"geodir_video" => '',
842
+			"geodir_timing" => 'Daily, 10:30 am – 10 pm',
843
+			"geodir_contact" => '(111) 111-0000',
844
+			"geodir_email" => '[email protected]',
845
+			"geodir_website" => 'http://doubletree1.hilton.com/en_US/dt/hotel/PHLBLDT-Doubletree-Hotel-Philadelphia-Pennsylvania/index.do',
846
+			"geodir_twitter" => 'http://twitter.com/doubletree1',
847
+			"geodir_facebook" => 'http://facebook.com/doubletree1',
848
+			"post_dummy" => '1'
849
+		);
850
+
851
+		////post end///
852
+		/// Hotels ////post start 3///
853
+
854
+		break;
855
+	case 14:
856
+
857
+
858
+		$image_array = array();
859
+		$post_meta = array();
860
+
861
+		/// Hotels ////post start 4///
862
+		$image_array[] = "$dummy_image_url/hotels15.jpg";
863
+		$image_array[] = "$dummy_image_url/hotels16.jpg";
864
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
865
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
866
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
867
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
868
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
869
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
870
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
871
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
872
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
873
+
874
+		$post_info[] = array(
875
+			"listing_type" => 'gd_place',
876
+			"post_title" => 'Philadelphia Marriott Downtown',
877
+			"post_desc" => '
878 878
 	Get ready to stay and play at the new aloft Philadelphia Airport!
879 879
 	
880 880
 	This incredibly modern hotel is located just five minutes from Philadelphia International Airport, offering a great convenience to travelers looking for fresh and fun accommodations.
@@ -901,45 +901,45 @@  discard block
 block discarded – undo
901 901
 	
902 902
 	Aahh…breathe deep at Aloft. This hotel is smoke-free.
903 903
 	',
904
-            "post_images" => $image_array,
905
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
906
-            "post_tags" => array(''),
907
-            "geodir_video" => '',
908
-            "geodir_timing" => '24 Hours',
909
-            "geodir_contact" => '(123) 111-2222',
910
-            "geodir_email" => '[email protected]',
911
-            "geodir_website" => 'http://www.marriott.com/hotels/travel/phldt-philadelphia-marriott-downtown/',
912
-            "geodir_twitter" => 'http://twitter.com/marriott',
913
-            "geodir_facebook" => 'http://facebook.com/marriott',
914
-            "post_dummy" => '1'
915
-        );
916
-
917
-        ////post end///
918
-        /// Hotels ////post start 4///
919
-        break;
920
-    case 15:
921
-
922
-
923
-        $image_array = array();
924
-        $post_meta = array();
925
-
926
-        /// Hotels ////post start 5///
927
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
928
-        $image_array[] = "$dummy_image_url/hotels16.jpg";
929
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
930
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
931
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
932
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
933
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
934
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
935
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
936
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
937
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
938
-
939
-        $post_info[] = array(
940
-            "listing_type" => 'gd_place',
941
-            "post_title" => 'Hilton Inn at Penn',
942
-            "post_desc" => '
904
+			"post_images" => $image_array,
905
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
906
+			"post_tags" => array(''),
907
+			"geodir_video" => '',
908
+			"geodir_timing" => '24 Hours',
909
+			"geodir_contact" => '(123) 111-2222',
910
+			"geodir_email" => '[email protected]',
911
+			"geodir_website" => 'http://www.marriott.com/hotels/travel/phldt-philadelphia-marriott-downtown/',
912
+			"geodir_twitter" => 'http://twitter.com/marriott',
913
+			"geodir_facebook" => 'http://facebook.com/marriott',
914
+			"post_dummy" => '1'
915
+		);
916
+
917
+		////post end///
918
+		/// Hotels ////post start 4///
919
+		break;
920
+	case 15:
921
+
922
+
923
+		$image_array = array();
924
+		$post_meta = array();
925
+
926
+		/// Hotels ////post start 5///
927
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
928
+		$image_array[] = "$dummy_image_url/hotels16.jpg";
929
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
930
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
931
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
932
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
933
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
934
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
935
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
936
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
937
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
938
+
939
+		$post_info[] = array(
940
+			"listing_type" => 'gd_place',
941
+			"post_title" => 'Hilton Inn at Penn',
942
+			"post_desc" => '
943 943
 	Located in the heart of Penn&acute;s campus in the beautiful University City neighborhood of Philadelphia, The Hilton Inn at Penn is a great choice for accommodations during your upcoming visit to Philadelphia.
944 944
 	
945 945
 	The location puts you right in the middle of the prestigious University of Pennsylvania and its many nearby educational, medical and corporate centers. And Center City Philadelphia is only a short cab ride away. So if you want to get out and explore the city, you are set.
@@ -955,45 +955,45 @@  discard block
 block discarded – undo
955 955
 	
956 956
 	The pasta is handmade right in front of you and then dished up along side delectable entrées such as grilled veal tenderloin and honey glazed sea scallops. And the wine bar offers more than 30 varieties by the glass and more than 100 by the bottle.  
957 957
 	',
958
-            "post_images" => $image_array,
959
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
960
-            "post_tags" => array(''),
961
-            "geodir_video" => '',
962
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
963
-            "geodir_contact" => '(888) 888-8888',
964
-            "geodir_email" => '[email protected]',
965
-            "geodir_website" => 'http://www.theinnatpenn.com/',
966
-            "geodir_twitter" => 'http://twitter.com/theinnatpenn',
967
-            "geodir_facebook" => 'http://facebook.com/theinnatpenn',
968
-            "post_dummy" => '1'
969
-        );
970
-
971
-        ////post end///
972
-        /// Hotels ////post start 5///
973
-        break;
974
-    case 16:
975
-
976
-
977
-        $image_array = array();
978
-        $post_meta = array();
979
-
980
-        /// Hotels ////post start 6///
981
-        $image_array[] = "$dummy_image_url/hotels17.jpg";
982
-        $image_array[] = "$dummy_image_url/hotels18.jpg";
983
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
984
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
985
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
986
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
987
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
988
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
989
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
990
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
991
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
992
-
993
-        $post_info[] = array(
994
-            "listing_type" => 'gd_place',
995
-            "post_title" => 'Courtyard Philadelphia Downtown',
996
-            "post_desc" => '
958
+			"post_images" => $image_array,
959
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
960
+			"post_tags" => array(''),
961
+			"geodir_video" => '',
962
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
963
+			"geodir_contact" => '(888) 888-8888',
964
+			"geodir_email" => '[email protected]',
965
+			"geodir_website" => 'http://www.theinnatpenn.com/',
966
+			"geodir_twitter" => 'http://twitter.com/theinnatpenn',
967
+			"geodir_facebook" => 'http://facebook.com/theinnatpenn',
968
+			"post_dummy" => '1'
969
+		);
970
+
971
+		////post end///
972
+		/// Hotels ////post start 5///
973
+		break;
974
+	case 16:
975
+
976
+
977
+		$image_array = array();
978
+		$post_meta = array();
979
+
980
+		/// Hotels ////post start 6///
981
+		$image_array[] = "$dummy_image_url/hotels17.jpg";
982
+		$image_array[] = "$dummy_image_url/hotels18.jpg";
983
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
984
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
985
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
986
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
987
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
988
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
989
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
990
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
991
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
992
+
993
+		$post_info[] = array(
994
+			"listing_type" => 'gd_place',
995
+			"post_title" => 'Courtyard Philadelphia Downtown',
996
+			"post_desc" => '
997 997
 	<h3>Overview </h3>
998 998
 	
999 999
 	The Philadelphia Downtown Courtyard opened it&acute;s doors after a grand $75 million restoration, recapturing the grandeur of its 1926 origins while incorporating state of the art systems throughout.
@@ -1023,45 +1023,45 @@  discard block
 block discarded – undo
1023 1023
 	
1024 1024
 	Recently featured on WE TV&acute;s “My Fair Wedding”, the Courtyard Marriott Philadelphia is one of the city&acute;s leading venues for corporate and social affairs with over 10,000 sq ft of flexible meeting space, including two Grand Ballrooms each with over 3,000 square feet accommodating up to 250 people. In addition, the hotel has a total of 11 meeting rooms making it an ideal home for all occasions. The hotel boasts an experienced full-service Event and Culinary Teams, ready to take care of all the details and ensure your event is not only a success, but a lasting memory. 
1025 1025
 	',
1026
-            "post_images" => $image_array,
1027
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1028
-            "post_tags" => array(''),
1029
-            "geodir_video" => '',
1030
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
1031
-            "geodir_contact" => '(888) 888-8888',
1032
-            "geodir_email" => '[email protected]',
1033
-            "geodir_website" => 'http://www.theinnatpenn.com/',
1034
-            "geodir_twitter" => 'http://twitter.com/theinnatpenn',
1035
-            "geodir_facebook" => 'http://facebook.com/theinnatpenn',
1036
-            "post_dummy" => '1'
1037
-        );
1038
-
1039
-        ////post end///
1040
-        /// Hotels ////post start 6///
1041
-
1042
-        break;
1043
-    case 17:
1044
-
1045
-        $image_array = array();
1046
-        $post_meta = array();
1047
-
1048
-        /// Hotels ////post start 7///
1049
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
1050
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1051
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1052
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1053
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1054
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1055
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1056
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1057
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1058
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1059
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1060
-
1061
-        $post_info[] = array(
1062
-            "listing_type" => 'gd_place',
1063
-            "post_title" => 'Four Seasons Philadelphia',
1064
-            "post_desc" => '
1026
+			"post_images" => $image_array,
1027
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1028
+			"post_tags" => array(''),
1029
+			"geodir_video" => '',
1030
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
1031
+			"geodir_contact" => '(888) 888-8888',
1032
+			"geodir_email" => '[email protected]',
1033
+			"geodir_website" => 'http://www.theinnatpenn.com/',
1034
+			"geodir_twitter" => 'http://twitter.com/theinnatpenn',
1035
+			"geodir_facebook" => 'http://facebook.com/theinnatpenn',
1036
+			"post_dummy" => '1'
1037
+		);
1038
+
1039
+		////post end///
1040
+		/// Hotels ////post start 6///
1041
+
1042
+		break;
1043
+	case 17:
1044
+
1045
+		$image_array = array();
1046
+		$post_meta = array();
1047
+
1048
+		/// Hotels ////post start 7///
1049
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
1050
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1051
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1052
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1053
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1054
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1055
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1056
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1057
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1058
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1059
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1060
+
1061
+		$post_info[] = array(
1062
+			"listing_type" => 'gd_place',
1063
+			"post_title" => 'Four Seasons Philadelphia',
1064
+			"post_desc" => '
1065 1065
 	<h3>Overview </h3>
1066 1066
 	
1067 1067
 	The Philadelphia Downtown Courtyard opened it&acute;s doors after a grand $75 million restoration, recapturing the grandeur of its 1926 origins while incorporating state of the art systems throughout.
@@ -1091,45 +1091,45 @@  discard block
 block discarded – undo
1091 1091
 	
1092 1092
 	Recently featured on WE TV&acute;s “My Fair Wedding”, the Courtyard Marriott Philadelphia is one of the city&acute;s leading venues for corporate and social affairs with over 10,000 sq ft of flexible meeting space, including two Grand Ballrooms each with over 3,000 square feet accommodating up to 250 people. In addition, the hotel has a total of 11 meeting rooms making it an ideal home for all occasions. The hotel boasts an experienced full-service Event and Culinary Teams, ready to take care of all the details and ensure your event is not only a success, but a lasting memory. 
1093 1093
 	',
1094
-            "post_images" => $image_array,
1095
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1096
-            "post_tags" => array(''),
1097
-            "geodir_video" => '',
1098
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
1099
-            "geodir_contact" => '(143) 888-8888',
1100
-            "geodir_email" => '[email protected]',
1101
-            "geodir_website" => 'http://www.fourseasons.com/philadelphia/',
1102
-            "geodir_twitter" => 'http://twitter.com/fourseasons',
1103
-            "geodir_facebook" => 'http://facebook.com/fourseasons',
1104
-            "post_dummy" => '1'
1105
-        );
1106
-
1107
-        ////post end///
1108
-        /// Hotels ////post start 7///
1109
-        break;
1110
-    case 18:
1111
-
1112
-
1113
-        $image_array = array();
1114
-        $post_meta = array();
1115
-
1116
-        /// Hotels ////post start 8///
1117
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
1118
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1119
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1120
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1121
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1122
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1123
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1124
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1125
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1126
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1127
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1128
-
1129
-        $post_info[] = array(
1130
-            "listing_type" => 'gd_place',
1131
-            "post_title" => 'Alexander Inn',
1132
-            "post_desc" => '
1094
+			"post_images" => $image_array,
1095
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1096
+			"post_tags" => array(''),
1097
+			"geodir_video" => '',
1098
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
1099
+			"geodir_contact" => '(143) 888-8888',
1100
+			"geodir_email" => '[email protected]',
1101
+			"geodir_website" => 'http://www.fourseasons.com/philadelphia/',
1102
+			"geodir_twitter" => 'http://twitter.com/fourseasons',
1103
+			"geodir_facebook" => 'http://facebook.com/fourseasons',
1104
+			"post_dummy" => '1'
1105
+		);
1106
+
1107
+		////post end///
1108
+		/// Hotels ////post start 7///
1109
+		break;
1110
+	case 18:
1111
+
1112
+
1113
+		$image_array = array();
1114
+		$post_meta = array();
1115
+
1116
+		/// Hotels ////post start 8///
1117
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
1118
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1119
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1120
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1121
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1122
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1123
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1124
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1125
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1126
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1127
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1128
+
1129
+		$post_info[] = array(
1130
+			"listing_type" => 'gd_place',
1131
+			"post_title" => 'Alexander Inn',
1132
+			"post_desc" => '
1133 1133
 	The Alexander Inn is one of Philadelphia&acute;s most popular and reasonably priced small hotels.
1134 1134
 	
1135 1135
 	Conveniently located in the heart of the Washington Square West neighborhood in Center City Philadelphia, the Alexander Inn is a great place to base your stay in Philadelphia.
@@ -1138,45 +1138,45 @@  discard block
 block discarded – undo
1138 1138
 	
1139 1139
 	Rooms are also fitted with DirecTV (including many complimentary channels like CNN, ESPN, eight movie channels, etc.) and telephones with modem ports and direct dial. You will also have access to the hotel&acute;s free 24-hour fitness and e-mail centers.  
1140 1140
 	',
1141
-            "post_images" => $image_array,
1142
-            "post_category" => array('gd_placecategory' => array('Hotels')),
1143
-            "post_tags" => array(''),
1144
-            "geodir_video" => '',
1145
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
1146
-            "geodir_contact" => '(143) 888-8888',
1147
-            "geodir_email" => '[email protected]',
1148
-            "geodir_website" => 'http://www.alexanderinn.com/',
1149
-            "geodir_twitter" => 'http://twitter.com/alexanderinn',
1150
-            "geodir_facebook" => 'http://facebook.com/alexanderinn',
1151
-            "post_dummy" => '1'
1152
-        );
1153
-
1154
-        ////post end///
1155
-        /// Hotels ////post start 8///
1156
-        break;
1157
-    case 19:
1158
-
1159
-
1160
-        $image_array = array();
1161
-        $post_meta = array();
1162
-
1163
-        /// Hotels ////post start 9///
1164
-        $image_array[] = "$dummy_image_url/hotels5.jpg";
1165
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1166
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1167
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1168
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1169
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1170
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1171
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1172
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1173
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1174
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1175
-
1176
-        $post_info[] = array(
1177
-            "listing_type" => 'gd_place',
1178
-            "post_title" => 'Best Western Center City Hotel',
1179
-            "post_desc" => '
1141
+			"post_images" => $image_array,
1142
+			"post_category" => array('gd_placecategory' => array('Hotels')),
1143
+			"post_tags" => array(''),
1144
+			"geodir_video" => '',
1145
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
1146
+			"geodir_contact" => '(143) 888-8888',
1147
+			"geodir_email" => '[email protected]',
1148
+			"geodir_website" => 'http://www.alexanderinn.com/',
1149
+			"geodir_twitter" => 'http://twitter.com/alexanderinn',
1150
+			"geodir_facebook" => 'http://facebook.com/alexanderinn',
1151
+			"post_dummy" => '1'
1152
+		);
1153
+
1154
+		////post end///
1155
+		/// Hotels ////post start 8///
1156
+		break;
1157
+	case 19:
1158
+
1159
+
1160
+		$image_array = array();
1161
+		$post_meta = array();
1162
+
1163
+		/// Hotels ////post start 9///
1164
+		$image_array[] = "$dummy_image_url/hotels5.jpg";
1165
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1166
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1167
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1168
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1169
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1170
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1171
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1172
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1173
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1174
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1175
+
1176
+		$post_info[] = array(
1177
+			"listing_type" => 'gd_place',
1178
+			"post_title" => 'Best Western Center City Hotel',
1179
+			"post_desc" => '
1180 1180
 	The Alexander Inn is one of Philadelphia&acute;s most popular and reasonably priced small hotels.
1181 1181
 	
1182 1182
 	Conveniently located in the heart of the Washington Square West neighborhood in Center City Philadelphia, the Alexander Inn is a great place to base your stay in Philadelphia.
@@ -1185,91 +1185,91 @@  discard block
 block discarded – undo
1185 1185
 	
1186 1186
 	Rooms are also fitted with DirecTV (including many complimentary channels like CNN, ESPN, eight movie channels, etc.) and telephones with modem ports and direct dial. You will also have access to the hotel&acute;s free 24-hour fitness and e-mail centers.  
1187 1187
 	',
1188
-            "post_images" => $image_array,
1189
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1190
-            "post_tags" => array(''),
1191
-            "geodir_video" => '',
1192
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1193
-            "geodir_contact" => '(243) 222-12344',
1194
-            "geodir_email" => '[email protected]',
1195
-            "geodir_website" => 'http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=39087',
1196
-            "geodir_twitter" => 'http://twitter.com/bestwestern',
1197
-            "geodir_facebook" => 'http://facebook.com/bestwestern',
1198
-            "post_dummy" => '1'
1199
-        );
1200
-
1201
-        ////post end///
1202
-        /// Hotels ////post start 9///
1203
-        break;
1204
-    case 20:
1205
-
1206
-
1207
-        $image_array = array();
1208
-        $post_meta = array();
1209
-
1210
-        /// Hotels ////post start 10///
1211
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1212
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1213
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1214
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1215
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1216
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1217
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1218
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1219
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1220
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1221
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1222
-
1223
-        $post_info[] = array(
1224
-            "listing_type" => 'gd_place',
1225
-            "post_title" => 'Chestnut Hill Hotel',
1226
-            "post_desc" => '
1188
+			"post_images" => $image_array,
1189
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1190
+			"post_tags" => array(''),
1191
+			"geodir_video" => '',
1192
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1193
+			"geodir_contact" => '(243) 222-12344',
1194
+			"geodir_email" => '[email protected]',
1195
+			"geodir_website" => 'http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=39087',
1196
+			"geodir_twitter" => 'http://twitter.com/bestwestern',
1197
+			"geodir_facebook" => 'http://facebook.com/bestwestern',
1198
+			"post_dummy" => '1'
1199
+		);
1200
+
1201
+		////post end///
1202
+		/// Hotels ////post start 9///
1203
+		break;
1204
+	case 20:
1205
+
1206
+
1207
+		$image_array = array();
1208
+		$post_meta = array();
1209
+
1210
+		/// Hotels ////post start 10///
1211
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1212
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1213
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1214
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1215
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1216
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1217
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1218
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1219
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1220
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1221
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1222
+
1223
+		$post_info[] = array(
1224
+			"listing_type" => 'gd_place',
1225
+			"post_title" => 'Chestnut Hill Hotel',
1226
+			"post_desc" => '
1227 1227
 	The Chestnut Hill Hotel is located in the historic community of Chestnut Hill, approximately nine miles northwest from Center City Philadelphia. Although Chestnut Hill is close to Center City by today&acute;s standards, it was originally a distant “suburb” on the outskirts of the Philadelphia countryside.
1228 1228
 	
1229 1229
 	Today, it is one of the region&acute;s most charming neighborhoods. Tree-lined streets and grand estates surround its main street, Germantown Avenue, where you can stroll and shop at more than 200 specialty shops and restaurants, along with trendy salons and other modern boutiques.
1230 1230
 	
1231 1231
 	The Chestnut Hill Hotel fits perfectly in this setting - the hotel&acute;s 36 rooms and suites, decorated in an 18th-century style, hold the hotel to its boutique roots. It&acute;s a perfect place at which to enjoy a romantic getaway in Philadelphia. 
1232 1232
 	',
1233
-            "post_images" => $image_array,
1234
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
1235
-            "post_tags" => array(''),
1236
-            "geodir_video" => '',
1237
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1238
-            "geodir_contact" => '(243) 222-12344',
1239
-            "geodir_email" => '[email protected]',
1240
-            "geodir_website" => 'http://www.chestnuthillhotel.com/',
1241
-            "geodir_twitter" => 'http://twitter.com/chestnuthillhotel',
1242
-            "geodir_facebook" => 'http://facebook.com/chestnuthillhotel',
1243
-            "post_dummy" => '1'
1244
-        );
1245
-
1246
-        ////post end///
1247
-        /// Hotels ////post start 10///
1248
-
1249
-        break;
1250
-    case 21:
1251
-
1252
-
1253
-        $image_array = array();
1254
-        $post_meta = array();
1255
-
1256
-        /// Restaurants ////post start 1//
1257
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1258
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1259
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1260
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1261
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1262
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1263
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1264
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1265
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1266
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1267
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1268
-
1269
-        $post_info[] = array(
1270
-            "listing_type" => 'gd_place',
1271
-            "post_title" => 'Village Whiskey',
1272
-            "post_desc" => '
1233
+			"post_images" => $image_array,
1234
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
1235
+			"post_tags" => array(''),
1236
+			"geodir_video" => '',
1237
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1238
+			"geodir_contact" => '(243) 222-12344',
1239
+			"geodir_email" => '[email protected]',
1240
+			"geodir_website" => 'http://www.chestnuthillhotel.com/',
1241
+			"geodir_twitter" => 'http://twitter.com/chestnuthillhotel',
1242
+			"geodir_facebook" => 'http://facebook.com/chestnuthillhotel',
1243
+			"post_dummy" => '1'
1244
+		);
1245
+
1246
+		////post end///
1247
+		/// Hotels ////post start 10///
1248
+
1249
+		break;
1250
+	case 21:
1251
+
1252
+
1253
+		$image_array = array();
1254
+		$post_meta = array();
1255
+
1256
+		/// Restaurants ////post start 1//
1257
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1258
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1259
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1260
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1261
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1262
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1263
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1264
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1265
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1266
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1267
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1268
+
1269
+		$post_info[] = array(
1270
+			"listing_type" => 'gd_place',
1271
+			"post_title" => 'Village Whiskey',
1272
+			"post_desc" => '
1273 1273
 	
1274 1274
 	
1275 1275
 	Located in a Rittenhouse Square space evoking the free-wheeling spirit of a speakeasy, Village Whiskey is prolific Chef Jose Garces’ intimate, 30-seat tribute to the time-honored liquor.
@@ -1295,45 +1295,45 @@  discard block
 block discarded – undo
1295 1295
 	
1296 1296
 	During the warmer months, diners can sit at large, wooden tables placed along Sansom Street for whiskey alfresco.
1297 1297
 	',
1298
-            "post_images" => $image_array,
1299
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Feature')),
1300
-            "post_tags" => array('Sample Tag1'),
1301
-            "geodir_video" => '',
1302
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1303
-            "geodir_contact" => '(243) 222-12344',
1304
-            "geodir_email" => '[email protected]',
1305
-            "geodir_website" => 'http://www.villagewhiskey.com/',
1306
-            "geodir_twitter" => 'http://twitter.com/villagewhiskey',
1307
-            "geodir_facebook" => 'http://facebook.com/villagewhiskey',
1308
-            "post_dummy" => '1'
1309
-        );
1310
-
1311
-        ////post end///
1312
-        /// Restaurants ////post start 1///
1313
-        break;
1314
-    case 22:
1315
-
1316
-
1317
-        $image_array = array();
1318
-        $post_meta = array();
1319
-
1320
-        /// Restaurants ////post start 2//
1321
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1322
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1323
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1324
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1325
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1326
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1327
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1328
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1329
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1330
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1331
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1332
-
1333
-        $post_info[] = array(
1334
-            "listing_type" => 'gd_place',
1335
-            "post_title" => 'Zavino Pizzeria and Wine Bar',
1336
-            "post_desc" => '
1298
+			"post_images" => $image_array,
1299
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Feature')),
1300
+			"post_tags" => array('Sample Tag1'),
1301
+			"geodir_video" => '',
1302
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1303
+			"geodir_contact" => '(243) 222-12344',
1304
+			"geodir_email" => '[email protected]',
1305
+			"geodir_website" => 'http://www.villagewhiskey.com/',
1306
+			"geodir_twitter" => 'http://twitter.com/villagewhiskey',
1307
+			"geodir_facebook" => 'http://facebook.com/villagewhiskey',
1308
+			"post_dummy" => '1'
1309
+		);
1310
+
1311
+		////post end///
1312
+		/// Restaurants ////post start 1///
1313
+		break;
1314
+	case 22:
1315
+
1316
+
1317
+		$image_array = array();
1318
+		$post_meta = array();
1319
+
1320
+		/// Restaurants ////post start 2//
1321
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1322
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1323
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1324
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1325
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1326
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1327
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1328
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1329
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1330
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1331
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1332
+
1333
+		$post_info[] = array(
1334
+			"listing_type" => 'gd_place',
1335
+			"post_title" => 'Zavino Pizzeria and Wine Bar',
1336
+			"post_desc" => '
1337 1337
 	Zavino is a new pizzeria and wine bar located at the epicenter of the city&acute;s trendy Midtown Village neighborhood. The restaurant features a seasonal menu, classic cocktails, an approachable selection of wine and beer and some of the best late night menu offerings in the area.
1338 1338
 	
1339 1339
 	The restaurant&acute;s interior looks great - it has a simple, rustic feel with an original brick wall, large picture windows, a long bar and a large outdoor cafe coming this spring.
@@ -1352,46 +1352,46 @@  discard block
 block discarded – undo
1352 1352
 	
1353 1353
 	Pizzas vary in price from $8 to $12.
1354 1354
 	',
1355
-            "post_images" => $image_array,
1356
-            "post_category" => array('gd_placecategory' => array('Restaurants')),
1357
-            "post_tags" => array('Sample Tag1'),
1358
-            "geodir_video" => '',
1359
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1360
-            "geodir_contact" => '(243) 222-12344',
1361
-            "geodir_email" => '[email protected]',
1362
-            "geodir_website" => 'http://www.villagewhiskey.com/',
1363
-            "geodir_twitter" => 'http://twitter.com/villagewhiskey',
1364
-            "geodir_facebook" => 'http://facebook.com/villagewhiskey',
1365
-            "post_dummy" => '1'
1366
-        );
1367
-
1368
-        ////post end///
1369
-        /// Restaurants ////post start 2///
1370
-
1371
-        break;
1372
-    case 23:
1373
-
1374
-
1375
-        $image_array = array();
1376
-        $post_meta = array();
1377
-
1378
-        /// Restaurants ////post start 3//
1379
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1380
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1381
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1382
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1383
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1384
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1385
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1386
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1387
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1388
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1389
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1390
-
1391
-        $post_info[] = array(
1392
-            "listing_type" => 'gd_place',
1393
-            "post_title" => 'Parc',
1394
-            "post_desc" => '
1355
+			"post_images" => $image_array,
1356
+			"post_category" => array('gd_placecategory' => array('Restaurants')),
1357
+			"post_tags" => array('Sample Tag1'),
1358
+			"geodir_video" => '',
1359
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1360
+			"geodir_contact" => '(243) 222-12344',
1361
+			"geodir_email" => '[email protected]',
1362
+			"geodir_website" => 'http://www.villagewhiskey.com/',
1363
+			"geodir_twitter" => 'http://twitter.com/villagewhiskey',
1364
+			"geodir_facebook" => 'http://facebook.com/villagewhiskey',
1365
+			"post_dummy" => '1'
1366
+		);
1367
+
1368
+		////post end///
1369
+		/// Restaurants ////post start 2///
1370
+
1371
+		break;
1372
+	case 23:
1373
+
1374
+
1375
+		$image_array = array();
1376
+		$post_meta = array();
1377
+
1378
+		/// Restaurants ////post start 3//
1379
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1380
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1381
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1382
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1383
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1384
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1385
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1386
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1387
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1388
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1389
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1390
+
1391
+		$post_info[] = array(
1392
+			"listing_type" => 'gd_place',
1393
+			"post_title" => 'Parc',
1394
+			"post_desc" => '
1395 1395
 	If you love Paris in the springtime, Parc is a veritable grand cru.
1396 1396
 	
1397 1397
 	With Parc, famed restaurateur Stephen Starr brings a certain je ne sais quoi to Rittenhouse Square. Parc offers an authentic French bistro experience, fully equipped with a chic Parisian ambiance and gorgeous sidewalk seating overlooking the Square.
@@ -1419,45 +1419,45 @@  discard block
 block discarded – undo
1419 1419
 	
1420 1420
 	To put it simply, Parc is nothing short of an authentic Parisian dining experience - right here in the heart of Rittenhouse Square.
1421 1421
 	',
1422
-            "post_images" => $image_array,
1423
-            "post_category" => array('gd_placecategory' => array('Restaurants')),
1424
-            "post_tags" => array('Sample Tag1'),
1425
-            "geodir_video" => '',
1426
-            "geodir_timing" => 'Daily : 10 am to 12 pm',
1427
-            "geodir_contact" => '(143) 222-12344',
1428
-            "geodir_email" => '[email protected]',
1429
-            "geodir_website" => 'http://www.parc-restaurant.com/',
1430
-            "geodir_twitter" => 'http://twitter.com/parc-restaurant',
1431
-            "geodir_facebook" => 'http://facebook.com/parc-restaurant',
1432
-            "post_dummy" => '1'
1433
-        );
1434
-
1435
-        ////post end///
1436
-        /// Restaurants ////post start 3///
1437
-        break;
1438
-    case 24:
1439
-
1440
-
1441
-        $image_array = array();
1442
-        $post_meta = array();
1443
-
1444
-        /// Restaurants ////post start 4//
1445
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1446
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1447
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1448
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1449
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1450
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1451
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1452
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1453
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1454
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1455
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1456
-
1457
-        $post_info[] = array(
1458
-            "listing_type" => 'gd_place',
1459
-            "post_title" => 'Percy Street Barbecue',
1460
-            "post_desc" => '
1422
+			"post_images" => $image_array,
1423
+			"post_category" => array('gd_placecategory' => array('Restaurants')),
1424
+			"post_tags" => array('Sample Tag1'),
1425
+			"geodir_video" => '',
1426
+			"geodir_timing" => 'Daily : 10 am to 12 pm',
1427
+			"geodir_contact" => '(143) 222-12344',
1428
+			"geodir_email" => '[email protected]',
1429
+			"geodir_website" => 'http://www.parc-restaurant.com/',
1430
+			"geodir_twitter" => 'http://twitter.com/parc-restaurant',
1431
+			"geodir_facebook" => 'http://facebook.com/parc-restaurant',
1432
+			"post_dummy" => '1'
1433
+		);
1434
+
1435
+		////post end///
1436
+		/// Restaurants ////post start 3///
1437
+		break;
1438
+	case 24:
1439
+
1440
+
1441
+		$image_array = array();
1442
+		$post_meta = array();
1443
+
1444
+		/// Restaurants ////post start 4//
1445
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1446
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1447
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1448
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1449
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1450
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1451
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1452
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1453
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1454
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1455
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1456
+
1457
+		$post_info[] = array(
1458
+			"listing_type" => 'gd_place',
1459
+			"post_title" => 'Percy Street Barbecue',
1460
+			"post_desc" => '
1461 1461
 	Percy Street Barbecue sees the South Street debut of restaurateurs Steven Cook and Michael Solomonov (Zahav, Xochitl).
1462 1462
 	
1463 1463
 	Serving a straightforward selection of slowly smoked meats and homey side dishes alongside craft beers and tasty cocktails, Percy Street is an ideal venue for Chef Erin OShea much-lauded Southern cooking, and is on its way to become the city top spot for barbecue.
@@ -1483,46 +1483,46 @@  discard block
 block discarded – undo
1483 1483
 	
1484 1484
 	Seating in the form of repurposed church pews, and bare light bulbs overhead in the dining room lend to the restaurant Texas-esque aesthetic.
1485 1485
 	',
1486
-            "post_images" => $image_array,
1487
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Feature')),
1488
-            "post_tags" => array('Sample Tag1'),
1489
-            "geodir_video" => '',
1490
-            "geodir_timing" => 'Percy Street is closed on Mondays. The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1491
-            "geodir_contact" => '(143) 222-12344',
1492
-            "geodir_email" => '[email protected]',
1493
-            "geodir_website" => 'http://www.percystreet.com/',
1494
-            "geodir_twitter" => 'http://twitter.com/percystreet',
1495
-            "geodir_facebook" => 'http://facebook.com/percystreet',
1496
-            "post_dummy" => '1'
1497
-        );
1498
-
1499
-        ////post end///
1500
-        /// Restaurants ////post start 4///
1501
-
1502
-        break;
1503
-    case 25:
1504
-
1505
-
1506
-        $image_array = array();
1507
-        $post_meta = array();
1508
-
1509
-        /// Restaurants ////post start 5//
1510
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1511
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1512
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1513
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1514
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1515
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1516
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1517
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1518
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1519
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1520
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1521
-
1522
-        $post_info[] = array(
1523
-            "listing_type" => 'gd_place',
1524
-            "post_title" => 'The Fountain Restaurant',
1525
-            "post_desc" => '
1486
+			"post_images" => $image_array,
1487
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Feature')),
1488
+			"post_tags" => array('Sample Tag1'),
1489
+			"geodir_video" => '',
1490
+			"geodir_timing" => 'Percy Street is closed on Mondays. The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1491
+			"geodir_contact" => '(143) 222-12344',
1492
+			"geodir_email" => '[email protected]',
1493
+			"geodir_website" => 'http://www.percystreet.com/',
1494
+			"geodir_twitter" => 'http://twitter.com/percystreet',
1495
+			"geodir_facebook" => 'http://facebook.com/percystreet',
1496
+			"post_dummy" => '1'
1497
+		);
1498
+
1499
+		////post end///
1500
+		/// Restaurants ////post start 4///
1501
+
1502
+		break;
1503
+	case 25:
1504
+
1505
+
1506
+		$image_array = array();
1507
+		$post_meta = array();
1508
+
1509
+		/// Restaurants ////post start 5//
1510
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1511
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1512
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1513
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1514
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1515
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1516
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1517
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1518
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1519
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1520
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1521
+
1522
+		$post_info[] = array(
1523
+			"listing_type" => 'gd_place',
1524
+			"post_title" => 'The Fountain Restaurant',
1525
+			"post_desc" => '
1526 1526
 	The Fountain Restaurant in the Four Seasons Hotel Philadelphia has received seemingly every type of accolade there is, from top honors in Gourmet magazine to Forbes Travel Guide&acute;s 2010 Five Star award to a perfect Five Diamond rating from AAA. It&acute;s been a Philadelphia favorite for special occasion meals for decades.
1527 1527
 	
1528 1528
 	Additionally rated as the best restaurant in Philadelphia by Zagat&acute;s, the Fountain Restaurant overlooks the majestic Swann Memorial Fountain sculpture by Alexander Stirling Calder in the center of Logan Square. You&acute;ll also enjoy sweeping views of the grand Benjamin Franklin Parkway and its gorgeous Beaux Arts architecture.
@@ -1532,45 +1532,45 @@  discard block
 block discarded – undo
1532 1532
 	You can order a la carte or select the prix fix option to enjoy the “spontaneous tastes” menu which gives the chef control of a few courses. The menu changes regularly, but you can expect to see globaly influenced items like Pan-fried Veal Sweetbreads, Braised Dover Sole Roulade, Sautéed Venison Medallions and Roasted Australian Lamb Saddle.
1533 1533
 	
1534 1534
 	',
1535
-            "post_images" => $image_array,
1536
-            "post_category" => array('gd_placecategory' => array('Restaurants')),
1537
-            "post_tags" => array('food'),
1538
-            "geodir_video" => '',
1539
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1540
-            "geodir_contact" => '(103) 100-12344',
1541
-            "geodir_email" => '[email protected]',
1542
-            "geodir_website" => 'http://www.fourseasons.com/philadelphia/dining',
1543
-            "geodir_twitter" => 'http://twitter.com/fourseasons',
1544
-            "geodir_facebook" => 'http://facebook.com/fourseasons',
1545
-            "post_dummy" => '1'
1546
-        );
1547
-
1548
-        ////post end///
1549
-        /// Restaurants ////post start 5///
1550
-        break;
1551
-    case 26:
1552
-
1553
-
1554
-        $image_array = array();
1555
-        $post_meta = array();
1556
-
1557
-        /// Restaurants ////post start 6//
1558
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1559
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1560
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1561
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1562
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1563
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1564
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1565
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1566
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1567
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1568
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1569
-
1570
-        $post_info[] = array(
1571
-            "listing_type" => 'gd_place',
1572
-            "post_title" => 'Lacroix at The Rittenhouse',
1573
-            "post_desc" => '
1535
+			"post_images" => $image_array,
1536
+			"post_category" => array('gd_placecategory' => array('Restaurants')),
1537
+			"post_tags" => array('food'),
1538
+			"geodir_video" => '',
1539
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1540
+			"geodir_contact" => '(103) 100-12344',
1541
+			"geodir_email" => '[email protected]',
1542
+			"geodir_website" => 'http://www.fourseasons.com/philadelphia/dining',
1543
+			"geodir_twitter" => 'http://twitter.com/fourseasons',
1544
+			"geodir_facebook" => 'http://facebook.com/fourseasons',
1545
+			"post_dummy" => '1'
1546
+		);
1547
+
1548
+		////post end///
1549
+		/// Restaurants ////post start 5///
1550
+		break;
1551
+	case 26:
1552
+
1553
+
1554
+		$image_array = array();
1555
+		$post_meta = array();
1556
+
1557
+		/// Restaurants ////post start 6//
1558
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1559
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1560
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1561
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1562
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1563
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1564
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1565
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1566
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1567
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1568
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1569
+
1570
+		$post_info[] = array(
1571
+			"listing_type" => 'gd_place',
1572
+			"post_title" => 'Lacroix at The Rittenhouse',
1573
+			"post_desc" => '
1574 1574
 	A deluxe hotel like The Rittenhouse deserves a deluxe restaurant, a fitting description for Lacroix, named “Restaurant of the Year” in 2003 by Esquire magazine.
1575 1575
 	
1576 1576
 	Located on the second floor of the Rittenhouse Hotel, Lacroix features elegant décor and a broad view of Rittenhouse Square, which combine to make the ambiance at Lacroix as enjoyable as the meal itself.
@@ -1581,46 +1581,46 @@  discard block
 block discarded – undo
1581 1581
 	
1582 1582
 	Sunday Brunch at Lacroix - which features such delectable dishes as baby lamb chops with garlic crust and banyuls sauce, niman ranch smoked bacon, quail eggs with artichoke, golden beet and shiitakes, and french baguette toast with apple, raspberry and rosemary jam - is also highly recommended.
1583 1583
 	',
1584
-            "post_images" => $image_array,
1585
-            "post_category" => array('gd_placecategory' => array('Restaurants')),
1586
-            "post_tags" => array('food'),
1587
-            "geodir_video" => '',
1588
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1589
-            "geodir_contact" => '(113) 121-12344',
1590
-            "geodir_email" => '[email protected]',
1591
-            "geodir_website" => 'http://www.rittenhousehotel.com/lacroix.cfm',
1592
-            "geodir_twitter" => 'http://twitter.com/rittenhousehotel',
1593
-            "geodir_facebook" => 'http://facebook.com/rittenhousehotel',
1594
-            "post_dummy" => '1'
1595
-        );
1596
-
1597
-        ////post end///
1598
-        /// Restaurants ////post start 6///
1599
-
1600
-        break;
1601
-    case 27:
1602
-
1603
-
1604
-        $image_array = array();
1605
-        $post_meta = array();
1606
-
1607
-        /// Restaurants ////post start 7//
1608
-        $image_array[] = "$dummy_image_url/restaurants12.jpg";
1609
-        $image_array[] = "$dummy_image_url/restaurants13.jpg";
1610
-        $image_array[] = "$dummy_image_url/restaurants14.jpg";
1611
-        $image_array[] = "$dummy_image_url/restaurants15.jpg";
1612
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1613
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1614
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1615
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1616
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1617
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1618
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1619
-
1620
-        $post_info[] = array(
1621
-            "listing_type" => 'gd_place',
1622
-            "post_title" => 'Lacroix at The Rittenhouse',
1623
-            "post_desc" => '
1584
+			"post_images" => $image_array,
1585
+			"post_category" => array('gd_placecategory' => array('Restaurants')),
1586
+			"post_tags" => array('food'),
1587
+			"geodir_video" => '',
1588
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1589
+			"geodir_contact" => '(113) 121-12344',
1590
+			"geodir_email" => '[email protected]',
1591
+			"geodir_website" => 'http://www.rittenhousehotel.com/lacroix.cfm',
1592
+			"geodir_twitter" => 'http://twitter.com/rittenhousehotel',
1593
+			"geodir_facebook" => 'http://facebook.com/rittenhousehotel',
1594
+			"post_dummy" => '1'
1595
+		);
1596
+
1597
+		////post end///
1598
+		/// Restaurants ////post start 6///
1599
+
1600
+		break;
1601
+	case 27:
1602
+
1603
+
1604
+		$image_array = array();
1605
+		$post_meta = array();
1606
+
1607
+		/// Restaurants ////post start 7//
1608
+		$image_array[] = "$dummy_image_url/restaurants12.jpg";
1609
+		$image_array[] = "$dummy_image_url/restaurants13.jpg";
1610
+		$image_array[] = "$dummy_image_url/restaurants14.jpg";
1611
+		$image_array[] = "$dummy_image_url/restaurants15.jpg";
1612
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1613
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1614
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1615
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1616
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1617
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1618
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1619
+
1620
+		$post_info[] = array(
1621
+			"listing_type" => 'gd_place',
1622
+			"post_title" => 'Lacroix at The Rittenhouse',
1623
+			"post_desc" => '
1624 1624
 	A deluxe hotel like The Rittenhouse deserves a deluxe restaurant, a fitting description for Lacroix, named “Restaurant of the Year” in 2003 by Esquire magazine.
1625 1625
 	
1626 1626
 	Located on the second floor of the Rittenhouse Hotel, Lacroix features elegant décor and a broad view of Rittenhouse Square, which combine to make the ambiance at Lacroix as enjoyable as the meal itself.
@@ -1631,45 +1631,45 @@  discard block
 block discarded – undo
1631 1631
 	
1632 1632
 	Sunday Brunch at Lacroix - which features such delectable dishes as baby lamb chops with garlic crust and banyuls sauce, niman ranch smoked bacon, quail eggs with artichoke, golden beet and shiitakes, and french baguette toast with apple, raspberry and rosemary jam - is also highly recommended.
1633 1633
 	',
1634
-            "post_images" => $image_array,
1635
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1636
-            "post_tags" => array('food'),
1637
-            "geodir_video" => '',
1638
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1639
-            "geodir_contact" => '(113) 121-12344',
1640
-            "geodir_email" => '[email protected]',
1641
-            "geodir_website" => 'http://www.zamarestaurant.com/',
1642
-            "geodir_twitter" => 'http://twitter.com/zamarestaurant',
1643
-            "geodir_facebook" => 'http://facebook.com/zamarestaurant',
1644
-            "post_dummy" => '1'
1645
-        );
1646
-
1647
-        ////post end///
1648
-        /// Restaurants ////post start 7///
1649
-
1650
-        break;
1651
-    case 28:
1652
-
1653
-        $image_array = array();
1654
-        $post_meta = array();
1655
-
1656
-        /// Restaurants ////post start 8//
1657
-        $image_array[] = "$dummy_image_url/restaurants16.jpg";
1658
-        $image_array[] = "$dummy_image_url/restaurants17.jpg";
1659
-        $image_array[] = "$dummy_image_url/restaurants18.jpg";
1660
-        $image_array[] = "$dummy_image_url/restaurants19.jpg";
1661
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1662
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1663
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1664
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1665
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1666
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1667
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1668
-
1669
-        $post_info[] = array(
1670
-            "listing_type" => 'gd_place',
1671
-            "post_title" => 'Sampan',
1672
-            "post_desc" => '
1634
+			"post_images" => $image_array,
1635
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1636
+			"post_tags" => array('food'),
1637
+			"geodir_video" => '',
1638
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1639
+			"geodir_contact" => '(113) 121-12344',
1640
+			"geodir_email" => '[email protected]',
1641
+			"geodir_website" => 'http://www.zamarestaurant.com/',
1642
+			"geodir_twitter" => 'http://twitter.com/zamarestaurant',
1643
+			"geodir_facebook" => 'http://facebook.com/zamarestaurant',
1644
+			"post_dummy" => '1'
1645
+		);
1646
+
1647
+		////post end///
1648
+		/// Restaurants ////post start 7///
1649
+
1650
+		break;
1651
+	case 28:
1652
+
1653
+		$image_array = array();
1654
+		$post_meta = array();
1655
+
1656
+		/// Restaurants ////post start 8//
1657
+		$image_array[] = "$dummy_image_url/restaurants16.jpg";
1658
+		$image_array[] = "$dummy_image_url/restaurants17.jpg";
1659
+		$image_array[] = "$dummy_image_url/restaurants18.jpg";
1660
+		$image_array[] = "$dummy_image_url/restaurants19.jpg";
1661
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1662
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1663
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1664
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1665
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1666
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1667
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1668
+
1669
+		$post_info[] = array(
1670
+			"listing_type" => 'gd_place',
1671
+			"post_title" => 'Sampan',
1672
+			"post_desc" => '
1673 1673
 	Chef and charismatic television star Michael Schulson returns to Philadelphia with the opening of Sampan, a modern Asian restaurant where he serves the acclaimed cuisine that has made him one of the country&acute;s highly sought-after culinary talents.
1674 1674
 	
1675 1675
 	Schulson returns to Philadelphia after having opened Buddakan in New York City for Stephen Starr and Izakaya at the Borgata in Atlantic City and then having gone on to star in Style network&acute;s popular series Pantry Raid and TLC Ultimate Cake Off.
@@ -1688,45 +1688,45 @@  discard block
 block discarded – undo
1688 1688
 	
1689 1689
 	Prices range from $5 to $19.
1690 1690
 	',
1691
-            "post_images" => $image_array,
1692
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1693
-            "post_tags" => array('restaurant'),
1694
-            "geodir_video" => '',
1695
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1696
-            "geodir_contact" => '(000) 111-2222',
1697
-            "geodir_email" => '[email protected]',
1698
-            "geodir_website" => 'http://www.sampanphilly.com/',
1699
-            "geodir_twitter" => 'http://twitter.com/sampanphilly',
1700
-            "geodir_facebook" => 'http://facebook.com/sampanphilly',
1701
-            "post_dummy" => '1'
1702
-        );
1703
-
1704
-        ////post end///
1705
-        /// Restaurants ////post start 8///
1706
-
1707
-        break;
1708
-    case 29:
1709
-
1710
-        $image_array = array();
1711
-        $post_meta = array();
1712
-
1713
-        /// Restaurants ////post start 9//
1714
-        $image_array[] = "$dummy_image_url/restaurants17.jpg";
1715
-        $image_array[] = "$dummy_image_url/restaurants16.jpg";
1716
-        $image_array[] = "$dummy_image_url/restaurants18.jpg";
1717
-        $image_array[] = "$dummy_image_url/restaurants19.jpg";
1718
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1719
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1720
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1721
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1722
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1723
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1724
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1725
-
1726
-        $post_info[] = array(
1727
-            "listing_type" => 'gd_place',
1728
-            "post_title" => 'Morimoto',
1729
-            "post_desc" => '
1691
+			"post_images" => $image_array,
1692
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1693
+			"post_tags" => array('restaurant'),
1694
+			"geodir_video" => '',
1695
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1696
+			"geodir_contact" => '(000) 111-2222',
1697
+			"geodir_email" => '[email protected]',
1698
+			"geodir_website" => 'http://www.sampanphilly.com/',
1699
+			"geodir_twitter" => 'http://twitter.com/sampanphilly',
1700
+			"geodir_facebook" => 'http://facebook.com/sampanphilly',
1701
+			"post_dummy" => '1'
1702
+		);
1703
+
1704
+		////post end///
1705
+		/// Restaurants ////post start 8///
1706
+
1707
+		break;
1708
+	case 29:
1709
+
1710
+		$image_array = array();
1711
+		$post_meta = array();
1712
+
1713
+		/// Restaurants ////post start 9//
1714
+		$image_array[] = "$dummy_image_url/restaurants17.jpg";
1715
+		$image_array[] = "$dummy_image_url/restaurants16.jpg";
1716
+		$image_array[] = "$dummy_image_url/restaurants18.jpg";
1717
+		$image_array[] = "$dummy_image_url/restaurants19.jpg";
1718
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1719
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1720
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1721
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1722
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1723
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1724
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1725
+
1726
+		$post_info[] = array(
1727
+			"listing_type" => 'gd_place',
1728
+			"post_title" => 'Morimoto',
1729
+			"post_desc" => '
1730 1730
 	Stephen Starr creative Japanese restaurant has garnered all kinds of national and international attention since opening a few years back. Located a block from Independence Hall on Chestnut Street, Morimoto has an interior - awash in glass and colors - that is both striking and serene in its design.
1731 1731
 	
1732 1732
 	The restaurant&acute;s namesake and head chef, Morimoto (of Food Network&acute;s Iron Chef fame), has created a menu offering the very best in contemporary Japanese cusine. While regulars flock here for the exquisitely prepared sushi, Morimoto offers diners a broad spectrum of flavors that delve beyond nigiri and sashimi.
@@ -1739,45 +1739,45 @@  discard block
 block discarded – undo
1739 1739
 	
1740 1740
 	The mezzanine level lounge is a great spot to have a pre-meal cocktail while waiting for your table. You can enjoy a sake or try a “Sakura” - a cosmo made with Sake - in the sleek space that overlooks the brilliant restaurant below.
1741 1741
 	',
1742
-            "post_images" => $image_array,
1743
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife', 'Feature')),
1744
-            "post_tags" => array('America'),
1745
-            "geodir_video" => '',
1746
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1747
-            "geodir_contact" => '(000) 111-2222',
1748
-            "geodir_email" => '[email protected]',
1749
-            "geodir_website" => 'http://www.morimotorestaurant.com/',
1750
-            "geodir_twitter" => 'http://twitter.com/morimotorestaurant',
1751
-            "geodir_facebook" => 'http://facebook.com/morimotorestaurant',
1752
-            "post_dummy" => '1'
1753
-        );
1754
-
1755
-        ////post end///
1756
-        /// Restaurants ////post start 9///
1757
-        break;
1758
-    case 30:
1759
-
1760
-
1761
-        $image_array = array();
1762
-        $post_meta = array();
1763
-
1764
-        /// Restaurants ////post start 10//
1765
-        $image_array[] = "$dummy_image_url/restaurants19.jpg";
1766
-        $image_array[] = "$dummy_image_url/restaurants17.jpg";
1767
-        $image_array[] = "$dummy_image_url/restaurants18.jpg";
1768
-        $image_array[] = "$dummy_image_url/restaurants16.jpg";
1769
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1770
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1771
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1772
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1773
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1774
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1775
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1776
-
1777
-        $post_info[] = array(
1778
-            "listing_type" => 'gd_place',
1779
-            "post_title" => 'Buddakan',
1780
-            "post_desc" => '
1742
+			"post_images" => $image_array,
1743
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife', 'Feature')),
1744
+			"post_tags" => array('America'),
1745
+			"geodir_video" => '',
1746
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1747
+			"geodir_contact" => '(000) 111-2222',
1748
+			"geodir_email" => '[email protected]',
1749
+			"geodir_website" => 'http://www.morimotorestaurant.com/',
1750
+			"geodir_twitter" => 'http://twitter.com/morimotorestaurant',
1751
+			"geodir_facebook" => 'http://facebook.com/morimotorestaurant',
1752
+			"post_dummy" => '1'
1753
+		);
1754
+
1755
+		////post end///
1756
+		/// Restaurants ////post start 9///
1757
+		break;
1758
+	case 30:
1759
+
1760
+
1761
+		$image_array = array();
1762
+		$post_meta = array();
1763
+
1764
+		/// Restaurants ////post start 10//
1765
+		$image_array[] = "$dummy_image_url/restaurants19.jpg";
1766
+		$image_array[] = "$dummy_image_url/restaurants17.jpg";
1767
+		$image_array[] = "$dummy_image_url/restaurants18.jpg";
1768
+		$image_array[] = "$dummy_image_url/restaurants16.jpg";
1769
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1770
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1771
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1772
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1773
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1774
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1775
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1776
+
1777
+		$post_info[] = array(
1778
+			"listing_type" => 'gd_place',
1779
+			"post_title" => 'Buddakan',
1780
+			"post_desc" => '
1781 1781
 	<h3>The Experience </h3>
1782 1782
 	
1783 1783
 	A towering gilded statue of the Buddha generates elegant calm in this 175-seat, Pan Asian restaurant with sleek, modern decor. Immensely popular, Buddakan is a restaurant that is great for both large parties and intimate dinners.
@@ -1788,86 +1788,86 @@  discard block
 block discarded – undo
1788 1788
 	
1789 1789
 	Be sure to make your reservation before coming to town as Buddakan fills up quickly especially on weekends. Better yet, make your reservation right now .
1790 1790
 	',
1791
-            "post_images" => $image_array,
1792
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1793
-            "post_tags" => array('America'),
1794
-            "geodir_video" => '',
1795
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1796
-            "geodir_contact" => '(000) 111-2222',
1797
-            "geodir_email" => '[email protected]',
1798
-            "geodir_website" => 'http://www.buddakan.com/',
1799
-            "geodir_twitter" => 'http://twitter.com/buddakan',
1800
-            "geodir_facebook" => 'http://facebook.com/buddakan',
1801
-            "post_dummy" => '1'
1802
-        );
1803
-        break;
1804
-
1805
-    ////post end///
1806
-    /// Restaurants ////post start 10///
1791
+			"post_images" => $image_array,
1792
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1793
+			"post_tags" => array('America'),
1794
+			"geodir_video" => '',
1795
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1796
+			"geodir_contact" => '(000) 111-2222',
1797
+			"geodir_email" => '[email protected]',
1798
+			"geodir_website" => 'http://www.buddakan.com/',
1799
+			"geodir_twitter" => 'http://twitter.com/buddakan',
1800
+			"geodir_facebook" => 'http://facebook.com/buddakan',
1801
+			"post_dummy" => '1'
1802
+		);
1803
+		break;
1804
+
1805
+	////post end///
1806
+	/// Restaurants ////post start 10///
1807 1807
 } // end of switch
1808 1808
 
1809 1809
 
1810 1810
 foreach ($post_info as $post_info) {
1811
-    $default_location = geodir_get_default_location();
1812
-    if ($city_bound_lat1 > $city_bound_lat2)
1813
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1814
-    else
1815
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1811
+	$default_location = geodir_get_default_location();
1812
+	if ($city_bound_lat1 > $city_bound_lat2)
1813
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1814
+	else
1815
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1816 1816
 
1817 1817
 
1818
-    if ($city_bound_lng1 > $city_bound_lng2)
1819
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1820
-    else
1821
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1818
+	if ($city_bound_lng1 > $city_bound_lng2)
1819
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1820
+	else
1821
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1822 1822
 
1823
-    $load_map = get_option('geodir_load_map');
1823
+	$load_map = get_option('geodir_load_map');
1824 1824
     
1825
-    if ($load_map == 'osm') {
1826
-        $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1827
-    } else {
1828
-        $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1829
-    }
1830
-
1831
-    $postal_code = '';
1832
-    if (!empty($post_address)) {
1833
-        if ($load_map == 'osm') {
1834
-            $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
1835
-            $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
1836
-        } else {
1837
-            $addresses = array();
1838
-            $addresses_default = array();
1825
+	if ($load_map == 'osm') {
1826
+		$post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1827
+	} else {
1828
+		$post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1829
+	}
1830
+
1831
+	$postal_code = '';
1832
+	if (!empty($post_address)) {
1833
+		if ($load_map == 'osm') {
1834
+			$address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
1835
+			$postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
1836
+		} else {
1837
+			$addresses = array();
1838
+			$addresses_default = array();
1839 1839
             
1840
-            foreach ($post_address as $add_key => $add_value) {
1841
-                if ($add_key < 2 && !empty($add_value->long_name)) {
1842
-                    $addresses_default[] = $add_value->long_name;
1843
-                }
1844
-                if ($add_value->types[0] == 'postal_code') {
1845
-                    $postal_code = $add_value->long_name;
1846
-                }
1847
-                if ($add_value->types[0] == 'street_number') {
1848
-                    $addresses[] = $add_value->long_name;
1849
-                }
1850
-                if ($add_value->types[0] == 'route') {
1851
-                    $addresses[] = $add_value->long_name;
1852
-                }
1853
-                if ($add_value->types[0] == 'neighborhood') {
1854
-                    $addresses[] = $add_value->long_name;
1855
-                }
1856
-                if ($add_value->types[0] == 'sublocality') {
1857
-                    $addresses[] = $add_value->long_name;
1858
-                }
1859
-            }
1860
-            $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1861
-        }
1862
-
1863
-        $post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1864
-        $post_info['post_city'] = $default_location->city;
1865
-        $post_info['post_region'] = $default_location->region;
1866
-        $post_info['post_country'] = $default_location->country;
1867
-        $post_info['post_zip'] = $postal_code;
1868
-        $post_info['post_latitude'] = $dummy_post_latitude;
1869
-        $post_info['post_longitude'] = $dummy_post_longitude;
1870
-    }
1840
+			foreach ($post_address as $add_key => $add_value) {
1841
+				if ($add_key < 2 && !empty($add_value->long_name)) {
1842
+					$addresses_default[] = $add_value->long_name;
1843
+				}
1844
+				if ($add_value->types[0] == 'postal_code') {
1845
+					$postal_code = $add_value->long_name;
1846
+				}
1847
+				if ($add_value->types[0] == 'street_number') {
1848
+					$addresses[] = $add_value->long_name;
1849
+				}
1850
+				if ($add_value->types[0] == 'route') {
1851
+					$addresses[] = $add_value->long_name;
1852
+				}
1853
+				if ($add_value->types[0] == 'neighborhood') {
1854
+					$addresses[] = $add_value->long_name;
1855
+				}
1856
+				if ($add_value->types[0] == 'sublocality') {
1857
+					$addresses[] = $add_value->long_name;
1858
+				}
1859
+			}
1860
+			$address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1861
+		}
1862
+
1863
+		$post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1864
+		$post_info['post_city'] = $default_location->city;
1865
+		$post_info['post_region'] = $default_location->region;
1866
+		$post_info['post_country'] = $default_location->country;
1867
+		$post_info['post_zip'] = $postal_code;
1868
+		$post_info['post_latitude'] = $dummy_post_latitude;
1869
+		$post_info['post_longitude'] = $dummy_post_longitude;
1870
+	}
1871 1871
     
1872
-    geodir_save_listing($post_info, true);
1872
+	geodir_save_listing($post_info, true);
1873 1873
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 $post_meta = array();
13 13
 
14 14
 if (geodir_dummy_folder_exists())
15
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
15
+    $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy";
16 16
 else
17 17
     $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
18 18
 
Please login to merge, or discard this patch.
Braces   +17 added lines, -14 removed lines patch added patch discarded remove patch
@@ -11,10 +11,11 @@  discard block
 block discarded – undo
11 11
 $image_array = array();
12 12
 $post_meta = array();
13 13
 
14
-if (geodir_dummy_folder_exists())
15
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
16
-else
17
-    $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
14
+if (geodir_dummy_folder_exists()) {
15
+    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
16
+} else {
17
+    $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
18
+}
18 19
 
19 20
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
20 21
 
@@ -1809,16 +1810,18 @@  discard block
 block discarded – undo
1809 1810
 
1810 1811
 foreach ($post_info as $post_info) {
1811 1812
     $default_location = geodir_get_default_location();
1812
-    if ($city_bound_lat1 > $city_bound_lat2)
1813
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1814
-    else
1815
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1816
-
1817
-
1818
-    if ($city_bound_lng1 > $city_bound_lng2)
1819
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1820
-    else
1821
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1813
+    if ($city_bound_lat1 > $city_bound_lat2) {
1814
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1815
+    } else {
1816
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1817
+    }
1818
+
1819
+
1820
+    if ($city_bound_lng1 > $city_bound_lng2) {
1821
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1822
+    } else {
1823
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1824
+    }
1822 1825
 
1823 1826
     $load_map = get_option('geodir_load_map');
1824 1827
     
Please login to merge, or discard this patch.
geodirectory-templates/listing-detail.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 // We are submitting iframes etc so we turn this off to allow them to show on preview.
13 13
 if(geodir_is_page('preview')){
14
-    header("X-XSS-Protection: 0");
14
+	header("X-XSS-Protection: 0");
15 15
 }
16 16
 
17 17
 
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 
39 39
 ###### SIDEBAR ON LEFT ######
40 40
 if (get_option('geodir_detail_sidebar_left_section')) {
41
-    /**
42
-     * Adds the details page sidebar to the details template page.
43
-     *
44
-     * @since 1.1.0
45
-     */
46
-    do_action('geodir_detail_sidebar');
41
+	/**
42
+	 * Adds the details page sidebar to the details template page.
43
+	 *
44
+	 * @since 1.1.0
45
+	 */
46
+	do_action('geodir_detail_sidebar');
47 47
 }
48 48
 
49 49
 ###### MAIN CONTENT WRAPPERS OPEN ######
@@ -72,29 +72,29 @@  discard block
 block discarded – undo
72 72
 // this call the main page content
73 73
 global $preview;
74 74
 if (have_posts() && !$preview) {
75
-    the_post();
76
-    global $post, $post_images;
77
-    /**
78
-     * Calls the details page main content on the details template page.
79
-     *
80
-     * @since 1.1.0
81
-     * @param object $post The current post object.
82
-     */
83
-    do_action('geodir_details_main_content', $post);
75
+	the_post();
76
+	global $post, $post_images;
77
+	/**
78
+	 * Calls the details page main content on the details template page.
79
+	 *
80
+	 * @since 1.1.0
81
+	 * @param object $post The current post object.
82
+	 */
83
+	do_action('geodir_details_main_content', $post);
84 84
 } elseif ($preview) {
85
-    /**
86
-     * Called on the details page if the page is being previewed.
87
-     *
88
-     * This sets the value of `$post` to the preview values before the main content is called.
89
-     *
90
-     * @since 1.1.0
91
-     */
92
-    do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
93
-    if (defined( 'GD_TESTING_MODE' )) {
94
-        global $post;
95
-    }
96
-    /** This action is documented in geodirectory-templates/listing-detail.php */
97
-    do_action('geodir_details_main_content', $post);
85
+	/**
86
+	 * Called on the details page if the page is being previewed.
87
+	 *
88
+	 * This sets the value of `$post` to the preview values before the main content is called.
89
+	 *
90
+	 * @since 1.1.0
91
+	 */
92
+	do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
93
+	if (defined( 'GD_TESTING_MODE' )) {
94
+		global $post;
95
+	}
96
+	/** This action is documented in geodirectory-templates/listing-detail.php */
97
+	do_action('geodir_details_main_content', $post);
98 98
 }
99 99
 
100 100
 /** This action is documented in geodirectory-templates/geodir-home.php */
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 
119 119
 ###### SIDEBAR ON RIGHT ######
120 120
 if (!get_option('geodir_detail_sidebar_left_section')) {
121
-    /** This action is documented in geodirectory-templates/listing-detail.php */
122
-    do_action('geodir_detail_sidebar');
121
+	/** This action is documented in geodirectory-templates/listing-detail.php */
122
+	do_action('geodir_detail_sidebar');
123 123
 }
124 124
 
125 125
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // We are submitting iframes etc so we turn this off to allow them to show on preview.
13
-if(geodir_is_page('preview')){
13
+if (geodir_is_page('preview')) {
14 14
     header("X-XSS-Protection: 0");
15 15
 }
16 16
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  * @param string $itemtype The itemtype value of the HTML element.
64 64
  * @see 'geodir_article_close'
65 65
  */
66
-do_action('geodir_article_open', 'details-page', 'post-' . get_the_ID(), get_post_class(), '');
66
+do_action('geodir_article_open', 'details-page', 'post-'.get_the_ID(), get_post_class(), '');
67 67
 
68 68
 ###### MAIN CONTENT ######
69 69
 /** This action is documented in geodirectory-templates/geodir-home.php */
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * @since 1.1.0
91 91
      */
92 92
     do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
93
-    if (defined( 'GD_TESTING_MODE' )) {
93
+    if (defined('GD_TESTING_MODE')) {
94 94
         global $post;
95 95
     }
96 96
     /** This action is documented in geodirectory-templates/listing-detail.php */
Please login to merge, or discard this patch.
geodirectory-functions/general_functions.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2301,7 +2301,7 @@  discard block
 block discarded – undo
2301 2301
  * @global string $table_prefix  WordPress Database Table prefix.
2302 2302
  *
2303 2303
  * @param array $query_args      The query array.
2304
- * @param  int|bool $count_only  If true returns listings count only, otherwise returns array
2304
+ * @param  boolean $count_only  If true returns listings count only, otherwise returns array
2305 2305
  *
2306 2306
  * @return mixed Result object.
2307 2307
  */
@@ -3958,7 +3958,7 @@  discard block
 block discarded – undo
3958 3958
  * @since   1.0.0
3959 3959
  * @since   1.6.1 Fixed add listing page load time.
3960 3960
  * @package GeoDirectory
3961
- * @return bool
3961
+ * @return null|boolean
3962 3962
  */
3963 3963
 function geodir_term_review_count_force_update( $new_status, $old_status = '', $post = '' ) {
3964 3964
 	if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'geodir_import_export' ) {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 			break;
302 302
 		case 'preview':
303 303
 			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_preview_page_id() ) && isset( $_REQUEST['listing_type'] )
304
-			     && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
304
+				 && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
305 305
 			) {
306 306
 				return true;
307 307
 			}
@@ -505,9 +505,9 @@  discard block
 block discarded – undo
505 505
 
506 506
 //check if homepage
507 507
 		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] )
508
-		     && ! isset( $wp->query_vars['page_id'] )
509
-		     && ! isset( $wp->query_vars['pagename'] )
510
-		     && is_page_geodir_home()
508
+			 && ! isset( $wp->query_vars['page_id'] )
509
+			 && ! isset( $wp->query_vars['pagename'] )
510
+			 && is_page_geodir_home()
511 511
 		) {
512 512
 			$wp->query_vars['gd_is_geodir_page'] = true;
513 513
 		}
@@ -692,8 +692,8 @@  discard block
 block discarded – undo
692 692
 		$deltaLatitude  = deg2rad( (float) $point2['latitude'] - (float) $point1['latitude'] );
693 693
 		$deltaLongitude = deg2rad( (float) $point2['longitude'] - (float) $point1['longitude'] );
694 694
 		$a              = sin( $deltaLatitude / 2 ) * sin( $deltaLatitude / 2 ) +
695
-		                  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
696
-		                  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
695
+						  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
696
+						  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
697 697
 		$c              = 2 * atan2( sqrt( $a ), sqrt( 1 - $a ) );
698 698
 		$distance       = $earthMeanRadius * $c;
699 699
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,10 @@  discard block
 block discarded – undo
29 29
 
30 30
 	if ( is_ssl() ) :
31 31
 		return str_replace( 'http://', 'https://', WP_PLUGIN_URL ) . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
32
-	else :
33
-		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
32
+	else {
33
+		:
34
+		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
35
+	}
34 36
 	endif;
35 37
 }
36 38
 
@@ -1496,12 +1498,14 @@  discard block
 block discarded – undo
1496 1498
 	 */
1497 1499
 	function geodir_allow_wpadmin() {
1498 1500
 		global $wpdb;
1499
-		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) // checking action in request to allow ajax request go through
1501
+		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) {
1502
+			// checking action in request to allow ajax request go through
1500 1503
 		{
1501 1504
 			if ( current_user_can( 'administrator' ) ) {
1502 1505
 			} else {
1503 1506
 
1504
-				wp_redirect( home_url() );
1507
+				wp_redirect( home_url() );
1508
+		}
1505 1509
 				exit;
1506 1510
 			}
1507 1511
 
Please login to merge, or discard this patch.
Spacing   +1338 added lines, -1338 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 /**
11 11
  * Get All Plugin functions from WordPress
12 12
  */
13
-include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
13
+include_once(ABSPATH.'wp-admin/includes/plugin.php');
14 14
 
15 15
 /*-----------------------------------------------------------------------------------*/
16 16
 /* Helper functions */
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function geodir_plugin_url() {
29 29
 
30
-	if ( is_ssl() ) :
31
-		return str_replace( 'http://', 'https://', WP_PLUGIN_URL ) . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
30
+	if (is_ssl()) :
31
+		return str_replace('http://', 'https://', WP_PLUGIN_URL)."/".plugin_basename(dirname(dirname(__FILE__)));
32 32
 	else :
33
-		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
33
+		return WP_PLUGIN_URL."/".plugin_basename(dirname(dirname(__FILE__)));
34 34
 	endif;
35 35
 }
36 36
 
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
  * @return string example url eg: /home/geo/public_html/wp-content/plugins/geodirectory
46 46
  */
47 47
 function geodir_plugin_path() {
48
-	if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
49
-		return dirname( dirname( __FILE__ ) );
48
+	if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) {
49
+		return dirname(dirname(__FILE__));
50 50
 	} else {
51
-		return WP_PLUGIN_DIR . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
51
+		return WP_PLUGIN_DIR."/".plugin_basename(dirname(dirname(__FILE__)));
52 52
 	}
53 53
 }
54 54
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
  * @return bool true or false.
64 64
  * @todo    check if this is faster than normal WP check and remove if not.
65 65
  */
66
-function geodir_is_plugin_active( $plugin ) {
67
-	$active_plugins = get_option( 'active_plugins' );
68
-	foreach ( $active_plugins as $key => $active_plugin ) {
69
-		if ( strstr( $active_plugin, $plugin ) ) {
66
+function geodir_is_plugin_active($plugin) {
67
+	$active_plugins = get_option('active_plugins');
68
+	foreach ($active_plugins as $key => $active_plugin) {
69
+		if (strstr($active_plugin, $plugin)) {
70 70
 			return true;
71 71
 		}
72 72
 	}
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
  *
89 89
  * @return bool|int|string the formatted date.
90 90
  */
91
-function geodir_get_formated_date( $date ) {
92
-	return mysql2date( get_option( 'date_format' ), $date );
91
+function geodir_get_formated_date($date) {
92
+	return mysql2date(get_option('date_format'), $date);
93 93
 }
94 94
 
95 95
 /**
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
  *
106 106
  * @return bool|int|string the formatted time.
107 107
  */
108
-function geodir_get_formated_time( $time ) {
109
-	return mysql2date( get_option( 'time_format' ), $time, $translate = true );
108
+function geodir_get_formated_time($time) {
109
+	return mysql2date(get_option('time_format'), $time, $translate = true);
110 110
 }
111 111
 
112 112
 
@@ -124,35 +124,35 @@  discard block
 block discarded – undo
124 124
  *
125 125
  * @return string Formatted link.
126 126
  */
127
-function geodir_getlink( $url, $params = array(), $use_existing_arguments = false ) {
128
-	if ( $use_existing_arguments ) {
127
+function geodir_getlink($url, $params = array(), $use_existing_arguments = false) {
128
+	if ($use_existing_arguments) {
129 129
 		$params = $params + $_GET;
130 130
 	}
131
-	if ( ! $params ) {
131
+	if (!$params) {
132 132
 		return $url;
133 133
 	}
134 134
 	$link = $url;
135
-	if ( strpos( $link, '?' ) === false ) {
135
+	if (strpos($link, '?') === false) {
136 136
 		$link .= '?';
137 137
 	} //If there is no '?' add one at the end
138
-	elseif ( strpos( $link, '//maps.google.com/maps/api/js?language=' ) ) {
138
+	elseif (strpos($link, '//maps.google.com/maps/api/js?language=')) {
139 139
 		$link .= '&amp;';
140 140
 	} //If there is no '&' at the END, add one.
141
-	elseif ( ! preg_match( '/(\?|\&(amp;)?)$/', $link ) ) {
141
+	elseif (!preg_match('/(\?|\&(amp;)?)$/', $link)) {
142 142
 		$link .= '&';
143 143
 	} //If there is no '&' at the END, add one.
144 144
 
145 145
 	$params_arr = array();
146
-	foreach ( $params as $key => $value ) {
147
-		if ( gettype( $value ) == 'array' ) { //Handle array data properly
148
-			foreach ( $value as $val ) {
149
-				$params_arr[] = $key . '[]=' . urlencode( $val );
146
+	foreach ($params as $key => $value) {
147
+		if (gettype($value) == 'array') { //Handle array data properly
148
+			foreach ($value as $val) {
149
+				$params_arr[] = $key.'[]='.urlencode($val);
150 150
 			}
151 151
 		} else {
152
-			$params_arr[] = $key . '=' . urlencode( $value );
152
+			$params_arr[] = $key.'='.urlencode($value);
153 153
 		}
154 154
 	}
155
-	$link .= implode( '&', $params_arr );
155
+	$link .= implode('&', $params_arr);
156 156
 
157 157
 	return $link;
158 158
 }
@@ -169,18 +169,18 @@  discard block
 block discarded – undo
169 169
  *
170 170
  * @return string Listing page url if valid. Otherwise home url will be returned.
171 171
  */
172
-function geodir_get_addlisting_link( $post_type = '' ) {
172
+function geodir_get_addlisting_link($post_type = '') {
173 173
 	global $wpdb;
174 174
 
175 175
 	//$check_pkg  = $wpdb->get_var("SELECT pid FROM ".GEODIR_PRICE_TABLE." WHERE post_type='".$post_type."' and status != '0'");
176 176
 	$check_pkg = 1;
177
-	if ( post_type_exists( $post_type ) && $check_pkg ) {
177
+	if (post_type_exists($post_type) && $check_pkg) {
178 178
 
179
-		$add_listing_link = get_page_link( geodir_add_listing_page_id() );
179
+		$add_listing_link = get_page_link(geodir_add_listing_page_id());
180 180
 
181
-		return esc_url( add_query_arg( array( 'listing_type' => $post_type ), $add_listing_link ) );
181
+		return esc_url(add_query_arg(array('listing_type' => $post_type), $add_listing_link));
182 182
 	} else {
183
-		return get_bloginfo( 'url' );
183
+		return get_bloginfo('url');
184 184
 	}
185 185
 }
186 186
 
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
  */
195 195
 function geodir_curPageURL() {
196 196
 	$pageURL = 'http';
197
-	if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {
197
+	if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
198 198
 		$pageURL .= "s";
199 199
 	}
200 200
 	$pageURL .= "://";
201
-	$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
201
+	$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
202 202
 
203 203
 	/**
204 204
 	 * Filter the current page URL returned by function geodir_curPageURL().
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 *
208 208
 	 * @param string $pageURL The URL of the current page.
209 209
 	 */
210
-	return apply_filters( 'geodir_curPageURL', $pageURL );
210
+	return apply_filters('geodir_curPageURL', $pageURL);
211 211
 }
212 212
 
213 213
 
@@ -223,12 +223,12 @@  discard block
 block discarded – undo
223 223
  *
224 224
  * @return string Cleaned variable.
225 225
  */
226
-function geodir_clean( $string ) {
226
+function geodir_clean($string) {
227 227
 
228
-	$string = trim( strip_tags( stripslashes( $string ) ) );
229
-	$string = str_replace( " ", "-", $string ); // Replaces all spaces with hyphens.
230
-	$string = preg_replace( '/[^A-Za-z0-9\-\_]/', '', $string ); // Removes special chars.
231
-	$string = preg_replace( '/-+/', '-', $string ); // Replaces multiple hyphens with single one.
228
+	$string = trim(strip_tags(stripslashes($string)));
229
+	$string = str_replace(" ", "-", $string); // Replaces all spaces with hyphens.
230
+	$string = preg_replace('/[^A-Za-z0-9\-\_]/', '', $string); // Removes special chars.
231
+	$string = preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
232 232
 
233 233
 	return $string;
234 234
 }
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
  */
243 243
 function geodir_get_weekday() {
244 244
 	return array(
245
-		__( 'Sunday', 'geodirectory' ),
246
-		__( 'Monday', 'geodirectory' ),
247
-		__( 'Tuesday', 'geodirectory' ),
248
-		__( 'Wednesday', 'geodirectory' ),
249
-		__( 'Thursday', 'geodirectory' ),
250
-		__( 'Friday', 'geodirectory' ),
251
-		__( 'Saturday', 'geodirectory' )
245
+		__('Sunday', 'geodirectory'),
246
+		__('Monday', 'geodirectory'),
247
+		__('Tuesday', 'geodirectory'),
248
+		__('Wednesday', 'geodirectory'),
249
+		__('Thursday', 'geodirectory'),
250
+		__('Friday', 'geodirectory'),
251
+		__('Saturday', 'geodirectory')
252 252
 	);
253 253
 }
254 254
 
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
  */
262 262
 function geodir_get_weeks() {
263 263
 	return array(
264
-		__( 'First', 'geodirectory' ),
265
-		__( 'Second', 'geodirectory' ),
266
-		__( 'Third', 'geodirectory' ),
267
-		__( 'Fourth', 'geodirectory' ),
268
-		__( 'Last', 'geodirectory' )
264
+		__('First', 'geodirectory'),
265
+		__('Second', 'geodirectory'),
266
+		__('Third', 'geodirectory'),
267
+		__('Fourth', 'geodirectory'),
268
+		__('Last', 'geodirectory')
269 269
 	);
270 270
 }
271 271
 
@@ -284,112 +284,112 @@  discard block
 block discarded – undo
284 284
  *
285 285
  * @return bool If valid returns true. Otherwise false.
286 286
  */
287
-function geodir_is_page( $gdpage = '' ) {
287
+function geodir_is_page($gdpage = '') {
288 288
 
289 289
 	global $wp_query, $post, $wp;
290 290
 	//if(!is_admin()):
291 291
 
292
-	switch ( $gdpage ):
292
+	switch ($gdpage):
293 293
 		case 'add-listing':
294 294
 
295
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_add_listing_page_id() ) {
295
+			if (is_page() && get_query_var('page_id') == geodir_add_listing_page_id()) {
296 296
 				return true;
297
-			} elseif ( is_page() && isset( $post->post_content ) && has_shortcode( $post->post_content, 'gd_add_listing' ) ) {
297
+			} elseif (is_page() && isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
298 298
 				return true;
299 299
 			}
300 300
 
301 301
 			break;
302 302
 		case 'preview':
303
-			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_preview_page_id() ) && isset( $_REQUEST['listing_type'] )
304
-			     && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
303
+			if ((is_page() && get_query_var('page_id') == geodir_preview_page_id()) && isset($_REQUEST['listing_type'])
304
+			     && in_array($_REQUEST['listing_type'], geodir_get_posttypes())
305 305
 			) {
306 306
 				return true;
307 307
 			}
308 308
 			break;
309 309
 		case 'listing-success':
310
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_success_page_id() ) {
310
+			if (is_page() && get_query_var('page_id') == geodir_success_page_id()) {
311 311
 				return true;
312 312
 			}
313 313
 			break;
314 314
 		case 'detail':
315
-			$post_type = get_query_var( 'post_type' );
316
-			if ( is_array( $post_type ) ) {
317
-				$post_type = reset( $post_type );
315
+			$post_type = get_query_var('post_type');
316
+			if (is_array($post_type)) {
317
+				$post_type = reset($post_type);
318 318
 			}
319
-			if ( is_single() && in_array( $post_type, geodir_get_posttypes() ) ) {
319
+			if (is_single() && in_array($post_type, geodir_get_posttypes())) {
320 320
 				return true;
321 321
 			}
322 322
 			break;
323 323
 		case 'pt':
324
-			$post_type = get_query_var( 'post_type' );
325
-			if ( is_array( $post_type ) ) {
326
-				$post_type = reset( $post_type );
324
+			$post_type = get_query_var('post_type');
325
+			if (is_array($post_type)) {
326
+				$post_type = reset($post_type);
327 327
 			}
328
-			if ( is_post_type_archive() && in_array( $post_type, geodir_get_posttypes() ) && ! is_tax() ) {
328
+			if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()) && !is_tax()) {
329 329
 				return true;
330 330
 			}
331 331
 
332 332
 			break;
333 333
 		case 'listing':
334
-			if ( is_tax() && geodir_get_taxonomy_posttype() ) {
334
+			if (is_tax() && geodir_get_taxonomy_posttype()) {
335 335
 				global $current_term, $taxonomy, $term;
336 336
 
337 337
 				return true;
338 338
 			}
339
-			$post_type = get_query_var( 'post_type' );
340
-			if ( is_array( $post_type ) ) {
341
-				$post_type = reset( $post_type );
339
+			$post_type = get_query_var('post_type');
340
+			if (is_array($post_type)) {
341
+				$post_type = reset($post_type);
342 342
 			}
343
-			if ( is_post_type_archive() && in_array( $post_type, geodir_get_posttypes() ) ) {
343
+			if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes())) {
344 344
 				return true;
345 345
 			}
346 346
 
347 347
 			break;
348 348
 		case 'home':
349 349
 
350
-			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_home_page_id() ) || is_page_geodir_home() ) {
350
+			if ((is_page() && get_query_var('page_id') == geodir_home_page_id()) || is_page_geodir_home()) {
351 351
 				return true;
352 352
 			}
353 353
 
354 354
 			break;
355 355
 		case 'location':
356
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_location_page_id() ) {
356
+			if (is_page() && get_query_var('page_id') == geodir_location_page_id()) {
357 357
 				return true;
358 358
 			}
359 359
 			break;
360 360
 		case 'author':
361
-			if ( is_author() && isset( $_REQUEST['geodir_dashbord'] ) ) {
361
+			if (is_author() && isset($_REQUEST['geodir_dashbord'])) {
362 362
 				return true;
363 363
 			}
364 364
 
365
-			if ( function_exists( 'bp_loggedin_user_id' ) && function_exists( 'bp_displayed_user_id' ) && $my_id = (int) bp_loggedin_user_id() ) {
366
-				if ( ( (bool) bp_is_current_component( 'listings' ) || (bool) bp_is_current_component( 'favorites' ) ) && $my_id > 0 && $my_id == (int) bp_displayed_user_id() ) {
365
+			if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int) bp_loggedin_user_id()) {
366
+				if (((bool) bp_is_current_component('listings') || (bool) bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int) bp_displayed_user_id()) {
367 367
 					return true;
368 368
 				}
369 369
 			}
370 370
 			break;
371 371
 		case 'search':
372
-			if ( is_search() && isset( $_REQUEST['geodir_search'] ) ) {
372
+			if (is_search() && isset($_REQUEST['geodir_search'])) {
373 373
 				return true;
374 374
 			}
375 375
 			break;
376 376
 		case 'info':
377
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_info_page_id() ) {
377
+			if (is_page() && get_query_var('page_id') == geodir_info_page_id()) {
378 378
 				return true;
379 379
 			}
380 380
 			break;
381 381
 		case 'login':
382
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_login_page_id() ) {
382
+			if (is_page() && get_query_var('page_id') == geodir_login_page_id()) {
383 383
 				return true;
384 384
 			}
385 385
 			break;
386 386
 		case 'checkout':
387
-			if ( is_page() && function_exists( 'geodir_payment_checkout_page_id' ) && get_query_var( 'page_id' ) == geodir_payment_checkout_page_id() ) {
387
+			if (is_page() && function_exists('geodir_payment_checkout_page_id') && get_query_var('page_id') == geodir_payment_checkout_page_id()) {
388 388
 				return true;
389 389
 			}
390 390
 			break;
391 391
 		case 'invoices':
392
-			if ( is_page() && function_exists( 'geodir_payment_invoices_page_id' ) && get_query_var( 'page_id' ) == geodir_payment_invoices_page_id() ) {
392
+			if (is_page() && function_exists('geodir_payment_invoices_page_id') && get_query_var('page_id') == geodir_payment_invoices_page_id()) {
393 393
 				return true;
394 394
 			}
395 395
 			break;
@@ -414,28 +414,28 @@  discard block
 block discarded – undo
414 414
  *
415 415
  * @param object $wp WordPress object.
416 416
  */
417
-function geodir_set_is_geodir_page( $wp ) {
418
-	if ( ! is_admin() ) {
417
+function geodir_set_is_geodir_page($wp) {
418
+	if (!is_admin()) {
419 419
 		//$wp->query_vars['gd_is_geodir_page'] = false;
420 420
 		//print_r()
421
-		if ( empty( $wp->query_vars ) || ! array_diff( array_keys( $wp->query_vars ), array(
421
+		if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array(
422 422
 				'preview',
423 423
 				'page',
424 424
 				'paged',
425 425
 				'cpage'
426
-			) )
426
+			))
427 427
 		) {
428
-			if ( get_option( 'geodir_set_as_home' ) ) {
428
+			if (get_option('geodir_set_as_home')) {
429 429
 				$wp->query_vars['gd_is_geodir_page'] = true;
430 430
 			}
431
-			if ( geodir_is_page( 'home' ) ) {
431
+			if (geodir_is_page('home')) {
432 432
 				$wp->query_vars['gd_is_geodir_page'] = true;
433 433
 			}
434 434
 
435 435
 
436 436
 		}
437 437
 
438
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['page_id'] ) ) {
438
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['page_id'])) {
439 439
 			if (
440 440
 				$wp->query_vars['page_id'] == geodir_add_listing_page_id()
441 441
 				|| $wp->query_vars['page_id'] == geodir_preview_page_id()
@@ -444,26 +444,26 @@  discard block
 block discarded – undo
444 444
 				|| $wp->query_vars['page_id'] == geodir_home_page_id()
445 445
 				|| $wp->query_vars['page_id'] == geodir_info_page_id()
446 446
 				|| $wp->query_vars['page_id'] == geodir_login_page_id()
447
-				|| ( function_exists( 'geodir_payment_checkout_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id() )
448
-				|| ( function_exists( 'geodir_payment_invoices_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id() )
447
+				|| (function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
448
+				|| (function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
449 449
 			) {
450 450
 				$wp->query_vars['gd_is_geodir_page'] = true;
451 451
 			}
452 452
 		}
453 453
 
454
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['pagename'] ) ) {
455
-			$page = get_page_by_path( $wp->query_vars['pagename'] );
454
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['pagename'])) {
455
+			$page = get_page_by_path($wp->query_vars['pagename']);
456 456
 
457
-			if ( ! empty( $page ) && (
457
+			if (!empty($page) && (
458 458
 					$page->ID == geodir_add_listing_page_id()
459 459
 					|| $page->ID == geodir_preview_page_id()
460 460
 					|| $page->ID == geodir_success_page_id()
461 461
 					|| $page->ID == geodir_location_page_id()
462
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_home_page_id() )
463
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_info_page_id() )
464
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_login_page_id() )
465
-					|| ( isset( $wp->query_vars['page_id'] ) && function_exists( 'geodir_payment_checkout_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id() )
466
-					|| ( isset( $wp->query_vars['page_id'] ) && function_exists( 'geodir_payment_invoices_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id() )
462
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_home_page_id())
463
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_info_page_id())
464
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_login_page_id())
465
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
466
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
467 467
 				)
468 468
 			) {
469 469
 				$wp->query_vars['gd_is_geodir_page'] = true;
@@ -471,20 +471,20 @@  discard block
 block discarded – undo
471 471
 		}
472 472
 
473 473
 
474
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['post_type'] ) && $wp->query_vars['post_type'] != '' ) {
474
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['post_type']) && $wp->query_vars['post_type'] != '') {
475 475
 			$requested_post_type = $wp->query_vars['post_type'];
476 476
 			// check if this post type is geodirectory post types
477 477
 			$post_type_array = geodir_get_posttypes();
478
-			if ( in_array( $requested_post_type, $post_type_array ) ) {
478
+			if (in_array($requested_post_type, $post_type_array)) {
479 479
 				$wp->query_vars['gd_is_geodir_page'] = true;
480 480
 			}
481 481
 		}
482 482
 
483
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) ) {
484
-			$geodir_taxonomis = geodir_get_taxonomies( '', true );
485
-			if ( ! empty( $geodir_taxonomis ) ) {
486
-				foreach ( $geodir_taxonomis as $taxonomy ) {
487
-					if ( array_key_exists( $taxonomy, $wp->query_vars ) ) {
483
+		if (!isset($wp->query_vars['gd_is_geodir_page'])) {
484
+			$geodir_taxonomis = geodir_get_taxonomies('', true);
485
+			if (!empty($geodir_taxonomis)) {
486
+				foreach ($geodir_taxonomis as $taxonomy) {
487
+					if (array_key_exists($taxonomy, $wp->query_vars)) {
488 488
 						$wp->query_vars['gd_is_geodir_page'] = true;
489 489
 						break;
490 490
 					}
@@ -493,20 +493,20 @@  discard block
 block discarded – undo
493 493
 
494 494
 		}
495 495
 
496
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['author_name'] ) && isset( $_REQUEST['geodir_dashbord'] ) ) {
496
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['author_name']) && isset($_REQUEST['geodir_dashbord'])) {
497 497
 			$wp->query_vars['gd_is_geodir_page'] = true;
498 498
 		}
499 499
 
500 500
 
501
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $_REQUEST['geodir_search'] ) ) {
501
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($_REQUEST['geodir_search'])) {
502 502
 			$wp->query_vars['gd_is_geodir_page'] = true;
503 503
 		}
504 504
 
505 505
 
506 506
 //check if homepage
507
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] )
508
-		     && ! isset( $wp->query_vars['page_id'] )
509
-		     && ! isset( $wp->query_vars['pagename'] )
507
+		if (!isset($wp->query_vars['gd_is_geodir_page'])
508
+		     && !isset($wp->query_vars['page_id'])
509
+		     && !isset($wp->query_vars['pagename'])
510 510
 		     && is_page_geodir_home()
511 511
 		) {
512 512
 			$wp->query_vars['gd_is_geodir_page'] = true;
@@ -530,14 +530,14 @@  discard block
 block discarded – undo
530 530
  */
531 531
 function geodir_is_geodir_page() {
532 532
 	global $wp;
533
-	if ( isset( $wp->query_vars['gd_is_geodir_page'] ) && $wp->query_vars['gd_is_geodir_page'] ) {
533
+	if (isset($wp->query_vars['gd_is_geodir_page']) && $wp->query_vars['gd_is_geodir_page']) {
534 534
 		return true;
535 535
 	} else {
536 536
 		return false;
537 537
 	}
538 538
 }
539 539
 
540
-if ( ! function_exists( 'geodir_get_imagesize' ) ) {
540
+if (!function_exists('geodir_get_imagesize')) {
541 541
 	/**
542 542
 	 * Get image size using the size key .
543 543
 	 *
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
 	 *
549 549
 	 * @return array|mixed|void|WP_Error If valid returns image size. Else returns error.
550 550
 	 */
551
-	function geodir_get_imagesize( $size = '' ) {
551
+	function geodir_get_imagesize($size = '') {
552 552
 
553 553
 		$imagesizes = array(
554
-			'list-thumb'   => array( 'w' => 283, 'h' => 188 ),
555
-			'thumbnail'    => array( 'w' => 125, 'h' => 125 ),
556
-			'widget-thumb' => array( 'w' => 50, 'h' => 50 ),
557
-			'slider-thumb' => array( 'w' => 100, 'h' => 100 )
554
+			'list-thumb'   => array('w' => 283, 'h' => 188),
555
+			'thumbnail'    => array('w' => 125, 'h' => 125),
556
+			'widget-thumb' => array('w' => 50, 'h' => 50),
557
+			'slider-thumb' => array('w' => 100, 'h' => 100)
558 558
 		);
559 559
 
560 560
 		/**
@@ -564,9 +564,9 @@  discard block
 block discarded – undo
564 564
 		 *
565 565
 		 * @param array $imagesizes Image size array.
566 566
 		 */
567
-		$imagesizes = apply_filters( 'geodir_imagesizes', $imagesizes );
567
+		$imagesizes = apply_filters('geodir_imagesizes', $imagesizes);
568 568
 
569
-		if ( ! empty( $size ) && array_key_exists( $size, $imagesizes ) ) {
569
+		if (!empty($size) && array_key_exists($size, $imagesizes)) {
570 570
 			/**
571 571
 			 * Filters image size of the passed key.
572 572
 			 *
@@ -574,11 +574,11 @@  discard block
 block discarded – undo
574 574
 			 *
575 575
 			 * @param array $imagesizes [$size] Image size array of the passed key.
576 576
 			 */
577
-			return apply_filters( 'geodir_get_imagesize_' . $size, $imagesizes[ $size ] );
577
+			return apply_filters('geodir_get_imagesize_'.$size, $imagesizes[$size]);
578 578
 
579
-		} elseif ( ! empty( $size ) ) {
579
+		} elseif (!empty($size)) {
580 580
 
581
-			return new WP_Error( 'geodir_no_imagesize', __( "Given image size is not valid", 'geodirectory' ) );
581
+			return new WP_Error('geodir_no_imagesize', __("Given image size is not valid", 'geodirectory'));
582 582
 
583 583
 		}
584 584
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 */
603 603
 
604 604
 
605
-if ( ! function_exists( 'createRandomString' ) ) {
605
+if (!function_exists('createRandomString')) {
606 606
 	/**
607 607
 	 * Creates random string.
608 608
 	 *
@@ -612,21 +612,21 @@  discard block
 block discarded – undo
612 612
 	 */
613 613
 	function createRandomString() {
614 614
 		$chars = "abcdefghijkmlnopqrstuvwxyz1023456789";
615
-		srand( (double) microtime() * 1000000 );
615
+		srand((double) microtime() * 1000000);
616 616
 		$i       = 0;
617 617
 		$rstring = '';
618
-		while ( $i <= 25 ) {
618
+		while ($i <= 25) {
619 619
 			$num     = rand() % 33;
620
-			$tmp     = substr( $chars, $num, 1 );
621
-			$rstring = $rstring . $tmp;
622
-			$i ++;
620
+			$tmp     = substr($chars, $num, 1);
621
+			$rstring = $rstring.$tmp;
622
+			$i++;
623 623
 		}
624 624
 
625 625
 		return $rstring;
626 626
 	}
627 627
 }
628 628
 
629
-if ( ! function_exists( 'geodir_getDistanceRadius' ) ) {
629
+if (!function_exists('geodir_getDistanceRadius')) {
630 630
 	/**
631 631
 	 * Calculates the distance radius.
632 632
 	 *
@@ -637,9 +637,9 @@  discard block
 block discarded – undo
637 637
 	 *
638 638
 	 * @return float The mean radius.
639 639
 	 */
640
-	function geodir_getDistanceRadius( $uom = 'km' ) {
640
+	function geodir_getDistanceRadius($uom = 'km') {
641 641
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
642
-		switch ( geodir_strtolower( $uom ) ):
642
+		switch (geodir_strtolower($uom)):
643 643
 			case 'km'    :
644 644
 				$earthMeanRadius = 6371.009; // km
645 645
 				break;
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 }
672 672
 
673 673
 
674
-if ( ! function_exists( 'geodir_calculateDistanceFromLatLong' ) ) {
674
+if (!function_exists('geodir_calculateDistanceFromLatLong')) {
675 675
 	/**
676 676
 	 * Calculate the great circle distance between two points identified by longitude and latitude.
677 677
 	 *
@@ -684,17 +684,17 @@  discard block
 block discarded – undo
684 684
 	 *
685 685
 	 * @return float The distance.
686 686
 	 */
687
-	function geodir_calculateDistanceFromLatLong( $point1, $point2, $uom = 'km' ) {
687
+	function geodir_calculateDistanceFromLatLong($point1, $point2, $uom = 'km') {
688 688
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
689 689
 
690
-		$earthMeanRadius = geodir_getDistanceRadius( $uom );
690
+		$earthMeanRadius = geodir_getDistanceRadius($uom);
691 691
 
692
-		$deltaLatitude  = deg2rad( (float) $point2['latitude'] - (float) $point1['latitude'] );
693
-		$deltaLongitude = deg2rad( (float) $point2['longitude'] - (float) $point1['longitude'] );
694
-		$a              = sin( $deltaLatitude / 2 ) * sin( $deltaLatitude / 2 ) +
695
-		                  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
696
-		                  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
697
-		$c              = 2 * atan2( sqrt( $a ), sqrt( 1 - $a ) );
692
+		$deltaLatitude  = deg2rad((float) $point2['latitude'] - (float) $point1['latitude']);
693
+		$deltaLongitude = deg2rad((float) $point2['longitude'] - (float) $point1['longitude']);
694
+		$a              = sin($deltaLatitude / 2) * sin($deltaLatitude / 2) +
695
+		                  cos(deg2rad((float) $point1['latitude'])) * cos(deg2rad((float) $point2['latitude'])) *
696
+		                  sin($deltaLongitude / 2) * sin($deltaLongitude / 2);
697
+		$c              = 2 * atan2(sqrt($a), sqrt(1 - $a));
698 698
 		$distance       = $earthMeanRadius * $c;
699 699
 
700 700
 		return $distance;
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 }
704 704
 
705 705
 
706
-if ( ! function_exists( 'geodir_sendEmail' ) ) {
706
+if (!function_exists('geodir_sendEmail')) {
707 707
 	/**
708 708
 	 * The main function that send transactional emails using the args provided.
709 709
 	 *
@@ -722,83 +722,83 @@  discard block
 block discarded – undo
722 722
 	 * @param string $post_id       The post ID.
723 723
 	 * @param string $user_id       The user ID.
724 724
 	 */
725
-	function geodir_sendEmail( $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '' ) {
725
+	function geodir_sendEmail($fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '') {
726 726
 		$login_details = '';
727 727
 
728 728
 		// strip slashes from subject & message text
729
-		$to_subject = stripslashes_deep( $to_subject );
730
-		$to_message = stripslashes_deep( $to_message );
731
-
732
-		if ( $message_type == 'send_friend' ) {
733
-			$subject = get_option( 'geodir_email_friend_subject' );
734
-			$message = get_option( 'geodir_email_friend_content' );
735
-		} elseif ( $message_type == 'send_enquiry' ) {
736
-			$subject = get_option( 'geodir_email_enquiry_subject' );
737
-			$message = get_option( 'geodir_email_enquiry_content' );
738
-		} elseif ( $message_type == 'forgot_password' ) {
739
-			$subject       = get_option( 'geodir_forgot_password_subject' );
740
-			$message       = get_option( 'geodir_forgot_password_content' );
729
+		$to_subject = stripslashes_deep($to_subject);
730
+		$to_message = stripslashes_deep($to_message);
731
+
732
+		if ($message_type == 'send_friend') {
733
+			$subject = get_option('geodir_email_friend_subject');
734
+			$message = get_option('geodir_email_friend_content');
735
+		} elseif ($message_type == 'send_enquiry') {
736
+			$subject = get_option('geodir_email_enquiry_subject');
737
+			$message = get_option('geodir_email_enquiry_content');
738
+		} elseif ($message_type == 'forgot_password') {
739
+			$subject       = get_option('geodir_forgot_password_subject');
740
+			$message       = get_option('geodir_forgot_password_content');
741 741
 			$login_details = $to_message;
742
-		} elseif ( $message_type == 'registration' ) {
743
-			$subject       = get_option( 'geodir_registration_success_email_subject' );
744
-			$message       = get_option( 'geodir_registration_success_email_content' );
742
+		} elseif ($message_type == 'registration') {
743
+			$subject       = get_option('geodir_registration_success_email_subject');
744
+			$message       = get_option('geodir_registration_success_email_content');
745 745
 			$login_details = $to_message;
746
-		} elseif ( $message_type == 'post_submit' ) {
747
-			$subject = get_option( 'geodir_post_submited_success_email_subject' );
748
-			$message = get_option( 'geodir_post_submited_success_email_content' );
749
-		} elseif ( $message_type == 'listing_published' ) {
750
-			$subject = get_option( 'geodir_post_published_email_subject' );
751
-			$message = get_option( 'geodir_post_published_email_content' );
752
-		} elseif ( $message_type == 'listing_edited' ) {
753
-			$subject = get_option( 'geodir_post_edited_email_subject_admin' );
754
-			$message = get_option( 'geodir_post_edited_email_content_admin' );
746
+		} elseif ($message_type == 'post_submit') {
747
+			$subject = get_option('geodir_post_submited_success_email_subject');
748
+			$message = get_option('geodir_post_submited_success_email_content');
749
+		} elseif ($message_type == 'listing_published') {
750
+			$subject = get_option('geodir_post_published_email_subject');
751
+			$message = get_option('geodir_post_published_email_content');
752
+		} elseif ($message_type == 'listing_edited') {
753
+			$subject = get_option('geodir_post_edited_email_subject_admin');
754
+			$message = get_option('geodir_post_edited_email_content_admin');
755 755
 		}
756 756
 
757
-		if ( ! empty( $subject ) ) {
758
-			$subject = __( stripslashes_deep( $subject ), 'geodirectory' );
757
+		if (!empty($subject)) {
758
+			$subject = __(stripslashes_deep($subject), 'geodirectory');
759 759
 		}
760 760
 
761
-		if ( ! empty( $message ) ) {
762
-			$message = __( stripslashes_deep( $message ), 'geodirectory' );
761
+		if (!empty($message)) {
762
+			$message = __(stripslashes_deep($message), 'geodirectory');
763 763
 		}
764 764
 
765
-		$to_message        = nl2br( $to_message );
766
-		$sitefromEmail     = get_option( 'site_email' );
765
+		$to_message        = nl2br($to_message);
766
+		$sitefromEmail     = get_option('site_email');
767 767
 		$sitefromEmailName = get_site_emailName();
768
-		$productlink       = get_permalink( $post_id );
768
+		$productlink       = get_permalink($post_id);
769 769
 
770 770
 		$user_login = '';
771
-		if ( $user_id > 0 && $user_info = get_userdata( $user_id ) ) {
771
+		if ($user_id > 0 && $user_info = get_userdata($user_id)) {
772 772
 			$user_login = $user_info->user_login;
773 773
 		}
774 774
 
775 775
 		$posted_date = '';
776 776
 		$listingLink = '';
777 777
 
778
-		$post_info = get_post( $post_id );
778
+		$post_info = get_post($post_id);
779 779
 
780
-		if ( $post_info ) {
780
+		if ($post_info) {
781 781
 			$posted_date = $post_info->post_date;
782
-			$listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
782
+			$listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
783 783
 		}
784 784
 		$siteurl       = home_url();
785
-		$siteurl_link  = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
785
+		$siteurl_link  = '<a href="'.$siteurl.'">'.$siteurl.'</a>';
786 786
 		$loginurl      = geodir_login_url();
787
-		$loginurl_link = '<a href="' . $loginurl . '">login</a>';
787
+		$loginurl_link = '<a href="'.$loginurl.'">login</a>';
788 788
 
789
-		$post_author_id   = ! empty( $post_info ) ? $post_info->post_author : 0;
790
-		$post_author_name = geodir_get_client_name( $post_author_id );
791
-		$current_date     = date_i18n( 'Y-m-d H:i:s', current_time( 'timestamp' ) );
789
+		$post_author_id   = !empty($post_info) ? $post_info->post_author : 0;
790
+		$post_author_name = geodir_get_client_name($post_author_id);
791
+		$current_date     = date_i18n('Y-m-d H:i:s', current_time('timestamp'));
792 792
 
793
-		if ( $fromEmail == '' ) {
794
-			$fromEmail = get_option( 'site_email' );
793
+		if ($fromEmail == '') {
794
+			$fromEmail = get_option('site_email');
795 795
 		}
796 796
 
797
-		if ( $fromEmailName == '' ) {
798
-			$fromEmailName = get_option( 'site_email_name' );
797
+		if ($fromEmailName == '') {
798
+			$fromEmailName = get_option('site_email_name');
799 799
 		}
800 800
 
801
-		$search_array  = array(
801
+		$search_array = array(
802 802
 			'[#listing_link#]',
803 803
 			'[#site_name_url#]',
804 804
 			'[#post_id#]',
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 			$post_author_name,
839 839
 			$current_date
840 840
 		);
841
-		$message       = str_replace( $search_array, $replace_array, $message );
841
+		$message       = str_replace($search_array, $replace_array, $message);
842 842
 
843 843
 		$search_array  = array(
844 844
 			'[#listing_link#]',
@@ -874,12 +874,12 @@  discard block
 block discarded – undo
874 874
 			$post_author_name,
875 875
 			$current_date
876 876
 		);
877
-		$subject       = str_replace( $search_array, $replace_array, $subject );
877
+		$subject = str_replace($search_array, $replace_array, $subject);
878 878
 
879
-		$headers = 'MIME-Version: 1.0' . "\r\n";
880
-		$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
881
-		$headers .= "Reply-To: " . $fromEmail . "\r\n";
882
-		$headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n";
879
+		$headers = 'MIME-Version: 1.0'."\r\n";
880
+		$headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
881
+		$headers .= "Reply-To: ".$fromEmail."\r\n";
882
+		$headers .= 'From: '.$sitefromEmailName.' <'.$sitefromEmail.'>'."\r\n";
883 883
 
884 884
 		$to = $toEmail;
885 885
 
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 		 * @param string $post_id       The post ID.
902 902
 		 * @param string $user_id       The user ID.
903 903
 		 */
904
-		$to = apply_filters( 'geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
904
+		$to = apply_filters('geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
905 905
 		/**
906 906
 		 * Filter the client email subject.
907 907
 		 *
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
 		 * @param string $post_id       The post ID.
921 921
 		 * @param string $user_id       The user ID.
922 922
 		 */
923
-		$subject = apply_filters( 'geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
923
+		$subject = apply_filters('geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
924 924
 		/**
925 925
 		 * Filter the client email message.
926 926
 		 *
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 		 * @param string $post_id       The post ID.
940 940
 		 * @param string $user_id       The user ID.
941 941
 		 */
942
-		$message = apply_filters( 'geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
942
+		$message = apply_filters('geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
943 943
 		/**
944 944
 		 * Filter the client email headers.
945 945
 		 *
@@ -958,39 +958,39 @@  discard block
 block discarded – undo
958 958
 		 * @param string $post_id       The post ID.
959 959
 		 * @param string $user_id       The user ID.
960 960
 		 */
961
-		$headers = apply_filters( 'geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
961
+		$headers = apply_filters('geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
962 962
 
963
-		$sent = wp_mail( $to, $subject, $message, $headers );
963
+		$sent = wp_mail($to, $subject, $message, $headers);
964 964
 
965
-		if ( ! $sent ) {
966
-			if ( is_array( $to ) ) {
967
-				$to = implode( ',', $to );
965
+		if (!$sent) {
966
+			if (is_array($to)) {
967
+				$to = implode(',', $to);
968 968
 			}
969 969
 			$log_message = sprintf(
970
-				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
970
+				__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
971 971
 				$message_type,
972
-				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
972
+				date_i18n('F j Y H:i:s', current_time('timestamp')),
973 973
 				$to,
974 974
 				$subject
975 975
 			);
976
-			geodir_error_log( $log_message );
976
+			geodir_error_log($log_message);
977 977
 		}
978 978
 
979 979
 		///////// ADMIN BCC EMIALS
980
-		$adminEmail = get_bloginfo( 'admin_email' );
980
+		$adminEmail = get_bloginfo('admin_email');
981 981
 		$to         = $adminEmail;
982 982
 
983 983
 		$admin_bcc = false;
984
-		if ( $message_type == 'registration' ) {
985
-			$message_raw  = explode( __( "Password:", 'geodirectory' ), $message );
986
-			$message_raw2 = explode( "</p>", $message_raw[1], 2 );
987
-			$message      = $message_raw[0] . __( 'Password:', 'geodirectory' ) . ' **********</p>' . $message_raw2[1];
984
+		if ($message_type == 'registration') {
985
+			$message_raw  = explode(__("Password:", 'geodirectory'), $message);
986
+			$message_raw2 = explode("</p>", $message_raw[1], 2);
987
+			$message      = $message_raw[0].__('Password:', 'geodirectory').' **********</p>'.$message_raw2[1];
988 988
 		}
989
-		if ( $message_type == 'post_submit' ) {
990
-			$subject = __( stripslashes_deep( get_option( 'geodir_post_submited_success_email_subject_admin' ) ), 'geodirectory' );
991
-			$message = __( stripslashes_deep( get_option( 'geodir_post_submited_success_email_content_admin' ) ), 'geodirectory' );
989
+		if ($message_type == 'post_submit') {
990
+			$subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory');
991
+			$message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory');
992 992
 
993
-			$search_array  = array(
993
+			$search_array = array(
994 994
 				'[#listing_link#]',
995 995
 				'[#site_name_url#]',
996 996
 				'[#post_id#]',
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
 				$user_login,
1023 1023
 				$user_login
1024 1024
 			);
1025
-			$message       = str_replace( $search_array, $replace_array, $message );
1025
+			$message       = str_replace($search_array, $replace_array, $message);
1026 1026
 
1027 1027
 			$search_array  = array(
1028 1028
 				'[#listing_link#]',
@@ -1050,40 +1050,40 @@  discard block
 block discarded – undo
1050 1050
 				$user_login,
1051 1051
 				$user_login
1052 1052
 			);
1053
-			$subject       = str_replace( $search_array, $replace_array, $subject );
1053
+			$subject = str_replace($search_array, $replace_array, $subject);
1054 1054
 
1055 1055
 			$subject .= ' - ADMIN BCC COPY';
1056 1056
 			$admin_bcc = true;
1057 1057
 
1058
-		} elseif ( $message_type == 'registration' && get_option( 'geodir_bcc_new_user' ) ) {
1058
+		} elseif ($message_type == 'registration' && get_option('geodir_bcc_new_user')) {
1059 1059
 			$subject .= ' - ADMIN BCC COPY';
1060 1060
 			$admin_bcc = true;
1061
-		} elseif ( $message_type == 'send_friend' && get_option( 'geodir_bcc_friend' ) ) {
1061
+		} elseif ($message_type == 'send_friend' && get_option('geodir_bcc_friend')) {
1062 1062
 			$subject .= ' - ADMIN BCC COPY';
1063 1063
 			$admin_bcc = true;
1064
-		} elseif ( $message_type == 'send_enquiry' && get_option( 'geodir_bcc_enquiry' ) ) {
1064
+		} elseif ($message_type == 'send_enquiry' && get_option('geodir_bcc_enquiry')) {
1065 1065
 			$subject .= ' - ADMIN BCC COPY';
1066 1066
 			$admin_bcc = true;
1067
-		} elseif ( $message_type == 'listing_published' && get_option( 'geodir_bcc_listing_published' ) ) {
1067
+		} elseif ($message_type == 'listing_published' && get_option('geodir_bcc_listing_published')) {
1068 1068
 			$subject .= ' - ADMIN BCC COPY';
1069 1069
 			$admin_bcc = true;
1070 1070
 		}
1071 1071
 
1072
-		if ( $admin_bcc === true ) {
1073
-			$sent = wp_mail( $to, $subject, $message, $headers );
1072
+		if ($admin_bcc === true) {
1073
+			$sent = wp_mail($to, $subject, $message, $headers);
1074 1074
 
1075
-			if ( ! $sent ) {
1076
-				if ( is_array( $to ) ) {
1077
-					$to = implode( ',', $to );
1075
+			if (!$sent) {
1076
+				if (is_array($to)) {
1077
+					$to = implode(',', $to);
1078 1078
 				}
1079 1079
 				$log_message = sprintf(
1080
-					__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1080
+					__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1081 1081
 					$message_type,
1082
-					date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1082
+					date_i18n('F j Y H:i:s', current_time('timestamp')),
1083 1083
 					$to,
1084 1084
 					$subject
1085 1085
 				);
1086
-				geodir_error_log( $log_message );
1086
+				geodir_error_log($log_message);
1087 1087
 			}
1088 1088
 		}
1089 1089
 
@@ -1099,58 +1099,58 @@  discard block
 block discarded – undo
1099 1099
  */
1100 1100
 function geodir_taxonomy_breadcrumb() {
1101 1101
 
1102
-	$term   = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
1102
+	$term   = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
1103 1103
 	$parent = $term->parent;
1104 1104
 
1105
-	while ( $parent ):
1105
+	while ($parent):
1106 1106
 		$parents[]  = $parent;
1107
-		$new_parent = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );
1107
+		$new_parent = get_term_by('id', $parent, get_query_var('taxonomy'));
1108 1108
 		$parent     = $new_parent->parent;
1109 1109
 	endwhile;
1110 1110
 
1111
-	if ( ! empty( $parents ) ):
1112
-		$parents = array_reverse( $parents );
1111
+	if (!empty($parents)):
1112
+		$parents = array_reverse($parents);
1113 1113
 
1114
-		foreach ( $parents as $parent ):
1115
-			$item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );
1116
-			$url  = get_term_link( $item, get_query_var( 'taxonomy' ) );
1117
-			echo '<li> > <a href="' . $url . '">' . $item->name . '</a></li>';
1114
+		foreach ($parents as $parent):
1115
+			$item = get_term_by('id', $parent, get_query_var('taxonomy'));
1116
+			$url  = get_term_link($item, get_query_var('taxonomy'));
1117
+			echo '<li> > <a href="'.$url.'">'.$item->name.'</a></li>';
1118 1118
 		endforeach;
1119 1119
 
1120 1120
 	endif;
1121 1121
 
1122
-	echo '<li> > ' . $term->name . '</li>';
1122
+	echo '<li> > '.$term->name.'</li>';
1123 1123
 }
1124 1124
 
1125
-function geodir_wpml_post_type_archive_link($link, $post_type){
1125
+function geodir_wpml_post_type_archive_link($link, $post_type) {
1126 1126
 
1127
-	if(function_exists('icl_object_id')) {
1128
-		$post_types   = get_option( 'geodir_post_types' );
1129
-		$slug         = $post_types[ $post_type ]['rewrite']['slug'];
1127
+	if (function_exists('icl_object_id')) {
1128
+		$post_types   = get_option('geodir_post_types');
1129
+		$slug         = $post_types[$post_type]['rewrite']['slug'];
1130 1130
 
1131
-		echo $link.'###'.gd_wpml_get_lang_from_url( $link) ;
1131
+		echo $link.'###'.gd_wpml_get_lang_from_url($link);
1132 1132
 
1133 1133
 		// Alter the CPT slug if WPML is set to do so
1134
-		if ( function_exists( 'icl_object_id' ) ) {
1135
-			if ( gd_wpml_slug_translation_turned_on( $post_type ) && $language_code = gd_wpml_get_lang_from_url( $link) ) {
1134
+		if (function_exists('icl_object_id')) {
1135
+			if (gd_wpml_slug_translation_turned_on($post_type) && $language_code = gd_wpml_get_lang_from_url($link)) {
1136 1136
 
1137 1137
 				$org_slug = $slug;
1138
-				$slug     = apply_filters( 'wpml_translate_single_string',
1138
+				$slug     = apply_filters('wpml_translate_single_string',
1139 1139
 					$slug,
1140 1140
 					'WordPress',
1141
-					'URL slug: ' . $slug,
1142
-					$language_code );
1141
+					'URL slug: '.$slug,
1142
+					$language_code);
1143 1143
 
1144
-				if ( ! $slug ) {
1144
+				if (!$slug) {
1145 1145
 					$slug = $org_slug;
1146 1146
 				} else {
1147
-					$link = str_replace( $org_slug, $slug, $link );
1147
+					$link = str_replace($org_slug, $slug, $link);
1148 1148
 				}
1149 1149
 
1150 1150
 			}
1151 1151
 		}
1152 1152
 
1153
-		echo $link.'####'.gd_wpml_get_lang_from_url( $link) ;
1153
+		echo $link.'####'.gd_wpml_get_lang_from_url($link);
1154 1154
 	}
1155 1155
 
1156 1156
 	return $link;
@@ -1175,9 +1175,9 @@  discard block
 block discarded – undo
1175 1175
 	 *
1176 1176
 	 * @since 1.0.0
1177 1177
 	 */
1178
-	$separator = apply_filters( 'geodir_breadcrumb_separator', ' > ' );
1178
+	$separator = apply_filters('geodir_breadcrumb_separator', ' > ');
1179 1179
 
1180
-	if ( ! geodir_is_page( 'home' ) ) {
1180
+	if (!geodir_is_page('home')) {
1181 1181
 		$breadcrumb    = '';
1182 1182
 		$url_categoris = '';
1183 1183
 		$breadcrumb .= '<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">';
@@ -1186,162 +1186,162 @@  discard block
 block discarded – undo
1186 1186
 		 *
1187 1187
 		 * @since 1.0.0
1188 1188
 		 */
1189
-		$breadcrumb .= '<li>' . apply_filters( 'geodir_breadcrumb_first_link', '<a href="' . home_url() . '">' . __( 'Home', 'geodirectory' ) . '</a>' ) . '</li>';
1189
+		$breadcrumb .= '<li>'.apply_filters('geodir_breadcrumb_first_link', '<a href="'.home_url().'">'.__('Home', 'geodirectory').'</a>').'</li>';
1190 1190
 
1191 1191
 		$gd_post_type   = geodir_get_current_posttype();
1192
-		$post_type_info = get_post_type_object( $gd_post_type );
1192
+		$post_type_info = get_post_type_object($gd_post_type);
1193 1193
 
1194
-		remove_filter( 'post_type_archive_link', 'geodir_get_posttype_link' );
1194
+		remove_filter('post_type_archive_link', 'geodir_get_posttype_link');
1195 1195
 
1196
-		$listing_link = get_post_type_archive_link( $gd_post_type );
1196
+		$listing_link = get_post_type_archive_link($gd_post_type);
1197 1197
 
1198
-		add_filter( 'post_type_archive_link', 'geodir_get_posttype_link', 10, 2 );
1199
-		$listing_link = rtrim( $listing_link, '/' );
1198
+		add_filter('post_type_archive_link', 'geodir_get_posttype_link', 10, 2);
1199
+		$listing_link = rtrim($listing_link, '/');
1200 1200
 		$listing_link .= '/';
1201 1201
 
1202 1202
 		$post_type_for_location_link = $listing_link;
1203
-		$location_terms              = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
1203
+		$location_terms              = geodir_get_current_location_terms('query_vars', $gd_post_type);
1204 1204
 
1205 1205
 		global $wp, $gd_session;
1206 1206
 		$location_link = $post_type_for_location_link;
1207 1207
 
1208
-		if ( geodir_is_page( 'detail' ) || geodir_is_page( 'listing' ) ) {
1208
+		if (geodir_is_page('detail') || geodir_is_page('listing')) {
1209 1209
 			global $post;
1210
-			$location_manager     = defined( 'POST_LOCATION_TABLE' ) ? true : false;
1211
-			$neighbourhood_active = $location_manager && get_option( 'location_neighbourhoods' ) ? true : false;
1210
+			$location_manager     = defined('POST_LOCATION_TABLE') ? true : false;
1211
+			$neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
1212 1212
 
1213
-			if ( geodir_is_page( 'detail' ) && isset( $post->country_slug ) ) {
1213
+			if (geodir_is_page('detail') && isset($post->country_slug)) {
1214 1214
 				$location_terms = array(
1215 1215
 					'gd_country' => $post->country_slug,
1216 1216
 					'gd_region'  => $post->region_slug,
1217 1217
 					'gd_city'    => $post->city_slug
1218 1218
 				);
1219 1219
 
1220
-				if ( $neighbourhood_active && ! empty( $location_terms['gd_city'] ) && $gd_ses_neighbourhood = $gd_session->get( 'gd_neighbourhood' ) ) {
1220
+				if ($neighbourhood_active && !empty($location_terms['gd_city']) && $gd_ses_neighbourhood = $gd_session->get('gd_neighbourhood')) {
1221 1221
 					$location_terms['gd_neighbourhood'] = $gd_ses_neighbourhood;
1222 1222
 				}
1223 1223
 			}
1224 1224
 
1225
-			$geodir_show_location_url = get_option( 'geodir_show_location_url' );
1225
+			$geodir_show_location_url = get_option('geodir_show_location_url');
1226 1226
 
1227 1227
 			$hide_url_part = array();
1228
-			if ( $location_manager ) {
1229
-				$hide_country_part = get_option( 'geodir_location_hide_country_part' );
1230
-				$hide_region_part  = get_option( 'geodir_location_hide_region_part' );
1231
-
1232
-				if ( $hide_region_part && $hide_country_part ) {
1233
-					$hide_url_part = array( 'gd_country', 'gd_region' );
1234
-				} else if ( $hide_region_part && ! $hide_country_part ) {
1235
-					$hide_url_part = array( 'gd_region' );
1236
-				} else if ( ! $hide_region_part && $hide_country_part ) {
1237
-					$hide_url_part = array( 'gd_country' );
1228
+			if ($location_manager) {
1229
+				$hide_country_part = get_option('geodir_location_hide_country_part');
1230
+				$hide_region_part  = get_option('geodir_location_hide_region_part');
1231
+
1232
+				if ($hide_region_part && $hide_country_part) {
1233
+					$hide_url_part = array('gd_country', 'gd_region');
1234
+				} else if ($hide_region_part && !$hide_country_part) {
1235
+					$hide_url_part = array('gd_region');
1236
+				} else if (!$hide_region_part && $hide_country_part) {
1237
+					$hide_url_part = array('gd_country');
1238 1238
 				}
1239 1239
 			}
1240 1240
 
1241 1241
 			$hide_text_part = array();
1242
-			if ( $geodir_show_location_url == 'country_city' ) {
1243
-				$hide_text_part = array( 'gd_region' );
1242
+			if ($geodir_show_location_url == 'country_city') {
1243
+				$hide_text_part = array('gd_region');
1244 1244
 
1245
-				if ( isset( $location_terms['gd_region'] ) && ! $location_manager ) {
1246
-					unset( $location_terms['gd_region'] );
1245
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1246
+					unset($location_terms['gd_region']);
1247 1247
 				}
1248
-			} else if ( $geodir_show_location_url == 'region_city' ) {
1249
-				$hide_text_part = array( 'gd_country' );
1248
+			} else if ($geodir_show_location_url == 'region_city') {
1249
+				$hide_text_part = array('gd_country');
1250 1250
 
1251
-				if ( isset( $location_terms['gd_country'] ) && ! $location_manager ) {
1252
-					unset( $location_terms['gd_country'] );
1251
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1252
+					unset($location_terms['gd_country']);
1253 1253
 				}
1254
-			} else if ( $geodir_show_location_url == 'city' ) {
1255
-				$hide_text_part = array( 'gd_country', 'gd_region' );
1254
+			} else if ($geodir_show_location_url == 'city') {
1255
+				$hide_text_part = array('gd_country', 'gd_region');
1256 1256
 
1257
-				if ( isset( $location_terms['gd_country'] ) && ! $location_manager ) {
1258
-					unset( $location_terms['gd_country'] );
1257
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1258
+					unset($location_terms['gd_country']);
1259 1259
 				}
1260
-				if ( isset( $location_terms['gd_region'] ) && ! $location_manager ) {
1261
-					unset( $location_terms['gd_region'] );
1260
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1261
+					unset($location_terms['gd_region']);
1262 1262
 				}
1263 1263
 			}
1264 1264
 
1265 1265
 			$is_location_last = '';
1266 1266
 			$is_taxonomy_last = '';
1267 1267
 			$breadcrumb .= '<li>';
1268
-			if ( get_query_var( $gd_post_type . 'category' ) ) {
1269
-				$gd_taxonomy = $gd_post_type . 'category';
1270
-			} elseif ( get_query_var( $gd_post_type . '_tags' ) ) {
1271
-				$gd_taxonomy = $gd_post_type . '_tags';
1268
+			if (get_query_var($gd_post_type.'category')) {
1269
+				$gd_taxonomy = $gd_post_type.'category';
1270
+			} elseif (get_query_var($gd_post_type.'_tags')) {
1271
+				$gd_taxonomy = $gd_post_type.'_tags';
1272 1272
 			}
1273 1273
 
1274
-			$breadcrumb .= $separator . '<a href="' . $listing_link . '">' . __( ucfirst( $post_type_info->label ), 'geodirectory' ) . '</a>';
1275
-			if ( ! empty( $gd_taxonomy ) || geodir_is_page( 'detail' ) ) {
1274
+			$breadcrumb .= $separator.'<a href="'.$listing_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1275
+			if (!empty($gd_taxonomy) || geodir_is_page('detail')) {
1276 1276
 				$is_location_last = false;
1277 1277
 			} else {
1278 1278
 				$is_location_last = true;
1279 1279
 			}
1280 1280
 
1281
-			if ( ! empty( $gd_taxonomy ) && geodir_is_page( 'listing' ) ) {
1281
+			if (!empty($gd_taxonomy) && geodir_is_page('listing')) {
1282 1282
 				$is_taxonomy_last = true;
1283 1283
 			} else {
1284 1284
 				$is_taxonomy_last = false;
1285 1285
 			}
1286 1286
 
1287
-			if ( ! empty( $location_terms ) ) {
1288
-				$geodir_get_locations = function_exists( 'get_actual_location_name' ) ? true : false;
1287
+			if (!empty($location_terms)) {
1288
+				$geodir_get_locations = function_exists('get_actual_location_name') ? true : false;
1289 1289
 
1290
-				foreach ( $location_terms as $key => $location_term ) {
1291
-					if ( $location_term != '' ) {
1292
-						if ( ! empty( $hide_url_part ) && in_array( $key, $hide_url_part ) ) { // Hide location part from url & breadcrumb.
1290
+				foreach ($location_terms as $key => $location_term) {
1291
+					if ($location_term != '') {
1292
+						if (!empty($hide_url_part) && in_array($key, $hide_url_part)) { // Hide location part from url & breadcrumb.
1293 1293
 							continue;
1294 1294
 						}
1295 1295
 
1296
-						$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location_term );
1297
-						$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
1298
-						$gd_location_link_text = ucfirst( $gd_location_link_text );
1296
+						$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location_term);
1297
+						$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
1298
+						$gd_location_link_text = ucfirst($gd_location_link_text);
1299 1299
 
1300 1300
 						$location_term_actual_country = '';
1301 1301
 						$location_term_actual_region  = '';
1302 1302
 						$location_term_actual_city    = '';
1303
-						if ( $geodir_get_locations ) {
1304
-							if ( $key == 'gd_country' ) {
1305
-								$location_term_actual_country = get_actual_location_name( 'country', $location_term, true );
1306
-							} else if ( $key == 'gd_region' ) {
1307
-								$location_term_actual_region = get_actual_location_name( 'region', $location_term, true );
1308
-							} else if ( $key == 'gd_city' ) {
1309
-								$location_term_actual_city = get_actual_location_name( 'city', $location_term, true );
1303
+						if ($geodir_get_locations) {
1304
+							if ($key == 'gd_country') {
1305
+								$location_term_actual_country = get_actual_location_name('country', $location_term, true);
1306
+							} else if ($key == 'gd_region') {
1307
+								$location_term_actual_region = get_actual_location_name('region', $location_term, true);
1308
+							} else if ($key == 'gd_city') {
1309
+								$location_term_actual_city = get_actual_location_name('city', $location_term, true);
1310 1310
 							}
1311 1311
 						} else {
1312 1312
 							$location_info = geodir_get_location();
1313 1313
 
1314
-							if ( ! empty( $location_info ) && isset( $location_info->location_id ) ) {
1315
-								if ( $key == 'gd_country' ) {
1316
-									$location_term_actual_country = __( $location_info->country, 'geodirectory' );
1317
-								} else if ( $key == 'gd_region' ) {
1318
-									$location_term_actual_region = __( $location_info->region, 'geodirectory' );
1319
-								} else if ( $key == 'gd_city' ) {
1320
-									$location_term_actual_city = __( $location_info->city, 'geodirectory' );
1314
+							if (!empty($location_info) && isset($location_info->location_id)) {
1315
+								if ($key == 'gd_country') {
1316
+									$location_term_actual_country = __($location_info->country, 'geodirectory');
1317
+								} else if ($key == 'gd_region') {
1318
+									$location_term_actual_region = __($location_info->region, 'geodirectory');
1319
+								} else if ($key == 'gd_city') {
1320
+									$location_term_actual_city = __($location_info->city, 'geodirectory');
1321 1321
 								}
1322 1322
 							}
1323 1323
 						}
1324 1324
 
1325
-						if ( $is_location_last && $key == 'gd_country' && ! ( isset( $location_terms['gd_region'] ) && $location_terms['gd_region'] != '' ) && ! ( isset( $location_terms['gd_city'] ) && $location_terms['gd_city'] != '' ) ) {
1326
-							$breadcrumb .= $location_term_actual_country != '' ? $separator . $location_term_actual_country : $separator . $gd_location_link_text;
1327
-						} else if ( $is_location_last && $key == 'gd_region' && ! ( isset( $location_terms['gd_city'] ) && $location_terms['gd_city'] != '' ) ) {
1328
-							$breadcrumb .= $location_term_actual_region != '' ? $separator . $location_term_actual_region : $separator . $gd_location_link_text;
1329
-						} else if ( $is_location_last && $key == 'gd_city' && empty( $location_terms['gd_neighbourhood'] ) ) {
1330
-							$breadcrumb .= $location_term_actual_city != '' ? $separator . $location_term_actual_city : $separator . $gd_location_link_text;
1331
-						} else if ( $is_location_last && $key == 'gd_neighbourhood' ) {
1332
-							$breadcrumb .= $separator . $gd_location_link_text;
1325
+						if ($is_location_last && $key == 'gd_country' && !(isset($location_terms['gd_region']) && $location_terms['gd_region'] != '') && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1326
+							$breadcrumb .= $location_term_actual_country != '' ? $separator.$location_term_actual_country : $separator.$gd_location_link_text;
1327
+						} else if ($is_location_last && $key == 'gd_region' && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1328
+							$breadcrumb .= $location_term_actual_region != '' ? $separator.$location_term_actual_region : $separator.$gd_location_link_text;
1329
+						} else if ($is_location_last && $key == 'gd_city' && empty($location_terms['gd_neighbourhood'])) {
1330
+							$breadcrumb .= $location_term_actual_city != '' ? $separator.$location_term_actual_city : $separator.$gd_location_link_text;
1331
+						} else if ($is_location_last && $key == 'gd_neighbourhood') {
1332
+							$breadcrumb .= $separator.$gd_location_link_text;
1333 1333
 						} else {
1334
-							if ( get_option( 'permalink_structure' ) != '' ) {
1335
-								$location_link .= $location_term . '/';
1334
+							if (get_option('permalink_structure') != '') {
1335
+								$location_link .= $location_term.'/';
1336 1336
 							} else {
1337
-								$location_link .= "&$key=" . $location_term;
1337
+								$location_link .= "&$key=".$location_term;
1338 1338
 							}
1339 1339
 
1340
-							if ( $key == 'gd_country' && $location_term_actual_country != '' ) {
1340
+							if ($key == 'gd_country' && $location_term_actual_country != '') {
1341 1341
 								$gd_location_link_text = $location_term_actual_country;
1342
-							} else if ( $key == 'gd_region' && $location_term_actual_region != '' ) {
1342
+							} else if ($key == 'gd_region' && $location_term_actual_region != '') {
1343 1343
 								$gd_location_link_text = $location_term_actual_region;
1344
-							} else if ( $key == 'gd_city' && $location_term_actual_city != '' ) {
1344
+							} else if ($key == 'gd_city' && $location_term_actual_city != '') {
1345 1345
 								$gd_location_link_text = $location_term_actual_city;
1346 1346
 							}
1347 1347
 
@@ -1351,76 +1351,76 @@  discard block
 block discarded – undo
1351 1351
                             }
1352 1352
                             */
1353 1353
 
1354
-							$breadcrumb .= $separator . '<a href="' . $location_link . '">' . $gd_location_link_text . '</a>';
1354
+							$breadcrumb .= $separator.'<a href="'.$location_link.'">'.$gd_location_link_text.'</a>';
1355 1355
 						}
1356 1356
 					}
1357 1357
 				}
1358 1358
 			}
1359 1359
 
1360
-			if ( ! empty( $gd_taxonomy ) ) {
1360
+			if (!empty($gd_taxonomy)) {
1361 1361
 				$term_index = 1;
1362 1362
 
1363 1363
 				//if(get_option('geodir_add_categories_url'))
1364 1364
 				{
1365
-					if ( get_query_var( $gd_post_type . '_tags' ) ) {
1366
-						$cat_link = $listing_link . 'tags/';
1365
+					if (get_query_var($gd_post_type.'_tags')) {
1366
+						$cat_link = $listing_link.'tags/';
1367 1367
 					} else {
1368 1368
 						$cat_link = $listing_link;
1369 1369
 					}
1370 1370
 
1371
-					foreach ( $location_terms as $key => $location_term ) {
1372
-						if ( $location_manager && in_array( $key, $hide_url_part ) ) {
1371
+					foreach ($location_terms as $key => $location_term) {
1372
+						if ($location_manager && in_array($key, $hide_url_part)) {
1373 1373
 							continue;
1374 1374
 						}
1375 1375
 
1376
-						if ( $location_term != '' ) {
1377
-							if ( get_option( 'permalink_structure' ) != '' ) {
1378
-								$cat_link .= $location_term . '/';
1376
+						if ($location_term != '') {
1377
+							if (get_option('permalink_structure') != '') {
1378
+								$cat_link .= $location_term.'/';
1379 1379
 							}
1380 1380
 						}
1381 1381
 					}
1382 1382
 
1383
-					$term_array = explode( "/", trim( $wp_query->query[ $gd_taxonomy ], "/" ) );
1384
-					foreach ( $term_array as $term ) {
1385
-						$term_link_text = preg_replace( '/-(\d+)$/', '', $term );
1386
-						$term_link_text = preg_replace( '/[_-]/', ' ', $term_link_text );
1383
+					$term_array = explode("/", trim($wp_query->query[$gd_taxonomy], "/"));
1384
+					foreach ($term_array as $term) {
1385
+						$term_link_text = preg_replace('/-(\d+)$/', '', $term);
1386
+						$term_link_text = preg_replace('/[_-]/', ' ', $term_link_text);
1387 1387
 
1388 1388
 						// get term actual name
1389
-						$term_info = get_term_by( 'slug', $term, $gd_taxonomy, 'ARRAY_A' );
1390
-						if ( ! empty( $term_info ) && isset( $term_info['name'] ) && $term_info['name'] != '' ) {
1391
-							$term_link_text = urldecode( $term_info['name'] );
1389
+						$term_info = get_term_by('slug', $term, $gd_taxonomy, 'ARRAY_A');
1390
+						if (!empty($term_info) && isset($term_info['name']) && $term_info['name'] != '') {
1391
+							$term_link_text = urldecode($term_info['name']);
1392 1392
 						} else {
1393 1393
 							continue;
1394 1394
 							//$term_link_text = wp_strip_all_tags(geodir_ucwords(urldecode($term_link_text)));
1395 1395
 						}
1396 1396
 
1397
-						if ( $term_index == count( $term_array ) && $is_taxonomy_last ) {
1398
-							$breadcrumb .= $separator . $term_link_text;
1397
+						if ($term_index == count($term_array) && $is_taxonomy_last) {
1398
+							$breadcrumb .= $separator.$term_link_text;
1399 1399
 						} else {
1400
-							$cat_link .= $term . '/';
1401
-							$breadcrumb .= $separator . '<a href="' . $cat_link . '">' . $term_link_text . '</a>';
1400
+							$cat_link .= $term.'/';
1401
+							$breadcrumb .= $separator.'<a href="'.$cat_link.'">'.$term_link_text.'</a>';
1402 1402
 						}
1403
-						$term_index ++;
1403
+						$term_index++;
1404 1404
 					}
1405 1405
 				}
1406 1406
 
1407 1407
 
1408 1408
 			}
1409 1409
 
1410
-			if ( geodir_is_page( 'detail' ) ) {
1411
-				$breadcrumb .= $separator . get_the_title();
1410
+			if (geodir_is_page('detail')) {
1411
+				$breadcrumb .= $separator.get_the_title();
1412 1412
 			}
1413 1413
 
1414 1414
 			$breadcrumb .= '</li>';
1415 1415
 
1416 1416
 
1417
-		} elseif ( geodir_is_page( 'author' ) ) {
1417
+		} elseif (geodir_is_page('author')) {
1418 1418
 			$user_id             = get_current_user_id();
1419
-			$author_link         = get_author_posts_url( $user_id );
1420
-			$default_author_link = geodir_getlink( $author_link, array(
1419
+			$author_link         = get_author_posts_url($user_id);
1420
+			$default_author_link = geodir_getlink($author_link, array(
1421 1421
 				'geodir_dashbord' => 'true',
1422 1422
 				'stype'           => 'gd_place'
1423
-			), false );
1423
+			), false);
1424 1424
 
1425 1425
 			/**
1426 1426
 			 * Filter author page link.
@@ -1430,16 +1430,16 @@  discard block
 block discarded – undo
1430 1430
 			 * @param string $default_author_link Default author link.
1431 1431
 			 * @param int $user_id                Author ID.
1432 1432
 			 */
1433
-			$default_author_link = apply_filters( 'geodir_dashboard_author_link', $default_author_link, $user_id );
1433
+			$default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_id);
1434 1434
 
1435 1435
 			$breadcrumb .= '<li>';
1436
-			$breadcrumb .= $separator . '<a href="' . $default_author_link . '">' . __( 'My Dashboard', 'geodirectory' ) . '</a>';
1436
+			$breadcrumb .= $separator.'<a href="'.$default_author_link.'">'.__('My Dashboard', 'geodirectory').'</a>';
1437 1437
 
1438
-			if ( isset( $_REQUEST['list'] ) ) {
1439
-				$author_link = geodir_getlink( $author_link, array(
1438
+			if (isset($_REQUEST['list'])) {
1439
+				$author_link = geodir_getlink($author_link, array(
1440 1440
 					'geodir_dashbord' => 'true',
1441 1441
 					'stype'           => $_REQUEST['stype']
1442
-				), false );
1442
+				), false);
1443 1443
 
1444 1444
 				/**
1445 1445
 				 * Filter author page link.
@@ -1450,61 +1450,61 @@  discard block
 block discarded – undo
1450 1450
 				 * @param int $user_id        Author ID.
1451 1451
 				 * @param string $_REQUEST    ['stype'] Post type.
1452 1452
 				 */
1453
-				$author_link = apply_filters( 'geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype'] );
1453
+				$author_link = apply_filters('geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype']);
1454 1454
 
1455
-				$breadcrumb .= $separator . '<a href="' . $author_link . '">' . __( ucfirst( $post_type_info->label ), 'geodirectory' ) . '</a>';
1456
-				$breadcrumb .= $separator . ucfirst( __( 'My', 'geodirectory' ) . ' ' . $_REQUEST['list'] );
1455
+				$breadcrumb .= $separator.'<a href="'.$author_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1456
+				$breadcrumb .= $separator.ucfirst(__('My', 'geodirectory').' '.$_REQUEST['list']);
1457 1457
 			} else {
1458
-				$breadcrumb .= $separator . __( ucfirst( $post_type_info->label ), 'geodirectory' );
1458
+				$breadcrumb .= $separator.__(ucfirst($post_type_info->label), 'geodirectory');
1459 1459
 			}
1460 1460
 
1461 1461
 			$breadcrumb .= '</li>';
1462
-		} elseif ( is_category() || is_single() ) {
1462
+		} elseif (is_category() || is_single()) {
1463 1463
 			$category = get_the_category();
1464
-			if ( is_category() ) {
1465
-				$breadcrumb .= '<li>' . $separator . $category[0]->cat_name . '</li>';
1464
+			if (is_category()) {
1465
+				$breadcrumb .= '<li>'.$separator.$category[0]->cat_name.'</li>';
1466 1466
 			}
1467
-			if ( is_single() ) {
1468
-				$breadcrumb .= '<li>' . $separator . '<a href="' . get_category_link( $category[0]->term_id ) . '">' . $category[0]->cat_name . '</a></li>';
1469
-				$breadcrumb .= '<li>' . $separator . get_the_title() . '</li>';
1467
+			if (is_single()) {
1468
+				$breadcrumb .= '<li>'.$separator.'<a href="'.get_category_link($category[0]->term_id).'">'.$category[0]->cat_name.'</a></li>';
1469
+				$breadcrumb .= '<li>'.$separator.get_the_title().'</li>';
1470 1470
 			}
1471 1471
 			/* End of my version ##################################################### */
1472
-		} else if ( is_page() ) {
1472
+		} else if (is_page()) {
1473 1473
 			$page_title = get_the_title();
1474 1474
 
1475
-			if ( geodir_is_page( 'location' ) ) {
1475
+			if (geodir_is_page('location')) {
1476 1476
 				$location_page_id = geodir_location_page_id();
1477
-				$loc_post         = get_post( $location_page_id );
1477
+				$loc_post         = get_post($location_page_id);
1478 1478
 				$post_name        = $loc_post->post_name;
1479
-				$slug             = ucwords( str_replace( '-', ' ', $post_name ) );
1480
-				$page_title       = ! empty( $slug ) ? $slug : __( 'Location', 'geodirectory' );
1479
+				$slug             = ucwords(str_replace('-', ' ', $post_name));
1480
+				$page_title       = !empty($slug) ? $slug : __('Location', 'geodirectory');
1481 1481
 			}
1482 1482
 
1483
-			$breadcrumb .= '<li>' . $separator;
1484
-			$breadcrumb .= stripslashes_deep( $page_title );
1483
+			$breadcrumb .= '<li>'.$separator;
1484
+			$breadcrumb .= stripslashes_deep($page_title);
1485 1485
 			$breadcrumb .= '</li>';
1486
-		} else if ( is_tag() ) {
1487
-			$breadcrumb .= "<li> " . $separator . single_tag_title( '', false ) . '</li>';
1488
-		} else if ( is_day() ) {
1489
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1490
-			the_time( 'F jS, Y' );
1486
+		} else if (is_tag()) {
1487
+			$breadcrumb .= "<li> ".$separator.single_tag_title('', false).'</li>';
1488
+		} else if (is_day()) {
1489
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1490
+			the_time('F jS, Y');
1491 1491
 			$breadcrumb .= '</li>';
1492
-		} else if ( is_month() ) {
1493
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1494
-			the_time( 'F, Y' );
1492
+		} else if (is_month()) {
1493
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1494
+			the_time('F, Y');
1495 1495
 			$breadcrumb .= '</li>';
1496
-		} else if ( is_year() ) {
1497
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1498
-			the_time( 'Y' );
1496
+		} else if (is_year()) {
1497
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1498
+			the_time('Y');
1499 1499
 			$breadcrumb .= '</li>';
1500
-		} else if ( is_author() ) {
1501
-			$breadcrumb .= "<li> " . $separator . __( " Author Archive", 'geodirectory' );
1500
+		} else if (is_author()) {
1501
+			$breadcrumb .= "<li> ".$separator.__(" Author Archive", 'geodirectory');
1502 1502
 			$breadcrumb .= '</li>';
1503
-		} else if ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) {
1504
-			$breadcrumb .= "<li>" . $separator . __( "Blog Archives", 'geodirectory' );
1503
+		} else if (isset($_GET['paged']) && !empty($_GET['paged'])) {
1504
+			$breadcrumb .= "<li>".$separator.__("Blog Archives", 'geodirectory');
1505 1505
 			$breadcrumb .= '</li>';
1506
-		} else if ( is_search() ) {
1507
-			$breadcrumb .= "<li> " . $separator . __( " Search Results", 'geodirectory' );
1506
+		} else if (is_search()) {
1507
+			$breadcrumb .= "<li> ".$separator.__(" Search Results", 'geodirectory');
1508 1508
 			$breadcrumb .= '</li>';
1509 1509
 		}
1510 1510
 		$breadcrumb .= '</ul></div>';
@@ -1517,13 +1517,13 @@  discard block
 block discarded – undo
1517 1517
 		 * @param string $breadcrumb Breadcrumb HTML.
1518 1518
 		 * @param string $separator  Breadcrumb separator.
1519 1519
 		 */
1520
-		echo $breadcrumb = apply_filters( 'geodir_breadcrumb', $breadcrumb, $separator );
1520
+		echo $breadcrumb = apply_filters('geodir_breadcrumb', $breadcrumb, $separator);
1521 1521
 	}
1522 1522
 }
1523 1523
 
1524 1524
 
1525
-add_action( "admin_init", "geodir_allow_wpadmin" ); // check user is admin
1526
-if ( ! function_exists( 'geodir_allow_wpadmin' ) ) {
1525
+add_action("admin_init", "geodir_allow_wpadmin"); // check user is admin
1526
+if (!function_exists('geodir_allow_wpadmin')) {
1527 1527
 	/**
1528 1528
 	 * Allow only admins to access wp-admin.
1529 1529
 	 *
@@ -1535,12 +1535,12 @@  discard block
 block discarded – undo
1535 1535
 	 */
1536 1536
 	function geodir_allow_wpadmin() {
1537 1537
 		global $wpdb;
1538
-		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) // checking action in request to allow ajax request go through
1538
+		if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && (!defined('DOING_AJAX'))) // checking action in request to allow ajax request go through
1539 1539
 		{
1540
-			if ( current_user_can( 'administrator' ) ) {
1540
+			if (current_user_can('administrator')) {
1541 1541
 			} else {
1542 1542
 
1543
-				wp_redirect( home_url() );
1543
+				wp_redirect(home_url());
1544 1544
 				exit;
1545 1545
 			}
1546 1546
 
@@ -1559,23 +1559,23 @@  discard block
 block discarded – undo
1559 1559
  *
1560 1560
  * @return array|WP_Error The uploaded data as array. When failure returns error.
1561 1561
  */
1562
-function fetch_remote_file( $url ) {
1562
+function fetch_remote_file($url) {
1563 1563
 	// extract the file name and extension from the url
1564
-	require_once( ABSPATH . 'wp-includes/pluggable.php' );
1565
-	$file_name = basename( $url );
1566
-	if ( strpos( $file_name, '?' ) !== false ) {
1567
-		list( $file_name ) = explode( '?', $file_name );
1564
+	require_once(ABSPATH.'wp-includes/pluggable.php');
1565
+	$file_name = basename($url);
1566
+	if (strpos($file_name, '?') !== false) {
1567
+		list($file_name) = explode('?', $file_name);
1568 1568
 	}
1569 1569
 	$dummy        = false;
1570 1570
 	$add_to_cache = false;
1571 1571
 	$key          = null;
1572
-	if ( strpos( $url, '/dummy/' ) !== false ) {
1572
+	if (strpos($url, '/dummy/') !== false) {
1573 1573
 		$dummy = true;
1574
-		$key   = "dummy_" . str_replace( '.', '_', $file_name );
1575
-		$value = get_transient( 'cached_dummy_images' );
1576
-		if ( $value ) {
1577
-			if ( isset( $value[ $key ] ) ) {
1578
-				return $value[ $key ];
1574
+		$key   = "dummy_".str_replace('.', '_', $file_name);
1575
+		$value = get_transient('cached_dummy_images');
1576
+		if ($value) {
1577
+			if (isset($value[$key])) {
1578
+				return $value[$key];
1579 1579
 			} else {
1580 1580
 				$add_to_cache = true;
1581 1581
 			}
@@ -1586,58 +1586,58 @@  discard block
 block discarded – undo
1586 1586
 
1587 1587
 	// get placeholder file in the upload dir with a unique, sanitized filename
1588 1588
 
1589
-	$post_upload_date = isset( $post['upload_date'] ) ? $post['upload_date'] : '';
1589
+	$post_upload_date = isset($post['upload_date']) ? $post['upload_date'] : '';
1590 1590
 
1591
-	$upload = wp_upload_bits( $file_name, 0, '', $post_upload_date );
1592
-	if ( $upload['error'] ) {
1593
-		return new WP_Error( 'upload_dir_error', $upload['error'] );
1591
+	$upload = wp_upload_bits($file_name, 0, '', $post_upload_date);
1592
+	if ($upload['error']) {
1593
+		return new WP_Error('upload_dir_error', $upload['error']);
1594 1594
 	}
1595 1595
 
1596 1596
 
1597
-	sleep( 0.3 );// if multiple remote file this can cause the remote server to timeout so we add a slight delay
1597
+	sleep(0.3); // if multiple remote file this can cause the remote server to timeout so we add a slight delay
1598 1598
 
1599 1599
 	// fetch the remote url and write it to the placeholder file
1600
-	$headers = wp_remote_get( $url, array( 'stream' => true, 'filename' => $upload['file'] ) );
1600
+	$headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file']));
1601 1601
 
1602 1602
 	$log_message = '';
1603
-	if ( is_wp_error( $headers ) ) {
1604
-		echo 'file: ' . $url;
1603
+	if (is_wp_error($headers)) {
1604
+		echo 'file: '.$url;
1605 1605
 
1606
-		return new WP_Error( 'import_file_error', $headers->get_error_message() );
1606
+		return new WP_Error('import_file_error', $headers->get_error_message());
1607 1607
 	}
1608 1608
 
1609
-	$filesize = filesize( $upload['file'] );
1609
+	$filesize = filesize($upload['file']);
1610 1610
 	// request failed
1611
-	if ( ! $headers ) {
1612
-		$log_message = __( 'Remote server did not respond', 'geodirectory' );
1611
+	if (!$headers) {
1612
+		$log_message = __('Remote server did not respond', 'geodirectory');
1613 1613
 	} // make sure the fetch was successful
1614
-	elseif ( $headers['response']['code'] != '200' ) {
1615
-		$log_message = sprintf( __( 'Remote server returned error response %1$d %2$s', 'geodirectory' ), esc_html( $headers['response'] ), get_status_header_desc( $headers['response'] ) );
1616
-	} elseif ( isset( $headers['headers']['content-length'] ) && $filesize != $headers['headers']['content-length'] ) {
1617
-		$log_message = __( 'Remote file is incorrect size', 'geodirectory' );
1618
-	} elseif ( 0 == $filesize ) {
1619
-		$log_message = __( 'Zero size file downloaded', 'geodirectory' );
1620
-	}
1621
-
1622
-	if ( $log_message ) {
1623
-		$del = unlink( $upload['file'] );
1624
-		if ( ! $del ) {
1625
-			geodir_error_log( __( 'GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory' ) );
1614
+	elseif ($headers['response']['code'] != '200') {
1615
+		$log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response']));
1616
+	} elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) {
1617
+		$log_message = __('Remote file is incorrect size', 'geodirectory');
1618
+	} elseif (0 == $filesize) {
1619
+		$log_message = __('Zero size file downloaded', 'geodirectory');
1620
+	}
1621
+
1622
+	if ($log_message) {
1623
+		$del = unlink($upload['file']);
1624
+		if (!$del) {
1625
+			geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));
1626 1626
 		}
1627 1627
 
1628
-		return new WP_Error( 'import_file_error', $log_message );
1628
+		return new WP_Error('import_file_error', $log_message);
1629 1629
 	}
1630 1630
 
1631
-	if ( $dummy && $add_to_cache && is_array( $upload ) ) {
1632
-		$images = get_transient( 'cached_dummy_images' );
1633
-		if ( is_array( $images ) ) {
1634
-			$images[ $key ] = $upload;
1631
+	if ($dummy && $add_to_cache && is_array($upload)) {
1632
+		$images = get_transient('cached_dummy_images');
1633
+		if (is_array($images)) {
1634
+			$images[$key] = $upload;
1635 1635
 		} else {
1636
-			$images = array( $key => $upload );
1636
+			$images = array($key => $upload);
1637 1637
 		}
1638 1638
 
1639 1639
 		//setting the cache using the WP Transient API
1640
-		set_transient( 'cached_dummy_images', $images, 60 * 10 ); //10 minutes cache
1640
+		set_transient('cached_dummy_images', $images, 60 * 10); //10 minutes cache
1641 1641
 	}
1642 1642
 
1643 1643
 	return $upload;
@@ -1651,12 +1651,12 @@  discard block
 block discarded – undo
1651 1651
  * @return string|void Max upload size.
1652 1652
  */
1653 1653
 function geodir_max_upload_size() {
1654
-	$max_filesize = (float) get_option( 'geodir_upload_max_filesize', 2 );
1654
+	$max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1655 1655
 
1656
-	if ( $max_filesize > 0 && $max_filesize < 1 ) {
1657
-		$max_filesize = (int) ( $max_filesize * 1024 ) . 'kb';
1656
+	if ($max_filesize > 0 && $max_filesize < 1) {
1657
+		$max_filesize = (int) ($max_filesize * 1024).'kb';
1658 1658
 	} else {
1659
-		$max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1659
+		$max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1660 1660
 	}
1661 1661
 
1662 1662
 	/**
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
 	 *
1667 1667
 	 * @param string $max_filesize Max file upload size. Ex. 10mb, 512kb.
1668 1668
 	 */
1669
-	return apply_filters( 'geodir_default_image_upload_size_limit', $max_filesize );
1669
+	return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1670 1670
 }
1671 1671
 
1672 1672
 /**
@@ -1679,8 +1679,8 @@  discard block
 block discarded – undo
1679 1679
  * @return bool If dummy folder exists returns true, else false.
1680 1680
  */
1681 1681
 function geodir_dummy_folder_exists() {
1682
-	$path = geodir_plugin_path() . '/geodirectory-admin/dummy/';
1683
-	if ( ! is_dir( $path ) ) {
1682
+	$path = geodir_plugin_path().'/geodirectory-admin/dummy/';
1683
+	if (!is_dir($path)) {
1684 1684
 		return false;
1685 1685
 	} else {
1686 1686
 		return true;
@@ -1699,17 +1699,17 @@  discard block
 block discarded – undo
1699 1699
  *
1700 1700
  * @return object Author info.
1701 1701
  */
1702
-function geodir_get_author_info( $aid ) {
1702
+function geodir_get_author_info($aid) {
1703 1703
 	global $wpdb;
1704 1704
 	/*$infosql = "select * from $wpdb->users where ID=$aid";*/
1705
-	$infosql = $wpdb->prepare( "select * from $wpdb->users where ID=%d", array( $aid ) );
1706
-	$info    = $wpdb->get_results( $infosql );
1707
-	if ( $info ) {
1705
+	$infosql = $wpdb->prepare("select * from $wpdb->users where ID=%d", array($aid));
1706
+	$info    = $wpdb->get_results($infosql);
1707
+	if ($info) {
1708 1708
 		return $info[0];
1709 1709
 	}
1710 1710
 }
1711 1711
 
1712
-if ( ! function_exists( 'adminEmail' ) ) {
1712
+if (!function_exists('adminEmail')) {
1713 1713
 	/**
1714 1714
 	 * Send emails to client on post submission, renew etc.
1715 1715
 	 *
@@ -1722,67 +1722,67 @@  discard block
 block discarded – undo
1722 1722
 	 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1723 1723
 	 * @param string $custom_1     Custom data to be sent.
1724 1724
 	 */
1725
-	function adminEmail( $page_id, $user_id, $message_type, $custom_1 = '' ) {
1725
+	function adminEmail($page_id, $user_id, $message_type, $custom_1 = '') {
1726 1726
 		global $wpdb;
1727
-		if ( $message_type == 'expiration' ) {
1728
-			$subject        = stripslashes( __( get_option( 'renew_email_subject' ), 'geodirectory' ) );
1729
-			$client_message = stripslashes( __( get_option( 'renew_email_content' ), 'geodirectory' ) );
1730
-		} elseif ( $message_type == 'post_submited' ) {
1731
-			$subject        = __( get_option( 'post_submited_success_email_subject_admin' ), 'geodirectory' );
1732
-			$client_message = __( get_option( 'post_submited_success_email_content_admin' ), 'geodirectory' );
1733
-		} elseif ( $message_type == 'renew' ) {
1734
-			$subject        = __( get_option( 'post_renew_success_email_subject_admin' ), 'geodirectory' );
1735
-			$client_message = __( get_option( 'post_renew_success_email_content_admin' ), 'geodirectory' );
1736
-		} elseif ( $message_type == 'upgrade' ) {
1737
-			$subject        = __( get_option( 'post_upgrade_success_email_subject_admin' ), 'geodirectory' );
1738
-			$client_message = __( get_option( 'post_upgrade_success_email_content_admin' ), 'geodirectory' );
1739
-		} elseif ( $message_type == 'claim_approved' ) {
1740
-			$subject        = __( get_option( 'claim_approved_email_subject' ), 'geodirectory' );
1741
-			$client_message = __( get_option( 'claim_approved_email_content' ), 'geodirectory' );
1742
-		} elseif ( $message_type == 'claim_rejected' ) {
1743
-			$subject        = __( get_option( 'claim_rejected_email_subject' ), 'geodirectory' );
1744
-			$client_message = __( get_option( 'claim_rejected_email_content' ), 'geodirectory' );
1745
-		} elseif ( $message_type == 'claim_requested' ) {
1746
-			$subject        = __( get_option( 'claim_email_subject_admin' ), 'geodirectory' );
1747
-			$client_message = __( get_option( 'claim_email_content_admin' ), 'geodirectory' );
1748
-		} elseif ( $message_type == 'auto_claim' ) {
1749
-			$subject        = __( get_option( 'auto_claim_email_subject' ), 'geodirectory' );
1750
-			$client_message = __( get_option( 'auto_claim_email_content' ), 'geodirectory' );
1751
-		} elseif ( $message_type == 'payment_success' ) {
1752
-			$subject        = __( get_option( 'post_payment_success_admin_email_subject' ), 'geodirectory' );
1753
-			$client_message = __( get_option( 'post_payment_success_admin_email_content' ), 'geodirectory' );
1754
-		} elseif ( $message_type == 'payment_fail' ) {
1755
-			$subject        = __( get_option( 'post_payment_fail_admin_email_subject' ), 'geodirectory' );
1756
-			$client_message = __( get_option( 'post_payment_fail_admin_email_content' ), 'geodirectory' );
1727
+		if ($message_type == 'expiration') {
1728
+			$subject        = stripslashes(__(get_option('renew_email_subject'), 'geodirectory'));
1729
+			$client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory'));
1730
+		} elseif ($message_type == 'post_submited') {
1731
+			$subject        = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory');
1732
+			$client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory');
1733
+		} elseif ($message_type == 'renew') {
1734
+			$subject        = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory');
1735
+			$client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory');
1736
+		} elseif ($message_type == 'upgrade') {
1737
+			$subject        = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory');
1738
+			$client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory');
1739
+		} elseif ($message_type == 'claim_approved') {
1740
+			$subject        = __(get_option('claim_approved_email_subject'), 'geodirectory');
1741
+			$client_message = __(get_option('claim_approved_email_content'), 'geodirectory');
1742
+		} elseif ($message_type == 'claim_rejected') {
1743
+			$subject        = __(get_option('claim_rejected_email_subject'), 'geodirectory');
1744
+			$client_message = __(get_option('claim_rejected_email_content'), 'geodirectory');
1745
+		} elseif ($message_type == 'claim_requested') {
1746
+			$subject        = __(get_option('claim_email_subject_admin'), 'geodirectory');
1747
+			$client_message = __(get_option('claim_email_content_admin'), 'geodirectory');
1748
+		} elseif ($message_type == 'auto_claim') {
1749
+			$subject        = __(get_option('auto_claim_email_subject'), 'geodirectory');
1750
+			$client_message = __(get_option('auto_claim_email_content'), 'geodirectory');
1751
+		} elseif ($message_type == 'payment_success') {
1752
+			$subject        = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory');
1753
+			$client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory');
1754
+		} elseif ($message_type == 'payment_fail') {
1755
+			$subject        = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory');
1756
+			$client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory');
1757 1757
 		}
1758 1758
 		$transaction_details = $custom_1;
1759
-		$fromEmail           = get_option( 'site_email' );
1759
+		$fromEmail           = get_option('site_email');
1760 1760
 		$fromEmailName       = get_site_emailName();
1761 1761
 //$alivedays = get_post_meta($page_id,'alive_days',true);
1762
-		$pkg_limit            = get_property_price_info_listing( $page_id );
1762
+		$pkg_limit            = get_property_price_info_listing($page_id);
1763 1763
 		$alivedays            = $pkg_limit['days'];
1764
-		$productlink          = get_permalink( $page_id );
1765
-		$post_info            = get_post( $page_id );
1766
-		$post_date            = date( 'dS F,Y', strtotime( $post_info->post_date ) );
1767
-		$listingLink          = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1764
+		$productlink          = get_permalink($page_id);
1765
+		$post_info            = get_post($page_id);
1766
+		$post_date            = date('dS F,Y', strtotime($post_info->post_date));
1767
+		$listingLink          = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
1768 1768
 		$loginurl             = geodir_login_url();
1769
-		$loginurl_link        = '<a href="' . $loginurl . '">login</a>';
1769
+		$loginurl_link        = '<a href="'.$loginurl.'">login</a>';
1770 1770
 		$siteurl              = home_url();
1771
-		$siteurl_link         = '<a href="' . $siteurl . '">' . $fromEmailName . '</a>';
1772
-		$user_info            = get_userdata( $user_id );
1771
+		$siteurl_link         = '<a href="'.$siteurl.'">'.$fromEmailName.'</a>';
1772
+		$user_info            = get_userdata($user_id);
1773 1773
 		$user_email           = $user_info->user_email;
1774
-		$display_name         = geodir_get_client_name( $user_id );
1774
+		$display_name         = geodir_get_client_name($user_id);
1775 1775
 		$user_login           = $user_info->user_login;
1776
-		$number_of_grace_days = get_option( 'ptthemes_listing_preexpiry_notice_days' );
1777
-		if ( $number_of_grace_days == '' ) {
1776
+		$number_of_grace_days = get_option('ptthemes_listing_preexpiry_notice_days');
1777
+		if ($number_of_grace_days == '') {
1778 1778
 			$number_of_grace_days = 1;
1779 1779
 		}
1780
-		if ( $post_info->post_type == 'event' ) {
1780
+		if ($post_info->post_type == 'event') {
1781 1781
 			$post_type = 'event';
1782 1782
 		} else {
1783 1783
 			$post_type = 'listing';
1784 1784
 		}
1785
-		$renew_link     = '<a href="' . $siteurl . '?ptype=post_' . $post_type . '&renew=1&pid=' . $page_id . '">' . RENEW_LINK . '</a>';
1785
+		$renew_link     = '<a href="'.$siteurl.'?ptype=post_'.$post_type.'&renew=1&pid='.$page_id.'">'.RENEW_LINK.'</a>';
1786 1786
 		$search_array   = array(
1787 1787
 			'[#client_name#]',
1788 1788
 			'[#listing_link#]',
@@ -1798,7 +1798,7 @@  discard block
 block discarded – undo
1798 1798
 			'[#site_name#]',
1799 1799
 			'[#transaction_details#]'
1800 1800
 		);
1801
-		$replace_array  = array(
1801
+		$replace_array = array(
1802 1802
 			$display_name,
1803 1803
 			$listingLink,
1804 1804
 			$post_date,
@@ -1813,11 +1813,11 @@  discard block
 block discarded – undo
1813 1813
 			$fromEmailName,
1814 1814
 			$transaction_details
1815 1815
 		);
1816
-		$client_message = str_replace( $search_array, $replace_array, $client_message );
1817
-		$subject        = str_replace( $search_array, $replace_array, $subject );
1818
-		$headers        = 'MIME-Version: 1.0' . "\r\n";
1819
-		$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
1820
-		$headers .= 'From: ' . $fromEmailName . ' <' . $fromEmail . '>' . "\r\n";
1816
+		$client_message = str_replace($search_array, $replace_array, $client_message);
1817
+		$subject        = str_replace($search_array, $replace_array, $subject);
1818
+		$headers        = 'MIME-Version: 1.0'."\r\n";
1819
+		$headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
1820
+		$headers .= 'From: '.$fromEmailName.' <'.$fromEmail.'>'."\r\n";
1821 1821
 
1822 1822
 		$to      = $fromEmail;
1823 1823
 		$message = $client_message;
@@ -1835,7 +1835,7 @@  discard block
 block discarded – undo
1835 1835
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1836 1836
 		 * @param string $custom_1     Custom data to be sent.
1837 1837
 		 */
1838
-		$to = apply_filters( 'geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1 );
1838
+		$to = apply_filters('geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1);
1839 1839
 		/**
1840 1840
 		 * Filter the admin email subject.
1841 1841
 		 *
@@ -1848,7 +1848,7 @@  discard block
 block discarded – undo
1848 1848
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1849 1849
 		 * @param string $custom_1     Custom data to be sent.
1850 1850
 		 */
1851
-		$subject = apply_filters( 'geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1 );
1851
+		$subject = apply_filters('geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1);
1852 1852
 		/**
1853 1853
 		 * Filter the admin email message.
1854 1854
 		 *
@@ -1861,7 +1861,7 @@  discard block
 block discarded – undo
1861 1861
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1862 1862
 		 * @param string $custom_1     Custom data to be sent.
1863 1863
 		 */
1864
-		$message = apply_filters( 'geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1 );
1864
+		$message = apply_filters('geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1);
1865 1865
 		/**
1866 1866
 		 * Filter the admin email headers.
1867 1867
 		 *
@@ -1874,22 +1874,22 @@  discard block
 block discarded – undo
1874 1874
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1875 1875
 		 * @param string $custom_1     Custom data to be sent.
1876 1876
 		 */
1877
-		$headers = apply_filters( 'geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1 );
1877
+		$headers = apply_filters('geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1);
1878 1878
 
1879 1879
 
1880
-		$sent = wp_mail( $to, $subject, $message, $headers );
1881
-		if ( ! $sent ) {
1882
-			if ( is_array( $to ) ) {
1883
-				$to = implode( ',', $to );
1880
+		$sent = wp_mail($to, $subject, $message, $headers);
1881
+		if (!$sent) {
1882
+			if (is_array($to)) {
1883
+				$to = implode(',', $to);
1884 1884
 			}
1885 1885
 			$log_message = sprintf(
1886
-				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1886
+				__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1887 1887
 				$message_type,
1888
-				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1888
+				date_i18n('F j Y H:i:s', current_time('timestamp')),
1889 1889
 				$to,
1890 1890
 				$subject
1891 1891
 			);
1892
-			geodir_error_log( $log_message );
1892
+			geodir_error_log($log_message);
1893 1893
 		}
1894 1894
 	}
1895 1895
 }
@@ -1909,12 +1909,12 @@  discard block
 block discarded – undo
1909 1909
  *
1910 1910
  * @return array Category IDs.
1911 1911
  */
1912
-function gd_lang_object_ids( $ids_array, $type ) {
1913
-	if ( function_exists( 'icl_object_id' ) ) {
1912
+function gd_lang_object_ids($ids_array, $type) {
1913
+	if (function_exists('icl_object_id')) {
1914 1914
 		$res = array();
1915
-		foreach ( $ids_array as $id ) {
1916
-			$xlat = icl_object_id( $id, $type, false );
1917
-			if ( ! is_null( $xlat ) ) {
1915
+		foreach ($ids_array as $id) {
1916
+			$xlat = icl_object_id($id, $type, false);
1917
+			if (!is_null($xlat)) {
1918 1918
 				$res[] = $xlat;
1919 1919
 			}
1920 1920
 		}
@@ -1938,20 +1938,20 @@  discard block
 block discarded – undo
1938 1938
  *
1939 1939
  * @return array Modified Body CSS classes.
1940 1940
  */
1941
-function geodir_custom_posts_body_class( $classes ) {
1941
+function geodir_custom_posts_body_class($classes) {
1942 1942
 	global $wpdb, $wp;
1943
-	$post_types = geodir_get_posttypes( 'object' );
1944
-	if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) {
1943
+	$post_types = geodir_get_posttypes('object');
1944
+	if (!empty($post_types) && count((array) $post_types) > 1) {
1945 1945
 		$classes[] = 'geodir_custom_posts';
1946 1946
 	}
1947 1947
 
1948 1948
 	// fix body class for signup page
1949
-	if ( geodir_is_page( 'login' ) ) {
1949
+	if (geodir_is_page('login')) {
1950 1950
 		$new_classes   = array();
1951 1951
 		$new_classes[] = 'signup page-geodir-signup';
1952
-		if ( ! empty( $classes ) ) {
1953
-			foreach ( $classes as $class ) {
1954
-				if ( $class && $class != 'home' && $class != 'blog' ) {
1952
+		if (!empty($classes)) {
1953
+			foreach ($classes as $class) {
1954
+				if ($class && $class != 'home' && $class != 'blog') {
1955 1955
 					$new_classes[] = $class;
1956 1956
 				}
1957 1957
 			}
@@ -1959,14 +1959,14 @@  discard block
 block discarded – undo
1959 1959
 		$classes = $new_classes;
1960 1960
 	}
1961 1961
 
1962
-	if ( geodir_is_geodir_page() ) {
1962
+	if (geodir_is_geodir_page()) {
1963 1963
 		$classes[] = 'geodir-page';
1964 1964
 	}
1965 1965
 
1966 1966
 	return $classes;
1967 1967
 }
1968 1968
 
1969
-add_filter( 'body_class', 'geodir_custom_posts_body_class' ); // let's add a class to the body so we can style the new addition to the search
1969
+add_filter('body_class', 'geodir_custom_posts_body_class'); // let's add a class to the body so we can style the new addition to the search
1970 1970
 
1971 1971
 
1972 1972
 /**
@@ -1982,7 +1982,7 @@  discard block
 block discarded – undo
1982 1982
 	 *
1983 1983
 	 * @since 1.0.0
1984 1984
 	 */
1985
-	return apply_filters( 'geodir_map_zoom_level', array(
1985
+	return apply_filters('geodir_map_zoom_level', array(
1986 1986
 		1,
1987 1987
 		2,
1988 1988
 		3,
@@ -2002,7 +2002,7 @@  discard block
 block discarded – undo
2002 2002
 		17,
2003 2003
 		18,
2004 2004
 		19
2005
-	) );
2005
+	));
2006 2006
 
2007 2007
 }
2008 2008
 
@@ -2015,12 +2015,12 @@  discard block
 block discarded – undo
2015 2015
  *
2016 2016
  * @param string $geodir_option_name Option key.
2017 2017
  */
2018
-function geodir_option_version_backup( $geodir_option_name ) {
2018
+function geodir_option_version_backup($geodir_option_name) {
2019 2019
 	$version_date  = time();
2020
-	$geodir_option = get_option( $geodir_option_name );
2020
+	$geodir_option = get_option($geodir_option_name);
2021 2021
 
2022
-	if ( ! empty( $geodir_option ) ) {
2023
-		add_option( $geodir_option_name . '_' . $version_date, $geodir_option );
2022
+	if (!empty($geodir_option)) {
2023
+		add_option($geodir_option_name.'_'.$version_date, $geodir_option);
2024 2024
 	}
2025 2025
 }
2026 2026
 
@@ -2034,10 +2034,10 @@  discard block
 block discarded – undo
2034 2034
  *
2035 2035
  * @return int Page ID.
2036 2036
  */
2037
-function get_page_id_geodir_add_listing_page( $page_id ) {
2038
-	if ( geodir_wpml_multilingual_status() ) {
2037
+function get_page_id_geodir_add_listing_page($page_id) {
2038
+	if (geodir_wpml_multilingual_status()) {
2039 2039
 		$post_type = 'post_page';
2040
-		$page_id   = geodir_get_wpml_element_id( $page_id, $post_type );
2040
+		$page_id   = geodir_get_wpml_element_id($page_id, $post_type);
2041 2041
 	}
2042 2042
 
2043 2043
 	return $page_id;
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
  * @return bool Returns true when sitepress multilingual CMS active. else returns false.
2052 2052
  */
2053 2053
 function geodir_wpml_multilingual_status() {
2054
-	if ( function_exists( 'icl_object_id' ) ) {
2054
+	if (function_exists('icl_object_id')) {
2055 2055
 		return true;
2056 2056
 	}
2057 2057
 
@@ -2069,19 +2069,19 @@  discard block
 block discarded – undo
2069 2069
  *
2070 2070
  * @return int Element ID when exists. Else the page id.
2071 2071
  */
2072
-function geodir_get_wpml_element_id( $page_id, $post_type ) {
2072
+function geodir_get_wpml_element_id($page_id, $post_type) {
2073 2073
 	global $sitepress;
2074
-	if ( geodir_wpml_multilingual_status() && ! empty( $sitepress ) && isset( $sitepress->queries ) ) {
2075
-		$trid = $sitepress->get_element_trid( $page_id, $post_type );
2074
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
2075
+		$trid = $sitepress->get_element_trid($page_id, $post_type);
2076 2076
 
2077
-		if ( $trid > 0 ) {
2078
-			$translations = $sitepress->get_element_translations( $trid, $post_type );
2077
+		if ($trid > 0) {
2078
+			$translations = $sitepress->get_element_translations($trid, $post_type);
2079 2079
 
2080 2080
 			$lang = $sitepress->get_current_language();
2081 2081
 			$lang = $lang ? $lang : $sitepress->get_default_language();
2082 2082
 
2083
-			if ( ! empty( $translations ) && ! empty( $lang ) && isset( $translations[ $lang ] ) && isset( $translations[ $lang ]->element_id ) && ! empty( $translations[ $lang ]->element_id ) ) {
2084
-				$page_id = $translations[ $lang ]->element_id;
2083
+			if (!empty($translations) && !empty($lang) && isset($translations[$lang]) && isset($translations[$lang]->element_id) && !empty($translations[$lang]->element_id)) {
2084
+				$page_id = $translations[$lang]->element_id;
2085 2085
 			}
2086 2086
 		}
2087 2087
 	}
@@ -2098,15 +2098,15 @@  discard block
 block discarded – undo
2098 2098
  */
2099 2099
 function geodir_wpml_check_element_id() {
2100 2100
 	global $sitepress;
2101
-	if ( geodir_wpml_multilingual_status() && ! empty( $sitepress ) && isset( $sitepress->queries ) ) {
2101
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
2102 2102
 		$el_type      = 'post_page';
2103
-		$el_id        = get_option( 'geodir_add_listing_page' );
2103
+		$el_id        = get_option('geodir_add_listing_page');
2104 2104
 		$default_lang = $sitepress->get_default_language();
2105
-		$el_details   = $sitepress->get_element_language_details( $el_id, $el_type );
2105
+		$el_details   = $sitepress->get_element_language_details($el_id, $el_type);
2106 2106
 
2107
-		if ( ! ( $el_id > 0 && $default_lang && ! empty( $el_details ) && isset( $el_details->language_code ) && $el_details->language_code == $default_lang ) ) {
2108
-			if ( ! $el_details->source_language_code ) {
2109
-				$sitepress->set_element_language_details( $el_id, $el_type, '', $default_lang );
2107
+		if (!($el_id > 0 && $default_lang && !empty($el_details) && isset($el_details->language_code) && $el_details->language_code == $default_lang)) {
2108
+			if (!$el_details->source_language_code) {
2109
+				$sitepress->set_element_language_details($el_id, $el_type, '', $default_lang);
2110 2110
 				$sitepress->icl_translations_cache->clear();
2111 2111
 			}
2112 2112
 		}
@@ -2125,41 +2125,41 @@  discard block
 block discarded – undo
2125 2125
  *
2126 2126
  * @return string Orderby SQL.
2127 2127
  */
2128
-function geodir_widget_listings_get_order( $query_args ) {
2128
+function geodir_widget_listings_get_order($query_args) {
2129 2129
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2130 2130
 
2131 2131
 	$query_args = $gd_query_args_widgets;
2132
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2133
-		return $wpdb->posts . ".post_date DESC, ";
2132
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2133
+		return $wpdb->posts.".post_date DESC, ";
2134 2134
 	}
2135 2135
 
2136
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2137
-	$table     = $plugin_prefix . $post_type . '_detail';
2136
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2137
+	$table     = $plugin_prefix.$post_type.'_detail';
2138 2138
 
2139
-	$sort_by = ! empty( $query_args['order_by'] ) ? $query_args['order_by'] : '';
2139
+	$sort_by = !empty($query_args['order_by']) ? $query_args['order_by'] : '';
2140 2140
 
2141
-	switch ( $sort_by ) {
2141
+	switch ($sort_by) {
2142 2142
 		case 'latest':
2143 2143
 		case 'newest':
2144
-			$orderby = $wpdb->posts . ".post_date DESC, ";
2144
+			$orderby = $wpdb->posts.".post_date DESC, ";
2145 2145
 			break;
2146 2146
 		case 'featured':
2147
-			$orderby = $table . ".is_featured ASC, ";
2147
+			$orderby = $table.".is_featured ASC, ";
2148 2148
 			break;
2149 2149
 		case 'az':
2150
-			$orderby = $wpdb->posts . ".post_title ASC, ";
2150
+			$orderby = $wpdb->posts.".post_title ASC, ";
2151 2151
 			break;
2152 2152
 		case 'high_review':
2153
-			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
2153
+			$orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, ";
2154 2154
 			break;
2155 2155
 		case 'high_rating':
2156
-			$orderby = "( " . $table . ".overall_rating  ) DESC, ";
2156
+			$orderby = "( ".$table.".overall_rating  ) DESC, ";
2157 2157
 			break;
2158 2158
 		case 'random':
2159 2159
 			$orderby = "RAND(), ";
2160 2160
 			break;
2161 2161
 		default:
2162
-			$orderby = $wpdb->posts . ".post_title ASC, ";
2162
+			$orderby = $wpdb->posts.".post_title ASC, ";
2163 2163
 			break;
2164 2164
 	}
2165 2165
 
@@ -2181,15 +2181,15 @@  discard block
 block discarded – undo
2181 2181
  *
2182 2182
  * @return mixed Result object.
2183 2183
  */
2184
-function geodir_get_widget_listings( $query_args = array(), $count_only = false ) {
2184
+function geodir_get_widget_listings($query_args = array(), $count_only = false) {
2185 2185
 	global $wpdb, $plugin_prefix, $table_prefix;
2186 2186
 	$GLOBALS['gd_query_args_widgets'] = $query_args;
2187 2187
 	$gd_query_args_widgets            = $query_args;
2188 2188
 
2189
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2190
-	$table     = $plugin_prefix . $post_type . '_detail';
2189
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2190
+	$table     = $plugin_prefix.$post_type.'_detail';
2191 2191
 
2192
-	$fields = $wpdb->posts . ".*, " . $table . ".*";
2192
+	$fields = $wpdb->posts.".*, ".$table.".*";
2193 2193
 	/**
2194 2194
 	 * Filter widget listing fields string part that is being used for query.
2195 2195
 	 *
@@ -2199,17 +2199,17 @@  discard block
 block discarded – undo
2199 2199
 	 * @param string $table     Table name.
2200 2200
 	 * @param string $post_type Post type.
2201 2201
 	 */
2202
-	$fields = apply_filters( 'geodir_filter_widget_listings_fields', $fields, $table, $post_type );
2202
+	$fields = apply_filters('geodir_filter_widget_listings_fields', $fields, $table, $post_type);
2203 2203
 
2204
-	$join = "INNER JOIN " . $table . " ON (" . $table . ".post_id = " . $wpdb->posts . ".ID)";
2204
+	$join = "INNER JOIN ".$table." ON (".$table.".post_id = ".$wpdb->posts.".ID)";
2205 2205
 
2206 2206
 	########### WPML ###########
2207 2207
 
2208
-	if ( function_exists( 'icl_object_id' ) ) {
2208
+	if (function_exists('icl_object_id')) {
2209 2209
 		global $sitepress;
2210 2210
 		$lang_code = ICL_LANGUAGE_CODE;
2211
-		if ( $lang_code ) {
2212
-			$join .= " JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
2211
+		if ($lang_code) {
2212
+			$join .= " JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID";
2213 2213
 		}
2214 2214
 	}
2215 2215
 
@@ -2223,15 +2223,15 @@  discard block
 block discarded – undo
2223 2223
 	 * @param string $join      Join clause string.
2224 2224
 	 * @param string $post_type Post type.
2225 2225
 	 */
2226
-	$join = apply_filters( 'geodir_filter_widget_listings_join', $join, $post_type );
2226
+	$join = apply_filters('geodir_filter_widget_listings_join', $join, $post_type);
2227 2227
 
2228
-	$post_status = is_super_admin() ? " OR " . $wpdb->posts . ".post_status = 'private'" : '';
2228
+	$post_status = is_super_admin() ? " OR ".$wpdb->posts.".post_status = 'private'" : '';
2229 2229
 
2230
-	$where = " AND ( " . $wpdb->posts . ".post_status = 'publish' " . $post_status . " ) AND " . $wpdb->posts . ".post_type = '" . $post_type . "'";
2230
+	$where = " AND ( ".$wpdb->posts.".post_status = 'publish' ".$post_status." ) AND ".$wpdb->posts.".post_type = '".$post_type."'";
2231 2231
 
2232 2232
 	########### WPML ###########
2233
-	if ( function_exists( 'icl_object_id' ) ) {
2234
-		if ( $lang_code ) {
2233
+	if (function_exists('icl_object_id')) {
2234
+		if ($lang_code) {
2235 2235
 			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type = 'post_$post_type' ";
2236 2236
 		}
2237 2237
 	}
@@ -2244,8 +2244,8 @@  discard block
 block discarded – undo
2244 2244
 	 * @param string $where     Where clause string.
2245 2245
 	 * @param string $post_type Post type.
2246 2246
 	 */
2247
-	$where = apply_filters( 'geodir_filter_widget_listings_where', $where, $post_type );
2248
-	$where = $where != '' ? " WHERE 1=1 " . $where : '';
2247
+	$where = apply_filters('geodir_filter_widget_listings_where', $where, $post_type);
2248
+	$where = $where != '' ? " WHERE 1=1 ".$where : '';
2249 2249
 
2250 2250
 	$groupby = " GROUP BY $wpdb->posts.ID ";
2251 2251
 	/**
@@ -2256,15 +2256,15 @@  discard block
 block discarded – undo
2256 2256
 	 * @param string $groupby   Group by clause string.
2257 2257
 	 * @param string $post_type Post type.
2258 2258
 	 */
2259
-	$groupby = apply_filters( 'geodir_filter_widget_listings_groupby', $groupby, $post_type );
2259
+	$groupby = apply_filters('geodir_filter_widget_listings_groupby', $groupby, $post_type);
2260 2260
 
2261
-	if ( $count_only ) {
2262
-		$sql  = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . "
2263
-			" . $join . "
2261
+	if ($count_only) {
2262
+		$sql  = "SELECT COUNT(".$wpdb->posts.".ID) AS total FROM ".$wpdb->posts."
2263
+			" . $join."
2264 2264
 			" . $where;
2265
-		$rows = (int) $wpdb->get_var( $sql );
2265
+		$rows = (int) $wpdb->get_var($sql);
2266 2266
 	} else {
2267
-		$orderby = geodir_widget_listings_get_order( $query_args );
2267
+		$orderby = geodir_widget_listings_get_order($query_args);
2268 2268
 		/**
2269 2269
 		 * Filter widget listing orderby clause string part that is being used for query.
2270 2270
 		 *
@@ -2274,11 +2274,11 @@  discard block
 block discarded – undo
2274 2274
 		 * @param string $table     Table name.
2275 2275
 		 * @param string $post_type Post type.
2276 2276
 		 */
2277
-		$orderby = apply_filters( 'geodir_filter_widget_listings_orderby', $orderby, $table, $post_type );
2278
-		$orderby .= $wpdb->posts . ".post_title ASC";
2279
-		$orderby = $orderby != '' ? " ORDER BY " . $orderby : '';
2277
+		$orderby = apply_filters('geodir_filter_widget_listings_orderby', $orderby, $table, $post_type);
2278
+		$orderby .= $wpdb->posts.".post_title ASC";
2279
+		$orderby = $orderby != '' ? " ORDER BY ".$orderby : '';
2280 2280
 
2281
-		$limit = ! empty( $query_args['posts_per_page'] ) ? $query_args['posts_per_page'] : 5;
2281
+		$limit = !empty($query_args['posts_per_page']) ? $query_args['posts_per_page'] : 5;
2282 2282
 		/**
2283 2283
 		 * Filter widget listing limit that is being used for query.
2284 2284
 		 *
@@ -2287,26 +2287,26 @@  discard block
 block discarded – undo
2287 2287
 		 * @param int $limit        Query results limit.
2288 2288
 		 * @param string $post_type Post type.
2289 2289
 		 */
2290
-		$limit = apply_filters( 'geodir_filter_widget_listings_limit', $limit, $post_type );
2290
+		$limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type);
2291 2291
 
2292
-		$page = ! empty( $query_args['pageno'] ) ? absint( $query_args['pageno'] ) : 1;
2293
-		if ( ! $page ) {
2292
+		$page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1;
2293
+		if (!$page) {
2294 2294
 			$page = 1;
2295 2295
 		}
2296 2296
 
2297
-		$limit = (int) $limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int) $limit ) . ", " . (int) $limit : "";
2297
+		$limit = (int) $limit > 0 ? " LIMIT ".absint(($page - 1) * (int) $limit).", ".(int) $limit : "";
2298 2298
 
2299
-		$sql  = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . "
2300
-			" . $join . "
2301
-			" . $where . "
2302
-			" . $groupby . "
2303
-			" . $orderby . "
2299
+		$sql = "SELECT SQL_CALC_FOUND_ROWS ".$fields." FROM ".$wpdb->posts."
2300
+			" . $join."
2301
+			" . $where."
2302
+			" . $groupby."
2303
+			" . $orderby."
2304 2304
 			" . $limit;
2305
-		$rows = $wpdb->get_results( $sql );
2305
+		$rows = $wpdb->get_results($sql);
2306 2306
 	}
2307 2307
 
2308
-	unset( $GLOBALS['gd_query_args_widgets'] );
2309
-	unset( $gd_query_args_widgets );
2308
+	unset($GLOBALS['gd_query_args_widgets']);
2309
+	unset($gd_query_args_widgets);
2310 2310
 
2311 2311
 	return $rows;
2312 2312
 }
@@ -2323,11 +2323,11 @@  discard block
 block discarded – undo
2323 2323
  *
2324 2324
  * @return string Modified fields SQL.
2325 2325
  */
2326
-function geodir_function_widget_listings_fields( $fields ) {
2326
+function geodir_function_widget_listings_fields($fields) {
2327 2327
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2328 2328
 
2329 2329
 	$query_args = $gd_query_args_widgets;
2330
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2330
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2331 2331
 		return $fields;
2332 2332
 	}
2333 2333
 
@@ -2346,24 +2346,24 @@  discard block
 block discarded – undo
2346 2346
  *
2347 2347
  * @return string Modified join clause SQL.
2348 2348
  */
2349
-function geodir_function_widget_listings_join( $join ) {
2349
+function geodir_function_widget_listings_join($join) {
2350 2350
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2351 2351
 
2352 2352
 	$query_args = $gd_query_args_widgets;
2353
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2353
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2354 2354
 		return $join;
2355 2355
 	}
2356 2356
 
2357
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2358
-	$table     = $plugin_prefix . $post_type . '_detail';
2357
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2358
+	$table     = $plugin_prefix.$post_type.'_detail';
2359 2359
 
2360
-	if ( ! empty( $query_args['with_pics_only'] ) ) {
2361
-		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
2360
+	if (!empty($query_args['with_pics_only'])) {
2361
+		$join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )";
2362 2362
 	}
2363 2363
 
2364
-	if ( ! empty( $query_args['tax_query'] ) ) {
2365
-		$tax_queries = get_tax_sql( $query_args['tax_query'], $wpdb->posts, 'ID' );
2366
-		if ( ! empty( $tax_queries['join'] ) && ! empty( $tax_queries['where'] ) ) {
2364
+	if (!empty($query_args['tax_query'])) {
2365
+		$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2366
+		if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2367 2367
 			$join .= $tax_queries['join'];
2368 2368
 		}
2369 2369
 	}
@@ -2383,49 +2383,49 @@  discard block
 block discarded – undo
2383 2383
  *
2384 2384
  * @return string Modified where clause SQL.
2385 2385
  */
2386
-function geodir_function_widget_listings_where( $where ) {
2386
+function geodir_function_widget_listings_where($where) {
2387 2387
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2388 2388
 
2389 2389
 	$query_args = $gd_query_args_widgets;
2390
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2390
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2391 2391
 		return $where;
2392 2392
 	}
2393
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2394
-	$table     = $plugin_prefix . $post_type . '_detail';
2393
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2394
+	$table     = $plugin_prefix.$post_type.'_detail';
2395 2395
 
2396
-	if ( ! empty( $query_args ) ) {
2397
-		if ( ! empty( $query_args['gd_location'] ) && function_exists( 'geodir_default_location_where' ) ) {
2398
-			$where = geodir_default_location_where( $where, $table );
2396
+	if (!empty($query_args)) {
2397
+		if (!empty($query_args['gd_location']) && function_exists('geodir_default_location_where')) {
2398
+			$where = geodir_default_location_where($where, $table);
2399 2399
 		}
2400 2400
 
2401
-		if ( ! empty( $query_args['post_author'] ) ) {
2402
-			$where .= " AND " . $wpdb->posts . ".post_author = " . (int) $query_args['post_author'];
2401
+		if (!empty($query_args['post_author'])) {
2402
+			$where .= " AND ".$wpdb->posts.".post_author = ".(int) $query_args['post_author'];
2403 2403
 		}
2404 2404
 
2405
-		if ( ! empty( $query_args['show_featured_only'] ) ) {
2406
-			$where .= " AND " . $table . ".is_featured = '1'";
2405
+		if (!empty($query_args['show_featured_only'])) {
2406
+			$where .= " AND ".$table.".is_featured = '1'";
2407 2407
 		}
2408 2408
 
2409
-		if ( ! empty( $query_args['show_special_only'] ) ) {
2410
-			$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
2409
+		if (!empty($query_args['show_special_only'])) {
2410
+			$where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )";
2411 2411
 		}
2412 2412
 
2413
-		if ( ! empty( $query_args['with_pics_only'] ) ) {
2414
-			$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL ";
2413
+		if (!empty($query_args['with_pics_only'])) {
2414
+			$where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL ";
2415 2415
 		}
2416 2416
 
2417
-		if ( ! empty( $query_args['featured_image_only'] ) ) {
2418
-			$where .= " AND " . $table . ".featured_image IS NOT NULL AND " . $table . ".featured_image!='' ";
2417
+		if (!empty($query_args['featured_image_only'])) {
2418
+			$where .= " AND ".$table.".featured_image IS NOT NULL AND ".$table.".featured_image!='' ";
2419 2419
 		}
2420 2420
 
2421
-		if ( ! empty( $query_args['with_videos_only'] ) ) {
2422
-			$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
2421
+		if (!empty($query_args['with_videos_only'])) {
2422
+			$where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )";
2423 2423
 		}
2424 2424
 
2425
-		if ( ! empty( $query_args['tax_query'] ) ) {
2426
-			$tax_queries = get_tax_sql( $query_args['tax_query'], $wpdb->posts, 'ID' );
2425
+		if (!empty($query_args['tax_query'])) {
2426
+			$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2427 2427
 
2428
-			if ( ! empty( $tax_queries['join'] ) && ! empty( $tax_queries['where'] ) ) {
2428
+			if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2429 2429
 				$where .= $tax_queries['where'];
2430 2430
 			}
2431 2431
 		}
@@ -2446,11 +2446,11 @@  discard block
 block discarded – undo
2446 2446
  *
2447 2447
  * @return string Modified orderby clause SQL.
2448 2448
  */
2449
-function geodir_function_widget_listings_orderby( $orderby ) {
2449
+function geodir_function_widget_listings_orderby($orderby) {
2450 2450
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2451 2451
 
2452 2452
 	$query_args = $gd_query_args_widgets;
2453
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2453
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2454 2454
 		return $orderby;
2455 2455
 	}
2456 2456
 
@@ -2469,15 +2469,15 @@  discard block
 block discarded – undo
2469 2469
  *
2470 2470
  * @return int Query limit.
2471 2471
  */
2472
-function geodir_function_widget_listings_limit( $limit ) {
2472
+function geodir_function_widget_listings_limit($limit) {
2473 2473
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2474 2474
 
2475 2475
 	$query_args = $gd_query_args_widgets;
2476
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2476
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2477 2477
 		return $limit;
2478 2478
 	}
2479 2479
 
2480
-	if ( ! empty( $query_args ) && ! empty( $query_args['posts_per_page'] ) ) {
2480
+	if (!empty($query_args) && !empty($query_args['posts_per_page'])) {
2481 2481
 		$limit = (int) $query_args['posts_per_page'];
2482 2482
 	}
2483 2483
 
@@ -2495,12 +2495,12 @@  discard block
 block discarded – undo
2495 2495
  *
2496 2496
  * @return int Large size width.
2497 2497
  */
2498
-function geodir_media_image_large_width( $default = 800, $params = '' ) {
2499
-	$large_size_w = get_option( 'large_size_w' );
2498
+function geodir_media_image_large_width($default = 800, $params = '') {
2499
+	$large_size_w = get_option('large_size_w');
2500 2500
 	$large_size_w = $large_size_w > 0 ? $large_size_w : $default;
2501
-	$large_size_w = absint( $large_size_w );
2501
+	$large_size_w = absint($large_size_w);
2502 2502
 
2503
-	if ( ! get_option( 'geodir_use_wp_media_large_size' ) ) {
2503
+	if (!get_option('geodir_use_wp_media_large_size')) {
2504 2504
 		$large_size_w = 800;
2505 2505
 	}
2506 2506
 
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
 	 * @param int $default         Default width.
2514 2514
 	 * @param string|array $params Image parameters.
2515 2515
 	 */
2516
-	$large_size_w = apply_filters( 'geodir_filter_media_image_large_width', $large_size_w, $default, $params );
2516
+	$large_size_w = apply_filters('geodir_filter_media_image_large_width', $large_size_w, $default, $params);
2517 2517
 
2518 2518
 	return $large_size_w;
2519 2519
 }
@@ -2529,12 +2529,12 @@  discard block
 block discarded – undo
2529 2529
  *
2530 2530
  * @return int Large size height.
2531 2531
  */
2532
-function geodir_media_image_large_height( $default = 800, $params = '' ) {
2533
-	$large_size_h = get_option( 'large_size_h' );
2532
+function geodir_media_image_large_height($default = 800, $params = '') {
2533
+	$large_size_h = get_option('large_size_h');
2534 2534
 	$large_size_h = $large_size_h > 0 ? $large_size_h : $default;
2535
-	$large_size_h = absint( $large_size_h );
2535
+	$large_size_h = absint($large_size_h);
2536 2536
 
2537
-	if ( ! get_option( 'geodir_use_wp_media_large_size' ) ) {
2537
+	if (!get_option('geodir_use_wp_media_large_size')) {
2538 2538
 		$large_size_h = 800;
2539 2539
 	}
2540 2540
 
@@ -2547,7 +2547,7 @@  discard block
 block discarded – undo
2547 2547
 	 * @param int $default         Default height.
2548 2548
 	 * @param string|array $params Image parameters.
2549 2549
 	 */
2550
-	$large_size_h = apply_filters( 'geodir_filter_media_image_large_height', $large_size_h, $default, $params );
2550
+	$large_size_h = apply_filters('geodir_filter_media_image_large_height', $large_size_h, $default, $params);
2551 2551
 
2552 2552
 	return $large_size_h;
2553 2553
 }
@@ -2564,8 +2564,8 @@  discard block
 block discarded – undo
2564 2564
  *
2565 2565
  * @return string Sanitized name.
2566 2566
  */
2567
-function geodir_sanitize_location_name( $type, $name, $translate = true ) {
2568
-	if ( $name == '' ) {
2567
+function geodir_sanitize_location_name($type, $name, $translate = true) {
2568
+	if ($name == '') {
2569 2569
 		return null;
2570 2570
 	}
2571 2571
 
@@ -2574,13 +2574,13 @@  discard block
 block discarded – undo
2574 2574
 	$type = $type == 'gd_city' ? 'city' : $type;
2575 2575
 
2576 2576
 	$return = $name;
2577
-	if ( function_exists( 'get_actual_location_name' ) ) {
2578
-		$return = get_actual_location_name( $type, $name, $translate );
2577
+	if (function_exists('get_actual_location_name')) {
2578
+		$return = get_actual_location_name($type, $name, $translate);
2579 2579
 	} else {
2580
-		$return = preg_replace( '/-(\d+)$/', '', $return );
2581
-		$return = preg_replace( '/[_-]/', ' ', $return );
2582
-		$return = geodir_ucwords( $return );
2583
-		$return = $translate ? __( $return, 'geodirectory' ) : $return;
2580
+		$return = preg_replace('/-(\d+)$/', '', $return);
2581
+		$return = preg_replace('/[_-]/', ' ', $return);
2582
+		$return = geodir_ucwords($return);
2583
+		$return = $translate ? __($return, 'geodirectory') : $return;
2584 2584
 	}
2585 2585
 
2586 2586
 	return $return;
@@ -2595,14 +2595,14 @@  discard block
 block discarded – undo
2595 2595
  *
2596 2596
  * @param int $number Comments number.
2597 2597
  */
2598
-function geodir_comments_number( $number ) {
2598
+function geodir_comments_number($number) {
2599 2599
 
2600
-	if ( $number > 1 ) {
2601
-		$output = str_replace( '%', number_format_i18n( $number ), __( '% Reviews', 'geodirectory' ) );
2602
-	} elseif ( $number == 0 || $number == '' ) {
2603
-		$output = __( 'No Reviews', 'geodirectory' );
2600
+	if ($number > 1) {
2601
+		$output = str_replace('%', number_format_i18n($number), __('% Reviews', 'geodirectory'));
2602
+	} elseif ($number == 0 || $number == '') {
2603
+		$output = __('No Reviews', 'geodirectory');
2604 2604
 	} else { // must be one
2605
-		$output = __( '1 Review', 'geodirectory' );
2605
+		$output = __('1 Review', 'geodirectory');
2606 2606
 	}
2607 2607
 	echo $output;
2608 2608
 }
@@ -2617,18 +2617,18 @@  discard block
 block discarded – undo
2617 2617
  */
2618 2618
 function is_page_geodir_home() {
2619 2619
 	global $wpdb;
2620
-	$cur_url = str_replace( array( "https://", "http://", "www." ), array( '', '', '' ), geodir_curPageURL() );
2621
-	if ( function_exists( 'geodir_location_geo_home_link' ) ) {
2622
-		remove_filter( 'home_url', 'geodir_location_geo_home_link', 100000 );
2620
+	$cur_url = str_replace(array("https://", "http://", "www."), array('', '', ''), geodir_curPageURL());
2621
+	if (function_exists('geodir_location_geo_home_link')) {
2622
+		remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
2623 2623
 	}
2624
-	$home_url = home_url( '', 'http' );
2625
-	if ( function_exists( 'geodir_location_geo_home_link' ) ) {
2626
-		add_filter( 'home_url', 'geodir_location_geo_home_link', 100000, 2 );
2624
+	$home_url = home_url('', 'http');
2625
+	if (function_exists('geodir_location_geo_home_link')) {
2626
+		add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
2627 2627
 	}
2628
-	$home_url = str_replace( "www.", "", $home_url );
2629
-	if ( ( strpos( $home_url, $cur_url ) !== false || strpos( $home_url . '/', $cur_url ) !== false ) && ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) ) {
2628
+	$home_url = str_replace("www.", "", $home_url);
2629
+	if ((strpos($home_url, $cur_url) !== false || strpos($home_url.'/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page'))) {
2630 2630
 		return true;
2631
-	} elseif ( get_query_var( 'page_id' ) == get_option( 'page_on_front' ) && 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) {
2631
+	} elseif (get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page')) {
2632 2632
 		return true;
2633 2633
 	} else {
2634 2634
 		return false;
@@ -2648,18 +2648,18 @@  discard block
 block discarded – undo
2648 2648
  *
2649 2649
  * @return string The canonical URL.
2650 2650
  */
2651
-function geodir_wpseo_homepage_canonical( $url ) {
2651
+function geodir_wpseo_homepage_canonical($url) {
2652 2652
 	global $post;
2653 2653
 
2654
-	if ( is_page_geodir_home() ) {
2654
+	if (is_page_geodir_home()) {
2655 2655
 		return home_url();
2656 2656
 	}
2657 2657
 
2658 2658
 	return $url;
2659 2659
 }
2660 2660
 
2661
-add_filter( 'wpseo_canonical', 'geodir_wpseo_homepage_canonical', 10 );
2662
-add_filter( 'aioseop_canonical_url', 'geodir_wpseo_homepage_canonical', 10 );
2661
+add_filter('wpseo_canonical', 'geodir_wpseo_homepage_canonical', 10);
2662
+add_filter('aioseop_canonical_url', 'geodir_wpseo_homepage_canonical', 10);
2663 2663
 
2664 2664
 /**
2665 2665
  * Add extra fields to google maps script call.
@@ -2672,20 +2672,20 @@  discard block
 block discarded – undo
2672 2672
  *
2673 2673
  * @return string Modified extra string.
2674 2674
  */
2675
-function geodir_googlemap_script_extra_details_page( $extra ) {
2675
+function geodir_googlemap_script_extra_details_page($extra) {
2676 2676
 	global $post;
2677 2677
 	$add_google_places_api = false;
2678
-	if ( isset( $post->post_content ) && has_shortcode( $post->post_content, 'gd_add_listing' ) ) {
2678
+	if (isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
2679 2679
 		$add_google_places_api = true;
2680 2680
 	}
2681
-	if ( ! str_replace( 'libraries=places', '', $extra ) && ( geodir_is_page( 'detail' ) || $add_google_places_api ) ) {
2681
+	if (!str_replace('libraries=places', '', $extra) && (geodir_is_page('detail') || $add_google_places_api)) {
2682 2682
 		$extra .= "&amp;libraries=places";
2683 2683
 	}
2684 2684
 
2685 2685
 	return $extra;
2686 2686
 }
2687 2687
 
2688
-add_filter( 'geodir_googlemap_script_extra', 'geodir_googlemap_script_extra_details_page', 101, 1 );
2688
+add_filter('geodir_googlemap_script_extra', 'geodir_googlemap_script_extra_details_page', 101, 1);
2689 2689
 
2690 2690
 
2691 2691
 /**
@@ -2703,99 +2703,99 @@  discard block
 block discarded – undo
2703 2703
  *                                          after_widget.
2704 2704
  * @param array|string $instance            The settings for the particular instance of the widget.
2705 2705
  */
2706
-function geodir_popular_post_category_output( $args = '', $instance = '' ) {
2706
+function geodir_popular_post_category_output($args = '', $instance = '') {
2707 2707
 	// prints the widget
2708 2708
 	global $wpdb, $plugin_prefix, $geodir_post_category_str;
2709
-	extract( $args, EXTR_SKIP );
2709
+	extract($args, EXTR_SKIP);
2710 2710
 
2711 2711
 	echo $before_widget;
2712 2712
 
2713 2713
 	/** This filter is documented in geodirectory_widgets.php */
2714
-	$title = empty( $instance['title'] ) ? __( 'Popular Categories', 'geodirectory' ) : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
2714
+	$title = empty($instance['title']) ? __('Popular Categories', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2715 2715
 
2716 2716
 	$gd_post_type = geodir_get_current_posttype();
2717 2717
 
2718
-	$category_limit = isset( $instance['category_limit'] ) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2719
-	if ( ! empty( $gd_post_type ) ) {
2718
+	$category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2719
+	if (!empty($gd_post_type)) {
2720 2720
 		$default_post_type = $gd_post_type;
2721
-	} elseif ( isset( $instance['default_post_type'] ) && gdsc_is_post_type_valid( $instance['default_post_type'] ) ) {
2721
+	} elseif (isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type'])) {
2722 2722
 		$default_post_type = $instance['default_post_type'];
2723 2723
 	} else {
2724 2724
 		$all_gd_post_type  = geodir_get_posttypes();
2725
-		$default_post_type = ( isset( $all_gd_post_type[0] ) ) ? $all_gd_post_type[0] : '';
2725
+		$default_post_type = (isset($all_gd_post_type[0])) ? $all_gd_post_type[0] : '';
2726 2726
 	}
2727
-	$parent_only = !empty( $instance['parent_only'] ) ? true : false;
2727
+	$parent_only = !empty($instance['parent_only']) ? true : false;
2728 2728
 
2729 2729
 	$taxonomy = array();
2730
-	if ( ! empty( $gd_post_type ) ) {
2731
-		$taxonomy[] = $gd_post_type . "category";
2730
+	if (!empty($gd_post_type)) {
2731
+		$taxonomy[] = $gd_post_type."category";
2732 2732
 	} else {
2733
-		$taxonomy = geodir_get_taxonomies( $gd_post_type );
2733
+		$taxonomy = geodir_get_taxonomies($gd_post_type);
2734 2734
 	}
2735 2735
     
2736
-	$term_args = array( 'taxonomy' => $taxonomy );
2737
-	if ( $parent_only ) {
2736
+	$term_args = array('taxonomy' => $taxonomy);
2737
+	if ($parent_only) {
2738 2738
 		$term_args['parent'] = 0;
2739 2739
 	}
2740 2740
 
2741
-	$terms   = get_terms( $term_args );
2741
+	$terms   = get_terms($term_args);
2742 2742
 	$a_terms = array();
2743 2743
 	$b_terms = array();
2744 2744
 
2745
-	foreach ( $terms as $term ) {
2746
-		if ( $term->count > 0 ) {
2747
-			$a_terms[ $term->taxonomy ][] = $term;
2745
+	foreach ($terms as $term) {
2746
+		if ($term->count > 0) {
2747
+			$a_terms[$term->taxonomy][] = $term;
2748 2748
 		}
2749 2749
 	}
2750 2750
 
2751
-	if ( ! empty( $a_terms ) ) {
2752
-		foreach ( $a_terms as $b_key => $b_val ) {
2753
-			$b_terms[ $b_key ] = geodir_sort_terms( $b_val, 'count' );
2751
+	if (!empty($a_terms)) {
2752
+		foreach ($a_terms as $b_key => $b_val) {
2753
+			$b_terms[$b_key] = geodir_sort_terms($b_val, 'count');
2754 2754
 		}
2755 2755
 
2756
-		$default_taxonomy = $default_post_type != '' && isset( $b_terms[ $default_post_type . 'category' ] ) ? $default_post_type . 'category' : '';
2756
+		$default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type.'category']) ? $default_post_type.'category' : '';
2757 2757
 
2758 2758
 		$tax_change_output = '';
2759
-		if ( count( $b_terms ) > 1 ) {
2760
-			$tax_change_output .= "<select data-limit='$category_limit' data-parent='" . (int)$parent_only . "' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2761
-			foreach ( $b_terms as $key => $val ) {
2762
-				$ptype    = get_post_type_object( str_replace( "category", "", $key ) );
2763
-				$cpt_name = __( $ptype->labels->singular_name, 'geodirectory' );
2764
-				$tax_change_output .= "<option value='$key' " . selected( $key, $default_taxonomy, false ) . ">" . sprintf( __( '%s Categories', 'geodirectory' ), $cpt_name ) . "</option>";
2759
+		if (count($b_terms) > 1) {
2760
+			$tax_change_output .= "<select data-limit='$category_limit' data-parent='".(int) $parent_only."' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2761
+			foreach ($b_terms as $key => $val) {
2762
+				$ptype    = get_post_type_object(str_replace("category", "", $key));
2763
+				$cpt_name = __($ptype->labels->singular_name, 'geodirectory');
2764
+				$tax_change_output .= "<option value='$key' ".selected($key, $default_taxonomy, false).">".sprintf(__('%s Categories', 'geodirectory'), $cpt_name)."</option>";
2765 2765
 			}
2766 2766
 			$tax_change_output .= "</select>";
2767 2767
 		}
2768 2768
 
2769
-		if ( ! empty( $b_terms ) ) {
2770
-			$terms = $default_taxonomy != '' && isset( $b_terms[ $default_taxonomy ] ) ? $b_terms[ $default_taxonomy ] : reset( $b_terms );// get the first array
2771
-			global $cat_count;//make global so we can change via function
2769
+		if (!empty($b_terms)) {
2770
+			$terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array
2771
+			global $cat_count; //make global so we can change via function
2772 2772
 			$cat_count = 0;
2773 2773
 			?>
2774 2774
 			<div class="geodir-category-list-in clearfix">
2775 2775
 				<div class="geodir-cat-list clearfix">
2776 2776
 					<?php
2777
-					echo $before_title . __( $title ) . $after_title;
2777
+					echo $before_title.__($title).$after_title;
2778 2778
 
2779 2779
 					echo $tax_change_output;
2780 2780
 
2781 2781
 					echo '<ul class="geodir-popular-cat-list">';
2782 2782
 
2783
-					geodir_helper_cat_list_output( $terms, $category_limit );
2783
+					geodir_helper_cat_list_output($terms, $category_limit);
2784 2784
 
2785 2785
 					echo '</ul>';
2786 2786
 					?>
2787 2787
 				</div>
2788 2788
 				<?php
2789 2789
 				$hide = '';
2790
-				if ( $cat_count < $category_limit ) {
2790
+				if ($cat_count < $category_limit) {
2791 2791
 					$hide = 'style="display:none;"';
2792 2792
 				}
2793 2793
 				echo "<div class='geodir-cat-list-more' $hide >";
2794
-				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">' . __( 'More Categories', 'geodirectory' ) . '</a>';
2795
-				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">' . __( 'Less Categories', 'geodirectory' ) . '</a>';
2794
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">'.__('More Categories', 'geodirectory').'</a>';
2795
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">'.__('Less Categories', 'geodirectory').'</a>';
2796 2796
 				echo "</div>";
2797 2797
 				/* add scripts */
2798
-				add_action( 'wp_footer', 'geodir_popular_category_add_scripts', 100 );
2798
+				add_action('wp_footer', 'geodir_popular_category_add_scripts', 100);
2799 2799
 				?>
2800 2800
 			</div>
2801 2801
 			<?php
@@ -2814,25 +2814,25 @@  discard block
 block discarded – undo
2814 2814
  * @param array $terms                      An array of term objects.
2815 2815
  * @param int $category_limit               Number of categories to display by default.
2816 2816
  */
2817
-function geodir_helper_cat_list_output( $terms, $category_limit ) {
2817
+function geodir_helper_cat_list_output($terms, $category_limit) {
2818 2818
 	global $geodir_post_category_str, $cat_count;
2819 2819
 	$term_icons = geodir_get_term_icon();
2820 2820
 
2821 2821
 	$geodir_post_category_str = array();
2822 2822
 
2823 2823
 
2824
-	foreach ( $terms as $cat ) {
2825
-		$post_type     = str_replace( "category", "", $cat->taxonomy );
2826
-		$term_icon_url = ! empty( $term_icons ) && isset( $term_icons[ $cat->term_id ] ) ? $term_icons[ $cat->term_id ] : '';
2824
+	foreach ($terms as $cat) {
2825
+		$post_type     = str_replace("category", "", $cat->taxonomy);
2826
+		$term_icon_url = !empty($term_icons) && isset($term_icons[$cat->term_id]) ? $term_icons[$cat->term_id] : '';
2827 2827
 
2828
-		$cat_count ++;
2828
+		$cat_count++;
2829 2829
 
2830
-		$geodir_post_category_str[] = array( 'posttype' => $post_type, 'termid' => $cat->term_id );
2830
+		$geodir_post_category_str[] = array('posttype' => $post_type, 'termid' => $cat->term_id);
2831 2831
 
2832 2832
 		$class_row  = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show';
2833 2833
 		$total_post = $cat->count;
2834 2834
 
2835
-		$term_link = get_term_link( $cat, $cat->taxonomy );
2835
+		$term_link = get_term_link($cat, $cat->taxonomy);
2836 2836
 		/**
2837 2837
 		 * Filer the category term link.
2838 2838
 		 *
@@ -2842,11 +2842,11 @@  discard block
 block discarded – undo
2842 2842
 		 * @param int $cat          ->term_id The term id.
2843 2843
 		 * @param string $post_type Wordpress post type.
2844 2844
 		 */
2845
-		$term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type );
2845
+		$term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type);
2846 2846
 
2847
-		echo '<li class="' . $class_row . '"><a href="' . $term_link . '">';
2848
-		echo '<img alt="' . esc_attr( $cat->name ) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">';
2849
-		echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> ';
2847
+		echo '<li class="'.$class_row.'"><a href="'.$term_link.'">';
2848
+		echo '<img alt="'.esc_attr($cat->name).' icon" style="height:20px;vertical-align:middle;" src="'.$term_icon_url.'"/> <span class="cat-link">';
2849
+		echo $cat->name.'</span> <span class="geodir_term_class geodir_link_span geodir_category_class_'.$post_type.'_'.$cat->term_id.'">('.$total_post.')</span> ';
2850 2850
 		echo '</a></li>';
2851 2851
 	}
2852 2852
 }
@@ -2861,14 +2861,14 @@  discard block
 block discarded – undo
2861 2861
  * @param array|string $args     Display arguments including before_title, after_title, before_widget, and after_widget.
2862 2862
  * @param array|string $instance The settings for the particular instance of the widget.
2863 2863
  */
2864
-function geodir_listing_slider_widget_output( $args = '', $instance = '' ) {
2864
+function geodir_listing_slider_widget_output($args = '', $instance = '') {
2865 2865
 	// prints the widget
2866
-	extract( $args, EXTR_SKIP );
2866
+	extract($args, EXTR_SKIP);
2867 2867
 
2868 2868
 	echo $before_widget;
2869 2869
 
2870 2870
 	/** This filter is documented in geodirectory_widgets.php */
2871
-	$title = empty( $instance['title'] ) ? '' : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
2871
+	$title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2872 2872
 	/**
2873 2873
 	 * Filter the widget post type.
2874 2874
 	 *
@@ -2876,7 +2876,7 @@  discard block
 block discarded – undo
2876 2876
 	 *
2877 2877
 	 * @param string $instance ['post_type'] Post type of listing.
2878 2878
 	 */
2879
-	$post_type = empty( $instance['post_type'] ) ? 'gd_place' : apply_filters( 'widget_post_type', $instance['post_type'] );
2879
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
2880 2880
 	/**
2881 2881
 	 * Filter the widget's term.
2882 2882
 	 *
@@ -2884,7 +2884,7 @@  discard block
 block discarded – undo
2884 2884
 	 *
2885 2885
 	 * @param string $instance ['category'] Filter by term. Can be any valid term.
2886 2886
 	 */
2887
-	$category = empty( $instance['category'] ) ? '0' : apply_filters( 'widget_category', $instance['category'] );
2887
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
2888 2888
 	/**
2889 2889
 	 * Filter widget's "add_location_filter" value.
2890 2890
 	 *
@@ -2892,7 +2892,7 @@  discard block
 block discarded – undo
2892 2892
 	 *
2893 2893
 	 * @param string|bool $instance ['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
2894 2894
 	 */
2895
-	$add_location_filter = empty( $instance['add_location_filter'] ) ? '0' : apply_filters( 'widget_add_location_filter', $instance['add_location_filter'] );
2895
+	$add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
2896 2896
 	/**
2897 2897
 	 * Filter the widget listings limit.
2898 2898
 	 *
@@ -2900,7 +2900,7 @@  discard block
 block discarded – undo
2900 2900
 	 *
2901 2901
 	 * @param string $instance ['post_number'] Number of listings to display.
2902 2902
 	 */
2903
-	$post_number = empty( $instance['post_number'] ) ? '5' : apply_filters( 'widget_post_number', $instance['post_number'] );
2903
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
2904 2904
 	/**
2905 2905
 	 * Filter the widget listings limit shown at one time.
2906 2906
 	 *
@@ -2908,7 +2908,7 @@  discard block
 block discarded – undo
2908 2908
 	 *
2909 2909
 	 * @param string $instance ['max_show'] Number of listings to display on screen.
2910 2910
 	 */
2911
-	$max_show = empty( $instance['max_show'] ) ? '1' : apply_filters( 'widget_max_show', $instance['max_show'] );
2911
+	$max_show = empty($instance['max_show']) ? '1' : apply_filters('widget_max_show', $instance['max_show']);
2912 2912
 	/**
2913 2913
 	 * Filter the widget slide width.
2914 2914
 	 *
@@ -2916,7 +2916,7 @@  discard block
 block discarded – undo
2916 2916
 	 *
2917 2917
 	 * @param string $instance ['slide_width'] Width of the slides shown.
2918 2918
 	 */
2919
-	$slide_width = empty( $instance['slide_width'] ) ? '' : apply_filters( 'widget_slide_width', $instance['slide_width'] );
2919
+	$slide_width = empty($instance['slide_width']) ? '' : apply_filters('widget_slide_width', $instance['slide_width']);
2920 2920
 	/**
2921 2921
 	 * Filter widget's "show title" value.
2922 2922
 	 *
@@ -2924,7 +2924,7 @@  discard block
 block discarded – undo
2924 2924
 	 *
2925 2925
 	 * @param string|bool $instance ['show_title'] Do you want to display title? Can be 1 or 0.
2926 2926
 	 */
2927
-	$show_title = empty( $instance['show_title'] ) ? '' : apply_filters( 'widget_show_title', $instance['show_title'] );
2927
+	$show_title = empty($instance['show_title']) ? '' : apply_filters('widget_show_title', $instance['show_title']);
2928 2928
 	/**
2929 2929
 	 * Filter widget's "slideshow" value.
2930 2930
 	 *
@@ -2932,7 +2932,7 @@  discard block
 block discarded – undo
2932 2932
 	 *
2933 2933
 	 * @param int $instance ['slideshow'] Setup a slideshow for the slider to animate automatically.
2934 2934
 	 */
2935
-	$slideshow = empty( $instance['slideshow'] ) ? 0 : apply_filters( 'widget_slideshow', $instance['slideshow'] );
2935
+	$slideshow = empty($instance['slideshow']) ? 0 : apply_filters('widget_slideshow', $instance['slideshow']);
2936 2936
 	/**
2937 2937
 	 * Filter widget's "animationLoop" value.
2938 2938
 	 *
@@ -2940,7 +2940,7 @@  discard block
 block discarded – undo
2940 2940
 	 *
2941 2941
 	 * @param int $instance ['animationLoop'] Gives the slider a seamless infinite loop.
2942 2942
 	 */
2943
-	$animationLoop = empty( $instance['animationLoop'] ) ? 0 : apply_filters( 'widget_animationLoop', $instance['animationLoop'] );
2943
+	$animationLoop = empty($instance['animationLoop']) ? 0 : apply_filters('widget_animationLoop', $instance['animationLoop']);
2944 2944
 	/**
2945 2945
 	 * Filter widget's "directionNav" value.
2946 2946
 	 *
@@ -2948,7 +2948,7 @@  discard block
 block discarded – undo
2948 2948
 	 *
2949 2949
 	 * @param int $instance ['directionNav'] Enable previous/next arrow navigation?. Can be 1 or 0.
2950 2950
 	 */
2951
-	$directionNav = empty( $instance['directionNav'] ) ? 0 : apply_filters( 'widget_directionNav', $instance['directionNav'] );
2951
+	$directionNav = empty($instance['directionNav']) ? 0 : apply_filters('widget_directionNav', $instance['directionNav']);
2952 2952
 	/**
2953 2953
 	 * Filter widget's "slideshowSpeed" value.
2954 2954
 	 *
@@ -2956,7 +2956,7 @@  discard block
 block discarded – undo
2956 2956
 	 *
2957 2957
 	 * @param int $instance ['slideshowSpeed'] Set the speed of the slideshow cycling, in milliseconds.
2958 2958
 	 */
2959
-	$slideshowSpeed = empty( $instance['slideshowSpeed'] ) ? 5000 : apply_filters( 'widget_slideshowSpeed', $instance['slideshowSpeed'] );
2959
+	$slideshowSpeed = empty($instance['slideshowSpeed']) ? 5000 : apply_filters('widget_slideshowSpeed', $instance['slideshowSpeed']);
2960 2960
 	/**
2961 2961
 	 * Filter widget's "animationSpeed" value.
2962 2962
 	 *
@@ -2964,7 +2964,7 @@  discard block
 block discarded – undo
2964 2964
 	 *
2965 2965
 	 * @param int $instance ['animationSpeed'] Set the speed of animations, in milliseconds.
2966 2966
 	 */
2967
-	$animationSpeed = empty( $instance['animationSpeed'] ) ? 600 : apply_filters( 'widget_animationSpeed', $instance['animationSpeed'] );
2967
+	$animationSpeed = empty($instance['animationSpeed']) ? 600 : apply_filters('widget_animationSpeed', $instance['animationSpeed']);
2968 2968
 	/**
2969 2969
 	 * Filter widget's "animation" value.
2970 2970
 	 *
@@ -2972,7 +2972,7 @@  discard block
 block discarded – undo
2972 2972
 	 *
2973 2973
 	 * @param string $instance ['animation'] Controls the animation type, "fade" or "slide".
2974 2974
 	 */
2975
-	$animation = empty( $instance['animation'] ) ? 'slide' : apply_filters( 'widget_animation', $instance['animation'] );
2975
+	$animation = empty($instance['animation']) ? 'slide' : apply_filters('widget_animation', $instance['animation']);
2976 2976
 	/**
2977 2977
 	 * Filter widget's "list_sort" type.
2978 2978
 	 *
@@ -2980,10 +2980,10 @@  discard block
 block discarded – undo
2980 2980
 	 *
2981 2981
 	 * @param string $instance ['list_sort'] Listing sort by type.
2982 2982
 	 */
2983
-	$list_sort          = empty( $instance['list_sort'] ) ? 'latest' : apply_filters( 'widget_list_sort', $instance['list_sort'] );
2984
-	$show_featured_only = ! empty( $instance['show_featured_only'] ) ? 1 : null;
2983
+	$list_sort          = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
2984
+	$show_featured_only = !empty($instance['show_featured_only']) ? 1 : null;
2985 2985
 
2986
-	wp_enqueue_script( 'geodirectory-jquery-flexslider-js' );
2986
+	wp_enqueue_script('geodirectory-jquery-flexslider-js');
2987 2987
 	?>
2988 2988
 	<script type="text/javascript">
2989 2989
 		jQuery(window).load(function () {
@@ -2998,23 +2998,23 @@  discard block
 block discarded – undo
2998 2998
 				itemWidth: 75,
2999 2999
 				itemMargin: 5,
3000 3000
 				asNavFor: '#geodir_widget_slider',
3001
-				rtl: <?php echo( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
3001
+				rtl: <?php echo(is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
3002 3002
 			});
3003 3003
 
3004 3004
 			jQuery('#geodir_widget_slider').flexslider({
3005
-				animation: "<?php echo $animation;?>",
3005
+				animation: "<?php echo $animation; ?>",
3006 3006
 				selector: ".geodir-slides > li",
3007 3007
 				namespace: "geodir-",
3008 3008
 				controlNav: true,
3009
-				animationLoop: <?php echo $animationLoop;?>,
3010
-				slideshow: <?php echo $slideshow;?>,
3011
-				slideshowSpeed: <?php echo $slideshowSpeed;?>,
3012
-				animationSpeed: <?php echo $animationSpeed;?>,
3013
-				directionNav: <?php echo $directionNav;?>,
3014
-				maxItems: <?php echo $max_show;?>,
3009
+				animationLoop: <?php echo $animationLoop; ?>,
3010
+				slideshow: <?php echo $slideshow; ?>,
3011
+				slideshowSpeed: <?php echo $slideshowSpeed; ?>,
3012
+				animationSpeed: <?php echo $animationSpeed; ?>,
3013
+				directionNav: <?php echo $directionNav; ?>,
3014
+				maxItems: <?php echo $max_show; ?>,
3015 3015
 				move: 1,
3016
-				<?php if ( $slide_width ) {
3017
-				echo "itemWidth: " . $slide_width . ",";
3016
+				<?php if ($slide_width) {
3017
+				echo "itemWidth: ".$slide_width.",";
3018 3018
 			}?>
3019 3019
 				sync: "#geodir_widget_carousel",
3020 3020
 				start: function (slider) {
@@ -3022,7 +3022,7 @@  discard block
 block discarded – undo
3022 3022
 					jQuery('#geodir_widget_slider').css({'visibility': 'visible'});
3023 3023
 					jQuery('#geodir_widget_carousel').css({'visibility': 'visible'});
3024 3024
 				},
3025
-				rtl: <?php echo( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
3025
+				rtl: <?php echo(is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
3026 3026
 			});
3027 3027
 		});
3028 3028
 	</script>
@@ -3035,62 +3035,62 @@  discard block
 block discarded – undo
3035 3035
 		'order_by'       => $list_sort
3036 3036
 	);
3037 3037
 
3038
-	if ( $show_featured_only ) {
3038
+	if ($show_featured_only) {
3039 3039
 		$query_args['show_featured_only'] = 1;
3040 3040
 	}
3041 3041
 
3042
-	if ( $category != 0 || $category != '' ) {
3043
-		$category_taxonomy = geodir_get_taxonomies( $post_type );
3042
+	if ($category != 0 || $category != '') {
3043
+		$category_taxonomy = geodir_get_taxonomies($post_type);
3044 3044
 		$tax_query         = array(
3045 3045
 			'taxonomy' => $category_taxonomy[0],
3046 3046
 			'field'    => 'id',
3047 3047
 			'terms'    => $category
3048 3048
 		);
3049 3049
 
3050
-		$query_args['tax_query'] = array( $tax_query );
3050
+		$query_args['tax_query'] = array($tax_query);
3051 3051
 	}
3052 3052
 
3053 3053
 	// we want listings with featured image only
3054 3054
 	$query_args['featured_image_only'] = 1;
3055 3055
 
3056
-	if ( $post_type == 'gd_event' ) {
3056
+	if ($post_type == 'gd_event') {
3057 3057
 		$query_args['gedir_event_listing_filter'] = 'upcoming';
3058 3058
 	}// show only upcoming events
3059 3059
 
3060
-	$widget_listings = geodir_get_widget_listings( $query_args );
3061
-	if ( ! empty( $widget_listings ) || ( isset( $with_no_results ) && $with_no_results ) ) {
3062
-		if ( $title ) {
3063
-			echo $before_title . $title . $after_title;
3060
+	$widget_listings = geodir_get_widget_listings($query_args);
3061
+	if (!empty($widget_listings) || (isset($with_no_results) && $with_no_results)) {
3062
+		if ($title) {
3063
+			echo $before_title.$title.$after_title;
3064 3064
 		}
3065 3065
 
3066 3066
 		global $post;
3067 3067
 
3068
-		$current_post = $post;// keep current post info
3068
+		$current_post = $post; // keep current post info
3069 3069
 
3070 3070
 		$widget_main_slides = '';
3071 3071
 		$nav_slides         = '';
3072 3072
 		$widget_slides      = 0;
3073 3073
 
3074
-		foreach ( $widget_listings as $widget_listing ) {
3074
+		foreach ($widget_listings as $widget_listing) {
3075 3075
 			global $gd_widget_listing_type;
3076 3076
 			$post         = $widget_listing;
3077
-			$widget_image = geodir_get_featured_image( $post->ID, 'thumbnail', get_option( 'geodir_listing_no_img' ) );
3077
+			$widget_image = geodir_get_featured_image($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
3078 3078
 
3079
-			if ( ! empty( $widget_image ) ) {
3080
-				if ( $widget_image->height >= 200 ) {
3079
+			if (!empty($widget_image)) {
3080
+				if ($widget_image->height >= 200) {
3081 3081
 					$widget_spacer_height = 0;
3082 3082
 				} else {
3083
-					$widget_spacer_height = ( ( 200 - $widget_image->height ) / 2 );
3083
+					$widget_spacer_height = ((200 - $widget_image->height) / 2);
3084 3084
 				}
3085 3085
 
3086
-				$widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:' . $widget_spacer_height . 'px !important;margin:0 auto;" width="100" />';
3086
+				$widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:'.$widget_spacer_height.'px !important;margin:0 auto;" width="100" />';
3087 3087
 
3088 3088
 				$title = '';
3089
-				if ( $show_title ) {
3090
-					$title_html     = '<div class="geodir-slider-title"><a href="' . get_permalink( $post->ID ) . '">' . get_the_title( $post->ID ) . '</a></div>';
3089
+				if ($show_title) {
3090
+					$title_html     = '<div class="geodir-slider-title"><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a></div>';
3091 3091
 					$post_id        = $post->ID;
3092
-					$post_permalink = get_permalink( $post->ID );
3093
-					$post_title     = get_the_title( $post->ID );
3092
+					$post_permalink = get_permalink($post->ID);
3093
+					$post_title     = get_the_title($post->ID);
3094 3094
 					/**
3095 3095
 					 * Filter the listing slider widget title.
3096 3096
 					 *
@@ -3101,12 +3101,12 @@  discard block
 block discarded – undo
3101 3101
 					 * @param string $post_permalink The post permalink url.
3102 3102
 					 * @param string $post_title     The post title text.
3103 3103
 					 */
3104
-					$title = apply_filters( 'geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title );
3104
+					$title = apply_filters('geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title);
3105 3105
 				}
3106 3106
 
3107
-				$widget_main_slides .= $title . '<img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:200px;margin:0 auto;" /></li>';
3108
-				$nav_slides .= '<li><img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
3109
-				$widget_slides ++;
3107
+				$widget_main_slides .= $title.'<img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:200px;margin:0 auto;" /></li>';
3108
+				$nav_slides .= '<li><img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
3109
+				$widget_slides++;
3110 3110
 			}
3111 3111
 		}
3112 3112
 		?>
@@ -3115,7 +3115,7 @@  discard block
 block discarded – undo
3115 3115
 			<div id="geodir_widget_slider" class="geodir_flexslider">
3116 3116
 				<ul class="geodir-slides clearfix"><?php echo $widget_main_slides; ?></ul>
3117 3117
 			</div>
3118
-			<?php if ( $widget_slides > 1 ) { ?>
3118
+			<?php if ($widget_slides > 1) { ?>
3119 3119
 				<div id="geodir_widget_carousel" class="geodir_flexslider">
3120 3120
 					<ul class="geodir-slides clearfix"><?php echo $nav_slides; ?></ul>
3121 3121
 				</div>
@@ -3123,7 +3123,7 @@  discard block
 block discarded – undo
3123 3123
 		</div>
3124 3124
 		<?php
3125 3125
 		$GLOBALS['post'] = $current_post;
3126
-		setup_postdata( $current_post );
3126
+		setup_postdata($current_post);
3127 3127
 	}
3128 3128
 	echo $after_widget;
3129 3129
 }
@@ -3139,46 +3139,46 @@  discard block
 block discarded – undo
3139 3139
  * @param array|string $args     Display arguments including before_title, after_title, before_widget, and after_widget.
3140 3140
  * @param array|string $instance The settings for the particular instance of the widget.
3141 3141
  */
3142
-function geodir_loginwidget_output( $args = '', $instance = '' ) {
3142
+function geodir_loginwidget_output($args = '', $instance = '') {
3143 3143
 	//print_r($args);
3144 3144
 	//print_r($instance);
3145 3145
 	// prints the widget
3146
-	extract( $args, EXTR_SKIP );
3146
+	extract($args, EXTR_SKIP);
3147 3147
 
3148 3148
 	/** This filter is documented in geodirectory_widgets.php */
3149
-	$title = empty( $instance['title'] ) ? __( 'My Dashboard', 'geodirectory' ) : apply_filters( 'my_dashboard_widget_title', __( $instance['title'], 'geodirectory' ) );
3149
+	$title = empty($instance['title']) ? __('My Dashboard', 'geodirectory') : apply_filters('my_dashboard_widget_title', __($instance['title'], 'geodirectory'));
3150 3150
 
3151 3151
 	echo $before_widget;
3152
-	echo $before_title . $title . $after_title;
3152
+	echo $before_title.$title.$after_title;
3153 3153
 
3154
-	if ( is_user_logged_in() ) {
3154
+	if (is_user_logged_in()) {
3155 3155
 		global $current_user;
3156 3156
 
3157
-		$author_link = get_author_posts_url( $current_user->data->ID );
3158
-		$author_link = geodir_getlink( $author_link, array( 'geodir_dashbord' => 'true' ), false );
3157
+		$author_link = get_author_posts_url($current_user->data->ID);
3158
+		$author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);
3159 3159
 
3160 3160
 		echo '<ul class="geodir-loginbox-list">';
3161 3161
 		ob_start();
3162 3162
 		?>
3163 3163
 		<li><a class="signin"
3164
-		       href="<?php echo wp_logout_url( home_url() ); ?>"><?php _e( 'Logout', 'geodirectory' ); ?></a></li>
3164
+		       href="<?php echo wp_logout_url(home_url()); ?>"><?php _e('Logout', 'geodirectory'); ?></a></li>
3165 3165
 		<?php
3166
-		$post_types                           = geodir_get_posttypes( 'object' );
3167
-		$show_add_listing_post_types_main_nav = get_option( 'geodir_add_listing_link_user_dashboard' );
3168
-		$geodir_allow_posttype_frontend       = get_option( 'geodir_allow_posttype_frontend' );
3166
+		$post_types                           = geodir_get_posttypes('object');
3167
+		$show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_user_dashboard');
3168
+		$geodir_allow_posttype_frontend       = get_option('geodir_allow_posttype_frontend');
3169 3169
 
3170
-		if ( ! empty( $show_add_listing_post_types_main_nav ) ) {
3170
+		if (!empty($show_add_listing_post_types_main_nav)) {
3171 3171
 			$addlisting_links = '';
3172
-			foreach ( $post_types as $key => $postobj ) {
3172
+			foreach ($post_types as $key => $postobj) {
3173 3173
 
3174
-				if ( in_array( $key, $show_add_listing_post_types_main_nav ) ) {
3174
+				if (in_array($key, $show_add_listing_post_types_main_nav)) {
3175 3175
 
3176
-					if ( $add_link = geodir_get_addlisting_link( $key ) ) {
3176
+					if ($add_link = geodir_get_addlisting_link($key)) {
3177 3177
 
3178 3178
 						$name = $postobj->labels->name;
3179 3179
 
3180 3180
 						$selected = '';
3181
-						if ( geodir_get_current_posttype() == $key && geodir_is_page( 'add-listing' ) ) {
3181
+						if (geodir_get_current_posttype() == $key && geodir_is_page('add-listing')) {
3182 3182
 							$selected = 'selected="selected"';
3183 3183
 						}
3184 3184
 
@@ -3191,22 +3191,22 @@  discard block
 block discarded – undo
3191 3191
 						 * @param string $key       Add listing array key.
3192 3192
 						 * @param int $current_user ->ID Current user ID.
3193 3193
 						 */
3194
-						$add_link = apply_filters( 'geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID );
3194
+						$add_link = apply_filters('geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID);
3195 3195
 
3196
-						$addlisting_links .= '<option ' . $selected . ' value="' . $add_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3196
+						$addlisting_links .= '<option '.$selected.' value="'.$add_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3197 3197
 
3198 3198
 					}
3199 3199
 				}
3200 3200
 
3201 3201
 			}
3202 3202
 
3203
-			if ( $addlisting_links != '' ) { ?>
3203
+			if ($addlisting_links != '') { ?>
3204 3204
 
3205 3205
 				<li><select id="geodir_add_listing" class="chosen_select" onchange="window.location.href=this.value"
3206 3206
 				            option-autoredirect="1" name="geodir_add_listing" option-ajaxchosen="false"
3207
-				            data-placeholder="<?php echo esc_attr( __( 'Add Listing', 'geodirectory' ) ); ?>">
3207
+				            data-placeholder="<?php echo esc_attr(__('Add Listing', 'geodirectory')); ?>">
3208 3208
 						<option value="" disabled="disabled" selected="selected"
3209
-						        style='display:none;'><?php echo esc_attr( __( 'Add Listing', 'geodirectory' ) ); ?></option>
3209
+						        style='display:none;'><?php echo esc_attr(__('Add Listing', 'geodirectory')); ?></option>
3210 3210
 						<?php echo $addlisting_links; ?>
3211 3211
 					</select></li> <?php
3212 3212
 
@@ -3214,23 +3214,23 @@  discard block
 block discarded – undo
3214 3214
 
3215 3215
 		}
3216 3216
 		// My Favourites in Dashboard
3217
-		$show_favorite_link_user_dashboard = get_option( 'geodir_favorite_link_user_dashboard' );
3217
+		$show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard');
3218 3218
 		$user_favourite                    = geodir_user_favourite_listing_count();
3219 3219
 
3220
-		if ( ! empty( $show_favorite_link_user_dashboard ) && ! empty( $user_favourite ) ) {
3220
+		if (!empty($show_favorite_link_user_dashboard) && !empty($user_favourite)) {
3221 3221
 			$favourite_links = '';
3222 3222
 
3223
-			foreach ( $post_types as $key => $postobj ) {
3224
-				if ( in_array( $key, $show_favorite_link_user_dashboard ) && array_key_exists( $key, $user_favourite ) ) {
3223
+			foreach ($post_types as $key => $postobj) {
3224
+				if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) {
3225 3225
 					$name           = $postobj->labels->name;
3226
-					$post_type_link = geodir_getlink( $author_link, array(
3226
+					$post_type_link = geodir_getlink($author_link, array(
3227 3227
 						'stype' => $key,
3228 3228
 						'list'  => 'favourite'
3229
-					), false );
3229
+					), false);
3230 3230
 
3231 3231
 					$selected = '';
3232 3232
 
3233
-					if ( isset( $_REQUEST['list'] ) && $_REQUEST['list'] == 'favourite' && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key && isset( $_REQUEST['geodir_dashbord'] ) ) {
3233
+					if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key && isset($_REQUEST['geodir_dashbord'])) {
3234 3234
 						$selected = 'selected="selected"';
3235 3235
 					}
3236 3236
 					/**
@@ -3242,20 +3242,20 @@  discard block
 block discarded – undo
3242 3242
 					 * @param string $key            Favorite listing array key.
3243 3243
 					 * @param int $current_user      ->ID Current user ID.
3244 3244
 					 */
3245
-					$post_type_link = apply_filters( 'geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID );
3245
+					$post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID);
3246 3246
 
3247
-					$favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3247
+					$favourite_links .= '<option '.$selected.' value="'.$post_type_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3248 3248
 				}
3249 3249
 			}
3250 3250
 
3251
-			if ( $favourite_links != '' ) {
3251
+			if ($favourite_links != '') {
3252 3252
 				?>
3253 3253
 				<li>
3254 3254
 					<select id="geodir_my_favourites" class="chosen_select" onchange="window.location.href=this.value"
3255 3255
 					        option-autoredirect="1" name="geodir_my_favourites" option-ajaxchosen="false"
3256
-					        data-placeholder="<?php echo esc_attr( __( 'My Favorites', 'geodirectory' ) ); ?>">
3256
+					        data-placeholder="<?php echo esc_attr(__('My Favorites', 'geodirectory')); ?>">
3257 3257
 						<option value="" disabled="disabled" selected="selected"
3258
-						        style='display:none;'><?php echo esc_attr( __( 'My Favorites', 'geodirectory' ) ); ?></option>
3258
+						        style='display:none;'><?php echo esc_attr(__('My Favorites', 'geodirectory')); ?></option>
3259 3259
 						<?php echo $favourite_links; ?>
3260 3260
 					</select>
3261 3261
 				</li>
@@ -3264,19 +3264,19 @@  discard block
 block discarded – undo
3264 3264
 		}
3265 3265
 
3266 3266
 
3267
-		$show_listing_link_user_dashboard = get_option( 'geodir_listing_link_user_dashboard' );
3267
+		$show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard');
3268 3268
 		$user_listing                     = geodir_user_post_listing_count();
3269 3269
 
3270
-		if ( ! empty( $show_listing_link_user_dashboard ) && ! empty( $user_listing ) ) {
3270
+		if (!empty($show_listing_link_user_dashboard) && !empty($user_listing)) {
3271 3271
 			$listing_links = '';
3272 3272
 
3273
-			foreach ( $post_types as $key => $postobj ) {
3274
-				if ( in_array( $key, $show_listing_link_user_dashboard ) && array_key_exists( $key, $user_listing ) ) {
3273
+			foreach ($post_types as $key => $postobj) {
3274
+				if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) {
3275 3275
 					$name         = $postobj->labels->name;
3276
-					$listing_link = geodir_getlink( $author_link, array( 'stype' => $key ), false );
3276
+					$listing_link = geodir_getlink($author_link, array('stype' => $key), false);
3277 3277
 
3278 3278
 					$selected = '';
3279
-					if ( ! isset( $_REQUEST['list'] ) && isset( $_REQUEST['geodir_dashbord'] ) && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key ) {
3279
+					if (!isset($_REQUEST['list']) && isset($_REQUEST['geodir_dashbord']) && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key) {
3280 3280
 						$selected = 'selected="selected"';
3281 3281
 					}
3282 3282
 
@@ -3289,20 +3289,20 @@  discard block
 block discarded – undo
3289 3289
 					 * @param string $key          My listing array key.
3290 3290
 					 * @param int $current_user    ->ID Current user ID.
3291 3291
 					 */
3292
-					$listing_link = apply_filters( 'geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID );
3292
+					$listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID);
3293 3293
 
3294
-					$listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3294
+					$listing_links .= '<option '.$selected.' value="'.$listing_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3295 3295
 				}
3296 3296
 			}
3297 3297
 
3298
-			if ( $listing_links != '' ) {
3298
+			if ($listing_links != '') {
3299 3299
 				?>
3300 3300
 				<li>
3301 3301
 					<select id="geodir_my_listings" class="chosen_select" onchange="window.location.href=this.value"
3302 3302
 					        option-autoredirect="1" name="geodir_my_listings" option-ajaxchosen="false"
3303
-					        data-placeholder="<?php echo esc_attr( __( 'My Listings', 'geodirectory' ) ); ?>">
3303
+					        data-placeholder="<?php echo esc_attr(__('My Listings', 'geodirectory')); ?>">
3304 3304
 						<option value="" disabled="disabled" selected="selected"
3305
-						        style='display:none;'><?php echo esc_attr( __( 'My Listings', 'geodirectory' ) ); ?></option>
3305
+						        style='display:none;'><?php echo esc_attr(__('My Listings', 'geodirectory')); ?></option>
3306 3306
 						<?php echo $listing_links; ?>
3307 3307
 					</select>
3308 3308
 				</li>
@@ -3318,7 +3318,7 @@  discard block
 block discarded – undo
3318 3318
 		 *
3319 3319
 		 * @param string $dashboard_link Dashboard links HTML.
3320 3320
 		 */
3321
-		echo apply_filters( 'geodir_dashboard_links', $dashboard_link );
3321
+		echo apply_filters('geodir_dashboard_links', $dashboard_link);
3322 3322
 		echo '</ul>';
3323 3323
 
3324 3324
 		/**
@@ -3326,7 +3326,7 @@  discard block
 block discarded – undo
3326 3326
 		 *
3327 3327
 		 * @since 1.6.6
3328 3328
 		 */
3329
-		do_action( 'geodir_after_loginwidget_form_logged_in' );
3329
+		do_action('geodir_after_loginwidget_form_logged_in');
3330 3330
 
3331 3331
 
3332 3332
 	} else {
@@ -3341,18 +3341,18 @@  discard block
 block discarded – undo
3341 3341
 		<form name="loginform" class="loginform1"
3342 3342
 		      action="<?php echo geodir_login_url(); ?>"
3343 3343
 		      method="post">
3344
-			<div class="geodir_form_row"><input placeholder="<?php _e( 'Email', 'geodirectory' ); ?>" name="log"
3344
+			<div class="geodir_form_row"><input placeholder="<?php _e('Email', 'geodirectory'); ?>" name="log"
3345 3345
 			                                    type="text" class="textfield user_login1"/> <span
3346 3346
 					class="user_loginInfo"></span></div>
3347
-			<div class="geodir_form_row"><input placeholder="<?php _e( 'Password', 'geodirectory' ); ?>"
3347
+			<div class="geodir_form_row"><input placeholder="<?php _e('Password', 'geodirectory'); ?>"
3348 3348
 			                                    name="pwd" type="password"
3349 3349
 			                                    class="textfield user_pass1 input-text"/><span
3350 3350
 					class="user_passInfo"></span></div>
3351 3351
 
3352
-			<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars( geodir_curPageURL() ); ?>"/>
3352
+			<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars(geodir_curPageURL()); ?>"/>
3353 3353
 			<input type="hidden" name="testcookie" value="1"/>
3354 3354
 
3355
-				<?php do_action( 'login_form' ); ?>
3355
+				<?php do_action('login_form'); ?>
3356 3356
 
3357 3357
 			<div class="geodir_form_row clearfix"><input type="submit" name="submit"
3358 3358
 			                                             value="<?php echo SIGN_IN_BUTTON; ?>" class="b_signin"/>
@@ -3365,7 +3365,7 @@  discard block
 block discarded – undo
3365 3365
 					 * @since 1.0.0
3366 3366
 					 */
3367 3367
 					?>
3368
-					<a href="<?php echo geodir_login_url( array( 'signup' => true ) ); ?>"
3368
+					<a href="<?php echo geodir_login_url(array('signup' => true)); ?>"
3369 3369
 					   class="goedir-newuser-link"><?php echo NEW_USER_TEXT; ?></a>
3370 3370
 
3371 3371
 					<?php
@@ -3375,7 +3375,7 @@  discard block
 block discarded – undo
3375 3375
 					 * @since 1.0.0
3376 3376
 					 */
3377 3377
 					?>
3378
-					<a href="<?php echo geodir_login_url( array( 'forgot' => true ) ); ?>"
3378
+					<a href="<?php echo geodir_login_url(array('forgot' => true)); ?>"
3379 3379
 					   class="goedir-forgot-link"><?php echo FORGOT_PW_TEXT; ?></a></p></div>
3380 3380
 		</form>
3381 3381
 		<?php
@@ -3384,7 +3384,7 @@  discard block
 block discarded – undo
3384 3384
 		 *
3385 3385
 		 * @since 1.6.6
3386 3386
 		 */
3387
-		do_action( 'geodir_after_loginwidget_form_logged_out' );
3387
+		do_action('geodir_after_loginwidget_form_logged_out');
3388 3388
 	}
3389 3389
 
3390 3390
 	echo $after_widget;
@@ -3406,16 +3406,16 @@  discard block
 block discarded – undo
3406 3406
  *                                         after_widget.
3407 3407
  * @param array|string $instance           The settings for the particular instance of the widget.
3408 3408
  */
3409
-function geodir_popular_postview_output( $args = '', $instance = '' ) {
3409
+function geodir_popular_postview_output($args = '', $instance = '') {
3410 3410
 	global $gd_session;
3411 3411
 
3412 3412
 	// prints the widget
3413
-	extract( $args, EXTR_SKIP );
3413
+	extract($args, EXTR_SKIP);
3414 3414
 
3415 3415
 	echo $before_widget;
3416 3416
 
3417 3417
 	/** This filter is documented in geodirectory_widgets.php */
3418
-	$title = empty( $instance['title'] ) ? geodir_ucwords( $instance['category_title'] ) : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
3418
+	$title = empty($instance['title']) ? geodir_ucwords($instance['category_title']) : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
3419 3419
 	/**
3420 3420
 	 * Filter the widget post type.
3421 3421
 	 *
@@ -3423,7 +3423,7 @@  discard block
 block discarded – undo
3423 3423
 	 *
3424 3424
 	 * @param string $instance ['post_type'] Post type of listing.
3425 3425
 	 */
3426
-	$post_type = empty( $instance['post_type'] ) ? 'gd_place' : apply_filters( 'widget_post_type', $instance['post_type'] );
3426
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
3427 3427
 	/**
3428 3428
 	 * Filter the widget's term.
3429 3429
 	 *
@@ -3431,7 +3431,7 @@  discard block
 block discarded – undo
3431 3431
 	 *
3432 3432
 	 * @param string $instance ['category'] Filter by term. Can be any valid term.
3433 3433
 	 */
3434
-	$category = empty( $instance['category'] ) ? '0' : apply_filters( 'widget_category', $instance['category'] );
3434
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
3435 3435
 	/**
3436 3436
 	 * Filter the widget listings limit.
3437 3437
 	 *
@@ -3439,7 +3439,7 @@  discard block
 block discarded – undo
3439 3439
 	 *
3440 3440
 	 * @param string $instance ['post_number'] Number of listings to display.
3441 3441
 	 */
3442
-	$post_number = empty( $instance['post_number'] ) ? '5' : apply_filters( 'widget_post_number', $instance['post_number'] );
3442
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
3443 3443
 	/**
3444 3444
 	 * Filter widget's "layout" type.
3445 3445
 	 *
@@ -3447,7 +3447,7 @@  discard block
 block discarded – undo
3447 3447
 	 *
3448 3448
 	 * @param string $instance ['layout'] Widget layout type.
3449 3449
 	 */
3450
-	$layout = empty( $instance['layout'] ) ? 'gridview_onehalf' : apply_filters( 'widget_layout', $instance['layout'] );
3450
+	$layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']);
3451 3451
 	/**
3452 3452
 	 * Filter widget's "add_location_filter" value.
3453 3453
 	 *
@@ -3455,7 +3455,7 @@  discard block
 block discarded – undo
3455 3455
 	 *
3456 3456
 	 * @param string|bool $instance ['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
3457 3457
 	 */
3458
-	$add_location_filter = empty( $instance['add_location_filter'] ) ? '0' : apply_filters( 'widget_add_location_filter', $instance['add_location_filter'] );
3458
+	$add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
3459 3459
 	/**
3460 3460
 	 * Filter widget's listing width.
3461 3461
 	 *
@@ -3463,7 +3463,7 @@  discard block
 block discarded – undo
3463 3463
 	 *
3464 3464
 	 * @param string $instance ['listing_width'] Listing width.
3465 3465
 	 */
3466
-	$listing_width = empty( $instance['listing_width'] ) ? '' : apply_filters( 'widget_listing_width', $instance['listing_width'] );
3466
+	$listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']);
3467 3467
 	/**
3468 3468
 	 * Filter widget's "list_sort" type.
3469 3469
 	 *
@@ -3471,25 +3471,25 @@  discard block
 block discarded – undo
3471 3471
 	 *
3472 3472
 	 * @param string $instance ['list_sort'] Listing sort by type.
3473 3473
 	 */
3474
-	$list_sort             = empty( $instance['list_sort'] ) ? 'latest' : apply_filters( 'widget_list_sort', $instance['list_sort'] );
3475
-	$use_viewing_post_type = ! empty( $instance['use_viewing_post_type'] ) ? true : false;
3474
+	$list_sort             = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
3475
+	$use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
3476 3476
 
3477 3477
 	// set post type to current viewing post type
3478
-	if ( $use_viewing_post_type ) {
3478
+	if ($use_viewing_post_type) {
3479 3479
 		$current_post_type = geodir_get_current_posttype();
3480
-		if ( $current_post_type != '' && $current_post_type != $post_type ) {
3480
+		if ($current_post_type != '' && $current_post_type != $post_type) {
3481 3481
 			$post_type = $current_post_type;
3482 3482
 			$category  = array(); // old post type category will not work for current changed post type
3483 3483
 		}
3484 3484
 	}
3485 3485
 	// replace widget title dynamically
3486
-	$posttype_plural_label   = __( get_post_type_plural_label( $post_type ), 'geodirectory' );
3487
-	$posttype_singular_label = __( get_post_type_singular_label( $post_type ), 'geodirectory' );
3486
+	$posttype_plural_label   = __(get_post_type_plural_label($post_type), 'geodirectory');
3487
+	$posttype_singular_label = __(get_post_type_singular_label($post_type), 'geodirectory');
3488 3488
 
3489
-	$title = str_replace( "%posttype_plural_label%", $posttype_plural_label, $title );
3490
-	$title = str_replace( "%posttype_singular_label%", $posttype_singular_label, $title );
3489
+	$title = str_replace("%posttype_plural_label%", $posttype_plural_label, $title);
3490
+	$title = str_replace("%posttype_singular_label%", $posttype_singular_label, $title);
3491 3491
 
3492
-	if ( isset( $instance['character_count'] ) ) {
3492
+	if (isset($instance['character_count'])) {
3493 3493
 		/**
3494 3494
 		 * Filter the widget's excerpt character count.
3495 3495
 		 *
@@ -3497,37 +3497,37 @@  discard block
 block discarded – undo
3497 3497
 		 *
3498 3498
 		 * @param int $instance ['character_count'] Excerpt character count.
3499 3499
 		 */
3500
-		$character_count = apply_filters( 'widget_list_character_count', $instance['character_count'] );
3500
+		$character_count = apply_filters('widget_list_character_count', $instance['character_count']);
3501 3501
 	} else {
3502 3502
 		$character_count = '';
3503 3503
 	}
3504 3504
 
3505
-	if ( empty( $title ) || $title == 'All' ) {
3506
-		$title .= ' ' . __( get_post_type_plural_label( $post_type ), 'geodirectory' );
3505
+	if (empty($title) || $title == 'All') {
3506
+		$title .= ' '.__(get_post_type_plural_label($post_type), 'geodirectory');
3507 3507
 	}
3508 3508
 
3509 3509
 	$location_url = array();
3510
-	$city         = get_query_var( 'gd_city' );
3511
-	if ( ! empty( $city ) ) {
3512
-		$country = get_query_var( 'gd_country' );
3513
-		$region  = get_query_var( 'gd_region' );
3510
+	$city         = get_query_var('gd_city');
3511
+	if (!empty($city)) {
3512
+		$country = get_query_var('gd_country');
3513
+		$region  = get_query_var('gd_region');
3514 3514
 
3515
-		$geodir_show_location_url = get_option( 'geodir_show_location_url' );
3515
+		$geodir_show_location_url = get_option('geodir_show_location_url');
3516 3516
 
3517
-		if ( $geodir_show_location_url == 'all' ) {
3518
-			if ( $country != '' ) {
3517
+		if ($geodir_show_location_url == 'all') {
3518
+			if ($country != '') {
3519 3519
 				$location_url[] = $country;
3520 3520
 			}
3521 3521
 
3522
-			if ( $region != '' ) {
3522
+			if ($region != '') {
3523 3523
 				$location_url[] = $region;
3524 3524
 			}
3525
-		} else if ( $geodir_show_location_url == 'country_city' ) {
3526
-			if ( $country != '' ) {
3525
+		} else if ($geodir_show_location_url == 'country_city') {
3526
+			if ($country != '') {
3527 3527
 				$location_url[] = $country;
3528 3528
 			}
3529
-		} else if ( $geodir_show_location_url == 'region_city' ) {
3530
-			if ( $region != '' ) {
3529
+		} else if ($geodir_show_location_url == 'region_city') {
3530
+			if ($region != '') {
3531 3531
 				$location_url[] = $region;
3532 3532
 			}
3533 3533
 		}
@@ -3535,37 +3535,37 @@  discard block
 block discarded – undo
3535 3535
 		$location_url[] = $city;
3536 3536
 	}
3537 3537
 
3538
-	$location_url  = implode( '/', $location_url );
3538
+	$location_url  = implode('/', $location_url);
3539 3539
 	$skip_location = false;
3540
-	if ( ! $add_location_filter && $gd_session->get( 'gd_multi_location' ) ) {
3540
+	if (!$add_location_filter && $gd_session->get('gd_multi_location')) {
3541 3541
 		$skip_location = true;
3542
-		$gd_session->un_set( 'gd_multi_location' );
3542
+		$gd_session->un_set('gd_multi_location');
3543 3543
 	}
3544 3544
 
3545
-	if ( get_option( 'permalink_structure' ) ) {
3546
-		$viewall_url = get_post_type_archive_link( $post_type );
3545
+	if (get_option('permalink_structure')) {
3546
+		$viewall_url = get_post_type_archive_link($post_type);
3547 3547
 	} else {
3548
-		$viewall_url = get_post_type_archive_link( $post_type );
3548
+		$viewall_url = get_post_type_archive_link($post_type);
3549 3549
 	}
3550 3550
 
3551
-	if ( ! empty( $category ) && $category[0] != '0' ) {
3551
+	if (!empty($category) && $category[0] != '0') {
3552 3552
 		global $geodir_add_location_url;
3553 3553
 
3554 3554
 		$geodir_add_location_url = '0';
3555 3555
 
3556
-		if ( $add_location_filter != '0' ) {
3556
+		if ($add_location_filter != '0') {
3557 3557
 			$geodir_add_location_url = '1';
3558 3558
 		}
3559 3559
 
3560
-		$viewall_url = get_term_link( (int) $category[0], $post_type . 'category' );
3560
+		$viewall_url = get_term_link((int) $category[0], $post_type.'category');
3561 3561
 
3562 3562
 		$geodir_add_location_url = null;
3563 3563
 	}
3564
-	if ( $skip_location ) {
3565
-		$gd_session->set( 'gd_multi_location', 1 );
3564
+	if ($skip_location) {
3565
+		$gd_session->set('gd_multi_location', 1);
3566 3566
 	}
3567 3567
 
3568
-	if ( is_wp_error( $viewall_url ) ) {
3568
+	if (is_wp_error($viewall_url)) {
3569 3569
 		$viewall_url = '';
3570 3570
 	}
3571 3571
 
@@ -3577,34 +3577,34 @@  discard block
 block discarded – undo
3577 3577
 		'order_by'       => $list_sort
3578 3578
 	);
3579 3579
 
3580
-	if ( $character_count ) {
3580
+	if ($character_count) {
3581 3581
 		$query_args['excerpt_length'] = $character_count;
3582 3582
 	}
3583 3583
 
3584
-	if ( ! empty( $instance['show_featured_only'] ) ) {
3584
+	if (!empty($instance['show_featured_only'])) {
3585 3585
 		$query_args['show_featured_only'] = 1;
3586 3586
 	}
3587 3587
 
3588
-	if ( ! empty( $instance['show_special_only'] ) ) {
3588
+	if (!empty($instance['show_special_only'])) {
3589 3589
 		$query_args['show_special_only'] = 1;
3590 3590
 	}
3591 3591
 
3592
-	if ( ! empty( $instance['with_pics_only'] ) ) {
3592
+	if (!empty($instance['with_pics_only'])) {
3593 3593
 		$query_args['with_pics_only']      = 0;
3594 3594
 		$query_args['featured_image_only'] = 1;
3595 3595
 	}
3596 3596
 
3597
-	if ( ! empty( $instance['with_videos_only'] ) ) {
3597
+	if (!empty($instance['with_videos_only'])) {
3598 3598
 		$query_args['with_videos_only'] = 1;
3599 3599
 	}
3600
-	$with_no_results = ! empty( $instance['without_no_results'] ) ? false : true;
3600
+	$with_no_results = !empty($instance['without_no_results']) ? false : true;
3601 3601
 
3602
-	if ( ! empty( $category ) && $category[0] != '0' ) {
3603
-		$category_taxonomy = geodir_get_taxonomies( $post_type );
3602
+	if (!empty($category) && $category[0] != '0') {
3603
+		$category_taxonomy = geodir_get_taxonomies($post_type);
3604 3604
 
3605 3605
 		######### WPML #########
3606
-		if ( function_exists( 'icl_object_id' ) ) {
3607
-			$category = gd_lang_object_ids( $category, $category_taxonomy[0] );
3606
+		if (function_exists('icl_object_id')) {
3607
+			$category = gd_lang_object_ids($category, $category_taxonomy[0]);
3608 3608
 		}
3609 3609
 		######### WPML #########
3610 3610
 
@@ -3614,14 +3614,14 @@  discard block
 block discarded – undo
3614 3614
 			'terms'    => $category
3615 3615
 		);
3616 3616
 
3617
-		$query_args['tax_query'] = array( $tax_query );
3617
+		$query_args['tax_query'] = array($tax_query);
3618 3618
 	}
3619 3619
 
3620 3620
 	global $gridview_columns_widget, $geodir_is_widget_listing;
3621 3621
 
3622
-	$widget_listings = geodir_get_widget_listings( $query_args );
3622
+	$widget_listings = geodir_get_widget_listings($query_args);
3623 3623
 
3624
-	if ( ! empty( $widget_listings ) || $with_no_results ) {
3624
+	if (!empty($widget_listings) || $with_no_results) {
3625 3625
 		?>
3626 3626
 		<div class="geodir_locations geodir_location_listing">
3627 3627
 
@@ -3631,11 +3631,11 @@  discard block
 block discarded – undo
3631 3631
 			 *
3632 3632
 			 * @since 1.0.0
3633 3633
 			 */
3634
-			do_action( 'geodir_before_view_all_link_in_widget' ); ?>
3634
+			do_action('geodir_before_view_all_link_in_widget'); ?>
3635 3635
 			<div class="geodir_list_heading clearfix">
3636
-				<?php echo $before_title . $title . $after_title; ?>
3636
+				<?php echo $before_title.$title.$after_title; ?>
3637 3637
 				<a href="<?php echo $viewall_url; ?>"
3638
-				   class="geodir-viewall"><?php _e( 'View all', 'geodirectory' ); ?></a>
3638
+				   class="geodir-viewall"><?php _e('View all', 'geodirectory'); ?></a>
3639 3639
 			</div>
3640 3640
 			<?php
3641 3641
 			/**
@@ -3643,10 +3643,10 @@  discard block
 block discarded – undo
3643 3643
 			 *
3644 3644
 			 * @since 1.0.0
3645 3645
 			 */
3646
-			do_action( 'geodir_after_view_all_link_in_widget' ); ?>
3646
+			do_action('geodir_after_view_all_link_in_widget'); ?>
3647 3647
 			<?php
3648
-			if ( strstr( $layout, 'gridview' ) ) {
3649
-				$listing_view_exp        = explode( '_', $layout );
3648
+			if (strstr($layout, 'gridview')) {
3649
+				$listing_view_exp        = explode('_', $layout);
3650 3650
 				$gridview_columns_widget = $layout;
3651 3651
 				$layout                  = $listing_view_exp[0];
3652 3652
 			} else {
@@ -3658,8 +3658,8 @@  discard block
 block discarded – undo
3658 3658
 			 *
3659 3659
 			 * @since 1.0.0
3660 3660
 			 */
3661
-			$template = apply_filters( "geodir_template_part-widget-listing-listview", geodir_locate_template( 'widget-listing-listview' ) );
3662
-			if ( ! isset( $character_count ) ) {
3661
+			$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
3662
+			if (!isset($character_count)) {
3663 3663
 				/**
3664 3664
 				 * Filter the widget's excerpt character count.
3665 3665
 				 *
@@ -3667,7 +3667,7 @@  discard block
 block discarded – undo
3667 3667
 				 *
3668 3668
 				 * @param int $instance ['character_count'] Excerpt character count.
3669 3669
 				 */
3670
-				$character_count = $character_count == '' ? 50 : apply_filters( 'widget_character_count', $character_count );
3670
+				$character_count = $character_count == '' ? 50 : apply_filters('widget_character_count', $character_count);
3671 3671
 			}
3672 3672
 
3673 3673
 			global $post, $map_jason, $map_canvas_arr;
@@ -3682,13 +3682,13 @@  discard block
 block discarded – undo
3682 3682
 			 *
3683 3683
 			 * @since 1.0.0
3684 3684
 			 */
3685
-			include( $template );
3685
+			include($template);
3686 3686
 
3687 3687
 			$geodir_is_widget_listing = false;
3688 3688
 
3689 3689
 			$GLOBALS['post'] = $current_post;
3690
-			if ( ! empty( $current_post ) ) {
3691
-				setup_postdata( $current_post );
3690
+			if (!empty($current_post)) {
3691
+				setup_postdata($current_post);
3692 3692
 			}
3693 3693
 			$map_jason      = $current_map_jason;
3694 3694
 			$map_canvas_arr = $current_map_canvas_arr;
@@ -3719,12 +3719,12 @@  discard block
 block discarded – undo
3719 3719
  *
3720 3720
  * @return int Reviews count.
3721 3721
  */
3722
-function geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type ) {
3722
+function geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type) {
3723 3723
 	global $wpdb, $plugin_prefix;
3724 3724
 
3725
-	$detail_table = $plugin_prefix . $post_type . '_detail';
3725
+	$detail_table = $plugin_prefix.$post_type.'_detail';
3726 3726
 
3727
-	$sql = "SELECT COALESCE(SUM(rating_count),0) FROM " . $detail_table . " WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(" . $term_id . ", " . $taxonomy . ")";
3727
+	$sql = "SELECT COALESCE(SUM(rating_count),0) FROM ".$detail_table." WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(".$term_id.", ".$taxonomy.")";
3728 3728
 
3729 3729
 	/**
3730 3730
 	 * Filter count review sql query.
@@ -3736,9 +3736,9 @@  discard block
 block discarded – undo
3736 3736
 	 * @param int $taxonomy     The taxonomy Id.
3737 3737
 	 * @param string $post_type The post type.
3738 3738
 	 */
3739
-	$sql = apply_filters( 'geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type );
3739
+	$sql = apply_filters('geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type);
3740 3740
 
3741
-	$count = $wpdb->get_var( $sql );
3741
+	$count = $wpdb->get_var($sql);
3742 3742
 
3743 3743
 	return $count;
3744 3744
 }
@@ -3756,7 +3756,7 @@  discard block
 block discarded – undo
3756 3756
  *
3757 3757
  * @return array Term array data.
3758 3758
  */
3759
-function geodir_count_reviews_by_terms( $force_update = false, $post_ID = 0 ) {
3759
+function geodir_count_reviews_by_terms($force_update = false, $post_ID = 0) {
3760 3760
 	/**
3761 3761
 	 * Filter review count option data.
3762 3762
 	 *
@@ -3766,78 +3766,78 @@  discard block
 block discarded – undo
3766 3766
 	 * @param bool $force_update Force update option value?. Default.false.
3767 3767
 	 * @param int $post_ID       The post id to update if any.
3768 3768
 	 */
3769
-	$option_data = apply_filters( 'geodir_count_reviews_by_terms_before', '', $force_update, $post_ID );
3770
-	if ( ! empty( $option_data ) ) {
3769
+	$option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update, $post_ID);
3770
+	if (!empty($option_data)) {
3771 3771
 		return $option_data;
3772 3772
 	}
3773 3773
 
3774
-	$option_data = get_option( 'geodir_global_review_count' );
3774
+	$option_data = get_option('geodir_global_review_count');
3775 3775
 
3776
-	if ( ! $option_data || $force_update ) {
3777
-		if ( (int) $post_ID > 0 ) { // Update reviews count for specific post categories only.
3776
+	if (!$option_data || $force_update) {
3777
+		if ((int) $post_ID > 0) { // Update reviews count for specific post categories only.
3778 3778
 			global $gd_session;
3779 3779
 			$term_array = (array) $option_data;
3780
-			$post_type  = get_post_type( $post_ID );
3781
-			$taxonomy   = $post_type . 'category';
3782
-			$terms      = wp_get_object_terms( $post_ID, $taxonomy, array( 'fields' => 'ids' ) );
3783
-
3784
-			if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
3785
-				foreach ( $terms as $term_id ) {
3786
-					$count                  = geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type );
3787
-					$children               = get_term_children( $term_id, $taxonomy );
3788
-					$term_array[ $term_id ] = $count;
3780
+			$post_type  = get_post_type($post_ID);
3781
+			$taxonomy   = $post_type.'category';
3782
+			$terms      = wp_get_object_terms($post_ID, $taxonomy, array('fields' => 'ids'));
3783
+
3784
+			if (!empty($terms) && !is_wp_error($terms)) {
3785
+				foreach ($terms as $term_id) {
3786
+					$count                  = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3787
+					$children               = get_term_children($term_id, $taxonomy);
3788
+					$term_array[$term_id] = $count;
3789 3789
 				}
3790 3790
 			}
3791 3791
 
3792
-			$session_listing = $gd_session->get( 'listing' );
3792
+			$session_listing = $gd_session->get('listing');
3793 3793
 
3794 3794
 			$terms = array();
3795
-			if ( isset( $_POST['post_category'][ $taxonomy ] ) ) {
3796
-				$terms = (array) $_POST['post_category'][ $taxonomy ];
3797
-			} else if ( ! empty( $session_listing ) && isset( $session_listing['post_category'][ $taxonomy ] ) ) {
3798
-				$terms = (array) $session_listing['post_category'][ $taxonomy ];
3795
+			if (isset($_POST['post_category'][$taxonomy])) {
3796
+				$terms = (array) $_POST['post_category'][$taxonomy];
3797
+			} else if (!empty($session_listing) && isset($session_listing['post_category'][$taxonomy])) {
3798
+				$terms = (array) $session_listing['post_category'][$taxonomy];
3799 3799
 			}
3800 3800
 
3801
-			if ( ! empty( $terms ) ) {
3802
-				foreach ( $terms as $term_id ) {
3803
-					if ( $term_id > 0 ) {
3804
-						$count                  = geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type );
3805
-						$children               = get_term_children( $term_id, $taxonomy );
3806
-						$term_array[ $term_id ] = $count;
3801
+			if (!empty($terms)) {
3802
+				foreach ($terms as $term_id) {
3803
+					if ($term_id > 0) {
3804
+						$count                  = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3805
+						$children               = get_term_children($term_id, $taxonomy);
3806
+						$term_array[$term_id] = $count;
3807 3807
 					}
3808 3808
 				}
3809 3809
 			}
3810 3810
 		} else { // Update reviews count for all post categories.
3811 3811
 			$term_array = array();
3812 3812
 			$post_types = geodir_get_posttypes();
3813
-			foreach ( $post_types as $post_type ) {
3813
+			foreach ($post_types as $post_type) {
3814 3814
 
3815
-				$taxonomy = geodir_get_taxonomies( $post_type );
3815
+				$taxonomy = geodir_get_taxonomies($post_type);
3816 3816
 				$taxonomy = $taxonomy[0];
3817 3817
 
3818 3818
 				$args = array(
3819 3819
 					'hide_empty' => false
3820 3820
 				);
3821 3821
 
3822
-				$terms = get_terms( $taxonomy, $args );
3822
+				$terms = get_terms($taxonomy, $args);
3823 3823
 
3824
-				foreach ( $terms as $term ) {
3825
-					$count    = geodir_count_reviews_by_term_id( $term->term_id, $taxonomy, $post_type );
3826
-					$children = get_term_children( $term->term_id, $taxonomy );
3824
+				foreach ($terms as $term) {
3825
+					$count    = geodir_count_reviews_by_term_id($term->term_id, $taxonomy, $post_type);
3826
+					$children = get_term_children($term->term_id, $taxonomy);
3827 3827
 					/*if ( is_array( $children ) ) {
3828 3828
                         foreach ( $children as $child_id ) {
3829 3829
                             $child_count = geodir_count_reviews_by_term_id($child_id, $taxonomy, $post_type);
3830 3830
                             $count = $count + $child_count;
3831 3831
                         }
3832 3832
                     }*/
3833
-					$term_array[ $term->term_id ] = $count;
3833
+					$term_array[$term->term_id] = $count;
3834 3834
 				}
3835 3835
 			}
3836 3836
 		}
3837 3837
 
3838
-		update_option( 'geodir_global_review_count', $term_array );
3838
+		update_option('geodir_global_review_count', $term_array);
3839 3839
 		//clear cache
3840
-		wp_cache_delete( 'geodir_global_review_count' );
3840
+		wp_cache_delete('geodir_global_review_count');
3841 3841
 
3842 3842
 		return $term_array;
3843 3843
 	} else {
@@ -3853,39 +3853,39 @@  discard block
 block discarded – undo
3853 3853
  * @package GeoDirectory
3854 3854
  * @return bool
3855 3855
  */
3856
-function geodir_term_review_count_force_update( $new_status, $old_status = '', $post = '' ) {
3857
-	if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'geodir_import_export' ) {
3856
+function geodir_term_review_count_force_update($new_status, $old_status = '', $post = '') {
3857
+	if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'geodir_import_export') {
3858 3858
 		return; // do not run if importing listings
3859 3859
 	}
3860 3860
 
3861
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
3861
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
3862 3862
 		return;
3863 3863
 	}
3864 3864
 
3865 3865
 	$post_ID = 0;
3866
-	if ( ! empty( $post ) ) {
3867
-		if ( isset( $post->post_type ) && strpos( $post->post_type, 'gd_' ) !== 0 ) {
3866
+	if (!empty($post)) {
3867
+		if (isset($post->post_type) && strpos($post->post_type, 'gd_') !== 0) {
3868 3868
 			return;
3869 3869
 		}
3870 3870
 
3871
-		if ( $new_status == 'auto-draft' && $old_status == 'new' ) {
3871
+		if ($new_status == 'auto-draft' && $old_status == 'new') {
3872 3872
 			return;
3873 3873
 		}
3874 3874
 
3875
-		if ( ! empty( $post->ID ) ) {
3875
+		if (!empty($post->ID)) {
3876 3876
 			$post_ID = $post->ID;
3877 3877
 		}
3878 3878
 	}
3879 3879
 
3880
-	if ( $new_status != $old_status ) {
3881
-		geodir_count_reviews_by_terms( true, $post_ID );
3880
+	if ($new_status != $old_status) {
3881
+		geodir_count_reviews_by_terms(true, $post_ID);
3882 3882
 	}
3883 3883
 
3884 3884
 	return true;
3885 3885
 }
3886 3886
 
3887
-function geodir_term_review_count_force_update_single_post( $post_id ) {
3888
-	geodir_count_reviews_by_terms( true, $post_id );
3887
+function geodir_term_review_count_force_update_single_post($post_id) {
3888
+	geodir_count_reviews_by_terms(true, $post_id);
3889 3889
 }
3890 3890
 
3891 3891
 /*-----------------------------------------------------------------------------------*/
@@ -3902,11 +3902,11 @@  discard block
 block discarded – undo
3902 3902
  *
3903 3903
  * @return int Post count.
3904 3904
  */
3905
-function geodir_count_posts_by_term( $data, $term ) {
3905
+function geodir_count_posts_by_term($data, $term) {
3906 3906
 
3907
-	if ( $data ) {
3908
-		if ( isset( $data[ $term->term_id ] ) ) {
3909
-			return $data[ $term->term_id ];
3907
+	if ($data) {
3908
+		if (isset($data[$term->term_id])) {
3909
+			return $data[$term->term_id];
3910 3910
 		} else {
3911 3911
 			return 0;
3912 3912
 		}
@@ -3923,8 +3923,8 @@  discard block
 block discarded – undo
3923 3923
  * param array $terms An array of term objects.
3924 3924
  * @return array Sorted terms array.
3925 3925
  */
3926
-function geodir_sort_terms_by_count( $terms ) {
3927
-	usort( $terms, "geodir_sort_by_count_obj" );
3926
+function geodir_sort_terms_by_count($terms) {
3927
+	usort($terms, "geodir_sort_by_count_obj");
3928 3928
 
3929 3929
 	return $terms;
3930 3930
 }
@@ -3939,8 +3939,8 @@  discard block
 block discarded – undo
3939 3939
  *
3940 3940
  * @return array Sorted terms array.
3941 3941
  */
3942
-function geodir_sort_terms_by_review_count( $terms ) {
3943
-	usort( $terms, "geodir_sort_by_review_count_obj" );
3942
+function geodir_sort_terms_by_review_count($terms) {
3943
+	usort($terms, "geodir_sort_by_review_count_obj");
3944 3944
 
3945 3945
 	return $terms;
3946 3946
 }
@@ -3956,12 +3956,12 @@  discard block
 block discarded – undo
3956 3956
  *
3957 3957
  * @return array Sorted terms array.
3958 3958
  */
3959
-function geodir_sort_terms( $terms, $sort = 'count' ) {
3960
-	if ( $sort == 'count' ) {
3961
-		return geodir_sort_terms_by_count( $terms );
3959
+function geodir_sort_terms($terms, $sort = 'count') {
3960
+	if ($sort == 'count') {
3961
+		return geodir_sort_terms_by_count($terms);
3962 3962
 	}
3963
-	if ( $sort == 'review_count' ) {
3964
-		return geodir_sort_terms_by_review_count( $terms );
3963
+	if ($sort == 'review_count') {
3964
+		return geodir_sort_terms_by_review_count($terms);
3965 3965
 	}
3966 3966
 }
3967 3967
 
@@ -3979,7 +3979,7 @@  discard block
 block discarded – undo
3979 3979
  *
3980 3980
  * @return bool
3981 3981
  */
3982
-function geodir_sort_by_count( $a, $b ) {
3982
+function geodir_sort_by_count($a, $b) {
3983 3983
 	return $a['count'] < $b['count'];
3984 3984
 }
3985 3985
 
@@ -3994,7 +3994,7 @@  discard block
 block discarded – undo
3994 3994
  *
3995 3995
  * @return bool
3996 3996
  */
3997
-function geodir_sort_by_count_obj( $a, $b ) {
3997
+function geodir_sort_by_count_obj($a, $b) {
3998 3998
 	return $a->count < $b->count;
3999 3999
 }
4000 4000
 
@@ -4009,7 +4009,7 @@  discard block
 block discarded – undo
4009 4009
  *
4010 4010
  * @return bool
4011 4011
  */
4012
-function geodir_sort_by_review_count_obj( $a, $b ) {
4012
+function geodir_sort_by_review_count_obj($a, $b) {
4013 4013
 	return $a->review_count < $b->review_count;
4014 4014
 }
4015 4015
 
@@ -4026,35 +4026,35 @@  discard block
 block discarded – undo
4026 4026
 	 * @since   1.4.2
4027 4027
 	 * @package GeoDirectory
4028 4028
 	 */
4029
-	$locale = apply_filters( 'plugin_locale', get_locale(), 'geodirectory' );
4029
+	$locale = apply_filters('plugin_locale', get_locale(), 'geodirectory');
4030 4030
 
4031
-	load_textdomain( 'geodirectory', WP_LANG_DIR . '/' . 'geodirectory' . '/' . 'geodirectory' . '-' . $locale . '.mo' );
4032
-	load_plugin_textdomain( 'geodirectory', false, plugin_basename( dirname( dirname( __FILE__ ) ) ) . '/geodirectory-languages' );
4031
+	load_textdomain('geodirectory', WP_LANG_DIR.'/'.'geodirectory'.'/'.'geodirectory'.'-'.$locale.'.mo');
4032
+	load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))).'/geodirectory-languages');
4033 4033
 
4034 4034
 	/**
4035 4035
 	 * Define language constants.
4036 4036
 	 *
4037 4037
 	 * @since 1.0.0
4038 4038
 	 */
4039
-	require_once( geodir_plugin_path() . '/language.php' );
4039
+	require_once(geodir_plugin_path().'/language.php');
4040 4040
 
4041
-	$language_file = geodir_plugin_path() . '/db-language.php';
4041
+	$language_file = geodir_plugin_path().'/db-language.php';
4042 4042
 
4043 4043
 	// Load language string file if not created yet
4044
-	if ( ! file_exists( $language_file ) ) {
4044
+	if (!file_exists($language_file)) {
4045 4045
 		geodirectory_load_db_language();
4046 4046
 	}
4047 4047
 
4048
-	if ( file_exists( $language_file ) ) {
4048
+	if (file_exists($language_file)) {
4049 4049
 		/**
4050 4050
 		 * Language strings from database.
4051 4051
 		 *
4052 4052
 		 * @since 1.4.2
4053 4053
 		 */
4054 4054
 		try {
4055
-			require_once( $language_file );
4056
-		} catch ( Exception $e ) {
4057
-			error_log( 'Language Error: ' . $e->getMessage() );
4055
+			require_once($language_file);
4056
+		} catch (Exception $e) {
4057
+			error_log('Language Error: '.$e->getMessage());
4058 4058
 		}
4059 4059
 	}
4060 4060
 }
@@ -4071,19 +4071,19 @@  discard block
 block discarded – undo
4071 4071
  */
4072 4072
 function geodirectory_load_db_language() {
4073 4073
 	global $wp_filesystem;
4074
-	if ( empty( $wp_filesystem ) ) {
4075
-		require_once( ABSPATH . '/wp-admin/includes/file.php' );
4074
+	if (empty($wp_filesystem)) {
4075
+		require_once(ABSPATH.'/wp-admin/includes/file.php');
4076 4076
 		WP_Filesystem();
4077 4077
 		global $wp_filesystem;
4078 4078
 	}
4079 4079
 
4080
-	$language_file = geodir_plugin_path() . '/db-language.php';
4080
+	$language_file = geodir_plugin_path().'/db-language.php';
4081 4081
 
4082
-	if ( is_file( $language_file ) && ! is_writable( $language_file ) ) {
4082
+	if (is_file($language_file) && !is_writable($language_file)) {
4083 4083
 		return false;
4084 4084
 	} // Not possible to create.
4085 4085
 
4086
-	if ( ! is_file( $language_file ) && ! is_writable( dirname( $language_file ) ) ) {
4086
+	if (!is_file($language_file) && !is_writable(dirname($language_file))) {
4087 4087
 		return false;
4088 4088
 	} // Not possible to create.
4089 4089
 
@@ -4096,9 +4096,9 @@  discard block
 block discarded – undo
4096 4096
 	 *
4097 4097
 	 * @param array $contents_strings Array of strings.
4098 4098
 	 */
4099
-	$contents_strings = apply_filters( 'geodir_load_db_language', $contents_strings );
4099
+	$contents_strings = apply_filters('geodir_load_db_language', $contents_strings);
4100 4100
 
4101
-	$contents_strings = array_unique( $contents_strings );
4101
+	$contents_strings = array_unique($contents_strings);
4102 4102
 
4103 4103
 	$contents_head   = array();
4104 4104
 	$contents_head[] = "<?php";
@@ -4115,20 +4115,20 @@  discard block
 block discarded – undo
4115 4115
 	$contents_foot[] = "";
4116 4116
 	$contents_foot[] = "";
4117 4117
 
4118
-	$contents = implode( PHP_EOL, $contents_head );
4118
+	$contents = implode(PHP_EOL, $contents_head);
4119 4119
 
4120
-	if ( ! empty( $contents_strings ) ) {
4121
-		foreach ( $contents_strings as $string ) {
4122
-			if ( is_scalar( $string ) && $string != '' ) {
4123
-				$string = str_replace( "'", "\'", $string );
4124
-				$contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');";
4120
+	if (!empty($contents_strings)) {
4121
+		foreach ($contents_strings as $string) {
4122
+			if (is_scalar($string) && $string != '') {
4123
+				$string = str_replace("'", "\'", $string);
4124
+				$contents .= PHP_EOL."__('".$string."', 'geodirectory');";
4125 4125
 			}
4126 4126
 		}
4127 4127
 	}
4128 4128
 
4129
-	$contents .= implode( PHP_EOL, $contents_foot );
4129
+	$contents .= implode(PHP_EOL, $contents_foot);
4130 4130
 
4131
-	if ( $wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE ) ) {
4131
+	if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE)) {
4132 4132
 		return false;
4133 4133
 	} // Failure; could not write file.
4134 4134
 
@@ -4148,45 +4148,45 @@  discard block
 block discarded – undo
4148 4148
  *
4149 4149
  * @return array Translation texts.
4150 4150
  */
4151
-function geodir_load_custom_field_translation( $translation_texts = array() ) {
4151
+function geodir_load_custom_field_translation($translation_texts = array()) {
4152 4152
 	global $wpdb;
4153 4153
 
4154 4154
 	// Custom fields table
4155
-	$sql  = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM " . GEODIR_CUSTOM_FIELDS_TABLE;
4156
-	$rows = $wpdb->get_results( $sql );
4155
+	$sql  = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM ".GEODIR_CUSTOM_FIELDS_TABLE;
4156
+	$rows = $wpdb->get_results($sql);
4157 4157
 
4158
-	if ( ! empty( $rows ) ) {
4159
-		foreach ( $rows as $row ) {
4160
-			if ( ! empty( $row->admin_title ) ) {
4161
-				$translation_texts[] = stripslashes_deep( $row->admin_title );
4158
+	if (!empty($rows)) {
4159
+		foreach ($rows as $row) {
4160
+			if (!empty($row->admin_title)) {
4161
+				$translation_texts[] = stripslashes_deep($row->admin_title);
4162 4162
 			}
4163 4163
 
4164
-			if ( ! empty( $row->admin_desc ) ) {
4165
-				$translation_texts[] = stripslashes_deep( $row->admin_desc );
4164
+			if (!empty($row->admin_desc)) {
4165
+				$translation_texts[] = stripslashes_deep($row->admin_desc);
4166 4166
 			}
4167 4167
 
4168
-			if ( ! empty( $row->site_title ) ) {
4169
-				$translation_texts[] = stripslashes_deep( $row->site_title );
4168
+			if (!empty($row->site_title)) {
4169
+				$translation_texts[] = stripslashes_deep($row->site_title);
4170 4170
 			}
4171 4171
 
4172
-			if ( ! empty( $row->clabels ) ) {
4173
-				$translation_texts[] = stripslashes_deep( $row->clabels );
4172
+			if (!empty($row->clabels)) {
4173
+				$translation_texts[] = stripslashes_deep($row->clabels);
4174 4174
 			}
4175 4175
 
4176
-			if ( ! empty( $row->required_msg ) ) {
4177
-				$translation_texts[] = stripslashes_deep( $row->required_msg );
4176
+			if (!empty($row->required_msg)) {
4177
+				$translation_texts[] = stripslashes_deep($row->required_msg);
4178 4178
 			}
4179 4179
 
4180
-			if ( ! empty( $row->default_value ) ) {
4181
-				$translation_texts[] = stripslashes_deep( $row->default_value );
4180
+			if (!empty($row->default_value)) {
4181
+				$translation_texts[] = stripslashes_deep($row->default_value);
4182 4182
 			}
4183 4183
 
4184
-			if ( ! empty( $row->option_values ) ) {
4185
-				$option_values = geodir_string_values_to_options( stripslashes_deep( $row->option_values ) );
4184
+			if (!empty($row->option_values)) {
4185
+				$option_values = geodir_string_values_to_options(stripslashes_deep($row->option_values));
4186 4186
 
4187
-				if ( ! empty( $option_values ) ) {
4188
-					foreach ( $option_values as $option_value ) {
4189
-						if ( ! empty( $option_value['label'] ) ) {
4187
+				if (!empty($option_values)) {
4188
+					foreach ($option_values as $option_value) {
4189
+						if (!empty($option_value['label'])) {
4190 4190
 							$translation_texts[] = $option_value['label'];
4191 4191
 						}
4192 4192
 					}
@@ -4196,48 +4196,48 @@  discard block
 block discarded – undo
4196 4196
 	}
4197 4197
 
4198 4198
 	// Custom sorting fields table
4199
-	$sql  = "SELECT site_title, asc_title, desc_title FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE;
4200
-	$rows = $wpdb->get_results( $sql );
4199
+	$sql  = "SELECT site_title, asc_title, desc_title FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE;
4200
+	$rows = $wpdb->get_results($sql);
4201 4201
 
4202
-	if ( ! empty( $rows ) ) {
4203
-		foreach ( $rows as $row ) {
4204
-			if ( ! empty( $row->site_title ) ) {
4205
-				$translation_texts[] = stripslashes_deep( $row->site_title );
4202
+	if (!empty($rows)) {
4203
+		foreach ($rows as $row) {
4204
+			if (!empty($row->site_title)) {
4205
+				$translation_texts[] = stripslashes_deep($row->site_title);
4206 4206
 			}
4207 4207
 
4208
-			if ( ! empty( $row->asc_title ) ) {
4209
-				$translation_texts[] = stripslashes_deep( $row->asc_title );
4208
+			if (!empty($row->asc_title)) {
4209
+				$translation_texts[] = stripslashes_deep($row->asc_title);
4210 4210
 			}
4211 4211
 
4212
-			if ( ! empty( $row->desc_title ) ) {
4213
-				$translation_texts[] = stripslashes_deep( $row->desc_title );
4212
+			if (!empty($row->desc_title)) {
4213
+				$translation_texts[] = stripslashes_deep($row->desc_title);
4214 4214
 			}
4215 4215
 		}
4216 4216
 	}
4217 4217
 
4218 4218
 	// Advance search filter fields table
4219
-	if ( defined( 'GEODIR_ADVANCE_SEARCH_TABLE' ) ) {
4220
-		$sql  = "SELECT field_site_name, front_search_title, field_desc FROM " . GEODIR_ADVANCE_SEARCH_TABLE;
4221
-		$rows = $wpdb->get_results( $sql );
4222
-
4223
-		if ( ! empty( $rows ) ) {
4224
-			foreach ( $rows as $row ) {
4225
-				if ( ! empty( $row->field_site_name ) ) {
4226
-					$translation_texts[] = stripslashes_deep( $row->field_site_name );
4219
+	if (defined('GEODIR_ADVANCE_SEARCH_TABLE')) {
4220
+		$sql  = "SELECT field_site_name, front_search_title, field_desc FROM ".GEODIR_ADVANCE_SEARCH_TABLE;
4221
+		$rows = $wpdb->get_results($sql);
4222
+
4223
+		if (!empty($rows)) {
4224
+			foreach ($rows as $row) {
4225
+				if (!empty($row->field_site_name)) {
4226
+					$translation_texts[] = stripslashes_deep($row->field_site_name);
4227 4227
 				}
4228 4228
 
4229
-				if ( ! empty( $row->front_search_title ) ) {
4230
-					$translation_texts[] = stripslashes_deep( $row->front_search_title );
4229
+				if (!empty($row->front_search_title)) {
4230
+					$translation_texts[] = stripslashes_deep($row->front_search_title);
4231 4231
 				}
4232 4232
 
4233
-				if ( ! empty( $row->field_desc ) ) {
4234
-					$translation_texts[] = stripslashes_deep( $row->field_desc );
4233
+				if (!empty($row->field_desc)) {
4234
+					$translation_texts[] = stripslashes_deep($row->field_desc);
4235 4235
 				}
4236 4236
 			}
4237 4237
 		}
4238 4238
 	}
4239 4239
 
4240
-	$translation_texts = ! empty( $translation_texts ) ? array_unique( $translation_texts ) : $translation_texts;
4240
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
4241 4241
 
4242 4242
 	return $translation_texts;
4243 4243
 }
@@ -4259,7 +4259,7 @@  discard block
 block discarded – undo
4259 4259
 	 *
4260 4260
 	 * @param array $geodir_allowed_mime_types and file extensions.
4261 4261
 	 */
4262
-	return apply_filters( 'geodir_allowed_mime_types', array(
4262
+	return apply_filters('geodir_allowed_mime_types', array(
4263 4263
 			'Image'       => array( // Image formats.
4264 4264
 				'jpg'  => 'image/jpeg',
4265 4265
 				'jpe'  => 'image/jpeg',
@@ -4327,18 +4327,18 @@  discard block
 block discarded – undo
4327 4327
  *
4328 4328
  * @return string User display name.
4329 4329
  */
4330
-function geodir_get_client_name( $user_id ) {
4330
+function geodir_get_client_name($user_id) {
4331 4331
 	$client_name = '';
4332 4332
 
4333
-	$user_data = get_userdata( $user_id );
4333
+	$user_data = get_userdata($user_id);
4334 4334
 
4335
-	if ( ! empty( $user_data ) ) {
4336
-		if ( isset( $user_data->display_name ) && trim( $user_data->display_name ) != '' ) {
4337
-			$client_name = trim( $user_data->display_name );
4338
-		} else if ( isset( $user_data->user_nicename ) && trim( $user_data->user_nicename ) != '' ) {
4339
-			$client_name = trim( $user_data->user_nicename );
4335
+	if (!empty($user_data)) {
4336
+		if (isset($user_data->display_name) && trim($user_data->display_name) != '') {
4337
+			$client_name = trim($user_data->display_name);
4338
+		} else if (isset($user_data->user_nicename) && trim($user_data->user_nicename) != '') {
4339
+			$client_name = trim($user_data->user_nicename);
4340 4340
 		} else {
4341
-			$client_name = trim( $user_data->user_login );
4341
+			$client_name = trim($user_data->user_login);
4342 4342
 		}
4343 4343
 	}
4344 4344
 
@@ -4346,19 +4346,19 @@  discard block
 block discarded – undo
4346 4346
 }
4347 4347
 
4348 4348
 
4349
-add_filter( 'wpseo_replacements', 'geodir_wpseo_replacements', 10, 1 );
4349
+add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1);
4350 4350
 /*
4351 4351
  * Add location variables to wpseo replacements.
4352 4352
  *
4353 4353
  * @since 1.5.4
4354 4354
  */
4355
-function geodir_wpseo_replacements( $vars ) {
4355
+function geodir_wpseo_replacements($vars) {
4356 4356
 
4357 4357
 	global $wp;
4358 4358
 	$title = '';
4359 4359
 	// location variables
4360 4360
 	$gd_post_type   = geodir_get_current_posttype();
4361
-	$location_array = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
4361
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4362 4362
 	/**
4363 4363
 	 * Filter the title variables location variables array
4364 4364
 	 *
@@ -4368,105 +4368,105 @@  discard block
 block discarded – undo
4368 4368
 	 * @param array $location_array The array of location variables.
4369 4369
 	 * @param array $vars           The page title variables.
4370 4370
 	 */
4371
-	$location_array  = apply_filters( 'geodir_filter_title_variables_location_arr_seo', $location_array, $vars );
4371
+	$location_array  = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars);
4372 4372
 	$location_titles = array();
4373
-	if ( get_query_var( 'gd_country_full' ) ) {
4374
-		if ( get_query_var( 'gd_country_full' ) ) {
4375
-			$location_array['gd_country'] = get_query_var( 'gd_country_full' );
4373
+	if (get_query_var('gd_country_full')) {
4374
+		if (get_query_var('gd_country_full')) {
4375
+			$location_array['gd_country'] = get_query_var('gd_country_full');
4376 4376
 		}
4377
-		if ( get_query_var( 'gd_region_full' ) ) {
4378
-			$location_array['gd_region'] = get_query_var( 'gd_region_full' );
4377
+		if (get_query_var('gd_region_full')) {
4378
+			$location_array['gd_region'] = get_query_var('gd_region_full');
4379 4379
 		}
4380
-		if ( get_query_var( 'gd_city_full' ) ) {
4381
-			$location_array['gd_city'] = get_query_var( 'gd_city_full' );
4380
+		if (get_query_var('gd_city_full')) {
4381
+			$location_array['gd_city'] = get_query_var('gd_city_full');
4382 4382
 		}
4383 4383
 	}
4384 4384
 	$location_single = '';
4385
-	$gd_country      = ( isset( $wp->query_vars['gd_country'] ) && $wp->query_vars['gd_country'] != '' ) ? $wp->query_vars['gd_country'] : '';
4386
-	$gd_region       = ( isset( $wp->query_vars['gd_region'] ) && $wp->query_vars['gd_region'] != '' ) ? $wp->query_vars['gd_region'] : '';
4387
-	$gd_city         = ( isset( $wp->query_vars['gd_city'] ) && $wp->query_vars['gd_city'] != '' ) ? $wp->query_vars['gd_city'] : '';
4385
+	$gd_country      = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4386
+	$gd_region       = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4387
+	$gd_city         = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4388 4388
 
4389 4389
 	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4390 4390
 
4391
-	if ( function_exists( 'get_actual_location_name' ) ) {
4392
-		$gd_country_actual = $gd_country != '' ? get_actual_location_name( 'country', $gd_country, true ) : $gd_country;
4393
-		$gd_region_actual  = $gd_region != '' ? get_actual_location_name( 'region', $gd_region ) : $gd_region;
4394
-		$gd_city_actual    = $gd_city != '' ? get_actual_location_name( 'city', $gd_city ) : $gd_city;
4391
+	if (function_exists('get_actual_location_name')) {
4392
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4393
+		$gd_region_actual  = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4394
+		$gd_city_actual    = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4395 4395
 	}
4396 4396
 
4397
-	if ( $gd_city != '' ) {
4398
-		if ( $gd_city_actual != '' ) {
4397
+	if ($gd_city != '') {
4398
+		if ($gd_city_actual != '') {
4399 4399
 			$gd_city = $gd_city_actual;
4400 4400
 		} else {
4401
-			$gd_city = preg_replace( '/-(\d+)$/', '', $gd_city );
4402
-			$gd_city = preg_replace( '/[_-]/', ' ', $gd_city );
4403
-			$gd_city = __( geodir_ucwords( $gd_city ), 'geodirectory' );
4401
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4402
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4403
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4404 4404
 		}
4405 4405
 		$location_single = $gd_city;
4406 4406
 
4407
-	} else if ( $gd_region != '' ) {
4408
-		if ( $gd_region_actual != '' ) {
4407
+	} else if ($gd_region != '') {
4408
+		if ($gd_region_actual != '') {
4409 4409
 			$gd_region = $gd_region_actual;
4410 4410
 		} else {
4411
-			$gd_region = preg_replace( '/-(\d+)$/', '', $gd_region );
4412
-			$gd_region = preg_replace( '/[_-]/', ' ', $gd_region );
4413
-			$gd_region = __( geodir_ucwords( $gd_region ), 'geodirectory' );
4411
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4412
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4413
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4414 4414
 		}
4415 4415
 
4416 4416
 		$location_single = $gd_region;
4417
-	} else if ( $gd_country != '' ) {
4418
-		if ( $gd_country_actual != '' ) {
4417
+	} else if ($gd_country != '') {
4418
+		if ($gd_country_actual != '') {
4419 4419
 			$gd_country = $gd_country_actual;
4420 4420
 		} else {
4421
-			$gd_country = preg_replace( '/-(\d+)$/', '', $gd_country );
4422
-			$gd_country = preg_replace( '/[_-]/', ' ', $gd_country );
4423
-			$gd_country = __( geodir_ucwords( $gd_country ), 'geodirectory' );
4421
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4422
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4423
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4424 4424
 		}
4425 4425
 
4426 4426
 		$location_single = $gd_country;
4427 4427
 	}
4428 4428
 
4429
-	if ( ! empty( $location_array ) ) {
4429
+	if (!empty($location_array)) {
4430 4430
 
4431
-		$actual_location_name = function_exists( 'get_actual_location_name' ) ? true : false;
4432
-		$location_array       = array_reverse( $location_array );
4431
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4432
+		$location_array       = array_reverse($location_array);
4433 4433
 
4434
-		foreach ( $location_array as $location_type => $location ) {
4435
-			$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location );
4436
-			$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
4434
+		foreach ($location_array as $location_type => $location) {
4435
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4436
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4437 4437
 
4438
-			$location_name = geodir_ucwords( $gd_location_link_text );
4439
-			$location_name = __( $location_name, 'geodirectory' );
4438
+			$location_name = geodir_ucwords($gd_location_link_text);
4439
+			$location_name = __($location_name, 'geodirectory');
4440 4440
 
4441
-			if ( $actual_location_name ) {
4442
-				$location_type = strpos( $location_type, 'gd_' ) === 0 ? substr( $location_type, 3 ) : $location_type;
4443
-				$location_name = get_actual_location_name( $location_type, $location, true );
4441
+			if ($actual_location_name) {
4442
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4443
+				$location_name = get_actual_location_name($location_type, $location, true);
4444 4444
 			}
4445 4445
 
4446 4446
 			$location_titles[] = $location_name;
4447 4447
 		}
4448
-		if ( ! empty( $location_titles ) ) {
4449
-			$location_titles = array_unique( $location_titles );
4448
+		if (!empty($location_titles)) {
4449
+			$location_titles = array_unique($location_titles);
4450 4450
 		}
4451 4451
 	}
4452 4452
 
4453 4453
 
4454
-	if ( ! empty( $location_titles ) ) {
4455
-		$vars['%%location%%'] = implode( ", ", $location_titles );
4454
+	if (!empty($location_titles)) {
4455
+		$vars['%%location%%'] = implode(", ", $location_titles);
4456 4456
 	}
4457 4457
 
4458 4458
 
4459
-	if ( ! empty( $location_titles ) ) {
4460
-		$vars['%%in_location%%'] = __( 'in ', 'geodirectory' ) . implode( ", ", $location_titles );
4459
+	if (!empty($location_titles)) {
4460
+		$vars['%%in_location%%'] = __('in ', 'geodirectory').implode(", ", $location_titles);
4461 4461
 	}
4462 4462
 
4463 4463
 
4464
-	if ( $location_single ) {
4465
-		$vars['%%in_location_single%%'] = __( 'in', 'geodirectory' ) . ' ' . $location_single;
4464
+	if ($location_single) {
4465
+		$vars['%%in_location_single%%'] = __('in', 'geodirectory').' '.$location_single;
4466 4466
 	}
4467 4467
 
4468 4468
 
4469
-	if ( $location_single ) {
4469
+	if ($location_single) {
4470 4470
 		$vars['%%location_single%%'] = $location_single;
4471 4471
 	}
4472 4472
 
@@ -4479,13 +4479,13 @@  discard block
 block discarded – undo
4479 4479
 	 * @param string $vars          The title with variables.
4480 4480
 	 * @param array $location_array The array of location variables.
4481 4481
 	 */
4482
-	return apply_filters( 'geodir_wpseo_replacements_vars', $vars, $location_array );
4482
+	return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array);
4483 4483
 }
4484 4484
 
4485 4485
 
4486
-add_filter( 'geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3 );
4487
-add_filter( 'geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2 );
4488
-add_filter( 'geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3 );
4486
+add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3);
4487
+add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2);
4488
+add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3);
4489 4489
 
4490 4490
 /**
4491 4491
  * Filter the title variables.
@@ -4527,14 +4527,14 @@  discard block
 block discarded – undo
4527 4527
  *
4528 4528
  * @return string Title after filtered variables.
4529 4529
  */
4530
-function geodir_filter_title_variables( $title, $gd_page, $sep = '' ) {
4530
+function geodir_filter_title_variables($title, $gd_page, $sep = '') {
4531 4531
 	global $wp, $post;
4532 4532
 
4533
-	if ( ! $gd_page || ! $title ) {
4533
+	if (!$gd_page || !$title) {
4534 4534
 		return $title; // if no a GD page then bail.
4535 4535
 	}
4536 4536
 
4537
-	if ( $sep == '' ) {
4537
+	if ($sep == '') {
4538 4538
 		/**
4539 4539
 		 * Filter the page title separator.
4540 4540
 		 *
@@ -4543,100 +4543,100 @@  discard block
 block discarded – undo
4543 4543
 		 *
4544 4544
 		 * @param string $sep The separator, default: `|`.
4545 4545
 		 */
4546
-		$sep = apply_filters( 'geodir_page_title_separator', '|' );
4546
+		$sep = apply_filters('geodir_page_title_separator', '|');
4547 4547
 	}
4548 4548
 
4549
-	if ( strpos( $title, '%%title%%' ) !== false ) {
4550
-		$title = str_replace( "%%title%%", $post->post_title, $title );
4549
+	if (strpos($title, '%%title%%') !== false) {
4550
+		$title = str_replace("%%title%%", $post->post_title, $title);
4551 4551
 	}
4552 4552
 
4553
-	if ( strpos( $title, '%%sitename%%' ) !== false ) {
4554
-		$title = str_replace( "%%sitename%%", get_bloginfo( 'name' ), $title );
4553
+	if (strpos($title, '%%sitename%%') !== false) {
4554
+		$title = str_replace("%%sitename%%", get_bloginfo('name'), $title);
4555 4555
 	}
4556 4556
 
4557
-	if ( strpos( $title, '%%sitedesc%%' ) !== false ) {
4558
-		$title = str_replace( "%%sitedesc%%", get_bloginfo( 'description' ), $title );
4557
+	if (strpos($title, '%%sitedesc%%') !== false) {
4558
+		$title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title);
4559 4559
 	}
4560 4560
 
4561
-	if ( strpos( $title, '%%excerpt%%' ) !== false ) {
4562
-		$title = str_replace( "%%excerpt%%", strip_tags( get_the_excerpt() ), $title );
4561
+	if (strpos($title, '%%excerpt%%') !== false) {
4562
+		$title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title);
4563 4563
 	}
4564 4564
 
4565
-	if ( $gd_page == 'search' || $gd_page == 'author' ) {
4566
-		$post_type = isset( $_REQUEST['stype'] ) ? sanitize_text_field( $_REQUEST['stype'] ) : '';
4567
-	} else if ( $gd_page == 'add-listing' ) {
4568
-		$post_type = ( isset( $_REQUEST['listing_type'] ) ) ? sanitize_text_field( $_REQUEST['listing_type'] ) : '';
4569
-		$post_type = ! $post_type && ! empty( $_REQUEST['pid'] ) ? get_post_type( (int) $_REQUEST['pid'] ) : $post_type;
4570
-	} else if ( isset( $post->post_type ) && $post->post_type && in_array( $post->post_type, geodir_get_posttypes() ) ) {
4565
+	if ($gd_page == 'search' || $gd_page == 'author') {
4566
+		$post_type = isset($_REQUEST['stype']) ? sanitize_text_field($_REQUEST['stype']) : '';
4567
+	} else if ($gd_page == 'add-listing') {
4568
+		$post_type = (isset($_REQUEST['listing_type'])) ? sanitize_text_field($_REQUEST['listing_type']) : '';
4569
+		$post_type = !$post_type && !empty($_REQUEST['pid']) ? get_post_type((int) $_REQUEST['pid']) : $post_type;
4570
+	} else if (isset($post->post_type) && $post->post_type && in_array($post->post_type, geodir_get_posttypes())) {
4571 4571
 		$post_type = $post->post_type;
4572 4572
 	} else {
4573
-		$post_type = get_query_var( 'post_type' );
4573
+		$post_type = get_query_var('post_type');
4574 4574
 	}
4575 4575
 
4576
-	if ( strpos( $title, '%%pt_single%%' ) !== false ) {
4576
+	if (strpos($title, '%%pt_single%%') !== false) {
4577 4577
 		$singular_name = '';
4578
-		if ( $post_type && $singular_name = get_post_type_singular_label( $post_type ) ) {
4579
-			$singular_name = __( $singular_name, 'geodirectory' );
4578
+		if ($post_type && $singular_name = get_post_type_singular_label($post_type)) {
4579
+			$singular_name = __($singular_name, 'geodirectory');
4580 4580
 		}
4581 4581
 
4582
-		$title = str_replace( "%%pt_single%%", $singular_name, $title );
4582
+		$title = str_replace("%%pt_single%%", $singular_name, $title);
4583 4583
 	}
4584 4584
 
4585
-	if ( strpos( $title, '%%pt_plural%%' ) !== false ) {
4585
+	if (strpos($title, '%%pt_plural%%') !== false) {
4586 4586
 		$plural_name = '';
4587
-		if ( $post_type && $plural_name = get_post_type_plural_label( $post_type ) ) {
4588
-			$plural_name = __( $plural_name, 'geodirectory' );
4587
+		if ($post_type && $plural_name = get_post_type_plural_label($post_type)) {
4588
+			$plural_name = __($plural_name, 'geodirectory');
4589 4589
 		}
4590 4590
 
4591
-		$title = str_replace( "%%pt_plural%%", $plural_name, $title );
4591
+		$title = str_replace("%%pt_plural%%", $plural_name, $title);
4592 4592
 	}
4593 4593
 
4594
-	if ( strpos( $title, '%%category%%' ) !== false ) {
4594
+	if (strpos($title, '%%category%%') !== false) {
4595 4595
 		$cat_name = '';
4596 4596
 
4597
-		if ( $gd_page == 'detail' ) {
4598
-			if ( $post->default_category ) {
4599
-				$cat      = get_term( $post->default_category, $post->post_type . 'category' );
4600
-				$cat_name = ( isset( $cat->name ) ) ? $cat->name : '';
4597
+		if ($gd_page == 'detail') {
4598
+			if ($post->default_category) {
4599
+				$cat      = get_term($post->default_category, $post->post_type.'category');
4600
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4601 4601
 			}
4602
-		} else if ( $gd_page == 'listing' ) {
4602
+		} else if ($gd_page == 'listing') {
4603 4603
 			$queried_object = get_queried_object();
4604
-			if ( isset( $queried_object->name ) ) {
4604
+			if (isset($queried_object->name)) {
4605 4605
 				$cat_name = $queried_object->name;
4606 4606
 			}
4607 4607
 		}
4608
-		$title = str_replace( "%%category%%", $cat_name, $title );
4608
+		$title = str_replace("%%category%%", $cat_name, $title);
4609 4609
 	}
4610 4610
 
4611
-	if ( strpos( $title, '%%tag%%' ) !== false ) {
4611
+	if (strpos($title, '%%tag%%') !== false) {
4612 4612
 		$cat_name = '';
4613 4613
 
4614
-		if ( $gd_page == 'detail' ) {
4615
-			if ( $post->default_category ) {
4616
-				$cat      = get_term( $post->default_category, $post->post_type . 'category' );
4617
-				$cat_name = ( isset( $cat->name ) ) ? $cat->name : '';
4614
+		if ($gd_page == 'detail') {
4615
+			if ($post->default_category) {
4616
+				$cat      = get_term($post->default_category, $post->post_type.'category');
4617
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4618 4618
 			}
4619
-		} else if ( $gd_page == 'listing' ) {
4619
+		} else if ($gd_page == 'listing') {
4620 4620
 			$queried_object = get_queried_object();
4621
-			if ( isset( $queried_object->name ) ) {
4621
+			if (isset($queried_object->name)) {
4622 4622
 				$cat_name = $queried_object->name;
4623 4623
 			}
4624 4624
 		}
4625
-		$title = str_replace( "%%tag%%", $cat_name, $title );
4625
+		$title = str_replace("%%tag%%", $cat_name, $title);
4626 4626
 	}
4627 4627
 
4628
-	if ( strpos( $title, '%%id%%' ) !== false ) {
4629
-		$ID    = ( isset( $post->ID ) ) ? $post->ID : '';
4630
-		$title = str_replace( "%%id%%", $ID, $title );
4628
+	if (strpos($title, '%%id%%') !== false) {
4629
+		$ID    = (isset($post->ID)) ? $post->ID : '';
4630
+		$title = str_replace("%%id%%", $ID, $title);
4631 4631
 	}
4632 4632
 
4633
-	if ( strpos( $title, '%%sep%%' ) !== false ) {
4634
-		$title = str_replace( "%%sep%%", $sep, $title );
4633
+	if (strpos($title, '%%sep%%') !== false) {
4634
+		$title = str_replace("%%sep%%", $sep, $title);
4635 4635
 	}
4636 4636
 
4637 4637
 	// location variables
4638 4638
 	$gd_post_type   = geodir_get_current_posttype();
4639
-	$location_array = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
4639
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4640 4640
 	/**
4641 4641
 	 * Filter the title variables location variables array
4642 4642
 	 *
@@ -4648,166 +4648,166 @@  discard block
 block discarded – undo
4648 4648
 	 * @param string $gd_page       The page being filtered.
4649 4649
 	 * @param string $sep           The separator, default: `|`.
4650 4650
 	 */
4651
-	$location_array  = apply_filters( 'geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep );
4651
+	$location_array  = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep);
4652 4652
 	$location_titles = array();
4653
-	if ( $gd_page == 'location' && get_query_var( 'gd_country_full' ) ) {
4654
-		if ( get_query_var( 'gd_country_full' ) ) {
4655
-			$location_array['gd_country'] = get_query_var( 'gd_country_full' );
4653
+	if ($gd_page == 'location' && get_query_var('gd_country_full')) {
4654
+		if (get_query_var('gd_country_full')) {
4655
+			$location_array['gd_country'] = get_query_var('gd_country_full');
4656 4656
 		}
4657
-		if ( get_query_var( 'gd_region_full' ) ) {
4658
-			$location_array['gd_region'] = get_query_var( 'gd_region_full' );
4657
+		if (get_query_var('gd_region_full')) {
4658
+			$location_array['gd_region'] = get_query_var('gd_region_full');
4659 4659
 		}
4660
-		if ( get_query_var( 'gd_city_full' ) ) {
4661
-			$location_array['gd_city'] = get_query_var( 'gd_city_full' );
4660
+		if (get_query_var('gd_city_full')) {
4661
+			$location_array['gd_city'] = get_query_var('gd_city_full');
4662 4662
 		}
4663 4663
 	}
4664 4664
 	$location_single = '';
4665
-	$gd_country      = ( isset( $wp->query_vars['gd_country'] ) && $wp->query_vars['gd_country'] != '' ) ? $wp->query_vars['gd_country'] : '';
4666
-	$gd_region       = ( isset( $wp->query_vars['gd_region'] ) && $wp->query_vars['gd_region'] != '' ) ? $wp->query_vars['gd_region'] : '';
4667
-	$gd_city         = ( isset( $wp->query_vars['gd_city'] ) && $wp->query_vars['gd_city'] != '' ) ? $wp->query_vars['gd_city'] : '';
4665
+	$gd_country      = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4666
+	$gd_region       = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4667
+	$gd_city         = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4668 4668
 
4669 4669
 	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4670 4670
 
4671
-	if ( function_exists( 'get_actual_location_name' ) ) {
4672
-		$gd_country_actual = $gd_country != '' ? get_actual_location_name( 'country', $gd_country, true ) : $gd_country;
4673
-		$gd_region_actual  = $gd_region != '' ? get_actual_location_name( 'region', $gd_region ) : $gd_region;
4674
-		$gd_city_actual    = $gd_city != '' ? get_actual_location_name( 'city', $gd_city ) : $gd_city;
4671
+	if (function_exists('get_actual_location_name')) {
4672
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4673
+		$gd_region_actual  = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4674
+		$gd_city_actual    = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4675 4675
 	}
4676 4676
 
4677
-	if ( $gd_city != '' ) {
4678
-		if ( $gd_city_actual != '' ) {
4677
+	if ($gd_city != '') {
4678
+		if ($gd_city_actual != '') {
4679 4679
 			$gd_city = $gd_city_actual;
4680 4680
 		} else {
4681
-			$gd_city = preg_replace( '/-(\d+)$/', '', $gd_city );
4682
-			$gd_city = preg_replace( '/[_-]/', ' ', $gd_city );
4683
-			$gd_city = __( geodir_ucwords( $gd_city ), 'geodirectory' );
4681
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4682
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4683
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4684 4684
 		}
4685 4685
 		$location_single = $gd_city;
4686 4686
 
4687
-	} else if ( $gd_region != '' ) {
4688
-		if ( $gd_region_actual != '' ) {
4687
+	} else if ($gd_region != '') {
4688
+		if ($gd_region_actual != '') {
4689 4689
 			$gd_region = $gd_region_actual;
4690 4690
 		} else {
4691
-			$gd_region = preg_replace( '/-(\d+)$/', '', $gd_region );
4692
-			$gd_region = preg_replace( '/[_-]/', ' ', $gd_region );
4693
-			$gd_region = __( geodir_ucwords( $gd_region ), 'geodirectory' );
4691
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4692
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4693
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4694 4694
 		}
4695 4695
 
4696 4696
 		$location_single = $gd_region;
4697
-	} else if ( $gd_country != '' ) {
4698
-		if ( $gd_country_actual != '' ) {
4697
+	} else if ($gd_country != '') {
4698
+		if ($gd_country_actual != '') {
4699 4699
 			$gd_country = $gd_country_actual;
4700 4700
 		} else {
4701
-			$gd_country = preg_replace( '/-(\d+)$/', '', $gd_country );
4702
-			$gd_country = preg_replace( '/[_-]/', ' ', $gd_country );
4703
-			$gd_country = __( geodir_ucwords( $gd_country ), 'geodirectory' );
4701
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4702
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4703
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4704 4704
 		}
4705 4705
 
4706 4706
 		$location_single = $gd_country;
4707 4707
 	}
4708 4708
 
4709
-	if ( ! empty( $location_array ) ) {
4709
+	if (!empty($location_array)) {
4710 4710
 
4711
-		$actual_location_name = function_exists( 'get_actual_location_name' ) ? true : false;
4712
-		$location_array       = array_reverse( $location_array );
4711
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4712
+		$location_array       = array_reverse($location_array);
4713 4713
 
4714
-		foreach ( $location_array as $location_type => $location ) {
4715
-			$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location );
4716
-			$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
4714
+		foreach ($location_array as $location_type => $location) {
4715
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4716
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4717 4717
 
4718
-			$location_name = geodir_ucwords( $gd_location_link_text );
4719
-			$location_name = __( $location_name, 'geodirectory' );
4718
+			$location_name = geodir_ucwords($gd_location_link_text);
4719
+			$location_name = __($location_name, 'geodirectory');
4720 4720
 
4721
-			if ( $actual_location_name ) {
4722
-				$location_type = strpos( $location_type, 'gd_' ) === 0 ? substr( $location_type, 3 ) : $location_type;
4723
-				$location_name = get_actual_location_name( $location_type, $location, true );
4721
+			if ($actual_location_name) {
4722
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4723
+				$location_name = get_actual_location_name($location_type, $location, true);
4724 4724
 			}
4725 4725
 
4726 4726
 			$location_titles[] = $location_name;
4727 4727
 		}
4728
-		if ( ! empty( $location_titles ) ) {
4729
-			$location_titles = array_unique( $location_titles );
4728
+		if (!empty($location_titles)) {
4729
+			$location_titles = array_unique($location_titles);
4730 4730
 		}
4731 4731
 	}
4732 4732
 
4733 4733
 
4734
-	if ( strpos( $title, '%%location%%' ) !== false ) {
4734
+	if (strpos($title, '%%location%%') !== false) {
4735 4735
 		$location = '';
4736
-		if ( $location_titles ) {
4737
-			$location = implode( ", ", $location_titles );
4736
+		if ($location_titles) {
4737
+			$location = implode(", ", $location_titles);
4738 4738
 		}
4739
-		$title = str_replace( "%%location%%", $location, $title );
4739
+		$title = str_replace("%%location%%", $location, $title);
4740 4740
 	}
4741 4741
 
4742
-	if ( strpos( $title, '%%in_location%%' ) !== false ) {
4742
+	if (strpos($title, '%%in_location%%') !== false) {
4743 4743
 		$location = '';
4744
-		if ( $location_titles ) {
4745
-			$location = __( 'in ', 'geodirectory' ) . implode( ", ", $location_titles );
4744
+		if ($location_titles) {
4745
+			$location = __('in ', 'geodirectory').implode(", ", $location_titles);
4746 4746
 		}
4747
-		$title = str_replace( "%%in_location%%", $location, $title );
4747
+		$title = str_replace("%%in_location%%", $location, $title);
4748 4748
 	}
4749 4749
 
4750
-	if ( strpos( $title, '%%in_location_single%%' ) !== false ) {
4751
-		if ( $location_single ) {
4752
-			$location_single = __( 'in', 'geodirectory' ) . ' ' . $location_single;
4750
+	if (strpos($title, '%%in_location_single%%') !== false) {
4751
+		if ($location_single) {
4752
+			$location_single = __('in', 'geodirectory').' '.$location_single;
4753 4753
 		}
4754
-		$title = str_replace( "%%in_location_single%%", $location_single, $title );
4754
+		$title = str_replace("%%in_location_single%%", $location_single, $title);
4755 4755
 	}
4756 4756
 
4757
-	if ( strpos( $title, '%%location_single%%' ) !== false ) {
4758
-		$title = str_replace( "%%location_single%%", $location_single, $title );
4757
+	if (strpos($title, '%%location_single%%') !== false) {
4758
+		$title = str_replace("%%location_single%%", $location_single, $title);
4759 4759
 	}
4760 4760
 
4761 4761
 
4762
-	if ( strpos( $title, '%%search_term%%' ) !== false ) {
4762
+	if (strpos($title, '%%search_term%%') !== false) {
4763 4763
 		$search_term = '';
4764
-		if ( isset( $_REQUEST['s'] ) ) {
4765
-			$search_term = esc_attr( $_REQUEST['s'] );
4764
+		if (isset($_REQUEST['s'])) {
4765
+			$search_term = esc_attr($_REQUEST['s']);
4766 4766
 		}
4767
-		$title = str_replace( "%%search_term%%", $search_term, $title );
4767
+		$title = str_replace("%%search_term%%", $search_term, $title);
4768 4768
 	}
4769 4769
 
4770
-	if ( strpos( $title, '%%search_near%%' ) !== false ) {
4770
+	if (strpos($title, '%%search_near%%') !== false) {
4771 4771
 		$search_term = '';
4772
-		if ( isset( $_REQUEST['snear'] ) ) {
4773
-			$search_term = esc_attr( $_REQUEST['snear'] );
4772
+		if (isset($_REQUEST['snear'])) {
4773
+			$search_term = esc_attr($_REQUEST['snear']);
4774 4774
 		}
4775
-		$title = str_replace( "%%search_near%%", $search_term, $title );
4775
+		$title = str_replace("%%search_near%%", $search_term, $title);
4776 4776
 	}
4777 4777
 
4778
-	if ( strpos( $title, '%%name%%' ) !== false ) {
4779
-		if ( is_author() ) {
4780
-			$curauth     = ( get_query_var( 'author_name' ) ) ? get_user_by( 'slug', get_query_var( 'author_name' ) ) : get_userdata( get_query_var( 'author' ) );
4778
+	if (strpos($title, '%%name%%') !== false) {
4779
+		if (is_author()) {
4780
+			$curauth     = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
4781 4781
 			$author_name = $curauth->display_name;
4782 4782
 		} else {
4783 4783
 			$author_name = get_the_author();
4784 4784
 		}
4785
-		if ( ! $author_name || $author_name === '' ) {
4785
+		if (!$author_name || $author_name === '') {
4786 4786
 			$queried_object = get_queried_object();
4787 4787
 
4788
-			if ( isset( $queried_object->data->user_nicename ) ) {
4788
+			if (isset($queried_object->data->user_nicename)) {
4789 4789
 				$author_name = $queried_object->data->display_name;
4790 4790
 			}
4791 4791
 		}
4792
-		$title = str_replace( "%%name%%", $author_name, $title );
4792
+		$title = str_replace("%%name%%", $author_name, $title);
4793 4793
 	}
4794 4794
 
4795
-	if ( strpos( $title, '%%page%%' ) !== false ) {
4796
-		$page  = geodir_title_meta_page( $sep );
4797
-		$title = str_replace( "%%page%%", $page, $title );
4795
+	if (strpos($title, '%%page%%') !== false) {
4796
+		$page  = geodir_title_meta_page($sep);
4797
+		$title = str_replace("%%page%%", $page, $title);
4798 4798
 	}
4799
-	if ( strpos( $title, '%%pagenumber%%' ) !== false ) {
4799
+	if (strpos($title, '%%pagenumber%%') !== false) {
4800 4800
 		$pagenumber = geodir_title_meta_pagenumber();
4801
-		$title      = str_replace( "%%pagenumber%%", $pagenumber, $title );
4801
+		$title      = str_replace("%%pagenumber%%", $pagenumber, $title);
4802 4802
 	}
4803
-	if ( strpos( $title, '%%pagetotal%%' ) !== false ) {
4803
+	if (strpos($title, '%%pagetotal%%') !== false) {
4804 4804
 		$pagetotal = geodir_title_meta_pagetotal();
4805
-		$title     = str_replace( "%%pagetotal%%", $pagetotal, $title );
4805
+		$title     = str_replace("%%pagetotal%%", $pagetotal, $title);
4806 4806
 	}
4807 4807
 
4808
-	$title = wptexturize( $title );
4809
-	$title = convert_chars( $title );
4810
-	$title = esc_html( $title );
4808
+	$title = wptexturize($title);
4809
+	$title = convert_chars($title);
4810
+	$title = esc_html($title);
4811 4811
 
4812 4812
 	/**
4813 4813
 	 * Filter the title variables after standard ones have been filtered.
@@ -4821,7 +4821,7 @@  discard block
 block discarded – undo
4821 4821
 	 * @param string $sep           The separator, default: `|`.
4822 4822
 	 */
4823 4823
 
4824
-	return apply_filters( 'geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep );
4824
+	return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep);
4825 4825
 }
4826 4826
 
4827 4827
 /**
@@ -4834,82 +4834,82 @@  discard block
 block discarded – undo
4834 4834
  *
4835 4835
  * @return array Translation texts.
4836 4836
  */
4837
-function geodir_load_cpt_text_translation( $translation_texts = array() ) {
4838
-	$gd_post_types = geodir_get_posttypes( 'array' );
4837
+function geodir_load_cpt_text_translation($translation_texts = array()) {
4838
+	$gd_post_types = geodir_get_posttypes('array');
4839 4839
 
4840
-	if ( ! empty( $gd_post_types ) ) {
4841
-		foreach ( $gd_post_types as $post_type => $cpt_info ) {
4842
-			$labels      = isset( $cpt_info['labels'] ) ? $cpt_info['labels'] : '';
4843
-			$description = isset( $cpt_info['description'] ) ? $cpt_info['description'] : '';
4844
-			$seo         = isset( $cpt_info['seo'] ) ? $cpt_info['seo'] : '';
4840
+	if (!empty($gd_post_types)) {
4841
+		foreach ($gd_post_types as $post_type => $cpt_info) {
4842
+			$labels      = isset($cpt_info['labels']) ? $cpt_info['labels'] : '';
4843
+			$description = isset($cpt_info['description']) ? $cpt_info['description'] : '';
4844
+			$seo         = isset($cpt_info['seo']) ? $cpt_info['seo'] : '';
4845 4845
 
4846
-			if ( ! empty( $labels ) ) {
4847
-				if ( $labels['name'] != '' && ! in_array( $labels['name'], $translation_texts ) ) {
4846
+			if (!empty($labels)) {
4847
+				if ($labels['name'] != '' && !in_array($labels['name'], $translation_texts)) {
4848 4848
 					$translation_texts[] = $labels['name'];
4849 4849
 				}
4850
-				if ( $labels['singular_name'] != '' && ! in_array( $labels['singular_name'], $translation_texts ) ) {
4850
+				if ($labels['singular_name'] != '' && !in_array($labels['singular_name'], $translation_texts)) {
4851 4851
 					$translation_texts[] = $labels['singular_name'];
4852 4852
 				}
4853
-				if ( $labels['add_new'] != '' && ! in_array( $labels['add_new'], $translation_texts ) ) {
4853
+				if ($labels['add_new'] != '' && !in_array($labels['add_new'], $translation_texts)) {
4854 4854
 					$translation_texts[] = $labels['add_new'];
4855 4855
 				}
4856
-				if ( $labels['add_new_item'] != '' && ! in_array( $labels['add_new_item'], $translation_texts ) ) {
4856
+				if ($labels['add_new_item'] != '' && !in_array($labels['add_new_item'], $translation_texts)) {
4857 4857
 					$translation_texts[] = $labels['add_new_item'];
4858 4858
 				}
4859
-				if ( $labels['edit_item'] != '' && ! in_array( $labels['edit_item'], $translation_texts ) ) {
4859
+				if ($labels['edit_item'] != '' && !in_array($labels['edit_item'], $translation_texts)) {
4860 4860
 					$translation_texts[] = $labels['edit_item'];
4861 4861
 				}
4862
-				if ( $labels['new_item'] != '' && ! in_array( $labels['new_item'], $translation_texts ) ) {
4862
+				if ($labels['new_item'] != '' && !in_array($labels['new_item'], $translation_texts)) {
4863 4863
 					$translation_texts[] = $labels['new_item'];
4864 4864
 				}
4865
-				if ( $labels['view_item'] != '' && ! in_array( $labels['view_item'], $translation_texts ) ) {
4865
+				if ($labels['view_item'] != '' && !in_array($labels['view_item'], $translation_texts)) {
4866 4866
 					$translation_texts[] = $labels['view_item'];
4867 4867
 				}
4868
-				if ( $labels['search_items'] != '' && ! in_array( $labels['search_items'], $translation_texts ) ) {
4868
+				if ($labels['search_items'] != '' && !in_array($labels['search_items'], $translation_texts)) {
4869 4869
 					$translation_texts[] = $labels['search_items'];
4870 4870
 				}
4871
-				if ( $labels['not_found'] != '' && ! in_array( $labels['not_found'], $translation_texts ) ) {
4871
+				if ($labels['not_found'] != '' && !in_array($labels['not_found'], $translation_texts)) {
4872 4872
 					$translation_texts[] = $labels['not_found'];
4873 4873
 				}
4874
-				if ( $labels['not_found_in_trash'] != '' && ! in_array( $labels['not_found_in_trash'], $translation_texts ) ) {
4874
+				if ($labels['not_found_in_trash'] != '' && !in_array($labels['not_found_in_trash'], $translation_texts)) {
4875 4875
 					$translation_texts[] = $labels['not_found_in_trash'];
4876 4876
 				}
4877
-				if ( isset( $labels['label_post_profile'] ) && $labels['label_post_profile'] != '' && ! in_array( $labels['label_post_profile'], $translation_texts ) ) {
4877
+				if (isset($labels['label_post_profile']) && $labels['label_post_profile'] != '' && !in_array($labels['label_post_profile'], $translation_texts)) {
4878 4878
 					$translation_texts[] = $labels['label_post_profile'];
4879 4879
 				}
4880
-				if ( isset( $labels['label_post_info'] ) && $labels['label_post_info'] != '' && ! in_array( $labels['label_post_info'], $translation_texts ) ) {
4880
+				if (isset($labels['label_post_info']) && $labels['label_post_info'] != '' && !in_array($labels['label_post_info'], $translation_texts)) {
4881 4881
 					$translation_texts[] = $labels['label_post_info'];
4882 4882
 				}
4883
-				if ( isset( $labels['label_post_images'] ) && $labels['label_post_images'] != '' && ! in_array( $labels['label_post_images'], $translation_texts ) ) {
4883
+				if (isset($labels['label_post_images']) && $labels['label_post_images'] != '' && !in_array($labels['label_post_images'], $translation_texts)) {
4884 4884
 					$translation_texts[] = $labels['label_post_images'];
4885 4885
 				}
4886
-				if ( isset( $labels['label_post_map'] ) && $labels['label_post_map'] != '' && ! in_array( $labels['label_post_map'], $translation_texts ) ) {
4886
+				if (isset($labels['label_post_map']) && $labels['label_post_map'] != '' && !in_array($labels['label_post_map'], $translation_texts)) {
4887 4887
 					$translation_texts[] = $labels['label_post_map'];
4888 4888
 				}
4889
-				if ( isset( $labels['label_reviews'] ) && $labels['label_reviews'] != '' && ! in_array( $labels['label_reviews'], $translation_texts ) ) {
4889
+				if (isset($labels['label_reviews']) && $labels['label_reviews'] != '' && !in_array($labels['label_reviews'], $translation_texts)) {
4890 4890
 					$translation_texts[] = $labels['label_reviews'];
4891 4891
 				}
4892
-				if ( isset( $labels['label_related_listing'] ) && $labels['label_related_listing'] != '' && ! in_array( $labels['label_related_listing'], $translation_texts ) ) {
4892
+				if (isset($labels['label_related_listing']) && $labels['label_related_listing'] != '' && !in_array($labels['label_related_listing'], $translation_texts)) {
4893 4893
 					$translation_texts[] = $labels['label_related_listing'];
4894 4894
 				}
4895 4895
 			}
4896 4896
 
4897
-			if ( $description != '' && ! in_array( $description, $translation_texts ) ) {
4898
-				$translation_texts[] = normalize_whitespace( $description );
4897
+			if ($description != '' && !in_array($description, $translation_texts)) {
4898
+				$translation_texts[] = normalize_whitespace($description);
4899 4899
 			}
4900 4900
 
4901
-			if ( ! empty( $seo ) ) {
4902
-				if ( isset( $seo['meta_keyword'] ) && $seo['meta_keyword'] != '' && ! in_array( $seo['meta_keyword'], $translation_texts ) ) {
4903
-					$translation_texts[] = normalize_whitespace( $seo['meta_keyword'] );
4901
+			if (!empty($seo)) {
4902
+				if (isset($seo['meta_keyword']) && $seo['meta_keyword'] != '' && !in_array($seo['meta_keyword'], $translation_texts)) {
4903
+					$translation_texts[] = normalize_whitespace($seo['meta_keyword']);
4904 4904
 				}
4905 4905
 
4906
-				if ( isset( $seo['meta_description'] ) && $seo['meta_description'] != '' && ! in_array( $seo['meta_description'], $translation_texts ) ) {
4907
-					$translation_texts[] = normalize_whitespace( $seo['meta_description'] );
4906
+				if (isset($seo['meta_description']) && $seo['meta_description'] != '' && !in_array($seo['meta_description'], $translation_texts)) {
4907
+					$translation_texts[] = normalize_whitespace($seo['meta_description']);
4908 4908
 				}
4909 4909
 			}
4910 4910
 		}
4911 4911
 	}
4912
-	$translation_texts = ! empty( $translation_texts ) ? array_unique( $translation_texts ) : $translation_texts;
4912
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
4913 4913
 
4914 4914
 	return $translation_texts;
4915 4915
 }
@@ -4924,27 +4924,27 @@  discard block
 block discarded – undo
4924 4924
  *
4925 4925
  * @return array Location terms.
4926 4926
  */
4927
-function geodir_remove_location_terms( $location_terms = array() ) {
4928
-	$location_manager = defined( 'POST_LOCATION_TABLE' ) ? true : false;
4927
+function geodir_remove_location_terms($location_terms = array()) {
4928
+	$location_manager = defined('POST_LOCATION_TABLE') ? true : false;
4929 4929
 
4930
-	if ( ! empty( $location_terms ) && $location_manager ) {
4931
-		$hide_country_part = get_option( 'geodir_location_hide_country_part' );
4932
-		$hide_region_part  = get_option( 'geodir_location_hide_region_part' );
4930
+	if (!empty($location_terms) && $location_manager) {
4931
+		$hide_country_part = get_option('geodir_location_hide_country_part');
4932
+		$hide_region_part  = get_option('geodir_location_hide_region_part');
4933 4933
 
4934
-		if ( $hide_region_part && $hide_country_part ) {
4935
-			if ( isset( $location_terms['gd_country'] ) ) {
4936
-				unset( $location_terms['gd_country'] );
4934
+		if ($hide_region_part && $hide_country_part) {
4935
+			if (isset($location_terms['gd_country'])) {
4936
+				unset($location_terms['gd_country']);
4937 4937
 			}
4938
-			if ( isset( $location_terms['gd_region'] ) ) {
4939
-				unset( $location_terms['gd_region'] );
4938
+			if (isset($location_terms['gd_region'])) {
4939
+				unset($location_terms['gd_region']);
4940 4940
 			}
4941
-		} else if ( $hide_region_part && ! $hide_country_part ) {
4942
-			if ( isset( $location_terms['gd_region'] ) ) {
4943
-				unset( $location_terms['gd_region'] );
4941
+		} else if ($hide_region_part && !$hide_country_part) {
4942
+			if (isset($location_terms['gd_region'])) {
4943
+				unset($location_terms['gd_region']);
4944 4944
 			}
4945
-		} else if ( ! $hide_region_part && $hide_country_part ) {
4946
-			if ( isset( $location_terms['gd_country'] ) ) {
4947
-				unset( $location_terms['gd_country'] );
4945
+		} else if (!$hide_region_part && $hide_country_part) {
4946
+			if (isset($location_terms['gd_country'])) {
4947
+				unset($location_terms['gd_country']);
4948 4948
 			}
4949 4949
 		}
4950 4950
 	}
@@ -4962,33 +4962,33 @@  discard block
 block discarded – undo
4962 4962
  * @param WP_Post $post Post object.
4963 4963
  * @param bool $update  Whether this is an existing listing being updated or not.
4964 4964
  */
4965
-function geodir_on_wp_insert_post( $post_ID, $post, $update ) {
4966
-	if ( ! $update ) {
4965
+function geodir_on_wp_insert_post($post_ID, $post, $update) {
4966
+	if (!$update) {
4967 4967
 		return;
4968 4968
 	}
4969 4969
 
4970
-	$action      = isset( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
4971
-	$is_admin    = is_admin() && ( ! defined( 'DOING_AJAX' ) || ( defined( 'DOING_AJAX' ) && ! DOING_AJAX ) ) ? true : false;
4970
+	$action      = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : '';
4971
+	$is_admin    = is_admin() && (!defined('DOING_AJAX') || (defined('DOING_AJAX') && !DOING_AJAX)) ? true : false;
4972 4972
 	$inline_save = $action == 'inline-save' ? true : false;
4973 4973
 
4974
-	if ( empty( $post->post_type ) || $is_admin || $inline_save || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) {
4974
+	if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {
4975 4975
 		return;
4976 4976
 	}
4977 4977
 
4978
-	if ( $action != '' && in_array( $action, array( 'geodir_import_export' ) ) ) {
4978
+	if ($action != '' && in_array($action, array('geodir_import_export'))) {
4979 4979
 		return;
4980 4980
 	}
4981 4981
 
4982 4982
 	$user_id = (int) get_current_user_id();
4983 4983
 
4984
-	if ( $user_id > 0 && get_option( 'geodir_notify_post_edited' ) && ! wp_is_post_revision( $post_ID ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
4985
-		$author_id = ! empty( $post->post_author ) ? $post->post_author : 0;
4984
+	if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) {
4985
+		$author_id = !empty($post->post_author) ? $post->post_author : 0;
4986 4986
 
4987
-		if ( $user_id == $author_id && ! is_super_admin() ) {
4988
-			$from_email   = get_option( 'site_email' );
4987
+		if ($user_id == $author_id && !is_super_admin()) {
4988
+			$from_email   = get_option('site_email');
4989 4989
 			$from_name    = get_site_emailName();
4990
-			$to_email     = get_option( 'admin_email' );
4991
-			$to_name      = get_option( 'name' );
4990
+			$to_email     = get_option('admin_email');
4991
+			$to_name      = get_option('name');
4992 4992
 			$message_type = 'listing_edited';
4993 4993
 
4994 4994
 			$notify_edited = true;
@@ -5000,9 +5000,9 @@  discard block
 block discarded – undo
5000 5000
 			 * @param bool $notify_edited Notify on listing edited by author?
5001 5001
 			 * @param object $post        The current post object.
5002 5002
 			 */
5003
-			$notify_edited = apply_filters( 'geodir_notify_on_listing_edited', $notify_edited, $post );
5003
+			$notify_edited = apply_filters('geodir_notify_on_listing_edited', $notify_edited, $post);
5004 5004
 
5005
-			geodir_sendEmail( $from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID );
5005
+			geodir_sendEmail($from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID);
5006 5006
 		}
5007 5007
 	}
5008 5008
 }
@@ -5017,14 +5017,14 @@  discard block
 block discarded – undo
5017 5017
  *
5018 5018
  * @return string|null The current page start & end numbering.
5019 5019
  */
5020
-function geodir_title_meta_page( $sep ) {
5020
+function geodir_title_meta_page($sep) {
5021 5021
 	$replacement = null;
5022 5022
 
5023
-	$max = geodir_title_meta_pagenumbering( 'max' );
5024
-	$nr  = geodir_title_meta_pagenumbering( 'nr' );
5023
+	$max = geodir_title_meta_pagenumbering('max');
5024
+	$nr  = geodir_title_meta_pagenumbering('nr');
5025 5025
 
5026
-	if ( $max > 1 && $nr > 1 ) {
5027
-		$replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'geodirectory' ), $nr, $max );
5026
+	if ($max > 1 && $nr > 1) {
5027
+		$replacement = sprintf($sep.' '.__('Page %1$d of %2$d', 'geodirectory'), $nr, $max);
5028 5028
 	}
5029 5029
 
5030 5030
 	return $replacement;
@@ -5041,8 +5041,8 @@  discard block
 block discarded – undo
5041 5041
 function geodir_title_meta_pagenumber() {
5042 5042
 	$replacement = null;
5043 5043
 
5044
-	$nr = geodir_title_meta_pagenumbering( 'nr' );
5045
-	if ( isset( $nr ) && $nr > 0 ) {
5044
+	$nr = geodir_title_meta_pagenumbering('nr');
5045
+	if (isset($nr) && $nr > 0) {
5046 5046
 		$replacement = (string) $nr;
5047 5047
 	}
5048 5048
 
@@ -5060,8 +5060,8 @@  discard block
 block discarded – undo
5060 5060
 function geodir_title_meta_pagetotal() {
5061 5061
 	$replacement = null;
5062 5062
 
5063
-	$max = geodir_title_meta_pagenumbering( 'max' );
5064
-	if ( isset( $max ) && $max > 0 ) {
5063
+	$max = geodir_title_meta_pagenumbering('max');
5064
+	if (isset($max) && $max > 0) {
5065 5065
 		$replacement = (string) $max;
5066 5066
 	}
5067 5067
 
@@ -5081,36 +5081,36 @@  discard block
 block discarded – undo
5081 5081
  *
5082 5082
  * @return int|null The current page numbering.
5083 5083
  */
5084
-function geodir_title_meta_pagenumbering( $request = 'nr' ) {
5084
+function geodir_title_meta_pagenumbering($request = 'nr') {
5085 5085
 	global $wp_query, $post;
5086 5086
 	$max_num_pages = null;
5087 5087
 	$page_number   = null;
5088 5088
 
5089 5089
 	$max_num_pages = 1;
5090 5090
 
5091
-	if ( ! is_singular() ) {
5092
-		$page_number = get_query_var( 'paged' );
5093
-		if ( $page_number === 0 || $page_number === '' ) {
5091
+	if (!is_singular()) {
5092
+		$page_number = get_query_var('paged');
5093
+		if ($page_number === 0 || $page_number === '') {
5094 5094
 			$page_number = 1;
5095 5095
 		}
5096 5096
 
5097
-		if ( isset( $wp_query->max_num_pages ) && ( $wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0 ) ) {
5097
+		if (isset($wp_query->max_num_pages) && ($wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0)) {
5098 5098
 			$max_num_pages = $wp_query->max_num_pages;
5099 5099
 		}
5100 5100
 	} else {
5101
-		$page_number = get_query_var( 'page' );
5102
-		if ( $page_number === 0 || $page_number === '' ) {
5101
+		$page_number = get_query_var('page');
5102
+		if ($page_number === 0 || $page_number === '') {
5103 5103
 			$page_number = 1;
5104 5104
 		}
5105 5105
 
5106
-		if ( isset( $post->post_content ) ) {
5107
-			$max_num_pages = ( substr_count( $post->post_content, '<!--nextpage-->' ) + 1 );
5106
+		if (isset($post->post_content)) {
5107
+			$max_num_pages = (substr_count($post->post_content, '<!--nextpage-->') + 1);
5108 5108
 		}
5109 5109
 	}
5110 5110
 
5111 5111
 	$return = null;
5112 5112
 
5113
-	switch ( $request ) {
5113
+	switch ($request) {
5114 5114
 		case 'nr':
5115 5115
 			$return = $page_number;
5116 5116
 			break;
@@ -5131,14 +5131,14 @@  discard block
 block discarded – undo
5131 5131
  *
5132 5132
  * @return array Terms.
5133 5133
  */
5134
-function geodir_filter_empty_terms( $terms ) {
5135
-	if ( empty( $terms ) ) {
5134
+function geodir_filter_empty_terms($terms) {
5135
+	if (empty($terms)) {
5136 5136
 		return $terms;
5137 5137
 	}
5138 5138
 
5139 5139
 	$return = array();
5140
-	foreach ( $terms as $term ) {
5141
-		if ( isset( $term->count ) && $term->count > 0 ) {
5140
+	foreach ($terms as $term) {
5141
+		if (isset($term->count) && $term->count > 0) {
5142 5142
 			$return[] = $term;
5143 5143
 		} else {
5144 5144
 			/**
@@ -5149,7 +5149,7 @@  discard block
 block discarded – undo
5149 5149
 			 * @param array $return The array of terms to return.
5150 5150
 			 * @param object $term  The term object.
5151 5151
 			 */
5152
-			$return = apply_filters( 'geodir_filter_empty_terms_filter', $return, $term );
5152
+			$return = apply_filters('geodir_filter_empty_terms_filter', $return, $term);
5153 5153
 		}
5154 5154
 	}
5155 5155
 
@@ -5166,12 +5166,12 @@  discard block
 block discarded – undo
5166 5166
  *
5167 5167
  * @return array
5168 5168
  */
5169
-function geodir_remove_hentry( $class ) {
5170
-	if ( geodir_is_page( 'detail' ) ) {
5171
-		$class = array_diff( $class, array( 'hentry' ) );
5169
+function geodir_remove_hentry($class) {
5170
+	if (geodir_is_page('detail')) {
5171
+		$class = array_diff($class, array('hentry'));
5172 5172
 	}
5173 5173
 
5174 5174
 	return $class;
5175 5175
 }
5176 5176
 
5177
-add_filter( 'post_class', 'geodir_remove_hentry' );
5178 5177
\ No newline at end of file
5178
+add_filter('post_class', 'geodir_remove_hentry');
5179 5179
\ No newline at end of file
Please login to merge, or discard this patch.
upgrade.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@
 block discarded – undo
324 324
 
325 325
             if(!empty($show_in_arr )){
326 326
                 $show_in_arr = implode(',',$show_in_arr);
327
-            }else{
327
+            } else{
328 328
                 $show_in_arr = '';
329 329
             }
330 330
 
Please login to merge, or discard this patch.
Indentation   +541 added lines, -541 removed lines patch added patch discarded remove patch
@@ -10,47 +10,47 @@  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 50
 
51
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
51
+	add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
52 52
 
53
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
53
+	update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
54 54
 
55 55
 }
56 56
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
  */
64 64
 function geodirectory_upgrade_all()
65 65
 {
66
-    geodir_create_tables();
67
-    geodir_update_review_db();
68
-    gd_install_theme_compat();
69
-    gd_convert_custom_field_display();
66
+	geodir_create_tables();
67
+	geodir_update_review_db();
68
+	gd_install_theme_compat();
69
+	gd_convert_custom_field_display();
70 70
 }
71 71
 
72 72
 /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
  */
78 78
 function geodir_upgrade_136()
79 79
 {
80
-    geodir_fix_review_overall_rating();
80
+	geodir_fix_review_overall_rating();
81 81
 }
82 82
 
83 83
 /**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
  * @package GeoDirectory
88 88
  */
89 89
 function geodir_upgrade_146(){
90
-    gd_convert_virtual_pages();
90
+	gd_convert_virtual_pages();
91 91
 }
92 92
 
93 93
 /**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  * @package GeoDirectory
98 98
  */
99 99
 function geodir_upgrade_150(){
100
-    gd_fix_cpt_rewrite_slug();
100
+	gd_fix_cpt_rewrite_slug();
101 101
 }
102 102
 
103 103
 
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
  * @package GeoDirectory
110 110
  */
111 111
 function geodir_upgrade_148(){
112
-    /*
112
+	/*
113 113
      * Blank the users google password if present as we now use oAuth 2.0
114 114
      */
115
-    update_option('geodir_ga_pass','');
116
-    update_option('geodir_ga_user','');
115
+	update_option('geodir_ga_pass','');
116
+	update_option('geodir_ga_user','');
117 117
 
118 118
 }
119 119
 
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
  * @package GeoDirectory
126 126
  */
127 127
 function geodir_upgrade_153(){
128
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
129
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
128
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
129
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
130 130
 }
131 131
 
132 132
 /**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
  * @package GeoDirectory
137 137
  */
138 138
 function geodir_upgrade_154(){
139
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
139
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
140 140
 }
141 141
 
142 142
 /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
  * @package GeoDirectory
147 147
  */
148 148
 function geodir_upgrade_152(){
149
-    gd_fix_address_detail_table_limit();
149
+	gd_fix_address_detail_table_limit();
150 150
 }
151 151
 
152 152
 
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function geodir_update_review_db()
164 164
 {
165
-    global $wpdb, $plugin_prefix;
165
+	global $wpdb, $plugin_prefix;
166 166
 
167
-    geodir_fix_review_date();
168
-    geodir_fix_review_post_status();
169
-    geodir_fix_review_content();
170
-    geodir_fix_review_location();
167
+	geodir_fix_review_date();
168
+	geodir_fix_review_post_status();
169
+	geodir_fix_review_content();
170
+	geodir_fix_review_location();
171 171
 
172 172
 }
173 173
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
  */
181 181
 function geodir_fix_review_date()
182 182
 {
183
-    global $wpdb;
184
-    $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'");
183
+	global $wpdb;
184
+	$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'");
185 185
 }
186 186
 
187 187
 /**
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
  */
194 194
 function geodir_fix_review_post_status()
195 195
 {
196
-    global $wpdb;
197
-    $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'");
196
+	global $wpdb;
197
+	$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'");
198 198
 }
199 199
 
200 200
 /**
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
  */
208 208
 function geodir_fix_review_content()
209 209
 {
210
-    global $wpdb;
211
-    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")) {
212
-        return true;
213
-    } else {
214
-        return false;
215
-    }
210
+	global $wpdb;
211
+	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")) {
212
+		return true;
213
+	} else {
214
+		return false;
215
+	}
216 216
 }
217 217
 
218 218
 /**
@@ -225,20 +225,20 @@  discard block
 block discarded – undo
225 225
  */
226 226
 function geodir_fix_review_location()
227 227
 {
228
-    global $wpdb;
228
+	global $wpdb;
229 229
 
230
-    $all_postypes = geodir_get_posttypes();
230
+	$all_postypes = geodir_get_posttypes();
231 231
 
232
-    if (!empty($all_postypes)) {
233
-        foreach ($all_postypes as $key) {
234
-            // update each GD CTP
232
+	if (!empty($all_postypes)) {
233
+		foreach ($all_postypes as $key) {
234
+			// update each GD CTP
235 235
 
236
-            $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");
236
+			$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");
237 237
 
238
-        }
239
-        return true;
240
-    }
241
-    return false;
238
+		}
239
+		return true;
240
+	}
241
+	return false;
242 242
 }
243 243
 
244 244
 /**
@@ -250,82 +250,82 @@  discard block
 block discarded – undo
250 250
  */
251 251
 function geodir_fix_review_overall_rating()
252 252
 {
253
-    global $wpdb;
253
+	global $wpdb;
254 254
 
255
-    $all_postypes = geodir_get_posttypes();
255
+	$all_postypes = geodir_get_posttypes();
256 256
 
257
-    if (!empty($all_postypes)) {
258
-        foreach ($all_postypes as $key) {
259
-            // update each GD CTP
260
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
257
+	if (!empty($all_postypes)) {
258
+		foreach ($all_postypes as $key) {
259
+			// update each GD CTP
260
+			$reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
261 261
 
262
-            if (!empty($reviews)) {
263
-                foreach ($reviews as $post_id) {
264
-                    geodir_update_postrating($post_id->post_id, $key);
265
-                }
262
+			if (!empty($reviews)) {
263
+				foreach ($reviews as $post_id) {
264
+					geodir_update_postrating($post_id->post_id, $key);
265
+				}
266 266
 
267
-            }
267
+			}
268 268
 
269
-        }
269
+		}
270 270
 
271
-    }
271
+	}
272 272
 }
273 273
 
274 274
 
275 275
 function gd_convert_custom_field_display(){
276
-    global $wpdb;
276
+	global $wpdb;
277 277
 
278
-    $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
278
+	$field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
279 279
 
280
-    $has_run = get_option('gd_convert_custom_field_display');
281
-    if($has_run){return;}
280
+	$has_run = get_option('gd_convert_custom_field_display');
281
+	if($has_run){return;}
282 282
 
283
-    // set the field_type_key for standard fields
284
-    $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
283
+	// set the field_type_key for standard fields
284
+	$wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
285 285
 
286 286
 
287
-    if(is_array( $field_info)){
287
+	if(is_array( $field_info)){
288 288
 
289
-        foreach( $field_info as $cf){
289
+		foreach( $field_info as $cf){
290 290
 
291
-            $id = $cf->id;
291
+			$id = $cf->id;
292 292
 
293
-            if(!property_exists($cf,'show_in') || !$id){return;}
293
+			if(!property_exists($cf,'show_in') || !$id){return;}
294 294
 
295
-            $show_in_arr = array();
295
+			$show_in_arr = array();
296 296
 
297
-            if($cf->is_default){
298
-                $show_in_arr[] = "[detail]";
299
-            }
297
+			if($cf->is_default){
298
+				$show_in_arr[] = "[detail]";
299
+			}
300 300
 
301
-            if($cf->show_on_detail){
302
-                $show_in_arr[] = "[moreinfo]";
303
-            }
301
+			if($cf->show_on_detail){
302
+				$show_in_arr[] = "[moreinfo]";
303
+			}
304 304
 
305
-            if($cf->show_on_listing){
306
-                $show_in_arr[] = "[listing]";
307
-            }
305
+			if($cf->show_on_listing){
306
+				$show_in_arr[] = "[listing]";
307
+			}
308 308
 
309
-            if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
310
-                $show_in_arr[] = "[owntab]";
311
-            }
309
+			if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
310
+				$show_in_arr[] = "[owntab]";
311
+			}
312 312
 
313
-            if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
314
-                $show_in_arr[] = "[mapbubble]";
315
-            }
313
+			if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
314
+				$show_in_arr[] = "[mapbubble]";
315
+			}
316 316
 
317
-            if(!empty($show_in_arr )){
318
-                $show_in_arr = implode(',',$show_in_arr);
319
-            }else{
320
-                $show_in_arr = '';
321
-            }
317
+			if(!empty($show_in_arr )){
318
+				$show_in_arr = implode(',',$show_in_arr);
319
+			}else{
320
+				$show_in_arr = '';
321
+			}
322 322
 
323
-            $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id");
323
+			$wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id");
324 324
 
325
-        }
325
+		}
326 326
 
327
-        update_option('gd_convert_custom_field_display',1);
328
-    }
327
+		update_option('gd_convert_custom_field_display',1);
328
+	}
329 329
 }
330 330
 
331 331
 ############################################
@@ -341,367 +341,367 @@  discard block
 block discarded – undo
341 341
  */
342 342
 function gd_install_theme_compat()
343 343
 {
344
-    global $wpdb;
344
+	global $wpdb;
345 345
 
346
-    $theme_compat = array();
347
-    $theme_compat = get_option('gd_theme_compats');
346
+	$theme_compat = array();
347
+	$theme_compat = get_option('gd_theme_compats');
348 348
 //GDF
349
-    $theme_compat['GeoDirectory_Framework'] = array(
350
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
351
-        'geodir_wrapper_open_class' => '',
352
-        'geodir_wrapper_open_replace' => '',
353
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
354
-        'geodir_wrapper_content_open_id' => 'geodir_content',
355
-        'geodir_wrapper_content_open_class' => '',
356
-        'geodir_wrapper_content_open_replace' => '',
357
-        'geodir_wrapper_content_close_replace' => '',
358
-        'geodir_article_open_id' => '',
359
-        'geodir_article_open_class' => '',
360
-        'geodir_article_open_replace' => '',
361
-        'geodir_article_close_replace' => '',
362
-        'geodir_sidebar_right_open_id' => '',
363
-        'geodir_sidebar_right_open_class' => '',
364
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
365
-        'geodir_sidebar_right_close_replace' => '',
366
-        'geodir_sidebar_left_open_id' => '',
367
-        'geodir_sidebar_left_open_class' => '',
368
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
369
-        'geodir_sidebar_left_close_replace' => '',
370
-        'geodir_main_content_open_id' => '',
371
-        'geodir_main_content_open_class' => '',
372
-        'geodir_main_content_open_replace' => '<!-- removed -->',
373
-        'geodir_main_content_close_replace' => '<!-- removed -->',
374
-        'geodir_top_content_add' => '',
375
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
376
-        'geodir_before_widget_filter' => '',
377
-        'geodir_after_widget_filter' => '',
378
-        'geodir_theme_compat_css' => '',
379
-        'geodir_theme_compat_js' => '',
380
-        'geodir_theme_compat_default_options' => '',
381
-        'geodir_theme_compat_code' => ''
382
-    );
349
+	$theme_compat['GeoDirectory_Framework'] = array(
350
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
351
+		'geodir_wrapper_open_class' => '',
352
+		'geodir_wrapper_open_replace' => '',
353
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
354
+		'geodir_wrapper_content_open_id' => 'geodir_content',
355
+		'geodir_wrapper_content_open_class' => '',
356
+		'geodir_wrapper_content_open_replace' => '',
357
+		'geodir_wrapper_content_close_replace' => '',
358
+		'geodir_article_open_id' => '',
359
+		'geodir_article_open_class' => '',
360
+		'geodir_article_open_replace' => '',
361
+		'geodir_article_close_replace' => '',
362
+		'geodir_sidebar_right_open_id' => '',
363
+		'geodir_sidebar_right_open_class' => '',
364
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
365
+		'geodir_sidebar_right_close_replace' => '',
366
+		'geodir_sidebar_left_open_id' => '',
367
+		'geodir_sidebar_left_open_class' => '',
368
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
369
+		'geodir_sidebar_left_close_replace' => '',
370
+		'geodir_main_content_open_id' => '',
371
+		'geodir_main_content_open_class' => '',
372
+		'geodir_main_content_open_replace' => '<!-- removed -->',
373
+		'geodir_main_content_close_replace' => '<!-- removed -->',
374
+		'geodir_top_content_add' => '',
375
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
376
+		'geodir_before_widget_filter' => '',
377
+		'geodir_after_widget_filter' => '',
378
+		'geodir_theme_compat_css' => '',
379
+		'geodir_theme_compat_js' => '',
380
+		'geodir_theme_compat_default_options' => '',
381
+		'geodir_theme_compat_code' => ''
382
+	);
383 383
 
384 384
 //Directory Theme
385
-    $theme_compat['Directory_Starter'] = array(
386
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
387
-        'geodir_wrapper_open_class' => '',
388
-        'geodir_wrapper_open_replace' => '',
389
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
390
-        'geodir_wrapper_content_open_id' => 'geodir_content',
391
-        'geodir_wrapper_content_open_class' => '',
392
-        'geodir_wrapper_content_open_replace' => '',
393
-        'geodir_wrapper_content_close_replace' => '',
394
-        'geodir_article_open_id' => '',
395
-        'geodir_article_open_class' => '',
396
-        'geodir_article_open_replace' => '',
397
-        'geodir_article_close_replace' => '',
398
-        'geodir_sidebar_right_open_id' => '',
399
-        'geodir_sidebar_right_open_class' => '',
400
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
401
-        'geodir_sidebar_right_close_replace' => '',
402
-        'geodir_sidebar_left_open_id' => '',
403
-        'geodir_sidebar_left_open_class' => '',
404
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
405
-        'geodir_sidebar_left_close_replace' => '',
406
-        'geodir_main_content_open_id' => '',
407
-        'geodir_main_content_open_class' => '',
408
-        'geodir_main_content_open_replace' => '<!-- removed -->',
409
-        'geodir_main_content_close_replace' => '<!-- removed -->',
410
-        'geodir_top_content_add' => '',
411
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
412
-        'geodir_before_widget_filter' => '',
413
-        'geodir_after_widget_filter' => '',
414
-        'geodir_theme_compat_css' => '',
415
-        'geodir_theme_compat_js' => '',
416
-        'geodir_theme_compat_default_options' => '',
417
-        'geodir_theme_compat_code' => ''
418
-    );
385
+	$theme_compat['Directory_Starter'] = array(
386
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
387
+		'geodir_wrapper_open_class' => '',
388
+		'geodir_wrapper_open_replace' => '',
389
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
390
+		'geodir_wrapper_content_open_id' => 'geodir_content',
391
+		'geodir_wrapper_content_open_class' => '',
392
+		'geodir_wrapper_content_open_replace' => '',
393
+		'geodir_wrapper_content_close_replace' => '',
394
+		'geodir_article_open_id' => '',
395
+		'geodir_article_open_class' => '',
396
+		'geodir_article_open_replace' => '',
397
+		'geodir_article_close_replace' => '',
398
+		'geodir_sidebar_right_open_id' => '',
399
+		'geodir_sidebar_right_open_class' => '',
400
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
401
+		'geodir_sidebar_right_close_replace' => '',
402
+		'geodir_sidebar_left_open_id' => '',
403
+		'geodir_sidebar_left_open_class' => '',
404
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
405
+		'geodir_sidebar_left_close_replace' => '',
406
+		'geodir_main_content_open_id' => '',
407
+		'geodir_main_content_open_class' => '',
408
+		'geodir_main_content_open_replace' => '<!-- removed -->',
409
+		'geodir_main_content_close_replace' => '<!-- removed -->',
410
+		'geodir_top_content_add' => '',
411
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
412
+		'geodir_before_widget_filter' => '',
413
+		'geodir_after_widget_filter' => '',
414
+		'geodir_theme_compat_css' => '',
415
+		'geodir_theme_compat_js' => '',
416
+		'geodir_theme_compat_default_options' => '',
417
+		'geodir_theme_compat_code' => ''
418
+	);
419 419
 
420 420
 //Jobby
421
-    $theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
421
+	$theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
422 422
 
423 423
 //GeoProperty
424
-    $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
424
+	$theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
425 425
 
426 426
 //Avada
427
-    $theme_compat['Avada'] = array(
428
-        'geodir_wrapper_open_id' => '',
429
-        'geodir_wrapper_open_class' => '',
430
-        'geodir_wrapper_open_replace' => '<!-- removed -->',
431
-        'geodir_wrapper_close_replace' => '<!-- removed -->',
432
-        'geodir_wrapper_content_open_id' => 'content',
433
-        'geodir_wrapper_content_open_class' => '',
434
-        'geodir_wrapper_content_open_replace' => '',
435
-        'geodir_wrapper_content_close_replace' => '',
436
-        'geodir_article_open_id' => '',
437
-        'geodir_article_open_class' => '',
438
-        'geodir_article_open_replace' => '',
439
-        'geodir_article_close_replace' => '',
440
-        'geodir_sidebar_right_open_id' => '',
441
-        'geodir_sidebar_right_open_class' => '',
442
-        'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
443
-        'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
444
-        'geodir_sidebar_left_open_id' => '',
445
-        'geodir_sidebar_left_open_class' => '',
446
-        'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
447
-        'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
448
-        'geodir_main_content_open_id' => '',
449
-        'geodir_main_content_open_class' => '',
450
-        'geodir_main_content_open_replace' => '<!-- removed -->',
451
-        'geodir_main_content_close_replace' => '<!-- removed -->',
452
-        'geodir_top_content_add' => '',
453
-        'geodir_before_main_content_add' => '',
454
-        'geodir_before_widget_filter' => '',
455
-        'geodir_after_widget_filter' => '',
456
-        '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;}'),
457
-        'geodir_theme_compat_js' => '',
458
-        'geodir_theme_compat_default_options' => '',
459
-        'geodir_theme_compat_code' => 'Avada'
460
-    );
427
+	$theme_compat['Avada'] = array(
428
+		'geodir_wrapper_open_id' => '',
429
+		'geodir_wrapper_open_class' => '',
430
+		'geodir_wrapper_open_replace' => '<!-- removed -->',
431
+		'geodir_wrapper_close_replace' => '<!-- removed -->',
432
+		'geodir_wrapper_content_open_id' => 'content',
433
+		'geodir_wrapper_content_open_class' => '',
434
+		'geodir_wrapper_content_open_replace' => '',
435
+		'geodir_wrapper_content_close_replace' => '',
436
+		'geodir_article_open_id' => '',
437
+		'geodir_article_open_class' => '',
438
+		'geodir_article_open_replace' => '',
439
+		'geodir_article_close_replace' => '',
440
+		'geodir_sidebar_right_open_id' => '',
441
+		'geodir_sidebar_right_open_class' => '',
442
+		'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
443
+		'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
444
+		'geodir_sidebar_left_open_id' => '',
445
+		'geodir_sidebar_left_open_class' => '',
446
+		'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
447
+		'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
448
+		'geodir_main_content_open_id' => '',
449
+		'geodir_main_content_open_class' => '',
450
+		'geodir_main_content_open_replace' => '<!-- removed -->',
451
+		'geodir_main_content_close_replace' => '<!-- removed -->',
452
+		'geodir_top_content_add' => '',
453
+		'geodir_before_main_content_add' => '',
454
+		'geodir_before_widget_filter' => '',
455
+		'geodir_after_widget_filter' => '',
456
+		'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;}'),
457
+		'geodir_theme_compat_js' => '',
458
+		'geodir_theme_compat_default_options' => '',
459
+		'geodir_theme_compat_code' => 'Avada'
460
+	);
461 461
 
462 462
 //Enfold
463
-    $theme_compat['Enfold'] = array(
464
-        'geodir_wrapper_open_id' => '',
465
-        'geodir_wrapper_open_class' => '',
466
-        'geodir_wrapper_open_replace' => '',
467
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
468
-        'geodir_wrapper_content_open_id' => '',
469
-        'geodir_wrapper_content_open_class' => '',
470
-        'geodir_wrapper_content_open_replace' => '',
471
-        'geodir_wrapper_content_close_replace' => '</div></main>',
472
-        'geodir_article_open_id' => '',
473
-        'geodir_article_open_class' => '',
474
-        'geodir_article_open_replace' => '',
475
-        'geodir_article_close_replace' => '',
476
-        'geodir_sidebar_right_open_id' => '',
477
-        'geodir_sidebar_right_open_class' => '',
478
-        'geodir_sidebar_right_open_replace' => '',
479
-        'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
480
-        'geodir_sidebar_left_open_id' => '',
481
-        'geodir_sidebar_left_open_class' => '',
482
-        'geodir_sidebar_left_open_replace' => '',
483
-        'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
484
-        'geodir_main_content_open_id' => '',
485
-        'geodir_main_content_open_class' => '',
486
-        'geodir_main_content_open_replace' => '',
487
-        'geodir_main_content_close_replace' => '',
488
-        'geodir_top_content_add' => '',
489
-        'geodir_before_main_content_add' => '',
490
-        'geodir_before_widget_filter' => '',
491
-        'geodir_after_widget_filter' => '',
492
-        '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;}'),
493
-        'geodir_theme_compat_js' => '',
494
-        'geodir_theme_compat_default_options' => '',
495
-        'geodir_theme_compat_code' => 'Enfold'
496
-    );
463
+	$theme_compat['Enfold'] = array(
464
+		'geodir_wrapper_open_id' => '',
465
+		'geodir_wrapper_open_class' => '',
466
+		'geodir_wrapper_open_replace' => '',
467
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
468
+		'geodir_wrapper_content_open_id' => '',
469
+		'geodir_wrapper_content_open_class' => '',
470
+		'geodir_wrapper_content_open_replace' => '',
471
+		'geodir_wrapper_content_close_replace' => '</div></main>',
472
+		'geodir_article_open_id' => '',
473
+		'geodir_article_open_class' => '',
474
+		'geodir_article_open_replace' => '',
475
+		'geodir_article_close_replace' => '',
476
+		'geodir_sidebar_right_open_id' => '',
477
+		'geodir_sidebar_right_open_class' => '',
478
+		'geodir_sidebar_right_open_replace' => '',
479
+		'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
480
+		'geodir_sidebar_left_open_id' => '',
481
+		'geodir_sidebar_left_open_class' => '',
482
+		'geodir_sidebar_left_open_replace' => '',
483
+		'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
484
+		'geodir_main_content_open_id' => '',
485
+		'geodir_main_content_open_class' => '',
486
+		'geodir_main_content_open_replace' => '',
487
+		'geodir_main_content_close_replace' => '',
488
+		'geodir_top_content_add' => '',
489
+		'geodir_before_main_content_add' => '',
490
+		'geodir_before_widget_filter' => '',
491
+		'geodir_after_widget_filter' => '',
492
+		'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;}'),
493
+		'geodir_theme_compat_js' => '',
494
+		'geodir_theme_compat_default_options' => '',
495
+		'geodir_theme_compat_code' => 'Enfold'
496
+	);
497 497
 
498 498
 // X
499
-    $theme_compat['X'] = array(
500
-        'geodir_wrapper_open_id' => '',
501
-        'geodir_wrapper_open_class' => '',
502
-        'geodir_wrapper_open_replace' => '',
503
-        'geodir_wrapper_close_replace' => '',
504
-        'geodir_wrapper_content_open_id' => '',
505
-        'geodir_wrapper_content_open_class' => '',
506
-        'geodir_wrapper_content_open_replace' => '',
507
-        'geodir_wrapper_content_close_replace' => '',
508
-        'geodir_article_open_id' => '',
509
-        'geodir_article_open_class' => '',
510
-        'geodir_article_open_replace' => '',
511
-        'geodir_article_close_replace' => '',
512
-        'geodir_sidebar_right_open_id' => '',
513
-        'geodir_sidebar_right_open_class' => '',
514
-        'geodir_sidebar_right_open_replace' => '',
515
-        'geodir_sidebar_right_close_replace' => '',
516
-        'geodir_sidebar_left_open_id' => '',
517
-        'geodir_sidebar_left_open_class' => '',
518
-        'geodir_sidebar_left_open_replace' => '',
519
-        'geodir_sidebar_left_close_replace' => '',
520
-        'geodir_main_content_open_id' => '',
521
-        'geodir_main_content_open_class' => '',
522
-        'geodir_main_content_open_replace' => '',
523
-        'geodir_main_content_close_replace' => '',
524
-        'geodir_top_content_add' => '',
525
-        'geodir_before_main_content_add' => '',
526
-        'geodir_before_widget_filter' => '',
527
-        'geodir_after_widget_filter' => '',
528
-        '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}'),
529
-        'geodir_theme_compat_js' => '',
530
-        'geodir_theme_compat_default_options' => '',
531
-        'geodir_theme_compat_code' => 'X'
532
-    );
499
+	$theme_compat['X'] = array(
500
+		'geodir_wrapper_open_id' => '',
501
+		'geodir_wrapper_open_class' => '',
502
+		'geodir_wrapper_open_replace' => '',
503
+		'geodir_wrapper_close_replace' => '',
504
+		'geodir_wrapper_content_open_id' => '',
505
+		'geodir_wrapper_content_open_class' => '',
506
+		'geodir_wrapper_content_open_replace' => '',
507
+		'geodir_wrapper_content_close_replace' => '',
508
+		'geodir_article_open_id' => '',
509
+		'geodir_article_open_class' => '',
510
+		'geodir_article_open_replace' => '',
511
+		'geodir_article_close_replace' => '',
512
+		'geodir_sidebar_right_open_id' => '',
513
+		'geodir_sidebar_right_open_class' => '',
514
+		'geodir_sidebar_right_open_replace' => '',
515
+		'geodir_sidebar_right_close_replace' => '',
516
+		'geodir_sidebar_left_open_id' => '',
517
+		'geodir_sidebar_left_open_class' => '',
518
+		'geodir_sidebar_left_open_replace' => '',
519
+		'geodir_sidebar_left_close_replace' => '',
520
+		'geodir_main_content_open_id' => '',
521
+		'geodir_main_content_open_class' => '',
522
+		'geodir_main_content_open_replace' => '',
523
+		'geodir_main_content_close_replace' => '',
524
+		'geodir_top_content_add' => '',
525
+		'geodir_before_main_content_add' => '',
526
+		'geodir_before_widget_filter' => '',
527
+		'geodir_after_widget_filter' => '',
528
+		'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}'),
529
+		'geodir_theme_compat_js' => '',
530
+		'geodir_theme_compat_default_options' => '',
531
+		'geodir_theme_compat_code' => 'X'
532
+	);
533 533
 
534 534
 // Divi
535
-    $theme_compat['Divi'] = array(
536
-        'geodir_wrapper_open_id' => 'main-content',
537
-        'geodir_wrapper_open_class' => '',
538
-        'geodir_wrapper_open_replace' => '',
539
-        'geodir_wrapper_close_replace' => '',
540
-        'geodir_wrapper_content_open_id' => 'left-area',
541
-        'geodir_wrapper_content_open_class' => '',
542
-        'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
543
-        'geodir_wrapper_content_close_replace' => '',
544
-        'geodir_article_open_id' => '',
545
-        'geodir_article_open_class' => '',
546
-        'geodir_article_open_replace' => '',
547
-        'geodir_article_close_replace' => '',
548
-        'geodir_sidebar_right_open_id' => 'sidebar',
549
-        'geodir_sidebar_right_open_class' => '',
550
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
551
-        'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
552
-        'geodir_sidebar_left_open_id' => 'sidebar',
553
-        'geodir_sidebar_left_open_class' => '',
554
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
555
-        'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
556
-        'geodir_main_content_open_id' => '',
557
-        'geodir_main_content_open_class' => '',
558
-        'geodir_main_content_open_replace' => '',
559
-        'geodir_main_content_close_replace' => '',
560
-        'geodir_top_content_add' => '',
561
-        'geodir_before_main_content_add' => '',
562
-        'geodir_before_widget_filter' => '',
563
-        'geodir_after_widget_filter' => '',
564
-        '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}'),
565
-        'geodir_theme_compat_js' => '',
566
-        'geodir_theme_compat_default_options' => '',
567
-        'geodir_theme_compat_code' => 'Divi'
568
-    );
535
+	$theme_compat['Divi'] = array(
536
+		'geodir_wrapper_open_id' => 'main-content',
537
+		'geodir_wrapper_open_class' => '',
538
+		'geodir_wrapper_open_replace' => '',
539
+		'geodir_wrapper_close_replace' => '',
540
+		'geodir_wrapper_content_open_id' => 'left-area',
541
+		'geodir_wrapper_content_open_class' => '',
542
+		'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
543
+		'geodir_wrapper_content_close_replace' => '',
544
+		'geodir_article_open_id' => '',
545
+		'geodir_article_open_class' => '',
546
+		'geodir_article_open_replace' => '',
547
+		'geodir_article_close_replace' => '',
548
+		'geodir_sidebar_right_open_id' => 'sidebar',
549
+		'geodir_sidebar_right_open_class' => '',
550
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
551
+		'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
552
+		'geodir_sidebar_left_open_id' => 'sidebar',
553
+		'geodir_sidebar_left_open_class' => '',
554
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
555
+		'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
556
+		'geodir_main_content_open_id' => '',
557
+		'geodir_main_content_open_class' => '',
558
+		'geodir_main_content_open_replace' => '',
559
+		'geodir_main_content_close_replace' => '',
560
+		'geodir_top_content_add' => '',
561
+		'geodir_before_main_content_add' => '',
562
+		'geodir_before_widget_filter' => '',
563
+		'geodir_after_widget_filter' => '',
564
+		'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}'),
565
+		'geodir_theme_compat_js' => '',
566
+		'geodir_theme_compat_default_options' => '',
567
+		'geodir_theme_compat_code' => 'Divi'
568
+	);
569 569
 
570 570
 // Genesis
571
-    $theme_compat['Genesis'] = array(
572
-        'geodir_wrapper_open_id' => '',
573
-        'geodir_wrapper_open_class' => 'content-sidebar-wrap',
574
-        'geodir_wrapper_open_replace' => '',
575
-        'geodir_wrapper_close_replace' => '',
576
-        'geodir_wrapper_content_open_id' => '',
577
-        'geodir_wrapper_content_open_class' => 'content',
578
-        'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
579
-        'geodir_wrapper_content_close_replace' => '',
580
-        'geodir_article_open_id' => '',
581
-        'geodir_article_open_class' => '',
582
-        'geodir_article_open_replace' => '',
583
-        'geodir_article_close_replace' => '',
584
-        'geodir_sidebar_right_open_id' => '',
585
-        'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
586
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
587
-        'geodir_sidebar_right_close_replace' => '',
588
-        'geodir_sidebar_left_open_id' => '',
589
-        'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
590
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
591
-        'geodir_sidebar_left_close_replace' => '',
592
-        'geodir_main_content_open_id' => '',
593
-        'geodir_main_content_open_class' => '',
594
-        'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
595
-        'geodir_main_content_close_replace' => '',
596
-        'geodir_top_content_add' => '',
597
-        'geodir_before_main_content_add' => '',
598
-        'geodir_before_widget_filter' => '',
599
-        'geodir_after_widget_filter' => '',
600
-        'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
601
-        '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}'),
602
-        'geodir_theme_compat_js' => '',
603
-        'geodir_theme_compat_default_options' => '',
604
-        'geodir_theme_compat_code' => 'Genesis'
605
-    );
571
+	$theme_compat['Genesis'] = array(
572
+		'geodir_wrapper_open_id' => '',
573
+		'geodir_wrapper_open_class' => 'content-sidebar-wrap',
574
+		'geodir_wrapper_open_replace' => '',
575
+		'geodir_wrapper_close_replace' => '',
576
+		'geodir_wrapper_content_open_id' => '',
577
+		'geodir_wrapper_content_open_class' => 'content',
578
+		'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
579
+		'geodir_wrapper_content_close_replace' => '',
580
+		'geodir_article_open_id' => '',
581
+		'geodir_article_open_class' => '',
582
+		'geodir_article_open_replace' => '',
583
+		'geodir_article_close_replace' => '',
584
+		'geodir_sidebar_right_open_id' => '',
585
+		'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
586
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
587
+		'geodir_sidebar_right_close_replace' => '',
588
+		'geodir_sidebar_left_open_id' => '',
589
+		'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
590
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
591
+		'geodir_sidebar_left_close_replace' => '',
592
+		'geodir_main_content_open_id' => '',
593
+		'geodir_main_content_open_class' => '',
594
+		'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
595
+		'geodir_main_content_close_replace' => '',
596
+		'geodir_top_content_add' => '',
597
+		'geodir_before_main_content_add' => '',
598
+		'geodir_before_widget_filter' => '',
599
+		'geodir_after_widget_filter' => '',
600
+		'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
601
+		'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}'),
602
+		'geodir_theme_compat_js' => '',
603
+		'geodir_theme_compat_default_options' => '',
604
+		'geodir_theme_compat_code' => 'Genesis'
605
+	);
606 606
 
607 607
 // Jupiter
608
-    $theme_compat['Jupiter'] = array(
609
-        'geodir_wrapper_open_id' => '',
610
-        'geodir_wrapper_open_class' => '',
611
-        '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">',
612
-        'geodir_wrapper_close_replace' => '</div></div></div>',
613
-        'geodir_wrapper_content_open_id' => '',
614
-        'geodir_wrapper_content_open_class' => '',
615
-        'geodir_wrapper_content_open_replace' => '',
616
-        'geodir_wrapper_content_close_replace' => '',
617
-        'geodir_article_open_id' => '',
618
-        'geodir_article_open_class' => '',
619
-        'geodir_article_open_replace' => '',
620
-        'geodir_article_close_replace' => '',
621
-        'geodir_sidebar_right_open_id' => 'mk-sidebar',
622
-        'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
623
-        'geodir_sidebar_right_open_replace' => '',
624
-        'geodir_sidebar_right_close_replace' => '',
625
-        'geodir_sidebar_left_open_id' => 'mk-sidebar',
626
-        'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
627
-        'geodir_sidebar_left_open_replace' => '',
628
-        'geodir_sidebar_left_close_replace' => '',
629
-        'geodir_main_content_open_id' => '',
630
-        'geodir_main_content_open_class' => '',
631
-        'geodir_main_content_open_replace' => '',
632
-        'geodir_main_content_close_replace' => '',
633
-        'geodir_top_content_add' => '',
634
-        'geodir_before_main_content_add' => '',
635
-        'geodir_before_widget_filter' => '',
636
-        'geodir_after_widget_filter' => '',
637
-        'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
638
-        'geodir_after_title_filter' => '',
639
-        'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
640
-        'geodir_sub_menu_ul_class_filter' => '',
641
-        'geodir_sub_menu_li_class_filter' => '',
642
-        'geodir_menu_a_class_filter' => 'menu-item-link',
643
-        'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
644
-        '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',
645
-        'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
646
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
647
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
648
-        '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}'),
649
-        'geodir_theme_compat_js' => '',
650
-        'geodir_theme_compat_default_options' => '',
651
-        'geodir_theme_compat_code' => 'Jupiter'
652
-    );
608
+	$theme_compat['Jupiter'] = array(
609
+		'geodir_wrapper_open_id' => '',
610
+		'geodir_wrapper_open_class' => '',
611
+		'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">',
612
+		'geodir_wrapper_close_replace' => '</div></div></div>',
613
+		'geodir_wrapper_content_open_id' => '',
614
+		'geodir_wrapper_content_open_class' => '',
615
+		'geodir_wrapper_content_open_replace' => '',
616
+		'geodir_wrapper_content_close_replace' => '',
617
+		'geodir_article_open_id' => '',
618
+		'geodir_article_open_class' => '',
619
+		'geodir_article_open_replace' => '',
620
+		'geodir_article_close_replace' => '',
621
+		'geodir_sidebar_right_open_id' => 'mk-sidebar',
622
+		'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
623
+		'geodir_sidebar_right_open_replace' => '',
624
+		'geodir_sidebar_right_close_replace' => '',
625
+		'geodir_sidebar_left_open_id' => 'mk-sidebar',
626
+		'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
627
+		'geodir_sidebar_left_open_replace' => '',
628
+		'geodir_sidebar_left_close_replace' => '',
629
+		'geodir_main_content_open_id' => '',
630
+		'geodir_main_content_open_class' => '',
631
+		'geodir_main_content_open_replace' => '',
632
+		'geodir_main_content_close_replace' => '',
633
+		'geodir_top_content_add' => '',
634
+		'geodir_before_main_content_add' => '',
635
+		'geodir_before_widget_filter' => '',
636
+		'geodir_after_widget_filter' => '',
637
+		'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
638
+		'geodir_after_title_filter' => '',
639
+		'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
640
+		'geodir_sub_menu_ul_class_filter' => '',
641
+		'geodir_sub_menu_li_class_filter' => '',
642
+		'geodir_menu_a_class_filter' => 'menu-item-link',
643
+		'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
644
+		'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',
645
+		'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
646
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
647
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
648
+		'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}'),
649
+		'geodir_theme_compat_js' => '',
650
+		'geodir_theme_compat_default_options' => '',
651
+		'geodir_theme_compat_code' => 'Jupiter'
652
+	);
653 653
 
654 654
 // Multi News
655
-    $theme_compat['Multi_News'] = array(
656
-        'geodir_wrapper_open_id' => '',
657
-        'geodir_wrapper_open_class' => 'main-container clearfix',
658
-        'geodir_wrapper_open_replace' => '',
659
-        'geodir_wrapper_close_replace' => '',
660
-        'geodir_wrapper_content_open_id' => '',
661
-        'geodir_wrapper_content_open_class' => '',
662
-        'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
663
-        'geodir_wrapper_content_close_replace' => '</div></div></div>',
664
-        'geodir_article_open_id' => '',
665
-        'geodir_article_open_class' => '',
666
-        'geodir_article_open_replace' => '',
667
-        'geodir_article_close_replace' => '',
668
-        'geodir_sidebar_right_open_id' => '',
669
-        'geodir_sidebar_right_open_class' => '',
670
-        'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
671
-        'geodir_sidebar_right_close_replace' => '',
672
-        'geodir_sidebar_left_open_id' => '',
673
-        'geodir_sidebar_left_open_class' => '',
674
-        'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
675
-        'geodir_sidebar_left_close_replace' => '',
676
-        'geodir_main_content_open_id' => '',
677
-        'geodir_main_content_open_class' => '',
678
-        'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
679
-        'geodir_main_content_close_replace' => '</div>',
680
-        'geodir_top_content_add' => '',
681
-        'geodir_before_main_content_add' => '',
682
-        'geodir_full_page_class_filter' => 'section full-width-section',
683
-        'geodir_before_widget_filter' => '',
684
-        'geodir_after_widget_filter' => '',
685
-        'geodir_before_title_filter' => '<div class="widget-title"><h2>',
686
-        'geodir_after_title_filter' => '</h2></div>',
687
-        'geodir_menu_li_class_filter' => '',
688
-        'geodir_sub_menu_ul_class_filter' => '',
689
-        'geodir_sub_menu_li_class_filter' => '',
690
-        'geodir_menu_a_class_filter' => '',
691
-        'geodir_sub_menu_a_class_filter' => '',
692
-        'geodir_location_switcher_menu_li_class_filter' => '',
693
-        'geodir_location_switcher_menu_a_class_filter' => '',
694
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
695
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
696
-        '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}'),
697
-        '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"})});',
698
-        'geodir_theme_compat_default_options' => '',
699
-        'geodir_theme_compat_code' => 'Multi_News'
700
-    );
701
-
702
-    update_option('gd_theme_compats', $theme_compat);
703
-
704
-    gd_set_theme_compat();// set the compat pack if avail
655
+	$theme_compat['Multi_News'] = array(
656
+		'geodir_wrapper_open_id' => '',
657
+		'geodir_wrapper_open_class' => 'main-container clearfix',
658
+		'geodir_wrapper_open_replace' => '',
659
+		'geodir_wrapper_close_replace' => '',
660
+		'geodir_wrapper_content_open_id' => '',
661
+		'geodir_wrapper_content_open_class' => '',
662
+		'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
663
+		'geodir_wrapper_content_close_replace' => '</div></div></div>',
664
+		'geodir_article_open_id' => '',
665
+		'geodir_article_open_class' => '',
666
+		'geodir_article_open_replace' => '',
667
+		'geodir_article_close_replace' => '',
668
+		'geodir_sidebar_right_open_id' => '',
669
+		'geodir_sidebar_right_open_class' => '',
670
+		'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
671
+		'geodir_sidebar_right_close_replace' => '',
672
+		'geodir_sidebar_left_open_id' => '',
673
+		'geodir_sidebar_left_open_class' => '',
674
+		'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
675
+		'geodir_sidebar_left_close_replace' => '',
676
+		'geodir_main_content_open_id' => '',
677
+		'geodir_main_content_open_class' => '',
678
+		'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
679
+		'geodir_main_content_close_replace' => '</div>',
680
+		'geodir_top_content_add' => '',
681
+		'geodir_before_main_content_add' => '',
682
+		'geodir_full_page_class_filter' => 'section full-width-section',
683
+		'geodir_before_widget_filter' => '',
684
+		'geodir_after_widget_filter' => '',
685
+		'geodir_before_title_filter' => '<div class="widget-title"><h2>',
686
+		'geodir_after_title_filter' => '</h2></div>',
687
+		'geodir_menu_li_class_filter' => '',
688
+		'geodir_sub_menu_ul_class_filter' => '',
689
+		'geodir_sub_menu_li_class_filter' => '',
690
+		'geodir_menu_a_class_filter' => '',
691
+		'geodir_sub_menu_a_class_filter' => '',
692
+		'geodir_location_switcher_menu_li_class_filter' => '',
693
+		'geodir_location_switcher_menu_a_class_filter' => '',
694
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
695
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
696
+		'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}'),
697
+		'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"})});',
698
+		'geodir_theme_compat_default_options' => '',
699
+		'geodir_theme_compat_code' => 'Multi_News'
700
+	);
701
+
702
+	update_option('gd_theme_compats', $theme_compat);
703
+
704
+	gd_set_theme_compat();// set the compat pack if avail
705 705
 }
706 706
 
707 707
 
@@ -713,61 +713,61 @@  discard block
 block discarded – undo
713 713
  * @global object $wpdb WordPress Database object.
714 714
  */
715 715
 function gd_convert_virtual_pages(){
716
-    global $wpdb;
717
-
718
-    // Update the add listing page settings
719
-    $add_listing_page = $wpdb->get_var(
720
-        $wpdb->prepare(
721
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
722
-            array('add-listing')
723
-        )
724
-    );
725
-
726
-    if($add_listing_page){
727
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
728
-        update_option( 'geodir_add_listing_page', $add_listing_page);
729
-    }
730
-
731
-    // Update the listing preview page settings
732
-    $listing_preview_page = $wpdb->get_var(
733
-        $wpdb->prepare(
734
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
735
-            array('listing-preview')
736
-        )
737
-    );
738
-
739
-    if($listing_preview_page){
740
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
741
-        update_option( 'geodir_preview_page', $listing_preview_page);
742
-    }
743
-
744
-    // Update the listing success page settings
745
-    $listing_success_page = $wpdb->get_var(
746
-        $wpdb->prepare(
747
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
748
-            array('listing-success')
749
-        )
750
-    );
751
-
752
-    if($listing_success_page){
753
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
754
-        update_option( 'geodir_success_page', $listing_success_page);
755
-    }
756
-
757
-    // Update the listing success page settings
758
-    $location_page = $wpdb->get_var(
759
-        $wpdb->prepare(
760
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
761
-            array('location')
762
-        )
763
-    );
764
-
765
-    if($location_page){
766
-        $location_slug = get_option('geodir_location_prefix');
767
-        if(!$location_slug ){$location_slug  = 'location';}
768
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
769
-        update_option( 'geodir_location_page', $location_page);
770
-    }
716
+	global $wpdb;
717
+
718
+	// Update the add listing page settings
719
+	$add_listing_page = $wpdb->get_var(
720
+		$wpdb->prepare(
721
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
722
+			array('add-listing')
723
+		)
724
+	);
725
+
726
+	if($add_listing_page){
727
+		wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
728
+		update_option( 'geodir_add_listing_page', $add_listing_page);
729
+	}
730
+
731
+	// Update the listing preview page settings
732
+	$listing_preview_page = $wpdb->get_var(
733
+		$wpdb->prepare(
734
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
735
+			array('listing-preview')
736
+		)
737
+	);
738
+
739
+	if($listing_preview_page){
740
+		wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
741
+		update_option( 'geodir_preview_page', $listing_preview_page);
742
+	}
743
+
744
+	// Update the listing success page settings
745
+	$listing_success_page = $wpdb->get_var(
746
+		$wpdb->prepare(
747
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
748
+			array('listing-success')
749
+		)
750
+	);
751
+
752
+	if($listing_success_page){
753
+		wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
754
+		update_option( 'geodir_success_page', $listing_success_page);
755
+	}
756
+
757
+	// Update the listing success page settings
758
+	$location_page = $wpdb->get_var(
759
+		$wpdb->prepare(
760
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
761
+			array('location')
762
+		)
763
+	);
764
+
765
+	if($location_page){
766
+		$location_slug = get_option('geodir_location_prefix');
767
+		if(!$location_slug ){$location_slug  = 'location';}
768
+		wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
769
+		update_option( 'geodir_location_page', $location_page);
770
+	}
771 771
 
772 772
 }
773 773
 
@@ -781,31 +781,31 @@  discard block
 block discarded – undo
781 781
 function gd_fix_cpt_rewrite_slug()
782 782
 {
783 783
 
784
-    $alt_post_types = array();
785
-    $post_types = get_option('geodir_post_types');
784
+	$alt_post_types = array();
785
+	$post_types = get_option('geodir_post_types');
786 786
 
787 787
 
788
-    if (is_array($post_types)){
788
+	if (is_array($post_types)){
789 789
 
790
-        foreach ($post_types as $post_type => $args) {
790
+		foreach ($post_types as $post_type => $args) {
791 791
 
792 792
 
793
-            if(isset($args['rewrite']['slug'])){
794
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
795
-            }
793
+			if(isset($args['rewrite']['slug'])){
794
+				$args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
795
+			}
796 796
 
797
-                $alt_post_types[$post_type] = $args;
797
+				$alt_post_types[$post_type] = $args;
798 798
 
799
-        }
800
-    }
799
+		}
800
+	}
801 801
 
802
-    if(!empty($alt_post_types)) {
803
-        update_option('geodir_post_types',$alt_post_types);
804
-        }
802
+	if(!empty($alt_post_types)) {
803
+		update_option('geodir_post_types',$alt_post_types);
804
+		}
805 805
 
806 806
 
807
-    // flush the rewrite rules
808
-    flush_rewrite_rules();
807
+	// flush the rewrite rules
808
+	flush_rewrite_rules();
809 809
 }
810 810
 
811 811
 
@@ -818,18 +818,18 @@  discard block
 block discarded – undo
818 818
  */
819 819
 function gd_fix_address_detail_table_limit()
820 820
 {
821
-    global $wpdb;
822
-
823
-    $all_postypes = geodir_get_posttypes();
824
-
825
-    if (!empty($all_postypes)) {
826
-        foreach ($all_postypes as $key) {
827
-            // update each GD CTP
828
-            try {
829
-                $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");
830
-            } catch(Exception $e) {
831
-                error_log( 'Error: ' . $e->getMessage() );
832
-            }
833
-        }
834
-    }
821
+	global $wpdb;
822
+
823
+	$all_postypes = geodir_get_posttypes();
824
+
825
+	if (!empty($all_postypes)) {
826
+		foreach ($all_postypes as $key) {
827
+			// update each GD CTP
828
+			try {
829
+				$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");
830
+			} catch(Exception $e) {
831
+				error_log( 'Error: ' . $e->getMessage() );
832
+			}
833
+		}
834
+	}
835 835
 }
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 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
      *
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 
49 49
 
50 50
 
51
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
51
+    add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions
52 52
 
53
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
53
+    update_option('geodirectory'.'_db_version', GEODIRECTORY_VERSION);
54 54
 
55 55
 }
56 56
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
  * @since 1.0.0
87 87
  * @package GeoDirectory
88 88
  */
89
-function geodir_upgrade_146(){
89
+function geodir_upgrade_146() {
90 90
     gd_convert_virtual_pages();
91 91
 }
92 92
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
  * @since 1.5.0
97 97
  * @package GeoDirectory
98 98
  */
99
-function geodir_upgrade_150(){
99
+function geodir_upgrade_150() {
100 100
     gd_fix_cpt_rewrite_slug();
101 101
 }
102 102
 
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
  * @since 1.4.8
109 109
  * @package GeoDirectory
110 110
  */
111
-function geodir_upgrade_148(){
111
+function geodir_upgrade_148() {
112 112
     /*
113 113
      * Blank the users google password if present as we now use oAuth 2.0
114 114
      */
115
-    update_option('geodir_ga_pass','');
116
-    update_option('geodir_ga_user','');
115
+    update_option('geodir_ga_pass', '');
116
+    update_option('geodir_ga_user', '');
117 117
 
118 118
 }
119 119
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
  * @since 1.5.3
125 125
  * @package GeoDirectory
126 126
  */
127
-function geodir_upgrade_153(){
127
+function geodir_upgrade_153() {
128 128
     geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
129 129
     geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
130 130
 }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
  * @since 1.5.3
136 136
  * @package GeoDirectory
137 137
  */
138
-function geodir_upgrade_154(){
138
+function geodir_upgrade_154() {
139 139
     geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
140 140
 }
141 141
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
  * @since 1.5.2
146 146
  * @package GeoDirectory
147 147
  */
148
-function geodir_upgrade_152(){
148
+function geodir_upgrade_152() {
149 149
     gd_fix_address_detail_table_limit();
150 150
 }
151 151
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 function geodir_fix_review_date()
182 182
 {
183 183
     global $wpdb;
184
-    $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'");
184
+    $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'");
185 185
 }
186 186
 
187 187
 /**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 function geodir_fix_review_post_status()
195 195
 {
196 196
     global $wpdb;
197
-    $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'");
197
+    $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'");
198 198
 }
199 199
 
200 200
 /**
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 function geodir_fix_review_content()
209 209
 {
210 210
     global $wpdb;
211
-    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")) {
211
+    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")) {
212 212
         return true;
213 213
     } else {
214 214
         return false;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         foreach ($all_postypes as $key) {
234 234
             // update each GD CTP
235 235
 
236
-            $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");
236
+            $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");
237 237
 
238 238
         }
239 239
         return true;
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     if (!empty($all_postypes)) {
258 258
         foreach ($all_postypes as $key) {
259 259
             // update each GD CTP
260
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
260
+            $reviews = $wpdb->get_results("SELECT post_id FROM ".$wpdb->prefix."geodir_".$key."_detail d");
261 261
 
262 262
             if (!empty($reviews)) {
263 263
                 foreach ($reviews as $post_id) {
@@ -272,51 +272,51 @@  discard block
 block discarded – undo
272 272
 }
273 273
 
274 274
 
275
-function gd_convert_custom_field_display(){
275
+function gd_convert_custom_field_display() {
276 276
     global $wpdb;
277 277
 
278
-    $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
278
+    $field_info = $wpdb->get_results("select * from ".GEODIR_CUSTOM_FIELDS_TABLE);
279 279
 
280 280
     $has_run = get_option('gd_convert_custom_field_display');
281
-    if($has_run){return;}
281
+    if ($has_run) {return; }
282 282
 
283 283
     // set the field_type_key for standard fields
284 284
     $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
285 285
 
286 286
 
287
-    if(is_array( $field_info)){
287
+    if (is_array($field_info)) {
288 288
 
289
-        foreach( $field_info as $cf){
289
+        foreach ($field_info as $cf) {
290 290
 
291 291
             $id = $cf->id;
292 292
 
293
-            if(!property_exists($cf,'show_in') || !$id){return;}
293
+            if (!property_exists($cf, 'show_in') || !$id) {return; }
294 294
 
295 295
             $show_in_arr = array();
296 296
 
297
-            if($cf->is_default){
297
+            if ($cf->is_default) {
298 298
                 $show_in_arr[] = "[detail]";
299 299
             }
300 300
 
301
-            if($cf->show_on_detail){
301
+            if ($cf->show_on_detail) {
302 302
                 $show_in_arr[] = "[moreinfo]";
303 303
             }
304 304
 
305
-            if($cf->show_on_listing){
305
+            if ($cf->show_on_listing) {
306 306
                 $show_in_arr[] = "[listing]";
307 307
             }
308 308
 
309
-            if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
309
+            if ($cf->show_as_tab || $cf->htmlvar_name == 'geodir_video' || $cf->htmlvar_name == 'geodir_special_offers') {
310 310
                 $show_in_arr[] = "[owntab]";
311 311
             }
312 312
 
313
-            if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
313
+            if ($cf->htmlvar_name == 'post' || $cf->htmlvar_name == 'geodir_contact' || $cf->htmlvar_name == 'geodir_timing') {
314 314
                 $show_in_arr[] = "[mapbubble]";
315 315
             }
316 316
 
317
-            if(!empty($show_in_arr )){
318
-                $show_in_arr = implode(',',$show_in_arr);
319
-            }else{
317
+            if (!empty($show_in_arr)) {
318
+                $show_in_arr = implode(',', $show_in_arr);
319
+            } else {
320 320
                 $show_in_arr = '';
321 321
             }
322 322
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 
325 325
         }
326 326
 
327
-        update_option('gd_convert_custom_field_display',1);
327
+        update_option('gd_convert_custom_field_display', 1);
328 328
     }
329 329
 }
330 330
 
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
 
702 702
     update_option('gd_theme_compats', $theme_compat);
703 703
 
704
-    gd_set_theme_compat();// set the compat pack if avail
704
+    gd_set_theme_compat(); // set the compat pack if avail
705 705
 }
706 706
 
707 707
 
@@ -712,61 +712,61 @@  discard block
 block discarded – undo
712 712
  * @package GeoDirectory
713 713
  * @global object $wpdb WordPress Database object.
714 714
  */
715
-function gd_convert_virtual_pages(){
715
+function gd_convert_virtual_pages() {
716 716
     global $wpdb;
717 717
 
718 718
     // Update the add listing page settings
719 719
     $add_listing_page = $wpdb->get_var(
720 720
         $wpdb->prepare(
721
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
721
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
722 722
             array('add-listing')
723 723
         )
724 724
     );
725 725
 
726
-    if($add_listing_page){
727
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
728
-        update_option( 'geodir_add_listing_page', $add_listing_page);
726
+    if ($add_listing_page) {
727
+        wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish'));
728
+        update_option('geodir_add_listing_page', $add_listing_page);
729 729
     }
730 730
 
731 731
     // Update the listing preview page settings
732 732
     $listing_preview_page = $wpdb->get_var(
733 733
         $wpdb->prepare(
734
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
734
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
735 735
             array('listing-preview')
736 736
         )
737 737
     );
738 738
 
739
-    if($listing_preview_page){
740
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
741
-        update_option( 'geodir_preview_page', $listing_preview_page);
739
+    if ($listing_preview_page) {
740
+        wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish'));
741
+        update_option('geodir_preview_page', $listing_preview_page);
742 742
     }
743 743
 
744 744
     // Update the listing success page settings
745 745
     $listing_success_page = $wpdb->get_var(
746 746
         $wpdb->prepare(
747
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
747
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
748 748
             array('listing-success')
749 749
         )
750 750
     );
751 751
 
752
-    if($listing_success_page){
753
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
754
-        update_option( 'geodir_success_page', $listing_success_page);
752
+    if ($listing_success_page) {
753
+        wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish'));
754
+        update_option('geodir_success_page', $listing_success_page);
755 755
     }
756 756
 
757 757
     // Update the listing success page settings
758 758
     $location_page = $wpdb->get_var(
759 759
         $wpdb->prepare(
760
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
760
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
761 761
             array('location')
762 762
         )
763 763
     );
764 764
 
765
-    if($location_page){
765
+    if ($location_page) {
766 766
         $location_slug = get_option('geodir_location_prefix');
767
-        if(!$location_slug ){$location_slug  = 'location';}
768
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
769
-        update_option( 'geodir_location_page', $location_page);
767
+        if (!$location_slug) {$location_slug = 'location'; }
768
+        wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug));
769
+        update_option('geodir_location_page', $location_page);
770 770
     }
771 771
 
772 772
 }
@@ -785,13 +785,13 @@  discard block
 block discarded – undo
785 785
     $post_types = get_option('geodir_post_types');
786 786
 
787 787
 
788
-    if (is_array($post_types)){
788
+    if (is_array($post_types)) {
789 789
 
790 790
         foreach ($post_types as $post_type => $args) {
791 791
 
792 792
 
793
-            if(isset($args['rewrite']['slug'])){
794
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
793
+            if (isset($args['rewrite']['slug'])) {
794
+                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']);
795 795
             }
796 796
 
797 797
                 $alt_post_types[$post_type] = $args;
@@ -799,8 +799,8 @@  discard block
 block discarded – undo
799 799
         }
800 800
     }
801 801
 
802
-    if(!empty($alt_post_types)) {
803
-        update_option('geodir_post_types',$alt_post_types);
802
+    if (!empty($alt_post_types)) {
803
+        update_option('geodir_post_types', $alt_post_types);
804 804
         }
805 805
 
806 806
 
@@ -826,9 +826,9 @@  discard block
 block discarded – undo
826 826
         foreach ($all_postypes as $key) {
827 827
             // update each GD CTP
828 828
             try {
829
-                $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");
830
-            } catch(Exception $e) {
831
-                error_log( 'Error: ' . $e->getMessage() );
829
+                $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");
830
+            } catch (Exception $e) {
831
+                error_log('Error: '.$e->getMessage());
832 832
             }
833 833
         }
834 834
     }
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_output_functions.php 3 patches
Braces   +25 added lines, -38 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
 function geodir_cf_checkbox($html,$location,$cf,$p=''){
23 23
 
24 24
     // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
25
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
27 26
 
28 27
     if(!is_array($cf) && $cf!=''){
29 28
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -76,8 +75,10 @@  discard block
 block discarded – undo
76 75
 
77 76
             if ( $post->{$html_var} == '1' ):
78 77
                 $html_val = __( 'Yes', 'geodirectory' );
79
-            else:
78
+            else {
79
+            	:
80 80
                 $html_val = __( 'No', 'geodirectory' );
81
+            }
81 82
             endif;
82 83
 
83 84
             $field_icon = geodir_field_icon_proccess($cf);
@@ -115,8 +116,7 @@  discard block
 block discarded – undo
115 116
 function geodir_cf_fieldset($html,$location,$cf,$p=''){
116 117
 
117 118
     // check we have the post value
118
-    if(is_int($p)){$post = geodir_get_post_info($p);}
119
-    else{ global $post;}
119
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
120 120
 
121 121
     if(!is_array($cf) && $cf!=''){
122 122
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -195,8 +195,7 @@  discard block
 block discarded – undo
195 195
 function geodir_cf_url($html,$location,$cf,$p=''){
196 196
 
197 197
     // check we have the post value
198
-    if(is_int($p)){$post = geodir_get_post_info($p);}
199
-    else{ global $post;}
198
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
200 199
 
201 200
     if(!is_array($cf) && $cf!=''){
202 201
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -310,8 +309,7 @@  discard block
 block discarded – undo
310 309
 function geodir_cf_phone($html,$location,$cf,$p=''){
311 310
 
312 311
     // check we have the post value
313
-    if(is_int($p)){$post = geodir_get_post_info($p);}
314
-    else{ global $post;}
312
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
315 313
 
316 314
     if(!is_array($cf) && $cf!=''){
317 315
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -399,8 +397,7 @@  discard block
 block discarded – undo
399 397
 function geodir_cf_time($html,$location,$cf,$p=''){
400 398
 
401 399
     // check we have the post value
402
-    if(is_int($p)){$post = geodir_get_post_info($p);}
403
-    else{ global $post;}
400
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
404 401
 
405 402
     if(!is_array($cf) && $cf!=''){
406 403
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -452,9 +449,10 @@  discard block
 block discarded – undo
452 449
         if ($post->{$cf['htmlvar_name']}):
453 450
 
454 451
             $value = '';
455
-            if ($post->{$cf['htmlvar_name']} != '')
456
-                //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
452
+            if ($post->{$cf['htmlvar_name']} != '') {
453
+                            //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
457 454
                 $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
455
+            }
458 456
 
459 457
             $field_icon = geodir_field_icon_proccess($cf);
460 458
             if (strpos($field_icon, 'http') !== false) {
@@ -493,8 +491,7 @@  discard block
 block discarded – undo
493 491
 function geodir_cf_datepicker($html,$location,$cf,$p=''){
494 492
 
495 493
     // check we have the post value
496
-    if(is_int($p)){$post = geodir_get_post_info($p);}
497
-    else{ global $post;}
494
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
498 495
 
499 496
     if(!is_array($cf) && $cf!=''){
500 497
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -560,13 +557,13 @@  discard block
 block discarded – undo
560 557
                 $date_format = str_replace($search, $replace, $date_format);
561 558
 
562 559
                 $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
563
-            }else{
560
+            } else{
564 561
                 $post_htmlvar_value = $post->{$cf['htmlvar_name']};
565 562
             }
566 563
 
567 564
             if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
568 565
                 $value = date_i18n($date_format, strtotime($post_htmlvar_value));
569
-            }else{
566
+            } else{
570 567
                 return '';
571 568
             }
572 569
 
@@ -609,8 +606,7 @@  discard block
 block discarded – undo
609 606
 function geodir_cf_text($html,$location,$cf,$p=''){
610 607
 
611 608
     // check we have the post value
612
-    if(is_int($p)){$post = geodir_get_post_info($p);}
613
-    else{ global $post;}
609
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
614 610
 
615 611
     if(!is_array($cf) && $cf!=''){
616 612
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -700,8 +696,7 @@  discard block
 block discarded – undo
700 696
 function geodir_cf_radio($html,$location,$cf,$p=''){
701 697
 
702 698
     // check we have the post value
703
-    if(is_int($p)){$post = geodir_get_post_info($p);}
704
-    else{ global $post;}
699
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
705 700
 
706 701
     if(!is_array($cf) && $cf!=''){
707 702
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -807,8 +802,7 @@  discard block
 block discarded – undo
807 802
 function geodir_cf_select($html,$location,$cf,$p=''){
808 803
 
809 804
     // check we have the post value
810
-    if(is_int($p)){$post = geodir_get_post_info($p);}
811
-    else{ global $post;}
805
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
812 806
 
813 807
     if(!is_array($cf) && $cf!=''){
814 808
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -908,8 +902,7 @@  discard block
 block discarded – undo
908 902
 function geodir_cf_multiselect($html,$location,$cf,$p=''){
909 903
 
910 904
     // check we have the post value
911
-    if(is_int($p)){$post = geodir_get_post_info($p);}
912
-    else{ global $post;}
905
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
913 906
 
914 907
     if(!is_array($cf) && $cf!=''){
915 908
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1030,8 +1023,7 @@  discard block
 block discarded – undo
1030 1023
 function geodir_cf_email($html,$location,$cf,$p=''){
1031 1024
 
1032 1025
     // check we have the post value
1033
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1034
-    else{ global $post;}
1026
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1035 1027
 
1036 1028
     if(!is_array($cf) && $cf!=''){
1037 1029
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1162,7 +1154,7 @@  discard block
 block discarded – undo
1162 1154
                      */
1163 1155
                     $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1164 1156
                     $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1165
-                }else{
1157
+                } else{
1166 1158
                     $html .=  $email;
1167 1159
                 }
1168 1160
                 $html .= '</span></div>';
@@ -1190,8 +1182,7 @@  discard block
 block discarded – undo
1190 1182
 function geodir_cf_file($html,$location,$cf,$p=''){
1191 1183
 
1192 1184
     // check we have the post value
1193
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1194
-    else{ global $post;}
1185
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1195 1186
 
1196 1187
     if(!is_array($cf) && $cf!=''){
1197 1188
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1330,8 +1321,7 @@  discard block
 block discarded – undo
1330 1321
 function geodir_cf_textarea($html,$location,$cf,$p=''){
1331 1322
 
1332 1323
     // check we have the post value
1333
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1334
-    else{ global $post;}
1324
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1335 1325
 
1336 1326
     if(!is_array($cf) && $cf!=''){
1337 1327
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1420,8 +1410,7 @@  discard block
 block discarded – undo
1420 1410
 function geodir_cf_html($html,$location,$cf,$p=''){
1421 1411
 
1422 1412
     // check we have the post value
1423
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1424
-    else{ global $post;}
1413
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1425 1414
 
1426 1415
     if(!is_array($cf) && $cf!=''){
1427 1416
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1509,8 +1498,7 @@  discard block
 block discarded – undo
1509 1498
 function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1510 1499
 
1511 1500
     // check we have the post value
1512
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1513
-    else{ global $post;}
1501
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1514 1502
 
1515 1503
     if(!is_array($cf) && $cf!=''){
1516 1504
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1631,8 +1619,7 @@  discard block
 block discarded – undo
1631 1619
 function geodir_cf_address($html,$location,$cf,$p=''){
1632 1620
 
1633 1621
     // check we have the post value
1634
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1635
-    else{ global $post;}
1622
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1636 1623
 
1637 1624
     if(!is_array($cf) && $cf!=''){
1638 1625
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
Please login to merge, or discard this patch.
Indentation   +1529 added lines, -1529 removed lines patch added patch discarded remove patch
@@ -21,84 +21,84 @@  discard block
 block discarded – undo
21 21
  */
22 22
 function geodir_cf_checkbox($html,$location,$cf,$p=''){
23 23
 
24
-    // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
27
-
28
-    if(!is_array($cf) && $cf!=''){
29
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
-        if(!$cf){return NULL;}
31
-    }
32
-
33
-    $html_var = $cf['htmlvar_name'];
34
-
35
-    // Check if there is a location specific filter.
36
-    if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
37
-        /**
38
-         * Filter the checkbox html by location.
39
-         *
40
-         * @param string $html The html to filter.
41
-         * @param array $cf The custom field array.
42
-         * @since 1.6.6
43
-         */
44
-        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
45
-    }
46
-
47
-    // Check if there is a custom field specific filter.
48
-    if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
49
-        /**
50
-         * Filter the checkbox html by individual custom field.
51
-         *
52
-         * @param string $html The html to filter.
53
-         * @param string $location The location to output the html.
54
-         * @param array $cf The custom field array.
55
-         * @since 1.6.6
56
-         */
57
-        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
58
-    }
59
-
60
-    // Check if there is a custom field key specific filter.
61
-    if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
62
-        /**
63
-         * Filter the checkbox html by field type key.
64
-         *
65
-         * @param string $html The html to filter.
66
-         * @param string $location The location to output the html.
67
-         * @param array $cf The custom field array.
68
-         * @since 1.6.6
69
-         */
70
-        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
71
-    }
72
-
73
-    // If not html then we run the standard output.
74
-    if(empty($html)){
75
-
76
-        if ( (int) $post->{$html_var} == 1 ):
77
-
78
-            if ( $post->{$html_var} == '1' ):
79
-                $html_val = __( 'Yes', 'geodirectory' );
80
-            else:
81
-                $html_val = __( 'No', 'geodirectory' );
82
-            endif;
83
-
84
-            $field_icon = geodir_field_icon_proccess($cf);
85
-            if (strpos($field_icon, 'http') !== false) {
86
-                $field_icon_af = '';
87
-            } elseif ($field_icon == '') {
88
-                $field_icon_af = '';
89
-            } else {
90
-                $field_icon_af = $field_icon;
91
-                $field_icon = '';
92
-            }
93
-
94
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
-            $html .= '</span>' . $html_val . '</div>';
97
-        endif;
98
-
99
-    }
100
-
101
-    return $html;
24
+	// check we have the post value
25
+	if(is_int($p)){$post = geodir_get_post_info($p);}
26
+	else{ global $post;}
27
+
28
+	if(!is_array($cf) && $cf!=''){
29
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
+		if(!$cf){return NULL;}
31
+	}
32
+
33
+	$html_var = $cf['htmlvar_name'];
34
+
35
+	// Check if there is a location specific filter.
36
+	if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
37
+		/**
38
+		 * Filter the checkbox html by location.
39
+		 *
40
+		 * @param string $html The html to filter.
41
+		 * @param array $cf The custom field array.
42
+		 * @since 1.6.6
43
+		 */
44
+		$html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
45
+	}
46
+
47
+	// Check if there is a custom field specific filter.
48
+	if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
49
+		/**
50
+		 * Filter the checkbox html by individual custom field.
51
+		 *
52
+		 * @param string $html The html to filter.
53
+		 * @param string $location The location to output the html.
54
+		 * @param array $cf The custom field array.
55
+		 * @since 1.6.6
56
+		 */
57
+		$html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
58
+	}
59
+
60
+	// Check if there is a custom field key specific filter.
61
+	if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
62
+		/**
63
+		 * Filter the checkbox html by field type key.
64
+		 *
65
+		 * @param string $html The html to filter.
66
+		 * @param string $location The location to output the html.
67
+		 * @param array $cf The custom field array.
68
+		 * @since 1.6.6
69
+		 */
70
+		$html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
71
+	}
72
+
73
+	// If not html then we run the standard output.
74
+	if(empty($html)){
75
+
76
+		if ( (int) $post->{$html_var} == 1 ):
77
+
78
+			if ( $post->{$html_var} == '1' ):
79
+				$html_val = __( 'Yes', 'geodirectory' );
80
+			else:
81
+				$html_val = __( 'No', 'geodirectory' );
82
+			endif;
83
+
84
+			$field_icon = geodir_field_icon_proccess($cf);
85
+			if (strpos($field_icon, 'http') !== false) {
86
+				$field_icon_af = '';
87
+			} elseif ($field_icon == '') {
88
+				$field_icon_af = '';
89
+			} else {
90
+				$field_icon_af = $field_icon;
91
+				$field_icon = '';
92
+			}
93
+
94
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
+			$html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
+			$html .= '</span>' . $html_val . '</div>';
97
+		endif;
98
+
99
+	}
100
+
101
+	return $html;
102 102
 }
103 103
 add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3);
104 104
 
@@ -115,71 +115,71 @@  discard block
 block discarded – undo
115 115
  */
116 116
 function geodir_cf_fieldset($html,$location,$cf,$p=''){
117 117
 
118
-    // check we have the post value
119
-    if(is_int($p)){$post = geodir_get_post_info($p);}
120
-    else{ global $post;}
121
-
122
-    if(!is_array($cf) && $cf!=''){
123
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
-        if(!$cf){return NULL;}
125
-    }
126
-
127
-    $html_var = $cf['htmlvar_name'];
128
-
129
-    // Check if there is a location specific filter.
130
-    if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
131
-        /**
132
-         * Filter the fieldset html by location.
133
-         *
134
-         * @param string $html The html to filter.
135
-         * @param array $cf The custom field array.
136
-         * @since 1.6.6
137
-         */
138
-        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
139
-    }
140
-
141
-    // Check if there is a custom field specific filter.
142
-    if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
143
-        /**
144
-         * Filter the fieldset html by individual custom field.
145
-         *
146
-         * @param string $html The html to filter.
147
-         * @param string $location The location to output the html.
148
-         * @param array $cf The custom field array.
149
-         * @since 1.6.6
150
-         */
151
-        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
152
-    }
153
-
154
-    // Check if there is a custom field key specific filter.
155
-    if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
156
-        /**
157
-         * Filter the fieldset html by field type key.
158
-         *
159
-         * @param string $html The html to filter.
160
-         * @param string $location The location to output the html.
161
-         * @param array $cf The custom field array.
162
-         * @since 1.6.6
163
-         */
164
-        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
165
-    }
166
-
167
-    // If not html then we run the standard output.
168
-    if(empty($html)){
169
-
170
-        global $field_set_start;
171
-        $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']);
172
-
173
-        if ($field_set_start == 1) {
174
-            $html = '';
175
-        } else {
176
-            $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>';
177
-            //$field_set_start = 1;
178
-        }
179
-
180
-    }
181
-
182
-    return $html;
118
+	// check we have the post value
119
+	if(is_int($p)){$post = geodir_get_post_info($p);}
120
+	else{ global $post;}
121
+
122
+	if(!is_array($cf) && $cf!=''){
123
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
+		if(!$cf){return NULL;}
125
+	}
126
+
127
+	$html_var = $cf['htmlvar_name'];
128
+
129
+	// Check if there is a location specific filter.
130
+	if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
131
+		/**
132
+		 * Filter the fieldset html by location.
133
+		 *
134
+		 * @param string $html The html to filter.
135
+		 * @param array $cf The custom field array.
136
+		 * @since 1.6.6
137
+		 */
138
+		$html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
139
+	}
140
+
141
+	// Check if there is a custom field specific filter.
142
+	if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
143
+		/**
144
+		 * Filter the fieldset html by individual custom field.
145
+		 *
146
+		 * @param string $html The html to filter.
147
+		 * @param string $location The location to output the html.
148
+		 * @param array $cf The custom field array.
149
+		 * @since 1.6.6
150
+		 */
151
+		$html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
152
+	}
153
+
154
+	// Check if there is a custom field key specific filter.
155
+	if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
156
+		/**
157
+		 * Filter the fieldset html by field type key.
158
+		 *
159
+		 * @param string $html The html to filter.
160
+		 * @param string $location The location to output the html.
161
+		 * @param array $cf The custom field array.
162
+		 * @since 1.6.6
163
+		 */
164
+		$html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
165
+	}
166
+
167
+	// If not html then we run the standard output.
168
+	if(empty($html)){
169
+
170
+		global $field_set_start;
171
+		$fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']);
172
+
173
+		if ($field_set_start == 1) {
174
+			$html = '';
175
+		} else {
176
+			$html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>';
177
+			//$field_set_start = 1;
178
+		}
179
+
180
+	}
181
+
182
+	return $html;
183 183
 }
184 184
 add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3);
185 185
 
@@ -196,106 +196,106 @@  discard block
 block discarded – undo
196 196
  */
197 197
 function geodir_cf_url($html,$location,$cf,$p=''){
198 198
 
199
-    // check we have the post value
200
-    if(is_int($p)){$post = geodir_get_post_info($p);}
201
-    else{ global $post;}
202
-
203
-    if(!is_array($cf) && $cf!=''){
204
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
-        if(!$cf){return NULL;}
206
-    }
207
-
208
-    $html_var = $cf['htmlvar_name'];
209
-
210
-    // Check if there is a location specific filter.
211
-    if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
212
-        /**
213
-         * Filter the url html by location.
214
-         *
215
-         * @param string $html The html to filter.
216
-         * @param array $cf The custom field array.
217
-         * @since 1.6.6
218
-         */
219
-        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
220
-    }
221
-
222
-    // Check if there is a custom field specific filter.
223
-    if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
224
-        /**
225
-         * Filter the url html by individual custom field.
226
-         *
227
-         * @param string $html The html to filter.
228
-         * @param string $location The location to output the html.
229
-         * @param array $cf The custom field array.
230
-         * @since 1.6.6
231
-         */
232
-        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
233
-    }
234
-
235
-    // Check if there is a custom field key specific filter.
236
-    if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
237
-        /**
238
-         * Filter the url html by field type key.
239
-         *
240
-         * @param string $html The html to filter.
241
-         * @param string $location The location to output the html.
242
-         * @param array $cf The custom field array.
243
-         * @since 1.6.6
244
-         */
245
-        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
246
-    }
247
-
248
-    // If not html then we run the standard output.
249
-    if(empty($html)){
250
-
251
-        if ($post->{$cf['htmlvar_name']}):
252
-
253
-            $field_icon = geodir_field_icon_proccess($cf);
254
-            if (strpos($field_icon, 'http') !== false) {
255
-                $field_icon_af = '';
256
-            } elseif ($field_icon == '') {
257
-
258
-                if ($cf['name'] == 'geodir_facebook') {
259
-                    $field_icon_af = '<i class="fa fa-facebook-square"></i>';
260
-                } elseif ($cf['name'] == 'geodir_twitter') {
261
-                    $field_icon_af = '<i class="fa fa-twitter-square"></i>';
262
-                } else {
263
-                    $field_icon_af = '<i class="fa fa-link"></i>';
264
-                }
265
-
266
-            } else {
267
-                $field_icon_af = $field_icon;
268
-                $field_icon = '';
269
-            }
270
-
271
-            $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']});
272
-
273
-
274
-            $website = !empty($a_url['url']) ? $a_url['url'] : '';
275
-            $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
-            if(!empty($cf['default_value'])){$title = $cf['default_value'];}
277
-            $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278
-
279
-
280
-
281
-            // all search engines that use the nofollow value exclude links that use it from their ranking calculation
282
-            $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
283
-            /**
284
-             * Filter custom field website name.
285
-             *
286
-             * @since 1.0.0
287
-             *
288
-             * @param string $title Website Title.
289
-             * @param string $website Website URL.
290
-             * @param int $post->ID Post ID.
291
-             */
292
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
293
-
294
-        endif;
295
-
296
-    }
297
-
298
-    return $html;
199
+	// check we have the post value
200
+	if(is_int($p)){$post = geodir_get_post_info($p);}
201
+	else{ global $post;}
202
+
203
+	if(!is_array($cf) && $cf!=''){
204
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
+		if(!$cf){return NULL;}
206
+	}
207
+
208
+	$html_var = $cf['htmlvar_name'];
209
+
210
+	// Check if there is a location specific filter.
211
+	if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
212
+		/**
213
+		 * Filter the url html by location.
214
+		 *
215
+		 * @param string $html The html to filter.
216
+		 * @param array $cf The custom field array.
217
+		 * @since 1.6.6
218
+		 */
219
+		$html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
220
+	}
221
+
222
+	// Check if there is a custom field specific filter.
223
+	if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
224
+		/**
225
+		 * Filter the url html by individual custom field.
226
+		 *
227
+		 * @param string $html The html to filter.
228
+		 * @param string $location The location to output the html.
229
+		 * @param array $cf The custom field array.
230
+		 * @since 1.6.6
231
+		 */
232
+		$html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
233
+	}
234
+
235
+	// Check if there is a custom field key specific filter.
236
+	if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
237
+		/**
238
+		 * Filter the url html by field type key.
239
+		 *
240
+		 * @param string $html The html to filter.
241
+		 * @param string $location The location to output the html.
242
+		 * @param array $cf The custom field array.
243
+		 * @since 1.6.6
244
+		 */
245
+		$html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
246
+	}
247
+
248
+	// If not html then we run the standard output.
249
+	if(empty($html)){
250
+
251
+		if ($post->{$cf['htmlvar_name']}):
252
+
253
+			$field_icon = geodir_field_icon_proccess($cf);
254
+			if (strpos($field_icon, 'http') !== false) {
255
+				$field_icon_af = '';
256
+			} elseif ($field_icon == '') {
257
+
258
+				if ($cf['name'] == 'geodir_facebook') {
259
+					$field_icon_af = '<i class="fa fa-facebook-square"></i>';
260
+				} elseif ($cf['name'] == 'geodir_twitter') {
261
+					$field_icon_af = '<i class="fa fa-twitter-square"></i>';
262
+				} else {
263
+					$field_icon_af = '<i class="fa fa-link"></i>';
264
+				}
265
+
266
+			} else {
267
+				$field_icon_af = $field_icon;
268
+				$field_icon = '';
269
+			}
270
+
271
+			$a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']});
272
+
273
+
274
+			$website = !empty($a_url['url']) ? $a_url['url'] : '';
275
+			$title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
+			if(!empty($cf['default_value'])){$title = $cf['default_value'];}
277
+			$title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278
+
279
+
280
+
281
+			// all search engines that use the nofollow value exclude links that use it from their ranking calculation
282
+			$rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
283
+			/**
284
+			 * Filter custom field website name.
285
+			 *
286
+			 * @since 1.0.0
287
+			 *
288
+			 * @param string $title Website Title.
289
+			 * @param string $website Website URL.
290
+			 * @param int $post->ID Post ID.
291
+			 */
292
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
293
+
294
+		endif;
295
+
296
+	}
297
+
298
+	return $html;
299 299
 }
300 300
 add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3);
301 301
 
@@ -312,80 +312,80 @@  discard block
 block discarded – undo
312 312
  */
313 313
 function geodir_cf_phone($html,$location,$cf,$p=''){
314 314
 
315
-    // check we have the post value
316
-    if(is_int($p)){$post = geodir_get_post_info($p);}
317
-    else{ global $post;}
318
-
319
-    if(!is_array($cf) && $cf!=''){
320
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
-        if(!$cf){return NULL;}
322
-    }
323
-
324
-    $html_var = $cf['htmlvar_name'];
325
-
326
-    // Check if there is a location specific filter.
327
-    if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
328
-        /**
329
-         * Filter the phone html by location.
330
-         *
331
-         * @param string $html The html to filter.
332
-         * @param array $cf The custom field array.
333
-         * @since 1.6.6
334
-         */
335
-        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
336
-    }
337
-
338
-    // Check if there is a custom field specific filter.
339
-    if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
340
-        /**
341
-         * Filter the phone html by individual custom field.
342
-         *
343
-         * @param string $html The html to filter.
344
-         * @param string $location The location to output the html.
345
-         * @param array $cf The custom field array.
346
-         * @since 1.6.6
347
-         */
348
-        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
349
-    }
350
-
351
-    // Check if there is a custom field key specific filter.
352
-    if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
353
-        /**
354
-         * Filter the phone html by field type key.
355
-         *
356
-         * @param string $html The html to filter.
357
-         * @param string $location The location to output the html.
358
-         * @param array $cf The custom field array.
359
-         * @since 1.6.6
360
-         */
361
-        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
362
-    }
363
-
364
-    // If not html then we run the standard output.
365
-    if(empty($html)){
366
-
367
-        if ($post->{$cf['htmlvar_name']}):
368
-
369
-            $field_icon = geodir_field_icon_proccess($cf);
370
-            if (strpos($field_icon, 'http') !== false) {
371
-                $field_icon_af = '';
372
-            } elseif ($field_icon == '') {
373
-                $field_icon_af = '<i class="fa fa-phone"></i>';
374
-            } else {
375
-                $field_icon_af = $field_icon;
376
-                $field_icon = '';
377
-            }
378
-
379
-
380
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
-                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
-            $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
383
-
384
-        endif;
385
-
386
-    }
387
-
388
-    return $html;
315
+	// check we have the post value
316
+	if(is_int($p)){$post = geodir_get_post_info($p);}
317
+	else{ global $post;}
318
+
319
+	if(!is_array($cf) && $cf!=''){
320
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
+		if(!$cf){return NULL;}
322
+	}
323
+
324
+	$html_var = $cf['htmlvar_name'];
325
+
326
+	// Check if there is a location specific filter.
327
+	if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
328
+		/**
329
+		 * Filter the phone html by location.
330
+		 *
331
+		 * @param string $html The html to filter.
332
+		 * @param array $cf The custom field array.
333
+		 * @since 1.6.6
334
+		 */
335
+		$html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
336
+	}
337
+
338
+	// Check if there is a custom field specific filter.
339
+	if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
340
+		/**
341
+		 * Filter the phone html by individual custom field.
342
+		 *
343
+		 * @param string $html The html to filter.
344
+		 * @param string $location The location to output the html.
345
+		 * @param array $cf The custom field array.
346
+		 * @since 1.6.6
347
+		 */
348
+		$html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
349
+	}
350
+
351
+	// Check if there is a custom field key specific filter.
352
+	if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
353
+		/**
354
+		 * Filter the phone html by field type key.
355
+		 *
356
+		 * @param string $html The html to filter.
357
+		 * @param string $location The location to output the html.
358
+		 * @param array $cf The custom field array.
359
+		 * @since 1.6.6
360
+		 */
361
+		$html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
362
+	}
363
+
364
+	// If not html then we run the standard output.
365
+	if(empty($html)){
366
+
367
+		if ($post->{$cf['htmlvar_name']}):
368
+
369
+			$field_icon = geodir_field_icon_proccess($cf);
370
+			if (strpos($field_icon, 'http') !== false) {
371
+				$field_icon_af = '';
372
+			} elseif ($field_icon == '') {
373
+				$field_icon_af = '<i class="fa fa-phone"></i>';
374
+			} else {
375
+				$field_icon_af = $field_icon;
376
+				$field_icon = '';
377
+			}
378
+
379
+
380
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
+					$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
+			$html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
383
+
384
+		endif;
385
+
386
+	}
387
+
388
+	return $html;
389 389
 }
390 390
 add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3);
391 391
 
@@ -402,85 +402,85 @@  discard block
 block discarded – undo
402 402
  */
403 403
 function geodir_cf_time($html,$location,$cf,$p=''){
404 404
 
405
-    // check we have the post value
406
-    if(is_int($p)){$post = geodir_get_post_info($p);}
407
-    else{ global $post;}
408
-
409
-    if(!is_array($cf) && $cf!=''){
410
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
-        if(!$cf){return NULL;}
412
-    }
413
-
414
-    $html_var = $cf['htmlvar_name'];
415
-
416
-    // Check if there is a location specific filter.
417
-    if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
418
-        /**
419
-         * Filter the time html by location.
420
-         *
421
-         * @param string $html The html to filter.
422
-         * @param array $cf The custom field array.
423
-         * @since 1.6.6
424
-         */
425
-        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
426
-    }
427
-
428
-    // Check if there is a custom field specific filter.
429
-    if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
430
-        /**
431
-         * Filter the time html by individual custom field.
432
-         *
433
-         * @param string $html The html to filter.
434
-         * @param string $location The location to output the html.
435
-         * @param array $cf The custom field array.
436
-         * @since 1.6.6
437
-         */
438
-        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
439
-    }
440
-
441
-    // Check if there is a custom field key specific filter.
442
-    if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
443
-        /**
444
-         * Filter the time html by field type key.
445
-         *
446
-         * @param string $html The html to filter.
447
-         * @param string $location The location to output the html.
448
-         * @param array $cf The custom field array.
449
-         * @since 1.6.6
450
-         */
451
-        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
452
-    }
453
-
454
-    // If not html then we run the standard output.
455
-    if(empty($html)){
456
-
457
-        if ($post->{$cf['htmlvar_name']}):
458
-
459
-            $value = '';
460
-            if ($post->{$cf['htmlvar_name']} != '')
461
-                //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
462
-                $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
463
-
464
-            $field_icon = geodir_field_icon_proccess($cf);
465
-            if (strpos($field_icon, 'http') !== false) {
466
-                $field_icon_af = '';
467
-            } elseif ($field_icon == '') {
468
-                $field_icon_af = '<i class="fa fa-clock-o"></i>';
469
-            } else {
470
-                $field_icon_af = $field_icon;
471
-                $field_icon = '';
472
-            }
473
-
474
-
475
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
-            $html .= '</span>' . $value . '</div>';
478
-
479
-        endif;
480
-
481
-    }
482
-
483
-    return $html;
405
+	// check we have the post value
406
+	if(is_int($p)){$post = geodir_get_post_info($p);}
407
+	else{ global $post;}
408
+
409
+	if(!is_array($cf) && $cf!=''){
410
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
+		if(!$cf){return NULL;}
412
+	}
413
+
414
+	$html_var = $cf['htmlvar_name'];
415
+
416
+	// Check if there is a location specific filter.
417
+	if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
418
+		/**
419
+		 * Filter the time html by location.
420
+		 *
421
+		 * @param string $html The html to filter.
422
+		 * @param array $cf The custom field array.
423
+		 * @since 1.6.6
424
+		 */
425
+		$html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
426
+	}
427
+
428
+	// Check if there is a custom field specific filter.
429
+	if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
430
+		/**
431
+		 * Filter the time html by individual custom field.
432
+		 *
433
+		 * @param string $html The html to filter.
434
+		 * @param string $location The location to output the html.
435
+		 * @param array $cf The custom field array.
436
+		 * @since 1.6.6
437
+		 */
438
+		$html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
439
+	}
440
+
441
+	// Check if there is a custom field key specific filter.
442
+	if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
443
+		/**
444
+		 * Filter the time html by field type key.
445
+		 *
446
+		 * @param string $html The html to filter.
447
+		 * @param string $location The location to output the html.
448
+		 * @param array $cf The custom field array.
449
+		 * @since 1.6.6
450
+		 */
451
+		$html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
452
+	}
453
+
454
+	// If not html then we run the standard output.
455
+	if(empty($html)){
456
+
457
+		if ($post->{$cf['htmlvar_name']}):
458
+
459
+			$value = '';
460
+			if ($post->{$cf['htmlvar_name']} != '')
461
+				//$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
462
+				$value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
463
+
464
+			$field_icon = geodir_field_icon_proccess($cf);
465
+			if (strpos($field_icon, 'http') !== false) {
466
+				$field_icon_af = '';
467
+			} elseif ($field_icon == '') {
468
+				$field_icon_af = '<i class="fa fa-clock-o"></i>';
469
+			} else {
470
+				$field_icon_af = $field_icon;
471
+				$field_icon = '';
472
+			}
473
+
474
+
475
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
+			$html .= '</span>' . $value . '</div>';
478
+
479
+		endif;
480
+
481
+	}
482
+
483
+	return $html;
484 484
 }
485 485
 add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3);
486 486
 
@@ -496,111 +496,111 @@  discard block
 block discarded – undo
496 496
  * @return string The html to output for the custom field.
497 497
  */
498 498
 function geodir_cf_datepicker($html,$location,$cf,$p=''){
499
-    global $preview;
500
-    // check we have the post value
501
-    if(is_int($p)){$post = geodir_get_post_info($p);}
502
-    else{ global $post;}
503
-
504
-    if(!is_array($cf) && $cf!=''){
505
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
-        if(!$cf){return NULL;}
507
-    }
508
-
509
-    $html_var = $cf['htmlvar_name'];
510
-
511
-    // Check if there is a location specific filter.
512
-    if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
513
-        /**
514
-         * Filter the datepicker html by location.
515
-         *
516
-         * @param string $html The html to filter.
517
-         * @param array $cf The custom field array.
518
-         * @since 1.6.6
519
-         */
520
-        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
521
-    }
522
-
523
-    // Check if there is a custom field specific filter.
524
-    if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
525
-        /**
526
-         * Filter the datepicker html by individual custom field.
527
-         *
528
-         * @param string $html The html to filter.
529
-         * @param string $location The location to output the html.
530
-         * @param array $cf The custom field array.
531
-         * @since 1.6.6
532
-         */
533
-        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
534
-    }
535
-
536
-    // Check if there is a custom field key specific filter.
537
-    if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
538
-        /**
539
-         * Filter the datepicker html by field type key.
540
-         *
541
-         * @param string $html The html to filter.
542
-         * @param string $location The location to output the html.
543
-         * @param array $cf The custom field array.
544
-         * @since 1.6.6
545
-         */
546
-        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
547
-    }
548
-
549
-    // If not html then we run the standard output.
550
-    if(empty($html)){
551
-
552
-        if ($post->{$cf['htmlvar_name']}):
553
-
554
-            $date_format = geodir_default_date_format();
555
-            if ($cf['extra_fields'] != '') {
556
-                $date_format = unserialize($cf['extra_fields']);
557
-                $date_format = $date_format['date_format'];
558
-            }
559
-            // check if we need to change the format or not
560
-            $date_format_len = strlen(str_replace(' ', '', $date_format));
561
-            if($date_format_len>5){// if greater then 4 then it's the old style format.
562
-
563
-                $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
-                $replace = array('d','j','l','m','n','F','Y');//PHP date format
565
-
566
-                $date_format = str_replace($search, $replace, $date_format);
567
-
568
-                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
-            }else{
570
-                $post_htmlvar_value = $post->{$cf['htmlvar_name']};
571
-            }
572
-
573
-            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
574
-                $date_format_from = $preview ? $date_format : 'Y-m-d';
575
-                $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d
576
-                //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value;
577
-                //$value = date_i18n($date_format, strtotime($post_htmlvar_value));
578
-            }else{
579
-                return '';
580
-            }
581
-
582
-            $field_icon = geodir_field_icon_proccess($cf);
583
-
584
-            if (strpos($field_icon, 'http') !== false) {
585
-                $field_icon_af = '';
586
-            } elseif ($field_icon == '') {
587
-                $field_icon_af = '<i class="fa fa-calendar"></i>';
588
-            } else {
589
-                $field_icon_af = $field_icon;
590
-                $field_icon = '';
591
-            }
592
-
593
-
594
-
595
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
596
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
597
-            $html .= '</span>' . $value . '</div>';
598
-
599
-        endif;
600
-
601
-    }
602
-
603
-    return $html;
499
+	global $preview;
500
+	// check we have the post value
501
+	if(is_int($p)){$post = geodir_get_post_info($p);}
502
+	else{ global $post;}
503
+
504
+	if(!is_array($cf) && $cf!=''){
505
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
+		if(!$cf){return NULL;}
507
+	}
508
+
509
+	$html_var = $cf['htmlvar_name'];
510
+
511
+	// Check if there is a location specific filter.
512
+	if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
513
+		/**
514
+		 * Filter the datepicker html by location.
515
+		 *
516
+		 * @param string $html The html to filter.
517
+		 * @param array $cf The custom field array.
518
+		 * @since 1.6.6
519
+		 */
520
+		$html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
521
+	}
522
+
523
+	// Check if there is a custom field specific filter.
524
+	if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
525
+		/**
526
+		 * Filter the datepicker html by individual custom field.
527
+		 *
528
+		 * @param string $html The html to filter.
529
+		 * @param string $location The location to output the html.
530
+		 * @param array $cf The custom field array.
531
+		 * @since 1.6.6
532
+		 */
533
+		$html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
534
+	}
535
+
536
+	// Check if there is a custom field key specific filter.
537
+	if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
538
+		/**
539
+		 * Filter the datepicker html by field type key.
540
+		 *
541
+		 * @param string $html The html to filter.
542
+		 * @param string $location The location to output the html.
543
+		 * @param array $cf The custom field array.
544
+		 * @since 1.6.6
545
+		 */
546
+		$html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
547
+	}
548
+
549
+	// If not html then we run the standard output.
550
+	if(empty($html)){
551
+
552
+		if ($post->{$cf['htmlvar_name']}):
553
+
554
+			$date_format = geodir_default_date_format();
555
+			if ($cf['extra_fields'] != '') {
556
+				$date_format = unserialize($cf['extra_fields']);
557
+				$date_format = $date_format['date_format'];
558
+			}
559
+			// check if we need to change the format or not
560
+			$date_format_len = strlen(str_replace(' ', '', $date_format));
561
+			if($date_format_len>5){// if greater then 4 then it's the old style format.
562
+
563
+				$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
+				$replace = array('d','j','l','m','n','F','Y');//PHP date format
565
+
566
+				$date_format = str_replace($search, $replace, $date_format);
567
+
568
+				$post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
+			}else{
570
+				$post_htmlvar_value = $post->{$cf['htmlvar_name']};
571
+			}
572
+
573
+			if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
574
+				$date_format_from = $preview ? $date_format : 'Y-m-d';
575
+				$value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d
576
+				//$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value;
577
+				//$value = date_i18n($date_format, strtotime($post_htmlvar_value));
578
+			}else{
579
+				return '';
580
+			}
581
+
582
+			$field_icon = geodir_field_icon_proccess($cf);
583
+
584
+			if (strpos($field_icon, 'http') !== false) {
585
+				$field_icon_af = '';
586
+			} elseif ($field_icon == '') {
587
+				$field_icon_af = '<i class="fa fa-calendar"></i>';
588
+			} else {
589
+				$field_icon_af = $field_icon;
590
+				$field_icon = '';
591
+			}
592
+
593
+
594
+
595
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
596
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
597
+			$html .= '</span>' . $value . '</div>';
598
+
599
+		endif;
600
+
601
+	}
602
+
603
+	return $html;
604 604
 }
605 605
 add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3);
606 606
 
@@ -617,84 +617,84 @@  discard block
 block discarded – undo
617 617
  */
618 618
 function geodir_cf_text($html,$location,$cf,$p=''){
619 619
 
620
-    // check we have the post value
621
-    if(is_int($p)){$post = geodir_get_post_info($p);}
622
-    else{ global $post;}
623
-
624
-    if(!is_array($cf) && $cf!=''){
625
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
626
-        if(!$cf){return NULL;}
627
-    }
628
-
629
-    $html_var = $cf['htmlvar_name'];
630
-
631
-    // Check if there is a location specific filter.
632
-    if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
633
-        /**
634
-         * Filter the text html by location.
635
-         *
636
-         * @param string $html The html to filter.
637
-         * @param array $cf The custom field array.
638
-         * @since 1.6.6
639
-         */
640
-        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
641
-    }
642
-
643
-    // Check if there is a custom field specific filter.
644
-    if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
645
-        /**
646
-         * Filter the text html by individual custom field.
647
-         *
648
-         * @param string $html The html to filter.
649
-         * @param string $location The location to output the html.
650
-         * @param array $cf The custom field array.
651
-         * @since 1.6.6
652
-         */
653
-        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
654
-    }
655
-
656
-    // Check if there is a custom field key specific filter.
657
-    if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
658
-        /**
659
-         * Filter the text html by field type key.
660
-         *
661
-         * @param string $html The html to filter.
662
-         * @param string $location The location to output the html.
663
-         * @param array $cf The custom field array.
664
-         * @since 1.6.6
665
-         */
666
-        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
667
-    }
620
+	// check we have the post value
621
+	if(is_int($p)){$post = geodir_get_post_info($p);}
622
+	else{ global $post;}
623
+
624
+	if(!is_array($cf) && $cf!=''){
625
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
626
+		if(!$cf){return NULL;}
627
+	}
628
+
629
+	$html_var = $cf['htmlvar_name'];
630
+
631
+	// Check if there is a location specific filter.
632
+	if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
633
+		/**
634
+		 * Filter the text html by location.
635
+		 *
636
+		 * @param string $html The html to filter.
637
+		 * @param array $cf The custom field array.
638
+		 * @since 1.6.6
639
+		 */
640
+		$html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
641
+	}
642
+
643
+	// Check if there is a custom field specific filter.
644
+	if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
645
+		/**
646
+		 * Filter the text html by individual custom field.
647
+		 *
648
+		 * @param string $html The html to filter.
649
+		 * @param string $location The location to output the html.
650
+		 * @param array $cf The custom field array.
651
+		 * @since 1.6.6
652
+		 */
653
+		$html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
654
+	}
655
+
656
+	// Check if there is a custom field key specific filter.
657
+	if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
658
+		/**
659
+		 * Filter the text html by field type key.
660
+		 *
661
+		 * @param string $html The html to filter.
662
+		 * @param string $location The location to output the html.
663
+		 * @param array $cf The custom field array.
664
+		 * @since 1.6.6
665
+		 */
666
+		$html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
667
+	}
668 668
 
669 669
     
670 670
 
671
-    // If not html then we run the standard output.
672
-    if(empty($html)){
671
+	// If not html then we run the standard output.
672
+	if(empty($html)){
673 673
 
674
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
674
+		if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
675 675
 
676
-            $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
676
+			$class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
677 677
 
678
-            $field_icon = geodir_field_icon_proccess($cf);
679
-            if (strpos($field_icon, 'http') !== false) {
680
-                $field_icon_af = '';
681
-            } elseif ($field_icon == '') {
682
-                $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : "";
683
-            } else {
684
-                $field_icon_af = $field_icon;
685
-                $field_icon = '';
686
-            }
678
+			$field_icon = geodir_field_icon_proccess($cf);
679
+			if (strpos($field_icon, 'http') !== false) {
680
+				$field_icon_af = '';
681
+			} elseif ($field_icon == '') {
682
+				$field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : "";
683
+			} else {
684
+				$field_icon_af = $field_icon;
685
+				$field_icon = '';
686
+			}
687 687
 
688 688
 
689
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
690
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
691
-            $html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>';
689
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
690
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
691
+			$html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>';
692 692
 
693
-        endif;
693
+		endif;
694 694
 
695
-    }
695
+	}
696 696
 
697
-    return $html;
697
+	return $html;
698 698
 }
699 699
 add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3);
700 700
 
@@ -711,98 +711,98 @@  discard block
 block discarded – undo
711 711
  */
712 712
 function geodir_cf_radio($html,$location,$cf,$p=''){
713 713
 
714
-    // check we have the post value
715
-    if(is_int($p)){$post = geodir_get_post_info($p);}
716
-    else{ global $post;}
717
-
718
-    if(!is_array($cf) && $cf!=''){
719
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
720
-        if(!$cf){return NULL;}
721
-    }
722
-
723
-    $html_var = $cf['htmlvar_name'];
724
-
725
-    // Check if there is a location specific filter.
726
-    if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
727
-        /**
728
-         * Filter the radio html by location.
729
-         *
730
-         * @param string $html The html to filter.
731
-         * @param array $cf The custom field array.
732
-         * @since 1.6.6
733
-         */
734
-        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
735
-    }
736
-
737
-    // Check if there is a custom field specific filter.
738
-    if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
739
-        /**
740
-         * Filter the radio html by individual custom field.
741
-         *
742
-         * @param string $html The html to filter.
743
-         * @param string $location The location to output the html.
744
-         * @param array $cf The custom field array.
745
-         * @since 1.6.6
746
-         */
747
-        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
748
-    }
749
-
750
-    // Check if there is a custom field key specific filter.
751
-    if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
752
-        /**
753
-         * Filter the radio html by field type key.
754
-         *
755
-         * @param string $html The html to filter.
756
-         * @param string $location The location to output the html.
757
-         * @param array $cf The custom field array.
758
-         * @since 1.6.6
759
-         */
760
-        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
761
-    }
762
-
763
-    // If not html then we run the standard output.
764
-    if(empty($html)){
765
-
766
-        $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : '';
767
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
768
-
769
-            if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') {
770
-                $html_val = __('No', 'geodirectory');
771
-            } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') {
772
-                $html_val = __('Yes', 'geodirectory');
773
-            } else {
774
-                if (!empty($cf['option_values'])) {
775
-                    $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
776
-
777
-                    if (!empty($cf_option_values)) {
778
-                        foreach ($cf_option_values as $cf_option_value) {
779
-                            if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
780
-                                $html_val = $cf_option_value['label'];
781
-                            }
782
-                        }
783
-                    }
784
-                }
785
-            }
786
-
787
-            $field_icon = geodir_field_icon_proccess($cf);
788
-            if (strpos($field_icon, 'http') !== false) {
789
-                $field_icon_af = '';
790
-            } elseif ($field_icon == '') {
791
-                $field_icon_af = '';
792
-            } else {
793
-                $field_icon_af = $field_icon;
794
-                $field_icon = '';
795
-            }
796
-
797
-
798
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
799
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
800
-            $html .= '</span>' . $html_val . '</div>';
801
-        endif;
802
-
803
-    }
804
-
805
-    return $html;
714
+	// check we have the post value
715
+	if(is_int($p)){$post = geodir_get_post_info($p);}
716
+	else{ global $post;}
717
+
718
+	if(!is_array($cf) && $cf!=''){
719
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
720
+		if(!$cf){return NULL;}
721
+	}
722
+
723
+	$html_var = $cf['htmlvar_name'];
724
+
725
+	// Check if there is a location specific filter.
726
+	if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
727
+		/**
728
+		 * Filter the radio html by location.
729
+		 *
730
+		 * @param string $html The html to filter.
731
+		 * @param array $cf The custom field array.
732
+		 * @since 1.6.6
733
+		 */
734
+		$html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
735
+	}
736
+
737
+	// Check if there is a custom field specific filter.
738
+	if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
739
+		/**
740
+		 * Filter the radio html by individual custom field.
741
+		 *
742
+		 * @param string $html The html to filter.
743
+		 * @param string $location The location to output the html.
744
+		 * @param array $cf The custom field array.
745
+		 * @since 1.6.6
746
+		 */
747
+		$html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
748
+	}
749
+
750
+	// Check if there is a custom field key specific filter.
751
+	if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
752
+		/**
753
+		 * Filter the radio html by field type key.
754
+		 *
755
+		 * @param string $html The html to filter.
756
+		 * @param string $location The location to output the html.
757
+		 * @param array $cf The custom field array.
758
+		 * @since 1.6.6
759
+		 */
760
+		$html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
761
+	}
762
+
763
+	// If not html then we run the standard output.
764
+	if(empty($html)){
765
+
766
+		$html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : '';
767
+		if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
768
+
769
+			if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') {
770
+				$html_val = __('No', 'geodirectory');
771
+			} else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') {
772
+				$html_val = __('Yes', 'geodirectory');
773
+			} else {
774
+				if (!empty($cf['option_values'])) {
775
+					$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
776
+
777
+					if (!empty($cf_option_values)) {
778
+						foreach ($cf_option_values as $cf_option_value) {
779
+							if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
780
+								$html_val = $cf_option_value['label'];
781
+							}
782
+						}
783
+					}
784
+				}
785
+			}
786
+
787
+			$field_icon = geodir_field_icon_proccess($cf);
788
+			if (strpos($field_icon, 'http') !== false) {
789
+				$field_icon_af = '';
790
+			} elseif ($field_icon == '') {
791
+				$field_icon_af = '';
792
+			} else {
793
+				$field_icon_af = $field_icon;
794
+				$field_icon = '';
795
+			}
796
+
797
+
798
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
799
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
800
+			$html .= '</span>' . $html_val . '</div>';
801
+		endif;
802
+
803
+	}
804
+
805
+	return $html;
806 806
 }
807 807
 add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3);
808 808
 
@@ -819,92 +819,92 @@  discard block
 block discarded – undo
819 819
  */
820 820
 function geodir_cf_select($html,$location,$cf,$p=''){
821 821
 
822
-    // check we have the post value
823
-    if(is_int($p)){$post = geodir_get_post_info($p);}
824
-    else{ global $post;}
825
-
826
-    if(!is_array($cf) && $cf!=''){
827
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
828
-        if(!$cf){return NULL;}
829
-    }
830
-
831
-    $html_var = $cf['htmlvar_name'];
832
-
833
-    // Check if there is a location specific filter.
834
-    if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
835
-        /**
836
-         * Filter the select html by location.
837
-         *
838
-         * @param string $html The html to filter.
839
-         * @param array $cf The custom field array.
840
-         * @since 1.6.6
841
-         */
842
-        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
843
-    }
844
-
845
-    // Check if there is a custom field specific filter.
846
-    if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
847
-        /**
848
-         * Filter the select html by individual custom field.
849
-         *
850
-         * @param string $html The html to filter.
851
-         * @param string $location The location to output the html.
852
-         * @param array $cf The custom field array.
853
-         * @since 1.6.6
854
-         */
855
-        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
856
-    }
857
-
858
-    // Check if there is a custom field key specific filter.
859
-    if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
860
-        /**
861
-         * Filter the select html by field type key.
862
-         *
863
-         * @param string $html The html to filter.
864
-         * @param string $location The location to output the html.
865
-         * @param array $cf The custom field array.
866
-         * @since 1.6.6
867
-         */
868
-        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
869
-    }
870
-
871
-    // If not html then we run the standard output.
872
-    if(empty($html)){
873
-
874
-        if ($post->{$cf['htmlvar_name']}):
875
-            $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
876
-
877
-            if (!empty($cf['option_values'])) {
878
-                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
879
-
880
-                if (!empty($cf_option_values)) {
881
-                    foreach ($cf_option_values as $cf_option_value) {
882
-                        if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
883
-                            //$field_value = $cf_option_value['label']; // no longer needed here.
884
-                        }
885
-                    }
886
-                }
887
-            }
888
-
889
-            $field_icon = geodir_field_icon_proccess($cf);
890
-            if (strpos($field_icon, 'http') !== false) {
891
-                $field_icon_af = '';
892
-            } elseif ($field_icon == '') {
893
-                $field_icon_af = '';
894
-            } else {
895
-                $field_icon_af = $field_icon;
896
-                $field_icon = '';
897
-            }
898
-
899
-
900
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
901
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
902
-            $html .= '</span>' . $field_value . '</div>';
903
-        endif;
904
-
905
-    }
906
-
907
-    return $html;
822
+	// check we have the post value
823
+	if(is_int($p)){$post = geodir_get_post_info($p);}
824
+	else{ global $post;}
825
+
826
+	if(!is_array($cf) && $cf!=''){
827
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
828
+		if(!$cf){return NULL;}
829
+	}
830
+
831
+	$html_var = $cf['htmlvar_name'];
832
+
833
+	// Check if there is a location specific filter.
834
+	if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
835
+		/**
836
+		 * Filter the select html by location.
837
+		 *
838
+		 * @param string $html The html to filter.
839
+		 * @param array $cf The custom field array.
840
+		 * @since 1.6.6
841
+		 */
842
+		$html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
843
+	}
844
+
845
+	// Check if there is a custom field specific filter.
846
+	if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
847
+		/**
848
+		 * Filter the select html by individual custom field.
849
+		 *
850
+		 * @param string $html The html to filter.
851
+		 * @param string $location The location to output the html.
852
+		 * @param array $cf The custom field array.
853
+		 * @since 1.6.6
854
+		 */
855
+		$html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
856
+	}
857
+
858
+	// Check if there is a custom field key specific filter.
859
+	if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
860
+		/**
861
+		 * Filter the select html by field type key.
862
+		 *
863
+		 * @param string $html The html to filter.
864
+		 * @param string $location The location to output the html.
865
+		 * @param array $cf The custom field array.
866
+		 * @since 1.6.6
867
+		 */
868
+		$html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
869
+	}
870
+
871
+	// If not html then we run the standard output.
872
+	if(empty($html)){
873
+
874
+		if ($post->{$cf['htmlvar_name']}):
875
+			$field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
876
+
877
+			if (!empty($cf['option_values'])) {
878
+				$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
879
+
880
+				if (!empty($cf_option_values)) {
881
+					foreach ($cf_option_values as $cf_option_value) {
882
+						if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
883
+							//$field_value = $cf_option_value['label']; // no longer needed here.
884
+						}
885
+					}
886
+				}
887
+			}
888
+
889
+			$field_icon = geodir_field_icon_proccess($cf);
890
+			if (strpos($field_icon, 'http') !== false) {
891
+				$field_icon_af = '';
892
+			} elseif ($field_icon == '') {
893
+				$field_icon_af = '';
894
+			} else {
895
+				$field_icon_af = $field_icon;
896
+				$field_icon = '';
897
+			}
898
+
899
+
900
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
901
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
902
+			$html .= '</span>' . $field_value . '</div>';
903
+		endif;
904
+
905
+	}
906
+
907
+	return $html;
908 908
 }
909 909
 add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3);
910 910
 
@@ -921,117 +921,117 @@  discard block
 block discarded – undo
921 921
  */
922 922
 function geodir_cf_multiselect($html,$location,$cf,$p=''){
923 923
 
924
-    // check we have the post value
925
-    if(is_int($p)){$post = geodir_get_post_info($p);}
926
-    else{ global $post;}
927
-
928
-    if(!is_array($cf) && $cf!=''){
929
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
930
-        if(!$cf){return NULL;}
931
-    }
932
-
933
-    $html_var = $cf['htmlvar_name'];
934
-
935
-    // Check if there is a location specific filter.
936
-    if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
937
-        /**
938
-         * Filter the multiselect html by location.
939
-         *
940
-         * @param string $html The html to filter.
941
-         * @param array $cf The custom field array.
942
-         * @since 1.6.6
943
-         */
944
-        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
945
-    }
946
-
947
-    // Check if there is a custom field specific filter.
948
-    if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
949
-        /**
950
-         * Filter the multiselect html by individual custom field.
951
-         *
952
-         * @param string $html The html to filter.
953
-         * @param string $location The location to output the html.
954
-         * @param array $cf The custom field array.
955
-         * @since 1.6.6
956
-         */
957
-        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
958
-    }
959
-
960
-    // Check if there is a custom field key specific filter.
961
-    if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
962
-        /**
963
-         * Filter the multiselect html by field type key.
964
-         *
965
-         * @param string $html The html to filter.
966
-         * @param string $location The location to output the html.
967
-         * @param array $cf The custom field array.
968
-         * @since 1.6.6
969
-         */
970
-        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
971
-    }
972
-
973
-    // If not html then we run the standard output.
974
-    if(empty($html)){
975
-
976
-
977
-        if (!empty($post->{$cf['htmlvar_name']})):
978
-
979
-            if (is_array($post->{$cf['htmlvar_name']})) {
980
-                $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']});
981
-            }
982
-
983
-            $field_icon = geodir_field_icon_proccess($cf);
984
-            if (strpos($field_icon, 'http') !== false) {
985
-                $field_icon_af = '';
986
-            } elseif ($field_icon == '') {
987
-                $field_icon_af = '';
988
-            } else {
989
-                $field_icon_af = $field_icon;
990
-                $field_icon = '';
991
-            }
992
-
993
-            $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
994
-
995
-            if(is_array($field_values)){
996
-                $field_values = array_map('trim', $field_values);
997
-            }
998
-
999
-            $option_values = array();
1000
-            if (!empty($cf['option_values'])) {
1001
-                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
1002
-
1003
-                if (!empty($cf_option_values)) {
1004
-                    foreach ($cf_option_values as $cf_option_value) {
1005
-                        if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
1006
-                            $option_values[] = $cf_option_value['label'];
1007
-                        }
1008
-                    }
1009
-                }
1010
-            }
1011
-
1012
-
1013
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1014
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1015
-            $html .= '</span>';
1016
-
1017
-            if (count($option_values) > 1) {
1018
-                $html .= '<ul>';
1019
-
1020
-                foreach ($option_values as $val) {
1021
-                    $html .= '<li>' . $val . '</li>';
1022
-                }
1023
-
1024
-                $html .= '</ul>';
1025
-            } else {
1026
-                $html .= $post->{$cf['htmlvar_name']};
1027
-            }
1028
-
1029
-            $html .= '</div>';
1030
-        endif;
1031
-
1032
-    }
1033
-
1034
-    return $html;
924
+	// check we have the post value
925
+	if(is_int($p)){$post = geodir_get_post_info($p);}
926
+	else{ global $post;}
927
+
928
+	if(!is_array($cf) && $cf!=''){
929
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
930
+		if(!$cf){return NULL;}
931
+	}
932
+
933
+	$html_var = $cf['htmlvar_name'];
934
+
935
+	// Check if there is a location specific filter.
936
+	if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
937
+		/**
938
+		 * Filter the multiselect html by location.
939
+		 *
940
+		 * @param string $html The html to filter.
941
+		 * @param array $cf The custom field array.
942
+		 * @since 1.6.6
943
+		 */
944
+		$html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
945
+	}
946
+
947
+	// Check if there is a custom field specific filter.
948
+	if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
949
+		/**
950
+		 * Filter the multiselect html by individual custom field.
951
+		 *
952
+		 * @param string $html The html to filter.
953
+		 * @param string $location The location to output the html.
954
+		 * @param array $cf The custom field array.
955
+		 * @since 1.6.6
956
+		 */
957
+		$html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
958
+	}
959
+
960
+	// Check if there is a custom field key specific filter.
961
+	if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
962
+		/**
963
+		 * Filter the multiselect html by field type key.
964
+		 *
965
+		 * @param string $html The html to filter.
966
+		 * @param string $location The location to output the html.
967
+		 * @param array $cf The custom field array.
968
+		 * @since 1.6.6
969
+		 */
970
+		$html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
971
+	}
972
+
973
+	// If not html then we run the standard output.
974
+	if(empty($html)){
975
+
976
+
977
+		if (!empty($post->{$cf['htmlvar_name']})):
978
+
979
+			if (is_array($post->{$cf['htmlvar_name']})) {
980
+				$post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']});
981
+			}
982
+
983
+			$field_icon = geodir_field_icon_proccess($cf);
984
+			if (strpos($field_icon, 'http') !== false) {
985
+				$field_icon_af = '';
986
+			} elseif ($field_icon == '') {
987
+				$field_icon_af = '';
988
+			} else {
989
+				$field_icon_af = $field_icon;
990
+				$field_icon = '';
991
+			}
992
+
993
+			$field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
994
+
995
+			if(is_array($field_values)){
996
+				$field_values = array_map('trim', $field_values);
997
+			}
998
+
999
+			$option_values = array();
1000
+			if (!empty($cf['option_values'])) {
1001
+				$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
1002
+
1003
+				if (!empty($cf_option_values)) {
1004
+					foreach ($cf_option_values as $cf_option_value) {
1005
+						if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
1006
+							$option_values[] = $cf_option_value['label'];
1007
+						}
1008
+					}
1009
+				}
1010
+			}
1011
+
1012
+
1013
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1014
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1015
+			$html .= '</span>';
1016
+
1017
+			if (count($option_values) > 1) {
1018
+				$html .= '<ul>';
1019
+
1020
+				foreach ($option_values as $val) {
1021
+					$html .= '<li>' . $val . '</li>';
1022
+				}
1023
+
1024
+				$html .= '</ul>';
1025
+			} else {
1026
+				$html .= $post->{$cf['htmlvar_name']};
1027
+			}
1028
+
1029
+			$html .= '</div>';
1030
+		endif;
1031
+
1032
+	}
1033
+
1034
+	return $html;
1035 1035
 }
1036 1036
 add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3);
1037 1037
 
@@ -1048,152 +1048,152 @@  discard block
 block discarded – undo
1048 1048
  */
1049 1049
 function geodir_cf_email($html,$location,$cf,$p=''){
1050 1050
 
1051
-    // check we have the post value
1052
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1053
-    else{ global $post;}
1054
-
1055
-    if(!is_array($cf) && $cf!=''){
1056
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1057
-        if(!$cf){return NULL;}
1058
-    }
1059
-
1060
-    $html_var = $cf['htmlvar_name'];
1061
-
1062
-    // Check if there is a location specific filter.
1063
-    if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1064
-        /**
1065
-         * Filter the email html by location.
1066
-         *
1067
-         * @param string $html The html to filter.
1068
-         * @param array $cf The custom field array.
1069
-         * @since 1.6.6
1070
-         */
1071
-        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1072
-    }
1073
-
1074
-    // Check if there is a custom field specific filter.
1075
-    if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1076
-        /**
1077
-         * Filter the email html by individual custom field.
1078
-         *
1079
-         * @param string $html The html to filter.
1080
-         * @param string $location The location to output the html.
1081
-         * @param array $cf The custom field array.
1082
-         * @since 1.6.6
1083
-         */
1084
-        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1085
-    }
1086
-
1087
-    // Check if there is a custom field key specific filter.
1088
-    if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1089
-        /**
1090
-         * Filter the email html by field type key.
1091
-         *
1092
-         * @param string $html The html to filter.
1093
-         * @param string $location The location to output the html.
1094
-         * @param array $cf The custom field array.
1095
-         * @since 1.6.6
1096
-         */
1097
-        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1098
-    }
1099
-
1100
-    // If not html then we run the standard output.
1101
-    if(empty($html)){
1102
-
1103
-        global $preview;
1104
-        if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1105
-            return ''; // Remove Send Enquiry | Send To Friend from listings page
1106
-        }
1107
-
1108
-        $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1109
-
1110
-        if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) {
1111
-            $send_to_friend = true;
1112
-            $b_send_inquiry = '';
1113
-            $b_sendtofriend = '';
1114
-
1115
-            $html = '';
1116
-            if (!$preview) {
1117
-                $b_send_inquiry = 'b_send_inquiry';
1118
-                $b_sendtofriend = 'b_sendtofriend';
1119
-                $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1120
-            }
1121
-
1122
-            $field_icon = geodir_field_icon_proccess($cf);
1123
-            if (strpos($field_icon, 'http') !== false) {
1124
-                $field_icon_af = '';
1125
-            } elseif ($field_icon == '') {
1126
-                $field_icon_af = '<i class="fa fa-envelope"></i>';
1127
-            } else {
1128
-                $field_icon_af = $field_icon;
1129
-                $field_icon = '';
1130
-            }
1131
-
1132
-            $html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1133
-            $seperator = '';
1134
-            if ($post->{$cf['htmlvar_name']}) {
1135
-                $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1136
-                $seperator = ' | ';
1137
-            }
1138
-
1139
-            if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) {
1140
-                $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
1141
-            }
1142
-
1143
-            $html .= '</span></div>';
1144
-
1145
-
1146
-            if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1147
-                $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1148
-            } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
1149
-                $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
1150
-            } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1151
-                $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1152
-            }
1153
-
1154
-            /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
1155
-
1156
-        } else {
1157
-
1158
-            if ($post->{$cf['htmlvar_name']}) {
1159
-
1160
-                $field_icon = geodir_field_icon_proccess($cf);
1161
-                if (strpos($field_icon, 'http') !== false) {
1162
-                    $field_icon_af = '';
1163
-                } elseif ($field_icon == '') {
1164
-                    $field_icon_af = '<i class="fa fa-envelope"></i>';
1165
-                } else {
1166
-                    $field_icon_af = $field_icon;
1167
-                    $field_icon = '';
1168
-                }
1169
-
1170
-
1171
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1172
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1173
-                $html .= '</span><span class="geodir-email-address-output">';
1174
-                $email = $post->{$cf['htmlvar_name']} ;
1175
-                if($e_split = explode('@',$email)){
1176
-                    /**
1177
-                     * Filter email custom field name output.
1178
-                     *
1179
-                     * @since 1.5.3
1180
-                     *
1181
-                     * @param string $email The email string being output.
1182
-                     * @param array $cf Custom field variables array.
1183
-                     */
1184
-                    $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1185
-                    $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1186
-                }else{
1187
-                    $html .=  $email;
1188
-                }
1189
-                $html .= '</span></div>';
1190
-            }
1191
-
1192
-        }
1193
-
1194
-    }
1195
-
1196
-    return $html;
1051
+	// check we have the post value
1052
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1053
+	else{ global $post;}
1054
+
1055
+	if(!is_array($cf) && $cf!=''){
1056
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1057
+		if(!$cf){return NULL;}
1058
+	}
1059
+
1060
+	$html_var = $cf['htmlvar_name'];
1061
+
1062
+	// Check if there is a location specific filter.
1063
+	if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1064
+		/**
1065
+		 * Filter the email html by location.
1066
+		 *
1067
+		 * @param string $html The html to filter.
1068
+		 * @param array $cf The custom field array.
1069
+		 * @since 1.6.6
1070
+		 */
1071
+		$html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1072
+	}
1073
+
1074
+	// Check if there is a custom field specific filter.
1075
+	if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1076
+		/**
1077
+		 * Filter the email html by individual custom field.
1078
+		 *
1079
+		 * @param string $html The html to filter.
1080
+		 * @param string $location The location to output the html.
1081
+		 * @param array $cf The custom field array.
1082
+		 * @since 1.6.6
1083
+		 */
1084
+		$html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1085
+	}
1086
+
1087
+	// Check if there is a custom field key specific filter.
1088
+	if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1089
+		/**
1090
+		 * Filter the email html by field type key.
1091
+		 *
1092
+		 * @param string $html The html to filter.
1093
+		 * @param string $location The location to output the html.
1094
+		 * @param array $cf The custom field array.
1095
+		 * @since 1.6.6
1096
+		 */
1097
+		$html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1098
+	}
1099
+
1100
+	// If not html then we run the standard output.
1101
+	if(empty($html)){
1102
+
1103
+		global $preview;
1104
+		if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1105
+			return ''; // Remove Send Enquiry | Send To Friend from listings page
1106
+		}
1107
+
1108
+		$package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1109
+
1110
+		if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) {
1111
+			$send_to_friend = true;
1112
+			$b_send_inquiry = '';
1113
+			$b_sendtofriend = '';
1114
+
1115
+			$html = '';
1116
+			if (!$preview) {
1117
+				$b_send_inquiry = 'b_send_inquiry';
1118
+				$b_sendtofriend = 'b_sendtofriend';
1119
+				$html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1120
+			}
1121
+
1122
+			$field_icon = geodir_field_icon_proccess($cf);
1123
+			if (strpos($field_icon, 'http') !== false) {
1124
+				$field_icon_af = '';
1125
+			} elseif ($field_icon == '') {
1126
+				$field_icon_af = '<i class="fa fa-envelope"></i>';
1127
+			} else {
1128
+				$field_icon_af = $field_icon;
1129
+				$field_icon = '';
1130
+			}
1131
+
1132
+			$html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1133
+			$seperator = '';
1134
+			if ($post->{$cf['htmlvar_name']}) {
1135
+				$html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1136
+				$seperator = ' | ';
1137
+			}
1138
+
1139
+			if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) {
1140
+				$html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
1141
+			}
1142
+
1143
+			$html .= '</span></div>';
1144
+
1145
+
1146
+			if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1147
+				$html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1148
+			} elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
1149
+				$html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
1150
+			} elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1151
+				$html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1152
+			}
1153
+
1154
+			/*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
1155
+
1156
+		} else {
1157
+
1158
+			if ($post->{$cf['htmlvar_name']}) {
1159
+
1160
+				$field_icon = geodir_field_icon_proccess($cf);
1161
+				if (strpos($field_icon, 'http') !== false) {
1162
+					$field_icon_af = '';
1163
+				} elseif ($field_icon == '') {
1164
+					$field_icon_af = '<i class="fa fa-envelope"></i>';
1165
+				} else {
1166
+					$field_icon_af = $field_icon;
1167
+					$field_icon = '';
1168
+				}
1169
+
1170
+
1171
+				$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1172
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1173
+				$html .= '</span><span class="geodir-email-address-output">';
1174
+				$email = $post->{$cf['htmlvar_name']} ;
1175
+				if($e_split = explode('@',$email)){
1176
+					/**
1177
+					 * Filter email custom field name output.
1178
+					 *
1179
+					 * @since 1.5.3
1180
+					 *
1181
+					 * @param string $email The email string being output.
1182
+					 * @param array $cf Custom field variables array.
1183
+					 */
1184
+					$email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1185
+					$html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1186
+				}else{
1187
+					$html .=  $email;
1188
+				}
1189
+				$html .= '</span></div>';
1190
+			}
1191
+
1192
+		}
1193
+
1194
+	}
1195
+
1196
+	return $html;
1197 1197
 }
1198 1198
 add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3);
1199 1199
 
@@ -1210,130 +1210,130 @@  discard block
 block discarded – undo
1210 1210
  */
1211 1211
 function geodir_cf_file($html,$location,$cf,$p=''){
1212 1212
 
1213
-    // check we have the post value
1214
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1215
-    else{ global $post;}
1216
-
1217
-    if(!is_array($cf) && $cf!=''){
1218
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1219
-        if(!$cf){return NULL;}
1220
-    }
1221
-
1222
-    $html_var = $cf['htmlvar_name'];
1223
-
1224
-    // Check if there is a location specific filter.
1225
-    if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1226
-        /**
1227
-         * Filter the file html by location.
1228
-         *
1229
-         * @param string $html The html to filter.
1230
-         * @param array $cf The custom field array.
1231
-         * @since 1.6.6
1232
-         */
1233
-        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1234
-    }
1235
-
1236
-    // Check if there is a custom field specific filter.
1237
-    if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1238
-        /**
1239
-         * Filter the file html by individual custom field.
1240
-         *
1241
-         * @param string $html The html to filter.
1242
-         * @param string $location The location to output the html.
1243
-         * @param array $cf The custom field array.
1244
-         * @since 1.6.6
1245
-         */
1246
-        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1247
-    }
1248
-
1249
-    // Check if there is a custom field key specific filter.
1250
-    if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1251
-        /**
1252
-         * Filter the file html by field type key.
1253
-         *
1254
-         * @param string $html The html to filter.
1255
-         * @param string $location The location to output the html.
1256
-         * @param array $cf The custom field array.
1257
-         * @since 1.6.6
1258
-         */
1259
-        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1260
-    }
1261
-
1262
-    // If not html then we run the standard output.
1263
-    if(empty($html)){
1264
-
1265
-        if (!empty($post->{$cf['htmlvar_name']})):
1266
-
1267
-            $files = explode(",", $post->{$cf['htmlvar_name']});
1268
-            if (!empty($files)):
1269
-
1270
-                $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL;
1271
-                $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
1272
-
1273
-                $file_paths = '';
1274
-                foreach ($files as $file) {
1275
-                    if (!empty($file)) {
1276
-
1277
-                        // $filetype = wp_check_filetype($file);
1278
-
1279
-                        $image_name_arr = explode('/', $file);
1280
-                        $curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1281
-                        $filename = end($image_name_arr);
1282
-                        $img_name_arr = explode('.', $filename);
1283
-
1284
-                        $arr_file_type = wp_check_filetype($filename);
1285
-                        if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1286
-                            continue;
1287
-                        }
1288
-
1289
-                        $uploaded_file_type = $arr_file_type['type'];
1290
-                        $uploaded_file_ext = $arr_file_type['ext'];
1291
-
1292
-                        if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1293
-                            continue; // Invalid file type.
1294
-                        }
1295
-
1296
-                        //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1297
-                        $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
1298
-
1299
-                        // If the uploaded file is image
1300
-                        if (in_array($uploaded_file_type, $image_file_types)) {
1301
-                            $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
1302
-                            $file_paths .= '<a href="'.$file.'">';
1303
-                            $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
1304
-                            $file_paths .= '</a>';
1305
-                            //$file_paths .= '<img src="'.$file.'"  />';	
1306
-                            $file_paths .= '</div>';
1307
-                        } else {
1308
-                            $ext_path = '_' . $html_var . '_';
1309
-                            $filename = explode($ext_path, $filename);
1310
-                            $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1311
-                        }
1312
-                    }
1313
-                }
1314
-
1315
-                $field_icon = geodir_field_icon_proccess($cf);
1316
-                if (strpos($field_icon, 'http') !== false) {
1317
-                    $field_icon_af = '';
1318
-                } elseif ($field_icon == '') {
1319
-                    $field_icon_af = '';
1320
-                } else {
1321
-                    $field_icon_af = $field_icon;
1322
-                    $field_icon = '';
1323
-                }
1324
-
1325
-                $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1326
-                $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1327
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1328
-                $html .= '</span>';
1329
-                $html .= $file_paths . '</div></div>';
1330
-
1331
-            endif;
1332
-        endif;
1333
-
1334
-    }
1335
-
1336
-    return $html;
1213
+	// check we have the post value
1214
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1215
+	else{ global $post;}
1216
+
1217
+	if(!is_array($cf) && $cf!=''){
1218
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1219
+		if(!$cf){return NULL;}
1220
+	}
1221
+
1222
+	$html_var = $cf['htmlvar_name'];
1223
+
1224
+	// Check if there is a location specific filter.
1225
+	if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1226
+		/**
1227
+		 * Filter the file html by location.
1228
+		 *
1229
+		 * @param string $html The html to filter.
1230
+		 * @param array $cf The custom field array.
1231
+		 * @since 1.6.6
1232
+		 */
1233
+		$html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1234
+	}
1235
+
1236
+	// Check if there is a custom field specific filter.
1237
+	if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1238
+		/**
1239
+		 * Filter the file html by individual custom field.
1240
+		 *
1241
+		 * @param string $html The html to filter.
1242
+		 * @param string $location The location to output the html.
1243
+		 * @param array $cf The custom field array.
1244
+		 * @since 1.6.6
1245
+		 */
1246
+		$html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1247
+	}
1248
+
1249
+	// Check if there is a custom field key specific filter.
1250
+	if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1251
+		/**
1252
+		 * Filter the file html by field type key.
1253
+		 *
1254
+		 * @param string $html The html to filter.
1255
+		 * @param string $location The location to output the html.
1256
+		 * @param array $cf The custom field array.
1257
+		 * @since 1.6.6
1258
+		 */
1259
+		$html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1260
+	}
1261
+
1262
+	// If not html then we run the standard output.
1263
+	if(empty($html)){
1264
+
1265
+		if (!empty($post->{$cf['htmlvar_name']})):
1266
+
1267
+			$files = explode(",", $post->{$cf['htmlvar_name']});
1268
+			if (!empty($files)):
1269
+
1270
+				$extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL;
1271
+				$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
1272
+
1273
+				$file_paths = '';
1274
+				foreach ($files as $file) {
1275
+					if (!empty($file)) {
1276
+
1277
+						// $filetype = wp_check_filetype($file);
1278
+
1279
+						$image_name_arr = explode('/', $file);
1280
+						$curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1281
+						$filename = end($image_name_arr);
1282
+						$img_name_arr = explode('.', $filename);
1283
+
1284
+						$arr_file_type = wp_check_filetype($filename);
1285
+						if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1286
+							continue;
1287
+						}
1288
+
1289
+						$uploaded_file_type = $arr_file_type['type'];
1290
+						$uploaded_file_ext = $arr_file_type['ext'];
1291
+
1292
+						if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1293
+							continue; // Invalid file type.
1294
+						}
1295
+
1296
+						//$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1297
+						$image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
1298
+
1299
+						// If the uploaded file is image
1300
+						if (in_array($uploaded_file_type, $image_file_types)) {
1301
+							$file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
1302
+							$file_paths .= '<a href="'.$file.'">';
1303
+							$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
1304
+							$file_paths .= '</a>';
1305
+							//$file_paths .= '<img src="'.$file.'"  />';	
1306
+							$file_paths .= '</div>';
1307
+						} else {
1308
+							$ext_path = '_' . $html_var . '_';
1309
+							$filename = explode($ext_path, $filename);
1310
+							$file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1311
+						}
1312
+					}
1313
+				}
1314
+
1315
+				$field_icon = geodir_field_icon_proccess($cf);
1316
+				if (strpos($field_icon, 'http') !== false) {
1317
+					$field_icon_af = '';
1318
+				} elseif ($field_icon == '') {
1319
+					$field_icon_af = '';
1320
+				} else {
1321
+					$field_icon_af = $field_icon;
1322
+					$field_icon = '';
1323
+				}
1324
+
1325
+				$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1326
+				$html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1327
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1328
+				$html .= '</span>';
1329
+				$html .= $file_paths . '</div></div>';
1330
+
1331
+			endif;
1332
+		endif;
1333
+
1334
+	}
1335
+
1336
+	return $html;
1337 1337
 }
1338 1338
 add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3);
1339 1339
 
@@ -1351,80 +1351,80 @@  discard block
 block discarded – undo
1351 1351
  */
1352 1352
 function geodir_cf_textarea($html,$location,$cf,$p=''){
1353 1353
 
1354
-    // check we have the post value
1355
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1356
-    else{ global $post;}
1357
-
1358
-    if(!is_array($cf) && $cf!=''){
1359
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1360
-        if(!$cf){return NULL;}
1361
-    }
1362
-
1363
-    $html_var = $cf['htmlvar_name'];
1364
-
1365
-    // Check if there is a location specific filter.
1366
-    if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1367
-        /**
1368
-         * Filter the textarea html by location.
1369
-         *
1370
-         * @param string $html The html to filter.
1371
-         * @param array $cf The custom field array.
1372
-         * @since 1.6.6
1373
-         */
1374
-        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1375
-    }
1376
-
1377
-    // Check if there is a custom field specific filter.
1378
-    if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1379
-        /**
1380
-         * Filter the textarea html by individual custom field.
1381
-         *
1382
-         * @param string $html The html to filter.
1383
-         * @param string $location The location to output the html.
1384
-         * @param array $cf The custom field array.
1385
-         * @since 1.6.6
1386
-         */
1387
-        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1388
-    }
1389
-
1390
-    // Check if there is a custom field key specific filter.
1391
-    if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1392
-        /**
1393
-         * Filter the textarea html by field type key.
1394
-         *
1395
-         * @param string $html The html to filter.
1396
-         * @param string $location The location to output the html.
1397
-         * @param array $cf The custom field array.
1398
-         * @since 1.6.6
1399
-         */
1400
-        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1401
-    }
1402
-
1403
-    // If not html then we run the standard output.
1404
-    if(empty($html)){
1405
-
1406
-        if (!empty($post->{$cf['htmlvar_name']})) {
1407
-
1408
-            $field_icon = geodir_field_icon_proccess($cf);
1409
-            if (strpos($field_icon, 'http') !== false) {
1410
-                $field_icon_af = '';
1411
-            } elseif ($field_icon == '') {
1412
-                $field_icon_af = '';
1413
-            } else {
1414
-                $field_icon_af = $field_icon;
1415
-                $field_icon = '';
1416
-            }
1417
-
1418
-
1419
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1420
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1421
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1422
-
1423
-        }
1424
-
1425
-    }
1426
-
1427
-    return $html;
1354
+	// check we have the post value
1355
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1356
+	else{ global $post;}
1357
+
1358
+	if(!is_array($cf) && $cf!=''){
1359
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1360
+		if(!$cf){return NULL;}
1361
+	}
1362
+
1363
+	$html_var = $cf['htmlvar_name'];
1364
+
1365
+	// Check if there is a location specific filter.
1366
+	if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1367
+		/**
1368
+		 * Filter the textarea html by location.
1369
+		 *
1370
+		 * @param string $html The html to filter.
1371
+		 * @param array $cf The custom field array.
1372
+		 * @since 1.6.6
1373
+		 */
1374
+		$html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1375
+	}
1376
+
1377
+	// Check if there is a custom field specific filter.
1378
+	if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1379
+		/**
1380
+		 * Filter the textarea html by individual custom field.
1381
+		 *
1382
+		 * @param string $html The html to filter.
1383
+		 * @param string $location The location to output the html.
1384
+		 * @param array $cf The custom field array.
1385
+		 * @since 1.6.6
1386
+		 */
1387
+		$html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1388
+	}
1389
+
1390
+	// Check if there is a custom field key specific filter.
1391
+	if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1392
+		/**
1393
+		 * Filter the textarea html by field type key.
1394
+		 *
1395
+		 * @param string $html The html to filter.
1396
+		 * @param string $location The location to output the html.
1397
+		 * @param array $cf The custom field array.
1398
+		 * @since 1.6.6
1399
+		 */
1400
+		$html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1401
+	}
1402
+
1403
+	// If not html then we run the standard output.
1404
+	if(empty($html)){
1405
+
1406
+		if (!empty($post->{$cf['htmlvar_name']})) {
1407
+
1408
+			$field_icon = geodir_field_icon_proccess($cf);
1409
+			if (strpos($field_icon, 'http') !== false) {
1410
+				$field_icon_af = '';
1411
+			} elseif ($field_icon == '') {
1412
+				$field_icon_af = '';
1413
+			} else {
1414
+				$field_icon_af = $field_icon;
1415
+				$field_icon = '';
1416
+			}
1417
+
1418
+
1419
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1420
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1421
+			$html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1422
+
1423
+		}
1424
+
1425
+	}
1426
+
1427
+	return $html;
1428 1428
 }
1429 1429
 add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3);
1430 1430
 
@@ -1442,79 +1442,79 @@  discard block
 block discarded – undo
1442 1442
  */
1443 1443
 function geodir_cf_html($html,$location,$cf,$p=''){
1444 1444
 
1445
-    // check we have the post value
1446
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1447
-    else{ global $post;}
1448
-
1449
-    if(!is_array($cf) && $cf!=''){
1450
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1451
-        if(!$cf){return NULL;}
1452
-    }
1453
-
1454
-    $html_var = $cf['htmlvar_name'];
1455
-
1456
-    // Check if there is a location specific filter.
1457
-    if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1458
-        /**
1459
-         * Filter the html html by location.
1460
-         *
1461
-         * @param string $html The html to filter.
1462
-         * @param array $cf The custom field array.
1463
-         * @since 1.6.6
1464
-         */
1465
-        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1466
-    }
1467
-
1468
-    // Check if there is a custom field specific filter.
1469
-    if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1470
-        /**
1471
-         * Filter the html html by individual custom field.
1472
-         *
1473
-         * @param string $html The html to filter.
1474
-         * @param string $location The location to output the html.
1475
-         * @param array $cf The custom field array.
1476
-         * @since 1.6.6
1477
-         */
1478
-        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1479
-    }
1480
-
1481
-    // Check if there is a custom field key specific filter.
1482
-    if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1483
-        /**
1484
-         * Filter the html html by field type key.
1485
-         *
1486
-         * @param string $html The html to filter.
1487
-         * @param string $location The location to output the html.
1488
-         * @param array $cf The custom field array.
1489
-         * @since 1.6.6
1490
-         */
1491
-        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1492
-    }
1493
-
1494
-    // If not html then we run the standard output.
1495
-    if(empty($html)){
1496
-
1497
-        if (!empty($post->{$cf['htmlvar_name']})) {
1498
-
1499
-            $field_icon = geodir_field_icon_proccess($cf);
1500
-            if (strpos($field_icon, 'http') !== false) {
1501
-                $field_icon_af = '';
1502
-            } elseif ($field_icon == '') {
1503
-                $field_icon_af = '';
1504
-            } else {
1505
-                $field_icon_af = $field_icon;
1506
-                $field_icon = '';
1507
-            }
1508
-
1509
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1510
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1511
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1512
-
1513
-        }
1514
-
1515
-    }
1516
-
1517
-    return $html;
1445
+	// check we have the post value
1446
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1447
+	else{ global $post;}
1448
+
1449
+	if(!is_array($cf) && $cf!=''){
1450
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1451
+		if(!$cf){return NULL;}
1452
+	}
1453
+
1454
+	$html_var = $cf['htmlvar_name'];
1455
+
1456
+	// Check if there is a location specific filter.
1457
+	if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1458
+		/**
1459
+		 * Filter the html html by location.
1460
+		 *
1461
+		 * @param string $html The html to filter.
1462
+		 * @param array $cf The custom field array.
1463
+		 * @since 1.6.6
1464
+		 */
1465
+		$html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1466
+	}
1467
+
1468
+	// Check if there is a custom field specific filter.
1469
+	if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1470
+		/**
1471
+		 * Filter the html html by individual custom field.
1472
+		 *
1473
+		 * @param string $html The html to filter.
1474
+		 * @param string $location The location to output the html.
1475
+		 * @param array $cf The custom field array.
1476
+		 * @since 1.6.6
1477
+		 */
1478
+		$html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1479
+	}
1480
+
1481
+	// Check if there is a custom field key specific filter.
1482
+	if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1483
+		/**
1484
+		 * Filter the html html by field type key.
1485
+		 *
1486
+		 * @param string $html The html to filter.
1487
+		 * @param string $location The location to output the html.
1488
+		 * @param array $cf The custom field array.
1489
+		 * @since 1.6.6
1490
+		 */
1491
+		$html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1492
+	}
1493
+
1494
+	// If not html then we run the standard output.
1495
+	if(empty($html)){
1496
+
1497
+		if (!empty($post->{$cf['htmlvar_name']})) {
1498
+
1499
+			$field_icon = geodir_field_icon_proccess($cf);
1500
+			if (strpos($field_icon, 'http') !== false) {
1501
+				$field_icon_af = '';
1502
+			} elseif ($field_icon == '') {
1503
+				$field_icon_af = '';
1504
+			} else {
1505
+				$field_icon_af = $field_icon;
1506
+				$field_icon = '';
1507
+			}
1508
+
1509
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1510
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1511
+			$html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1512
+
1513
+		}
1514
+
1515
+	}
1516
+
1517
+	return $html;
1518 1518
 }
1519 1519
 add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3);
1520 1520
 
@@ -1532,113 +1532,113 @@  discard block
 block discarded – undo
1532 1532
  */
1533 1533
 function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1534 1534
 
1535
-    // check we have the post value
1536
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1537
-    else{ global $post;}
1538
-
1539
-    if(!is_array($cf) && $cf!=''){
1540
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1541
-        if(!$cf){return NULL;}
1542
-    }
1543
-
1544
-    $html_var = $cf['htmlvar_name'];
1545
-
1546
-    // Check if there is a location specific filter.
1547
-    if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1548
-        /**
1549
-         * Filter the taxonomy html by location.
1550
-         *
1551
-         * @param string $html The html to filter.
1552
-         * @param array $cf The custom field array.
1553
-         * @since 1.6.6
1554
-         */
1555
-        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1556
-    }
1557
-
1558
-    // Check if there is a custom field specific filter.
1559
-    if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1560
-        /**
1561
-         * Filter the taxonomy html by individual custom field.
1562
-         *
1563
-         * @param string $html The html to filter.
1564
-         * @param string $location The location to output the html.
1565
-         * @param array $cf The custom field array.
1566
-         * @since 1.6.6
1567
-         */
1568
-        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1569
-    }
1570
-
1571
-    // Check if there is a custom field key specific filter.
1572
-    if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1573
-        /**
1574
-         * Filter the taxonomy html by field type key.
1575
-         *
1576
-         * @param string $html The html to filter.
1577
-         * @param string $location The location to output the html.
1578
-         * @param array $cf The custom field array.
1579
-         * @since 1.6.6
1580
-         */
1581
-        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1582
-    }
1583
-
1584
-    // If not html then we run the standard output.
1585
-    if(empty($html)){
1586
-
1587
-        if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1588
-            $post_taxonomy = $post->post_type . 'category';
1589
-            $field_value = $post->{$html_var};
1590
-            $links = array();
1591
-            $terms = array();
1592
-            $termsOrdered = array();
1593
-            if (!is_array($field_value)) {
1594
-                $field_value = explode(",", trim($field_value, ","));
1595
-            }
1596
-
1597
-            $field_value = array_unique($field_value);
1598
-
1599
-            if (!empty($field_value)) {
1600
-                foreach ($field_value as $term) {
1601
-                    $term = trim($term);
1602
-
1603
-                    if ($term != '') {
1604
-                        $term = get_term_by('id', $term, $html_var);
1605
-                        if (is_object($term)) {
1606
-                            $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1607
-                            $terms[] = $term;
1608
-                        }
1609
-                    }
1610
-                }
1611
-                if (!empty($links)) {
1612
-                    // order alphabetically
1613
-                    asort($links);
1614
-                    foreach (array_keys($links) as $key) {
1615
-                        $termsOrdered[$key] = $terms[$key];
1616
-                    }
1617
-                    $terms = $termsOrdered;
1618
-                }
1619
-            }
1620
-            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1621
-
1622
-            if ($html_value != '') {
1623
-                $field_icon = geodir_field_icon_proccess($cf);
1624
-                if (strpos($field_icon, 'http') !== false) {
1625
-                    $field_icon_af = '';
1626
-                } else if ($field_icon == '') {
1627
-                    $field_icon_af = '';
1628
-                } else {
1629
-                    $field_icon_af = $field_icon;
1630
-                    $field_icon = '';
1631
-                }
1632
-
1633
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1634
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1635
-                $html .= '</span> ' . $html_value . '</div>';
1636
-            }
1637
-        }
1638
-
1639
-    }
1640
-
1641
-    return $html;
1535
+	// check we have the post value
1536
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1537
+	else{ global $post;}
1538
+
1539
+	if(!is_array($cf) && $cf!=''){
1540
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1541
+		if(!$cf){return NULL;}
1542
+	}
1543
+
1544
+	$html_var = $cf['htmlvar_name'];
1545
+
1546
+	// Check if there is a location specific filter.
1547
+	if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1548
+		/**
1549
+		 * Filter the taxonomy html by location.
1550
+		 *
1551
+		 * @param string $html The html to filter.
1552
+		 * @param array $cf The custom field array.
1553
+		 * @since 1.6.6
1554
+		 */
1555
+		$html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1556
+	}
1557
+
1558
+	// Check if there is a custom field specific filter.
1559
+	if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1560
+		/**
1561
+		 * Filter the taxonomy html by individual custom field.
1562
+		 *
1563
+		 * @param string $html The html to filter.
1564
+		 * @param string $location The location to output the html.
1565
+		 * @param array $cf The custom field array.
1566
+		 * @since 1.6.6
1567
+		 */
1568
+		$html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1569
+	}
1570
+
1571
+	// Check if there is a custom field key specific filter.
1572
+	if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1573
+		/**
1574
+		 * Filter the taxonomy html by field type key.
1575
+		 *
1576
+		 * @param string $html The html to filter.
1577
+		 * @param string $location The location to output the html.
1578
+		 * @param array $cf The custom field array.
1579
+		 * @since 1.6.6
1580
+		 */
1581
+		$html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1582
+	}
1583
+
1584
+	// If not html then we run the standard output.
1585
+	if(empty($html)){
1586
+
1587
+		if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1588
+			$post_taxonomy = $post->post_type . 'category';
1589
+			$field_value = $post->{$html_var};
1590
+			$links = array();
1591
+			$terms = array();
1592
+			$termsOrdered = array();
1593
+			if (!is_array($field_value)) {
1594
+				$field_value = explode(",", trim($field_value, ","));
1595
+			}
1596
+
1597
+			$field_value = array_unique($field_value);
1598
+
1599
+			if (!empty($field_value)) {
1600
+				foreach ($field_value as $term) {
1601
+					$term = trim($term);
1602
+
1603
+					if ($term != '') {
1604
+						$term = get_term_by('id', $term, $html_var);
1605
+						if (is_object($term)) {
1606
+							$links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1607
+							$terms[] = $term;
1608
+						}
1609
+					}
1610
+				}
1611
+				if (!empty($links)) {
1612
+					// order alphabetically
1613
+					asort($links);
1614
+					foreach (array_keys($links) as $key) {
1615
+						$termsOrdered[$key] = $terms[$key];
1616
+					}
1617
+					$terms = $termsOrdered;
1618
+				}
1619
+			}
1620
+			$html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1621
+
1622
+			if ($html_value != '') {
1623
+				$field_icon = geodir_field_icon_proccess($cf);
1624
+				if (strpos($field_icon, 'http') !== false) {
1625
+					$field_icon_af = '';
1626
+				} else if ($field_icon == '') {
1627
+					$field_icon_af = '';
1628
+				} else {
1629
+					$field_icon_af = $field_icon;
1630
+					$field_icon = '';
1631
+				}
1632
+
1633
+				$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1634
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1635
+				$html .= '</span> ' . $html_value . '</div>';
1636
+			}
1637
+		}
1638
+
1639
+	}
1640
+
1641
+	return $html;
1642 1642
 }
1643 1643
 add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3);
1644 1644
 
@@ -1655,162 +1655,162 @@  discard block
 block discarded – undo
1655 1655
  */
1656 1656
 function geodir_cf_address($html,$location,$cf,$p=''){
1657 1657
 
1658
-    // check we have the post value
1659
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1660
-    else{ global $post;}
1661
-
1662
-    if(!is_array($cf) && $cf!=''){
1663
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1664
-        if(!$cf){return NULL;}
1665
-    }
1666
-
1667
-    $html_var = $cf['htmlvar_name'];
1668
-
1669
-    // Check if there is a location specific filter.
1670
-    if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1671
-        /**
1672
-         * Filter the address html by location.
1673
-         *
1674
-         * @param string $html The html to filter.
1675
-         * @param array $cf The custom field array.
1676
-         * @since 1.6.6
1677
-         */
1678
-        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1679
-    }
1680
-
1681
-    // Check if there is a custom field specific filter.
1682
-    if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1683
-        /**
1684
-         * Filter the address html by individual custom field.
1685
-         *
1686
-         * @param string $html The html to filter.
1687
-         * @param string $location The location to output the html.
1688
-         * @param array $cf The custom field array.
1689
-         * @since 1.6.6
1690
-         */
1691
-        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1692
-    }
1693
-
1694
-    // Check if there is a custom field key specific filter.
1695
-    if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1696
-        /**
1697
-         * Filter the address html by field type key.
1698
-         *
1699
-         * @param string $html The html to filter.
1700
-         * @param string $location The location to output the html.
1701
-         * @param array $cf The custom field array.
1702
-         * @since 1.6.6
1703
-         */
1704
-        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1705
-    }
1706
-
1707
-    // If not html then we run the standard output.
1708
-    if(empty($html)){
1709
-
1710
-        global $preview;
1711
-        $html_var = $cf['htmlvar_name'] . '_address';
1712
-
1713
-        if ($cf['extra_fields']) {
1714
-
1715
-            $extra_fields = unserialize($cf['extra_fields']);
1716
-
1717
-            $addition_fields = '';
1718
-
1719
-            if (!empty($extra_fields)) {
1720
-
1721
-                $show_city_in_address = false;
1722
-                if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
1723
-                    $show_city_in_address = true;
1724
-                }
1725
-                /**
1726
-                 * Filter "show city in address" value.
1727
-                 *
1728
-                 * @since 1.0.0
1729
-                 */
1730
-                $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address);
1731
-
1732
-
1733
-                $show_region_in_address = false;
1734
-                if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
1735
-                    $show_region_in_address = true;
1736
-                }
1737
-                /**
1738
-                 * Filter "show region in address" value.
1739
-                 *
1740
-                 * @since 1.6.6
1741
-                 */
1742
-                $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address);
1743
-
1744
-                $show_country_in_address = false;
1745
-                if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
1746
-                    $show_country_in_address = true;
1747
-                }
1748
-                /**
1749
-                 * Filter "show country in address" value.
1750
-                 *
1751
-                 * @since 1.6.6
1752
-                 */
1753
-                $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address);
1754
-
1755
-                $show_zip_in_address = false;
1756
-                if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
1757
-                    $show_zip_in_address = true;
1758
-                }
1759
-                /**
1760
-                 * Filter "show zip in address" value.
1761
-                 *
1762
-                 * @since 1.6.6
1763
-                 */
1764
-                $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address);
1765
-
1766
-
1767
-            }
1768
-
1769
-        }
1770
-
1771
-
1772
-        if ($post->{$html_var}) {
1773
-
1774
-            $field_icon = geodir_field_icon_proccess( $cf );
1775
-            if ( strpos( $field_icon, 'http' ) !== false ) {
1776
-                $field_icon_af = '';
1777
-            } elseif ( $field_icon == '' ) {
1778
-                $field_icon_af = '<i class="fa fa-home"></i>';
1779
-            } else {
1780
-                $field_icon_af = $field_icon;
1781
-                $field_icon    = '';
1782
-            }
1658
+	// check we have the post value
1659
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1660
+	else{ global $post;}
1661
+
1662
+	if(!is_array($cf) && $cf!=''){
1663
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1664
+		if(!$cf){return NULL;}
1665
+	}
1666
+
1667
+	$html_var = $cf['htmlvar_name'];
1668
+
1669
+	// Check if there is a location specific filter.
1670
+	if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1671
+		/**
1672
+		 * Filter the address html by location.
1673
+		 *
1674
+		 * @param string $html The html to filter.
1675
+		 * @param array $cf The custom field array.
1676
+		 * @since 1.6.6
1677
+		 */
1678
+		$html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1679
+	}
1680
+
1681
+	// Check if there is a custom field specific filter.
1682
+	if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1683
+		/**
1684
+		 * Filter the address html by individual custom field.
1685
+		 *
1686
+		 * @param string $html The html to filter.
1687
+		 * @param string $location The location to output the html.
1688
+		 * @param array $cf The custom field array.
1689
+		 * @since 1.6.6
1690
+		 */
1691
+		$html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1692
+	}
1693
+
1694
+	// Check if there is a custom field key specific filter.
1695
+	if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1696
+		/**
1697
+		 * Filter the address html by field type key.
1698
+		 *
1699
+		 * @param string $html The html to filter.
1700
+		 * @param string $location The location to output the html.
1701
+		 * @param array $cf The custom field array.
1702
+		 * @since 1.6.6
1703
+		 */
1704
+		$html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1705
+	}
1706
+
1707
+	// If not html then we run the standard output.
1708
+	if(empty($html)){
1709
+
1710
+		global $preview;
1711
+		$html_var = $cf['htmlvar_name'] . '_address';
1712
+
1713
+		if ($cf['extra_fields']) {
1714
+
1715
+			$extra_fields = unserialize($cf['extra_fields']);
1716
+
1717
+			$addition_fields = '';
1718
+
1719
+			if (!empty($extra_fields)) {
1720
+
1721
+				$show_city_in_address = false;
1722
+				if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
1723
+					$show_city_in_address = true;
1724
+				}
1725
+				/**
1726
+				 * Filter "show city in address" value.
1727
+				 *
1728
+				 * @since 1.0.0
1729
+				 */
1730
+				$show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address);
1731
+
1732
+
1733
+				$show_region_in_address = false;
1734
+				if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
1735
+					$show_region_in_address = true;
1736
+				}
1737
+				/**
1738
+				 * Filter "show region in address" value.
1739
+				 *
1740
+				 * @since 1.6.6
1741
+				 */
1742
+				$show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address);
1743
+
1744
+				$show_country_in_address = false;
1745
+				if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
1746
+					$show_country_in_address = true;
1747
+				}
1748
+				/**
1749
+				 * Filter "show country in address" value.
1750
+				 *
1751
+				 * @since 1.6.6
1752
+				 */
1753
+				$show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address);
1754
+
1755
+				$show_zip_in_address = false;
1756
+				if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
1757
+					$show_zip_in_address = true;
1758
+				}
1759
+				/**
1760
+				 * Filter "show zip in address" value.
1761
+				 *
1762
+				 * @since 1.6.6
1763
+				 */
1764
+				$show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address);
1765
+
1766
+
1767
+			}
1768
+
1769
+		}
1770
+
1771
+
1772
+		if ($post->{$html_var}) {
1773
+
1774
+			$field_icon = geodir_field_icon_proccess( $cf );
1775
+			if ( strpos( $field_icon, 'http' ) !== false ) {
1776
+				$field_icon_af = '';
1777
+			} elseif ( $field_icon == '' ) {
1778
+				$field_icon_af = '<i class="fa fa-home"></i>';
1779
+			} else {
1780
+				$field_icon_af = $field_icon;
1781
+				$field_icon    = '';
1782
+			}
1783 1783
             
1784 1784
 
1785 1785
 
1786
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
1787
-            $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1788
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1789
-            $html .= '</span>';
1786
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
1787
+			$html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1788
+			$html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1789
+			$html .= '</span>';
1790 1790
 
1791 1791
 
1792
-            if ( $post->post_address ) {
1793
-                $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
1794
-            }
1795
-            if ($show_city_in_address && $post->post_city ) {
1796
-                $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
1797
-            }
1798
-            if ($show_region_in_address && $post->post_region ) {
1799
-                $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
1800
-            }
1801
-            if ($show_zip_in_address && $post->post_zip ) {
1802
-                $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
1803
-            }
1804
-            if ($show_country_in_address && $post->post_country ) {
1805
-                $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
1806
-            }
1807
-            $html .= '</div>';
1792
+			if ( $post->post_address ) {
1793
+				$html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
1794
+			}
1795
+			if ($show_city_in_address && $post->post_city ) {
1796
+				$html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
1797
+			}
1798
+			if ($show_region_in_address && $post->post_region ) {
1799
+				$html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
1800
+			}
1801
+			if ($show_zip_in_address && $post->post_zip ) {
1802
+				$html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
1803
+			}
1804
+			if ($show_country_in_address && $post->post_country ) {
1805
+				$html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
1806
+			}
1807
+			$html .= '</div>';
1808 1808
 
1809
-        }
1809
+		}
1810 1810
 
1811
-    }
1811
+	}
1812 1812
 
1813 1813
 
1814
-    return $html;
1814
+	return $html;
1815 1815
 }
1816 1816
 add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3);
1817 1817
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +299 added lines, -299 removed lines patch added patch discarded remove patch
@@ -19,21 +19,21 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @return string The html to output for the custom field.
21 21
  */
22
-function geodir_cf_checkbox($html,$location,$cf,$p=''){
22
+function geodir_cf_checkbox($html, $location, $cf, $p = '') {
23 23
 
24 24
     // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
25
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
26
+    else { global $post; }
27 27
 
28
-    if(!is_array($cf) && $cf!=''){
28
+    if (!is_array($cf) && $cf != '') {
29 29
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
-        if(!$cf){return NULL;}
30
+        if (!$cf) {return NULL; }
31 31
     }
32 32
 
33 33
     $html_var = $cf['htmlvar_name'];
34 34
 
35 35
     // Check if there is a location specific filter.
36
-    if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
36
+    if (has_filter("geodir_custom_field_output_checkbox_loc_{$location}")) {
37 37
         /**
38 38
          * Filter the checkbox html by location.
39 39
          *
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
          * @param array $cf The custom field array.
42 42
          * @since 1.6.6
43 43
          */
44
-        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
44
+        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}", $html, $cf);
45 45
     }
46 46
 
47 47
     // Check if there is a custom field specific filter.
48
-    if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
48
+    if (has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")) {
49 49
         /**
50 50
          * Filter the checkbox html by individual custom field.
51 51
          *
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
          * @param array $cf The custom field array.
55 55
          * @since 1.6.6
56 56
          */
57
-        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
57
+        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}", $html, $location, $cf);
58 58
     }
59 59
 
60 60
     // Check if there is a custom field key specific filter.
61
-    if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
61
+    if (has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")) {
62 62
         /**
63 63
          * Filter the checkbox html by field type key.
64 64
          *
@@ -67,18 +67,18 @@  discard block
 block discarded – undo
67 67
          * @param array $cf The custom field array.
68 68
          * @since 1.6.6
69 69
          */
70
-        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
70
+        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}", $html, $location, $cf);
71 71
     }
72 72
 
73 73
     // If not html then we run the standard output.
74
-    if(empty($html)){
74
+    if (empty($html)) {
75 75
 
76
-        if ( (int) $post->{$html_var} == 1 ):
76
+        if ((int) $post->{$html_var} == 1):
77 77
 
78
-            if ( $post->{$html_var} == '1' ):
79
-                $html_val = __( 'Yes', 'geodirectory' );
78
+            if ($post->{$html_var} == '1'):
79
+                $html_val = __('Yes', 'geodirectory');
80 80
             else:
81
-                $html_val = __( 'No', 'geodirectory' );
81
+                $html_val = __('No', 'geodirectory');
82 82
             endif;
83 83
 
84 84
             $field_icon = geodir_field_icon_proccess($cf);
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
                 $field_icon = '';
92 92
             }
93 93
 
94
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
-            $html .= '</span>' . $html_val . '</div>';
94
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
95
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
96
+            $html .= '</span>'.$html_val.'</div>';
97 97
         endif;
98 98
 
99 99
     }
100 100
 
101 101
     return $html;
102 102
 }
103
-add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3);
103
+add_filter('geodir_custom_field_output_checkbox', 'geodir_cf_checkbox', 10, 3);
104 104
 
105 105
 
106 106
 /**
@@ -113,21 +113,21 @@  discard block
 block discarded – undo
113 113
  *
114 114
  * @return string The html to output for the custom field.
115 115
  */
116
-function geodir_cf_fieldset($html,$location,$cf,$p=''){
116
+function geodir_cf_fieldset($html, $location, $cf, $p = '') {
117 117
 
118 118
     // check we have the post value
119
-    if(is_int($p)){$post = geodir_get_post_info($p);}
120
-    else{ global $post;}
119
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
120
+    else { global $post; }
121 121
 
122
-    if(!is_array($cf) && $cf!=''){
122
+    if (!is_array($cf) && $cf != '') {
123 123
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
-        if(!$cf){return NULL;}
124
+        if (!$cf) {return NULL; }
125 125
     }
126 126
 
127 127
     $html_var = $cf['htmlvar_name'];
128 128
 
129 129
     // Check if there is a location specific filter.
130
-    if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
130
+    if (has_filter("geodir_custom_field_output_fieldset_loc_{$location}")) {
131 131
         /**
132 132
          * Filter the fieldset html by location.
133 133
          *
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
          * @param array $cf The custom field array.
136 136
          * @since 1.6.6
137 137
          */
138
-        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
138
+        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}", $html, $cf);
139 139
     }
140 140
 
141 141
     // Check if there is a custom field specific filter.
142
-    if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
142
+    if (has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")) {
143 143
         /**
144 144
          * Filter the fieldset html by individual custom field.
145 145
          *
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
          * @param array $cf The custom field array.
149 149
          * @since 1.6.6
150 150
          */
151
-        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
151
+        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}", $html, $location, $cf);
152 152
     }
153 153
 
154 154
     // Check if there is a custom field key specific filter.
155
-    if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
155
+    if (has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")) {
156 156
         /**
157 157
          * Filter the fieldset html by field type key.
158 158
          *
@@ -161,11 +161,11 @@  discard block
 block discarded – undo
161 161
          * @param array $cf The custom field array.
162 162
          * @since 1.6.6
163 163
          */
164
-        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
164
+        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}", $html, $location, $cf);
165 165
     }
166 166
 
167 167
     // If not html then we run the standard output.
168
-    if(empty($html)){
168
+    if (empty($html)) {
169 169
 
170 170
         global $field_set_start;
171 171
         $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         if ($field_set_start == 1) {
174 174
             $html = '';
175 175
         } else {
176
-            $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>';
176
+            $html = '<h2 class="'.$fieldset_class.'">'.__($cf['site_title'], 'geodirectory').'</h2>';
177 177
             //$field_set_start = 1;
178 178
         }
179 179
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
     return $html;
183 183
 }
184
-add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3);
184
+add_filter('geodir_custom_field_output_fieldset', 'geodir_cf_fieldset', 10, 3);
185 185
 
186 186
 
187 187
 /**
@@ -194,21 +194,21 @@  discard block
 block discarded – undo
194 194
  *
195 195
  * @return string The html to output for the custom field.
196 196
  */
197
-function geodir_cf_url($html,$location,$cf,$p=''){
197
+function geodir_cf_url($html, $location, $cf, $p = '') {
198 198
 
199 199
     // check we have the post value
200
-    if(is_int($p)){$post = geodir_get_post_info($p);}
201
-    else{ global $post;}
200
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
201
+    else { global $post; }
202 202
 
203
-    if(!is_array($cf) && $cf!=''){
203
+    if (!is_array($cf) && $cf != '') {
204 204
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
-        if(!$cf){return NULL;}
205
+        if (!$cf) {return NULL; }
206 206
     }
207 207
 
208 208
     $html_var = $cf['htmlvar_name'];
209 209
 
210 210
     // Check if there is a location specific filter.
211
-    if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
211
+    if (has_filter("geodir_custom_field_output_url_loc_{$location}")) {
212 212
         /**
213 213
          * Filter the url html by location.
214 214
          *
@@ -216,11 +216,11 @@  discard block
 block discarded – undo
216 216
          * @param array $cf The custom field array.
217 217
          * @since 1.6.6
218 218
          */
219
-        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
219
+        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}", $html, $cf);
220 220
     }
221 221
 
222 222
     // Check if there is a custom field specific filter.
223
-    if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
223
+    if (has_filter("geodir_custom_field_output_url_var_{$html_var}")) {
224 224
         /**
225 225
          * Filter the url html by individual custom field.
226 226
          *
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
          * @param array $cf The custom field array.
230 230
          * @since 1.6.6
231 231
          */
232
-        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
232
+        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}", $html, $location, $cf);
233 233
     }
234 234
 
235 235
     // Check if there is a custom field key specific filter.
236
-    if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
236
+    if (has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")) {
237 237
         /**
238 238
          * Filter the url html by field type key.
239 239
          *
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
          * @param array $cf The custom field array.
243 243
          * @since 1.6.6
244 244
          */
245
-        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
245
+        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}", $html, $location, $cf);
246 246
     }
247 247
 
248 248
     // If not html then we run the standard output.
249
-    if(empty($html)){
249
+    if (empty($html)) {
250 250
 
251 251
         if ($post->{$cf['htmlvar_name']}):
252 252
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 
274 274
             $website = !empty($a_url['url']) ? $a_url['url'] : '';
275 275
             $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
-            if(!empty($cf['default_value'])){$title = $cf['default_value'];}
276
+            if (!empty($cf['default_value'])) {$title = $cf['default_value']; }
277 277
             $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278 278
 
279 279
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
              * @param string $website Website URL.
290 290
              * @param int $post->ID Post ID.
291 291
              */
292
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
292
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
293 293
 
294 294
         endif;
295 295
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 
298 298
     return $html;
299 299
 }
300
-add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3);
300
+add_filter('geodir_custom_field_output_url', 'geodir_cf_url', 10, 3);
301 301
 
302 302
 
303 303
 /**
@@ -310,21 +310,21 @@  discard block
 block discarded – undo
310 310
  *
311 311
  * @return string The html to output for the custom field.
312 312
  */
313
-function geodir_cf_phone($html,$location,$cf,$p=''){
313
+function geodir_cf_phone($html, $location, $cf, $p = '') {
314 314
 
315 315
     // check we have the post value
316
-    if(is_int($p)){$post = geodir_get_post_info($p);}
317
-    else{ global $post;}
316
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
317
+    else { global $post; }
318 318
 
319
-    if(!is_array($cf) && $cf!=''){
319
+    if (!is_array($cf) && $cf != '') {
320 320
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
-        if(!$cf){return NULL;}
321
+        if (!$cf) {return NULL; }
322 322
     }
323 323
 
324 324
     $html_var = $cf['htmlvar_name'];
325 325
 
326 326
     // Check if there is a location specific filter.
327
-    if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
327
+    if (has_filter("geodir_custom_field_output_phone_loc_{$location}")) {
328 328
         /**
329 329
          * Filter the phone html by location.
330 330
          *
@@ -332,11 +332,11 @@  discard block
 block discarded – undo
332 332
          * @param array $cf The custom field array.
333 333
          * @since 1.6.6
334 334
          */
335
-        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
335
+        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}", $html, $cf);
336 336
     }
337 337
 
338 338
     // Check if there is a custom field specific filter.
339
-    if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
339
+    if (has_filter("geodir_custom_field_output_phone_var_{$html_var}")) {
340 340
         /**
341 341
          * Filter the phone html by individual custom field.
342 342
          *
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
          * @param array $cf The custom field array.
346 346
          * @since 1.6.6
347 347
          */
348
-        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
348
+        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}", $html, $location, $cf);
349 349
     }
350 350
 
351 351
     // Check if there is a custom field key specific filter.
352
-    if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
352
+    if (has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")) {
353 353
         /**
354 354
          * Filter the phone html by field type key.
355 355
          *
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
          * @param array $cf The custom field array.
359 359
          * @since 1.6.6
360 360
          */
361
-        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
361
+        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}", $html, $location, $cf);
362 362
     }
363 363
 
364 364
     // If not html then we run the standard output.
365
-    if(empty($html)){
365
+    if (empty($html)) {
366 366
 
367 367
         if ($post->{$cf['htmlvar_name']}):
368 368
 
@@ -377,9 +377,9 @@  discard block
 block discarded – undo
377 377
             }
378 378
 
379 379
 
380
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
-                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
-            $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
380
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af.
381
+                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
382
+            $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}).'">'.$post->{$cf['htmlvar_name']}.'</a></div>';
383 383
 
384 384
         endif;
385 385
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
     return $html;
389 389
 }
390
-add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3);
390
+add_filter('geodir_custom_field_output_phone', 'geodir_cf_phone', 10, 3);
391 391
 
392 392
 
393 393
 /**
@@ -400,21 +400,21 @@  discard block
 block discarded – undo
400 400
  *
401 401
  * @return string The html to output for the custom field.
402 402
  */
403
-function geodir_cf_time($html,$location,$cf,$p=''){
403
+function geodir_cf_time($html, $location, $cf, $p = '') {
404 404
 
405 405
     // check we have the post value
406
-    if(is_int($p)){$post = geodir_get_post_info($p);}
407
-    else{ global $post;}
406
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
407
+    else { global $post; }
408 408
 
409
-    if(!is_array($cf) && $cf!=''){
409
+    if (!is_array($cf) && $cf != '') {
410 410
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
-        if(!$cf){return NULL;}
411
+        if (!$cf) {return NULL; }
412 412
     }
413 413
 
414 414
     $html_var = $cf['htmlvar_name'];
415 415
 
416 416
     // Check if there is a location specific filter.
417
-    if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
417
+    if (has_filter("geodir_custom_field_output_time_loc_{$location}")) {
418 418
         /**
419 419
          * Filter the time html by location.
420 420
          *
@@ -422,11 +422,11 @@  discard block
 block discarded – undo
422 422
          * @param array $cf The custom field array.
423 423
          * @since 1.6.6
424 424
          */
425
-        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
425
+        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}", $html, $cf);
426 426
     }
427 427
 
428 428
     // Check if there is a custom field specific filter.
429
-    if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
429
+    if (has_filter("geodir_custom_field_output_time_var_{$html_var}")) {
430 430
         /**
431 431
          * Filter the time html by individual custom field.
432 432
          *
@@ -435,11 +435,11 @@  discard block
 block discarded – undo
435 435
          * @param array $cf The custom field array.
436 436
          * @since 1.6.6
437 437
          */
438
-        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
438
+        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}", $html, $location, $cf);
439 439
     }
440 440
 
441 441
     // Check if there is a custom field key specific filter.
442
-    if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
442
+    if (has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")) {
443 443
         /**
444 444
          * Filter the time html by field type key.
445 445
          *
@@ -448,11 +448,11 @@  discard block
 block discarded – undo
448 448
          * @param array $cf The custom field array.
449 449
          * @since 1.6.6
450 450
          */
451
-        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
451
+        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}", $html, $location, $cf);
452 452
     }
453 453
 
454 454
     // If not html then we run the standard output.
455
-    if(empty($html)){
455
+    if (empty($html)) {
456 456
 
457 457
         if ($post->{$cf['htmlvar_name']}):
458 458
 
@@ -472,9 +472,9 @@  discard block
 block discarded – undo
472 472
             }
473 473
 
474 474
 
475
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
-            $html .= '</span>' . $value . '</div>';
475
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
476
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
477
+            $html .= '</span>'.$value.'</div>';
478 478
 
479 479
         endif;
480 480
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 
483 483
     return $html;
484 484
 }
485
-add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3);
485
+add_filter('geodir_custom_field_output_time', 'geodir_cf_time', 10, 3);
486 486
 
487 487
 
488 488
 /**
@@ -495,21 +495,21 @@  discard block
 block discarded – undo
495 495
  *
496 496
  * @return string The html to output for the custom field.
497 497
  */
498
-function geodir_cf_datepicker($html,$location,$cf,$p=''){
498
+function geodir_cf_datepicker($html, $location, $cf, $p = '') {
499 499
     global $preview;
500 500
     // check we have the post value
501
-    if(is_int($p)){$post = geodir_get_post_info($p);}
502
-    else{ global $post;}
501
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
502
+    else { global $post; }
503 503
 
504
-    if(!is_array($cf) && $cf!=''){
504
+    if (!is_array($cf) && $cf != '') {
505 505
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
-        if(!$cf){return NULL;}
506
+        if (!$cf) {return NULL; }
507 507
     }
508 508
 
509 509
     $html_var = $cf['htmlvar_name'];
510 510
 
511 511
     // Check if there is a location specific filter.
512
-    if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
512
+    if (has_filter("geodir_custom_field_output_datepicker_loc_{$location}")) {
513 513
         /**
514 514
          * Filter the datepicker html by location.
515 515
          *
@@ -517,11 +517,11 @@  discard block
 block discarded – undo
517 517
          * @param array $cf The custom field array.
518 518
          * @since 1.6.6
519 519
          */
520
-        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
520
+        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}", $html, $cf);
521 521
     }
522 522
 
523 523
     // Check if there is a custom field specific filter.
524
-    if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
524
+    if (has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")) {
525 525
         /**
526 526
          * Filter the datepicker html by individual custom field.
527 527
          *
@@ -530,11 +530,11 @@  discard block
 block discarded – undo
530 530
          * @param array $cf The custom field array.
531 531
          * @since 1.6.6
532 532
          */
533
-        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
533
+        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}", $html, $location, $cf);
534 534
     }
535 535
 
536 536
     // Check if there is a custom field key specific filter.
537
-    if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
537
+    if (has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")) {
538 538
         /**
539 539
          * Filter the datepicker html by field type key.
540 540
          *
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
          * @param array $cf The custom field array.
544 544
          * @since 1.6.6
545 545
          */
546
-        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
546
+        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}", $html, $location, $cf);
547 547
     }
548 548
 
549 549
     // If not html then we run the standard output.
550
-    if(empty($html)){
550
+    if (empty($html)) {
551 551
 
552 552
         if ($post->{$cf['htmlvar_name']}):
553 553
 
@@ -558,24 +558,24 @@  discard block
 block discarded – undo
558 558
             }
559 559
             // check if we need to change the format or not
560 560
             $date_format_len = strlen(str_replace(' ', '', $date_format));
561
-            if($date_format_len>5){// if greater then 4 then it's the old style format.
561
+            if ($date_format_len > 5) {// if greater then 4 then it's the old style format.
562 562
 
563
-                $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
-                $replace = array('d','j','l','m','n','F','Y');//PHP date format
563
+                $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
564
+                $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
565 565
 
566 566
                 $date_format = str_replace($search, $replace, $date_format);
567 567
 
568
-                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
-            }else{
568
+                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y') ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
+            } else {
570 570
                 $post_htmlvar_value = $post->{$cf['htmlvar_name']};
571 571
             }
572 572
 
573
-            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
573
+            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']} != "0000-00-00") {
574 574
                 $date_format_from = $preview ? $date_format : 'Y-m-d';
575 575
                 $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d
576 576
                 //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value;
577 577
                 //$value = date_i18n($date_format, strtotime($post_htmlvar_value));
578
-            }else{
578
+            } else {
579 579
                 return '';
580 580
             }
581 581
 
@@ -592,9 +592,9 @@  discard block
 block discarded – undo
592 592
 
593 593
 
594 594
 
595
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
596
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
597
-            $html .= '</span>' . $value . '</div>';
595
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
596
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
597
+            $html .= '</span>'.$value.'</div>';
598 598
 
599 599
         endif;
600 600
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 
603 603
     return $html;
604 604
 }
605
-add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3);
605
+add_filter('geodir_custom_field_output_datepicker', 'geodir_cf_datepicker', 10, 3);
606 606
 
607 607
 
608 608
 /**
@@ -615,21 +615,21 @@  discard block
 block discarded – undo
615 615
  *
616 616
  * @return string The html to output for the custom field.
617 617
  */
618
-function geodir_cf_text($html,$location,$cf,$p=''){
618
+function geodir_cf_text($html, $location, $cf, $p = '') {
619 619
 
620 620
     // check we have the post value
621
-    if(is_int($p)){$post = geodir_get_post_info($p);}
622
-    else{ global $post;}
621
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
622
+    else { global $post; }
623 623
 
624
-    if(!is_array($cf) && $cf!=''){
624
+    if (!is_array($cf) && $cf != '') {
625 625
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
626
-        if(!$cf){return NULL;}
626
+        if (!$cf) {return NULL; }
627 627
     }
628 628
 
629 629
     $html_var = $cf['htmlvar_name'];
630 630
 
631 631
     // Check if there is a location specific filter.
632
-    if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
632
+    if (has_filter("geodir_custom_field_output_text_loc_{$location}")) {
633 633
         /**
634 634
          * Filter the text html by location.
635 635
          *
@@ -637,11 +637,11 @@  discard block
 block discarded – undo
637 637
          * @param array $cf The custom field array.
638 638
          * @since 1.6.6
639 639
          */
640
-        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
640
+        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}", $html, $cf);
641 641
     }
642 642
 
643 643
     // Check if there is a custom field specific filter.
644
-    if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
644
+    if (has_filter("geodir_custom_field_output_text_var_{$html_var}")) {
645 645
         /**
646 646
          * Filter the text html by individual custom field.
647 647
          *
@@ -650,11 +650,11 @@  discard block
 block discarded – undo
650 650
          * @param array $cf The custom field array.
651 651
          * @since 1.6.6
652 652
          */
653
-        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
653
+        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}", $html, $location, $cf);
654 654
     }
655 655
 
656 656
     // Check if there is a custom field key specific filter.
657
-    if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
657
+    if (has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")) {
658 658
         /**
659 659
          * Filter the text html by field type key.
660 660
          *
@@ -663,15 +663,15 @@  discard block
 block discarded – undo
663 663
          * @param array $cf The custom field array.
664 664
          * @since 1.6.6
665 665
          */
666
-        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
666
+        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}", $html, $location, $cf);
667 667
     }
668 668
 
669 669
     
670 670
 
671 671
     // If not html then we run the standard output.
672
-    if(empty($html)){
672
+    if (empty($html)) {
673 673
 
674
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
674
+        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
675 675
 
676 676
             $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
677 677
 
@@ -686,9 +686,9 @@  discard block
 block discarded – undo
686 686
             }
687 687
 
688 688
 
689
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
690
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
691
-            $html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>';
689
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="'.$class.'" style="'.$field_icon.'">'.$field_icon_af;
690
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
691
+            $html .= '</span>'.$post->{$cf['htmlvar_name']}.'</div>';
692 692
 
693 693
         endif;
694 694
 
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 
697 697
     return $html;
698 698
 }
699
-add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3);
699
+add_filter('geodir_custom_field_output_text', 'geodir_cf_text', 10, 3);
700 700
 
701 701
 
702 702
 /**
@@ -709,21 +709,21 @@  discard block
 block discarded – undo
709 709
  *
710 710
  * @return string The html to output for the custom field.
711 711
  */
712
-function geodir_cf_radio($html,$location,$cf,$p=''){
712
+function geodir_cf_radio($html, $location, $cf, $p = '') {
713 713
 
714 714
     // check we have the post value
715
-    if(is_int($p)){$post = geodir_get_post_info($p);}
716
-    else{ global $post;}
715
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
716
+    else { global $post; }
717 717
 
718
-    if(!is_array($cf) && $cf!=''){
718
+    if (!is_array($cf) && $cf != '') {
719 719
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
720
-        if(!$cf){return NULL;}
720
+        if (!$cf) {return NULL; }
721 721
     }
722 722
 
723 723
     $html_var = $cf['htmlvar_name'];
724 724
 
725 725
     // Check if there is a location specific filter.
726
-    if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
726
+    if (has_filter("geodir_custom_field_output_radio_loc_{$location}")) {
727 727
         /**
728 728
          * Filter the radio html by location.
729 729
          *
@@ -731,11 +731,11 @@  discard block
 block discarded – undo
731 731
          * @param array $cf The custom field array.
732 732
          * @since 1.6.6
733 733
          */
734
-        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
734
+        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}", $html, $cf);
735 735
     }
736 736
 
737 737
     // Check if there is a custom field specific filter.
738
-    if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
738
+    if (has_filter("geodir_custom_field_output_radio_var_{$html_var}")) {
739 739
         /**
740 740
          * Filter the radio html by individual custom field.
741 741
          *
@@ -744,11 +744,11 @@  discard block
 block discarded – undo
744 744
          * @param array $cf The custom field array.
745 745
          * @since 1.6.6
746 746
          */
747
-        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
747
+        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}", $html, $location, $cf);
748 748
     }
749 749
 
750 750
     // Check if there is a custom field key specific filter.
751
-    if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
751
+    if (has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")) {
752 752
         /**
753 753
          * Filter the radio html by field type key.
754 754
          *
@@ -757,11 +757,11 @@  discard block
 block discarded – undo
757 757
          * @param array $cf The custom field array.
758 758
          * @since 1.6.6
759 759
          */
760
-        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
760
+        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}", $html, $location, $cf);
761 761
     }
762 762
 
763 763
     // If not html then we run the standard output.
764
-    if(empty($html)){
764
+    if (empty($html)) {
765 765
 
766 766
         $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : '';
767 767
         if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
@@ -795,16 +795,16 @@  discard block
 block discarded – undo
795 795
             }
796 796
 
797 797
 
798
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
799
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
800
-            $html .= '</span>' . $html_val . '</div>';
798
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
799
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
800
+            $html .= '</span>'.$html_val.'</div>';
801 801
         endif;
802 802
 
803 803
     }
804 804
 
805 805
     return $html;
806 806
 }
807
-add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3);
807
+add_filter('geodir_custom_field_output_radio', 'geodir_cf_radio', 10, 3);
808 808
 
809 809
 
810 810
 /**
@@ -817,21 +817,21 @@  discard block
 block discarded – undo
817 817
  *
818 818
  * @return string The html to output for the custom field.
819 819
  */
820
-function geodir_cf_select($html,$location,$cf,$p=''){
820
+function geodir_cf_select($html, $location, $cf, $p = '') {
821 821
 
822 822
     // check we have the post value
823
-    if(is_int($p)){$post = geodir_get_post_info($p);}
824
-    else{ global $post;}
823
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
824
+    else { global $post; }
825 825
 
826
-    if(!is_array($cf) && $cf!=''){
826
+    if (!is_array($cf) && $cf != '') {
827 827
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
828
-        if(!$cf){return NULL;}
828
+        if (!$cf) {return NULL; }
829 829
     }
830 830
 
831 831
     $html_var = $cf['htmlvar_name'];
832 832
 
833 833
     // Check if there is a location specific filter.
834
-    if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
834
+    if (has_filter("geodir_custom_field_output_select_loc_{$location}")) {
835 835
         /**
836 836
          * Filter the select html by location.
837 837
          *
@@ -839,11 +839,11 @@  discard block
 block discarded – undo
839 839
          * @param array $cf The custom field array.
840 840
          * @since 1.6.6
841 841
          */
842
-        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
842
+        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}", $html, $cf);
843 843
     }
844 844
 
845 845
     // Check if there is a custom field specific filter.
846
-    if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
846
+    if (has_filter("geodir_custom_field_output_select_var_{$html_var}")) {
847 847
         /**
848 848
          * Filter the select html by individual custom field.
849 849
          *
@@ -852,11 +852,11 @@  discard block
 block discarded – undo
852 852
          * @param array $cf The custom field array.
853 853
          * @since 1.6.6
854 854
          */
855
-        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
855
+        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}", $html, $location, $cf);
856 856
     }
857 857
 
858 858
     // Check if there is a custom field key specific filter.
859
-    if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
859
+    if (has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")) {
860 860
         /**
861 861
          * Filter the select html by field type key.
862 862
          *
@@ -865,11 +865,11 @@  discard block
 block discarded – undo
865 865
          * @param array $cf The custom field array.
866 866
          * @since 1.6.6
867 867
          */
868
-        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
868
+        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}", $html, $location, $cf);
869 869
     }
870 870
 
871 871
     // If not html then we run the standard output.
872
-    if(empty($html)){
872
+    if (empty($html)) {
873 873
 
874 874
         if ($post->{$cf['htmlvar_name']}):
875 875
             $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
@@ -897,16 +897,16 @@  discard block
 block discarded – undo
897 897
             }
898 898
 
899 899
 
900
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
901
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
902
-            $html .= '</span>' . $field_value . '</div>';
900
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
901
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
902
+            $html .= '</span>'.$field_value.'</div>';
903 903
         endif;
904 904
 
905 905
     }
906 906
 
907 907
     return $html;
908 908
 }
909
-add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3);
909
+add_filter('geodir_custom_field_output_select', 'geodir_cf_select', 10, 3);
910 910
 
911 911
 
912 912
 /**
@@ -919,21 +919,21 @@  discard block
 block discarded – undo
919 919
  *
920 920
  * @return string The html to output for the custom field.
921 921
  */
922
-function geodir_cf_multiselect($html,$location,$cf,$p=''){
922
+function geodir_cf_multiselect($html, $location, $cf, $p = '') {
923 923
 
924 924
     // check we have the post value
925
-    if(is_int($p)){$post = geodir_get_post_info($p);}
926
-    else{ global $post;}
925
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
926
+    else { global $post; }
927 927
 
928
-    if(!is_array($cf) && $cf!=''){
928
+    if (!is_array($cf) && $cf != '') {
929 929
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
930
-        if(!$cf){return NULL;}
930
+        if (!$cf) {return NULL; }
931 931
     }
932 932
 
933 933
     $html_var = $cf['htmlvar_name'];
934 934
 
935 935
     // Check if there is a location specific filter.
936
-    if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
936
+    if (has_filter("geodir_custom_field_output_multiselect_loc_{$location}")) {
937 937
         /**
938 938
          * Filter the multiselect html by location.
939 939
          *
@@ -941,11 +941,11 @@  discard block
 block discarded – undo
941 941
          * @param array $cf The custom field array.
942 942
          * @since 1.6.6
943 943
          */
944
-        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
944
+        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}", $html, $cf);
945 945
     }
946 946
 
947 947
     // Check if there is a custom field specific filter.
948
-    if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
948
+    if (has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")) {
949 949
         /**
950 950
          * Filter the multiselect html by individual custom field.
951 951
          *
@@ -954,11 +954,11 @@  discard block
 block discarded – undo
954 954
          * @param array $cf The custom field array.
955 955
          * @since 1.6.6
956 956
          */
957
-        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
957
+        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}", $html, $location, $cf);
958 958
     }
959 959
 
960 960
     // Check if there is a custom field key specific filter.
961
-    if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
961
+    if (has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")) {
962 962
         /**
963 963
          * Filter the multiselect html by field type key.
964 964
          *
@@ -967,11 +967,11 @@  discard block
 block discarded – undo
967 967
          * @param array $cf The custom field array.
968 968
          * @since 1.6.6
969 969
          */
970
-        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
970
+        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}", $html, $location, $cf);
971 971
     }
972 972
 
973 973
     // If not html then we run the standard output.
974
-    if(empty($html)){
974
+    if (empty($html)) {
975 975
 
976 976
 
977 977
         if (!empty($post->{$cf['htmlvar_name']})):
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
 
993 993
             $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
994 994
 
995
-            if(is_array($field_values)){
995
+            if (is_array($field_values)) {
996 996
                 $field_values = array_map('trim', $field_values);
997 997
             }
998 998
 
@@ -1010,15 +1010,15 @@  discard block
 block discarded – undo
1010 1010
             }
1011 1011
 
1012 1012
 
1013
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1014
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1013
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
1014
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1015 1015
             $html .= '</span>';
1016 1016
 
1017 1017
             if (count($option_values) > 1) {
1018 1018
                 $html .= '<ul>';
1019 1019
 
1020 1020
                 foreach ($option_values as $val) {
1021
-                    $html .= '<li>' . $val . '</li>';
1021
+                    $html .= '<li>'.$val.'</li>';
1022 1022
                 }
1023 1023
 
1024 1024
                 $html .= '</ul>';
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 
1034 1034
     return $html;
1035 1035
 }
1036
-add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3);
1036
+add_filter('geodir_custom_field_output_multiselect', 'geodir_cf_multiselect', 10, 3);
1037 1037
 
1038 1038
 
1039 1039
 /**
@@ -1046,21 +1046,21 @@  discard block
 block discarded – undo
1046 1046
  *
1047 1047
  * @return string The html to output for the custom field.
1048 1048
  */
1049
-function geodir_cf_email($html,$location,$cf,$p=''){
1049
+function geodir_cf_email($html, $location, $cf, $p = '') {
1050 1050
 
1051 1051
     // check we have the post value
1052
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1053
-    else{ global $post;}
1052
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1053
+    else { global $post; }
1054 1054
 
1055
-    if(!is_array($cf) && $cf!=''){
1055
+    if (!is_array($cf) && $cf != '') {
1056 1056
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1057
-        if(!$cf){return NULL;}
1057
+        if (!$cf) {return NULL; }
1058 1058
     }
1059 1059
 
1060 1060
     $html_var = $cf['htmlvar_name'];
1061 1061
 
1062 1062
     // Check if there is a location specific filter.
1063
-    if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1063
+    if (has_filter("geodir_custom_field_output_email_loc_{$location}")) {
1064 1064
         /**
1065 1065
          * Filter the email html by location.
1066 1066
          *
@@ -1068,11 +1068,11 @@  discard block
 block discarded – undo
1068 1068
          * @param array $cf The custom field array.
1069 1069
          * @since 1.6.6
1070 1070
          */
1071
-        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1071
+        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}", $html, $cf);
1072 1072
     }
1073 1073
 
1074 1074
     // Check if there is a custom field specific filter.
1075
-    if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1075
+    if (has_filter("geodir_custom_field_output_email_var_{$html_var}")) {
1076 1076
         /**
1077 1077
          * Filter the email html by individual custom field.
1078 1078
          *
@@ -1081,11 +1081,11 @@  discard block
 block discarded – undo
1081 1081
          * @param array $cf The custom field array.
1082 1082
          * @since 1.6.6
1083 1083
          */
1084
-        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1084
+        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}", $html, $location, $cf);
1085 1085
     }
1086 1086
 
1087 1087
     // Check if there is a custom field key specific filter.
1088
-    if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1088
+    if (has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")) {
1089 1089
         /**
1090 1090
          * Filter the email html by field type key.
1091 1091
          *
@@ -1094,18 +1094,18 @@  discard block
 block discarded – undo
1094 1094
          * @param array $cf The custom field array.
1095 1095
          * @since 1.6.6
1096 1096
          */
1097
-        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1097
+        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}", $html, $location, $cf);
1098 1098
     }
1099 1099
 
1100 1100
     // If not html then we run the standard output.
1101
-    if(empty($html)){
1101
+    if (empty($html)) {
1102 1102
 
1103 1103
         global $preview;
1104 1104
         if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1105 1105
             return ''; // Remove Send Enquiry | Send To Friend from listings page
1106 1106
         }
1107 1107
 
1108
-        $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1108
+        $package_info = (array) geodir_post_package_info(array(), $post, $post->post_type);
1109 1109
 
1110 1110
         if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) {
1111 1111
             $send_to_friend = true;
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
             if (!$preview) {
1117 1117
                 $b_send_inquiry = 'b_send_inquiry';
1118 1118
                 $b_sendtofriend = 'b_sendtofriend';
1119
-                $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1119
+                $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>';
1120 1120
             }
1121 1121
 
1122 1122
             $field_icon = geodir_field_icon_proccess($cf);
@@ -1129,26 +1129,26 @@  discard block
 block discarded – undo
1129 1129
                 $field_icon = '';
1130 1130
             }
1131 1131
 
1132
-            $html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1132
+            $html .= '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
1133 1133
             $seperator = '';
1134 1134
             if ($post->{$cf['htmlvar_name']}) {
1135
-                $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1135
+                $html .= '<a href="javascript:void(0);" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>';
1136 1136
                 $seperator = ' | ';
1137 1137
             }
1138 1138
 
1139 1139
             if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) {
1140
-                $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
1140
+                $html .= $seperator.'<a href="javascript:void(0);" class="'.$b_sendtofriend.'">'.SEND_TO_FRIEND.'</a>';
1141 1141
             }
1142 1142
 
1143 1143
             $html .= '</span></div>';
1144 1144
 
1145 1145
 
1146 1146
             if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1147
-                $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1147
+                $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>';
1148 1148
             } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
1149
-                $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
1149
+                $html .= '<p class="sucess_msg">'.SEND_FRIEND_SUCCESS.'</p>';
1150 1150
             } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1151
-                $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1151
+                $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>';
1152 1152
             }
1153 1153
 
1154 1154
             /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
@@ -1168,11 +1168,11 @@  discard block
 block discarded – undo
1168 1168
                 }
1169 1169
 
1170 1170
 
1171
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1172
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1171
+                $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
1172
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1173 1173
                 $html .= '</span><span class="geodir-email-address-output">';
1174 1174
                 $email = $post->{$cf['htmlvar_name']} ;
1175
-                if($e_split = explode('@',$email)){
1175
+                if ($e_split = explode('@', $email)) {
1176 1176
                     /**
1177 1177
                      * Filter email custom field name output.
1178 1178
                      *
@@ -1181,10 +1181,10 @@  discard block
 block discarded – undo
1181 1181
                      * @param string $email The email string being output.
1182 1182
                      * @param array $cf Custom field variables array.
1183 1183
                      */
1184
-                    $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1185
-                    $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1186
-                }else{
1187
-                    $html .=  $email;
1184
+                    $email_name = apply_filters('geodir_email_field_name_output', $email, $cf);
1185
+                    $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1186
+                } else {
1187
+                    $html .= $email;
1188 1188
                 }
1189 1189
                 $html .= '</span></div>';
1190 1190
             }
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
     return $html;
1197 1197
 }
1198
-add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3);
1198
+add_filter('geodir_custom_field_output_email', 'geodir_cf_email', 10, 3);
1199 1199
 
1200 1200
 
1201 1201
 /**
@@ -1208,21 +1208,21 @@  discard block
 block discarded – undo
1208 1208
  *
1209 1209
  * @return string The html to output for the custom field.
1210 1210
  */
1211
-function geodir_cf_file($html,$location,$cf,$p=''){
1211
+function geodir_cf_file($html, $location, $cf, $p = '') {
1212 1212
 
1213 1213
     // check we have the post value
1214
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1215
-    else{ global $post;}
1214
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1215
+    else { global $post; }
1216 1216
 
1217
-    if(!is_array($cf) && $cf!=''){
1217
+    if (!is_array($cf) && $cf != '') {
1218 1218
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1219
-        if(!$cf){return NULL;}
1219
+        if (!$cf) {return NULL; }
1220 1220
     }
1221 1221
 
1222 1222
     $html_var = $cf['htmlvar_name'];
1223 1223
 
1224 1224
     // Check if there is a location specific filter.
1225
-    if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1225
+    if (has_filter("geodir_custom_field_output_file_loc_{$location}")) {
1226 1226
         /**
1227 1227
          * Filter the file html by location.
1228 1228
          *
@@ -1230,11 +1230,11 @@  discard block
 block discarded – undo
1230 1230
          * @param array $cf The custom field array.
1231 1231
          * @since 1.6.6
1232 1232
          */
1233
-        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1233
+        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}", $html, $cf);
1234 1234
     }
1235 1235
 
1236 1236
     // Check if there is a custom field specific filter.
1237
-    if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1237
+    if (has_filter("geodir_custom_field_output_file_var_{$html_var}")) {
1238 1238
         /**
1239 1239
          * Filter the file html by individual custom field.
1240 1240
          *
@@ -1243,11 +1243,11 @@  discard block
 block discarded – undo
1243 1243
          * @param array $cf The custom field array.
1244 1244
          * @since 1.6.6
1245 1245
          */
1246
-        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1246
+        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}", $html, $location, $cf);
1247 1247
     }
1248 1248
 
1249 1249
     // Check if there is a custom field key specific filter.
1250
-    if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1250
+    if (has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")) {
1251 1251
         /**
1252 1252
          * Filter the file html by field type key.
1253 1253
          *
@@ -1256,11 +1256,11 @@  discard block
 block discarded – undo
1256 1256
          * @param array $cf The custom field array.
1257 1257
          * @since 1.6.6
1258 1258
          */
1259
-        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1259
+        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}", $html, $location, $cf);
1260 1260
     }
1261 1261
 
1262 1262
     // If not html then we run the standard output.
1263
-    if(empty($html)){
1263
+    if (empty($html)) {
1264 1264
 
1265 1265
         if (!empty($post->{$cf['htmlvar_name']})):
1266 1266
 
@@ -1268,7 +1268,7 @@  discard block
 block discarded – undo
1268 1268
             if (!empty($files)):
1269 1269
 
1270 1270
                 $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL;
1271
-                $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
1271
+                $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
1272 1272
 
1273 1273
                 $file_paths = '';
1274 1274
                 foreach ($files as $file) {
@@ -1305,9 +1305,9 @@  discard block
 block discarded – undo
1305 1305
                             //$file_paths .= '<img src="'.$file.'"  />';	
1306 1306
                             $file_paths .= '</div>';
1307 1307
                         } else {
1308
-                            $ext_path = '_' . $html_var . '_';
1308
+                            $ext_path = '_'.$html_var.'_';
1309 1309
                             $filename = explode($ext_path, $filename);
1310
-                            $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1310
+                            $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
1311 1311
                         }
1312 1312
                     }
1313 1313
                 }
@@ -1322,11 +1322,11 @@  discard block
 block discarded – undo
1322 1322
                     $field_icon = '';
1323 1323
                 }
1324 1324
 
1325
-                $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1325
+                $html = '<div class="geodir_more_info  '.$cf['css_class'].' geodir-custom-file-box '.$cf['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
1326 1326
                 $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1327
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1327
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1328 1328
                 $html .= '</span>';
1329
-                $html .= $file_paths . '</div></div>';
1329
+                $html .= $file_paths.'</div></div>';
1330 1330
 
1331 1331
             endif;
1332 1332
         endif;
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
 
1336 1336
     return $html;
1337 1337
 }
1338
-add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3);
1338
+add_filter('geodir_custom_field_output_file', 'geodir_cf_file', 10, 3);
1339 1339
 
1340 1340
 
1341 1341
 
@@ -1349,21 +1349,21 @@  discard block
 block discarded – undo
1349 1349
  *
1350 1350
  * @return string The html to output for the custom field.
1351 1351
  */
1352
-function geodir_cf_textarea($html,$location,$cf,$p=''){
1352
+function geodir_cf_textarea($html, $location, $cf, $p = '') {
1353 1353
 
1354 1354
     // check we have the post value
1355
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1356
-    else{ global $post;}
1355
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1356
+    else { global $post; }
1357 1357
 
1358
-    if(!is_array($cf) && $cf!=''){
1358
+    if (!is_array($cf) && $cf != '') {
1359 1359
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1360
-        if(!$cf){return NULL;}
1360
+        if (!$cf) {return NULL; }
1361 1361
     }
1362 1362
 
1363 1363
     $html_var = $cf['htmlvar_name'];
1364 1364
 
1365 1365
     // Check if there is a location specific filter.
1366
-    if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1366
+    if (has_filter("geodir_custom_field_output_textarea_loc_{$location}")) {
1367 1367
         /**
1368 1368
          * Filter the textarea html by location.
1369 1369
          *
@@ -1371,11 +1371,11 @@  discard block
 block discarded – undo
1371 1371
          * @param array $cf The custom field array.
1372 1372
          * @since 1.6.6
1373 1373
          */
1374
-        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1374
+        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}", $html, $cf);
1375 1375
     }
1376 1376
 
1377 1377
     // Check if there is a custom field specific filter.
1378
-    if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1378
+    if (has_filter("geodir_custom_field_output_textarea_var_{$html_var}")) {
1379 1379
         /**
1380 1380
          * Filter the textarea html by individual custom field.
1381 1381
          *
@@ -1384,11 +1384,11 @@  discard block
 block discarded – undo
1384 1384
          * @param array $cf The custom field array.
1385 1385
          * @since 1.6.6
1386 1386
          */
1387
-        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1387
+        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}", $html, $location, $cf);
1388 1388
     }
1389 1389
 
1390 1390
     // Check if there is a custom field key specific filter.
1391
-    if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1391
+    if (has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")) {
1392 1392
         /**
1393 1393
          * Filter the textarea html by field type key.
1394 1394
          *
@@ -1397,11 +1397,11 @@  discard block
 block discarded – undo
1397 1397
          * @param array $cf The custom field array.
1398 1398
          * @since 1.6.6
1399 1399
          */
1400
-        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1400
+        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}", $html, $location, $cf);
1401 1401
     }
1402 1402
 
1403 1403
     // If not html then we run the standard output.
1404
-    if(empty($html)){
1404
+    if (empty($html)) {
1405 1405
 
1406 1406
         if (!empty($post->{$cf['htmlvar_name']})) {
1407 1407
 
@@ -1416,9 +1416,9 @@  discard block
 block discarded – undo
1416 1416
             }
1417 1417
 
1418 1418
 
1419
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1420
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1421
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1419
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
1420
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1421
+            $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>';
1422 1422
 
1423 1423
         }
1424 1424
 
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
 
1427 1427
     return $html;
1428 1428
 }
1429
-add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3);
1429
+add_filter('geodir_custom_field_output_textarea', 'geodir_cf_textarea', 10, 3);
1430 1430
 
1431 1431
 
1432 1432
 
@@ -1440,21 +1440,21 @@  discard block
 block discarded – undo
1440 1440
  *
1441 1441
  * @return string The html to output for the custom field.
1442 1442
  */
1443
-function geodir_cf_html($html,$location,$cf,$p=''){
1443
+function geodir_cf_html($html, $location, $cf, $p = '') {
1444 1444
 
1445 1445
     // check we have the post value
1446
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1447
-    else{ global $post;}
1446
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1447
+    else { global $post; }
1448 1448
 
1449
-    if(!is_array($cf) && $cf!=''){
1449
+    if (!is_array($cf) && $cf != '') {
1450 1450
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1451
-        if(!$cf){return NULL;}
1451
+        if (!$cf) {return NULL; }
1452 1452
     }
1453 1453
 
1454 1454
     $html_var = $cf['htmlvar_name'];
1455 1455
 
1456 1456
     // Check if there is a location specific filter.
1457
-    if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1457
+    if (has_filter("geodir_custom_field_output_html_loc_{$location}")) {
1458 1458
         /**
1459 1459
          * Filter the html html by location.
1460 1460
          *
@@ -1462,11 +1462,11 @@  discard block
 block discarded – undo
1462 1462
          * @param array $cf The custom field array.
1463 1463
          * @since 1.6.6
1464 1464
          */
1465
-        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1465
+        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}", $html, $cf);
1466 1466
     }
1467 1467
 
1468 1468
     // Check if there is a custom field specific filter.
1469
-    if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1469
+    if (has_filter("geodir_custom_field_output_html_var_{$html_var}")) {
1470 1470
         /**
1471 1471
          * Filter the html html by individual custom field.
1472 1472
          *
@@ -1475,11 +1475,11 @@  discard block
 block discarded – undo
1475 1475
          * @param array $cf The custom field array.
1476 1476
          * @since 1.6.6
1477 1477
          */
1478
-        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1478
+        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}", $html, $location, $cf);
1479 1479
     }
1480 1480
 
1481 1481
     // Check if there is a custom field key specific filter.
1482
-    if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1482
+    if (has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")) {
1483 1483
         /**
1484 1484
          * Filter the html html by field type key.
1485 1485
          *
@@ -1488,11 +1488,11 @@  discard block
 block discarded – undo
1488 1488
          * @param array $cf The custom field array.
1489 1489
          * @since 1.6.6
1490 1490
          */
1491
-        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1491
+        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}", $html, $location, $cf);
1492 1492
     }
1493 1493
 
1494 1494
     // If not html then we run the standard output.
1495
-    if(empty($html)){
1495
+    if (empty($html)) {
1496 1496
 
1497 1497
         if (!empty($post->{$cf['htmlvar_name']})) {
1498 1498
 
@@ -1506,9 +1506,9 @@  discard block
 block discarded – undo
1506 1506
                 $field_icon = '';
1507 1507
             }
1508 1508
 
1509
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1510
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1511
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1509
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
1510
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1511
+            $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>';
1512 1512
 
1513 1513
         }
1514 1514
 
@@ -1516,7 +1516,7 @@  discard block
 block discarded – undo
1516 1516
 
1517 1517
     return $html;
1518 1518
 }
1519
-add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3);
1519
+add_filter('geodir_custom_field_output_html', 'geodir_cf_html', 10, 3);
1520 1520
 
1521 1521
 
1522 1522
 
@@ -1530,21 +1530,21 @@  discard block
 block discarded – undo
1530 1530
  *
1531 1531
  * @return string The html to output for the custom field.
1532 1532
  */
1533
-function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1533
+function geodir_cf_taxonomy($html, $location, $cf, $p = '') {
1534 1534
 
1535 1535
     // check we have the post value
1536
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1537
-    else{ global $post;}
1536
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1537
+    else { global $post; }
1538 1538
 
1539
-    if(!is_array($cf) && $cf!=''){
1539
+    if (!is_array($cf) && $cf != '') {
1540 1540
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1541
-        if(!$cf){return NULL;}
1541
+        if (!$cf) {return NULL; }
1542 1542
     }
1543 1543
 
1544 1544
     $html_var = $cf['htmlvar_name'];
1545 1545
 
1546 1546
     // Check if there is a location specific filter.
1547
-    if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1547
+    if (has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")) {
1548 1548
         /**
1549 1549
          * Filter the taxonomy html by location.
1550 1550
          *
@@ -1552,11 +1552,11 @@  discard block
 block discarded – undo
1552 1552
          * @param array $cf The custom field array.
1553 1553
          * @since 1.6.6
1554 1554
          */
1555
-        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1555
+        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}", $html, $cf);
1556 1556
     }
1557 1557
 
1558 1558
     // Check if there is a custom field specific filter.
1559
-    if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1559
+    if (has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")) {
1560 1560
         /**
1561 1561
          * Filter the taxonomy html by individual custom field.
1562 1562
          *
@@ -1565,11 +1565,11 @@  discard block
 block discarded – undo
1565 1565
          * @param array $cf The custom field array.
1566 1566
          * @since 1.6.6
1567 1567
          */
1568
-        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1568
+        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}", $html, $location, $cf);
1569 1569
     }
1570 1570
 
1571 1571
     // Check if there is a custom field key specific filter.
1572
-    if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1572
+    if (has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")) {
1573 1573
         /**
1574 1574
          * Filter the taxonomy html by field type key.
1575 1575
          *
@@ -1578,14 +1578,14 @@  discard block
 block discarded – undo
1578 1578
          * @param array $cf The custom field array.
1579 1579
          * @since 1.6.6
1580 1580
          */
1581
-        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1581
+        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}", $html, $location, $cf);
1582 1582
     }
1583 1583
 
1584 1584
     // If not html then we run the standard output.
1585
-    if(empty($html)){
1585
+    if (empty($html)) {
1586 1586
 
1587
-        if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1588
-            $post_taxonomy = $post->post_type . 'category';
1587
+        if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) {
1588
+            $post_taxonomy = $post->post_type.'category';
1589 1589
             $field_value = $post->{$html_var};
1590 1590
             $links = array();
1591 1591
             $terms = array();
@@ -1603,7 +1603,7 @@  discard block
 block discarded – undo
1603 1603
                     if ($term != '') {
1604 1604
                         $term = get_term_by('id', $term, $html_var);
1605 1605
                         if (is_object($term)) {
1606
-                            $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1606
+                            $links[] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>";
1607 1607
                             $terms[] = $term;
1608 1608
                         }
1609 1609
                     }
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
                     $terms = $termsOrdered;
1618 1618
                 }
1619 1619
             }
1620
-            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1620
+            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : '';
1621 1621
 
1622 1622
             if ($html_value != '') {
1623 1623
                 $field_icon = geodir_field_icon_proccess($cf);
@@ -1630,9 +1630,9 @@  discard block
 block discarded – undo
1630 1630
                     $field_icon = '';
1631 1631
                 }
1632 1632
 
1633
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1634
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1635
-                $html .= '</span> ' . $html_value . '</div>';
1633
+                $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af;
1634
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1635
+                $html .= '</span> '.$html_value.'</div>';
1636 1636
             }
1637 1637
         }
1638 1638
 
@@ -1640,7 +1640,7 @@  discard block
 block discarded – undo
1640 1640
 
1641 1641
     return $html;
1642 1642
 }
1643
-add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3);
1643
+add_filter('geodir_custom_field_output_taxonomy', 'geodir_cf_taxonomy', 10, 3);
1644 1644
 
1645 1645
 
1646 1646
 /**
@@ -1653,21 +1653,21 @@  discard block
 block discarded – undo
1653 1653
  *
1654 1654
  * @return string The html to output for the custom field.
1655 1655
  */
1656
-function geodir_cf_address($html,$location,$cf,$p=''){
1656
+function geodir_cf_address($html, $location, $cf, $p = '') {
1657 1657
 
1658 1658
     // check we have the post value
1659
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1660
-    else{ global $post;}
1659
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1660
+    else { global $post; }
1661 1661
 
1662
-    if(!is_array($cf) && $cf!=''){
1662
+    if (!is_array($cf) && $cf != '') {
1663 1663
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1664
-        if(!$cf){return NULL;}
1664
+        if (!$cf) {return NULL; }
1665 1665
     }
1666 1666
 
1667 1667
     $html_var = $cf['htmlvar_name'];
1668 1668
 
1669 1669
     // Check if there is a location specific filter.
1670
-    if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1670
+    if (has_filter("geodir_custom_field_output_address_loc_{$location}")) {
1671 1671
         /**
1672 1672
          * Filter the address html by location.
1673 1673
          *
@@ -1675,11 +1675,11 @@  discard block
 block discarded – undo
1675 1675
          * @param array $cf The custom field array.
1676 1676
          * @since 1.6.6
1677 1677
          */
1678
-        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1678
+        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}", $html, $cf);
1679 1679
     }
1680 1680
 
1681 1681
     // Check if there is a custom field specific filter.
1682
-    if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1682
+    if (has_filter("geodir_custom_field_output_address_var_{$html_var}")) {
1683 1683
         /**
1684 1684
          * Filter the address html by individual custom field.
1685 1685
          *
@@ -1688,11 +1688,11 @@  discard block
 block discarded – undo
1688 1688
          * @param array $cf The custom field array.
1689 1689
          * @since 1.6.6
1690 1690
          */
1691
-        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1691
+        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}", $html, $location, $cf);
1692 1692
     }
1693 1693
 
1694 1694
     // Check if there is a custom field key specific filter.
1695
-    if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1695
+    if (has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")) {
1696 1696
         /**
1697 1697
          * Filter the address html by field type key.
1698 1698
          *
@@ -1701,14 +1701,14 @@  discard block
 block discarded – undo
1701 1701
          * @param array $cf The custom field array.
1702 1702
          * @since 1.6.6
1703 1703
          */
1704
-        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1704
+        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}", $html, $location, $cf);
1705 1705
     }
1706 1706
 
1707 1707
     // If not html then we run the standard output.
1708
-    if(empty($html)){
1708
+    if (empty($html)) {
1709 1709
 
1710 1710
         global $preview;
1711
-        $html_var = $cf['htmlvar_name'] . '_address';
1711
+        $html_var = $cf['htmlvar_name'].'_address';
1712 1712
 
1713 1713
         if ($cf['extra_fields']) {
1714 1714
 
@@ -1771,10 +1771,10 @@  discard block
 block discarded – undo
1771 1771
 
1772 1772
         if ($post->{$html_var}) {
1773 1773
 
1774
-            $field_icon = geodir_field_icon_proccess( $cf );
1775
-            if ( strpos( $field_icon, 'http' ) !== false ) {
1774
+            $field_icon = geodir_field_icon_proccess($cf);
1775
+            if (strpos($field_icon, 'http') !== false) {
1776 1776
                 $field_icon_af = '';
1777
-            } elseif ( $field_icon == '' ) {
1777
+            } elseif ($field_icon == '') {
1778 1778
                 $field_icon_af = '<i class="fa fa-home"></i>';
1779 1779
             } else {
1780 1780
                 $field_icon_af = $field_icon;
@@ -1783,26 +1783,26 @@  discard block
 block discarded – undo
1783 1783
             
1784 1784
 
1785 1785
 
1786
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
1787
-            $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1788
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1786
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
1787
+            $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af;
1788
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
1789 1789
             $html .= '</span>';
1790 1790
 
1791 1791
 
1792
-            if ( $post->post_address ) {
1793
-                $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
1792
+            if ($post->post_address) {
1793
+                $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>';
1794 1794
             }
1795
-            if ($show_city_in_address && $post->post_city ) {
1796
-                $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
1795
+            if ($show_city_in_address && $post->post_city) {
1796
+                $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>';
1797 1797
             }
1798
-            if ($show_region_in_address && $post->post_region ) {
1799
-                $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
1798
+            if ($show_region_in_address && $post->post_region) {
1799
+                $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>';
1800 1800
             }
1801
-            if ($show_zip_in_address && $post->post_zip ) {
1802
-                $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
1801
+            if ($show_zip_in_address && $post->post_zip) {
1802
+                $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>';
1803 1803
             }
1804
-            if ($show_country_in_address && $post->post_country ) {
1805
-                $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
1804
+            if ($show_country_in_address && $post->post_country) {
1805
+                $html .= '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span><br>';
1806 1806
             }
1807 1807
             $html .= '</div>';
1808 1808
 
@@ -1813,4 +1813,4 @@  discard block
 block discarded – undo
1813 1813
 
1814 1814
     return $html;
1815 1815
 }
1816
-add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3);
1817 1816
\ No newline at end of file
1817
+add_filter('geodir_custom_field_output_address', 'geodir_cf_address', 10, 3);
1818 1818
\ No newline at end of file
Please login to merge, or discard this patch.