Test Failed
Pull Request — master (#238)
by Kiran
09:22
created
geodirectory_template_tags.php 1 patch
Indentation   +343 added lines, -343 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,158 +35,158 @@  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_ajax_url' => geodir_get_ajax_url(),
54
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
-        'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56
-    );
57
-
58
-    /**
59
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
60
-     *
61
-     * This is used by addons to add JS translatable variables.
62
-     *
63
-     * @since 1.4.4
64
-     * @param array $geodir_vars_data {
65
-     *    geodir var data used by addons to add JS translatable variables.
66
-     *
67
-     *    @type string $siteurl Site url.
68
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
69
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
70
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
71
-     *    @type int $is_rtl Checks if current locale is RTL.
72
-     *
73
-     * }
74
-     */
75
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
-
77
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78
-
79
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
80
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
81
-
82
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
-    wp_enqueue_script('geodirectory-lightbox-jquery');
84
-
85
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
-    if ($is_detail_page) {
87
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
88
-    }
89
-
90
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
91
-        $map_lang = "&language=" . geodir_get_map_default_language();
92
-        /**
93
-         * Filter the variables that are added to the end of the google maps script call.
94
-         *
95
-         * This i used to change things like google maps language etc.
96
-         *
97
-         * @since 1.0.0
98
-         * @param string $var The string to filter, default is empty string.
99
-         */
100
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
101
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
102
-    }
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_ajax_url' => geodir_get_ajax_url(),
54
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+		'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56
+	);
57
+
58
+	/**
59
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
60
+	 *
61
+	 * This is used by addons to add JS translatable variables.
62
+	 *
63
+	 * @since 1.4.4
64
+	 * @param array $geodir_vars_data {
65
+	 *    geodir var data used by addons to add JS translatable variables.
66
+	 *
67
+	 *    @type string $siteurl Site url.
68
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
69
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
70
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
71
+	 *    @type int $is_rtl Checks if current locale is RTL.
72
+	 *
73
+	 * }
74
+	 */
75
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+
77
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78
+
79
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
80
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
81
+
82
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+	wp_enqueue_script('geodirectory-lightbox-jquery');
84
+
85
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+	if ($is_detail_page) {
87
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
88
+	}
89
+
90
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
91
+		$map_lang = "&language=" . geodir_get_map_default_language();
92
+		/**
93
+		 * Filter the variables that are added to the end of the google maps script call.
94
+		 *
95
+		 * This i used to change things like google maps language etc.
96
+		 *
97
+		 * @since 1.0.0
98
+		 * @param string $var The string to filter, default is empty string.
99
+		 */
100
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
101
+		wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
102
+	}
103 103
     
104
-    if ($geodir_map_name == 'osm') {
105
-        // Leaflet OpenStreetMap
106
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107
-        wp_enqueue_style('geodirectory-leaflet-style');
104
+	if ($geodir_map_name == 'osm') {
105
+		// Leaflet OpenStreetMap
106
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107
+		wp_enqueue_style('geodirectory-leaflet-style');
108 108
             
109
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110
-        wp_enqueue_script('geodirectory-leaflet-script');
109
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110
+		wp_enqueue_script('geodirectory-leaflet-script');
111 111
         
112
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
114
-    }
115
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
112
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
114
+	}
115
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
116 116
     
117
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
118
-    wp_enqueue_script('geodirectory-goMap-script');
119
-
120
-
121
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122
-    wp_enqueue_script('chosen');
123
-
124
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125
-    wp_enqueue_script('geodirectory-choose-ajax');
126
-
127
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
128
-
129
-    if (is_page() && geodir_is_page('add-listing')) {
130
-        // SCRIPT FOR UPLOAD
131
-        wp_enqueue_script('plupload-all');
132
-        wp_enqueue_script('jquery-ui-sortable');
133
-
134
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
135
-        wp_enqueue_script('geodirectory-plupload-script');
136
-        // SCRIPT FOR UPLOAD END
137
-
138
-        // 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
139
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
140
-            $ajax_url = admin_url('admin-ajax.php');
141
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
142
-            $ajax_url = admin_url('admin-ajax.php');
143
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
144
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
145
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
146
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
147
-        } else {
148
-            $ajax_url = admin_url('admin-ajax.php');
149
-        }
117
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
118
+	wp_enqueue_script('geodirectory-goMap-script');
119
+
120
+
121
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122
+	wp_enqueue_script('chosen');
123
+
124
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125
+	wp_enqueue_script('geodirectory-choose-ajax');
126
+
127
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
128
+
129
+	if (is_page() && geodir_is_page('add-listing')) {
130
+		// SCRIPT FOR UPLOAD
131
+		wp_enqueue_script('plupload-all');
132
+		wp_enqueue_script('jquery-ui-sortable');
133
+
134
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
135
+		wp_enqueue_script('geodirectory-plupload-script');
136
+		// SCRIPT FOR UPLOAD END
137
+
138
+		// 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
139
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
140
+			$ajax_url = admin_url('admin-ajax.php');
141
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
142
+			$ajax_url = admin_url('admin-ajax.php');
143
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
144
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
145
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
146
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
147
+		} else {
148
+			$ajax_url = admin_url('admin-ajax.php');
149
+		}
150 150
 
151
-        // place js config array for plupload
152
-        $plupload_init = array(
153
-            'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
154
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
155
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
156
-            'drop_element' => 'dropbox', // will be adjusted per uploader
157
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
158
-            'multiple_queues' => true,
159
-            'max_file_size' => geodir_max_upload_size(),
160
-            'url' => $ajax_url,
161
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
162
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
163
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
164
-            'multipart' => true,
165
-            'urlstream_upload' => true,
166
-            'multi_selection' => false, // will be added per uploader
167
-            // additional post data to send to our ajax hook
168
-            'multipart_params' => array(
169
-                '_ajax_nonce' => "", // will be added per uploader
170
-                'action' => 'plupload_action', // the ajax action name
171
-                'imgid' => 0 // will be added per uploader
172
-            )
173
-        );
174
-        $base_plupload_config = json_encode($plupload_init);
175
-
176
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
177
-            'upload_img_size' => geodir_max_upload_size());
178
-
179
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
180
-
181
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
182
-    } // End if for add place page
183
-
184
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185
-    if ($is_detail_page) {
151
+		// place js config array for plupload
152
+		$plupload_init = array(
153
+			'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
154
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
155
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
156
+			'drop_element' => 'dropbox', // will be adjusted per uploader
157
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
158
+			'multiple_queues' => true,
159
+			'max_file_size' => geodir_max_upload_size(),
160
+			'url' => $ajax_url,
161
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
162
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
163
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
164
+			'multipart' => true,
165
+			'urlstream_upload' => true,
166
+			'multi_selection' => false, // will be added per uploader
167
+			// additional post data to send to our ajax hook
168
+			'multipart_params' => array(
169
+				'_ajax_nonce' => "", // will be added per uploader
170
+				'action' => 'plupload_action', // the ajax action name
171
+				'imgid' => 0 // will be added per uploader
172
+			)
173
+		);
174
+		$base_plupload_config = json_encode($plupload_init);
175
+
176
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
177
+			'upload_img_size' => geodir_max_upload_size());
178
+
179
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
180
+
181
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
182
+	} // End if for add place page
183
+
184
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185
+	if ($is_detail_page) {
186 186
 		wp_enqueue_script('geodirectory-post-custom-js');
187 187
 	}
188 188
 
189
-    // font awesome rating script
189
+	// font awesome rating script
190 190
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
191 191
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
192 192
 		wp_enqueue_script('geodir-barrating-js');
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 		wp_enqueue_script('geodir-jRating-js');
196 196
 	}
197 197
 
198
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199
-    wp_enqueue_script('geodir-on-document-load');
198
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199
+	wp_enqueue_script('geodir-on-document-load');
200 200
 
201
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202
-    wp_enqueue_script('google-geometa');
201
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202
+	wp_enqueue_script('google-geometa');
203 203
 }
204 204
 
205 205
 /**
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
  */
214 214
 function geodir_header_scripts()
215 215
 {
216
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
217
-    echo stripslashes(get_option('geodir_header_scripts'));
216
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
217
+	echo stripslashes(get_option('geodir_header_scripts'));
218 218
 }
219 219
 
220 220
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 function geodir_footer_scripts()
231 231
 {	
232 232
 	echo stripslashes(get_option('geodir_ga_tracking_code'));
233
-    echo stripslashes(get_option('geodir_footer_scripts'));
233
+	echo stripslashes(get_option('geodir_footer_scripts'));
234 234
 }
235 235
 
236 236
 
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
  */
245 245
 function geodir_add_async_forscript($url)
246 246
 {
247
-    if (strpos($url, '#asyncload')===false)
248
-        return $url;
249
-    else if (is_admin())
250
-        return str_replace('#asyncload', '', $url);
251
-    else
252
-        return str_replace('#asyncload', '', $url)."' async='async";
247
+	if (strpos($url, '#asyncload')===false)
248
+		return $url;
249
+	else if (is_admin())
250
+		return str_replace('#asyncload', '', $url);
251
+	else
252
+		return str_replace('#asyncload', '', $url)."' async='async";
253 253
 }
254 254
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
255 255
 
@@ -263,55 +263,55 @@  discard block
 block discarded – undo
263 263
 {
264 264
 
265 265
 
266
-    if(get_option('geodir_scss_core')) {
266
+	if(get_option('geodir_scss_core')) {
267 267
 
268 268
 
269
-        wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
270
-        wp_enqueue_style('geodirectory-frontend-style');
269
+		wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
270
+		wp_enqueue_style('geodirectory-frontend-style');
271 271
 
272
-        wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
273
-        wp_enqueue_style('geodirectory-media-style');
272
+		wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
273
+		wp_enqueue_style('geodirectory-media-style');
274 274
 
275 275
 
276
-        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
277
-        wp_enqueue_style('geodirectory-jquery-ui-css');
276
+		wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
277
+		wp_enqueue_style('geodirectory-jquery-ui-css');
278 278
 
279
-        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
280
-        wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
279
+		wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
280
+		wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
281 281
 
282
-        wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
283
-        wp_enqueue_style('geodirectory-flexslider-css');
282
+		wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
283
+		wp_enqueue_style('geodirectory-flexslider-css');
284 284
 
285
-        wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
286
-        wp_enqueue_style('geodirectory-thic-box-css');
285
+		wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
286
+		wp_enqueue_style('geodirectory-thic-box-css');
287 287
 
288
-        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
289
-        wp_enqueue_style('geodirectory-pluplodar-css');
288
+		wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
289
+		wp_enqueue_style('geodirectory-pluplodar-css');
290 290
 
291
-        wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
292
-        wp_enqueue_style('geodirectory-lightbox-css');
291
+		wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
292
+		wp_enqueue_style('geodirectory-lightbox-css');
293 293
 
294
-        wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
295
-        wp_enqueue_style('geodir-rating-style');
294
+		wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
295
+		wp_enqueue_style('geodir-rating-style');
296 296
 
297
-        wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
298
-        wp_enqueue_style('geodir-chosen-style');
297
+		wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
298
+		wp_enqueue_style('geodir-chosen-style');
299 299
 
300
-    }else{
301
-        wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
302
-        wp_enqueue_style('geodir-core-scss');
300
+	}else{
301
+		wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
302
+		wp_enqueue_style('geodir-core-scss');
303 303
 
304
-        wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
304
+		wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
305 305
 
306
-    }
306
+	}
307 307
 
308
-    if(is_rtl()){
309
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
310
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
311
-    }
308
+	if(is_rtl()){
309
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
310
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
311
+	}
312 312
 
313
-    wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
314
-    wp_enqueue_style('geodirectory-font-awesome');
313
+	wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
314
+	wp_enqueue_style('geodirectory-font-awesome');
315 315
 
316 316
 
317 317
 }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
  */
326 326
 function geodir_get_sidebar()
327 327
 {
328
-    get_sidebar('geodirectory');
328
+	get_sidebar('geodirectory');
329 329
 }
330 330
 
331 331
 /**
@@ -344,122 +344,122 @@  discard block
 block discarded – undo
344 344
  * @param bool $always_show Do you want to show the pagination always? Default: false.
345 345
  */
346 346
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
347
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
347
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
348 348
 
349
-    if (empty($prelabel)) {
350
-        $prelabel = '<strong>&laquo;</strong>';
351
-    }
349
+	if (empty($prelabel)) {
350
+		$prelabel = '<strong>&laquo;</strong>';
351
+	}
352 352
 
353
-    if (empty($nxtlabel)) {
354
-        $nxtlabel = '<strong>&raquo;</strong>';
355
-    }
353
+	if (empty($nxtlabel)) {
354
+		$nxtlabel = '<strong>&raquo;</strong>';
355
+	}
356 356
 
357
-    $half_pages_to_show = round($pages_to_show / 2);
357
+	$half_pages_to_show = round($pages_to_show / 2);
358 358
 
359
-    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
360
-        return;
359
+	if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
360
+		return;
361 361
 
362
-    if (!is_single()) {
363
-        if (function_exists('geodir_location_geo_home_link')) {
364
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
365
-        }
366
-        $numposts = $wp_query->found_posts;
362
+	if (!is_single()) {
363
+		if (function_exists('geodir_location_geo_home_link')) {
364
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
365
+		}
366
+		$numposts = $wp_query->found_posts;
367 367
 
368
-        $max_page = ceil($numposts / $posts_per_page);
368
+		$max_page = ceil($numposts / $posts_per_page);
369 369
 
370
-        if (empty($paged)) {
371
-            $paged = 1;
372
-        }
370
+		if (empty($paged)) {
371
+			$paged = 1;
372
+		}
373 373
         
374
-        $post_type = geodir_get_current_posttype();
375
-        $listing_type_name = get_post_type_plural_label($post_type);
376
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
377
-            $term = array();
374
+		$post_type = geodir_get_current_posttype();
375
+		$listing_type_name = get_post_type_plural_label($post_type);
376
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
377
+			$term = array();
378 378
             
379
-            if (is_tax()) {
380
-                $term_id = get_queried_object_id();
381
-                $taxonomy = get_query_var('taxonomy');
379
+			if (is_tax()) {
380
+				$term_id = get_queried_object_id();
381
+				$taxonomy = get_query_var('taxonomy');
382 382
 
383
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
384
-                    $term = get_term($term_id, $post_type . 'category');
385
-                }
386
-            }
383
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
384
+					$term = get_term($term_id, $post_type . 'category');
385
+				}
386
+			}
387 387
             
388
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
389
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
388
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
389
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
390 390
                 
391
-                if (!is_array($taxonomy_search)) {
392
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
393
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
395
-                }
396
-            }
391
+				if (!is_array($taxonomy_search)) {
392
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
393
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
395
+				}
396
+			}
397 397
             
398
-            if (!empty($term) && !is_wp_error($term)) {
399
-                $listing_type_name = $term->name;
400
-            }
401
-        }
398
+			if (!empty($term) && !is_wp_error($term)) {
399
+				$listing_type_name = $term->name;
400
+			}
401
+		}
402 402
 
403
-        if ($max_page > 1 || $always_show) {            
404
-            // Extra pagination info
405
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
406
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
407
-            $end_no = min($paged * $posts_per_page, $numposts);
403
+		if ($max_page > 1 || $always_show) {            
404
+			// Extra pagination info
405
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
406
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
407
+			$end_no = min($paged * $posts_per_page, $numposts);
408 408
 
409
-            if ($geodir_pagination_more_info != '') {
410
-                if ($listing_type_name) {
411
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
412
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
413
-                } else {
414
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
415
-                }
416
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
417
-                /**
418
-                 * Adds an extra pagination info above/under pagination.
419
-                 *
420
-                 * @since 1.5.9
421
-                 *
422
-                 * @param string $pagination_info Extra pagination info content.
423
-                 * @param string $listing_type_name Listing results type.
424
-                 * @param string $start_no First result number.
425
-                 * @param string $end_no Last result number.
426
-                 * @param string $numposts Total number of listings.
427
-                 * @param string $post_type The post type.
428
-                 */
429
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
409
+			if ($geodir_pagination_more_info != '') {
410
+				if ($listing_type_name) {
411
+					$listing_type_name = __($listing_type_name, 'geodirectory');
412
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
413
+				} else {
414
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
415
+				}
416
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
417
+				/**
418
+				 * Adds an extra pagination info above/under pagination.
419
+				 *
420
+				 * @since 1.5.9
421
+				 *
422
+				 * @param string $pagination_info Extra pagination info content.
423
+				 * @param string $listing_type_name Listing results type.
424
+				 * @param string $start_no First result number.
425
+				 * @param string $end_no Last result number.
426
+				 * @param string $numposts Total number of listings.
427
+				 * @param string $post_type The post type.
428
+				 */
429
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
430 430
                 
431
-                if ($geodir_pagination_more_info == 'before') {
432
-                    $before = $before . $pagination_info;
433
-                } else if ($geodir_pagination_more_info == 'after') {
434
-                    $after = $pagination_info . $after;
435
-                }
436
-            }
431
+				if ($geodir_pagination_more_info == 'before') {
432
+					$before = $before . $pagination_info;
433
+				} else if ($geodir_pagination_more_info == 'after') {
434
+					$after = $pagination_info . $after;
435
+				}
436
+			}
437 437
             
438
-            echo "$before <div class='Navi'>";
439
-            if ($paged >= ($pages_to_show - 1)) {
440
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
441
-            }
442
-            previous_posts_link($prelabel);
443
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
444
-                if ($i >= 1 && $i <= $max_page) {
445
-                    if ($i == $paged) {
446
-                        echo "<strong class='on'>$i</strong>";
447
-                    } else {
448
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
449
-                    }
450
-                }
451
-            }
452
-            next_posts_link($nxtlabel, $max_page);
453
-            if (($paged + $half_pages_to_show) < ($max_page)) {
454
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
455
-            }
456
-            echo "</div> $after";
457
-        }
438
+			echo "$before <div class='Navi'>";
439
+			if ($paged >= ($pages_to_show - 1)) {
440
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
441
+			}
442
+			previous_posts_link($prelabel);
443
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
444
+				if ($i >= 1 && $i <= $max_page) {
445
+					if ($i == $paged) {
446
+						echo "<strong class='on'>$i</strong>";
447
+					} else {
448
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
449
+					}
450
+				}
451
+			}
452
+			next_posts_link($nxtlabel, $max_page);
453
+			if (($paged + $half_pages_to_show) < ($max_page)) {
454
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
455
+			}
456
+			echo "</div> $after";
457
+		}
458 458
         
459
-        if (function_exists('geodir_location_geo_home_link')) {
460
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
461
-        }
462
-    }
459
+		if (function_exists('geodir_location_geo_home_link')) {
460
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
461
+		}
462
+	}
463 463
 }
464 464
 
465 465
 /**
@@ -470,20 +470,20 @@  discard block
 block discarded – undo
470 470
  */
471 471
 function geodir_listingsearch_scripts()
472 472
 {
473
-    if (get_option('gd_search_dist') != '') {
474
-        $dist = get_option('gd_search_dist');
475
-    } else {
476
-        $dist = 500;
477
-    }
478
-    $dist_dif = 1000;
479
-
480
-    if ($dist <= 5000) $dist_dif = 500;
481
-    if ($dist <= 1000) $dist_dif = 100;
482
-    if ($dist <= 500) $dist_dif = 50;
483
-    if ($dist <= 100) $dist_dif = 10;
484
-    if ($dist <= 50) $dist_dif = 5;
485
-
486
-    ?>
473
+	if (get_option('gd_search_dist') != '') {
474
+		$dist = get_option('gd_search_dist');
475
+	} else {
476
+		$dist = 500;
477
+	}
478
+	$dist_dif = 1000;
479
+
480
+	if ($dist <= 5000) $dist_dif = 500;
481
+	if ($dist <= 1000) $dist_dif = 100;
482
+	if ($dist <= 500) $dist_dif = 50;
483
+	if ($dist <= 100) $dist_dif = 10;
484
+	if ($dist <= 50) $dist_dif = 5;
485
+
486
+	?>
487 487
     <script type="text/javascript">
488 488
 
489 489
         jQuery(function ($) {
@@ -542,15 +542,15 @@  discard block
 block discarded – undo
542 542
 function geodir_add_sharelocation_scripts()
543 543
 {
544 544
 
545
-    $default_search_for_text = SEARCH_FOR_TEXT;
546
-    if (get_option('geodir_search_field_default_text'))
547
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
545
+	$default_search_for_text = SEARCH_FOR_TEXT;
546
+	if (get_option('geodir_search_field_default_text'))
547
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
548 548
 
549
-    $default_near_text = NEAR_TEXT;
550
-    if (get_option('geodir_near_field_default_text'))
551
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
549
+	$default_near_text = NEAR_TEXT;
550
+	if (get_option('geodir_near_field_default_text'))
551
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
552 552
 
553
-    ?>
553
+	?>
554 554
 
555 555
 
556 556
     <script type="text/javascript">
@@ -628,14 +628,14 @@  discard block
 block discarded – undo
628 628
                         initialise2();
629 629
                     } else {
630 630
                         Sgeocoder.geocode({'address': address<?php
631
-                        if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';}
632
-                        if($near_add2 =
633
-                        /**
634
-                         * Adds any extra info to the near search box query when trying to geolocate it via google api.
635
-                         *
636
-                         * @since 1.0.0
637
-                         */
638
-                        apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>},
631
+						if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';}
632
+						if($near_add2 =
633
+						/**
634
+						 * Adds any extra info to the near search box query when trying to geolocate it via google api.
635
+						 *
636
+						 * @since 1.0.0
637
+						 */
638
+						apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>},
639 639
                             function (results, status) {
640 640
                                 if (status == google.maps.GeocoderStatus.OK) {
641 641
                                     updateSearchPosition(results[0].geometry.location, $form);
@@ -715,30 +715,30 @@  discard block
 block discarded – undo
715 715
  */
716 716
 function geodir_show_badges_on_image($which, $post, $link)
717 717
 {
718
-    $return = '';
719
-    switch ($which) {
720
-        case 'featured':
721
-            /**
722
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
723
-             *
724
-             * @since 1.0.0
725
-             * @param object $post The post object.
726
-             * @param string $link The link to the post.
727
-             */
728
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
729
-            break;
730
-        case 'new' :
731
-            /**
732
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
733
-             *
734
-             * @since 1.0.0
735
-             * @param object $post The post object.
736
-             * @param string $link The link to the post.
737
-             */
738
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
739
-            break;
740
-
741
-    }
718
+	$return = '';
719
+	switch ($which) {
720
+		case 'featured':
721
+			/**
722
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
723
+			 *
724
+			 * @since 1.0.0
725
+			 * @param object $post The post object.
726
+			 * @param string $link The link to the post.
727
+			 */
728
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
729
+			break;
730
+		case 'new' :
731
+			/**
732
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
733
+			 *
734
+			 * @since 1.0.0
735
+			 * @param object $post The post object.
736
+			 * @param string $link The link to the post.
737
+			 */
738
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
739
+			break;
740
+
741
+	}
742 742
     
743
-    return $return;
743
+	return $return;
744 744
 }
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/get_markers.php 1 patch
Indentation   +228 added lines, -228 removed lines patch added patch discarded remove patch
@@ -7,59 +7,59 @@  discard block
 block discarded – undo
7 7
  */
8 8
  
9 9
 if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'homemap_catlist') {
10
-    $gd_post_type = sanitize_text_field($_REQUEST['post_type']);
11
-    $post_taxonomy = geodir_get_taxonomies($gd_post_type);
12
-    $map_canvas_name = sanitize_text_field($_REQUEST['map_canvas']);
13
-    $child_collapse = (bool)$_REQUEST['child_collapse'];
14
-    echo home_map_taxonomy_walker($post_taxonomy, 0, true, 0, $map_canvas_name, $child_collapse, true);
15
-    die;
10
+	$gd_post_type = sanitize_text_field($_REQUEST['post_type']);
11
+	$post_taxonomy = geodir_get_taxonomies($gd_post_type);
12
+	$map_canvas_name = sanitize_text_field($_REQUEST['map_canvas']);
13
+	$child_collapse = (bool)$_REQUEST['child_collapse'];
14
+	echo home_map_taxonomy_walker($post_taxonomy, 0, true, 0, $map_canvas_name, $child_collapse, true);
15
+	die;
16 16
 }
17 17
 
18 18
 // Send the content-type header with correct encoding
19 19
 header("Content-type: text/javascript; charset=utf-8");
20 20
 
21 21
 if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'cat') { // Retrives markers data for categories
22
-    echo get_markers();
23
-    exit;
22
+	echo get_markers();
23
+	exit;
24 24
 } else if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'info') { // Retrives marker info window html
25
-    /**
26
-     * @global object $wpdb WordPress Database object.
27
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
28
-     * @global object $gd_session GeoDirectory Session object.
29
-     */
30
-    global $wpdb, $plugin_prefix, $gd_session;
31
-
32
-    if ($_REQUEST['m_id'] != '') {
33
-        $pid = (int)$_REQUEST['m_id'];
34
-    } else {
35
-        echo __('No marker data found', 'geodirectory');
36
-        exit;
37
-    }
38
-
39
-    if (isset($_REQUEST['post_preview']) && $_REQUEST['post_preview'] != '' && $gd_ses_listing = $gd_session->get('listing')) {
40
-        $post = (object)$gd_ses_listing;
41
-        echo geodir_get_infowindow_html($post, $_REQUEST['post_preview']);
42
-    } else {
43
-        $geodir_post_type = get_post_type($pid);
44
-
45
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
46
-
47
-        $sql = $wpdb->prepare("SELECT * FROM " . $table . " WHERE post_id = %d", array($pid));
48
-
49
-        $postinfo = $wpdb->get_results($sql);
50
-
51
-        $data_arr = array();
52
-
53
-        if ($postinfo) {
54
-            $srcharr = array("'", "/", "-", '"', '\\');
55
-            $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
56
-
57
-            foreach ($postinfo as $postinfo_obj) {
58
-                echo geodir_get_infowindow_html($postinfo_obj);
59
-            }
60
-        }
61
-    }
62
-    exit;
25
+	/**
26
+	 * @global object $wpdb WordPress Database object.
27
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
28
+	 * @global object $gd_session GeoDirectory Session object.
29
+	 */
30
+	global $wpdb, $plugin_prefix, $gd_session;
31
+
32
+	if ($_REQUEST['m_id'] != '') {
33
+		$pid = (int)$_REQUEST['m_id'];
34
+	} else {
35
+		echo __('No marker data found', 'geodirectory');
36
+		exit;
37
+	}
38
+
39
+	if (isset($_REQUEST['post_preview']) && $_REQUEST['post_preview'] != '' && $gd_ses_listing = $gd_session->get('listing')) {
40
+		$post = (object)$gd_ses_listing;
41
+		echo geodir_get_infowindow_html($post, $_REQUEST['post_preview']);
42
+	} else {
43
+		$geodir_post_type = get_post_type($pid);
44
+
45
+		$table = $plugin_prefix . $geodir_post_type . '_detail';
46
+
47
+		$sql = $wpdb->prepare("SELECT * FROM " . $table . " WHERE post_id = %d", array($pid));
48
+
49
+		$postinfo = $wpdb->get_results($sql);
50
+
51
+		$data_arr = array();
52
+
53
+		if ($postinfo) {
54
+			$srcharr = array("'", "/", "-", '"', '\\');
55
+			$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
56
+
57
+			foreach ($postinfo as $postinfo_obj) {
58
+				echo geodir_get_infowindow_html($postinfo_obj);
59
+			}
60
+		}
61
+	}
62
+	exit;
63 63
 }
64 64
 
65 65
 /**
@@ -77,80 +77,80 @@  discard block
 block discarded – undo
77 77
  * @return string
78 78
  */
79 79
 function get_markers() {
80
-    global $wpdb, $plugin_prefix, $geodir_cat_icons, $gd_marker_sizes;
80
+	global $wpdb, $plugin_prefix, $geodir_cat_icons, $gd_marker_sizes;
81 81
 
82
-    $search = '';
83
-    $main_query_array;
82
+	$search = '';
83
+	$main_query_array;
84 84
 
85
-    $srcharr = array("'", "/", "-", '"', '\\');
86
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
85
+	$srcharr = array("'", "/", "-", '"', '\\');
86
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
87 87
 
88
-    $post_type = isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : 'gd_place';
88
+	$post_type = isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : 'gd_place';
89 89
 
90
-    $map_cat_ids_array = array('0');
91
-    $cat_find_array = array(" FIND_IN_SET(%d, pd." . $post_type . "category)");
90
+	$map_cat_ids_array = array('0');
91
+	$cat_find_array = array(" FIND_IN_SET(%d, pd." . $post_type . "category)");
92 92
 
93 93
 
94
-    $field_default_cat = '';
95
-    if (isset($_REQUEST['cat_id']) && $_REQUEST['cat_id'] != '') {
96
-        $map_cat_arr = trim($_REQUEST['cat_id'], ',');
94
+	$field_default_cat = '';
95
+	if (isset($_REQUEST['cat_id']) && $_REQUEST['cat_id'] != '') {
96
+		$map_cat_arr = trim($_REQUEST['cat_id'], ',');
97 97
 
98
-        if (!empty($map_cat_arr)) {
99
-            $field_default_cat .= "WHEN (default_category IN (" . $map_cat_arr . ")) THEN default_category ";
98
+		if (!empty($map_cat_arr)) {
99
+			$field_default_cat .= "WHEN (default_category IN (" . $map_cat_arr . ")) THEN default_category ";
100 100
 
101
-            $map_cat_ids_array = explode(',', $map_cat_arr);
102
-            $cat_find_array = array();
103
-            foreach ($map_cat_ids_array as $cat_id) {
104
-                $field_default_cat .= "WHEN (FIND_IN_SET($cat_id, `" . $post_type . "category`) > 0) THEN $cat_id ";
105
-                $cat_find_array[] = " FIND_IN_SET(%d, pd." . $post_type . "category)";
106
-                $main_query_array[] = $cat_id;
107
-            }
101
+			$map_cat_ids_array = explode(',', $map_cat_arr);
102
+			$cat_find_array = array();
103
+			foreach ($map_cat_ids_array as $cat_id) {
104
+				$field_default_cat .= "WHEN (FIND_IN_SET($cat_id, `" . $post_type . "category`) > 0) THEN $cat_id ";
105
+				$cat_find_array[] = " FIND_IN_SET(%d, pd." . $post_type . "category)";
106
+				$main_query_array[] = $cat_id;
107
+			}
108 108
 
109
-        }
110
-    }
109
+		}
110
+	}
111 111
 
112
-    if (!empty($field_default_cat))
113
-        $field_default_cat = '';
112
+	if (!empty($field_default_cat))
113
+		$field_default_cat = '';
114 114
 
115
-    if (!empty($cat_find_array))
116
-        $search .= "AND (" . implode(' OR ', $cat_find_array) . ")";
115
+	if (!empty($cat_find_array))
116
+		$search .= "AND (" . implode(' OR ', $cat_find_array) . ")";
117 117
 
118
-    $main_query_array = $map_cat_ids_array;
118
+	$main_query_array = $map_cat_ids_array;
119 119
   
120
-    if (isset($_REQUEST['search']) && !empty($_REQUEST['search']) && $_REQUEST['search'] != __('Title', 'geodirectory')) {
121
-        $search .= " AND p.post_title LIKE %s";
122
-        $main_query_array[] = "%" . $_REQUEST['search'] . "%";
123
-    }
124
-
125
-    /**
126
-     * Filter the marker query search SQL, values are replaces with %s or %d.
127
-     *
128
-     * @since 1.5.3
129
-     *
130
-     * @param string $search The SQL query for search/where.
131
-     */
132
-    $search = apply_filters('geodir_marker_search', $search);
133
-    /**
134
-     * Filter the marker query search SQL values %s and %d, this is an array of values.
135
-     *
136
-     * @since 1.5.3
137
-     *
138
-     * @param array $main_query_array The SQL query values for search/where.
139
-     */
140
-    $main_query_array = apply_filters('geodir_marker_main_query_array', $main_query_array);
141
-
142
-    $gd_posttype = '';
143
-    if (isset($_REQUEST['gd_posttype']) && $_REQUEST['gd_posttype'] != '') {
144
-        $table = $plugin_prefix . $_REQUEST['gd_posttype'] . '_detail';
145
-        $gd_posttype = " AND p.post_type = %s";
146
-        $main_query_array[] = $_REQUEST['gd_posttype'];
147
-
148
-    } else
149
-        $table = $plugin_prefix . 'gd_place_detail';
150
-
151
-    $join = ", " . $table . " AS pd ";
152
-
153
-    /**
120
+	if (isset($_REQUEST['search']) && !empty($_REQUEST['search']) && $_REQUEST['search'] != __('Title', 'geodirectory')) {
121
+		$search .= " AND p.post_title LIKE %s";
122
+		$main_query_array[] = "%" . $_REQUEST['search'] . "%";
123
+	}
124
+
125
+	/**
126
+	 * Filter the marker query search SQL, values are replaces with %s or %d.
127
+	 *
128
+	 * @since 1.5.3
129
+	 *
130
+	 * @param string $search The SQL query for search/where.
131
+	 */
132
+	$search = apply_filters('geodir_marker_search', $search);
133
+	/**
134
+	 * Filter the marker query search SQL values %s and %d, this is an array of values.
135
+	 *
136
+	 * @since 1.5.3
137
+	 *
138
+	 * @param array $main_query_array The SQL query values for search/where.
139
+	 */
140
+	$main_query_array = apply_filters('geodir_marker_main_query_array', $main_query_array);
141
+
142
+	$gd_posttype = '';
143
+	if (isset($_REQUEST['gd_posttype']) && $_REQUEST['gd_posttype'] != '') {
144
+		$table = $plugin_prefix . $_REQUEST['gd_posttype'] . '_detail';
145
+		$gd_posttype = " AND p.post_type = %s";
146
+		$main_query_array[] = $_REQUEST['gd_posttype'];
147
+
148
+	} else
149
+		$table = $plugin_prefix . 'gd_place_detail';
150
+
151
+	$join = ", " . $table . " AS pd ";
152
+
153
+	/**
154 154
 	 * Filter the SQL JOIN clause for the markers data
155 155
 	 *
156 156
 	 * @since 1.0.0
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
167 167
 	 * @param string $search Row of searched fields to use in WHERE clause.
168 168
 	 */
169 169
 	$search = apply_filters('geodir_home_map_listing_where', $search);
170
-    $search = str_replace(array("'%", "%'"), array("'%%", "%%'"), $search);
171
-    $cat_type = $post_type . 'category';
172
-    if ($post_type == 'gd_event') {
173
-        $event_select = ", pd.recurring_dates, pd.is_recurring";
174
-    } else {
175
-        $event_select = "";
176
-    }
177
-
178
-    $sql_select = 'SELECT pd.default_category, pd.' . $cat_type . ', pd.post_title, pd.post_id, pd.post_latitude, pd.post_longitude' . $event_select;
179
-    /**
170
+	$search = str_replace(array("'%", "%'"), array("'%%", "%%'"), $search);
171
+	$cat_type = $post_type . 'category';
172
+	if ($post_type == 'gd_event') {
173
+		$event_select = ", pd.recurring_dates, pd.is_recurring";
174
+	} else {
175
+		$event_select = "";
176
+	}
177
+
178
+	$sql_select = 'SELECT pd.default_category, pd.' . $cat_type . ', pd.post_title, pd.post_id, pd.post_latitude, pd.post_longitude' . $event_select;
179
+	/**
180 180
 	 * Filter the SQL SELECT clause to retrive fields data
181 181
 	 *
182 182
 	 * @since 1.0.0
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	$groupby = apply_filters('geodir_home_map_listing_groupby', $groupby);
197 197
 
198
-    $catsql = $wpdb->prepare("$select $field_default_cat FROM " . $wpdb->posts . " as p" . $join . " WHERE p.ID = pd.post_id AND p.post_status = 'publish' " . $search . $gd_posttype . $groupby , $main_query_array);
198
+	$catsql = $wpdb->prepare("$select $field_default_cat FROM " . $wpdb->posts . " as p" . $join . " WHERE p.ID = pd.post_id AND p.post_status = 'publish' " . $search . $gd_posttype . $groupby , $main_query_array);
199 199
     
200 200
 	/**
201 201
 	 * Filter the SQL query to retrive markers data
@@ -207,125 +207,125 @@  discard block
 block discarded – undo
207 207
 	 */
208 208
 	$catsql = apply_filters('geodir_home_map_listing_query', $catsql, $search);
209 209
 
210
-    $catinfo = $wpdb->get_results($catsql);
210
+	$catinfo = $wpdb->get_results($catsql);
211 211
 	
212
-    $cat_content_info = array();
213
-    $content_data = array();
214
-    $post_ids = array();
215
-
216
-    /**
217
-     * Called before marker data is processed into JSON.
218
-     *
219
-     * Called before marker data is processed into JSON, this action can be used to change the format or add/remove markers.
220
-     *
221
-     * @since 1.5.3
222
-     * @param object $catinfo The posts object containing all marker data.
223
-     * @see 'geodir_after_marker_post_process'
224
-     */
225
-    $catinfo = apply_filters('geodir_before_marker_post_process', $catinfo);
226
-
227
-    /**
228
-     * Called before marker data is processed into JSON.
229
-     *
230
-     * Called before marker data is processed into JSON, this action can be used to change the format or add/remove markers.
231
-     *
232
-     * @since 1.4.9
233
-     * @param object $catinfo The posts object containing all marker data.
234
-     * @see 'geodir_after_marker_post_process'
235
-     */
236
-    do_action('geodir_before_marker_post_process_action', $catinfo);
237
-
238
-    // Sort any posts into a ajax array
239
-    if (!empty($catinfo)) {
240
-        $geodir_cat_icons = geodir_get_term_icon();
241
-        global $geodir_date_format;
242
-
243
-        $today = strtotime(date_i18n('Y-m-d'));
212
+	$cat_content_info = array();
213
+	$content_data = array();
214
+	$post_ids = array();
215
+
216
+	/**
217
+	 * Called before marker data is processed into JSON.
218
+	 *
219
+	 * Called before marker data is processed into JSON, this action can be used to change the format or add/remove markers.
220
+	 *
221
+	 * @since 1.5.3
222
+	 * @param object $catinfo The posts object containing all marker data.
223
+	 * @see 'geodir_after_marker_post_process'
224
+	 */
225
+	$catinfo = apply_filters('geodir_before_marker_post_process', $catinfo);
226
+
227
+	/**
228
+	 * Called before marker data is processed into JSON.
229
+	 *
230
+	 * Called before marker data is processed into JSON, this action can be used to change the format or add/remove markers.
231
+	 *
232
+	 * @since 1.4.9
233
+	 * @param object $catinfo The posts object containing all marker data.
234
+	 * @see 'geodir_after_marker_post_process'
235
+	 */
236
+	do_action('geodir_before_marker_post_process_action', $catinfo);
237
+
238
+	// Sort any posts into a ajax array
239
+	if (!empty($catinfo)) {
240
+		$geodir_cat_icons = geodir_get_term_icon();
241
+		global $geodir_date_format;
242
+
243
+		$today = strtotime(date_i18n('Y-m-d'));
244 244
         
245
-        foreach ($catinfo as $catinfo_obj) {
246
-            $post_title = $catinfo_obj->post_title;
245
+		foreach ($catinfo as $catinfo_obj) {
246
+			$post_title = $catinfo_obj->post_title;
247 247
             
248
-            if ($post_type == 'gd_event' && !empty($catinfo_obj->recurring_dates)) {
249
-                $event_dates = '';
250
-                $recurring_data = isset($catinfo_obj->recurring_dates) ? maybe_unserialize($catinfo_obj->recurring_dates) : array();
248
+			if ($post_type == 'gd_event' && !empty($catinfo_obj->recurring_dates)) {
249
+				$event_dates = '';
250
+				$recurring_data = isset($catinfo_obj->recurring_dates) ? maybe_unserialize($catinfo_obj->recurring_dates) : array();
251 251
                 
252
-                $post_info = geodir_get_post_info($catinfo_obj->post_id);
253
-                if (!empty($catinfo_obj->is_recurring) && !empty($recurring_data) && !empty($recurring_data['is_recurring']) && geodir_event_recurring_pkg($post_info)) {
254
-                    $recurring_dates = explode(',', $recurring_data['event_recurring_dates']);
252
+				$post_info = geodir_get_post_info($catinfo_obj->post_id);
253
+				if (!empty($catinfo_obj->is_recurring) && !empty($recurring_data) && !empty($recurring_data['is_recurring']) && geodir_event_recurring_pkg($post_info)) {
254
+					$recurring_dates = explode(',', $recurring_data['event_recurring_dates']);
255 255
                     
256
-                    if (!empty($recurring_dates)) {					
257
-                        $e = 0;
258
-                        foreach ($recurring_dates as $date) {
259
-                            if (strtotime($date) >= $today) {
260
-                                $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($date));
256
+					if (!empty($recurring_dates)) {					
257
+						$e = 0;
258
+						foreach ($recurring_dates as $date) {
259
+							if (strtotime($date) >= $today) {
260
+								$event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($date));
261 261
                                 
262
-                                $e++;
263
-                                if ($e == 3) { // only show 3 event dates
264
-                                    break;
265
-                                }
266
-                            }
267
-                        }
268
-                    }
269
-                } else {
270
-                    $start_date = !empty($recurring_data['event_start']) && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? $recurring_data['event_start'] : '';
271
-                    $end_date = !empty($recurring_data['event_end']) && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? $recurring_data['event_end'] : $start_date;
262
+								$e++;
263
+								if ($e == 3) { // only show 3 event dates
264
+									break;
265
+								}
266
+							}
267
+						}
268
+					}
269
+				} else {
270
+					$start_date = !empty($recurring_data['event_start']) && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? $recurring_data['event_start'] : '';
271
+					$end_date = !empty($recurring_data['event_end']) && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? $recurring_data['event_end'] : $start_date;
272 272
                 
273
-                    if ($end_date != '' && strtotime($end_date) >= $today) {
274
-                        $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($start_date)) .' -> ' . date_i18n($geodir_date_format, strtotime($end_date));
275
-                    }
276
-                }
277
-
278
-                if (empty($event_dates)) {
279
-                    continue;
280
-                }
273
+					if ($end_date != '' && strtotime($end_date) >= $today) {
274
+						$event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($start_date)) .' -> ' . date_i18n($geodir_date_format, strtotime($end_date));
275
+					}
276
+				}
277
+
278
+				if (empty($event_dates)) {
279
+					continue;
280
+				}
281 281
                 
282
-                $post_title .= $event_dates;
283
-            }
282
+				$post_title .= $event_dates;
283
+			}
284 284
 
285
-            $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$catinfo_obj->default_category]) ? $geodir_cat_icons[$catinfo_obj->default_category] : '';
286
-            $mark_extra = (isset($catinfo_obj->marker_extra)) ? $catinfo_obj->marker_extra : '';
287
-            $title = str_replace($srcharr, $replarr, $post_title);
285
+			$icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$catinfo_obj->default_category]) ? $geodir_cat_icons[$catinfo_obj->default_category] : '';
286
+			$mark_extra = (isset($catinfo_obj->marker_extra)) ? $catinfo_obj->marker_extra : '';
287
+			$title = str_replace($srcharr, $replarr, $post_title);
288 288
             
289
-            if ($icon != '') {
290
-                $gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
289
+			if ($icon != '') {
290
+				$gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
291 291
                 
292
-                if (isset($gd_marker_sizes[$icon])) {
293
-                    $icon_size = $gd_marker_sizes[$icon];
294
-                } else {
295
-                    $icon_size = geodir_get_marker_size($icon);
296
-                    $gd_marker_sizes[$icon] = $icon_size;
297
-                }               
298
-            } else {
299
-                $icon_size = array('w' => 36, 'h' => 45);
300
-            }
301
-
302
-            $content_data[] = '{"id":"' . $catinfo_obj->post_id . '","t": "' . $title . '","lt": "' . $catinfo_obj->post_latitude . '","ln": "' . $catinfo_obj->post_longitude . '","mk_id":"' . $catinfo_obj->post_id . '_' . $catinfo_obj->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"'.$mark_extra.'}';
303
-            $post_ids[] = $catinfo_obj->post_id;
304
-        }
305
-    }
306
-
307
-    /**
308
-     * Called after marker data is processed into JSON.
309
-     *
310
-     * Called after marker data is processed into JSON, this action can be used to change the format or add/remove markers.
311
-     *
312
-     * @since 1.4.9
313
-     * @param array $content_data The array containing all markers in JSON format.
314
-     * @param object $catinfo The posts object containing all marker data.
315
-     * @see 'geodir_before_marker_post_process'
316
-     */
317
-    do_action('geodir_after_marker_post_process', $content_data, $catinfo);
318
-
319
-    if (!empty($content_data)) {
320
-        $cat_content_info[] = implode(',', $content_data);
321
-    }
322
-
323
-    $totalcount = count(array_unique($post_ids));
324
-
325
-    if (!empty($cat_content_info)) {
326
-        return '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']';
327
-    }
328
-    else {
329
-        return '[{"totalcount":"0"}]';
330
-    }
292
+				if (isset($gd_marker_sizes[$icon])) {
293
+					$icon_size = $gd_marker_sizes[$icon];
294
+				} else {
295
+					$icon_size = geodir_get_marker_size($icon);
296
+					$gd_marker_sizes[$icon] = $icon_size;
297
+				}               
298
+			} else {
299
+				$icon_size = array('w' => 36, 'h' => 45);
300
+			}
301
+
302
+			$content_data[] = '{"id":"' . $catinfo_obj->post_id . '","t": "' . $title . '","lt": "' . $catinfo_obj->post_latitude . '","ln": "' . $catinfo_obj->post_longitude . '","mk_id":"' . $catinfo_obj->post_id . '_' . $catinfo_obj->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"'.$mark_extra.'}';
303
+			$post_ids[] = $catinfo_obj->post_id;
304
+		}
305
+	}
306
+
307
+	/**
308
+	 * Called after marker data is processed into JSON.
309
+	 *
310
+	 * Called after marker data is processed into JSON, this action can be used to change the format or add/remove markers.
311
+	 *
312
+	 * @since 1.4.9
313
+	 * @param array $content_data The array containing all markers in JSON format.
314
+	 * @param object $catinfo The posts object containing all marker data.
315
+	 * @see 'geodir_before_marker_post_process'
316
+	 */
317
+	do_action('geodir_after_marker_post_process', $content_data, $catinfo);
318
+
319
+	if (!empty($content_data)) {
320
+		$cat_content_info[] = implode(',', $content_data);
321
+	}
322
+
323
+	$totalcount = count(array_unique($post_ids));
324
+
325
+	if (!empty($cat_content_info)) {
326
+		return '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']';
327
+	}
328
+	else {
329
+		return '[{"totalcount":"0"}]';
330
+	}
331 331
 }
332 332
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_functions.php 1 patch
Indentation   +197 added lines, -197 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function  geodir_init_map_jason()
17 17
 {
18
-    global $map_jason;
19
-    $map_jason = array();
18
+	global $map_jason;
19
+	$map_jason = array();
20 20
 }
21 21
 
22 22
 /**
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
  */
29 29
 function geodir_init_map_canvas_array()
30 30
 {
31
-    global $map_canvas_arr;
32
-    $map_canvas_arr = array();
31
+	global $map_canvas_arr;
32
+	$map_canvas_arr = array();
33 33
 }
34 34
 
35 35
 
@@ -50,47 +50,47 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function create_marker_jason_of_posts($post)
52 52
 {
53
-    global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes;
53
+	global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes;
54 54
 
55
-    if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') {
56
-        $srcharr = array("'", "/", "-", '"', '\\');
57
-        $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
55
+	if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') {
56
+		$srcharr = array("'", "/", "-", '"', '\\');
57
+		$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
58 58
 
59 59
 
60
-        $geodir_cat_icons = geodir_get_term_icon();
61
-        $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$post->default_category]) ? $geodir_cat_icons[$post->default_category] : '';
60
+		$geodir_cat_icons = geodir_get_term_icon();
61
+		$icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$post->default_category]) ? $geodir_cat_icons[$post->default_category] : '';
62 62
 
63
-        $post_title = $post->post_title;
64
-        $title = str_replace($srcharr, $replarr, $post_title);
63
+		$post_title = $post->post_title;
64
+		$title = str_replace($srcharr, $replarr, $post_title);
65 65
 
66
-        if (is_ssl()) {
67
-            $icon = str_replace("http:","https:",$icon );
68
-        }
66
+		if (is_ssl()) {
67
+			$icon = str_replace("http:","https:",$icon );
68
+		}
69 69
         
70
-        if ($icon != '') {
71
-            $gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
70
+		if ($icon != '') {
71
+			$gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
72 72
             
73
-            if (isset($gd_marker_sizes[$icon])) {
74
-                $icon_size = $gd_marker_sizes[$icon];
75
-            } else {
76
-                $icon_size = geodir_get_marker_size($icon);
77
-                $gd_marker_sizes[$icon] = $icon_size;
78
-            }               
79
-        } else {
80
-            $icon_size = array('w' => 36, 'h' => 45);
81
-        }
82
-
83
-        $post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}';
84
-
85
-        /**
86
-         * Filter the json data when creating output for post json marker..
87
-         *
88
-         * @since 1.5.7
89
-         * @param string $post_json JSON representation of the post marker info.
90
-         * @param object $post The post object.
91
-         */
92
-        $map_jason[] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
93
-    }
73
+			if (isset($gd_marker_sizes[$icon])) {
74
+				$icon_size = $gd_marker_sizes[$icon];
75
+			} else {
76
+				$icon_size = geodir_get_marker_size($icon);
77
+				$gd_marker_sizes[$icon] = $icon_size;
78
+			}               
79
+		} else {
80
+			$icon_size = array('w' => 36, 'h' => 45);
81
+		}
82
+
83
+		$post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}';
84
+
85
+		/**
86
+		 * Filter the json data when creating output for post json marker..
87
+		 *
88
+		 * @since 1.5.7
89
+		 * @param string $post_json JSON representation of the post marker info.
90
+		 * @param object $post The post object.
91
+		 */
92
+		$map_jason[] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
93
+	}
94 94
 }
95 95
 
96 96
 /**
@@ -103,60 +103,60 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function send_marker_jason_to_js()
105 105
 {
106
-    global $map_jason, $map_canvas_arr;
107
-
108
-    if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) {
109
-        foreach ($map_canvas_arr as $canvas => $jason) {
110
-            if (is_array($map_jason) && !empty($map_jason)) {
111
-
112
-                $canvas_jason = $canvas . "_jason";
113
-                $map_canvas_arr[$canvas] = array_unique($map_jason);
114
-                unset($cat_content_info);
115
-                $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
116
-                $totalcount = count(array_unique($map_jason));
117
-                if (!empty($cat_content_info)) {
118
-                    $json_content = substr(implode(',', $cat_content_info), 1);
119
-                    $json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
120
-                    $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
121
-                } else {
122
-                    $canvas_jason = '[{"totalcount":"0"}]';
123
-                }
124
-
125
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
126
-
127
-                /**
128
-                 * Filter the send_marker_jason_to_js() function map canvas json args.
129
-                 *
130
-                 * You can use this filter to modify map canvas json args.
131
-                 *
132
-                 * @since 1.0.0
133
-                 * @package GeoDirectory
134
-                 * @param string $canvas Map canvas array key.
135
-                 * @param array $map_canvas_jason_args Map canvas args.
136
-                 */
137
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
138
-
139
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
140
-            } else {
141
-                $canvas_jason = '[{"totalcount":"0"}]';
142
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
143
-
144
-                /**
145
-                 * Filter the send_marker_jason_to_js() function map canvas json args.
146
-                 *
147
-                 * You can use this filter to modify map canvas json args.
148
-                 *
149
-                 * @since 1.0.0
150
-                 * @package GeoDirectory
151
-                 * @param string $canvas Map canvas array key.
152
-                 * @param array $map_canvas_jason_args Map canvas args.
153
-                 */
154
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
155
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
156
-            }
157
-        }
158
-
159
-    }
106
+	global $map_jason, $map_canvas_arr;
107
+
108
+	if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) {
109
+		foreach ($map_canvas_arr as $canvas => $jason) {
110
+			if (is_array($map_jason) && !empty($map_jason)) {
111
+
112
+				$canvas_jason = $canvas . "_jason";
113
+				$map_canvas_arr[$canvas] = array_unique($map_jason);
114
+				unset($cat_content_info);
115
+				$cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
116
+				$totalcount = count(array_unique($map_jason));
117
+				if (!empty($cat_content_info)) {
118
+					$json_content = substr(implode(',', $cat_content_info), 1);
119
+					$json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
120
+					$canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
121
+				} else {
122
+					$canvas_jason = '[{"totalcount":"0"}]';
123
+				}
124
+
125
+				$map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
126
+
127
+				/**
128
+				 * Filter the send_marker_jason_to_js() function map canvas json args.
129
+				 *
130
+				 * You can use this filter to modify map canvas json args.
131
+				 *
132
+				 * @since 1.0.0
133
+				 * @package GeoDirectory
134
+				 * @param string $canvas Map canvas array key.
135
+				 * @param array $map_canvas_jason_args Map canvas args.
136
+				 */
137
+				$map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
138
+
139
+				wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
140
+			} else {
141
+				$canvas_jason = '[{"totalcount":"0"}]';
142
+				$map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
143
+
144
+				/**
145
+				 * Filter the send_marker_jason_to_js() function map canvas json args.
146
+				 *
147
+				 * You can use this filter to modify map canvas json args.
148
+				 *
149
+				 * @since 1.0.0
150
+				 * @package GeoDirectory
151
+				 * @param string $canvas Map canvas array key.
152
+				 * @param array $map_canvas_jason_args Map canvas args.
153
+				 */
154
+				$map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
155
+				wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
156
+			}
157
+		}
158
+
159
+	}
160 160
 }
161 161
 
162 162
 /**
@@ -175,90 +175,90 @@  discard block
 block discarded – undo
175 175
  */
176 176
 function home_map_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = true, $pading = 0, $map_canvas_name = '', $child_collapse, $is_home_map = false)
177 177
 {
178
-    global $cat_count, $geodir_cat_icons;
178
+	global $cat_count, $geodir_cat_icons;
179 179
 
180
-    $exclude_categories = get_option('geodir_exclude_cat_on_map');
181
-    $exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade');
180
+	$exclude_categories = get_option('geodir_exclude_cat_on_map');
181
+	$exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade');
182 182
 
183
-    // check if exclude categories saved before fix of categories identical names
184
-    if ($exclude_categories_new) {
185
-        $gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : '';
186
-        $exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array();
187
-    }
183
+	// check if exclude categories saved before fix of categories identical names
184
+	if ($exclude_categories_new) {
185
+		$gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : '';
186
+		$exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array();
187
+	}
188 188
 
189
-    $exclude_cat_str = implode(',', $exclude_categories);
189
+	$exclude_cat_str = implode(',', $exclude_categories);
190 190
 
191
-    if ($exclude_cat_str == '') {
192
-        $exclude_cat_str = '0';
193
-    }
191
+	if ($exclude_cat_str == '') {
192
+		$exclude_cat_str = '0';
193
+	}
194 194
 
195
-    $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty));
195
+	$cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty));
196 196
     
197
-    if ($hide_empty) {
198
-        $cat_terms = geodir_filter_empty_terms($cat_terms);
199
-    }
197
+	if ($hide_empty) {
198
+		$cat_terms = geodir_filter_empty_terms($cat_terms);
199
+	}
200 200
 
201
-    $main_list_class = '';
202
-    //If there are terms, start displaying
203
-    if (count($cat_terms) > 0) {
204
-        //Displaying as a list
205
-        $p = $pading * 15;
206
-        $pading++;
201
+	$main_list_class = '';
202
+	//If there are terms, start displaying
203
+	if (count($cat_terms) > 0) {
204
+		//Displaying as a list
205
+		$p = $pading * 15;
206
+		$pading++;
207 207
 
208
-        if ($cat_parent == 0) {
209
-            $list_class = 'main_list';
210
-            $display = '';
211
-        } else {
212
-            $list_class = 'sub_list';
213
-            $display = !$child_collapse ? '' : 'display:none';
214
-        }
208
+		if ($cat_parent == 0) {
209
+			$list_class = 'main_list';
210
+			$display = '';
211
+		} else {
212
+			$list_class = 'sub_list';
213
+			$display = !$child_collapse ? '' : 'display:none';
214
+		}
215 215
 
216 216
 
217
-        $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
217
+		$out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
218 218
 
219
-        $geodir_cat_icons = geodir_get_term_icon();
219
+		$geodir_cat_icons = geodir_get_term_icon();
220 220
 
221
-        foreach ($cat_terms as $cat_term):
221
+		foreach ($cat_terms as $cat_term):
222 222
 
223
-            $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : 'gd_place';
223
+			$post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : 'gd_place';
224 224
 
225
-            $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : '';
225
+			$icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : '';
226 226
 
227
-            if (!in_array($cat_term->term_id, $exclude_categories)):
228
-                //Secret sauce.  Function calls itself to display child elements, if any
229
-                $checked = 'checked="checked"';
227
+			if (!in_array($cat_term->term_id, $exclude_categories)):
228
+				//Secret sauce.  Function calls itself to display child elements, if any
229
+				$checked = 'checked="checked"';
230 230
 
231
-                // Untick the category by default on home map
232
-                if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
233
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
234
-                        $checked = '';
235
-                    }
236
-                }
231
+				// Untick the category by default on home map
232
+				if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
233
+					if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
234
+						$checked = '';
235
+					}
236
+				}
237 237
 
238
-                $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
239
-                $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
240
-                $term_check .= '  title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
241
-                $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
242
-                $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>';
238
+				$term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
239
+				$term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
240
+				$term_check .= '  title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
241
+				$term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
242
+				$out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>';
243 243
 
244
-            endif;
244
+			endif;
245 245
 
246 246
 
247
-            // get sub category by recursion
248
-            $out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map);
247
+			// get sub category by recursion
248
+			$out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map);
249 249
 
250
-            $out .= '</li>';
250
+			$out .= '</li>';
251 251
 
252
-        endforeach;
252
+		endforeach;
253 253
 
254
-        $out .= '</ul>';
254
+		$out .= '</ul>';
255 255
 
256
-        return $out;
257
-    } else {
258
-        if ($cat_parent == 0)
259
-            return _e('No category', 'geodirectory');
260
-    }
261
-    return;
256
+		return $out;
257
+	} else {
258
+		if ($cat_parent == 0)
259
+			return _e('No category', 'geodirectory');
260
+	}
261
+	return;
262 262
 }
263 263
 
264 264
 /**
@@ -270,19 +270,19 @@  discard block
 block discarded – undo
270 270
  * @return string The map API provider name.
271 271
  */
272 272
 function geodir_map_name() {
273
-    $geodir_map_name = get_option('geodir_load_map', 'google');
273
+	$geodir_map_name = get_option('geodir_load_map', 'google');
274 274
     
275
-    if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) {
276
-        $geodir_map_name = 'auto';
277
-    }
278
-
279
-    /**
280
-     * Filter the map JS API provider name.
281
-     *
282
-     * @since 1.6.1
283
-     * @param string $geodir_map_name The map API provider name.
284
-     */
285
-    return apply_filters('geodir_map_name', $geodir_map_name);
275
+	if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) {
276
+		$geodir_map_name = 'auto';
277
+	}
278
+
279
+	/**
280
+	 * Filter the map JS API provider name.
281
+	 *
282
+	 * @since 1.6.1
283
+	 * @param string $geodir_map_name The map API provider name.
284
+	 */
285
+	return apply_filters('geodir_map_name', $geodir_map_name);
286 286
 }
287 287
 
288 288
 /**
@@ -298,48 +298,48 @@  discard block
 block discarded – undo
298 298
  * @return array The icon size.
299 299
  */
300 300
 function geodir_get_marker_size($icon, $default_size = array('w' => 36, 'h' => 45)) {
301
-    global $gd_marker_sizes;
301
+	global $gd_marker_sizes;
302 302
     
303
-    if (empty($gd_marker_sizes)) {
304
-        $gd_marker_sizes = array();
305
-    }
303
+	if (empty($gd_marker_sizes)) {
304
+		$gd_marker_sizes = array();
305
+	}
306 306
       
307
-    if (!empty($gd_marker_sizes[$icon])) {
308
-        return $gd_marker_sizes[$icon];
309
-    }
307
+	if (!empty($gd_marker_sizes[$icon])) {
308
+		return $gd_marker_sizes[$icon];
309
+	}
310 310
     
311
-    if (empty($icon)) {
312
-        $gd_marker_sizes[$icon] = $default_size;
311
+	if (empty($icon)) {
312
+		$gd_marker_sizes[$icon] = $default_size;
313 313
         
314
-        return $default_size;
315
-    }
314
+		return $default_size;
315
+	}
316 316
     
317
-    $icon_url = $icon;
317
+	$icon_url = $icon;
318 318
     
319
-    $uploads = wp_upload_dir(); // Array of key => value pairs
319
+	$uploads = wp_upload_dir(); // Array of key => value pairs
320 320
       
321
-    if (!path_is_absolute($icon)) {
322
-        $icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon);
323
-    }
321
+	if (!path_is_absolute($icon)) {
322
+		$icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon);
323
+	}
324 324
     
325
-    if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) {
326
-        $icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon);
327
-    }
325
+	if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) {
326
+		$icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon);
327
+	}
328 328
     
329
-    $sizes = array();
330
-    if (is_file($icon) && file_exists($icon)) {
331
-        $size = getimagesize(trim($icon));
329
+	$sizes = array();
330
+	if (is_file($icon) && file_exists($icon)) {
331
+		$size = getimagesize(trim($icon));
332 332
         
333
-        if (!empty($size[0]) && !empty($size[1])) {
334
-            $sizes = array('w' => $size[0], 'h' => $size[1]);
335
-        }
336
-    }
333
+		if (!empty($size[0]) && !empty($size[1])) {
334
+			$sizes = array('w' => $size[0], 'h' => $size[1]);
335
+		}
336
+	}
337 337
     
338
-    $sizes = !empty($sizes) ? $sizes : $default_size;
338
+	$sizes = !empty($sizes) ? $sizes : $default_size;
339 339
     
340
-    $gd_marker_sizes[$icon_url] = $sizes;
340
+	$gd_marker_sizes[$icon_url] = $sizes;
341 341
     
342
-    return $sizes;
342
+	return $sizes;
343 343
 }
344 344
 
345 345
 add_action('wp_head', 'geodir_map_load_style', 10);
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
  * @package GeoDirectory
352 352
  */
353 353
 function geodir_map_load_style() {    
354
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
354
+	if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
355 355
 ?>
356 356
 <script type="text/javascript">
357 357
 if (!(window.google && typeof google.maps !== 'undefined')) {
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 }
360 360
 </script>
361 361
 <?php
362
-    }
362
+	}
363 363
 }
364 364
 
365 365
 add_action('wp_footer', 'geodir_map_load_script', 10);
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
  * @package GeoDirectory
372 372
  */
373 373
 function geodir_map_load_script() {
374
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
374
+	if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
375 375
 ?>
376 376
 <script type="text/javascript">
377 377
 if (!(window.google && typeof google.maps !== 'undefined')) {
@@ -380,5 +380,5 @@  discard block
 block discarded – undo
380 380
 }
381 381
 </script>
382 382
 <?php
383
-    }
383
+	}
384 384
 }
385 385
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_on_add_listing_page.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
 $defaultcity = isset($default_location->city) ? $default_location->city : '';
35 35
 $lat_lng_blank = false;
36 36
 if ($lat == '' && $lng == '') {
37
-    $lat_lng_blank = true;
38
-    $city = $defaultcity;
39
-    $region = isset($default_location->region) ? $default_location->region : '';
40
-    $country = isset($default_location->country) ? $default_location->country : '';
41
-    $lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
42
-    $lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
37
+	$lat_lng_blank = true;
38
+	$city = $defaultcity;
39
+	$region = isset($default_location->region) ? $default_location->region : '';
40
+	$country = isset($default_location->country) ? $default_location->country : '';
41
+	$lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
42
+	$lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
43 43
 }
44 44
 $default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
45 45
 $default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
46 46
 if (is_admin() && isset($_REQUEST['tab']) && $mapzoom == '') {
47
-    $mapzoom = 4;
48
-    if (isset($_REQUEST['add_hood']))
49
-        $mapzoom = 10;
47
+	$mapzoom = 4;
48
+	if (isset($_REQUEST['add_hood']))
49
+		$mapzoom = 10;
50 50
 }
51 51
 
52 52
 /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * Fires at the start of the add javascript on the add lsitings map.
68 68
 	 *
69 69
 	 * @since 1.0.0
70
-     * @param string $prefix The prefix for all elements.
70
+	 * @param string $prefix The prefix for all elements.
71 71
 	 */
72 72
 	do_action('geodir_add_listing_js_start', $prefix);
73 73
 	?>
@@ -314,13 +314,13 @@  discard block
 block discarded – undo
314 314
                 getZip = postal_code.long_name;
315 315
             }
316 316
             <?php 
317
-            /**
318
-             * Fires to add javascript variable to use in google map.
319
-             *
320
-             * @since 1.0.0
321
-             */
322
-            do_action('geodir_add_listing_geocode_js_vars');
323
-            ?>
317
+			/**
318
+			 * Fires to add javascript variable to use in google map.
319
+			 *
320
+			 * @since 1.0.0
321
+			 */
322
+			do_action('geodir_add_listing_geocode_js_vars');
323
+			?>
324 324
             <?php if ($is_map_restrict) { ?>
325 325
             if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
326 326
                 alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
@@ -400,15 +400,15 @@  discard block
 block discarded – undo
400 400
             }
401 401
         }
402 402
         <?php
403
-        /**
404
-         * Fires when marker address updated on map.
405
-         *
406
-         * @since 1.0.0
407
-         * @param string $prefix Identifier used as a prefix for field name
408
-         */
409
-        do_action('geodir_update_marker_address', $prefix);
410
-        echo $updateMarkerAddress = ob_get_clean();
411
-        ?>
403
+		/**
404
+		 * Fires when marker address updated on map.
405
+		 *
406
+		 * @since 1.0.0
407
+		 * @param string $prefix Identifier used as a prefix for field name
408
+		 */
409
+		do_action('geodir_update_marker_address', $prefix);
410
+		echo $updateMarkerAddress = ob_get_clean();
411
+		?>
412 412
     }
413 413
     function geodir_codeAddress(set_on_map) {
414 414
         var address = jQuery('#<?php echo $prefix.'address';?>').val();
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
         }
436 436
         var is_restrict = '<?php echo $is_map_restrict; ?>';
437 437
         <?php ob_start();
438
-        $defaultregion = isset($default_location->region) ? $default_location->region : '';
439
-        $defaultcountry = isset($default_location->country) ? $default_location->country : '';
440
-        ?>
438
+		$defaultregion = isset($default_location->region) ? $default_location->region : '';
439
+		$defaultcountry = isset($default_location->country) ? $default_location->country : '';
440
+		?>
441 441
         if (set_on_map && is_restrict) {
442 442
             if (zip != '' && address != '') {
443 443
                 address = address + ',' + zip;
@@ -446,12 +446,12 @@  discard block
 block discarded – undo
446 446
             if (typeof address === 'undefined')
447 447
                 address = '';
448 448
             <?php
449
-            if(is_admin() && isset($_REQUEST['tab'])){?>
449
+			if(is_admin() && isset($_REQUEST['tab'])){?>
450 450
             if (jQuery.trim(city) == '' || jQuery.trim(region) == '') {
451 451
                 address = '';
452 452
             }
453 453
             <?php
454
-               }?>
454
+			   }?>
455 455
 
456 456
             if (ISO2 == 'GB') {
457 457
                 address = address + ',' + city + ',' + country + ',' + zip; // UK is funny with regions
@@ -460,15 +460,15 @@  discard block
 block discarded – undo
460 460
             }
461 461
         }
462 462
         <?php $codeAddress = ob_get_clean();
463
-        /**
464
-         * Filter the address variable
465
-         *
466
-         * @since 1.0.0
467
-         *
468
-         * @param string $codeAddress Row of address to use in google map.
469
-         */
470
-        echo apply_filters('geodir_codeaddress', $codeAddress);
471
-        ?>
463
+		/**
464
+		 * Filter the address variable
465
+		 *
466
+		 * @since 1.0.0
467
+		 *
468
+		 * @param string $codeAddress Row of address to use in google map.
469
+		 */
470
+		echo apply_filters('geodir_codeaddress', $codeAddress);
471
+		?>
472 472
         if (!window.gdMaps) { // No Google Map Loaded
473 473
             return;
474 474
         }
@@ -493,13 +493,13 @@  discard block
 block discarded – undo
493 493
                         updateMarkerPosition(baseMarker.getPosition());
494 494
                         //if(set_on_map && is_restrict) {
495 495
                         <?php 
496
-                        /**
497
-                         * Fires before set geocode position.
498
-                         *
499
-                         * @since 1.0.0
500
-                         */
501
-                        do_action('geodir_add_listing_codeaddress_before_geocode');
502
-                        ?>
496
+						/**
497
+						 * Fires before set geocode position.
498
+						 *
499
+						 * @since 1.0.0
500
+						 */
501
+						do_action('geodir_add_listing_codeaddress_before_geocode');
502
+						?>
503 503
                         geocodePosition(baseMarker.getPosition(), {'address': address, 'country': ISO2});
504 504
                         //}
505 505
                     } else {
@@ -545,13 +545,13 @@  discard block
 block discarded – undo
545 545
                 updateMarkerPositionOSM(baseMarker.getLatLng());
546 546
             }
547 547
             <?php 
548
-            /**
549
-             * Fires to add javascript variable to use in google map.
550
-             *
551
-             * @since 1.0.0
552
-             */
553
-            do_action('geodir_add_listing_geocode_js_vars');
554
-            ?>
548
+			/**
549
+			 * Fires to add javascript variable to use in google map.
550
+			 *
551
+			 * @since 1.0.0
552
+			 */
553
+			do_action('geodir_add_listing_geocode_js_vars');
554
+			?>
555 555
             <?php if ($is_map_restrict) { ?>
556 556
             if (getCity.toLowerCase() != '<?php echo geodir_strtolower(addslashes_gpc($city));?>') {
557 557
                 alert('<?php echo addslashes_gpc(wp_sprintf(__('Please choose any address of the (%s) city only.','geodirectory'), $city));?>');
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 <?php
700 700
 $set_button_class = 'geodir_button';
701 701
 if (is_admin())
702
-    $set_button_class = 'button-primary';
702
+	$set_button_class = 'button-primary';
703 703
 ?>
704 704
 <input type="button" id="<?php echo $prefix; ?>set_address_button" class="<?php echo $set_button_class; ?>" value="<?php esc_attr_e($map_title, 'geodirectory'); ?>" style="float:none;"/>
705 705
 <div id="<?php echo $prefix; ?>d_mouseClick"></div>
Please login to merge, or discard this patch.
geodirectory-functions/custom_functions.php 1 patch
Indentation   +1380 added lines, -1380 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @global object $gd_session GeoDirectory Session object.
18 18
  */
19 19
 function geodir_list_view_select() {
20
-    global $gd_session;
20
+	global $gd_session;
21 21
 	?>
22 22
     <script type="text/javascript">
23 23
 	function geodir_list_view_select(list) {
@@ -86,63 +86,63 @@  discard block
 block discarded – undo
86 86
  */
87 87
 function geodir_max_excerpt($charlength)
88 88
 {
89
-    global $post;
90
-    if ($charlength == '0') {
91
-        return;
92
-    }
93
-    $out = '';
89
+	global $post;
90
+	if ($charlength == '0') {
91
+		return;
92
+	}
93
+	$out = '';
94 94
 	
95 95
 	$temp_post = $post;
96 96
 	$excerpt = get_the_excerpt();
97 97
 
98
-    $charlength++;
99
-    $excerpt_more = function_exists('geodirf_excerpt_more') ? geodirf_excerpt_more('') : geodir_excerpt_more('');
100
-    if (mb_strlen($excerpt) > $charlength) {
101
-        if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
102
-            $excut = -(mb_strlen($excerpt_more));
103
-            $subex = mb_substr($excerpt, 0, $excut);
104
-            if ($charlength > 0 && mb_strlen($subex) > $charlength) {
105
-                $subex = mb_substr($subex, 0, $charlength);
106
-            }
107
-            $out .= $subex;
108
-        } else {
109
-            $subex = mb_substr($excerpt, 0, $charlength - 5);
110
-            $exwords = explode(' ', $subex);
111
-            $excut = -(mb_strlen($exwords[count($exwords) - 1]));
112
-            if ($excut < 0) {
113
-                $out .= mb_substr($subex, 0, $excut);
114
-            } else {
115
-                $out .= $subex;
116
-            }
117
-        }
118
-        $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
119
-        /**
120
-         * Filter excerpt read more text.
121
-         *
122
-         * @since 1.0.0
123
-         */
124
-        $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
125
-        $out .= '</a>';
126
-
127
-    } else {
128
-        if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
129
-            $excut = -(mb_strlen($excerpt_more));
130
-            $out .= mb_substr($excerpt, 0, $excut);
131
-            $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
132
-            /**
133
-             * Filter excerpt read more text.
134
-             *
135
-             * @since 1.0.0
136
-             */
137
-            $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
138
-            $out .= '</a>';
139
-        } else {
140
-            $out .= $excerpt;
141
-        }
142
-    }
98
+	$charlength++;
99
+	$excerpt_more = function_exists('geodirf_excerpt_more') ? geodirf_excerpt_more('') : geodir_excerpt_more('');
100
+	if (mb_strlen($excerpt) > $charlength) {
101
+		if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
102
+			$excut = -(mb_strlen($excerpt_more));
103
+			$subex = mb_substr($excerpt, 0, $excut);
104
+			if ($charlength > 0 && mb_strlen($subex) > $charlength) {
105
+				$subex = mb_substr($subex, 0, $charlength);
106
+			}
107
+			$out .= $subex;
108
+		} else {
109
+			$subex = mb_substr($excerpt, 0, $charlength - 5);
110
+			$exwords = explode(' ', $subex);
111
+			$excut = -(mb_strlen($exwords[count($exwords) - 1]));
112
+			if ($excut < 0) {
113
+				$out .= mb_substr($subex, 0, $excut);
114
+			} else {
115
+				$out .= $subex;
116
+			}
117
+		}
118
+		$out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
119
+		/**
120
+		 * Filter excerpt read more text.
121
+		 *
122
+		 * @since 1.0.0
123
+		 */
124
+		$out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
125
+		$out .= '</a>';
126
+
127
+	} else {
128
+		if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
129
+			$excut = -(mb_strlen($excerpt_more));
130
+			$out .= mb_substr($excerpt, 0, $excut);
131
+			$out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
132
+			/**
133
+			 * Filter excerpt read more text.
134
+			 *
135
+			 * @since 1.0.0
136
+			 */
137
+			$out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
138
+			$out .= '</a>';
139
+		} else {
140
+			$out .= $excerpt;
141
+		}
142
+	}
143 143
 	$post = $temp_post;
144 144
 
145
-    return $out;
145
+	return $out;
146 146
 }
147 147
 
148 148
 /**
@@ -157,34 +157,34 @@  discard block
 block discarded – undo
157 157
  */
158 158
 function geodir_post_package_info($package_info, $post = '', $post_type = '')
159 159
 {
160
-    $package_info['pid'] = 0;
161
-    $package_info['days'] = 0;
162
-    $package_info['amount'] = 0;
163
-    $package_info['is_featured'] = 0;
164
-    $package_info['image_limit'] = '';
165
-    $package_info['google_analytics'] = 1;
166
-    $package_info['sendtofriend'] = 1;
167
-
168
-    /**
169
-     * Filter listing package info.
170
-     *
171
-     * @since 1.0.0
172
-     * @param array $package_info {
173
-     *    Attributes of the package_info.
174
-     *
175
-     *    @type int $pid Package ID. Default 0.
176
-     *    @type int $days Package validity in Days. Default 0.
177
-     *    @type int $amount Package amount. Default 0.
178
-     *    @type int $is_featured Is this featured package? Default 0.
179
-     *    @type string $image_limit Image limit for this package. Default "".
180
-     *    @type int $google_analytics Add analytics to this package. Default 1.
181
-     *    @type int $sendtofriend Send to friend. Default 1.
182
-     *
183
-     * }
184
-     * @param object|string $post The post object.
185
-     * @param string $post_type The post type.
186
-     */
187
-    return (object)apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
160
+	$package_info['pid'] = 0;
161
+	$package_info['days'] = 0;
162
+	$package_info['amount'] = 0;
163
+	$package_info['is_featured'] = 0;
164
+	$package_info['image_limit'] = '';
165
+	$package_info['google_analytics'] = 1;
166
+	$package_info['sendtofriend'] = 1;
167
+
168
+	/**
169
+	 * Filter listing package info.
170
+	 *
171
+	 * @since 1.0.0
172
+	 * @param array $package_info {
173
+	 *    Attributes of the package_info.
174
+	 *
175
+	 *    @type int $pid Package ID. Default 0.
176
+	 *    @type int $days Package validity in Days. Default 0.
177
+	 *    @type int $amount Package amount. Default 0.
178
+	 *    @type int $is_featured Is this featured package? Default 0.
179
+	 *    @type string $image_limit Image limit for this package. Default "".
180
+	 *    @type int $google_analytics Add analytics to this package. Default 1.
181
+	 *    @type int $sendtofriend Send to friend. Default 1.
182
+	 *
183
+	 * }
184
+	 * @param object|string $post The post object.
185
+	 * @param string $post_type The post type.
186
+	 */
187
+	return (object)apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
188 188
 
189 189
 }
190 190
 
@@ -212,127 +212,127 @@  discard block
 block discarded – undo
212 212
  */
213 213
 function geodir_send_inquiry($request)
214 214
 {
215
-    global $wpdb;
215
+	global $wpdb;
216 216
 
217
-    // strip slashes from text
218
-    $request = !empty($request) ? stripslashes_deep($request) : $request;
217
+	// strip slashes from text
218
+	$request = !empty($request) ? stripslashes_deep($request) : $request;
219 219
 
220
-    $yourname = $request['inq_name'];
221
-    $youremail = $request['inq_email'];
222
-    $inq_phone = $request['inq_phone'];
223
-    $frnd_comments = $request['inq_msg'];
224
-    $pid = $request['pid'];
220
+	$yourname = $request['inq_name'];
221
+	$youremail = $request['inq_email'];
222
+	$inq_phone = $request['inq_phone'];
223
+	$frnd_comments = $request['inq_msg'];
224
+	$pid = $request['pid'];
225 225
 
226
-    $author_id = '';
227
-    $post_title = '';
226
+	$author_id = '';
227
+	$post_title = '';
228 228
 
229
-    if ($request['pid']) {
229
+	if ($request['pid']) {
230 230
 
231
-        $productinfosql = $wpdb->prepare(
232
-            "select ID,post_author,post_title from $wpdb->posts where ID =%d",
233
-            array($request['pid'])
234
-        );
235
-        $productinfo = $wpdb->get_row($productinfosql);
231
+		$productinfosql = $wpdb->prepare(
232
+			"select ID,post_author,post_title from $wpdb->posts where ID =%d",
233
+			array($request['pid'])
234
+		);
235
+		$productinfo = $wpdb->get_row($productinfosql);
236 236
 
237
-        $author_id = $productinfo->post_author;
238
-        $post_title = $productinfo->post_title;
239
-    }
237
+		$author_id = $productinfo->post_author;
238
+		$post_title = $productinfo->post_title;
239
+	}
240 240
 
241
-    $post_title = '<a href="' . get_permalink($pid) . '">' . $post_title . '</a>';
241
+	$post_title = '<a href="' . get_permalink($pid) . '">' . $post_title . '</a>';
242 242
 
243
-    $user_info = get_userdata($author_id);
244
-    $to_email = geodir_get_post_meta($pid, 'geodir_email', true);
245
-    $to_name = geodir_get_client_name($author_id);
243
+	$user_info = get_userdata($author_id);
244
+	$to_email = geodir_get_post_meta($pid, 'geodir_email', true);
245
+	$to_name = geodir_get_client_name($author_id);
246 246
 
247
-    if ($to_email == '') {
248
-        $to_email = get_option('admin_email');
249
-    }
247
+	if ($to_email == '') {
248
+		$to_email = get_option('admin_email');
249
+	}
250 250
 
251
-    /**
252
-     * Called after the send enquiry var have been set but before the email has been sent.
253
-     *
254
-     * @since 1.0.0
255
-     * @param array $request {
256
-     *    The submitted form fields as an array.
257
-     *
258
-     *    @type string $sendact Enquiry type. Default "send_inqury".
259
-     *    @type string $pid Post ID.
260
-     *    @type string $inq_name Sender name.
261
-     *    @type string $inq_email Sender mail.
262
-     *    @type string $inq_phone Sender phone.
263
-     *    @type string $inq_msg Email message.
264
-     *
265
-     * }
266
-     * @param string $type The form type, default: `Enquiry`.
267
-     */
268
-    do_action('geodir_after_send_enquiry', $request, 'Enquiry');
269
-
270
-    $client_message = $frnd_comments;
271
-    $client_message .= '<br>' . __('From :', 'geodirectory') . ' ' . $yourname . '<br>' . __('Phone :', 'geodirectory') . ' ' . $inq_phone . '<br>' . __('Email :', 'geodirectory') . ' ' . $youremail . '<br><br>' . __('Sent from', 'geodirectory') . ' - <b><a href="' . trailingslashit(home_url()) . '">' . get_option('blogname') . '</a></b>.';
272
-    /**
273
-     * Filter client message text.
274
-     *
275
-     * @since 1.0.0
276
-     * @param string $client_message Client message text.
277
-     */
278
-    $client_message = apply_filters('geodir_inquiry_email_msg', $client_message);
279
-
280
-    /**
281
-     * Called before the send enquiry email is sent.
282
-     *
283
-     * @since 1.0.0
284
-     * @param array $request {
285
-     *    The submitted form fields as an array.
286
-     *
287
-     *    @type string $sendact Enquiry type. Default "send_inqury".
288
-     *    @type string $pid Post ID.
289
-     *    @type string $inq_name Sender name.
290
-     *    @type string $inq_email Sender mail.
291
-     *    @type string $inq_phone Sender phone.
292
-     *    @type string $inq_msg Email message.
293
-     *
294
-     * }
295
-     */
296
-    do_action('geodir_before_send_enquiry_email', $request);
297
-    if ($to_email) {
298
-        // strip slashes message
299
-        $client_message = stripslashes_deep($client_message);
300
-
301
-        geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']);//To client email
302
-    }
251
+	/**
252
+	 * Called after the send enquiry var have been set but before the email has been sent.
253
+	 *
254
+	 * @since 1.0.0
255
+	 * @param array $request {
256
+	 *    The submitted form fields as an array.
257
+	 *
258
+	 *    @type string $sendact Enquiry type. Default "send_inqury".
259
+	 *    @type string $pid Post ID.
260
+	 *    @type string $inq_name Sender name.
261
+	 *    @type string $inq_email Sender mail.
262
+	 *    @type string $inq_phone Sender phone.
263
+	 *    @type string $inq_msg Email message.
264
+	 *
265
+	 * }
266
+	 * @param string $type The form type, default: `Enquiry`.
267
+	 */
268
+	do_action('geodir_after_send_enquiry', $request, 'Enquiry');
303 269
 
304
-    /**
305
-     * Called after the send enquiry email is sent.
306
-     *
307
-     * @since 1.0.0
308
-     * @param array $request {
309
-     *    The submitted form fields as an array.
310
-     *
311
-     *    @type string $sendact Enquiry type. Default "send_inqury".
312
-     *    @type string $pid Post ID.
313
-     *    @type string $inq_name Sender name.
314
-     *    @type string $inq_email Sender mail.
315
-     *    @type string $inq_phone Sender phone.
316
-     *    @type string $inq_msg Email message.
317
-     *
318
-     * }
319
-     */
320
-    do_action('geodir_after_send_enquiry_email', $request);
321
-    $url = get_permalink($pid);
322
-    if (strstr($url, '?')) {
323
-        $url = $url . "&send_inquiry=success";
324
-    } else {
325
-        $url = $url . "?send_inquiry=success";
326
-    }
327
-    /**
328
-     * Filter redirect url after the send enquiry email is sent.
329
-     *
330
-     * @since 1.0.0
331
-     * @param string $url Redirect url.
332
-     */
333
-    $url = apply_filters('geodir_send_enquiry_after_submit_redirect', $url);
334
-    wp_redirect($url);
335
-    gd_die();
270
+	$client_message = $frnd_comments;
271
+	$client_message .= '<br>' . __('From :', 'geodirectory') . ' ' . $yourname . '<br>' . __('Phone :', 'geodirectory') . ' ' . $inq_phone . '<br>' . __('Email :', 'geodirectory') . ' ' . $youremail . '<br><br>' . __('Sent from', 'geodirectory') . ' - <b><a href="' . trailingslashit(home_url()) . '">' . get_option('blogname') . '</a></b>.';
272
+	/**
273
+	 * Filter client message text.
274
+	 *
275
+	 * @since 1.0.0
276
+	 * @param string $client_message Client message text.
277
+	 */
278
+	$client_message = apply_filters('geodir_inquiry_email_msg', $client_message);
279
+
280
+	/**
281
+	 * Called before the send enquiry email is sent.
282
+	 *
283
+	 * @since 1.0.0
284
+	 * @param array $request {
285
+	 *    The submitted form fields as an array.
286
+	 *
287
+	 *    @type string $sendact Enquiry type. Default "send_inqury".
288
+	 *    @type string $pid Post ID.
289
+	 *    @type string $inq_name Sender name.
290
+	 *    @type string $inq_email Sender mail.
291
+	 *    @type string $inq_phone Sender phone.
292
+	 *    @type string $inq_msg Email message.
293
+	 *
294
+	 * }
295
+	 */
296
+	do_action('geodir_before_send_enquiry_email', $request);
297
+	if ($to_email) {
298
+		// strip slashes message
299
+		$client_message = stripslashes_deep($client_message);
300
+
301
+		geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']);//To client email
302
+	}
303
+
304
+	/**
305
+	 * Called after the send enquiry email is sent.
306
+	 *
307
+	 * @since 1.0.0
308
+	 * @param array $request {
309
+	 *    The submitted form fields as an array.
310
+	 *
311
+	 *    @type string $sendact Enquiry type. Default "send_inqury".
312
+	 *    @type string $pid Post ID.
313
+	 *    @type string $inq_name Sender name.
314
+	 *    @type string $inq_email Sender mail.
315
+	 *    @type string $inq_phone Sender phone.
316
+	 *    @type string $inq_msg Email message.
317
+	 *
318
+	 * }
319
+	 */
320
+	do_action('geodir_after_send_enquiry_email', $request);
321
+	$url = get_permalink($pid);
322
+	if (strstr($url, '?')) {
323
+		$url = $url . "&send_inquiry=success";
324
+	} else {
325
+		$url = $url . "?send_inquiry=success";
326
+	}
327
+	/**
328
+	 * Filter redirect url after the send enquiry email is sent.
329
+	 *
330
+	 * @since 1.0.0
331
+	 * @param string $url Redirect url.
332
+	 */
333
+	$url = apply_filters('geodir_send_enquiry_after_submit_redirect', $url);
334
+	wp_redirect($url);
335
+	gd_die();
336 336
 
337 337
 }
338 338
 
@@ -361,85 +361,85 @@  discard block
 block discarded – undo
361 361
  */
362 362
 function geodir_send_friend($request)
363 363
 {
364
-    global $wpdb;
365
-
366
-    // strip slashes from text
367
-    $request = !empty($request) ? stripslashes_deep($request) : $request;
368
-
369
-    $yourname = $request['yourname'];
370
-    $youremail = $request['youremail'];
371
-    $frnd_subject = $request['frnd_subject'];
372
-    $frnd_comments = $request['frnd_comments'];
373
-    $pid = $request['pid'];
374
-    $to_email = $request['to_email'];
375
-    $to_name = $request['to_name'];
376
-    if ($request['pid']) {
377
-        $productinfosql = $wpdb->prepare(
378
-            "select ID,post_title from $wpdb->posts where ID =%d",
379
-            array($request['pid'])
380
-        );
381
-        $productinfo = $wpdb->get_results($productinfosql);
382
-        foreach ($productinfo as $productinfoObj) {
383
-            $post_title = $productinfoObj->post_title;
384
-        }
385
-    }
364
+	global $wpdb;
365
+
366
+	// strip slashes from text
367
+	$request = !empty($request) ? stripslashes_deep($request) : $request;
368
+
369
+	$yourname = $request['yourname'];
370
+	$youremail = $request['youremail'];
371
+	$frnd_subject = $request['frnd_subject'];
372
+	$frnd_comments = $request['frnd_comments'];
373
+	$pid = $request['pid'];
374
+	$to_email = $request['to_email'];
375
+	$to_name = $request['to_name'];
376
+	if ($request['pid']) {
377
+		$productinfosql = $wpdb->prepare(
378
+			"select ID,post_title from $wpdb->posts where ID =%d",
379
+			array($request['pid'])
380
+		);
381
+		$productinfo = $wpdb->get_results($productinfosql);
382
+		foreach ($productinfo as $productinfoObj) {
383
+			$post_title = $productinfoObj->post_title;
384
+		}
385
+	}
386 386
 
387
-    /**
388
-     * Called before the send to friend email is sent.
389
-     *
390
-     * @since 1.0.0
391
-     * @param array $request {
392
-     *    The submitted form fields as an array.
393
-     *
394
-     *    @type string $sendact Enquiry type. Default "email_frnd".
395
-     *    @type string $pid Post ID.
396
-     *    @type string $to_name Friend name.
397
-     *    @type string $to_email Friend email.
398
-     *    @type string $yourname Sender name.
399
-     *    @type string $youremail Sender email.
400
-     *    @type string $frnd_subject Email subject.
401
-     *    @type string $frnd_comments Email Message.
402
-     *
403
-     * }
404
-     */
405
-    do_action('geodir_before_send_to_friend_email', $request);
406
-    geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']);//To client email
407
-
408
-    /**
409
-     * Called after the send to friend email is sent.
410
-     *
411
-     * @since 1.0.0
412
-     * @param array $request {
413
-     *    The submitted form fields as an array.
414
-     *
415
-     *    @type string $sendact Enquiry type. Default "email_frnd".
416
-     *    @type string $pid Post ID.
417
-     *    @type string $to_name Friend name.
418
-     *    @type string $to_email Friend email.
419
-     *    @type string $yourname Sender name.
420
-     *    @type string $youremail Sender email.
421
-     *    @type string $frnd_subject Email subject.
422
-     *    @type string $frnd_comments Email Message.
423
-     *
424
-     * }
425
-     */
426
-    do_action('geodir_after_send_to_friend_email', $request);
427
-
428
-    $url = get_permalink($pid);
429
-    if (strstr($url, '?')) {
430
-        $url = $url . "&sendtofrnd=success";
431
-    } else {
432
-        $url = $url . "?sendtofrnd=success";
433
-    }
434
-    /**
435
-     * Filter redirect url after the send to friend email is sent.
436
-     *
437
-     * @since 1.0.0
438
-     * @param string $url Redirect url.
439
-     */
440
-    $url = apply_filters('geodir_send_to_friend_after_submit_redirect', $url);
441
-    wp_redirect($url);
442
-    gd_die();
387
+	/**
388
+	 * Called before the send to friend email is sent.
389
+	 *
390
+	 * @since 1.0.0
391
+	 * @param array $request {
392
+	 *    The submitted form fields as an array.
393
+	 *
394
+	 *    @type string $sendact Enquiry type. Default "email_frnd".
395
+	 *    @type string $pid Post ID.
396
+	 *    @type string $to_name Friend name.
397
+	 *    @type string $to_email Friend email.
398
+	 *    @type string $yourname Sender name.
399
+	 *    @type string $youremail Sender email.
400
+	 *    @type string $frnd_subject Email subject.
401
+	 *    @type string $frnd_comments Email Message.
402
+	 *
403
+	 * }
404
+	 */
405
+	do_action('geodir_before_send_to_friend_email', $request);
406
+	geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']);//To client email
407
+
408
+	/**
409
+	 * Called after the send to friend email is sent.
410
+	 *
411
+	 * @since 1.0.0
412
+	 * @param array $request {
413
+	 *    The submitted form fields as an array.
414
+	 *
415
+	 *    @type string $sendact Enquiry type. Default "email_frnd".
416
+	 *    @type string $pid Post ID.
417
+	 *    @type string $to_name Friend name.
418
+	 *    @type string $to_email Friend email.
419
+	 *    @type string $yourname Sender name.
420
+	 *    @type string $youremail Sender email.
421
+	 *    @type string $frnd_subject Email subject.
422
+	 *    @type string $frnd_comments Email Message.
423
+	 *
424
+	 * }
425
+	 */
426
+	do_action('geodir_after_send_to_friend_email', $request);
427
+
428
+	$url = get_permalink($pid);
429
+	if (strstr($url, '?')) {
430
+		$url = $url . "&sendtofrnd=success";
431
+	} else {
432
+		$url = $url . "?sendtofrnd=success";
433
+	}
434
+	/**
435
+	 * Filter redirect url after the send to friend email is sent.
436
+	 *
437
+	 * @since 1.0.0
438
+	 * @param string $url Redirect url.
439
+	 */
440
+	$url = apply_filters('geodir_send_to_friend_after_submit_redirect', $url);
441
+	wp_redirect($url);
442
+	gd_die();
443 443
 }
444 444
 
445 445
 /**
@@ -453,28 +453,28 @@  discard block
 block discarded – undo
453 453
  */
454 454
 function geodir_before_tab_content($hash_key)
455 455
 {
456
-    switch ($hash_key) {
457
-        case 'post_info' :
458
-            echo '<div class="geodir-company_info field-group">';
459
-            break;
460
-        case 'post_images' :
461
-            /**
462
-             * Filter post gallery HTML id.
463
-             *
464
-             * @since 1.0.0
465
-             */
466
-            echo ' <div id="' . apply_filters('geodir_post_gallery_id', 'geodir-post-gallery') . '" class="clearfix" >';
467
-            break;
468
-        case 'reviews' :
469
-            echo '<div id="reviews-wrap" class="clearfix"> ';
470
-            break;
471
-        case 'post_video':
472
-            echo ' <div id="post_video-wrap" class="clearfix">';
473
-            break;
474
-        case 'special_offers':
475
-            echo '<div id="special_offers-wrap" class="clearfix">';
476
-            break;
477
-    }
456
+	switch ($hash_key) {
457
+		case 'post_info' :
458
+			echo '<div class="geodir-company_info field-group">';
459
+			break;
460
+		case 'post_images' :
461
+			/**
462
+			 * Filter post gallery HTML id.
463
+			 *
464
+			 * @since 1.0.0
465
+			 */
466
+			echo ' <div id="' . apply_filters('geodir_post_gallery_id', 'geodir-post-gallery') . '" class="clearfix" >';
467
+			break;
468
+		case 'reviews' :
469
+			echo '<div id="reviews-wrap" class="clearfix"> ';
470
+			break;
471
+		case 'post_video':
472
+			echo ' <div id="post_video-wrap" class="clearfix">';
473
+			break;
474
+		case 'special_offers':
475
+			echo '<div id="special_offers-wrap" class="clearfix">';
476
+			break;
477
+	}
478 478
 }
479 479
 
480 480
 /**
@@ -488,23 +488,23 @@  discard block
 block discarded – undo
488 488
  */
489 489
 function geodir_after_tab_content($hash_key)
490 490
 {
491
-    switch ($hash_key) {
492
-        case 'post_info' :
493
-            echo '</div>';
494
-            break;
495
-        case 'post_images' :
496
-            echo '</div>';
497
-            break;
498
-        case 'reviews' :
499
-            echo '</div>';
500
-            break;
501
-        case 'post_video':
502
-            echo '</div>';
503
-            break;
504
-        case 'special_offers':
505
-            echo '</div>';
506
-            break;
507
-    }
491
+	switch ($hash_key) {
492
+		case 'post_info' :
493
+			echo '</div>';
494
+			break;
495
+		case 'post_images' :
496
+			echo '</div>';
497
+			break;
498
+		case 'reviews' :
499
+			echo '</div>';
500
+			break;
501
+		case 'post_video':
502
+			echo '</div>';
503
+			break;
504
+		case 'special_offers':
505
+			echo '</div>';
506
+			break;
507
+	}
508 508
 }
509 509
 
510 510
 
@@ -520,21 +520,21 @@  discard block
 block discarded – undo
520 520
 function geodir_get_posts_default_sort($post_type)
521 521
 {
522 522
 
523
-    global $wpdb;
523
+	global $wpdb;
524 524
 
525
-    if ($post_type != '') {
525
+	if ($post_type != '') {
526 526
 
527
-        $all_postypes = geodir_get_posttypes();
527
+		$all_postypes = geodir_get_posttypes();
528 528
 
529
-        if (!in_array($post_type, $all_postypes))
530
-            return false;
529
+		if (!in_array($post_type, $all_postypes))
530
+			return false;
531 531
 
532
-        $sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where	post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
532
+		$sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where	post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
533 533
 
534
-        if (!empty($sort_field_info))
535
-            return $sort_field_info;
534
+		if (!empty($sort_field_info))
535
+			return $sort_field_info;
536 536
 
537
-    }
537
+	}
538 538
 
539 539
 }
540 540
 
@@ -549,24 +549,24 @@  discard block
 block discarded – undo
549 549
  * @return bool|mixed|void Returns sort results, when the post type is valid. Otherwise returns false.
550 550
  */
551 551
 function geodir_get_sort_options($post_type) {
552
-    global $wpdb;
553
-
554
-    if ($post_type != '') {
555
-        $all_postypes = geodir_get_posttypes();
556
-
557
-        if (!in_array($post_type, $all_postypes))
558
-            return false;
559
-
560
-        $sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
561
-        /**
562
-         * Filter post sort options.
563
-         *
564
-         * @since 1.0.0
565
-         * @param array $sort_field_info Unfiltered sort field array.
566
-         * @param string $post_type Post type.
567
-         */
568
-        return apply_filters('geodir_get_sort_options', $sort_field_info, $post_type);
569
-    }
552
+	global $wpdb;
553
+
554
+	if ($post_type != '') {
555
+		$all_postypes = geodir_get_posttypes();
556
+
557
+		if (!in_array($post_type, $all_postypes))
558
+			return false;
559
+
560
+		$sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
561
+		/**
562
+		 * Filter post sort options.
563
+		 *
564
+		 * @since 1.0.0
565
+		 * @param array $sort_field_info Unfiltered sort field array.
566
+		 * @param string $post_type Post type.
567
+		 */
568
+		return apply_filters('geodir_get_sort_options', $sort_field_info, $post_type);
569
+	}
570 570
 
571 571
 }
572 572
 
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
  */
581 581
 function geodir_display_sort_options()
582 582
 {
583
-    global $wp_query;
583
+	global $wp_query;
584 584
 	
585 585
 	/**
586 586
 	 * On search pages there should be no sort options, sorting is done by search criteria.
@@ -591,57 +591,57 @@  discard block
 block discarded – undo
591 591
 		return;
592 592
 	}
593 593
 
594
-    $sort_by = '';
594
+	$sort_by = '';
595 595
 
596
-    if (isset($_REQUEST['sort_by'])) $sort_by = $_REQUEST['sort_by'];
596
+	if (isset($_REQUEST['sort_by'])) $sort_by = $_REQUEST['sort_by'];
597 597
 
598
-    $gd_post_type = geodir_get_current_posttype();
598
+	$gd_post_type = geodir_get_current_posttype();
599 599
 
600
-    $sort_options = geodir_get_sort_options($gd_post_type);
600
+	$sort_options = geodir_get_sort_options($gd_post_type);
601 601
 
602 602
 
603
-    $sort_field_options = '';
603
+	$sort_field_options = '';
604 604
 
605
-    if (!empty($sort_options)) {
606
-        foreach ($sort_options as $sort) {
605
+	if (!empty($sort_options)) {
606
+		foreach ($sort_options as $sort) {
607 607
 			$sort = stripslashes_deep($sort); // strip slashes
608 608
 
609
-            $label = __($sort->site_title, 'geodirectory');
609
+			$label = __($sort->site_title, 'geodirectory');
610 610
 
611
-            if ($sort->field_type == 'random') {
612
-                $key = $sort->field_type;
613
-                ($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
614
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
615
-            }
611
+			if ($sort->field_type == 'random') {
612
+				$key = $sort->field_type;
613
+				($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
614
+				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
615
+			}
616 616
 
617
-            if ($sort->htmlvar_name == 'comment_count') {
618
-                $sort->htmlvar_name = 'rating_count';
619
-            }
617
+			if ($sort->htmlvar_name == 'comment_count') {
618
+				$sort->htmlvar_name = 'rating_count';
619
+			}
620 620
 
621
-            if ($sort->sort_asc) {
622
-                $key = $sort->htmlvar_name . '_asc';
623
-                $label = $sort->site_title;
624
-                if ($sort->asc_title)
625
-                    $label = $sort->asc_title;
626
-                ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
627
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
628
-            }
621
+			if ($sort->sort_asc) {
622
+				$key = $sort->htmlvar_name . '_asc';
623
+				$label = $sort->site_title;
624
+				if ($sort->asc_title)
625
+					$label = $sort->asc_title;
626
+				($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
627
+				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
628
+			}
629 629
 
630
-            if ($sort->sort_desc) {
631
-                $key = $sort->htmlvar_name . '_desc';
632
-                $label = $sort->site_title;
633
-                if ($sort->desc_title)
634
-                    $label = $sort->desc_title;
635
-                ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
636
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
637
-            }
630
+			if ($sort->sort_desc) {
631
+				$key = $sort->htmlvar_name . '_desc';
632
+				$label = $sort->site_title;
633
+				if ($sort->desc_title)
634
+					$label = $sort->desc_title;
635
+				($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
636
+				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
637
+			}
638 638
 
639
-        }
640
-    }
639
+		}
640
+	}
641 641
 
642
-    if ($sort_field_options != '') {
642
+	if ($sort_field_options != '') {
643 643
 
644
-        ?>
644
+		?>
645 645
 
646 646
         <div class="geodir-tax-sort">
647 647
 
@@ -650,14 +650,14 @@  discard block
 block discarded – undo
650 650
                 <option
651 651
                     value="<?php echo esc_url( add_query_arg('sort_by', '') );?>" <?php if ($sort_by == '') echo 'selected="selected"';?>><?php _e('Sort By', 'geodirectory');?></option><?php
652 652
 
653
-                echo $sort_field_options;?>
653
+				echo $sort_field_options;?>
654 654
 
655 655
             </select>
656 656
 
657 657
         </div>
658 658
     <?php
659 659
 
660
-    }
660
+	}
661 661
 
662 662
 }
663 663
 
@@ -677,10 +677,10 @@  discard block
 block discarded – undo
677 677
 function geodir_advance_customfields_heading($title, $field_type)
678 678
 {
679 679
 
680
-    if (in_array($field_type, array('multiselect', 'textarea', 'taxonomy'))) {
681
-        $title = '';
682
-    }
683
-    return $title;
680
+	if (in_array($field_type, array('multiselect', 'textarea', 'taxonomy'))) {
681
+		$title = '';
682
+	}
683
+	return $title;
684 684
 }
685 685
 
686 686
 
@@ -697,69 +697,69 @@  discard block
 block discarded – undo
697 697
  * @return string Returns related posts html.
698 698
  */
699 699
 function geodir_related_posts_display($request) {
700
-    if (!empty($request)) {
701
-        $before_title = (isset($request['before_title']) && !empty($request['before_title'])) ? $request['before_title'] : '';
702
-        $after_title = (isset($request['after_title']) && !empty($request['after_title'])) ? $request['after_title'] : '';
703
-
704
-        $title = (isset($request['title']) && !empty($request['title'])) ? $request['title'] : __('Related Listings', 'geodirectory');
705
-        $post_number = (isset($request['post_number']) && !empty($request['post_number'])) ? $request['post_number'] : '5';
706
-        $relate_to = (isset($request['relate_to']) && !empty($request['relate_to'])) ? $request['relate_to'] : 'category';
707
-        $layout = (isset($request['layout']) && !empty($request['layout'])) ? $request['layout'] : 'gridview_onehalf';
708
-        $add_location_filter = (isset($request['add_location_filter']) && !empty($request['add_location_filter'])) ? $request['add_location_filter'] : '0';
709
-        $listing_width = (isset($request['listing_width']) && !empty($request['listing_width'])) ? $request['listing_width'] : '';
710
-        $list_sort = (isset($request['list_sort']) && !empty($request['list_sort'])) ? $request['list_sort'] : 'latest';
711
-        $character_count = (isset($request['character_count']) && !empty($request['character_count'])) ? $request['character_count'] : '';
712
-
713
-        global $wpdb, $post, $gd_session;
714
-        $origi_post = $post;
715
-        $post_type = '';
716
-        $post_id = '';
717
-        $category_taxonomy = '';
718
-        $tax_field = 'id';
719
-        $category = array();
720
-
721
-        if (isset($_REQUEST['backandedit'])) {
722
-            $post = (object)$gd_session->get('listing');
723
-            $post_type = $post->listing_type;
724
-            if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
725
-                $post_id = $_REQUEST['pid'];
726
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
727
-            $post = geodir_get_post_info($_REQUEST['pid']);
728
-            $post_type = $post->post_type;
729
-            $post_id = $_REQUEST['pid'];
730
-        } elseif (isset($post->post_type) && $post->post_type != '') {
731
-            $post_type = $post->post_type;
732
-            $post_id = $post->ID;
733
-        }
700
+	if (!empty($request)) {
701
+		$before_title = (isset($request['before_title']) && !empty($request['before_title'])) ? $request['before_title'] : '';
702
+		$after_title = (isset($request['after_title']) && !empty($request['after_title'])) ? $request['after_title'] : '';
703
+
704
+		$title = (isset($request['title']) && !empty($request['title'])) ? $request['title'] : __('Related Listings', 'geodirectory');
705
+		$post_number = (isset($request['post_number']) && !empty($request['post_number'])) ? $request['post_number'] : '5';
706
+		$relate_to = (isset($request['relate_to']) && !empty($request['relate_to'])) ? $request['relate_to'] : 'category';
707
+		$layout = (isset($request['layout']) && !empty($request['layout'])) ? $request['layout'] : 'gridview_onehalf';
708
+		$add_location_filter = (isset($request['add_location_filter']) && !empty($request['add_location_filter'])) ? $request['add_location_filter'] : '0';
709
+		$listing_width = (isset($request['listing_width']) && !empty($request['listing_width'])) ? $request['listing_width'] : '';
710
+		$list_sort = (isset($request['list_sort']) && !empty($request['list_sort'])) ? $request['list_sort'] : 'latest';
711
+		$character_count = (isset($request['character_count']) && !empty($request['character_count'])) ? $request['character_count'] : '';
712
+
713
+		global $wpdb, $post, $gd_session;
714
+		$origi_post = $post;
715
+		$post_type = '';
716
+		$post_id = '';
717
+		$category_taxonomy = '';
718
+		$tax_field = 'id';
719
+		$category = array();
720
+
721
+		if (isset($_REQUEST['backandedit'])) {
722
+			$post = (object)$gd_session->get('listing');
723
+			$post_type = $post->listing_type;
724
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
725
+				$post_id = $_REQUEST['pid'];
726
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
727
+			$post = geodir_get_post_info($_REQUEST['pid']);
728
+			$post_type = $post->post_type;
729
+			$post_id = $_REQUEST['pid'];
730
+		} elseif (isset($post->post_type) && $post->post_type != '') {
731
+			$post_type = $post->post_type;
732
+			$post_id = $post->ID;
733
+		}
734 734
 
735
-        if ($relate_to == 'category') {
735
+		if ($relate_to == 'category') {
736 736
 
737
-            $category_taxonomy = $post_type . $relate_to;
738
-            if (isset($post->{$category_taxonomy}) && $post->{$category_taxonomy} != '')
739
-                $category = explode(',', trim($post->{$category_taxonomy}, ','));
737
+			$category_taxonomy = $post_type . $relate_to;
738
+			if (isset($post->{$category_taxonomy}) && $post->{$category_taxonomy} != '')
739
+				$category = explode(',', trim($post->{$category_taxonomy}, ','));
740 740
 
741
-        } elseif ($relate_to == 'tags') {
741
+		} elseif ($relate_to == 'tags') {
742 742
 
743
-            $category_taxonomy = $post_type . '_' . $relate_to;
744
-            if ($post->post_tags != '')
745
-                $category = explode(',', trim($post->post_tags, ','));
746
-            $tax_field = 'name';
747
-        }
743
+			$category_taxonomy = $post_type . '_' . $relate_to;
744
+			if ($post->post_tags != '')
745
+				$category = explode(',', trim($post->post_tags, ','));
746
+			$tax_field = 'name';
747
+		}
748 748
 
749
-        /* --- return false in invalid request --- */
750
-        if (empty($category))
751
-            return false;
749
+		/* --- return false in invalid request --- */
750
+		if (empty($category))
751
+			return false;
752 752
 
753
-        $all_postypes = geodir_get_posttypes();
753
+		$all_postypes = geodir_get_posttypes();
754 754
 
755
-        if (!in_array($post_type, $all_postypes))
756
-            return false;
755
+		if (!in_array($post_type, $all_postypes))
756
+			return false;
757 757
 
758
-        /* --- return false in invalid request --- */
758
+		/* --- return false in invalid request --- */
759 759
 
760
-       $location_url = '';
761
-        if ($add_location_filter != '0') {
762
-            $location_url = array();
760
+	   $location_url = '';
761
+		if ($add_location_filter != '0') {
762
+			$location_url = array();
763 763
 			$geodir_show_location_url = get_option('geodir_show_location_url');
764 764
 			
765 765
 			$gd_city = get_query_var('gd_city');
@@ -767,13 +767,13 @@  discard block
 block discarded – undo
767 767
 			if ($gd_city) {
768 768
 				$gd_country = get_query_var('gd_country');
769 769
 				$gd_region = get_query_var('gd_region');
770
-            } else {
771
-                $location = geodir_get_default_location();
770
+			} else {
771
+				$location = geodir_get_default_location();
772 772
 				
773 773
 				$gd_country = isset($location->country_slug) ? $location->country_slug : '';
774 774
 				$gd_region = isset($location->region_slug) ? $location->region_slug : '';
775 775
 				$gd_city = isset($location->city_slug) ? $location->city_slug : '';
776
-            }
776
+			}
777 777
 			
778 778
 			if ($geodir_show_location_url == 'all') {
779 779
 				$location_url[] = $gd_country;
@@ -786,92 +786,92 @@  discard block
 block discarded – undo
786 786
 			
787 787
 			$location_url[] = $gd_city;
788 788
 
789
-            $location_url = implode('/', $location_url);
790
-        }
789
+			$location_url = implode('/', $location_url);
790
+		}
791 791
 
792 792
 
793
-        if (!empty($category)) {
794
-            global $geodir_add_location_url;
795
-            $geodir_add_location_url = '0';
796
-            if ($add_location_filter != '0') {
797
-                $geodir_add_location_url = '1';
798
-            }
799
-            $viewall_url = get_term_link((int)$category[0], $post_type . $category_taxonomy);
800
-            $geodir_add_location_url = NULL;
801
-        }
802
-        ob_start();
803
-        ?>
793
+		if (!empty($category)) {
794
+			global $geodir_add_location_url;
795
+			$geodir_add_location_url = '0';
796
+			if ($add_location_filter != '0') {
797
+				$geodir_add_location_url = '1';
798
+			}
799
+			$viewall_url = get_term_link((int)$category[0], $post_type . $category_taxonomy);
800
+			$geodir_add_location_url = NULL;
801
+		}
802
+		ob_start();
803
+		?>
804 804
 
805 805
 
806 806
         <div class="geodir_locations geodir_location_listing">
807 807
 
808 808
             <?php
809
-            if (isset($request['is_widget']) && $request['is_widget'] == '1') {
810
-                /** geodir_before_title filter Documented in geodirectory_widgets.php */
811
-                $before_title = isset($before_title) ? $before_title : apply_filters('geodir_before_title', '<h3 class="widget-title">');
812
-                /** geodir_after_title filter Documented in geodirectory_widgets.php */
813
-                $after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
814
-                ?>
809
+			if (isset($request['is_widget']) && $request['is_widget'] == '1') {
810
+				/** geodir_before_title filter Documented in geodirectory_widgets.php */
811
+				$before_title = isset($before_title) ? $before_title : apply_filters('geodir_before_title', '<h3 class="widget-title">');
812
+				/** geodir_after_title filter Documented in geodirectory_widgets.php */
813
+				$after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
814
+				?>
815 815
                 <div class="location_list_heading clearfix">
816 816
                     <?php echo $before_title . $title . $after_title; ?>
817 817
                 </div>
818 818
             <?php
819
-            }
820
-            $query_args = array(
821
-                'posts_per_page' => $post_number,
822
-                'is_geodir_loop' => true,
823
-                'gd_location' => ($add_location_filter) ? true : false,
824
-                'post_type' => $post_type,
825
-                'order_by' => $list_sort,
826
-                'post__not_in' => array($post_id),
827
-                'excerpt_length' => $character_count,
828
-            );
819
+			}
820
+			$query_args = array(
821
+				'posts_per_page' => $post_number,
822
+				'is_geodir_loop' => true,
823
+				'gd_location' => ($add_location_filter) ? true : false,
824
+				'post_type' => $post_type,
825
+				'order_by' => $list_sort,
826
+				'post__not_in' => array($post_id),
827
+				'excerpt_length' => $character_count,
828
+			);
829 829
 
830
-            $tax_query = array('taxonomy' => $category_taxonomy,
831
-                'field' => $tax_field,
832
-                'terms' => $category
833
-            );
830
+			$tax_query = array('taxonomy' => $category_taxonomy,
831
+				'field' => $tax_field,
832
+				'terms' => $category
833
+			);
834 834
 
835
-            $query_args['tax_query'] = array($tax_query);
835
+			$query_args['tax_query'] = array($tax_query);
836 836
 
837 837
 
838
-            global $gridview_columns, $post;
838
+			global $gridview_columns, $post;
839 839
 
840 840
 
841
-            query_posts($query_args);
841
+			query_posts($query_args);
842 842
 
843
-            if (strstr($layout, 'gridview')) {
844
-                $listing_view_exp = explode('_', $layout);
845
-                $gridview_columns = $layout;
846
-                $layout = $listing_view_exp[0];
847
-            } else if ($layout == 'list') {
848
-                $gridview_columns = '';
849
-            }
850
-            $related_posts = true;
851
-
852
-            /**
853
-             * Filters related listing listview template.
854
-             *
855
-             * @since 1.0.0
856
-             */
857
-            $template = apply_filters("geodir_template_part-related-listing-listview", geodir_locate_template('listing-listview'));
858
-
859
-            /**
860
-             * Includes related listing listview template.
861
-             *
862
-             * @since 1.0.0
863
-             */
864
-            include($template);
865
-
866
-            wp_reset_query();
867
-            $post = $origi_post;
868
-            ?>
843
+			if (strstr($layout, 'gridview')) {
844
+				$listing_view_exp = explode('_', $layout);
845
+				$gridview_columns = $layout;
846
+				$layout = $listing_view_exp[0];
847
+			} else if ($layout == 'list') {
848
+				$gridview_columns = '';
849
+			}
850
+			$related_posts = true;
851
+
852
+			/**
853
+			 * Filters related listing listview template.
854
+			 *
855
+			 * @since 1.0.0
856
+			 */
857
+			$template = apply_filters("geodir_template_part-related-listing-listview", geodir_locate_template('listing-listview'));
858
+
859
+			/**
860
+			 * Includes related listing listview template.
861
+			 *
862
+			 * @since 1.0.0
863
+			 */
864
+			include($template);
865
+
866
+			wp_reset_query();
867
+			$post = $origi_post;
868
+			?>
869 869
 
870 870
         </div>
871 871
         <?php
872
-        return $html = ob_get_clean();
872
+		return $html = ob_get_clean();
873 873
 
874
-    }
874
+	}
875 875
 
876 876
 }
877 877
 
@@ -887,17 +887,17 @@  discard block
 block discarded – undo
887 887
  */
888 888
 function geodir_category_count_script()
889 889
 {
890
-    global $geodir_post_category_str;
890
+	global $geodir_post_category_str;
891 891
 
892
-    if (!empty($geodir_post_category_str)) {
893
-        $geodir_post_category_str = serialize($geodir_post_category_str);
894
-    }
892
+	if (!empty($geodir_post_category_str)) {
893
+		$geodir_post_category_str = serialize($geodir_post_category_str);
894
+	}
895 895
 
896
-    $all_var['post_category_array'] = html_entity_decode((string)$geodir_post_category_str, ENT_QUOTES, 'UTF-8');
897
-    $script = "var post_category_array = " . json_encode($all_var) . ';';
898
-    echo '<script>';
899
-    echo $script;
900
-    echo '</script>';
896
+	$all_var['post_category_array'] = html_entity_decode((string)$geodir_post_category_str, ENT_QUOTES, 'UTF-8');
897
+	$script = "var post_category_array = " . json_encode($all_var) . ';';
898
+	echo '<script>';
899
+	echo $script;
900
+	echo '</script>';
901 901
 
902 902
 }
903 903
 
@@ -910,16 +910,16 @@  discard block
 block discarded – undo
910 910
  */
911 911
 function geodir_get_map_default_language()
912 912
 {
913
-    $geodir_default_map_language = get_option('geodir_default_map_language');
914
-    if (empty($geodir_default_map_language))
915
-        $geodir_default_map_language = 'en';
916
-    /**
917
-     * Filter default map language.
918
-     *
919
-     * @since 1.0.0
920
-     * @param string $geodir_default_map_language Default map language.
921
-     */
922
-    return apply_filters('geodir_default_map_language', $geodir_default_map_language);
913
+	$geodir_default_map_language = get_option('geodir_default_map_language');
914
+	if (empty($geodir_default_map_language))
915
+		$geodir_default_map_language = 'en';
916
+	/**
917
+	 * Filter default map language.
918
+	 *
919
+	 * @since 1.0.0
920
+	 * @param string $geodir_default_map_language Default map language.
921
+	 */
922
+	return apply_filters('geodir_default_map_language', $geodir_default_map_language);
923 923
 }
924 924
 
925 925
 
@@ -936,12 +936,12 @@  discard block
 block discarded – undo
936 936
  */
937 937
 function geodir_add_meta_keywords()
938 938
 {
939
-    global $wp, $post, $wp_query, $wpdb, $geodir_addon_list;
939
+	global $wp, $post, $wp_query, $wpdb, $geodir_addon_list;
940 940
 
941
-    $is_geodir_page = geodir_is_geodir_page();
942
-    if (!$is_geodir_page) {
943
-        return;
944
-    }// if non GD page, bail
941
+	$is_geodir_page = geodir_is_geodir_page();
942
+	if (!$is_geodir_page) {
943
+		return;
944
+	}// if non GD page, bail
945 945
 
946 946
 	$use_gd_meta = true;
947 947
 	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
@@ -956,182 +956,182 @@  discard block
 block discarded – undo
956 956
 		return;
957 957
 	}// bail if Yoast Wordpress SEO or All_in_One_SEO_Pack active.
958 958
 
959
-    $current_term = $wp_query->get_queried_object();
959
+	$current_term = $wp_query->get_queried_object();
960 960
 
961
-    $all_postypes = geodir_get_posttypes();
961
+	$all_postypes = geodir_get_posttypes();
962 962
 
963
-    $geodir_taxonomies = geodir_get_taxonomies('', true);
963
+	$geodir_taxonomies = geodir_get_taxonomies('', true);
964 964
 
965
-    $meta_desc = '';
966
-    $meta_key = '';
967
-    if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) {
968
-        /**
969
-         * Filter SEO meta location description.
970
-         *
971
-         * @since 1.0.0
972
-         */
973
-        $meta_desc = apply_filters('geodir_seo_meta_location_description', '');
974
-        $meta_desc .= '';
975
-    }
976
-    if (have_posts() && is_single() OR is_page()) {
977
-        while (have_posts()) {
978
-            the_post();
979
-
980
-            if (has_excerpt()) {
981
-                $out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt()));
982
-                if (empty($out_excerpt)) {
983
-                    $out_excerpt = strip_tags(do_shortcode(get_the_excerpt()));
984
-                }
985
-                $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt);
986
-            } else {
987
-                $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content);
988
-                $out_excerpt = strip_tags(strip_shortcodes($out_excerpt));
989
-                if (empty($out_excerpt)) {
990
-                    $out_excerpt = strip_tags(do_shortcode($out_excerpt)); // parse short code from content
991
-                }
992
-                $out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-');
993
-            }
965
+	$meta_desc = '';
966
+	$meta_key = '';
967
+	if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) {
968
+		/**
969
+		 * Filter SEO meta location description.
970
+		 *
971
+		 * @since 1.0.0
972
+		 */
973
+		$meta_desc = apply_filters('geodir_seo_meta_location_description', '');
974
+		$meta_desc .= '';
975
+	}
976
+	if (have_posts() && is_single() OR is_page()) {
977
+		while (have_posts()) {
978
+			the_post();
979
+
980
+			if (has_excerpt()) {
981
+				$out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt()));
982
+				if (empty($out_excerpt)) {
983
+					$out_excerpt = strip_tags(do_shortcode(get_the_excerpt()));
984
+				}
985
+				$out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt);
986
+			} else {
987
+				$out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content);
988
+				$out_excerpt = strip_tags(strip_shortcodes($out_excerpt));
989
+				if (empty($out_excerpt)) {
990
+					$out_excerpt = strip_tags(do_shortcode($out_excerpt)); // parse short code from content
991
+				}
992
+				$out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-');
993
+			}
994 994
 
995
-            $meta_desc .= $out_excerpt;
996
-        }
997
-    } elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
998
-        if (is_category()) {
999
-            $meta_desc .= __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE));
1000
-        } elseif (is_tag()) {
1001
-            $meta_desc .= __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE));
1002
-        }
1003
-    } elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1004
-        $meta_desc .= isset($current_term->description) ? $current_term->description : '';
1005
-    }
995
+			$meta_desc .= $out_excerpt;
996
+		}
997
+	} elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
998
+		if (is_category()) {
999
+			$meta_desc .= __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE));
1000
+		} elseif (is_tag()) {
1001
+			$meta_desc .= __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE));
1002
+		}
1003
+	} elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1004
+		$meta_desc .= isset($current_term->description) ? $current_term->description : '';
1005
+	}
1006 1006
 
1007 1007
 
1008
-    $geodir_post_type = geodir_get_current_posttype();
1009
-    $geodir_post_type_info = get_post_type_object($geodir_post_type);
1010
-    $geodir_is_page_listing = geodir_is_page('listing') ? true : false;
1011
-
1012
-    $category_taxonomy = geodir_get_taxonomies($geodir_post_type);
1013
-    $tag_taxonomy = geodir_get_taxonomies($geodir_post_type, true);
1014
-
1015
-    $geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false;
1016
-    $geodir_is_tag = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false;
1017
-
1018
-    $geodir_is_search = geodir_is_page('search') ? true : false;
1019
-    $geodir_is_location = geodir_is_page('location') ? true : false;
1020
-    $geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false;
1021
-    $godir_location_terms = geodir_get_current_location_terms('query_vars');
1022
-    $gd_city = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : NULL;
1023
-    $gd_region = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : NULL;
1024
-    $gd_country = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : NULL;
1025
-    $replace_location = __('Everywhere', 'geodirectory');
1026
-    $location_id = NULL;
1027
-    if ($geodir_location_manager) {
1028
-        $sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1029
-        $location_id = (int)$wpdb->get_var($sql);
1030
-        $location_type = geodir_what_is_current_location();
1031
-        if ($location_type == 'city') {
1032
-            $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
1033
-        } elseif ($location_type == 'region') {
1034
-            $replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
1035
-        } elseif ($location_type == 'country') {
1036
-            $replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
1037
-            $replace_location = __($replace_location, 'geodirectory');
1038
-        }
1039
-        $country = get_query_var('gd_country');
1040
-        $region = get_query_var('gd_region');
1041
-        $city = get_query_var('gd_city');
1042
-        $current_location = '';
1043
-        if ($country != '') {
1044
-            $current_location = get_actual_location_name('country', $country, true);
1045
-        }
1046
-        if ($region != '') {
1047
-            $current_location = get_actual_location_name('region', $region);
1048
-        }
1049
-        if ($city != '') {
1050
-            $current_location = get_actual_location_name('city', $city);
1051
-        }
1052
-        $replace_location = $current_location != '' ? $current_location : $replace_location;
1053
-    }
1008
+	$geodir_post_type = geodir_get_current_posttype();
1009
+	$geodir_post_type_info = get_post_type_object($geodir_post_type);
1010
+	$geodir_is_page_listing = geodir_is_page('listing') ? true : false;
1011
+
1012
+	$category_taxonomy = geodir_get_taxonomies($geodir_post_type);
1013
+	$tag_taxonomy = geodir_get_taxonomies($geodir_post_type, true);
1014
+
1015
+	$geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false;
1016
+	$geodir_is_tag = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false;
1017
+
1018
+	$geodir_is_search = geodir_is_page('search') ? true : false;
1019
+	$geodir_is_location = geodir_is_page('location') ? true : false;
1020
+	$geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false;
1021
+	$godir_location_terms = geodir_get_current_location_terms('query_vars');
1022
+	$gd_city = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : NULL;
1023
+	$gd_region = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : NULL;
1024
+	$gd_country = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : NULL;
1025
+	$replace_location = __('Everywhere', 'geodirectory');
1026
+	$location_id = NULL;
1027
+	if ($geodir_location_manager) {
1028
+		$sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1029
+		$location_id = (int)$wpdb->get_var($sql);
1030
+		$location_type = geodir_what_is_current_location();
1031
+		if ($location_type == 'city') {
1032
+			$replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
1033
+		} elseif ($location_type == 'region') {
1034
+			$replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
1035
+		} elseif ($location_type == 'country') {
1036
+			$replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
1037
+			$replace_location = __($replace_location, 'geodirectory');
1038
+		}
1039
+		$country = get_query_var('gd_country');
1040
+		$region = get_query_var('gd_region');
1041
+		$city = get_query_var('gd_city');
1042
+		$current_location = '';
1043
+		if ($country != '') {
1044
+			$current_location = get_actual_location_name('country', $country, true);
1045
+		}
1046
+		if ($region != '') {
1047
+			$current_location = get_actual_location_name('region', $region);
1048
+		}
1049
+		if ($city != '') {
1050
+			$current_location = get_actual_location_name('city', $city);
1051
+		}
1052
+		$replace_location = $current_location != '' ? $current_location : $replace_location;
1053
+	}
1054 1054
 
1055
-    $geodir_meta_keys = '';
1056
-    $geodir_meta_desc = '';
1057
-    if ($is_geodir_page && !empty($geodir_post_type_info)) {
1058
-        if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) {
1059
-            $geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys;
1060
-
1061
-            $geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc;
1062
-            $geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc;
1063
-
1064
-            if ($geodir_is_category) {
1065
-                $category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : NULL;
1066
-                if (isset($category->term_id) && !empty($category->term_id)) {
1067
-                    $category_id = $category->term_id;
1068
-                    $category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type);
1069
-                    if ($location_id) {
1070
-                        $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id;
1071
-                        $cat_loc_option = get_option($option_name);
1072
-
1073
-                        $gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
1074
-                        if (!$gd_cat_loc_default) {
1075
-                            $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id;
1076
-                            $option = get_option($option_name);
1077
-                            $category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc;
1078
-                        }
1079
-                    }
1080
-                    $geodir_meta_desc = __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE)) . '. ' . $category_desc;
1081
-                }
1082
-            } else if ($geodir_is_tag) {
1083
-                $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE)) . '. ' . $geodir_meta_desc;
1084
-            }
1085
-        }
1086
-    }
1055
+	$geodir_meta_keys = '';
1056
+	$geodir_meta_desc = '';
1057
+	if ($is_geodir_page && !empty($geodir_post_type_info)) {
1058
+		if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) {
1059
+			$geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys;
1060
+
1061
+			$geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc;
1062
+			$geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc;
1063
+
1064
+			if ($geodir_is_category) {
1065
+				$category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : NULL;
1066
+				if (isset($category->term_id) && !empty($category->term_id)) {
1067
+					$category_id = $category->term_id;
1068
+					$category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type);
1069
+					if ($location_id) {
1070
+						$option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id;
1071
+						$cat_loc_option = get_option($option_name);
1072
+
1073
+						$gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
1074
+						if (!$gd_cat_loc_default) {
1075
+							$option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id;
1076
+							$option = get_option($option_name);
1077
+							$category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc;
1078
+						}
1079
+					}
1080
+					$geodir_meta_desc = __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE)) . '. ' . $category_desc;
1081
+				}
1082
+			} else if ($geodir_is_tag) {
1083
+				$geodir_meta_desc = __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE)) . '. ' . $geodir_meta_desc;
1084
+			}
1085
+		}
1086
+	}
1087 1087
 
1088 1088
 
1089
-    $gd_page = '';
1090
-    if(geodir_is_page('home')){
1091
-        $gd_page = 'home';
1092
-        $meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
1093
-    }
1094
-    elseif(geodir_is_page('detail')){
1095
-        $gd_page = 'detail';
1096
-        $meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
1097
-    }
1098
-    elseif(geodir_is_page('pt')){
1099
-        $gd_page = 'pt';
1100
-        $meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
1101
-    }
1102
-    elseif(geodir_is_page('listing')){
1103
-        $gd_page = 'listing';
1104
-        $meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
1105
-    }
1106
-    elseif(geodir_is_page('location')){
1107
-        $gd_page = 'location';
1108
-        $meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
1109
-        $meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
1089
+	$gd_page = '';
1090
+	if(geodir_is_page('home')){
1091
+		$gd_page = 'home';
1092
+		$meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
1093
+	}
1094
+	elseif(geodir_is_page('detail')){
1095
+		$gd_page = 'detail';
1096
+		$meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
1097
+	}
1098
+	elseif(geodir_is_page('pt')){
1099
+		$gd_page = 'pt';
1100
+		$meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
1101
+	}
1102
+	elseif(geodir_is_page('listing')){
1103
+		$gd_page = 'listing';
1104
+		$meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
1105
+	}
1106
+	elseif(geodir_is_page('location')){
1107
+		$gd_page = 'location';
1108
+		$meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
1109
+		$meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
1110 1110
 
1111
-    }
1112
-    elseif(geodir_is_page('search')){
1113
-        $gd_page = 'search';
1114
-        $meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
1115
-    }
1116
-    elseif(geodir_is_page('add-listing')){
1117
-        $gd_page = 'add-listing';
1118
-        $meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
1119
-    }
1120
-    elseif(geodir_is_page('author')){
1121
-        $gd_page = 'author';
1122
-        $meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
1123
-    }
1124
-    elseif(geodir_is_page('login')){
1125
-        $gd_page = 'login';
1126
-        $meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
1127
-    }
1128
-    elseif(geodir_is_page('listing-success')){
1129
-        $gd_page = 'listing-success';
1130
-        $meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
1131
-    }
1111
+	}
1112
+	elseif(geodir_is_page('search')){
1113
+		$gd_page = 'search';
1114
+		$meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
1115
+	}
1116
+	elseif(geodir_is_page('add-listing')){
1117
+		$gd_page = 'add-listing';
1118
+		$meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
1119
+	}
1120
+	elseif(geodir_is_page('author')){
1121
+		$gd_page = 'author';
1122
+		$meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
1123
+	}
1124
+	elseif(geodir_is_page('login')){
1125
+		$gd_page = 'login';
1126
+		$meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
1127
+	}
1128
+	elseif(geodir_is_page('listing-success')){
1129
+		$gd_page = 'listing-success';
1130
+		$meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
1131
+	}
1132 1132
 
1133 1133
 
1134
-    /*
1134
+	/*
1135 1135
     $geodir_meta_desc = $geodir_meta_desc != '' ? $geodir_meta_desc : $meta_desc;
1136 1136
     if ($geodir_meta_desc != '') {
1137 1137
         $geodir_meta_desc = strip_tags($geodir_meta_desc);
@@ -1144,74 +1144,74 @@  discard block
 block discarded – undo
1144 1144
     */
1145 1145
 
1146 1146
 
1147
-    if ($meta_desc) {
1148
-        $meta_desc = stripslashes_deep($meta_desc);
1149
-        /**
1150
-         * Filter page description to replace variables.
1151
-         *
1152
-         * @since 1.5.4
1153
-         * @param string $title The page description including variables.
1154
-         * @param string $gd_page The GeoDirectory page type if any.
1155
-         */
1156
-        $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'),$gd_page,'');
1157
-
1158
-        /**
1159
-         * Filter SEO meta description.
1160
-         *
1161
-         * @since 1.0.0
1162
-         * @param string $meta_desc Meta description content.
1163
-         */
1164
-        echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc);
1165
-    }
1147
+	if ($meta_desc) {
1148
+		$meta_desc = stripslashes_deep($meta_desc);
1149
+		/**
1150
+		 * Filter page description to replace variables.
1151
+		 *
1152
+		 * @since 1.5.4
1153
+		 * @param string $title The page description including variables.
1154
+		 * @param string $gd_page The GeoDirectory page type if any.
1155
+		 */
1156
+		$meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'),$gd_page,'');
1157
+
1158
+		/**
1159
+		 * Filter SEO meta description.
1160
+		 *
1161
+		 * @since 1.0.0
1162
+		 * @param string $meta_desc Meta description content.
1163
+		 */
1164
+		echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc);
1165
+	}
1166 1166
 
1167
-    // meta keywords
1168
-    if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
1169
-        $place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
1170
-        $place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
1171
-
1172
-        $meta_key .= implode(", ", array_merge((array)$place_cats, (array)$place_tags));
1173
-    } else {
1174
-        $posttags = get_the_tags();
1175
-        if ($posttags) {
1176
-            foreach ($posttags as $tag) {
1177
-                $meta_key .= $tag->name . ' ';
1178
-            }
1179
-        } else {
1180
-            $tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
1181
-            $xt = 1;
1167
+	// meta keywords
1168
+	if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
1169
+		$place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
1170
+		$place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
1171
+
1172
+		$meta_key .= implode(", ", array_merge((array)$place_cats, (array)$place_tags));
1173
+	} else {
1174
+		$posttags = get_the_tags();
1175
+		if ($posttags) {
1176
+			foreach ($posttags as $tag) {
1177
+				$meta_key .= $tag->name . ' ';
1178
+			}
1179
+		} else {
1180
+			$tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
1181
+			$xt = 1;
1182 1182
 
1183
-            foreach ($tags as $tag) {
1184
-                if ($xt <= 20) {
1185
-                    $meta_key .= $tag->name . ", ";
1186
-                }
1183
+			foreach ($tags as $tag) {
1184
+				if ($xt <= 20) {
1185
+					$meta_key .= $tag->name . ", ";
1186
+				}
1187 1187
 
1188
-                $xt++;
1189
-            }
1190
-        }
1191
-    }
1188
+				$xt++;
1189
+			}
1190
+		}
1191
+	}
1192 1192
 
1193
-    $meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key;
1194
-    $geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1195
-    if ($geodir_meta_keys != '') {
1196
-        $geodir_meta_keys = strip_tags($geodir_meta_keys);
1197
-        $geodir_meta_keys = esc_html($geodir_meta_keys);
1198
-        $geodir_meta_keys = geodir_strtolower($geodir_meta_keys);
1199
-        $geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, '');
1200
-        $geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys);
1193
+	$meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key;
1194
+	$geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1195
+	if ($geodir_meta_keys != '') {
1196
+		$geodir_meta_keys = strip_tags($geodir_meta_keys);
1197
+		$geodir_meta_keys = esc_html($geodir_meta_keys);
1198
+		$geodir_meta_keys = geodir_strtolower($geodir_meta_keys);
1199
+		$geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, '');
1200
+		$geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys);
1201 1201
 
1202
-        $meta_key = rtrim(trim($geodir_meta_keys), ",");
1203
-    }
1202
+		$meta_key = rtrim(trim($geodir_meta_keys), ",");
1203
+	}
1204 1204
 
1205
-    if ($meta_key) {
1206
-        $meta_key = stripslashes_deep($meta_key);
1207
-        /**
1208
-         * Filter SEO meta keywords.
1209
-         *
1210
-         * @since 1.0.0
1211
-         * @param string $meta_desc Meta keywords.
1212
-         */
1213
-        echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key);
1214
-    }
1205
+	if ($meta_key) {
1206
+		$meta_key = stripslashes_deep($meta_key);
1207
+		/**
1208
+		 * Filter SEO meta keywords.
1209
+		 *
1210
+		 * @since 1.0.0
1211
+		 * @param string $meta_desc Meta keywords.
1212
+		 */
1213
+		echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key);
1214
+	}
1215 1215
 
1216 1216
 }
1217 1217
 
@@ -1226,14 +1226,14 @@  discard block
 block discarded – undo
1226 1226
  */
1227 1227
 function geodir_detail_page_tabs_key_value_array()
1228 1228
 {
1229
-    $geodir_detail_page_tabs_key_value_array = array();
1229
+	$geodir_detail_page_tabs_key_value_array = array();
1230 1230
 
1231
-    $geodir_detail_page_tabs_array = geodir_detail_page_tabs_array();
1231
+	$geodir_detail_page_tabs_array = geodir_detail_page_tabs_array();
1232 1232
 
1233
-    foreach ($geodir_detail_page_tabs_array as $key => $tabs_obj) {
1234
-        $geodir_detail_page_tabs_key_value_array[$key] = $tabs_obj['heading_text'];
1235
-    }
1236
-    return $geodir_detail_page_tabs_key_value_array;
1233
+	foreach ($geodir_detail_page_tabs_array as $key => $tabs_obj) {
1234
+		$geodir_detail_page_tabs_key_value_array[$key] = $tabs_obj['heading_text'];
1235
+	}
1236
+	return $geodir_detail_page_tabs_key_value_array;
1237 1237
 }
1238 1238
 
1239 1239
 /**
@@ -1246,73 +1246,73 @@  discard block
 block discarded – undo
1246 1246
 function geodir_detail_page_tabs_array()
1247 1247
 {
1248 1248
 
1249
-    $arr_tabs = array();
1250
-    /**
1251
-     * Filter detail page tab display.
1252
-     *
1253
-     * @since 1.0.0
1254
-     */
1255
-    $arr_tabs['post_profile'] = array(
1256
-        'heading_text' => __('Profile', 'geodirectory'),
1257
-        'is_active_tab' => true,
1258
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_profile'),
1259
-        'tab_content' => ''
1260
-    );
1261
-    $arr_tabs['post_info'] = array(
1262
-        'heading_text' => __('More Info', 'geodirectory'),
1263
-        'is_active_tab' => false,
1264
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_info'),
1265
-        'tab_content' => ''
1266
-    );
1267
-
1268
-    $arr_tabs['post_images'] = array(
1269
-        'heading_text' => __('Photo', 'geodirectory'),
1270
-        'is_active_tab' => false,
1271
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_images'),
1272
-        'tab_content' => ''
1273
-    );
1274
-
1275
-    $arr_tabs['post_video'] = array(
1276
-        'heading_text' => __('Video', 'geodirectory'),
1277
-        'is_active_tab' => false,
1278
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_video'),
1279
-        'tab_content' => ''
1280
-    );
1281
-
1282
-    $arr_tabs['special_offers'] = array(
1283
-        'heading_text' => __('Special Offers', 'geodirectory'),
1284
-        'is_active_tab' => false,
1285
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'special_offers'),
1286
-        'tab_content' => ''
1287
-    );
1288
-
1289
-    $arr_tabs['post_map'] = array(
1290
-        'heading_text' => __('Map', 'geodirectory'),
1291
-        'is_active_tab' => false,
1292
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_map'),
1293
-        'tab_content' => ''
1294
-    );
1295
-
1296
-    $arr_tabs['reviews'] = array(
1297
-        'heading_text' => __('Reviews', 'geodirectory'),
1298
-        'is_active_tab' => false,
1299
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'reviews'),
1300
-        'tab_content' => 'review display'
1301
-    );
1302
-
1303
-    $arr_tabs['related_listing'] = array(
1304
-        'heading_text' => __('Related Listing', 'geodirectory'),
1305
-        'is_active_tab' => false,
1306
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'related_listing'),
1307
-        'tab_content' => ''
1308
-    );
1309
-
1310
-    /**
1311
-     * Filter the tabs array.
1312
-     *
1313
-     * @since 1.0.0
1314
-     */
1315
-    return apply_filters('geodir_detail_page_tab_list_extend', $arr_tabs);
1249
+	$arr_tabs = array();
1250
+	/**
1251
+	 * Filter detail page tab display.
1252
+	 *
1253
+	 * @since 1.0.0
1254
+	 */
1255
+	$arr_tabs['post_profile'] = array(
1256
+		'heading_text' => __('Profile', 'geodirectory'),
1257
+		'is_active_tab' => true,
1258
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_profile'),
1259
+		'tab_content' => ''
1260
+	);
1261
+	$arr_tabs['post_info'] = array(
1262
+		'heading_text' => __('More Info', 'geodirectory'),
1263
+		'is_active_tab' => false,
1264
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_info'),
1265
+		'tab_content' => ''
1266
+	);
1267
+
1268
+	$arr_tabs['post_images'] = array(
1269
+		'heading_text' => __('Photo', 'geodirectory'),
1270
+		'is_active_tab' => false,
1271
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_images'),
1272
+		'tab_content' => ''
1273
+	);
1274
+
1275
+	$arr_tabs['post_video'] = array(
1276
+		'heading_text' => __('Video', 'geodirectory'),
1277
+		'is_active_tab' => false,
1278
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_video'),
1279
+		'tab_content' => ''
1280
+	);
1281
+
1282
+	$arr_tabs['special_offers'] = array(
1283
+		'heading_text' => __('Special Offers', 'geodirectory'),
1284
+		'is_active_tab' => false,
1285
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'special_offers'),
1286
+		'tab_content' => ''
1287
+	);
1288
+
1289
+	$arr_tabs['post_map'] = array(
1290
+		'heading_text' => __('Map', 'geodirectory'),
1291
+		'is_active_tab' => false,
1292
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_map'),
1293
+		'tab_content' => ''
1294
+	);
1295
+
1296
+	$arr_tabs['reviews'] = array(
1297
+		'heading_text' => __('Reviews', 'geodirectory'),
1298
+		'is_active_tab' => false,
1299
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'reviews'),
1300
+		'tab_content' => 'review display'
1301
+	);
1302
+
1303
+	$arr_tabs['related_listing'] = array(
1304
+		'heading_text' => __('Related Listing', 'geodirectory'),
1305
+		'is_active_tab' => false,
1306
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'related_listing'),
1307
+		'tab_content' => ''
1308
+	);
1309
+
1310
+	/**
1311
+	 * Filter the tabs array.
1312
+	 *
1313
+	 * @since 1.0.0
1314
+	 */
1315
+	return apply_filters('geodir_detail_page_tab_list_extend', $arr_tabs);
1316 1316
 
1317 1317
 
1318 1318
 }
@@ -1327,15 +1327,15 @@  discard block
 block discarded – undo
1327 1327
  */
1328 1328
 function geodir_detail_page_tabs_list()
1329 1329
 {
1330
-    $tabs_excluded = get_option('geodir_detail_page_tabs_excluded');
1331
-    $tabs_array = geodir_detail_page_tabs_array();
1332
-    if (!empty($tabs_excluded)) {
1333
-        foreach ($tabs_excluded as $tab) {
1334
-            if (array_key_exists($tab, $tabs_array))
1335
-                unset($tabs_array[$tab]);
1336
-        }
1337
-    }
1338
-    return $tabs_array;
1330
+	$tabs_excluded = get_option('geodir_detail_page_tabs_excluded');
1331
+	$tabs_array = geodir_detail_page_tabs_array();
1332
+	if (!empty($tabs_excluded)) {
1333
+		foreach ($tabs_excluded as $tab) {
1334
+			if (array_key_exists($tab, $tabs_array))
1335
+				unset($tabs_array[$tab]);
1336
+		}
1337
+	}
1338
+	return $tabs_array;
1339 1339
 }
1340 1340
 
1341 1341
 
@@ -1353,151 +1353,151 @@  discard block
 block discarded – undo
1353 1353
  */
1354 1354
 function geodir_show_detail_page_tabs()
1355 1355
 {
1356
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1356
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1357 1357
 
1358
-    $post_id = !empty($post) && isset($post->ID) ? (int)$post->ID : 0;
1359
-    $request_post_id = !empty($_REQUEST['p']) ? (int)$_REQUEST['p'] : 0;
1360
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1358
+	$post_id = !empty($post) && isset($post->ID) ? (int)$post->ID : 0;
1359
+	$request_post_id = !empty($_REQUEST['p']) ? (int)$_REQUEST['p'] : 0;
1360
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1361 1361
 
1362
-    if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
1363
-        $post = geodir_get_post_info($request_post_id);
1364
-        setup_postdata($post);
1365
-    }
1362
+	if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
1363
+		$post = geodir_get_post_info($request_post_id);
1364
+		setup_postdata($post);
1365
+	}
1366 1366
 
1367
-    $geodir_post_detail_fields = geodir_show_listing_info('detail');
1368
-
1369
-    if (geodir_is_page('detail')) {
1370
-        $video = geodir_get_video($post->ID);
1371
-        $special_offers = geodir_get_special_offers($post->ID);
1372
-        $related_listing_array = array();
1373
-        if (get_option('geodir_add_related_listing_posttypes'))
1374
-            $related_listing_array = get_option('geodir_add_related_listing_posttypes');
1375
-
1376
-        $related_listing = '';
1377
-        if (in_array($post->post_type, $related_listing_array)) {
1378
-            $request = array('post_number' => get_option('geodir_related_post_count'),
1379
-                'relate_to' => get_option('geodir_related_post_relate_to'),
1380
-                'layout' => get_option('geodir_related_post_listing_view'),
1381
-                'add_location_filter' => get_option('geodir_related_post_location_filter'),
1382
-                'list_sort' => get_option('geodir_related_post_sortby'),
1383
-                'character_count' => get_option('geodir_related_post_excerpt'));
1384
-
1385
-            $related_listing = geodir_related_posts_display($request);
1386
-        }
1367
+	$geodir_post_detail_fields = geodir_show_listing_info('detail');
1368
+
1369
+	if (geodir_is_page('detail')) {
1370
+		$video = geodir_get_video($post->ID);
1371
+		$special_offers = geodir_get_special_offers($post->ID);
1372
+		$related_listing_array = array();
1373
+		if (get_option('geodir_add_related_listing_posttypes'))
1374
+			$related_listing_array = get_option('geodir_add_related_listing_posttypes');
1375
+
1376
+		$related_listing = '';
1377
+		if (in_array($post->post_type, $related_listing_array)) {
1378
+			$request = array('post_number' => get_option('geodir_related_post_count'),
1379
+				'relate_to' => get_option('geodir_related_post_relate_to'),
1380
+				'layout' => get_option('geodir_related_post_listing_view'),
1381
+				'add_location_filter' => get_option('geodir_related_post_location_filter'),
1382
+				'list_sort' => get_option('geodir_related_post_sortby'),
1383
+				'character_count' => get_option('geodir_related_post_excerpt'));
1384
+
1385
+			$related_listing = geodir_related_posts_display($request);
1386
+		}
1387 1387
 
1388
-        $post_images = geodir_get_images($post->ID, 'thumbnail');
1389
-        $thumb_image = '';
1390
-        if (!empty($post_images)) {
1391
-            foreach ($post_images as $image) {
1392
-                $caption = (!empty($image->caption)) ? $image->caption : '';
1393
-                $thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">';
1394
-                $thumb_image .= geodir_show_image($image, 'thumbnail', true, false);
1395
-                $thumb_image .= '</a>';
1396
-            }
1397
-        }
1388
+		$post_images = geodir_get_images($post->ID, 'thumbnail');
1389
+		$thumb_image = '';
1390
+		if (!empty($post_images)) {
1391
+			foreach ($post_images as $image) {
1392
+				$caption = (!empty($image->caption)) ? $image->caption : '';
1393
+				$thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">';
1394
+				$thumb_image .= geodir_show_image($image, 'thumbnail', true, false);
1395
+				$thumb_image .= '</a>';
1396
+			}
1397
+		}
1398 1398
 
1399
-        $map_args = array();
1400
-        $map_args['map_canvas_name'] = 'detail_page_map_canvas';
1401
-        $map_args['width'] = '600';
1402
-        $map_args['height'] = '300';
1403
-        if ($post->post_mapzoom) {
1404
-            $map_args['zoom'] = '' . $post->post_mapzoom . '';
1405
-        }
1406
-        $map_args['autozoom'] = false;
1407
-        $map_args['child_collapse'] = '0';
1408
-        $map_args['enable_cat_filters'] = false;
1409
-        $map_args['enable_text_search'] = false;
1410
-        $map_args['enable_post_type_filters'] = false;
1411
-        $map_args['enable_location_filters'] = false;
1412
-        $map_args['enable_jason_on_load'] = true;
1413
-        $map_args['enable_map_direction'] = true;
1414
-        $map_args['map_class_name'] = 'geodir-map-detail-page';
1415
-        $map_args['maptype'] = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP';
1416
-    } else if (geodir_is_page('preview')) {
1417
-        $video = isset($post->geodir_video) ? $post->geodir_video : '';
1418
-        $special_offers = isset($post->geodir_special_offers) ? $post->geodir_special_offers : '';
1419
-
1420
-        if (isset($post->post_images))
1421
-            $post->post_images = trim($post->post_images, ",");
1422
-
1423
-        if (isset($post->post_images) && !empty($post->post_images))
1424
-            $post_images = explode(",", $post->post_images);
1425
-
1426
-        $thumb_image = '';
1427
-        if (!empty($post_images)) {
1428
-            foreach ($post_images as $image) {
1429
-                if ($image != '') {
1430
-                    $thumb_image .= '<a href="' . $image . '">';
1431
-                    $thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
1432
-                    $thumb_image .= '</a>';
1433
-                }
1434
-            }
1435
-        }
1399
+		$map_args = array();
1400
+		$map_args['map_canvas_name'] = 'detail_page_map_canvas';
1401
+		$map_args['width'] = '600';
1402
+		$map_args['height'] = '300';
1403
+		if ($post->post_mapzoom) {
1404
+			$map_args['zoom'] = '' . $post->post_mapzoom . '';
1405
+		}
1406
+		$map_args['autozoom'] = false;
1407
+		$map_args['child_collapse'] = '0';
1408
+		$map_args['enable_cat_filters'] = false;
1409
+		$map_args['enable_text_search'] = false;
1410
+		$map_args['enable_post_type_filters'] = false;
1411
+		$map_args['enable_location_filters'] = false;
1412
+		$map_args['enable_jason_on_load'] = true;
1413
+		$map_args['enable_map_direction'] = true;
1414
+		$map_args['map_class_name'] = 'geodir-map-detail-page';
1415
+		$map_args['maptype'] = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP';
1416
+	} else if (geodir_is_page('preview')) {
1417
+		$video = isset($post->geodir_video) ? $post->geodir_video : '';
1418
+		$special_offers = isset($post->geodir_special_offers) ? $post->geodir_special_offers : '';
1419
+
1420
+		if (isset($post->post_images))
1421
+			$post->post_images = trim($post->post_images, ",");
1422
+
1423
+		if (isset($post->post_images) && !empty($post->post_images))
1424
+			$post_images = explode(",", $post->post_images);
1425
+
1426
+		$thumb_image = '';
1427
+		if (!empty($post_images)) {
1428
+			foreach ($post_images as $image) {
1429
+				if ($image != '') {
1430
+					$thumb_image .= '<a href="' . $image . '">';
1431
+					$thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
1432
+					$thumb_image .= '</a>';
1433
+				}
1434
+			}
1435
+		}
1436 1436
 
1437
-        global $map_jason;
1438
-        $marker_json = $post->marker_json != '' ? json_decode($post->marker_json, true) : array();
1439
-        $icon_size = (!empty($marker_json) && !empty($marker_json['icon'])) ? $marker_json['icon'] : '';             
1440
-        $icon_size = geodir_get_marker_size($marker_json['icon']);
1441
-        $marker_json['w'] = $icon_size['w'];
1442
-        $marker_json['h'] = $icon_size['h'];
1443
-        $map_jason[] = json_encode($marker_json);
1444
-
1445
-        $address_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
1446
-        $address_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
1447
-        $mapview = isset($post->post_mapview) ? $post->post_mapview : '';
1448
-        $mapzoom = isset($post->post_mapzoom) ? $post->post_mapzoom : '';
1449
-        if (!$mapzoom) {
1450
-            $mapzoom = 12;
1451
-        }
1437
+		global $map_jason;
1438
+		$marker_json = $post->marker_json != '' ? json_decode($post->marker_json, true) : array();
1439
+		$icon_size = (!empty($marker_json) && !empty($marker_json['icon'])) ? $marker_json['icon'] : '';             
1440
+		$icon_size = geodir_get_marker_size($marker_json['icon']);
1441
+		$marker_json['w'] = $icon_size['w'];
1442
+		$marker_json['h'] = $icon_size['h'];
1443
+		$map_jason[] = json_encode($marker_json);
1444
+
1445
+		$address_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
1446
+		$address_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
1447
+		$mapview = isset($post->post_mapview) ? $post->post_mapview : '';
1448
+		$mapzoom = isset($post->post_mapzoom) ? $post->post_mapzoom : '';
1449
+		if (!$mapzoom) {
1450
+			$mapzoom = 12;
1451
+		}
1452 1452
 
1453
-        $map_args = array();
1454
-        $map_args['map_canvas_name'] = 'preview_map_canvas';
1455
-        $map_args['width'] = '950';
1456
-        $map_args['height'] = '300';
1457
-        $map_args['child_collapse'] = '0';
1458
-        $map_args['maptype'] = $mapview;
1459
-        $map_args['autozoom'] = false;
1460
-        $map_args['zoom'] = "$mapzoom";
1461
-        $map_args['latitude'] = $address_latitude;
1462
-        $map_args['longitude'] = $address_longitude;
1463
-        $map_args['enable_cat_filters'] = false;
1464
-        $map_args['enable_text_search'] = false;
1465
-        $map_args['enable_post_type_filters'] = false;
1466
-        $map_args['enable_location_filters'] = false;
1467
-        $map_args['enable_jason_on_load'] = true;
1468
-        $map_args['enable_map_direction'] = true;
1469
-        $map_args['map_class_name'] = 'geodir-map-preview-page';
1470
-    }
1453
+		$map_args = array();
1454
+		$map_args['map_canvas_name'] = 'preview_map_canvas';
1455
+		$map_args['width'] = '950';
1456
+		$map_args['height'] = '300';
1457
+		$map_args['child_collapse'] = '0';
1458
+		$map_args['maptype'] = $mapview;
1459
+		$map_args['autozoom'] = false;
1460
+		$map_args['zoom'] = "$mapzoom";
1461
+		$map_args['latitude'] = $address_latitude;
1462
+		$map_args['longitude'] = $address_longitude;
1463
+		$map_args['enable_cat_filters'] = false;
1464
+		$map_args['enable_text_search'] = false;
1465
+		$map_args['enable_post_type_filters'] = false;
1466
+		$map_args['enable_location_filters'] = false;
1467
+		$map_args['enable_jason_on_load'] = true;
1468
+		$map_args['enable_map_direction'] = true;
1469
+		$map_args['map_class_name'] = 'geodir-map-preview-page';
1470
+	}
1471 1471
 
1472
-    $arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user
1472
+	$arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user
1473 1473
 
1474
-    $active_tab = '';
1475
-    $active_tab_name = '';
1476
-    $default_tab = '';
1477
-    $default_tab_name = '';
1478
-    foreach($arr_detail_page_tabs as $tab_index => $tabs){
1479
-        if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
1480
-            $active_tab = $tab_index;
1481
-            $active_tab_name = __($tabs['heading_text'], 'geodirectory');
1482
-        }
1474
+	$active_tab = '';
1475
+	$active_tab_name = '';
1476
+	$default_tab = '';
1477
+	$default_tab_name = '';
1478
+	foreach($arr_detail_page_tabs as $tab_index => $tabs){
1479
+		if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
1480
+			$active_tab = $tab_index;
1481
+			$active_tab_name = __($tabs['heading_text'], 'geodirectory');
1482
+		}
1483 1483
         
1484
-        if ($default_tab === '' && !empty($tabs['is_display']) && !empty($tabs['heading_text'])) {
1485
-            $default_tab = $tab_index;
1486
-            $default_tab_name = __($tabs['heading_text'], 'geodirectory');
1487
-        }
1488
-    }
1484
+		if ($default_tab === '' && !empty($tabs['is_display']) && !empty($tabs['heading_text'])) {
1485
+			$default_tab = $tab_index;
1486
+			$default_tab_name = __($tabs['heading_text'], 'geodirectory');
1487
+		}
1488
+	}
1489 1489
     
1490
-    if ($active_tab === '' && $default_tab !== '') { // Make first tab acs a active tab if not any tab is active.
1491
-        if (isset($arr_detail_page_tabs[$active_tab]) && isset($arr_detail_page_tabs[$active_tab]['is_active_tab'])) {
1492
-            $arr_detail_page_tabs[$active_tab]['is_active_tab'] = false;
1493
-        }
1490
+	if ($active_tab === '' && $default_tab !== '') { // Make first tab acs a active tab if not any tab is active.
1491
+		if (isset($arr_detail_page_tabs[$active_tab]) && isset($arr_detail_page_tabs[$active_tab]['is_active_tab'])) {
1492
+			$arr_detail_page_tabs[$active_tab]['is_active_tab'] = false;
1493
+		}
1494 1494
         
1495
-        $arr_detail_page_tabs[$default_tab]['is_active_tab'] = true;
1496
-        $active_tab = $default_tab;
1497
-        $active_tab_name = $default_tab_name;
1498
-    }
1499
-    $tab_list = (get_option('geodir_disable_tabs',true)) ? true : false;
1500
-    ?>
1495
+		$arr_detail_page_tabs[$default_tab]['is_active_tab'] = true;
1496
+		$active_tab = $default_tab;
1497
+		$active_tab_name = $default_tab_name;
1498
+	}
1499
+	$tab_list = (get_option('geodir_disable_tabs',true)) ? true : false;
1500
+	?>
1501 1501
     <div class="geodir-tabs" id="gd-tabs" style="position:relative;">
1502 1502
         <?php if(!$tab_list){ ?>
1503 1503
         <div id="geodir-tab-mobile-menu">
@@ -1507,166 +1507,166 @@  discard block
 block discarded – undo
1507 1507
         </div>
1508 1508
         <dl class="geodir-tab-head">
1509 1509
             <?php
1510
-            }
1511
-            /**
1512
-             * Called before the details page tab list headings, inside the `dl` tag.
1513
-             *
1514
-             * @since 1.0.0
1515
-             * @see 'geodir_after_tab_list'
1516
-             */
1517
-            do_action('geodir_before_tab_list'); ?>
1510
+			}
1511
+			/**
1512
+			 * Called before the details page tab list headings, inside the `dl` tag.
1513
+			 *
1514
+			 * @since 1.0.0
1515
+			 * @see 'geodir_after_tab_list'
1516
+			 */
1517
+			do_action('geodir_before_tab_list'); ?>
1518 1518
             <?php
1519 1519
 
1520
-            foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
1521
-                if ($detail_page_tab['is_display']) {
1520
+			foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
1521
+				if ($detail_page_tab['is_display']) {
1522 1522
 
1523
-                    if(!$tab_list) {
1524
-                        ?>
1523
+					if(!$tab_list) {
1524
+						?>
1525 1525
                         <dt></dt> <!-- added to comply with validation -->
1526 1526
                         <dd <?php if ($detail_page_tab['is_active_tab']){ ?>class="geodir-tab-active"<?php } ?> ><a
1527 1527
                                 data-tab="#<?php echo $tab_index; ?>"
1528 1528
                                 data-status="enable"><?php _e($detail_page_tab['heading_text'], 'geodirectory'); ?></a>
1529 1529
                         </dd>
1530 1530
                         <?php
1531
-                    }
1532
-                    ob_start() // start tab content buffering
1533
-                    ?>
1531
+					}
1532
+					ob_start() // start tab content buffering
1533
+					?>
1534 1534
                     <li id="<?php echo $tab_index;?>Tab">
1535 1535
                         <?php if($tab_list){
1536
-                            $tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'],'geodirectory').'</a></span><hr />';
1537
-                            /**
1538
-                             * Filter the tab list title html.
1539
-                             *
1540
-                             * @since 1.6.1
1541
-                             * @param string $tab_title The html for the tab title.
1542
-                             * @param string $tab_index The tab index type.
1543
-                             * @param array $detail_page_tab The array of values including title text.
1544
-                             */
1545
-                            echo apply_filters('geodir_tab_list_title',$tab_title ,$tab_index ,$detail_page_tab);
1546
-                        }?>
1536
+							$tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'],'geodirectory').'</a></span><hr />';
1537
+							/**
1538
+							 * Filter the tab list title html.
1539
+							 *
1540
+							 * @since 1.6.1
1541
+							 * @param string $tab_title The html for the tab title.
1542
+							 * @param string $tab_index The tab index type.
1543
+							 * @param array $detail_page_tab The array of values including title text.
1544
+							 */
1545
+							echo apply_filters('geodir_tab_list_title',$tab_title ,$tab_index ,$detail_page_tab);
1546
+						}?>
1547 1547
                         <div id="<?php echo $tab_index;?>" class="hash-offset"></div>
1548 1548
                         <?php
1549
-                        /**
1550
-                         * Called before the details tab content is output per tab.
1551
-                         *
1552
-                         * @since 1.0.0
1553
-                         * @param string $tab_index The tab name ID.
1554
-                         */
1555
-                        do_action('geodir_before_tab_content', $tab_index);
1556
-
1557
-                        /**
1558
-                         * Called before the details tab content is output per tab.
1559
-                         *
1560
-                         * Uses dynamic hook name: geodir_before_$tab_index_tab_content
1561
-                         *
1562
-                         * @since 1.0.0
1563
-                         * @todo do we need this if we have the hook above? 'geodir_before_tab_content'
1564
-                         */
1565
-                        do_action('geodir_before_' . $tab_index . '_tab_content');
1566
-                        /// write a code to generate content of each tab
1567
-                        switch ($tab_index) {
1568
-                            case 'post_profile':
1569
-                                /**
1570
-                                 * Called before the listing description content on the details page tab.
1571
-                                 *
1572
-                                 * @since 1.0.0
1573
-                                 */
1574
-                                do_action('geodir_before_description_on_listing_detail');
1575
-                                if (geodir_is_page('detail')) {
1576
-                                    the_content();
1577
-                                } else {
1578
-                                    /** This action is documented in geodirectory_template_actions.php */
1579
-                                    echo apply_filters('the_content', stripslashes($post->post_desc));
1580
-                                }
1581
-
1582
-                                /**
1583
-                                 * Called after the listing description content on the details page tab.
1584
-                                 *
1585
-                                 * @since 1.0.0
1586
-                                 */
1587
-                                do_action('geodir_after_description_on_listing_detail');
1588
-                                break;
1589
-                            case 'post_info':
1590
-                                echo $geodir_post_detail_fields;
1591
-                                break;
1592
-                            case 'post_images':
1593
-                                echo $thumb_image;
1594
-                                break;
1595
-                            case 'post_video':
1596
-                                /** This action is documented in geodirectory_template_actions.php */
1597
-                                echo apply_filters('the_content', stripslashes($video));// we apply the_content filter so oembed works also;
1598
-                                break;
1599
-                            case 'special_offers':
1600
-                                echo wpautop(stripslashes($special_offers));
1601
-
1602
-                                break;
1603
-                            case 'post_map':
1604
-                                geodir_draw_map($map_args);
1605
-                                break;
1606
-                            case 'reviews':
1607
-                                comments_template();
1608
-                                break;
1609
-                            case 'related_listing':
1610
-                                echo $related_listing;
1611
-                                break;
1612
-                            default: {
1613
-                                if ((isset($post->{$tab_index}) || (!isset($post->{$tab_index}) && (strpos($tab_index, 'gd_tab_') !== false || $tab_index == 'link_business'))) && !empty($detail_page_tab['tab_content'])) {
1614
-                                    echo $detail_page_tab['tab_content'];
1615
-                                }
1616
-                            }
1617
-                                break;
1618
-                        }
1619
-
1620
-                        /**
1621
-                         * Called after the details tab content is output per tab.
1622
-                         *
1623
-                         * @since 1.0.0
1624
-                         */
1625
-                        do_action('geodir_after_tab_content', $tab_index);
1626
-
1627
-                        /**
1628
-                         * Called after the details tab content is output per tab.
1629
-                         *
1630
-                         * Uses dynamic hook name: geodir_after_$tab_index_tab_content
1631
-                         *
1632
-                         * @since 1.0.0
1633
-                         * @todo do we need this if we have the hook above? 'geodir_after_tab_content'
1634
-                         */
1635
-                        do_action('geodir_after_' . $tab_index . '_tab_content');
1636
-                        ?> </li>
1549
+						/**
1550
+						 * Called before the details tab content is output per tab.
1551
+						 *
1552
+						 * @since 1.0.0
1553
+						 * @param string $tab_index The tab name ID.
1554
+						 */
1555
+						do_action('geodir_before_tab_content', $tab_index);
1556
+
1557
+						/**
1558
+						 * Called before the details tab content is output per tab.
1559
+						 *
1560
+						 * Uses dynamic hook name: geodir_before_$tab_index_tab_content
1561
+						 *
1562
+						 * @since 1.0.0
1563
+						 * @todo do we need this if we have the hook above? 'geodir_before_tab_content'
1564
+						 */
1565
+						do_action('geodir_before_' . $tab_index . '_tab_content');
1566
+						/// write a code to generate content of each tab
1567
+						switch ($tab_index) {
1568
+							case 'post_profile':
1569
+								/**
1570
+								 * Called before the listing description content on the details page tab.
1571
+								 *
1572
+								 * @since 1.0.0
1573
+								 */
1574
+								do_action('geodir_before_description_on_listing_detail');
1575
+								if (geodir_is_page('detail')) {
1576
+									the_content();
1577
+								} else {
1578
+									/** This action is documented in geodirectory_template_actions.php */
1579
+									echo apply_filters('the_content', stripslashes($post->post_desc));
1580
+								}
1581
+
1582
+								/**
1583
+								 * Called after the listing description content on the details page tab.
1584
+								 *
1585
+								 * @since 1.0.0
1586
+								 */
1587
+								do_action('geodir_after_description_on_listing_detail');
1588
+								break;
1589
+							case 'post_info':
1590
+								echo $geodir_post_detail_fields;
1591
+								break;
1592
+							case 'post_images':
1593
+								echo $thumb_image;
1594
+								break;
1595
+							case 'post_video':
1596
+								/** This action is documented in geodirectory_template_actions.php */
1597
+								echo apply_filters('the_content', stripslashes($video));// we apply the_content filter so oembed works also;
1598
+								break;
1599
+							case 'special_offers':
1600
+								echo wpautop(stripslashes($special_offers));
1601
+
1602
+								break;
1603
+							case 'post_map':
1604
+								geodir_draw_map($map_args);
1605
+								break;
1606
+							case 'reviews':
1607
+								comments_template();
1608
+								break;
1609
+							case 'related_listing':
1610
+								echo $related_listing;
1611
+								break;
1612
+							default: {
1613
+								if ((isset($post->{$tab_index}) || (!isset($post->{$tab_index}) && (strpos($tab_index, 'gd_tab_') !== false || $tab_index == 'link_business'))) && !empty($detail_page_tab['tab_content'])) {
1614
+									echo $detail_page_tab['tab_content'];
1615
+								}
1616
+							}
1617
+								break;
1618
+						}
1619
+
1620
+						/**
1621
+						 * Called after the details tab content is output per tab.
1622
+						 *
1623
+						 * @since 1.0.0
1624
+						 */
1625
+						do_action('geodir_after_tab_content', $tab_index);
1626
+
1627
+						/**
1628
+						 * Called after the details tab content is output per tab.
1629
+						 *
1630
+						 * Uses dynamic hook name: geodir_after_$tab_index_tab_content
1631
+						 *
1632
+						 * @since 1.0.0
1633
+						 * @todo do we need this if we have the hook above? 'geodir_after_tab_content'
1634
+						 */
1635
+						do_action('geodir_after_' . $tab_index . '_tab_content');
1636
+						?> </li>
1637 1637
                     <?php
1638
-                    /**
1639
-                     * Filter the current tab content.
1640
-                     *
1641
-                     * @since 1.0.0
1642
-                     */
1643
-                    $arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean());
1644
-                } // end of if for is_display
1645
-            }// end of foreach
1646
-
1647
-            /**
1648
-             * Called after the details page tab list headings, inside the `dl` tag.
1649
-             *
1650
-             * @since 1.0.0
1651
-             * @see 'geodir_before_tab_list'
1652
-             */
1653
-            do_action('geodir_after_tab_list');
1654
-            ?>
1638
+					/**
1639
+					 * Filter the current tab content.
1640
+					 *
1641
+					 * @since 1.0.0
1642
+					 */
1643
+					$arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean());
1644
+				} // end of if for is_display
1645
+			}// end of foreach
1646
+
1647
+			/**
1648
+			 * Called after the details page tab list headings, inside the `dl` tag.
1649
+			 *
1650
+			 * @since 1.0.0
1651
+			 * @see 'geodir_before_tab_list'
1652
+			 */
1653
+			do_action('geodir_after_tab_list');
1654
+			?>
1655 1655
             <?php if(!$tab_list){?></dl><?php }?>
1656 1656
         <ul class="geodir-tabs-content entry-content" style="position:relative;">
1657 1657
             <?php
1658
-            foreach ($arr_detail_page_tabs as $detail_page_tab) {
1659
-                if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) {
1660
-                    echo $detail_page_tab['tab_content'];
1661
-                }// end of if
1662
-            }// end of foreach
1663
-
1664
-            /**
1665
-             * Called after all the tab content is output in `li` tags, called before the closing `ul` tag.
1666
-             *
1667
-             * @since 1.0.0
1668
-             */
1669
-            do_action('geodir_add_tab_content'); ?>
1658
+			foreach ($arr_detail_page_tabs as $detail_page_tab) {
1659
+				if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) {
1660
+					echo $detail_page_tab['tab_content'];
1661
+				}// end of if
1662
+			}// end of foreach
1663
+
1664
+			/**
1665
+			 * Called after all the tab content is output in `li` tags, called before the closing `ul` tag.
1666
+			 *
1667
+			 * @since 1.0.0
1668
+			 */
1669
+			do_action('geodir_add_tab_content'); ?>
1670 1670
         </ul>
1671 1671
         <!--gd-tabs-content ul end-->
1672 1672
     </div>
@@ -1689,7 +1689,7 @@  discard block
 block discarded – undo
1689 1689
         });
1690 1690
     </script>
1691 1691
     <?php
1692
-    }
1692
+	}
1693 1693
 }
1694 1694
 
1695 1695
 /**
@@ -1702,127 +1702,127 @@  discard block
 block discarded – undo
1702 1702
  */
1703 1703
 function geodir_exif($file)
1704 1704
 {
1705
-    if (empty($file) || !is_array($file)) {
1706
-        return $file;
1707
-    }
1705
+	if (empty($file) || !is_array($file)) {
1706
+		return $file;
1707
+	}
1708 1708
     
1709
-    $file_path = !empty($file['tmp_name']) ? sanitize_text_field($file['tmp_name']) : '';
1710
-    if (!($file_path && file_exists($file_path))) {
1711
-        return $file;
1712
-    }
1713
-    $file['file'] = $file_path;
1709
+	$file_path = !empty($file['tmp_name']) ? sanitize_text_field($file['tmp_name']) : '';
1710
+	if (!($file_path && file_exists($file_path))) {
1711
+		return $file;
1712
+	}
1713
+	$file['file'] = $file_path;
1714 1714
     
1715
-    if (!file_is_valid_image($file_path)) {
1716
-        return $file; // Bail if file is not an image.
1717
-    }
1715
+	if (!file_is_valid_image($file_path)) {
1716
+		return $file; // Bail if file is not an image.
1717
+	}
1718 1718
     
1719
-    if (!function_exists('wp_get_image_editor')) {
1720
-        return $file;
1721
-    }
1719
+	if (!function_exists('wp_get_image_editor')) {
1720
+		return $file;
1721
+	}
1722 1722
    
1723
-    $mime_type = $file['type'];
1724
-    $exif = array();
1725
-    if ($mime_type == 'image/jpeg' && function_exists('exif_read_data')) {
1726
-        try {
1727
-            $exif = exif_read_data($file_path);
1728
-        } catch(Exception $e) {
1729
-            $exif = array();
1730
-        }
1731
-    }
1723
+	$mime_type = $file['type'];
1724
+	$exif = array();
1725
+	if ($mime_type == 'image/jpeg' && function_exists('exif_read_data')) {
1726
+		try {
1727
+			$exif = exif_read_data($file_path);
1728
+		} catch(Exception $e) {
1729
+			$exif = array();
1730
+		}
1731
+	}
1732 1732
     
1733
-    $rotate = false;
1734
-    $flip = false;
1735
-    $modify = false;
1736
-    $orientation = 0;
1737
-    if (!empty($exif) && isset($exif['Orientation'])) {
1738
-        switch ((int)$exif['Orientation']) {
1739
-            case 1:
1740
-                // do nothing
1741
-                break;
1742
-            case 2:
1743
-                $flip = array(false, true);
1744
-                $modify = true;
1745
-                break;
1746
-            case 3:
1747
-                $orientation = -180;
1748
-                $rotate = true;
1749
-                $modify = true;
1750
-                break;
1751
-            case 4:
1752
-                $flip = array(true, false);
1753
-                $modify = true;
1754
-                break;
1755
-            case 5:
1756
-                $orientation = -90;
1757
-                $rotate = true;
1758
-                $flip = array(false, true);
1759
-                $modify = true;
1760
-                break;
1761
-            case 6:
1762
-                $orientation = -90;
1763
-                $rotate = true;
1764
-                $modify = true;
1765
-                break;
1766
-            case 7:
1767
-                $orientation = -270;
1768
-                $rotate = true;
1769
-                $flip = array(false, true);
1770
-                $modify = true;
1771
-                break;
1772
-            case 8:
1773
-            case 9:
1774
-                $orientation = -270;
1775
-                $rotate = true;
1776
-                $modify = true;
1777
-                break;
1778
-            default:
1779
-                $orientation = 0;
1780
-                $rotate = true;
1781
-                $modify = true;
1782
-                break;
1783
-        }
1784
-    }
1733
+	$rotate = false;
1734
+	$flip = false;
1735
+	$modify = false;
1736
+	$orientation = 0;
1737
+	if (!empty($exif) && isset($exif['Orientation'])) {
1738
+		switch ((int)$exif['Orientation']) {
1739
+			case 1:
1740
+				// do nothing
1741
+				break;
1742
+			case 2:
1743
+				$flip = array(false, true);
1744
+				$modify = true;
1745
+				break;
1746
+			case 3:
1747
+				$orientation = -180;
1748
+				$rotate = true;
1749
+				$modify = true;
1750
+				break;
1751
+			case 4:
1752
+				$flip = array(true, false);
1753
+				$modify = true;
1754
+				break;
1755
+			case 5:
1756
+				$orientation = -90;
1757
+				$rotate = true;
1758
+				$flip = array(false, true);
1759
+				$modify = true;
1760
+				break;
1761
+			case 6:
1762
+				$orientation = -90;
1763
+				$rotate = true;
1764
+				$modify = true;
1765
+				break;
1766
+			case 7:
1767
+				$orientation = -270;
1768
+				$rotate = true;
1769
+				$flip = array(false, true);
1770
+				$modify = true;
1771
+				break;
1772
+			case 8:
1773
+			case 9:
1774
+				$orientation = -270;
1775
+				$rotate = true;
1776
+				$modify = true;
1777
+				break;
1778
+			default:
1779
+				$orientation = 0;
1780
+				$rotate = true;
1781
+				$modify = true;
1782
+				break;
1783
+		}
1784
+	}
1785 1785
     
1786
-    $quality = null;
1787
-    /**
1788
-     * Filter the image quality.
1789
-     *
1790
-     * @since 1.5.7
1791
-     * @param int|null $quality Image Compression quality between 1-100% scale. Default null.
1792
-     * @param string $quality Image mime type.
1793
-     */
1794
-    $quality = apply_filters('geodir_image_upload_set_quality', $quality, $mime_type);
1795
-    if ($quality !== null) {
1796
-        $modify = true;
1797
-    }
1786
+	$quality = null;
1787
+	/**
1788
+	 * Filter the image quality.
1789
+	 *
1790
+	 * @since 1.5.7
1791
+	 * @param int|null $quality Image Compression quality between 1-100% scale. Default null.
1792
+	 * @param string $quality Image mime type.
1793
+	 */
1794
+	$quality = apply_filters('geodir_image_upload_set_quality', $quality, $mime_type);
1795
+	if ($quality !== null) {
1796
+		$modify = true;
1797
+	}
1798 1798
 
1799
-    if (!$modify) {
1800
-        return $file; // no change
1801
-    }
1799
+	if (!$modify) {
1800
+		return $file; // no change
1801
+	}
1802 1802
 
1803
-    $image = wp_get_image_editor($file_path);
1804
-    if (!is_wp_error($image)) {
1805
-        if ($rotate) {
1806
-            $image->rotate($orientation);
1807
-        }
1803
+	$image = wp_get_image_editor($file_path);
1804
+	if (!is_wp_error($image)) {
1805
+		if ($rotate) {
1806
+			$image->rotate($orientation);
1807
+		}
1808 1808
         
1809
-        if (!empty($flip)) {
1810
-            $image->flip($flip[0], $flip[1]);
1811
-        }
1809
+		if (!empty($flip)) {
1810
+			$image->flip($flip[0], $flip[1]);
1811
+		}
1812 1812
         
1813
-        if ($quality !== null) {
1814
-            $image->set_quality((int)$quality);
1815
-        }
1813
+		if ($quality !== null) {
1814
+			$image->set_quality((int)$quality);
1815
+		}
1816 1816
         
1817
-       $result = $image->save($file_path);
1818
-       if (!is_wp_error($result)) {
1819
-           $file['file'] = $result['path'];
1820
-           $file['tmp_name'] = $result['path'];
1821
-       }
1822
-    }
1817
+	   $result = $image->save($file_path);
1818
+	   if (!is_wp_error($result)) {
1819
+		   $file['file'] = $result['path'];
1820
+		   $file['tmp_name'] = $result['path'];
1821
+	   }
1822
+	}
1823 1823
     
1824
-    // The image orientation is fixed, pass it back for further processing
1825
-    return $file;
1824
+	// The image orientation is fixed, pass it back for further processing
1825
+	return $file;
1826 1826
 }
1827 1827
 
1828 1828
 /**
@@ -1841,138 +1841,138 @@  discard block
 block discarded – undo
1841 1841
  * @return string Returns the recent reviews html.
1842 1842
  */
1843 1843
 function geodir_get_recent_reviews($g_size = 60, $no_comments = 10, $comment_lenth = 60, $show_pass_post = false) {
1844
-    global $wpdb, $tablecomments, $tableposts, $rating_table_name, $gd_session;
1845
-    $tablecomments = $wpdb->comments;
1846
-    $tableposts = $wpdb->posts;
1847
-
1848
-    $comments_echo = '';
1849
-    $city_filter = '';
1850
-    $region_filter = '';
1851
-    $country_filter = '';
1852
-
1853
-    if ($gd_session->get('gd_multi_location')) {
1854
-        if ($gd_ses_country = $gd_session->get('gd_country')) {
1855
-            $country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $gd_ses_country));
1856
-        }
1844
+	global $wpdb, $tablecomments, $tableposts, $rating_table_name, $gd_session;
1845
+	$tablecomments = $wpdb->comments;
1846
+	$tableposts = $wpdb->posts;
1847
+
1848
+	$comments_echo = '';
1849
+	$city_filter = '';
1850
+	$region_filter = '';
1851
+	$country_filter = '';
1852
+
1853
+	if ($gd_session->get('gd_multi_location')) {
1854
+		if ($gd_ses_country = $gd_session->get('gd_country')) {
1855
+			$country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $gd_ses_country));
1856
+		}
1857 1857
 
1858
-        if ($gd_ses_region = $gd_session->get('gd_region')) {
1859
-            $region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $gd_ses_region));
1860
-        }
1858
+		if ($gd_ses_region = $gd_session->get('gd_region')) {
1859
+			$region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $gd_ses_region));
1860
+		}
1861 1861
 
1862
-        if ($gd_ses_city = $gd_session->get('gd_city')) {
1863
-            $city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $gd_ses_city));
1864
-        }
1865
-    }
1862
+		if ($gd_ses_city = $gd_session->get('gd_city')) {
1863
+			$city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $gd_ses_city));
1864
+		}
1865
+	}
1866 1866
 	
1867
-    $review_table = GEODIR_REVIEW_TABLE;
1868
-    $request = "SELECT r.id as ID, r.post_type, r.comment_id as comment_ID, r.post_date as comment_date,r.overall_rating, r.user_id, r.post_id FROM $review_table as r WHERE r.post_status = 1 AND r.status =1 AND r.overall_rating>=1 $country_filter $region_filter $city_filter ORDER BY r.post_date DESC, r.id DESC LIMIT $no_comments";
1869
-
1870
-    $comments = $wpdb->get_results($request);
1871
-
1872
-    foreach ($comments as $comment) {
1873
-        // Set the extra comment info needed.
1874
-        $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
1875
-        //echo "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID";
1876
-        $comment->comment_content = $comment_extra->comment_content;
1877
-        $comment->comment_author = $comment_extra->comment_author;
1878
-        $comment->comment_author_email = $comment_extra->comment_author_email;
1879
-
1880
-        $comment_id = '';
1881
-        $comment_id = $comment->comment_ID;
1882
-        $comment_content = strip_tags($comment->comment_content);
1883
-
1884
-        $comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
1885
-
1886
-        $permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID;
1887
-        $comment_author_email = $comment->comment_author_email;
1888
-        $comment_post_ID = $comment->post_id;
1889
-
1890
-        $na = true;
1891
-        if (function_exists('icl_object_id') && icl_object_id($comment_post_ID, $comment->post_type, true)) {
1892
-            $comment_post_ID2 = icl_object_id($comment_post_ID, $comment->post_type, false);
1893
-            if ($comment_post_ID == $comment_post_ID2) {
1894
-            } else {
1895
-                $na = false;
1896
-            }
1897
-        }
1867
+	$review_table = GEODIR_REVIEW_TABLE;
1868
+	$request = "SELECT r.id as ID, r.post_type, r.comment_id as comment_ID, r.post_date as comment_date,r.overall_rating, r.user_id, r.post_id FROM $review_table as r WHERE r.post_status = 1 AND r.status =1 AND r.overall_rating>=1 $country_filter $region_filter $city_filter ORDER BY r.post_date DESC, r.id DESC LIMIT $no_comments";
1869
+
1870
+	$comments = $wpdb->get_results($request);
1871
+
1872
+	foreach ($comments as $comment) {
1873
+		// Set the extra comment info needed.
1874
+		$comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
1875
+		//echo "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID";
1876
+		$comment->comment_content = $comment_extra->comment_content;
1877
+		$comment->comment_author = $comment_extra->comment_author;
1878
+		$comment->comment_author_email = $comment_extra->comment_author_email;
1879
+
1880
+		$comment_id = '';
1881
+		$comment_id = $comment->comment_ID;
1882
+		$comment_content = strip_tags($comment->comment_content);
1883
+
1884
+		$comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
1885
+
1886
+		$permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID;
1887
+		$comment_author_email = $comment->comment_author_email;
1888
+		$comment_post_ID = $comment->post_id;
1889
+
1890
+		$na = true;
1891
+		if (function_exists('icl_object_id') && icl_object_id($comment_post_ID, $comment->post_type, true)) {
1892
+			$comment_post_ID2 = icl_object_id($comment_post_ID, $comment->post_type, false);
1893
+			if ($comment_post_ID == $comment_post_ID2) {
1894
+			} else {
1895
+				$na = false;
1896
+			}
1897
+		}
1898 1898
 
1899
-        $post_title = get_the_title($comment_post_ID);
1900
-        $permalink = get_permalink($comment_post_ID);
1901
-        $comment_permalink = $permalink . "#comment-" . $comment->comment_ID;
1902
-        $read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __('Read more', 'geodirectory') . '</a>';
1899
+		$post_title = get_the_title($comment_post_ID);
1900
+		$permalink = get_permalink($comment_post_ID);
1901
+		$comment_permalink = $permalink . "#comment-" . $comment->comment_ID;
1902
+		$read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __('Read more', 'geodirectory') . '</a>';
1903 1903
 
1904
-        $comment_content_length = strlen($comment_content);
1905
-        if ($comment_content_length > $comment_lenth) {
1906
-            $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth) . '... ' . $read_more;
1907
-        } else {
1908
-            $comment_excerpt = $comment_content;
1909
-        }
1904
+		$comment_content_length = strlen($comment_content);
1905
+		if ($comment_content_length > $comment_lenth) {
1906
+			$comment_excerpt = mb_substr($comment_content, 0, $comment_lenth) . '... ' . $read_more;
1907
+		} else {
1908
+			$comment_excerpt = $comment_content;
1909
+		}
1910 1910
 
1911
-        if ($comment->user_id) {
1912
-            $user_profile_url = get_author_posts_url($comment->user_id);
1913
-        } else {
1914
-            $user_profile_url = '';
1915
-        }
1911
+		if ($comment->user_id) {
1912
+			$user_profile_url = get_author_posts_url($comment->user_id);
1913
+		} else {
1914
+			$user_profile_url = '';
1915
+		}
1916 1916
 
1917
-        if ($comment_id && $na) {
1918
-            $comments_echo .= '<li class="clearfix">';
1919
-            $comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">";
1920
-            if (function_exists('get_avatar')) {
1921
-                if (!isset($comment->comment_type)) {
1922
-                    if ($user_profile_url) {
1923
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1924
-                    }
1925
-                    $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1926
-                    if ($user_profile_url) {
1927
-                        $comments_echo .= '</a>';
1928
-                    }
1929
-                } elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
1930
-                    if ($user_profile_url) {
1931
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1932
-                    }
1933
-                    $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1934
-                }
1935
-            } elseif (function_exists('gravatar')) {
1936
-                if ($user_profile_url) {
1937
-                    $comments_echo .= '<a href="' . $user_profile_url . '">';
1938
-                }
1939
-                $comments_echo .= "<img src=\"";
1940
-                if ('' == $comment->comment_type) {
1941
-                    $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1942
-                    if ($user_profile_url) {
1943
-                        $comments_echo .= '</a>';
1944
-                    }
1945
-                } elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
1946
-                    if ($user_profile_url) {
1947
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1948
-                    }
1949
-                    $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1950
-                    if ($user_profile_url) {
1951
-                        $comments_echo .= '</a>';
1952
-                    }
1953
-                }
1954
-                $comments_echo .= "\" alt=\"\" class=\"avatar\" />";
1955
-            }
1917
+		if ($comment_id && $na) {
1918
+			$comments_echo .= '<li class="clearfix">';
1919
+			$comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">";
1920
+			if (function_exists('get_avatar')) {
1921
+				if (!isset($comment->comment_type)) {
1922
+					if ($user_profile_url) {
1923
+						$comments_echo .= '<a href="' . $user_profile_url . '">';
1924
+					}
1925
+					$comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1926
+					if ($user_profile_url) {
1927
+						$comments_echo .= '</a>';
1928
+					}
1929
+				} elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
1930
+					if ($user_profile_url) {
1931
+						$comments_echo .= '<a href="' . $user_profile_url . '">';
1932
+					}
1933
+					$comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1934
+				}
1935
+			} elseif (function_exists('gravatar')) {
1936
+				if ($user_profile_url) {
1937
+					$comments_echo .= '<a href="' . $user_profile_url . '">';
1938
+				}
1939
+				$comments_echo .= "<img src=\"";
1940
+				if ('' == $comment->comment_type) {
1941
+					$comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1942
+					if ($user_profile_url) {
1943
+						$comments_echo .= '</a>';
1944
+					}
1945
+				} elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
1946
+					if ($user_profile_url) {
1947
+						$comments_echo .= '<a href="' . $user_profile_url . '">';
1948
+					}
1949
+					$comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1950
+					if ($user_profile_url) {
1951
+						$comments_echo .= '</a>';
1952
+					}
1953
+				}
1954
+				$comments_echo .= "\" alt=\"\" class=\"avatar\" />";
1955
+			}
1956 1956
 
1957
-            $comments_echo .= "</span>\n";
1958
-
1959
-            $comments_echo .= '<span class="geodir_reviewer_content">';
1960
-            if($comment->user_id){$comments_echo .= '<a href="'.get_author_posts_url( $comment->user_id ).'">';}
1961
-            $comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> ';
1962
-            if($comment->user_id){$comments_echo .= '</a>';}
1963
-            $comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
1964
-            $comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>';
1965
-            $comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID);
1966
-            $comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . '';
1967
-            //echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
1968
-            $comments_echo .= '</p>';
1969
-
1970
-            $comments_echo .= "</span>\n";
1971
-            $comments_echo .= '</li>';
1972
-        }
1973
-    }
1957
+			$comments_echo .= "</span>\n";
1958
+
1959
+			$comments_echo .= '<span class="geodir_reviewer_content">';
1960
+			if($comment->user_id){$comments_echo .= '<a href="'.get_author_posts_url( $comment->user_id ).'">';}
1961
+			$comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> ';
1962
+			if($comment->user_id){$comments_echo .= '</a>';}
1963
+			$comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
1964
+			$comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>';
1965
+			$comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID);
1966
+			$comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . '';
1967
+			//echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
1968
+			$comments_echo .= '</p>';
1969
+
1970
+			$comments_echo .= "</span>\n";
1971
+			$comments_echo .= '</li>';
1972
+		}
1973
+	}
1974 1974
 
1975
-    return $comments_echo;
1975
+	return $comments_echo;
1976 1976
 }
1977 1977
 
1978 1978
 /**
@@ -1984,29 +1984,29 @@  discard block
 block discarded – undo
1984 1984
  */
1985 1985
 function geodir_home_map_cats_key_value_array()
1986 1986
 {
1987
-    $post_types = geodir_get_posttypes('object');
1988
-
1989
-    $return = array();
1990
-    if (!empty($post_types)) {
1991
-        foreach ($post_types as $key => $post_type) {
1992
-            $cpt_name = __($post_type->labels->singular_name, 'geodirectory');
1993
-            $post_type_name =   sprintf(__('%s Categories', 'geodirectory'),$cpt_name);
1994
-            $taxonomies = geodir_get_taxonomies($key);
1995
-            $cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : NULL;
1996
-            $cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : NULL;
1997
-
1998
-            if (!empty($cat_terms)) {
1999
-                $return['optgroup_start-' . $key] = $post_type_name;
2000
-
2001
-                foreach ($cat_terms as $cat_term) {
2002
-                    $return[$key . '_' . $cat_term->term_id] = $cat_term->name;
2003
-                }
1987
+	$post_types = geodir_get_posttypes('object');
2004 1988
 
2005
-                $return['optgroup_end-' . $key] = $post_type_name;
2006
-            }
2007
-        }
2008
-    }
2009
-    return $return;
1989
+	$return = array();
1990
+	if (!empty($post_types)) {
1991
+		foreach ($post_types as $key => $post_type) {
1992
+			$cpt_name = __($post_type->labels->singular_name, 'geodirectory');
1993
+			$post_type_name =   sprintf(__('%s Categories', 'geodirectory'),$cpt_name);
1994
+			$taxonomies = geodir_get_taxonomies($key);
1995
+			$cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : NULL;
1996
+			$cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : NULL;
1997
+
1998
+			if (!empty($cat_terms)) {
1999
+				$return['optgroup_start-' . $key] = $post_type_name;
2000
+
2001
+				foreach ($cat_terms as $cat_term) {
2002
+					$return[$key . '_' . $cat_term->term_id] = $cat_term->name;
2003
+				}
2004
+
2005
+				$return['optgroup_end-' . $key] = $post_type_name;
2006
+			}
2007
+		}
2008
+	}
2009
+	return $return;
2010 2010
 }
2011 2011
 
2012 2012
 /**
@@ -2018,7 +2018,7 @@  discard block
 block discarded – undo
2018 2018
  */
2019 2019
 function geodir_twitter_tweet_button()
2020 2020
 {
2021
-    ?>
2021
+	?>
2022 2022
     <a href="http://twitter.com/share"
2023 2023
        class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a>
2024 2024
     <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
@@ -2035,11 +2035,11 @@  discard block
 block discarded – undo
2035 2035
  * @global object $post The current post object.
2036 2036
  */
2037 2037
 function geodir_fb_like_button() {
2038
-    global $post;
2039
-    ?>
2038
+	global $post;
2039
+	?>
2040 2040
     <iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
2041
-        echo 'allowtransparency="true"';
2042
-    } ?> class="facebook"
2041
+		echo 'allowtransparency="true"';
2042
+	} ?> class="facebook"
2043 2043
          src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light"
2044 2044
          style="border:none; overflow:hidden; width:100px; height:20px"></iframe>
2045 2045
     <?php
@@ -2054,7 +2054,7 @@  discard block
 block discarded – undo
2054 2054
  * @package GeoDirectory
2055 2055
  */
2056 2056
 function geodir_google_plus_button() {
2057
-    ?>
2057
+	?>
2058 2058
     <div id="plusone-div" class="g-plusone" data-size="medium"></div>
2059 2059
     <script type="text/javascript">
2060 2060
         (function () {
@@ -2079,8 +2079,8 @@  discard block
 block discarded – undo
2079 2079
  * @global object $post The current post object.
2080 2080
  */
2081 2081
 function geodir_share_this_button_code() {
2082
-    global $post;
2083
-    ?>
2082
+	global $post;
2083
+	?>
2084 2084
     <div class="addthis_toolbox addthis_default_style">
2085 2085
         <span id='st_sharethis'></span>
2086 2086
         <script type="text/javascript">var switchTo5x = false;</script>
@@ -2105,8 +2105,8 @@  discard block
 block discarded – undo
2105 2105
 }
2106 2106
 
2107 2107
 function geodir_listing_bounce_map_pin_on_hover() {
2108
-    if(get_option('geodir_listing_hover_bounce_map_pin',true)) {
2109
-        ?>
2108
+	if(get_option('geodir_listing_hover_bounce_map_pin',true)) {
2109
+		?>
2110 2110
         <script>
2111 2111
             jQuery(function ($) {
2112 2112
                 if (typeof(animate_marker) == 'function') {
@@ -2120,27 +2120,27 @@  discard block
 block discarded – undo
2120 2120
             });
2121 2121
         </script>
2122 2122
         <?php
2123
-    }
2123
+	}
2124 2124
 }
2125 2125
 add_action('geodir_after_listing_listview','geodir_listing_bounce_map_pin_on_hover',10);
2126 2126
 
2127 2127
 add_action('geodir_after_favorite_html','geodir_output_favourite_html_listings',1,1);
2128 2128
 function geodir_output_favourite_html_listings( $post_id){
2129
-    geodir_favourite_html('', $post_id);
2129
+	geodir_favourite_html('', $post_id);
2130 2130
 }
2131 2131
 
2132 2132
 add_action( 'geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2);
2133 2133
 function geodir_output_pinpoint_html_listings( $post_id, $post){
2134
-    global $wp_query;
2134
+	global $wp_query;
2135 2135
 
2136
-    $show_pin_point = $wp_query->is_main_query();
2136
+	$show_pin_point = $wp_query->is_main_query();
2137 2137
     
2138
-    if (!empty($show_pin_point) && is_active_widget(false, "", "geodir_map_v3_listing_map")) {
2139
-        $term_icon_url = get_tax_meta($post->default_category, 'ct_cat_icon', false, $post->post_type);
2140
-        $marker_icon = isset($term_icon_url['src']) ? $term_icon_url['src'] : get_option('geodir_default_marker_icon');
2141
-        ?>
2138
+	if (!empty($show_pin_point) && is_active_widget(false, "", "geodir_map_v3_listing_map")) {
2139
+		$term_icon_url = get_tax_meta($post->default_category, 'ct_cat_icon', false, $post->post_type);
2140
+		$marker_icon = isset($term_icon_url['src']) ? $term_icon_url['src'] : get_option('geodir_default_marker_icon');
2141
+		?>
2142 2142
         <span class="geodir-pinpoint" style="background:url('<?php echo $marker_icon; ?>') no-repeat scroll left top transparent;background-size:auto 100%; -webkit-background-size:auto 100%;-moz-background-size:auto 100%;height:9px;width:14px;"><?php echo apply_filters('geodir_listing_listview_pinpoint_inner_content', '', 'listing'); ?></span>
2143 2143
         <a class="geodir-pinpoint-link" href="javascript:void(0)" onclick="openMarker('listing_map_canvas' ,'<?php echo $post->ID; ?>')" onmouseover="animate_marker('listing_map_canvas' ,'<?php echo $post->ID; ?>')" onmouseout="stop_marker_animation('listing_map_canvas' ,'<?php echo $post->ID; ?>')"><?php _e('Pinpoint', 'geodirectory'); ?></a>
2144 2144
         <?php
2145
-    }
2145
+	}
2146 2146
 }
2147 2147
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/design_settings_array.php 1 patch
Indentation   +923 added lines, -923 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function geodir_post_type_setting_fun()
19 19
 {
20
-    $post_type_arr = array();
20
+	$post_type_arr = array();
21 21
 
22
-    $post_types = geodir_get_posttypes('object');
22
+	$post_types = geodir_get_posttypes('object');
23 23
 
24
-    foreach ($post_types as $key => $post_types_obj) {
25
-        $post_type_arr[$key] = $post_types_obj->labels->singular_name;
26
-    }
27
-    return $post_type_arr;
24
+	foreach ($post_types as $key => $post_types_obj) {
25
+		$post_type_arr[$key] = $post_types_obj->labels->singular_name;
26
+	}
27
+	return $post_type_arr;
28 28
 }
29 29
 
30 30
 /**
@@ -35,17 +35,17 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_theme_location_setting_fun()
37 37
 {
38
-    $post_type_arr = array();
39
-    $geodir_all_nav_locations = get_registered_nav_menus();
40
-    $geodir_active_nav_locations = get_nav_menu_locations();
41
-    if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
42
-        foreach ($geodir_active_nav_locations as $key => $theme_location) {
43
-            if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations))
44
-                $post_type_arr[$key] = $geodir_all_nav_locations[$key];
45
-        }
46
-    }
47
-
48
-    return $post_type_arr;
38
+	$post_type_arr = array();
39
+	$geodir_all_nav_locations = get_registered_nav_menus();
40
+	$geodir_active_nav_locations = get_nav_menu_locations();
41
+	if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
42
+		foreach ($geodir_active_nav_locations as $key => $theme_location) {
43
+			if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations))
44
+				$post_type_arr[$key] = $geodir_all_nav_locations[$key];
45
+		}
46
+	}
47
+
48
+	return $post_type_arr;
49 49
 }
50 50
 /**
51 51
  * Filter GD design settings array.
@@ -55,543 +55,543 @@  discard block
 block discarded – undo
55 55
  */
56 56
 $geodir_settings['design_settings'] = apply_filters('geodir_design_settings', array(
57 57
 
58
-    /* Home Layout Settings start */
59
-    array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
58
+	/* Home Layout Settings start */
59
+	array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
60 60
 
61 61
 
62
-    array('name' => __('Home Top Section Settings', 'geodirectory'),
63
-        'type' => 'sectionstart',
64
-        'desc' => '',
65
-        'id' => 'geodir_home_top_section'),
62
+	array('name' => __('Home Top Section Settings', 'geodirectory'),
63
+		'type' => 'sectionstart',
64
+		'desc' => '',
65
+		'id' => 'geodir_home_top_section'),
66 66
 
67
-    array(
68
-        'name' => __('Geodirectory home page', 'geodirectory'),
69
-        'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'),
70
-        'id' => 'geodir_set_as_home',
71
-        'type' => 'checkbox',
72
-        'std' => '0' // Default value to show home top section
73
-    ),
67
+	array(
68
+		'name' => __('Geodirectory home page', 'geodirectory'),
69
+		'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'),
70
+		'id' => 'geodir_set_as_home',
71
+		'type' => 'checkbox',
72
+		'std' => '0' // Default value to show home top section
73
+	),
74 74
 
75
-    array(
76
-        'name' => __('Home top section', 'geodirectory'),
77
-        'desc' => __('Show the top section of home page', 'geodirectory'),
78
-        'id' => 'geodir_show_home_top_section',
79
-        'type' => 'checkbox',
80
-        'std' => '1' // Default value to show home top section
81
-    ),
75
+	array(
76
+		'name' => __('Home top section', 'geodirectory'),
77
+		'desc' => __('Show the top section of home page', 'geodirectory'),
78
+		'id' => 'geodir_show_home_top_section',
79
+		'type' => 'checkbox',
80
+		'std' => '1' // Default value to show home top section
81
+	),
82 82
 
83 83
 
84
-    array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
84
+	array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
85 85
 
86 86
 
87
-    array('name' => __('Home Page Layout Settings', 'geodirectory'),
88
-        'type' => 'sectionstart',
89
-        'desc' => '',
90
-        'id' => 'geodir_home_layout'),
87
+	array('name' => __('Home Page Layout Settings', 'geodirectory'),
88
+		'type' => 'sectionstart',
89
+		'desc' => '',
90
+		'id' => 'geodir_home_layout'),
91 91
 
92
-    array(
93
-        'name' => __('Home right section', 'geodirectory'),
94
-        'desc' => __('Show the right section of home page', 'geodirectory'),
95
-        'id' => 'geodir_show_home_right_section',
96
-        'type' => 'checkbox',
97
-        'std' => '1' // Default value to show home top section
98
-    ),
92
+	array(
93
+		'name' => __('Home right section', 'geodirectory'),
94
+		'desc' => __('Show the right section of home page', 'geodirectory'),
95
+		'id' => 'geodir_show_home_right_section',
96
+		'type' => 'checkbox',
97
+		'std' => '1' // Default value to show home top section
98
+	),
99 99
 
100
-    array(
101
-        'name' => __('Width of home right section', 'geodirectory'),
102
-        'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
103
-        'id' => 'geodir_width_home_right_section',
104
-        'type' => 'text',
105
-        'css' => 'min-width:300px;',
106
-        'std' => '30' // Default value to show home top section
107
-    ),
100
+	array(
101
+		'name' => __('Width of home right section', 'geodirectory'),
102
+		'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
103
+		'id' => 'geodir_width_home_right_section',
104
+		'type' => 'text',
105
+		'css' => 'min-width:300px;',
106
+		'std' => '30' // Default value to show home top section
107
+	),
108 108
 
109
-    array(
110
-        'name' => __('Home content section', 'geodirectory'),
111
-        'desc' => __('Show the content section of home page', 'geodirectory'),
112
-        'id' => 'geodir_show_home_contant_section',
113
-        'type' => 'checkbox',
114
-        'std' => '1' // Default value to show home top section
115
-    ),
109
+	array(
110
+		'name' => __('Home content section', 'geodirectory'),
111
+		'desc' => __('Show the content section of home page', 'geodirectory'),
112
+		'id' => 'geodir_show_home_contant_section',
113
+		'type' => 'checkbox',
114
+		'std' => '1' // Default value to show home top section
115
+	),
116 116
 
117
-    array(
118
-        'name' => __('Width of home content section', 'geodirectory'),
119
-        'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
120
-        'id' => 'geodir_width_home_contant_section',
121
-        'type' => 'text',
122
-        'css' => 'min-width:300px;',
123
-        'std' => '63' // Default value to show home top section
124
-    ),
117
+	array(
118
+		'name' => __('Width of home content section', 'geodirectory'),
119
+		'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
120
+		'id' => 'geodir_width_home_contant_section',
121
+		'type' => 'text',
122
+		'css' => 'min-width:300px;',
123
+		'std' => '63' // Default value to show home top section
124
+	),
125 125
 
126
-    array(
127
-        'name' => __('Home left section', 'geodirectory'),
128
-        'desc' => __('Show the left section of home page', 'geodirectory'),
129
-        'id' => 'geodir_show_home_left_section',
130
-        'type' => 'checkbox',
131
-        'std' => '0' // Default value to show home top section
132
-    ),
126
+	array(
127
+		'name' => __('Home left section', 'geodirectory'),
128
+		'desc' => __('Show the left section of home page', 'geodirectory'),
129
+		'id' => 'geodir_show_home_left_section',
130
+		'type' => 'checkbox',
131
+		'std' => '0' // Default value to show home top section
132
+	),
133 133
 
134
-    array(
135
-        'name' => __('Width of home left section', 'geodirectory'),
136
-        'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
137
-        'id' => 'geodir_width_home_left_section',
138
-        'type' => 'text',
139
-        'css' => 'min-width:300px;',
140
-        'std' => '30' // Default value to show home top section
141
-    ),
134
+	array(
135
+		'name' => __('Width of home left section', 'geodirectory'),
136
+		'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
137
+		'id' => 'geodir_width_home_left_section',
138
+		'type' => 'text',
139
+		'css' => 'min-width:300px;',
140
+		'std' => '30' // Default value to show home top section
141
+	),
142 142
 
143
-    array(
144
-        'name' => __('Home bottom section', 'geodirectory'),
145
-        'desc' => __('Show the bottom section of home page', 'geodirectory'),
146
-        'id' => 'geodir_show_home_bottom_section',
147
-        'type' => 'checkbox',
148
-        'std' => '0' // Default value to show home top section
149
-    ),
150
-    array(
151
-        'name' => __('Resize image large size', 'geodirectory'),
152
-        'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
153
-        'id' => 'geodir_use_wp_media_large_size',
154
-        'type' => 'checkbox',
155
-        'std' => '0'
156
-    ),
143
+	array(
144
+		'name' => __('Home bottom section', 'geodirectory'),
145
+		'desc' => __('Show the bottom section of home page', 'geodirectory'),
146
+		'id' => 'geodir_show_home_bottom_section',
147
+		'type' => 'checkbox',
148
+		'std' => '0' // Default value to show home top section
149
+	),
150
+	array(
151
+		'name' => __('Resize image large size', 'geodirectory'),
152
+		'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
153
+		'id' => 'geodir_use_wp_media_large_size',
154
+		'type' => 'checkbox',
155
+		'std' => '0'
156
+	),
157 157
 
158
-    array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
158
+	array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
159 159
 
160 160
 
161
-    /* Home Layout Settings end */
161
+	/* Home Layout Settings end */
162 162
 
163 163
 
164
-    /* Listing Layout Settings end */
164
+	/* Listing Layout Settings end */
165 165
 
166
-    array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
166
+	array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
167 167
 
168 168
 
169
-    array('name' => __('Listing Page Layout Settings', 'geodirectory'),
170
-        'type' => 'sectionstart',
171
-        'desc' => '',
172
-        'id' => 'geodir_listing_layout'),
169
+	array('name' => __('Listing Page Layout Settings', 'geodirectory'),
170
+		'type' => 'sectionstart',
171
+		'desc' => '',
172
+		'id' => 'geodir_listing_layout'),
173 173
 
174
-    array(
175
-        'name' => __('Listing top section', 'geodirectory'),
176
-        'desc' => __('Show the top section of listing page', 'geodirectory'),
177
-        'id' => 'geodir_show_listing_top_section',
178
-        'type' => 'checkbox',
179
-        'std' => '1' // Default value to show home top section
180
-    ),
174
+	array(
175
+		'name' => __('Listing top section', 'geodirectory'),
176
+		'desc' => __('Show the top section of listing page', 'geodirectory'),
177
+		'id' => 'geodir_show_listing_top_section',
178
+		'type' => 'checkbox',
179
+		'std' => '1' // Default value to show home top section
180
+	),
181 181
 
182
-    array(
183
-        'name' => __('Listing right section', 'geodirectory'),
184
-        'desc' => __('Show the right section of listing page', 'geodirectory'),
185
-        'id' => 'geodir_show_listing_right_section',
186
-        'type' => 'checkbox',
187
-        'std' => '1' // Default value to show home top section
188
-    ),
182
+	array(
183
+		'name' => __('Listing right section', 'geodirectory'),
184
+		'desc' => __('Show the right section of listing page', 'geodirectory'),
185
+		'id' => 'geodir_show_listing_right_section',
186
+		'type' => 'checkbox',
187
+		'std' => '1' // Default value to show home top section
188
+	),
189 189
 
190
-    array(
191
-        'name' => __('Width of listing right section', 'geodirectory'),
192
-        'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
193
-        'id' => 'geodir_width_listing_right_section',
194
-        'type' => 'text',
195
-        'css' => 'min-width:300px;',
196
-        'std' => '30' // Default value to show home top section
197
-    ),
190
+	array(
191
+		'name' => __('Width of listing right section', 'geodirectory'),
192
+		'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
193
+		'id' => 'geodir_width_listing_right_section',
194
+		'type' => 'text',
195
+		'css' => 'min-width:300px;',
196
+		'std' => '30' // Default value to show home top section
197
+	),
198 198
 
199 199
 
200
-    array(
201
-        'name' => __('Listing content section view', 'geodirectory'),
202
-        'desc' => __('Set the listing view of listing page', 'geodirectory'),
203
-        'id' => 'geodir_listing_view',
204
-        'css' => 'min-width:300px;',
205
-        'std' => 'gridview_onehalf',
206
-        'type' => 'select',
207
-        'class' => 'chosen_select',
208
-        'options' => array_unique(array(
209
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
210
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
211
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
212
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
213
-            'listview' => __('List view', 'geodirectory'),
214
-        ))
215
-    ),
200
+	array(
201
+		'name' => __('Listing content section view', 'geodirectory'),
202
+		'desc' => __('Set the listing view of listing page', 'geodirectory'),
203
+		'id' => 'geodir_listing_view',
204
+		'css' => 'min-width:300px;',
205
+		'std' => 'gridview_onehalf',
206
+		'type' => 'select',
207
+		'class' => 'chosen_select',
208
+		'options' => array_unique(array(
209
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
210
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
211
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
212
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
213
+			'listview' => __('List view', 'geodirectory'),
214
+		))
215
+	),
216 216
 
217
-    array(
218
-        'name' => __('Width of listing content section', 'geodirectory'),
219
-        'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
220
-        'id' => 'geodir_width_listing_contant_section',
221
-        'type' => 'text',
222
-        'css' => 'min-width:300px;',
223
-        'std' => '63' // Default value to show home top section
224
-    ),
217
+	array(
218
+		'name' => __('Width of listing content section', 'geodirectory'),
219
+		'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
220
+		'id' => 'geodir_width_listing_contant_section',
221
+		'type' => 'text',
222
+		'css' => 'min-width:300px;',
223
+		'std' => '63' // Default value to show home top section
224
+	),
225 225
 
226
-    array(
227
-        'name' => __('Listing left section', 'geodirectory'),
228
-        'desc' => __('Show the left section of listing page', 'geodirectory'),
229
-        'id' => 'geodir_show_listing_left_section',
230
-        'type' => 'checkbox',
231
-        'std' => '0' // Default value to show home top section
232
-    ),
226
+	array(
227
+		'name' => __('Listing left section', 'geodirectory'),
228
+		'desc' => __('Show the left section of listing page', 'geodirectory'),
229
+		'id' => 'geodir_show_listing_left_section',
230
+		'type' => 'checkbox',
231
+		'std' => '0' // Default value to show home top section
232
+	),
233 233
 
234
-    array(
235
-        'name' => __('Width of listing left section', 'geodirectory'),
236
-        'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
237
-        'id' => 'geodir_width_listing_left_section',
238
-        'type' => 'text',
239
-        'css' => 'min-width:300px;',
240
-        'std' => '30' // Default value to show home top section
241
-    ),
234
+	array(
235
+		'name' => __('Width of listing left section', 'geodirectory'),
236
+		'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
237
+		'id' => 'geodir_width_listing_left_section',
238
+		'type' => 'text',
239
+		'css' => 'min-width:300px;',
240
+		'std' => '30' // Default value to show home top section
241
+	),
242 242
 
243
-    array(
244
-        'name' => __('Listing bottom section', 'geodirectory'),
245
-        'desc' => __('Show the bottom section of listing page', 'geodirectory'),
246
-        'id' => 'geodir_show_listing_bottom_section',
247
-        'type' => 'checkbox',
248
-        'std' => '0' // Default value to show home top section
249
-    ),
243
+	array(
244
+		'name' => __('Listing bottom section', 'geodirectory'),
245
+		'desc' => __('Show the bottom section of listing page', 'geodirectory'),
246
+		'id' => 'geodir_show_listing_bottom_section',
247
+		'type' => 'checkbox',
248
+		'std' => '0' // Default value to show home top section
249
+	),
250 250
 
251
-    array(
252
-        'name' => __('Upload listing no image', 'geodirectory'),
253
-        'desc' => '',
254
-        'id' => 'geodir_listing_no_img',
255
-        'type' => 'file',
256
-        'std' => '0' // Default value to show home top section
257
-    ),
251
+	array(
252
+		'name' => __('Upload listing no image', 'geodirectory'),
253
+		'desc' => '',
254
+		'id' => 'geodir_listing_no_img',
255
+		'type' => 'file',
256
+		'std' => '0' // Default value to show home top section
257
+	),
258 258
 
259
-    array(
260
-        'name' => __('Description word limit', 'geodirectory'),
261
-        'desc' => '',
262
-        'id' => 'geodir_desc_word_limit',
263
-        'type' => 'text',
264
-        'css' => 'min-width:300px;',
265
-        'std' => '50' // Default value to show home top section
266
-    ),
259
+	array(
260
+		'name' => __('Description word limit', 'geodirectory'),
261
+		'desc' => '',
262
+		'id' => 'geodir_desc_word_limit',
263
+		'type' => 'text',
264
+		'css' => 'min-width:300px;',
265
+		'std' => '50' // Default value to show home top section
266
+	),
267 267
 
268
-    array(
269
-        'name' => __('Hover listing map animation', 'geodirectory'),
270
-        'desc' => __('Bounce map pin if listing hovered', 'geodirectory'),
271
-        'id' => 'geodir_listing_hover_bounce_map_pin',
272
-        'type' => 'checkbox',
273
-        'std' => '1' // Default value to show home top section
274
-    ),
268
+	array(
269
+		'name' => __('Hover listing map animation', 'geodirectory'),
270
+		'desc' => __('Bounce map pin if listing hovered', 'geodirectory'),
271
+		'id' => 'geodir_listing_hover_bounce_map_pin',
272
+		'type' => 'checkbox',
273
+		'std' => '1' // Default value to show home top section
274
+	),
275 275
 
276
-    array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
276
+	array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
277 277
 
278 278
 
279
-    array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
279
+	array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
280 280
 
281
-    array(
282
-        'name' => __('New listing default status', 'geodirectory'),
283
-        'desc' => __('Select new listing default status.', 'geodirectory'),
284
-        'tip' => '',
285
-        'id' => 'geodir_new_post_default_status',
286
-        'css' => 'min-width:300px;',
287
-        'std' => 'publish',
288
-        'type' => 'select',
289
-        'class' => 'chosen_select',
290
-        'options' => array_unique(array(
291
-            'publish' => __('publish', 'geodirectory'),
292
-            'draft' => __('draft', 'geodirectory'),
293
-        ))
294
-    ),
281
+	array(
282
+		'name' => __('New listing default status', 'geodirectory'),
283
+		'desc' => __('Select new listing default status.', 'geodirectory'),
284
+		'tip' => '',
285
+		'id' => 'geodir_new_post_default_status',
286
+		'css' => 'min-width:300px;',
287
+		'std' => 'publish',
288
+		'type' => 'select',
289
+		'class' => 'chosen_select',
290
+		'options' => array_unique(array(
291
+			'publish' => __('publish', 'geodirectory'),
292
+			'draft' => __('draft', 'geodirectory'),
293
+		))
294
+	),
295 295
 
296
-    array(
297
-        'name' => __('New listings settings', 'geodirectory'),
298
-        'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
299
-        'id' => 'geodir_listing_new_days',
300
-        'type' => 'text',
301
-        'css' => 'min-width:300px;',
302
-        'std' => '30' // Default value for the page title - changed in settings
303
-    ),
296
+	array(
297
+		'name' => __('New listings settings', 'geodirectory'),
298
+		'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
299
+		'id' => 'geodir_listing_new_days',
300
+		'type' => 'text',
301
+		'css' => 'min-width:300px;',
302
+		'std' => '30' // Default value for the page title - changed in settings
303
+	),
304 304
 
305
-    array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
305
+	array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
306 306
 
307 307
 
308
-    array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
308
+	array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
309 309
 
310
-    array(
311
-        'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
312
-        'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
313
-        'id' => 'geodir_accept_term_condition',
314
-        'type' => 'checkbox',
315
-        'std' => '1' // Default value to show home top section
316
-    ),
310
+	array(
311
+		'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
312
+		'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
313
+		'id' => 'geodir_accept_term_condition',
314
+		'type' => 'checkbox',
315
+		'std' => '1' // Default value to show home top section
316
+	),
317 317
 
318 318
 
319
-    array(
320
-        'name' => __('Show description field as editor', 'geodirectory'),
321
-        'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
322
-        'tip' => '',
323
-        'id' => 'geodir_tiny_editor_on_add_listing',
324
-        'css' => 'min-width:300px;',
325
-        'std' => array(),
326
-        'type' => 'multiselect',
327
-        'placeholder_text' => __('Select post types', 'geodirectory'),
328
-        'class' => 'chosen_select',
329
-        'options' => array_unique(geodir_post_type_setting_fun())
330
-    ),
319
+	array(
320
+		'name' => __('Show description field as editor', 'geodirectory'),
321
+		'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
322
+		'tip' => '',
323
+		'id' => 'geodir_tiny_editor_on_add_listing',
324
+		'css' => 'min-width:300px;',
325
+		'std' => array(),
326
+		'type' => 'multiselect',
327
+		'placeholder_text' => __('Select post types', 'geodirectory'),
328
+		'class' => 'chosen_select',
329
+		'options' => array_unique(geodir_post_type_setting_fun())
330
+	),
331 331
 
332
-    array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
333
-    /* Listing Layout Settings end */
332
+	array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
333
+	/* Listing Layout Settings end */
334 334
 
335 335
 
336
-    /* Search Layout Settings end */
336
+	/* Search Layout Settings end */
337 337
 
338
-    array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
338
+	array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
339 339
 
340 340
 
341
-    array('name' => __('Search Page Layout Settings', 'geodirectory'),
342
-        'type' => 'sectionstart',
343
-        'desc' => '',
344
-        'id' => 'geodir_search_layout'),
341
+	array('name' => __('Search Page Layout Settings', 'geodirectory'),
342
+		'type' => 'sectionstart',
343
+		'desc' => '',
344
+		'id' => 'geodir_search_layout'),
345 345
 
346
-    array(
347
-        'name' => __('Search top section', 'geodirectory'),
348
-        'desc' => __('Show the top section of search page', 'geodirectory'),
349
-        'id' => 'geodir_show_search_top_section',
350
-        'type' => 'checkbox',
351
-        'std' => '1' // Default value to show home top section
352
-    ),
346
+	array(
347
+		'name' => __('Search top section', 'geodirectory'),
348
+		'desc' => __('Show the top section of search page', 'geodirectory'),
349
+		'id' => 'geodir_show_search_top_section',
350
+		'type' => 'checkbox',
351
+		'std' => '1' // Default value to show home top section
352
+	),
353 353
 
354
-    array(
355
-        'name' => __('Search right section', 'geodirectory'),
356
-        'desc' => __('Show the right section of search page', 'geodirectory'),
357
-        'id' => 'geodir_show_search_right_section',
358
-        'type' => 'checkbox',
359
-        'std' => '1' // Default value to show home top section
360
-    ),
354
+	array(
355
+		'name' => __('Search right section', 'geodirectory'),
356
+		'desc' => __('Show the right section of search page', 'geodirectory'),
357
+		'id' => 'geodir_show_search_right_section',
358
+		'type' => 'checkbox',
359
+		'std' => '1' // Default value to show home top section
360
+	),
361 361
 
362
-    array(
363
-        'name' => __('Width of search right section', 'geodirectory'),
364
-        'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
365
-        'id' => 'geodir_width_search_right_section',
366
-        'type' => 'text',
367
-        'css' => 'min-width:300px;',
368
-        'std' => '30' // Default value to show home top section
369
-    ),
362
+	array(
363
+		'name' => __('Width of search right section', 'geodirectory'),
364
+		'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
365
+		'id' => 'geodir_width_search_right_section',
366
+		'type' => 'text',
367
+		'css' => 'min-width:300px;',
368
+		'std' => '30' // Default value to show home top section
369
+	),
370 370
 
371 371
 
372
-    array(
373
-        'name' => __('Search content section view', 'geodirectory'),
374
-        'desc' => __('Set the listing view of search page', 'geodirectory'),
375
-        'id' => 'geodir_search_view',
376
-        'css' => 'min-width:300px;',
377
-        'std' => 'gridview_onehalf',
378
-        'type' => 'select',
379
-        'class' => 'chosen_select',
380
-        'options' => array_unique(array(
381
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
382
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
383
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
384
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
385
-            'listview' => __('List view', 'geodirectory'),
386
-        ))
387
-    ),
372
+	array(
373
+		'name' => __('Search content section view', 'geodirectory'),
374
+		'desc' => __('Set the listing view of search page', 'geodirectory'),
375
+		'id' => 'geodir_search_view',
376
+		'css' => 'min-width:300px;',
377
+		'std' => 'gridview_onehalf',
378
+		'type' => 'select',
379
+		'class' => 'chosen_select',
380
+		'options' => array_unique(array(
381
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
382
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
383
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
384
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
385
+			'listview' => __('List view', 'geodirectory'),
386
+		))
387
+	),
388 388
 
389
-    array(
390
-        'name' => __('Width of search content section', 'geodirectory'),
391
-        'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
392
-        'id' => 'geodir_width_search_contant_section',
393
-        'type' => 'text',
394
-        'css' => 'min-width:300px;',
395
-        'std' => '63' // Default value to show home top section
396
-    ),
389
+	array(
390
+		'name' => __('Width of search content section', 'geodirectory'),
391
+		'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
392
+		'id' => 'geodir_width_search_contant_section',
393
+		'type' => 'text',
394
+		'css' => 'min-width:300px;',
395
+		'std' => '63' // Default value to show home top section
396
+	),
397 397
 
398
-    array(
399
-        'name' => __('Search left section', 'geodirectory'),
400
-        'desc' => __('Show the left section of search page', 'geodirectory'),
401
-        'id' => 'geodir_show_search_left_section',
402
-        'type' => 'checkbox',
403
-        'std' => '0' // Default value to show home top section
404
-    ),
398
+	array(
399
+		'name' => __('Search left section', 'geodirectory'),
400
+		'desc' => __('Show the left section of search page', 'geodirectory'),
401
+		'id' => 'geodir_show_search_left_section',
402
+		'type' => 'checkbox',
403
+		'std' => '0' // Default value to show home top section
404
+	),
405 405
 
406
-    array(
407
-        'name' => __('Width of search left section', 'geodirectory'),
408
-        'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
409
-        'id' => 'geodir_width_search_left_section',
410
-        'type' => 'text',
411
-        'css' => 'min-width:300px;',
412
-        'std' => '30' // Default value to show home top section
413
-    ),
406
+	array(
407
+		'name' => __('Width of search left section', 'geodirectory'),
408
+		'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
409
+		'id' => 'geodir_width_search_left_section',
410
+		'type' => 'text',
411
+		'css' => 'min-width:300px;',
412
+		'std' => '30' // Default value to show home top section
413
+	),
414 414
 
415
-    array(
416
-        'name' => __('Search bottom section', 'geodirectory'),
417
-        'desc' => __('Show the bottom section of search page', 'geodirectory'),
418
-        'id' => 'geodir_show_search_bottom_section',
419
-        'type' => 'checkbox',
420
-        'std' => '0' // Default value to show home top section
421
-    ),
415
+	array(
416
+		'name' => __('Search bottom section', 'geodirectory'),
417
+		'desc' => __('Show the bottom section of search page', 'geodirectory'),
418
+		'id' => 'geodir_show_search_bottom_section',
419
+		'type' => 'checkbox',
420
+		'std' => '0' // Default value to show home top section
421
+	),
422 422
 	
423 423
 	array(
424
-        'name' => __('Show advanced pagination details', 'geodirectory'),
425
-        'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'),
426
-        'id' => 'geodir_pagination_advance_info',
427
-        'css' => 'min-width:300px;',
428
-        'std' => '',
429
-        'type' => 'select',
430
-        'class' => 'chosen_select',
431
-        'options' => array(
424
+		'name' => __('Show advanced pagination details', 'geodirectory'),
425
+		'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'),
426
+		'id' => 'geodir_pagination_advance_info',
427
+		'css' => 'min-width:300px;',
428
+		'std' => '',
429
+		'type' => 'select',
430
+		'class' => 'chosen_select',
431
+		'options' => array(
432 432
 						'' => __('Never Display', 'geodirectory'),
433 433
 						'after' => __('After Pagination', 'geodirectory'),
434 434
 						'before' => __('Before Pagination', 'geodirectory')
435 435
 					)
436
-    ),
436
+	),
437 437
 
438
-    array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
438
+	array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
439 439
 
440 440
 
441
-    array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
441
+	array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
442 442
 
443
-    array(
444
-        'name' => __('Search field default value', 'geodirectory'),
445
-        'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
446
-        'id' => 'geodir_search_field_default_text',
447
-        'type' => 'text',
448
-        'css' => 'min-width:300px;',
449
-        'std' => 'Search for' // show on the listing page.
450
-    ),
443
+	array(
444
+		'name' => __('Search field default value', 'geodirectory'),
445
+		'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
446
+		'id' => 'geodir_search_field_default_text',
447
+		'type' => 'text',
448
+		'css' => 'min-width:300px;',
449
+		'std' => 'Search for' // show on the listing page.
450
+	),
451 451
 
452
-    array(
453
-        'name' => __('Near field default value', 'geodirectory'),
454
-        'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
455
-        'id' => 'geodir_near_field_default_text',
456
-        'type' => 'text',
457
-        'css' => 'min-width:300px;',
458
-        'std' => 'Near' // show on the listing page.
459
-    ),
452
+	array(
453
+		'name' => __('Near field default value', 'geodirectory'),
454
+		'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
455
+		'id' => 'geodir_near_field_default_text',
456
+		'type' => 'text',
457
+		'css' => 'min-width:300px;',
458
+		'std' => 'Near' // show on the listing page.
459
+	),
460 460
 
461
-    array(
462
-        'name' => __('Search button label', 'geodirectory'),
463
-        'desc' => __('Show the search button label on search form.', 'geodirectory'),
464
-        'id' => 'geodir_search_button_label',
465
-        'type' => 'text',
466
-        'css' => 'min-width:300px;',
467
-        'std' => 'Search' // show on the listing page.
468
-    ),
461
+	array(
462
+		'name' => __('Search button label', 'geodirectory'),
463
+		'desc' => __('Show the search button label on search form.', 'geodirectory'),
464
+		'id' => 'geodir_search_button_label',
465
+		'type' => 'text',
466
+		'css' => 'min-width:300px;',
467
+		'std' => 'Search' // show on the listing page.
468
+	),
469 469
 
470
-    array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
470
+	array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
471 471
 
472
-    /* Listing Layout Settings end */
472
+	/* Listing Layout Settings end */
473 473
 
474 474
 
475
-    /* Detail Layout Settings end */
475
+	/* Detail Layout Settings end */
476 476
 
477
-    array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
477
+	array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
478 478
 
479
-    array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
479
+	array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
480 480
 
481
-    array(
482
-        'name' => __('Detail top section', 'geodirectory'),
483
-        'desc' => __('Show the top section of listing page', 'geodirectory'),
484
-        'id' => 'geodir_show_detail_top_section',
485
-        'type' => 'checkbox',
486
-        'std' => '1' // Default value to show home top section
487
-    ),
481
+	array(
482
+		'name' => __('Detail top section', 'geodirectory'),
483
+		'desc' => __('Show the top section of listing page', 'geodirectory'),
484
+		'id' => 'geodir_show_detail_top_section',
485
+		'type' => 'checkbox',
486
+		'std' => '1' // Default value to show home top section
487
+	),
488 488
 
489
-    array(
490
-        'name' => __('Detail bottom section', 'geodirectory'),
491
-        'desc' => __('Show the bottom section of listing page', 'geodirectory'),
492
-        'id' => 'geodir_show_detail_bottom_section',
493
-        'type' => 'checkbox',
494
-        'std' => '1' // Default value to show home top section
495
-    ),
496
-    array(
497
-        'name' => __('Detail sidebar section on left side', 'geodirectory'),
498
-        'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
499
-        'id' => 'geodir_detail_sidebar_left_section',
500
-        'type' => 'checkbox',
501
-        'std' => '0'
502
-    ),
503
-    array(
504
-        'name' => __('Disable GD modal', 'geodirectory'),
505
-        'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
506
-        'id' => 'geodir_disable_gb_modal',
507
-        'type' => 'checkbox',
508
-        'std' => '0'
509
-    ),
510
-    array(
511
-        'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
512
-        'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
513
-        'id' => 'geodir_disable_tfg_buttons_section',
514
-        'type' => 'checkbox',
515
-        'std' => '0'
516
-    ),
517
-    array(
518
-        'name' => __('Disable share this button section', 'geodirectory'),
519
-        'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'),
520
-        'id' => 'geodir_disable_sharethis_button_section',
521
-        'type' => 'checkbox',
522
-        'std' => '0'
523
-    ),
524
-    array(
525
-        'name' => __('Disable Google Analytics section', 'geodirectory'),
526
-        'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
527
-        'id' => 'geodir_disable_google_analytics_section',
528
-        'type' => 'checkbox',
529
-        'std' => '0'
530
-    ),
531
-    array(
532
-        'name' => __('Disable User Links section', 'geodirectory'),
533
-        'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
534
-        'id' => 'geodir_disable_user_links_section',
535
-        'type' => 'checkbox',
536
-        'std' => '0'
537
-    ),
538
-    array(
539
-        'name' => __('Disable Rating Info section', 'geodirectory'),
540
-        'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
541
-        'id' => 'geodir_disable_rating_info_section',
542
-        'type' => 'checkbox',
543
-        'std' => '0'
544
-    ),
545
-    array(
546
-        'name' => __('Disable Listing Info section', 'geodirectory'),
547
-        'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
548
-        'id' => 'geodir_disable_listing_info_section',
549
-        'type' => 'checkbox',
550
-        'std' => '0'
551
-    ),
489
+	array(
490
+		'name' => __('Detail bottom section', 'geodirectory'),
491
+		'desc' => __('Show the bottom section of listing page', 'geodirectory'),
492
+		'id' => 'geodir_show_detail_bottom_section',
493
+		'type' => 'checkbox',
494
+		'std' => '1' // Default value to show home top section
495
+	),
496
+	array(
497
+		'name' => __('Detail sidebar section on left side', 'geodirectory'),
498
+		'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
499
+		'id' => 'geodir_detail_sidebar_left_section',
500
+		'type' => 'checkbox',
501
+		'std' => '0'
502
+	),
503
+	array(
504
+		'name' => __('Disable GD modal', 'geodirectory'),
505
+		'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
506
+		'id' => 'geodir_disable_gb_modal',
507
+		'type' => 'checkbox',
508
+		'std' => '0'
509
+	),
510
+	array(
511
+		'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
512
+		'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
513
+		'id' => 'geodir_disable_tfg_buttons_section',
514
+		'type' => 'checkbox',
515
+		'std' => '0'
516
+	),
517
+	array(
518
+		'name' => __('Disable share this button section', 'geodirectory'),
519
+		'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'),
520
+		'id' => 'geodir_disable_sharethis_button_section',
521
+		'type' => 'checkbox',
522
+		'std' => '0'
523
+	),
524
+	array(
525
+		'name' => __('Disable Google Analytics section', 'geodirectory'),
526
+		'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
527
+		'id' => 'geodir_disable_google_analytics_section',
528
+		'type' => 'checkbox',
529
+		'std' => '0'
530
+	),
531
+	array(
532
+		'name' => __('Disable User Links section', 'geodirectory'),
533
+		'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
534
+		'id' => 'geodir_disable_user_links_section',
535
+		'type' => 'checkbox',
536
+		'std' => '0'
537
+	),
538
+	array(
539
+		'name' => __('Disable Rating Info section', 'geodirectory'),
540
+		'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
541
+		'id' => 'geodir_disable_rating_info_section',
542
+		'type' => 'checkbox',
543
+		'std' => '0'
544
+	),
545
+	array(
546
+		'name' => __('Disable Listing Info section', 'geodirectory'),
547
+		'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
548
+		'id' => 'geodir_disable_listing_info_section',
549
+		'type' => 'checkbox',
550
+		'std' => '0'
551
+	),
552 552
 
553
-    array('type' => 'sectionend', 'id' => 'detail_page_settings'),
553
+	array('type' => 'sectionend', 'id' => 'detail_page_settings'),
554 554
 
555 555
 
556
-    /* ---------- DETAIL PAGE TAB SETTING START*/
556
+	/* ---------- DETAIL PAGE TAB SETTING START*/
557 557
 
558
-    array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
558
+	array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
559 559
 
560
-    array(
561
-        'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
562
-        'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
563
-        'tip' => '',
564
-        'id' => 'geodir_detail_page_tabs_excluded',
565
-        'css' => 'min-width:300px;',
566
-        'std' => geodir_get_posttypes(),
567
-        'type' => 'multiselect',
568
-        'placeholder_text' => __('Select tabs', 'geodirectory'),
569
-        'class' => 'chosen_select',
570
-        'options' => array_unique(geodir_detail_page_tabs_key_value_array())
571
-    ),
560
+	array(
561
+		'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
562
+		'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
563
+		'tip' => '',
564
+		'id' => 'geodir_detail_page_tabs_excluded',
565
+		'css' => 'min-width:300px;',
566
+		'std' => geodir_get_posttypes(),
567
+		'type' => 'multiselect',
568
+		'placeholder_text' => __('Select tabs', 'geodirectory'),
569
+		'class' => 'chosen_select',
570
+		'options' => array_unique(geodir_detail_page_tabs_key_value_array())
571
+	),
572 572
     
573
-    array(
574
-        'name' => __('Show as list', 'geodirectory'),
575
-        'desc' => __('Show as list instead of tabs', 'geodirectory'),
576
-        'id' => 'geodir_disable_tabs',
577
-        'type' => 'checkbox',
578
-        'std' => '0'
579
-    ),
573
+	array(
574
+		'name' => __('Show as list', 'geodirectory'),
575
+		'desc' => __('Show as list instead of tabs', 'geodirectory'),
576
+		'id' => 'geodir_disable_tabs',
577
+		'type' => 'checkbox',
578
+		'std' => '0'
579
+	),
580 580
 
581
-    array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
582
-    /* ---------- DETAIL PAGE TAB SETTING END*/
581
+	array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
582
+	/* ---------- DETAIL PAGE TAB SETTING END*/
583 583
 
584
-    /* START DEFAULT STAR IMAGE*/
585
-    array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
584
+	/* START DEFAULT STAR IMAGE*/
585
+	array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
586 586
 
587
-    array(
588
-        'name' => __('Upload default rating star icon', 'geodirectory'),
589
-        'desc' => '',
590
-        'id' => 'geodir_default_rating_star_icon',
591
-        'type' => 'file',
592
-        'std' => '0',
593
-        'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section
594
-    ),
587
+	array(
588
+		'name' => __('Upload default rating star icon', 'geodirectory'),
589
+		'desc' => '',
590
+		'id' => 'geodir_default_rating_star_icon',
591
+		'type' => 'file',
592
+		'std' => '0',
593
+		'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section
594
+	),
595 595
 	array(
596 596
 		'name' => __('Enable Font Awesome', 'geodirectory'),
597 597
 		'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ),
@@ -607,368 +607,368 @@  discard block
 block discarded – undo
607 607
 		'std' => '#757575'
608 608
 	),
609 609
 
610
-    array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
610
+	array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
611 611
 
612
-    /* END DEFAULT STAR IMAGE*/
612
+	/* END DEFAULT STAR IMAGE*/
613 613
 
614
-    /* Detail related post settings start */
614
+	/* Detail related post settings start */
615 615
 
616
-    array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
616
+	array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
617 617
 
618
-    array(
619
-        'name' => __('Show related post listing on', 'geodirectory'),
620
-        'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
621
-        'tip' => '',
622
-        'id' => 'geodir_add_related_listing_posttypes',
623
-        'css' => 'min-width:300px;',
624
-        'std' => geodir_get_posttypes(),
625
-        'type' => 'multiselect',
626
-        'placeholder_text' => __('Select post types', 'geodirectory'),
627
-        'class' => 'chosen_select',
628
-        'options' => array_unique(geodir_post_type_setting_fun())
629
-    ),
618
+	array(
619
+		'name' => __('Show related post listing on', 'geodirectory'),
620
+		'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
621
+		'tip' => '',
622
+		'id' => 'geodir_add_related_listing_posttypes',
623
+		'css' => 'min-width:300px;',
624
+		'std' => geodir_get_posttypes(),
625
+		'type' => 'multiselect',
626
+		'placeholder_text' => __('Select post types', 'geodirectory'),
627
+		'class' => 'chosen_select',
628
+		'options' => array_unique(geodir_post_type_setting_fun())
629
+	),
630 630
 
631
-    array(
632
-        'name' => __('Relate to', 'geodirectory'),
633
-        'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
634
-        'id' => 'geodir_related_post_relate_to',
635
-        'css' => 'min-width:300px;',
636
-        'std' => 'category',
637
-        'type' => 'select',
638
-        'class' => 'chosen_select',
639
-        'options' => array_unique(array(
640
-            'category' => __('Categories', 'geodirectory'),
641
-            'tags' => __('Tags', 'geodirectory'),
642
-        ))
643
-    ),
631
+	array(
632
+		'name' => __('Relate to', 'geodirectory'),
633
+		'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
634
+		'id' => 'geodir_related_post_relate_to',
635
+		'css' => 'min-width:300px;',
636
+		'std' => 'category',
637
+		'type' => 'select',
638
+		'class' => 'chosen_select',
639
+		'options' => array_unique(array(
640
+			'category' => __('Categories', 'geodirectory'),
641
+			'tags' => __('Tags', 'geodirectory'),
642
+		))
643
+	),
644 644
 
645
-    array(
646
-        'name' => __('Layout', 'geodirectory'),
647
-        'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
648
-        'id' => 'geodir_related_post_listing_view',
649
-        'css' => 'min-width:300px;',
650
-        'std' => 'gridview_onehalf',
651
-        'type' => 'select',
652
-        'class' => 'chosen_select',
653
-        'options' => array_unique(array(
654
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
655
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
656
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
657
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
658
-            'listview' => __('List view', 'geodirectory'),
659
-        ))
660
-    ),
645
+	array(
646
+		'name' => __('Layout', 'geodirectory'),
647
+		'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
648
+		'id' => 'geodir_related_post_listing_view',
649
+		'css' => 'min-width:300px;',
650
+		'std' => 'gridview_onehalf',
651
+		'type' => 'select',
652
+		'class' => 'chosen_select',
653
+		'options' => array_unique(array(
654
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
655
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
656
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
657
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
658
+			'listview' => __('List view', 'geodirectory'),
659
+		))
660
+	),
661 661
 
662
-    array(
663
-        'name' => __('Sort by', 'geodirectory'),
664
-        'desc' => __('Set the related post listing sort by view', 'geodirectory'),
665
-        'id' => 'geodir_related_post_sortby',
666
-        'css' => 'min-width:300px;',
667
-        'std' => 'latest',
668
-        'type' => 'select',
669
-        'class' => 'chosen_select',
670
-        'options' => array_unique(array(
671
-            'latest' => __('Latest', 'geodirectory'),
672
-            'featured' => __('Featured', 'geodirectory'),
673
-            'high_review' => __('Review', 'geodirectory'),
674
-            'high_rating' => __('Rating', 'geodirectory'),
675
-            'random' => __('Random', 'geodirectory'),
676
-        ))
677
-    ),
662
+	array(
663
+		'name' => __('Sort by', 'geodirectory'),
664
+		'desc' => __('Set the related post listing sort by view', 'geodirectory'),
665
+		'id' => 'geodir_related_post_sortby',
666
+		'css' => 'min-width:300px;',
667
+		'std' => 'latest',
668
+		'type' => 'select',
669
+		'class' => 'chosen_select',
670
+		'options' => array_unique(array(
671
+			'latest' => __('Latest', 'geodirectory'),
672
+			'featured' => __('Featured', 'geodirectory'),
673
+			'high_review' => __('Review', 'geodirectory'),
674
+			'high_rating' => __('Rating', 'geodirectory'),
675
+			'random' => __('Random', 'geodirectory'),
676
+		))
677
+	),
678 678
 
679
-    array(
680
-        'name' => __('Number of posts:', 'geodirectory'),
681
-        'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
682
-        'id' => 'geodir_related_post_count',
683
-        'type' => 'text',
684
-        'css' => 'min-width:300px;',
685
-        'std' => '5' // Default value to show home top section
686
-    ),
679
+	array(
680
+		'name' => __('Number of posts:', 'geodirectory'),
681
+		'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
682
+		'id' => 'geodir_related_post_count',
683
+		'type' => 'text',
684
+		'css' => 'min-width:300px;',
685
+		'std' => '5' // Default value to show home top section
686
+	),
687 687
 
688
-    array(
689
-        'name' => __('Post excerpt', 'geodirectory'),
690
-        'desc' => __('Post content excerpt character count', 'geodirectory'),
691
-        'id' => 'geodir_related_post_excerpt',
692
-        'type' => 'text',
693
-        'css' => 'min-width:300px;',
694
-        'std' => '20' // Default value to show home top section
695
-    ),
688
+	array(
689
+		'name' => __('Post excerpt', 'geodirectory'),
690
+		'desc' => __('Post content excerpt character count', 'geodirectory'),
691
+		'id' => 'geodir_related_post_excerpt',
692
+		'type' => 'text',
693
+		'css' => 'min-width:300px;',
694
+		'std' => '20' // Default value to show home top section
695
+	),
696 696
 
697 697
 
698
-    array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
699
-    /* Detail Layout Settings end */
698
+	array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
699
+	/* Detail Layout Settings end */
700 700
 
701
-    /* Author Layout Settings Start */
701
+	/* Author Layout Settings Start */
702 702
 
703
-    array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
703
+	array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
704 704
 
705 705
 
706
-    array('name' => __('Author Page Layout Settings', 'geodirectory'),
707
-        'type' => 'sectionstart',
708
-        'desc' => '',
709
-        'id' => 'geodir_author_layout'),
706
+	array('name' => __('Author Page Layout Settings', 'geodirectory'),
707
+		'type' => 'sectionstart',
708
+		'desc' => '',
709
+		'id' => 'geodir_author_layout'),
710 710
 
711
-    array(
712
-        'name' => __('Author top section', 'geodirectory'),
713
-        'desc' => __('Show the top section of author page', 'geodirectory'),
714
-        'id' => 'geodir_show_author_top_section',
715
-        'type' => 'checkbox',
716
-        'std' => '1' // Default value to show home top section
717
-    ),
711
+	array(
712
+		'name' => __('Author top section', 'geodirectory'),
713
+		'desc' => __('Show the top section of author page', 'geodirectory'),
714
+		'id' => 'geodir_show_author_top_section',
715
+		'type' => 'checkbox',
716
+		'std' => '1' // Default value to show home top section
717
+	),
718 718
 
719
-    array(
720
-        'name' => __('Author right section', 'geodirectory'),
721
-        'desc' => __('Show the right section of author page', 'geodirectory'),
722
-        'id' => 'geodir_show_author_right_section',
723
-        'type' => 'checkbox',
724
-        'std' => '1' // Default value to show home top section
725
-    ),
719
+	array(
720
+		'name' => __('Author right section', 'geodirectory'),
721
+		'desc' => __('Show the right section of author page', 'geodirectory'),
722
+		'id' => 'geodir_show_author_right_section',
723
+		'type' => 'checkbox',
724
+		'std' => '1' // Default value to show home top section
725
+	),
726 726
 
727
-    array(
728
-        'name' => __('Width of author right section', 'geodirectory'),
729
-        'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
730
-        'id' => 'geodir_width_author_right_section',
731
-        'type' => 'text',
732
-        'css' => 'min-width:300px;',
733
-        'std' => '30' // Default value to show home top section
734
-    ),
727
+	array(
728
+		'name' => __('Width of author right section', 'geodirectory'),
729
+		'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
730
+		'id' => 'geodir_width_author_right_section',
731
+		'type' => 'text',
732
+		'css' => 'min-width:300px;',
733
+		'std' => '30' // Default value to show home top section
734
+	),
735 735
 
736
-    array(
737
-        'name' => __('Author content section view', 'geodirectory'),
738
-        'desc' => __('Set the listing view of author page', 'geodirectory'),
739
-        'id' => 'geodir_author_view',
740
-        'css' => 'min-width:300px;',
741
-        'std' => 'gridview_onehalf',
742
-        'type' => 'select',
743
-        'class' => 'chosen_select',
744
-        'options' => array_unique(array(
745
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
746
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
747
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
748
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
749
-            'listview' => __('List view', 'geodirectory'),
750
-        ))
751
-    ),
736
+	array(
737
+		'name' => __('Author content section view', 'geodirectory'),
738
+		'desc' => __('Set the listing view of author page', 'geodirectory'),
739
+		'id' => 'geodir_author_view',
740
+		'css' => 'min-width:300px;',
741
+		'std' => 'gridview_onehalf',
742
+		'type' => 'select',
743
+		'class' => 'chosen_select',
744
+		'options' => array_unique(array(
745
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
746
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
747
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
748
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
749
+			'listview' => __('List view', 'geodirectory'),
750
+		))
751
+	),
752 752
 
753
-    array(
754
-        'name' => __('Width of author content section', 'geodirectory'),
755
-        'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
756
-        'id' => 'geodir_width_author_contant_section',
757
-        'type' => 'text',
758
-        'css' => 'min-width:300px;',
759
-        'std' => '63' // Default value to show home top section
760
-    ),
753
+	array(
754
+		'name' => __('Width of author content section', 'geodirectory'),
755
+		'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
756
+		'id' => 'geodir_width_author_contant_section',
757
+		'type' => 'text',
758
+		'css' => 'min-width:300px;',
759
+		'std' => '63' // Default value to show home top section
760
+	),
761 761
 
762
-    array(
763
-        'name' => __('Author left section', 'geodirectory'),
764
-        'desc' => __('Show the left section of author page', 'geodirectory'),
765
-        'id' => 'geodir_show_author_left_section',
766
-        'type' => 'checkbox',
767
-        'std' => '0' // Default value to show home top section
768
-    ),
762
+	array(
763
+		'name' => __('Author left section', 'geodirectory'),
764
+		'desc' => __('Show the left section of author page', 'geodirectory'),
765
+		'id' => 'geodir_show_author_left_section',
766
+		'type' => 'checkbox',
767
+		'std' => '0' // Default value to show home top section
768
+	),
769 769
 
770
-    array(
771
-        'name' => __('Width of author left section', 'geodirectory'),
772
-        'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
773
-        'id' => 'geodir_width_author_left_section',
774
-        'type' => 'text',
775
-        'css' => 'min-width:300px;',
776
-        'std' => '30' // Default value to show home top section
777
-    ),
770
+	array(
771
+		'name' => __('Width of author left section', 'geodirectory'),
772
+		'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
773
+		'id' => 'geodir_width_author_left_section',
774
+		'type' => 'text',
775
+		'css' => 'min-width:300px;',
776
+		'std' => '30' // Default value to show home top section
777
+	),
778 778
 
779
-    array(
780
-        'name' => __('Author bottom section', 'geodirectory'),
781
-        'desc' => __('Show the bottom section of author page', 'geodirectory'),
782
-        'id' => 'geodir_show_author_bottom_section',
783
-        'type' => 'checkbox',
784
-        'std' => '0' // Default value to show home top section
785
-    ),
779
+	array(
780
+		'name' => __('Author bottom section', 'geodirectory'),
781
+		'desc' => __('Show the bottom section of author page', 'geodirectory'),
782
+		'id' => 'geodir_show_author_bottom_section',
783
+		'type' => 'checkbox',
784
+		'std' => '0' // Default value to show home top section
785
+	),
786 786
 
787 787
 
788
-    array(
789
-        'name' => __('Description word limit', 'geodirectory'),
790
-        'desc' => '',
791
-        'id' => 'geodir_author_desc_word_limit',
792
-        'type' => 'text',
793
-        'css' => 'min-width:300px;',
794
-        'std' => '50' // Default value to show home top section
795
-    ),
788
+	array(
789
+		'name' => __('Description word limit', 'geodirectory'),
790
+		'desc' => '',
791
+		'id' => 'geodir_author_desc_word_limit',
792
+		'type' => 'text',
793
+		'css' => 'min-width:300px;',
794
+		'std' => '50' // Default value to show home top section
795
+	),
796 796
 
797
-    array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
798
-    /* Author Layout Settings end */
797
+	array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
798
+	/* Author Layout Settings end */
799 799
 
800 800
 
801
-    /* Post Type Navigation Settings Start */
802
-    array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
801
+	/* Post Type Navigation Settings Start */
802
+	array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
803 803
 
804 804
 
805
-    /* Post Type Navigation Settings Start */
805
+	/* Post Type Navigation Settings Start */
806 806
 
807
-    array('name' => __('Navigation Locations', 'geodirectory'),
808
-        'type' => 'sectionstart',
809
-        'desc' => '',
810
-        'id' => 'geodir_navigation_locations'),
807
+	array('name' => __('Navigation Locations', 'geodirectory'),
808
+		'type' => 'sectionstart',
809
+		'desc' => '',
810
+		'id' => 'geodir_navigation_locations'),
811 811
 
812
-    array(
813
-        'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
814
-        'desc' => '',
815
-        'tip' => '',
816
-        'id' => 'geodir_theme_location_nav',
817
-        'css' => 'min-width:300px;',
818
-        'std' => array(),
819
-        'type' => 'multiselect',
820
-        'placeholder_text' => __('Select menu locations', 'geodirectory'),
821
-        'class' => 'chosen_select',
822
-        'options' => array_unique(geodir_theme_location_setting_fun())
823
-    ),
824
-    array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
825
-
826
-
827
-    array('name' => __('Navigation Settings', 'geodirectory'),
828
-        'type' => 'sectionstart',
829
-        'desc' => '',
830
-        'id' => 'geodir_navigation_options'),
812
+	array(
813
+		'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
814
+		'desc' => '',
815
+		'tip' => '',
816
+		'id' => 'geodir_theme_location_nav',
817
+		'css' => 'min-width:300px;',
818
+		'std' => array(),
819
+		'type' => 'multiselect',
820
+		'placeholder_text' => __('Select menu locations', 'geodirectory'),
821
+		'class' => 'chosen_select',
822
+		'options' => array_unique(geodir_theme_location_setting_fun())
823
+	),
824
+	array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
831 825
 
832 826
 
833
-    array(
834
-        'name' => __('Show add listing navigation in menu', 'geodirectory'),
835
-        'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
836
-        'id' => 'geodir_show_addlisting_nav',
837
-        'std' => '1',
838
-        'type' => 'checkbox'
839
-    ),
827
+	array('name' => __('Navigation Settings', 'geodirectory'),
828
+		'type' => 'sectionstart',
829
+		'desc' => '',
830
+		'id' => 'geodir_navigation_options'),
840 831
 
841
-    array(
842
-        'name' => __('Show listings navigation in menu', 'geodirectory'),
843
-        'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
844
-        'id' => 'geodir_show_listing_nav',
845
-        'std' => '1',
846
-        'type' => 'checkbox'
847
-    ),
848 832
 
849
-    array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
833
+	array(
834
+		'name' => __('Show add listing navigation in menu', 'geodirectory'),
835
+		'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
836
+		'id' => 'geodir_show_addlisting_nav',
837
+		'std' => '1',
838
+		'type' => 'checkbox'
839
+	),
840
+
841
+	array(
842
+		'name' => __('Show listings navigation in menu', 'geodirectory'),
843
+		'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
844
+		'id' => 'geodir_show_listing_nav',
845
+		'std' => '1',
846
+		'type' => 'checkbox'
847
+	),
848
+
849
+	array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
850 850
 
851 851
 
852
-    array('name' => __('Post Type Navigation Settings', 'geodirectory'),
853
-        'type' => 'sectionstart',
854
-        'desc' => '',
855
-        'id' => 'geodir_post_type_navigation_layout'),
856
-    array(
857
-        'name' => __('Show listing link in main navigation', 'geodirectory'),
858
-        'desc' => '',
859
-        'tip' => '',
860
-        'id' => 'geodir_add_posttype_in_main_nav',
861
-        'css' => 'min-width:300px;',
862
-        'std' => array(),
863
-        'type' => 'multiselect',
864
-        'placeholder_text' => __('Select post types', 'geodirectory'),
865
-        'class' => 'chosen_select',
866
-        'options' => array_unique(geodir_post_type_setting_fun())
867
-    ),
852
+	array('name' => __('Post Type Navigation Settings', 'geodirectory'),
853
+		'type' => 'sectionstart',
854
+		'desc' => '',
855
+		'id' => 'geodir_post_type_navigation_layout'),
856
+	array(
857
+		'name' => __('Show listing link in main navigation', 'geodirectory'),
858
+		'desc' => '',
859
+		'tip' => '',
860
+		'id' => 'geodir_add_posttype_in_main_nav',
861
+		'css' => 'min-width:300px;',
862
+		'std' => array(),
863
+		'type' => 'multiselect',
864
+		'placeholder_text' => __('Select post types', 'geodirectory'),
865
+		'class' => 'chosen_select',
866
+		'options' => array_unique(geodir_post_type_setting_fun())
867
+	),
868 868
 
869
-    array(
870
-        'name' => __('Show listing link in listing navigation', 'geodirectory'),
871
-        'desc' => '',
872
-        'tip' => '',
873
-        'id' => 'geodir_add_posttype_in_listing_nav',
874
-        'css' => 'min-width:300px;',
875
-        'std' => geodir_get_posttypes(),
876
-        'type' => 'multiselect',
877
-        'placeholder_text' => __('Select post types', 'geodirectory'),
878
-        'class' => 'chosen_select',
879
-        'options' => array_unique(geodir_post_type_setting_fun())
880
-    ),
869
+	array(
870
+		'name' => __('Show listing link in listing navigation', 'geodirectory'),
871
+		'desc' => '',
872
+		'tip' => '',
873
+		'id' => 'geodir_add_posttype_in_listing_nav',
874
+		'css' => 'min-width:300px;',
875
+		'std' => geodir_get_posttypes(),
876
+		'type' => 'multiselect',
877
+		'placeholder_text' => __('Select post types', 'geodirectory'),
878
+		'class' => 'chosen_select',
879
+		'options' => array_unique(geodir_post_type_setting_fun())
880
+	),
881 881
 
882
-    array(
883
-        'name' => __('Allow post type to add from frontend', 'geodirectory'),
884
-        'desc' => '',
885
-        'tip' => '',
886
-        'id' => 'geodir_allow_posttype_frontend',
887
-        'css' => 'min-width:300px;',
888
-        'std' => geodir_get_posttypes(),
889
-        'type' => 'multiselect',
890
-        'placeholder_text' => __('Select post types', 'geodirectory'),
891
-        'class' => 'chosen_select',
892
-        'options' => array_unique(geodir_post_type_setting_fun())
893
-    ),
882
+	array(
883
+		'name' => __('Allow post type to add from frontend', 'geodirectory'),
884
+		'desc' => '',
885
+		'tip' => '',
886
+		'id' => 'geodir_allow_posttype_frontend',
887
+		'css' => 'min-width:300px;',
888
+		'std' => geodir_get_posttypes(),
889
+		'type' => 'multiselect',
890
+		'placeholder_text' => __('Select post types', 'geodirectory'),
891
+		'class' => 'chosen_select',
892
+		'options' => array_unique(geodir_post_type_setting_fun())
893
+	),
894 894
 
895
-    array(
896
-        'name' => __('Show add listing link in main navigation', 'geodirectory'),
897
-        'desc' => '',
898
-        'tip' => '',
899
-        'id' => 'geodir_add_listing_link_main_nav',
900
-        'css' => 'min-width:300px;',
901
-        'std' => array(),
902
-        'type' => 'multiselect',
903
-        'placeholder_text' => __('Select post types', 'geodirectory'),
904
-        'class' => 'chosen_select',
905
-        'options' => array_unique(geodir_post_type_setting_fun())
906
-    ),
895
+	array(
896
+		'name' => __('Show add listing link in main navigation', 'geodirectory'),
897
+		'desc' => '',
898
+		'tip' => '',
899
+		'id' => 'geodir_add_listing_link_main_nav',
900
+		'css' => 'min-width:300px;',
901
+		'std' => array(),
902
+		'type' => 'multiselect',
903
+		'placeholder_text' => __('Select post types', 'geodirectory'),
904
+		'class' => 'chosen_select',
905
+		'options' => array_unique(geodir_post_type_setting_fun())
906
+	),
907 907
 
908
-    array(
909
-        'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
910
-        'desc' => '',
911
-        'tip' => '',
912
-        'id' => 'geodir_add_listing_link_add_listing_nav',
913
-        'css' => 'min-width:300px;',
914
-        'std' => geodir_get_posttypes(),
915
-        'type' => 'multiselect',
916
-        'class' => 'chosen_select',
917
-        'options' => array_unique(geodir_post_type_setting_fun())
918
-    ),
908
+	array(
909
+		'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
910
+		'desc' => '',
911
+		'tip' => '',
912
+		'id' => 'geodir_add_listing_link_add_listing_nav',
913
+		'css' => 'min-width:300px;',
914
+		'std' => geodir_get_posttypes(),
915
+		'type' => 'multiselect',
916
+		'class' => 'chosen_select',
917
+		'options' => array_unique(geodir_post_type_setting_fun())
918
+	),
919 919
 
920
-    array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
920
+	array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
921 921
 
922 922
 
923
-    array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
923
+	array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
924 924
 
925 925
 
926
-    array(
927
-        'name' => __('Show add listing link in user dashboard', 'geodirectory'),
928
-        'desc' => '',
929
-        'tip' => '',
930
-        'id' => 'geodir_add_listing_link_user_dashboard',
931
-        'css' => 'min-width:300px;',
932
-        'std' => geodir_get_posttypes(),
933
-        'type' => 'multiselect',
934
-        'placeholder_text' => __('Select post types', 'geodirectory'),
935
-        'class' => 'chosen_select',
936
-        'options' => array_unique(geodir_post_type_setting_fun())
937
-    ),
926
+	array(
927
+		'name' => __('Show add listing link in user dashboard', 'geodirectory'),
928
+		'desc' => '',
929
+		'tip' => '',
930
+		'id' => 'geodir_add_listing_link_user_dashboard',
931
+		'css' => 'min-width:300px;',
932
+		'std' => geodir_get_posttypes(),
933
+		'type' => 'multiselect',
934
+		'placeholder_text' => __('Select post types', 'geodirectory'),
935
+		'class' => 'chosen_select',
936
+		'options' => array_unique(geodir_post_type_setting_fun())
937
+	),
938 938
 
939
-    array(
940
-        'name' => __('Show favorite link in user dashboard', 'geodirectory'),
941
-        'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
942
-        'tip' => '',
943
-        'id' => 'geodir_favorite_link_user_dashboard',
944
-        'css' => 'min-width:300px;',
945
-        'std' => geodir_get_posttypes(),
946
-        'type' => 'multiselect',
947
-        'placeholder_text' => __('Select post types', 'geodirectory'),
948
-        'class' => 'chosen_select',
949
-        'options' => array_unique(geodir_post_type_setting_fun())
950
-    ),
939
+	array(
940
+		'name' => __('Show favorite link in user dashboard', 'geodirectory'),
941
+		'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
942
+		'tip' => '',
943
+		'id' => 'geodir_favorite_link_user_dashboard',
944
+		'css' => 'min-width:300px;',
945
+		'std' => geodir_get_posttypes(),
946
+		'type' => 'multiselect',
947
+		'placeholder_text' => __('Select post types', 'geodirectory'),
948
+		'class' => 'chosen_select',
949
+		'options' => array_unique(geodir_post_type_setting_fun())
950
+	),
951 951
 
952
-    array(
953
-        'name' => __('Show listing link in user dashboard', 'geodirectory'),
954
-        'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
955
-        'tip' => '',
956
-        'id' => 'geodir_listing_link_user_dashboard',
957
-        'css' => 'min-width:300px;',
958
-        'std' => geodir_get_posttypes(),
959
-        'type' => 'multiselect',
960
-        'placeholder_text' => __('Select post types', 'geodirectory'),
961
-        'class' => 'chosen_select',
962
-        'options' => array_unique(geodir_post_type_setting_fun())
963
-    ),
964
-
965
-    array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
966
-    /* Post Type Navigation Settings End */
967
-
968
-    /* Script Settings Start */
969
-    array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
970
-
971
-    /*
952
+	array(
953
+		'name' => __('Show listing link in user dashboard', 'geodirectory'),
954
+		'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
955
+		'tip' => '',
956
+		'id' => 'geodir_listing_link_user_dashboard',
957
+		'css' => 'min-width:300px;',
958
+		'std' => geodir_get_posttypes(),
959
+		'type' => 'multiselect',
960
+		'placeholder_text' => __('Select post types', 'geodirectory'),
961
+		'class' => 'chosen_select',
962
+		'options' => array_unique(geodir_post_type_setting_fun())
963
+	),
964
+
965
+	array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
966
+	/* Post Type Navigation Settings End */
967
+
968
+	/* Script Settings Start */
969
+	array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
970
+
971
+	/*
972 972
     array( 	'name' => __( 'Add/Remove Scripts', 'geodirectory' ),
973 973
                 'type' => 'sectionstart',
974 974
                 'desc' => '',
@@ -994,166 +994,166 @@  discard block
 block discarded – undo
994 994
 
995 995
     */
996 996
 
997
-    array('name' => __('SCSS Settings (CSS combine and minify)', 'geodirectory'),
998
-        'type' => 'sectionstart',
999
-        'desc' => '',
1000
-        'id' => 'geodir_scss_settings'),
997
+	array('name' => __('SCSS Settings (CSS combine and minify)', 'geodirectory'),
998
+		'type' => 'sectionstart',
999
+		'desc' => '',
1000
+		'id' => 'geodir_scss_settings'),
1001 1001
 
1002
-    array(
1003
-        'name' => __('Disable Core SCSS', 'geodirectory'),
1004
-        'desc' => __('Stops the CSS files being minified and output as one.', 'geodirectory'),
1005
-        'id' => 'geodir_scss_core',
1006
-        'type' => 'checkbox',
1007
-        'std' => '0' // Default value to show home top section
1008
-    ),
1002
+	array(
1003
+		'name' => __('Disable Core SCSS', 'geodirectory'),
1004
+		'desc' => __('Stops the CSS files being minified and output as one.', 'geodirectory'),
1005
+		'id' => 'geodir_scss_core',
1006
+		'type' => 'checkbox',
1007
+		'std' => '0' // Default value to show home top section
1008
+	),
1009 1009
 
1010
-    array('type' => 'sectionend', 'id' => 'geodir_scss_settings'),
1010
+	array('type' => 'sectionend', 'id' => 'geodir_scss_settings'),
1011 1011
 
1012
-    array('name' => __('Script Settings', 'geodirectory'),
1013
-        'type' => 'sectionstart',
1014
-        'desc' => '',
1015
-        'id' => 'geodir_script_settings'),
1012
+	array('name' => __('Script Settings', 'geodirectory'),
1013
+		'type' => 'sectionstart',
1014
+		'desc' => '',
1015
+		'id' => 'geodir_script_settings'),
1016 1016
 
1017
-    array(
1018
-        'name' => __('Custom style css code', 'geodirectory'),
1019
-        'desc' => '',
1020
-        'id' => 'geodir_coustem_css',
1021
-        'type' => 'textarea',
1022
-        'css' => 'min-width:300px;',
1023
-        'std' => '' // Default value for the page title - changed in settings
1024
-    ),
1017
+	array(
1018
+		'name' => __('Custom style css code', 'geodirectory'),
1019
+		'desc' => '',
1020
+		'id' => 'geodir_coustem_css',
1021
+		'type' => 'textarea',
1022
+		'css' => 'min-width:300px;',
1023
+		'std' => '' // Default value for the page title - changed in settings
1024
+	),
1025 1025
 
1026
-    array(
1027
-        'name' => __('Header script code', 'geodirectory'),
1028
-        'desc' => '',
1029
-        'id' => 'geodir_header_scripts',
1030
-        'type' => 'textarea',
1031
-        'css' => 'min-width:300px;',
1032
-        'std' => '' // Default value for the page title - changed in settings
1033
-    ),
1026
+	array(
1027
+		'name' => __('Header script code', 'geodirectory'),
1028
+		'desc' => '',
1029
+		'id' => 'geodir_header_scripts',
1030
+		'type' => 'textarea',
1031
+		'css' => 'min-width:300px;',
1032
+		'std' => '' // Default value for the page title - changed in settings
1033
+	),
1034 1034
 
1035
-    array(
1036
-        'name' => __('Footer script code', 'geodirectory'),
1037
-        'desc' => '',
1038
-        'id' => 'geodir_footer_scripts',
1039
-        'type' => 'textarea',
1040
-        'css' => 'min-width:300px;',
1041
-        'std' => '' // Default value for the page title - changed in settings
1042
-    ),
1035
+	array(
1036
+		'name' => __('Footer script code', 'geodirectory'),
1037
+		'desc' => '',
1038
+		'id' => 'geodir_footer_scripts',
1039
+		'type' => 'textarea',
1040
+		'css' => 'min-width:300px;',
1041
+		'std' => '' // Default value for the page title - changed in settings
1042
+	),
1043 1043
 
1044
-    array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
1045
-    /* Script Settings End */
1044
+	array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
1045
+	/* Script Settings End */
1046 1046
 
1047
-    /* Map Settings Start */
1048
-    array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
1047
+	/* Map Settings Start */
1048
+	array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
1049 1049
 
1050
-    /* Untick the category by default on home map */
1051
-    array(
1052
-        'name' => __('Home Map Settings', 'geodirectory'),
1053
-        'type' => 'sectionstart',
1054
-        'desc' => '',
1055
-        'id' => 'geodir_home_map_section'
1056
-    ),
1057
-    array(
1058
-        'name' => __('Select category to untick by default on map', 'geodirectory'),
1059
-        'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1060
-        'tip' => '',
1061
-        'id' => 'geodir_home_map_untick',
1062
-        'css' => 'min-width:300px;',
1063
-        'std' => '',
1064
-        'type' => 'multiselect',
1065
-        'placeholder_text' => __('Select category', 'geodirectory'),
1066
-        'class' => 'chosen_select',
1067
-        'options' => geodir_home_map_cats_key_value_array()
1068
-    ),
1069
-    array(
1070
-        'type' => 'sectionend',
1071
-        'id' => 'geodir_home_map_section'
1072
-    ),
1050
+	/* Untick the category by default on home map */
1051
+	array(
1052
+		'name' => __('Home Map Settings', 'geodirectory'),
1053
+		'type' => 'sectionstart',
1054
+		'desc' => '',
1055
+		'id' => 'geodir_home_map_section'
1056
+	),
1057
+	array(
1058
+		'name' => __('Select category to untick by default on map', 'geodirectory'),
1059
+		'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1060
+		'tip' => '',
1061
+		'id' => 'geodir_home_map_untick',
1062
+		'css' => 'min-width:300px;',
1063
+		'std' => '',
1064
+		'type' => 'multiselect',
1065
+		'placeholder_text' => __('Select category', 'geodirectory'),
1066
+		'class' => 'chosen_select',
1067
+		'options' => geodir_home_map_cats_key_value_array()
1068
+	),
1069
+	array(
1070
+		'type' => 'sectionend',
1071
+		'id' => 'geodir_home_map_section'
1072
+	),
1073 1073
 
1074
-    array(
1075
-        'name' => __('Add Listing Map Settings', 'geodirectory'),
1076
-        'type' => 'sectionstart',
1077
-        'desc' => '',
1078
-        'id' => 'geodir_add_listing_map_section'
1079
-    ),
1080
-    array(
1081
-        'name' => __('Disable mouse scroll', 'geodirectory'),
1082
-        'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1083
-        'id' => 'geodir_add_listing_mouse_scroll',
1084
-        'type' => 'checkbox',
1085
-        'std' => '0' // Default value to show home top section
1086
-    ),
1087
-    array(
1088
-        'type' => 'sectionend',
1089
-        'id' => 'geodir_add_listing_map_section'
1090
-    ),
1074
+	array(
1075
+		'name' => __('Add Listing Map Settings', 'geodirectory'),
1076
+		'type' => 'sectionstart',
1077
+		'desc' => '',
1078
+		'id' => 'geodir_add_listing_map_section'
1079
+	),
1080
+	array(
1081
+		'name' => __('Disable mouse scroll', 'geodirectory'),
1082
+		'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1083
+		'id' => 'geodir_add_listing_mouse_scroll',
1084
+		'type' => 'checkbox',
1085
+		'std' => '0' // Default value to show home top section
1086
+	),
1087
+	array(
1088
+		'type' => 'sectionend',
1089
+		'id' => 'geodir_add_listing_map_section'
1090
+	),
1091 1091
 
1092 1092
 
1093
-    array('name' => __('Default map settings', 'geodirectory'),
1094
-        'type' => 'sectionstart',
1095
-        'desc' => '',
1096
-        'id' => 'geodir_map_default_settings'),
1093
+	array('name' => __('Default map settings', 'geodirectory'),
1094
+		'type' => 'sectionstart',
1095
+		'desc' => '',
1096
+		'id' => 'geodir_map_default_settings'),
1097 1097
 
1098
-    array(
1099
-        'name' => '',
1100
-        'desc' => '',
1101
-        'id' => 'map_default_settings',
1102
-        'type' => 'map_default_settings',
1103
-        'css' => 'min-width:300px;',
1104
-        'std' => '' // Default value for the page title - changed in settings
1105
-    ),
1098
+	array(
1099
+		'name' => '',
1100
+		'desc' => '',
1101
+		'id' => 'map_default_settings',
1102
+		'type' => 'map_default_settings',
1103
+		'css' => 'min-width:300px;',
1104
+		'std' => '' // Default value for the page title - changed in settings
1105
+	),
1106 1106
 
1107
-    array(
1108
-        'name' => __('Upload map default marker icon', 'geodirectory'),
1109
-        'desc' => '',
1110
-        'id' => 'geodir_default_marker_icon',
1111
-        'type' => 'file',
1112
-        'std' => '0',
1113
-        'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1114
-    ),
1115
-    // add option that allows enable/disable map dragging to phone devices
1116
-    array(
1117
-        'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1118
-        'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1119
-        'id' => 'geodir_map_onoff_dragging',
1120
-        'type' => 'checkbox',
1121
-        'std' => '0' // Default value to show home top section
1122
-    ),
1123
-    array(
1124
-        'name' => __('Select Maps API', 'geodirectory'),
1125
-        'desc' => __('- Google Maps API will force to load Google JS library only.<br>- OpenStreetMap API will force to load OpenStreetMap JS library only.<br>- Load Automatic will load Google JS library first, but if Google maps JS library not loaded it then loads the OpenStreetMap JS library to load the maps (recommended for regions where Google maps banned).<br>- Disable Maps will disable and hides maps for entire site.', 'geodirectory'),
1126
-        'tip' => '',
1127
-        'id' => 'geodir_load_map',
1128
-        'css' => 'min-width:300px;',
1129
-        'std' => 'auto',
1130
-        'type' => 'select',
1131
-        'placeholder_text' => __('Select Map', 'geodirectory'),
1132
-        'options' => array(
1133
-                        'auto' => __('Load Automatic', 'geodirectory'),
1134
-                        'google' => __('Load Google Maps API', 'geodirectory'),
1135
-                        'osm' => __('Load OpenStreetMap API', 'geodirectory'),
1136
-                        'none' => __('Disbale Maps', 'geodirectory')
1137
-                    )
1138
-    ),
1139
-
1140
-    array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1141
-
1142
-    array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1143
-        'type' => 'sectionstart',
1144
-        'desc' => '',
1145
-        'id' => 'geodir_map_settings'),
1107
+	array(
1108
+		'name' => __('Upload map default marker icon', 'geodirectory'),
1109
+		'desc' => '',
1110
+		'id' => 'geodir_default_marker_icon',
1111
+		'type' => 'file',
1112
+		'std' => '0',
1113
+		'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1114
+	),
1115
+	// add option that allows enable/disable map dragging to phone devices
1116
+	array(
1117
+		'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1118
+		'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1119
+		'id' => 'geodir_map_onoff_dragging',
1120
+		'type' => 'checkbox',
1121
+		'std' => '0' // Default value to show home top section
1122
+	),
1123
+	array(
1124
+		'name' => __('Select Maps API', 'geodirectory'),
1125
+		'desc' => __('- Google Maps API will force to load Google JS library only.<br>- OpenStreetMap API will force to load OpenStreetMap JS library only.<br>- Load Automatic will load Google JS library first, but if Google maps JS library not loaded it then loads the OpenStreetMap JS library to load the maps (recommended for regions where Google maps banned).<br>- Disable Maps will disable and hides maps for entire site.', 'geodirectory'),
1126
+		'tip' => '',
1127
+		'id' => 'geodir_load_map',
1128
+		'css' => 'min-width:300px;',
1129
+		'std' => 'auto',
1130
+		'type' => 'select',
1131
+		'placeholder_text' => __('Select Map', 'geodirectory'),
1132
+		'options' => array(
1133
+						'auto' => __('Load Automatic', 'geodirectory'),
1134
+						'google' => __('Load Google Maps API', 'geodirectory'),
1135
+						'osm' => __('Load OpenStreetMap API', 'geodirectory'),
1136
+						'none' => __('Disbale Maps', 'geodirectory')
1137
+					)
1138
+	),
1146 1139
 
1147
-    array(
1148
-        'name' => __('Select Map Category', 'geodirectory'),
1149
-        'desc' => '',
1150
-        'id' => 'geodir_map_settings',
1151
-        'type' => 'map',
1152
-        'css' => 'min-width:300px;',
1153
-        'std' => '' // Default value for the page title - changed in settings
1154
-    ),
1155
-
1156
-    array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1157
-    /* Map Settings End */
1140
+	array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1141
+
1142
+	array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1143
+		'type' => 'sectionstart',
1144
+		'desc' => '',
1145
+		'id' => 'geodir_map_settings'),
1146
+
1147
+	array(
1148
+		'name' => __('Select Map Category', 'geodirectory'),
1149
+		'desc' => '',
1150
+		'id' => 'geodir_map_settings',
1151
+		'type' => 'map',
1152
+		'css' => 'min-width:300px;',
1153
+		'std' => '' // Default value for the page title - changed in settings
1154
+	),
1155
+
1156
+	array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1157
+	/* Map Settings End */
1158 1158
 
1159 1159
 )); // End Design settings
Please login to merge, or discard this patch.
geodirectory-admin/admin_functions.php 1 patch
Indentation   +2814 added lines, -2814 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
 function geodir_deactivation()
16 16
 {
17 17
 
18
-    // Update installed variable
19
-    update_option("geodir_installed", 0);
18
+	// Update installed variable
19
+	update_option("geodir_installed", 0);
20 20
 
21
-    // Remove rewrite rules and then recreate rewrite rules.
22
-    flush_rewrite_rules();
21
+	// Remove rewrite rules and then recreate rewrite rules.
22
+	flush_rewrite_rules();
23 23
 }
24 24
 
25 25
 
@@ -32,124 +32,124 @@  discard block
 block discarded – undo
32 32
 function geodir_uninstall()
33 33
 {
34 34
 
35
-    delete_option('geodir_default_data_installed');
35
+	delete_option('geodir_default_data_installed');
36 36
 
37 37
 }
38 38
 
39 39
 if (!function_exists('geodir_admin_styles')) {
40
-    /**
41
-     * Enqueue Admin Styles.
42
-     *
43
-     * @since 1.0.0
44
-     * @package GeoDirectory
45
-     */
46
-    function geodir_admin_styles()
47
-    {
40
+	/**
41
+	 * Enqueue Admin Styles.
42
+	 *
43
+	 * @since 1.0.0
44
+	 * @package GeoDirectory
45
+	 */
46
+	function geodir_admin_styles()
47
+	{
48 48
 
49
-        wp_register_style('geodirectory-admin-css', geodir_plugin_url() . '/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION);
50
-        wp_enqueue_style('geodirectory-admin-css');
49
+		wp_register_style('geodirectory-admin-css', geodir_plugin_url() . '/geodirectory-assets/css/admin.css', array(), GEODIRECTORY_VERSION);
50
+		wp_enqueue_style('geodirectory-admin-css');
51 51
 
52
-        wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
53
-        wp_enqueue_style('geodirectory-frontend-style');
52
+		wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
53
+		wp_enqueue_style('geodirectory-frontend-style');
54 54
 
55
-        wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
56
-        wp_enqueue_style('geodir-chosen-style');
55
+		wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
56
+		wp_enqueue_style('geodir-chosen-style');
57 57
 
58
-        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
59
-        wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
58
+		wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
59
+		wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
60 60
 
61
-        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
62
-        wp_enqueue_style('geodirectory-jquery-ui-css');
61
+		wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
62
+		wp_enqueue_style('geodirectory-jquery-ui-css');
63 63
 
64
-        wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url() . '/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION);
65
-        wp_enqueue_style('geodirectory-custom-fields-css');
64
+		wp_register_style('geodirectory-custom-fields-css', geodir_plugin_url() . '/geodirectory-assets/css/custom_field.css', array(), GEODIRECTORY_VERSION);
65
+		wp_enqueue_style('geodirectory-custom-fields-css');
66 66
 
67
-        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
68
-        wp_enqueue_style('geodirectory-pluplodar-css');
67
+		wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
68
+		wp_enqueue_style('geodirectory-pluplodar-css');
69 69
 
70
-        wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
71
-        wp_enqueue_style('geodir-rating-style');
70
+		wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
71
+		wp_enqueue_style('geodir-rating-style');
72 72
 
73
-        wp_register_style('geodir-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION);
74
-        wp_enqueue_style('geodir-rtl-style');
73
+		wp_register_style('geodir-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl.css', array(), GEODIRECTORY_VERSION);
74
+		wp_enqueue_style('geodir-rtl-style');
75 75
 
76
-    }
76
+	}
77 77
 }
78 78
 
79 79
 if (!function_exists('geodir_admin_styles_req')) {
80
-    /**
81
-     * Loads stylesheets from CDN.
82
-     *
83
-     * @since 1.0.0
84
-     * @package GeoDirectory
85
-     */
86
-    function geodir_admin_styles_req()
87
-    {
80
+	/**
81
+	 * Loads stylesheets from CDN.
82
+	 *
83
+	 * @since 1.0.0
84
+	 * @package GeoDirectory
85
+	 */
86
+	function geodir_admin_styles_req()
87
+	{
88 88
 
89
-        wp_register_style('geodirectory-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
90
-        wp_enqueue_style('geodirectory-font-awesome');
89
+		wp_register_style('geodirectory-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
90
+		wp_enqueue_style('geodirectory-font-awesome');
91 91
 
92
-        wp_register_script('geodirectory-admin', geodir_plugin_url() . '/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION);
93
-        wp_enqueue_script('geodirectory-admin');
92
+		wp_register_script('geodirectory-admin', geodir_plugin_url() . '/geodirectory-assets/js/admin-req.min.js', array('jquery'), GEODIRECTORY_VERSION);
93
+		wp_enqueue_script('geodirectory-admin');
94 94
 
95
-    }
95
+	}
96 96
 }
97 97
 
98 98
 if (!function_exists('geodir_admin_scripts')) {
99
-    /**
100
-     * Enqueue Admin Scripts.
101
-     *
102
-     * @since 1.0.0
103
-     * @package GeoDirectory
104
-     */
105
-    function geodir_admin_scripts()
106
-    {
107
-        $geodir_map_name = geodir_map_name();
99
+	/**
100
+	 * Enqueue Admin Scripts.
101
+	 *
102
+	 * @since 1.0.0
103
+	 * @package GeoDirectory
104
+	 */
105
+	function geodir_admin_scripts()
106
+	{
107
+		$geodir_map_name = geodir_map_name();
108 108
         
109
-        wp_enqueue_script('jquery');
109
+		wp_enqueue_script('jquery');
110 110
 
111
-        wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '', true);
111
+		wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '', true);
112 112
 
113
-        wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.js', array(), GEODIRECTORY_VERSION);
114
-        wp_enqueue_script('chosen');
113
+		wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.js', array(), GEODIRECTORY_VERSION);
114
+		wp_enqueue_script('chosen');
115 115
 
116
-        wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION);
117
-        wp_enqueue_script('geodirectory-choose-ajax');
116
+		wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.js', array(), GEODIRECTORY_VERSION);
117
+		wp_enqueue_script('geodirectory-choose-ajax');
118 118
 
119
-        if (isset($_REQUEST['listing_type'])) {
120
-            wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url() . '/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION);
121
-        }
119
+		if (isset($_REQUEST['listing_type'])) {
120
+			wp_register_script('geodirectory-custom-fields-script', geodir_plugin_url() . '/geodirectory-assets/js/custom_fields.js', array(), GEODIRECTORY_VERSION);
121
+		}
122 122
 
123
-        wp_enqueue_script('geodirectory-custom-fields-script');
124
-        $plugin_path = geodir_plugin_url() . '/geodirectory-functions/cat-meta-functions';
123
+		wp_enqueue_script('geodirectory-custom-fields-script');
124
+		$plugin_path = geodir_plugin_url() . '/geodirectory-functions/cat-meta-functions';
125 125
 
126
-        wp_enqueue_script('tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array('jquery'), null, true);
126
+		wp_enqueue_script('tax-meta-clss', $plugin_path . '/js/tax-meta-clss.js', array('jquery'), null, true);
127 127
 
128
-        if (in_array($geodir_map_name, array('auto', 'google'))) {
129
-            $map_lang = "&language=" . geodir_get_map_default_language();
130
-            /** This filter is documented in geodirectory_template_tags.php */
131
-            $map_extra = apply_filters('geodir_googlemap_script_extra', '');
132
-            wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
133
-        }
128
+		if (in_array($geodir_map_name, array('auto', 'google'))) {
129
+			$map_lang = "&language=" . geodir_get_map_default_language();
130
+			/** This filter is documented in geodirectory_template_tags.php */
131
+			$map_extra = apply_filters('geodir_googlemap_script_extra', '');
132
+			wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
133
+		}
134 134
         
135
-        if ($geodir_map_name == 'osm') {
136
-            // Leaflet OpenStreetMap
137
-            wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
138
-            wp_enqueue_style('geodirectory-leaflet-style');
135
+		if ($geodir_map_name == 'osm') {
136
+			// Leaflet OpenStreetMap
137
+			wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
138
+			wp_enqueue_style('geodirectory-leaflet-style');
139 139
                 
140
-            wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
141
-            wp_enqueue_script('geodirectory-leaflet-script');
140
+			wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
141
+			wp_enqueue_script('geodirectory-leaflet-script');
142 142
             
143
-            wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION);
144
-            wp_enqueue_script('geodirectory-leaflet-geo-script');
145
-        }
146
-        wp_enqueue_script( 'jquery-ui-autocomplete' );
143
+			wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array('geodirectory-leaflet-script'), GEODIRECTORY_VERSION);
144
+			wp_enqueue_script('geodirectory-leaflet-geo-script');
145
+		}
146
+		wp_enqueue_script( 'jquery-ui-autocomplete' );
147 147
         
148
-        wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
149
-        wp_enqueue_script('geodirectory-goMap-script');
148
+		wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
149
+		wp_enqueue_script('geodirectory-goMap-script');
150 150
 
151
-        wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION);
152
-        wp_enqueue_script('geodirectory-goMap-script');
151
+		wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.js', array(), GEODIRECTORY_VERSION);
152
+		wp_enqueue_script('geodirectory-goMap-script');
153 153
 
154 154
 		// font awesome rating script
155 155
 		if (get_option('geodir_reviewrating_enable_font_awesome')) {
@@ -160,167 +160,167 @@  discard block
 block discarded – undo
160 160
 			wp_enqueue_script('geodir-jRating-js');
161 161
 		}
162 162
 
163
-        wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js', array(), GEODIRECTORY_VERSION);
164
-        wp_enqueue_script('geodir-on-document-load');
165
-
166
-
167
-        // SCRIPT FOR UPLOAD
168
-        wp_enqueue_script('plupload-all');
169
-        wp_enqueue_script('jquery-ui-sortable');
170
-
171
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION);
172
-        wp_enqueue_script('geodirectory-plupload-script');
173
-
174
-        // SCRIPT FOR UPLOAD END
175
-
176
-
177
-        // place js config array for plupload
178
-        $plupload_init = array(
179
-            'runtimes' => 'html5,silverlight,flash,html4',
180
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
181
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
182
-            'drop_element' => 'dropbox', // will be adjusted per uploader
183
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
184
-            'multiple_queues' => true,
185
-            'max_file_size' => geodir_max_upload_size(),
186
-            'url' => admin_url('admin-ajax.php'),
187
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
188
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
189
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
190
-            'multipart' => true,
191
-            'urlstream_upload' => true,
192
-            'multi_selection' => false, // will be added per uploader
193
-            // additional post data to send to our ajax hook
194
-            'multipart_params' => array(
195
-                '_ajax_nonce' => "", // will be added per uploader
196
-                'action' => 'plupload_action', // the ajax action name
197
-                'imgid' => 0 // will be added per uploader
198
-            )
199
-        );
200
-        $base_plupload_config = json_encode($plupload_init);
201
-
202
-
203
-        $thumb_img_arr = array();
204
-
205
-        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
206
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
207
-
208
-        $totImg = '';
209
-        $image_limit = '';
210
-        if (!empty($thumb_img_arr)) {
211
-            $totImg = count($thumb_img_arr);
212
-        }
163
+		wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js', array(), GEODIRECTORY_VERSION);
164
+		wp_enqueue_script('geodir-on-document-load');
165
+
166
+
167
+		// SCRIPT FOR UPLOAD
168
+		wp_enqueue_script('plupload-all');
169
+		wp_enqueue_script('jquery-ui-sortable');
170
+
171
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.js', array(), GEODIRECTORY_VERSION);
172
+		wp_enqueue_script('geodirectory-plupload-script');
173
+
174
+		// SCRIPT FOR UPLOAD END
175
+
176
+
177
+		// place js config array for plupload
178
+		$plupload_init = array(
179
+			'runtimes' => 'html5,silverlight,flash,html4',
180
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
181
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
182
+			'drop_element' => 'dropbox', // will be adjusted per uploader
183
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
184
+			'multiple_queues' => true,
185
+			'max_file_size' => geodir_max_upload_size(),
186
+			'url' => admin_url('admin-ajax.php'),
187
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
188
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
189
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
190
+			'multipart' => true,
191
+			'urlstream_upload' => true,
192
+			'multi_selection' => false, // will be added per uploader
193
+			// additional post data to send to our ajax hook
194
+			'multipart_params' => array(
195
+				'_ajax_nonce' => "", // will be added per uploader
196
+				'action' => 'plupload_action', // the ajax action name
197
+				'imgid' => 0 // will be added per uploader
198
+			)
199
+		);
200
+		$base_plupload_config = json_encode($plupload_init);
201
+
202
+
203
+		$thumb_img_arr = array();
204
+
205
+		if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
206
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
207
+
208
+		$totImg = '';
209
+		$image_limit = '';
210
+		if (!empty($thumb_img_arr)) {
211
+			$totImg = count($thumb_img_arr);
212
+		}
213 213
 
214
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
215
-            'totalImg' => $totImg,
216
-            'image_limit' => $image_limit,
217
-            'upload_img_size' => geodir_max_upload_size());
214
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
215
+			'totalImg' => $totImg,
216
+			'image_limit' => $image_limit,
217
+			'upload_img_size' => geodir_max_upload_size());
218 218
 
219
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
219
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
220 220
 
221
-        $ajax_cons_data = array('url' => __(admin_url('admin-ajax.php')));
222
-        wp_localize_script('geodirectory-custom-fields-script', 'geodir_admin_ajax', $ajax_cons_data);
221
+		$ajax_cons_data = array('url' => __(admin_url('admin-ajax.php')));
222
+		wp_localize_script('geodirectory-custom-fields-script', 'geodir_admin_ajax', $ajax_cons_data);
223 223
 
224 224
 
225
-        wp_register_script('geodirectory-admin-script', geodir_plugin_url() . '/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION);
226
-        wp_enqueue_script('geodirectory-admin-script');
225
+		wp_register_script('geodirectory-admin-script', geodir_plugin_url() . '/geodirectory-assets/js/admin.js', array(), GEODIRECTORY_VERSION);
226
+		wp_enqueue_script('geodirectory-admin-script');
227 227
 
228
-        wp_enqueue_style('farbtastic');
229
-        wp_enqueue_script('farbtastic');
228
+		wp_enqueue_style('farbtastic');
229
+		wp_enqueue_script('farbtastic');
230 230
 
231
-        $screen = get_current_screen();
232
-        if ($screen->base == 'post' && in_array($screen->post_type, geodir_get_posttypes())) {
233
-            wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation_admin.js');
234
-        }
231
+		$screen = get_current_screen();
232
+		if ($screen->base == 'post' && in_array($screen->post_type, geodir_get_posttypes())) {
233
+			wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation_admin.js');
234
+		}
235 235
 
236
-        $ajax_cons_data = array('url' => __(get_option('siteurl') . '?geodir_ajax=true'));
237
-        wp_localize_script('geodirectory-admin-script', 'geodir_ajax', $ajax_cons_data);
236
+		$ajax_cons_data = array('url' => __(get_option('siteurl') . '?geodir_ajax=true'));
237
+		wp_localize_script('geodirectory-admin-script', 'geodir_ajax', $ajax_cons_data);
238 238
 
239
-    }
239
+	}
240 240
 }
241 241
 
242 242
 if (!function_exists('geodir_admin_menu')) {
243
-    /**
244
-     * Admin Menus
245
-     *
246
-     * Sets up the admin menus in wordpress.
247
-     *
248
-     * @since 1.0.0
249
-     * @package GeoDirectory
250
-     * @global array $menu Menu array.
251
-     * @global object $geodirectory GeoDirectory plugin object.
252
-     */
253
-    function geodir_admin_menu()
254
-    {
255
-        global $menu, $geodirectory;
243
+	/**
244
+	 * Admin Menus
245
+	 *
246
+	 * Sets up the admin menus in wordpress.
247
+	 *
248
+	 * @since 1.0.0
249
+	 * @package GeoDirectory
250
+	 * @global array $menu Menu array.
251
+	 * @global object $geodirectory GeoDirectory plugin object.
252
+	 */
253
+	function geodir_admin_menu()
254
+	{
255
+		global $menu, $geodirectory;
256 256
 
257
-        if (current_user_can('manage_options')) $menu[] = array('', 'read', 'separator-geodirectory', '', 'wp-menu-separator geodirectory');
257
+		if (current_user_can('manage_options')) $menu[] = array('', 'read', 'separator-geodirectory', '', 'wp-menu-separator geodirectory');
258 258
 
259
-        add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico', '55.1984');
259
+		add_menu_page(__('Geodirectory', 'geodirectory'), __('Geodirectory', 'geodirectory'), 'manage_options', 'geodirectory', 'geodir_admin_panel', geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico', '55.1984');
260 260
 
261 261
 
262
-    }
262
+	}
263 263
 }
264 264
 
265 265
 if (!function_exists('geodir_admin_menu_order')) {
266
-    /**
267
-     * Order admin menus.
268
-     *
269
-     * @since 1.0.0
270
-     * @package GeoDirectory
271
-     * @param array $menu_order Menu order array.
272
-     * @return array Modified menu order array.
273
-     */
274
-    function geodir_admin_menu_order($menu_order)
275
-    {
276
-
277
-        // Initialize our custom order array
278
-        $geodir_menu_order = array();
279
-
280
-        // Get the index of our custom separator
281
-        $geodir_separator = array_search('separator-geodirectory', $menu_order);
282
-
283
-        // Get index of posttype menu
284
-        $post_types = geodir_get_posttypes();
285
-
286
-        // Loop through menu order and do some rearranging
287
-        foreach ($menu_order as $index => $item) :
288
-
289
-            if ((('geodirectory') == $item)) :
290
-                $geodir_menu_order[] = 'separator-geodirectory';
291
-                if (!empty($post_types)) {
292
-                    foreach ($post_types as $post_type) {
293
-                        $geodir_menu_order[] = 'edit.php?post_type=' . $post_type;
294
-                    }
295
-                }
296
-                $geodir_menu_order[] = $item;
266
+	/**
267
+	 * Order admin menus.
268
+	 *
269
+	 * @since 1.0.0
270
+	 * @package GeoDirectory
271
+	 * @param array $menu_order Menu order array.
272
+	 * @return array Modified menu order array.
273
+	 */
274
+	function geodir_admin_menu_order($menu_order)
275
+	{
297 276
 
298
-                unset($menu_order[$geodir_separator]);
299
-            //unset( $menu_order[$geodir_places] );
300
-            elseif (!in_array($item, array('separator-geodirectory'))) :
301
-                $geodir_menu_order[] = $item;
302
-            endif;
277
+		// Initialize our custom order array
278
+		$geodir_menu_order = array();
303 279
 
304
-        endforeach;
280
+		// Get the index of our custom separator
281
+		$geodir_separator = array_search('separator-geodirectory', $menu_order);
305 282
 
306
-        // Return order
307
-        return $geodir_menu_order;
308
-    }
283
+		// Get index of posttype menu
284
+		$post_types = geodir_get_posttypes();
285
+
286
+		// Loop through menu order and do some rearranging
287
+		foreach ($menu_order as $index => $item) :
288
+
289
+			if ((('geodirectory') == $item)) :
290
+				$geodir_menu_order[] = 'separator-geodirectory';
291
+				if (!empty($post_types)) {
292
+					foreach ($post_types as $post_type) {
293
+						$geodir_menu_order[] = 'edit.php?post_type=' . $post_type;
294
+					}
295
+				}
296
+				$geodir_menu_order[] = $item;
297
+
298
+				unset($menu_order[$geodir_separator]);
299
+			//unset( $menu_order[$geodir_places] );
300
+			elseif (!in_array($item, array('separator-geodirectory'))) :
301
+				$geodir_menu_order[] = $item;
302
+			endif;
303
+
304
+		endforeach;
305
+
306
+		// Return order
307
+		return $geodir_menu_order;
308
+	}
309 309
 }
310 310
 
311 311
 if (!function_exists('geodir_admin_custom_menu_order')) {
312
-    /**
313
-     * Enables custom menu order.
314
-     *
315
-     * @since 1.0.0
316
-     * @package GeoDirectory
317
-     * @return bool
318
-     */
319
-    function geodir_admin_custom_menu_order()
320
-    {
321
-        if (!current_user_can('manage_options')) return false;
322
-        return true;
323
-    }
312
+	/**
313
+	 * Enables custom menu order.
314
+	 *
315
+	 * @since 1.0.0
316
+	 * @package GeoDirectory
317
+	 * @return bool
318
+	 */
319
+	function geodir_admin_custom_menu_order()
320
+	{
321
+		if (!current_user_can('manage_options')) return false;
322
+		return true;
323
+	}
324 324
 }
325 325
 
326 326
 /**
@@ -331,41 +331,41 @@  discard block
 block discarded – undo
331 331
  */
332 332
 function geodir_before_admin_panel()
333 333
 {
334
-    if (isset($_REQUEST['installed']) && $_REQUEST['installed'] != '') {
335
-        echo '<div id="message" class="updated fade">
334
+	if (isset($_REQUEST['installed']) && $_REQUEST['installed'] != '') {
335
+		echo '<div id="message" class="updated fade">
336 336
                         <p style="float:right;">' . __('Like Geodirectory?', 'geodirectory') . ' <a href="http://wordpress.org/extend/plugins/Geodirectory/" target="_blank">' . __('Support us by leaving a rating!', 'geodirectory') . '</a></p>
337 337
                         <p><strong>' . __('Geodirectory has been installed and setup. Enjoy :)', 'geodirectory') . '</strong></p>
338 338
                 </div>';
339 339
 
340
-    }
340
+	}
341 341
 
342
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] != '') {
343
-        switch ($_REQUEST['msg']) {
344
-            case 'success':
345
-                echo '<div id="message" class="updated fade"><p><strong>' . __('Your settings have been saved.', 'geodirectory') . '</strong></p></div>';
346
-                flush_rewrite_rules(false);
342
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] != '') {
343
+		switch ($_REQUEST['msg']) {
344
+			case 'success':
345
+				echo '<div id="message" class="updated fade"><p><strong>' . __('Your settings have been saved.', 'geodirectory') . '</strong></p></div>';
346
+				flush_rewrite_rules(false);
347 347
 
348
-                break;
348
+				break;
349 349
 			case 'fail':
350 350
 				$gderr = isset($_REQUEST['gderr']) ? $_REQUEST['gderr'] : '';
351 351
 				
352 352
 				if ($gderr == 21)
353
-			    	echo '<div id="message" class="error fade"><p><strong>' . __('Error: You can not add same permalinks for both Listing and Location, please try again.', 'geodirectory') . '</strong></p></div>';
353
+					echo '<div id="message" class="error fade"><p><strong>' . __('Error: You can not add same permalinks for both Listing and Location, please try again.', 'geodirectory') . '</strong></p></div>';
354 354
 				else
355 355
 					echo '<div id="message" class="error fade"><p><strong>' . __('Error: Your settings have not been saved, please try again.', 'geodirectory') . '</strong></p></div>';
356
-                break;
357
-        }
358
-    }
356
+				break;
357
+		}
358
+	}
359 359
 
360
-    if (!geodir_is_default_location_set()) {
361
-        echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>';
360
+	if (!geodir_is_default_location_set()) {
361
+		echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>';
362 362
 
363
-    }
363
+	}
364 364
 
365
-    if (!function_exists('curl_init')) {
366
-        echo '<div class="error"><p><strong>' . __('CURL is not installed on this server, this can cause problems, please ask your server admin to install it.', 'geodirectory') . '</strong></p></div>';
365
+	if (!function_exists('curl_init')) {
366
+		echo '<div class="error"><p><strong>' . __('CURL is not installed on this server, this can cause problems, please ask your server admin to install it.', 'geodirectory') . '</strong></p></div>';
367 367
 
368
-    }
368
+	}
369 369
 }
370 370
 
371 371
 /**
@@ -378,19 +378,19 @@  discard block
 block discarded – undo
378 378
  */
379 379
 function geodir_handle_option_form_submit($current_tab)
380 380
 {
381
-    global $geodir_settings;
382
-    if (file_exists(dirname(__FILE__) . '/option-pages/' . $current_tab . '_array.php')) {
383
-        /**
384
-         * Contains settings array for current tab.
385
-         *
386
-         * @since 1.0.0
387
-         * @package GeoDirectory
388
-         */
389
-        include_once('option-pages/' . $current_tab . '_array.php');
390
-    }
391
-    if (isset($_POST) && $_POST && isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory') :
392
-        if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir-settings')) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
393
-        if (!wp_verify_nonce($_REQUEST['_wpnonce-' . $current_tab], 'geodir-settings-' . $current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
381
+	global $geodir_settings;
382
+	if (file_exists(dirname(__FILE__) . '/option-pages/' . $current_tab . '_array.php')) {
383
+		/**
384
+		 * Contains settings array for current tab.
385
+		 *
386
+		 * @since 1.0.0
387
+		 * @package GeoDirectory
388
+		 */
389
+		include_once('option-pages/' . $current_tab . '_array.php');
390
+	}
391
+	if (isset($_POST) && $_POST && isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory') :
392
+		if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir-settings')) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
393
+		if (!wp_verify_nonce($_REQUEST['_wpnonce-' . $current_tab], 'geodir-settings-' . $current_tab)) die(__('Action failed. Please refresh the page and retry.', 'geodirectory'));
394 394
 		
395 395
 		/**
396 396
 		 * Fires before updating geodirectory admin settings.
@@ -402,98 +402,98 @@  discard block
 block discarded – undo
402 402
 		 */
403 403
 		do_action('geodir_before_update_options', $current_tab, $geodir_settings);		
404 404
 		
405
-        if (!empty($geodir_settings[$current_tab]))
406
-            geodir_update_options($geodir_settings[$current_tab]);
405
+		if (!empty($geodir_settings[$current_tab]))
406
+			geodir_update_options($geodir_settings[$current_tab]);
407 407
 
408
-        /**
409
-         * Called after GeoDirectory options settings are updated.
410
-         *
411
-         * @since 1.0.0
412
-         * @param array $geodir_settings The array of GeoDirectory settings.
413
-         * @see 'geodir_before_update_options'
414
-         */
415
-        do_action('geodir_update_options', $geodir_settings);
408
+		/**
409
+		 * Called after GeoDirectory options settings are updated.
410
+		 *
411
+		 * @since 1.0.0
412
+		 * @param array $geodir_settings The array of GeoDirectory settings.
413
+		 * @see 'geodir_before_update_options'
414
+		 */
415
+		do_action('geodir_update_options', $geodir_settings);
416 416
 
417
-        /**
418
-         * Called after GeoDirectory options settings are updated.
419
-         *
420
-         * Provides tab specific settings.
421
-         *
422
-         * @since 1.0.0
423
-         * @param string $current_tab The current settings tab name.
424
-         * @param array $geodir_settings[$current_tab] The array of settings for the current settings tab.
425
-         */
426
-        do_action('geodir_update_options_' . $current_tab, $geodir_settings[$current_tab]);
417
+		/**
418
+		 * Called after GeoDirectory options settings are updated.
419
+		 *
420
+		 * Provides tab specific settings.
421
+		 *
422
+		 * @since 1.0.0
423
+		 * @param string $current_tab The current settings tab name.
424
+		 * @param array $geodir_settings[$current_tab] The array of settings for the current settings tab.
425
+		 */
426
+		do_action('geodir_update_options_' . $current_tab, $geodir_settings[$current_tab]);
427 427
 
428
-        flush_rewrite_rules(false);
428
+		flush_rewrite_rules(false);
429 429
 
430
-        $current_tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : '';
430
+		$current_tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : '';
431 431
 
432
-        $redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $_REQUEST['active_tab'] . '&msg=success');
432
+		$redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $_REQUEST['active_tab'] . '&msg=success');
433 433
 
434
-        wp_redirect($redirect_url);
435
-        exit();
436
-    endif;
434
+		wp_redirect($redirect_url);
435
+		exit();
436
+	endif;
437 437
 
438 438
 
439 439
 }
440 440
 
441 441
 
442 442
 if (!function_exists('geodir_autoinstall_admin_header') && get_option('geodir_installed')) {
443
-    /**
444
-     * GeoDirectory dummy data installation.
445
-     *
446
-     * @since 1.0.0
447
-     * @package GeoDirectory
448
-     * @global object $wpdb WordPress Database object.
449
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
450
-     * @param string $post_type The post type.
451
-     */
452
-    function geodir_autoinstall_admin_header($post_type = 'gd_place')
453
-    {
443
+	/**
444
+	 * GeoDirectory dummy data installation.
445
+	 *
446
+	 * @since 1.0.0
447
+	 * @package GeoDirectory
448
+	 * @global object $wpdb WordPress Database object.
449
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
450
+	 * @param string $post_type The post type.
451
+	 */
452
+	function geodir_autoinstall_admin_header($post_type = 'gd_place')
453
+	{
454 454
 
455
-        global $wpdb, $plugin_prefix;
455
+		global $wpdb, $plugin_prefix;
456 456
 
457
-        if (!geodir_is_default_location_set()) {
458
-            echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>';
459
-        } else {
457
+		if (!geodir_is_default_location_set()) {
458
+			echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>';
459
+		} else {
460 460
 
461
-            $geodir_url = admin_url() . 'admin.php?page=geodirectory&tab=general_settings&active_tab=';
461
+			$geodir_url = admin_url() . 'admin.php?page=geodirectory&tab=general_settings&active_tab=';
462 462
 
463
-            $post_counts = $wpdb->get_var("SELECT count(post_id) FROM " . $plugin_prefix . $post_type . "_detail WHERE post_dummy='1'");
463
+			$post_counts = $wpdb->get_var("SELECT count(post_id) FROM " . $plugin_prefix . $post_type . "_detail WHERE post_dummy='1'");
464 464
 
465
-            if ($post_counts > 0) {
466
-                $nonce = wp_create_nonce('geodir_dummy_posts_delete_noncename');
465
+			if ($post_counts > 0) {
466
+				$nonce = wp_create_nonce('geodir_dummy_posts_delete_noncename');
467 467
 
468
-                $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>' . SAMPLE_DATA_SHOW_MSG . '</b><br /><a id="geodir_dummy_delete" class="button_delete" onclick="geodir_autoinstall(this,\'geodir_dummy_delete\',\'' . $nonce . '\',\'' . $post_type . '\')" href="javascript:void(0);" redirect_to="' . $geodir_url . '"  >' . DELETE_BTN_SAMPLE_MSG . '</a></p></div>';
469
-                $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>' . GEODIR_SAMPLE_DATA_DELETE_MSG . '</b><br><img src="' . geodir_plugin_url() . '/geodirectory-assets/images/loadingAnimation.gif" /></p></div>';
470
-            } else {
471
-                $options_list = '';
472
-                for ($option = 1; $option <= 30; $option++) {
473
-                    $selected = '';
474
-                    if ($option == 10)
475
-                        $selected = 'selected="selected"';
468
+				$dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>' . SAMPLE_DATA_SHOW_MSG . '</b><br /><a id="geodir_dummy_delete" class="button_delete" onclick="geodir_autoinstall(this,\'geodir_dummy_delete\',\'' . $nonce . '\',\'' . $post_type . '\')" href="javascript:void(0);" redirect_to="' . $geodir_url . '"  >' . DELETE_BTN_SAMPLE_MSG . '</a></p></div>';
469
+				$dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>' . GEODIR_SAMPLE_DATA_DELETE_MSG . '</b><br><img src="' . geodir_plugin_url() . '/geodirectory-assets/images/loadingAnimation.gif" /></p></div>';
470
+			} else {
471
+				$options_list = '';
472
+				for ($option = 1; $option <= 30; $option++) {
473
+					$selected = '';
474
+					if ($option == 10)
475
+						$selected = 'selected="selected"';
476 476
 
477
-                    $options_list .= '<option ' . $selected . ' value="' . $option . '">' . $option . '</option>';
478
-                }
477
+					$options_list .= '<option ' . $selected . ' value="' . $option . '">' . $option . '</option>';
478
+				}
479 479
 
480
-                $nonce = wp_create_nonce('geodir_dummy_posts_insert_noncename');
480
+				$nonce = wp_create_nonce('geodir_dummy_posts_insert_noncename');
481 481
 
482
-                $dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>' . AUTO_INSATALL_MSG . '</b><br /><select class="selected_sample_data">' . $options_list . '</select><a id="geodir_dummy_insert" class="button_insert" href="javascript:void(0);" onclick="geodir_autoinstall(this,\'geodir_dummy_insert\',\'' . $nonce . '\',\'' . $post_type . '\')"   redirect_to="' . $geodir_url . '" >' . INSERT_BTN_SAMPLE_MSG . '</a></p></div>';
483
-                $dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>' . GEODIR_SAMPLE_DATA_IMPORT_MSG . '</b><br><img src="' . geodir_plugin_url() . '/geodirectory-assets/images/loadingAnimation.gif" /><br><span class="dummy_post_inserted"></span></div>';
482
+				$dummy_msg = '<div id="" class="geodir_auto_install updated highlight fade"><p><b>' . AUTO_INSATALL_MSG . '</b><br /><select class="selected_sample_data">' . $options_list . '</select><a id="geodir_dummy_insert" class="button_insert" href="javascript:void(0);" onclick="geodir_autoinstall(this,\'geodir_dummy_insert\',\'' . $nonce . '\',\'' . $post_type . '\')"   redirect_to="' . $geodir_url . '" >' . INSERT_BTN_SAMPLE_MSG . '</a></p></div>';
483
+				$dummy_msg .= '<div id="" style="display:none;" class="geodir_show_progress updated highlight fade"><p><b>' . GEODIR_SAMPLE_DATA_IMPORT_MSG . '</b><br><img src="' . geodir_plugin_url() . '/geodirectory-assets/images/loadingAnimation.gif" /><br><span class="dummy_post_inserted"></span></div>';
484 484
 
485
-            }
486
-            echo $dummy_msg;
487
-            ?>
485
+			}
486
+			echo $dummy_msg;
487
+			?>
488 488
             <script>
489 489
                 <?php
490
-                  $default_location = geodir_get_default_location();
491
-                  $city =  isset($default_location->city) ? $default_location->city : '';
492
-                  $region =isset($default_location->region) ? $default_location->region : '';
493
-                  $country =isset($default_location->country) ? $default_location->country : '';
494
-                  $city_latitude =isset($default_location->city_latitude) ? $default_location->city_latitude : '';
495
-                  $city_longitude =isset($default_location->city_longitude) ? $default_location->city_longitude : '';
496
-                ?>
490
+				  $default_location = geodir_get_default_location();
491
+				  $city =  isset($default_location->city) ? $default_location->city : '';
492
+				  $region =isset($default_location->region) ? $default_location->region : '';
493
+				  $country =isset($default_location->country) ? $default_location->country : '';
494
+				  $city_latitude =isset($default_location->city_latitude) ? $default_location->city_latitude : '';
495
+				  $city_longitude =isset($default_location->city_longitude) ? $default_location->city_longitude : '';
496
+				?>
497 497
                 var geocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
498 498
                 var CITY_ADDRESS = '<?php echo $city.','.$region.','.$country;?>';
499 499
                 var bound_lat_lng;
@@ -584,8 +584,8 @@  discard block
 block discarded – undo
584 584
                 }
585 585
             </script>
586 586
         <?php
587
-        }
588
-    }
587
+		}
588
+	}
589 589
 }
590 590
 
591 591
 /**
@@ -598,19 +598,19 @@  discard block
 block discarded – undo
598 598
  */
599 599
 function geodir_insert_dummy_posts()
600 600
 {
601
-    geodir_default_taxonomies();
601
+	geodir_default_taxonomies();
602 602
 
603
-    ini_set('max_execution_time', 999999); //300 seconds = 5 minutes
603
+	ini_set('max_execution_time', 999999); //300 seconds = 5 minutes
604 604
 
605
-    global $wpdb, $current_user;
605
+	global $wpdb, $current_user;
606 606
 
607
-    /**
608
-     * Contains dummy post content.
609
-     *
610
-     * @since 1.0.0
611
-     * @package GeoDirectory
612
-     */
613
-    include_once('place_dummy_post.php');
607
+	/**
608
+	 * Contains dummy post content.
609
+	 *
610
+	 * @since 1.0.0
611
+	 * @package GeoDirectory
612
+	 */
613
+	include_once('place_dummy_post.php');
614 614
 
615 615
 }
616 616
 
@@ -624,18 +624,18 @@  discard block
 block discarded – undo
624 624
  */
625 625
 function geodir_delete_dummy_posts()
626 626
 {
627
-    global $wpdb, $plugin_prefix;
627
+	global $wpdb, $plugin_prefix;
628 628
 
629 629
 
630
-    $post_ids = $wpdb->get_results("SELECT post_id FROM " . $plugin_prefix . "gd_place_detail WHERE post_dummy='1'");
630
+	$post_ids = $wpdb->get_results("SELECT post_id FROM " . $plugin_prefix . "gd_place_detail WHERE post_dummy='1'");
631 631
 
632 632
 
633
-    foreach ($post_ids as $post_ids_obj) {
634
-        wp_delete_post($post_ids_obj->post_id);
635
-    }
633
+	foreach ($post_ids as $post_ids_obj) {
634
+		wp_delete_post($post_ids_obj->post_id);
635
+	}
636 636
 
637
-    //double check posts are deleted
638
-    $wpdb->get_results("DELETE FROM " . $plugin_prefix . "gd_place_detail WHERE post_dummy='1'");
637
+	//double check posts are deleted
638
+	$wpdb->get_results("DELETE FROM " . $plugin_prefix . "gd_place_detail WHERE post_dummy='1'");
639 639
 }
640 640
 
641 641
 /**
@@ -649,114 +649,114 @@  discard block
 block discarded – undo
649 649
  * @global string $dummy_image_path The dummy image path.
650 650
  */
651 651
 function geodir_default_taxonomies() {
652
-    global $wpdb, $dummy_image_path;
652
+	global $wpdb, $dummy_image_path;
653 653
 
654
-    $category_array = array('Attractions', 'Hotels', 'Restaurants', 'Food Nightlife', 'Festival', 'Videos', 'Feature');
654
+	$category_array = array('Attractions', 'Hotels', 'Restaurants', 'Food Nightlife', 'Festival', 'Videos', 'Feature');
655 655
 
656
-    $last_catid = '';
656
+	$last_catid = '';
657 657
 
658
-    $uploads = wp_upload_dir(); // Array of key => value pairs
658
+	$uploads = wp_upload_dir(); // Array of key => value pairs
659 659
 
660
-    for ($i = 0; $i < count($category_array); $i++) {
661
-        $parent_catid = 0;
662
-        if (is_array($category_array[$i])) {
663
-            $cat_name_arr = $category_array[$i];
664
-            for ($j = 0; $j < count($cat_name_arr); $j++) {
665
-                $catname = $cat_name_arr[$j];
660
+	for ($i = 0; $i < count($category_array); $i++) {
661
+		$parent_catid = 0;
662
+		if (is_array($category_array[$i])) {
663
+			$cat_name_arr = $category_array[$i];
664
+			for ($j = 0; $j < count($cat_name_arr); $j++) {
665
+				$catname = $cat_name_arr[$j];
666 666
 
667
-                if (!term_exists($catname, 'gd_placecategory')) {
668
-                    $last_catid = wp_insert_term($catname, 'gd_placecategory', $args = array('parent' => $parent_catid));
667
+				if (!term_exists($catname, 'gd_placecategory')) {
668
+					$last_catid = wp_insert_term($catname, 'gd_placecategory', $args = array('parent' => $parent_catid));
669 669
 
670
-                    if ($j == 0) {
671
-                        $parent_catid = $last_catid;
672
-                    }
670
+					if ($j == 0) {
671
+						$parent_catid = $last_catid;
672
+					}
673 673
 
674 674
 
675
-                    if (geodir_dummy_folder_exists())
676
-                        $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon";
677
-                    else
678
-                        $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon';
675
+					if (geodir_dummy_folder_exists())
676
+						$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon";
677
+					else
678
+						$dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon';
679 679
 
680
-                    $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url);
680
+					$dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url);
681 681
 
682
-                    $catname = str_replace(' ', '_', $catname);
683
-                    $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png");
682
+					$catname = str_replace(' ', '_', $catname);
683
+					$uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png");
684 684
 
685
-                    if (empty($uploaded['error'])) {
686
-                        $new_path = $uploaded['file'];
687
-                        $new_url = $uploaded['url'];
688
-                    }
685
+					if (empty($uploaded['error'])) {
686
+						$new_path = $uploaded['file'];
687
+						$new_url = $uploaded['url'];
688
+					}
689 689
 
690
-                    $wp_filetype = wp_check_filetype(basename($new_path), null);
691
-
692
-                    $attachment = array(
693
-                        'guid' => $uploads['baseurl'] . '/' . basename($new_path),
694
-                        'post_mime_type' => $wp_filetype['type'],
695
-                        'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)),
696
-                        'post_content' => '',
697
-                        'post_status' => 'inherit'
698
-                    );
699
-                    $attach_id = wp_insert_attachment($attachment, $new_path);
700
-
701
-                    // you must first include the image.php file
702
-                    // for the function wp_generate_attachment_metadata() to work
703
-                    require_once(ABSPATH . 'wp-admin/includes/image.php');
704
-                    $attach_data = wp_generate_attachment_metadata($attach_id, $new_path);
705
-                    wp_update_attachment_metadata($attach_id, $attach_data);
706
-
707
-                    if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, 'gd_place')) {
708
-                        update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => 'icon', 'src' => $new_url), 'gd_place');
709
-                    }
710
-                }
711
-            }
690
+					$wp_filetype = wp_check_filetype(basename($new_path), null);
691
+
692
+					$attachment = array(
693
+						'guid' => $uploads['baseurl'] . '/' . basename($new_path),
694
+						'post_mime_type' => $wp_filetype['type'],
695
+						'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)),
696
+						'post_content' => '',
697
+						'post_status' => 'inherit'
698
+					);
699
+					$attach_id = wp_insert_attachment($attachment, $new_path);
700
+
701
+					// you must first include the image.php file
702
+					// for the function wp_generate_attachment_metadata() to work
703
+					require_once(ABSPATH . 'wp-admin/includes/image.php');
704
+					$attach_data = wp_generate_attachment_metadata($attach_id, $new_path);
705
+					wp_update_attachment_metadata($attach_id, $attach_data);
706
+
707
+					if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, 'gd_place')) {
708
+						update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => 'icon', 'src' => $new_url), 'gd_place');
709
+					}
710
+				}
711
+			}
712 712
 
713
-        } else {
714
-            $catname = $category_array[$i];
713
+		} else {
714
+			$catname = $category_array[$i];
715 715
 
716
-            if (!term_exists($catname, 'gd_placecategory')) {
717
-                $last_catid = wp_insert_term($catname, 'gd_placecategory');
716
+			if (!term_exists($catname, 'gd_placecategory')) {
717
+				$last_catid = wp_insert_term($catname, 'gd_placecategory');
718 718
 
719
-                if (geodir_dummy_folder_exists())
720
-                    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon";
721
-                else
722
-                    $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon';
719
+				if (geodir_dummy_folder_exists())
720
+					$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon";
721
+				else
722
+					$dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon';
723 723
 
724
-                $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url);
724
+				$dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url);
725 725
 
726
-                $catname = str_replace(' ', '_', $catname);
727
-                $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png");
726
+				$catname = str_replace(' ', '_', $catname);
727
+				$uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png");
728 728
 
729
-                if (empty($uploaded['error'])) {
730
-                    $new_path = $uploaded['file'];
731
-                    $new_url = $uploaded['url'];
732
-                }
729
+				if (empty($uploaded['error'])) {
730
+					$new_path = $uploaded['file'];
731
+					$new_url = $uploaded['url'];
732
+				}
733 733
 
734
-                $wp_filetype = wp_check_filetype(basename($new_path), null);
734
+				$wp_filetype = wp_check_filetype(basename($new_path), null);
735 735
 
736
-                $attachment = array(
737
-                    'guid' => $uploads['baseurl'] . '/' . basename($new_path),
738
-                    'post_mime_type' => $wp_filetype['type'],
739
-                    'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)),
740
-                    'post_content' => '',
741
-                    'post_status' => 'inherit'
742
-                );
736
+				$attachment = array(
737
+					'guid' => $uploads['baseurl'] . '/' . basename($new_path),
738
+					'post_mime_type' => $wp_filetype['type'],
739
+					'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)),
740
+					'post_content' => '',
741
+					'post_status' => 'inherit'
742
+				);
743 743
 
744
-                $attach_id = wp_insert_attachment($attachment, $new_path);
744
+				$attach_id = wp_insert_attachment($attachment, $new_path);
745 745
 
746 746
 
747
-                // you must first include the image.php file
748
-                // for the function wp_generate_attachment_metadata() to work
749
-                require_once(ABSPATH . 'wp-admin/includes/image.php');
750
-                $attach_data = wp_generate_attachment_metadata($attach_id, $new_path);
751
-                wp_update_attachment_metadata($attach_id, $attach_data);
747
+				// you must first include the image.php file
748
+				// for the function wp_generate_attachment_metadata() to work
749
+				require_once(ABSPATH . 'wp-admin/includes/image.php');
750
+				$attach_data = wp_generate_attachment_metadata($attach_id, $new_path);
751
+				wp_update_attachment_metadata($attach_id, $attach_data);
752 752
 
753
-                if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, 'gd_place')) {
754
-                    update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => $attach_id, 'src' => $new_url), 'gd_place');
755
-                }
756
-            }
757
-        }
753
+				if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, 'gd_place')) {
754
+					update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => $attach_id, 'src' => $new_url), 'gd_place');
755
+				}
756
+			}
757
+		}
758 758
 
759
-    }
759
+	}
760 760
 }
761 761
 
762 762
 /**
@@ -771,144 +771,144 @@  discard block
 block discarded – undo
771 771
  * @return bool Returns true if saved.
772 772
  */
773 773
 function geodir_update_options($options, $dummy = false) {
774
-    if ((!isset($_POST) || !$_POST) && !$dummy) return false;
774
+	if ((!isset($_POST) || !$_POST) && !$dummy) return false;
775 775
 
776
-    foreach ($options as $value) {
777
-        if ($dummy && isset($value['std']))
778
-            $_POST[$value['id']] = $value['std'];
776
+	foreach ($options as $value) {
777
+		if ($dummy && isset($value['std']))
778
+			$_POST[$value['id']] = $value['std'];
779 779
 
780 780
 
781
-        if (isset($value['type']) && $value['type'] == 'checkbox') :
781
+		if (isset($value['type']) && $value['type'] == 'checkbox') :
782 782
 
783
-            if (isset($value['id']) && isset($_POST[$value['id']])) {
784
-                update_option($value['id'], $_POST[$value['id']]);
785
-            } else {
786
-                update_option($value['id'], 0);
787
-            }
783
+			if (isset($value['id']) && isset($_POST[$value['id']])) {
784
+				update_option($value['id'], $_POST[$value['id']]);
785
+			} else {
786
+				update_option($value['id'], 0);
787
+			}
788 788
 
789
-        elseif (isset($value['type']) && $value['type'] == 'image_width') :
789
+		elseif (isset($value['type']) && $value['type'] == 'image_width') :
790 790
 
791
-            if (isset($value['id']) && isset($_POST[$value['id'] . '_width'])) {
792
-                update_option($value['id'] . '_width', $_POST[$value['id'] . '_width']);
793
-                update_option($value['id'] . '_height', $_POST[$value['id'] . '_height']);
794
-                if (isset($_POST[$value['id'] . '_crop'])) :
795
-                    update_option($value['id'] . '_crop', 1);
796
-                else :
797
-                    update_option($value['id'] . '_crop', 0);
798
-                endif;
799
-            } else {
800
-                update_option($value['id'] . '_width', $value['std']);
801
-                update_option($value['id'] . '_height', $value['std']);
802
-                update_option($value['id'] . '_crop', 1);
803
-            }
791
+			if (isset($value['id']) && isset($_POST[$value['id'] . '_width'])) {
792
+				update_option($value['id'] . '_width', $_POST[$value['id'] . '_width']);
793
+				update_option($value['id'] . '_height', $_POST[$value['id'] . '_height']);
794
+				if (isset($_POST[$value['id'] . '_crop'])) :
795
+					update_option($value['id'] . '_crop', 1);
796
+				else :
797
+					update_option($value['id'] . '_crop', 0);
798
+				endif;
799
+			} else {
800
+				update_option($value['id'] . '_width', $value['std']);
801
+				update_option($value['id'] . '_height', $value['std']);
802
+				update_option($value['id'] . '_crop', 1);
803
+			}
804 804
 
805
-        elseif (isset($value['type']) && $value['type'] == 'map') :
806
-            $post_types = array();
807
-            $categories = array();
805
+		elseif (isset($value['type']) && $value['type'] == 'map') :
806
+			$post_types = array();
807
+			$categories = array();
808 808
 
809
-            if (!empty($_POST['home_map_post_types'])) :
810
-                foreach ($_POST['home_map_post_types'] as $post_type) :
811
-                    $post_types[] = $post_type;
812
-                endforeach;
813
-            endif;
809
+			if (!empty($_POST['home_map_post_types'])) :
810
+				foreach ($_POST['home_map_post_types'] as $post_type) :
811
+					$post_types[] = $post_type;
812
+				endforeach;
813
+			endif;
814 814
 
815
-            update_option('geodir_exclude_post_type_on_map', $post_types);
815
+			update_option('geodir_exclude_post_type_on_map', $post_types);
816 816
 
817
-            if (!empty($_POST['post_category'])) :
818
-                foreach ($_POST['post_category'] as $texonomy => $cat_arr) :
819
-                    $categories[$texonomy] = array();
820
-                    foreach ($cat_arr as $category) :
821
-                        $categories[$texonomy][] = $category;
822
-                    endforeach;
823
-                    $categories[$texonomy] = !empty($categories[$texonomy]) ? array_unique($categories[$texonomy]) : array();
824
-                endforeach;
825
-            endif;
826
-            update_option('geodir_exclude_cat_on_map', $categories);
827
-            update_option('geodir_exclude_cat_on_map_upgrade', 1);
828
-        elseif (isset($value['type']) && $value['type'] == 'map_default_settings') :
817
+			if (!empty($_POST['post_category'])) :
818
+				foreach ($_POST['post_category'] as $texonomy => $cat_arr) :
819
+					$categories[$texonomy] = array();
820
+					foreach ($cat_arr as $category) :
821
+						$categories[$texonomy][] = $category;
822
+					endforeach;
823
+					$categories[$texonomy] = !empty($categories[$texonomy]) ? array_unique($categories[$texonomy]) : array();
824
+				endforeach;
825
+			endif;
826
+			update_option('geodir_exclude_cat_on_map', $categories);
827
+			update_option('geodir_exclude_cat_on_map_upgrade', 1);
828
+		elseif (isset($value['type']) && $value['type'] == 'map_default_settings') :
829 829
 
830 830
 
831
-            if (!empty($_POST['geodir_default_map_language'])):
832
-                update_option('geodir_default_map_language', $_POST['geodir_default_map_language']);
833
-            endif;
831
+			if (!empty($_POST['geodir_default_map_language'])):
832
+				update_option('geodir_default_map_language', $_POST['geodir_default_map_language']);
833
+			endif;
834 834
 
835 835
 
836
-            if (!empty($_POST['geodir_default_map_search_pt'])):
837
-                update_option('geodir_default_map_search_pt', $_POST['geodir_default_map_search_pt']);
838
-            endif;
836
+			if (!empty($_POST['geodir_default_map_search_pt'])):
837
+				update_option('geodir_default_map_search_pt', $_POST['geodir_default_map_search_pt']);
838
+			endif;
839 839
 
840 840
 
841
-        elseif (isset($value['type']) && $value['type'] == 'file') :
841
+		elseif (isset($value['type']) && $value['type'] == 'file') :
842 842
 
843 843
 
844
-            if (isset($_POST[$value['id'] . '_remove']) && $_POST[$value['id'] . '_remove']) {// if remove is set then remove the file
844
+			if (isset($_POST[$value['id'] . '_remove']) && $_POST[$value['id'] . '_remove']) {// if remove is set then remove the file
845 845
 
846
-                if (get_option($value['id'])) {
847
-                    $image_name_arr = explode('/', get_option($value['id']));
848
-                    $noimg_name = end($image_name_arr);
849
-                    $img_path = $uploads['path'] . '/' . $noimg_name;
850
-                    if (file_exists($img_path))
851
-                        unlink($img_path);
852
-                }
846
+				if (get_option($value['id'])) {
847
+					$image_name_arr = explode('/', get_option($value['id']));
848
+					$noimg_name = end($image_name_arr);
849
+					$img_path = $uploads['path'] . '/' . $noimg_name;
850
+					if (file_exists($img_path))
851
+						unlink($img_path);
852
+				}
853 853
 
854
-                update_option($value['id'], '');
855
-            }
854
+				update_option($value['id'], '');
855
+			}
856 856
 
857
-            $uploadedfile = isset($_FILES[$value['id']]) ? $_FILES[$value['id']] : '';
858
-            $filename = isset($_FILES[$value['id']]['name']) ? $_FILES[$value['id']]['name'] : '';
859
-
860
-            if (!empty($filename)):
861
-                $ext = pathinfo($filename, PATHINFO_EXTENSION);
862
-                $uplaods = array();
863
-
864
-                foreach ($uploadedfile as $key => $uplaod):
865
-                    if ($key == 'name'):
866
-                        $uplaods[$key] = $filename;
867
-                    else :
868
-                        $uplaods[$key] = $uplaod;
869
-                    endif;
870
-                endforeach;
871
-
872
-                $uploads = wp_upload_dir();
873
-
874
-                if (get_option($value['id'])) {
875
-                    $image_name_arr = explode('/', get_option($value['id']));
876
-                    $noimg_name = end($image_name_arr);
877
-                    $img_path = $uploads['path'] . '/' . $noimg_name;
878
-                    if (file_exists($img_path))
879
-                        unlink($img_path);
880
-                }
857
+			$uploadedfile = isset($_FILES[$value['id']]) ? $_FILES[$value['id']] : '';
858
+			$filename = isset($_FILES[$value['id']]['name']) ? $_FILES[$value['id']]['name'] : '';
859
+
860
+			if (!empty($filename)):
861
+				$ext = pathinfo($filename, PATHINFO_EXTENSION);
862
+				$uplaods = array();
863
+
864
+				foreach ($uploadedfile as $key => $uplaod):
865
+					if ($key == 'name'):
866
+						$uplaods[$key] = $filename;
867
+					else :
868
+						$uplaods[$key] = $uplaod;
869
+					endif;
870
+				endforeach;
871
+
872
+				$uploads = wp_upload_dir();
873
+
874
+				if (get_option($value['id'])) {
875
+					$image_name_arr = explode('/', get_option($value['id']));
876
+					$noimg_name = end($image_name_arr);
877
+					$img_path = $uploads['path'] . '/' . $noimg_name;
878
+					if (file_exists($img_path))
879
+						unlink($img_path);
880
+				}
881 881
 
882
-                $upload_overrides = array('test_form' => false);
883
-                $movefile = wp_handle_upload($uplaods, $upload_overrides);
882
+				$upload_overrides = array('test_form' => false);
883
+				$movefile = wp_handle_upload($uplaods, $upload_overrides);
884 884
 
885
-                update_option($value['id'], $movefile['url']);
885
+				update_option($value['id'], $movefile['url']);
886 886
 
887
-            endif;
887
+			endif;
888 888
 
889
-            if (!get_option($value['id']) && isset($value['value'])):
890
-                update_option($value['id'], $value['value']);
891
-            endif;
889
+			if (!get_option($value['id']) && isset($value['value'])):
890
+				update_option($value['id'], $value['value']);
891
+			endif;
892 892
 
893 893
 
894
-        else :
895
-            // same menu setting per theme.
896
-            if (isset($value['id']) && $value['id'] == 'geodir_theme_location_nav' && isset($_POST[$value['id']])) {
897
-                $theme = wp_get_theme();
898
-                update_option('geodir_theme_location_nav_' . $theme->name, $_POST[$value['id']]);
899
-            }
894
+		else :
895
+			// same menu setting per theme.
896
+			if (isset($value['id']) && $value['id'] == 'geodir_theme_location_nav' && isset($_POST[$value['id']])) {
897
+				$theme = wp_get_theme();
898
+				update_option('geodir_theme_location_nav_' . $theme->name, $_POST[$value['id']]);
899
+			}
900 900
 
901
-            if (isset($value['id']) && isset($_POST[$value['id']])) {
902
-                update_option($value['id'], $_POST[$value['id']]);
903
-            } else {
904
-                delete_option($value['id']);
905
-            }
901
+			if (isset($value['id']) && isset($_POST[$value['id']])) {
902
+				update_option($value['id'], $_POST[$value['id']]);
903
+			} else {
904
+				delete_option($value['id']);
905
+			}
906 906
 
907
-        endif;
908
-    }
909
-    if ($dummy)
910
-        $_POST = array();
911
-    return true;
907
+		endif;
908
+	}
909
+	if ($dummy)
910
+		$_POST = array();
911
+	return true;
912 912
 
913 913
 }
914 914
 
@@ -957,33 +957,33 @@  discard block
 block discarded – undo
957 957
 function places_custom_fields_tab($tabs)
958 958
 {
959 959
 
960
-    $geodir_post_types = get_option('geodir_post_types');
960
+	$geodir_post_types = get_option('geodir_post_types');
961 961
 
962
-    if (!empty($geodir_post_types)) {
962
+	if (!empty($geodir_post_types)) {
963 963
 
964
-        foreach ($geodir_post_types as $geodir_post_type => $geodir_posttype_info):
964
+		foreach ($geodir_post_types as $geodir_post_type => $geodir_posttype_info):
965 965
 
966
-            $listing_slug = $geodir_posttype_info['labels']['singular_name'];
966
+			$listing_slug = $geodir_posttype_info['labels']['singular_name'];
967 967
 
968
-            $tabs[$geodir_post_type . '_fields_settings'] = array(
969
-                'label' => __(ucfirst($listing_slug) . ' Settings', 'geodirectory'),
970
-                'subtabs' => array(
971
-                    array('subtab' => 'custom_fields',
972
-                        'label' => __('Custom Fields', 'geodirectory'),
973
-                        'request' => array('listing_type' => $geodir_post_type)),
974
-                    array('subtab' => 'sorting_options',
975
-                        'label' => __('Sorting Options', 'geodirectory'),
976
-                        'request' => array('listing_type' => $geodir_post_type)),
977
-                ),
978
-                'tab_index' => 9,
979
-                'request' => array('listing_type' => $geodir_post_type)
980
-            );
968
+			$tabs[$geodir_post_type . '_fields_settings'] = array(
969
+				'label' => __(ucfirst($listing_slug) . ' Settings', 'geodirectory'),
970
+				'subtabs' => array(
971
+					array('subtab' => 'custom_fields',
972
+						'label' => __('Custom Fields', 'geodirectory'),
973
+						'request' => array('listing_type' => $geodir_post_type)),
974
+					array('subtab' => 'sorting_options',
975
+						'label' => __('Sorting Options', 'geodirectory'),
976
+						'request' => array('listing_type' => $geodir_post_type)),
977
+				),
978
+				'tab_index' => 9,
979
+				'request' => array('listing_type' => $geodir_post_type)
980
+			);
981 981
 
982
-        endforeach;
982
+		endforeach;
983 983
 
984
-    }
984
+	}
985 985
 
986
-    return $tabs;
986
+	return $tabs;
987 987
 }
988 988
 
989 989
 
@@ -999,8 +999,8 @@  discard block
 block discarded – undo
999 999
  */
1000 1000
 function geodir_tools_setting_tab($tabs)
1001 1001
 {
1002
-    $tabs['tools_settings'] = array('label' => __('GD Tools', 'geodirectory'));
1003
-    return $tabs;
1002
+	$tabs['tools_settings'] = array('label' => __('GD Tools', 'geodirectory'));
1003
+	return $tabs;
1004 1004
 }
1005 1005
 
1006 1006
 /**
@@ -1015,8 +1015,8 @@  discard block
 block discarded – undo
1015 1015
  */
1016 1016
 function geodir_compatibility_setting_tab($tabs)
1017 1017
 {
1018
-    $tabs['compatibility_settings'] = array('label' => __('Theme Compatibility', 'geodirectory'));
1019
-    return $tabs;
1018
+	$tabs['compatibility_settings'] = array('label' => __('Theme Compatibility', 'geodirectory'));
1019
+	return $tabs;
1020 1020
 }
1021 1021
 
1022 1022
 
@@ -1032,144 +1032,144 @@  discard block
 block discarded – undo
1032 1032
  */
1033 1033
 function geodir_extend_geodirectory_setting_tab($tabs)
1034 1034
 {
1035
-    $tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory'). ' <i class="fa fa-plug"></i>', 'url' => 'http://wpgeodirectory.com', 'target' => '_blank');
1036
-    return $tabs;
1035
+	$tabs['extend_geodirectory_settings'] = array('label' => __('Extend Geodirectory', 'geodirectory'). ' <i class="fa fa-plug"></i>', 'url' => 'http://wpgeodirectory.com', 'target' => '_blank');
1036
+	return $tabs;
1037 1037
 }
1038 1038
 
1039 1039
 
1040 1040
 if (!function_exists('geodir_edit_post_columns')) {
1041
-    /**
1042
-     * Modify admin post listing page columns.
1043
-     *
1044
-     * @since 1.0.0
1045
-     * @package GeoDirectory
1046
-     * @param array $columns The column array.
1047
-     * @return array Altered column array.
1048
-     */
1049
-    function geodir_edit_post_columns($columns)
1050
-    {
1051
-
1052
-        $new_columns = array('location' => __('Location (ID)', 'geodirectory'),
1053
-            'categorys' => __('Categories', 'geodirectory'));
1054
-
1055
-        if (($offset = array_search('author', array_keys($columns))) === false) // if the key doesn't exist
1056
-        {
1057
-            $offset = 0; // should we prepend $array with $data?
1058
-            $offset = count($columns); // or should we append $array with $data? lets pick this one...
1059
-        }
1041
+	/**
1042
+	 * Modify admin post listing page columns.
1043
+	 *
1044
+	 * @since 1.0.0
1045
+	 * @package GeoDirectory
1046
+	 * @param array $columns The column array.
1047
+	 * @return array Altered column array.
1048
+	 */
1049
+	function geodir_edit_post_columns($columns)
1050
+	{
1060 1051
 
1061
-        $columns = array_merge(array_slice($columns, 0, $offset), $new_columns, array_slice($columns, $offset));
1052
+		$new_columns = array('location' => __('Location (ID)', 'geodirectory'),
1053
+			'categorys' => __('Categories', 'geodirectory'));
1062 1054
 
1063
-        $columns = array_merge($columns, array('expire' => __('Expires', 'geodirectory')));
1055
+		if (($offset = array_search('author', array_keys($columns))) === false) // if the key doesn't exist
1056
+		{
1057
+			$offset = 0; // should we prepend $array with $data?
1058
+			$offset = count($columns); // or should we append $array with $data? lets pick this one...
1059
+		}
1064 1060
 
1065
-        return $columns;
1066
-    }
1061
+		$columns = array_merge(array_slice($columns, 0, $offset), $new_columns, array_slice($columns, $offset));
1062
+
1063
+		$columns = array_merge($columns, array('expire' => __('Expires', 'geodirectory')));
1064
+
1065
+		return $columns;
1066
+	}
1067 1067
 }
1068 1068
 
1069 1069
 
1070 1070
 if (!function_exists('geodir_manage_post_columns')) {
1071
-    /**
1072
-     * Adds content to our custom post listing page columns.
1073
-     *
1074
-     * @since 1.0.0
1075
-     * @package GeoDirectory
1076
-     * @global object $wpdb WordPress Database object.
1077
-     * @global object $post WordPress Post object.
1078
-     * @param string $column The column name.
1079
-     * @param int $post_id The post ID.
1080
-     */
1081
-    function geodir_manage_post_columns($column, $post_id)
1082
-    {
1083
-        global $post, $wpdb;
1084
-
1085
-        switch ($column):
1086
-            /* If displaying the 'city' column. */
1087
-            case 'location' :
1088
-                $location_id = geodir_get_post_meta($post->ID, 'post_location_id', true);
1089
-                $location = geodir_get_location($location_id);
1090
-                /* If no city is found, output a default message. */
1091
-                if (empty($location)) {
1092
-                    _e('Unknown', 'geodirectory');
1093
-                } else {
1094
-                    /* If there is a city id, append 'city name' to the text string. */
1095
-                    $add_location_id = $location_id > 0 ? ' (' . $location_id . ')' : '';
1096
-                    echo(__($location->country, 'geodirectory') . '-' . $location->region . '-' . $location->city . $add_location_id);
1097
-                }
1098
-                break;
1099
-
1100
-            /* If displaying the 'expire' column. */
1101
-            case 'expire' :
1102
-                $expire_date = geodir_get_post_meta($post->ID, 'expire_date', true);
1103
-                $d1 = $expire_date; // get expire_date
1104
-                $d2 = date('Y-m-d'); // get current date
1105
-                $state = __('days left', 'geodirectory');
1106
-                $date_diff_text = '';
1107
-                $expire_class = 'expire_left';
1108
-                if ($expire_date != 'Never') {
1109
-                    if (strtotime($d1) < strtotime($d2)) {
1110
-                        $state = __('days overdue', 'geodirectory');
1111
-                        $expire_class = 'expire_over';
1112
-                    }
1113
-                    $date_diff = round(abs(strtotime($d1) - strtotime($d2)) / 86400); // get the difference in days
1114
-                    $date_diff_text = '<br /><span class="' . $expire_class . '">(' . $date_diff . ' ' . $state . ')</span>';
1115
-                }
1116
-                /* If no expire_date is found, output a default message. */
1117
-                if (empty($expire_date))
1118
-                    echo __('Unknown', 'geodirectory');
1119
-                /* If there is a expire_date, append 'days left' to the text string. */
1120
-                else
1121
-                    echo $expire_date . $date_diff_text;
1122
-                break;
1123
-
1124
-            /* If displaying the 'categorys' column. */
1125
-            case 'categorys' :
1126
-
1127
-                /* Get the categorys for the post. */
1128
-
1129
-
1130
-                $terms = wp_get_object_terms($post_id, get_object_taxonomies($post));
1131
-
1132
-                /* If terms were found. */
1133
-                if (!empty($terms)) {
1134
-                    $out = array();
1135
-                    /* Loop through each term, linking to the 'edit posts' page for the specific term. */
1136
-                    foreach ($terms as $term) {
1137
-                        if (!strstr($term->taxonomy, 'tag')) {
1138
-                            $out[] = sprintf('<a href="%s">%s</a>',
1139
-                                esc_url(add_query_arg(array('post_type' => $post->post_type, $term->taxonomy => $term->slug), 'edit.php')),
1140
-                                esc_html(sanitize_term_field('name', $term->name, $term->term_id, $term->taxonomy, 'display'))
1141
-                            );
1142
-                        }
1143
-                    }
1144
-                    /* Join the terms, separating them with a comma. */
1145
-                    echo(join(', ', $out));
1146
-                } /* If no terms were found, output a default message. */
1147
-                else {
1148
-                    _e('No Categories', 'geodirectory');
1149
-                }
1150
-                break;
1071
+	/**
1072
+	 * Adds content to our custom post listing page columns.
1073
+	 *
1074
+	 * @since 1.0.0
1075
+	 * @package GeoDirectory
1076
+	 * @global object $wpdb WordPress Database object.
1077
+	 * @global object $post WordPress Post object.
1078
+	 * @param string $column The column name.
1079
+	 * @param int $post_id The post ID.
1080
+	 */
1081
+	function geodir_manage_post_columns($column, $post_id)
1082
+	{
1083
+		global $post, $wpdb;
1084
+
1085
+		switch ($column):
1086
+			/* If displaying the 'city' column. */
1087
+			case 'location' :
1088
+				$location_id = geodir_get_post_meta($post->ID, 'post_location_id', true);
1089
+				$location = geodir_get_location($location_id);
1090
+				/* If no city is found, output a default message. */
1091
+				if (empty($location)) {
1092
+					_e('Unknown', 'geodirectory');
1093
+				} else {
1094
+					/* If there is a city id, append 'city name' to the text string. */
1095
+					$add_location_id = $location_id > 0 ? ' (' . $location_id . ')' : '';
1096
+					echo(__($location->country, 'geodirectory') . '-' . $location->region . '-' . $location->city . $add_location_id);
1097
+				}
1098
+				break;
1099
+
1100
+			/* If displaying the 'expire' column. */
1101
+			case 'expire' :
1102
+				$expire_date = geodir_get_post_meta($post->ID, 'expire_date', true);
1103
+				$d1 = $expire_date; // get expire_date
1104
+				$d2 = date('Y-m-d'); // get current date
1105
+				$state = __('days left', 'geodirectory');
1106
+				$date_diff_text = '';
1107
+				$expire_class = 'expire_left';
1108
+				if ($expire_date != 'Never') {
1109
+					if (strtotime($d1) < strtotime($d2)) {
1110
+						$state = __('days overdue', 'geodirectory');
1111
+						$expire_class = 'expire_over';
1112
+					}
1113
+					$date_diff = round(abs(strtotime($d1) - strtotime($d2)) / 86400); // get the difference in days
1114
+					$date_diff_text = '<br /><span class="' . $expire_class . '">(' . $date_diff . ' ' . $state . ')</span>';
1115
+				}
1116
+				/* If no expire_date is found, output a default message. */
1117
+				if (empty($expire_date))
1118
+					echo __('Unknown', 'geodirectory');
1119
+				/* If there is a expire_date, append 'days left' to the text string. */
1120
+				else
1121
+					echo $expire_date . $date_diff_text;
1122
+				break;
1151 1123
 
1152
-        endswitch;
1153
-    }
1124
+			/* If displaying the 'categorys' column. */
1125
+			case 'categorys' :
1126
+
1127
+				/* Get the categorys for the post. */
1128
+
1129
+
1130
+				$terms = wp_get_object_terms($post_id, get_object_taxonomies($post));
1131
+
1132
+				/* If terms were found. */
1133
+				if (!empty($terms)) {
1134
+					$out = array();
1135
+					/* Loop through each term, linking to the 'edit posts' page for the specific term. */
1136
+					foreach ($terms as $term) {
1137
+						if (!strstr($term->taxonomy, 'tag')) {
1138
+							$out[] = sprintf('<a href="%s">%s</a>',
1139
+								esc_url(add_query_arg(array('post_type' => $post->post_type, $term->taxonomy => $term->slug), 'edit.php')),
1140
+								esc_html(sanitize_term_field('name', $term->name, $term->term_id, $term->taxonomy, 'display'))
1141
+							);
1142
+						}
1143
+					}
1144
+					/* Join the terms, separating them with a comma. */
1145
+					echo(join(', ', $out));
1146
+				} /* If no terms were found, output a default message. */
1147
+				else {
1148
+					_e('No Categories', 'geodirectory');
1149
+				}
1150
+				break;
1151
+
1152
+		endswitch;
1153
+	}
1154 1154
 }
1155 1155
 
1156 1156
 
1157 1157
 if (!function_exists('geodir_post_sortable_columns')) {
1158
-    /**
1159
-     * Makes admin post listing page columns sortable.
1160
-     *
1161
-     * @since 1.0.0
1162
-     * @package GeoDirectory
1163
-     * @param array $columns The column array.
1164
-     * @return array Altered column array.
1165
-     */
1166
-    function geodir_post_sortable_columns($columns)
1167
-    {
1168
-
1169
-        $columns['expire'] = 'expire';
1170
-
1171
-        return $columns;
1172
-    }
1158
+	/**
1159
+	 * Makes admin post listing page columns sortable.
1160
+	 *
1161
+	 * @since 1.0.0
1162
+	 * @package GeoDirectory
1163
+	 * @param array $columns The column array.
1164
+	 * @return array Altered column array.
1165
+	 */
1166
+	function geodir_post_sortable_columns($columns)
1167
+	{
1168
+
1169
+		$columns['expire'] = 'expire';
1170
+
1171
+		return $columns;
1172
+	}
1173 1173
 }
1174 1174
 
1175 1175
 /**
@@ -1183,32 +1183,32 @@  discard block
 block discarded – undo
1183 1183
  * @param int $post_id The post ID.
1184 1184
  */
1185 1185
 function geodir_post_information_save($post_id, $post) {
1186
-    global $wpdb, $current_user;
1186
+	global $wpdb, $current_user;
1187 1187
 
1188
-    if (isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')) {
1189
-        return;
1190
-    }
1188
+	if (isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')) {
1189
+		return;
1190
+	}
1191 1191
 
1192
-    $geodir_posttypes = geodir_get_posttypes();
1192
+	$geodir_posttypes = geodir_get_posttypes();
1193 1193
 
1194
-    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
1195
-        return;
1194
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
1195
+		return;
1196 1196
 
1197
-    if (!wp_is_post_revision($post_id) && isset($post->post_type) && in_array($post->post_type, $geodir_posttypes)) {
1198
-        if (isset($_REQUEST['_status']))
1199
-            geodir_change_post_status($post_id, $_REQUEST['_status']);
1197
+	if (!wp_is_post_revision($post_id) && isset($post->post_type) && in_array($post->post_type, $geodir_posttypes)) {
1198
+		if (isset($_REQUEST['_status']))
1199
+			geodir_change_post_status($post_id, $_REQUEST['_status']);
1200 1200
 
1201
-        if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'trash' || $_REQUEST['action'] == 'untrash'))
1202
-            return;
1201
+		if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'trash' || $_REQUEST['action'] == 'untrash'))
1202
+			return;
1203 1203
 
1204
-        if (!isset($_POST['geodir_post_info_noncename']) || !wp_verify_nonce($_POST['geodir_post_info_noncename'], plugin_basename(__FILE__)))
1205
-            return;
1204
+		if (!isset($_POST['geodir_post_info_noncename']) || !wp_verify_nonce($_POST['geodir_post_info_noncename'], plugin_basename(__FILE__)))
1205
+			return;
1206 1206
 
1207
-        if (!isset($_POST['geodir_post_attachments_noncename']) || !wp_verify_nonce($_POST['geodir_post_attachments_noncename'], plugin_basename(__FILE__)))
1208
-            return;
1207
+		if (!isset($_POST['geodir_post_attachments_noncename']) || !wp_verify_nonce($_POST['geodir_post_attachments_noncename'], plugin_basename(__FILE__)))
1208
+			return;
1209 1209
 
1210
-        geodir_save_listing($_REQUEST);
1211
-    }
1210
+		geodir_save_listing($_REQUEST);
1211
+	}
1212 1212
 }
1213 1213
 
1214 1214
 /**
@@ -1224,102 +1224,102 @@  discard block
 block discarded – undo
1224 1224
  */
1225 1225
 function geodir_admin_fields($options)
1226 1226
 {
1227
-    global $geodirectory;
1228
-
1229
-    $first_title = true;
1230
-    $tab_id = '';
1231
-    $i = 0;
1232
-    foreach ($options as $value) :
1233
-        if (!isset($value['name'])) $value['name'] = '';
1234
-        if (!isset($value['class'])) $value['class'] = '';
1235
-        if (!isset($value['css'])) $value['css'] = '';
1236
-        if (!isset($value['std'])) $value['std'] = '';
1237
-        $desc = '';
1238
-        switch ($value['type']) :
1239
-            case 'dummy_installer':
1240
-                $post_type = isset($value['post_type']) ? $value['post_type'] : 'gd_place';
1241
-                geodir_autoinstall_admin_header($post_type);
1242
-                break;
1243
-            case 'title':
1244
-
1245
-                if ($i == 0) {
1246
-                    echo '<dl id="geodir_oiption_tabs" class="gd-tab-head"></dl>';
1247
-                    echo '<div class="inner_content_tab_main">';
1248
-                }
1227
+	global $geodirectory;
1228
+
1229
+	$first_title = true;
1230
+	$tab_id = '';
1231
+	$i = 0;
1232
+	foreach ($options as $value) :
1233
+		if (!isset($value['name'])) $value['name'] = '';
1234
+		if (!isset($value['class'])) $value['class'] = '';
1235
+		if (!isset($value['css'])) $value['css'] = '';
1236
+		if (!isset($value['std'])) $value['std'] = '';
1237
+		$desc = '';
1238
+		switch ($value['type']) :
1239
+			case 'dummy_installer':
1240
+				$post_type = isset($value['post_type']) ? $value['post_type'] : 'gd_place';
1241
+				geodir_autoinstall_admin_header($post_type);
1242
+				break;
1243
+			case 'title':
1244
+
1245
+				if ($i == 0) {
1246
+					echo '<dl id="geodir_oiption_tabs" class="gd-tab-head"></dl>';
1247
+					echo '<div class="inner_content_tab_main">';
1248
+				}
1249 1249
 
1250
-                $i++;
1250
+				$i++;
1251 1251
 
1252
-                if (isset($value['id']) && $value['id'])
1253
-                    $tab_id = $value['id'];
1252
+				if (isset($value['id']) && $value['id'])
1253
+					$tab_id = $value['id'];
1254 1254
 
1255
-                if (isset($value['desc']) && $value['desc'])
1256
-                    $desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>';
1255
+				if (isset($value['desc']) && $value['desc'])
1256
+					$desc = '<span style=" text-transform:none;">:- ' . $value['desc'] . '</span>';
1257 1257
 
1258
-                if (isset($value['name']) && $value['name']) {
1259
-                    if ($first_title === true) {
1260
-                        $first_title = false;
1261
-                    } else {
1262
-                        echo '</div>';
1263
-                    }
1264
-                    echo '<dd id="' . trim($tab_id) . '" class="geodir_option_tabs" ><a href="javascript:void(0);">' . $value['name'] . '</a></dd>';
1258
+				if (isset($value['name']) && $value['name']) {
1259
+					if ($first_title === true) {
1260
+						$first_title = false;
1261
+					} else {
1262
+						echo '</div>';
1263
+					}
1264
+					echo '<dd id="' . trim($tab_id) . '" class="geodir_option_tabs" ><a href="javascript:void(0);">' . $value['name'] . '</a></dd>';
1265 1265
 
1266
-                    echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >';
1267
-                }
1266
+					echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >';
1267
+				}
1268 1268
 
1269
-                /**
1270
-                 * Called after a GeoDirectory settings title is output in the GD settings page.
1271
-                 *
1272
-                 * The action is called dynamically geodir_settings_$value['id'].
1273
-                 *
1274
-                 * @since 1.0.0
1275
-                 */
1276
-                do_action('geodir_settings_' . sanitize_title($value['id']));
1277
-                break;
1278
-
1279
-            case 'no_tabs':
1280
-
1281
-                echo '<div class="inner_content_tab_main">';
1282
-                echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >';
1283
-
1284
-                break;
1285
-
1286
-            case 'sectionstart':
1287
-                if (isset($value['desc']) && $value['desc'])
1288
-                    $desc = '<span style=" text-transform:none;"> - ' . $value['desc'] . '</span>';
1289
-                if (isset($value['name']) && $value['name'])
1290
-                    echo '<h3>' . $value['name'] . $desc . '</h3>';
1291
-                /**
1292
-                 * Called after a GeoDirectory settings sectionstart is output in the GD settings page.
1293
-                 *
1294
-                 * The action is called dynamically geodir_settings_$value['id']_start.
1295
-                 *
1296
-                 * @since 1.0.0
1297
-                 */
1298
-                if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_start');
1299
-                echo '<table class="form-table">' . "\n\n";
1300
-
1301
-                break;
1302
-            case 'sectionend':
1303
-                /**
1304
-                 * Called before a GeoDirectory settings sectionend is output in the GD settings page.
1305
-                 *
1306
-                 * The action is called dynamically geodir_settings_$value['id']_end.
1307
-                 *
1308
-                 * @since 1.0.0
1309
-                 */
1310
-                if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end');
1311
-                echo '</table>';
1312
-                /**
1313
-                 * Called after a GeoDirectory settings sectionend is output in the GD settings page.
1314
-                 *
1315
-                 * The action is called dynamically geodir_settings_$value['id']_end.
1316
-                 *
1317
-                 * @since 1.0.0
1318
-                 */
1319
-                if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after');
1320
-                break;
1321
-            case 'text':
1322
-                ?>
1269
+				/**
1270
+				 * Called after a GeoDirectory settings title is output in the GD settings page.
1271
+				 *
1272
+				 * The action is called dynamically geodir_settings_$value['id'].
1273
+				 *
1274
+				 * @since 1.0.0
1275
+				 */
1276
+				do_action('geodir_settings_' . sanitize_title($value['id']));
1277
+				break;
1278
+
1279
+			case 'no_tabs':
1280
+
1281
+				echo '<div class="inner_content_tab_main">';
1282
+				echo '<div id="sub_' . trim($tab_id) . '" class="gd-content-heading" style=" margin-bottom:10px;" >';
1283
+
1284
+				break;
1285
+
1286
+			case 'sectionstart':
1287
+				if (isset($value['desc']) && $value['desc'])
1288
+					$desc = '<span style=" text-transform:none;"> - ' . $value['desc'] . '</span>';
1289
+				if (isset($value['name']) && $value['name'])
1290
+					echo '<h3>' . $value['name'] . $desc . '</h3>';
1291
+				/**
1292
+				 * Called after a GeoDirectory settings sectionstart is output in the GD settings page.
1293
+				 *
1294
+				 * The action is called dynamically geodir_settings_$value['id']_start.
1295
+				 *
1296
+				 * @since 1.0.0
1297
+				 */
1298
+				if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_start');
1299
+				echo '<table class="form-table">' . "\n\n";
1300
+
1301
+				break;
1302
+			case 'sectionend':
1303
+				/**
1304
+				 * Called before a GeoDirectory settings sectionend is output in the GD settings page.
1305
+				 *
1306
+				 * The action is called dynamically geodir_settings_$value['id']_end.
1307
+				 *
1308
+				 * @since 1.0.0
1309
+				 */
1310
+				if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_end');
1311
+				echo '</table>';
1312
+				/**
1313
+				 * Called after a GeoDirectory settings sectionend is output in the GD settings page.
1314
+				 *
1315
+				 * The action is called dynamically geodir_settings_$value['id']_end.
1316
+				 *
1317
+				 * @since 1.0.0
1318
+				 */
1319
+				if (isset($value['id']) && $value['id']) do_action('geodir_settings_' . sanitize_title($value['id']) . '_after');
1320
+				break;
1321
+			case 'text':
1322
+				?>
1323 1323
                 <tr valign="top">
1324 1324
                 <th scope="row" class="titledesc"><?php echo $value['name']; ?></th>
1325 1325
                 <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>"
@@ -1328,15 +1328,15 @@  discard block
 block discarded – undo
1328 1328
                                            <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
1329 1329
                                            style=" <?php echo esc_attr($value['css']); ?>"
1330 1330
                                            value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
1331
-                                               echo esc_attr(stripslashes(get_option($value['id'])));
1332
-                                           } else {
1333
-                                               echo esc_attr($value['std']);
1334
-                                           } ?>"/> <span class="description"><?php echo $value['desc']; ?></span></td>
1331
+											   echo esc_attr(stripslashes(get_option($value['id'])));
1332
+										   } else {
1333
+											   echo esc_attr($value['std']);
1334
+										   } ?>"/> <span class="description"><?php echo $value['desc']; ?></span></td>
1335 1335
                 </tr><?php
1336
-                break;
1336
+				break;
1337 1337
 
1338
-            case 'password':
1339
-                ?>
1338
+			case 'password':
1339
+				?>
1340 1340
                 <tr valign="top">
1341 1341
                 <th scope="row" class="titledesc"><?php echo $value['name']; ?></th>
1342 1342
                 <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>"
@@ -1345,42 +1345,42 @@  discard block
 block discarded – undo
1345 1345
                                            <?php if(isset($value['placeholder'])){?>placeholder="<?php echo esc_attr($value['placeholder']); ?>"<?php }?>
1346 1346
                                            style="<?php echo esc_attr($value['css']); ?>"
1347 1347
                                            value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
1348
-                                               echo esc_attr(stripslashes(get_option($value['id'])));
1349
-                                           } else {
1350
-                                               echo esc_attr($value['std']);
1351
-                                           } ?>"/> <span class="description"><?php echo $value['desc']; ?></span></td>
1348
+											   echo esc_attr(stripslashes(get_option($value['id'])));
1349
+										   } else {
1350
+											   echo esc_attr($value['std']);
1351
+										   } ?>"/> <span class="description"><?php echo $value['desc']; ?></span></td>
1352 1352
                 </tr><?php
1353
-                break;
1353
+				break;
1354 1354
 
1355
-            case 'html_content':
1356
-                ?>
1355
+			case 'html_content':
1356
+				?>
1357 1357
                 <tr valign="top">
1358 1358
                 <th scope="row" class="titledesc"><?php echo $value['name']; ?></th>
1359 1359
                 <td class="forminp"><span class="description"><?php echo $value['desc']; ?></span></td>
1360 1360
                 </tr><?php
1361
-                break;
1361
+				break;
1362 1362
 
1363
-            case 'color' :
1364
-                ?>
1363
+			case 'color' :
1364
+				?>
1365 1365
                 <tr valign="top">
1366 1366
                 <th scope="row" class="titledesc"><?php echo $value['name']; ?></th>
1367 1367
                 <td class="forminp"><input name="<?php echo esc_attr($value['id']); ?>"
1368 1368
                                            id="<?php echo esc_attr($value['id']); ?>" type="text"
1369 1369
                                            style="<?php echo esc_attr($value['css']); ?>"
1370 1370
                                            value="<?php if (get_option($value['id']) !== false && get_option($value['id']) !== null) {
1371
-                                               echo esc_attr(stripslashes(get_option($value['id'])));
1372
-                                           } else {
1373
-                                               echo esc_attr($value['std']);
1374
-                                           } ?>" class="colorpick"/> <span
1371
+											   echo esc_attr(stripslashes(get_option($value['id'])));
1372
+										   } else {
1373
+											   echo esc_attr($value['std']);
1374
+										   } ?>" class="colorpick"/> <span
1375 1375
                         class="description"><?php echo $value['desc']; ?></span>
1376 1376
 
1377 1377
                     <div id="colorPickerDiv_<?php echo esc_attr($value['id']); ?>" class="colorpickdiv"
1378 1378
                          style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>
1379 1379
                 </td>
1380 1380
                 </tr><?php
1381
-                break;
1382
-            case 'image_width' :
1383
-                ?>
1381
+				break;
1382
+			case 'image_width' :
1383
+				?>
1384 1384
                 <tr valign="top">
1385 1385
                 <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1386 1386
                 <td class="forminp">
@@ -1402,11 +1402,11 @@  discard block
 block discarded – undo
1402 1402
 
1403 1403
                     <span class="description"><?php echo $value['desc'] ?></span></td>
1404 1404
                 </tr><?php
1405
-                break;
1406
-            case 'select':
1407
-                $option_value = get_option($value['id']);
1408
-                $option_value = !empty($option_value) ? stripslashes_deep($option_value) : $option_value;
1409
-                ?>
1405
+				break;
1406
+			case 'select':
1407
+				$option_value = get_option($value['id']);
1408
+				$option_value = !empty($option_value) ? stripslashes_deep($option_value) : $option_value;
1409
+				?>
1410 1410
                 <tr valign="top">
1411 1411
                 <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1412 1412
                 <td class="forminp"><select name="<?php echo esc_attr($value['id']); ?>"
@@ -1415,33 +1415,33 @@  discard block
 block discarded – undo
1415 1415
                                             class="<?php if (isset($value['class'])) echo $value['class']; ?>"
1416 1416
                                             option-ajaxchosen="false">
1417 1417
                         <?php
1418
-                        foreach ($value['options'] as $key => $val) {
1419
-                            $geodir_select_value = '';
1420
-                            if ($option_value != '') {
1421
-                                if ($option_value != '' && $option_value == $key)
1422
-                                    $geodir_select_value = ' selected="selected" ';
1423
-                            } else {
1424
-                                if ($value['std'] == $key)
1425
-                                    $geodir_select_value = ' selected="selected" ';
1426
-                            }
1427
-                            ?>
1418
+						foreach ($value['options'] as $key => $val) {
1419
+							$geodir_select_value = '';
1420
+							if ($option_value != '') {
1421
+								if ($option_value != '' && $option_value == $key)
1422
+									$geodir_select_value = ' selected="selected" ';
1423
+							} else {
1424
+								if ($value['std'] == $key)
1425
+									$geodir_select_value = ' selected="selected" ';
1426
+							}
1427
+							?>
1428 1428
                             <option
1429 1429
                                 value="<?php echo esc_attr($key); ?>" <?php echo $geodir_select_value; ?> ><?php echo ucfirst($val) ?></option>
1430 1430
                         <?php
1431
-                        }
1432
-                        ?>
1431
+						}
1432
+						?>
1433 1433
                     </select> <span class="description"><?php echo $value['desc'] ?></span>
1434 1434
                 </td>
1435 1435
                 </tr><?php
1436
-                break;
1436
+				break;
1437 1437
 
1438
-            case 'multiselect':
1439
-                $option_values = get_option($value['id']);
1440
-                if ($option_values === '' && !empty($value['std']) && is_array($value['std'])) {
1441
-                   $option_values = $value['std'];
1442
-                }
1443
-                $option_values = !empty($option_values) ? stripslashes_deep($option_values) : $option_values;
1444
-                ?>
1438
+			case 'multiselect':
1439
+				$option_values = get_option($value['id']);
1440
+				if ($option_values === '' && !empty($value['std']) && is_array($value['std'])) {
1441
+				   $option_values = $value['std'];
1442
+				}
1443
+				$option_values = !empty($option_values) ? stripslashes_deep($option_values) : $option_values;
1444
+				?>
1445 1445
                 <tr valign="top">
1446 1446
                 <th scope="row" class="titledesc"><?php echo $value['name']; ?></th>
1447 1447
                 <td class="forminp"><select multiple="multiple" name="<?php echo esc_attr($value['id']); ?>[]"
@@ -1451,25 +1451,25 @@  discard block
 block discarded – undo
1451 1451
                                             data-placeholder="<?php if (isset($value['placeholder_text'])) echo $value['placeholder_text'];?>"
1452 1452
                                             option-ajaxchosen="false">
1453 1453
                         <?php
1454
-                        foreach ($value['options'] as $key => $val) {
1455
-                            if (strpos($key, 'optgroup_start-') === 0) {
1456
-                                ?><optgroup label="<?php echo ucfirst($val); ?>"><?php
1457
-                            } else if (strpos($key, 'optgroup_end-') === 0) {
1458
-                                ?></optgroup><?php
1459
-                            } else {
1460
-                                ?>
1454
+						foreach ($value['options'] as $key => $val) {
1455
+							if (strpos($key, 'optgroup_start-') === 0) {
1456
+								?><optgroup label="<?php echo ucfirst($val); ?>"><?php
1457
+							} else if (strpos($key, 'optgroup_end-') === 0) {
1458
+								?></optgroup><?php
1459
+							} else {
1460
+								?>
1461 1461
                                 <option
1462 1462
                                     value="<?php echo esc_attr($key); ?>" <?php selected(true, (is_array($option_values) && in_array($key, $option_values)));?>><?php echo ucfirst($val) ?></option>
1463 1463
                             <?php
1464
-                            }
1465
-                        }
1466
-                        ?>
1464
+							}
1465
+						}
1466
+						?>
1467 1467
                     </select> <span class="description"><?php echo $value['desc'] ?></span>
1468 1468
                 </td>
1469 1469
                 </tr><?php
1470
-                break;
1471
-            case 'file':
1472
-                ?>
1470
+				break;
1471
+			case 'file':
1472
+				?>
1473 1473
                 <tr valign="top">
1474 1474
                 <th scope="row" class="titledesc"><?php echo $value['name']; ?></th>
1475 1475
                 <td class="forminp">
@@ -1489,87 +1489,87 @@  discard block
 block discarded – undo
1489 1489
                     <?php } ?>
1490 1490
                 </td>
1491 1491
                 </tr><?php
1492
-                break;
1493
-            case 'map_default_settings' :
1494
-                ?>
1492
+				break;
1493
+			case 'map_default_settings' :
1494
+				?>
1495 1495
 
1496 1496
                 <tr valign="top">
1497 1497
                     <th class="titledesc" width="40%"><?php _e('Default map language', 'geodirectory');?></th>
1498 1498
                     <td width="60%">
1499 1499
                         <select name="geodir_default_map_language" style="width:60%">
1500 1500
                             <?php
1501
-                            $arr_map_langages = array(
1502
-                                'ar' => __('ARABIC', 'geodirectory'),
1503
-                                'eu' => __('BASQUE', 'geodirectory'),
1504
-                                'bg' => __('BULGARIAN', 'geodirectory'),
1505
-                                'bn' => __('BENGALI', 'geodirectory'),
1506
-                                'ca' => __('CATALAN', 'geodirectory'),
1507
-                                'cs' => __('CZECH', 'geodirectory'),
1508
-                                'da' => __('DANISH', 'geodirectory'),
1509
-                                'de' => __('GERMAN', 'geodirectory'),
1510
-                                'el' => __('GREEK', 'geodirectory'),
1511
-                                'en' => __('ENGLISH', 'geodirectory'),
1512
-                                'en-AU' => __('ENGLISH (AUSTRALIAN)', 'geodirectory'),
1513
-                                'en-GB' => __('ENGLISH (GREAT BRITAIN)', 'geodirectory'),
1514
-                                'es' => __('SPANISH', 'geodirectory'),
1515
-                                'eu' => __('BASQUE', 'geodirectory'),
1516
-                                'fa' => __('FARSI', 'geodirectory'),
1517
-                                'fi' => __('FINNISH', 'geodirectory'),
1518
-                                'fil' => __('FILIPINO', 'geodirectory'),
1519
-                                'fr' => __('FRENCH', 'geodirectory'),
1520
-                                'gl' => __('GALICIAN', 'geodirectory'),
1521
-                                'gu' => __('GUJARATI', 'geodirectory'),
1522
-                                'hi' => __('HINDI', 'geodirectory'),
1523
-                                'hr' => __('CROATIAN', 'geodirectory'),
1524
-                                'hu' => __('HUNGARIAN', 'geodirectory'),
1525
-                                'id' => __('INDONESIAN', 'geodirectory'),
1526
-                                'it' => __('ITALIAN', 'geodirectory'),
1527
-                                'iw' => __('HEBREW', 'geodirectory'),
1528
-                                'ja' => __('JAPANESE', 'geodirectory'),
1529
-                                'kn' => __('KANNADA', 'geodirectory'),
1530
-                                'ko' => __('KOREAN', 'geodirectory'),
1531
-                                'lt' => __('LITHUANIAN', 'geodirectory'),
1532
-                                'lv' => __('LATVIAN', 'geodirectory'),
1533
-                                'ml' => __('MALAYALAM', 'geodirectory'),
1534
-                                'mr' => __('MARATHI', 'geodirectory'),
1535
-                                'nl' => __('DUTCH', 'geodirectory'),
1536
-                                'no' => __('NORWEGIAN', 'geodirectory'),
1537
-                                'pl' => __('POLISH', 'geodirectory'),
1538
-                                'pt' => __('PORTUGUESE', 'geodirectory'),
1539
-                                'pt-BR' => __('PORTUGUESE (BRAZIL)', 'geodirectory'),
1540
-                                'pt-PT' => __('PORTUGUESE (PORTUGAL)', 'geodirectory'),
1541
-                                'ro' => __('ROMANIAN', 'geodirectory'),
1542
-                                'ru' => __('RUSSIAN', 'geodirectory'),
1543
-                                'ru' => __('RUSSIAN', 'geodirectory'),
1544
-                                'sk' => __('SLOVAK', 'geodirectory'),
1545
-                                'sl' => __('SLOVENIAN', 'geodirectory'),
1546
-                                'sr' => __('SERBIAN', 'geodirectory'),
1547
-                                'sv' => __('	SWEDISH', 'geodirectory'),
1548
-                                'tl' => __('TAGALOG', 'geodirectory'),
1549
-                                'ta' => __('TAMIL', 'geodirectory'),
1550
-                                'te' => __('TELUGU', 'geodirectory'),
1551
-                                'th' => __('THAI', 'geodirectory'),
1552
-                                'tr' => __('TURKISH', 'geodirectory'),
1553
-                                'uk' => __('UKRAINIAN', 'geodirectory'),
1554
-                                'vi' => __('VIETNAMESE', 'geodirectory'),
1555
-                                'zh-CN' => __('CHINESE (SIMPLIFIED)', 'geodirectory'),
1556
-                                'zh-TW' => __('CHINESE (TRADITIONAL)', 'geodirectory'),
1557
-                            );
1558
-                            $geodir_default_map_language = get_option('geodir_default_map_language');
1559
-                            if (empty($geodir_default_map_language))
1560
-                                $geodir_default_map_language = 'en';
1561
-                            foreach ($arr_map_langages as $language_key => $language_txt) {
1562
-                                if (!empty($geodir_default_map_language) && $language_key == $geodir_default_map_language)
1563
-                                    $geodir_default_language_selected = "selected='selected'";
1564
-                                else
1565
-                                    $geodir_default_language_selected = '';
1566
-
1567
-                                ?>
1501
+							$arr_map_langages = array(
1502
+								'ar' => __('ARABIC', 'geodirectory'),
1503
+								'eu' => __('BASQUE', 'geodirectory'),
1504
+								'bg' => __('BULGARIAN', 'geodirectory'),
1505
+								'bn' => __('BENGALI', 'geodirectory'),
1506
+								'ca' => __('CATALAN', 'geodirectory'),
1507
+								'cs' => __('CZECH', 'geodirectory'),
1508
+								'da' => __('DANISH', 'geodirectory'),
1509
+								'de' => __('GERMAN', 'geodirectory'),
1510
+								'el' => __('GREEK', 'geodirectory'),
1511
+								'en' => __('ENGLISH', 'geodirectory'),
1512
+								'en-AU' => __('ENGLISH (AUSTRALIAN)', 'geodirectory'),
1513
+								'en-GB' => __('ENGLISH (GREAT BRITAIN)', 'geodirectory'),
1514
+								'es' => __('SPANISH', 'geodirectory'),
1515
+								'eu' => __('BASQUE', 'geodirectory'),
1516
+								'fa' => __('FARSI', 'geodirectory'),
1517
+								'fi' => __('FINNISH', 'geodirectory'),
1518
+								'fil' => __('FILIPINO', 'geodirectory'),
1519
+								'fr' => __('FRENCH', 'geodirectory'),
1520
+								'gl' => __('GALICIAN', 'geodirectory'),
1521
+								'gu' => __('GUJARATI', 'geodirectory'),
1522
+								'hi' => __('HINDI', 'geodirectory'),
1523
+								'hr' => __('CROATIAN', 'geodirectory'),
1524
+								'hu' => __('HUNGARIAN', 'geodirectory'),
1525
+								'id' => __('INDONESIAN', 'geodirectory'),
1526
+								'it' => __('ITALIAN', 'geodirectory'),
1527
+								'iw' => __('HEBREW', 'geodirectory'),
1528
+								'ja' => __('JAPANESE', 'geodirectory'),
1529
+								'kn' => __('KANNADA', 'geodirectory'),
1530
+								'ko' => __('KOREAN', 'geodirectory'),
1531
+								'lt' => __('LITHUANIAN', 'geodirectory'),
1532
+								'lv' => __('LATVIAN', 'geodirectory'),
1533
+								'ml' => __('MALAYALAM', 'geodirectory'),
1534
+								'mr' => __('MARATHI', 'geodirectory'),
1535
+								'nl' => __('DUTCH', 'geodirectory'),
1536
+								'no' => __('NORWEGIAN', 'geodirectory'),
1537
+								'pl' => __('POLISH', 'geodirectory'),
1538
+								'pt' => __('PORTUGUESE', 'geodirectory'),
1539
+								'pt-BR' => __('PORTUGUESE (BRAZIL)', 'geodirectory'),
1540
+								'pt-PT' => __('PORTUGUESE (PORTUGAL)', 'geodirectory'),
1541
+								'ro' => __('ROMANIAN', 'geodirectory'),
1542
+								'ru' => __('RUSSIAN', 'geodirectory'),
1543
+								'ru' => __('RUSSIAN', 'geodirectory'),
1544
+								'sk' => __('SLOVAK', 'geodirectory'),
1545
+								'sl' => __('SLOVENIAN', 'geodirectory'),
1546
+								'sr' => __('SERBIAN', 'geodirectory'),
1547
+								'sv' => __('	SWEDISH', 'geodirectory'),
1548
+								'tl' => __('TAGALOG', 'geodirectory'),
1549
+								'ta' => __('TAMIL', 'geodirectory'),
1550
+								'te' => __('TELUGU', 'geodirectory'),
1551
+								'th' => __('THAI', 'geodirectory'),
1552
+								'tr' => __('TURKISH', 'geodirectory'),
1553
+								'uk' => __('UKRAINIAN', 'geodirectory'),
1554
+								'vi' => __('VIETNAMESE', 'geodirectory'),
1555
+								'zh-CN' => __('CHINESE (SIMPLIFIED)', 'geodirectory'),
1556
+								'zh-TW' => __('CHINESE (TRADITIONAL)', 'geodirectory'),
1557
+							);
1558
+							$geodir_default_map_language = get_option('geodir_default_map_language');
1559
+							if (empty($geodir_default_map_language))
1560
+								$geodir_default_map_language = 'en';
1561
+							foreach ($arr_map_langages as $language_key => $language_txt) {
1562
+								if (!empty($geodir_default_map_language) && $language_key == $geodir_default_map_language)
1563
+									$geodir_default_language_selected = "selected='selected'";
1564
+								else
1565
+									$geodir_default_language_selected = '';
1566
+
1567
+								?>
1568 1568
                                 <option
1569 1569
                                     value="<?php echo $language_key?>" <?php echo $geodir_default_language_selected; ?>><?php echo $language_txt; ?></option>
1570 1570
 
1571 1571
                             <?php }
1572
-                            ?>
1572
+							?>
1573 1573
                         </select>
1574 1574
                     </td>
1575 1575
                 </tr>
@@ -1580,46 +1580,46 @@  discard block
 block discarded – undo
1580 1580
                     <td width="60%">
1581 1581
                         <select name="geodir_default_map_search_pt" style="width:60%">
1582 1582
                             <?php
1583
-                            $post_types = geodir_get_posttypes('array');
1584
-                            $geodir_default_map_search_pt = get_option('geodir_default_map_search_pt');
1585
-                            if (empty($geodir_default_map_search_pt))
1586
-                                $geodir_default_map_search_pt = 'gd_place';
1587
-                            if (is_array($post_types)) {
1588
-                                foreach ($post_types as $key => $post_types_obj) {
1589
-                                    if (!empty($geodir_default_map_search_pt) && $key == $geodir_default_map_search_pt)
1590
-                                        $geodir_search_pt_selected = "selected='selected'";
1591
-                                    else
1592
-                                        $geodir_search_pt_selected = '';
1593
-
1594
-                                    ?>
1583
+							$post_types = geodir_get_posttypes('array');
1584
+							$geodir_default_map_search_pt = get_option('geodir_default_map_search_pt');
1585
+							if (empty($geodir_default_map_search_pt))
1586
+								$geodir_default_map_search_pt = 'gd_place';
1587
+							if (is_array($post_types)) {
1588
+								foreach ($post_types as $key => $post_types_obj) {
1589
+									if (!empty($geodir_default_map_search_pt) && $key == $geodir_default_map_search_pt)
1590
+										$geodir_search_pt_selected = "selected='selected'";
1591
+									else
1592
+										$geodir_search_pt_selected = '';
1593
+
1594
+									?>
1595 1595
                                     <option
1596 1596
                                         value="<?php echo $key?>" <?php echo $geodir_search_pt_selected; ?>><?php echo $post_types_obj['labels']['singular_name']; ?></option>
1597 1597
 
1598 1598
                                 <?php }
1599 1599
 
1600
-                            }
1600
+							}
1601 1601
 
1602
-                            ?>
1602
+							?>
1603 1603
                         </select>
1604 1604
                     </td>
1605 1605
                 </tr>
1606 1606
 
1607 1607
                 <?php
1608
-                break;
1608
+				break;
1609 1609
 
1610
-            case 'map':
1611
-                ?>
1610
+			case 'map':
1611
+				?>
1612 1612
                 <tr valign="top">
1613 1613
                     <td class="forminp">
1614 1614
                         <?php
1615
-                        global $post_cat, $cat_display;
1616
-                        $post_types = geodir_get_posttypes('object');
1617
-                        $cat_display = 'checkbox';
1618
-                        $gd_post_types = get_option('geodir_exclude_post_type_on_map');
1619
-                        $gd_cats = get_option('geodir_exclude_cat_on_map');
1620
-                        $gd_cats_upgrade = (int)get_option('geodir_exclude_cat_on_map_upgrade');
1621
-                        $count = 1;
1622
-                        ?>
1615
+						global $post_cat, $cat_display;
1616
+						$post_types = geodir_get_posttypes('object');
1617
+						$cat_display = 'checkbox';
1618
+						$gd_post_types = get_option('geodir_exclude_post_type_on_map');
1619
+						$gd_cats = get_option('geodir_exclude_cat_on_map');
1620
+						$gd_cats_upgrade = (int)get_option('geodir_exclude_cat_on_map_upgrade');
1621
+						$count = 1;
1622
+						?>
1623 1623
                         <table width="70%" class="widefat">
1624 1624
                             <thead>
1625 1625
                             <tr>
@@ -1628,18 +1628,18 @@  discard block
 block discarded – undo
1628 1628
                                 <th><b><?php echo DESIGN_POST_TYPE_CAT; ?></b></th>
1629 1629
                             </tr>
1630 1630
                             <?php
1631
-                            $gd_categs = $gd_cats;
1632
-                            foreach ($post_types as $key => $post_types_obj) :
1633
-                                $checked = is_array($gd_post_types) && in_array($key, $gd_post_types) ? 'checked="checked"' : '';
1634
-                                $gd_taxonomy = geodir_get_taxonomies($key);
1635
-                                if ($gd_cats_upgrade) {
1636
-                                    $gd_cat_taxonomy = isset($gd_taxonomy[0]) ? $gd_taxonomy[0] : '';
1637
-                                    $gd_cats = isset($gd_categs[$gd_cat_taxonomy]) ? $gd_categs[$gd_cat_taxonomy] : array();
1638
-                                    $gd_cats = !empty($gd_cats) && is_array($gd_cats) ? array_unique($gd_cats) : array();
1639
-                                }
1640
-                                $post_cat = implode(',', $gd_cats);
1641
-                                $gd_taxonomy_list = geodir_custom_taxonomy_walker($gd_taxonomy);
1642
-                                ?>
1631
+							$gd_categs = $gd_cats;
1632
+							foreach ($post_types as $key => $post_types_obj) :
1633
+								$checked = is_array($gd_post_types) && in_array($key, $gd_post_types) ? 'checked="checked"' : '';
1634
+								$gd_taxonomy = geodir_get_taxonomies($key);
1635
+								if ($gd_cats_upgrade) {
1636
+									$gd_cat_taxonomy = isset($gd_taxonomy[0]) ? $gd_taxonomy[0] : '';
1637
+									$gd_cats = isset($gd_categs[$gd_cat_taxonomy]) ? $gd_categs[$gd_cat_taxonomy] : array();
1638
+									$gd_cats = !empty($gd_cats) && is_array($gd_cats) ? array_unique($gd_cats) : array();
1639
+								}
1640
+								$post_cat = implode(',', $gd_cats);
1641
+								$gd_taxonomy_list = geodir_custom_taxonomy_walker($gd_taxonomy);
1642
+								?>
1643 1643
                                 <tr>
1644 1644
                                     <td valign="top" width="5%"><?php echo $count; ?></td>
1645 1645
                                     <td valign="top" width="25%" id="td_post_types"><input type="checkbox"
@@ -1660,19 +1660,19 @@  discard block
 block discarded – undo
1660 1660
                     </td>
1661 1661
                 </tr>
1662 1662
                 <?php
1663
-                break;
1663
+				break;
1664 1664
 
1665
-            case 'checkbox' :
1665
+			case 'checkbox' :
1666 1666
 
1667
-                if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup'] == 'start')) :
1668
-                    ?>
1667
+				if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup'] == 'start')) :
1668
+					?>
1669 1669
                     <tr valign="top">
1670 1670
                     <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1671 1671
                     <td class="forminp">
1672 1672
                 <?php
1673
-                endif;
1673
+				endif;
1674 1674
 
1675
-                ?>
1675
+				?>
1676 1676
                 <fieldset>
1677 1677
                     <legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend>
1678 1678
                     <label for="<?php echo $value['id'] ?>">
@@ -1682,49 +1682,49 @@  discard block
 block discarded – undo
1682 1682
                 </fieldset>
1683 1683
                 <?php
1684 1684
 
1685
-                if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup'] == 'end')) :
1686
-                    ?>
1685
+				if (!isset($value['checkboxgroup']) || (isset($value['checkboxgroup']) && $value['checkboxgroup'] == 'end')) :
1686
+					?>
1687 1687
                     </td>
1688 1688
                     </tr>
1689 1689
                 <?php
1690
-                endif;
1690
+				endif;
1691 1691
 
1692
-                break;
1692
+				break;
1693 1693
 
1694
-            case 'radio' :
1694
+			case 'radio' :
1695 1695
 
1696
-                if (!isset($value['radiogroup']) || (isset($value['radiogroup']) && $value['radiogroup'] == 'start')) :
1697
-                    ?>
1696
+				if (!isset($value['radiogroup']) || (isset($value['radiogroup']) && $value['radiogroup'] == 'start')) :
1697
+					?>
1698 1698
                     <tr valign="top">
1699 1699
                     <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1700 1700
                     <td class="forminp">
1701 1701
                 <?php
1702
-                endif;
1702
+				endif;
1703 1703
 
1704
-                ?>
1704
+				?>
1705 1705
                 <fieldset>
1706 1706
                     <legend class="screen-reader-text"><span><?php echo $value['name'] ?></span></legend>
1707 1707
                     <label for="<?php echo $value['id'];?>">
1708 1708
                         <input name="<?php echo esc_attr($value['id']); ?>"
1709 1709
                                id="<?php echo esc_attr($value['id'] . $value['value']); ?>" type="radio"
1710 1710
                                value="<?php echo $value['value'] ?>" <?php if (get_option($value['id']) == $value['value']) {
1711
-                            echo 'checked="checked"';
1712
-                        }elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> />
1711
+							echo 'checked="checked"';
1712
+						}elseif(get_option($value['id'])=='' && $value['std']==$value['value']){echo 'checked="checked"';} ?> />
1713 1713
                         <?php echo $value['desc']; ?></label><br>
1714 1714
                 </fieldset>
1715 1715
                 <?php
1716 1716
 
1717
-                if (!isset($value['radiogroup']) || (isset($value['radiogroup']) && $value['radiogroup'] == 'end')) :
1718
-                    ?>
1717
+				if (!isset($value['radiogroup']) || (isset($value['radiogroup']) && $value['radiogroup'] == 'end')) :
1718
+					?>
1719 1719
                     </td>
1720 1720
                     </tr>
1721 1721
                 <?php
1722
-                endif;
1722
+				endif;
1723 1723
 
1724
-                break;
1724
+				break;
1725 1725
 
1726
-            case 'textarea':
1727
-                ?>
1726
+			case 'textarea':
1727
+				?>
1728 1728
                 <tr valign="top">
1729 1729
                 <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1730 1730
                 <td class="forminp">
@@ -1737,30 +1737,30 @@  discard block
 block discarded – undo
1737 1737
 
1738 1738
                 </td>
1739 1739
                 </tr><?php
1740
-                break;
1740
+				break;
1741 1741
 
1742
-            case 'editor':
1743
-                ?>
1742
+			case 'editor':
1743
+				?>
1744 1744
                 <tr valign="top">
1745 1745
                 <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1746 1746
                 <td class="forminp"><?php
1747
-                    if (get_option($value['id']))
1748
-                        $content = stripslashes(get_option($value['id']));
1749
-                    else
1750
-                        $content = $value['std'];
1747
+					if (get_option($value['id']))
1748
+						$content = stripslashes(get_option($value['id']));
1749
+					else
1750
+						$content = $value['std'];
1751 1751
 
1752
-                    $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
1752
+					$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
1753 1753
 
1754
-                    wp_editor($content, esc_attr($value['id']), $editor_settings);
1754
+					wp_editor($content, esc_attr($value['id']), $editor_settings);
1755 1755
 
1756
-                    ?> <span class="description"><?php echo $value['desc'] ?></span>
1756
+					?> <span class="description"><?php echo $value['desc'] ?></span>
1757 1757
 
1758 1758
                 </td>
1759 1759
                 </tr><?php
1760
-                break;
1760
+				break;
1761 1761
 
1762
-            case 'single_select_page' :
1763
-                // WPML
1762
+			case 'single_select_page' :
1763
+				// WPML
1764 1764
 				$switch_lang = false;
1765 1765
 				$disabled = '';
1766 1766
 				if (geodir_is_wpml() && isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'permalink_settings') {
@@ -1778,18 +1778,18 @@  discard block
 block discarded – undo
1778 1778
 				//
1779 1779
 				$page_setting = (int)get_option($value['id']);
1780 1780
 
1781
-                $args = array('name' => $value['id'],
1782
-                    'id' => $value['id'],
1783
-                    'sort_column' => 'menu_order',
1784
-                    'sort_order' => 'ASC',
1785
-                    'show_option_none' => ' ',
1786
-                    'class' => $value['class'],
1787
-                    'echo' => false,
1788
-                    'selected' => $page_setting);
1781
+				$args = array('name' => $value['id'],
1782
+					'id' => $value['id'],
1783
+					'sort_column' => 'menu_order',
1784
+					'sort_order' => 'ASC',
1785
+					'show_option_none' => ' ',
1786
+					'class' => $value['class'],
1787
+					'echo' => false,
1788
+					'selected' => $page_setting);
1789 1789
 
1790
-                if (isset($value['args'])) $args = wp_parse_args($value['args'], $args);
1790
+				if (isset($value['args'])) $args = wp_parse_args($value['args'], $args);
1791 1791
 
1792
-                ?>
1792
+				?>
1793 1793
                 <tr valign="top" class="single_select_page">
1794 1794
                 <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1795 1795
                 <td class="forminp">
@@ -1800,17 +1800,17 @@  discard block
 block discarded – undo
1800 1800
 				if ($switch_lang) {
1801 1801
 					$sitepress->switch_lang($switch_lang, true);
1802 1802
 				}
1803
-                break;
1804
-            case 'single_select_country' :
1805
-                $country_setting = (string)get_option($value['id']);
1806
-                if (strstr($country_setting, ':')) :
1807
-                    $country = current(explode(':', $country_setting));
1808
-                    $state = end(explode(':', $country_setting));
1809
-                else :
1810
-                    $country = $country_setting;
1811
-                    $state = '*';
1812
-                endif;
1813
-                ?>
1803
+				break;
1804
+			case 'single_select_country' :
1805
+				$country_setting = (string)get_option($value['id']);
1806
+				if (strstr($country_setting, ':')) :
1807
+					$country = current(explode(':', $country_setting));
1808
+					$state = end(explode(':', $country_setting));
1809
+				else :
1810
+					$country = $country_setting;
1811
+					$state = '*';
1812
+				endif;
1813
+				?>
1814 1814
                 <tr valign="top">
1815 1815
                 <th scope="rpw" class="titledesc"><?php echo $value['name'] ?></th>
1816 1816
                 <td class="forminp"><select name="<?php echo esc_attr($value['id']); ?>"
@@ -1821,12 +1821,12 @@  discard block
 block discarded – undo
1821 1821
                     </select> <span class="description"><?php echo $value['desc'] ?></span>
1822 1822
                 </td>
1823 1823
                 </tr><?php
1824
-                break;
1825
-            case 'multi_select_countries' :
1826
-                $countries = $geodirectory->countries->countries;
1827
-                asort($countries);
1828
-                $selections = (array)get_option($value['id']);
1829
-                ?>
1824
+				break;
1825
+			case 'multi_select_countries' :
1826
+				$countries = $geodirectory->countries->countries;
1827
+				asort($countries);
1828
+				$selections = (array)get_option($value['id']);
1829
+				?>
1830 1830
                 <tr valign="top">
1831 1831
                 <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1832 1832
                 <td class="forminp">
@@ -1834,22 +1834,22 @@  discard block
 block discarded – undo
1834 1834
                             data-placeholder="<?php _e('Choose countries&hellip;', 'geodirectory'); ?>"
1835 1835
                             title="Country" class="chosen_select">
1836 1836
                         <?php
1837
-                        if ($countries) foreach ($countries as $key => $val) :
1838
-                            echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>';
1839
-                        endforeach;
1840
-                        ?>
1837
+						if ($countries) foreach ($countries as $key => $val) :
1838
+							echo '<option value="' . $key . '" ' . selected(in_array($key, $selections), true, false) . '>' . $val . '</option>';
1839
+						endforeach;
1840
+						?>
1841 1841
                     </select>
1842 1842
                 </td>
1843 1843
                 </tr>
1844 1844
 
1845 1845
                 <?php
1846 1846
 
1847
-                break;
1847
+				break;
1848 1848
 
1849
-            case 'google_analytics' :
1850
-                $selections = (array)get_option($value['id']);
1851
-                if(get_option('geodir_ga_client_id') && get_option('geodir_ga_client_secret') ) {
1852
-                    ?>
1849
+			case 'google_analytics' :
1850
+				$selections = (array)get_option($value['id']);
1851
+				if(get_option('geodir_ga_client_id') && get_option('geodir_ga_client_secret') ) {
1852
+					?>
1853 1853
                     <tr valign="top">
1854 1854
                         <th scope="row" class="titledesc"><?php echo $value['name'] ?></th>
1855 1855
                         <td class="forminp">
@@ -1857,19 +1857,19 @@  discard block
 block discarded – undo
1857 1857
 
1858 1858
                             <?php
1859 1859
 
1860
-                            $oAuthURL = "https://accounts.google.com/o/oauth2/auth?";
1861
-                            $scope = "scope=https://www.googleapis.com/auth/analytics.readonly";
1862
-                            $state = "&state=123";//any string
1863
-                            $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
1864
-                            $response_type = "&response_type=code";
1865
-                            $client_id = "&client_id=".get_option('geodir_ga_client_id');
1866
-                            $access_type = "&access_type=offline";
1867
-                            $approval_prompt = "&approval_prompt=force";
1860
+							$oAuthURL = "https://accounts.google.com/o/oauth2/auth?";
1861
+							$scope = "scope=https://www.googleapis.com/auth/analytics.readonly";
1862
+							$state = "&state=123";//any string
1863
+							$redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
1864
+							$response_type = "&response_type=code";
1865
+							$client_id = "&client_id=".get_option('geodir_ga_client_id');
1866
+							$access_type = "&access_type=offline";
1867
+							$approval_prompt = "&approval_prompt=force";
1868 1868
 
1869
-                            $auth_url = $oAuthURL . $scope . $state . $redirect_uri . $response_type . $client_id . $access_type . $approval_prompt;
1869
+							$auth_url = $oAuthURL . $scope . $state . $redirect_uri . $response_type . $client_id . $access_type . $approval_prompt;
1870 1870
 
1871 1871
 
1872
-                            ?>
1872
+							?>
1873 1873
                             <script>
1874 1874
                                 function gd_ga_popup() {
1875 1875
                                     var win = window.open("<?php echo $auth_url;?>", "Google Analytics", "");
@@ -1884,47 +1884,47 @@  discard block
 block discarded – undo
1884 1884
                             </script>
1885 1885
 
1886 1886
                             <?php
1887
-                            if (get_option('gd_ga_refresh_token')) {
1888
-                                ?>
1887
+							if (get_option('gd_ga_refresh_token')) {
1888
+								?>
1889 1889
                                 <span class="button-primary"
1890 1890
                                       onclick="gd_ga_popup();"><?php _e('Re-authorize', 'geodirectory'); ?></span>
1891 1891
                                 <span
1892 1892
                                     style="color: green; font-weight: bold;"><?php _e('Authorized', 'geodirectory'); ?></span>
1893 1893
                             <?php
1894
-                            } else {
1895
-                                ?>
1894
+							} else {
1895
+								?>
1896 1896
                                 <span class="button-primary"
1897 1897
                                       onclick="gd_ga_popup();"><?php _e('Authorize', 'geodirectory');?></span>
1898 1898
                             <?php
1899
-                            }
1900
-                            ?>
1899
+							}
1900
+							?>
1901 1901
                         </td>
1902 1902
                     </tr>
1903 1903
 
1904 1904
                 <?php
1905
-                }
1905
+				}
1906 1906
 
1907
-                break;
1907
+				break;
1908 1908
 
1909
-            case 'field_seperator' :
1909
+			case 'field_seperator' :
1910 1910
 
1911
-                ?>
1911
+				?>
1912 1912
                 <tr valign="top">
1913 1913
                     <td colspan="2" class="forminp geodir_line_seperator"></td>
1914 1914
                 </tr>
1915 1915
                 <?php
1916 1916
 
1917
-                break;
1917
+				break;
1918 1918
 
1919
-        endswitch;
1919
+		endswitch;
1920 1920
 
1921
-    endforeach;
1921
+	endforeach;
1922 1922
 
1923
-    if ($first_title === false) {
1924
-        echo "</div>";
1925
-    }
1923
+	if ($first_title === false) {
1924
+		echo "</div>";
1925
+	}
1926 1926
 
1927
-    ?>
1927
+	?>
1928 1928
 
1929 1929
     <script type="text/javascript">
1930 1930
 
@@ -1984,33 +1984,33 @@  discard block
 block discarded – undo
1984 1984
  */
1985 1985
 function geodir_post_info_setting()
1986 1986
 {
1987
-    global $post, $post_id;
1988
-
1989
-    $post_type = get_post_type();
1990
-
1991
-    $package_info = array();
1992
-
1993
-    $package_info = geodir_post_package_info($package_info, $post, $post_type);
1994
-    wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_info_noncename');
1995
-    echo '<div id="geodir_wrapper">';
1996
-    /**
1997
-     * Called before the GD custom fields are output in the wp-admin area.
1998
-     *
1999
-     * @since 1.0.0
2000
-     * @see 'geodir_after_default_field_in_meta_box'
2001
-     */
2002
-    do_action('geodir_before_default_field_in_meta_box');
2003
-    //geodir_get_custom_fields_html($package_info->pid,'default',$post_type);
2004
-    // to display all fields in one information box
2005
-    geodir_get_custom_fields_html($package_info->pid, 'all', $post_type);
2006
-    /**
2007
-     * Called after the GD custom fields are output in the wp-admin area.
2008
-     *
2009
-     * @since 1.0.0
2010
-     * @see 'geodir_before_default_field_in_meta_box'
2011
-     */
2012
-    do_action('geodir_after_default_field_in_meta_box');
2013
-    echo '</div>';
1987
+	global $post, $post_id;
1988
+
1989
+	$post_type = get_post_type();
1990
+
1991
+	$package_info = array();
1992
+
1993
+	$package_info = geodir_post_package_info($package_info, $post, $post_type);
1994
+	wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_info_noncename');
1995
+	echo '<div id="geodir_wrapper">';
1996
+	/**
1997
+	 * Called before the GD custom fields are output in the wp-admin area.
1998
+	 *
1999
+	 * @since 1.0.0
2000
+	 * @see 'geodir_after_default_field_in_meta_box'
2001
+	 */
2002
+	do_action('geodir_before_default_field_in_meta_box');
2003
+	//geodir_get_custom_fields_html($package_info->pid,'default',$post_type);
2004
+	// to display all fields in one information box
2005
+	geodir_get_custom_fields_html($package_info->pid, 'all', $post_type);
2006
+	/**
2007
+	 * Called after the GD custom fields are output in the wp-admin area.
2008
+	 *
2009
+	 * @since 1.0.0
2010
+	 * @see 'geodir_before_default_field_in_meta_box'
2011
+	 */
2012
+	do_action('geodir_after_default_field_in_meta_box');
2013
+	echo '</div>';
2014 2014
 }
2015 2015
 
2016 2016
 /**
@@ -2023,18 +2023,18 @@  discard block
 block discarded – undo
2023 2023
  */
2024 2024
 function geodir_post_addinfo_setting()
2025 2025
 {
2026
-    global $post, $post_id;
2026
+	global $post, $post_id;
2027 2027
 
2028
-    $post_type = get_post_type();
2028
+	$post_type = get_post_type();
2029 2029
 
2030
-    $package_info = array();
2030
+	$package_info = array();
2031 2031
 
2032
-    $package_info = geodir_post_package_info($package_info, $post, $post_type);
2032
+	$package_info = geodir_post_package_info($package_info, $post, $post_type);
2033 2033
 
2034
-    wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_addinfo_noncename');
2035
-    echo '<div id="geodir_wrapper">';
2036
-    geodir_get_custom_fields_html($package_info->pid, 'custom', $post_type);
2037
-    echo '</div>';
2034
+	wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_addinfo_noncename');
2035
+	echo '<div id="geodir_wrapper">';
2036
+	geodir_get_custom_fields_html($package_info->pid, 'custom', $post_type);
2037
+	echo '</div>';
2038 2038
 
2039 2039
 }
2040 2040
 
@@ -2048,60 +2048,60 @@  discard block
 block discarded – undo
2048 2048
  */
2049 2049
 function geodir_post_attachments()
2050 2050
 {
2051
-    global $post, $post_id;
2051
+	global $post, $post_id;
2052 2052
 
2053
-    wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_attachments_noncename');
2053
+	wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_attachments_noncename');
2054 2054
 
2055
-    if (geodir_get_featured_image($post_id, 'thumbnail')) {
2056
-        echo '<h4>' . __('Featured Image', 'geodirectory') . '</h4>';
2057
-        geodir_show_featured_image($post_id, 'thumbnail');
2058
-    }
2055
+	if (geodir_get_featured_image($post_id, 'thumbnail')) {
2056
+		echo '<h4>' . __('Featured Image', 'geodirectory') . '</h4>';
2057
+		geodir_show_featured_image($post_id, 'thumbnail');
2058
+	}
2059 2059
 
2060
-    $image_limit = 0;
2060
+	$image_limit = 0;
2061 2061
 
2062
-    ?>
2062
+	?>
2063 2063
 
2064 2064
 
2065 2065
     <h5 class="form_title">
2066 2066
         <?php if ($image_limit != 0 && $image_limit == 1) {
2067
-            echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2068
-        } ?>
2067
+			echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2068
+		} ?>
2069 2069
         <?php if ($image_limit != 0 && $image_limit > 1) {
2070
-            echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2071
-        } ?>
2070
+			echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2071
+		} ?>
2072 2072
         <?php if ($image_limit == 0) {
2073
-            echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2074
-        } ?>
2073
+			echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2074
+		} ?>
2075 2075
     </h5>
2076 2076
 
2077 2077
 
2078 2078
     <?php
2079 2079
 
2080
-    $curImages = geodir_get_images($post_id);
2081
-    $place_img_array = array();
2080
+	$curImages = geodir_get_images($post_id);
2081
+	$place_img_array = array();
2082 2082
 
2083
-    if (!empty($curImages)):
2084
-        foreach ($curImages as $p_img):
2085
-            $place_img_array[] = $p_img->src;
2086
-        endforeach;
2087
-    endif;
2083
+	if (!empty($curImages)):
2084
+		foreach ($curImages as $p_img):
2085
+			$place_img_array[] = $p_img->src;
2086
+		endforeach;
2087
+	endif;
2088 2088
 
2089
-    if (!empty($place_img_array))
2090
-        $curImages = implode(',', $place_img_array);
2089
+	if (!empty($place_img_array))
2090
+		$curImages = implode(',', $place_img_array);
2091 2091
 
2092 2092
 
2093
-    // adjust values here
2094
-    $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2093
+	// adjust values here
2094
+	$id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2095 2095
 
2096
-    $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2096
+	$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2097 2097
 
2098
-    $multiple = true; // allow multiple files upload
2098
+	$multiple = true; // allow multiple files upload
2099 2099
 
2100
-    $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2100
+	$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2101 2101
 
2102
-    $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2102
+	$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2103 2103
 
2104
-    ?>
2104
+	?>
2105 2105
 
2106 2106
     <div class="gtd-form_row clearfix" id="<?php echo $id; ?>dropbox" style="border:1px solid #999999;padding:5px;text-align:center;">
2107 2107
         <input type="hidden" name="<?php echo $id; ?>" id="<?php echo $id; ?>" value="<?php echo $svalue; ?>"/>
@@ -2143,13 +2143,13 @@  discard block
 block discarded – undo
2143 2143
  */
2144 2144
 function geodir_action_post_updated($post_ID, $post_after, $post_before)
2145 2145
 {
2146
-    $post_type = get_post_type($post_ID);
2146
+	$post_type = get_post_type($post_ID);
2147 2147
 
2148
-    if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
2149
-        if ($post_type != '' && in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_ID) && !empty($post_after->post_title) && $post_after->post_title != $post_before->post_title) {
2150
-            geodir_save_post_meta($post_ID, 'post_title', $post_after->post_title);
2151
-        }
2152
-    }
2148
+	if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
2149
+		if ($post_type != '' && in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_ID) && !empty($post_after->post_title) && $post_after->post_title != $post_before->post_title) {
2150
+			geodir_save_post_meta($post_ID, 'post_title', $post_after->post_title);
2151
+		}
2152
+	}
2153 2153
 }
2154 2154
 
2155 2155
 /**
@@ -2164,39 +2164,39 @@  discard block
 block discarded – undo
2164 2164
  */
2165 2165
 function geodir_notification_add_bcc_option($settings)
2166 2166
 {
2167
-    if (!empty($settings)) {
2168
-        $new_settings = array();
2169
-        foreach ($settings as $setting) {
2170
-            if (isset($setting['id']) && $setting['id'] == 'site_bcc_options' && isset($setting['type']) && $setting['type'] == 'sectionend') {
2171
-                $geodir_bcc_listing_published_yes = array(
2172
-                    'name' => __('Listing published', 'geodirectory'),
2173
-                    'desc' => __('Yes', 'geodirectory'),
2174
-                    'id' => 'geodir_bcc_listing_published',
2175
-                    'std' => 'yes',
2176
-                    'type' => 'radio',
2177
-                    'value' => '1',
2178
-                    'radiogroup' => 'start'
2179
-                );
2180
-
2181
-                $geodir_bcc_listing_published_no = array(
2182
-                    'name' => __('Listing published', 'geodirectory'),
2183
-                    'desc' => __('No', 'geodirectory'),
2184
-                    'id' => 'geodir_bcc_listing_published',
2185
-                    'std' => 'yes',
2186
-                    'type' => 'radio',
2187
-                    'value' => '0',
2188
-                    'radiogroup' => 'end'
2189
-                );
2190
-
2191
-                $new_settings[] = $geodir_bcc_listing_published_yes;
2192
-                $new_settings[] = $geodir_bcc_listing_published_no;
2193
-            }
2194
-            $new_settings[] = $setting;
2195
-        }
2196
-        $settings = $new_settings;
2197
-    }
2167
+	if (!empty($settings)) {
2168
+		$new_settings = array();
2169
+		foreach ($settings as $setting) {
2170
+			if (isset($setting['id']) && $setting['id'] == 'site_bcc_options' && isset($setting['type']) && $setting['type'] == 'sectionend') {
2171
+				$geodir_bcc_listing_published_yes = array(
2172
+					'name' => __('Listing published', 'geodirectory'),
2173
+					'desc' => __('Yes', 'geodirectory'),
2174
+					'id' => 'geodir_bcc_listing_published',
2175
+					'std' => 'yes',
2176
+					'type' => 'radio',
2177
+					'value' => '1',
2178
+					'radiogroup' => 'start'
2179
+				);
2180
+
2181
+				$geodir_bcc_listing_published_no = array(
2182
+					'name' => __('Listing published', 'geodirectory'),
2183
+					'desc' => __('No', 'geodirectory'),
2184
+					'id' => 'geodir_bcc_listing_published',
2185
+					'std' => 'yes',
2186
+					'type' => 'radio',
2187
+					'value' => '0',
2188
+					'radiogroup' => 'end'
2189
+				);
2190
+
2191
+				$new_settings[] = $geodir_bcc_listing_published_yes;
2192
+				$new_settings[] = $geodir_bcc_listing_published_no;
2193
+			}
2194
+			$new_settings[] = $setting;
2195
+		}
2196
+		$settings = $new_settings;
2197
+	}
2198 2198
 
2199
-    return $settings;
2199
+	return $settings;
2200 2200
 }
2201 2201
 
2202 2202
 
@@ -2211,19 +2211,19 @@  discard block
 block discarded – undo
2211 2211
  */
2212 2212
 function get_gd_theme_compat_callback()
2213 2213
 {
2214
-    global $wpdb;
2215
-    $themes = get_option('gd_theme_compats');
2216
-
2217
-    if (isset($_POST['theme']) && isset($themes[$_POST['theme']]) && !empty($themes[$_POST['theme']])) {
2218
-        if (isset($_POST['export'])) {
2219
-            echo json_encode(array($_POST['theme'] => $themes[$_POST['theme']]));
2220
-        } else {
2221
-            echo json_encode($themes[$_POST['theme']]);
2222
-        }
2214
+	global $wpdb;
2215
+	$themes = get_option('gd_theme_compats');
2223 2216
 
2224
-    }
2217
+	if (isset($_POST['theme']) && isset($themes[$_POST['theme']]) && !empty($themes[$_POST['theme']])) {
2218
+		if (isset($_POST['export'])) {
2219
+			echo json_encode(array($_POST['theme'] => $themes[$_POST['theme']]));
2220
+		} else {
2221
+			echo json_encode($themes[$_POST['theme']]);
2222
+		}
2225 2223
 
2226
-    die();
2224
+	}
2225
+
2226
+	die();
2227 2227
 }
2228 2228
 
2229 2229
 add_action('wp_ajax_get_gd_theme_compat_import_callback', 'get_gd_theme_compat_import_callback');
@@ -2237,20 +2237,20 @@  discard block
 block discarded – undo
2237 2237
  */
2238 2238
 function get_gd_theme_compat_import_callback()
2239 2239
 {
2240
-    global $wpdb;
2241
-    $themes = get_option('gd_theme_compats');
2242
-    if (isset($_POST['theme']) && !empty($_POST['theme'])) {
2243
-        $json = json_decode(stripslashes($_POST['theme']), true);
2244
-        if (!empty($json) && is_array($json)) {
2245
-            $key = sanitize_text_field(key($json));
2246
-            $themes[$key] = $json[$key];
2247
-            update_option('gd_theme_compats', $themes);
2248
-            echo $key;
2249
-            die();
2250
-        }
2251
-    }
2252
-    echo '0';
2253
-    die();
2240
+	global $wpdb;
2241
+	$themes = get_option('gd_theme_compats');
2242
+	if (isset($_POST['theme']) && !empty($_POST['theme'])) {
2243
+		$json = json_decode(stripslashes($_POST['theme']), true);
2244
+		if (!empty($json) && is_array($json)) {
2245
+			$key = sanitize_text_field(key($json));
2246
+			$themes[$key] = $json[$key];
2247
+			update_option('gd_theme_compats', $themes);
2248
+			echo $key;
2249
+			die();
2250
+		}
2251
+	}
2252
+	echo '0';
2253
+	die();
2254 2254
 }
2255 2255
 
2256 2256
 
@@ -2263,39 +2263,39 @@  discard block
 block discarded – undo
2263 2263
  */
2264 2264
 function gd_set_theme_compat()
2265 2265
 {
2266
-    global $wpdb;
2267
-    $theme = wp_get_theme();
2266
+	global $wpdb;
2267
+	$theme = wp_get_theme();
2268 2268
 
2269
-    if ($theme->parent()) {
2270
-        $theme_name = str_replace(" ", "_", $theme->parent()->get('Name'));
2271
-    } else {
2272
-        $theme_name = str_replace(" ", "_", $theme->get('Name'));
2273
-    }
2269
+	if ($theme->parent()) {
2270
+		$theme_name = str_replace(" ", "_", $theme->parent()->get('Name'));
2271
+	} else {
2272
+		$theme_name = str_replace(" ", "_", $theme->get('Name'));
2273
+	}
2274 2274
 
2275
-    $theme_compats = get_option('gd_theme_compats');
2276
-    $current_compat = get_option('gd_theme_compat');
2277
-    $current_compat = str_replace("_custom", "", $current_compat);
2275
+	$theme_compats = get_option('gd_theme_compats');
2276
+	$current_compat = get_option('gd_theme_compat');
2277
+	$current_compat = str_replace("_custom", "", $current_compat);
2278 2278
 
2279
-    if ($current_compat == $theme_name && strpos("_custom", get_option('gd_theme_compat')) !== false) {
2280
-        return;
2281
-    }// if already running correct compat then bail
2279
+	if ($current_compat == $theme_name && strpos("_custom", get_option('gd_theme_compat')) !== false) {
2280
+		return;
2281
+	}// if already running correct compat then bail
2282 2282
 
2283
-    if (isset($theme_compats[$theme_name])) {// if there is a compat avail then set it
2284
-        update_option('gd_theme_compat', $theme_name);
2285
-        update_option('theme_compatibility_setting', $theme_compats[$theme_name]);
2283
+	if (isset($theme_compats[$theme_name])) {// if there is a compat avail then set it
2284
+		update_option('gd_theme_compat', $theme_name);
2285
+		update_option('theme_compatibility_setting', $theme_compats[$theme_name]);
2286 2286
 
2287
-        // if there are default options to set then set them
2288
-        if (isset($theme_compats[$theme_name]['geodir_theme_compat_default_options']) && !empty($theme_compats[$theme_name]['geodir_theme_compat_default_options'])) {
2287
+		// if there are default options to set then set them
2288
+		if (isset($theme_compats[$theme_name]['geodir_theme_compat_default_options']) && !empty($theme_compats[$theme_name]['geodir_theme_compat_default_options'])) {
2289 2289
 
2290
-            foreach ($theme_compats[$theme_name]['geodir_theme_compat_default_options'] as $key => $val) {
2291
-                update_option($key, $val);
2292
-            }
2293
-        }
2290
+			foreach ($theme_compats[$theme_name]['geodir_theme_compat_default_options'] as $key => $val) {
2291
+				update_option($key, $val);
2292
+			}
2293
+		}
2294 2294
 
2295
-    } else {
2296
-        update_option('gd_theme_compat', '');
2297
-        update_option('theme_compatibility_setting', '');
2298
-    }
2295
+	} else {
2296
+		update_option('gd_theme_compat', '');
2297
+		update_option('theme_compatibility_setting', '');
2298
+	}
2299 2299
 
2300 2300
 
2301 2301
 }
@@ -2310,9 +2310,9 @@  discard block
 block discarded – undo
2310 2310
  */
2311 2311
 function gd_check_avada_compat()
2312 2312
 {
2313
-    if (function_exists('avada_load_textdomain') && !get_option('avada_nag')) {
2314
-        add_action('admin_notices', 'gd_avada_compat_warning');
2315
-    }
2313
+	if (function_exists('avada_load_textdomain') && !get_option('avada_nag')) {
2314
+		add_action('admin_notices', 'gd_avada_compat_warning');
2315
+	}
2316 2316
 }
2317 2317
 
2318 2318
 
@@ -2325,22 +2325,22 @@  discard block
 block discarded – undo
2325 2325
 function gd_avada_compat_warning()
2326 2326
 {
2327 2327
 
2328
-    /*
2328
+	/*
2329 2329
     $msg_type = error
2330 2330
     $msg_type = updated fade
2331 2331
     $msg_type = update-nag
2332 2332
     */
2333 2333
 
2334
-    $plugin = 'avada-nag';
2335
-    $timestamp = 'avada-nag1234';
2336
-    $message = __('Welcome to GeoDirectory, please have a look <a href="https://docs.wpgeodirectory.com/category/getting-started/" target="_blank">here</a> to get started. :)', 'geodirectory');
2337
-    echo '<div id="' . $timestamp . '"  class="error">';
2338
-    echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\'' . $plugin . '\',\'' . $timestamp . '\');" ><i class="fa fa-times"></i></span>';
2339
-    echo "<img class='gd-icon-noti' src='" . plugin_dir_url('') . "geodirectory/geodirectory-assets/images/favicon.ico' > ";
2340
-    echo "<p>$message</p>";
2341
-    echo "</div>";
2334
+	$plugin = 'avada-nag';
2335
+	$timestamp = 'avada-nag1234';
2336
+	$message = __('Welcome to GeoDirectory, please have a look <a href="https://docs.wpgeodirectory.com/category/getting-started/" target="_blank">here</a> to get started. :)', 'geodirectory');
2337
+	echo '<div id="' . $timestamp . '"  class="error">';
2338
+	echo '<span class="gd-remove-noti" onclick="gdRemoveANotification(\'' . $plugin . '\',\'' . $timestamp . '\');" ><i class="fa fa-times"></i></span>';
2339
+	echo "<img class='gd-icon-noti' src='" . plugin_dir_url('') . "geodirectory/geodirectory-assets/images/favicon.ico' > ";
2340
+	echo "<p>$message</p>";
2341
+	echo "</div>";
2342 2342
 
2343
-    ?>
2343
+	?>
2344 2344
     <script>
2345 2345
         function gdRemoveANotification($plugin, $timestamp) {
2346 2346
 
@@ -2408,10 +2408,10 @@  discard block
 block discarded – undo
2408 2408
  */
2409 2409
 function geodir_avada_remove_notification()
2410 2410
 {
2411
-    update_option('avada_nag', TRUE);
2411
+	update_option('avada_nag', TRUE);
2412 2412
 
2413
-    // Always die in functions echoing ajax content
2414
-    die();
2413
+	// Always die in functions echoing ajax content
2414
+	die();
2415 2415
 }
2416 2416
 
2417 2417
 
@@ -2470,7 +2470,7 @@  discard block
 block discarded – undo
2470 2470
 		// Don't allow same slug url for listing and location
2471 2471
 		if (geodir_strtolower($listing_prefix) == geodir_strtolower($location_prefix)) {
2472 2472
 			$redirect_url = admin_url('admin.php?page=geodirectory&tab=' . $current_tab . '&active_tab=' . $active_tab . '&msg=fail&gderr=21');
2473
-        	wp_redirect($redirect_url);
2473
+			wp_redirect($redirect_url);
2474 2474
 			exit;
2475 2475
 		}
2476 2476
 		
@@ -2500,10 +2500,10 @@  discard block
 block discarded – undo
2500 2500
  * @package GeoDirectory
2501 2501
  */
2502 2502
 function geodir_hide_admin_preview_button() {
2503
-    global $post_type;
2504
-    $post_types = geodir_get_posttypes();
2505
-    if(in_array($post_type, $post_types))
2506
-        echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>';
2503
+	global $post_type;
2504
+	$post_types = geodir_get_posttypes();
2505
+	if(in_array($post_type, $post_types))
2506
+		echo '<style type="text/css">#post-preview, #view-post-btn{display: none;}</style>';
2507 2507
 }
2508 2508
 add_action( 'admin_head-post-new.php', 'geodir_hide_admin_preview_button' );
2509 2509
 add_action( 'admin_head-post.php', 'geodir_hide_admin_preview_button' );
@@ -2518,7 +2518,7 @@  discard block
 block discarded – undo
2518 2518
  */
2519 2519
 function geodir_import_export_tab( $tabs ) {
2520 2520
 	$tabs['import_export'] = array( 'label' => __( 'Import & Export', 'geodirectory' ) );
2521
-    return $tabs;
2521
+	return $tabs;
2522 2522
 }
2523 2523
 
2524 2524
 /**
@@ -2533,26 +2533,26 @@  discard block
 block discarded – undo
2533 2533
 function geodir_import_export_page() {
2534 2534
 	$nonce = wp_create_nonce( 'geodir_import_export_nonce' );
2535 2535
 	$gd_cats_sample_csv = geodir_plugin_url() . '/geodirectory-assets/gd_sample_categories.csv';
2536
-    /**
2537
-     * Filter sample category data csv file url.
2538
-     *
2539
-     * @since 1.0.0
2540
-     * @package GeoDirectory
2541
-     *
2542
-     * @param string $gd_cats_sample_csv Sample category data csv file url.
2543
-     */
2536
+	/**
2537
+	 * Filter sample category data csv file url.
2538
+	 *
2539
+	 * @since 1.0.0
2540
+	 * @package GeoDirectory
2541
+	 *
2542
+	 * @param string $gd_cats_sample_csv Sample category data csv file url.
2543
+	 */
2544 2544
 	$gd_cats_sample_csv = apply_filters( 'geodir_export_cats_sample_csv', $gd_cats_sample_csv );
2545 2545
 	
2546 2546
 	$gd_posts_sample_csv = geodir_plugin_url() . '/geodirectory-assets/place_listing.csv';
2547
-    /**
2548
-     * Filter sample post data csv file url.
2549
-     *
2550
-     * @since 1.0.0
2551
-     * @package GeoDirectory
2552
-     *
2553
-     * @param string $gd_posts_sample_csv Sample post data csv file url.
2554
-     */
2555
-    $gd_posts_sample_csv = apply_filters( 'geodir_export_posts_sample_csv', $gd_posts_sample_csv );
2547
+	/**
2548
+	 * Filter sample post data csv file url.
2549
+	 *
2550
+	 * @since 1.0.0
2551
+	 * @package GeoDirectory
2552
+	 *
2553
+	 * @param string $gd_posts_sample_csv Sample post data csv file url.
2554
+	 */
2555
+	$gd_posts_sample_csv = apply_filters( 'geodir_export_posts_sample_csv', $gd_posts_sample_csv );
2556 2556
 	
2557 2557
 	$gd_posttypes = geodir_get_posttypes( 'array' );
2558 2558
 	
@@ -2575,14 +2575,14 @@  discard block
 block discarded – undo
2575 2575
 	$gd_chunksize_options[100000] = 100000;
2576 2576
 	 
2577 2577
 	 /**
2578
-     * Filter max entries per export csv file.
2579
-     *
2580
-     * @since 1.5.6
2581
-     * @package GeoDirectory
2582
-     *
2583
-     * @param string $gd_chunksize_options Entries options.
2584
-     */
2585
-    $gd_chunksize_options = apply_filters( 'geodir_export_csv_chunksize_options', $gd_chunksize_options );
2578
+	  * Filter max entries per export csv file.
2579
+	  *
2580
+	  * @since 1.5.6
2581
+	  * @package GeoDirectory
2582
+	  *
2583
+	  * @param string $gd_chunksize_options Entries options.
2584
+	  */
2585
+	$gd_chunksize_options = apply_filters( 'geodir_export_csv_chunksize_options', $gd_chunksize_options );
2586 2586
 	
2587 2587
 	$gd_chunksize_option = '';
2588 2588
 	foreach ($gd_chunksize_options as $value => $title) {
@@ -2598,12 +2598,12 @@  discard block
 block discarded – undo
2598 2598
   <div class="gd-content-heading">
2599 2599
 
2600 2600
   <?php
2601
-    ini_set('max_execution_time', 999999);
2602
-    $ini_max_execution_time_check = @ini_get( 'max_execution_time' );
2603
-    ini_restore('max_execution_time');
2601
+	ini_set('max_execution_time', 999999);
2602
+	$ini_max_execution_time_check = @ini_get( 'max_execution_time' );
2603
+	ini_restore('max_execution_time');
2604 2604
 
2605
-    if($ini_max_execution_time_check != 999999){ // only show these setting to the user if we can't change the ini setting
2606
-        ?>
2605
+	if($ini_max_execution_time_check != 999999){ // only show these setting to the user if we can't change the ini setting
2606
+		?>
2607 2607
 	<div id="gd_ie_reqs" class="metabox-holder">
2608 2608
       <div class="meta-box-sortables ui-sortable">
2609 2609
         <div class="postbox">
@@ -2772,7 +2772,7 @@  discard block
 block discarded – undo
2772 2772
 						 * Called just after the sample CSV download link.
2773 2773
 						 *
2774 2774
 						 * @since 1.0.0
2775
-                         * @package GeoDirectory
2775
+						 * @package GeoDirectory
2776 2776
 						 */
2777 2777
 						do_action('geodir_sample_cats_csv_download_link');
2778 2778
 						?>
@@ -2857,11 +2857,11 @@  discard block
 block discarded – undo
2857 2857
 	 *
2858 2858
 	 * Called after the last setting on the GD > Import & Export page.
2859 2859
 	 * @since 1.4.6
2860
-     * @package GeoDirectory
2860
+	 * @package GeoDirectory
2861 2861
 	 *
2862 2862
 	 * @param array $gd_posttypes GD post types.
2863
-     * @param array $gd_chunksize_options File chunk size options.
2864
-     * @param string $nonce Wordpress security token for GD import & export.
2863
+	 * @param array $gd_chunksize_options File chunk size options.
2864
+	 * @param string $nonce Wordpress security token for GD import & export.
2865 2865
 	 */
2866 2866
 	do_action( 'geodir_import_export', $gd_posttypes, $gd_chunksize_options, $nonce );
2867 2867
 	?>
@@ -3526,44 +3526,44 @@  discard block
 block discarded – undo
3526 3526
 function geodir_init_filesystem()
3527 3527
 {
3528 3528
 
3529
-    if(!function_exists('get_filesystem_method')){
3530
-        require_once(ABSPATH."/wp-admin/includes/file.php");
3531
-    }
3532
-    $access_type = get_filesystem_method();
3533
-    if ($access_type === 'direct') {
3534
-        /* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */
3535
-        $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array());
3536
-
3537
-        /* initialize the API */
3538
-        if (!WP_Filesystem($creds)) {
3539
-            /* any problems and we exit */
3540
-            //return '@@@3';
3541
-            return false;
3542
-        }
3543
-
3544
-        global $wp_filesystem;
3545
-        return $wp_filesystem;
3546
-        /* do our file manipulations below */
3547
-    } elseif (defined('FTP_USER')) {
3548
-        $creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array());
3529
+	if(!function_exists('get_filesystem_method')){
3530
+		require_once(ABSPATH."/wp-admin/includes/file.php");
3531
+	}
3532
+	$access_type = get_filesystem_method();
3533
+	if ($access_type === 'direct') {
3534
+		/* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */
3535
+		$creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array());
3536
+
3537
+		/* initialize the API */
3538
+		if (!WP_Filesystem($creds)) {
3539
+			/* any problems and we exit */
3540
+			//return '@@@3';
3541
+			return false;
3542
+		}
3549 3543
 
3550
-        /* initialize the API */
3551
-        if (!WP_Filesystem($creds)) {
3552
-            /* any problems and we exit */
3553
-            //return '@@@33';
3554
-            return false;
3555
-        }
3544
+		global $wp_filesystem;
3545
+		return $wp_filesystem;
3546
+		/* do our file manipulations below */
3547
+	} elseif (defined('FTP_USER')) {
3548
+		$creds = request_filesystem_credentials(trailingslashit(site_url()) . 'wp-admin/', '', false, false, array());
3549
+
3550
+		/* initialize the API */
3551
+		if (!WP_Filesystem($creds)) {
3552
+			/* any problems and we exit */
3553
+			//return '@@@33';
3554
+			return false;
3555
+		}
3556 3556
 
3557
-        global $wp_filesystem;
3558
-        //return '@@@1';
3559
-        return $wp_filesystem;
3557
+		global $wp_filesystem;
3558
+		//return '@@@1';
3559
+		return $wp_filesystem;
3560 3560
 
3561
-    } else {
3562
-        //return '@@@2';
3563
-        /* don't have direct write access. Prompt user with our notice */
3564
-        add_action('admin_notice', 'geodir_filesystem_notice');
3565
-        return false;
3566
-    }
3561
+	} else {
3562
+		//return '@@@2';
3563
+		/* don't have direct write access. Prompt user with our notice */
3564
+		add_action('admin_notice', 'geodir_filesystem_notice');
3565
+		return false;
3566
+	}
3567 3567
 
3568 3568
 }
3569 3569
 
@@ -3581,10 +3581,10 @@  discard block
 block discarded – undo
3581 3581
  */
3582 3582
 function geodir_filesystem_notice()
3583 3583
 {   if ( defined( 'DOING_AJAX' ) ){return;}
3584
-    $access_type = get_filesystem_method();
3585
-    if ($access_type === 'direct') {
3586
-    } elseif (!defined('FTP_USER')) {
3587
-        ?>
3584
+	$access_type = get_filesystem_method();
3585
+	if ($access_type === 'direct') {
3586
+	} elseif (!defined('FTP_USER')) {
3587
+		?>
3588 3588
         <div class="error">
3589 3589
             <p><?php _e('GeoDirectory does not have access to your filesystem, thing like import/export will not work. Please define your details in wp-config.php as explained here', 'geodirectory'); ?>
3590 3590
                 <a target="_blank" href="http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants">http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants</a>
@@ -3610,1514 +3610,1514 @@  discard block
 block discarded – undo
3610 3610
  * @return string Json data.
3611 3611
  */
3612 3612
 function geodir_ajax_import_export() {
3613
-    global $wpdb, $plugin_prefix, $current_user, $wp_filesystem;
3613
+	global $wpdb, $plugin_prefix, $current_user, $wp_filesystem;
3614 3614
     
3615
-    error_reporting(0);
3615
+	error_reporting(0);
3616 3616
 
3617
-    // try to set higher limits for import
3618
-    $max_input_time = ini_get('max_input_time');
3619
-    $max_execution_time = ini_get('max_execution_time');
3620
-    $memory_limit= ini_get('memory_limit');
3617
+	// try to set higher limits for import
3618
+	$max_input_time = ini_get('max_input_time');
3619
+	$max_execution_time = ini_get('max_execution_time');
3620
+	$memory_limit= ini_get('memory_limit');
3621 3621
 
3622
-    if(!$max_input_time || $max_input_time<3000){
3623
-        ini_set('max_input_time', 3000);
3624
-    }
3622
+	if(!$max_input_time || $max_input_time<3000){
3623
+		ini_set('max_input_time', 3000);
3624
+	}
3625 3625
 
3626
-    if(!$max_execution_time || $max_execution_time<3000){
3627
-        ini_set('max_execution_time', 3000);
3628
-    }
3626
+	if(!$max_execution_time || $max_execution_time<3000){
3627
+		ini_set('max_execution_time', 3000);
3628
+	}
3629 3629
 
3630
-    if($memory_limit && str_replace('M','',$memory_limit)){
3631
-        if(str_replace('M','',$memory_limit)<256){
3632
-            ini_set('memory_limit', '256M');
3633
-        }
3634
-    }
3630
+	if($memory_limit && str_replace('M','',$memory_limit)){
3631
+		if(str_replace('M','',$memory_limit)<256){
3632
+			ini_set('memory_limit', '256M');
3633
+		}
3634
+	}
3635 3635
 
3636
-    $json = array();
3636
+	$json = array();
3637 3637
 
3638
-    if ( !current_user_can( 'manage_options' ) ) {
3639
-        wp_send_json( $json );
3640
-    }
3638
+	if ( !current_user_can( 'manage_options' ) ) {
3639
+		wp_send_json( $json );
3640
+	}
3641 3641
 
3642
-    $task = isset( $_REQUEST['task'] ) ? $_REQUEST['task'] : NULL;
3643
-    $nonce = isset( $_REQUEST['_nonce'] ) ? $_REQUEST['_nonce'] : NULL;
3644
-    $stat = isset( $_REQUEST['_st'] ) ? $_REQUEST['_st'] : false;
3642
+	$task = isset( $_REQUEST['task'] ) ? $_REQUEST['task'] : NULL;
3643
+	$nonce = isset( $_REQUEST['_nonce'] ) ? $_REQUEST['_nonce'] : NULL;
3644
+	$stat = isset( $_REQUEST['_st'] ) ? $_REQUEST['_st'] : false;
3645 3645
 
3646
-    if ( !wp_verify_nonce( $nonce, 'geodir_import_export_nonce' ) ) {
3647
-        wp_send_json( $json );
3648
-    }
3646
+	if ( !wp_verify_nonce( $nonce, 'geodir_import_export_nonce' ) ) {
3647
+		wp_send_json( $json );
3648
+	}
3649 3649
 
3650
-    $post_type = isset( $_REQUEST['_pt'] ) ? $_REQUEST['_pt'] : NULL;
3651
-    $chunk_per_page = isset( $_REQUEST['_n'] ) ? absint($_REQUEST['_n']) : NULL;
3652
-    $chunk_per_page = $chunk_per_page < 50 || $chunk_per_page > 100000 ? 5000 : $chunk_per_page;
3653
-    $chunk_page_no = isset( $_REQUEST['_p'] ) ? absint($_REQUEST['_p']) : 1;
3650
+	$post_type = isset( $_REQUEST['_pt'] ) ? $_REQUEST['_pt'] : NULL;
3651
+	$chunk_per_page = isset( $_REQUEST['_n'] ) ? absint($_REQUEST['_n']) : NULL;
3652
+	$chunk_per_page = $chunk_per_page < 50 || $chunk_per_page > 100000 ? 5000 : $chunk_per_page;
3653
+	$chunk_page_no = isset( $_REQUEST['_p'] ) ? absint($_REQUEST['_p']) : 1;
3654 3654
 
3655
-    $wp_filesystem = geodir_init_filesystem();
3656
-    if (!$wp_filesystem) {
3657
-        $json['error'] = __( 'Filesystem ERROR: Could not access filesystem.', 'geodirectory' );
3658
-        wp_send_json( $json );
3659
-    }
3655
+	$wp_filesystem = geodir_init_filesystem();
3656
+	if (!$wp_filesystem) {
3657
+		$json['error'] = __( 'Filesystem ERROR: Could not access filesystem.', 'geodirectory' );
3658
+		wp_send_json( $json );
3659
+	}
3660 3660
 
3661
-    if (!empty($wp_filesystem) && isset($wp_filesystem->errors) && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
3662
-        $json['error'] = __( 'Filesystem ERROR: ' . $wp_filesystem->errors->get_error_message(), 'geodirectory' );
3663
-        wp_send_json( $json );
3664
-    }
3661
+	if (!empty($wp_filesystem) && isset($wp_filesystem->errors) && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
3662
+		$json['error'] = __( 'Filesystem ERROR: ' . $wp_filesystem->errors->get_error_message(), 'geodirectory' );
3663
+		wp_send_json( $json );
3664
+	}
3665 3665
 
3666
-    $csv_file_dir = geodir_path_import_export( false );
3667
-    if ( !$wp_filesystem->is_dir( $csv_file_dir ) ) {
3668
-        if ( !$wp_filesystem->mkdir( $csv_file_dir, FS_CHMOD_DIR ) ) {
3669
-            $json['error'] = __( 'ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory' );
3670
-            wp_send_json( $json );
3671
-        }
3672
-    }
3666
+	$csv_file_dir = geodir_path_import_export( false );
3667
+	if ( !$wp_filesystem->is_dir( $csv_file_dir ) ) {
3668
+		if ( !$wp_filesystem->mkdir( $csv_file_dir, FS_CHMOD_DIR ) ) {
3669
+			$json['error'] = __( 'ERROR: Could not create cache directory. This is usually due to inconsistent file permissions.', 'geodirectory' );
3670
+			wp_send_json( $json );
3671
+		}
3672
+	}
3673 3673
     
3674
-    $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
3675
-    $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
3676
-
3677
-    switch ( $task ) {
3678
-        case 'export_posts': {
3679
-            // WPML
3680
-            $is_wpml = geodir_is_wpml();
3681
-            if ($is_wpml) {
3682
-                global $sitepress;
3683
-                $active_lang = ICL_LANGUAGE_CODE;
3674
+	$location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
3675
+	$neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
3676
+
3677
+	switch ( $task ) {
3678
+		case 'export_posts': {
3679
+			// WPML
3680
+			$is_wpml = geodir_is_wpml();
3681
+			if ($is_wpml) {
3682
+				global $sitepress;
3683
+				$active_lang = ICL_LANGUAGE_CODE;
3684 3684
                 
3685
-                $sitepress->switch_lang('all', true);
3686
-            }
3687
-            // WPML
3688
-            if ( $post_type == 'gd_event' ) {
3689
-                add_filter( 'geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2 );
3690
-            }
3691
-            $file_name = $post_type . '_' . date( 'dmyHi' );
3692
-            $posts_count = geodir_get_posts_count( $post_type );
3693
-            $file_url_base = geodir_path_import_export() . '/';
3694
-            $file_url = $file_url_base . $file_name . '.csv';
3695
-            $file_path = $csv_file_dir . '/' . $file_name . '.csv';
3696
-            $file_path_temp = $csv_file_dir . '/' . $post_type . '_' . $nonce . '.csv';
3685
+				$sitepress->switch_lang('all', true);
3686
+			}
3687
+			// WPML
3688
+			if ( $post_type == 'gd_event' ) {
3689
+				add_filter( 'geodir_imex_export_posts_query', 'geodir_imex_get_events_query', 10, 2 );
3690
+			}
3691
+			$file_name = $post_type . '_' . date( 'dmyHi' );
3692
+			$posts_count = geodir_get_posts_count( $post_type );
3693
+			$file_url_base = geodir_path_import_export() . '/';
3694
+			$file_url = $file_url_base . $file_name . '.csv';
3695
+			$file_path = $csv_file_dir . '/' . $file_name . '.csv';
3696
+			$file_path_temp = $csv_file_dir . '/' . $post_type . '_' . $nonce . '.csv';
3697 3697
             
3698
-            $chunk_file_paths = array();
3698
+			$chunk_file_paths = array();
3699 3699
 
3700
-            if ( isset( $_REQUEST['_st'] ) ) {
3701
-                $line_count = (int)geodir_import_export_line_count( $file_path_temp );
3702
-                $percentage = count( $posts_count ) > 0 && $line_count > 0 ? ceil( $line_count / $posts_count ) * 100 : 0;
3703
-                $percentage = min( $percentage, 100 );
3700
+			if ( isset( $_REQUEST['_st'] ) ) {
3701
+				$line_count = (int)geodir_import_export_line_count( $file_path_temp );
3702
+				$percentage = count( $posts_count ) > 0 && $line_count > 0 ? ceil( $line_count / $posts_count ) * 100 : 0;
3703
+				$percentage = min( $percentage, 100 );
3704 3704
                 
3705
-                $json['percentage'] = $percentage;
3706
-                // WPML
3707
-                if ($is_wpml) {
3708
-                    $sitepress->switch_lang($active_lang, true);
3709
-                }
3710
-                // WPML
3711
-                wp_send_json( $json );
3712
-                gd_die();
3713
-            } else {
3714
-                if ( !$posts_count > 0 ) {
3715
-                    $json['error'] = __( 'No records to export.', 'geodirectory' );
3716
-                } else {
3717
-                    $total_posts = $posts_count;
3718
-                    if ($chunk_per_page > $total_posts) {
3719
-                        $chunk_per_page = $total_posts;
3720
-                    }
3721
-                    $chunk_total_pages = ceil( $total_posts / $chunk_per_page );
3705
+				$json['percentage'] = $percentage;
3706
+				// WPML
3707
+				if ($is_wpml) {
3708
+					$sitepress->switch_lang($active_lang, true);
3709
+				}
3710
+				// WPML
3711
+				wp_send_json( $json );
3712
+				gd_die();
3713
+			} else {
3714
+				if ( !$posts_count > 0 ) {
3715
+					$json['error'] = __( 'No records to export.', 'geodirectory' );
3716
+				} else {
3717
+					$total_posts = $posts_count;
3718
+					if ($chunk_per_page > $total_posts) {
3719
+						$chunk_per_page = $total_posts;
3720
+					}
3721
+					$chunk_total_pages = ceil( $total_posts / $chunk_per_page );
3722 3722
                     
3723
-                    $j = $chunk_page_no;
3724
-                    $chunk_save_posts = geodir_imex_get_posts( $post_type, $chunk_per_page, $j );
3723
+					$j = $chunk_page_no;
3724
+					$chunk_save_posts = geodir_imex_get_posts( $post_type, $chunk_per_page, $j );
3725 3725
                     
3726
-                    $per_page = 500;
3727
-                    if ($per_page > $chunk_per_page) {
3728
-                        $per_page = $chunk_per_page;
3729
-                    }
3730
-                    $total_pages = ceil( $chunk_per_page / $per_page );
3726
+					$per_page = 500;
3727
+					if ($per_page > $chunk_per_page) {
3728
+						$per_page = $chunk_per_page;
3729
+					}
3730
+					$total_pages = ceil( $chunk_per_page / $per_page );
3731 3731
                     
3732
-                    for ( $i = 0; $i <= $total_pages; $i++ ) {
3733
-                        $save_posts = array_slice( $chunk_save_posts , ( $i * $per_page ), $per_page );
3732
+					for ( $i = 0; $i <= $total_pages; $i++ ) {
3733
+						$save_posts = array_slice( $chunk_save_posts , ( $i * $per_page ), $per_page );
3734 3734
                         
3735
-                        $clear = $i == 0 ? true : false;
3736
-                        geodir_save_csv_data( $file_path_temp, $save_posts, $clear );
3737
-                    }
3735
+						$clear = $i == 0 ? true : false;
3736
+						geodir_save_csv_data( $file_path_temp, $save_posts, $clear );
3737
+					}
3738 3738
                         
3739
-                    if ( $wp_filesystem->exists( $file_path_temp ) ) {
3740
-                        $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3741
-                        $chunk_file_name = $file_name . $chunk_page_no . '.csv';
3742
-                        $file_path = $csv_file_dir . '/' . $chunk_file_name;
3743
-                        $wp_filesystem->move( $file_path_temp, $file_path, true );
3739
+					if ( $wp_filesystem->exists( $file_path_temp ) ) {
3740
+						$chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3741
+						$chunk_file_name = $file_name . $chunk_page_no . '.csv';
3742
+						$file_path = $csv_file_dir . '/' . $chunk_file_name;
3743
+						$wp_filesystem->move( $file_path_temp, $file_path, true );
3744 3744
                         
3745
-                        $file_url = $file_url_base . $chunk_file_name;
3746
-                        $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3747
-                    }
3745
+						$file_url = $file_url_base . $chunk_file_name;
3746
+						$chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3747
+					}
3748 3748
                     
3749
-                    if ( !empty($chunk_file_paths) ) {
3750
-                        $json['total'] = $posts_count;
3751
-                        $json['files'] = $chunk_file_paths;
3752
-                    } else {
3753
-                        if ($j > 1) {
3754
-                            $json['total'] = $posts_count;
3755
-                            $json['files'] = array();
3756
-                        } else {
3757
-                            $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' );
3758
-                        }
3759
-                    }
3760
-                }
3761
-                // WPML
3762
-                if ($is_wpml) {
3763
-                    $sitepress->switch_lang($active_lang, true);
3764
-                }
3765
-                // WPML
3766
-                wp_send_json( $json );
3767
-            }
3768
-        }
3769
-        break;
3770
-        case 'export_cats': {
3771
-            // WPML
3772
-            $is_wpml = geodir_is_wpml();
3773
-            if ($is_wpml) {
3774
-                global $sitepress;
3775
-                $active_lang = ICL_LANGUAGE_CODE;
3749
+					if ( !empty($chunk_file_paths) ) {
3750
+						$json['total'] = $posts_count;
3751
+						$json['files'] = $chunk_file_paths;
3752
+					} else {
3753
+						if ($j > 1) {
3754
+							$json['total'] = $posts_count;
3755
+							$json['files'] = array();
3756
+						} else {
3757
+							$json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' );
3758
+						}
3759
+					}
3760
+				}
3761
+				// WPML
3762
+				if ($is_wpml) {
3763
+					$sitepress->switch_lang($active_lang, true);
3764
+				}
3765
+				// WPML
3766
+				wp_send_json( $json );
3767
+			}
3768
+		}
3769
+		break;
3770
+		case 'export_cats': {
3771
+			// WPML
3772
+			$is_wpml = geodir_is_wpml();
3773
+			if ($is_wpml) {
3774
+				global $sitepress;
3775
+				$active_lang = ICL_LANGUAGE_CODE;
3776 3776
                 
3777
-                $sitepress->switch_lang('all', true);
3778
-            }
3779
-            // WPML
3780
-            $file_name = $post_type . 'category_' . date( 'dmyHi' );
3777
+				$sitepress->switch_lang('all', true);
3778
+			}
3779
+			// WPML
3780
+			$file_name = $post_type . 'category_' . date( 'dmyHi' );
3781 3781
             
3782
-            $terms_count = geodir_get_terms_count( $post_type );
3783
-            $file_url_base = geodir_path_import_export() . '/';
3784
-            $file_url = $file_url_base . $file_name . '.csv';
3785
-            $file_path = $csv_file_dir . '/' . $file_name . '.csv';
3786
-            $file_path_temp = $csv_file_dir . '/' . $post_type . 'category_' . $nonce . '.csv';
3782
+			$terms_count = geodir_get_terms_count( $post_type );
3783
+			$file_url_base = geodir_path_import_export() . '/';
3784
+			$file_url = $file_url_base . $file_name . '.csv';
3785
+			$file_path = $csv_file_dir . '/' . $file_name . '.csv';
3786
+			$file_path_temp = $csv_file_dir . '/' . $post_type . 'category_' . $nonce . '.csv';
3787 3787
             
3788
-            $chunk_file_paths = array();
3788
+			$chunk_file_paths = array();
3789 3789
             
3790
-            if ( isset( $_REQUEST['_st'] ) ) {
3791
-                $line_count = (int)geodir_import_export_line_count( $file_path_temp );
3792
-                $percentage = count( $terms_count ) > 0 && $line_count > 0 ? ceil( $line_count / $terms_count ) * 100 : 0;
3793
-                $percentage = min( $percentage, 100 );
3790
+			if ( isset( $_REQUEST['_st'] ) ) {
3791
+				$line_count = (int)geodir_import_export_line_count( $file_path_temp );
3792
+				$percentage = count( $terms_count ) > 0 && $line_count > 0 ? ceil( $line_count / $terms_count ) * 100 : 0;
3793
+				$percentage = min( $percentage, 100 );
3794 3794
                 
3795
-                $json['percentage'] = $percentage;
3796
-                // WPML
3797
-                if ($is_wpml) {
3798
-                    $sitepress->switch_lang($active_lang, true);
3799
-                }
3800
-                // WPML
3801
-                wp_send_json( $json );
3802
-            } else {
3803
-                if ( !$terms_count > 0 ) {
3804
-                    $json['error'] = __( 'No records to export.', 'geodirectory' );
3805
-                } else {
3806
-                    $total_terms = $terms_count;
3807
-                    if ($chunk_per_page > $terms_count) {
3808
-                        $chunk_per_page = $terms_count;
3809
-                    }
3810
-                    $chunk_total_pages = ceil( $total_terms / $chunk_per_page );
3795
+				$json['percentage'] = $percentage;
3796
+				// WPML
3797
+				if ($is_wpml) {
3798
+					$sitepress->switch_lang($active_lang, true);
3799
+				}
3800
+				// WPML
3801
+				wp_send_json( $json );
3802
+			} else {
3803
+				if ( !$terms_count > 0 ) {
3804
+					$json['error'] = __( 'No records to export.', 'geodirectory' );
3805
+				} else {
3806
+					$total_terms = $terms_count;
3807
+					if ($chunk_per_page > $terms_count) {
3808
+						$chunk_per_page = $terms_count;
3809
+					}
3810
+					$chunk_total_pages = ceil( $total_terms / $chunk_per_page );
3811 3811
                     
3812
-                    $j = $chunk_page_no;
3813
-                    $chunk_save_terms = geodir_imex_get_terms( $post_type, $chunk_per_page, $j );
3812
+					$j = $chunk_page_no;
3813
+					$chunk_save_terms = geodir_imex_get_terms( $post_type, $chunk_per_page, $j );
3814 3814
                     
3815
-                    $per_page = 500;
3816
-                    if ($per_page > $chunk_per_page) {
3817
-                        $per_page = $chunk_per_page;
3818
-                    }
3819
-                    $total_pages = ceil( $chunk_per_page / $per_page );
3815
+					$per_page = 500;
3816
+					if ($per_page > $chunk_per_page) {
3817
+						$per_page = $chunk_per_page;
3818
+					}
3819
+					$total_pages = ceil( $chunk_per_page / $per_page );
3820 3820
                     
3821
-                    for ( $i = 0; $i <= $total_pages; $i++ ) {
3822
-                        $save_terms = array_slice( $chunk_save_terms , ( $i * $per_page ), $per_page );
3821
+					for ( $i = 0; $i <= $total_pages; $i++ ) {
3822
+						$save_terms = array_slice( $chunk_save_terms , ( $i * $per_page ), $per_page );
3823 3823
                         
3824
-                        $clear = $i == 0 ? true : false;
3825
-                        geodir_save_csv_data( $file_path_temp, $save_terms, $clear );
3826
-                    }
3824
+						$clear = $i == 0 ? true : false;
3825
+						geodir_save_csv_data( $file_path_temp, $save_terms, $clear );
3826
+					}
3827 3827
                     
3828
-                    if ( $wp_filesystem->exists( $file_path_temp ) ) {
3829
-                        $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3830
-                        $chunk_file_name = $file_name . $chunk_page_no . '.csv';
3831
-                        $file_path = $csv_file_dir . '/' . $chunk_file_name;
3832
-                        $wp_filesystem->move( $file_path_temp, $file_path, true );
3828
+					if ( $wp_filesystem->exists( $file_path_temp ) ) {
3829
+						$chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3830
+						$chunk_file_name = $file_name . $chunk_page_no . '.csv';
3831
+						$file_path = $csv_file_dir . '/' . $chunk_file_name;
3832
+						$wp_filesystem->move( $file_path_temp, $file_path, true );
3833 3833
                         
3834
-                        $file_url = $file_url_base . $chunk_file_name;
3835
-                        $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3836
-                    }
3834
+						$file_url = $file_url_base . $chunk_file_name;
3835
+						$chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3836
+					}
3837 3837
                     
3838
-                    if ( !empty($chunk_file_paths) ) {
3839
-                        $json['total'] = $terms_count;
3840
-                        $json['files'] = $chunk_file_paths;
3841
-                    } else {
3842
-                        $json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' );
3843
-                    }
3844
-                }
3845
-                // WPML
3846
-                if ($is_wpml) {
3847
-                    $sitepress->switch_lang($active_lang, true);
3848
-                }
3849
-                // WPML
3850
-                wp_send_json( $json );
3851
-            }
3852
-        }
3853
-        break;
3854
-        case 'export_locations': {
3855
-            $file_url_base = geodir_path_import_export() . '/';
3856
-            $file_name = 'gd_locations_' . date( 'dmyHi' );
3857
-            $file_url = $file_url_base . $file_name . '.csv';
3858
-            $file_path = $csv_file_dir . '/' . $file_name . '.csv';
3859
-            $file_path_temp = $csv_file_dir . '/gd_locations_' . $nonce . '.csv';
3838
+					if ( !empty($chunk_file_paths) ) {
3839
+						$json['total'] = $terms_count;
3840
+						$json['files'] = $chunk_file_paths;
3841
+					} else {
3842
+						$json['error'] = __( 'ERROR: Could not create csv file. This is usually due to inconsistent file permissions.', 'geodirectory' );
3843
+					}
3844
+				}
3845
+				// WPML
3846
+				if ($is_wpml) {
3847
+					$sitepress->switch_lang($active_lang, true);
3848
+				}
3849
+				// WPML
3850
+				wp_send_json( $json );
3851
+			}
3852
+		}
3853
+		break;
3854
+		case 'export_locations': {
3855
+			$file_url_base = geodir_path_import_export() . '/';
3856
+			$file_name = 'gd_locations_' . date( 'dmyHi' );
3857
+			$file_url = $file_url_base . $file_name . '.csv';
3858
+			$file_path = $csv_file_dir . '/' . $file_name . '.csv';
3859
+			$file_path_temp = $csv_file_dir . '/gd_locations_' . $nonce . '.csv';
3860 3860
             
3861
-            $items_count = (int)geodir_location_imex_count_locations();
3861
+			$items_count = (int)geodir_location_imex_count_locations();
3862 3862
             
3863
-            if ( isset( $_REQUEST['_st'] ) ) {
3864
-                $line_count = (int)geodir_import_export_line_count( $file_path_temp );
3865
-                $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0;
3866
-                $percentage = min( $percentage, 100 );
3863
+			if ( isset( $_REQUEST['_st'] ) ) {
3864
+				$line_count = (int)geodir_import_export_line_count( $file_path_temp );
3865
+				$percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0;
3866
+				$percentage = min( $percentage, 100 );
3867 3867
                 
3868
-                $json['percentage'] = $percentage;
3869
-                wp_send_json( $json );
3870
-            } else {
3871
-                $chunk_file_paths = array();
3868
+				$json['percentage'] = $percentage;
3869
+				wp_send_json( $json );
3870
+			} else {
3871
+				$chunk_file_paths = array();
3872 3872
                 
3873
-                if ( !$items_count > 0 ) {
3874
-                    $json['error'] = __( 'No records to export.', 'geodirectory' );
3875
-                } else {
3876
-                    $chunk_per_page = min( $chunk_per_page, $items_count );
3877
-                    $chunk_total_pages = ceil( $items_count / $chunk_per_page );
3873
+				if ( !$items_count > 0 ) {
3874
+					$json['error'] = __( 'No records to export.', 'geodirectory' );
3875
+				} else {
3876
+					$chunk_per_page = min( $chunk_per_page, $items_count );
3877
+					$chunk_total_pages = ceil( $items_count / $chunk_per_page );
3878 3878
                     
3879
-                    $j = $chunk_page_no;
3880
-                    $chunk_save_items = geodir_location_imex_locations_data( $chunk_per_page, $j );
3879
+					$j = $chunk_page_no;
3880
+					$chunk_save_items = geodir_location_imex_locations_data( $chunk_per_page, $j );
3881 3881
                     
3882
-                    $per_page = 500;
3883
-                    $per_page = min( $per_page, $chunk_per_page );
3884
-                    $total_pages = ceil( $chunk_per_page / $per_page );
3882
+					$per_page = 500;
3883
+					$per_page = min( $per_page, $chunk_per_page );
3884
+					$total_pages = ceil( $chunk_per_page / $per_page );
3885 3885
                     
3886
-                    for ( $i = 0; $i <= $total_pages; $i++ ) {
3887
-                        $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page );
3886
+					for ( $i = 0; $i <= $total_pages; $i++ ) {
3887
+						$save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page );
3888 3888
                         
3889
-                        $clear = $i == 0 ? true : false;
3890
-                        geodir_save_csv_data( $file_path_temp, $save_items, $clear );
3891
-                    }
3889
+						$clear = $i == 0 ? true : false;
3890
+						geodir_save_csv_data( $file_path_temp, $save_items, $clear );
3891
+					}
3892 3892
                     
3893
-                    if ( $wp_filesystem->exists( $file_path_temp ) ) {
3894
-                        $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3895
-                        $chunk_file_name = $file_name . $chunk_page_no . '.csv';
3896
-                        $file_path = $csv_file_dir . '/' . $chunk_file_name;
3897
-                        $wp_filesystem->move( $file_path_temp, $file_path, true );
3893
+					if ( $wp_filesystem->exists( $file_path_temp ) ) {
3894
+						$chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3895
+						$chunk_file_name = $file_name . $chunk_page_no . '.csv';
3896
+						$file_path = $csv_file_dir . '/' . $chunk_file_name;
3897
+						$wp_filesystem->move( $file_path_temp, $file_path, true );
3898 3898
                         
3899
-                        $file_url = $file_url_base . $chunk_file_name;
3900
-                        $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3901
-                    }
3899
+						$file_url = $file_url_base . $chunk_file_name;
3900
+						$chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3901
+					}
3902 3902
                     
3903
-                    if ( !empty($chunk_file_paths) ) {
3904
-                        $json['total'] = $items_count;
3905
-                        $json['files'] = $chunk_file_paths;
3906
-                    } else {
3907
-                        $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' );
3908
-                    }
3909
-                }
3910
-                wp_send_json( $json );
3911
-            }
3912
-        }
3913
-        break;
3914
-        case 'export_hoods': {
3915
-            $file_url_base = geodir_path_import_export() . '/';
3916
-            $file_name = 'gd_neighbourhoods_' . date( 'dmyHi' );
3917
-            $file_url = $file_url_base . $file_name . '.csv';
3918
-            $file_path = $csv_file_dir . '/' . $file_name . '.csv';
3919
-            $file_path_temp = $csv_file_dir . '/gd_neighbourhoods_' . $nonce . '.csv';
3903
+					if ( !empty($chunk_file_paths) ) {
3904
+						$json['total'] = $items_count;
3905
+						$json['files'] = $chunk_file_paths;
3906
+					} else {
3907
+						$json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' );
3908
+					}
3909
+				}
3910
+				wp_send_json( $json );
3911
+			}
3912
+		}
3913
+		break;
3914
+		case 'export_hoods': {
3915
+			$file_url_base = geodir_path_import_export() . '/';
3916
+			$file_name = 'gd_neighbourhoods_' . date( 'dmyHi' );
3917
+			$file_url = $file_url_base . $file_name . '.csv';
3918
+			$file_path = $csv_file_dir . '/' . $file_name . '.csv';
3919
+			$file_path_temp = $csv_file_dir . '/gd_neighbourhoods_' . $nonce . '.csv';
3920 3920
             
3921
-            $items_count = (int)geodir_location_imex_count_neighbourhoods();
3921
+			$items_count = (int)geodir_location_imex_count_neighbourhoods();
3922 3922
             
3923
-            if ( isset( $_REQUEST['_st'] ) ) {
3924
-                $line_count = (int)geodir_import_export_line_count( $file_path_temp );
3925
-                $percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0;
3926
-                $percentage = min( $percentage, 100 );
3923
+			if ( isset( $_REQUEST['_st'] ) ) {
3924
+				$line_count = (int)geodir_import_export_line_count( $file_path_temp );
3925
+				$percentage = count( $items_count ) > 0 && $line_count > 0 ? ceil( $line_count / $items_count ) * 100 : 0;
3926
+				$percentage = min( $percentage, 100 );
3927 3927
                 
3928
-                $json['percentage'] = $percentage;
3929
-                wp_send_json( $json );
3930
-            } else {
3931
-                $chunk_file_paths = array();
3928
+				$json['percentage'] = $percentage;
3929
+				wp_send_json( $json );
3930
+			} else {
3931
+				$chunk_file_paths = array();
3932 3932
                 
3933
-                if ( !$items_count > 0 ) {
3934
-                    $json['error'] = __( 'No records to export.', 'geodirectory' );
3935
-                } else {
3936
-                    $chunk_per_page = min( $chunk_per_page, $items_count );
3937
-                    $chunk_total_pages = ceil( $items_count / $chunk_per_page );
3933
+				if ( !$items_count > 0 ) {
3934
+					$json['error'] = __( 'No records to export.', 'geodirectory' );
3935
+				} else {
3936
+					$chunk_per_page = min( $chunk_per_page, $items_count );
3937
+					$chunk_total_pages = ceil( $items_count / $chunk_per_page );
3938 3938
                     
3939
-                    $j = $chunk_page_no;
3940
-                    $chunk_save_items = geodir_location_imex_neighbourhoods_data( $chunk_per_page, $j );
3939
+					$j = $chunk_page_no;
3940
+					$chunk_save_items = geodir_location_imex_neighbourhoods_data( $chunk_per_page, $j );
3941 3941
                     
3942
-                    $per_page = 500;
3943
-                    $per_page = min( $per_page, $chunk_per_page );
3944
-                    $total_pages = ceil( $chunk_per_page / $per_page );
3942
+					$per_page = 500;
3943
+					$per_page = min( $per_page, $chunk_per_page );
3944
+					$total_pages = ceil( $chunk_per_page / $per_page );
3945 3945
                     
3946
-                    for ( $i = 0; $i <= $total_pages; $i++ ) {
3947
-                        $save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page );
3946
+					for ( $i = 0; $i <= $total_pages; $i++ ) {
3947
+						$save_items = array_slice( $chunk_save_items , ( $i * $per_page ), $per_page );
3948 3948
                         
3949
-                        $clear = $i == 0 ? true : false;
3950
-                        geodir_save_csv_data( $file_path_temp, $save_items, $clear );
3951
-                    }
3949
+						$clear = $i == 0 ? true : false;
3950
+						geodir_save_csv_data( $file_path_temp, $save_items, $clear );
3951
+					}
3952 3952
                     
3953
-                    if ( $wp_filesystem->exists( $file_path_temp ) ) {
3954
-                        $chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3955
-                        $chunk_file_name = $file_name . $chunk_page_no . '.csv';
3956
-                        $file_path = $csv_file_dir . '/' . $chunk_file_name;
3957
-                        $wp_filesystem->move( $file_path_temp, $file_path, true );
3953
+					if ( $wp_filesystem->exists( $file_path_temp ) ) {
3954
+						$chunk_page_no = $chunk_total_pages > 1 ? '-' . $j : '';
3955
+						$chunk_file_name = $file_name . $chunk_page_no . '.csv';
3956
+						$file_path = $csv_file_dir . '/' . $chunk_file_name;
3957
+						$wp_filesystem->move( $file_path_temp, $file_path, true );
3958 3958
                         
3959
-                        $file_url = $file_url_base . $chunk_file_name;
3960
-                        $chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3961
-                    }
3959
+						$file_url = $file_url_base . $chunk_file_name;
3960
+						$chunk_file_paths[] = array('i' => $j . '.', 'u' => $file_url, 's' => size_format(filesize($file_path), 2));
3961
+					}
3962 3962
                     
3963
-                    if ( !empty($chunk_file_paths) ) {
3964
-                        $json['total'] = $items_count;
3965
-                        $json['files'] = $chunk_file_paths;
3966
-                    } else {
3967
-                        $json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' );
3968
-                    }
3969
-                }
3970
-                wp_send_json( $json );
3971
-            }
3972
-        }
3973
-        break;
3974
-        case 'prepare_import':
3975
-        case 'import_cat':
3976
-        case 'import_post':
3977
-        case 'import_loc':
3978
-        case 'import_hood': {
3979
-            // WPML
3980
-            $is_wpml = geodir_is_wpml();
3981
-            if ($is_wpml) {
3982
-                global $sitepress;
3983
-                $active_lang = ICL_LANGUAGE_CODE;
3984
-            }
3985
-            // WPML
3963
+					if ( !empty($chunk_file_paths) ) {
3964
+						$json['total'] = $items_count;
3965
+						$json['files'] = $chunk_file_paths;
3966
+					} else {
3967
+						$json['error'] = __( 'Fail, something wrong to create csv file.', 'geodirectory' );
3968
+					}
3969
+				}
3970
+				wp_send_json( $json );
3971
+			}
3972
+		}
3973
+		break;
3974
+		case 'prepare_import':
3975
+		case 'import_cat':
3976
+		case 'import_post':
3977
+		case 'import_loc':
3978
+		case 'import_hood': {
3979
+			// WPML
3980
+			$is_wpml = geodir_is_wpml();
3981
+			if ($is_wpml) {
3982
+				global $sitepress;
3983
+				$active_lang = ICL_LANGUAGE_CODE;
3984
+			}
3985
+			// WPML
3986 3986
             
3987
-            ini_set( 'auto_detect_line_endings', true );
3987
+			ini_set( 'auto_detect_line_endings', true );
3988 3988
             
3989
-            $uploads = wp_upload_dir();
3990
-            $uploads_dir = $uploads['path'];
3991
-            $uploads_subdir = $uploads['subdir'];
3989
+			$uploads = wp_upload_dir();
3990
+			$uploads_dir = $uploads['path'];
3991
+			$uploads_subdir = $uploads['subdir'];
3992 3992
             
3993
-            $csv_file = isset( $_POST['_file'] ) ? $_POST['_file'] : NULL;
3994
-            $import_choice = isset( $_REQUEST['_ch'] ) ? $_REQUEST['_ch'] : 'skip';
3993
+			$csv_file = isset( $_POST['_file'] ) ? $_POST['_file'] : NULL;
3994
+			$import_choice = isset( $_REQUEST['_ch'] ) ? $_REQUEST['_ch'] : 'skip';
3995 3995
             
3996
-            $csv_file_arr = explode( '/', $csv_file );
3997
-            $csv_filename = end( $csv_file_arr );
3998
-            $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $csv_filename;
3996
+			$csv_file_arr = explode( '/', $csv_file );
3997
+			$csv_filename = end( $csv_file_arr );
3998
+			$target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $csv_filename;
3999 3999
             
4000
-            $json['file'] = $csv_file;
4001
-            $json['error'] = __( 'The uploaded file is not a valid csv file. Please try again.', 'geodirectory' );
4002
-            $file = array();
4000
+			$json['file'] = $csv_file;
4001
+			$json['error'] = __( 'The uploaded file is not a valid csv file. Please try again.', 'geodirectory' );
4002
+			$file = array();
4003 4003
 
4004
-            if ( $csv_file && $wp_filesystem->is_file( $target_path ) && $wp_filesystem->exists( $target_path ) ) {
4005
-                $wp_filetype = wp_check_filetype_and_ext( $target_path, $csv_filename );
4004
+			if ( $csv_file && $wp_filesystem->is_file( $target_path ) && $wp_filesystem->exists( $target_path ) ) {
4005
+				$wp_filetype = wp_check_filetype_and_ext( $target_path, $csv_filename );
4006 4006
                 
4007
-                if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') {
4008
-                    $json['error'] = NULL;
4009
-                    $json['rows'] = 0;
4007
+				if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') {
4008
+					$json['error'] = NULL;
4009
+					$json['rows'] = 0;
4010 4010
                     
4011
-                    if ( ( $handle = fopen($target_path, "r" ) ) !== FALSE ) {
4012
-                        while ( ( $data = fgetcsv( $handle, 100000, "," ) ) !== FALSE ) {
4013
-                            if ( !empty( $data ) ) {
4014
-                                $file[] = $data;
4015
-                            }
4016
-                        }
4017
-                        fclose($handle);
4018
-                    }
4011
+					if ( ( $handle = fopen($target_path, "r" ) ) !== FALSE ) {
4012
+						while ( ( $data = fgetcsv( $handle, 100000, "," ) ) !== FALSE ) {
4013
+							if ( !empty( $data ) ) {
4014
+								$file[] = $data;
4015
+							}
4016
+						}
4017
+						fclose($handle);
4018
+					}
4019 4019
 
4020
-                    $json['rows'] = (!empty($file) && count($file) > 1) ? count($file) - 1 : 0;
4020
+					$json['rows'] = (!empty($file) && count($file) > 1) ? count($file) - 1 : 0;
4021 4021
                     
4022
-                    if (!$json['rows'] > 0) {
4023
-                        $json['error'] = __('No data found in csv file.', 'geodirectory');
4024
-                    }
4025
-                } else {
4026
-                    wp_send_json( $json );
4027
-                }
4028
-            } else {
4029
-                wp_send_json( $json );
4030
-            }
4022
+					if (!$json['rows'] > 0) {
4023
+						$json['error'] = __('No data found in csv file.', 'geodirectory');
4024
+					}
4025
+				} else {
4026
+					wp_send_json( $json );
4027
+				}
4028
+			} else {
4029
+				wp_send_json( $json );
4030
+			}
4031 4031
             
4032
-            if ( $task == 'prepare_import' || !empty( $json['error'] ) ) {
4033
-                wp_send_json( $json );
4034
-            }
4032
+			if ( $task == 'prepare_import' || !empty( $json['error'] ) ) {
4033
+				wp_send_json( $json );
4034
+			}
4035 4035
             
4036
-            $total = $json['rows'];
4037
-            $limit = isset($_POST['limit']) ? (int)$_POST['limit'] : 1;
4038
-            $processed = isset($_POST['processed']) ? (int)$_POST['processed'] : 0;
4036
+			$total = $json['rows'];
4037
+			$limit = isset($_POST['limit']) ? (int)$_POST['limit'] : 1;
4038
+			$processed = isset($_POST['processed']) ? (int)$_POST['processed'] : 0;
4039 4039
             
4040
-            $count = $limit;
4040
+			$count = $limit;
4041 4041
             
4042
-            if ($count < $total) {
4043
-                $count = $processed + $count;
4044
-                if ($count > $total) {
4045
-                    $count = $total;
4046
-                }
4047
-            } else {
4048
-                $count = $total;
4049
-            }
4042
+			if ($count < $total) {
4043
+				$count = $processed + $count;
4044
+				if ($count > $total) {
4045
+					$count = $total;
4046
+				}
4047
+			} else {
4048
+				$count = $total;
4049
+			}
4050 4050
             
4051
-            $created = 0;
4052
-            $updated = 0;
4053
-            $skipped = 0;
4054
-            $invalid = 0;
4055
-            $invalid_addr = 0;
4056
-            $images = 0;
4051
+			$created = 0;
4052
+			$updated = 0;
4053
+			$skipped = 0;
4054
+			$invalid = 0;
4055
+			$invalid_addr = 0;
4056
+			$images = 0;
4057 4057
             
4058
-            $gd_post_info = array();
4059
-            $countpost = 0;
4058
+			$gd_post_info = array();
4059
+			$countpost = 0;
4060 4060
             
4061
-            $post_types = geodir_get_posttypes();
4061
+			$post_types = geodir_get_posttypes();
4062 4062
 
4063
-            if ( $task == 'import_cat' ) {
4064
-                if (!empty($file)) {
4065
-                    $columns = isset($file[0]) ? $file[0] : NULL;
4063
+			if ( $task == 'import_cat' ) {
4064
+				if (!empty($file)) {
4065
+					$columns = isset($file[0]) ? $file[0] : NULL;
4066 4066
                     
4067
-                    if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4068
-                        $json['error'] = CSV_INVAILD_FILE;
4069
-                        wp_send_json( $json );
4070
-                        exit;
4071
-                    }
4067
+					if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4068
+						$json['error'] = CSV_INVAILD_FILE;
4069
+						wp_send_json( $json );
4070
+						exit;
4071
+					}
4072 4072
                     
4073
-                    $gd_error_log = __('GD IMPORT CATEGORIES [ROW %d]:', 'geodirectory');
4073
+					$gd_error_log = __('GD IMPORT CATEGORIES [ROW %d]:', 'geodirectory');
4074 4074
                     
4075
-                    for ($i = 1; $i <= $limit; $i++) {
4076
-                        $index = $processed + $i;
4075
+					for ($i = 1; $i <= $limit; $i++) {
4076
+						$index = $processed + $i;
4077 4077
                         
4078
-                        if (isset($file[$index])) {
4079
-                            $row = $file[$index];
4080
-                            $row = array_map( 'trim', $row );
4081
-                            //$row = array_map( 'utf8_encode', $row );
4078
+						if (isset($file[$index])) {
4079
+							$row = $file[$index];
4080
+							$row = array_map( 'trim', $row );
4081
+							//$row = array_map( 'utf8_encode', $row );
4082 4082
                             
4083
-                            $cat_id = '';
4084
-                            $cat_name = '';
4085
-                            $cat_slug = '';
4086
-                            $cat_posttype = '';
4087
-                            $cat_parent = '';
4088
-                            $cat_description = '';
4089
-                            $cat_schema = '';
4090
-                            $cat_top_description = '';
4091
-                            $cat_image = '';
4092
-                            $cat_icon = '';
4093
-                            $cat_language = '';
4094
-                            $cat_id_original = '';
4083
+							$cat_id = '';
4084
+							$cat_name = '';
4085
+							$cat_slug = '';
4086
+							$cat_posttype = '';
4087
+							$cat_parent = '';
4088
+							$cat_description = '';
4089
+							$cat_schema = '';
4090
+							$cat_top_description = '';
4091
+							$cat_image = '';
4092
+							$cat_icon = '';
4093
+							$cat_language = '';
4094
+							$cat_id_original = '';
4095 4095
                             
4096
-                            $c = 0;
4097
-                            foreach ($columns as $column ) {
4098
-                                if ( $column == 'cat_id' ) {
4099
-                                    $cat_id = (int)$row[$c];
4100
-                                } else if ( $column == 'cat_name' ) {
4101
-                                    $cat_name = $row[$c];
4102
-                                } else if ( $column == 'cat_slug' ) {
4103
-                                    $cat_slug = $row[$c];
4104
-                                } else if ( $column == 'cat_posttype' ) {
4105
-                                    $cat_posttype = $row[$c];
4106
-                                } else if ( $column == 'cat_parent' ) {
4107
-                                    $cat_parent = trim($row[$c]);
4108
-                                } else if ( $column == 'cat_schema' && $row[$c] != '' ) {
4109
-                                    $cat_schema = $row[$c];
4110
-                                } else if ( $column == 'cat_description' ) {
4111
-                                    $cat_description = $row[$c];
4112
-                                } else if ( $column == 'cat_top_description' ) {
4113
-                                    $cat_top_description = $row[$c];
4114
-                                } else if ( $column == 'cat_image' ) {
4115
-                                    $cat_image = $row[$c];
4116
-                                } else if ( $column == 'cat_icon' ) {
4117
-                                    $cat_icon = $row[$c];
4118
-                                }
4119
-                                // WPML
4120
-                                if ( $is_wpml ) {
4121
-                                    if ( $column == 'cat_language' ) {
4122
-                                        $cat_language = geodir_strtolower( trim( $row[$c] ) );
4123
-                                    } else if ( $column == 'cat_id_original' ) {
4124
-                                        $cat_id_original = (int)$row[$c];
4125
-                                    }
4126
-                                }
4127
-                                // WPML
4128
-                                $c++;
4129
-                            }
4096
+							$c = 0;
4097
+							foreach ($columns as $column ) {
4098
+								if ( $column == 'cat_id' ) {
4099
+									$cat_id = (int)$row[$c];
4100
+								} else if ( $column == 'cat_name' ) {
4101
+									$cat_name = $row[$c];
4102
+								} else if ( $column == 'cat_slug' ) {
4103
+									$cat_slug = $row[$c];
4104
+								} else if ( $column == 'cat_posttype' ) {
4105
+									$cat_posttype = $row[$c];
4106
+								} else if ( $column == 'cat_parent' ) {
4107
+									$cat_parent = trim($row[$c]);
4108
+								} else if ( $column == 'cat_schema' && $row[$c] != '' ) {
4109
+									$cat_schema = $row[$c];
4110
+								} else if ( $column == 'cat_description' ) {
4111
+									$cat_description = $row[$c];
4112
+								} else if ( $column == 'cat_top_description' ) {
4113
+									$cat_top_description = $row[$c];
4114
+								} else if ( $column == 'cat_image' ) {
4115
+									$cat_image = $row[$c];
4116
+								} else if ( $column == 'cat_icon' ) {
4117
+									$cat_icon = $row[$c];
4118
+								}
4119
+								// WPML
4120
+								if ( $is_wpml ) {
4121
+									if ( $column == 'cat_language' ) {
4122
+										$cat_language = geodir_strtolower( trim( $row[$c] ) );
4123
+									} else if ( $column == 'cat_id_original' ) {
4124
+										$cat_id_original = (int)$row[$c];
4125
+									}
4126
+								}
4127
+								// WPML
4128
+								$c++;
4129
+							}
4130 4130
                             
4131
-                            if ( $cat_name == '' || !in_array( $cat_posttype, $post_types ) ) {
4132
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) );
4131
+							if ( $cat_name == '' || !in_array( $cat_posttype, $post_types ) ) {
4132
+								geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) );
4133 4133
                                 
4134
-                                $invalid++;
4135
-                                continue;
4136
-                            }
4134
+								$invalid++;
4135
+								continue;
4136
+							}
4137 4137
                             
4138
-                            // WPML
4139
-                            if ($is_wpml && $cat_language != '') {
4140
-                                $sitepress->switch_lang($cat_language, true);
4141
-                            }
4142
-                            // WPML
4138
+							// WPML
4139
+							if ($is_wpml && $cat_language != '') {
4140
+								$sitepress->switch_lang($cat_language, true);
4141
+							}
4142
+							// WPML
4143 4143
                                                         
4144
-                            $term_data = array();
4145
-                            $term_data['name'] = $cat_name;
4146
-                            $term_data['slug'] = $cat_slug;
4147
-                            $term_data['description'] = $cat_description;
4148
-                            $term_data['cat_schema'] = $cat_schema;
4149
-                            $term_data['top_description'] = $cat_top_description;
4150
-                            $term_data['image'] = $cat_image != '' ? basename( $cat_image ) : '';
4151
-                            $term_data['icon'] = $cat_icon != '' ? basename( $cat_icon ) : '';
4144
+							$term_data = array();
4145
+							$term_data['name'] = $cat_name;
4146
+							$term_data['slug'] = $cat_slug;
4147
+							$term_data['description'] = $cat_description;
4148
+							$term_data['cat_schema'] = $cat_schema;
4149
+							$term_data['top_description'] = $cat_top_description;
4150
+							$term_data['image'] = $cat_image != '' ? basename( $cat_image ) : '';
4151
+							$term_data['icon'] = $cat_icon != '' ? basename( $cat_icon ) : '';
4152 4152
                             
4153
-                            //$term_data = array_map( 'utf8_encode', $term_data );
4153
+							//$term_data = array_map( 'utf8_encode', $term_data );
4154 4154
                             
4155
-                            $taxonomy = $cat_posttype . 'category';
4155
+							$taxonomy = $cat_posttype . 'category';
4156 4156
                             
4157
-                            $term_data['taxonomy'] = $taxonomy;
4157
+							$term_data['taxonomy'] = $taxonomy;
4158 4158
 
4159
-                            $term_parent_id = 0;
4160
-                            if ($cat_parent != "" || (int)$cat_parent > 0) {
4161
-                                $term_parent = '';
4159
+							$term_parent_id = 0;
4160
+							if ($cat_parent != "" || (int)$cat_parent > 0) {
4161
+								$term_parent = '';
4162 4162
                                 
4163
-                                if ( $term_parent = get_term_by( 'name', $cat_parent, $taxonomy ) ) {
4164
-                                    //
4165
-                                } else if ( $term_parent = get_term_by( 'slug', $cat_parent, $taxonomy ) ) {
4166
-                                    //
4167
-                                } else if ( $term_parent = get_term_by( 'id', $cat_parent, $taxonomy ) ) {
4168
-                                    //
4169
-                                } else {
4170
-                                    $term_parent_data = array();
4171
-                                    $term_parent_data['name'] = $cat_parent;
4172
-                                    //$term_parent_data = array_map( 'utf8_encode', $term_parent_data );
4173
-                                    $term_parent_data['taxonomy'] = $taxonomy;
4163
+								if ( $term_parent = get_term_by( 'name', $cat_parent, $taxonomy ) ) {
4164
+									//
4165
+								} else if ( $term_parent = get_term_by( 'slug', $cat_parent, $taxonomy ) ) {
4166
+									//
4167
+								} else if ( $term_parent = get_term_by( 'id', $cat_parent, $taxonomy ) ) {
4168
+									//
4169
+								} else {
4170
+									$term_parent_data = array();
4171
+									$term_parent_data['name'] = $cat_parent;
4172
+									//$term_parent_data = array_map( 'utf8_encode', $term_parent_data );
4173
+									$term_parent_data['taxonomy'] = $taxonomy;
4174 4174
                                     
4175
-                                    $term_parent_id = (int)geodir_imex_insert_term( $taxonomy, $term_parent_data );
4176
-                                }
4175
+									$term_parent_id = (int)geodir_imex_insert_term( $taxonomy, $term_parent_data );
4176
+								}
4177 4177
                                 
4178
-                                if ( !empty( $term_parent ) && !is_wp_error( $term_parent ) ) {
4179
-                                    $term_parent_id = (int)$term_parent->term_id;
4180
-                                }
4181
-                            }
4182
-                            $term_data['parent'] = (int)$term_parent_id;
4178
+								if ( !empty( $term_parent ) && !is_wp_error( $term_parent ) ) {
4179
+									$term_parent_id = (int)$term_parent->term_id;
4180
+								}
4181
+							}
4182
+							$term_data['parent'] = (int)$term_parent_id;
4183 4183
 
4184
-                            $term_id = NULL;
4185
-                            if ( $import_choice == 'update' ) {
4186
-                                if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
4187
-                                    $term_data['term_id'] = $term['term_id'];
4184
+							$term_id = NULL;
4185
+							if ( $import_choice == 'update' ) {
4186
+								if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
4187
+									$term_data['term_id'] = $term['term_id'];
4188 4188
                                     
4189
-                                    if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
4190
-                                        $updated++;
4191
-                                    } else {
4192
-                                        $invalid++;
4193
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4194
-                                    }
4195
-                                } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
4196
-                                    $term_data['term_id'] = $term['term_id'];
4189
+									if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
4190
+										$updated++;
4191
+									} else {
4192
+										$invalid++;
4193
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4194
+									}
4195
+								} else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
4196
+									$term_data['term_id'] = $term['term_id'];
4197 4197
                                     
4198
-                                    if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
4199
-                                        $updated++;
4200
-                                    } else {
4201
-                                        $invalid++;
4202
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4203
-                                    }
4204
-                                } else {
4205
-                                    if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
4206
-                                        $created++;
4207
-                                    } else {
4208
-                                        $invalid++;
4209
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4210
-                                    }
4211
-                                }
4212
-                            } else if ( $import_choice == 'skip' ) {
4213
-                                if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
4214
-                                    $skipped++;
4215
-                                } else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
4216
-                                    $skipped++;
4217
-                                } else {
4218
-                                    if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
4219
-                                        $created++;
4220
-                                    } else {
4221
-                                        $invalid++;
4222
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4223
-                                    }
4224
-                                }
4225
-                            } else {
4226
-                                $invalid++;
4227
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4228
-                            }
4198
+									if ( $term_id = geodir_imex_update_term( $taxonomy, $term_data ) ) {
4199
+										$updated++;
4200
+									} else {
4201
+										$invalid++;
4202
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4203
+									}
4204
+								} else {
4205
+									if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
4206
+										$created++;
4207
+									} else {
4208
+										$invalid++;
4209
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4210
+									}
4211
+								}
4212
+							} else if ( $import_choice == 'skip' ) {
4213
+								if ( $cat_id > 0 && $term = (array)term_exists( $cat_id, $taxonomy ) ) {
4214
+									$skipped++;
4215
+								} else if ( $term_data['slug'] != '' && $term = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
4216
+									$skipped++;
4217
+								} else {
4218
+									if ( $term_id = geodir_imex_insert_term( $taxonomy, $term_data ) ) {
4219
+										$created++;
4220
+									} else {
4221
+										$invalid++;
4222
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be updated due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4223
+									}
4224
+								}
4225
+							} else {
4226
+								$invalid++;
4227
+								geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to invalid data (check & remove if any invalid characters used in data)', 'geodirectory' ) );
4228
+							}
4229 4229
                             
4230
-                            if ( $term_id ) {
4231
-                                // WPML
4232
-                                if ($is_wpml && $cat_id_original > 0 && $cat_language != '') {
4233
-                                    $wpml_element_type = 'tax_' . $taxonomy;
4234
-                                    $source_language = geodir_get_language_for_element( $cat_id_original, $wpml_element_type );
4235
-                                    $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language();
4236
-
4237
-                                    $trid = $sitepress->get_element_trid( $cat_id_original, $wpml_element_type );
4230
+							if ( $term_id ) {
4231
+								// WPML
4232
+								if ($is_wpml && $cat_id_original > 0 && $cat_language != '') {
4233
+									$wpml_element_type = 'tax_' . $taxonomy;
4234
+									$source_language = geodir_get_language_for_element( $cat_id_original, $wpml_element_type );
4235
+									$source_language = $source_language != '' ? $source_language : $sitepress->get_default_language();
4236
+
4237
+									$trid = $sitepress->get_element_trid( $cat_id_original, $wpml_element_type );
4238 4238
                                     
4239
-                                    $sitepress->set_element_language_details( $term_id, $wpml_element_type, $trid, $cat_language, $source_language );
4240
-                                }
4241
-                                // WPML
4239
+									$sitepress->set_element_language_details( $term_id, $wpml_element_type, $trid, $cat_language, $source_language );
4240
+								}
4241
+								// WPML
4242 4242
                                 
4243
-                                if ( isset( $term_data['top_description'] ) ) {
4244
-                                    update_tax_meta( $term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype );
4245
-                                }
4243
+								if ( isset( $term_data['top_description'] ) ) {
4244
+									update_tax_meta( $term_id, 'ct_cat_top_desc', $term_data['top_description'], $cat_posttype );
4245
+								}
4246 4246
                                 
4247
-                                if ( isset( $term_data['cat_schema'] ) ) {
4248
-                                    update_tax_meta( $term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype );
4249
-                                }
4247
+								if ( isset( $term_data['cat_schema'] ) ) {
4248
+									update_tax_meta( $term_id, 'ct_cat_schema', $term_data['cat_schema'], $cat_posttype );
4249
+								}
4250 4250
             
4251
-                                $attachment = false;
4252
-                                if ( isset( $term_data['image'] ) && $term_data['image'] != '' ) {
4253
-                                    $cat_image = geodir_get_default_catimage( $term_id, $cat_posttype );
4254
-                                    $cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : '';
4251
+								$attachment = false;
4252
+								if ( isset( $term_data['image'] ) && $term_data['image'] != '' ) {
4253
+									$cat_image = geodir_get_default_catimage( $term_id, $cat_posttype );
4254
+									$cat_image = !empty( $cat_image ) && isset( $cat_image['src'] ) ? $cat_image['src'] : '';
4255 4255
                                     
4256
-                                    if ( basename($cat_image) != $term_data['image'] ) {
4257
-                                        $attachment = true;
4258
-                                        update_tax_meta( $term_id, 'ct_cat_default_img', array( 'id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image'] ), $cat_posttype );
4259
-                                    }
4260
-                                }
4256
+									if ( basename($cat_image) != $term_data['image'] ) {
4257
+										$attachment = true;
4258
+										update_tax_meta( $term_id, 'ct_cat_default_img', array( 'id' => 'image', 'src' => $uploads['url'] . '/' . $term_data['image'] ), $cat_posttype );
4259
+									}
4260
+								}
4261 4261
                                 
4262
-                                if ( isset( $term_data['icon'] ) && $term_data['icon'] != '' ) {
4263
-                                    $cat_icon = get_tax_meta( $term_id, 'ct_cat_icon', false, $cat_posttype );
4264
-                                    $cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : '';
4262
+								if ( isset( $term_data['icon'] ) && $term_data['icon'] != '' ) {
4263
+									$cat_icon = get_tax_meta( $term_id, 'ct_cat_icon', false, $cat_posttype );
4264
+									$cat_icon = !empty( $cat_icon ) && isset( $cat_icon['src'] ) ? $cat_icon['src'] : '';
4265 4265
                                         
4266
-                                    if ( basename($cat_icon) != $term_data['icon'] ) {
4267
-                                        $attachment = true;
4268
-                                        update_tax_meta( $term_id, 'ct_cat_icon', array( 'id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon'] ), $cat_posttype );
4269
-                                    }
4270
-                                }
4266
+									if ( basename($cat_icon) != $term_data['icon'] ) {
4267
+										$attachment = true;
4268
+										update_tax_meta( $term_id, 'ct_cat_icon', array( 'id' => 'icon', 'src' => $uploads['url'] . '/' . $term_data['icon'] ), $cat_posttype );
4269
+									}
4270
+								}
4271 4271
                                 
4272
-                                if ( $attachment ) {
4273
-                                    $images++;
4274
-                                }
4275
-                            }
4272
+								if ( $attachment ) {
4273
+									$images++;
4274
+								}
4275
+							}
4276 4276
                             
4277
-                            // WPML
4278
-                            if ($is_wpml && $cat_language != '') {
4279
-                                $sitepress->switch_lang($active_lang, true);
4280
-                            }
4281
-                            // WPML
4282
-                        }
4283
-                    }
4284
-                }
4277
+							// WPML
4278
+							if ($is_wpml && $cat_language != '') {
4279
+								$sitepress->switch_lang($active_lang, true);
4280
+							}
4281
+							// WPML
4282
+						}
4283
+					}
4284
+				}
4285 4285
                 
4286
-                $json = array();
4287
-                $json['processed'] = $limit;
4288
-                $json['created'] = $created;
4289
-                $json['updated'] = $updated;
4290
-                $json['skipped'] = $skipped;
4291
-                $json['invalid'] = $invalid;
4292
-                $json['images'] = $images;
4286
+				$json = array();
4287
+				$json['processed'] = $limit;
4288
+				$json['created'] = $created;
4289
+				$json['updated'] = $updated;
4290
+				$json['skipped'] = $skipped;
4291
+				$json['invalid'] = $invalid;
4292
+				$json['images'] = $images;
4293 4293
                 
4294
-                wp_send_json( $json );
4295
-                exit;
4296
-            } else if ( $task == 'import_post' ) {
4297
-                //run some stuff to make the import quicker
4298
-                wp_defer_term_counting( true );
4299
-                wp_defer_comment_counting( true );
4300
-                $wpdb->query( 'SET autocommit = 0;' );
4301
-
4302
-                //remove_all_actions('publish_post');
4303
-                //remove_all_actions('transition_post_status');
4304
-                //remove_all_actions('publish_future_post');
4305
-
4306
-                if (!empty($file)) {
4307
-                    $wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses.
4308
-                    $default_status = 'publish';
4309
-                    $current_date = date_i18n( 'Y-m-d', time() );
4294
+				wp_send_json( $json );
4295
+				exit;
4296
+			} else if ( $task == 'import_post' ) {
4297
+				//run some stuff to make the import quicker
4298
+				wp_defer_term_counting( true );
4299
+				wp_defer_comment_counting( true );
4300
+				$wpdb->query( 'SET autocommit = 0;' );
4301
+
4302
+				//remove_all_actions('publish_post');
4303
+				//remove_all_actions('transition_post_status');
4304
+				//remove_all_actions('publish_future_post');
4305
+
4306
+				if (!empty($file)) {
4307
+					$wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses.
4308
+					$default_status = 'publish';
4309
+					$current_date = date_i18n( 'Y-m-d', time() );
4310 4310
                     
4311
-                    $columns = isset($file[0]) ? $file[0] : NULL;
4311
+					$columns = isset($file[0]) ? $file[0] : NULL;
4312 4312
                     
4313
-                    if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4314
-                        $json['error'] = CSV_INVAILD_FILE;
4315
-                        wp_send_json( $json );
4316
-                        exit;
4317
-                    }
4313
+					if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4314
+						$json['error'] = CSV_INVAILD_FILE;
4315
+						wp_send_json( $json );
4316
+						exit;
4317
+					}
4318 4318
 
4319
-                    $gd_error_log = __('GD IMPORT LISTINGS [ROW %d]:', 'geodirectory');
4320
-                    $wp_chars_error = __( '(check & remove if any invalid characters used in data)', 'geodirectory' );
4321
-                    $processed_actual = 0;
4322
-                    for ($i = 1; $i <= $limit; $i++) {
4323
-                        $index = $processed + $i;
4324
-                        $gd_post = array();
4319
+					$gd_error_log = __('GD IMPORT LISTINGS [ROW %d]:', 'geodirectory');
4320
+					$wp_chars_error = __( '(check & remove if any invalid characters used in data)', 'geodirectory' );
4321
+					$processed_actual = 0;
4322
+					for ($i = 1; $i <= $limit; $i++) {
4323
+						$index = $processed + $i;
4324
+						$gd_post = array();
4325 4325
                         
4326
-                        if (isset($file[$index])) {
4327
-                            $processed_actual++;
4328
-                            $row = $file[$index];
4329
-                            $row = array_map( 'trim', $row );
4330
-                            //$row = array_map( 'utf8_encode', $row );
4331
-                            $row = array_map( 'addslashes_gpc', $row );
4326
+						if (isset($file[$index])) {
4327
+							$processed_actual++;
4328
+							$row = $file[$index];
4329
+							$row = array_map( 'trim', $row );
4330
+							//$row = array_map( 'utf8_encode', $row );
4331
+							$row = array_map( 'addslashes_gpc', $row );
4332 4332
                             
4333
-                            $post_id = '';
4334
-                            $post_title = '';
4335
-                            $post_author = '';
4336
-                            $post_content = '';
4337
-                            $post_category_arr = array();
4338
-                            $default_category = '';
4339
-                            $post_tags = array();
4340
-                            $post_type = '';
4341
-                            $post_status = '';
4342
-                            $geodir_video = '';
4343
-                            $post_address = '';
4344
-                            $post_city = '';
4345
-                            $post_region = '';
4346
-                            $post_country = '';
4347
-                            $post_zip = '';
4348
-                            $post_latitude = '';
4349
-                            $post_longitude = '';
4350
-                            $post_neighbourhood = '';
4351
-                            $neighbourhood_latitude = '';
4352
-                            $neighbourhood_longitude = '';
4353
-                            $geodir_timing = '';
4354
-                            $geodir_contact = '';
4355
-                            $geodir_email = '';
4356
-                            $geodir_website = '';
4357
-                            $geodir_twitter = '';
4358
-                            $geodir_facebook = '';
4359
-                            $geodir_twitter = '';
4360
-                            $post_images = array();
4333
+							$post_id = '';
4334
+							$post_title = '';
4335
+							$post_author = '';
4336
+							$post_content = '';
4337
+							$post_category_arr = array();
4338
+							$default_category = '';
4339
+							$post_tags = array();
4340
+							$post_type = '';
4341
+							$post_status = '';
4342
+							$geodir_video = '';
4343
+							$post_address = '';
4344
+							$post_city = '';
4345
+							$post_region = '';
4346
+							$post_country = '';
4347
+							$post_zip = '';
4348
+							$post_latitude = '';
4349
+							$post_longitude = '';
4350
+							$post_neighbourhood = '';
4351
+							$neighbourhood_latitude = '';
4352
+							$neighbourhood_longitude = '';
4353
+							$geodir_timing = '';
4354
+							$geodir_contact = '';
4355
+							$geodir_email = '';
4356
+							$geodir_website = '';
4357
+							$geodir_twitter = '';
4358
+							$geodir_facebook = '';
4359
+							$geodir_twitter = '';
4360
+							$post_images = array();
4361 4361
                             
4362
-                            $expire_date = 'Never';
4362
+							$expire_date = 'Never';
4363 4363
                             
4364
-                            $language = '';
4365
-                            $original_post_id = '';
4364
+							$language = '';
4365
+							$original_post_id = '';
4366 4366
                                                         
4367
-                            $c = 0;
4368
-                            foreach ($columns as $column ) {
4369
-                                $gd_post[$column] = $row[$c];
4367
+							$c = 0;
4368
+							foreach ($columns as $column ) {
4369
+								$gd_post[$column] = $row[$c];
4370 4370
                                 
4371
-                                if ( $column == 'post_id' ) {
4372
-                                    $post_id = $row[$c];
4373
-                                } else if ( $column == 'post_title' ) {
4374
-                                    $post_title = sanitize_text_field($row[$c]);
4375
-                                } else if ( $column == 'post_author' ) {
4376
-                                    $post_author = $row[$c];
4377
-                                } else if ( $column == 'post_content' ) {
4378
-                                    $post_content = $row[$c];
4379
-                                } else if ( $column == 'post_category' && $row[$c] != '' ) {
4380
-                                    $post_category_arr = explode( ',', $row[$c] );
4381
-                                } else if ( $column == 'default_category' ) {
4382
-                                    $default_category = wp_kses_normalize_entities($row[$c]);
4383
-                                } else if ( $column == 'post_tags' && $row[$c] != '' ) {
4384
-                                    $post_tags = explode( ',', sanitize_text_field($row[$c]) );
4385
-                                } else if ( $column == 'post_type' ) {
4386
-                                    $post_type = $row[$c];
4387
-                                } else if ( $column == 'post_status' ) {
4388
-                                    $post_status = sanitize_key( $row[$c] );
4389
-                                } else if ( $column == 'is_featured' ) {
4390
-                                    $is_featured = (int)$row[$c];
4391
-                                } else if ( $column == 'geodir_video' ) {
4392
-                                    $geodir_video = $row[$c];
4393
-                                } else if ( $column == 'post_address' ) {
4394
-                                    $post_address = sanitize_text_field($row[$c]);
4395
-                                } else if ( $column == 'post_city' ) {
4396
-                                    $post_city = sanitize_text_field($row[$c]);
4397
-                                } else if ( $column == 'post_region' ) {
4398
-                                    $post_region = sanitize_text_field($row[$c]);
4399
-                                } else if ( $column == 'post_country' ) {
4400
-                                    $post_country = sanitize_text_field($row[$c]);
4401
-                                } else if ( $column == 'post_zip' ) {
4402
-                                    $post_zip = sanitize_text_field($row[$c]);
4403
-                                } else if ( $column == 'post_latitude' ) {
4404
-                                    $post_latitude = sanitize_text_field($row[$c]);
4405
-                                } else if ( $column == 'post_longitude' ) {
4406
-                                    $post_longitude = sanitize_text_field($row[$c]);
4407
-                                } else if ( $column == 'post_neighbourhood' ) {
4408
-                                    $post_neighbourhood = sanitize_text_field($row[$c]);
4409
-                                    unset($gd_post[$column]);
4410
-                                } else if ( $column == 'neighbourhood_latitude' ) {
4411
-                                    $neighbourhood_latitude = sanitize_text_field($row[$c]);
4412
-                                } else if ( $column == 'neighbourhood_longitude' ) {
4413
-                                    $neighbourhood_longitude = sanitize_text_field($row[$c]);
4414
-                                } else if ( $column == 'geodir_timing' ) {
4415
-                                    $geodir_timing = sanitize_text_field($row[$c]);
4416
-                                } else if ( $column == 'geodir_contact' ) {
4417
-                                    $geodir_contact = sanitize_text_field($row[$c]);
4418
-                                } else if ( $column == 'geodir_email' ) {
4419
-                                    $geodir_email = sanitize_email($row[$c]);
4420
-                                } else if ( $column == 'geodir_website' ) {
4421
-                                    $geodir_website = sanitize_text_field($row[$c]);
4422
-                                } else if ( $column == 'geodir_twitter' ) {
4423
-                                    $geodir_twitter = sanitize_text_field($row[$c]);
4424
-                                } else if ( $column == 'geodir_facebook' ) {
4425
-                                    $geodir_facebook = sanitize_text_field($row[$c]);
4426
-                                } else if ( $column == 'IMAGE' && !empty( $row[$c] ) && $row[$c] != '' ) {
4427
-                                    $post_images[] = $row[$c];
4428
-                                } else if ( $column == 'alive_days' && (int)$row[$c] > 0 ) {
4429
-                                    $expire_date = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$row[$c] . ' days' ) );
4430
-                                } else if ( $column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never' ) {
4431
-                                    $row[$c] = str_replace('/', '-', $row[$c]);
4432
-                                    $expire_date = date_i18n( 'Y-m-d', strtotime( $row[$c] ) );
4433
-                                }
4434
-                                // WPML
4435
-                                if ($is_wpml) {
4436
-                                    if ($column == 'language') {
4437
-                                        $language = geodir_strtolower(trim($row[$c]));
4438
-                                    } else if ($column == 'original_post_id') {
4439
-                                        $original_post_id = (int)$row[$c];
4440
-                                    }
4441
-                                }
4442
-                                // WPML
4443
-                                $c++;
4444
-                            }
4371
+								if ( $column == 'post_id' ) {
4372
+									$post_id = $row[$c];
4373
+								} else if ( $column == 'post_title' ) {
4374
+									$post_title = sanitize_text_field($row[$c]);
4375
+								} else if ( $column == 'post_author' ) {
4376
+									$post_author = $row[$c];
4377
+								} else if ( $column == 'post_content' ) {
4378
+									$post_content = $row[$c];
4379
+								} else if ( $column == 'post_category' && $row[$c] != '' ) {
4380
+									$post_category_arr = explode( ',', $row[$c] );
4381
+								} else if ( $column == 'default_category' ) {
4382
+									$default_category = wp_kses_normalize_entities($row[$c]);
4383
+								} else if ( $column == 'post_tags' && $row[$c] != '' ) {
4384
+									$post_tags = explode( ',', sanitize_text_field($row[$c]) );
4385
+								} else if ( $column == 'post_type' ) {
4386
+									$post_type = $row[$c];
4387
+								} else if ( $column == 'post_status' ) {
4388
+									$post_status = sanitize_key( $row[$c] );
4389
+								} else if ( $column == 'is_featured' ) {
4390
+									$is_featured = (int)$row[$c];
4391
+								} else if ( $column == 'geodir_video' ) {
4392
+									$geodir_video = $row[$c];
4393
+								} else if ( $column == 'post_address' ) {
4394
+									$post_address = sanitize_text_field($row[$c]);
4395
+								} else if ( $column == 'post_city' ) {
4396
+									$post_city = sanitize_text_field($row[$c]);
4397
+								} else if ( $column == 'post_region' ) {
4398
+									$post_region = sanitize_text_field($row[$c]);
4399
+								} else if ( $column == 'post_country' ) {
4400
+									$post_country = sanitize_text_field($row[$c]);
4401
+								} else if ( $column == 'post_zip' ) {
4402
+									$post_zip = sanitize_text_field($row[$c]);
4403
+								} else if ( $column == 'post_latitude' ) {
4404
+									$post_latitude = sanitize_text_field($row[$c]);
4405
+								} else if ( $column == 'post_longitude' ) {
4406
+									$post_longitude = sanitize_text_field($row[$c]);
4407
+								} else if ( $column == 'post_neighbourhood' ) {
4408
+									$post_neighbourhood = sanitize_text_field($row[$c]);
4409
+									unset($gd_post[$column]);
4410
+								} else if ( $column == 'neighbourhood_latitude' ) {
4411
+									$neighbourhood_latitude = sanitize_text_field($row[$c]);
4412
+								} else if ( $column == 'neighbourhood_longitude' ) {
4413
+									$neighbourhood_longitude = sanitize_text_field($row[$c]);
4414
+								} else if ( $column == 'geodir_timing' ) {
4415
+									$geodir_timing = sanitize_text_field($row[$c]);
4416
+								} else if ( $column == 'geodir_contact' ) {
4417
+									$geodir_contact = sanitize_text_field($row[$c]);
4418
+								} else if ( $column == 'geodir_email' ) {
4419
+									$geodir_email = sanitize_email($row[$c]);
4420
+								} else if ( $column == 'geodir_website' ) {
4421
+									$geodir_website = sanitize_text_field($row[$c]);
4422
+								} else if ( $column == 'geodir_twitter' ) {
4423
+									$geodir_twitter = sanitize_text_field($row[$c]);
4424
+								} else if ( $column == 'geodir_facebook' ) {
4425
+									$geodir_facebook = sanitize_text_field($row[$c]);
4426
+								} else if ( $column == 'IMAGE' && !empty( $row[$c] ) && $row[$c] != '' ) {
4427
+									$post_images[] = $row[$c];
4428
+								} else if ( $column == 'alive_days' && (int)$row[$c] > 0 ) {
4429
+									$expire_date = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$row[$c] . ' days' ) );
4430
+								} else if ( $column == 'expire_date' && $row[$c] != '' && geodir_strtolower($row[$c]) != 'never' ) {
4431
+									$row[$c] = str_replace('/', '-', $row[$c]);
4432
+									$expire_date = date_i18n( 'Y-m-d', strtotime( $row[$c] ) );
4433
+								}
4434
+								// WPML
4435
+								if ($is_wpml) {
4436
+									if ($column == 'language') {
4437
+										$language = geodir_strtolower(trim($row[$c]));
4438
+									} else if ($column == 'original_post_id') {
4439
+										$original_post_id = (int)$row[$c];
4440
+									}
4441
+								}
4442
+								// WPML
4443
+								$c++;
4444
+							}
4445 4445
                             
4446
-                            // WPML
4447
-                            if ($is_wpml && $language != '') {
4448
-                                $sitepress->switch_lang($language, true);
4449
-                            }
4450
-                            // WPML
4446
+							// WPML
4447
+							if ($is_wpml && $language != '') {
4448
+								$sitepress->switch_lang($language, true);
4449
+							}
4450
+							// WPML
4451 4451
 
4452
-                            $gd_post['IMAGE'] = $post_images;
4452
+							$gd_post['IMAGE'] = $post_images;
4453 4453
                             
4454
-                            $post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status;
4455
-                            $post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status;
4454
+							$post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status;
4455
+							$post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status;
4456 4456
                                                                                                                 
4457
-                            $valid = true;
4458
-                            
4459
-                            if ( $post_title == '' || !in_array( $post_type, $post_types ) ) {
4460
-                                $invalid++;
4461
-                                $valid = false;
4462
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) );
4463
-                            }
4457
+							$valid = true;
4464 4458
                             
4465
-                            $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true;
4466
-                            if ( $location_allowed ) {
4467
-                                $location_result = geodir_get_default_location();
4468
-                                if ( $post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '' ) {
4469
-                                    $invalid_addr++;
4470
-                                    $valid = false;
4471
-                                    geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) );
4472
-                                } else if ( !empty( $location_result ) && $location_result->location_id == 0 ) {
4473
-                                    if ( ( geodir_strtolower( $post_city ) != geodir_strtolower( $location_result->city ) ) || ( geodir_strtolower( $post_region ) != geodir_strtolower( $location_result->region ) ) || (geodir_strtolower( $post_country ) != geodir_strtolower( $location_result->country ) ) ) {
4474
-                                        $invalid_addr++;
4475
-                                        $valid = false;
4476
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) );
4477
-                                    } else {
4478
-                                        if (!$location_manager) {
4479
-                                            $gd_post['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // Set the default location when location manager not activated.
4480
-                                        }
4481
-                                    }
4482
-                                }
4483
-                            }
4459
+							if ( $post_title == '' || !in_array( $post_type, $post_types ) ) {
4460
+								$invalid++;
4461
+								$valid = false;
4462
+								geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank title/invalid post type', 'geodirectory' ) );
4463
+							}
4484 4464
                             
4485
-                            if ( !$valid ) {
4486
-                                continue;
4487
-                            }
4465
+							$location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true;
4466
+							if ( $location_allowed ) {
4467
+								$location_result = geodir_get_default_location();
4468
+								if ( $post_address == '' || $post_city == '' || $post_region == '' || $post_country == '' || $post_latitude == '' || $post_longitude == '' ) {
4469
+									$invalid_addr++;
4470
+									$valid = false;
4471
+									geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) );
4472
+								} else if ( !empty( $location_result ) && $location_result->location_id == 0 ) {
4473
+									if ( ( geodir_strtolower( $post_city ) != geodir_strtolower( $location_result->city ) ) || ( geodir_strtolower( $post_region ) != geodir_strtolower( $location_result->region ) ) || (geodir_strtolower( $post_country ) != geodir_strtolower( $location_result->country ) ) ) {
4474
+										$invalid_addr++;
4475
+										$valid = false;
4476
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . __( 'Could not be added due to blank/invalid address(city, region, country, latitude, longitude).', 'geodirectory' ) );
4477
+									} else {
4478
+										if (!$location_manager) {
4479
+											$gd_post['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // Set the default location when location manager not activated.
4480
+										}
4481
+									}
4482
+								}
4483
+							}
4484
+                            
4485
+							if ( !$valid ) {
4486
+								continue;
4487
+							}
4488 4488
 
4489
-                            $cat_taxonomy = $post_type . 'category';
4490
-                            $tags_taxonomy = $post_type . '_tags';
4489
+							$cat_taxonomy = $post_type . 'category';
4490
+							$tags_taxonomy = $post_type . '_tags';
4491 4491
                             
4492
-                            if ($default_category != '' && !in_array($default_category, $post_category_arr)) {
4493
-                                $post_category_arr = array_merge(array($default_category), $post_category_arr);
4494
-                            }
4492
+							if ($default_category != '' && !in_array($default_category, $post_category_arr)) {
4493
+								$post_category_arr = array_merge(array($default_category), $post_category_arr);
4494
+							}
4495 4495
 
4496
-                            $post_category = array();
4497
-                            $default_category_id = NULL;
4498
-                            if ( !empty( $post_category_arr ) ) {
4499
-                                foreach ( $post_category_arr as $value ) {
4500
-                                    $category_name = wp_kses_normalize_entities( trim( $value ) );
4496
+							$post_category = array();
4497
+							$default_category_id = NULL;
4498
+							if ( !empty( $post_category_arr ) ) {
4499
+								foreach ( $post_category_arr as $value ) {
4500
+									$category_name = wp_kses_normalize_entities( trim( $value ) );
4501 4501
                                     
4502
-                                    if ( $category_name != '' ) {
4503
-                                        $term_category = array();
4502
+									if ( $category_name != '' ) {
4503
+										$term_category = array();
4504 4504
                                         
4505
-                                        if ( $term = get_term_by( 'name', $category_name, $cat_taxonomy ) ) {
4506
-                                            $term_category = $term;
4507
-                                        } else if ( $term = get_term_by( 'slug', $category_name, $cat_taxonomy ) ) {
4508
-                                            $term_category = $term;
4509
-                                        } else {
4510
-                                            $term_data = array();
4511
-                                            $term_data['name'] = $category_name;
4512
-                                            $term_data['taxonomy'] = $cat_taxonomy;
4505
+										if ( $term = get_term_by( 'name', $category_name, $cat_taxonomy ) ) {
4506
+											$term_category = $term;
4507
+										} else if ( $term = get_term_by( 'slug', $category_name, $cat_taxonomy ) ) {
4508
+											$term_category = $term;
4509
+										} else {
4510
+											$term_data = array();
4511
+											$term_data['name'] = $category_name;
4512
+											$term_data['taxonomy'] = $cat_taxonomy;
4513 4513
                                             
4514
-                                            $term_id = geodir_imex_insert_term( $cat_taxonomy, $term_data );
4515
-                                            if ( $term_id ) {
4516
-                                                $term_category = get_term( $term_id, $cat_taxonomy );
4517
-                                            }
4518
-                                        }
4514
+											$term_id = geodir_imex_insert_term( $cat_taxonomy, $term_data );
4515
+											if ( $term_id ) {
4516
+												$term_category = get_term( $term_id, $cat_taxonomy );
4517
+											}
4518
+										}
4519 4519
                                         
4520
-                                        if ( !empty( $term_category ) && !is_wp_error( $term_category ) ) {
4521
-                                            $post_category[] = intval($term_category->term_id);
4520
+										if ( !empty( $term_category ) && !is_wp_error( $term_category ) ) {
4521
+											$post_category[] = intval($term_category->term_id);
4522 4522
                                             
4523
-                                            if ($category_name == $default_category) {
4524
-                                                $default_category_id = intval($term_category->term_id);
4525
-                                            }
4526
-                                        }
4527
-                                    }
4528
-                                }
4529
-                            }
4523
+											if ($category_name == $default_category) {
4524
+												$default_category_id = intval($term_category->term_id);
4525
+											}
4526
+										}
4527
+									}
4528
+								}
4529
+							}
4530 4530
 
4531
-                            $save_post = array();
4532
-                            $save_post['post_title'] = $post_title;
4533
-                            $save_post['post_content'] = $post_content;
4534
-                            $save_post['post_type'] = $post_type;
4535
-                            $save_post['post_author'] = $post_author;
4536
-                            $save_post['post_status'] = $post_status;
4537
-                            $save_post['post_category'] = $post_category;
4538
-                            $save_post['post_tags'] = $post_tags;
4539
-
4540
-                            $saved_post_id = NULL;
4541
-                            if ( $import_choice == 'update' ) {
4542
-                                $gd_wp_error = __( 'Unable to add listing, please check the listing data.', 'geodirectory' );
4531
+							$save_post = array();
4532
+							$save_post['post_title'] = $post_title;
4533
+							$save_post['post_content'] = $post_content;
4534
+							$save_post['post_type'] = $post_type;
4535
+							$save_post['post_author'] = $post_author;
4536
+							$save_post['post_status'] = $post_status;
4537
+							$save_post['post_category'] = $post_category;
4538
+							$save_post['post_tags'] = $post_tags;
4539
+
4540
+							$saved_post_id = NULL;
4541
+							if ( $import_choice == 'update' ) {
4542
+								$gd_wp_error = __( 'Unable to add listing, please check the listing data.', 'geodirectory' );
4543 4543
                                 
4544
-                                if ( $post_id > 0 && get_post( $post_id ) ) {
4545
-                                    $save_post['ID'] = $post_id;
4544
+								if ( $post_id > 0 && get_post( $post_id ) ) {
4545
+									$save_post['ID'] = $post_id;
4546 4546
                                     
4547
-                                    if ( $saved_post_id = wp_update_post( $save_post, true ) ) {
4548
-                                        if ( is_wp_error( $saved_post_id ) ) {
4549
-                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4550
-                                            $saved_post_id = 0;
4551
-                                        } else {
4552
-                                            $saved_post_id = $post_id;
4553
-                                            $updated++;
4554
-                                        }
4555
-                                    }
4556
-                                } else {
4557
-                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4558
-                                        if ( is_wp_error( $saved_post_id ) ) {
4559
-                                            $gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4560
-                                            $saved_post_id = 0;
4561
-                                        } else {
4562
-                                            $created++;
4563
-                                        }
4564
-                                    }
4565
-                                }
4547
+									if ( $saved_post_id = wp_update_post( $save_post, true ) ) {
4548
+										if ( is_wp_error( $saved_post_id ) ) {
4549
+											$gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4550
+											$saved_post_id = 0;
4551
+										} else {
4552
+											$saved_post_id = $post_id;
4553
+											$updated++;
4554
+										}
4555
+									}
4556
+								} else {
4557
+									if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4558
+										if ( is_wp_error( $saved_post_id ) ) {
4559
+											$gd_wp_error = $saved_post_id->get_error_message() . ' ' . $wp_chars_error;
4560
+											$saved_post_id = 0;
4561
+										} else {
4562
+											$created++;
4563
+										}
4564
+									}
4565
+								}
4566 4566
                                 
4567
-                                if ( !$saved_post_id > 0 ) {
4568
-                                    $invalid++;
4569
-                                    geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_wp_error );
4570
-                                }
4571
-                            } else if ( $import_choice == 'skip' ) {
4572
-                                if ( $post_id > 0 && get_post( $post_id ) ) {
4573
-                                    $skipped++;	
4574
-                                } else {
4575
-                                    if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4576
-                                        if ( is_wp_error( $saved_post_id ) ) {
4577
-                                            $invalid++;
4567
+								if ( !$saved_post_id > 0 ) {
4568
+									$invalid++;
4569
+									geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_wp_error );
4570
+								}
4571
+							} else if ( $import_choice == 'skip' ) {
4572
+								if ( $post_id > 0 && get_post( $post_id ) ) {
4573
+									$skipped++;	
4574
+								} else {
4575
+									if ( $saved_post_id = wp_insert_post( $save_post, true ) ) {
4576
+										if ( is_wp_error( $saved_post_id ) ) {
4577
+											$invalid++;
4578 4578
                                             
4579
-                                            geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $saved_post_id->get_error_message() . ' ' . $wp_chars_error );
4580
-                                            $saved_post_id = 0;
4581
-                                        } else {
4582
-                                            $created++;
4583
-                                        }
4584
-                                    } else {
4585
-                                        $invalid++;
4579
+											geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $saved_post_id->get_error_message() . ' ' . $wp_chars_error );
4580
+											$saved_post_id = 0;
4581
+										} else {
4582
+											$created++;
4583
+										}
4584
+									} else {
4585
+										$invalid++;
4586 4586
                                         
4587
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error );
4588
-                                    }
4589
-                                }
4590
-                            } else {
4591
-                                $invalid++;
4587
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error );
4588
+									}
4589
+								}
4590
+							} else {
4591
+								$invalid++;
4592 4592
                                 
4593
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error );
4594
-                            }
4593
+								geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $wp_chars_error );
4594
+							}
4595 4595
 
4596
-                            if ( (int)$saved_post_id > 0 ) {
4597
-                                // WPML
4598
-                                if ($is_wpml && $original_post_id > 0 && $language != '') {
4599
-                                    $wpml_post_type = 'post_' . $post_type;
4600
-                                    $source_language = geodir_get_language_for_element( $original_post_id, $wpml_post_type );
4601
-                                    $source_language = $source_language != '' ? $source_language : $sitepress->get_default_language();
4596
+							if ( (int)$saved_post_id > 0 ) {
4597
+								// WPML
4598
+								if ($is_wpml && $original_post_id > 0 && $language != '') {
4599
+									$wpml_post_type = 'post_' . $post_type;
4600
+									$source_language = geodir_get_language_for_element( $original_post_id, $wpml_post_type );
4601
+									$source_language = $source_language != '' ? $source_language : $sitepress->get_default_language();
4602 4602
 
4603
-                                    $trid = $sitepress->get_element_trid( $original_post_id, $wpml_post_type );
4603
+									$trid = $sitepress->get_element_trid( $original_post_id, $wpml_post_type );
4604 4604
                                     
4605
-                                    $sitepress->set_element_language_details( $saved_post_id, $wpml_post_type, $trid, $language, $source_language );
4606
-                                }
4607
-                                // WPML
4608
-                                $gd_post_info = geodir_get_post_info( $saved_post_id );
4605
+									$sitepress->set_element_language_details( $saved_post_id, $wpml_post_type, $trid, $language, $source_language );
4606
+								}
4607
+								// WPML
4608
+								$gd_post_info = geodir_get_post_info( $saved_post_id );
4609 4609
                                 
4610
-                                $gd_post['post_id'] = $saved_post_id;
4611
-                                $gd_post['ID'] = $saved_post_id;
4612
-                                $gd_post['post_tags'] = $post_tags;
4613
-                                $gd_post['post_title'] = $post_title;
4614
-                                $gd_post['post_status'] = $post_status;
4615
-                                $gd_post['submit_time'] = time();
4616
-                                $gd_post['submit_ip'] = $_SERVER['REMOTE_ADDR'];
4610
+								$gd_post['post_id'] = $saved_post_id;
4611
+								$gd_post['ID'] = $saved_post_id;
4612
+								$gd_post['post_tags'] = $post_tags;
4613
+								$gd_post['post_title'] = $post_title;
4614
+								$gd_post['post_status'] = $post_status;
4615
+								$gd_post['submit_time'] = time();
4616
+								$gd_post['submit_ip'] = $_SERVER['REMOTE_ADDR'];
4617 4617
                                                     
4618
-                                // post location
4619
-                                $post_location_id = 0;
4620
-                                if ( $location_allowed && !empty( $location_result ) && $location_result->location_id > 0 ) {
4621
-                                    $gd_post['post_neighbourhood'] = '';
4618
+								// post location
4619
+								$post_location_id = 0;
4620
+								if ( $location_allowed && !empty( $location_result ) && $location_result->location_id > 0 ) {
4621
+									$gd_post['post_neighbourhood'] = '';
4622 4622
                                     
4623
-                                    $post_location_info = array(
4624
-                                                                'city' => $post_city,
4625
-                                                                'region' => $post_region,
4626
-                                                                'country' => $post_country,
4627
-                                                                'geo_lat' => $post_latitude,
4628
-                                                                'geo_lng' => $post_longitude
4629
-                                                            );
4630
-                                    if ( $location_id = (int)geodir_add_new_location( $post_location_info ) ) {
4631
-                                        $post_location_id = $location_id;
4632
-                                    }
4623
+									$post_location_info = array(
4624
+																'city' => $post_city,
4625
+																'region' => $post_region,
4626
+																'country' => $post_country,
4627
+																'geo_lat' => $post_latitude,
4628
+																'geo_lng' => $post_longitude
4629
+															);
4630
+									if ( $location_id = (int)geodir_add_new_location( $post_location_info ) ) {
4631
+										$post_location_id = $location_id;
4632
+									}
4633 4633
                                     
4634
-                                    if ($post_location_id > 0 && $neighbourhood_active && !empty($post_neighbourhood)) {
4635
-                                        $neighbourhood_info = geodir_location_neighbourhood_by_name_loc_id($post_neighbourhood, $post_location_id);
4634
+									if ($post_location_id > 0 && $neighbourhood_active && !empty($post_neighbourhood)) {
4635
+										$neighbourhood_info = geodir_location_neighbourhood_by_name_loc_id($post_neighbourhood, $post_location_id);
4636 4636
 
4637
-                                        $hood_data = array();
4638
-                                        $hood_data['hood_location_id'] = $post_location_id;
4639
-                                        $hood_data['hood_name'] = $post_neighbourhood;
4637
+										$hood_data = array();
4638
+										$hood_data['hood_location_id'] = $post_location_id;
4639
+										$hood_data['hood_name'] = $post_neighbourhood;
4640 4640
                                         
4641
-                                        if (!empty($neighbourhood_info)) {
4642
-                                            $hood_data['hood_id'] = $neighbourhood_info->hood_id;
4643
-                                            $hood_data['hood_slug'] = $neighbourhood_info->hood_slug;
4641
+										if (!empty($neighbourhood_info)) {
4642
+											$hood_data['hood_id'] = $neighbourhood_info->hood_id;
4643
+											$hood_data['hood_slug'] = $neighbourhood_info->hood_slug;
4644 4644
                                             
4645
-                                            if (empty($neighbourhood_latitude) || empty($neighbourhood_longitude)) {
4646
-                                                $neighbourhood_latitude = $neighbourhood_info->hood_latitude;
4647
-                                                $neighbourhood_longitude = $neighbourhood_info->hood_longitude;
4648
-                                            }
4649
-                                        }
4645
+											if (empty($neighbourhood_latitude) || empty($neighbourhood_longitude)) {
4646
+												$neighbourhood_latitude = $neighbourhood_info->hood_latitude;
4647
+												$neighbourhood_longitude = $neighbourhood_info->hood_longitude;
4648
+											}
4649
+										}
4650 4650
                                         
4651
-                                        if (empty($neighbourhood_latitude) || empty($neighbourhood_longitude)) {
4652
-                                            $neighbourhood_latitude = $neighbourhood_info->hood_latitude;
4653
-                                            $neighbourhood_longitude = $neighbourhood_info->hood_longitude;
4654
-                                        }
4651
+										if (empty($neighbourhood_latitude) || empty($neighbourhood_longitude)) {
4652
+											$neighbourhood_latitude = $neighbourhood_info->hood_latitude;
4653
+											$neighbourhood_longitude = $neighbourhood_info->hood_longitude;
4654
+										}
4655 4655
                                         
4656
-                                        $hood_data['hood_latitude'] = $post_latitude;
4657
-                                        $hood_data['hood_longitude'] = $post_longitude;
4656
+										$hood_data['hood_latitude'] = $post_latitude;
4657
+										$hood_data['hood_longitude'] = $post_longitude;
4658 4658
 
4659
-                                        $neighbourhood_info = geodir_location_insert_update_neighbourhood($hood_data);
4660
-                                        if (!empty($neighbourhood_info) && isset($neighbourhood_info->hood_slug)) {
4661
-                                            $gd_post['post_neighbourhood'] = $neighbourhood_info->hood_slug;
4662
-                                        }
4663
-                                    }
4664
-                                }
4665
-                                $gd_post['post_location_id'] = $post_location_id;
4659
+										$neighbourhood_info = geodir_location_insert_update_neighbourhood($hood_data);
4660
+										if (!empty($neighbourhood_info) && isset($neighbourhood_info->hood_slug)) {
4661
+											$gd_post['post_neighbourhood'] = $neighbourhood_info->hood_slug;
4662
+										}
4663
+									}
4664
+								}
4665
+								$gd_post['post_location_id'] = $post_location_id;
4666 4666
                                 
4667
-                                // post package info
4668
-                                $package_id = isset( $gd_post['package_id'] ) && !empty( $gd_post['package_id'] ) ? (int)$gd_post['package_id'] : 0;
4669
-                                if (!$package_id && !empty($gd_post_info) && isset($gd_post_info->package_id) && $gd_post_info->package_id) {
4670
-                                    $package_id = $gd_post_info->package_id;
4671
-                                }
4667
+								// post package info
4668
+								$package_id = isset( $gd_post['package_id'] ) && !empty( $gd_post['package_id'] ) ? (int)$gd_post['package_id'] : 0;
4669
+								if (!$package_id && !empty($gd_post_info) && isset($gd_post_info->package_id) && $gd_post_info->package_id) {
4670
+									$package_id = $gd_post_info->package_id;
4671
+								}
4672 4672
                                 
4673
-                                $package_info = array();
4674
-                                if ($package_id && function_exists('geodir_get_package_info_by_id')) {
4675
-                                    $package_info = (array)geodir_get_package_info_by_id($package_id);
4673
+								$package_info = array();
4674
+								if ($package_id && function_exists('geodir_get_package_info_by_id')) {
4675
+									$package_info = (array)geodir_get_package_info_by_id($package_id);
4676 4676
                                     
4677
-                                    if (!(!empty($package_info) && isset($package_info['post_type']) && $package_info['post_type'] == $post_type)) {
4678
-                                        $package_info = array();
4679
-                                    }
4680
-                                }
4677
+									if (!(!empty($package_info) && isset($package_info['post_type']) && $package_info['post_type'] == $post_type)) {
4678
+										$package_info = array();
4679
+									}
4680
+								}
4681 4681
                                 
4682
-                                if (empty($package_info)) {
4683
-                                    $package_info = (array)geodir_post_package_info( array(), '', $post_type );
4684
-                                }
4682
+								if (empty($package_info)) {
4683
+									$package_info = (array)geodir_post_package_info( array(), '', $post_type );
4684
+								}
4685 4685
                                  
4686
-                                if (!empty($package_info))	 {
4687
-                                    $package_id = $package_info['pid'];
4686
+								if (!empty($package_info))	 {
4687
+									$package_id = $package_info['pid'];
4688 4688
                                     
4689
-                                    if (isset($gd_post['alive_days']) || isset($gd_post['expire_date'])) {
4690
-                                        $gd_post['expire_date'] = $expire_date;
4691
-                                    } else {
4692
-                                        if ( isset( $package_info['days'] ) && (int)$package_info['days'] > 0 ) {
4693
-                                            $gd_post['alive_days'] = (int)$package_info['days'];
4694
-                                            $gd_post['expire_date'] = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$package_info['days'] . ' days' ) );
4695
-                                        } else {
4696
-                                            $gd_post['expire_date'] = 'Never';
4697
-                                        }
4698
-                                    }
4689
+									if (isset($gd_post['alive_days']) || isset($gd_post['expire_date'])) {
4690
+										$gd_post['expire_date'] = $expire_date;
4691
+									} else {
4692
+										if ( isset( $package_info['days'] ) && (int)$package_info['days'] > 0 ) {
4693
+											$gd_post['alive_days'] = (int)$package_info['days'];
4694
+											$gd_post['expire_date'] = date_i18n( 'Y-m-d', strtotime( $current_date . '+' . (int)$package_info['days'] . ' days' ) );
4695
+										} else {
4696
+											$gd_post['expire_date'] = 'Never';
4697
+										}
4698
+									}
4699 4699
                                     
4700
-                                    $gd_post['package_id'] = $package_id;
4701
-                                }
4700
+									$gd_post['package_id'] = $package_id;
4701
+								}
4702 4702
 
4703
-                                $table = $plugin_prefix . $post_type . '_detail';
4703
+								$table = $plugin_prefix . $post_type . '_detail';
4704 4704
                                 
4705
-                                if ($post_type == 'gd_event') {
4706
-                                    $gd_post = geodir_imex_process_event_data($gd_post);
4707
-                                }
4705
+								if ($post_type == 'gd_event') {
4706
+									$gd_post = geodir_imex_process_event_data($gd_post);
4707
+								}
4708 4708
                                 
4709
-                                if (isset($gd_post['post_id'])) {
4710
-                                    unset($gd_post['post_id']);
4711
-                                }
4709
+								if (isset($gd_post['post_id'])) {
4710
+									unset($gd_post['post_id']);
4711
+								}
4712 4712
 
4713
-                                // Export franchise fields
4714
-                                $is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false;
4715
-                                if ($is_franchise_active) {
4716
-                                    if ( isset( $gd_post['gd_is_franchise'] ) && (int)$gd_post['gd_is_franchise'] == 1 ) {
4717
-                                        $gd_franchise_lock = array();
4713
+								// Export franchise fields
4714
+								$is_franchise_active = is_plugin_active( 'geodir_franchise/geodir_franchise.php' ) && geodir_franchise_enabled( $post_type ) ? true : false;
4715
+								if ($is_franchise_active) {
4716
+									if ( isset( $gd_post['gd_is_franchise'] ) && (int)$gd_post['gd_is_franchise'] == 1 ) {
4717
+										$gd_franchise_lock = array();
4718 4718
                                         
4719
-                                        if ( isset( $gd_post['gd_franchise_lock'] ) ) {
4720
-                                            $gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock'] );
4721
-                                            $gd_franchise_lock = trim( $gd_franchise_lock );
4722
-                                            $gd_franchise_lock = explode( ",", $gd_franchise_lock );
4723
-                                        }
4719
+										if ( isset( $gd_post['gd_franchise_lock'] ) ) {
4720
+											$gd_franchise_lock = str_replace(" ", "", $gd_post['gd_franchise_lock'] );
4721
+											$gd_franchise_lock = trim( $gd_franchise_lock );
4722
+											$gd_franchise_lock = explode( ",", $gd_franchise_lock );
4723
+										}
4724 4724
                                         
4725
-                                        update_post_meta( $saved_post_id, 'gd_is_franchise', 1 );
4726
-                                        update_post_meta( $saved_post_id, 'gd_franchise_lock', $gd_franchise_lock );
4727
-                                    } else {
4728
-                                        if ( isset( $gd_post['franchise'] ) && (int)$gd_post['franchise'] > 0 && geodir_franchise_check( (int)$gd_post['franchise'] ) ) {
4729
-                                            geodir_save_post_meta( $saved_post_id, 'franchise', (int)$gd_post['franchise'] );
4730
-                                        }
4731
-                                    }
4732
-                                }
4725
+										update_post_meta( $saved_post_id, 'gd_is_franchise', 1 );
4726
+										update_post_meta( $saved_post_id, 'gd_franchise_lock', $gd_franchise_lock );
4727
+									} else {
4728
+										if ( isset( $gd_post['franchise'] ) && (int)$gd_post['franchise'] > 0 && geodir_franchise_check( (int)$gd_post['franchise'] ) ) {
4729
+											geodir_save_post_meta( $saved_post_id, 'franchise', (int)$gd_post['franchise'] );
4730
+										}
4731
+									}
4732
+								}
4733 4733
                                 
4734
-                                if (!empty($save_post['post_category']) && is_array($save_post['post_category'])) {
4735
-                                    $save_post['post_category'] = array_unique( array_map( 'intval', $save_post['post_category'] ) );
4736
-                                    if ($default_category_id) {
4737
-                                        $save_post['post_default_category'] = $default_category_id;
4738
-                                        $gd_post['default_category'] = $default_category_id;
4739
-                                    }
4740
-                                    $gd_post[$cat_taxonomy] = $save_post['post_category'];
4741
-                                }
4734
+								if (!empty($save_post['post_category']) && is_array($save_post['post_category'])) {
4735
+									$save_post['post_category'] = array_unique( array_map( 'intval', $save_post['post_category'] ) );
4736
+									if ($default_category_id) {
4737
+										$save_post['post_default_category'] = $default_category_id;
4738
+										$gd_post['default_category'] = $default_category_id;
4739
+									}
4740
+									$gd_post[$cat_taxonomy] = $save_post['post_category'];
4741
+								}
4742 4742
                                 
4743
-                                // Save post info
4744
-                                geodir_save_post_info( $saved_post_id, $gd_post );
4745
-                                // post taxonomies
4746
-                                if ( !empty( $save_post['post_category'] ) ) {
4747
-                                    wp_set_object_terms( $saved_post_id, $save_post['post_category'], $cat_taxonomy );
4743
+								// Save post info
4744
+								geodir_save_post_info( $saved_post_id, $gd_post );
4745
+								// post taxonomies
4746
+								if ( !empty( $save_post['post_category'] ) ) {
4747
+									wp_set_object_terms( $saved_post_id, $save_post['post_category'], $cat_taxonomy );
4748 4748
                                     
4749
-                                    $post_default_category = isset( $save_post['post_default_category'] ) ? $save_post['post_default_category'] : '';
4750
-                                    if ($default_category_id) {
4751
-                                        $post_default_category = $default_category_id;
4752
-                                    }
4753
-                                    $post_cat_ids = geodir_get_post_meta($saved_post_id, $cat_taxonomy);
4754
-                                    $save_post['post_category'] = !empty($post_cat_ids) ? explode(",", trim($post_cat_ids, ",")) : $save_post['post_category'];
4755
-                                    $post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']) . ',y:' : '';
4749
+									$post_default_category = isset( $save_post['post_default_category'] ) ? $save_post['post_default_category'] : '';
4750
+									if ($default_category_id) {
4751
+										$post_default_category = $default_category_id;
4752
+									}
4753
+									$post_cat_ids = geodir_get_post_meta($saved_post_id, $cat_taxonomy);
4754
+									$save_post['post_category'] = !empty($post_cat_ids) ? explode(",", trim($post_cat_ids, ",")) : $save_post['post_category'];
4755
+									$post_category_str = !empty($save_post['post_category']) ? implode(",y:#", $save_post['post_category']) . ',y:' : '';
4756 4756
                                     
4757
-                                    if ($post_category_str != '' && $post_default_category) {
4758
-                                        $post_category_str = str_replace($post_default_category . ',y:', $post_default_category . ',y,d:', $post_category_str);
4759
-                                    }
4757
+									if ($post_category_str != '' && $post_default_category) {
4758
+										$post_category_str = str_replace($post_default_category . ',y:', $post_default_category . ',y,d:', $post_category_str);
4759
+									}
4760 4760
                                     
4761
-                                    $post_category_str = $post_category_str != '' ? array($cat_taxonomy => $post_category_str) : '';
4761
+									$post_category_str = $post_category_str != '' ? array($cat_taxonomy => $post_category_str) : '';
4762 4762
                                     
4763
-                                    geodir_set_postcat_structure( $saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str );
4764
-                                }
4763
+									geodir_set_postcat_structure( $saved_post_id, $cat_taxonomy, $post_default_category, $post_category_str );
4764
+								}
4765 4765
 
4766
-                                if ( !empty( $save_post['post_tags'] ) ) {
4767
-                                    wp_set_object_terms( $saved_post_id, $save_post['post_tags'], $tags_taxonomy );
4768
-                                }
4766
+								if ( !empty( $save_post['post_tags'] ) ) {
4767
+									wp_set_object_terms( $saved_post_id, $save_post['post_tags'], $tags_taxonomy );
4768
+								}
4769 4769
 
4770
-                                // Post images
4771
-                                if ( !empty( $post_images ) ) {
4772
-                                    $post_images = array_unique($post_images);
4770
+								// Post images
4771
+								if ( !empty( $post_images ) ) {
4772
+									$post_images = array_unique($post_images);
4773 4773
                                     
4774
-                                    $old_post_images_arr = array();
4775
-                                    $saved_post_images_arr = array();
4774
+									$old_post_images_arr = array();
4775
+									$saved_post_images_arr = array();
4776 4776
                                     
4777
-                                    $order = 1;
4777
+									$order = 1;
4778 4778
                                     
4779
-                                    $old_post_images = geodir_get_images( $saved_post_id );
4780
-                                    if (!empty($old_post_images)) {
4781
-                                        foreach( $old_post_images as $old_post_image ) {
4782
-                                            if (!empty($old_post_image) && isset($old_post_image->file) && $old_post_image->file != '') {
4783
-                                                $old_post_images_arr[] = $old_post_image->file;
4784
-                                            }
4785
-                                        }
4786
-                                    }
4779
+									$old_post_images = geodir_get_images( $saved_post_id );
4780
+									if (!empty($old_post_images)) {
4781
+										foreach( $old_post_images as $old_post_image ) {
4782
+											if (!empty($old_post_image) && isset($old_post_image->file) && $old_post_image->file != '') {
4783
+												$old_post_images_arr[] = $old_post_image->file;
4784
+											}
4785
+										}
4786
+									}
4787 4787
                                     
4788
-                                    foreach ( $post_images as $post_image ) {
4789
-                                        $image_name = basename( $post_image );
4790
-                                        $saved_post_images_arr[] = $image_name;
4788
+									foreach ( $post_images as $post_image ) {
4789
+										$image_name = basename( $post_image );
4790
+										$saved_post_images_arr[] = $image_name;
4791 4791
                                         
4792
-                                        if (!empty($old_post_images_arr) && in_array( $image_name, $old_post_images_arr) ) {
4793
-                                            continue; // Skip if image already exists.
4794
-                                        }
4792
+										if (!empty($old_post_images_arr) && in_array( $image_name, $old_post_images_arr) ) {
4793
+											continue; // Skip if image already exists.
4794
+										}
4795 4795
                                         
4796
-                                        $image_name_parts = explode( '.', $image_name );
4797
-                                        array_pop( $image_name_parts );
4798
-                                        $proper_image_name = implode( '.', $image_name_parts );
4796
+										$image_name_parts = explode( '.', $image_name );
4797
+										array_pop( $image_name_parts );
4798
+										$proper_image_name = implode( '.', $image_name_parts );
4799 4799
                                         
4800
-                                        $arr_file_type = wp_check_filetype( $image_name );
4800
+										$arr_file_type = wp_check_filetype( $image_name );
4801 4801
                                         
4802
-                                        if ( !empty( $arr_file_type ) ) {
4803
-                                            $uploaded_file_type = $arr_file_type['type'];
4802
+										if ( !empty( $arr_file_type ) ) {
4803
+											$uploaded_file_type = $arr_file_type['type'];
4804 4804
                                             
4805
-                                            $attachment = array();
4806
-                                            $attachment['post_id'] = $saved_post_id;
4807
-                                            $attachment['title'] = $proper_image_name;
4808
-                                            $attachment['content'] = '';
4809
-                                            $attachment['file'] = $uploads_subdir . '/' . $image_name;
4810
-                                            $attachment['mime_type'] = $uploaded_file_type;
4811
-                                            $attachment['menu_order'] = $order;
4812
-                                            $attachment['is_featured'] = 0;
4813
-
4814
-                                            $attachment_set = '';
4815
-                                            foreach ( $attachment as $key => $val ) {
4816
-                                                if ( $val != '' ) {
4817
-                                                    $attachment_set .= $key . " = '" . $val . "', ";
4818
-                                                }
4819
-                                            }
4820
-                                            $attachment_set = trim( $attachment_set, ", " );
4805
+											$attachment = array();
4806
+											$attachment['post_id'] = $saved_post_id;
4807
+											$attachment['title'] = $proper_image_name;
4808
+											$attachment['content'] = '';
4809
+											$attachment['file'] = $uploads_subdir . '/' . $image_name;
4810
+											$attachment['mime_type'] = $uploaded_file_type;
4811
+											$attachment['menu_order'] = $order;
4812
+											$attachment['is_featured'] = 0;
4813
+
4814
+											$attachment_set = '';
4815
+											foreach ( $attachment as $key => $val ) {
4816
+												if ( $val != '' ) {
4817
+													$attachment_set .= $key . " = '" . $val . "', ";
4818
+												}
4819
+											}
4820
+											$attachment_set = trim( $attachment_set, ", " );
4821 4821
                                                                                         
4822
-                                            // Add new attachment
4823
-                                            $wpdb->query( "INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set );
4822
+											// Add new attachment
4823
+											$wpdb->query( "INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set );
4824 4824
                                                                                         
4825
-                                            $order++;
4826
-                                        }
4827
-                                    }
4825
+											$order++;
4826
+										}
4827
+									}
4828 4828
 
4829
-                                    $saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/" . implode("' AND file NOT LIKE '%/",  $saved_post_images_arr) . "' )" : '';
4830
-                                    // Remove previous attachment
4831
-                                    $wpdb->query( "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int)$saved_post_id . " " . $saved_post_images_sql );
4829
+									$saved_post_images_sql = !empty($saved_post_images_arr) ? " AND ( file NOT LIKE '%/" . implode("' AND file NOT LIKE '%/",  $saved_post_images_arr) . "' )" : '';
4830
+									// Remove previous attachment
4831
+									$wpdb->query( "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = " . (int)$saved_post_id . " " . $saved_post_images_sql );
4832 4832
                                     
4833
-                                    if ( !empty( $saved_post_images_arr ) ) {
4834
-                                        $menu_order = 1;
4833
+									if ( !empty( $saved_post_images_arr ) ) {
4834
+										$menu_order = 1;
4835 4835
                                         
4836
-                                        foreach ( $saved_post_images_arr as $img_name ) {
4837
-                                            $wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d WHERE post_id =%d AND file LIKE %s", array( $menu_order, $saved_post_id, '%/' . $img_name ) ) );
4836
+										foreach ( $saved_post_images_arr as $img_name ) {
4837
+											$wpdb->query( $wpdb->prepare( "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d WHERE post_id =%d AND file LIKE %s", array( $menu_order, $saved_post_id, '%/' . $img_name ) ) );
4838 4838
                                             
4839
-                                            if( $menu_order == 1 ) {
4840
-                                                if ( $featured_image = $wpdb->get_var( $wpdb->prepare( "SELECT file FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =%d AND file LIKE %s", array( $saved_post_id, '%/' . $img_name ) ) ) ) {
4841
-                                                    $wpdb->query( $wpdb->prepare( "UPDATE " . $table . " SET featured_image = %s WHERE post_id =%d", array( $featured_image, $saved_post_id ) ) );
4842
-                                                }
4843
-                                            }
4844
-                                            $menu_order++;
4845
-                                        }
4846
-                                    }
4839
+											if( $menu_order == 1 ) {
4840
+												if ( $featured_image = $wpdb->get_var( $wpdb->prepare( "SELECT file FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =%d AND file LIKE %s", array( $saved_post_id, '%/' . $img_name ) ) ) ) {
4841
+													$wpdb->query( $wpdb->prepare( "UPDATE " . $table . " SET featured_image = %s WHERE post_id =%d", array( $featured_image, $saved_post_id ) ) );
4842
+												}
4843
+											}
4844
+											$menu_order++;
4845
+										}
4846
+									}
4847 4847
                                     
4848
-                                    if ( $order > 1 ) {
4849
-                                        $images++;
4850
-                                    }
4851
-                                }
4848
+									if ( $order > 1 ) {
4849
+										$images++;
4850
+									}
4851
+								}
4852 4852
 
4853
-                                /** This action is documented in geodirectory-functions/post-functions.php */
4854
-                                do_action( 'geodir_after_save_listing', $saved_post_id, $gd_post );
4853
+								/** This action is documented in geodirectory-functions/post-functions.php */
4854
+								do_action( 'geodir_after_save_listing', $saved_post_id, $gd_post );
4855 4855
                                 
4856
-                                if (isset($is_featured)) {
4857
-                                    geodir_save_post_meta($saved_post_id, 'is_featured', $is_featured);
4858
-                                }
4859
-                                if (isset($gd_post['expire_date'])) {
4860
-                                    geodir_save_post_meta($saved_post_id, 'expire_date', $gd_post['expire_date']);
4861
-                                }
4862
-                            }
4856
+								if (isset($is_featured)) {
4857
+									geodir_save_post_meta($saved_post_id, 'is_featured', $is_featured);
4858
+								}
4859
+								if (isset($gd_post['expire_date'])) {
4860
+									geodir_save_post_meta($saved_post_id, 'expire_date', $gd_post['expire_date']);
4861
+								}
4862
+							}
4863 4863
                             
4864
-                            // WPML
4865
-                            if ($is_wpml && $language != '') {
4866
-                                $sitepress->switch_lang($active_lang, true);
4867
-                            }
4868
-                            // WPML
4869
-                        }
4870
-                    }
4871
-                }
4864
+							// WPML
4865
+							if ($is_wpml && $language != '') {
4866
+								$sitepress->switch_lang($active_lang, true);
4867
+							}
4868
+							// WPML
4869
+						}
4870
+					}
4871
+				}
4872 4872
 
4873
-                //undo some stuff to make the import quicker
4874
-                wp_defer_term_counting( false );
4875
-                wp_defer_comment_counting( false );
4876
-                $wpdb->query( 'COMMIT;' );
4877
-                $wpdb->query( 'SET autocommit = 1;' );
4878
-
4879
-                $json = array();
4880
-                $json['processed'] = $processed_actual;
4881
-                $json['created'] = $created;
4882
-                $json['updated'] = $updated;
4883
-                $json['skipped'] = $skipped;
4884
-                $json['invalid'] = $invalid;
4885
-                $json['invalid_addr'] = $invalid_addr;
4886
-                $json['images'] = $images;
4873
+				//undo some stuff to make the import quicker
4874
+				wp_defer_term_counting( false );
4875
+				wp_defer_comment_counting( false );
4876
+				$wpdb->query( 'COMMIT;' );
4877
+				$wpdb->query( 'SET autocommit = 1;' );
4878
+
4879
+				$json = array();
4880
+				$json['processed'] = $processed_actual;
4881
+				$json['created'] = $created;
4882
+				$json['updated'] = $updated;
4883
+				$json['skipped'] = $skipped;
4884
+				$json['invalid'] = $invalid;
4885
+				$json['invalid_addr'] = $invalid_addr;
4886
+				$json['images'] = $images;
4887 4887
                 
4888
-                wp_send_json( $json );
4889
-                exit;
4890
-            } else if ( $task == 'import_loc' ) {
4891
-                global $gd_post_types;
4892
-                $gd_post_types = $post_types;
4888
+				wp_send_json( $json );
4889
+				exit;
4890
+			} else if ( $task == 'import_loc' ) {
4891
+				global $gd_post_types;
4892
+				$gd_post_types = $post_types;
4893 4893
                 
4894
-                if (!empty($file)) {
4895
-                    $columns = isset($file[0]) ? $file[0] : NULL;
4894
+				if (!empty($file)) {
4895
+					$columns = isset($file[0]) ? $file[0] : NULL;
4896 4896
                     
4897
-                    if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4898
-                        $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
4899
-                        wp_send_json( $json );
4900
-                    }
4897
+					if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4898
+						$json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
4899
+						wp_send_json( $json );
4900
+					}
4901 4901
                     
4902
-                    $gd_error_log = __('GD IMPORT LOCATIONS [ROW %d]:', 'geodirectory');
4903
-                    $gd_error_location = __( 'Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory' );
4904
-                    for ($i = 1; $i <= $limit; $i++) {
4905
-                        $index = $processed + $i;
4902
+					$gd_error_log = __('GD IMPORT LOCATIONS [ROW %d]:', 'geodirectory');
4903
+					$gd_error_location = __( 'Could not be saved due to blank/invalid address(city, region, country, latitude, longitude)', 'geodirectory' );
4904
+					for ($i = 1; $i <= $limit; $i++) {
4905
+						$index = $processed + $i;
4906 4906
                         
4907
-                        if (isset($file[$index])) {
4908
-                            $row = $file[$index];
4909
-                            $row = array_map( 'trim', $row );
4910
-                            $data = array();
4907
+						if (isset($file[$index])) {
4908
+							$row = $file[$index];
4909
+							$row = array_map( 'trim', $row );
4910
+							$data = array();
4911 4911
                             
4912
-                            foreach ($columns as $c => $column ) {
4913
-                                if (in_array($column, array('location_id', 'latitude', 'longitude', 'city', 'city_slug', 'region', 'country', 'city_meta', 'city_desc', 'region_meta', 'region_desc', 'country_meta', 'country_desc'))) {
4914
-                                    $data[$column] = $row[$c];
4915
-                                }
4916
-                            }
4912
+							foreach ($columns as $c => $column ) {
4913
+								if (in_array($column, array('location_id', 'latitude', 'longitude', 'city', 'city_slug', 'region', 'country', 'city_meta', 'city_desc', 'region_meta', 'region_desc', 'country_meta', 'country_desc'))) {
4914
+									$data[$column] = $row[$c];
4915
+								}
4916
+							}
4917 4917
 
4918
-                            if ( empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude']) ) {
4919
-                                $invalid++;
4920
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4921
-                                continue;
4922
-                            }
4918
+							if ( empty($data['city']) || empty($data['region']) || empty($data['country']) || empty($data['latitude']) || empty($data['longitude']) ) {
4919
+								$invalid++;
4920
+								geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4921
+								continue;
4922
+							}
4923 4923
                             
4924
-                            $data['location_id'] = isset($data['location_id']) ? absint($data['location_id']) : 0;
4924
+							$data['location_id'] = isset($data['location_id']) ? absint($data['location_id']) : 0;
4925 4925
                             
4926
-                            if ( $import_choice == 'update' ) {
4927
-                                if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
4928
-                                    if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
4929
-                                        $updated++;
4930
-                                    } else {
4931
-                                        $invalid++;
4932
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4933
-                                    }
4934
-                                } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
4935
-                                    $data['location_id'] = (int)$location->location_id;
4926
+							if ( $import_choice == 'update' ) {
4927
+								if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
4928
+									if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
4929
+										$updated++;
4930
+									} else {
4931
+										$invalid++;
4932
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4933
+									}
4934
+								} else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
4935
+									$data['location_id'] = (int)$location->location_id;
4936 4936
                                     
4937
-                                    if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region'] ) ) ) {
4938
-                                        $data['location_id'] = (int)$location->location_id;
4939
-                                    } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'region' => $data['region'] ) ) ) {
4940
-                                        $data['location_id'] = (int)$location->location_id;
4941
-                                    } else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'] ) ) ) {
4942
-                                        $data['location_id'] = (int)$location->location_id;
4943
-                                    }
4937
+									if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'], 'region' => $data['region'] ) ) ) {
4938
+										$data['location_id'] = (int)$location->location_id;
4939
+									} else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'region' => $data['region'] ) ) ) {
4940
+										$data['location_id'] = (int)$location->location_id;
4941
+									} else if ( $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'], 'country' => $data['country'] ) ) ) {
4942
+										$data['location_id'] = (int)$location->location_id;
4943
+									}
4944 4944
                                     
4945
-                                    if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
4946
-                                        $updated++;
4947
-                                    } else {
4948
-                                        $invalid++;
4949
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4950
-                                    }
4951
-                                } else {
4952
-                                    if ( $location_id = geodir_location_insert_city( $data, true ) ) {
4953
-                                        $created++;
4954
-                                    } else {
4955
-                                        $invalid++;
4956
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4957
-                                    }
4958
-                                }
4959
-                            } elseif ( $import_choice == 'skip' ) {
4960
-                                if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
4961
-                                    $skipped++;
4962
-                                } else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
4963
-                                    $skipped++;
4964
-                                } else {
4965
-                                    if ( $location_id = geodir_location_insert_city( $data, true ) ) {
4966
-                                        $created++;
4967
-                                    } else {
4968
-                                        $invalid++;
4969
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4970
-                                    }
4971
-                                }
4972
-                            } else {
4973
-                                $invalid++;
4974
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4975
-                            }
4976
-                        }
4977
-                    }
4978
-                }
4945
+									if ( $location_id = geodir_location_update_city( $data, true, $location ) ) {
4946
+										$updated++;
4947
+									} else {
4948
+										$invalid++;
4949
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4950
+									}
4951
+								} else {
4952
+									if ( $location_id = geodir_location_insert_city( $data, true ) ) {
4953
+										$created++;
4954
+									} else {
4955
+										$invalid++;
4956
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4957
+									}
4958
+								}
4959
+							} elseif ( $import_choice == 'skip' ) {
4960
+								if ( (int)$data['location_id'] > 0 && $location = geodir_get_location_by_id( '', (int)$data['location_id'] ) ) {
4961
+									$skipped++;
4962
+								} else if ( !empty( $data['city_slug'] ) && $location = geodir_get_location_by_slug( 'city', array( 'city_slug' => $data['city_slug'] ) ) ) {
4963
+									$skipped++;
4964
+								} else {
4965
+									if ( $location_id = geodir_location_insert_city( $data, true ) ) {
4966
+										$created++;
4967
+									} else {
4968
+										$invalid++;
4969
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4970
+									}
4971
+								}
4972
+							} else {
4973
+								$invalid++;
4974
+								geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_location );
4975
+							}
4976
+						}
4977
+					}
4978
+				}
4979 4979
                 
4980
-                $json = array();
4981
-                $json['processed'] = $limit;
4982
-                $json['created'] = $created;
4983
-                $json['updated'] = $updated;
4984
-                $json['skipped'] = $skipped;
4985
-                $json['invalid'] = $invalid;
4986
-                $json['images'] = $images;
4980
+				$json = array();
4981
+				$json['processed'] = $limit;
4982
+				$json['created'] = $created;
4983
+				$json['updated'] = $updated;
4984
+				$json['skipped'] = $skipped;
4985
+				$json['invalid'] = $invalid;
4986
+				$json['images'] = $images;
4987 4987
                 
4988
-                wp_send_json( $json );
4989
-            } else if ( $task == 'import_hood' ) {               
4990
-                if (!empty($file)) {
4991
-                    $columns = isset($file[0]) ? $file[0] : NULL;
4988
+				wp_send_json( $json );
4989
+			} else if ( $task == 'import_hood' ) {               
4990
+				if (!empty($file)) {
4991
+					$columns = isset($file[0]) ? $file[0] : NULL;
4992 4992
                     
4993
-                    if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4994
-                        $json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
4995
-                        wp_send_json( $json );
4996
-                    }
4993
+					if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
4994
+						$json['error'] = __('File you are uploading is not valid. Columns does not matching.', 'geodirectory');
4995
+						wp_send_json( $json );
4996
+					}
4997 4997
                     
4998
-                    $gd_error_log = __('GD IMPORT NEIGHBOURHOODS [ROW %d]:', 'geodirectory');
4999
-                    $gd_error_hood = __( 'Could not be saved due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory' );
5000
-                    for ($i = 1; $i <= $limit; $i++) {
5001
-                        $index = $processed + $i;
4998
+					$gd_error_log = __('GD IMPORT NEIGHBOURHOODS [ROW %d]:', 'geodirectory');
4999
+					$gd_error_hood = __( 'Could not be saved due to invalid neighbourhood data(name, latitude, longitude) or invalid location data(either location_id or city/region/country is empty)', 'geodirectory' );
5000
+					for ($i = 1; $i <= $limit; $i++) {
5001
+						$index = $processed + $i;
5002 5002
                         
5003
-                        if (isset($file[$index])) {
5004
-                            $row = $file[$index];
5005
-                            $row = array_map( 'trim', $row );
5006
-                            $data = array();
5003
+						if (isset($file[$index])) {
5004
+							$row = $file[$index];
5005
+							$row = array_map( 'trim', $row );
5006
+							$data = array();
5007 5007
                             
5008
-                            foreach ($columns as $c => $column) {
5009
-                                if (in_array($column, array('neighbourhood_id', 'neighbourhood_name', 'neighbourhood_slug', 'latitude', 'longitude', 'location_id', 'city', 'region', 'country'))) {
5010
-                                    $data[$column] = sanitize_text_field($row[$c]);
5011
-                                }
5012
-                            }
5008
+							foreach ($columns as $c => $column) {
5009
+								if (in_array($column, array('neighbourhood_id', 'neighbourhood_name', 'neighbourhood_slug', 'latitude', 'longitude', 'location_id', 'city', 'region', 'country'))) {
5010
+									$data[$column] = sanitize_text_field($row[$c]);
5011
+								}
5012
+							}
5013 5013
 
5014
-                            if (empty($data['neighbourhood_name']) || empty($data['latitude']) || empty($data['longitude'])) {
5015
-                                $invalid++;
5016
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5017
-                                continue;
5018
-                            }
5014
+							if (empty($data['neighbourhood_name']) || empty($data['latitude']) || empty($data['longitude'])) {
5015
+								$invalid++;
5016
+								geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5017
+								continue;
5018
+							}
5019 5019
                             
5020
-                            $location_info = array();
5021
-                            if (!empty($data['location_id']) && (int)$data['location_id'] > 0) {
5022
-                                $location_info = geodir_get_location_by_id('', (int)$data['location_id']);
5023
-                            } else if (!empty($data['city']) && !empty($data['region']) && !empty($data['country'])) {
5024
-                                $location_info = geodir_get_location_by_slug('city', array('fields' => 'location_id', 'city' => $data['city'], 'country' => $data['country'], 'region' => $data['region']));
5025
-                            }
5020
+							$location_info = array();
5021
+							if (!empty($data['location_id']) && (int)$data['location_id'] > 0) {
5022
+								$location_info = geodir_get_location_by_id('', (int)$data['location_id']);
5023
+							} else if (!empty($data['city']) && !empty($data['region']) && !empty($data['country'])) {
5024
+								$location_info = geodir_get_location_by_slug('city', array('fields' => 'location_id', 'city' => $data['city'], 'country' => $data['country'], 'region' => $data['region']));
5025
+							}
5026 5026
 
5027
-                            if (empty($location_info)) {
5028
-                                $invalid++;
5029
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5030
-                                continue;
5031
-                            }
5027
+							if (empty($location_info)) {
5028
+								$invalid++;
5029
+								geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5030
+								continue;
5031
+							}
5032 5032
                             
5033
-                            $location_id = $location_info->location_id;
5033
+							$location_id = $location_info->location_id;
5034 5034
 
5035
-                            $data['neighbourhood_id'] = isset($data['neighbourhood_id']) ? absint($data['neighbourhood_id']) : 0;
5035
+							$data['neighbourhood_id'] = isset($data['neighbourhood_id']) ? absint($data['neighbourhood_id']) : 0;
5036 5036
                             
5037
-                            $hood_data = array();
5038
-                            $hood_data['hood_name'] = $data['neighbourhood_name'];
5039
-                            $hood_data['hood_slug'] = $data['neighbourhood_slug'];
5040
-                            $hood_data['hood_latitude'] = $data['latitude'];
5041
-                            $hood_data['hood_longitude'] = $data['longitude'];
5042
-                            $hood_data['hood_location_id'] = $location_id;
5037
+							$hood_data = array();
5038
+							$hood_data['hood_name'] = $data['neighbourhood_name'];
5039
+							$hood_data['hood_slug'] = $data['neighbourhood_slug'];
5040
+							$hood_data['hood_latitude'] = $data['latitude'];
5041
+							$hood_data['hood_longitude'] = $data['longitude'];
5042
+							$hood_data['hood_location_id'] = $location_id;
5043 5043
                                     
5044
-                            if ( $import_choice == 'update' ) {
5045
-                                if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
5046
-                                    $hood_data['hood_id'] = (int)$data['neighbourhood_id'];
5044
+							if ( $import_choice == 'update' ) {
5045
+								if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
5046
+									$hood_data['hood_id'] = (int)$data['neighbourhood_id'];
5047 5047
                                     
5048
-                                    if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5049
-                                        $updated++;
5050
-                                    } else {
5051
-                                        $invalid++;
5052
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5053
-                                    }
5054
-                                } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
5055
-                                    $hood_data['hood_id'] = (int)$neighbourhood->hood_id;
5048
+									if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5049
+										$updated++;
5050
+									} else {
5051
+										$invalid++;
5052
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5053
+									}
5054
+								} else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
5055
+									$hood_data['hood_id'] = (int)$neighbourhood->hood_id;
5056 5056
                                     
5057
-                                    if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5058
-                                        $updated++;
5059
-                                    } else {
5060
-                                        $invalid++;
5061
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5062
-                                    }
5063
-                                } else {
5064
-                                    if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5065
-                                        $created++;
5066
-                                    } else {
5067
-                                        $invalid++;
5068
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5069
-                                    }
5070
-                                }
5071
-                            } elseif ( $import_choice == 'skip' ) {
5072
-                                if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
5073
-                                    $skipped++;
5074
-                                } else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
5075
-                                    $skipped++;
5076
-                                } else {
5057
+									if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5058
+										$updated++;
5059
+									} else {
5060
+										$invalid++;
5061
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5062
+									}
5063
+								} else {
5064
+									if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5065
+										$created++;
5066
+									} else {
5067
+										$invalid++;
5068
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5069
+									}
5070
+								}
5071
+							} elseif ( $import_choice == 'skip' ) {
5072
+								if ((int)$data['neighbourhood_id'] > 0 && ($neighbourhood = geodir_location_get_neighbourhood_by_id((int)$data['neighbourhood_id']))) {
5073
+									$skipped++;
5074
+								} else if (!empty($data['neighbourhood_slug']) && ($neighbourhood = geodir_location_get_neighbourhood_by_id($data['neighbourhood_slug'], true))) {
5075
+									$skipped++;
5076
+								} else {
5077 5077
                                     
5078
-                                    if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5079
-                                        $created++;
5080
-                                    } else {
5081
-                                        $invalid++;
5082
-                                        geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5083
-                                    }
5084
-                                }
5085
-                            } else {
5086
-                                $invalid++;
5087
-                                geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5088
-                            }
5089
-                        }
5090
-                    }
5091
-                }
5078
+									if ($neighbourhood = geodir_location_insert_update_neighbourhood($hood_data)) {
5079
+										$created++;
5080
+									} else {
5081
+										$invalid++;
5082
+										geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5083
+									}
5084
+								}
5085
+							} else {
5086
+								$invalid++;
5087
+								geodir_error_log( wp_sprintf( $gd_error_log, ($index + 1) ) . ' ' . $gd_error_hood );
5088
+							}
5089
+						}
5090
+					}
5091
+				}
5092 5092
                 
5093
-                $json = array();
5094
-                $json['processed'] = $limit;
5095
-                $json['created'] = $created;
5096
-                $json['updated'] = $updated;
5097
-                $json['skipped'] = $skipped;
5098
-                $json['invalid'] = $invalid;
5099
-                $json['images'] = $images;
5093
+				$json = array();
5094
+				$json['processed'] = $limit;
5095
+				$json['created'] = $created;
5096
+				$json['updated'] = $updated;
5097
+				$json['skipped'] = $skipped;
5098
+				$json['invalid'] = $invalid;
5099
+				$json['images'] = $images;
5100 5100
                 
5101
-                wp_send_json( $json );
5102
-            }
5103
-        }
5104
-        break;
5105
-        case 'import_finish':{
5106
-            /**
5107
-             * Run an action when an import finishes.
5108
-             *
5109
-             * This action can be used to fire functions after an import ends.
5110
-             *
5111
-             * @since 1.5.3
5112
-             * @package GeoDirectory
5113
-             */
5114
-            do_action('geodir_import_finished');
5115
-        }
5116
-        break;
5101
+				wp_send_json( $json );
5102
+			}
5103
+		}
5104
+		break;
5105
+		case 'import_finish':{
5106
+			/**
5107
+			 * Run an action when an import finishes.
5108
+			 *
5109
+			 * This action can be used to fire functions after an import ends.
5110
+			 *
5111
+			 * @since 1.5.3
5112
+			 * @package GeoDirectory
5113
+			 */
5114
+			do_action('geodir_import_finished');
5115
+		}
5116
+		break;
5117 5117
 
5118
-    }
5119
-    echo '0';
5120
-    gd_die();
5118
+	}
5119
+	echo '0';
5120
+	gd_die();
5121 5121
 }
5122 5122
 
5123 5123
 /**
@@ -5161,12 +5161,12 @@  discard block
 block discarded – undo
5161 5161
 		$args['slug'] = wp_unique_term_slug( $args['slug'], (object)$term_args );
5162 5162
 	}
5163 5163
 	
5164
-    if( !empty( $term ) ) {
5164
+	if( !empty( $term ) ) {
5165 5165
 		$result = wp_insert_term( $term, $taxonomy, $args );
5166
-        if( !is_wp_error( $result ) ) {
5167
-            return isset( $result['term_id'] ) ? $result['term_id'] : 0;
5168
-        }
5169
-    }
5166
+		if( !is_wp_error( $result ) ) {
5167
+			return isset( $result['term_id'] ) ? $result['term_id'] : 0;
5168
+		}
5169
+	}
5170 5170
 	
5171 5171
 	return false;
5172 5172
 }
@@ -5212,16 +5212,16 @@  discard block
 block discarded – undo
5212 5212
 		$result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data );
5213 5213
 		
5214 5214
 		if( !is_wp_error( $result ) ) {
5215
-            return isset( $result['term_id'] ) ? $result['term_id'] : 0;
5216
-        }
5215
+			return isset( $result['term_id'] ) ? $result['term_id'] : 0;
5216
+		}
5217 5217
 	} else if ( $term_data['slug'] != '' && $term_info = (array)term_exists( $term_data['slug'], $taxonomy ) ) {
5218 5218
 		$term_data['term_id'] = $term_info['term_id'];
5219 5219
 		
5220 5220
 		$result = wp_update_term( $term_data['term_id'], $taxonomy, $term_data );
5221 5221
 		
5222 5222
 		if( !is_wp_error( $result ) ) {
5223
-            return isset( $result['term_id'] ) ? $result['term_id'] : 0;
5224
-        }
5223
+			return isset( $result['term_id'] ) ? $result['term_id'] : 0;
5224
+		}
5225 5225
 	} else {
5226 5226
 		return geodir_imex_insert_term( $taxonomy, $term_data );
5227 5227
 	}
@@ -5242,37 +5242,37 @@  discard block
 block discarded – undo
5242 5242
  * @return int Posts count.
5243 5243
  */
5244 5244
 function geodir_get_posts_count( $post_type ) {
5245
-    global $wpdb, $plugin_prefix;
5245
+	global $wpdb, $plugin_prefix;
5246 5246
 
5247
-    if ( !post_type_exists( $post_type ) ) {
5248
-        return 0;
5249
-    }
5247
+	if ( !post_type_exists( $post_type ) ) {
5248
+		return 0;
5249
+	}
5250 5250
         
5251
-    $table = $plugin_prefix . $post_type . '_detail';
5251
+	$table = $plugin_prefix . $post_type . '_detail';
5252 5252
 
5253
-    // Skip listing with statuses trash, auto-draft etc...
5254
-    $skip_statuses = geodir_imex_export_skip_statuses();
5255
-    $where_statuses = '';
5256
-    if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
5257
-        $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
5258
-    }
5253
+	// Skip listing with statuses trash, auto-draft etc...
5254
+	$skip_statuses = geodir_imex_export_skip_statuses();
5255
+	$where_statuses = '';
5256
+	if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
5257
+		$where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
5258
+	}
5259 5259
 
5260
-    $query = $wpdb->prepare( "SELECT COUNT({$wpdb->posts}.ID) FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses, $post_type );
5260
+	$query = $wpdb->prepare( "SELECT COUNT({$wpdb->posts}.ID) FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses, $post_type );
5261 5261
 
5262
-    $posts_count = (int)$wpdb->get_var( $query );
5262
+	$posts_count = (int)$wpdb->get_var( $query );
5263 5263
     
5264
-    /**
5265
-     * Modify returned post counts for the current post type.
5266
-     *
5267
-     * @since 1.4.6
5268
-     * @package GeoDirectory
5269
-     *
5270
-     * @param int $posts_count Post counts.
5271
-     * @param string $post_type Post type.
5272
-     */
5273
-    $posts_count = apply_filters( 'geodir_imex_count_posts', $posts_count, $post_type );
5274
-
5275
-    return $posts_count;
5264
+	/**
5265
+	 * Modify returned post counts for the current post type.
5266
+	 *
5267
+	 * @since 1.4.6
5268
+	 * @package GeoDirectory
5269
+	 *
5270
+	 * @param int $posts_count Post counts.
5271
+	 * @param string $post_type Post type.
5272
+	 */
5273
+	$posts_count = apply_filters( 'geodir_imex_count_posts', $posts_count, $post_type );
5274
+
5275
+	return $posts_count;
5276 5276
 }
5277 5277
 
5278 5278
 /**
@@ -5300,9 +5300,9 @@  discard block
 block discarded – undo
5300 5300
 	
5301 5301
 	if ( !empty( $posts ) ) {
5302 5302
 		$is_payment_plugin = is_plugin_active( 'geodir_payment_manager/geodir_payment_manager.php' );
5303
-        $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
5304
-        $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true;
5305
-        $neighbourhood_active = $location_manager && $location_allowed && get_option('location_neighbourhoods') ? true : false;
5303
+		$location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active.
5304
+		$location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $post_type ) ? false : true;
5305
+		$neighbourhood_active = $location_manager && $location_allowed && get_option('location_neighbourhoods') ? true : false;
5306 5306
 		
5307 5307
 		$csv_row = array();
5308 5308
 		$csv_row[] = 'post_id';
@@ -5346,11 +5346,11 @@  discard block
 block discarded – undo
5346 5346
 		$csv_row[] = 'post_zip';
5347 5347
 		$csv_row[] = 'post_latitude';
5348 5348
 		$csv_row[] = 'post_longitude';
5349
-        if ($neighbourhood_active) {
5350
-            $csv_row[] = 'post_neighbourhood';
5351
-            $csv_row[] = 'neighbourhood_latitude';
5352
-            $csv_row[] = 'neighbourhood_longitude';
5353
-        }
5349
+		if ($neighbourhood_active) {
5350
+			$csv_row[] = 'post_neighbourhood';
5351
+			$csv_row[] = 'neighbourhood_latitude';
5352
+			$csv_row[] = 'neighbourhood_longitude';
5353
+		}
5354 5354
 		$csv_row[] = 'geodir_timing';
5355 5355
 		$csv_row[] = 'geodir_contact';
5356 5356
 		$csv_row[] = 'geodir_email';
@@ -5385,7 +5385,7 @@  discard block
 block discarded – undo
5385 5385
 		$csv_rows[] = $csv_row;
5386 5386
 
5387 5387
 		$images_count = 5;
5388
-        $xx=0;
5388
+		$xx=0;
5389 5389
 		foreach ( $posts as $post ) {$xx++;
5390 5390
 			$post_id = $post['ID'];
5391 5391
 			
@@ -5528,21 +5528,21 @@  discard block
 block discarded – undo
5528 5528
 			$csv_row[] = $post_info['post_zip']; // post_zip
5529 5529
 			$csv_row[] = $post_info['post_latitude']; // post_latitude
5530 5530
 			$csv_row[] = $post_info['post_longitude']; // post_longitude
5531
-            if ($neighbourhood_active) {
5532
-                $post_neighbourhood = '';
5533
-                $neighbourhood_latitude = '';
5534
-                $neighbourhood_longitude = '';
5535
-                if (!empty($post_info['post_neighbourhood']) && ($hood_info = geodir_location_get_neighbourhood_by_id($post_info['post_neighbourhood'], true, $post_info['post_location_id']))) {
5536
-                    if (!empty($hood_info)) {
5537
-                        $post_neighbourhood = $hood_info->hood_name;
5538
-                        $neighbourhood_latitude = $hood_info->hood_latitude;
5539
-                        $neighbourhood_longitude = $hood_info->hood_longitude;
5540
-                    }
5541
-                }
5542
-                $csv_row[] = $post_neighbourhood; // post_neighbourhood
5543
-                $csv_row[] = $neighbourhood_latitude; // neighbourhood_latitude
5544
-                $csv_row[] = $neighbourhood_longitude; // neighbourhood_longitude
5545
-            }
5531
+			if ($neighbourhood_active) {
5532
+				$post_neighbourhood = '';
5533
+				$neighbourhood_latitude = '';
5534
+				$neighbourhood_longitude = '';
5535
+				if (!empty($post_info['post_neighbourhood']) && ($hood_info = geodir_location_get_neighbourhood_by_id($post_info['post_neighbourhood'], true, $post_info['post_location_id']))) {
5536
+					if (!empty($hood_info)) {
5537
+						$post_neighbourhood = $hood_info->hood_name;
5538
+						$neighbourhood_latitude = $hood_info->hood_latitude;
5539
+						$neighbourhood_longitude = $hood_info->hood_longitude;
5540
+					}
5541
+				}
5542
+				$csv_row[] = $post_neighbourhood; // post_neighbourhood
5543
+				$csv_row[] = $neighbourhood_latitude; // neighbourhood_latitude
5544
+				$csv_row[] = $neighbourhood_longitude; // neighbourhood_longitude
5545
+			}
5546 5546
 			$csv_row[] = $post_info['geodir_timing']; // geodir_timing
5547 5547
 			$csv_row[] = $post_info['geodir_contact']; // geodir_contact
5548 5548
 			$csv_row[] = $post_info['geodir_email']; // geodir_email
@@ -5613,55 +5613,55 @@  discard block
 block discarded – undo
5613 5613
  * @return array Array of posts data.
5614 5614
  */
5615 5615
 function geodir_get_export_posts( $post_type, $per_page = 0, $page_no = 0 ) {
5616
-    global $wpdb, $plugin_prefix;
5616
+	global $wpdb, $plugin_prefix;
5617 5617
 
5618
-    if ( ! post_type_exists( $post_type ) )
5619
-        return new stdClass;
5618
+	if ( ! post_type_exists( $post_type ) )
5619
+		return new stdClass;
5620 5620
         
5621
-    $table = $plugin_prefix . $post_type . '_detail';
5621
+	$table = $plugin_prefix . $post_type . '_detail';
5622 5622
 
5623
-    $limit = '';
5624
-    if ( $per_page > 0 && $page_no > 0 ) {
5625
-        $offset = ( $page_no - 1 ) * $per_page;
5623
+	$limit = '';
5624
+	if ( $per_page > 0 && $page_no > 0 ) {
5625
+		$offset = ( $page_no - 1 ) * $per_page;
5626 5626
         
5627
-        if ( $offset > 0 ) {
5628
-            $limit = " LIMIT " . $offset . "," . $per_page;
5629
-        } else {
5630
-            $limit = " LIMIT " . $per_page;
5631
-        }
5632
-    }
5627
+		if ( $offset > 0 ) {
5628
+			$limit = " LIMIT " . $offset . "," . $per_page;
5629
+		} else {
5630
+			$limit = " LIMIT " . $per_page;
5631
+		}
5632
+	}
5633 5633
 
5634
-    // Skip listing with statuses trash, auto-draft etc...
5635
-    $skip_statuses = geodir_imex_export_skip_statuses();
5636
-    $where_statuses = '';
5637
-    if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
5638
-        $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
5639
-    }
5634
+	// Skip listing with statuses trash, auto-draft etc...
5635
+	$skip_statuses = geodir_imex_export_skip_statuses();
5636
+	$where_statuses = '';
5637
+	if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
5638
+		$where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
5639
+	}
5640
+
5641
+	$query = "SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " ORDER BY {$wpdb->posts}.ID ASC" . $limit;
5642
+	/**
5643
+	 * Modify returned posts SQL query for the current post type.
5644
+	 *
5645
+	 * @since 1.4.6
5646
+	 * @package GeoDirectory
5647
+	 *
5648
+	 * @param int $query The SQL query.
5649
+	 * @param string $post_type Post type.
5650
+	 */
5651
+	$query = apply_filters( 'geodir_imex_export_posts_query', $query, $post_type );
5652
+
5653
+	$results = (array)$wpdb->get_results( $wpdb->prepare( $query, $post_type ), ARRAY_A );
5640 5654
 
5641
-    $query = "SELECT {$wpdb->posts}.ID FROM {$wpdb->posts} INNER JOIN {$table} ON {$table}.post_id = {$wpdb->posts}.ID WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " ORDER BY {$wpdb->posts}.ID ASC" . $limit;
5642
-    /**
5643
-     * Modify returned posts SQL query for the current post type.
5644
-     *
5645
-     * @since 1.4.6
5646
-     * @package GeoDirectory
5647
-     *
5648
-     * @param int $query The SQL query.
5649
-     * @param string $post_type Post type.
5650
-     */
5651
-    $query = apply_filters( 'geodir_imex_export_posts_query', $query, $post_type );
5652
-
5653
-    $results = (array)$wpdb->get_results( $wpdb->prepare( $query, $post_type ), ARRAY_A );
5654
-
5655
-    /**
5656
-     * Modify returned post results for the current post type.
5657
-     *
5658
-     * @since 1.4.6
5659
-     * @package GeoDirectory
5660
-     *
5661
-     * @param object $results An object containing all post ids.
5662
-     * @param string $post_type Post type.
5663
-     */
5664
-    return apply_filters( 'geodir_export_posts', $results, $post_type );
5655
+	/**
5656
+	 * Modify returned post results for the current post type.
5657
+	 *
5658
+	 * @since 1.4.6
5659
+	 * @package GeoDirectory
5660
+	 *
5661
+	 * @param object $results An object containing all post ids.
5662
+	 * @param string $post_type Post type.
5663
+	 */
5664
+	return apply_filters( 'geodir_export_posts', $results, $post_type );
5665 5665
 }
5666 5666
 
5667 5667
 /**
@@ -5679,23 +5679,23 @@  discard block
 block discarded – undo
5679 5679
  * @return string The SQL query.
5680 5680
  */
5681 5681
 function geodir_imex_get_events_query( $query, $post_type ) {
5682
-    if ( $post_type == 'gd_event' ) {
5683
-        global $wpdb, $plugin_prefix;
5682
+	if ( $post_type == 'gd_event' ) {
5683
+		global $wpdb, $plugin_prefix;
5684 5684
         
5685
-        $table = $plugin_prefix . $post_type . '_detail';
5686
-        $schedule_table = EVENT_SCHEDULE;
5685
+		$table = $plugin_prefix . $post_type . '_detail';
5686
+		$schedule_table = EVENT_SCHEDULE;
5687 5687
         
5688
-        // Skip listing with statuses trash, auto-draft etc...
5689
-        $skip_statuses = geodir_imex_export_skip_statuses();
5690
-        $where_statuses = '';
5691
-        if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
5692
-            $where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
5693
-        }
5688
+		// Skip listing with statuses trash, auto-draft etc...
5689
+		$skip_statuses = geodir_imex_export_skip_statuses();
5690
+		$where_statuses = '';
5691
+		if ( !empty( $skip_statuses ) && is_array( $skip_statuses ) ) {
5692
+			$where_statuses = "AND `" . $wpdb->posts . "`.`post_status` NOT IN('" . implode( "','", $skip_statuses ) . "')";
5693
+		}
5694 5694
 
5695
-        $query = "SELECT {$wpdb->posts}.ID, {$schedule_table}.event_date, {$schedule_table}.event_enddate AS enddate, {$schedule_table}.event_starttime AS starttime, {$schedule_table}.event_endtime AS endtime FROM {$wpdb->posts} INNER JOIN {$table} ON ({$table}.post_id = {$wpdb->posts}.ID) INNER JOIN {$schedule_table} ON ({$schedule_table}.event_id = {$wpdb->posts}.ID) WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " GROUP BY {$table}.post_id ORDER BY {$wpdb->posts}.ID ASC, {$schedule_table}.schedule_id ASC";
5696
-    }
5695
+		$query = "SELECT {$wpdb->posts}.ID, {$schedule_table}.event_date, {$schedule_table}.event_enddate AS enddate, {$schedule_table}.event_starttime AS starttime, {$schedule_table}.event_endtime AS endtime FROM {$wpdb->posts} INNER JOIN {$table} ON ({$table}.post_id = {$wpdb->posts}.ID) INNER JOIN {$schedule_table} ON ({$schedule_table}.event_id = {$wpdb->posts}.ID) WHERE {$wpdb->posts}.post_type = %s " . $where_statuses . " GROUP BY {$table}.post_id ORDER BY {$wpdb->posts}.ID ASC, {$schedule_table}.schedule_id ASC";
5696
+	}
5697 5697
 
5698
-    return $query;
5698
+	return $query;
5699 5699
 }
5700 5700
 
5701 5701
 /**
@@ -5717,36 +5717,36 @@  discard block
 block discarded – undo
5717 5717
  * @return int Total terms count.
5718 5718
  */
5719 5719
 function geodir_get_terms_count( $post_type ) {
5720
-    $args = array( 'hide_empty' => 0 );
5720
+	$args = array( 'hide_empty' => 0 );
5721 5721
 
5722
-    remove_all_filters( 'get_terms' );
5722
+	remove_all_filters( 'get_terms' );
5723 5723
 
5724
-    $taxonomy = $post_type . 'category';
5724
+	$taxonomy = $post_type . 'category';
5725 5725
 
5726
-    // WPML
5727
-    $is_wpml = geodir_is_wpml();
5728
-    $active_lang = 'all';
5729
-    if ( $is_wpml ) {
5730
-        global $sitepress;
5731
-        $active_lang = $sitepress->get_current_language();
5726
+	// WPML
5727
+	$is_wpml = geodir_is_wpml();
5728
+	$active_lang = 'all';
5729
+	if ( $is_wpml ) {
5730
+		global $sitepress;
5731
+		$active_lang = $sitepress->get_current_language();
5732 5732
         
5733
-        if ( $active_lang != 'all' ) {
5734
-            $sitepress->switch_lang( 'all', true );
5735
-        }
5736
-    }
5737
-    // WPML
5733
+		if ( $active_lang != 'all' ) {
5734
+			$sitepress->switch_lang( 'all', true );
5735
+		}
5736
+	}
5737
+	// WPML
5738 5738
             
5739
-    $count_terms = wp_count_terms( $taxonomy, $args );
5739
+	$count_terms = wp_count_terms( $taxonomy, $args );
5740 5740
 
5741
-    // WPML
5742
-    if ( $is_wpml && $active_lang !== 'all' ) {
5743
-        global $sitepress;
5744
-        $sitepress->switch_lang( $active_lang, true );
5745
-    }
5746
-    // WPML
5747
-    $count_terms = !is_wp_error( $count_terms ) ? $count_terms : 0;
5741
+	// WPML
5742
+	if ( $is_wpml && $active_lang !== 'all' ) {
5743
+		global $sitepress;
5744
+		$sitepress->switch_lang( $active_lang, true );
5745
+	}
5746
+	// WPML
5747
+	$count_terms = !is_wp_error( $count_terms ) ? $count_terms : 0;
5748 5748
      
5749
-    return $count_terms;
5749
+	return $count_terms;
5750 5750
 }
5751 5751
 
5752 5752
 /**
@@ -5785,11 +5785,11 @@  discard block
 block discarded – undo
5785 5785
 		$csv_row[] = 'cat_posttype';
5786 5786
 		$csv_row[] = 'cat_parent';
5787 5787
 		$csv_row[] = 'cat_schema';
5788
-        // WPML
5788
+		// WPML
5789 5789
 		$is_wpml = geodir_is_wpml();
5790 5790
 		if ($is_wpml) {
5791 5791
 			$csv_row[] = 'cat_language';
5792
-            $csv_row[] = 'cat_id_original';
5792
+			$csv_row[] = 'cat_id_original';
5793 5793
 		}
5794 5794
 		// WPML
5795 5795
 		$csv_row[] = 'cat_description';
@@ -5819,10 +5819,10 @@  discard block
 block discarded – undo
5819 5819
 			$csv_row[] = $post_type;
5820 5820
 			$csv_row[] = $cat_parent;
5821 5821
 			$csv_row[] = get_tax_meta( $term->term_id, 'ct_cat_schema', false, $post_type );
5822
-            // WPML
5822
+			// WPML
5823 5823
 			if ($is_wpml) {
5824 5824
 				$csv_row[] = geodir_get_language_for_element( $term->term_id, 'tax_' . $taxonomy );
5825
-                $csv_row[] = geodir_imex_original_post_id( $term->term_id, 'tax_' . $taxonomy );
5825
+				$csv_row[] = geodir_imex_original_post_id( $term->term_id, 'tax_' . $taxonomy );
5826 5826
 			}
5827 5827
 			// WPML
5828 5828
 			$csv_row[] = $term->description;
@@ -6418,43 +6418,43 @@  discard block
 block discarded – undo
6418 6418
  * @param string $status Post status.
6419 6419
  */
6420 6420
 function geodir_create_page($slug, $option, $page_title = '', $page_content = '', $post_parent = 0, $status = 'publish') {
6421
-    global $wpdb, $current_user;
6422
-
6423
-    $option_value = get_option($option);
6424
-
6425
-    if ($option_value > 0) :
6426
-        if (get_post($option_value)) :
6427
-            // Page exists
6428
-            return;
6429
-        endif;
6430
-    endif;
6431
-
6432
-    $page_found = $wpdb->get_var(
6433
-        $wpdb->prepare(
6434
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;",
6435
-            array($slug)
6436
-        )
6437
-    );
6438
-
6439
-    if ($page_found) :
6440
-        // Page exists
6441
-        if (!$option_value) update_option($option, $page_found);
6442
-        return;
6443
-    endif;
6444
-
6445
-    $page_data = array(
6446
-        'post_status' => $status,
6447
-        'post_type' => 'page',
6448
-        'post_author' => $current_user->ID,
6449
-        'post_name' => $slug,
6450
-        'post_title' => $page_title,
6451
-        'post_content' => $page_content,
6452
-        'post_parent' => $post_parent,
6453
-        'comment_status' => 'closed'
6454
-    );
6455
-    $page_id = wp_insert_post($page_data);
6456
-
6457
-    add_option($option, $page_id);
6421
+	global $wpdb, $current_user;
6422
+
6423
+	$option_value = get_option($option);
6424
+
6425
+	if ($option_value > 0) :
6426
+		if (get_post($option_value)) :
6427
+			// Page exists
6428
+			return;
6429
+		endif;
6430
+	endif;
6431
+
6432
+	$page_found = $wpdb->get_var(
6433
+		$wpdb->prepare(
6434
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;",
6435
+			array($slug)
6436
+		)
6437
+	);
6438
+
6439
+	if ($page_found) :
6440
+		// Page exists
6441
+		if (!$option_value) update_option($option, $page_found);
6442
+		return;
6443
+	endif;
6444
+
6445
+	$page_data = array(
6446
+		'post_status' => $status,
6447
+		'post_type' => 'page',
6448
+		'post_author' => $current_user->ID,
6449
+		'post_name' => $slug,
6450
+		'post_title' => $page_title,
6451
+		'post_content' => $page_content,
6452
+		'post_parent' => $post_parent,
6453
+		'comment_status' => 'closed'
6454
+	);
6455
+	$page_id = wp_insert_post($page_data);
6456
+
6457
+	add_option($option, $page_id);
6458 6458
 
6459 6459
 }
6460 6460
 
@@ -6485,9 +6485,9 @@  discard block
 block discarded – undo
6485 6485
  * @package GeoDirectory
6486 6486
  */
6487 6487
 function geodir_admin_upgrade_notice() {
6488
-    $class = "error";
6489
-    $message = __("Please update core GeoDirectory or some addons may not function correctly.","geodirectory");
6490
-    echo"<div class=\"$class\"> <p>$message</p></div>";
6488
+	$class = "error";
6489
+	$message = __("Please update core GeoDirectory or some addons may not function correctly.","geodirectory");
6490
+	echo"<div class=\"$class\"> <p>$message</p></div>";
6491 6491
 }
6492 6492
 
6493 6493
 /**
@@ -6500,18 +6500,18 @@  discard block
 block discarded – undo
6500 6500
  */
6501 6501
 function geodire_admin_upgrade_notice( $plugin_data, $r )
6502 6502
 {
6503
-    // readme contents
6504
-    $args = array(
6505
-        'timeout'     => 15,
6506
-        'redirection' => 5
6507
-    );
6508
-    $url = "http://plugins.svn.wordpress.org/geodirectory/trunk/readme.txt";
6509
-    $data       = wp_remote_get( $url, $args );
6503
+	// readme contents
6504
+	$args = array(
6505
+		'timeout'     => 15,
6506
+		'redirection' => 5
6507
+	);
6508
+	$url = "http://plugins.svn.wordpress.org/geodirectory/trunk/readme.txt";
6509
+	$data       = wp_remote_get( $url, $args );
6510 6510
 
6511
-    if (!is_wp_error($data) && $data['response']['code'] == 200) {
6511
+	if (!is_wp_error($data) && $data['response']['code'] == 200) {
6512 6512
 
6513
-        geodir_in_plugin_update_message($data['body']);
6514
-    }
6513
+		geodir_in_plugin_update_message($data['body']);
6514
+	}
6515 6515
 }
6516 6516
 
6517 6517
 
@@ -6519,28 +6519,28 @@  discard block
 block discarded – undo
6519 6519
 * @param string $content http response body
6520 6520
 */
6521 6521
 function geodir_in_plugin_update_message($content) {
6522
-    // Output Upgrade Notice
6523
-    $matches        = null;
6524
-    $regexp         = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( GEODIRECTORY_VERSION ) . '\s*=|$)~Uis';
6525
-    $upgrade_notice = '';
6526
-    if ( preg_match( $regexp, $content, $matches ) ) {
6527
-        if(empty($matches)){return;}
6528
-
6529
-        $version = trim( $matches[1] );
6530
-        if($version && $version>GEODIRECTORY_VERSION){
6531
-
6532
-
6533
-        $notices = (array) preg_split('~[\r\n]+~', trim( $matches[2] ) );
6534
-        if ( version_compare( GEODIRECTORY_VERSION, $version, '<' ) ) {
6535
-            $upgrade_notice .= '<div class="geodir_plugin_upgrade_notice">';
6536
-            foreach ( $notices as $index => $line ) {
6537
-                $upgrade_notice .= wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line ) );
6538
-            }
6539
-            $upgrade_notice .= '</div> ';
6540
-        }
6541
-        }
6542
-    }
6543
-    echo $upgrade_notice;
6522
+	// Output Upgrade Notice
6523
+	$matches        = null;
6524
+	$regexp         = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( GEODIRECTORY_VERSION ) . '\s*=|$)~Uis';
6525
+	$upgrade_notice = '';
6526
+	if ( preg_match( $regexp, $content, $matches ) ) {
6527
+		if(empty($matches)){return;}
6528
+
6529
+		$version = trim( $matches[1] );
6530
+		if($version && $version>GEODIRECTORY_VERSION){
6531
+
6532
+
6533
+		$notices = (array) preg_split('~[\r\n]+~', trim( $matches[2] ) );
6534
+		if ( version_compare( GEODIRECTORY_VERSION, $version, '<' ) ) {
6535
+			$upgrade_notice .= '<div class="geodir_plugin_upgrade_notice">';
6536
+			foreach ( $notices as $index => $line ) {
6537
+				$upgrade_notice .= wp_kses_post( preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line ) );
6538
+			}
6539
+			$upgrade_notice .= '</div> ';
6540
+		}
6541
+		}
6542
+	}
6543
+	echo $upgrade_notice;
6544 6544
 }
6545 6545
 
6546 6546
 /**
@@ -6573,19 +6573,19 @@  discard block
 block discarded – undo
6573 6573
  * @param array Listing statuses to be skipped.
6574 6574
  */
6575 6575
 function geodir_imex_export_skip_statuses() {
6576
-    $statuses = array( 'trash', 'auto-draft' );
6576
+	$statuses = array( 'trash', 'auto-draft' );
6577 6577
     
6578
-    /**
6579
-     * Filter the statuses to skip during GD export listings.
6580
-     *
6581
-     * @since 1.6.0
6582
-     * @package GeoDirectory
6583
-     *
6584
-     * @param array $statuses Listing statuses to be skipped.
6585
-     */
6586
-    $statuses = apply_filters( 'geodir_imex_export_skip_statuses', $statuses );
6578
+	/**
6579
+	 * Filter the statuses to skip during GD export listings.
6580
+	 *
6581
+	 * @since 1.6.0
6582
+	 * @package GeoDirectory
6583
+	 *
6584
+	 * @param array $statuses Listing statuses to be skipped.
6585
+	 */
6586
+	$statuses = apply_filters( 'geodir_imex_export_skip_statuses', $statuses );
6587 6587
      
6588
-    return $statuses;
6588
+	return $statuses;
6589 6589
 }
6590 6590
 
6591 6591
 /*
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 1 patch
Indentation   +1480 added lines, -1480 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_get_ajax_url()
21 21
 {
22
-    return admin_url('admin-ajax.php?action=geodir_ajax_action');
22
+	return admin_url('admin-ajax.php?action=geodir_ajax_action');
23 23
 }
24 24
 
25 25
 /////////////////////
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 add_filter('query_vars', 'geodir_add_geodir_page_var');
88 88
 add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
89 89
 if (get_option('permalink_structure') != '')
90
-    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
90
+	add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
91 91
 
92 92
 add_filter('parse_query', 'geodir_modified_query');
93 93
 
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 /* POST AND LOOP ACTIONS */
155 155
 ////////////////////////
156 156
 if (!is_admin()) {
157
-    add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
-    add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
-    /** Exclude Virtual Pages From Pages List **/
160
-    add_action('pre_get_posts', 'set_listing_request', 0);
161
-    add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
-    add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
-    add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
-    add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
157
+	add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
+	add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
+	/** Exclude Virtual Pages From Pages List **/
160
+	add_action('pre_get_posts', 'set_listing_request', 0);
161
+	add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
+	add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
+	add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
+	add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
165 165
 }
166 166
 
167 167
 
@@ -221,12 +221,12 @@  discard block
 block discarded – undo
221 221
  */
222 222
 function geodir_unset_prev_theme_nav_location($newname)
223 223
 {
224
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
-    if ($geodir_theme_location) {
226
-        update_option('geodir_theme_location_nav', $geodir_theme_location);
227
-    } else {
228
-        update_option('geodir_theme_location_nav', '');
229
-    }
224
+	$geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
+	if ($geodir_theme_location) {
226
+		update_option('geodir_theme_location_nav', $geodir_theme_location);
227
+	} else {
228
+		update_option('geodir_theme_location_nav', '');
229
+	}
230 230
 }
231 231
 
232 232
 /// add action for theme switch to blank previous theme navigation location setting
@@ -247,32 +247,32 @@  discard block
 block discarded – undo
247 247
  */
248 248
 function geodir_add_post_filters()
249 249
 {
250
-    /**
251
-     * Contains all function for filtering listing.
252
-     *
253
-     * @since 1.0.0
254
-     * @package GeoDirectory
255
-     */
256
-    include_once('geodirectory-functions/listing_filters.php');
250
+	/**
251
+	 * Contains all function for filtering listing.
252
+	 *
253
+	 * @since 1.0.0
254
+	 * @package GeoDirectory
255
+	 */
256
+	include_once('geodirectory-functions/listing_filters.php');
257 257
 }
258 258
 
259 259
 
260 260
 if (!function_exists('geodir_init_defaults')) {
261
-    /**
262
-     * Calls the function to register the GeoDirectory default CPT and taxonomies.
263
-     *
264
-     * @since 1.0.0
265
-     * @package GeoDirectory
266
-     */
267
-    function geodir_init_defaults()
268
-    {
269
-        if (function_exists('geodir_register_defaults')) {
261
+	/**
262
+	 * Calls the function to register the GeoDirectory default CPT and taxonomies.
263
+	 *
264
+	 * @since 1.0.0
265
+	 * @package GeoDirectory
266
+	 */
267
+	function geodir_init_defaults()
268
+	{
269
+		if (function_exists('geodir_register_defaults')) {
270 270
 
271
-            geodir_register_defaults();
271
+			geodir_register_defaults();
272 272
 
273
-        }
273
+		}
274 274
 
275
-    }
275
+	}
276 276
 }
277 277
 
278 278
 
@@ -294,26 +294,26 @@  discard block
 block discarded – undo
294 294
 // CALLED ON 'sidebars_widgets' FILTER
295 295
 
296 296
 if (!function_exists('geodir_restrict_widget')) {
297
-    /**
298
-     * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
299
-     *
300
-     * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
301
-     * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
302
-     * @since 1.0.0
303
-     * @package GeoDirectory
304
-     */
305
-    function geodir_restrict_widget()
306
-    {
307
-        global $is_listing, $is_single_place;
297
+	/**
298
+	 * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
299
+	 *
300
+	 * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
301
+	 * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
302
+	 * @since 1.0.0
303
+	 * @package GeoDirectory
304
+	 */
305
+	function geodir_restrict_widget()
306
+	{
307
+		global $is_listing, $is_single_place;
308 308
 
309
-        // set is listing	
310
-        (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
309
+		// set is listing	
310
+		(geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
311 311
 
312
-        // set is single place
313
-        (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
312
+		// set is single place
313
+		(geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
314 314
 
315 315
 
316
-    }
316
+	}
317 317
 }
318 318
 
319 319
 
@@ -334,32 +334,32 @@  discard block
 block discarded – undo
334 334
  */
335 335
 function geodir_detail_page_sidebar_content_sorting()
336 336
 {
337
-    $arr_detail_page_sidebar_content =
338
-        /**
339
-         * An array of functions to be called to be displayed on the details (post) page sidebar.
340
-         *
341
-         * This filter can be used to remove sections of the details page sidebar,
342
-         * add new sections or rearrange the order of the sections.
343
-         *
344
-         * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
345
-         * @since 1.0.0
346
-         */
347
-        apply_filters('geodir_detail_page_sidebar_content',
348
-            array('geodir_social_sharing_buttons',
349
-                'geodir_share_this_button',
350
-                'geodir_detail_page_google_analytics',
351
-                'geodir_edit_post_link',
352
-                'geodir_detail_page_review_rating',
353
-                'geodir_detail_page_more_info'
354
-            ) // end of array 
355
-        ); // end of apply filter
356
-    if (!empty($arr_detail_page_sidebar_content)) {
357
-        foreach ($arr_detail_page_sidebar_content as $content_function) {
358
-            if (function_exists($content_function)) {
359
-                add_action('geodir_detail_page_sidebar', $content_function);
360
-            }
361
-        }
362
-    }
337
+	$arr_detail_page_sidebar_content =
338
+		/**
339
+		 * An array of functions to be called to be displayed on the details (post) page sidebar.
340
+		 *
341
+		 * This filter can be used to remove sections of the details page sidebar,
342
+		 * add new sections or rearrange the order of the sections.
343
+		 *
344
+		 * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
345
+		 * @since 1.0.0
346
+		 */
347
+		apply_filters('geodir_detail_page_sidebar_content',
348
+			array('geodir_social_sharing_buttons',
349
+				'geodir_share_this_button',
350
+				'geodir_detail_page_google_analytics',
351
+				'geodir_edit_post_link',
352
+				'geodir_detail_page_review_rating',
353
+				'geodir_detail_page_more_info'
354
+			) // end of array 
355
+		); // end of apply filter
356
+	if (!empty($arr_detail_page_sidebar_content)) {
357
+		foreach ($arr_detail_page_sidebar_content as $content_function) {
358
+			if (function_exists($content_function)) {
359
+				add_action('geodir_detail_page_sidebar', $content_function);
360
+			}
361
+		}
362
+	}
363 363
 }
364 364
 
365 365
 add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1);
@@ -374,14 +374,14 @@  discard block
 block discarded – undo
374 374
  */
375 375
 function geodir_add_to_favourite_link()
376 376
 {
377
-    global $post, $preview;
378
-    if (!$preview && geodir_is_page('detail')) {
379
-        ?>
377
+	global $post, $preview;
378
+	if (!$preview && geodir_is_page('detail')) {
379
+		?>
380 380
         <p class="edit_link">
381 381
             <?php geodir_favourite_html($post->post_author, $post->ID); ?>
382 382
         </p>
383 383
     <?php
384
-    }
384
+	}
385 385
 }
386 386
 
387 387
 /**
@@ -395,41 +395,41 @@  discard block
 block discarded – undo
395 395
  */
396 396
 function geodir_social_sharing_buttons()
397 397
 {
398
-    global $preview;
399
-    ob_start(); // Start  buffering;
400
-    /**
401
-     * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
402
-     *
403
-     * @since 1.0.0
404
-     */
405
-    do_action('geodir_before_social_sharing_buttons');
406
-    if (!$preview) {
407
-        ?>
398
+	global $preview;
399
+	ob_start(); // Start  buffering;
400
+	/**
401
+	 * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
402
+	 *
403
+	 * @since 1.0.0
404
+	 */
405
+	do_action('geodir_before_social_sharing_buttons');
406
+	if (!$preview) {
407
+		?>
408 408
         <div class="likethis">
409 409
             <?php geodir_twitter_tweet_button(); ?>
410 410
             <?php geodir_fb_like_button(); ?>
411 411
             <?php geodir_google_plus_button(); ?>
412 412
         </div>
413 413
     <?php
414
-    }// end of if, if its a preview or not
415
-
416
-    /**
417
-     * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
418
-     *
419
-     * @since 1.0.0
420
-     */
421
-    do_action('geodir_after_social_sharing_buttons');
422
-    $content_html = ob_get_clean();
423
-    if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426
-        /**
427
-         * Filter the geodir_social_sharing_buttons() function content.
428
-         *
429
-         * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
430
-         */
431
-        echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
432
-    }
414
+	}// end of if, if its a preview or not
415
+
416
+	/**
417
+	 * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
418
+	 *
419
+	 * @since 1.0.0
420
+	 */
421
+	do_action('geodir_after_social_sharing_buttons');
422
+	$content_html = ob_get_clean();
423
+	if (trim($content_html) != '')
424
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
+	if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426
+		/**
427
+		 * Filter the geodir_social_sharing_buttons() function content.
428
+		 *
429
+		 * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
430
+		 */
431
+		echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
432
+	}
433 433
 
434 434
 
435 435
 }
@@ -445,39 +445,39 @@  discard block
 block discarded – undo
445 445
  */
446 446
 function geodir_share_this_button()
447 447
 {
448
-    global $preview;
449
-    ob_start(); // Start buffering;
450
-    /**
451
-     * This is called before the share this html in the function geodir_share_this_button()
452
-     *
453
-     * @since 1.0.0
454
-     */
455
-    do_action('geodir_before_share_this_button');
456
-    if (!$preview) {
457
-        ?>
448
+	global $preview;
449
+	ob_start(); // Start buffering;
450
+	/**
451
+	 * This is called before the share this html in the function geodir_share_this_button()
452
+	 *
453
+	 * @since 1.0.0
454
+	 */
455
+	do_action('geodir_before_share_this_button');
456
+	if (!$preview) {
457
+		?>
458 458
         <div class="share clearfix">
459 459
             <?php geodir_share_this_button_code(); ?>
460 460
         </div>
461 461
     <?php
462
-    }// end of if, if its a preview or not
463
-    /**
464
-     * This is called after the share this html in the function geodir_share_this_button()
465
-     *
466
-     * @since 1.0.0
467
-     */
468
-    do_action('geodir_after_share_this_button');
469
-    $content_html = ob_get_clean();
470
-    if (trim($content_html) != '')
471
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
472
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
473
-        /**
474
-         * Filter the geodir_share_this_button() function content.
475
-         *
476
-         * @param string $content_html The output html of the geodir_share_this_button() function.
477
-         * @since 1.0.0
478
-         */
479
-        echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
480
-    }
462
+	}// end of if, if its a preview or not
463
+	/**
464
+	 * This is called after the share this html in the function geodir_share_this_button()
465
+	 *
466
+	 * @since 1.0.0
467
+	 */
468
+	do_action('geodir_after_share_this_button');
469
+	$content_html = ob_get_clean();
470
+	if (trim($content_html) != '')
471
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
472
+	if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
473
+		/**
474
+		 * Filter the geodir_share_this_button() function content.
475
+		 *
476
+		 * @param string $content_html The output html of the geodir_share_this_button() function.
477
+		 * @since 1.0.0
478
+		 */
479
+		echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
480
+	}
481 481
 
482 482
 }
483 483
 
@@ -493,46 +493,46 @@  discard block
 block discarded – undo
493 493
  */
494 494
 function geodir_edit_post_link()
495 495
 {
496
-    global $post, $preview;
497
-    ob_start(); // Start buffering;
498
-    /**
499
-     * This is called before the edit post link html in the function geodir_edit_post_link()
500
-     *
501
-     * @since 1.0.0
502
-     */
503
-    do_action('geodir_before_edit_post_link');
504
-    if (!$preview) {
505
-        $is_current_user_owner = geodir_listing_belong_to_current_user();
496
+	global $post, $preview;
497
+	ob_start(); // Start buffering;
498
+	/**
499
+	 * This is called before the edit post link html in the function geodir_edit_post_link()
500
+	 *
501
+	 * @since 1.0.0
502
+	 */
503
+	do_action('geodir_before_edit_post_link');
504
+	if (!$preview) {
505
+		$is_current_user_owner = geodir_listing_belong_to_current_user();
506 506
         
507
-        if ($is_current_user_owner) {
508
-            $post_id = $post->ID;
507
+		if ($is_current_user_owner) {
508
+			$post_id = $post->ID;
509 509
             
510
-            if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
511
-                $post_id = (int)$_REQUEST['pid'];
512
-            }
510
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
511
+				$post_id = (int)$_REQUEST['pid'];
512
+			}
513 513
 
514
-            $postlink = get_permalink(geodir_add_listing_page_id());
515
-            $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
516
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
517
-        }
518
-    }// end of if, if its a preview or not
519
-    /**
520
-     * This is called after the edit post link html in the function geodir_edit_post_link()
521
-     *
522
-     * @since 1.0.0
523
-     */
524
-    do_action('geodir_after_edit_post_link');
525
-    $content_html = ob_get_clean();
526
-    if (trim($content_html) != '')
527
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
528
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
529
-        /**
530
-         * Filter the geodir_edit_post_link() function content.
531
-         *
532
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
533
-         */
534
-        echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
535
-    }
514
+			$postlink = get_permalink(geodir_add_listing_page_id());
515
+			$editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
516
+			echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
517
+		}
518
+	}// end of if, if its a preview or not
519
+	/**
520
+	 * This is called after the edit post link html in the function geodir_edit_post_link()
521
+	 *
522
+	 * @since 1.0.0
523
+	 */
524
+	do_action('geodir_after_edit_post_link');
525
+	$content_html = ob_get_clean();
526
+	if (trim($content_html) != '')
527
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
528
+	if ((int)get_option('geodir_disable_user_links_section') != 1) {
529
+		/**
530
+		 * Filter the geodir_edit_post_link() function content.
531
+		 *
532
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
533
+		 */
534
+		echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
535
+	}
536 536
 }
537 537
 
538 538
 /**
@@ -546,41 +546,41 @@  discard block
 block discarded – undo
546 546
  */
547 547
 function geodir_detail_page_google_analytics()
548 548
 {
549
-    global $post;
550
-    $package_info = array();
551
-    $package_info = geodir_post_package_info($package_info, $post);
549
+	global $post;
550
+	$package_info = array();
551
+	$package_info = geodir_post_package_info($package_info, $post);
552 552
 
553
-    $id = trim(get_option('geodir_ga_id'));
553
+	$id = trim(get_option('geodir_ga_id'));
554 554
 
555
-    if (!$id) {
556
-        return; //if no Google Analytics ID then bail.
557
-    }
555
+	if (!$id) {
556
+		return; //if no Google Analytics ID then bail.
557
+	}
558 558
 
559
-    ob_start(); // Start buffering;
560
-    /**
561
-     * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
562
-     *
563
-     * @since 1.0.0
564
-     */
565
-    do_action('geodir_before_google_analytics');
559
+	ob_start(); // Start buffering;
560
+	/**
561
+	 * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
562
+	 *
563
+	 * @since 1.0.0
564
+	 */
565
+	do_action('geodir_before_google_analytics');
566 566
     
567
-    $refresh_time = get_option('geodir_ga_refresh_time', 5);
568
-    /**
569
-     * Filter the time interval to check & refresh new users results.
570
-     *
571
-     * @since 1.5.9
572
-     *
573
-     * @param int $refresh_time Time interval to check & refresh new users results.
574
-     */
575
-    $refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
576
-    $refresh_time = absint($refresh_time * 1000);
567
+	$refresh_time = get_option('geodir_ga_refresh_time', 5);
568
+	/**
569
+	 * Filter the time interval to check & refresh new users results.
570
+	 *
571
+	 * @since 1.5.9
572
+	 *
573
+	 * @param int $refresh_time Time interval to check & refresh new users results.
574
+	 */
575
+	$refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
576
+	$refresh_time = absint($refresh_time * 1000);
577 577
     
578
-    $hide_refresh = get_option('geodir_ga_auto_refresh');
578
+	$hide_refresh = get_option('geodir_ga_auto_refresh');
579 579
     
580
-    $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
581
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
582
-        $page_url = urlencode($_SERVER['REQUEST_URI']);
583
-        ?>
580
+	$auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
581
+	if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
582
+		$page_url = urlencode($_SERVER['REQUEST_URI']);
583
+		?>
584 584
         <script type="text/javascript">
585 585
             var gd_gaTimeOut;
586 586
             var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
@@ -832,15 +832,15 @@  discard block
 block discarded – undo
832 832
                     var labels = results[1].rows.map(function(row) { return +row[0]; });
833 833
 
834 834
                     <?php
835
-                    // Here we list the shorthand days of the week so it can be used in translation.
836
-                    __("Mon",'geodirectory');
837
-                    __("Tue",'geodirectory');
838
-                    __("Wed",'geodirectory');
839
-                    __("Thu",'geodirectory');
840
-                    __("Fri",'geodirectory');
841
-                    __("Sat",'geodirectory');
842
-                    __("Sun",'geodirectory');
843
-                    ?>
835
+					// Here we list the shorthand days of the week so it can be used in translation.
836
+					__("Mon",'geodirectory');
837
+					__("Tue",'geodirectory');
838
+					__("Wed",'geodirectory');
839
+					__("Thu",'geodirectory');
840
+					__("Fri",'geodirectory');
841
+					__("Sat",'geodirectory');
842
+					__("Sun",'geodirectory');
843
+					?>
844 844
 
845 845
                     labels = [
846 846
                         "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
@@ -1089,24 +1089,24 @@  discard block
 block discarded – undo
1089 1089
         </span>
1090 1090
 
1091 1091
     <?php
1092
-    }
1093
-    /**
1094
-     * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1095
-     *
1096
-     * @since 1.0.0
1097
-     */
1098
-    do_action('geodir_after_google_analytics');
1099
-    $content_html = ob_get_clean();
1100
-    if (trim($content_html) != '')
1101
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1102
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1103
-        /**
1104
-         * Filter the geodir_edit_post_link() function content.
1105
-         *
1106
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
1107
-         */
1108
-        echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1109
-    }
1092
+	}
1093
+	/**
1094
+	 * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1095
+	 *
1096
+	 * @since 1.0.0
1097
+	 */
1098
+	do_action('geodir_after_google_analytics');
1099
+	$content_html = ob_get_clean();
1100
+	if (trim($content_html) != '')
1101
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1102
+	if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1103
+		/**
1104
+		 * Filter the geodir_edit_post_link() function content.
1105
+		 *
1106
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
1107
+		 */
1108
+		echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1109
+	}
1110 1110
 }
1111 1111
 
1112 1112
 /**
@@ -1120,90 +1120,90 @@  discard block
 block discarded – undo
1120 1120
  */
1121 1121
 function geodir_detail_page_review_rating()
1122 1122
 {
1123
-    global $post, $preview, $post_images;
1124
-    ob_start(); // Start  buffering;
1125
-    /**
1126
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1127
-     *
1128
-     * This is called outside the check for an actual rating and the check for preview page.
1129
-     *
1130
-     * @since 1.0.0
1131
-     */
1132
-    do_action('geodir_before_detail_page_review_rating');
1133
-
1134
-    $comment_count = geodir_get_review_count_total($post->ID);
1135
-    $post_avgratings = geodir_get_post_rating($post->ID);
1136
-
1137
-    if ($post_avgratings != 0 && !$preview) {
1138
-        /**
1139
-         * This is called before the rating html in the function geodir_detail_page_review_rating().
1140
-         *
1141
-         * This is called inside the check for an actual rating and the check for preview page.
1142
-         *
1143
-         * @since 1.0.0
1144
-         * @param float $post_avgratings Average rating for the surrent post.
1145
-         * @param int $post->ID Current post ID.
1146
-         */
1147
-        do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1148
-
1149
-        $html = '<p style=" float:left;">';
1150
-        $html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1151
-        $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1152
-        $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1123
+	global $post, $preview, $post_images;
1124
+	ob_start(); // Start  buffering;
1125
+	/**
1126
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1127
+	 *
1128
+	 * This is called outside the check for an actual rating and the check for preview page.
1129
+	 *
1130
+	 * @since 1.0.0
1131
+	 */
1132
+	do_action('geodir_before_detail_page_review_rating');
1133
+
1134
+	$comment_count = geodir_get_review_count_total($post->ID);
1135
+	$post_avgratings = geodir_get_post_rating($post->ID);
1136
+
1137
+	if ($post_avgratings != 0 && !$preview) {
1138
+		/**
1139
+		 * This is called before the rating html in the function geodir_detail_page_review_rating().
1140
+		 *
1141
+		 * This is called inside the check for an actual rating and the check for preview page.
1142
+		 *
1143
+		 * @since 1.0.0
1144
+		 * @param float $post_avgratings Average rating for the surrent post.
1145
+		 * @param int $post->ID Current post ID.
1146
+		 */
1147
+		do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1148
+
1149
+		$html = '<p style=" float:left;">';
1150
+		$html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1151
+		$html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1152
+		$post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1153 1153
        
1154 1154
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1155 1155
 	   
1156 1156
 	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1157 1157
 
1158
-        $html .= '<span class="item">';
1159
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1158
+		$html .= '<span class="item">';
1159
+		$html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1160 1160
 
1161
-        if ($post_images) {
1162
-            foreach ($post_images as $img) {
1163
-                $post_img = $img->src;
1164
-                break;
1165
-            }
1166
-        }
1167
-
1168
-        if (isset($post_img) && $post_img) {
1169
-            $html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />';
1170
-        }
1171
-
1172
-        $html .= '</span>';
1173
-
1174
-        echo $html .= '</div>';
1175
-        /**
1176
-         * This is called after the rating html in the function geodir_detail_page_review_rating().
1177
-         *
1178
-         * This is called inside the check for an actual rating and the check for preview page.
1179
-         *
1180
-         * @since 1.0.0
1181
-         * @param float $post_avgratings Average rating for the surrent post.
1182
-         * @param int $post->ID Current post ID.
1183
-         */
1184
-        do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1185
-    }
1186
-    /**
1187
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1188
-     *
1189
-     * This is called outside the check for an actual rating and the check for preview page.
1190
-     *
1191
-     * @since 1.0.0
1192
-     */
1193
-    do_action('geodir_after_detail_page_review_rating');
1194
-    $content_html = ob_get_clean();
1195
-    if (trim($content_html) != '') {
1196
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1197
-    }
1198
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1199
-        /**
1200
-         * Filter the geodir_detail_page_review_rating() function content.
1201
-         *
1202
-         * @since 1.0.0
1203
-         * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1204
-         */
1205
-        echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1206
-    }
1161
+		if ($post_images) {
1162
+			foreach ($post_images as $img) {
1163
+				$post_img = $img->src;
1164
+				break;
1165
+			}
1166
+		}
1167
+
1168
+		if (isset($post_img) && $post_img) {
1169
+			$html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />';
1170
+		}
1171
+
1172
+		$html .= '</span>';
1173
+
1174
+		echo $html .= '</div>';
1175
+		/**
1176
+		 * This is called after the rating html in the function geodir_detail_page_review_rating().
1177
+		 *
1178
+		 * This is called inside the check for an actual rating and the check for preview page.
1179
+		 *
1180
+		 * @since 1.0.0
1181
+		 * @param float $post_avgratings Average rating for the surrent post.
1182
+		 * @param int $post->ID Current post ID.
1183
+		 */
1184
+		do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1185
+	}
1186
+	/**
1187
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1188
+	 *
1189
+	 * This is called outside the check for an actual rating and the check for preview page.
1190
+	 *
1191
+	 * @since 1.0.0
1192
+	 */
1193
+	do_action('geodir_after_detail_page_review_rating');
1194
+	$content_html = ob_get_clean();
1195
+	if (trim($content_html) != '') {
1196
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1197
+	}
1198
+	if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1199
+		/**
1200
+		 * Filter the geodir_detail_page_review_rating() function content.
1201
+		 *
1202
+		 * @since 1.0.0
1203
+		 * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1204
+		 */
1205
+		echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1206
+	}
1207 1207
 }
1208 1208
 
1209 1209
 /**
@@ -1215,35 +1215,35 @@  discard block
 block discarded – undo
1215 1215
  */
1216 1216
 function geodir_detail_page_more_info()
1217 1217
 {
1218
-    ob_start(); // Start  buffering;
1219
-    /**
1220
-     * This is called before the info section html.
1221
-     *
1222
-     * @since 1.0.0
1223
-     */
1224
-    do_action('geodir_before_detail_page_more_info');
1225
-    if ($geodir_post_detail_fields = geodir_show_listing_info()) {
1226
-        echo $geodir_post_detail_fields;
1227
-    }
1228
-    /**
1229
-     * This is called after the info section html.
1230
-     *
1231
-     * @since 1.0.0
1232
-     */
1233
-    do_action('geodir_after_detail_page_more_info');
1234
-
1235
-    $content_html = ob_get_clean();
1236
-    if (trim($content_html) != '')
1237
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1238
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1239
-        /**
1240
-         * Filter the output html for function geodir_detail_page_more_info().
1241
-         *
1242
-         * @since 1.0.0
1243
-         * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1244
-         */
1245
-        echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1246
-    }
1218
+	ob_start(); // Start  buffering;
1219
+	/**
1220
+	 * This is called before the info section html.
1221
+	 *
1222
+	 * @since 1.0.0
1223
+	 */
1224
+	do_action('geodir_before_detail_page_more_info');
1225
+	if ($geodir_post_detail_fields = geodir_show_listing_info()) {
1226
+		echo $geodir_post_detail_fields;
1227
+	}
1228
+	/**
1229
+	 * This is called after the info section html.
1230
+	 *
1231
+	 * @since 1.0.0
1232
+	 */
1233
+	do_action('geodir_after_detail_page_more_info');
1234
+
1235
+	$content_html = ob_get_clean();
1236
+	if (trim($content_html) != '')
1237
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1238
+	if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1239
+		/**
1240
+		 * Filter the output html for function geodir_detail_page_more_info().
1241
+		 *
1242
+		 * @since 1.0.0
1243
+		 * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1244
+		 */
1245
+		echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1246
+	}
1247 1247
 }
1248 1248
 
1249 1249
 
@@ -1257,15 +1257,15 @@  discard block
 block discarded – undo
1257 1257
  */
1258 1258
 function geodir_localize_all_js_msg()
1259 1259
 {// 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
1260
-    if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1261
-        $ajax_url = admin_url('admin-ajax.php');
1262
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1263
-        $ajax_url = admin_url('admin-ajax.php');
1264
-    } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1265
-        $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1266
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1267
-        $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1268
-    }
1260
+	if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1261
+		$ajax_url = admin_url('admin-ajax.php');
1262
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1263
+		$ajax_url = admin_url('admin-ajax.php');
1264
+	} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1265
+		$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1266
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1267
+		$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1268
+	}
1269 1269
 	
1270 1270
 	/**
1271 1271
 	 * Filter the allowed image type extensions for post images.
@@ -1275,59 +1275,59 @@  discard block
 block discarded – undo
1275 1275
 	 */
1276 1276
 	$allowed_img_types = apply_filters('geodir_allowed_post_image_exts', array('jpg', 'jpeg', 'jpe', 'gif', 'png'));
1277 1277
 	
1278
-    $default_marker_icon = get_option('geodir_default_marker_icon');
1279
-    $default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1280
-    $default_marker_width = $default_marker_size['w'];
1281
-    $default_marker_height = $default_marker_size['h'];
1278
+	$default_marker_icon = get_option('geodir_default_marker_icon');
1279
+	$default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1280
+	$default_marker_width = $default_marker_size['w'];
1281
+	$default_marker_height = $default_marker_size['h'];
1282 1282
     
1283
-    $arr_alert_msg = array(
1284
-        'geodir_plugin_url' => geodir_plugin_url(),
1285
-        'geodir_admin_ajax_url' => $ajax_url,
1286
-        'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1287
-        'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1288
-        'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1289
-        'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1290
-        //start not show alert msg
1291
-        'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1292
-        'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1293
-        'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1294
-        'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1295
-        'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1296
-        // end not show alert msg
1297
-        'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1298
-        //start not show alert msg
1299
-        'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1300
-        'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1301
-        'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1302
-        'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1303
-        'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1304
-        'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1305
-        'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1306
-        'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1307
-        'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1308
-        'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1309
-        'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1310
-        'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1311
-        'geodir_default_marker_icon' => $default_marker_icon,
1312
-        'geodir_default_marker_w' => $default_marker_width,
1313
-        'geodir_default_marker_h' => $default_marker_height,
1314
-        'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1315
-        'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1316
-        'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1317
-        'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1318
-        'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1319
-        'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1320
-        'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1321
-        'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1322
-        /* on/off dragging for phone devices */
1323
-        'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1324
-        'geodir_is_mobile' => wp_is_mobile() ? true : false,
1325
-        'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1326
-        'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1327
-        'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1328
-        'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1329
-        'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1330
-        'geodir_action_remove' => __('Remove', 'geodirectory'),
1283
+	$arr_alert_msg = array(
1284
+		'geodir_plugin_url' => geodir_plugin_url(),
1285
+		'geodir_admin_ajax_url' => $ajax_url,
1286
+		'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1287
+		'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1288
+		'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1289
+		'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1290
+		//start not show alert msg
1291
+		'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1292
+		'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1293
+		'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1294
+		'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1295
+		'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1296
+		// end not show alert msg
1297
+		'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1298
+		//start not show alert msg
1299
+		'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1300
+		'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1301
+		'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1302
+		'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1303
+		'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1304
+		'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1305
+		'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1306
+		'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1307
+		'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1308
+		'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1309
+		'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1310
+		'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1311
+		'geodir_default_marker_icon' => $default_marker_icon,
1312
+		'geodir_default_marker_w' => $default_marker_width,
1313
+		'geodir_default_marker_h' => $default_marker_height,
1314
+		'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1315
+		'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1316
+		'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1317
+		'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1318
+		'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1319
+		'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1320
+		'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1321
+		'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1322
+		/* on/off dragging for phone devices */
1323
+		'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1324
+		'geodir_is_mobile' => wp_is_mobile() ? true : false,
1325
+		'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1326
+		'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1327
+		'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1328
+		'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1329
+		'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1330
+		'geodir_action_remove' => __('Remove', 'geodirectory'),
1331 1331
 		'geodir_txt_all_files' => __('Allowed files', 'geodirectory'),
1332 1332
 		'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'),
1333 1333
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
@@ -1335,29 +1335,29 @@  discard block
 block discarded – undo
1335 1335
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1336 1336
 		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1337 1337
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1338
-        'geodir_map_name' => geodir_map_name(),
1339
-    );
1340
-
1341
-    /**
1342
-     * Filters the translated JS strings from function geodir_localize_all_js_msg().
1343
-     *
1344
-     * With this filter you can add, remove or change translated JS strings.
1345
-     * You should add your own translations to this if you are building an addon rather than adding another script block.
1346
-     *
1347
-     * @since 1.0.0
1348
-     */
1349
-    $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1350
-
1351
-    foreach ($arr_alert_msg as $key => $value) {
1352
-        if (!is_scalar($value))
1353
-            continue;
1354
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1355
-    }
1338
+		'geodir_map_name' => geodir_map_name(),
1339
+	);
1340
+
1341
+	/**
1342
+	 * Filters the translated JS strings from function geodir_localize_all_js_msg().
1343
+	 *
1344
+	 * With this filter you can add, remove or change translated JS strings.
1345
+	 * You should add your own translations to this if you are building an addon rather than adding another script block.
1346
+	 *
1347
+	 * @since 1.0.0
1348
+	 */
1349
+	$arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1356 1350
 
1357
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1358
-    echo '<script>';
1359
-    echo $script;
1360
-    echo '</script>';
1351
+	foreach ($arr_alert_msg as $key => $value) {
1352
+		if (!is_scalar($value))
1353
+			continue;
1354
+		$arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1355
+	}
1356
+
1357
+	$script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1358
+	echo '<script>';
1359
+	echo $script;
1360
+	echo '</script>';
1361 1361
 }
1362 1362
 
1363 1363
 add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31);
@@ -1373,9 +1373,9 @@  discard block
 block discarded – undo
1373 1373
  */
1374 1374
 function geodir_admin_bar_site_menu($wp_admin_bar)
1375 1375
 {
1376
-    if (get_option("geodir_installed")) {
1377
-        $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1378
-    }
1376
+	if (get_option("geodir_installed")) {
1377
+		$wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1378
+	}
1379 1379
 }
1380 1380
 
1381 1381
 add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/
@@ -1401,25 +1401,25 @@  discard block
 block discarded – undo
1401 1401
  */
1402 1402
 function geodir_store_sidebars()
1403 1403
 {
1404
-    global $geodir_sidebars;
1405
-    global $sidebars_widgets;
1406
-
1407
-    if (!is_array($sidebars_widgets))
1408
-        $sidebars_widgets = wp_get_sidebars_widgets();
1409
-    $geodir_old_sidebars = array();
1410
-
1411
-    if (is_array($geodir_sidebars)) {
1412
-        foreach ($geodir_sidebars as $val) {
1413
-            if (is_array($sidebars_widgets)) {
1414
-                if (array_key_exists($val, $sidebars_widgets))
1415
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1416
-                else
1417
-                    $geodir_old_sidebars[$val] = array();
1418
-            }
1419
-        }
1420
-    }
1421
-    update_option('geodir_sidebars', $geodir_old_sidebars);
1422
-    geodir_option_version_backup('geodir_sidebars');
1404
+	global $geodir_sidebars;
1405
+	global $sidebars_widgets;
1406
+
1407
+	if (!is_array($sidebars_widgets))
1408
+		$sidebars_widgets = wp_get_sidebars_widgets();
1409
+	$geodir_old_sidebars = array();
1410
+
1411
+	if (is_array($geodir_sidebars)) {
1412
+		foreach ($geodir_sidebars as $val) {
1413
+			if (is_array($sidebars_widgets)) {
1414
+				if (array_key_exists($val, $sidebars_widgets))
1415
+					$geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1416
+				else
1417
+					$geodir_old_sidebars[$val] = array();
1418
+			}
1419
+		}
1420
+	}
1421
+	update_option('geodir_sidebars', $geodir_old_sidebars);
1422
+	geodir_option_version_backup('geodir_sidebars');
1423 1423
 
1424 1424
 }
1425 1425
 
@@ -1433,34 +1433,34 @@  discard block
 block discarded – undo
1433 1433
  */
1434 1434
 function geodir_restore_sidebars()
1435 1435
 {
1436
-    global $sidebars_widgets;
1437
-
1438
-    if (!is_array($sidebars_widgets))
1439
-        $sidebars_widgets = wp_get_sidebars_widgets();
1440
-
1441
-    if (is_array($sidebars_widgets)) {
1442
-        $geodir_old_sidebars = get_option('geodir_sidebars');
1443
-        if (is_array($geodir_old_sidebars)) {
1444
-            foreach ($geodir_old_sidebars as $key => $val) {
1445
-                //if(array_key_exists($key, $sidebars_widgets))
1446
-                {
1447
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1448
-                }
1436
+	global $sidebars_widgets;
1449 1437
 
1438
+	if (!is_array($sidebars_widgets))
1439
+		$sidebars_widgets = wp_get_sidebars_widgets();
1450 1440
 
1451
-            }
1452
-        }
1441
+	if (is_array($sidebars_widgets)) {
1442
+		$geodir_old_sidebars = get_option('geodir_sidebars');
1443
+		if (is_array($geodir_old_sidebars)) {
1444
+			foreach ($geodir_old_sidebars as $key => $val) {
1445
+				//if(array_key_exists($key, $sidebars_widgets))
1446
+				{
1447
+					$sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1448
+				}
1453 1449
 
1454
-        // now clear all non geodiretory sidebars 
1455
-        foreach ($sidebars_widgets as $key => $val) {
1456
-            if (!array_key_exists($key, $geodir_old_sidebars)) {
1457
-                $sidebars_widgets[$key] = array();
1458
-            }
1459
-        }
1460
-    }
1461 1450
 
1462
-    update_option('sidebars_widgets', $sidebars_widgets);
1463
-    update_option('geodir_sidebars', '');
1451
+			}
1452
+		}
1453
+
1454
+		// now clear all non geodiretory sidebars 
1455
+		foreach ($sidebars_widgets as $key => $val) {
1456
+			if (!array_key_exists($key, $geodir_old_sidebars)) {
1457
+				$sidebars_widgets[$key] = array();
1458
+			}
1459
+		}
1460
+	}
1461
+
1462
+	update_option('sidebars_widgets', $sidebars_widgets);
1463
+	update_option('geodir_sidebars', '');
1464 1464
 }
1465 1465
 
1466 1466
 add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview');
@@ -1473,9 +1473,9 @@  discard block
 block discarded – undo
1473 1473
  */
1474 1474
 function geodir_after_listing_post_gridview()
1475 1475
 {
1476
-    global $gridview_columns;
1476
+	global $gridview_columns;
1477 1477
 
1478
-    $gridview_columns = '';
1478
+	$gridview_columns = '';
1479 1479
 
1480 1480
 }
1481 1481
 
@@ -1503,11 +1503,11 @@  discard block
 block discarded – undo
1503 1503
  */
1504 1504
 function so_handle_038($url, $original_url, $_context)
1505 1505
 {
1506
-    if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1507
-        $url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1508
-    }
1506
+	if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1507
+		$url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1508
+	}
1509 1509
 
1510
-    return $url;
1510
+	return $url;
1511 1511
 }
1512 1512
 
1513 1513
 
@@ -1523,34 +1523,34 @@  discard block
 block discarded – undo
1523 1523
 function geodir_after_main_form_fields() {
1524 1524
 	global $gd_session;
1525 1525
 	
1526
-    if (get_option('geodir_accept_term_condition')) {
1527
-        global $post;
1528
-        $term_condition = '';
1529
-        if (isset($_REQUEST['backandedit'])) {
1530
-            $post = (object)$gd_session->get('listing');
1531
-            $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1532
-        }
1533
-
1534
-        ?>
1526
+	if (get_option('geodir_accept_term_condition')) {
1527
+		global $post;
1528
+		$term_condition = '';
1529
+		if (isset($_REQUEST['backandedit'])) {
1530
+			$post = (object)$gd_session->get('listing');
1531
+			$term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1532
+		}
1533
+
1534
+		?>
1535 1535
         <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix">
1536 1536
             <label>&nbsp;</label>
1537 1537
 
1538 1538
             <div class="geodir_taxonomy_field" style="float:left; width:70%;">
1539 1539
 				<span style="display:block"> 
1540 1540
 				<input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') {
1541
-                    echo 'checked="checked"';
1542
-                } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1541
+					echo 'checked="checked"';
1542
+				} ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1543 1543
                        class="geodir_textfield" value="1"
1544 1544
                        style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1545 1545
 				</span>
1546 1546
             </div>
1547 1547
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
1548
-                    _e($required_msg, 'geodirectory');
1549
-                } ?></span>
1548
+					_e($required_msg, 'geodirectory');
1549
+				} ?></span>
1550 1550
         </div>
1551 1551
     <?php
1552 1552
 
1553
-    }
1553
+	}
1554 1554
 }
1555 1555
 
1556 1556
 
@@ -1575,42 +1575,42 @@  discard block
 block discarded – undo
1575 1575
  */
1576 1576
 function geodir_detail_page_tab_is_display($is_display, $tab)
1577 1577
 {
1578
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1578
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1579 1579
 
1580
-    if ($tab == 'post_profile') {
1581
-        /** This action is documented in geodirectory_template_actions.php */
1582
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1580
+	if ($tab == 'post_profile') {
1581
+		/** This action is documented in geodirectory_template_actions.php */
1582
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1583 1583
         
1584
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1585
-            $is_display = false;
1586
-        }
1587
-    }
1584
+		if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1585
+			$is_display = false;
1586
+		}
1587
+	}
1588 1588
     
1589
-    if ($tab == 'post_info')
1590
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1589
+	if ($tab == 'post_info')
1590
+		$is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1591 1591
 
1592
-    if ($tab == 'post_images')
1593
-        $is_display = (!empty($post_images)) ? true : false;
1592
+	if ($tab == 'post_images')
1593
+		$is_display = (!empty($post_images)) ? true : false;
1594 1594
 
1595
-    if ($tab == 'post_video')
1596
-        $is_display = (!empty($video)) ? true : false;
1595
+	if ($tab == 'post_video')
1596
+		$is_display = (!empty($video)) ? true : false;
1597 1597
 
1598
-    if ($tab == 'special_offers')
1599
-        $is_display = (!empty($special_offers)) ? true : false;
1598
+	if ($tab == 'special_offers')
1599
+		$is_display = (!empty($special_offers)) ? true : false;
1600 1600
 
1601
-    if ($tab == 'reviews')
1602
-        $is_display = (geodir_is_page('detail')) ? true : false;
1601
+	if ($tab == 'reviews')
1602
+		$is_display = (geodir_is_page('detail')) ? true : false;
1603 1603
 
1604
-    if ($tab == 'related_listing') {
1605
-       $message = __('No listings found which match your selection.', 'geodirectory');
1604
+	if ($tab == 'related_listing') {
1605
+	   $message = __('No listings found which match your selection.', 'geodirectory');
1606 1606
        
1607
-       /** This action is documented in geodirectory-functions/template_functions.php */
1608
-       $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1607
+	   /** This action is documented in geodirectory-functions/template_functions.php */
1608
+	   $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1609 1609
        
1610
-       $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1611
-    }
1610
+	   $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1611
+	}
1612 1612
 
1613
-    return $is_display;
1613
+	return $is_display;
1614 1614
 }
1615 1615
 
1616 1616
 
@@ -1626,69 +1626,69 @@  discard block
 block discarded – undo
1626 1626
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1627 1627
  */
1628 1628
 function geodir_changes_in_custom_fields_table() {
1629
-    global $wpdb, $plugin_prefix;
1629
+	global $wpdb, $plugin_prefix;
1630 1630
 	
1631 1631
 	// Remove unused virtual page
1632 1632
 	$listings_page_id = (int)get_option('geodir_listing_page');
1633 1633
 	if ($listings_page_id) {
1634 1634
 		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1635
-        delete_option('geodir_listing_page');
1635
+		delete_option('geodir_listing_page');
1636 1636
 	}
1637 1637
 
1638
-    if (!get_option('geodir_changes_in_custom_fields_table')) {
1639
-        $wpdb->query(
1640
-            $wpdb->prepare(
1641
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1642
-                array('1', '1', 'admin')
1643
-            )
1644
-        );
1638
+	if (!get_option('geodir_changes_in_custom_fields_table')) {
1639
+		$wpdb->query(
1640
+			$wpdb->prepare(
1641
+				"UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1642
+				array('1', '1', 'admin')
1643
+			)
1644
+		);
1645 1645
 
1646 1646
 
1647
-        /* --- terms meta value set --- */
1647
+		/* --- terms meta value set --- */
1648 1648
 
1649
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1649
+		update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1650 1650
 
1651
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1651
+		$options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1652 1652
 
1653
-        if (!empty($options_data)) {
1653
+		if (!empty($options_data)) {
1654 1654
 
1655
-            foreach ($options_data as $optobj) {
1655
+			foreach ($options_data as $optobj) {
1656 1656
 
1657
-                $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1657
+				$option_val = str_replace('tax_meta_', '', $optobj->option_name);
1658 1658
 
1659
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1659
+				$taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1660 1660
 
1661
-                if (!empty($taxonomies_data)) {
1661
+				if (!empty($taxonomies_data)) {
1662 1662
 
1663
-                    foreach ($taxonomies_data as $taxobj) {
1663
+					foreach ($taxonomies_data as $taxobj) {
1664 1664
 
1665
-                        $taxObject = get_taxonomy($taxobj->taxonomy);
1666
-                        $post_type = $taxObject->object_type[0];
1665
+						$taxObject = get_taxonomy($taxobj->taxonomy);
1666
+						$post_type = $taxObject->object_type[0];
1667 1667
 
1668
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1668
+						$opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1669 1669
 
1670
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1670
+						$duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1671 1671
 
1672
-                        if ($duplicate_data) {
1672
+						if ($duplicate_data) {
1673 1673
 
1674
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1674
+							$wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1675 1675
 
1676
-                        } else {
1676
+						} else {
1677 1677
 
1678
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1678
+							$wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1679 1679
 
1680
-                        }
1680
+						}
1681 1681
 
1682
-                    }
1682
+					}
1683 1683
 
1684
-                }
1684
+				}
1685 1685
 
1686
-            }
1687
-        }
1686
+			}
1687
+		}
1688 1688
 
1689
-        update_option('geodir_changes_in_custom_fields_table', '1');
1689
+		update_option('geodir_changes_in_custom_fields_table', '1');
1690 1690
 
1691
-    }
1691
+	}
1692 1692
 
1693 1693
 }
1694 1694
 
@@ -1707,24 +1707,24 @@  discard block
 block discarded – undo
1707 1707
 function geodir_location_slug_check($slug)
1708 1708
 {
1709 1709
 
1710
-    global $wpdb, $table_prefix;
1710
+	global $wpdb, $table_prefix;
1711 1711
 
1712
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1712
+	$slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1713 1713
 
1714
-    if ($slug_exists) {
1714
+	if ($slug_exists) {
1715 1715
 
1716
-        $suffix = 1;
1717
-        do {
1718
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1719
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1720
-            $suffix++;
1721
-        } while ($location_slug_check && $suffix < 100);
1716
+		$suffix = 1;
1717
+		do {
1718
+			$alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1719
+			$location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1720
+			$suffix++;
1721
+		} while ($location_slug_check && $suffix < 100);
1722 1722
 
1723
-        $slug = $alt_location_name;
1723
+		$slug = $alt_location_name;
1724 1724
 
1725
-    }
1725
+	}
1726 1726
 
1727
-    return $slug;
1727
+	return $slug;
1728 1728
 
1729 1729
 }
1730 1730
 
@@ -1749,42 +1749,42 @@  discard block
 block discarded – undo
1749 1749
 function geodir_update_term_slug($term_id, $tt_id, $taxonomy)
1750 1750
 {
1751 1751
 
1752
-    global $wpdb, $plugin_prefix, $table_prefix;
1752
+	global $wpdb, $plugin_prefix, $table_prefix;
1753 1753
 
1754
-    $tern_data = get_term_by('id', $term_id, $taxonomy);
1754
+	$tern_data = get_term_by('id', $term_id, $taxonomy);
1755 1755
 
1756
-    $slug = $tern_data->slug;
1756
+	$slug = $tern_data->slug;
1757 1757
 
1758
-    /**
1759
-     * Filter if a term slug exists.
1760
-     *
1761
-     * @since 1.0.0
1762
-     * @package GeoDirectory
1763
-     * @param bool $bool Default: false.
1764
-     * @param string $slug The term slug.
1765
-     * @param int $term_id The term ID.
1766
-     */
1767
-    $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1758
+	/**
1759
+	 * Filter if a term slug exists.
1760
+	 *
1761
+	 * @since 1.0.0
1762
+	 * @package GeoDirectory
1763
+	 * @param bool $bool Default: false.
1764
+	 * @param string $slug The term slug.
1765
+	 * @param int $term_id The term ID.
1766
+	 */
1767
+	$slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1768 1768
 
1769
-    if ($slug_exists) {
1769
+	if ($slug_exists) {
1770 1770
 
1771
-        $suffix = 1;
1772
-        do {
1773
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1771
+		$suffix = 1;
1772
+		do {
1773
+			$new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1774 1774
 
1775
-            /** This action is documented in geodirectory_hooks_actions.php */
1776
-            $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1775
+			/** This action is documented in geodirectory_hooks_actions.php */
1776
+			$term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1777 1777
 
1778
-            $suffix++;
1779
-        } while ($term_slug_check && $suffix < 100);
1778
+			$suffix++;
1779
+		} while ($term_slug_check && $suffix < 100);
1780 1780
 
1781
-        $slug = $new_slug;
1781
+		$slug = $new_slug;
1782 1782
 
1783
-        //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1783
+		//wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1784 1784
 
1785
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1785
+		$wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1786 1786
 
1787
-    }
1787
+	}
1788 1788
 	
1789 1789
 	// Update tag in detail table.
1790 1790
 	$taxonomy_obj = get_taxonomy($taxonomy);
@@ -1825,21 +1825,21 @@  discard block
 block discarded – undo
1825 1825
 function geodir_term_slug_is_exists($slug_exists, $slug, $term_id)
1826 1826
 {
1827 1827
 
1828
-    global $wpdb, $table_prefix;
1828
+	global $wpdb, $table_prefix;
1829 1829
 
1830
-    $default_location = geodir_get_default_location();
1830
+	$default_location = geodir_get_default_location();
1831 1831
 
1832
-    $country_slug = $default_location->country_slug;
1833
-    $region_slug = $default_location->region_slug;
1834
-    $city_slug = $default_location->city_slug;
1832
+	$country_slug = $default_location->country_slug;
1833
+	$region_slug = $default_location->region_slug;
1834
+	$city_slug = $default_location->city_slug;
1835 1835
 
1836
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1837
-        return $slug_exists = true;
1836
+	if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1837
+		return $slug_exists = true;
1838 1838
 
1839
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1840
-        return $slug_exists = true;
1839
+	if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1840
+		return $slug_exists = true;
1841 1841
 
1842
-    return $slug_exists;
1842
+	return $slug_exists;
1843 1843
 }
1844 1844
 
1845 1845
 
@@ -1858,75 +1858,75 @@  discard block
 block discarded – undo
1858 1858
  */
1859 1859
 function geodir_custom_page_title($title = '', $sep = '')
1860 1860
 {
1861
-    global $wp;
1862
-    if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1863
-        return $title;
1864
-    }
1861
+	global $wp;
1862
+	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1863
+		return $title;
1864
+	}
1865 1865
 
1866
-    if ($sep == '') {
1867
-        /**
1868
-         * Filter the page title separator.
1869
-         *
1870
-         * @since 1.0.0
1871
-         * @package GeoDirectory
1872
-         * @param string $sep The separator, default: `|`.
1873
-         */
1874
-        $sep = apply_filters('geodir_page_title_separator', '|');
1875
-    }
1866
+	if ($sep == '') {
1867
+		/**
1868
+		 * Filter the page title separator.
1869
+		 *
1870
+		 * @since 1.0.0
1871
+		 * @package GeoDirectory
1872
+		 * @param string $sep The separator, default: `|`.
1873
+		 */
1874
+		$sep = apply_filters('geodir_page_title_separator', '|');
1875
+	}
1876 1876
 
1877 1877
 
1878
-    $gd_page = '';
1879
-    if(geodir_is_page('home')){
1880
-        $gd_page = 'home';
1881
-        $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1882
-    }
1883
-    elseif(geodir_is_page('detail')){
1884
-        $gd_page = 'detail';
1885
-        $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1886
-    }
1887
-    elseif(geodir_is_page('pt')){
1888
-        $gd_page = 'pt';
1889
-        $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1890
-    }
1891
-    elseif(geodir_is_page('listing')){
1892
-        $gd_page = 'listing';
1893
-        $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1894
-    }
1895
-    elseif(geodir_is_page('location')){
1896
-        $gd_page = 'location';
1897
-        $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1898
-    }
1899
-    elseif(geodir_is_page('search')){
1900
-        $gd_page = 'search';
1901
-        $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1902
-    }
1903
-    elseif(geodir_is_page('add-listing')){
1904
-        $gd_page = 'add-listing';
1905
-        $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1906
-    }
1907
-    elseif(geodir_is_page('author')){
1908
-        $gd_page = 'author';
1909
-        $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1910
-    }
1911
-    elseif(geodir_is_page('login')){
1912
-        $gd_page = 'login';
1913
-        $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1914
-    }
1915
-    elseif(geodir_is_page('listing-success')){
1916
-        $gd_page = 'listing-success';
1917
-        $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1918
-    }
1878
+	$gd_page = '';
1879
+	if(geodir_is_page('home')){
1880
+		$gd_page = 'home';
1881
+		$title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1882
+	}
1883
+	elseif(geodir_is_page('detail')){
1884
+		$gd_page = 'detail';
1885
+		$title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1886
+	}
1887
+	elseif(geodir_is_page('pt')){
1888
+		$gd_page = 'pt';
1889
+		$title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1890
+	}
1891
+	elseif(geodir_is_page('listing')){
1892
+		$gd_page = 'listing';
1893
+		$title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1894
+	}
1895
+	elseif(geodir_is_page('location')){
1896
+		$gd_page = 'location';
1897
+		$title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1898
+	}
1899
+	elseif(geodir_is_page('search')){
1900
+		$gd_page = 'search';
1901
+		$title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1902
+	}
1903
+	elseif(geodir_is_page('add-listing')){
1904
+		$gd_page = 'add-listing';
1905
+		$title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1906
+	}
1907
+	elseif(geodir_is_page('author')){
1908
+		$gd_page = 'author';
1909
+		$title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1910
+	}
1911
+	elseif(geodir_is_page('login')){
1912
+		$gd_page = 'login';
1913
+		$title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1914
+	}
1915
+	elseif(geodir_is_page('listing-success')){
1916
+		$gd_page = 'listing-success';
1917
+		$title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1918
+	}
1919 1919
 
1920 1920
 
1921
-    /**
1922
-     * Filter page meta title to replace variables.
1923
-     *
1924
-     * @since 1.5.4
1925
-     * @param string $title The page title including variables.
1926
-     * @param string $gd_page The GeoDirectory page type if any.
1927
-     * @param string $sep The title separator symbol.
1928
-     */
1929
-    return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1921
+	/**
1922
+	 * Filter page meta title to replace variables.
1923
+	 *
1924
+	 * @since 1.5.4
1925
+	 * @param string $title The page title including variables.
1926
+	 * @param string $gd_page The GeoDirectory page type if any.
1927
+	 * @param string $sep The title separator symbol.
1928
+	 */
1929
+	return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1930 1930
 
1931 1931
 }
1932 1932
 
@@ -1942,33 +1942,33 @@  discard block
 block discarded – undo
1942 1942
 function geodir_set_post_attachment()
1943 1943
 {
1944 1944
 
1945
-    if (!get_option('geodir_set_post_attachments')) {
1945
+	if (!get_option('geodir_set_post_attachments')) {
1946 1946
 
1947
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1948
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1947
+		require_once(ABSPATH . 'wp-admin/includes/image.php');
1948
+		require_once(ABSPATH . 'wp-admin/includes/file.php');
1949 1949
 
1950
-        $all_postypes = geodir_get_posttypes();
1950
+		$all_postypes = geodir_get_posttypes();
1951 1951
 
1952
-        $args = array(
1953
-            'posts_per_page' => -1,
1954
-            'post_type' => $all_postypes,
1955
-            'post_status' => 'publish');
1952
+		$args = array(
1953
+			'posts_per_page' => -1,
1954
+			'post_type' => $all_postypes,
1955
+			'post_status' => 'publish');
1956 1956
 
1957
-        $posts_array = get_posts($args);
1957
+		$posts_array = get_posts($args);
1958 1958
 
1959
-        if (!empty($posts_array)) {
1959
+		if (!empty($posts_array)) {
1960 1960
 
1961
-            foreach ($posts_array as $post) {
1961
+			foreach ($posts_array as $post) {
1962 1962
 
1963
-                geodir_set_wp_featured_image($post->ID);
1963
+				geodir_set_wp_featured_image($post->ID);
1964 1964
 
1965
-            }
1965
+			}
1966 1966
 
1967
-        }
1967
+		}
1968 1968
 
1969
-        update_option('geodir_set_post_attachments', '1');
1969
+		update_option('geodir_set_post_attachments', '1');
1970 1970
 
1971
-    }
1971
+	}
1972 1972
 
1973 1973
 }
1974 1974
 
@@ -1985,19 +1985,19 @@  discard block
 block discarded – undo
1985 1985
 function geodir_remove_url_seperator()
1986 1986
 {
1987 1987
 
1988
-    if (!get_option('geodir_remove_url_seperator')) {
1988
+	if (!get_option('geodir_remove_url_seperator')) {
1989 1989
 
1990
-        if (get_option('geodir_listingurl_separator'))
1991
-            delete_option('geodir_listingurl_separator');
1990
+		if (get_option('geodir_listingurl_separator'))
1991
+			delete_option('geodir_listingurl_separator');
1992 1992
 
1993
-        if (get_option('geodir_detailurl_separator'))
1994
-            delete_option('geodir_detailurl_separator');
1993
+		if (get_option('geodir_detailurl_separator'))
1994
+			delete_option('geodir_detailurl_separator');
1995 1995
 
1996
-        flush_rewrite_rules(false);
1996
+		flush_rewrite_rules(false);
1997 1997
 
1998
-        update_option('geodir_remove_url_seperator', '1');
1998
+		update_option('geodir_remove_url_seperator', '1');
1999 1999
 
2000
-    }
2000
+	}
2001 2001
 
2002 2002
 }
2003 2003
 
@@ -2013,19 +2013,19 @@  discard block
 block discarded – undo
2013 2013
  */
2014 2014
 function geodir_remove_url_seperator_form_permalink_settings($permalink_arr)
2015 2015
 {
2016
-    foreach ($permalink_arr as $key => $value) {
2016
+	foreach ($permalink_arr as $key => $value) {
2017 2017
 
2018
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2019
-            unset($permalink_arr[$key]);
2018
+		if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2019
+			unset($permalink_arr[$key]);
2020 2020
 
2021
-    }
2021
+	}
2022 2022
 
2023
-    return $permalink_arr;
2023
+	return $permalink_arr;
2024 2024
 
2025 2025
 }
2026 2026
 
2027 2027
 if (!is_admin()) {
2028
-    add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2028
+	add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2029 2029
 }
2030 2030
 /**
2031 2031
  * Set status from draft to publish.
@@ -2038,13 +2038,13 @@  discard block
 block discarded – undo
2038 2038
  */
2039 2039
 function geodir_set_status_draft_to_publish_for_own_post($post)
2040 2040
 {
2041
-    global $wp;
2042
-    $user_id = get_current_user_id();
2041
+	global $wp;
2042
+	$user_id = get_current_user_id();
2043 2043
 
2044
-    if (!empty($post) && $post[0]->post_author == $user_id) {
2045
-        $post[0]->post_status = 'publish';
2046
-    }
2047
-    return $post;
2044
+	if (!empty($post) && $post[0]->post_author == $user_id) {
2045
+		$post[0]->post_status = 'publish';
2046
+	}
2047
+	return $post;
2048 2048
 }
2049 2049
 
2050 2050
 
@@ -2136,33 +2136,33 @@  discard block
 block discarded – undo
2136 2136
  */
2137 2137
 function geodir_detail_page_tab_headings_change($tabs_arr)
2138 2138
 {
2139
-    global $wpdb;
2139
+	global $wpdb;
2140 2140
 
2141
-    $post_type = geodir_get_current_posttype();
2141
+	$post_type = geodir_get_current_posttype();
2142 2142
 
2143
-    $all_postypes = geodir_get_posttypes();
2143
+	$all_postypes = geodir_get_posttypes();
2144 2144
 
2145
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2145
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2146 2146
 
2147
-        if (array_key_exists('post_video', $tabs_arr)) {
2147
+		if (array_key_exists('post_video', $tabs_arr)) {
2148 2148
 
2149
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2149
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2150 2150
 
2151
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2152
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2153
-        }
2151
+			if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2152
+				$tabs_arr['post_video']['heading_text'] = $field_title;
2153
+		}
2154 2154
 
2155
-        if (array_key_exists('special_offers', $tabs_arr)) {
2155
+		if (array_key_exists('special_offers', $tabs_arr)) {
2156 2156
 
2157
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2157
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2158 2158
 
2159
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2160
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2161
-        }
2159
+			if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2160
+				$tabs_arr['special_offers']['heading_text'] = $field_title;
2161
+		}
2162 2162
 
2163
-    }
2163
+	}
2164 2164
 
2165
-    return $tabs_arr;
2165
+	return $tabs_arr;
2166 2166
 
2167 2167
 }
2168 2168
 
@@ -2175,10 +2175,10 @@  discard block
 block discarded – undo
2175 2175
  */
2176 2176
 function geodir_remove_template_redirect_actions()
2177 2177
 {
2178
-    if (geodir_is_page('login')){
2179
-        remove_all_actions('template_redirect');
2180
-        remove_action('init', 'avia_modify_front', 10);
2181
-    }
2178
+	if (geodir_is_page('login')){
2179
+		remove_all_actions('template_redirect');
2180
+		remove_action('init', 'avia_modify_front', 10);
2181
+	}
2182 2182
 }
2183 2183
 
2184 2184
 
@@ -2200,51 +2200,51 @@  discard block
 block discarded – undo
2200 2200
 function geodirectory_before_featured_image_delete($attachment_id)
2201 2201
 {
2202 2202
 
2203
-    global $wpdb, $plugin_prefix;
2203
+	global $wpdb, $plugin_prefix;
2204 2204
 
2205
-    $post_id = get_post_field('post_parent', $attachment_id);
2205
+	$post_id = get_post_field('post_parent', $attachment_id);
2206 2206
 
2207
-    $attachment_url = wp_get_attachment_url($attachment_id);
2207
+	$attachment_url = wp_get_attachment_url($attachment_id);
2208 2208
 
2209
-    if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2209
+	if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2210 2210
 
2211
-        $post_type = get_post_type($post_id);
2211
+		$post_type = get_post_type($post_id);
2212 2212
 
2213
-        $all_postypes = geodir_get_posttypes();
2213
+		$all_postypes = geodir_get_posttypes();
2214 2214
 
2215
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2216
-            return false;
2215
+		if (!in_array($post_type, $all_postypes) || !is_admin())
2216
+			return false;
2217 2217
 
2218
-        $uploads = wp_upload_dir();
2218
+		$uploads = wp_upload_dir();
2219 2219
 
2220
-        $split_img_path = explode($uploads['baseurl'], $attachment_url);
2220
+		$split_img_path = explode($uploads['baseurl'], $attachment_url);
2221 2221
 
2222
-        $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2222
+		$split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2223 2223
 
2224
-        $wpdb->query(
2225
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2226
-                array($post_id, $split_img_file_path)
2227
-            )
2228
-        );
2224
+		$wpdb->query(
2225
+			$wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2226
+				array($post_id, $split_img_file_path)
2227
+			)
2228
+		);
2229 2229
 
2230
-        $attachment_data = $wpdb->get_row(
2231
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2232
-                array($post_id)
2233
-            )
2234
-        );
2230
+		$attachment_data = $wpdb->get_row(
2231
+			$wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2232
+				array($post_id)
2233
+			)
2234
+		);
2235 2235
 
2236
-        if (!empty($attachment_data)) {
2237
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2238
-        }
2236
+		if (!empty($attachment_data)) {
2237
+			$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2238
+		}
2239 2239
 
2240 2240
 
2241
-        $table_name = $plugin_prefix . $post_type . '_detail';
2241
+		$table_name = $plugin_prefix . $post_type . '_detail';
2242 2242
 
2243
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2243
+		$wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2244 2244
 
2245
-        geodir_set_wp_featured_image($post_id);
2245
+		geodir_set_wp_featured_image($post_id);
2246 2246
 
2247
-    }
2247
+	}
2248 2248
 
2249 2249
 }
2250 2250
 
@@ -2262,79 +2262,79 @@  discard block
 block discarded – undo
2262 2262
 function geodir_temp_set_post_attachment()
2263 2263
 {
2264 2264
 
2265
-    global $wpdb, $plugin_prefix;
2265
+	global $wpdb, $plugin_prefix;
2266 2266
 
2267
-    $all_postypes = geodir_get_posttypes();
2267
+	$all_postypes = geodir_get_posttypes();
2268 2268
 
2269
-    foreach ($all_postypes as $posttype) {
2269
+	foreach ($all_postypes as $posttype) {
2270 2270
 
2271
-        $tablename = $plugin_prefix . $posttype . '_detail';
2271
+		$tablename = $plugin_prefix . $posttype . '_detail';
2272 2272
 
2273
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2273
+		$get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2274 2274
 
2275
-        if (!empty($get_post_data)) {
2275
+		if (!empty($get_post_data)) {
2276 2276
 
2277
-            foreach ($get_post_data as $data) {
2277
+			foreach ($get_post_data as $data) {
2278 2278
 
2279
-                $post_id = $data->post_id;
2279
+				$post_id = $data->post_id;
2280 2280
 
2281
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2281
+				$attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2282 2282
 
2283
-                if (!empty($attachment_data)) {
2283
+				if (!empty($attachment_data)) {
2284 2284
 
2285
-                    foreach ($attachment_data as $attach) {
2285
+					foreach ($attachment_data as $attach) {
2286 2286
 
2287
-                        $file_info = pathinfo($attach->file);
2287
+						$file_info = pathinfo($attach->file);
2288 2288
 
2289
-                        $sub_dir = '';
2290
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2291
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2289
+						$sub_dir = '';
2290
+						if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2291
+							$sub_dir = stripslashes_deep($file_info['dirname']);
2292 2292
 
2293
-                        $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2294
-                        $uploads_path = $uploads['basedir'];
2293
+						$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2294
+						$uploads_path = $uploads['basedir'];
2295 2295
 
2296
-                        $file_name = $file_info['basename'];
2296
+						$file_name = $file_info['basename'];
2297 2297
 
2298
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2298
+						$img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2299 2299
 
2300
-                        if (!file_exists($img_arr['path'])) {
2300
+						if (!file_exists($img_arr['path'])) {
2301 2301
 
2302
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2302
+							$wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2303 2303
 
2304
-                        }
2304
+						}
2305 2305
 
2306
-                    }
2306
+					}
2307 2307
 
2308
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2308
+					$attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2309 2309
 
2310
-                    if (!empty($attachment_data)) {
2310
+					if (!empty($attachment_data)) {
2311 2311
 
2312
-                        if ($attachment_data->ID)
2313
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2312
+						if ($attachment_data->ID)
2313
+							$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2314 2314
 
2315
-                    } else {
2315
+					} else {
2316 2316
 
2317
-                        if (has_post_thumbnail($post_id)) {
2317
+						if (has_post_thumbnail($post_id)) {
2318 2318
 
2319
-                            $post_thumbnail_id = get_post_thumbnail_id($post_id);
2319
+							$post_thumbnail_id = get_post_thumbnail_id($post_id);
2320 2320
 
2321
-                            wp_delete_attachment($post_thumbnail_id);
2321
+							wp_delete_attachment($post_thumbnail_id);
2322 2322
 
2323
-                        }
2323
+						}
2324 2324
 
2325
-                    }
2325
+					}
2326 2326
 
2327
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2327
+					$wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2328 2328
 
2329
-                    geodir_set_wp_featured_image($post_id);
2329
+					geodir_set_wp_featured_image($post_id);
2330 2330
 
2331
-                }
2331
+				}
2332 2332
 
2333
-            }
2333
+			}
2334 2334
 
2335
-        }
2335
+		}
2336 2336
 
2337
-    }
2337
+	}
2338 2338
 
2339 2339
 }
2340 2340
 
@@ -2352,9 +2352,9 @@  discard block
 block discarded – undo
2352 2352
 function geodir_default_rating_star_icon()
2353 2353
 {
2354 2354
 
2355
-    if (!get_option('geodir_default_rating_star_icon')) {
2356
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2357
-    }
2355
+	if (!get_option('geodir_default_rating_star_icon')) {
2356
+		update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2357
+	}
2358 2358
 
2359 2359
 }
2360 2360
 
@@ -2372,27 +2372,27 @@  discard block
 block discarded – undo
2372 2372
  */
2373 2373
 function geodir_user_post_listing_count($user_id=null)
2374 2374
 {
2375
-    global $wpdb, $plugin_prefix, $current_user;
2376
-    if(!$user_id){
2377
-        $user_id = $current_user->ID;
2378
-    }
2375
+	global $wpdb, $plugin_prefix, $current_user;
2376
+	if(!$user_id){
2377
+		$user_id = $current_user->ID;
2378
+	}
2379 2379
 
2380
-    $user_id = $current_user->ID;
2381
-    $all_postypes = geodir_get_posttypes();
2382
-    $all_posts = get_option('geodir_listing_link_user_dashboard');
2380
+	$user_id = $current_user->ID;
2381
+	$all_postypes = geodir_get_posttypes();
2382
+	$all_posts = get_option('geodir_listing_link_user_dashboard');
2383 2383
 
2384
-    $user_listing = array();
2385
-    if (is_array($all_posts) && !empty($all_posts)) {
2386
-        foreach ($all_posts as $ptype) {
2387
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2384
+	$user_listing = array();
2385
+	if (is_array($all_posts) && !empty($all_posts)) {
2386
+		foreach ($all_posts as $ptype) {
2387
+			$total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2388 2388
 
2389
-            if ($total_posts > 0) {
2390
-                $user_listing[$ptype] = $total_posts;
2391
-            }
2392
-        }
2393
-    }
2389
+			if ($total_posts > 0) {
2390
+				$user_listing[$ptype] = $total_posts;
2391
+			}
2392
+		}
2393
+	}
2394 2394
 
2395
-    return $user_listing;
2395
+	return $user_listing;
2396 2396
 }
2397 2397
 
2398 2398
 
@@ -2412,579 +2412,579 @@  discard block
 block discarded – undo
2412 2412
  */
2413 2413
 function geodir_detail_page_custom_field_tab($tabs_arr)
2414 2414
 {
2415
-    global $post;
2416
-
2417
-    $post_type = geodir_get_current_posttype();
2418
-    $all_postypes = geodir_get_posttypes();
2419
-
2420
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2421
-        $package_info = array();
2422
-        $package_info = geodir_post_package_info($package_info, $post);
2423
-        $post_package_id = $package_info->pid;
2424
-        $fields_location = 'detail';
2425
-
2426
-        $custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2427
-        if (!empty($custom_fields)) {
2428
-            $parse_custom_fields = array();
2429
-            foreach ($custom_fields as $field) {
2430
-                $field = stripslashes_deep($field); // strip slashes
2415
+	global $post;
2416
+
2417
+	$post_type = geodir_get_current_posttype();
2418
+	$all_postypes = geodir_get_posttypes();
2419
+
2420
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2421
+		$package_info = array();
2422
+		$package_info = geodir_post_package_info($package_info, $post);
2423
+		$post_package_id = $package_info->pid;
2424
+		$fields_location = 'detail';
2425
+
2426
+		$custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2427
+		if (!empty($custom_fields)) {
2428
+			$parse_custom_fields = array();
2429
+			foreach ($custom_fields as $field) {
2430
+				$field = stripslashes_deep($field); // strip slashes
2431 2431
                 
2432
-                $type = $field;
2433
-                $field_name = $field['htmlvar_name'];
2434
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2435
-                    $post->{$field_name} = $_REQUEST[$field_name];
2436
-                }
2437
-
2438
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2439
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2440
-                        continue;
2441
-                    }
2442
-
2443
-                    $parse_custom_fields[] = $field;
2444
-                }
2445
-            }
2446
-            $custom_fields = $parse_custom_fields;
2447
-        }
2448
-
2449
-        if (!empty($custom_fields)) {
2450
-            $field_set_start = 0;
2451
-            $fieldset_count = 0;
2452
-            $fieldset = '';
2453
-            $total_fields = count($custom_fields);
2454
-            $count_field = 0;
2455
-            $fieldset_arr = array();
2456
-            $i = 0;
2457
-            $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2458
-
2459
-            foreach ($custom_fields as $field) {
2460
-                $count_field++;
2461
-                $field_name = $field['htmlvar_name'];
2462
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2463
-                    $post->{$field_name} = $_REQUEST[$field_name];
2464
-                }
2465
-
2466
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2467
-                    $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2468
-                    $site_title = trim($field['site_title']);
2469
-                    $type = $field;
2470
-                    $html = '';
2471
-                    $html_var = $field_name;
2472
-                    $field_icon = '';
2473
-                    $variables_array = array();
2474
-
2475
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2476
-                        continue;
2477
-                    }
2478
-
2479
-                    if ($type['type'] != 'fieldset') {
2480
-                        $i++;
2481
-                        $variables_array['post_id'] = $post->ID;
2482
-                        $variables_array['label'] = __($type['site_title'], 'geodirectory');
2483
-                        $variables_array['value'] = '';
2484
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
2485
-                    }
2486
-
2487
-                    if (strpos($type['field_icon'], 'http') !== false) {
2488
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2489
-                    } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2490
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2491
-                    }
2432
+				$type = $field;
2433
+				$field_name = $field['htmlvar_name'];
2434
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2435
+					$post->{$field_name} = $_REQUEST[$field_name];
2436
+				}
2437
+
2438
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2439
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2440
+						continue;
2441
+					}
2442
+
2443
+					$parse_custom_fields[] = $field;
2444
+				}
2445
+			}
2446
+			$custom_fields = $parse_custom_fields;
2447
+		}
2492 2448
 
2493
-                    switch ($type['type']) {
2494
-                        case 'fieldset': {
2495
-                            $i = 0;
2496
-                            $fieldset_count++;
2497
-                            $field_set_start = 1;
2498
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2499
-                            $fieldset_arr[$fieldset_count]['label'] = $label;
2500
-                        }
2501
-                            break;
2502
-                        case 'url': {
2503
-                            if (strpos($field_icon, 'http') !== false) {
2504
-                                $field_icon_af = '';
2505
-                            } elseif ($field_icon == '') {
2506
-
2507
-                                if ($type['name'] == 'geodir_facebook') {
2508
-                                    $field_icon_af = '<i class="fa fa-facebook-square"></i>';
2509
-                                } elseif ($type['name'] == 'geodir_twitter') {
2510
-                                    $field_icon_af = '<i class="fa fa-twitter-square"></i>';
2511
-                                } else {
2512
-                                    $field_icon_af = '<i class="fa fa-link"></i>';
2513
-                                }
2514
-
2515
-                            } else {
2516
-                                $field_icon_af = $field_icon;
2517
-                                $field_icon = '';
2518
-                            }
2449
+		if (!empty($custom_fields)) {
2450
+			$field_set_start = 0;
2451
+			$fieldset_count = 0;
2452
+			$fieldset = '';
2453
+			$total_fields = count($custom_fields);
2454
+			$count_field = 0;
2455
+			$fieldset_arr = array();
2456
+			$i = 0;
2457
+			$geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2458
+
2459
+			foreach ($custom_fields as $field) {
2460
+				$count_field++;
2461
+				$field_name = $field['htmlvar_name'];
2462
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2463
+					$post->{$field_name} = $_REQUEST[$field_name];
2464
+				}
2465
+
2466
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2467
+					$label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2468
+					$site_title = trim($field['site_title']);
2469
+					$type = $field;
2470
+					$html = '';
2471
+					$html_var = $field_name;
2472
+					$field_icon = '';
2473
+					$variables_array = array();
2474
+
2475
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2476
+						continue;
2477
+					}
2478
+
2479
+					if ($type['type'] != 'fieldset') {
2480
+						$i++;
2481
+						$variables_array['post_id'] = $post->ID;
2482
+						$variables_array['label'] = __($type['site_title'], 'geodirectory');
2483
+						$variables_array['value'] = '';
2484
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
2485
+					}
2486
+
2487
+					if (strpos($type['field_icon'], 'http') !== false) {
2488
+						$field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2489
+					} elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2490
+						$field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2491
+					}
2492
+
2493
+					switch ($type['type']) {
2494
+						case 'fieldset': {
2495
+							$i = 0;
2496
+							$fieldset_count++;
2497
+							$field_set_start = 1;
2498
+							$fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2499
+							$fieldset_arr[$fieldset_count]['label'] = $label;
2500
+						}
2501
+							break;
2502
+						case 'url': {
2503
+							if (strpos($field_icon, 'http') !== false) {
2504
+								$field_icon_af = '';
2505
+							} elseif ($field_icon == '') {
2506
+
2507
+								if ($type['name'] == 'geodir_facebook') {
2508
+									$field_icon_af = '<i class="fa fa-facebook-square"></i>';
2509
+								} elseif ($type['name'] == 'geodir_twitter') {
2510
+									$field_icon_af = '<i class="fa fa-twitter-square"></i>';
2511
+								} else {
2512
+									$field_icon_af = '<i class="fa fa-link"></i>';
2513
+								}
2514
+
2515
+							} else {
2516
+								$field_icon_af = $field_icon;
2517
+								$field_icon = '';
2518
+							}
2519 2519
                             
2520
-                            $a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2521
-
2522
-                            $website = !empty($a_url['url']) ? $a_url['url'] : '';
2523
-                            $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2524
-                            $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2525
-
2526
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2527
-
2528
-                            // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2529
-                            $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2530
-
2531
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2532
-                                /**
2533
-                                 * Filer the custom field website name.
2534
-                                 *
2535
-                                 * @since 1.0.0
2536
-                                 * @param string $title The field name default: "Website".
2537
-                                 * @param string $website The website address.
2538
-                                 * @param int $post->ID The post ID.
2539
-                                 */
2540
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2541
-                        }
2542
-                            break;
2543
-                        case 'phone': {
2544
-                            if (strpos($field_icon, 'http') !== false) {
2545
-                                $field_icon_af = '';
2546
-                            } elseif ($field_icon == '') {
2547
-                                $field_icon_af = '<i class="fa fa-phone"></i>';
2548
-                            } else {
2549
-                                $field_icon_af = $field_icon;
2550
-                                $field_icon = '';
2551
-                            }
2552
-
2553
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2554
-
2555
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2556
-                            if ($field_set_start == 1 && $site_title != '') {
2557
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2558
-                            }
2559
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2560
-                        }
2561
-                            break;
2562
-                        case 'time': {
2563
-                            $value = '';
2564
-                            if ($post->{$type['htmlvar_name']} != '')
2565
-                                $value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2566
-
2567
-                            if (strpos($field_icon, 'http') !== false) {
2568
-                                $field_icon_af = '';
2569
-                            } elseif ($field_icon == '') {
2570
-                                $field_icon_af = '<i class="fa fa-clock-o"></i>';
2571
-                            } else {
2572
-                                $field_icon_af = $field_icon;
2573
-                                $field_icon = '';
2574
-                            }
2575
-
2576
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2577
-
2578
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2579
-                            if ($field_set_start == 1 && $site_title != '') {
2580
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2581
-                            }
2582
-                            $html .= ' </span>' . stripslashes($value) . '</div>';
2583
-                        }
2584
-                            break;
2585
-                        case 'datepicker': {
2586
-                            $date_format = geodir_default_date_format();
2587
-                            if ($type['extra_fields'] != '') {
2588
-                                $date_format = unserialize($type['extra_fields']);
2589
-                                $date_format = $date_format['date_format'];
2590
-                            }
2591
-
2592
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2593
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2594
-
2595
-                            $date_format = str_replace($search, $replace, $date_format);
2596
-
2597
-                            $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2598
-
2599
-                            $value = '';
2600
-                            if ($post->{$type['htmlvar_name']} != '')
2601
-                                $value = date($date_format, strtotime($post_htmlvar_value));
2602
-
2603
-                            if (strpos($field_icon, 'http') !== false) {
2604
-                                $field_icon_af = '';
2605
-                            } elseif ($field_icon == '') {
2606
-                                $field_icon_af = '<i class="fa fa-calendar"></i>';
2607
-                            } else {
2608
-                                $field_icon_af = $field_icon;
2609
-                                $field_icon = '';
2610
-                            }
2611
-
2612
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2613
-
2614
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2615
-                            if ($field_set_start == 1 && $site_title != '') {
2616
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2617
-                            }
2618
-                            $html .= ' </span>' . $value . '</div>';
2619
-                        }
2620
-                            break;
2621
-                        case 'text': {
2622
-                            if (strpos($field_icon, 'http') !== false) {
2623
-                                $field_icon_af = '';
2624
-                            } elseif ($field_icon == '') {
2625
-                                $field_icon_af = '';
2626
-                            } else {
2627
-                                $field_icon_af = $field_icon;
2628
-                                $field_icon = '';
2629
-                            }
2630
-
2631
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2632
-
2633
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2634
-                            if ($field_set_start == 1 && $site_title != '') {
2635
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2636
-                            }
2637
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2638
-                        }
2639
-                            break;
2640
-                        case 'radio': {
2641
-
2642
-                            if ($post->{$type['htmlvar_name']} != '') {
2643
-                                if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2644
-                                    $html_val = __('No', 'geodirectory');
2645
-                                } else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2646
-                                    $html_val = __('Yes', 'geodirectory');
2647
-                                } else {
2648
-                                    $html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2520
+							$a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2521
+
2522
+							$website = !empty($a_url['url']) ? $a_url['url'] : '';
2523
+							$title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2524
+							$title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2525
+
2526
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2527
+
2528
+							// all search engines that use the nofollow value exclude links that use it from their ranking calculation
2529
+							$rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2530
+
2531
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2532
+								/**
2533
+								 * Filer the custom field website name.
2534
+								 *
2535
+								 * @since 1.0.0
2536
+								 * @param string $title The field name default: "Website".
2537
+								 * @param string $website The website address.
2538
+								 * @param int $post->ID The post ID.
2539
+								 */
2540
+								apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2541
+						}
2542
+							break;
2543
+						case 'phone': {
2544
+							if (strpos($field_icon, 'http') !== false) {
2545
+								$field_icon_af = '';
2546
+							} elseif ($field_icon == '') {
2547
+								$field_icon_af = '<i class="fa fa-phone"></i>';
2548
+							} else {
2549
+								$field_icon_af = $field_icon;
2550
+								$field_icon = '';
2551
+							}
2552
+
2553
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2554
+
2555
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2556
+							if ($field_set_start == 1 && $site_title != '') {
2557
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2558
+							}
2559
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2560
+						}
2561
+							break;
2562
+						case 'time': {
2563
+							$value = '';
2564
+							if ($post->{$type['htmlvar_name']} != '')
2565
+								$value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2566
+
2567
+							if (strpos($field_icon, 'http') !== false) {
2568
+								$field_icon_af = '';
2569
+							} elseif ($field_icon == '') {
2570
+								$field_icon_af = '<i class="fa fa-clock-o"></i>';
2571
+							} else {
2572
+								$field_icon_af = $field_icon;
2573
+								$field_icon = '';
2574
+							}
2575
+
2576
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2577
+
2578
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2579
+							if ($field_set_start == 1 && $site_title != '') {
2580
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2581
+							}
2582
+							$html .= ' </span>' . stripslashes($value) . '</div>';
2583
+						}
2584
+							break;
2585
+						case 'datepicker': {
2586
+							$date_format = geodir_default_date_format();
2587
+							if ($type['extra_fields'] != '') {
2588
+								$date_format = unserialize($type['extra_fields']);
2589
+								$date_format = $date_format['date_format'];
2590
+							}
2591
+
2592
+							$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2593
+							$replace = array('d','j','l','m','n','F','Y');//PHP date format
2594
+
2595
+							$date_format = str_replace($search, $replace, $date_format);
2596
+
2597
+							$post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2598
+
2599
+							$value = '';
2600
+							if ($post->{$type['htmlvar_name']} != '')
2601
+								$value = date($date_format, strtotime($post_htmlvar_value));
2602
+
2603
+							if (strpos($field_icon, 'http') !== false) {
2604
+								$field_icon_af = '';
2605
+							} elseif ($field_icon == '') {
2606
+								$field_icon_af = '<i class="fa fa-calendar"></i>';
2607
+							} else {
2608
+								$field_icon_af = $field_icon;
2609
+								$field_icon = '';
2610
+							}
2611
+
2612
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2613
+
2614
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2615
+							if ($field_set_start == 1 && $site_title != '') {
2616
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2617
+							}
2618
+							$html .= ' </span>' . $value . '</div>';
2619
+						}
2620
+							break;
2621
+						case 'text': {
2622
+							if (strpos($field_icon, 'http') !== false) {
2623
+								$field_icon_af = '';
2624
+							} elseif ($field_icon == '') {
2625
+								$field_icon_af = '';
2626
+							} else {
2627
+								$field_icon_af = $field_icon;
2628
+								$field_icon = '';
2629
+							}
2630
+
2631
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2632
+
2633
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2634
+							if ($field_set_start == 1 && $site_title != '') {
2635
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2636
+							}
2637
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2638
+						}
2639
+							break;
2640
+						case 'radio': {
2641
+
2642
+							if ($post->{$type['htmlvar_name']} != '') {
2643
+								if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2644
+									$html_val = __('No', 'geodirectory');
2645
+								} else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2646
+									$html_val = __('Yes', 'geodirectory');
2647
+								} else {
2648
+									$html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2649 2649
                                     
2650
-                                    if (!empty($type['option_values'])) {
2651
-                                        $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2650
+									if (!empty($type['option_values'])) {
2651
+										$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2652 2652
                                         
2653
-                                        if (!empty($cf_option_values)) {
2654
-                                            foreach ($cf_option_values as $cf_option_value) {
2655
-                                                if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2656
-                                                    $html_val = $cf_option_value['label'];
2657
-                                                }
2658
-                                            }
2659
-                                        }
2660
-                                    }
2661
-                                }
2662
-
2663
-                                if (strpos($field_icon, 'http') !== false) {
2664
-                                    $field_icon_af = '';
2665
-                                } else if ($field_icon == '') {
2666
-                                    $field_icon_af = '';
2667
-                                } else {
2668
-                                    $field_icon_af = $field_icon;
2669
-                                    $field_icon = '';
2670
-                                }
2671
-
2672
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2673
-
2674
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2675
-
2676
-                                if ($field_set_start == 1 && $site_title != '') {
2677
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2678
-                                }
2679
-
2680
-                                $html .= ' </span>' . $html_val . '</div>';
2681
-                            }
2682
-                        }
2683
-                            break;
2684
-                        case 'checkbox': {
2685
-                            $html_var = $type['htmlvar_name'];
2686
-                            $html_val = $type['htmlvar_name'];
2687
-
2688
-                            if ((int)$post->{$html_var} == 1) {
2689
-
2690
-                                if ($post->{$type['htmlvar_name']} == '1') {
2691
-                                    $html_val = __('Yes', 'geodirectory');
2692
-                                } else {
2693
-                                    $html_val = __('No', 'geodirectory');
2694
-                                }
2695
-
2696
-                                if (strpos($field_icon, 'http') !== false) {
2697
-                                    $field_icon_af = '';
2698
-                                } else if ($field_icon == '') {
2699
-                                    $field_icon_af = '';
2700
-                                } else {
2701
-                                    $field_icon_af = $field_icon;
2702
-                                    $field_icon = '';
2703
-                                }
2704
-
2705
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2706
-
2707
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2708
-
2709
-                                if ($field_set_start == 1 && $site_title != '') {
2710
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2711
-                                }
2712
-
2713
-                                $html .= ' </span>' . $html_val . '</div>';
2714
-                            }
2715
-                        }
2716
-                            break;
2717
-                        case 'select': {
2718
-                            if (strpos($field_icon, 'http') !== false) {
2719
-                                $field_icon_af = '';
2720
-                            } elseif ($field_icon == '') {
2721
-                                $field_icon_af = '';
2722
-                            } else {
2723
-                                $field_icon_af = $field_icon;
2724
-                                $field_icon = '';
2725
-                            }
2653
+										if (!empty($cf_option_values)) {
2654
+											foreach ($cf_option_values as $cf_option_value) {
2655
+												if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2656
+													$html_val = $cf_option_value['label'];
2657
+												}
2658
+											}
2659
+										}
2660
+									}
2661
+								}
2662
+
2663
+								if (strpos($field_icon, 'http') !== false) {
2664
+									$field_icon_af = '';
2665
+								} else if ($field_icon == '') {
2666
+									$field_icon_af = '';
2667
+								} else {
2668
+									$field_icon_af = $field_icon;
2669
+									$field_icon = '';
2670
+								}
2671
+
2672
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2673
+
2674
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2675
+
2676
+								if ($field_set_start == 1 && $site_title != '') {
2677
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2678
+								}
2679
+
2680
+								$html .= ' </span>' . $html_val . '</div>';
2681
+							}
2682
+						}
2683
+							break;
2684
+						case 'checkbox': {
2685
+							$html_var = $type['htmlvar_name'];
2686
+							$html_val = $type['htmlvar_name'];
2687
+
2688
+							if ((int)$post->{$html_var} == 1) {
2689
+
2690
+								if ($post->{$type['htmlvar_name']} == '1') {
2691
+									$html_val = __('Yes', 'geodirectory');
2692
+								} else {
2693
+									$html_val = __('No', 'geodirectory');
2694
+								}
2695
+
2696
+								if (strpos($field_icon, 'http') !== false) {
2697
+									$field_icon_af = '';
2698
+								} else if ($field_icon == '') {
2699
+									$field_icon_af = '';
2700
+								} else {
2701
+									$field_icon_af = $field_icon;
2702
+									$field_icon = '';
2703
+								}
2704
+
2705
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2706
+
2707
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2708
+
2709
+								if ($field_set_start == 1 && $site_title != '') {
2710
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2711
+								}
2712
+
2713
+								$html .= ' </span>' . $html_val . '</div>';
2714
+							}
2715
+						}
2716
+							break;
2717
+						case 'select': {
2718
+							if (strpos($field_icon, 'http') !== false) {
2719
+								$field_icon_af = '';
2720
+							} elseif ($field_icon == '') {
2721
+								$field_icon_af = '';
2722
+							} else {
2723
+								$field_icon_af = $field_icon;
2724
+								$field_icon = '';
2725
+							}
2726 2726
                             
2727
-                            $field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2727
+							$field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2728 2728
                             
2729
-                            if (!empty($type['option_values'])) {
2730
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2729
+							if (!empty($type['option_values'])) {
2730
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2731 2731
                                 
2732
-                                if (!empty($cf_option_values)) {
2733
-                                    foreach ($cf_option_values as $cf_option_value) {
2734
-                                        if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2735
-                                            $field_value = $cf_option_value['label'];
2736
-                                        }
2737
-                                    }
2738
-                                }
2739
-                            }
2740
-
2741
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2742
-
2743
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2744
-                            if ($field_set_start == 1 && $site_title != '') {
2745
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2746
-                            }
2747
-                            $html .= ' </span>' . $field_value . '</div>';
2748
-                        }
2749
-                            break;
2750
-                        case 'multiselect': {
2751
-                            if (is_array($post->{$type['htmlvar_name']})) {
2752
-                                $post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2753
-                            }
2754
-
2755
-                            if (strpos($field_icon, 'http') !== false) {
2756
-                                $field_icon_af = '';
2757
-                            } elseif ($field_icon == '') {
2758
-                                $field_icon_af = '';
2759
-                            } else {
2760
-                                $field_icon_af = $field_icon;
2761
-                                $field_icon = '';
2762
-                            }
2763
-
2764
-                            $field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2765
-
2766
-                            $option_values = array();
2767
-                            if (!empty($type['option_values'])) {
2768
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2732
+								if (!empty($cf_option_values)) {
2733
+									foreach ($cf_option_values as $cf_option_value) {
2734
+										if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2735
+											$field_value = $cf_option_value['label'];
2736
+										}
2737
+									}
2738
+								}
2739
+							}
2740
+
2741
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2742
+
2743
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2744
+							if ($field_set_start == 1 && $site_title != '') {
2745
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2746
+							}
2747
+							$html .= ' </span>' . $field_value . '</div>';
2748
+						}
2749
+							break;
2750
+						case 'multiselect': {
2751
+							if (is_array($post->{$type['htmlvar_name']})) {
2752
+								$post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2753
+							}
2754
+
2755
+							if (strpos($field_icon, 'http') !== false) {
2756
+								$field_icon_af = '';
2757
+							} elseif ($field_icon == '') {
2758
+								$field_icon_af = '';
2759
+							} else {
2760
+								$field_icon_af = $field_icon;
2761
+								$field_icon = '';
2762
+							}
2763
+
2764
+							$field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2765
+
2766
+							$option_values = array();
2767
+							if (!empty($type['option_values'])) {
2768
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2769 2769
                                 
2770
-                                if (!empty($cf_option_values)) {
2771
-                                    foreach ($cf_option_values as $cf_option_value) {
2772
-                                        if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2773
-                                            $option_values[] = $cf_option_value['label'];
2774
-                                        }
2775
-                                    }
2776
-                                }
2777
-                            }
2778
-
2779
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2780
-
2781
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2782
-                            if ($field_set_start == 1 && $site_title != '') {
2783
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2784
-                            }
2785
-                            $html .= ' </span>';
2786
-
2787
-                            if (count($option_values) > 1) {
2788
-                                $html .= '<ul>';
2789
-                                foreach ($option_values as $val) {
2790
-                                    $html .= '<li>' . $val . '</li>';
2791
-                                }
2792
-                                $html .= '</ul>';
2793
-                            } else {
2794
-                                $html .= $post->{$type['htmlvar_name']};
2795
-                            }
2796
-                            $html .= '</div>';
2797
-                        }
2798
-                            break;
2799
-                        case 'email': {
2800
-                            if (strpos($field_icon, 'http') !== false) {
2801
-                                $field_icon_af = '';
2802
-                            } elseif ($field_icon == '') {
2803
-                                $field_icon_af = '<i class="fa fa-envelope"></i>';
2804
-                            } else {
2805
-                                $field_icon_af = $field_icon;
2806
-                                $field_icon = '';
2807
-                            }
2808
-
2809
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2810
-
2811
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2812
-                            if ($field_set_start == 1 && $site_title != '') {
2813
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2814
-                            }
2815
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2816
-                        }
2817
-                            break;
2818
-                        case 'textarea': {
2819
-                            if (strpos($field_icon, 'http') !== false) {
2820
-                                $field_icon_af = '';
2821
-                            } elseif ($field_icon == '') {
2822
-                                $field_icon_af = '';
2823
-                            } else {
2824
-                                $field_icon_af = $field_icon;
2825
-                                $field_icon = '';
2826
-                            }
2827
-
2828
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2829
-
2830
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2831
-                            if ($field_set_start == 1 && $site_title != '') {
2832
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2833
-                            }
2834
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2835
-                        }
2836
-                            break;
2837
-                        case 'html': {
2838
-                            if (strpos($field_icon, 'http') !== false) {
2839
-                                $field_icon_af = '';
2840
-                            } elseif ($field_icon == '') {
2841
-                                $field_icon_af = '';
2842
-                            } else {
2843
-                                $field_icon_af = $field_icon;
2844
-                                $field_icon = '';
2845
-                            }
2846
-
2847
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2848
-
2849
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2850
-                            if ($field_set_start == 1 && $site_title != '') {
2851
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2852
-                            }
2853
-                            $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2854
-                        }
2855
-                        break;
2856
-                        case 'file': {
2857
-                            $html_var = $type['htmlvar_name'];
2858
-
2859
-                            if (!empty($post->{$type['htmlvar_name']})) {
2860
-                                $files = explode(",", $post->{$type['htmlvar_name']});
2861
-
2862
-                                if (!empty($files)) {
2863
-                                    $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2864
-                                    $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'] : '';
2770
+								if (!empty($cf_option_values)) {
2771
+									foreach ($cf_option_values as $cf_option_value) {
2772
+										if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2773
+											$option_values[] = $cf_option_value['label'];
2774
+										}
2775
+									}
2776
+								}
2777
+							}
2778
+
2779
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2780
+
2781
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2782
+							if ($field_set_start == 1 && $site_title != '') {
2783
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2784
+							}
2785
+							$html .= ' </span>';
2786
+
2787
+							if (count($option_values) > 1) {
2788
+								$html .= '<ul>';
2789
+								foreach ($option_values as $val) {
2790
+									$html .= '<li>' . $val . '</li>';
2791
+								}
2792
+								$html .= '</ul>';
2793
+							} else {
2794
+								$html .= $post->{$type['htmlvar_name']};
2795
+							}
2796
+							$html .= '</div>';
2797
+						}
2798
+							break;
2799
+						case 'email': {
2800
+							if (strpos($field_icon, 'http') !== false) {
2801
+								$field_icon_af = '';
2802
+							} elseif ($field_icon == '') {
2803
+								$field_icon_af = '<i class="fa fa-envelope"></i>';
2804
+							} else {
2805
+								$field_icon_af = $field_icon;
2806
+								$field_icon = '';
2807
+							}
2808
+
2809
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2810
+
2811
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2812
+							if ($field_set_start == 1 && $site_title != '') {
2813
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2814
+							}
2815
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2816
+						}
2817
+							break;
2818
+						case 'textarea': {
2819
+							if (strpos($field_icon, 'http') !== false) {
2820
+								$field_icon_af = '';
2821
+							} elseif ($field_icon == '') {
2822
+								$field_icon_af = '';
2823
+							} else {
2824
+								$field_icon_af = $field_icon;
2825
+								$field_icon = '';
2826
+							}
2827
+
2828
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2829
+
2830
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2831
+							if ($field_set_start == 1 && $site_title != '') {
2832
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2833
+							}
2834
+							$html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2835
+						}
2836
+							break;
2837
+						case 'html': {
2838
+							if (strpos($field_icon, 'http') !== false) {
2839
+								$field_icon_af = '';
2840
+							} elseif ($field_icon == '') {
2841
+								$field_icon_af = '';
2842
+							} else {
2843
+								$field_icon_af = $field_icon;
2844
+								$field_icon = '';
2845
+							}
2846
+
2847
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2848
+
2849
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2850
+							if ($field_set_start == 1 && $site_title != '') {
2851
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2852
+							}
2853
+							$html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2854
+						}
2855
+						break;
2856
+						case 'file': {
2857
+							$html_var = $type['htmlvar_name'];
2858
+
2859
+							if (!empty($post->{$type['htmlvar_name']})) {
2860
+								$files = explode(",", $post->{$type['htmlvar_name']});
2861
+
2862
+								if (!empty($files)) {
2863
+									$extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2864
+									$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'] : '';
2865 2865
                                
2866
-                                    $file_paths = '';
2867
-                                    foreach ($files as $file) {
2868
-                                        if (!empty($file)) {
2869
-                                            $image_name_arr = explode('/', $file);
2870
-                                            $filename = end($image_name_arr);
2871
-
2872
-                                            $arr_file_type = wp_check_filetype($filename);
2873
-                                            if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2874
-                                                continue;
2875
-                                            }
2876
-                                            $uploaded_file_type = $arr_file_type['type'];
2877
-                                            $uploaded_file_ext = $arr_file_type['ext'];
2866
+									$file_paths = '';
2867
+									foreach ($files as $file) {
2868
+										if (!empty($file)) {
2869
+											$image_name_arr = explode('/', $file);
2870
+											$filename = end($image_name_arr);
2871
+
2872
+											$arr_file_type = wp_check_filetype($filename);
2873
+											if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2874
+												continue;
2875
+											}
2876
+											$uploaded_file_type = $arr_file_type['type'];
2877
+											$uploaded_file_ext = $arr_file_type['ext'];
2878 2878
                                             
2879
-                                            if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2880
-                                                continue; // Invalid file type.
2881
-                                            }
2882
-
2883
-                                            $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2884
-
2885
-                                            // If the uploaded file is image
2886
-                                            if (in_array($uploaded_file_type, $image_file_types)) {
2887
-                                                $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2888
-                                                $file_paths .= '<a href="'.$file.'">';
2889
-                                                $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2890
-                                                $file_paths .= '</a>';
2891
-                                                $file_paths .= '</div>';
2892
-                                            } else {
2893
-                                                $ext_path = '_' . $html_var . '_';
2894
-                                                $filename = explode($ext_path, $filename);
2895
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2896
-                                            }
2897
-                                        }
2898
-                                    }
2899
-
2900
-                                    if (strpos($field_icon, 'http') !== false) {
2901
-                                        $field_icon_af = '';
2902
-                                    } else if ($field_icon == '') {
2903
-                                        $field_icon_af = '';
2904
-                                    } else {
2905
-                                        $field_icon_af = $field_icon;
2906
-                                        $field_icon = '';
2907
-                                    }
2908
-
2909
-                                    $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2910
-
2911
-
2912
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2913
-
2914
-                                    if ($field_set_start == 1 && $site_title != '') {
2915
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2916
-                                    }
2917
-
2918
-                                    $html .= ' </span>' . $file_paths . '</div>';
2919
-                                }
2920
-                            }
2921
-                        }
2922
-                            break;
2923
-                    }
2924
-
2925
-
2926
-                    /**
2927
-                     * Filter custom field output in tab.
2928
-                     *
2929
-                     * @since 1.5.6
2930
-                     *
2931
-                     * @param string $html_var The HTML variable name for the field.
2932
-                     * @param string $html Custom field unfiltered HTML.
2933
-                     * @param array $variables_array Custom field variables array.
2934
-                     */
2935
-                    $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2936
-
2937
-                    $fieldset_html = '';
2938
-                    if ($field_set_start == 1) {
2939
-                        $add_html = false;
2940
-                        if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2941
-                            if ($fieldset != '') {
2942
-                                $add_html = true;
2943
-                                $label = $fieldset_arr[$fieldset_count - 1]['label'];
2944
-                                $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2945
-                            }
2946
-                            $fieldset_html = $fieldset;
2947
-                            $fieldset = '';
2948
-                        } else {
2949
-                            $fieldset .= $html;
2950
-                            if ($total_fields == $count_field && $fieldset != '') {
2951
-                                $add_html = true;
2952
-                                $label = $fieldset_arr[$fieldset_count]['label'];
2953
-                                $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2954
-                                $fieldset_html = $fieldset;
2955
-                            }
2956
-                        }
2957
-
2958
-                        if ($add_html) {
2959
-                            $tabs_arr[$htmlvar_name] = array(
2960
-                                'heading_text' => __($label, 'geodirectory'),
2961
-                                'is_active_tab' => false,
2962
-                                /**
2963
-                                 * Filter if a custom field should be displayed on the details page tab.
2964
-                                 *
2965
-                                 * @since 1.0.0
2966
-                                 * @param string $htmlvar_name The field HTML var name.
2967
-                                 */
2968
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2969
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2970
-                            );
2971
-                        }
2972
-                    } else {
2973
-                        if ($html != '') {
2974
-                            $tabs_arr[$field['htmlvar_name']] = array(
2975
-                                'heading_text' => __($label, 'geodirectory'),
2976
-                                'is_active_tab' => false,
2977
-                                /** This action is documented in geodirectory_hooks_actions.php */
2978
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2979
-                                'tab_content' => $html
2980
-                            );
2981
-                        }
2982
-                    }
2983
-                }
2984
-            }
2985
-        }
2986
-    }
2987
-    return $tabs_arr;
2879
+											if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2880
+												continue; // Invalid file type.
2881
+											}
2882
+
2883
+											$image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2884
+
2885
+											// If the uploaded file is image
2886
+											if (in_array($uploaded_file_type, $image_file_types)) {
2887
+												$file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2888
+												$file_paths .= '<a href="'.$file.'">';
2889
+												$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2890
+												$file_paths .= '</a>';
2891
+												$file_paths .= '</div>';
2892
+											} else {
2893
+												$ext_path = '_' . $html_var . '_';
2894
+												$filename = explode($ext_path, $filename);
2895
+												$file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2896
+											}
2897
+										}
2898
+									}
2899
+
2900
+									if (strpos($field_icon, 'http') !== false) {
2901
+										$field_icon_af = '';
2902
+									} else if ($field_icon == '') {
2903
+										$field_icon_af = '';
2904
+									} else {
2905
+										$field_icon_af = $field_icon;
2906
+										$field_icon = '';
2907
+									}
2908
+
2909
+									$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2910
+
2911
+
2912
+									$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2913
+
2914
+									if ($field_set_start == 1 && $site_title != '') {
2915
+										$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2916
+									}
2917
+
2918
+									$html .= ' </span>' . $file_paths . '</div>';
2919
+								}
2920
+							}
2921
+						}
2922
+							break;
2923
+					}
2924
+
2925
+
2926
+					/**
2927
+					 * Filter custom field output in tab.
2928
+					 *
2929
+					 * @since 1.5.6
2930
+					 *
2931
+					 * @param string $html_var The HTML variable name for the field.
2932
+					 * @param string $html Custom field unfiltered HTML.
2933
+					 * @param array $variables_array Custom field variables array.
2934
+					 */
2935
+					$html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2936
+
2937
+					$fieldset_html = '';
2938
+					if ($field_set_start == 1) {
2939
+						$add_html = false;
2940
+						if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2941
+							if ($fieldset != '') {
2942
+								$add_html = true;
2943
+								$label = $fieldset_arr[$fieldset_count - 1]['label'];
2944
+								$htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2945
+							}
2946
+							$fieldset_html = $fieldset;
2947
+							$fieldset = '';
2948
+						} else {
2949
+							$fieldset .= $html;
2950
+							if ($total_fields == $count_field && $fieldset != '') {
2951
+								$add_html = true;
2952
+								$label = $fieldset_arr[$fieldset_count]['label'];
2953
+								$htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2954
+								$fieldset_html = $fieldset;
2955
+							}
2956
+						}
2957
+
2958
+						if ($add_html) {
2959
+							$tabs_arr[$htmlvar_name] = array(
2960
+								'heading_text' => __($label, 'geodirectory'),
2961
+								'is_active_tab' => false,
2962
+								/**
2963
+								 * Filter if a custom field should be displayed on the details page tab.
2964
+								 *
2965
+								 * @since 1.0.0
2966
+								 * @param string $htmlvar_name The field HTML var name.
2967
+								 */
2968
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2969
+								'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2970
+							);
2971
+						}
2972
+					} else {
2973
+						if ($html != '') {
2974
+							$tabs_arr[$field['htmlvar_name']] = array(
2975
+								'heading_text' => __($label, 'geodirectory'),
2976
+								'is_active_tab' => false,
2977
+								/** This action is documented in geodirectory_hooks_actions.php */
2978
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2979
+								'tab_content' => $html
2980
+							);
2981
+						}
2982
+					}
2983
+				}
2984
+			}
2985
+		}
2986
+	}
2987
+	return $tabs_arr;
2988 2988
 }
2989 2989
 
2990 2990
 /* display add listing page for wpml */
@@ -3008,37 +3008,37 @@  discard block
 block discarded – undo
3008 3008
  */
3009 3009
 function geodir_add_post_status_author_page()
3010 3010
 {
3011
-    global $wpdb, $post;
3012
-
3013
-    $html = '';
3014
-    if (get_current_user_id()) {
3015
-        if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3016
-
3017
-            // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
3018
-            $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3019
-            $status = "<strong>(";
3020
-            $status_icon = '<i class="fa fa-play"></i>';
3021
-            if ($real_status == 'publish') {
3022
-                $status .= __('Published', 'geodirectory');
3023
-            } else {
3024
-                $status .= __('Not published', 'geodirectory');
3025
-                $status_icon = '<i class="fa fa-pause"></i>';
3026
-            }
3027
-            $status .= ")</strong>";
3011
+	global $wpdb, $post;
3012
+
3013
+	$html = '';
3014
+	if (get_current_user_id()) {
3015
+		if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3016
+
3017
+			// we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
3018
+			$real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3019
+			$status = "<strong>(";
3020
+			$status_icon = '<i class="fa fa-play"></i>';
3021
+			if ($real_status == 'publish') {
3022
+				$status .= __('Published', 'geodirectory');
3023
+			} else {
3024
+				$status .= __('Not published', 'geodirectory');
3025
+				$status_icon = '<i class="fa fa-pause"></i>';
3026
+			}
3027
+			$status .= ")</strong>";
3028 3028
 
3029
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3030
-        }
3031
-    }
3029
+			$html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3030
+		}
3031
+	}
3032 3032
 
3033
-    if ($html != '') {
3034
-        /**
3035
-         * Filter the post status text on the author page.
3036
-         *
3037
-         * @since 1.0.0
3038
-         * @param string $html The HTML of the status.
3039
-         */
3040
-        echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3041
-    }
3033
+	if ($html != '') {
3034
+		/**
3035
+		 * Filter the post status text on the author page.
3036
+		 *
3037
+		 * @since 1.0.0
3038
+		 * @param string $html The HTML of the status.
3039
+		 */
3040
+		echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3041
+	}
3042 3042
 
3043 3043
 
3044 3044
 }
@@ -3052,21 +3052,21 @@  discard block
 block discarded – undo
3052 3052
  */
3053 3053
 function geodir_init_no_rating()
3054 3054
 {
3055
-    if (get_option('geodir_disable_rating')) {
3056
-        remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3057
-        remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3058
-        remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3059
-        remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3060
-        remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3061
-        remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3062
-        remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3063
-
3064
-        add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3065
-        add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3066
-        add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3067
-        add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3068
-        add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3069
-    }
3055
+	if (get_option('geodir_disable_rating')) {
3056
+		remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3057
+		remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3058
+		remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3059
+		remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3060
+		remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3061
+		remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3062
+		remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3063
+
3064
+		add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3065
+		add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3066
+		add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3067
+		add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3068
+		add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3069
+	}
3070 3070
 }
3071 3071
 
3072 3072
 /**
@@ -3078,20 +3078,20 @@  discard block
 block discarded – undo
3078 3078
  */
3079 3079
 function geodir_no_rating_rating_fields()
3080 3080
 {
3081
-    global $post;
3081
+	global $post;
3082 3082
 
3083
-    $post_types = geodir_get_posttypes();
3083
+	$post_types = geodir_get_posttypes();
3084 3084
 
3085
-    if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3086
-        if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3087
-            echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3088
-            if (get_option('geodir_reviewrating_enable_images')) {
3089
-                geodir_reviewrating_rating_img_html();
3090
-            }
3091
-        } else {
3092
-            echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3093
-        }
3094
-    }
3085
+	if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3086
+		if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3087
+			echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3088
+			if (get_option('geodir_reviewrating_enable_images')) {
3089
+				geodir_reviewrating_rating_img_html();
3090
+			}
3091
+		} else {
3092
+			echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3093
+		}
3094
+	}
3095 3095
 }
3096 3096
 
3097 3097
 /**
@@ -3105,11 +3105,11 @@  discard block
 block discarded – undo
3105 3105
  */
3106 3106
 function geodir_no_rating_comment_text($content, $comment = '')
3107 3107
 {
3108
-    if (!is_admin()) {
3109
-        return '<div class="description">' . $content . '</div>';
3110
-    } else {
3111
-        return $content;
3112
-    }
3108
+	if (!is_admin()) {
3109
+		return '<div class="description">' . $content . '</div>';
3110
+	} else {
3111
+		return $content;
3112
+	}
3113 3113
 }
3114 3114
 
3115 3115
 /**
@@ -3122,7 +3122,7 @@  discard block
 block discarded – undo
3122 3122
  */
3123 3123
 function geodir_no_rating_review_rating_html($content = '')
3124 3124
 {
3125
-    return NULL;
3125
+	return NULL;
3126 3126
 }
3127 3127
 
3128 3128
 /**
@@ -3136,19 +3136,19 @@  discard block
 block discarded – undo
3136 3136
  */
3137 3137
 function geodir_no_rating_get_sort_options($options, $post_type = '')
3138 3138
 {
3139
-    $new_options = array();
3140
-    if (!empty($options)) {
3141
-        foreach ($options as $option) {
3142
-            if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3143
-                continue;
3144
-            }
3145
-            $new_options[] = $option;
3146
-        }
3139
+	$new_options = array();
3140
+	if (!empty($options)) {
3141
+		foreach ($options as $option) {
3142
+			if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3143
+				continue;
3144
+			}
3145
+			$new_options[] = $option;
3146
+		}
3147 3147
 
3148
-        $options = $new_options;
3149
-    }
3148
+		$options = $new_options;
3149
+	}
3150 3150
 
3151
-    return $options;
3151
+	return $options;
3152 3152
 }
3153 3153
 
3154 3154
 add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100);
@@ -3162,11 +3162,11 @@  discard block
 block discarded – undo
3162 3162
  */
3163 3163
 function geodir_all_js_msg_no_rating($msg = array())
3164 3164
 {
3165
-    if (get_option('geodir_disable_rating')) {
3166
-        $msg['gd_cmt_no_rating'] = true;
3167
-    }
3165
+	if (get_option('geodir_disable_rating')) {
3166
+		$msg['gd_cmt_no_rating'] = true;
3167
+	}
3168 3168
 
3169
-    return $msg;
3169
+	return $msg;
3170 3170
 }
3171 3171
 
3172 3172
 add_filter('body_class', 'geodir_body_class_no_rating', 100);
@@ -3180,13 +3180,13 @@  discard block
 block discarded – undo
3180 3180
  */
3181 3181
 function geodir_body_class_no_rating($classes = array())
3182 3182
 {
3183
-    if (get_option('geodir_disable_rating')) {
3184
-        $classes[] = 'gd-no-rating';
3185
-    }
3183
+	if (get_option('geodir_disable_rating')) {
3184
+		$classes[] = 'gd-no-rating';
3185
+	}
3186 3186
     
3187
-    $classes[] = 'gd-map-' . geodir_map_name();
3187
+	$classes[] = 'gd-map-' . geodir_map_name();
3188 3188
 
3189
-    return $classes;
3189
+	return $classes;
3190 3190
 }
3191 3191
 
3192 3192
 add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100);
@@ -3200,13 +3200,13 @@  discard block
 block discarded – undo
3200 3200
  */
3201 3201
 function geodir_admin_body_class_no_rating($class = '')
3202 3202
 {
3203
-    if (get_option('geodir_disable_rating')) {
3204
-        $class .= ' gd-no-rating';
3205
-    }
3203
+	if (get_option('geodir_disable_rating')) {
3204
+		$class .= ' gd-no-rating';
3205
+	}
3206 3206
     
3207
-    $class .= ' gd-map-' . geodir_map_name();
3207
+	$class .= ' gd-map-' . geodir_map_name();
3208 3208
 
3209
-    return $class;
3209
+	return $class;
3210 3210
 }
3211 3211
 
3212 3212
 add_action('wp_head', 'geodir_wp_head_no_rating');
@@ -3219,10 +3219,10 @@  discard block
 block discarded – undo
3219 3219
  */
3220 3220
 function geodir_wp_head_no_rating()
3221 3221
 {
3222
-    if (get_option('geodir_disable_rating')) {
3223
-        echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3224
-        echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3225
-    }
3222
+	if (get_option('geodir_disable_rating')) {
3223
+		echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3224
+		echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3225
+	}
3226 3226
 }
3227 3227
 
3228 3228
 add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation');
@@ -3239,36 +3239,36 @@  discard block
 block discarded – undo
3239 3239
  * @return array Translation texts.
3240 3240
  */
3241 3241
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3242
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3243
-
3244
-    $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3245
-
3246
-    /**
3247
-     * Filters the geodirectory option names that requires to add for translation.
3248
-     *
3249
-     * @since 1.5.7
3250
-     * @package GeoDirectory
3251
-     *
3252
-     * @param  array $gd_options Array of option names.
3253
-     */
3254
-    $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3255
-    $gd_options = array_unique($gd_options);
3256
-
3257
-    if (!empty($gd_options)) {
3258
-        foreach ($gd_options as $gd_option) {
3259
-            if ($gd_option != '' && $option_value = get_option($gd_option)) {
3260
-                $option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3242
+	$translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3243
+
3244
+	$gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3245
+
3246
+	/**
3247
+	 * Filters the geodirectory option names that requires to add for translation.
3248
+	 *
3249
+	 * @since 1.5.7
3250
+	 * @package GeoDirectory
3251
+	 *
3252
+	 * @param  array $gd_options Array of option names.
3253
+	 */
3254
+	$gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3255
+	$gd_options = array_unique($gd_options);
3256
+
3257
+	if (!empty($gd_options)) {
3258
+		foreach ($gd_options as $gd_option) {
3259
+			if ($gd_option != '' && $option_value = get_option($gd_option)) {
3260
+				$option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3261 3261
                 
3262
-                if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3263
-                    $translation_texts[] = stripslashes_deep($option_value);
3264
-                }
3265
-            }
3266
-        }
3267
-    }
3262
+				if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3263
+					$translation_texts[] = stripslashes_deep($option_value);
3264
+				}
3265
+			}
3266
+		}
3267
+	}
3268 3268
 
3269
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3269
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3270 3270
 
3271
-    return $translation_texts;
3271
+	return $translation_texts;
3272 3272
 }
3273 3273
 
3274 3274
 add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation');
Please login to merge, or discard this patch.