Test Failed
Push — master ( e4b526...599770 )
by Stiofan
06:48
created
geodirectory-functions/ajax_handler_functions.php 3 patches
Indentation   +314 added lines, -314 removed lines patch added patch discarded remove patch
@@ -16,22 +16,22 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_on_wp_loaded()
18 18
 {
19
-    /**
20
-     * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms.
21
-     *
22
-     * @since 1.0.0
23
-     */
24
-    do_action('giodir_handle_request_plugins_loaded');
25
-    global $wpdb;
19
+	/**
20
+	 * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms.
21
+	 *
22
+	 * @since 1.0.0
23
+	 */
24
+	do_action('giodir_handle_request_plugins_loaded');
25
+	global $wpdb;
26 26
 
27 27
 
28
-    if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') {
29
-        geodir_send_inquiry($_REQUEST); // function in custom_functions.php
28
+	if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') {
29
+		geodir_send_inquiry($_REQUEST); // function in custom_functions.php
30 30
 
31
-    } elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') {
32
-        geodir_send_friend($_REQUEST); // function in custom_functions.php
31
+	} elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') {
32
+		geodir_send_friend($_REQUEST); // function in custom_functions.php
33 33
 
34
-    }
34
+	}
35 35
 
36 36
 }
37 37
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function geodir_on_wp()
46 46
 {
47
-    if(geodir_is_page('login')) {
48
-        geodir_user_signup();
49
-    }
47
+	if(geodir_is_page('login')) {
48
+		geodir_user_signup();
49
+	}
50 50
 
51 51
 }
52 52
 
@@ -59,47 +59,47 @@  discard block
 block discarded – undo
59 59
  */
60 60
 function geodir_on_init()
61 61
 {
62
-    /**
63
-     * Called on the wp_init WP hook at the start of the geodir_on_init() function.
64
-     *
65
-     * @since 1.0.0
66
-     */
67
-    do_action('giodir_handle_request');
68
-    global $wpdb;
69
-
70
-
71
-
72
-
73
-    if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) {
74
-        show_admin_bar(false);
75
-    }
76
-
77
-
78
-    if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') {
79
-        /**
80
-         * Contains map marker functions.
81
-         *
82
-         * @since 1.0.0
83
-         * @package GeoDirectory
84
-         */
85
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
86
-        die;
87
-    }
88
-
89
-    if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'ga') {
90
-        if (isset($_REQUEST['ga_start'])) {
91
-            $ga_start = $_REQUEST['ga_start'];
92
-        } else {
93
-            $ga_start = '';
94
-        }
95
-        if (isset($_REQUEST['ga_end'])) {
96
-            $ga_end = $_REQUEST['ga_end'];
97
-        } else {
98
-            $ga_end = '';
99
-        }
100
-        geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end);
101
-        die;
102
-    }
62
+	/**
63
+	 * Called on the wp_init WP hook at the start of the geodir_on_init() function.
64
+	 *
65
+	 * @since 1.0.0
66
+	 */
67
+	do_action('giodir_handle_request');
68
+	global $wpdb;
69
+
70
+
71
+
72
+
73
+	if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) {
74
+		show_admin_bar(false);
75
+	}
76
+
77
+
78
+	if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') {
79
+		/**
80
+		 * Contains map marker functions.
81
+		 *
82
+		 * @since 1.0.0
83
+		 * @package GeoDirectory
84
+		 */
85
+		include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
86
+		die;
87
+	}
88
+
89
+	if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'ga') {
90
+		if (isset($_REQUEST['ga_start'])) {
91
+			$ga_start = $_REQUEST['ga_start'];
92
+		} else {
93
+			$ga_start = '';
94
+		}
95
+		if (isset($_REQUEST['ga_end'])) {
96
+			$ga_end = $_REQUEST['ga_end'];
97
+		} else {
98
+			$ga_end = '';
99
+		}
100
+		geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end);
101
+		die;
102
+	}
103 103
 
104 104
 
105 105
 }
@@ -118,271 +118,271 @@  discard block
 block discarded – undo
118 118
  * @todo check if nonce is required here and if so add one.
119 119
  */
120 120
 function geodir_ajax_handler() {
121
-    global $wpdb, $gd_session;
121
+	global $wpdb, $gd_session;
122 122
 
123
-    if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') {
123
+	if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') {
124 124
 		$gd_session->set('gd_listing_view', $_REQUEST['gd_listing_view']);
125
-        echo '1';
126
-    }
127
-
128
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
129
-        if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude']))
130
-            geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
-        else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax']))
132
-            geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
133
-    }
134
-
135
-    if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
136
-        if (current_user_can('manage_options')) {
137
-            /**
138
-             * Contains admin ajax handling functions.
139
-             *
140
-             * @since 1.0.0
141
-             * @package GeoDirectory
142
-             */
143
-            include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php');
144
-        } else {
145
-            wp_redirect(geodir_login_url());
146
-            gd_die();
147
-        }
148
-    }
149
-
150
-    if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) {
151
-        if (current_user_can('manage_options')) {
152
-            switch ($_REQUEST['geodir_autofill']):
153
-                case "geodir_dummy_delete" :
154
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
155
-                        return;
156
-
157
-                    if (isset($_REQUEST['posttype']))
158
-                        /**
159
-                         * Used to delete the dummy post data per post type.
160
-                         *
161
-                         * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype'].
162
-                         *
163
-                         * @since 1.6.11
164
-                         * @param string $posttype The post type to insert.
165
-                         * @param string $datatype The type of dummy data to insert.
166
-                         */
167
-                        do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),sanitize_key(['datatype']));
168
-                    break;
169
-                case "geodir_dummy_insert" :
170
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
171
-                        return;
172
-
173
-                    global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
174
-                    $city_bound_lat1 = $_REQUEST['city_bound_lat1'];
175
-                    $city_bound_lng1 = $_REQUEST['city_bound_lng1'];
176
-                    $city_bound_lat2 = $_REQUEST['city_bound_lat2'];
177
-                    $city_bound_lng2 = $_REQUEST['city_bound_lng2'];
178
-
179
-                    if (isset($_REQUEST['posttype'])){
180
-                        /**
181
-                         * Used to insert the dummy post data per post type.
182
-                         *
183
-                         * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype'].
184
-                         *
185
-                         * @since 1.6.11
186
-                         * @param string $posttype The post type to insert.
187
-                         * @param string $datatype The type of dummy data to insert.
188
-                         * @param int $post_index The item number to insert.
189
-                         */
190
-                        do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index']));
191
-                    }
192
-
193
-
194
-                    break;
195
-            endswitch;
196
-        } else {
197
-            wp_redirect(geodir_login_url());
198
-            exit();
199
-        }
200
-    }
201
-
202
-    if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
203
-
204
-        if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
205
-            $template = locate_template(array("geodirectory/popup-forms.php"));
206
-            if (!$template) {
207
-                $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php';
208
-            }
209
-            require_once($template);
210
-        }
211
-
212
-        gd_die();
213
-    }
214
-
215
-    /*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){
125
+		echo '1';
126
+	}
127
+
128
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
129
+		if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude']))
130
+			geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
+		else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax']))
132
+			geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
133
+	}
134
+
135
+	if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
136
+		if (current_user_can('manage_options')) {
137
+			/**
138
+			 * Contains admin ajax handling functions.
139
+			 *
140
+			 * @since 1.0.0
141
+			 * @package GeoDirectory
142
+			 */
143
+			include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php');
144
+		} else {
145
+			wp_redirect(geodir_login_url());
146
+			gd_die();
147
+		}
148
+	}
149
+
150
+	if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) {
151
+		if (current_user_can('manage_options')) {
152
+			switch ($_REQUEST['geodir_autofill']):
153
+				case "geodir_dummy_delete" :
154
+					if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
155
+						return;
156
+
157
+					if (isset($_REQUEST['posttype']))
158
+						/**
159
+						 * Used to delete the dummy post data per post type.
160
+						 *
161
+						 * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype'].
162
+						 *
163
+						 * @since 1.6.11
164
+						 * @param string $posttype The post type to insert.
165
+						 * @param string $datatype The type of dummy data to insert.
166
+						 */
167
+						do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),sanitize_key(['datatype']));
168
+					break;
169
+				case "geodir_dummy_insert" :
170
+					if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
171
+						return;
172
+
173
+					global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
174
+					$city_bound_lat1 = $_REQUEST['city_bound_lat1'];
175
+					$city_bound_lng1 = $_REQUEST['city_bound_lng1'];
176
+					$city_bound_lat2 = $_REQUEST['city_bound_lat2'];
177
+					$city_bound_lng2 = $_REQUEST['city_bound_lng2'];
178
+
179
+					if (isset($_REQUEST['posttype'])){
180
+						/**
181
+						 * Used to insert the dummy post data per post type.
182
+						 *
183
+						 * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype'].
184
+						 *
185
+						 * @since 1.6.11
186
+						 * @param string $posttype The post type to insert.
187
+						 * @param string $datatype The type of dummy data to insert.
188
+						 * @param int $post_index The item number to insert.
189
+						 */
190
+						do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index']));
191
+					}
192
+
193
+
194
+					break;
195
+			endswitch;
196
+		} else {
197
+			wp_redirect(geodir_login_url());
198
+			exit();
199
+		}
200
+	}
201
+
202
+	if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
203
+
204
+		if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
205
+			$template = locate_template(array("geodirectory/popup-forms.php"));
206
+			if (!$template) {
207
+				$template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php';
208
+			}
209
+			require_once($template);
210
+		}
211
+
212
+		gd_die();
213
+	}
214
+
215
+	/*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){
216 216
         include_once ( geodir_plugin_path() . '/geodirectory-templates/advance-search-form.php');
217 217
     }*/
218 218
 
219
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
220
-        /**
221
-         * Contains map marker functions.
222
-         *
223
-         * @since 1.0.0
224
-         * @package GeoDirectory
225
-         */
226
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
227
-    }
228
-
229
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
230
-        if (is_user_logged_in()) {
231
-            switch ($_REQUEST['ajax_action']):
232
-                case "add" :
233
-                    geodir_add_to_favorite((int)$_REQUEST['pid']);
234
-                    break;
235
-                case "remove" :
236
-                    geodir_remove_from_favorite((int)$_REQUEST['pid']);
237
-                    break;
238
-            endswitch;
239
-        } else {
240
-            wp_redirect(geodir_login_url());
241
-            exit();
242
-        }
243
-    }
244
-
245
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
246
-
247
-        $is_current_user_owner = true;
248
-        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
249
-            $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']);
250
-        }
251
-
252
-        $request = $gd_session->get('listing');
253
-
254
-        if (is_user_logged_in() && $is_current_user_owner) {
255
-
256
-            switch ($_REQUEST['ajax_action']):
257
-                case "add":
258
-                case "update":
259
-
260
-                    if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
261
-                        $last_id = geodir_save_listing();
262
-
263
-                        if ($last_id) {
264
-                            //$redirect_to = get_permalink( $last_id );
265
-                            $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
266
-
267
-                        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
268
-                            $redirect_to = get_permalink(geodir_add_listing_page_id());
269
-                            $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
270
-                        } else
271
-                            $redirect_to = get_permalink(geodir_add_listing_page_id());
272
-
273
-                        wp_redirect($redirect_to);
274
-                    } else {
275
-                        $gd_session->un_set('listing');
276
-                        wp_redirect(home_url());
277
-                    }
278
-
279
-                    break;
280
-                case "cancel" :
281
-
282
-                    $gd_session->un_set('listing');
283
-
284
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid']))
285
-                        wp_redirect(get_permalink($_REQUEST['pid']));
286
-                    else {
287
-                        geodir_remove_temp_images();
288
-                        wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
289
-                    }
290
-
291
-                    break;
292
-
293
-                case "publish" :
294
-
295
-                    if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
296
-
297
-                        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
298
-                            $new_post = array();
299
-                            $new_post['ID'] = $_REQUEST['pid'];
300
-
301
-                            $lastid = wp_update_post($new_post);
302
-
303
-                            $gd_session->un_set('listing');
304
-                            wp_redirect(get_permalink($lastid));
305
-                        } else {
306
-                            $last_id = geodir_save_listing();
307
-
308
-                            if ($last_id) {
309
-                                //$redirect_to = get_permalink( $last_id );
310
-                                $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
311
-                            } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
312
-                                $redirect_to = get_permalink(geodir_add_listing_page_id());
313
-                                $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
314
-                            } else
315
-                                $redirect_to = get_permalink(geodir_add_listing_page_id());
316
-
317
-                            $gd_session->un_set('listing');
318
-                            wp_redirect($redirect_to);
319
-                        }
320
-                    } else {
321
-                        $gd_session->un_set('listing');
322
-                        wp_redirect(home_url());
323
-                    }
324
-
325
-                    break;
326
-                case "delete" :
327
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
328
-                        global $current_user;
329
-
330
-                        if (get_option('geodir_disable_perm_delete')) {
331
-                            $lastid = wp_trash_post($_REQUEST['pid']);
332
-                        } else {
333
-                            $lastid = wp_delete_post($_REQUEST['pid']);
334
-                        }
335
-
336
-                        if ($lastid && !is_wp_error($lastid))
337
-                            wp_redirect($_SERVER['HTTP_REFERER']);
338
-
339
-                        //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
340
-                    }
341
-                    break;
342
-            endswitch;
343
-
344
-            $gd_session->un_set('listing');
345
-        } else {
346
-            $gd_session->un_set('listing');
347
-            wp_redirect(geodir_login_url());
348
-            exit();
349
-        }
350
-    }
351
-
352
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
353
-        /**
354
-         * Contains registration and login functions.
355
-         * @todo Fix the file path.
356
-         *
357
-         * @since 1.0.0
358
-         * @package GeoDirectory
359
-         */
360
-        include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php');
361
-    }
362
-
363
-    if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
364
-        $args = array('taxonomy' => sanitize_text_field($_REQUEST['term']));
365
-        if (!empty($_REQUEST['parent_only'])) {
366
-            $args['parent'] = 0;
367
-        }
368
-        $terms_o = get_terms($args);
219
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
220
+		/**
221
+		 * Contains map marker functions.
222
+		 *
223
+		 * @since 1.0.0
224
+		 * @package GeoDirectory
225
+		 */
226
+		include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
227
+	}
228
+
229
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
230
+		if (is_user_logged_in()) {
231
+			switch ($_REQUEST['ajax_action']):
232
+				case "add" :
233
+					geodir_add_to_favorite((int)$_REQUEST['pid']);
234
+					break;
235
+				case "remove" :
236
+					geodir_remove_from_favorite((int)$_REQUEST['pid']);
237
+					break;
238
+			endswitch;
239
+		} else {
240
+			wp_redirect(geodir_login_url());
241
+			exit();
242
+		}
243
+	}
244
+
245
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
246
+
247
+		$is_current_user_owner = true;
248
+		if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
249
+			$is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']);
250
+		}
251
+
252
+		$request = $gd_session->get('listing');
253
+
254
+		if (is_user_logged_in() && $is_current_user_owner) {
255
+
256
+			switch ($_REQUEST['ajax_action']):
257
+				case "add":
258
+				case "update":
259
+
260
+					if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
261
+						$last_id = geodir_save_listing();
262
+
263
+						if ($last_id) {
264
+							//$redirect_to = get_permalink( $last_id );
265
+							$redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
266
+
267
+						} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
268
+							$redirect_to = get_permalink(geodir_add_listing_page_id());
269
+							$redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
270
+						} else
271
+							$redirect_to = get_permalink(geodir_add_listing_page_id());
272
+
273
+						wp_redirect($redirect_to);
274
+					} else {
275
+						$gd_session->un_set('listing');
276
+						wp_redirect(home_url());
277
+					}
278
+
279
+					break;
280
+				case "cancel" :
281
+
282
+					$gd_session->un_set('listing');
283
+
284
+					if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid']))
285
+						wp_redirect(get_permalink($_REQUEST['pid']));
286
+					else {
287
+						geodir_remove_temp_images();
288
+						wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
289
+					}
290
+
291
+					break;
292
+
293
+				case "publish" :
294
+
295
+					if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
296
+
297
+						if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
298
+							$new_post = array();
299
+							$new_post['ID'] = $_REQUEST['pid'];
300
+
301
+							$lastid = wp_update_post($new_post);
302
+
303
+							$gd_session->un_set('listing');
304
+							wp_redirect(get_permalink($lastid));
305
+						} else {
306
+							$last_id = geodir_save_listing();
307
+
308
+							if ($last_id) {
309
+								//$redirect_to = get_permalink( $last_id );
310
+								$redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
311
+							} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
312
+								$redirect_to = get_permalink(geodir_add_listing_page_id());
313
+								$redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
314
+							} else
315
+								$redirect_to = get_permalink(geodir_add_listing_page_id());
316
+
317
+							$gd_session->un_set('listing');
318
+							wp_redirect($redirect_to);
319
+						}
320
+					} else {
321
+						$gd_session->un_set('listing');
322
+						wp_redirect(home_url());
323
+					}
324
+
325
+					break;
326
+				case "delete" :
327
+					if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
328
+						global $current_user;
329
+
330
+						if (get_option('geodir_disable_perm_delete')) {
331
+							$lastid = wp_trash_post($_REQUEST['pid']);
332
+						} else {
333
+							$lastid = wp_delete_post($_REQUEST['pid']);
334
+						}
335
+
336
+						if ($lastid && !is_wp_error($lastid))
337
+							wp_redirect($_SERVER['HTTP_REFERER']);
338
+
339
+						//wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
340
+					}
341
+					break;
342
+			endswitch;
343
+
344
+			$gd_session->un_set('listing');
345
+		} else {
346
+			$gd_session->un_set('listing');
347
+			wp_redirect(geodir_login_url());
348
+			exit();
349
+		}
350
+	}
351
+
352
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
353
+		/**
354
+		 * Contains registration and login functions.
355
+		 * @todo Fix the file path.
356
+		 *
357
+		 * @since 1.0.0
358
+		 * @package GeoDirectory
359
+		 */
360
+		include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php');
361
+	}
362
+
363
+	if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
364
+		$args = array('taxonomy' => sanitize_text_field($_REQUEST['term']));
365
+		if (!empty($_REQUEST['parent_only'])) {
366
+			$args['parent'] = 0;
367
+		}
368
+		$terms_o = get_terms($args);
369 369
         
370
-        // Skip terms which has no listing
371
-        if (!empty($terms_o)) {
372
-            $filter_terms = array();
370
+		// Skip terms which has no listing
371
+		if (!empty($terms_o)) {
372
+			$filter_terms = array();
373 373
             
374
-            foreach ($terms_o as $term) {
375
-                if (isset($term->count) && $term->count > 0) {
376
-                    $filter_terms[] = $term;
377
-                }
378
-            }
379
-            $terms_o = $filter_terms;
380
-        }
374
+			foreach ($terms_o as $term) {
375
+				if (isset($term->count) && $term->count > 0) {
376
+					$filter_terms[] = $term;
377
+				}
378
+			}
379
+			$terms_o = $filter_terms;
380
+		}
381 381
         
382
-        $terms = geodir_sort_terms($terms_o, 'count');
383
-        geodir_helper_cat_list_output($terms, intval($_REQUEST['limit']));
384
-        exit();
385
-    }
382
+		$terms = geodir_sort_terms($terms_o, 'count');
383
+		geodir_helper_cat_list_output($terms, intval($_REQUEST['limit']));
384
+		exit();
385
+	}
386 386
 
387
-    gd_die();
387
+	gd_die();
388 388
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function geodir_on_wp()
46 46
 {
47
-    if(geodir_is_page('login')) {
47
+    if (geodir_is_page('login')) {
48 48
         geodir_user_signup();
49 49
     }
50 50
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
          * @since 1.0.0
83 83
          * @package GeoDirectory
84 84
          */
85
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
85
+        include_once(geodir_plugin_path().'/geodirectory-functions/map-functions/get_markers.php');
86 86
         die;
87 87
     }
88 88
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
              * @since 1.0.0
141 141
              * @package GeoDirectory
142 142
              */
143
-            include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php');
143
+            include_once(geodir_plugin_path().'/geodirectory-admin/geodir_admin_ajax.php');
144 144
         } else {
145 145
             wp_redirect(geodir_login_url());
146 146
             gd_die();
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                          * @param string $posttype The post type to insert.
165 165
                          * @param string $datatype The type of dummy data to insert.
166 166
                          */
167
-                        do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),sanitize_key(['datatype']));
167
+                        do_action('geodir_delete_dummy_posts', sanitize_key($_REQUEST['posttype']), sanitize_key(['datatype']));
168 168
                     break;
169 169
                 case "geodir_dummy_insert" :
170 170
                     if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                     $city_bound_lat2 = $_REQUEST['city_bound_lat2'];
177 177
                     $city_bound_lng2 = $_REQUEST['city_bound_lng2'];
178 178
 
179
-                    if (isset($_REQUEST['posttype'])){
179
+                    if (isset($_REQUEST['posttype'])) {
180 180
                         /**
181 181
                          * Used to insert the dummy post data per post type.
182 182
                          *
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                          * @param string $datatype The type of dummy data to insert.
188 188
                          * @param int $post_index The item number to insert.
189 189
                          */
190
-                        do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index']));
190
+                        do_action('geodir_insert_dummy_posts', sanitize_key($_REQUEST['posttype']), sanitize_key($_REQUEST['datatype']), absint($_REQUEST['insert_dummy_post_index']));
191 191
                     }
192 192
 
193 193
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
205 205
             $template = locate_template(array("geodirectory/popup-forms.php"));
206 206
             if (!$template) {
207
-                $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php';
207
+                $template = geodir_plugin_path().'/geodirectory-templates/popup-forms.php';
208 208
             }
209 209
             require_once($template);
210 210
         }
@@ -223,17 +223,17 @@  discard block
 block discarded – undo
223 223
          * @since 1.0.0
224 224
          * @package GeoDirectory
225 225
          */
226
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
226
+        include_once(geodir_plugin_path().'/geodirectory-functions/map-functions/get_markers.php');
227 227
     }
228 228
 
229 229
     if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
230 230
         if (is_user_logged_in()) {
231 231
             switch ($_REQUEST['ajax_action']):
232 232
                 case "add" :
233
-                    geodir_add_to_favorite((int)$_REQUEST['pid']);
233
+                    geodir_add_to_favorite((int) $_REQUEST['pid']);
234 234
                     break;
235 235
                 case "remove" :
236
-                    geodir_remove_from_favorite((int)$_REQUEST['pid']);
236
+                    geodir_remove_from_favorite((int) $_REQUEST['pid']);
237 237
                     break;
238 238
             endswitch;
239 239
         } else {
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 
247 247
         $is_current_user_owner = true;
248 248
         if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
249
-            $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']);
249
+            $is_current_user_owner = geodir_listing_belong_to_current_user((int) $_REQUEST['pid']);
250 250
         }
251 251
 
252 252
         $request = $gd_session->get('listing');
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
          * @since 1.0.0
358 358
          * @package GeoDirectory
359 359
          */
360
-        include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php');
360
+        include_once(geodir_plugin_path().'/geodirectory-functions/geodirectory_reg.php');
361 361
     }
362 362
 
363 363
     if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
Please login to merge, or discard this patch.
Braces   +27 added lines, -20 removed lines patch added patch discarded remove patch
@@ -126,10 +126,11 @@  discard block
 block discarded – undo
126 126
     }
127 127
 
128 128
     if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
129
-        if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude']))
130
-            geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
-        else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax']))
132
-            geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
129
+        if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) {
130
+                    geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
+        } else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) {
132
+                    geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
133
+        }
133 134
     }
134 135
 
135 136
     if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
@@ -151,11 +152,12 @@  discard block
 block discarded – undo
151 152
         if (current_user_can('manage_options')) {
152 153
             switch ($_REQUEST['geodir_autofill']):
153 154
                 case "geodir_dummy_delete" :
154
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
155
-                        return;
155
+                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) {
156
+                                            return;
157
+                    }
156 158
 
157
-                    if (isset($_REQUEST['posttype']))
158
-                        /**
159
+                    if (isset($_REQUEST['posttype'])) {
160
+                                            /**
159 161
                          * Used to delete the dummy post data per post type.
160 162
                          *
161 163
                          * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype'].
@@ -164,11 +166,13 @@  discard block
 block discarded – undo
164 166
                          * @param string $posttype The post type to insert.
165 167
                          * @param string $datatype The type of dummy data to insert.
166 168
                          */
167
-                        do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),sanitize_key(['datatype']));
169
+                        do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),sanitize_key(['datatype']));
170
+                    }
168 171
                     break;
169 172
                 case "geodir_dummy_insert" :
170
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
171
-                        return;
173
+                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) {
174
+                                            return;
175
+                    }
172 176
 
173 177
                     global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
174 178
                     $city_bound_lat1 = $_REQUEST['city_bound_lat1'];
@@ -267,8 +271,9 @@  discard block
 block discarded – undo
267 271
                         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
268 272
                             $redirect_to = get_permalink(geodir_add_listing_page_id());
269 273
                             $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
270
-                        } else
271
-                            $redirect_to = get_permalink(geodir_add_listing_page_id());
274
+                        } else {
275
+                                                    $redirect_to = get_permalink(geodir_add_listing_page_id());
276
+                        }
272 277
 
273 278
                         wp_redirect($redirect_to);
274 279
                     } else {
@@ -281,9 +286,9 @@  discard block
 block discarded – undo
281 286
 
282 287
                     $gd_session->un_set('listing');
283 288
 
284
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid']))
285
-                        wp_redirect(get_permalink($_REQUEST['pid']));
286
-                    else {
289
+                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) {
290
+                                            wp_redirect(get_permalink($_REQUEST['pid']));
291
+                    } else {
287 292
                         geodir_remove_temp_images();
288 293
                         wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
289 294
                     }
@@ -311,8 +316,9 @@  discard block
 block discarded – undo
311 316
                             } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
312 317
                                 $redirect_to = get_permalink(geodir_add_listing_page_id());
313 318
                                 $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
314
-                            } else
315
-                                $redirect_to = get_permalink(geodir_add_listing_page_id());
319
+                            } else {
320
+                                                            $redirect_to = get_permalink(geodir_add_listing_page_id());
321
+                            }
316 322
 
317 323
                             $gd_session->un_set('listing');
318 324
                             wp_redirect($redirect_to);
@@ -333,8 +339,9 @@  discard block
 block discarded – undo
333 339
                             $lastid = wp_delete_post($_REQUEST['pid']);
334 340
                         }
335 341
 
336
-                        if ($lastid && !is_wp_error($lastid))
337
-                            wp_redirect($_SERVER['HTTP_REFERER']);
342
+                        if ($lastid && !is_wp_error($lastid)) {
343
+                                                    wp_redirect($_SERVER['HTTP_REFERER']);
344
+                        }
338 345
 
339 346
                         //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
340 347
                     }
Please login to merge, or discard this patch.
geodirectory-functions/listing_filters.php 2 patches
Indentation   +518 added lines, -518 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_session_start()
18 18
 {
19
-    if (!session_id()) session_start();
20
-    global $geodir_add_location_url;
19
+	if (!session_id()) session_start();
20
+	global $geodir_add_location_url;
21 21
 
22
-    $geodir_add_location_url = NULL;
22
+	$geodir_add_location_url = NULL;
23 23
 }
24 24
 
25 25
 /**
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
  */
34 34
 function geodir_modified_query($query)
35 35
 {
36
-    if ($query->is_main_query() && (
37
-            (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
-            || geodir_is_page('listing')
39
-            || geodir_is_page('author')
40
-            || geodir_is_page('search')
41
-            || geodir_is_page('detail'))
42
-    ) {
43
-
44
-        $query->set('is_geodir_loop', true);
45
-    }
36
+	if ($query->is_main_query() && (
37
+			(geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
+			|| geodir_is_page('listing')
39
+			|| geodir_is_page('author')
40
+			|| geodir_is_page('search')
41
+			|| geodir_is_page('detail'))
42
+	) {
43
+
44
+		$query->set('is_geodir_loop', true);
45
+	}
46 46
 
47
-    return $query;
47
+	return $query;
48 48
 }
49 49
 
50 50
 /**
@@ -67,81 +67,81 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function set_listing_request($query )
69 69
 {
70
-    global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
70
+	global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
71 71
 
72 72
 
73
-    // fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
-    if (!geodir_is_geodir_page()) {
75
-        return;
76
-    }
73
+	// fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
+	if (!geodir_is_geodir_page()) {
75
+		return;
76
+	}
77 77
 
78
-    /* remove all pre filters */
79
-    remove_all_filters('query');
80
-    remove_all_filters('posts_search');
81
-    remove_all_filters('posts_fields');
82
-    remove_all_filters('posts_join');
83
-    remove_all_filters('posts_orderby');
84
-    remove_all_filters('posts_where');
78
+	/* remove all pre filters */
79
+	remove_all_filters('query');
80
+	remove_all_filters('posts_search');
81
+	remove_all_filters('posts_fields');
82
+	remove_all_filters('posts_join');
83
+	remove_all_filters('posts_orderby');
84
+	remove_all_filters('posts_where');
85 85
 
86 86
 
87
-    if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
87
+	if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
88 88
 
89
-        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
-        //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
89
+		if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
+		//if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
91 91
 
92
-        if (isset($_REQUEST['sdist'])) {
93
-            ($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
-        } elseif (get_option('geodir_search_dist') != '') {
95
-            $dist = get_option('geodir_search_dist');
92
+		if (isset($_REQUEST['sdist'])) {
93
+			($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
+		} elseif (get_option('geodir_search_dist') != '') {
95
+			$dist = get_option('geodir_search_dist');
96 96
 
97
-        } else {
98
-            $dist = 25000;
99
-        } //  Distance
97
+		} else {
98
+			$dist = 25000;
99
+		} //  Distance
100 100
 
101
-        if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
-        } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
105
-        } //  Latatude
101
+		if (isset($_REQUEST['sgeo_lat'])) {
102
+			$mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
+		} else {
104
+			$mylat = (float)geodir_get_current_city_lat();
105
+		} //  Latatude
106 106
 
107
-        if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
-        } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
111
-        } //  Distance
107
+		if (isset($_REQUEST['sgeo_lon'])) {
108
+			$mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
+		} else {
110
+			$mylon = (float)geodir_get_current_city_lng();
111
+		} //  Distance
112 112
 
113
-        if (isset($_REQUEST['snear'])) {
114
-            $snear = trim(esc_attr($_REQUEST['snear']));
115
-        }
113
+		if (isset($_REQUEST['snear'])) {
114
+			$snear = trim(esc_attr($_REQUEST['snear']));
115
+		}
116 116
 
117
-        if (isset($_REQUEST['s'])) {
118
-            $s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
-        }
117
+		if (isset($_REQUEST['s'])) {
118
+			$s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
+		}
120 120
 
121
-        if ($snear == 'NEAR ME') {
122
-            $ip = $_SERVER['REMOTE_ADDR'];
123
-            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
-            $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
-            $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
-        }
121
+		if ($snear == 'NEAR ME') {
122
+			$ip = $_SERVER['REMOTE_ADDR'];
123
+			$addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
+			$mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
+			$mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
+		}
127 127
 
128 128
 
129
-        if (strstr($s, ',')) {
130
-            $s_AA = str_replace(" ", "", $s);
131
-            $s_A = explode(",", $s_AA);
132
-            $s_A = implode('","', $s_A);
133
-            $s_A = '"' . $s_A . '"';
134
-        } else {
135
-            $s_A = '"' . $s . '"';
136
-        }
129
+		if (strstr($s, ',')) {
130
+			$s_AA = str_replace(" ", "", $s);
131
+			$s_A = explode(",", $s_AA);
132
+			$s_A = implode('","', $s_A);
133
+			$s_A = '"' . $s_A . '"';
134
+		} else {
135
+			$s_A = '"' . $s . '"';
136
+		}
137 137
 
138
-        if (strstr($s, ' ')) {
139
-            $s_SA = explode(" ", $s);
140
-        } else {
141
-            $s_SA = '';
142
-        }
138
+		if (strstr($s, ' ')) {
139
+			$s_SA = explode(" ", $s);
140
+		} else {
141
+			$s_SA = '';
142
+		}
143 143
 
144
-    endif;
144
+	endif;
145 145
 
146 146
 
147 147
 
@@ -162,56 +162,56 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function geodir_listing_loop_filter($query)
164 164
 {
165
-    global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
165
+	global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
166 166
 
167
-    // fix wp_reset_query for popular post view widget
168
-    if (!geodir_is_geodir_page()) {
169
-        return;
170
-    }
167
+	// fix wp_reset_query for popular post view widget
168
+	if (!geodir_is_geodir_page()) {
169
+		return;
170
+	}
171 171
 
172
-    $geodir_post_type = geodir_get_current_posttype();
173
-
174
-    if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
-        $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
-
177
-        if (isset($wp_query->query[$taxonomies[0]])) {
178
-            $request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
-            $request_term = end($request_term);
180
-            if (!term_exists($request_term)) {
181
-                $args = array('number' => '1',);
182
-                $terms_arr = get_terms($taxonomies[0], $args);
183
-                foreach ($terms_arr as $location_term) {
184
-                    $term_arr = $location_term;
185
-                    $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
-                }
187
-                $wp_query->queried_object_id = 1;
188
-                $wp_query->queried_object = $term_arr;
189
-                //print_r($wp_query) ;
190
-            }
191
-        }
172
+	$geodir_post_type = geodir_get_current_posttype();
173
+
174
+	if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
+		$taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
+
177
+		if (isset($wp_query->query[$taxonomies[0]])) {
178
+			$request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
+			$request_term = end($request_term);
180
+			if (!term_exists($request_term)) {
181
+				$args = array('number' => '1',);
182
+				$terms_arr = get_terms($taxonomies[0], $args);
183
+				foreach ($terms_arr as $location_term) {
184
+					$term_arr = $location_term;
185
+					$term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
+				}
187
+				$wp_query->queried_object_id = 1;
188
+				$wp_query->queried_object = $term_arr;
189
+				//print_r($wp_query) ;
190
+			}
191
+		}
192 192
 
193
-    }
194
-    if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
195
-
196
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
197
-
198
-        add_filter('posts_fields', 'geodir_posts_fields', 1);
199
-        add_filter('posts_join', 'geodir_posts_join', 1);
200
-        geodir_post_where();
201
-        if (!is_admin())
202
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
-
204
-        // advanced filter for popular post view widget
205
-        global $wp_query;
206
-        if (!is_admin()) {
207
-            if (!empty($wp_query->query['with_pics_only'])) {
208
-                add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
-            }
210
-            add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
-        }
193
+	}
194
+	if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
212 195
 
213
-    }
214
-    return $query;
196
+		$table = $plugin_prefix . $geodir_post_type . '_detail';
197
+
198
+		add_filter('posts_fields', 'geodir_posts_fields', 1);
199
+		add_filter('posts_join', 'geodir_posts_join', 1);
200
+		geodir_post_where();
201
+		if (!is_admin())
202
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
+
204
+		// advanced filter for popular post view widget
205
+		global $wp_query;
206
+		if (!is_admin()) {
207
+			if (!empty($wp_query->query['with_pics_only'])) {
208
+				add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
+			}
210
+			add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
+		}
212
+
213
+	}
214
+	return $query;
215 215
 }
216 216
 
217 217
 
@@ -230,67 +230,67 @@  discard block
 block discarded – undo
230 230
  * @return string Modified fields query string.
231 231
  */
232 232
 function geodir_posts_fields($fields) {
233
-    global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
233
+	global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
234 234
 
235
-    // Filter-Location-Manager to add location table.
236
-    $fields .= ", " . $table . ".* ";
235
+	// Filter-Location-Manager to add location table.
236
+	$fields .= ", " . $table . ".* ";
237 237
 
238 238
 	if ($snear != '' || $gd_session->get('all_near_me')) {
239
-        $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
239
+		$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
240 240
 
241 241
 		if ($gd_session->get('all_near_me')) {
242
-            $mylat = $gd_session->get('user_lat');
243
-            $mylon = $gd_session->get('user_lon');
244
-        }
245
-
246
-        $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
-    }
248
-
249
-    global $s;
250
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
-        $keywords = explode(" ", $s);
252
-
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
-                    unset($keywords[$kkey]);
257
-                }
258
-            }
259
-        }
242
+			$mylat = $gd_session->get('user_lat');
243
+			$mylon = $gd_session->get('user_lon');
244
+		}
260 245
 
246
+		$fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
+	}
261 248
 
262
-        if (count($keywords) > 1) {
263
-            $parts = array(
264
-                'AND' => 'gd_alltitlematch_part',
265
-                'OR' => 'gd_titlematch_part'
266
-            );
267
-            $gd_titlematch_part = "";
268
-            foreach ($parts as $key => $part) {
269
-                $gd_titlematch_part .= " CASE WHEN ";
270
-                $count = 0;
271
-                foreach ($keywords as $keyword) {
272
-                    $keyword = trim($keyword);
273
-                    $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
249
+	global $s;
250
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
+		$keywords = explode(" ", $s);
252
+
253
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
+			foreach($keywords as $kkey=>$kword){
255
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
+					unset($keywords[$kkey]);
257
+				}
258
+			}
259
+		}
260
+
261
+
262
+		if (count($keywords) > 1) {
263
+			$parts = array(
264
+				'AND' => 'gd_alltitlematch_part',
265
+				'OR' => 'gd_titlematch_part'
266
+			);
267
+			$gd_titlematch_part = "";
268
+			foreach ($parts as $key => $part) {
269
+				$gd_titlematch_part .= " CASE WHEN ";
270
+				$count = 0;
271
+				foreach ($keywords as $keyword) {
272
+					$keyword = trim($keyword);
273
+					$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
274 274
 					$count++;
275
-                    if ($count < count($keywords)) {
276
-                       // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
275
+					if ($count < count($keywords)) {
276
+					   // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
277 277
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
278
-                    } else {
279
-                        //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
278
+					} else {
279
+						//$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
280 280
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
281
-                    }
282
-                }
283
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
-            }
285
-        } else {
286
-            $gd_titlematch_part = "";
287
-        }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
281
+					}
282
+				}
283
+				$gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
+			}
285
+		} else {
286
+			$gd_titlematch_part = "";
287
+		}
288
+		$s = stripslashes_deep( $s );
289
+		$s = wp_specialchars_decode($s,ENT_QUOTES);
290 290
 		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
291
-    }
291
+	}
292 292
 
293
-    return $fields;
293
+	return $fields;
294 294
 }
295 295
 
296 296
 
@@ -307,26 +307,26 @@  discard block
 block discarded – undo
307 307
  */
308 308
 function geodir_posts_join($join)
309 309
 {
310
-    global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
310
+	global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
311 311
 
312
-    ########### WPML ###########
312
+	########### WPML ###########
313 313
 
314
-    if (function_exists('icl_object_id')) {
315
-        global $sitepress;
316
-        $lang_code = ICL_LANGUAGE_CODE;
317
-        $default_lang_code = $sitepress->get_default_language();
318
-        if ($lang_code) {
319
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
-        }
314
+	if (function_exists('icl_object_id')) {
315
+		global $sitepress;
316
+		$lang_code = ICL_LANGUAGE_CODE;
317
+		$default_lang_code = $sitepress->get_default_language();
318
+		if ($lang_code) {
319
+			$join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
+		}
321 321
 
322
-    }
323
-    ########### WPML ###########
322
+	}
323
+	########### WPML ###########
324 324
 
325
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
-    //===old code start
327
-    //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
325
+	$join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
+	//===old code start
327
+	//$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
328 328
 
329
-    return $join;
329
+	return $join;
330 330
 }
331 331
 
332 332
 
@@ -344,15 +344,15 @@  discard block
 block discarded – undo
344 344
  */
345 345
 function geodir_posts_orderby($orderby)
346 346
 {
347
-    global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
347
+	global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
348 348
 
349
-    $sort_by = '';
350
-    $orderby = ' ';
349
+	$sort_by = '';
350
+	$orderby = ' ';
351 351
 
352
-    if (get_query_var('order_by'))
353
-        $sort_by = get_query_var('order_by');
352
+	if (get_query_var('order_by'))
353
+		$sort_by = get_query_var('order_by');
354 354
 
355
-    /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
355
+	/*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
356 356
         $current_term = $wp_query->get_queried_object();
357 357
     }
358 358
 
@@ -366,123 +366,123 @@  discard block
 block discarded – undo
366 366
     }*/
367 367
 
368 368
 
369
-    if ($snear != '') {
370
-        $orderby .= " distance,";
371
-    }
369
+	if ($snear != '') {
370
+		$orderby .= " distance,";
371
+	}
372 372
 
373
-    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
-        $sort_by = esc_attr($_REQUEST['sort_by']);
373
+	if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
+		$sort_by = esc_attr($_REQUEST['sort_by']);
375 375
 
376 376
 
377
-    if ($sort_by == '') {
378
-        $default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
-        if (!empty($default_sort))
380
-            $sort_by = $default_sort;
381
-    }
377
+	if ($sort_by == '') {
378
+		$default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
+		if (!empty($default_sort))
380
+			$sort_by = $default_sort;
381
+	}
382 382
 
383
-    /*
383
+	/*
384 384
     if search by term & no location then order always "relevance"
385 385
     if search by location then order always "nearest"
386 386
     */
387
-    if (is_main_query() && geodir_is_page('search')) {
388
-        $search_term = get_query_var('s');
387
+	if (is_main_query() && geodir_is_page('search')) {
388
+		$search_term = get_query_var('s');
389 389
 
390
-        if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
-            $sort_by = 'az';
392
-        }
390
+		if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
+			$sort_by = 'az';
392
+		}
393 393
 
394
-        if ($snear != '' &&  $sort_by!='farthest') {
395
-            $sort_by = 'nearest';
396
-        }
397
-    }
394
+		if ($snear != '' &&  $sort_by!='farthest') {
395
+			$sort_by = 'nearest';
396
+		}
397
+	}
398 398
 
399
-    switch ($sort_by):
400
-        case 'newest':
401
-            $orderby = "$wpdb->posts.post_date desc, ";
402
-            break;
403
-        case 'oldest':
404
-            $orderby = "$wpdb->posts.post_date asc, ";
405
-            break;
406
-        case 'low_review':
407
-        case 'rating_count_asc':
408
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
-            break;
410
-        case 'high_review':
411
-        case 'rating_count_desc':
399
+	switch ($sort_by):
400
+		case 'newest':
401
+			$orderby = "$wpdb->posts.post_date desc, ";
402
+			break;
403
+		case 'oldest':
404
+			$orderby = "$wpdb->posts.post_date asc, ";
405
+			break;
406
+		case 'low_review':
407
+		case 'rating_count_asc':
408
+			$orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
+			break;
410
+		case 'high_review':
411
+		case 'rating_count_desc':
412 412
 			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
413
-            break;
414
-        case 'low_rating':
415
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
-            break;
417
-        case 'high_rating':
418
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
-            break;
420
-        case 'featured':
421
-            $orderby = $table . ".is_featured asc, ";
422
-            break;
423
-        case 'nearest':
424
-            $orderby = " distance asc, ";
425
-            break;
426
-        case 'farthest':
427
-            $orderby = " distance desc, ";
428
-            break;
429
-        case 'random':
430
-            $orderby = " rand(), ";
431
-            break;
432
-        case 'az':
433
-            $orderby = "$wpdb->posts.post_title asc, ";
434
-            break;
435
-        // sort by rating
436
-        case 'overall_rating_desc':
437
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
438
-            break;
439
-        case 'overall_rating_asc':
440
-            $orderby = " " . $table . ".overall_rating ASC, " . $table . ".rating_count ASC, ";
441
-            break;
442
-        default:
443
-
444
-            break;
445
-    endswitch;
446
-
447
-    global $s;
448
-
449
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
450
-        $keywords = explode(" ", $s);
451
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
452
-            foreach($keywords as $kkey=>$kword){
453
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
454
-                    unset($keywords[$kkey]);
455
-                }
456
-            }
457
-        }
458
-        if ($sort_by == 'nearest' || $sort_by == 'farthest') {
459
-            if (count($keywords) > 1) {
460
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
461
-            } else {
462
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
463
-            }
464
-        } else {
465
-            if (count($keywords) > 1) {
466
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
467
-            } else {
468
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
469
-            }
470
-        }
471
-    }
413
+			break;
414
+		case 'low_rating':
415
+			$orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
+			break;
417
+		case 'high_rating':
418
+			$orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
+			break;
420
+		case 'featured':
421
+			$orderby = $table . ".is_featured asc, ";
422
+			break;
423
+		case 'nearest':
424
+			$orderby = " distance asc, ";
425
+			break;
426
+		case 'farthest':
427
+			$orderby = " distance desc, ";
428
+			break;
429
+		case 'random':
430
+			$orderby = " rand(), ";
431
+			break;
432
+		case 'az':
433
+			$orderby = "$wpdb->posts.post_title asc, ";
434
+			break;
435
+		// sort by rating
436
+		case 'overall_rating_desc':
437
+			$orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
438
+			break;
439
+		case 'overall_rating_asc':
440
+			$orderby = " " . $table . ".overall_rating ASC, " . $table . ".rating_count ASC, ";
441
+			break;
442
+		default:
443
+
444
+			break;
445
+	endswitch;
446
+
447
+	global $s;
448
+
449
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
450
+		$keywords = explode(" ", $s);
451
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
452
+			foreach($keywords as $kkey=>$kword){
453
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
454
+					unset($keywords[$kkey]);
455
+				}
456
+			}
457
+		}
458
+		if ($sort_by == 'nearest' || $sort_by == 'farthest') {
459
+			if (count($keywords) > 1) {
460
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
461
+			} else {
462
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
463
+			}
464
+		} else {
465
+			if (count($keywords) > 1) {
466
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
467
+			} else {
468
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
469
+			}
470
+		}
471
+	}
472 472
 
473
-    /**
474
-     * Filter order by SQL.
475
-     *
476
-     * @since 1.0.0
477
-     * @param string $orderby The orderby query string.
478
-     * @param string $sort_by Sortby query string.
479
-     * @param string $table Listing table name.
480
-     */
481
-    $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
473
+	/**
474
+	 * Filter order by SQL.
475
+	 *
476
+	 * @since 1.0.0
477
+	 * @param string $orderby The orderby query string.
478
+	 * @param string $sort_by Sortby query string.
479
+	 * @param string $table Listing table name.
480
+	 */
481
+	$orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
482 482
 
483
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
483
+	$orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
484 484
 
485
-    return $orderby;
485
+	return $orderby;
486 486
 }
487 487
 
488 488
 
@@ -500,53 +500,53 @@  discard block
 block discarded – undo
500 500
 function geodir_posts_order_by_custom_sort($orderby, $sort_by, $table)
501 501
 {
502 502
 
503
-    global $wpdb;
503
+	global $wpdb;
504 504
 
505
-    if ($sort_by != '' && (!is_search() || ( isset($_REQUEST['s']) && isset($_REQUEST['snear']) && $_REQUEST['snear']=='' && ( $_REQUEST['s']=='' ||  $_REQUEST['s']==' ') ) )) {
505
+	if ($sort_by != '' && (!is_search() || ( isset($_REQUEST['s']) && isset($_REQUEST['snear']) && $_REQUEST['snear']=='' && ( $_REQUEST['s']=='' ||  $_REQUEST['s']==' ') ) )) {
506 506
 
507
-        $sort_array = explode('_', $sort_by);
507
+		$sort_array = explode('_', $sort_by);
508 508
 
509
-        $sort_by_count = count($sort_array);
509
+		$sort_by_count = count($sort_array);
510 510
 
511
-        $order = $sort_array[$sort_by_count - 1];
511
+		$order = $sort_array[$sort_by_count - 1];
512 512
 
513
-        if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
513
+		if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
514 514
 
515
-            $sort_by = str_replace('_' . $order, '', $sort_by);
515
+			$sort_by = str_replace('_' . $order, '', $sort_by);
516 516
 
517
-            switch ($sort_by):
517
+			switch ($sort_by):
518 518
 
519
-                case 'post_date':
520
-                case 'comment_count':
519
+				case 'post_date':
520
+				case 'comment_count':
521 521
 
522
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
523
-                    break;
522
+					$orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
523
+					break;
524 524
 
525
-                case 'distance':
526
-                    $orderby = $sort_by . " " . $order . ", ";
527
-                    break;
525
+				case 'distance':
526
+					$orderby = $sort_by . " " . $order . ", ";
527
+					break;
528 528
 
529 529
 
530
-                // sort by rating
531
-                case 'overall_rating':
532
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
530
+				// sort by rating
531
+				case 'overall_rating':
532
+					$orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
533 533
 
534
-                    break;
534
+					break;
535 535
 
536 536
 
537
-                default:
538
-                    if (geodir_column_exist($table, $sort_by)) {
537
+				default:
538
+					if (geodir_column_exist($table, $sort_by)) {
539 539
 						$orderby = $table . "." . $sort_by . " " . $order . ", ";
540 540
 					}
541
-                    break;
541
+					break;
542 542
 
543
-            endswitch;
543
+			endswitch;
544 544
 
545
-        }
545
+		}
546 546
 
547
-    }
547
+	}
548 548
 
549
-    return $orderby;
549
+	return $orderby;
550 550
 }
551 551
 
552 552
 /**
@@ -561,34 +561,34 @@  discard block
 block discarded – undo
561 561
 {
562 562
 
563 563
 
564
-    global $wpdb, $geodir_post_type, $table, $s, $snear;
564
+	global $wpdb, $geodir_post_type, $table, $s, $snear;
565 565
 
566
-    if (!is_admin()) {
566
+	if (!is_admin()) {
567 567
 
568
-        if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
569
-            add_filter('posts_where', 'geodir_edit_listing_where', 1);
568
+		if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
569
+			add_filter('posts_where', 'geodir_edit_listing_where', 1);
570 570
 
571
-        } elseif ((is_search() && $_REQUEST['geodir_search'])) {
571
+		} elseif ((is_search() && $_REQUEST['geodir_search'])) {
572 572
 
573
-            add_filter('posts_where', 'searching_filter_where', 1);
573
+			add_filter('posts_where', 'searching_filter_where', 1);
574 574
 
575
-            if ($snear != '')
576
-                add_filter('posts_where', 'searching_filter_where', 1);
575
+			if ($snear != '')
576
+				add_filter('posts_where', 'searching_filter_where', 1);
577 577
 
578
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
578
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
579 579
 
580
-        } elseif (geodir_is_page('author')) {
580
+		} elseif (geodir_is_page('author')) {
581 581
 
582
-            add_filter('posts_where', 'author_filter_where', 1);
582
+			add_filter('posts_where', 'author_filter_where', 1);
583 583
 
584
-        }
584
+		}
585 585
 
586
-        //if (!geodir_is_page('detail'))
587
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
586
+		//if (!geodir_is_page('detail'))
587
+			add_filter('posts_where', 'geodir_default_where', 1);/**/
588 588
 
589
-        //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
589
+		//add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
590 590
 
591
-    }
591
+	}
592 592
 }
593 593
 
594 594
 /**
@@ -603,13 +603,13 @@  discard block
 block discarded – undo
603 603
  */
604 604
 function geodir_preview_post_cap($allcaps, $caps, $args)
605 605
 {
606
-    $user_id = get_current_user_id();
607
-    if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
606
+	$user_id = get_current_user_id();
607
+	if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
608 608
 
609
-        $allcaps['edit_posts'] = true;
610
-    }
611
-    //print_r($allcaps);
612
-    return $allcaps;
609
+		$allcaps['edit_posts'] = true;
610
+	}
611
+	//print_r($allcaps);
612
+	return $allcaps;
613 613
 }
614 614
 
615 615
 
@@ -624,9 +624,9 @@  discard block
 block discarded – undo
624 624
  */
625 625
 function geodir_edit_listing_where($where)
626 626
 {
627
-    global $wpdb;
628
-    $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
629
-    return $where;
627
+	global $wpdb;
628
+	$where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
629
+	return $where;
630 630
 }
631 631
 
632 632
 
@@ -643,29 +643,29 @@  discard block
 block discarded – undo
643 643
  */
644 644
 function geodir_default_where($where)
645 645
 {
646
-    global $wp_query, $wpdb;
647
-
648
-    //print_r($wp_query);
649
-    ########### WPML ###########
650
-
651
-    if (function_exists('icl_object_id')) {
652
-        global $sitepress, $table_prefix;
653
-        $lang_code = ICL_LANGUAGE_CODE;
654
-        $default_lang_code = $sitepress->get_default_language();
655
-        $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
656
-        //echo '##########'.$q_post_type;
657
-        if ($lang_code && $q_post_type) {
658
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
659
-            //$where .= " AND icl_t.language_code = '$lang_code' ";
660
-        }
646
+	global $wp_query, $wpdb;
661 647
 
662
-    }
663
-    ########### WPML ###########
648
+	//print_r($wp_query);
649
+	########### WPML ###########
664 650
 
651
+	if (function_exists('icl_object_id')) {
652
+		global $sitepress, $table_prefix;
653
+		$lang_code = ICL_LANGUAGE_CODE;
654
+		$default_lang_code = $sitepress->get_default_language();
655
+		$q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
656
+		//echo '##########'.$q_post_type;
657
+		if ($lang_code && $q_post_type) {
658
+			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
659
+			//$where .= " AND icl_t.language_code = '$lang_code' ";
660
+		}
665 661
 
666
-    return $where = str_replace("0 = 1", "1=1", $where);
662
+	}
663
+	########### WPML ###########
667 664
 
668
-    /* ====== old code start ===
665
+
666
+	return $where = str_replace("0 = 1", "1=1", $where);
667
+
668
+	/* ====== old code start ===
669 669
     $where = str_replace("0 = 1", "1=1", $where);
670 670
     $country = get_query_var('gd_country');
671 671
     $region = get_query_var('gd_region');
@@ -706,108 +706,108 @@  discard block
 block discarded – undo
706 706
  * @return string Modified where query string.
707 707
  */
708 708
 function searching_filter_where($where) {
709
-    global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
709
+	global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
710 710
 
711
-    $search_term = 'OR';
712
-    $search_term = 'AND';
713
-    $geodir_custom_search = '';
714
-    $category_search_range = '';
711
+	$search_term = 'OR';
712
+	$search_term = 'AND';
713
+	$geodir_custom_search = '';
714
+	$category_search_range = '';
715 715
 
716
-    if (is_single() && get_query_var('post_type')) {
716
+	if (is_single() && get_query_var('post_type')) {
717 717
 		return $where;
718 718
 	}
719 719
 
720
-    if (is_tax()) {
720
+	if (is_tax()) {
721 721
 		return $where;
722 722
 	}
723 723
 
724 724
 	$s = trim($s);
725
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
726
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
727
-
728
-    $where = '';
729
-    $better_search_terms = '';
730
-    if (isset($_REQUEST['stype']))
731
-        $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
732
-    else
733
-        $post_types = 'gd_place';
734
-
735
-    if ($s != '') {
736
-        $keywords = explode(" ", $s);
737
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
738
-            foreach($keywords as $kkey=>$kword){
739
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
740
-                    unset($keywords[$kkey]);
741
-                }
742
-            }
743
-        }
725
+	$s  = wp_specialchars_decode($s ,ENT_QUOTES);
726
+	$s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
744 727
 
745
-        if (!empty($keywords)) {
746
-            foreach ($keywords as $keyword) {
747
-                $keyword = trim($keyword);
748
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
749
-                if ($keyword != '') {
750
-                    /**
751
-                     * Filter the search query keywords SQL.
752
-                     *
753
-                     * @since 1.5.9
754
-                     * @package GeoDirectory
755
-                     * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
756
-                     * @param array $keywords The array of keywords for the query.
757
-                     * @param string $keyword The single keyword being searched.
758
-                     */
728
+	$where = '';
729
+	$better_search_terms = '';
730
+	if (isset($_REQUEST['stype']))
731
+		$post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
732
+	else
733
+		$post_types = 'gd_place';
734
+
735
+	if ($s != '') {
736
+		$keywords = explode(" ", $s);
737
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
738
+			foreach($keywords as $kkey=>$kword){
739
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
740
+					unset($keywords[$kkey]);
741
+				}
742
+			}
743
+		}
744
+
745
+		if (!empty($keywords)) {
746
+			foreach ($keywords as $keyword) {
747
+				$keyword = trim($keyword);
748
+				$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
749
+				if ($keyword != '') {
750
+					/**
751
+					 * Filter the search query keywords SQL.
752
+					 *
753
+					 * @since 1.5.9
754
+					 * @package GeoDirectory
755
+					 * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
756
+					 * @param array $keywords The array of keywords for the query.
757
+					 * @param string $keyword The single keyword being searched.
758
+					 */
759 759
 					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
760
-                }
761
-            }
762
-        }
763
-    }
760
+				}
761
+			}
762
+		}
763
+	}
764 764
 
765
-    /* get taxonomy */
766
-    $taxonomies = geodir_get_taxonomies($post_types, true);
767
-    if($taxonomies) {
768
-        $taxonomies = implode("','", $taxonomies);
769
-        $taxonomies = "'" . $taxonomies . "'";
770
-    }else{$taxonomies='';}
765
+	/* get taxonomy */
766
+	$taxonomies = geodir_get_taxonomies($post_types, true);
767
+	if($taxonomies) {
768
+		$taxonomies = implode("','", $taxonomies);
769
+		$taxonomies = "'" . $taxonomies . "'";
770
+	}else{$taxonomies='';}
771 771
 
772
-    $content_where = $terms_where = '';
772
+	$content_where = $terms_where = '';
773 773
 	if ($s != '') {
774
-        /**
775
-         * Filter the search query content where values.
776
-         *
777
-         * @since 1.5.0
778
-         * @package GeoDirectory
779
-         * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
780
-         */
774
+		/**
775
+		 * Filter the search query content where values.
776
+		 *
777
+		 * @since 1.5.0
778
+		 * @package GeoDirectory
779
+		 * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
780
+		 */
781 781
 		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
782
-        /**
783
-         * Filter the search query term values.
784
-         *
785
-         * @since 1.5.0
786
-         * @package GeoDirectory
787
-         * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
788
-         */
789
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
782
+		/**
783
+		 * Filter the search query term values.
784
+		 *
785
+		 * @since 1.5.0
786
+		 * @package GeoDirectory
787
+		 * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
788
+		 */
789
+		$terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
790 790
 	}
791 791
 
792
-    if ($snear != '') {
792
+	if ($snear != '') {
793 793
 
794 794
 
795
-        if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
796
-            $dist = $gd_session->get('near_me_range');
797
-        }
798
-        $lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
799
-        $lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
800
-        $lat1 = $mylat - ($dist / 69);
801
-        $lat2 = $mylat + ($dist / 69);
795
+		if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
796
+			$dist = $gd_session->get('near_me_range');
797
+		}
798
+		$lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
799
+		$lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
800
+		$lat1 = $mylat - ($dist / 69);
801
+		$lat2 = $mylat + ($dist / 69);
802 802
 
803
-        $rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
804
-        $rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
805
-        $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
806
-        $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
803
+		$rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
804
+		$rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
805
+		$rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
806
+		$rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
807 807
 
808 808
 
809 809
 
810
-	    $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
810
+		$where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
811 811
 			                    $content_where 
812 812
 								OR ($wpdb->posts.ID IN( 
813 813
 										SELECT $wpdb->term_relationships.object_id as post_id 
@@ -824,13 +824,13 @@  discard block
 block discarded – undo
824 824
 						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
825 825
 						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
826 826
 
827
-        if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
828
-            $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
829
-            $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
830
-        }
827
+		if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
828
+			$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
829
+			$where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
830
+		}
831 831
 
832
-    } else {
833
-        $where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
832
+	} else {
833
+		$where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
834 834
                             $content_where  
835 835
 							OR ( $wpdb->posts.ID IN(	
836 836
 									SELECT $wpdb->term_relationships.object_id as post_id                     
@@ -844,19 +844,19 @@  discard block
 block discarded – undo
844 844
 					) 
845 845
 				AND $wpdb->posts.post_type in ('$post_types')
846 846
 				AND ($wpdb->posts.post_status = 'publish') ";
847
-    }
847
+	}
848 848
 
849 849
 	########### WPML ###########
850
-    if ( function_exists( 'icl_object_id' ) ) {
850
+	if ( function_exists( 'icl_object_id' ) ) {
851 851
 		$lang_code = ICL_LANGUAGE_CODE;
852 852
 
853 853
 		if ($lang_code && $post_types) {
854
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
855
-        }
856
-    }
857
-    ########### WPML ###########
854
+			$where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
855
+		}
856
+	}
857
+	########### WPML ###########
858 858
 
859
-    return $where;
859
+	return $where;
860 860
 }
861 861
 
862 862
 
@@ -871,45 +871,45 @@  discard block
 block discarded – undo
871 871
  * @return string Modified where query string.
872 872
  */
873 873
 function author_filter_where($where) {
874
-    global $wpdb, $geodir_post_type, $table, $curr;
874
+	global $wpdb, $geodir_post_type, $table, $curr;
875 875
 
876
-    $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
877
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
876
+	$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
877
+	$user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
878 878
 
879
-    if (isset($_REQUEST['stype'])) {
880
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
881
-    } else {
882
-        $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
883
-    }
879
+	if (isset($_REQUEST['stype'])) {
880
+		$where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
881
+	} else {
882
+		$where = " AND $wpdb->posts.post_type IN ('gd_place') ";
883
+	}
884 884
 
885
-    if ($user_id > 0) {
886
-        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
887
-            $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
888
-            $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
889
-            $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
890
-        } else
891
-            $where .= " AND $wpdb->posts.post_author = $user_id";
892
-
893
-        if ($user_id == (int)get_current_user_id()) {
894
-            $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
895
-        } else {
896
-            $where .= " AND $wpdb->posts.post_status = 'publish' ";
897
-        }
898
-    } else {
899
-        $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
900
-    }
885
+	if ($user_id > 0) {
886
+		if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
887
+			$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
888
+			$user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
889
+			$where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
890
+		} else
891
+			$where .= " AND $wpdb->posts.post_author = $user_id";
892
+
893
+		if ($user_id == (int)get_current_user_id()) {
894
+			$where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
895
+		} else {
896
+			$where .= " AND $wpdb->posts.post_status = 'publish' ";
897
+		}
898
+	} else {
899
+		$where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
900
+	}
901 901
 
902
-    ########### WPML ###########
903
-    if (function_exists('icl_object_id')) {
904
-        $lang_code = ICL_LANGUAGE_CODE;
905
-        if ($lang_code) {
906
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
907
-        }
902
+	########### WPML ###########
903
+	if (function_exists('icl_object_id')) {
904
+		$lang_code = ICL_LANGUAGE_CODE;
905
+		if ($lang_code) {
906
+			$where .= " AND icl_t.language_code='" . $lang_code . "' ";
907
+		}
908 908
 
909
-    }
910
-    ########### WPML ###########
909
+	}
910
+	########### WPML ###########
911 911
 
912
-    return $where;
912
+	return $where;
913 913
 }
914 914
 
915 915
 /**
@@ -924,11 +924,11 @@  discard block
 block discarded – undo
924 924
  */
925 925
 function geodir_filter_widget_join($join)
926 926
 {
927
-    global $wp_query, $table;
928
-    if (!empty($wp_query->query['with_pics_only'])) {
929
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
930
-    }
931
-    return $join;
927
+	global $wp_query, $table;
928
+	if (!empty($wp_query->query['with_pics_only'])) {
929
+		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
930
+	}
931
+	return $join;
932 932
 }
933 933
 
934 934
 /**
@@ -943,42 +943,42 @@  discard block
 block discarded – undo
943 943
  */
944 944
 function geodir_filter_widget_where($where)
945 945
 {
946
-    global $wp_query, $table;
947
-    if (!empty($wp_query->query['show_featured_only'])) {
948
-        $where .= " AND " . $table . ".is_featured = '1'";
949
-    }
950
-    if (!empty($wp_query->query['show_special_only'])) {
951
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
952
-    }
953
-    if (!empty($wp_query->query['with_pics_only'])) {
954
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
955
-    }
956
-    if (!empty($wp_query->query['with_videos_only'])) {
957
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
958
-    }
959
-    return $where;
946
+	global $wp_query, $table;
947
+	if (!empty($wp_query->query['show_featured_only'])) {
948
+		$where .= " AND " . $table . ".is_featured = '1'";
949
+	}
950
+	if (!empty($wp_query->query['show_special_only'])) {
951
+		$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
952
+	}
953
+	if (!empty($wp_query->query['with_pics_only'])) {
954
+		$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
955
+	}
956
+	if (!empty($wp_query->query['with_videos_only'])) {
957
+		$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
958
+	}
959
+	return $where;
960 960
 }
961 961
 
962 962
 
963 963
 function geodir_related_posts_fields($fields) {
964
-    global $wp_query, $wpdb, $table, $post;
964
+	global $wp_query, $wpdb, $table, $post;
965 965
 
966
-    $fields .= ", " . $table . ".* ";
966
+	$fields .= ", " . $table . ".* ";
967 967
 
968
-    $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
968
+	$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
969 969
 
970
-    $mylat = $post->post_latitude;
971
-    $mylon = $post->post_longitude;
970
+	$mylat = $post->post_latitude;
971
+	$mylon = $post->post_longitude;
972 972
 
973
-    $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
974
-    return $fields;
973
+	$fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
974
+	return $fields;
975 975
 }
976 976
 function geodir_related_posts_fields_filter($query) {
977
-    if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
978
-        && isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
979
-        && isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
980
-    ) {
981
-        add_filter('posts_fields', 'geodir_related_posts_fields', 1);
982
-    }
977
+	if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
978
+		&& isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
979
+		&& isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
980
+	) {
981
+		add_filter('posts_fields', 'geodir_related_posts_fields', 1);
982
+	}
983 983
 }
984 984
 add_action('pre_get_posts', 'geodir_related_posts_fields_filter', 1);
985 985
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
  * @global string $s_A Extra parameters.
66 66
  * @global string $s_SA Extra parameters.
67 67
  */
68
-function set_listing_request($query )
68
+function set_listing_request($query)
69 69
 {
70 70
     global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
71 71
 
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
         } //  Distance
100 100
 
101 101
         if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
102
+            $mylat = (float) esc_attr($_REQUEST['sgeo_lat']);
103 103
         } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
104
+            $mylat = (float) geodir_get_current_city_lat();
105 105
         } //  Latatude
106 106
 
107 107
         if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
108
+            $mylon = (float) esc_attr($_REQUEST['sgeo_lon']);
109 109
         } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
110
+            $mylon = (float) geodir_get_current_city_lng();
111 111
         } //  Distance
112 112
 
113 113
         if (isset($_REQUEST['snear'])) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         if ($snear == 'NEAR ME') {
122 122
             $ip = $_SERVER['REMOTE_ADDR'];
123
-            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
123
+            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip));
124 124
             $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125 125
             $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126 126
         }
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
             $s_AA = str_replace(" ", "", $s);
131 131
             $s_A = explode(",", $s_AA);
132 132
             $s_A = implode('","', $s_A);
133
-            $s_A = '"' . $s_A . '"';
133
+            $s_A = '"'.$s_A.'"';
134 134
         } else {
135
-            $s_A = '"' . $s . '"';
135
+            $s_A = '"'.$s.'"';
136 136
         }
137 137
 
138 138
         if (strstr($s, ' ')) {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     }
194 194
     if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
195 195
 
196
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
196
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
197 197
 
198 198
         add_filter('posts_fields', 'geodir_posts_fields', 1);
199 199
         add_filter('posts_join', 'geodir_posts_join', 1);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
234 234
 
235 235
     // Filter-Location-Manager to add location table.
236
-    $fields .= ", " . $table . ".* ";
236
+    $fields .= ", ".$table.".* ";
237 237
 
238 238
 	if ($snear != '' || $gd_session->get('all_near_me')) {
239 239
         $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
@@ -243,16 +243,16 @@  discard block
 block discarded – undo
243 243
             $mylon = $gd_session->get('user_lon');
244 244
         }
245 245
 
246
-        $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
246
+        $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247 247
     }
248 248
 
249 249
     global $s;
250 250
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251 251
         $keywords = explode(" ", $s);
252 252
 
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
253
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
254
+            foreach ($keywords as $kkey=>$kword) {
255
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
256 256
                     unset($keywords[$kkey]);
257 257
                 }
258 258
             }
@@ -270,24 +270,24 @@  discard block
 block discarded – undo
270 270
                 $count = 0;
271 271
                 foreach ($keywords as $keyword) {
272 272
                     $keyword = trim($keyword);
273
-                    $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
273
+                    $keyword = wp_specialchars_decode($keyword, ENT_QUOTES);
274 274
 					$count++;
275 275
                     if ($count < count($keywords)) {
276 276
                        // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
277
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
277
+						$gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ".$key." ";
278 278
                     } else {
279 279
                         //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
280
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
280
+						$gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ";
281 281
                     }
282 282
                 }
283
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
283
+                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS ".$part.",";
284 284
             }
285 285
         } else {
286 286
             $gd_titlematch_part = "";
287 287
         }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
290
-		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
288
+        $s = stripslashes_deep($s);
289
+        $s = wp_specialchars_decode($s, ENT_QUOTES);
290
+		$fields .= $wpdb->prepare(", CASE WHEN ".$table.".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN ".$wpdb->posts.".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle,".$gd_titlematch_part." CASE WHEN ( ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s.'%', '% '.$s.'%', $s, $s.' %', '% '.$s.' %', '% '.$s));
291 291
     }
292 292
 
293 293
     return $fields;
@@ -316,13 +316,13 @@  discard block
 block discarded – undo
316 316
         $lang_code = ICL_LANGUAGE_CODE;
317 317
         $default_lang_code = $sitepress->get_default_language();
318 318
         if ($lang_code) {
319
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
319
+            $join .= "JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID";
320 320
         }
321 321
 
322 322
     }
323 323
     ########### WPML ###########
324 324
 
325
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
325
+    $join .= " INNER JOIN ".$table." ON (".$table.".post_id = $wpdb->posts.ID)  ";
326 326
     //===old code start
327 327
     //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
328 328
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
             $sort_by = 'az';
392 392
         }
393 393
 
394
-        if ($snear != '' &&  $sort_by!='farthest') {
394
+        if ($snear != '' && $sort_by != 'farthest') {
395 395
             $sort_by = 'nearest';
396 396
         }
397 397
     }
@@ -405,20 +405,20 @@  discard block
 block discarded – undo
405 405
             break;
406 406
         case 'low_review':
407 407
         case 'rating_count_asc':
408
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
408
+            $orderby = $table.".rating_count ASC, ".$table.".overall_rating ASC, ";
409 409
             break;
410 410
         case 'high_review':
411 411
         case 'rating_count_desc':
412
-			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
412
+			$orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, ";
413 413
             break;
414 414
         case 'low_rating':
415
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
415
+            $orderby = "( ".$table.".overall_rating  ) ASC, ".$table.".rating_count ASC,  ";
416 416
             break;
417 417
         case 'high_rating':
418
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
418
+            $orderby = " ".$table.".overall_rating DESC, ".$table.".rating_count DESC, ";
419 419
             break;
420 420
         case 'featured':
421
-            $orderby = $table . ".is_featured asc, ";
421
+            $orderby = $table.".is_featured asc, ";
422 422
             break;
423 423
         case 'nearest':
424 424
             $orderby = " distance asc, ";
@@ -434,10 +434,10 @@  discard block
 block discarded – undo
434 434
             break;
435 435
         // sort by rating
436 436
         case 'overall_rating_desc':
437
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
437
+            $orderby = " ".$table.".overall_rating DESC, ".$table.".rating_count DESC, ";
438 438
             break;
439 439
         case 'overall_rating_asc':
440
-            $orderby = " " . $table . ".overall_rating ASC, " . $table . ".rating_count ASC, ";
440
+            $orderby = " ".$table.".overall_rating ASC, ".$table.".rating_count ASC, ";
441 441
             break;
442 442
         default:
443 443
 
@@ -448,24 +448,24 @@  discard block
 block discarded – undo
448 448
 
449 449
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
450 450
         $keywords = explode(" ", $s);
451
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
452
-            foreach($keywords as $kkey=>$kword){
453
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
451
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
452
+            foreach ($keywords as $kkey=>$kword) {
453
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
454 454
                     unset($keywords[$kkey]);
455 455
                 }
456 456
             }
457 457
         }
458 458
         if ($sort_by == 'nearest' || $sort_by == 'farthest') {
459 459
             if (count($keywords) > 1) {
460
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
460
+                $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
461 461
             } else {
462
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
462
+                $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
463 463
             }
464 464
         } else {
465 465
             if (count($keywords) > 1) {
466
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
466
+                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ".$orderby;
467 467
             } else {
468
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
468
+                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ".$orderby;
469 469
             }
470 470
         }
471 471
     }
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
      */
481 481
     $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
482 482
 
483
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
483
+    $orderby .= $table.".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
484 484
 
485 485
     return $orderby;
486 486
 }
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 
503 503
     global $wpdb;
504 504
 
505
-    if ($sort_by != '' && (!is_search() || ( isset($_REQUEST['s']) && isset($_REQUEST['snear']) && $_REQUEST['snear']=='' && ( $_REQUEST['s']=='' ||  $_REQUEST['s']==' ') ) )) {
505
+    if ($sort_by != '' && (!is_search() || (isset($_REQUEST['s']) && isset($_REQUEST['snear']) && $_REQUEST['snear'] == '' && ($_REQUEST['s'] == '' || $_REQUEST['s'] == ' ')))) {
506 506
 
507 507
         $sort_array = explode('_', $sort_by);
508 508
 
@@ -512,31 +512,31 @@  discard block
 block discarded – undo
512 512
 
513 513
         if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
514 514
 
515
-            $sort_by = str_replace('_' . $order, '', $sort_by);
515
+            $sort_by = str_replace('_'.$order, '', $sort_by);
516 516
 
517 517
             switch ($sort_by):
518 518
 
519 519
                 case 'post_date':
520 520
                 case 'comment_count':
521 521
 
522
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
522
+                    $orderby = "$wpdb->posts.".$sort_by." ".$order.", ".$table.".overall_rating ".$order.", ";
523 523
                     break;
524 524
 
525 525
                 case 'distance':
526
-                    $orderby = $sort_by . " " . $order . ", ";
526
+                    $orderby = $sort_by." ".$order.", ";
527 527
                     break;
528 528
 
529 529
 
530 530
                 // sort by rating
531 531
                 case 'overall_rating':
532
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
532
+                    $orderby = " ".$table.".".$sort_by."  ".$order.", ".$table.".rating_count ".$order.", ";
533 533
 
534 534
                     break;
535 535
 
536 536
 
537 537
                 default:
538 538
                     if (geodir_column_exist($table, $sort_by)) {
539
-						$orderby = $table . "." . $sort_by . " " . $order . ", ";
539
+						$orderby = $table.".".$sort_by." ".$order.", ";
540 540
 					}
541 541
                     break;
542 542
 
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
         }
585 585
 
586 586
         //if (!geodir_is_page('detail'))
587
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
587
+            add_filter('posts_where', 'geodir_default_where', 1); /**/
588 588
 
589 589
         //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
590 590
 
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
         $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
656 656
         //echo '##########'.$q_post_type;
657 657
         if ($lang_code && $q_post_type) {
658
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
658
+            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_".$q_post_type."') ";
659 659
             //$where .= " AND icl_t.language_code = '$lang_code' ";
660 660
         }
661 661
 
@@ -722,8 +722,8 @@  discard block
 block discarded – undo
722 722
 	}
723 723
 
724 724
 	$s = trim($s);
725
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
726
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
725
+    $s = wp_specialchars_decode($s, ENT_QUOTES);
726
+    $s_A = wp_specialchars_decode($s_A, ENT_QUOTES);
727 727
 
728 728
     $where = '';
729 729
     $better_search_terms = '';
@@ -734,9 +734,9 @@  discard block
 block discarded – undo
734 734
 
735 735
     if ($s != '') {
736 736
         $keywords = explode(" ", $s);
737
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
738
-            foreach($keywords as $kkey=>$kword){
739
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
737
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
738
+            foreach ($keywords as $kkey=>$kword) {
739
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
740 740
                     unset($keywords[$kkey]);
741 741
                 }
742 742
             }
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
         if (!empty($keywords)) {
746 746
             foreach ($keywords as $keyword) {
747 747
                 $keyword = trim($keyword);
748
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
748
+                $keyword = wp_specialchars_decode($keyword, ENT_QUOTES);
749 749
                 if ($keyword != '') {
750 750
                     /**
751 751
                      * Filter the search query keywords SQL.
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
                      * @param array $keywords The array of keywords for the query.
757 757
                      * @param string $keyword The single keyword being searched.
758 758
                      */
759
-					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
759
+					$better_search_terms .= apply_filters("geodir_search_better_search_terms", ' OR ( '.$wpdb->posts.'.post_title LIKE "'.$keyword.'" OR '.$wpdb->posts.'.post_title LIKE "'.$keyword.'%" OR '.$wpdb->posts.'.post_title LIKE "% '.$keyword.'%" )', $keywords, $keyword);
760 760
                 }
761 761
             }
762 762
         }
@@ -764,10 +764,10 @@  discard block
 block discarded – undo
764 764
 
765 765
     /* get taxonomy */
766 766
     $taxonomies = geodir_get_taxonomies($post_types, true);
767
-    if($taxonomies) {
767
+    if ($taxonomies) {
768 768
         $taxonomies = implode("','", $taxonomies);
769
-        $taxonomies = "'" . $taxonomies . "'";
770
-    }else{$taxonomies='';}
769
+        $taxonomies = "'".$taxonomies."'";
770
+    } else {$taxonomies = ''; }
771 771
 
772 772
     $content_where = $terms_where = '';
773 773
 	if ($s != '') {
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
          * @package GeoDirectory
779 779
          * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
780 780
          */
781
-		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
781
+		$content_where = apply_filters("geodir_search_content_where", " OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
782 782
         /**
783 783
          * Filter the search query term values.
784 784
          *
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
          * @package GeoDirectory
787 787
          * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
788 788
          */
789
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
789
+        $terms_where = apply_filters("geodir_search_terms_where", " AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
790 790
 	}
791 791
 
792 792
     if ($snear != '') {
@@ -821,12 +821,12 @@  discard block
 block discarded – undo
821 821
 							)
822 822
 						AND $wpdb->posts.post_type in ('{$post_types}')
823 823
 						AND ($wpdb->posts.post_status = 'publish')
824
-						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
825
-						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
824
+						AND ( ".$table.".post_latitude between $rlat1 and $rlat2 )
825
+						AND ( ".$table.".post_longitude between $rlon1 and $rlon2 ) ";
826 826
 
827 827
         if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
828 828
             $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
829
-            $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
829
+            $where .= " AND CONVERT((".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= ".$dist;
830 830
         }
831 831
 
832 832
     } else {
@@ -847,11 +847,11 @@  discard block
 block discarded – undo
847 847
     }
848 848
 
849 849
 	########### WPML ###########
850
-    if ( function_exists( 'icl_object_id' ) ) {
850
+    if (function_exists('icl_object_id')) {
851 851
 		$lang_code = ICL_LANGUAGE_CODE;
852 852
 
853 853
 		if ($lang_code && $post_types) {
854
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
854
+            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_".$post_types."') ";
855 855
         }
856 856
     }
857 857
     ########### WPML ###########
@@ -874,10 +874,10 @@  discard block
 block discarded – undo
874 874
     global $wpdb, $geodir_post_type, $table, $curr;
875 875
 
876 876
     $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
877
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
877
+    $user_id = !empty($curauth->ID) ? (int) $curauth->ID : 0;
878 878
 
879 879
     if (isset($_REQUEST['stype'])) {
880
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
880
+        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ", $_REQUEST['stype']);
881 881
     } else {
882 882
         $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
883 883
     }
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
         } else
891 891
             $where .= " AND $wpdb->posts.post_author = $user_id";
892 892
 
893
-        if ($user_id == (int)get_current_user_id()) {
893
+        if ($user_id == (int) get_current_user_id()) {
894 894
             $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
895 895
         } else {
896 896
             $where .= " AND $wpdb->posts.post_status = 'publish' ";
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
     if (function_exists('icl_object_id')) {
904 904
         $lang_code = ICL_LANGUAGE_CODE;
905 905
         if ($lang_code) {
906
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
906
+            $where .= " AND icl_t.language_code='".$lang_code."' ";
907 907
         }
908 908
 
909 909
     }
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 {
927 927
     global $wp_query, $table;
928 928
     if (!empty($wp_query->query['with_pics_only'])) {
929
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
929
+        $join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )";
930 930
     }
931 931
     return $join;
932 932
 }
@@ -945,16 +945,16 @@  discard block
 block discarded – undo
945 945
 {
946 946
     global $wp_query, $table;
947 947
     if (!empty($wp_query->query['show_featured_only'])) {
948
-        $where .= " AND " . $table . ".is_featured = '1'";
948
+        $where .= " AND ".$table.".is_featured = '1'";
949 949
     }
950 950
     if (!empty($wp_query->query['show_special_only'])) {
951
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
951
+        $where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )";
952 952
     }
953 953
     if (!empty($wp_query->query['with_pics_only'])) {
954
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
954
+        $where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL GROUP BY ".$table.".post_id";
955 955
     }
956 956
     if (!empty($wp_query->query['with_videos_only'])) {
957
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
957
+        $where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )";
958 958
     }
959 959
     return $where;
960 960
 }
@@ -963,18 +963,18 @@  discard block
 block discarded – undo
963 963
 function geodir_related_posts_fields($fields) {
964 964
     global $wp_query, $wpdb, $table, $post;
965 965
 
966
-    $fields .= ", " . $table . ".* ";
966
+    $fields .= ", ".$table.".* ";
967 967
 
968 968
     $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
969 969
 
970 970
     $mylat = $post->post_latitude;
971 971
     $mylon = $post->post_longitude;
972 972
 
973
-    $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
973
+    $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
974 974
     return $fields;
975 975
 }
976 976
 function geodir_related_posts_fields_filter($query) {
977
-    if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
977
+    if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
978 978
         && isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
979 979
         && isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
980 980
     ) {
Please login to merge, or discard this patch.
geodirectory-functions/general_functions.php 1 patch
Spacing   +1344 added lines, -1344 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 /**
11 11
  * Get All Plugin functions from WordPress
12 12
  */
13
-include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
13
+include_once(ABSPATH.'wp-admin/includes/plugin.php');
14 14
 
15 15
 /*-----------------------------------------------------------------------------------*/
16 16
 /* Helper functions */
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function geodir_plugin_url() {
29 29
 
30
-	if ( is_ssl() ) :
31
-		return str_replace( 'http://', 'https://', WP_PLUGIN_URL ) . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
30
+	if (is_ssl()) :
31
+		return str_replace('http://', 'https://', WP_PLUGIN_URL)."/".plugin_basename(dirname(dirname(__FILE__)));
32 32
 	else :
33
-		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
33
+		return WP_PLUGIN_URL."/".plugin_basename(dirname(dirname(__FILE__)));
34 34
 	endif;
35 35
 }
36 36
 
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
  * @return string example url eg: /home/geo/public_html/wp-content/plugins/geodirectory
46 46
  */
47 47
 function geodir_plugin_path() {
48
-	if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
49
-		return dirname( dirname( __FILE__ ) );
48
+	if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) {
49
+		return dirname(dirname(__FILE__));
50 50
 	} else {
51
-		return WP_PLUGIN_DIR . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
51
+		return WP_PLUGIN_DIR."/".plugin_basename(dirname(dirname(__FILE__)));
52 52
 	}
53 53
 }
54 54
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
  * @return bool true or false.
64 64
  * @todo    check if this is faster than normal WP check and remove if not.
65 65
  */
66
-function geodir_is_plugin_active( $plugin ) {
67
-	$active_plugins = get_option( 'active_plugins' );
68
-	foreach ( $active_plugins as $key => $active_plugin ) {
69
-		if ( strstr( $active_plugin, $plugin ) ) {
66
+function geodir_is_plugin_active($plugin) {
67
+	$active_plugins = get_option('active_plugins');
68
+	foreach ($active_plugins as $key => $active_plugin) {
69
+		if (strstr($active_plugin, $plugin)) {
70 70
 			return true;
71 71
 		}
72 72
 	}
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
  *
89 89
  * @return bool|int|string the formatted date.
90 90
  */
91
-function geodir_get_formated_date( $date ) {
92
-	return mysql2date( get_option( 'date_format' ), $date );
91
+function geodir_get_formated_date($date) {
92
+	return mysql2date(get_option('date_format'), $date);
93 93
 }
94 94
 
95 95
 /**
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
  *
106 106
  * @return bool|int|string the formatted time.
107 107
  */
108
-function geodir_get_formated_time( $time ) {
109
-	return mysql2date( get_option( 'time_format' ), $time, $translate = true );
108
+function geodir_get_formated_time($time) {
109
+	return mysql2date(get_option('time_format'), $time, $translate = true);
110 110
 }
111 111
 
112 112
 
@@ -124,35 +124,35 @@  discard block
 block discarded – undo
124 124
  *
125 125
  * @return string Formatted link.
126 126
  */
127
-function geodir_getlink( $url, $params = array(), $use_existing_arguments = false ) {
128
-	if ( $use_existing_arguments ) {
127
+function geodir_getlink($url, $params = array(), $use_existing_arguments = false) {
128
+	if ($use_existing_arguments) {
129 129
 		$params = $params + $_GET;
130 130
 	}
131
-	if ( ! $params ) {
131
+	if (!$params) {
132 132
 		return $url;
133 133
 	}
134 134
 	$link = $url;
135
-	if ( strpos( $link, '?' ) === false ) {
135
+	if (strpos($link, '?') === false) {
136 136
 		$link .= '?';
137 137
 	} //If there is no '?' add one at the end
138
-	elseif ( strpos( $link, '//maps.google.com/maps/api/js?language=' ) ) {
138
+	elseif (strpos($link, '//maps.google.com/maps/api/js?language=')) {
139 139
 		$link .= '&amp;';
140 140
 	} //If there is no '&' at the END, add one.
141
-	elseif ( ! preg_match( '/(\?|\&(amp;)?)$/', $link ) ) {
141
+	elseif (!preg_match('/(\?|\&(amp;)?)$/', $link)) {
142 142
 		$link .= '&';
143 143
 	} //If there is no '&' at the END, add one.
144 144
 
145 145
 	$params_arr = array();
146
-	foreach ( $params as $key => $value ) {
147
-		if ( gettype( $value ) == 'array' ) { //Handle array data properly
148
-			foreach ( $value as $val ) {
149
-				$params_arr[] = $key . '[]=' . urlencode( $val );
146
+	foreach ($params as $key => $value) {
147
+		if (gettype($value) == 'array') { //Handle array data properly
148
+			foreach ($value as $val) {
149
+				$params_arr[] = $key.'[]='.urlencode($val);
150 150
 			}
151 151
 		} else {
152
-			$params_arr[] = $key . '=' . urlencode( $value );
152
+			$params_arr[] = $key.'='.urlencode($value);
153 153
 		}
154 154
 	}
155
-	$link .= implode( '&', $params_arr );
155
+	$link .= implode('&', $params_arr);
156 156
 
157 157
 	return $link;
158 158
 }
@@ -169,18 +169,18 @@  discard block
 block discarded – undo
169 169
  *
170 170
  * @return string Listing page url if valid. Otherwise home url will be returned.
171 171
  */
172
-function geodir_get_addlisting_link( $post_type = '' ) {
172
+function geodir_get_addlisting_link($post_type = '') {
173 173
 	global $wpdb;
174 174
 
175 175
 	//$check_pkg  = $wpdb->get_var("SELECT pid FROM ".GEODIR_PRICE_TABLE." WHERE post_type='".$post_type."' and status != '0'");
176 176
 	$check_pkg = 1;
177
-	if ( post_type_exists( $post_type ) && $check_pkg ) {
177
+	if (post_type_exists($post_type) && $check_pkg) {
178 178
 
179
-		$add_listing_link = get_page_link( geodir_add_listing_page_id() );
179
+		$add_listing_link = get_page_link(geodir_add_listing_page_id());
180 180
 
181
-		return esc_url( add_query_arg( array( 'listing_type' => $post_type ), $add_listing_link ) );
181
+		return esc_url(add_query_arg(array('listing_type' => $post_type), $add_listing_link));
182 182
 	} else {
183
-		return get_bloginfo( 'url' );
183
+		return get_bloginfo('url');
184 184
 	}
185 185
 }
186 186
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) {
209 209
 		// To build the entire URI we need to prepend the protocol, and the http host
210 210
 		// to the URI string.
211
-		$pageURL .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
211
+		$pageURL .= $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
212 212
 	} else {
213 213
 		/*
214 214
 		 * Since we do not have REQUEST_URI to work with, we will assume we are
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 		 *
218 218
 		 * IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS
219 219
 		 */
220
-		$pageURL .= $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
220
+		$pageURL .= $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
221 221
 		
222 222
 		// If the query string exists append it to the URI string
223 223
 		if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
224
-			$pageURL .= '?' . $_SERVER['QUERY_STRING'];
224
+			$pageURL .= '?'.$_SERVER['QUERY_STRING'];
225 225
 		}
226 226
 	}
227 227
 	
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	 *
233 233
 	 * @param string $pageURL The URL of the current page.
234 234
 	 */
235
-	return apply_filters( 'geodir_curPageURL', $pageURL );
235
+	return apply_filters('geodir_curPageURL', $pageURL);
236 236
 }
237 237
 
238 238
 /**
@@ -247,12 +247,12 @@  discard block
 block discarded – undo
247 247
  *
248 248
  * @return string Cleaned variable.
249 249
  */
250
-function geodir_clean( $string ) {
250
+function geodir_clean($string) {
251 251
 
252
-	$string = trim( strip_tags( stripslashes( $string ) ) );
253
-	$string = str_replace( " ", "-", $string ); // Replaces all spaces with hyphens.
254
-	$string = preg_replace( '/[^A-Za-z0-9\-\_]/', '', $string ); // Removes special chars.
255
-	$string = preg_replace( '/-+/', '-', $string ); // Replaces multiple hyphens with single one.
252
+	$string = trim(strip_tags(stripslashes($string)));
253
+	$string = str_replace(" ", "-", $string); // Replaces all spaces with hyphens.
254
+	$string = preg_replace('/[^A-Za-z0-9\-\_]/', '', $string); // Removes special chars.
255
+	$string = preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
256 256
 
257 257
 	return $string;
258 258
 }
@@ -266,13 +266,13 @@  discard block
 block discarded – undo
266 266
  */
267 267
 function geodir_get_weekday() {
268 268
 	return array(
269
-		__( 'Sunday', 'geodirectory' ),
270
-		__( 'Monday', 'geodirectory' ),
271
-		__( 'Tuesday', 'geodirectory' ),
272
-		__( 'Wednesday', 'geodirectory' ),
273
-		__( 'Thursday', 'geodirectory' ),
274
-		__( 'Friday', 'geodirectory' ),
275
-		__( 'Saturday', 'geodirectory' )
269
+		__('Sunday', 'geodirectory'),
270
+		__('Monday', 'geodirectory'),
271
+		__('Tuesday', 'geodirectory'),
272
+		__('Wednesday', 'geodirectory'),
273
+		__('Thursday', 'geodirectory'),
274
+		__('Friday', 'geodirectory'),
275
+		__('Saturday', 'geodirectory')
276 276
 	);
277 277
 }
278 278
 
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
  */
286 286
 function geodir_get_weeks() {
287 287
 	return array(
288
-		__( 'First', 'geodirectory' ),
289
-		__( 'Second', 'geodirectory' ),
290
-		__( 'Third', 'geodirectory' ),
291
-		__( 'Fourth', 'geodirectory' ),
292
-		__( 'Last', 'geodirectory' )
288
+		__('First', 'geodirectory'),
289
+		__('Second', 'geodirectory'),
290
+		__('Third', 'geodirectory'),
291
+		__('Fourth', 'geodirectory'),
292
+		__('Last', 'geodirectory')
293 293
 	);
294 294
 }
295 295
 
@@ -308,112 +308,112 @@  discard block
 block discarded – undo
308 308
  *
309 309
  * @return bool If valid returns true. Otherwise false.
310 310
  */
311
-function geodir_is_page( $gdpage = '' ) {
311
+function geodir_is_page($gdpage = '') {
312 312
 
313 313
 	global $wp_query, $post, $wp;
314 314
 	//if(!is_admin()):
315 315
 
316
-	switch ( $gdpage ):
316
+	switch ($gdpage):
317 317
 		case 'add-listing':
318 318
 
319
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_add_listing_page_id() ) {
319
+			if (is_page() && get_query_var('page_id') == geodir_add_listing_page_id()) {
320 320
 				return true;
321
-			} elseif ( is_page() && isset( $post->post_content ) && has_shortcode( $post->post_content, 'gd_add_listing' ) ) {
321
+			} elseif (is_page() && isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
322 322
 				return true;
323 323
 			}
324 324
 
325 325
 			break;
326 326
 		case 'preview':
327
-			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_preview_page_id() ) && isset( $_REQUEST['listing_type'] )
328
-			     && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
327
+			if ((is_page() && get_query_var('page_id') == geodir_preview_page_id()) && isset($_REQUEST['listing_type'])
328
+			     && in_array($_REQUEST['listing_type'], geodir_get_posttypes())
329 329
 			) {
330 330
 				return true;
331 331
 			}
332 332
 			break;
333 333
 		case 'listing-success':
334
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_success_page_id() ) {
334
+			if (is_page() && get_query_var('page_id') == geodir_success_page_id()) {
335 335
 				return true;
336 336
 			}
337 337
 			break;
338 338
 		case 'detail':
339
-			$post_type = get_query_var( 'post_type' );
340
-			if ( is_array( $post_type ) ) {
341
-				$post_type = reset( $post_type );
339
+			$post_type = get_query_var('post_type');
340
+			if (is_array($post_type)) {
341
+				$post_type = reset($post_type);
342 342
 			}
343
-			if ( is_single() && in_array( $post_type, geodir_get_posttypes() ) ) {
343
+			if (is_single() && in_array($post_type, geodir_get_posttypes())) {
344 344
 				return true;
345 345
 			}
346 346
 			break;
347 347
 		case 'pt':
348
-			$post_type = get_query_var( 'post_type' );
349
-			if ( is_array( $post_type ) ) {
350
-				$post_type = reset( $post_type );
348
+			$post_type = get_query_var('post_type');
349
+			if (is_array($post_type)) {
350
+				$post_type = reset($post_type);
351 351
 			}
352
-			if ( is_post_type_archive() && in_array( $post_type, geodir_get_posttypes() ) && ! is_tax() ) {
352
+			if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()) && !is_tax()) {
353 353
 				return true;
354 354
 			}
355 355
 
356 356
 			break;
357 357
 		case 'listing':
358
-			if ( is_tax() && geodir_get_taxonomy_posttype() ) {
358
+			if (is_tax() && geodir_get_taxonomy_posttype()) {
359 359
 				global $current_term, $taxonomy, $term;
360 360
 
361 361
 				return true;
362 362
 			}
363
-			$post_type = get_query_var( 'post_type' );
364
-			if ( is_array( $post_type ) ) {
365
-				$post_type = reset( $post_type );
363
+			$post_type = get_query_var('post_type');
364
+			if (is_array($post_type)) {
365
+				$post_type = reset($post_type);
366 366
 			}
367
-			if ( is_post_type_archive() && in_array( $post_type, geodir_get_posttypes() ) ) {
367
+			if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes())) {
368 368
 				return true;
369 369
 			}
370 370
 
371 371
 			break;
372 372
 		case 'home':
373 373
 
374
-			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_home_page_id() ) || is_page_geodir_home() ) {
374
+			if ((is_page() && get_query_var('page_id') == geodir_home_page_id()) || is_page_geodir_home()) {
375 375
 				return true;
376 376
 			}
377 377
 
378 378
 			break;
379 379
 		case 'location':
380
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_location_page_id() ) {
380
+			if (is_page() && get_query_var('page_id') == geodir_location_page_id()) {
381 381
 				return true;
382 382
 			}
383 383
 			break;
384 384
 		case 'author':
385
-			if ( is_author() && isset( $_REQUEST['geodir_dashbord'] ) ) {
385
+			if (is_author() && isset($_REQUEST['geodir_dashbord'])) {
386 386
 				return true;
387 387
 			}
388 388
 
389
-			if ( function_exists( 'bp_loggedin_user_id' ) && function_exists( 'bp_displayed_user_id' ) && $my_id = (int) bp_loggedin_user_id() ) {
390
-				if ( ( (bool) bp_is_current_component( 'listings' ) || (bool) bp_is_current_component( 'favorites' ) ) && $my_id > 0 && $my_id == (int) bp_displayed_user_id() ) {
389
+			if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int) bp_loggedin_user_id()) {
390
+				if (((bool) bp_is_current_component('listings') || (bool) bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int) bp_displayed_user_id()) {
391 391
 					return true;
392 392
 				}
393 393
 			}
394 394
 			break;
395 395
 		case 'search':
396
-			if ( is_search() && isset( $_REQUEST['geodir_search'] ) ) {
396
+			if (is_search() && isset($_REQUEST['geodir_search'])) {
397 397
 				return true;
398 398
 			}
399 399
 			break;
400 400
 		case 'info':
401
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_info_page_id() ) {
401
+			if (is_page() && get_query_var('page_id') == geodir_info_page_id()) {
402 402
 				return true;
403 403
 			}
404 404
 			break;
405 405
 		case 'login':
406
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_login_page_id() ) {
406
+			if (is_page() && get_query_var('page_id') == geodir_login_page_id()) {
407 407
 				return true;
408 408
 			}
409 409
 			break;
410 410
 		case 'checkout':
411
-			if ( is_page() && function_exists( 'geodir_payment_checkout_page_id' ) && get_query_var( 'page_id' ) == geodir_payment_checkout_page_id() ) {
411
+			if (is_page() && function_exists('geodir_payment_checkout_page_id') && get_query_var('page_id') == geodir_payment_checkout_page_id()) {
412 412
 				return true;
413 413
 			}
414 414
 			break;
415 415
 		case 'invoices':
416
-			if ( is_page() && function_exists( 'geodir_payment_invoices_page_id' ) && get_query_var( 'page_id' ) == geodir_payment_invoices_page_id() ) {
416
+			if (is_page() && function_exists('geodir_payment_invoices_page_id') && get_query_var('page_id') == geodir_payment_invoices_page_id()) {
417 417
 				return true;
418 418
 			}
419 419
 			break;
@@ -438,25 +438,25 @@  discard block
 block discarded – undo
438 438
  *
439 439
  * @param object $wp WordPress object.
440 440
  */
441
-function geodir_set_is_geodir_page( $wp ) {
442
-	if ( ! is_admin() ) {
441
+function geodir_set_is_geodir_page($wp) {
442
+	if (!is_admin()) {
443 443
 		//$wp->query_vars['gd_is_geodir_page'] = false;
444 444
 		//print_r()
445
-		if ( empty( $wp->query_vars ) || ! array_diff( array_keys( $wp->query_vars ), array(
445
+		if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array(
446 446
 				'preview',
447 447
 				'page',
448 448
 				'paged',
449 449
 				'cpage'
450
-			) )
450
+			))
451 451
 		) {
452
-			if ( geodir_is_page( 'home' ) ) {
452
+			if (geodir_is_page('home')) {
453 453
 				$wp->query_vars['gd_is_geodir_page'] = true;
454 454
 			}
455 455
 
456 456
 
457 457
 		}
458 458
 
459
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['page_id'] ) ) {
459
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['page_id'])) {
460 460
 			if (
461 461
 				$wp->query_vars['page_id'] == geodir_add_listing_page_id()
462 462
 				|| $wp->query_vars['page_id'] == geodir_preview_page_id()
@@ -465,26 +465,26 @@  discard block
 block discarded – undo
465 465
 				|| $wp->query_vars['page_id'] == geodir_home_page_id()
466 466
 				|| $wp->query_vars['page_id'] == geodir_info_page_id()
467 467
 				|| $wp->query_vars['page_id'] == geodir_login_page_id()
468
-				|| ( function_exists( 'geodir_payment_checkout_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id() )
469
-				|| ( function_exists( 'geodir_payment_invoices_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id() )
468
+				|| (function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
469
+				|| (function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
470 470
 			) {
471 471
 				$wp->query_vars['gd_is_geodir_page'] = true;
472 472
 			}
473 473
 		}
474 474
 
475
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['pagename'] ) ) {
476
-			$page = get_page_by_path( $wp->query_vars['pagename'] );
475
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['pagename'])) {
476
+			$page = get_page_by_path($wp->query_vars['pagename']);
477 477
 
478
-			if ( ! empty( $page ) && (
478
+			if (!empty($page) && (
479 479
 					$page->ID == geodir_add_listing_page_id()
480 480
 					|| $page->ID == geodir_preview_page_id()
481 481
 					|| $page->ID == geodir_success_page_id()
482 482
 					|| $page->ID == geodir_location_page_id()
483
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_home_page_id() )
484
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_info_page_id() )
485
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_login_page_id() )
486
-					|| ( isset( $wp->query_vars['page_id'] ) && function_exists( 'geodir_payment_checkout_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id() )
487
-					|| ( isset( $wp->query_vars['page_id'] ) && function_exists( 'geodir_payment_invoices_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id() )
483
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_home_page_id())
484
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_info_page_id())
485
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_login_page_id())
486
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
487
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
488 488
 				)
489 489
 			) {
490 490
 				$wp->query_vars['gd_is_geodir_page'] = true;
@@ -492,20 +492,20 @@  discard block
 block discarded – undo
492 492
 		}
493 493
 
494 494
 
495
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['post_type'] ) && $wp->query_vars['post_type'] != '' ) {
495
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['post_type']) && $wp->query_vars['post_type'] != '') {
496 496
 			$requested_post_type = $wp->query_vars['post_type'];
497 497
 			// check if this post type is geodirectory post types
498 498
 			$post_type_array = geodir_get_posttypes();
499
-			if ( in_array( $requested_post_type, $post_type_array ) ) {
499
+			if (in_array($requested_post_type, $post_type_array)) {
500 500
 				$wp->query_vars['gd_is_geodir_page'] = true;
501 501
 			}
502 502
 		}
503 503
 
504
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) ) {
505
-			$geodir_taxonomis = geodir_get_taxonomies( '', true );
506
-			if ( ! empty( $geodir_taxonomis ) ) {
507
-				foreach ( $geodir_taxonomis as $taxonomy ) {
508
-					if ( array_key_exists( $taxonomy, $wp->query_vars ) ) {
504
+		if (!isset($wp->query_vars['gd_is_geodir_page'])) {
505
+			$geodir_taxonomis = geodir_get_taxonomies('', true);
506
+			if (!empty($geodir_taxonomis)) {
507
+				foreach ($geodir_taxonomis as $taxonomy) {
508
+					if (array_key_exists($taxonomy, $wp->query_vars)) {
509 509
 						$wp->query_vars['gd_is_geodir_page'] = true;
510 510
 						break;
511 511
 					}
@@ -514,20 +514,20 @@  discard block
 block discarded – undo
514 514
 
515 515
 		}
516 516
 
517
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['author_name'] ) && isset( $_REQUEST['geodir_dashbord'] ) ) {
517
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['author_name']) && isset($_REQUEST['geodir_dashbord'])) {
518 518
 			$wp->query_vars['gd_is_geodir_page'] = true;
519 519
 		}
520 520
 
521 521
 
522
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $_REQUEST['geodir_search'] ) ) {
522
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($_REQUEST['geodir_search'])) {
523 523
 			$wp->query_vars['gd_is_geodir_page'] = true;
524 524
 		}
525 525
 
526 526
 
527 527
 //check if homepage
528
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] )
529
-		     && ! isset( $wp->query_vars['page_id'] )
530
-		     && ! isset( $wp->query_vars['pagename'] )
528
+		if (!isset($wp->query_vars['gd_is_geodir_page'])
529
+		     && !isset($wp->query_vars['page_id'])
530
+		     && !isset($wp->query_vars['pagename'])
531 531
 		     && is_page_geodir_home()
532 532
 		) {
533 533
 			$wp->query_vars['gd_is_geodir_page'] = true;
@@ -551,14 +551,14 @@  discard block
 block discarded – undo
551 551
  */
552 552
 function geodir_is_geodir_page() {
553 553
 	global $wp;
554
-	if ( isset( $wp->query_vars['gd_is_geodir_page'] ) && $wp->query_vars['gd_is_geodir_page'] ) {
554
+	if (isset($wp->query_vars['gd_is_geodir_page']) && $wp->query_vars['gd_is_geodir_page']) {
555 555
 		return true;
556 556
 	} else {
557 557
 		return false;
558 558
 	}
559 559
 }
560 560
 
561
-if ( ! function_exists( 'geodir_get_imagesize' ) ) {
561
+if (!function_exists('geodir_get_imagesize')) {
562 562
 	/**
563 563
 	 * Get image size using the size key .
564 564
 	 *
@@ -569,13 +569,13 @@  discard block
 block discarded – undo
569 569
 	 *
570 570
 	 * @return array|mixed|void|WP_Error If valid returns image size. Else returns error.
571 571
 	 */
572
-	function geodir_get_imagesize( $size = '' ) {
572
+	function geodir_get_imagesize($size = '') {
573 573
 
574 574
 		$imagesizes = array(
575
-			'list-thumb'   => array( 'w' => 283, 'h' => 188 ),
576
-			'thumbnail'    => array( 'w' => 125, 'h' => 125 ),
577
-			'widget-thumb' => array( 'w' => 50, 'h' => 50 ),
578
-			'slider-thumb' => array( 'w' => 100, 'h' => 100 )
575
+			'list-thumb'   => array('w' => 283, 'h' => 188),
576
+			'thumbnail'    => array('w' => 125, 'h' => 125),
577
+			'widget-thumb' => array('w' => 50, 'h' => 50),
578
+			'slider-thumb' => array('w' => 100, 'h' => 100)
579 579
 		);
580 580
 
581 581
 		/**
@@ -585,9 +585,9 @@  discard block
 block discarded – undo
585 585
 		 *
586 586
 		 * @param array $imagesizes Image size array.
587 587
 		 */
588
-		$imagesizes = apply_filters( 'geodir_imagesizes', $imagesizes );
588
+		$imagesizes = apply_filters('geodir_imagesizes', $imagesizes);
589 589
 
590
-		if ( ! empty( $size ) && array_key_exists( $size, $imagesizes ) ) {
590
+		if (!empty($size) && array_key_exists($size, $imagesizes)) {
591 591
 			/**
592 592
 			 * Filters image size of the passed key.
593 593
 			 *
@@ -595,11 +595,11 @@  discard block
 block discarded – undo
595 595
 			 *
596 596
 			 * @param array $imagesizes [$size] Image size array of the passed key.
597 597
 			 */
598
-			return apply_filters( 'geodir_get_imagesize_' . $size, $imagesizes[ $size ] );
598
+			return apply_filters('geodir_get_imagesize_'.$size, $imagesizes[$size]);
599 599
 
600
-		} elseif ( ! empty( $size ) ) {
600
+		} elseif (!empty($size)) {
601 601
 
602
-			return new WP_Error( 'geodir_no_imagesize', __( "Given image size is not valid", 'geodirectory' ) );
602
+			return new WP_Error('geodir_no_imagesize', __("Given image size is not valid", 'geodirectory'));
603 603
 
604 604
 		}
605 605
 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 */
624 624
 
625 625
 
626
-if ( ! function_exists( 'createRandomString' ) ) {
626
+if (!function_exists('createRandomString')) {
627 627
 	/**
628 628
 	 * Creates random string.
629 629
 	 *
@@ -633,21 +633,21 @@  discard block
 block discarded – undo
633 633
 	 */
634 634
 	function createRandomString() {
635 635
 		$chars = "abcdefghijkmlnopqrstuvwxyz1023456789";
636
-		srand( (double) microtime() * 1000000 );
636
+		srand((double) microtime() * 1000000);
637 637
 		$i       = 0;
638 638
 		$rstring = '';
639
-		while ( $i <= 25 ) {
639
+		while ($i <= 25) {
640 640
 			$num     = rand() % 33;
641
-			$tmp     = substr( $chars, $num, 1 );
642
-			$rstring = $rstring . $tmp;
643
-			$i ++;
641
+			$tmp     = substr($chars, $num, 1);
642
+			$rstring = $rstring.$tmp;
643
+			$i++;
644 644
 		}
645 645
 
646 646
 		return $rstring;
647 647
 	}
648 648
 }
649 649
 
650
-if ( ! function_exists( 'geodir_getDistanceRadius' ) ) {
650
+if (!function_exists('geodir_getDistanceRadius')) {
651 651
 	/**
652 652
 	 * Calculates the distance radius.
653 653
 	 *
@@ -658,9 +658,9 @@  discard block
 block discarded – undo
658 658
 	 *
659 659
 	 * @return float The mean radius.
660 660
 	 */
661
-	function geodir_getDistanceRadius( $uom = 'km' ) {
661
+	function geodir_getDistanceRadius($uom = 'km') {
662 662
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
663
-		switch ( geodir_strtolower( $uom ) ):
663
+		switch (geodir_strtolower($uom)):
664 664
 			case 'km'    :
665 665
 				$earthMeanRadius = 6371.009; // km
666 666
 				break;
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 }
693 693
 
694 694
 
695
-if ( ! function_exists( 'geodir_calculateDistanceFromLatLong' ) ) {
695
+if (!function_exists('geodir_calculateDistanceFromLatLong')) {
696 696
 	/**
697 697
 	 * Calculate the great circle distance between two points identified by longitude and latitude.
698 698
 	 *
@@ -705,17 +705,17 @@  discard block
 block discarded – undo
705 705
 	 *
706 706
 	 * @return float The distance.
707 707
 	 */
708
-	function geodir_calculateDistanceFromLatLong( $point1, $point2, $uom = 'km' ) {
708
+	function geodir_calculateDistanceFromLatLong($point1, $point2, $uom = 'km') {
709 709
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
710 710
 
711
-		$earthMeanRadius = geodir_getDistanceRadius( $uom );
711
+		$earthMeanRadius = geodir_getDistanceRadius($uom);
712 712
 
713
-		$deltaLatitude  = deg2rad( (float) $point2['latitude'] - (float) $point1['latitude'] );
714
-		$deltaLongitude = deg2rad( (float) $point2['longitude'] - (float) $point1['longitude'] );
715
-		$a              = sin( $deltaLatitude / 2 ) * sin( $deltaLatitude / 2 ) +
716
-		                  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
717
-		                  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
718
-		$c              = 2 * atan2( sqrt( $a ), sqrt( 1 - $a ) );
713
+		$deltaLatitude  = deg2rad((float) $point2['latitude'] - (float) $point1['latitude']);
714
+		$deltaLongitude = deg2rad((float) $point2['longitude'] - (float) $point1['longitude']);
715
+		$a              = sin($deltaLatitude / 2) * sin($deltaLatitude / 2) +
716
+		                  cos(deg2rad((float) $point1['latitude'])) * cos(deg2rad((float) $point2['latitude'])) *
717
+		                  sin($deltaLongitude / 2) * sin($deltaLongitude / 2);
718
+		$c              = 2 * atan2(sqrt($a), sqrt(1 - $a));
719 719
 		$distance       = $earthMeanRadius * $c;
720 720
 
721 721
 		return $distance;
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 }
725 725
 
726 726
 
727
-if ( ! function_exists( 'geodir_sendEmail' ) ) {
727
+if (!function_exists('geodir_sendEmail')) {
728 728
 	/**
729 729
 	 * The main function that send transactional emails using the args provided.
730 730
 	 *
@@ -743,93 +743,93 @@  discard block
 block discarded – undo
743 743
 	 * @param string $post_id       The post ID.
744 744
 	 * @param string $user_id       The user ID.
745 745
 	 */
746
-	function geodir_sendEmail( $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '' ) {
746
+	function geodir_sendEmail($fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '') {
747 747
 		$login_details = '';
748 748
 
749 749
 		// strip slashes from subject & message text
750
-		$to_subject = stripslashes_deep( $to_subject );
751
-		$to_message = stripslashes_deep( $to_message );
750
+		$to_subject = stripslashes_deep($to_subject);
751
+		$to_message = stripslashes_deep($to_message);
752 752
 
753
-		if ( $message_type == 'send_friend' ) {
754
-			$subject = get_option( 'geodir_email_friend_subject' );
755
-			$message = get_option( 'geodir_email_friend_content' );
756
-		} elseif ( $message_type == 'send_enquiry' ) {
757
-			$subject = get_option( 'geodir_email_enquiry_subject' );
758
-			$message = get_option( 'geodir_email_enquiry_content' );
753
+		if ($message_type == 'send_friend') {
754
+			$subject = get_option('geodir_email_friend_subject');
755
+			$message = get_option('geodir_email_friend_content');
756
+		} elseif ($message_type == 'send_enquiry') {
757
+			$subject = get_option('geodir_email_enquiry_subject');
758
+			$message = get_option('geodir_email_enquiry_content');
759 759
 
760 760
 			// change to name in some cases
761
-			$post_author = get_post_field( 'post_author', $post_id );
762
-			if(is_super_admin( $post_author  )){// if admin probably not the post author so change name
763
-				$toEmailName = __('Business Owner','geodirectory');
764
-			}elseif(defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id,'claimed')!='1'){// if claim manager installed but listing not claimed
765
-				$toEmailName = __('Business Owner','geodirectory');
761
+			$post_author = get_post_field('post_author', $post_id);
762
+			if (is_super_admin($post_author)) {// if admin probably not the post author so change name
763
+				$toEmailName = __('Business Owner', 'geodirectory');
764
+			}elseif (defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id, 'claimed') != '1') {// if claim manager installed but listing not claimed
765
+				$toEmailName = __('Business Owner', 'geodirectory');
766 766
 			}
767 767
 
768 768
 
769
-		} elseif ( $message_type == 'forgot_password' ) {
770
-			$subject       = get_option( 'geodir_forgot_password_subject' );
771
-			$message       = get_option( 'geodir_forgot_password_content' );
769
+		} elseif ($message_type == 'forgot_password') {
770
+			$subject       = get_option('geodir_forgot_password_subject');
771
+			$message       = get_option('geodir_forgot_password_content');
772 772
 			$login_details = $to_message;
773
-		} elseif ( $message_type == 'registration' ) {
774
-			$subject       = get_option( 'geodir_registration_success_email_subject' );
775
-			$message       = get_option( 'geodir_registration_success_email_content' );
773
+		} elseif ($message_type == 'registration') {
774
+			$subject       = get_option('geodir_registration_success_email_subject');
775
+			$message       = get_option('geodir_registration_success_email_content');
776 776
 			$login_details = $to_message;
777
-		} elseif ( $message_type == 'post_submit' ) {
778
-			$subject = get_option( 'geodir_post_submited_success_email_subject' );
779
-			$message = get_option( 'geodir_post_submited_success_email_content' );
780
-		} elseif ( $message_type == 'listing_published' ) {
781
-			$subject = get_option( 'geodir_post_published_email_subject' );
782
-			$message = get_option( 'geodir_post_published_email_content' );
783
-		} elseif ( $message_type == 'listing_edited' ) {
784
-			$subject = get_option( 'geodir_post_edited_email_subject_admin' );
785
-			$message = get_option( 'geodir_post_edited_email_content_admin' );
777
+		} elseif ($message_type == 'post_submit') {
778
+			$subject = get_option('geodir_post_submited_success_email_subject');
779
+			$message = get_option('geodir_post_submited_success_email_content');
780
+		} elseif ($message_type == 'listing_published') {
781
+			$subject = get_option('geodir_post_published_email_subject');
782
+			$message = get_option('geodir_post_published_email_content');
783
+		} elseif ($message_type == 'listing_edited') {
784
+			$subject = get_option('geodir_post_edited_email_subject_admin');
785
+			$message = get_option('geodir_post_edited_email_content_admin');
786 786
 		}
787 787
 
788
-		if ( ! empty( $subject ) ) {
789
-			$subject = __( stripslashes_deep( $subject ), 'geodirectory' );
788
+		if (!empty($subject)) {
789
+			$subject = __(stripslashes_deep($subject), 'geodirectory');
790 790
 		}
791 791
 
792
-		if ( ! empty( $message ) ) {
793
-			$message = __( stripslashes_deep( $message ), 'geodirectory' );
792
+		if (!empty($message)) {
793
+			$message = __(stripslashes_deep($message), 'geodirectory');
794 794
 		}
795 795
 
796
-		$to_message        = nl2br( $to_message );
797
-		$sitefromEmail     = get_option( 'site_email' );
796
+		$to_message        = nl2br($to_message);
797
+		$sitefromEmail     = get_option('site_email');
798 798
 		$sitefromEmailName = get_site_emailName();
799
-		$productlink       = get_permalink( $post_id );
799
+		$productlink       = get_permalink($post_id);
800 800
 
801 801
 		$user_login = '';
802
-		if ( $user_id > 0 && $user_info = get_userdata( $user_id ) ) {
802
+		if ($user_id > 0 && $user_info = get_userdata($user_id)) {
803 803
 			$user_login = $user_info->user_login;
804 804
 		}
805 805
 
806 806
 		$posted_date = '';
807 807
 		$listingLink = '';
808 808
 
809
-		$post_info = get_post( $post_id );
809
+		$post_info = get_post($post_id);
810 810
 
811
-		if ( $post_info ) {
811
+		if ($post_info) {
812 812
 			$posted_date = $post_info->post_date;
813
-			$listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
813
+			$listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
814 814
 		}
815 815
 		$siteurl       = home_url();
816
-		$siteurl_link  = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
816
+		$siteurl_link  = '<a href="'.$siteurl.'">'.$siteurl.'</a>';
817 817
 		$loginurl      = geodir_login_url();
818
-		$loginurl_link = '<a href="' . $loginurl . '">login</a>';
818
+		$loginurl_link = '<a href="'.$loginurl.'">login</a>';
819 819
 
820
-		$post_author_id   = ! empty( $post_info ) ? $post_info->post_author : 0;
821
-		$post_author_name = geodir_get_client_name( $post_author_id );
822
-		$current_date     = date_i18n( 'Y-m-d H:i:s', current_time( 'timestamp' ) );
820
+		$post_author_id   = !empty($post_info) ? $post_info->post_author : 0;
821
+		$post_author_name = geodir_get_client_name($post_author_id);
822
+		$current_date     = date_i18n('Y-m-d H:i:s', current_time('timestamp'));
823 823
 
824
-		if ( $fromEmail == '' ) {
825
-			$fromEmail = get_option( 'site_email' );
824
+		if ($fromEmail == '') {
825
+			$fromEmail = get_option('site_email');
826 826
 		}
827 827
 
828
-		if ( $fromEmailName == '' ) {
829
-			$fromEmailName = get_option( 'site_email_name' );
828
+		if ($fromEmailName == '') {
829
+			$fromEmailName = get_option('site_email_name');
830 830
 		}
831 831
 
832
-		$search_array  = array(
832
+		$search_array = array(
833 833
 			'[#listing_link#]',
834 834
 			'[#site_name_url#]',
835 835
 			'[#post_id#]',
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 			$post_author_name,
870 870
 			$current_date
871 871
 		);
872
-		$message       = str_replace( $search_array, $replace_array, $message );
872
+		$message       = str_replace($search_array, $replace_array, $message);
873 873
 
874 874
 		$search_array  = array(
875 875
 			'[#listing_link#]',
@@ -905,12 +905,12 @@  discard block
 block discarded – undo
905 905
 			$post_author_name,
906 906
 			$current_date
907 907
 		);
908
-		$subject       = str_replace( $search_array, $replace_array, $subject );
908
+		$subject = str_replace($search_array, $replace_array, $subject);
909 909
 
910
-		$headers =  array();
910
+		$headers = array();
911 911
 		$headers[] = 'Content-type: text/html; charset=UTF-8';
912
-		$headers[] = "Reply-To: " . $fromEmail;
913
-		$headers[] = 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>';
912
+		$headers[] = "Reply-To: ".$fromEmail;
913
+		$headers[] = 'From: '.$sitefromEmailName.' <'.$sitefromEmail.'>';
914 914
 
915 915
 		$to = $toEmail;
916 916
 
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 		 * @param string $post_id       The post ID.
933 933
 		 * @param string $user_id       The user ID.
934 934
 		 */
935
-		$to = apply_filters( 'geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
935
+		$to = apply_filters('geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
936 936
 		/**
937 937
 		 * Filter the client email subject.
938 938
 		 *
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 		 * @param string $post_id       The post ID.
952 952
 		 * @param string $user_id       The user ID.
953 953
 		 */
954
-		$subject = apply_filters( 'geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
954
+		$subject = apply_filters('geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
955 955
 		/**
956 956
 		 * Filter the client email message.
957 957
 		 *
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 		 * @param string $post_id       The post ID.
971 971
 		 * @param string $user_id       The user ID.
972 972
 		 */
973
-		$message = apply_filters( 'geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
973
+		$message = apply_filters('geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
974 974
 		/**
975 975
 		 * Filter the client email headers.
976 976
 		 *
@@ -989,39 +989,39 @@  discard block
 block discarded – undo
989 989
 		 * @param string $post_id       The post ID.
990 990
 		 * @param string $user_id       The user ID.
991 991
 		 */
992
-		$headers = apply_filters( 'geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
992
+		$headers = apply_filters('geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
993 993
 
994
-		$sent = wp_mail( $to, $subject, $message, $headers );
994
+		$sent = wp_mail($to, $subject, $message, $headers);
995 995
 
996
-		if ( ! $sent ) {
997
-			if ( is_array( $to ) ) {
998
-				$to = implode( ',', $to );
996
+		if (!$sent) {
997
+			if (is_array($to)) {
998
+				$to = implode(',', $to);
999 999
 			}
1000 1000
 			$log_message = sprintf(
1001
-				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1001
+				__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1002 1002
 				$message_type,
1003
-				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1003
+				date_i18n('F j Y H:i:s', current_time('timestamp')),
1004 1004
 				$to,
1005 1005
 				$subject
1006 1006
 			);
1007
-			geodir_error_log( $log_message );
1007
+			geodir_error_log($log_message);
1008 1008
 		}
1009 1009
 
1010 1010
 		///////// ADMIN BCC EMIALS
1011
-		$adminEmail = get_bloginfo( 'admin_email' );
1011
+		$adminEmail = get_bloginfo('admin_email');
1012 1012
 		$to         = $adminEmail;
1013 1013
 
1014 1014
 		$admin_bcc = false;
1015
-		if ( $message_type == 'registration' ) {
1016
-			$message_raw  = explode( __( "Password:", 'geodirectory' ), $message );
1017
-			$message_raw2 = explode( "</p>", $message_raw[1], 2 );
1018
-			$message      = $message_raw[0] . __( 'Password:', 'geodirectory' ) . ' **********</p>' . $message_raw2[1];
1015
+		if ($message_type == 'registration') {
1016
+			$message_raw  = explode(__("Password:", 'geodirectory'), $message);
1017
+			$message_raw2 = explode("</p>", $message_raw[1], 2);
1018
+			$message      = $message_raw[0].__('Password:', 'geodirectory').' **********</p>'.$message_raw2[1];
1019 1019
 		}
1020
-		if ( $message_type == 'post_submit' ) {
1021
-			$subject = __( stripslashes_deep( get_option( 'geodir_post_submited_success_email_subject_admin' ) ), 'geodirectory' );
1022
-			$message = __( stripslashes_deep( get_option( 'geodir_post_submited_success_email_content_admin' ) ), 'geodirectory' );
1020
+		if ($message_type == 'post_submit') {
1021
+			$subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory');
1022
+			$message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory');
1023 1023
 
1024
-			$search_array  = array(
1024
+			$search_array = array(
1025 1025
 				'[#listing_link#]',
1026 1026
 				'[#site_name_url#]',
1027 1027
 				'[#post_id#]',
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 				$user_login,
1054 1054
 				$user_login
1055 1055
 			);
1056
-			$message       = str_replace( $search_array, $replace_array, $message );
1056
+			$message       = str_replace($search_array, $replace_array, $message);
1057 1057
 
1058 1058
 			$search_array  = array(
1059 1059
 				'[#listing_link#]',
@@ -1081,40 +1081,40 @@  discard block
 block discarded – undo
1081 1081
 				$user_login,
1082 1082
 				$user_login
1083 1083
 			);
1084
-			$subject       = str_replace( $search_array, $replace_array, $subject );
1084
+			$subject = str_replace($search_array, $replace_array, $subject);
1085 1085
 
1086 1086
 			$subject .= ' - ADMIN BCC COPY';
1087 1087
 			$admin_bcc = true;
1088 1088
 
1089
-		} elseif ( $message_type == 'registration' && get_option( 'geodir_bcc_new_user' ) ) {
1089
+		} elseif ($message_type == 'registration' && get_option('geodir_bcc_new_user')) {
1090 1090
 			$subject .= ' - ADMIN BCC COPY';
1091 1091
 			$admin_bcc = true;
1092
-		} elseif ( $message_type == 'send_friend' && get_option( 'geodir_bcc_friend' ) ) {
1092
+		} elseif ($message_type == 'send_friend' && get_option('geodir_bcc_friend')) {
1093 1093
 			$subject .= ' - ADMIN BCC COPY';
1094 1094
 			$admin_bcc = true;
1095
-		} elseif ( $message_type == 'send_enquiry' && get_option( 'geodir_bcc_enquiry' ) ) {
1095
+		} elseif ($message_type == 'send_enquiry' && get_option('geodir_bcc_enquiry')) {
1096 1096
 			$subject .= ' - ADMIN BCC COPY';
1097 1097
 			$admin_bcc = true;
1098
-		} elseif ( $message_type == 'listing_published' && get_option( 'geodir_bcc_listing_published' ) ) {
1098
+		} elseif ($message_type == 'listing_published' && get_option('geodir_bcc_listing_published')) {
1099 1099
 			$subject .= ' - ADMIN BCC COPY';
1100 1100
 			$admin_bcc = true;
1101 1101
 		}
1102 1102
 
1103
-		if ( $admin_bcc === true ) {
1104
-			$sent = wp_mail( $to, $subject, $message, $headers );
1103
+		if ($admin_bcc === true) {
1104
+			$sent = wp_mail($to, $subject, $message, $headers);
1105 1105
 
1106
-			if ( ! $sent ) {
1107
-				if ( is_array( $to ) ) {
1108
-					$to = implode( ',', $to );
1106
+			if (!$sent) {
1107
+				if (is_array($to)) {
1108
+					$to = implode(',', $to);
1109 1109
 				}
1110 1110
 				$log_message = sprintf(
1111
-					__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1111
+					__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1112 1112
 					$message_type,
1113
-					date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1113
+					date_i18n('F j Y H:i:s', current_time('timestamp')),
1114 1114
 					$to,
1115 1115
 					$subject
1116 1116
 				);
1117
-				geodir_error_log( $log_message );
1117
+				geodir_error_log($log_message);
1118 1118
 			}
1119 1119
 		}
1120 1120
 
@@ -1130,52 +1130,52 @@  discard block
 block discarded – undo
1130 1130
  */
1131 1131
 function geodir_taxonomy_breadcrumb() {
1132 1132
 
1133
-	$term   = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
1133
+	$term   = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
1134 1134
 	$parent = $term->parent;
1135 1135
 
1136
-	while ( $parent ):
1136
+	while ($parent):
1137 1137
 		$parents[]  = $parent;
1138
-		$new_parent = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );
1138
+		$new_parent = get_term_by('id', $parent, get_query_var('taxonomy'));
1139 1139
 		$parent     = $new_parent->parent;
1140 1140
 	endwhile;
1141 1141
 
1142
-	if ( ! empty( $parents ) ):
1143
-		$parents = array_reverse( $parents );
1142
+	if (!empty($parents)):
1143
+		$parents = array_reverse($parents);
1144 1144
 
1145
-		foreach ( $parents as $parent ):
1146
-			$item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );
1147
-			$url  = get_term_link( $item, get_query_var( 'taxonomy' ) );
1148
-			echo '<li> > <a href="' . $url . '">' . $item->name . '</a></li>';
1145
+		foreach ($parents as $parent):
1146
+			$item = get_term_by('id', $parent, get_query_var('taxonomy'));
1147
+			$url  = get_term_link($item, get_query_var('taxonomy'));
1148
+			echo '<li> > <a href="'.$url.'">'.$item->name.'</a></li>';
1149 1149
 		endforeach;
1150 1150
 
1151 1151
 	endif;
1152 1152
 
1153
-	echo '<li> > ' . $term->name . '</li>';
1153
+	echo '<li> > '.$term->name.'</li>';
1154 1154
 }
1155 1155
 
1156
-function geodir_wpml_post_type_archive_link($link, $post_type){
1156
+function geodir_wpml_post_type_archive_link($link, $post_type) {
1157 1157
 
1158
-	if(function_exists('icl_object_id')) {
1159
-		$post_types   = get_option( 'geodir_post_types' );
1160
-		$slug         = $post_types[ $post_type ]['rewrite']['slug'];
1158
+	if (function_exists('icl_object_id')) {
1159
+		$post_types   = get_option('geodir_post_types');
1160
+		$slug         = $post_types[$post_type]['rewrite']['slug'];
1161 1161
 
1162 1162
 		//echo $link.'###'.gd_wpml_get_lang_from_url( $link) ;
1163 1163
 
1164 1164
 		// Alter the CPT slug if WPML is set to do so
1165
-		if ( function_exists( 'icl_object_id' ) ) {
1166
-			if ( gd_wpml_slug_translation_turned_on( $post_type ) && $language_code = gd_wpml_get_lang_from_url( $link) ) {
1165
+		if (function_exists('icl_object_id')) {
1166
+			if (gd_wpml_slug_translation_turned_on($post_type) && $language_code = gd_wpml_get_lang_from_url($link)) {
1167 1167
 
1168 1168
 				$org_slug = $slug;
1169
-				$slug     = apply_filters( 'wpml_translate_single_string',
1169
+				$slug     = apply_filters('wpml_translate_single_string',
1170 1170
 					$slug,
1171 1171
 					'WordPress',
1172
-					'URL slug: ' . $slug,
1173
-					$language_code );
1172
+					'URL slug: '.$slug,
1173
+					$language_code);
1174 1174
 
1175
-				if ( ! $slug ) {
1175
+				if (!$slug) {
1176 1176
 					$slug = $org_slug;
1177 1177
 				} else {
1178
-					$link = str_replace( $org_slug, $slug, $link );
1178
+					$link = str_replace($org_slug, $slug, $link);
1179 1179
 				}
1180 1180
 
1181 1181
 			}
@@ -1206,9 +1206,9 @@  discard block
 block discarded – undo
1206 1206
 	 *
1207 1207
 	 * @since 1.0.0
1208 1208
 	 */
1209
-	$separator = apply_filters( 'geodir_breadcrumb_separator', ' > ' );
1209
+	$separator = apply_filters('geodir_breadcrumb_separator', ' > ');
1210 1210
 
1211
-	if ( ! geodir_is_page( 'home' ) ) {
1211
+	if (!geodir_is_page('home')) {
1212 1212
 		$breadcrumb    = '';
1213 1213
 		$url_categoris = '';
1214 1214
 		$breadcrumb .= '<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">';
@@ -1217,162 +1217,162 @@  discard block
 block discarded – undo
1217 1217
 		 *
1218 1218
 		 * @since 1.0.0
1219 1219
 		 */
1220
-		$breadcrumb .= '<li>' . apply_filters( 'geodir_breadcrumb_first_link', '<a href="' . home_url() . '">' . __( 'Home', 'geodirectory' ) . '</a>' ) . '</li>';
1220
+		$breadcrumb .= '<li>'.apply_filters('geodir_breadcrumb_first_link', '<a href="'.home_url().'">'.__('Home', 'geodirectory').'</a>').'</li>';
1221 1221
 
1222 1222
 		$gd_post_type   = geodir_get_current_posttype();
1223
-		$post_type_info = get_post_type_object( $gd_post_type );
1223
+		$post_type_info = get_post_type_object($gd_post_type);
1224 1224
 
1225
-		remove_filter( 'post_type_archive_link', 'geodir_get_posttype_link' );
1225
+		remove_filter('post_type_archive_link', 'geodir_get_posttype_link');
1226 1226
 
1227
-		$listing_link = get_post_type_archive_link( $gd_post_type );
1227
+		$listing_link = get_post_type_archive_link($gd_post_type);
1228 1228
 
1229
-		add_filter( 'post_type_archive_link', 'geodir_get_posttype_link', 10, 2 );
1230
-		$listing_link = rtrim( $listing_link, '/' );
1229
+		add_filter('post_type_archive_link', 'geodir_get_posttype_link', 10, 2);
1230
+		$listing_link = rtrim($listing_link, '/');
1231 1231
 		$listing_link .= '/';
1232 1232
 
1233 1233
 		$post_type_for_location_link = $listing_link;
1234
-		$location_terms              = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
1234
+		$location_terms              = geodir_get_current_location_terms('query_vars', $gd_post_type);
1235 1235
 
1236 1236
 		global $wp, $gd_session;
1237 1237
 		$location_link = $post_type_for_location_link;
1238 1238
 
1239
-		if ( geodir_is_page( 'detail' ) || geodir_is_page( 'listing' ) ) {
1239
+		if (geodir_is_page('detail') || geodir_is_page('listing')) {
1240 1240
 			global $post;
1241
-			$location_manager     = defined( 'POST_LOCATION_TABLE' ) ? true : false;
1242
-			$neighbourhood_active = $location_manager && get_option( 'location_neighbourhoods' ) ? true : false;
1241
+			$location_manager     = defined('POST_LOCATION_TABLE') ? true : false;
1242
+			$neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
1243 1243
 
1244
-			if ( geodir_is_page( 'detail' ) && isset( $post->country_slug ) ) {
1244
+			if (geodir_is_page('detail') && isset($post->country_slug)) {
1245 1245
 				$location_terms = array(
1246 1246
 					'gd_country' => $post->country_slug,
1247 1247
 					'gd_region'  => $post->region_slug,
1248 1248
 					'gd_city'    => $post->city_slug
1249 1249
 				);
1250 1250
 
1251
-				if ( $neighbourhood_active && ! empty( $location_terms['gd_city'] ) && $gd_ses_neighbourhood = $gd_session->get( 'gd_neighbourhood' ) ) {
1251
+				if ($neighbourhood_active && !empty($location_terms['gd_city']) && $gd_ses_neighbourhood = $gd_session->get('gd_neighbourhood')) {
1252 1252
 					$location_terms['gd_neighbourhood'] = $gd_ses_neighbourhood;
1253 1253
 				}
1254 1254
 			}
1255 1255
 
1256
-			$geodir_show_location_url = get_option( 'geodir_show_location_url' );
1256
+			$geodir_show_location_url = get_option('geodir_show_location_url');
1257 1257
 
1258 1258
 			$hide_url_part = array();
1259
-			if ( $location_manager ) {
1260
-				$hide_country_part = get_option( 'geodir_location_hide_country_part' );
1261
-				$hide_region_part  = get_option( 'geodir_location_hide_region_part' );
1262
-
1263
-				if ( $hide_region_part && $hide_country_part ) {
1264
-					$hide_url_part = array( 'gd_country', 'gd_region' );
1265
-				} else if ( $hide_region_part && ! $hide_country_part ) {
1266
-					$hide_url_part = array( 'gd_region' );
1267
-				} else if ( ! $hide_region_part && $hide_country_part ) {
1268
-					$hide_url_part = array( 'gd_country' );
1259
+			if ($location_manager) {
1260
+				$hide_country_part = get_option('geodir_location_hide_country_part');
1261
+				$hide_region_part  = get_option('geodir_location_hide_region_part');
1262
+
1263
+				if ($hide_region_part && $hide_country_part) {
1264
+					$hide_url_part = array('gd_country', 'gd_region');
1265
+				} else if ($hide_region_part && !$hide_country_part) {
1266
+					$hide_url_part = array('gd_region');
1267
+				} else if (!$hide_region_part && $hide_country_part) {
1268
+					$hide_url_part = array('gd_country');
1269 1269
 				}
1270 1270
 			}
1271 1271
 
1272 1272
 			$hide_text_part = array();
1273
-			if ( $geodir_show_location_url == 'country_city' ) {
1274
-				$hide_text_part = array( 'gd_region' );
1273
+			if ($geodir_show_location_url == 'country_city') {
1274
+				$hide_text_part = array('gd_region');
1275 1275
 
1276
-				if ( isset( $location_terms['gd_region'] ) && ! $location_manager ) {
1277
-					unset( $location_terms['gd_region'] );
1276
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1277
+					unset($location_terms['gd_region']);
1278 1278
 				}
1279
-			} else if ( $geodir_show_location_url == 'region_city' ) {
1280
-				$hide_text_part = array( 'gd_country' );
1279
+			} else if ($geodir_show_location_url == 'region_city') {
1280
+				$hide_text_part = array('gd_country');
1281 1281
 
1282
-				if ( isset( $location_terms['gd_country'] ) && ! $location_manager ) {
1283
-					unset( $location_terms['gd_country'] );
1282
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1283
+					unset($location_terms['gd_country']);
1284 1284
 				}
1285
-			} else if ( $geodir_show_location_url == 'city' ) {
1286
-				$hide_text_part = array( 'gd_country', 'gd_region' );
1285
+			} else if ($geodir_show_location_url == 'city') {
1286
+				$hide_text_part = array('gd_country', 'gd_region');
1287 1287
 
1288
-				if ( isset( $location_terms['gd_country'] ) && ! $location_manager ) {
1289
-					unset( $location_terms['gd_country'] );
1288
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1289
+					unset($location_terms['gd_country']);
1290 1290
 				}
1291
-				if ( isset( $location_terms['gd_region'] ) && ! $location_manager ) {
1292
-					unset( $location_terms['gd_region'] );
1291
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1292
+					unset($location_terms['gd_region']);
1293 1293
 				}
1294 1294
 			}
1295 1295
 
1296 1296
 			$is_location_last = '';
1297 1297
 			$is_taxonomy_last = '';
1298 1298
 			$breadcrumb .= '<li>';
1299
-			if ( get_query_var( $gd_post_type . 'category' ) ) {
1300
-				$gd_taxonomy = $gd_post_type . 'category';
1301
-			} elseif ( get_query_var( $gd_post_type . '_tags' ) ) {
1302
-				$gd_taxonomy = $gd_post_type . '_tags';
1299
+			if (get_query_var($gd_post_type.'category')) {
1300
+				$gd_taxonomy = $gd_post_type.'category';
1301
+			} elseif (get_query_var($gd_post_type.'_tags')) {
1302
+				$gd_taxonomy = $gd_post_type.'_tags';
1303 1303
 			}
1304 1304
 
1305
-			$breadcrumb .= $separator . '<a href="' . $listing_link . '">' . __( ucfirst( $post_type_info->label ), 'geodirectory' ) . '</a>';
1306
-			if ( ! empty( $gd_taxonomy ) || geodir_is_page( 'detail' ) ) {
1305
+			$breadcrumb .= $separator.'<a href="'.$listing_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1306
+			if (!empty($gd_taxonomy) || geodir_is_page('detail')) {
1307 1307
 				$is_location_last = false;
1308 1308
 			} else {
1309 1309
 				$is_location_last = true;
1310 1310
 			}
1311 1311
 
1312
-			if ( ! empty( $gd_taxonomy ) && geodir_is_page( 'listing' ) ) {
1312
+			if (!empty($gd_taxonomy) && geodir_is_page('listing')) {
1313 1313
 				$is_taxonomy_last = true;
1314 1314
 			} else {
1315 1315
 				$is_taxonomy_last = false;
1316 1316
 			}
1317 1317
 
1318
-			if ( ! empty( $location_terms ) ) {
1319
-				$geodir_get_locations = function_exists( 'get_actual_location_name' ) ? true : false;
1318
+			if (!empty($location_terms)) {
1319
+				$geodir_get_locations = function_exists('get_actual_location_name') ? true : false;
1320 1320
 
1321
-				foreach ( $location_terms as $key => $location_term ) {
1322
-					if ( $location_term != '' ) {
1323
-						if ( ! empty( $hide_url_part ) && in_array( $key, $hide_url_part ) ) { // Hide location part from url & breadcrumb.
1321
+				foreach ($location_terms as $key => $location_term) {
1322
+					if ($location_term != '') {
1323
+						if (!empty($hide_url_part) && in_array($key, $hide_url_part)) { // Hide location part from url & breadcrumb.
1324 1324
 							continue;
1325 1325
 						}
1326 1326
 
1327
-						$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location_term );
1328
-						$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
1329
-						$gd_location_link_text = ucfirst( $gd_location_link_text );
1327
+						$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location_term);
1328
+						$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
1329
+						$gd_location_link_text = ucfirst($gd_location_link_text);
1330 1330
 
1331 1331
 						$location_term_actual_country = '';
1332 1332
 						$location_term_actual_region  = '';
1333 1333
 						$location_term_actual_city    = '';
1334
-						if ( $geodir_get_locations ) {
1335
-							if ( $key == 'gd_country' ) {
1336
-								$location_term_actual_country = get_actual_location_name( 'country', $location_term, true );
1337
-							} else if ( $key == 'gd_region' ) {
1338
-								$location_term_actual_region = get_actual_location_name( 'region', $location_term, true );
1339
-							} else if ( $key == 'gd_city' ) {
1340
-								$location_term_actual_city = get_actual_location_name( 'city', $location_term, true );
1334
+						if ($geodir_get_locations) {
1335
+							if ($key == 'gd_country') {
1336
+								$location_term_actual_country = get_actual_location_name('country', $location_term, true);
1337
+							} else if ($key == 'gd_region') {
1338
+								$location_term_actual_region = get_actual_location_name('region', $location_term, true);
1339
+							} else if ($key == 'gd_city') {
1340
+								$location_term_actual_city = get_actual_location_name('city', $location_term, true);
1341 1341
 							}
1342 1342
 						} else {
1343 1343
 							$location_info = geodir_get_location();
1344 1344
 
1345
-							if ( ! empty( $location_info ) && isset( $location_info->location_id ) ) {
1346
-								if ( $key == 'gd_country' ) {
1347
-									$location_term_actual_country = __( $location_info->country, 'geodirectory' );
1348
-								} else if ( $key == 'gd_region' ) {
1349
-									$location_term_actual_region = __( $location_info->region, 'geodirectory' );
1350
-								} else if ( $key == 'gd_city' ) {
1351
-									$location_term_actual_city = __( $location_info->city, 'geodirectory' );
1345
+							if (!empty($location_info) && isset($location_info->location_id)) {
1346
+								if ($key == 'gd_country') {
1347
+									$location_term_actual_country = __($location_info->country, 'geodirectory');
1348
+								} else if ($key == 'gd_region') {
1349
+									$location_term_actual_region = __($location_info->region, 'geodirectory');
1350
+								} else if ($key == 'gd_city') {
1351
+									$location_term_actual_city = __($location_info->city, 'geodirectory');
1352 1352
 								}
1353 1353
 							}
1354 1354
 						}
1355 1355
 
1356
-						if ( $is_location_last && $key == 'gd_country' && ! ( isset( $location_terms['gd_region'] ) && $location_terms['gd_region'] != '' ) && ! ( isset( $location_terms['gd_city'] ) && $location_terms['gd_city'] != '' ) ) {
1357
-							$breadcrumb .= $location_term_actual_country != '' ? $separator . $location_term_actual_country : $separator . $gd_location_link_text;
1358
-						} else if ( $is_location_last && $key == 'gd_region' && ! ( isset( $location_terms['gd_city'] ) && $location_terms['gd_city'] != '' ) ) {
1359
-							$breadcrumb .= $location_term_actual_region != '' ? $separator . $location_term_actual_region : $separator . $gd_location_link_text;
1360
-						} else if ( $is_location_last && $key == 'gd_city' && empty( $location_terms['gd_neighbourhood'] ) ) {
1361
-							$breadcrumb .= $location_term_actual_city != '' ? $separator . $location_term_actual_city : $separator . $gd_location_link_text;
1362
-						} else if ( $is_location_last && $key == 'gd_neighbourhood' ) {
1363
-							$breadcrumb .= $separator . $gd_location_link_text;
1356
+						if ($is_location_last && $key == 'gd_country' && !(isset($location_terms['gd_region']) && $location_terms['gd_region'] != '') && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1357
+							$breadcrumb .= $location_term_actual_country != '' ? $separator.$location_term_actual_country : $separator.$gd_location_link_text;
1358
+						} else if ($is_location_last && $key == 'gd_region' && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1359
+							$breadcrumb .= $location_term_actual_region != '' ? $separator.$location_term_actual_region : $separator.$gd_location_link_text;
1360
+						} else if ($is_location_last && $key == 'gd_city' && empty($location_terms['gd_neighbourhood'])) {
1361
+							$breadcrumb .= $location_term_actual_city != '' ? $separator.$location_term_actual_city : $separator.$gd_location_link_text;
1362
+						} else if ($is_location_last && $key == 'gd_neighbourhood') {
1363
+							$breadcrumb .= $separator.$gd_location_link_text;
1364 1364
 						} else {
1365
-							if ( get_option( 'permalink_structure' ) != '' ) {
1366
-								$location_link .= $location_term . '/';
1365
+							if (get_option('permalink_structure') != '') {
1366
+								$location_link .= $location_term.'/';
1367 1367
 							} else {
1368
-								$location_link .= "&$key=" . $location_term;
1368
+								$location_link .= "&$key=".$location_term;
1369 1369
 							}
1370 1370
 
1371
-							if ( $key == 'gd_country' && $location_term_actual_country != '' ) {
1371
+							if ($key == 'gd_country' && $location_term_actual_country != '') {
1372 1372
 								$gd_location_link_text = $location_term_actual_country;
1373
-							} else if ( $key == 'gd_region' && $location_term_actual_region != '' ) {
1373
+							} else if ($key == 'gd_region' && $location_term_actual_region != '') {
1374 1374
 								$gd_location_link_text = $location_term_actual_region;
1375
-							} else if ( $key == 'gd_city' && $location_term_actual_city != '' ) {
1375
+							} else if ($key == 'gd_city' && $location_term_actual_city != '') {
1376 1376
 								$gd_location_link_text = $location_term_actual_city;
1377 1377
 							}
1378 1378
 
@@ -1382,76 +1382,76 @@  discard block
 block discarded – undo
1382 1382
                             }
1383 1383
                             */
1384 1384
 
1385
-							$breadcrumb .= $separator . '<a href="' . $location_link . '">' . $gd_location_link_text . '</a>';
1385
+							$breadcrumb .= $separator.'<a href="'.$location_link.'">'.$gd_location_link_text.'</a>';
1386 1386
 						}
1387 1387
 					}
1388 1388
 				}
1389 1389
 			}
1390 1390
 
1391
-			if ( ! empty( $gd_taxonomy ) ) {
1391
+			if (!empty($gd_taxonomy)) {
1392 1392
 				$term_index = 1;
1393 1393
 
1394 1394
 				//if(get_option('geodir_add_categories_url'))
1395 1395
 				{
1396
-					if ( get_query_var( $gd_post_type . '_tags' ) ) {
1397
-						$cat_link = $listing_link . 'tags/';
1396
+					if (get_query_var($gd_post_type.'_tags')) {
1397
+						$cat_link = $listing_link.'tags/';
1398 1398
 					} else {
1399 1399
 						$cat_link = $listing_link;
1400 1400
 					}
1401 1401
 
1402
-					foreach ( $location_terms as $key => $location_term ) {
1403
-						if ( $location_manager && in_array( $key, $hide_url_part ) ) {
1402
+					foreach ($location_terms as $key => $location_term) {
1403
+						if ($location_manager && in_array($key, $hide_url_part)) {
1404 1404
 							continue;
1405 1405
 						}
1406 1406
 
1407
-						if ( $location_term != '' ) {
1408
-							if ( get_option( 'permalink_structure' ) != '' ) {
1409
-								$cat_link .= $location_term . '/';
1407
+						if ($location_term != '') {
1408
+							if (get_option('permalink_structure') != '') {
1409
+								$cat_link .= $location_term.'/';
1410 1410
 							}
1411 1411
 						}
1412 1412
 					}
1413 1413
 
1414
-					$term_array = explode( "/", trim( $wp_query->query[ $gd_taxonomy ], "/" ) );
1415
-					foreach ( $term_array as $term ) {
1416
-						$term_link_text = preg_replace( '/-(\d+)$/', '', $term );
1417
-						$term_link_text = preg_replace( '/[_-]/', ' ', $term_link_text );
1414
+					$term_array = explode("/", trim($wp_query->query[$gd_taxonomy], "/"));
1415
+					foreach ($term_array as $term) {
1416
+						$term_link_text = preg_replace('/-(\d+)$/', '', $term);
1417
+						$term_link_text = preg_replace('/[_-]/', ' ', $term_link_text);
1418 1418
 
1419 1419
 						// get term actual name
1420
-						$term_info = get_term_by( 'slug', $term, $gd_taxonomy, 'ARRAY_A' );
1421
-						if ( ! empty( $term_info ) && isset( $term_info['name'] ) && $term_info['name'] != '' ) {
1422
-							$term_link_text = urldecode( $term_info['name'] );
1420
+						$term_info = get_term_by('slug', $term, $gd_taxonomy, 'ARRAY_A');
1421
+						if (!empty($term_info) && isset($term_info['name']) && $term_info['name'] != '') {
1422
+							$term_link_text = urldecode($term_info['name']);
1423 1423
 						} else {
1424 1424
 							continue;
1425 1425
 							//$term_link_text = wp_strip_all_tags(geodir_ucwords(urldecode($term_link_text)));
1426 1426
 						}
1427 1427
 
1428
-						if ( $term_index == count( $term_array ) && $is_taxonomy_last ) {
1429
-							$breadcrumb .= $separator . $term_link_text;
1428
+						if ($term_index == count($term_array) && $is_taxonomy_last) {
1429
+							$breadcrumb .= $separator.$term_link_text;
1430 1430
 						} else {
1431
-							$cat_link .= $term . '/';
1432
-							$breadcrumb .= $separator . '<a href="' . $cat_link . '">' . $term_link_text . '</a>';
1431
+							$cat_link .= $term.'/';
1432
+							$breadcrumb .= $separator.'<a href="'.$cat_link.'">'.$term_link_text.'</a>';
1433 1433
 						}
1434
-						$term_index ++;
1434
+						$term_index++;
1435 1435
 					}
1436 1436
 				}
1437 1437
 
1438 1438
 
1439 1439
 			}
1440 1440
 
1441
-			if ( geodir_is_page( 'detail' ) ) {
1442
-				$breadcrumb .= $separator . get_the_title();
1441
+			if (geodir_is_page('detail')) {
1442
+				$breadcrumb .= $separator.get_the_title();
1443 1443
 			}
1444 1444
 
1445 1445
 			$breadcrumb .= '</li>';
1446 1446
 
1447 1447
 
1448
-		} elseif ( geodir_is_page( 'author' ) ) {
1448
+		} elseif (geodir_is_page('author')) {
1449 1449
 			$user_id             = get_current_user_id();
1450
-			$author_link         = get_author_posts_url( $user_id );
1451
-			$default_author_link = geodir_getlink( $author_link, array(
1450
+			$author_link         = get_author_posts_url($user_id);
1451
+			$default_author_link = geodir_getlink($author_link, array(
1452 1452
 				'geodir_dashbord' => 'true',
1453 1453
 				'stype'           => 'gd_place'
1454
-			), false );
1454
+			), false);
1455 1455
 
1456 1456
 			/**
1457 1457
 			 * Filter author page link.
@@ -1461,16 +1461,16 @@  discard block
 block discarded – undo
1461 1461
 			 * @param string $default_author_link Default author link.
1462 1462
 			 * @param int $user_id                Author ID.
1463 1463
 			 */
1464
-			$default_author_link = apply_filters( 'geodir_dashboard_author_link', $default_author_link, $user_id );
1464
+			$default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_id);
1465 1465
 
1466 1466
 			$breadcrumb .= '<li>';
1467
-			$breadcrumb .= $separator . '<a href="' . $default_author_link . '">' . __( 'My Dashboard', 'geodirectory' ) . '</a>';
1467
+			$breadcrumb .= $separator.'<a href="'.$default_author_link.'">'.__('My Dashboard', 'geodirectory').'</a>';
1468 1468
 
1469
-			if ( isset( $_REQUEST['list'] ) ) {
1470
-				$author_link = geodir_getlink( $author_link, array(
1469
+			if (isset($_REQUEST['list'])) {
1470
+				$author_link = geodir_getlink($author_link, array(
1471 1471
 					'geodir_dashbord' => 'true',
1472 1472
 					'stype'           => $_REQUEST['stype']
1473
-				), false );
1473
+				), false);
1474 1474
 
1475 1475
 				/**
1476 1476
 				 * Filter author page link.
@@ -1481,61 +1481,61 @@  discard block
 block discarded – undo
1481 1481
 				 * @param int $user_id        Author ID.
1482 1482
 				 * @param string $_REQUEST    ['stype'] Post type.
1483 1483
 				 */
1484
-				$author_link = apply_filters( 'geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype'] );
1484
+				$author_link = apply_filters('geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype']);
1485 1485
 
1486
-				$breadcrumb .= $separator . '<a href="' . $author_link . '">' . __( ucfirst( $post_type_info->label ), 'geodirectory' ) . '</a>';
1487
-				$breadcrumb .= $separator . ucfirst( __( 'My', 'geodirectory' ) . ' ' . $_REQUEST['list'] );
1486
+				$breadcrumb .= $separator.'<a href="'.$author_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1487
+				$breadcrumb .= $separator.ucfirst(__('My', 'geodirectory').' '.$_REQUEST['list']);
1488 1488
 			} else {
1489
-				$breadcrumb .= $separator . __( ucfirst( $post_type_info->label ), 'geodirectory' );
1489
+				$breadcrumb .= $separator.__(ucfirst($post_type_info->label), 'geodirectory');
1490 1490
 			}
1491 1491
 
1492 1492
 			$breadcrumb .= '</li>';
1493
-		} elseif ( is_category() || is_single() ) {
1493
+		} elseif (is_category() || is_single()) {
1494 1494
 			$category = get_the_category();
1495
-			if ( is_category() ) {
1496
-				$breadcrumb .= '<li>' . $separator . $category[0]->cat_name . '</li>';
1495
+			if (is_category()) {
1496
+				$breadcrumb .= '<li>'.$separator.$category[0]->cat_name.'</li>';
1497 1497
 			}
1498
-			if ( is_single() ) {
1499
-				$breadcrumb .= '<li>' . $separator . '<a href="' . get_category_link( $category[0]->term_id ) . '">' . $category[0]->cat_name . '</a></li>';
1500
-				$breadcrumb .= '<li>' . $separator . get_the_title() . '</li>';
1498
+			if (is_single()) {
1499
+				$breadcrumb .= '<li>'.$separator.'<a href="'.get_category_link($category[0]->term_id).'">'.$category[0]->cat_name.'</a></li>';
1500
+				$breadcrumb .= '<li>'.$separator.get_the_title().'</li>';
1501 1501
 			}
1502 1502
 			/* End of my version ##################################################### */
1503
-		} else if ( is_page() ) {
1503
+		} else if (is_page()) {
1504 1504
 			$page_title = get_the_title();
1505 1505
 
1506
-			if ( geodir_is_page( 'location' ) ) {
1506
+			if (geodir_is_page('location')) {
1507 1507
 				$location_page_id = geodir_location_page_id();
1508
-				$loc_post         = get_post( $location_page_id );
1508
+				$loc_post         = get_post($location_page_id);
1509 1509
 				$post_name        = $loc_post->post_name;
1510
-				$slug             = ucwords( str_replace( '-', ' ', $post_name ) );
1511
-				$page_title       = ! empty( $slug ) ? $slug : __( 'Location', 'geodirectory' );
1510
+				$slug             = ucwords(str_replace('-', ' ', $post_name));
1511
+				$page_title       = !empty($slug) ? $slug : __('Location', 'geodirectory');
1512 1512
 			}
1513 1513
 
1514
-			$breadcrumb .= '<li>' . $separator;
1515
-			$breadcrumb .= stripslashes_deep( $page_title );
1514
+			$breadcrumb .= '<li>'.$separator;
1515
+			$breadcrumb .= stripslashes_deep($page_title);
1516 1516
 			$breadcrumb .= '</li>';
1517
-		} else if ( is_tag() ) {
1518
-			$breadcrumb .= "<li> " . $separator . single_tag_title( '', false ) . '</li>';
1519
-		} else if ( is_day() ) {
1520
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1521
-			the_time( 'F jS, Y' );
1517
+		} else if (is_tag()) {
1518
+			$breadcrumb .= "<li> ".$separator.single_tag_title('', false).'</li>';
1519
+		} else if (is_day()) {
1520
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1521
+			the_time('F jS, Y');
1522 1522
 			$breadcrumb .= '</li>';
1523
-		} else if ( is_month() ) {
1524
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1525
-			the_time( 'F, Y' );
1523
+		} else if (is_month()) {
1524
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1525
+			the_time('F, Y');
1526 1526
 			$breadcrumb .= '</li>';
1527
-		} else if ( is_year() ) {
1528
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1529
-			the_time( 'Y' );
1527
+		} else if (is_year()) {
1528
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1529
+			the_time('Y');
1530 1530
 			$breadcrumb .= '</li>';
1531
-		} else if ( is_author() ) {
1532
-			$breadcrumb .= "<li> " . $separator . __( " Author Archive", 'geodirectory' );
1531
+		} else if (is_author()) {
1532
+			$breadcrumb .= "<li> ".$separator.__(" Author Archive", 'geodirectory');
1533 1533
 			$breadcrumb .= '</li>';
1534
-		} else if ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) {
1535
-			$breadcrumb .= "<li>" . $separator . __( "Blog Archives", 'geodirectory' );
1534
+		} else if (isset($_GET['paged']) && !empty($_GET['paged'])) {
1535
+			$breadcrumb .= "<li>".$separator.__("Blog Archives", 'geodirectory');
1536 1536
 			$breadcrumb .= '</li>';
1537
-		} else if ( is_search() ) {
1538
-			$breadcrumb .= "<li> " . $separator . __( " Search Results", 'geodirectory' );
1537
+		} else if (is_search()) {
1538
+			$breadcrumb .= "<li> ".$separator.__(" Search Results", 'geodirectory');
1539 1539
 			$breadcrumb .= '</li>';
1540 1540
 		}
1541 1541
 		$breadcrumb .= '</ul></div>';
@@ -1548,13 +1548,13 @@  discard block
 block discarded – undo
1548 1548
 		 * @param string $breadcrumb Breadcrumb HTML.
1549 1549
 		 * @param string $separator  Breadcrumb separator.
1550 1550
 		 */
1551
-		echo $breadcrumb = apply_filters( 'geodir_breadcrumb', $breadcrumb, $separator );
1551
+		echo $breadcrumb = apply_filters('geodir_breadcrumb', $breadcrumb, $separator);
1552 1552
 	}
1553 1553
 }
1554 1554
 
1555 1555
 
1556
-add_action( "admin_init", "geodir_allow_wpadmin" ); // check user is admin
1557
-if ( ! function_exists( 'geodir_allow_wpadmin' ) ) {
1556
+add_action("admin_init", "geodir_allow_wpadmin"); // check user is admin
1557
+if (!function_exists('geodir_allow_wpadmin')) {
1558 1558
 	/**
1559 1559
 	 * Allow only admins to access wp-admin.
1560 1560
 	 *
@@ -1566,12 +1566,12 @@  discard block
 block discarded – undo
1566 1566
 	 */
1567 1567
 	function geodir_allow_wpadmin() {
1568 1568
 		global $wpdb;
1569
-		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) // checking action in request to allow ajax request go through
1569
+		if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && (!defined('DOING_AJAX'))) // checking action in request to allow ajax request go through
1570 1570
 		{
1571
-			if ( current_user_can( 'administrator' ) ) {
1571
+			if (current_user_can('administrator')) {
1572 1572
 			} else {
1573 1573
 
1574
-				wp_redirect( home_url() );
1574
+				wp_redirect(home_url());
1575 1575
 				exit;
1576 1576
 			}
1577 1577
 
@@ -1590,23 +1590,23 @@  discard block
 block discarded – undo
1590 1590
  *
1591 1591
  * @return array|WP_Error The uploaded data as array. When failure returns error.
1592 1592
  */
1593
-function fetch_remote_file( $url ) {
1593
+function fetch_remote_file($url) {
1594 1594
 	// extract the file name and extension from the url
1595
-	require_once( ABSPATH . 'wp-includes/pluggable.php' );
1596
-	$file_name = basename( $url );
1597
-	if ( strpos( $file_name, '?' ) !== false ) {
1598
-		list( $file_name ) = explode( '?', $file_name );
1595
+	require_once(ABSPATH.'wp-includes/pluggable.php');
1596
+	$file_name = basename($url);
1597
+	if (strpos($file_name, '?') !== false) {
1598
+		list($file_name) = explode('?', $file_name);
1599 1599
 	}
1600 1600
 	$dummy        = false;
1601 1601
 	$add_to_cache = false;
1602 1602
 	$key          = null;
1603
-	if ( strpos( $url, '/dummy/' ) !== false ) {
1603
+	if (strpos($url, '/dummy/') !== false) {
1604 1604
 		$dummy = true;
1605
-		$key   = "dummy_" . str_replace( '.', '_', $file_name );
1606
-		$value = get_transient( 'cached_dummy_images' );
1607
-		if ( $value ) {
1608
-			if ( isset( $value[ $key ] ) ) {
1609
-				return $value[ $key ];
1605
+		$key   = "dummy_".str_replace('.', '_', $file_name);
1606
+		$value = get_transient('cached_dummy_images');
1607
+		if ($value) {
1608
+			if (isset($value[$key])) {
1609
+				return $value[$key];
1610 1610
 			} else {
1611 1611
 				$add_to_cache = true;
1612 1612
 			}
@@ -1617,58 +1617,58 @@  discard block
 block discarded – undo
1617 1617
 
1618 1618
 	// get placeholder file in the upload dir with a unique, sanitized filename
1619 1619
 
1620
-	$post_upload_date = isset( $post['upload_date'] ) ? $post['upload_date'] : '';
1620
+	$post_upload_date = isset($post['upload_date']) ? $post['upload_date'] : '';
1621 1621
 
1622
-	$upload = wp_upload_bits( $file_name, 0, '', $post_upload_date );
1623
-	if ( $upload['error'] ) {
1624
-		return new WP_Error( 'upload_dir_error', $upload['error'] );
1622
+	$upload = wp_upload_bits($file_name, 0, '', $post_upload_date);
1623
+	if ($upload['error']) {
1624
+		return new WP_Error('upload_dir_error', $upload['error']);
1625 1625
 	}
1626 1626
 
1627 1627
 
1628
-	sleep( 0.3 );// if multiple remote file this can cause the remote server to timeout so we add a slight delay
1628
+	sleep(0.3); // if multiple remote file this can cause the remote server to timeout so we add a slight delay
1629 1629
 
1630 1630
 	// fetch the remote url and write it to the placeholder file
1631
-	$headers = wp_remote_get( $url, array( 'stream' => true, 'filename' => $upload['file'] ) );
1631
+	$headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file']));
1632 1632
 
1633 1633
 	$log_message = '';
1634
-	if ( is_wp_error( $headers ) ) {
1635
-		echo 'file: ' . $url;
1634
+	if (is_wp_error($headers)) {
1635
+		echo 'file: '.$url;
1636 1636
 
1637
-		return new WP_Error( 'import_file_error', $headers->get_error_message() );
1637
+		return new WP_Error('import_file_error', $headers->get_error_message());
1638 1638
 	}
1639 1639
 
1640
-	$filesize = filesize( $upload['file'] );
1640
+	$filesize = filesize($upload['file']);
1641 1641
 	// request failed
1642
-	if ( ! $headers ) {
1643
-		$log_message = __( 'Remote server did not respond', 'geodirectory' );
1642
+	if (!$headers) {
1643
+		$log_message = __('Remote server did not respond', 'geodirectory');
1644 1644
 	} // make sure the fetch was successful
1645
-	elseif ( $headers['response']['code'] != '200' ) {
1646
-		$log_message = sprintf( __( 'Remote server returned error response %1$d %2$s', 'geodirectory' ), esc_html( $headers['response'] ), get_status_header_desc( $headers['response'] ) );
1647
-	} elseif ( isset( $headers['headers']['content-length'] ) && $filesize != $headers['headers']['content-length'] ) {
1648
-		$log_message = __( 'Remote file is incorrect size', 'geodirectory' );
1649
-	} elseif ( 0 == $filesize ) {
1650
-		$log_message = __( 'Zero size file downloaded', 'geodirectory' );
1651
-	}
1652
-
1653
-	if ( $log_message ) {
1654
-		$del = unlink( $upload['file'] );
1655
-		if ( ! $del ) {
1656
-			geodir_error_log( __( 'GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory' ) );
1645
+	elseif ($headers['response']['code'] != '200') {
1646
+		$log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response']));
1647
+	} elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) {
1648
+		$log_message = __('Remote file is incorrect size', 'geodirectory');
1649
+	} elseif (0 == $filesize) {
1650
+		$log_message = __('Zero size file downloaded', 'geodirectory');
1651
+	}
1652
+
1653
+	if ($log_message) {
1654
+		$del = unlink($upload['file']);
1655
+		if (!$del) {
1656
+			geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));
1657 1657
 		}
1658 1658
 
1659
-		return new WP_Error( 'import_file_error', $log_message );
1659
+		return new WP_Error('import_file_error', $log_message);
1660 1660
 	}
1661 1661
 
1662
-	if ( $dummy && $add_to_cache && is_array( $upload ) ) {
1663
-		$images = get_transient( 'cached_dummy_images' );
1664
-		if ( is_array( $images ) ) {
1665
-			$images[ $key ] = $upload;
1662
+	if ($dummy && $add_to_cache && is_array($upload)) {
1663
+		$images = get_transient('cached_dummy_images');
1664
+		if (is_array($images)) {
1665
+			$images[$key] = $upload;
1666 1666
 		} else {
1667
-			$images = array( $key => $upload );
1667
+			$images = array($key => $upload);
1668 1668
 		}
1669 1669
 
1670 1670
 		//setting the cache using the WP Transient API
1671
-		set_transient( 'cached_dummy_images', $images, 60 * 10 ); //10 minutes cache
1671
+		set_transient('cached_dummy_images', $images, 60 * 10); //10 minutes cache
1672 1672
 	}
1673 1673
 
1674 1674
 	return $upload;
@@ -1682,12 +1682,12 @@  discard block
 block discarded – undo
1682 1682
  * @return string|void Max upload size.
1683 1683
  */
1684 1684
 function geodir_max_upload_size() {
1685
-	$max_filesize = (float) get_option( 'geodir_upload_max_filesize', 2 );
1685
+	$max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1686 1686
 
1687
-	if ( $max_filesize > 0 && $max_filesize < 1 ) {
1688
-		$max_filesize = (int) ( $max_filesize * 1024 ) . 'kb';
1687
+	if ($max_filesize > 0 && $max_filesize < 1) {
1688
+		$max_filesize = (int) ($max_filesize * 1024).'kb';
1689 1689
 	} else {
1690
-		$max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1690
+		$max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1691 1691
 	}
1692 1692
 
1693 1693
 	/**
@@ -1697,7 +1697,7 @@  discard block
 block discarded – undo
1697 1697
 	 *
1698 1698
 	 * @param string $max_filesize Max file upload size. Ex. 10mb, 512kb.
1699 1699
 	 */
1700
-	return apply_filters( 'geodir_default_image_upload_size_limit', $max_filesize );
1700
+	return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1701 1701
 }
1702 1702
 
1703 1703
 /**
@@ -1710,8 +1710,8 @@  discard block
 block discarded – undo
1710 1710
  * @return bool If dummy folder exists returns true, else false.
1711 1711
  */
1712 1712
 function geodir_dummy_folder_exists() {
1713
-	$path = geodir_plugin_path() . '/geodirectory-admin/dummy/';
1714
-	if ( ! is_dir( $path ) ) {
1713
+	$path = geodir_plugin_path().'/geodirectory-admin/dummy/';
1714
+	if (!is_dir($path)) {
1715 1715
 		return false;
1716 1716
 	} else {
1717 1717
 		return true;
@@ -1730,17 +1730,17 @@  discard block
 block discarded – undo
1730 1730
  *
1731 1731
  * @return object Author info.
1732 1732
  */
1733
-function geodir_get_author_info( $aid ) {
1733
+function geodir_get_author_info($aid) {
1734 1734
 	global $wpdb;
1735 1735
 	/*$infosql = "select * from $wpdb->users where ID=$aid";*/
1736
-	$infosql = $wpdb->prepare( "select * from $wpdb->users where ID=%d", array( $aid ) );
1737
-	$info    = $wpdb->get_results( $infosql );
1738
-	if ( $info ) {
1736
+	$infosql = $wpdb->prepare("select * from $wpdb->users where ID=%d", array($aid));
1737
+	$info    = $wpdb->get_results($infosql);
1738
+	if ($info) {
1739 1739
 		return $info[0];
1740 1740
 	}
1741 1741
 }
1742 1742
 
1743
-if ( ! function_exists( 'adminEmail' ) ) {
1743
+if (!function_exists('adminEmail')) {
1744 1744
 	/**
1745 1745
 	 * Send emails to client on post submission, renew etc.
1746 1746
 	 *
@@ -1753,67 +1753,67 @@  discard block
 block discarded – undo
1753 1753
 	 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1754 1754
 	 * @param string $custom_1     Custom data to be sent.
1755 1755
 	 */
1756
-	function adminEmail( $page_id, $user_id, $message_type, $custom_1 = '' ) {
1756
+	function adminEmail($page_id, $user_id, $message_type, $custom_1 = '') {
1757 1757
 		global $wpdb;
1758
-		if ( $message_type == 'expiration' ) {
1759
-			$subject        = stripslashes( __( get_option( 'renew_email_subject' ), 'geodirectory' ) );
1760
-			$client_message = stripslashes( __( get_option( 'renew_email_content' ), 'geodirectory' ) );
1761
-		} elseif ( $message_type == 'post_submited' ) {
1762
-			$subject        = __( get_option( 'post_submited_success_email_subject_admin' ), 'geodirectory' );
1763
-			$client_message = __( get_option( 'post_submited_success_email_content_admin' ), 'geodirectory' );
1764
-		} elseif ( $message_type == 'renew' ) {
1765
-			$subject        = __( get_option( 'post_renew_success_email_subject_admin' ), 'geodirectory' );
1766
-			$client_message = __( get_option( 'post_renew_success_email_content_admin' ), 'geodirectory' );
1767
-		} elseif ( $message_type == 'upgrade' ) {
1768
-			$subject        = __( get_option( 'post_upgrade_success_email_subject_admin' ), 'geodirectory' );
1769
-			$client_message = __( get_option( 'post_upgrade_success_email_content_admin' ), 'geodirectory' );
1770
-		} elseif ( $message_type == 'claim_approved' ) {
1771
-			$subject        = __( get_option( 'claim_approved_email_subject' ), 'geodirectory' );
1772
-			$client_message = __( get_option( 'claim_approved_email_content' ), 'geodirectory' );
1773
-		} elseif ( $message_type == 'claim_rejected' ) {
1774
-			$subject        = __( get_option( 'claim_rejected_email_subject' ), 'geodirectory' );
1775
-			$client_message = __( get_option( 'claim_rejected_email_content' ), 'geodirectory' );
1776
-		} elseif ( $message_type == 'claim_requested' ) {
1777
-			$subject        = __( get_option( 'claim_email_subject_admin' ), 'geodirectory' );
1778
-			$client_message = __( get_option( 'claim_email_content_admin' ), 'geodirectory' );
1779
-		} elseif ( $message_type == 'auto_claim' ) {
1780
-			$subject        = __( get_option( 'auto_claim_email_subject' ), 'geodirectory' );
1781
-			$client_message = __( get_option( 'auto_claim_email_content' ), 'geodirectory' );
1782
-		} elseif ( $message_type == 'payment_success' ) {
1783
-			$subject        = __( get_option( 'post_payment_success_admin_email_subject' ), 'geodirectory' );
1784
-			$client_message = __( get_option( 'post_payment_success_admin_email_content' ), 'geodirectory' );
1785
-		} elseif ( $message_type == 'payment_fail' ) {
1786
-			$subject        = __( get_option( 'post_payment_fail_admin_email_subject' ), 'geodirectory' );
1787
-			$client_message = __( get_option( 'post_payment_fail_admin_email_content' ), 'geodirectory' );
1758
+		if ($message_type == 'expiration') {
1759
+			$subject        = stripslashes(__(get_option('renew_email_subject'), 'geodirectory'));
1760
+			$client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory'));
1761
+		} elseif ($message_type == 'post_submited') {
1762
+			$subject        = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory');
1763
+			$client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory');
1764
+		} elseif ($message_type == 'renew') {
1765
+			$subject        = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory');
1766
+			$client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory');
1767
+		} elseif ($message_type == 'upgrade') {
1768
+			$subject        = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory');
1769
+			$client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory');
1770
+		} elseif ($message_type == 'claim_approved') {
1771
+			$subject        = __(get_option('claim_approved_email_subject'), 'geodirectory');
1772
+			$client_message = __(get_option('claim_approved_email_content'), 'geodirectory');
1773
+		} elseif ($message_type == 'claim_rejected') {
1774
+			$subject        = __(get_option('claim_rejected_email_subject'), 'geodirectory');
1775
+			$client_message = __(get_option('claim_rejected_email_content'), 'geodirectory');
1776
+		} elseif ($message_type == 'claim_requested') {
1777
+			$subject        = __(get_option('claim_email_subject_admin'), 'geodirectory');
1778
+			$client_message = __(get_option('claim_email_content_admin'), 'geodirectory');
1779
+		} elseif ($message_type == 'auto_claim') {
1780
+			$subject        = __(get_option('auto_claim_email_subject'), 'geodirectory');
1781
+			$client_message = __(get_option('auto_claim_email_content'), 'geodirectory');
1782
+		} elseif ($message_type == 'payment_success') {
1783
+			$subject        = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory');
1784
+			$client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory');
1785
+		} elseif ($message_type == 'payment_fail') {
1786
+			$subject        = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory');
1787
+			$client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory');
1788 1788
 		}
1789 1789
 		$transaction_details = $custom_1;
1790
-		$fromEmail           = get_option( 'site_email' );
1790
+		$fromEmail           = get_option('site_email');
1791 1791
 		$fromEmailName       = get_site_emailName();
1792 1792
 //$alivedays = get_post_meta($page_id,'alive_days',true);
1793
-		$pkg_limit            = get_property_price_info_listing( $page_id );
1793
+		$pkg_limit            = get_property_price_info_listing($page_id);
1794 1794
 		$alivedays            = $pkg_limit['days'];
1795
-		$productlink          = get_permalink( $page_id );
1796
-		$post_info            = get_post( $page_id );
1797
-		$post_date            = date( 'dS F,Y', strtotime( $post_info->post_date ) );
1798
-		$listingLink          = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1795
+		$productlink          = get_permalink($page_id);
1796
+		$post_info            = get_post($page_id);
1797
+		$post_date            = date('dS F,Y', strtotime($post_info->post_date));
1798
+		$listingLink          = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
1799 1799
 		$loginurl             = geodir_login_url();
1800
-		$loginurl_link        = '<a href="' . $loginurl . '">login</a>';
1800
+		$loginurl_link        = '<a href="'.$loginurl.'">login</a>';
1801 1801
 		$siteurl              = home_url();
1802
-		$siteurl_link         = '<a href="' . $siteurl . '">' . $fromEmailName . '</a>';
1803
-		$user_info            = get_userdata( $user_id );
1802
+		$siteurl_link         = '<a href="'.$siteurl.'">'.$fromEmailName.'</a>';
1803
+		$user_info            = get_userdata($user_id);
1804 1804
 		$user_email           = $user_info->user_email;
1805
-		$display_name         = geodir_get_client_name( $user_id );
1805
+		$display_name         = geodir_get_client_name($user_id);
1806 1806
 		$user_login           = $user_info->user_login;
1807
-		$number_of_grace_days = get_option( 'ptthemes_listing_preexpiry_notice_days' );
1808
-		if ( $number_of_grace_days == '' ) {
1807
+		$number_of_grace_days = get_option('ptthemes_listing_preexpiry_notice_days');
1808
+		if ($number_of_grace_days == '') {
1809 1809
 			$number_of_grace_days = 1;
1810 1810
 		}
1811
-		if ( $post_info->post_type == 'event' ) {
1811
+		if ($post_info->post_type == 'event') {
1812 1812
 			$post_type = 'event';
1813 1813
 		} else {
1814 1814
 			$post_type = 'listing';
1815 1815
 		}
1816
-		$renew_link     = '<a href="' . $siteurl . '?ptype=post_' . $post_type . '&renew=1&pid=' . $page_id . '">' . RENEW_LINK . '</a>';
1816
+		$renew_link     = '<a href="'.$siteurl.'?ptype=post_'.$post_type.'&renew=1&pid='.$page_id.'">'.RENEW_LINK.'</a>';
1817 1817
 		$search_array   = array(
1818 1818
 			'[#client_name#]',
1819 1819
 			'[#listing_link#]',
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
 			'[#site_name#]',
1830 1830
 			'[#transaction_details#]'
1831 1831
 		);
1832
-		$replace_array  = array(
1832
+		$replace_array = array(
1833 1833
 			$display_name,
1834 1834
 			$listingLink,
1835 1835
 			$post_date,
@@ -1844,13 +1844,13 @@  discard block
 block discarded – undo
1844 1844
 			$fromEmailName,
1845 1845
 			$transaction_details
1846 1846
 		);
1847
-		$client_message = str_replace( $search_array, $replace_array, $client_message );
1848
-		$subject        = str_replace( $search_array, $replace_array, $subject );
1847
+		$client_message = str_replace($search_array, $replace_array, $client_message);
1848
+		$subject        = str_replace($search_array, $replace_array, $subject);
1849 1849
 		
1850 1850
 		
1851
-		$headers  = array();
1851
+		$headers = array();
1852 1852
 		$headers[] = 'Content-type: text/html; charset=UTF-8';
1853
-		$headers[] = 'From: ' . $fromEmailName . ' <' . $fromEmail . '>';
1853
+		$headers[] = 'From: '.$fromEmailName.' <'.$fromEmail.'>';
1854 1854
 
1855 1855
 		$to      = $fromEmail;
1856 1856
 		$message = $client_message;
@@ -1868,7 +1868,7 @@  discard block
 block discarded – undo
1868 1868
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1869 1869
 		 * @param string $custom_1     Custom data to be sent.
1870 1870
 		 */
1871
-		$to = apply_filters( 'geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1 );
1871
+		$to = apply_filters('geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1);
1872 1872
 		/**
1873 1873
 		 * Filter the admin email subject.
1874 1874
 		 *
@@ -1881,7 +1881,7 @@  discard block
 block discarded – undo
1881 1881
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1882 1882
 		 * @param string $custom_1     Custom data to be sent.
1883 1883
 		 */
1884
-		$subject = apply_filters( 'geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1 );
1884
+		$subject = apply_filters('geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1);
1885 1885
 		/**
1886 1886
 		 * Filter the admin email message.
1887 1887
 		 *
@@ -1894,7 +1894,7 @@  discard block
 block discarded – undo
1894 1894
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1895 1895
 		 * @param string $custom_1     Custom data to be sent.
1896 1896
 		 */
1897
-		$message = apply_filters( 'geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1 );
1897
+		$message = apply_filters('geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1);
1898 1898
 		/**
1899 1899
 		 * Filter the admin email headers.
1900 1900
 		 *
@@ -1907,22 +1907,22 @@  discard block
 block discarded – undo
1907 1907
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1908 1908
 		 * @param string $custom_1     Custom data to be sent.
1909 1909
 		 */
1910
-		$headers = apply_filters( 'geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1 );
1910
+		$headers = apply_filters('geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1);
1911 1911
 
1912 1912
 
1913
-		$sent = wp_mail( $to, $subject, $message, $headers );
1914
-		if ( ! $sent ) {
1915
-			if ( is_array( $to ) ) {
1916
-				$to = implode( ',', $to );
1913
+		$sent = wp_mail($to, $subject, $message, $headers);
1914
+		if (!$sent) {
1915
+			if (is_array($to)) {
1916
+				$to = implode(',', $to);
1917 1917
 			}
1918 1918
 			$log_message = sprintf(
1919
-				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1919
+				__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1920 1920
 				$message_type,
1921
-				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1921
+				date_i18n('F j Y H:i:s', current_time('timestamp')),
1922 1922
 				$to,
1923 1923
 				$subject
1924 1924
 			);
1925
-			geodir_error_log( $log_message );
1925
+			geodir_error_log($log_message);
1926 1926
 		}
1927 1927
 	}
1928 1928
 }
@@ -1942,12 +1942,12 @@  discard block
 block discarded – undo
1942 1942
  *
1943 1943
  * @return array Category IDs.
1944 1944
  */
1945
-function gd_lang_object_ids( $ids_array, $type ) {
1946
-	if ( function_exists( 'icl_object_id' ) ) {
1945
+function gd_lang_object_ids($ids_array, $type) {
1946
+	if (function_exists('icl_object_id')) {
1947 1947
 		$res = array();
1948
-		foreach ( $ids_array as $id ) {
1949
-			$xlat = icl_object_id( $id, $type, false );
1950
-			if ( ! is_null( $xlat ) ) {
1948
+		foreach ($ids_array as $id) {
1949
+			$xlat = icl_object_id($id, $type, false);
1950
+			if (!is_null($xlat)) {
1951 1951
 				$res[] = $xlat;
1952 1952
 			}
1953 1953
 		}
@@ -1971,20 +1971,20 @@  discard block
 block discarded – undo
1971 1971
  *
1972 1972
  * @return array Modified Body CSS classes.
1973 1973
  */
1974
-function geodir_custom_posts_body_class( $classes ) {
1974
+function geodir_custom_posts_body_class($classes) {
1975 1975
 	global $wpdb, $wp;
1976
-	$post_types = geodir_get_posttypes( 'object' );
1977
-	if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) {
1976
+	$post_types = geodir_get_posttypes('object');
1977
+	if (!empty($post_types) && count((array) $post_types) > 1) {
1978 1978
 		$classes[] = 'geodir_custom_posts';
1979 1979
 	}
1980 1980
 
1981 1981
 	// fix body class for signup page
1982
-	if ( geodir_is_page( 'login' ) ) {
1982
+	if (geodir_is_page('login')) {
1983 1983
 		$new_classes   = array();
1984 1984
 		$new_classes[] = 'signup page-geodir-signup';
1985
-		if ( ! empty( $classes ) ) {
1986
-			foreach ( $classes as $class ) {
1987
-				if ( $class && $class != 'home' && $class != 'blog' ) {
1985
+		if (!empty($classes)) {
1986
+			foreach ($classes as $class) {
1987
+				if ($class && $class != 'home' && $class != 'blog') {
1988 1988
 					$new_classes[] = $class;
1989 1989
 				}
1990 1990
 			}
@@ -1992,14 +1992,14 @@  discard block
 block discarded – undo
1992 1992
 		$classes = $new_classes;
1993 1993
 	}
1994 1994
 
1995
-	if ( geodir_is_geodir_page() ) {
1995
+	if (geodir_is_geodir_page()) {
1996 1996
 		$classes[] = 'geodir-page';
1997 1997
 	}
1998 1998
 
1999 1999
 	return $classes;
2000 2000
 }
2001 2001
 
2002
-add_filter( 'body_class', 'geodir_custom_posts_body_class' ); // let's add a class to the body so we can style the new addition to the search
2002
+add_filter('body_class', 'geodir_custom_posts_body_class'); // let's add a class to the body so we can style the new addition to the search
2003 2003
 
2004 2004
 
2005 2005
 /**
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
 	 *
2016 2016
 	 * @since 1.0.0
2017 2017
 	 */
2018
-	return apply_filters( 'geodir_map_zoom_level', array(
2018
+	return apply_filters('geodir_map_zoom_level', array(
2019 2019
 		1,
2020 2020
 		2,
2021 2021
 		3,
@@ -2035,7 +2035,7 @@  discard block
 block discarded – undo
2035 2035
 		17,
2036 2036
 		18,
2037 2037
 		19
2038
-	) );
2038
+	));
2039 2039
 
2040 2040
 }
2041 2041
 
@@ -2048,12 +2048,12 @@  discard block
 block discarded – undo
2048 2048
  *
2049 2049
  * @param string $geodir_option_name Option key.
2050 2050
  */
2051
-function geodir_option_version_backup( $geodir_option_name ) {
2051
+function geodir_option_version_backup($geodir_option_name) {
2052 2052
 	$version_date  = time();
2053
-	$geodir_option = get_option( $geodir_option_name );
2053
+	$geodir_option = get_option($geodir_option_name);
2054 2054
 
2055
-	if ( ! empty( $geodir_option ) ) {
2056
-		add_option( $geodir_option_name . '_' . $version_date, $geodir_option );
2055
+	if (!empty($geodir_option)) {
2056
+		add_option($geodir_option_name.'_'.$version_date, $geodir_option);
2057 2057
 	}
2058 2058
 }
2059 2059
 
@@ -2067,10 +2067,10 @@  discard block
 block discarded – undo
2067 2067
  *
2068 2068
  * @return int Page ID.
2069 2069
  */
2070
-function get_page_id_geodir_add_listing_page( $page_id ) {
2071
-	if ( geodir_wpml_multilingual_status() ) {
2070
+function get_page_id_geodir_add_listing_page($page_id) {
2071
+	if (geodir_wpml_multilingual_status()) {
2072 2072
 		$post_type = 'post_page';
2073
-		$page_id   = geodir_get_wpml_element_id( $page_id, $post_type );
2073
+		$page_id   = geodir_get_wpml_element_id($page_id, $post_type);
2074 2074
 	}
2075 2075
 
2076 2076
 	return $page_id;
@@ -2084,7 +2084,7 @@  discard block
 block discarded – undo
2084 2084
  * @return bool Returns true when sitepress multilingual CMS active. else returns false.
2085 2085
  */
2086 2086
 function geodir_wpml_multilingual_status() {
2087
-	if ( function_exists( 'icl_object_id' ) ) {
2087
+	if (function_exists('icl_object_id')) {
2088 2088
 		return true;
2089 2089
 	}
2090 2090
 
@@ -2102,19 +2102,19 @@  discard block
 block discarded – undo
2102 2102
  *
2103 2103
  * @return int Element ID when exists. Else the page id.
2104 2104
  */
2105
-function geodir_get_wpml_element_id( $page_id, $post_type ) {
2105
+function geodir_get_wpml_element_id($page_id, $post_type) {
2106 2106
 	global $sitepress;
2107
-	if ( geodir_wpml_multilingual_status() && ! empty( $sitepress ) && isset( $sitepress->queries ) ) {
2108
-		$trid = $sitepress->get_element_trid( $page_id, $post_type );
2107
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
2108
+		$trid = $sitepress->get_element_trid($page_id, $post_type);
2109 2109
 
2110
-		if ( $trid > 0 ) {
2111
-			$translations = $sitepress->get_element_translations( $trid, $post_type );
2110
+		if ($trid > 0) {
2111
+			$translations = $sitepress->get_element_translations($trid, $post_type);
2112 2112
 
2113 2113
 			$lang = $sitepress->get_current_language();
2114 2114
 			$lang = $lang ? $lang : $sitepress->get_default_language();
2115 2115
 
2116
-			if ( ! empty( $translations ) && ! empty( $lang ) && isset( $translations[ $lang ] ) && isset( $translations[ $lang ]->element_id ) && ! empty( $translations[ $lang ]->element_id ) ) {
2117
-				$page_id = $translations[ $lang ]->element_id;
2116
+			if (!empty($translations) && !empty($lang) && isset($translations[$lang]) && isset($translations[$lang]->element_id) && !empty($translations[$lang]->element_id)) {
2117
+				$page_id = $translations[$lang]->element_id;
2118 2118
 			}
2119 2119
 		}
2120 2120
 	}
@@ -2131,15 +2131,15 @@  discard block
 block discarded – undo
2131 2131
  */
2132 2132
 function geodir_wpml_check_element_id() {
2133 2133
 	global $sitepress;
2134
-	if ( geodir_wpml_multilingual_status() && ! empty( $sitepress ) && isset( $sitepress->queries ) ) {
2134
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
2135 2135
 		$el_type      = 'post_page';
2136
-		$el_id        = get_option( 'geodir_add_listing_page' );
2136
+		$el_id        = get_option('geodir_add_listing_page');
2137 2137
 		$default_lang = $sitepress->get_default_language();
2138
-		$el_details   = $sitepress->get_element_language_details( $el_id, $el_type );
2138
+		$el_details   = $sitepress->get_element_language_details($el_id, $el_type);
2139 2139
 
2140
-		if ( ! ( $el_id > 0 && $default_lang && ! empty( $el_details ) && isset( $el_details->language_code ) && $el_details->language_code == $default_lang ) ) {
2141
-			if ( ! $el_details->source_language_code ) {
2142
-				$sitepress->set_element_language_details( $el_id, $el_type, '', $default_lang );
2140
+		if (!($el_id > 0 && $default_lang && !empty($el_details) && isset($el_details->language_code) && $el_details->language_code == $default_lang)) {
2141
+			if (!$el_details->source_language_code) {
2142
+				$sitepress->set_element_language_details($el_id, $el_type, '', $default_lang);
2143 2143
 				$sitepress->icl_translations_cache->clear();
2144 2144
 			}
2145 2145
 		}
@@ -2158,41 +2158,41 @@  discard block
 block discarded – undo
2158 2158
  *
2159 2159
  * @return string Orderby SQL.
2160 2160
  */
2161
-function geodir_widget_listings_get_order( $query_args ) {
2161
+function geodir_widget_listings_get_order($query_args) {
2162 2162
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2163 2163
 
2164 2164
 	$query_args = $gd_query_args_widgets;
2165
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2166
-		return $wpdb->posts . ".post_date DESC, ";
2165
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2166
+		return $wpdb->posts.".post_date DESC, ";
2167 2167
 	}
2168 2168
 
2169
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2170
-	$table     = $plugin_prefix . $post_type . '_detail';
2169
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2170
+	$table     = $plugin_prefix.$post_type.'_detail';
2171 2171
 
2172
-	$sort_by = ! empty( $query_args['order_by'] ) ? $query_args['order_by'] : '';
2172
+	$sort_by = !empty($query_args['order_by']) ? $query_args['order_by'] : '';
2173 2173
 
2174
-	switch ( $sort_by ) {
2174
+	switch ($sort_by) {
2175 2175
 		case 'latest':
2176 2176
 		case 'newest':
2177
-			$orderby = $wpdb->posts . ".post_date DESC, ";
2177
+			$orderby = $wpdb->posts.".post_date DESC, ";
2178 2178
 			break;
2179 2179
 		case 'featured':
2180
-			$orderby = $table . ".is_featured ASC, ";
2180
+			$orderby = $table.".is_featured ASC, ";
2181 2181
 			break;
2182 2182
 		case 'az':
2183
-			$orderby = $wpdb->posts . ".post_title ASC, ";
2183
+			$orderby = $wpdb->posts.".post_title ASC, ";
2184 2184
 			break;
2185 2185
 		case 'high_review':
2186
-			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
2186
+			$orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, ";
2187 2187
 			break;
2188 2188
 		case 'high_rating':
2189
-			$orderby = "( " . $table . ".overall_rating  ) DESC, ";
2189
+			$orderby = "( ".$table.".overall_rating  ) DESC, ";
2190 2190
 			break;
2191 2191
 		case 'random':
2192 2192
 			$orderby = "RAND(), ";
2193 2193
 			break;
2194 2194
 		default:
2195
-			$orderby = $wpdb->posts . ".post_title ASC, ";
2195
+			$orderby = $wpdb->posts.".post_title ASC, ";
2196 2196
 			break;
2197 2197
 	}
2198 2198
 
@@ -2214,15 +2214,15 @@  discard block
 block discarded – undo
2214 2214
  *
2215 2215
  * @return mixed Result object.
2216 2216
  */
2217
-function geodir_get_widget_listings( $query_args = array(), $count_only = false ) {
2217
+function geodir_get_widget_listings($query_args = array(), $count_only = false) {
2218 2218
 	global $wpdb, $plugin_prefix, $table_prefix;
2219 2219
 	$GLOBALS['gd_query_args_widgets'] = $query_args;
2220 2220
 	$gd_query_args_widgets            = $query_args;
2221 2221
 
2222
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2223
-	$table     = $plugin_prefix . $post_type . '_detail';
2222
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2223
+	$table     = $plugin_prefix.$post_type.'_detail';
2224 2224
 
2225
-	$fields = $wpdb->posts . ".*, " . $table . ".*";
2225
+	$fields = $wpdb->posts.".*, ".$table.".*";
2226 2226
 	/**
2227 2227
 	 * Filter widget listing fields string part that is being used for query.
2228 2228
 	 *
@@ -2232,17 +2232,17 @@  discard block
 block discarded – undo
2232 2232
 	 * @param string $table     Table name.
2233 2233
 	 * @param string $post_type Post type.
2234 2234
 	 */
2235
-	$fields = apply_filters( 'geodir_filter_widget_listings_fields', $fields, $table, $post_type );
2235
+	$fields = apply_filters('geodir_filter_widget_listings_fields', $fields, $table, $post_type);
2236 2236
 
2237
-	$join = "INNER JOIN " . $table . " ON (" . $table . ".post_id = " . $wpdb->posts . ".ID)";
2237
+	$join = "INNER JOIN ".$table." ON (".$table.".post_id = ".$wpdb->posts.".ID)";
2238 2238
 
2239 2239
 	########### WPML ###########
2240 2240
 
2241
-	if ( function_exists( 'icl_object_id' ) ) {
2241
+	if (function_exists('icl_object_id')) {
2242 2242
 		global $sitepress;
2243 2243
 		$lang_code = ICL_LANGUAGE_CODE;
2244
-		if ( $lang_code ) {
2245
-			$join .= " JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
2244
+		if ($lang_code) {
2245
+			$join .= " JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID";
2246 2246
 		}
2247 2247
 	}
2248 2248
 
@@ -2256,15 +2256,15 @@  discard block
 block discarded – undo
2256 2256
 	 * @param string $join      Join clause string.
2257 2257
 	 * @param string $post_type Post type.
2258 2258
 	 */
2259
-	$join = apply_filters( 'geodir_filter_widget_listings_join', $join, $post_type );
2259
+	$join = apply_filters('geodir_filter_widget_listings_join', $join, $post_type);
2260 2260
 
2261
-	$post_status = is_super_admin() ? " OR " . $wpdb->posts . ".post_status = 'private'" : '';
2261
+	$post_status = is_super_admin() ? " OR ".$wpdb->posts.".post_status = 'private'" : '';
2262 2262
 
2263
-	$where = " AND ( " . $wpdb->posts . ".post_status = 'publish' " . $post_status . " ) AND " . $wpdb->posts . ".post_type = '" . $post_type . "'";
2263
+	$where = " AND ( ".$wpdb->posts.".post_status = 'publish' ".$post_status." ) AND ".$wpdb->posts.".post_type = '".$post_type."'";
2264 2264
 
2265 2265
 	########### WPML ###########
2266
-	if ( function_exists( 'icl_object_id' ) ) {
2267
-		if ( $lang_code ) {
2266
+	if (function_exists('icl_object_id')) {
2267
+		if ($lang_code) {
2268 2268
 			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type = 'post_$post_type' ";
2269 2269
 		}
2270 2270
 	}
@@ -2277,8 +2277,8 @@  discard block
 block discarded – undo
2277 2277
 	 * @param string $where     Where clause string.
2278 2278
 	 * @param string $post_type Post type.
2279 2279
 	 */
2280
-	$where = apply_filters( 'geodir_filter_widget_listings_where', $where, $post_type );
2281
-	$where = $where != '' ? " WHERE 1=1 " . $where : '';
2280
+	$where = apply_filters('geodir_filter_widget_listings_where', $where, $post_type);
2281
+	$where = $where != '' ? " WHERE 1=1 ".$where : '';
2282 2282
 
2283 2283
 	$groupby = " GROUP BY $wpdb->posts.ID ";
2284 2284
 	/**
@@ -2289,15 +2289,15 @@  discard block
 block discarded – undo
2289 2289
 	 * @param string $groupby   Group by clause string.
2290 2290
 	 * @param string $post_type Post type.
2291 2291
 	 */
2292
-	$groupby = apply_filters( 'geodir_filter_widget_listings_groupby', $groupby, $post_type );
2292
+	$groupby = apply_filters('geodir_filter_widget_listings_groupby', $groupby, $post_type);
2293 2293
 
2294
-	if ( $count_only ) {
2295
-		$sql  = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . "
2296
-			" . $join . "
2294
+	if ($count_only) {
2295
+		$sql  = "SELECT COUNT(".$wpdb->posts.".ID) AS total FROM ".$wpdb->posts."
2296
+			" . $join."
2297 2297
 			" . $where;
2298
-		$rows = (int) $wpdb->get_var( $sql );
2298
+		$rows = (int) $wpdb->get_var($sql);
2299 2299
 	} else {
2300
-		$orderby = geodir_widget_listings_get_order( $query_args );
2300
+		$orderby = geodir_widget_listings_get_order($query_args);
2301 2301
 		/**
2302 2302
 		 * Filter widget listing orderby clause string part that is being used for query.
2303 2303
 		 *
@@ -2307,11 +2307,11 @@  discard block
 block discarded – undo
2307 2307
 		 * @param string $table     Table name.
2308 2308
 		 * @param string $post_type Post type.
2309 2309
 		 */
2310
-		$orderby = apply_filters( 'geodir_filter_widget_listings_orderby', $orderby, $table, $post_type );
2311
-		$orderby .= $wpdb->posts . ".post_title ASC";
2312
-		$orderby = $orderby != '' ? " ORDER BY " . $orderby : '';
2310
+		$orderby = apply_filters('geodir_filter_widget_listings_orderby', $orderby, $table, $post_type);
2311
+		$orderby .= $wpdb->posts.".post_title ASC";
2312
+		$orderby = $orderby != '' ? " ORDER BY ".$orderby : '';
2313 2313
 
2314
-		$limit = ! empty( $query_args['posts_per_page'] ) ? $query_args['posts_per_page'] : 5;
2314
+		$limit = !empty($query_args['posts_per_page']) ? $query_args['posts_per_page'] : 5;
2315 2315
 		/**
2316 2316
 		 * Filter widget listing limit that is being used for query.
2317 2317
 		 *
@@ -2320,26 +2320,26 @@  discard block
 block discarded – undo
2320 2320
 		 * @param int $limit        Query results limit.
2321 2321
 		 * @param string $post_type Post type.
2322 2322
 		 */
2323
-		$limit = apply_filters( 'geodir_filter_widget_listings_limit', $limit, $post_type );
2323
+		$limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type);
2324 2324
 
2325
-		$page = ! empty( $query_args['pageno'] ) ? absint( $query_args['pageno'] ) : 1;
2326
-		if ( ! $page ) {
2325
+		$page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1;
2326
+		if (!$page) {
2327 2327
 			$page = 1;
2328 2328
 		}
2329 2329
 
2330
-		$limit = (int) $limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int) $limit ) . ", " . (int) $limit : "";
2330
+		$limit = (int) $limit > 0 ? " LIMIT ".absint(($page - 1) * (int) $limit).", ".(int) $limit : "";
2331 2331
 
2332
-		$sql  = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . "
2333
-			" . $join . "
2334
-			" . $where . "
2335
-			" . $groupby . "
2336
-			" . $orderby . "
2332
+		$sql = "SELECT SQL_CALC_FOUND_ROWS ".$fields." FROM ".$wpdb->posts."
2333
+			" . $join."
2334
+			" . $where."
2335
+			" . $groupby."
2336
+			" . $orderby."
2337 2337
 			" . $limit;
2338
-		$rows = $wpdb->get_results( $sql );
2338
+		$rows = $wpdb->get_results($sql);
2339 2339
 	}
2340 2340
 
2341
-	unset( $GLOBALS['gd_query_args_widgets'] );
2342
-	unset( $gd_query_args_widgets );
2341
+	unset($GLOBALS['gd_query_args_widgets']);
2342
+	unset($gd_query_args_widgets);
2343 2343
 
2344 2344
 	return $rows;
2345 2345
 }
@@ -2356,11 +2356,11 @@  discard block
 block discarded – undo
2356 2356
  *
2357 2357
  * @return string Modified fields SQL.
2358 2358
  */
2359
-function geodir_function_widget_listings_fields( $fields ) {
2359
+function geodir_function_widget_listings_fields($fields) {
2360 2360
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2361 2361
 
2362 2362
 	$query_args = $gd_query_args_widgets;
2363
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2363
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2364 2364
 		return $fields;
2365 2365
 	}
2366 2366
 
@@ -2379,24 +2379,24 @@  discard block
 block discarded – undo
2379 2379
  *
2380 2380
  * @return string Modified join clause SQL.
2381 2381
  */
2382
-function geodir_function_widget_listings_join( $join ) {
2382
+function geodir_function_widget_listings_join($join) {
2383 2383
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2384 2384
 
2385 2385
 	$query_args = $gd_query_args_widgets;
2386
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2386
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2387 2387
 		return $join;
2388 2388
 	}
2389 2389
 
2390
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2391
-	$table     = $plugin_prefix . $post_type . '_detail';
2390
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2391
+	$table     = $plugin_prefix.$post_type.'_detail';
2392 2392
 
2393
-	if ( ! empty( $query_args['with_pics_only'] ) ) {
2394
-		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
2393
+	if (!empty($query_args['with_pics_only'])) {
2394
+		$join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )";
2395 2395
 	}
2396 2396
 
2397
-	if ( ! empty( $query_args['tax_query'] ) ) {
2398
-		$tax_queries = get_tax_sql( $query_args['tax_query'], $wpdb->posts, 'ID' );
2399
-		if ( ! empty( $tax_queries['join'] ) && ! empty( $tax_queries['where'] ) ) {
2397
+	if (!empty($query_args['tax_query'])) {
2398
+		$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2399
+		if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2400 2400
 			$join .= $tax_queries['join'];
2401 2401
 		}
2402 2402
 	}
@@ -2416,49 +2416,49 @@  discard block
 block discarded – undo
2416 2416
  *
2417 2417
  * @return string Modified where clause SQL.
2418 2418
  */
2419
-function geodir_function_widget_listings_where( $where ) {
2419
+function geodir_function_widget_listings_where($where) {
2420 2420
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2421 2421
 
2422 2422
 	$query_args = $gd_query_args_widgets;
2423
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2423
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2424 2424
 		return $where;
2425 2425
 	}
2426
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2427
-	$table     = $plugin_prefix . $post_type . '_detail';
2426
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2427
+	$table     = $plugin_prefix.$post_type.'_detail';
2428 2428
 
2429
-	if ( ! empty( $query_args ) ) {
2430
-		if ( ! empty( $query_args['gd_location'] ) && function_exists( 'geodir_default_location_where' ) ) {
2431
-			$where = geodir_default_location_where( $where, $table );
2429
+	if (!empty($query_args)) {
2430
+		if (!empty($query_args['gd_location']) && function_exists('geodir_default_location_where')) {
2431
+			$where = geodir_default_location_where($where, $table);
2432 2432
 		}
2433 2433
 
2434
-		if ( ! empty( $query_args['post_author'] ) ) {
2435
-			$where .= " AND " . $wpdb->posts . ".post_author = " . (int) $query_args['post_author'];
2434
+		if (!empty($query_args['post_author'])) {
2435
+			$where .= " AND ".$wpdb->posts.".post_author = ".(int) $query_args['post_author'];
2436 2436
 		}
2437 2437
 
2438
-		if ( ! empty( $query_args['show_featured_only'] ) ) {
2439
-			$where .= " AND " . $table . ".is_featured = '1'";
2438
+		if (!empty($query_args['show_featured_only'])) {
2439
+			$where .= " AND ".$table.".is_featured = '1'";
2440 2440
 		}
2441 2441
 
2442
-		if ( ! empty( $query_args['show_special_only'] ) ) {
2443
-			$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
2442
+		if (!empty($query_args['show_special_only'])) {
2443
+			$where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )";
2444 2444
 		}
2445 2445
 
2446
-		if ( ! empty( $query_args['with_pics_only'] ) ) {
2447
-			$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL ";
2446
+		if (!empty($query_args['with_pics_only'])) {
2447
+			$where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL ";
2448 2448
 		}
2449 2449
 
2450
-		if ( ! empty( $query_args['featured_image_only'] ) ) {
2451
-			$where .= " AND " . $table . ".featured_image IS NOT NULL AND " . $table . ".featured_image!='' ";
2450
+		if (!empty($query_args['featured_image_only'])) {
2451
+			$where .= " AND ".$table.".featured_image IS NOT NULL AND ".$table.".featured_image!='' ";
2452 2452
 		}
2453 2453
 
2454
-		if ( ! empty( $query_args['with_videos_only'] ) ) {
2455
-			$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
2454
+		if (!empty($query_args['with_videos_only'])) {
2455
+			$where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )";
2456 2456
 		}
2457 2457
 
2458
-		if ( ! empty( $query_args['tax_query'] ) ) {
2459
-			$tax_queries = get_tax_sql( $query_args['tax_query'], $wpdb->posts, 'ID' );
2458
+		if (!empty($query_args['tax_query'])) {
2459
+			$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2460 2460
 
2461
-			if ( ! empty( $tax_queries['join'] ) && ! empty( $tax_queries['where'] ) ) {
2461
+			if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2462 2462
 				$where .= $tax_queries['where'];
2463 2463
 			}
2464 2464
 		}
@@ -2479,11 +2479,11 @@  discard block
 block discarded – undo
2479 2479
  *
2480 2480
  * @return string Modified orderby clause SQL.
2481 2481
  */
2482
-function geodir_function_widget_listings_orderby( $orderby ) {
2482
+function geodir_function_widget_listings_orderby($orderby) {
2483 2483
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2484 2484
 
2485 2485
 	$query_args = $gd_query_args_widgets;
2486
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2486
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2487 2487
 		return $orderby;
2488 2488
 	}
2489 2489
 
@@ -2502,15 +2502,15 @@  discard block
 block discarded – undo
2502 2502
  *
2503 2503
  * @return int Query limit.
2504 2504
  */
2505
-function geodir_function_widget_listings_limit( $limit ) {
2505
+function geodir_function_widget_listings_limit($limit) {
2506 2506
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2507 2507
 
2508 2508
 	$query_args = $gd_query_args_widgets;
2509
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2509
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2510 2510
 		return $limit;
2511 2511
 	}
2512 2512
 
2513
-	if ( ! empty( $query_args ) && ! empty( $query_args['posts_per_page'] ) ) {
2513
+	if (!empty($query_args) && !empty($query_args['posts_per_page'])) {
2514 2514
 		$limit = (int) $query_args['posts_per_page'];
2515 2515
 	}
2516 2516
 
@@ -2528,12 +2528,12 @@  discard block
 block discarded – undo
2528 2528
  *
2529 2529
  * @return int Large size width.
2530 2530
  */
2531
-function geodir_media_image_large_width( $default = 800, $params = '' ) {
2532
-	$large_size_w = get_option( 'large_size_w' );
2531
+function geodir_media_image_large_width($default = 800, $params = '') {
2532
+	$large_size_w = get_option('large_size_w');
2533 2533
 	$large_size_w = $large_size_w > 0 ? $large_size_w : $default;
2534
-	$large_size_w = absint( $large_size_w );
2534
+	$large_size_w = absint($large_size_w);
2535 2535
 
2536
-	if ( ! get_option( 'geodir_use_wp_media_large_size' ) ) {
2536
+	if (!get_option('geodir_use_wp_media_large_size')) {
2537 2537
 		$large_size_w = 800;
2538 2538
 	}
2539 2539
 
@@ -2546,7 +2546,7 @@  discard block
 block discarded – undo
2546 2546
 	 * @param int $default         Default width.
2547 2547
 	 * @param string|array $params Image parameters.
2548 2548
 	 */
2549
-	$large_size_w = apply_filters( 'geodir_filter_media_image_large_width', $large_size_w, $default, $params );
2549
+	$large_size_w = apply_filters('geodir_filter_media_image_large_width', $large_size_w, $default, $params);
2550 2550
 
2551 2551
 	return $large_size_w;
2552 2552
 }
@@ -2562,12 +2562,12 @@  discard block
 block discarded – undo
2562 2562
  *
2563 2563
  * @return int Large size height.
2564 2564
  */
2565
-function geodir_media_image_large_height( $default = 800, $params = '' ) {
2566
-	$large_size_h = get_option( 'large_size_h' );
2565
+function geodir_media_image_large_height($default = 800, $params = '') {
2566
+	$large_size_h = get_option('large_size_h');
2567 2567
 	$large_size_h = $large_size_h > 0 ? $large_size_h : $default;
2568
-	$large_size_h = absint( $large_size_h );
2568
+	$large_size_h = absint($large_size_h);
2569 2569
 
2570
-	if ( ! get_option( 'geodir_use_wp_media_large_size' ) ) {
2570
+	if (!get_option('geodir_use_wp_media_large_size')) {
2571 2571
 		$large_size_h = 800;
2572 2572
 	}
2573 2573
 
@@ -2580,7 +2580,7 @@  discard block
 block discarded – undo
2580 2580
 	 * @param int $default         Default height.
2581 2581
 	 * @param string|array $params Image parameters.
2582 2582
 	 */
2583
-	$large_size_h = apply_filters( 'geodir_filter_media_image_large_height', $large_size_h, $default, $params );
2583
+	$large_size_h = apply_filters('geodir_filter_media_image_large_height', $large_size_h, $default, $params);
2584 2584
 
2585 2585
 	return $large_size_h;
2586 2586
 }
@@ -2597,8 +2597,8 @@  discard block
 block discarded – undo
2597 2597
  *
2598 2598
  * @return string Sanitized name.
2599 2599
  */
2600
-function geodir_sanitize_location_name( $type, $name, $translate = true ) {
2601
-	if ( $name == '' ) {
2600
+function geodir_sanitize_location_name($type, $name, $translate = true) {
2601
+	if ($name == '') {
2602 2602
 		return null;
2603 2603
 	}
2604 2604
 
@@ -2607,13 +2607,13 @@  discard block
 block discarded – undo
2607 2607
 	$type = $type == 'gd_city' ? 'city' : $type;
2608 2608
 
2609 2609
 	$return = $name;
2610
-	if ( function_exists( 'get_actual_location_name' ) ) {
2611
-		$return = get_actual_location_name( $type, $name, $translate );
2610
+	if (function_exists('get_actual_location_name')) {
2611
+		$return = get_actual_location_name($type, $name, $translate);
2612 2612
 	} else {
2613
-		$return = preg_replace( '/-(\d+)$/', '', $return );
2614
-		$return = preg_replace( '/[_-]/', ' ', $return );
2615
-		$return = geodir_ucwords( $return );
2616
-		$return = $translate ? __( $return, 'geodirectory' ) : $return;
2613
+		$return = preg_replace('/-(\d+)$/', '', $return);
2614
+		$return = preg_replace('/[_-]/', ' ', $return);
2615
+		$return = geodir_ucwords($return);
2616
+		$return = $translate ? __($return, 'geodirectory') : $return;
2617 2617
 	}
2618 2618
 
2619 2619
 	return $return;
@@ -2628,14 +2628,14 @@  discard block
 block discarded – undo
2628 2628
  *
2629 2629
  * @param int $number Comments number.
2630 2630
  */
2631
-function geodir_comments_number( $number ) {
2631
+function geodir_comments_number($number) {
2632 2632
 
2633
-	if ( $number > 1 ) {
2634
-		$output = str_replace( '%', number_format_i18n( $number ), __( '% Reviews', 'geodirectory' ) );
2635
-	} elseif ( $number == 0 || $number == '' ) {
2636
-		$output = __( 'No Reviews', 'geodirectory' );
2633
+	if ($number > 1) {
2634
+		$output = str_replace('%', number_format_i18n($number), __('% Reviews', 'geodirectory'));
2635
+	} elseif ($number == 0 || $number == '') {
2636
+		$output = __('No Reviews', 'geodirectory');
2637 2637
 	} else { // must be one
2638
-		$output = __( '1 Review', 'geodirectory' );
2638
+		$output = __('1 Review', 'geodirectory');
2639 2639
 	}
2640 2640
 	echo $output;
2641 2641
 }
@@ -2650,18 +2650,18 @@  discard block
 block discarded – undo
2650 2650
  */
2651 2651
 function is_page_geodir_home() {
2652 2652
 	global $wpdb;
2653
-	$cur_url = str_replace( array( "https://", "http://", "www." ), array( '', '', '' ), geodir_curPageURL() );
2654
-	if ( function_exists( 'geodir_location_geo_home_link' ) ) {
2655
-		remove_filter( 'home_url', 'geodir_location_geo_home_link', 100000 );
2653
+	$cur_url = str_replace(array("https://", "http://", "www."), array('', '', ''), geodir_curPageURL());
2654
+	if (function_exists('geodir_location_geo_home_link')) {
2655
+		remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
2656 2656
 	}
2657
-	$home_url = home_url( '', 'http' );
2658
-	if ( function_exists( 'geodir_location_geo_home_link' ) ) {
2659
-		add_filter( 'home_url', 'geodir_location_geo_home_link', 100000, 2 );
2657
+	$home_url = home_url('', 'http');
2658
+	if (function_exists('geodir_location_geo_home_link')) {
2659
+		add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
2660 2660
 	}
2661
-	$home_url = str_replace( "www.", "", $home_url );
2662
-	if ( ( strpos( $home_url, $cur_url ) !== false || strpos( $home_url . '/', $cur_url ) !== false ) && ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) ) {
2661
+	$home_url = str_replace("www.", "", $home_url);
2662
+	if ((strpos($home_url, $cur_url) !== false || strpos($home_url.'/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page'))) {
2663 2663
 		return true;
2664
-	} elseif ( get_query_var( 'page_id' ) == get_option( 'page_on_front' ) && 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) {
2664
+	} elseif (get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page')) {
2665 2665
 		return true;
2666 2666
 	} else {
2667 2667
 		return false;
@@ -2681,18 +2681,18 @@  discard block
 block discarded – undo
2681 2681
  *
2682 2682
  * @return string The canonical URL.
2683 2683
  */
2684
-function geodir_wpseo_homepage_canonical( $url ) {
2684
+function geodir_wpseo_homepage_canonical($url) {
2685 2685
 	global $post;
2686 2686
 
2687
-	if ( is_page_geodir_home() ) {
2687
+	if (is_page_geodir_home()) {
2688 2688
 		return home_url();
2689 2689
 	}
2690 2690
 
2691 2691
 	return $url;
2692 2692
 }
2693 2693
 
2694
-add_filter( 'wpseo_canonical', 'geodir_wpseo_homepage_canonical', 10 );
2695
-add_filter( 'aioseop_canonical_url', 'geodir_wpseo_homepage_canonical', 10 );
2694
+add_filter('wpseo_canonical', 'geodir_wpseo_homepage_canonical', 10);
2695
+add_filter('aioseop_canonical_url', 'geodir_wpseo_homepage_canonical', 10);
2696 2696
 
2697 2697
 /**
2698 2698
  * Add extra fields to google maps script call.
@@ -2705,20 +2705,20 @@  discard block
 block discarded – undo
2705 2705
  *
2706 2706
  * @return string Modified extra string.
2707 2707
  */
2708
-function geodir_googlemap_script_extra_details_page( $extra ) {
2708
+function geodir_googlemap_script_extra_details_page($extra) {
2709 2709
 	global $post;
2710 2710
 	$add_google_places_api = false;
2711
-	if ( isset( $post->post_content ) && has_shortcode( $post->post_content, 'gd_add_listing' ) ) {
2711
+	if (isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
2712 2712
 		$add_google_places_api = true;
2713 2713
 	}
2714
-	if ( ! str_replace( 'libraries=places', '', $extra ) && ( geodir_is_page( 'detail' ) || $add_google_places_api ) ) {
2714
+	if (!str_replace('libraries=places', '', $extra) && (geodir_is_page('detail') || $add_google_places_api)) {
2715 2715
 		$extra .= "&amp;libraries=places";
2716 2716
 	}
2717 2717
 
2718 2718
 	return $extra;
2719 2719
 }
2720 2720
 
2721
-add_filter( 'geodir_googlemap_script_extra', 'geodir_googlemap_script_extra_details_page', 101, 1 );
2721
+add_filter('geodir_googlemap_script_extra', 'geodir_googlemap_script_extra_details_page', 101, 1);
2722 2722
 
2723 2723
 
2724 2724
 /**
@@ -2736,99 +2736,99 @@  discard block
 block discarded – undo
2736 2736
  *                                          after_widget.
2737 2737
  * @param array|string $instance            The settings for the particular instance of the widget.
2738 2738
  */
2739
-function geodir_popular_post_category_output( $args = '', $instance = '' ) {
2739
+function geodir_popular_post_category_output($args = '', $instance = '') {
2740 2740
 	// prints the widget
2741 2741
 	global $wpdb, $plugin_prefix, $geodir_post_category_str;
2742
-	extract( $args, EXTR_SKIP );
2742
+	extract($args, EXTR_SKIP);
2743 2743
 
2744 2744
 	echo $before_widget;
2745 2745
 
2746 2746
 	/** This filter is documented in geodirectory_widgets.php */
2747
-	$title = empty( $instance['title'] ) ? __( 'Popular Categories', 'geodirectory' ) : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
2747
+	$title = empty($instance['title']) ? __('Popular Categories', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2748 2748
 
2749 2749
 	$gd_post_type = geodir_get_current_posttype();
2750 2750
 
2751
-	$category_limit = isset( $instance['category_limit'] ) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2752
-	if ( ! empty( $gd_post_type ) ) {
2751
+	$category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2752
+	if (!empty($gd_post_type)) {
2753 2753
 		$default_post_type = $gd_post_type;
2754
-	} elseif ( isset( $instance['default_post_type'] ) && gdsc_is_post_type_valid( $instance['default_post_type'] ) ) {
2754
+	} elseif (isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type'])) {
2755 2755
 		$default_post_type = $instance['default_post_type'];
2756 2756
 	} else {
2757 2757
 		$all_gd_post_type  = geodir_get_posttypes();
2758
-		$default_post_type = ( isset( $all_gd_post_type[0] ) ) ? $all_gd_post_type[0] : '';
2758
+		$default_post_type = (isset($all_gd_post_type[0])) ? $all_gd_post_type[0] : '';
2759 2759
 	}
2760
-	$parent_only = !empty( $instance['parent_only'] ) ? true : false;
2760
+	$parent_only = !empty($instance['parent_only']) ? true : false;
2761 2761
 
2762 2762
 	$taxonomy = array();
2763
-	if ( ! empty( $gd_post_type ) ) {
2764
-		$taxonomy[] = $gd_post_type . "category";
2763
+	if (!empty($gd_post_type)) {
2764
+		$taxonomy[] = $gd_post_type."category";
2765 2765
 	} else {
2766
-		$taxonomy = geodir_get_taxonomies( $gd_post_type );
2766
+		$taxonomy = geodir_get_taxonomies($gd_post_type);
2767 2767
 	}
2768 2768
     
2769
-	$term_args = array( 'taxonomy' => $taxonomy );
2770
-	if ( $parent_only ) {
2769
+	$term_args = array('taxonomy' => $taxonomy);
2770
+	if ($parent_only) {
2771 2771
 		$term_args['parent'] = 0;
2772 2772
 	}
2773 2773
 
2774
-	$terms   = get_terms( $term_args );
2774
+	$terms   = get_terms($term_args);
2775 2775
 	$a_terms = array();
2776 2776
 	$b_terms = array();
2777 2777
 
2778
-	foreach ( $terms as $term ) {
2779
-		if ( $term->count > 0 ) {
2780
-			$a_terms[ $term->taxonomy ][] = $term;
2778
+	foreach ($terms as $term) {
2779
+		if ($term->count > 0) {
2780
+			$a_terms[$term->taxonomy][] = $term;
2781 2781
 		}
2782 2782
 	}
2783 2783
 
2784
-	if ( ! empty( $a_terms ) ) {
2785
-		foreach ( $a_terms as $b_key => $b_val ) {
2786
-			$b_terms[ $b_key ] = geodir_sort_terms( $b_val, 'count' );
2784
+	if (!empty($a_terms)) {
2785
+		foreach ($a_terms as $b_key => $b_val) {
2786
+			$b_terms[$b_key] = geodir_sort_terms($b_val, 'count');
2787 2787
 		}
2788 2788
 
2789
-		$default_taxonomy = $default_post_type != '' && isset( $b_terms[ $default_post_type . 'category' ] ) ? $default_post_type . 'category' : '';
2789
+		$default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type.'category']) ? $default_post_type.'category' : '';
2790 2790
 
2791 2791
 		$tax_change_output = '';
2792
-		if ( count( $b_terms ) > 1 ) {
2793
-			$tax_change_output .= "<select data-limit='$category_limit' data-parent='" . (int)$parent_only . "' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2794
-			foreach ( $b_terms as $key => $val ) {
2795
-				$ptype    = get_post_type_object( str_replace( "category", "", $key ) );
2796
-				$cpt_name = __( $ptype->labels->singular_name, 'geodirectory' );
2797
-				$tax_change_output .= "<option value='$key' " . selected( $key, $default_taxonomy, false ) . ">" . sprintf( __( '%s Categories', 'geodirectory' ), $cpt_name ) . "</option>";
2792
+		if (count($b_terms) > 1) {
2793
+			$tax_change_output .= "<select data-limit='$category_limit' data-parent='".(int) $parent_only."' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2794
+			foreach ($b_terms as $key => $val) {
2795
+				$ptype    = get_post_type_object(str_replace("category", "", $key));
2796
+				$cpt_name = __($ptype->labels->singular_name, 'geodirectory');
2797
+				$tax_change_output .= "<option value='$key' ".selected($key, $default_taxonomy, false).">".sprintf(__('%s Categories', 'geodirectory'), $cpt_name)."</option>";
2798 2798
 			}
2799 2799
 			$tax_change_output .= "</select>";
2800 2800
 		}
2801 2801
 
2802
-		if ( ! empty( $b_terms ) ) {
2803
-			$terms = $default_taxonomy != '' && isset( $b_terms[ $default_taxonomy ] ) ? $b_terms[ $default_taxonomy ] : reset( $b_terms );// get the first array
2804
-			global $cat_count;//make global so we can change via function
2802
+		if (!empty($b_terms)) {
2803
+			$terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array
2804
+			global $cat_count; //make global so we can change via function
2805 2805
 			$cat_count = 0;
2806 2806
 			?>
2807 2807
 			<div class="geodir-category-list-in clearfix">
2808 2808
 				<div class="geodir-cat-list clearfix">
2809 2809
 					<?php
2810
-					echo $before_title . __( $title ) . $after_title;
2810
+					echo $before_title.__($title).$after_title;
2811 2811
 
2812 2812
 					echo $tax_change_output;
2813 2813
 
2814 2814
 					echo '<ul class="geodir-popular-cat-list">';
2815 2815
 
2816
-					geodir_helper_cat_list_output( $terms, $category_limit );
2816
+					geodir_helper_cat_list_output($terms, $category_limit);
2817 2817
 
2818 2818
 					echo '</ul>';
2819 2819
 					?>
2820 2820
 				</div>
2821 2821
 				<?php
2822 2822
 				$hide = '';
2823
-				if ( $cat_count < $category_limit ) {
2823
+				if ($cat_count < $category_limit) {
2824 2824
 					$hide = 'style="display:none;"';
2825 2825
 				}
2826 2826
 				echo "<div class='geodir-cat-list-more' $hide >";
2827
-				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">' . __( 'More Categories', 'geodirectory' ) . '</a>';
2828
-				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">' . __( 'Less Categories', 'geodirectory' ) . '</a>';
2827
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">'.__('More Categories', 'geodirectory').'</a>';
2828
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">'.__('Less Categories', 'geodirectory').'</a>';
2829 2829
 				echo "</div>";
2830 2830
 				/* add scripts */
2831
-				add_action( 'wp_footer', 'geodir_popular_category_add_scripts', 100 );
2831
+				add_action('wp_footer', 'geodir_popular_category_add_scripts', 100);
2832 2832
 				?>
2833 2833
 			</div>
2834 2834
 			<?php
@@ -2847,25 +2847,25 @@  discard block
 block discarded – undo
2847 2847
  * @param array $terms                      An array of term objects.
2848 2848
  * @param int $category_limit               Number of categories to display by default.
2849 2849
  */
2850
-function geodir_helper_cat_list_output( $terms, $category_limit ) {
2850
+function geodir_helper_cat_list_output($terms, $category_limit) {
2851 2851
 	global $geodir_post_category_str, $cat_count;
2852 2852
 	$term_icons = geodir_get_term_icon();
2853 2853
 
2854 2854
 	$geodir_post_category_str = array();
2855 2855
 
2856 2856
 
2857
-	foreach ( $terms as $cat ) {
2858
-		$post_type     = str_replace( "category", "", $cat->taxonomy );
2859
-		$term_icon_url = ! empty( $term_icons ) && isset( $term_icons[ $cat->term_id ] ) ? $term_icons[ $cat->term_id ] : '';
2857
+	foreach ($terms as $cat) {
2858
+		$post_type     = str_replace("category", "", $cat->taxonomy);
2859
+		$term_icon_url = !empty($term_icons) && isset($term_icons[$cat->term_id]) ? $term_icons[$cat->term_id] : '';
2860 2860
 
2861
-		$cat_count ++;
2861
+		$cat_count++;
2862 2862
 
2863
-		$geodir_post_category_str[] = array( 'posttype' => $post_type, 'termid' => $cat->term_id );
2863
+		$geodir_post_category_str[] = array('posttype' => $post_type, 'termid' => $cat->term_id);
2864 2864
 
2865 2865
 		$class_row  = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show';
2866 2866
 		$total_post = $cat->count;
2867 2867
 
2868
-		$term_link = get_term_link( $cat, $cat->taxonomy );
2868
+		$term_link = get_term_link($cat, $cat->taxonomy);
2869 2869
 		/**
2870 2870
 		 * Filer the category term link.
2871 2871
 		 *
@@ -2875,11 +2875,11 @@  discard block
 block discarded – undo
2875 2875
 		 * @param int $cat          ->term_id The term id.
2876 2876
 		 * @param string $post_type Wordpress post type.
2877 2877
 		 */
2878
-		$term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type );
2878
+		$term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type);
2879 2879
 
2880
-		echo '<li class="' . $class_row . '"><a href="' . $term_link . '">';
2881
-		echo '<img alt="' . esc_attr( $cat->name ) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">';
2882
-		echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> ';
2880
+		echo '<li class="'.$class_row.'"><a href="'.$term_link.'">';
2881
+		echo '<img alt="'.esc_attr($cat->name).' icon" style="height:20px;vertical-align:middle;" src="'.$term_icon_url.'"/> <span class="cat-link">';
2882
+		echo $cat->name.'</span> <span class="geodir_term_class geodir_link_span geodir_category_class_'.$post_type.'_'.$cat->term_id.'">('.$total_post.')</span> ';
2883 2883
 		echo '</a></li>';
2884 2884
 	}
2885 2885
 }
@@ -2894,14 +2894,14 @@  discard block
 block discarded – undo
2894 2894
  * @param array|string $args     Display arguments including before_title, after_title, before_widget, and after_widget.
2895 2895
  * @param array|string $instance The settings for the particular instance of the widget.
2896 2896
  */
2897
-function geodir_listing_slider_widget_output( $args = '', $instance = '' ) {
2897
+function geodir_listing_slider_widget_output($args = '', $instance = '') {
2898 2898
 	// prints the widget
2899
-	extract( $args, EXTR_SKIP );
2899
+	extract($args, EXTR_SKIP);
2900 2900
 
2901 2901
 	echo $before_widget;
2902 2902
 
2903 2903
 	/** This filter is documented in geodirectory_widgets.php */
2904
-	$title = empty( $instance['title'] ) ? '' : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
2904
+	$title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2905 2905
 	/**
2906 2906
 	 * Filter the widget post type.
2907 2907
 	 *
@@ -2909,7 +2909,7 @@  discard block
 block discarded – undo
2909 2909
 	 *
2910 2910
 	 * @param string $instance ['post_type'] Post type of listing.
2911 2911
 	 */
2912
-	$post_type = empty( $instance['post_type'] ) ? 'gd_place' : apply_filters( 'widget_post_type', $instance['post_type'] );
2912
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
2913 2913
 	/**
2914 2914
 	 * Filter the widget's term.
2915 2915
 	 *
@@ -2917,7 +2917,7 @@  discard block
 block discarded – undo
2917 2917
 	 *
2918 2918
 	 * @param string $instance ['category'] Filter by term. Can be any valid term.
2919 2919
 	 */
2920
-	$category = empty( $instance['category'] ) ? '0' : apply_filters( 'widget_category', $instance['category'] );
2920
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
2921 2921
 	/**
2922 2922
 	 * Filter widget's "add_location_filter" value.
2923 2923
 	 *
@@ -2925,7 +2925,7 @@  discard block
 block discarded – undo
2925 2925
 	 *
2926 2926
 	 * @param string|bool $instance ['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
2927 2927
 	 */
2928
-	$add_location_filter = empty( $instance['add_location_filter'] ) ? '0' : apply_filters( 'widget_add_location_filter', $instance['add_location_filter'] );
2928
+	$add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
2929 2929
 	/**
2930 2930
 	 * Filter the widget listings limit.
2931 2931
 	 *
@@ -2933,7 +2933,7 @@  discard block
 block discarded – undo
2933 2933
 	 *
2934 2934
 	 * @param string $instance ['post_number'] Number of listings to display.
2935 2935
 	 */
2936
-	$post_number = empty( $instance['post_number'] ) ? '5' : apply_filters( 'widget_post_number', $instance['post_number'] );
2936
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
2937 2937
 	/**
2938 2938
 	 * Filter the widget listings limit shown at one time.
2939 2939
 	 *
@@ -2941,7 +2941,7 @@  discard block
 block discarded – undo
2941 2941
 	 *
2942 2942
 	 * @param string $instance ['max_show'] Number of listings to display on screen.
2943 2943
 	 */
2944
-	$max_show = empty( $instance['max_show'] ) ? '1' : apply_filters( 'widget_max_show', $instance['max_show'] );
2944
+	$max_show = empty($instance['max_show']) ? '1' : apply_filters('widget_max_show', $instance['max_show']);
2945 2945
 	/**
2946 2946
 	 * Filter the widget slide width.
2947 2947
 	 *
@@ -2949,7 +2949,7 @@  discard block
 block discarded – undo
2949 2949
 	 *
2950 2950
 	 * @param string $instance ['slide_width'] Width of the slides shown.
2951 2951
 	 */
2952
-	$slide_width = empty( $instance['slide_width'] ) ? '' : apply_filters( 'widget_slide_width', $instance['slide_width'] );
2952
+	$slide_width = empty($instance['slide_width']) ? '' : apply_filters('widget_slide_width', $instance['slide_width']);
2953 2953
 	/**
2954 2954
 	 * Filter widget's "show title" value.
2955 2955
 	 *
@@ -2957,7 +2957,7 @@  discard block
 block discarded – undo
2957 2957
 	 *
2958 2958
 	 * @param string|bool $instance ['show_title'] Do you want to display title? Can be 1 or 0.
2959 2959
 	 */
2960
-	$show_title = empty( $instance['show_title'] ) ? '' : apply_filters( 'widget_show_title', $instance['show_title'] );
2960
+	$show_title = empty($instance['show_title']) ? '' : apply_filters('widget_show_title', $instance['show_title']);
2961 2961
 	/**
2962 2962
 	 * Filter widget's "slideshow" value.
2963 2963
 	 *
@@ -2965,7 +2965,7 @@  discard block
 block discarded – undo
2965 2965
 	 *
2966 2966
 	 * @param int $instance ['slideshow'] Setup a slideshow for the slider to animate automatically.
2967 2967
 	 */
2968
-	$slideshow = empty( $instance['slideshow'] ) ? 0 : apply_filters( 'widget_slideshow', $instance['slideshow'] );
2968
+	$slideshow = empty($instance['slideshow']) ? 0 : apply_filters('widget_slideshow', $instance['slideshow']);
2969 2969
 	/**
2970 2970
 	 * Filter widget's "animationLoop" value.
2971 2971
 	 *
@@ -2973,7 +2973,7 @@  discard block
 block discarded – undo
2973 2973
 	 *
2974 2974
 	 * @param int $instance ['animationLoop'] Gives the slider a seamless infinite loop.
2975 2975
 	 */
2976
-	$animationLoop = empty( $instance['animationLoop'] ) ? 0 : apply_filters( 'widget_animationLoop', $instance['animationLoop'] );
2976
+	$animationLoop = empty($instance['animationLoop']) ? 0 : apply_filters('widget_animationLoop', $instance['animationLoop']);
2977 2977
 	/**
2978 2978
 	 * Filter widget's "directionNav" value.
2979 2979
 	 *
@@ -2981,7 +2981,7 @@  discard block
 block discarded – undo
2981 2981
 	 *
2982 2982
 	 * @param int $instance ['directionNav'] Enable previous/next arrow navigation?. Can be 1 or 0.
2983 2983
 	 */
2984
-	$directionNav = empty( $instance['directionNav'] ) ? 0 : apply_filters( 'widget_directionNav', $instance['directionNav'] );
2984
+	$directionNav = empty($instance['directionNav']) ? 0 : apply_filters('widget_directionNav', $instance['directionNav']);
2985 2985
 	/**
2986 2986
 	 * Filter widget's "slideshowSpeed" value.
2987 2987
 	 *
@@ -2989,7 +2989,7 @@  discard block
 block discarded – undo
2989 2989
 	 *
2990 2990
 	 * @param int $instance ['slideshowSpeed'] Set the speed of the slideshow cycling, in milliseconds.
2991 2991
 	 */
2992
-	$slideshowSpeed = empty( $instance['slideshowSpeed'] ) ? 5000 : apply_filters( 'widget_slideshowSpeed', $instance['slideshowSpeed'] );
2992
+	$slideshowSpeed = empty($instance['slideshowSpeed']) ? 5000 : apply_filters('widget_slideshowSpeed', $instance['slideshowSpeed']);
2993 2993
 	/**
2994 2994
 	 * Filter widget's "animationSpeed" value.
2995 2995
 	 *
@@ -2997,7 +2997,7 @@  discard block
 block discarded – undo
2997 2997
 	 *
2998 2998
 	 * @param int $instance ['animationSpeed'] Set the speed of animations, in milliseconds.
2999 2999
 	 */
3000
-	$animationSpeed = empty( $instance['animationSpeed'] ) ? 600 : apply_filters( 'widget_animationSpeed', $instance['animationSpeed'] );
3000
+	$animationSpeed = empty($instance['animationSpeed']) ? 600 : apply_filters('widget_animationSpeed', $instance['animationSpeed']);
3001 3001
 	/**
3002 3002
 	 * Filter widget's "animation" value.
3003 3003
 	 *
@@ -3005,7 +3005,7 @@  discard block
 block discarded – undo
3005 3005
 	 *
3006 3006
 	 * @param string $instance ['animation'] Controls the animation type, "fade" or "slide".
3007 3007
 	 */
3008
-	$animation = empty( $instance['animation'] ) ? 'slide' : apply_filters( 'widget_animation', $instance['animation'] );
3008
+	$animation = empty($instance['animation']) ? 'slide' : apply_filters('widget_animation', $instance['animation']);
3009 3009
 	/**
3010 3010
 	 * Filter widget's "list_sort" type.
3011 3011
 	 *
@@ -3013,10 +3013,10 @@  discard block
 block discarded – undo
3013 3013
 	 *
3014 3014
 	 * @param string $instance ['list_sort'] Listing sort by type.
3015 3015
 	 */
3016
-	$list_sort          = empty( $instance['list_sort'] ) ? 'latest' : apply_filters( 'widget_list_sort', $instance['list_sort'] );
3017
-	$show_featured_only = ! empty( $instance['show_featured_only'] ) ? 1 : null;
3016
+	$list_sort          = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
3017
+	$show_featured_only = !empty($instance['show_featured_only']) ? 1 : null;
3018 3018
 
3019
-	wp_enqueue_script( 'geodirectory-jquery-flexslider-js' );
3019
+	wp_enqueue_script('geodirectory-jquery-flexslider-js');
3020 3020
 	?>
3021 3021
 	<script type="text/javascript">
3022 3022
 		jQuery(window).load(function () {
@@ -3034,23 +3034,23 @@  discard block
 block discarded – undo
3034 3034
 				itemWidth: 75,
3035 3035
 				itemMargin: 5,
3036 3036
 				asNavFor: '#geodir_widget_slider',
3037
-				rtl: <?php echo( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
3037
+				rtl: <?php echo(is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
3038 3038
 			});
3039 3039
 
3040 3040
 			jQuery('#geodir_widget_slider').flexslider({
3041
-				animation: "<?php echo $animation;?>",
3041
+				animation: "<?php echo $animation; ?>",
3042 3042
 				selector: ".geodir-slides > li",
3043 3043
 				namespace: "geodir-",
3044 3044
 				controlNav: true,
3045
-				animationLoop: <?php echo $animationLoop;?>,
3046
-				slideshow: <?php echo $slideshow;?>,
3047
-				slideshowSpeed: <?php echo $slideshowSpeed;?>,
3048
-				animationSpeed: <?php echo $animationSpeed;?>,
3049
-				directionNav: <?php echo $directionNav;?>,
3050
-				maxItems: <?php echo $max_show;?>,
3045
+				animationLoop: <?php echo $animationLoop; ?>,
3046
+				slideshow: <?php echo $slideshow; ?>,
3047
+				slideshowSpeed: <?php echo $slideshowSpeed; ?>,
3048
+				animationSpeed: <?php echo $animationSpeed; ?>,
3049
+				directionNav: <?php echo $directionNav; ?>,
3050
+				maxItems: <?php echo $max_show; ?>,
3051 3051
 				move: 1,
3052
-				<?php if ( $slide_width ) {
3053
-				echo "itemWidth: " . $slide_width . ",";
3052
+				<?php if ($slide_width) {
3053
+				echo "itemWidth: ".$slide_width.",";
3054 3054
 			}?>
3055 3055
 				sync: "#geodir_widget_carousel",
3056 3056
 				start: function (slider) {
@@ -3062,7 +3062,7 @@  discard block
 block discarded – undo
3062 3062
 					jQuery('#geodir_widget_slider').css({'visibility': 'visible'});
3063 3063
 					jQuery('#geodir_widget_carousel').css({'visibility': 'visible'});
3064 3064
 				},
3065
-				rtl: <?php echo( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
3065
+				rtl: <?php echo(is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
3066 3066
 			});
3067 3067
 		});
3068 3068
 	</script>
@@ -3075,62 +3075,62 @@  discard block
 block discarded – undo
3075 3075
 		'order_by'       => $list_sort
3076 3076
 	);
3077 3077
 
3078
-	if ( $show_featured_only ) {
3078
+	if ($show_featured_only) {
3079 3079
 		$query_args['show_featured_only'] = 1;
3080 3080
 	}
3081 3081
 
3082
-	if ( $category != 0 || $category != '' ) {
3083
-		$category_taxonomy = geodir_get_taxonomies( $post_type );
3082
+	if ($category != 0 || $category != '') {
3083
+		$category_taxonomy = geodir_get_taxonomies($post_type);
3084 3084
 		$tax_query         = array(
3085 3085
 			'taxonomy' => $category_taxonomy[0],
3086 3086
 			'field'    => 'id',
3087 3087
 			'terms'    => $category
3088 3088
 		);
3089 3089
 
3090
-		$query_args['tax_query'] = array( $tax_query );
3090
+		$query_args['tax_query'] = array($tax_query);
3091 3091
 	}
3092 3092
 
3093 3093
 	// we want listings with featured image only
3094 3094
 	$query_args['featured_image_only'] = 1;
3095 3095
 
3096
-	if ( $post_type == 'gd_event' ) {
3096
+	if ($post_type == 'gd_event') {
3097 3097
 		$query_args['gedir_event_listing_filter'] = 'upcoming';
3098 3098
 	}// show only upcoming events
3099 3099
 
3100
-	$widget_listings = geodir_get_widget_listings( $query_args );
3101
-	if ( ! empty( $widget_listings ) || ( isset( $with_no_results ) && $with_no_results ) ) {
3102
-		if ( $title ) {
3103
-			echo $before_title . $title . $after_title;
3100
+	$widget_listings = geodir_get_widget_listings($query_args);
3101
+	if (!empty($widget_listings) || (isset($with_no_results) && $with_no_results)) {
3102
+		if ($title) {
3103
+			echo $before_title.$title.$after_title;
3104 3104
 		}
3105 3105
 
3106 3106
 		global $post;
3107 3107
 
3108
-		$current_post = $post;// keep current post info
3108
+		$current_post = $post; // keep current post info
3109 3109
 
3110 3110
 		$widget_main_slides = '';
3111 3111
 		$nav_slides         = '';
3112 3112
 		$widget_slides      = 0;
3113 3113
 
3114
-		foreach ( $widget_listings as $widget_listing ) {
3114
+		foreach ($widget_listings as $widget_listing) {
3115 3115
 			global $gd_widget_listing_type;
3116 3116
 			$post         = $widget_listing;
3117
-			$widget_image = geodir_get_featured_image( $post->ID, 'thumbnail', get_option( 'geodir_listing_no_img' ) );
3117
+			$widget_image = geodir_get_featured_image($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
3118 3118
 
3119
-			if ( ! empty( $widget_image ) ) {
3120
-				if ( $widget_image->height >= 200 ) {
3119
+			if (!empty($widget_image)) {
3120
+				if ($widget_image->height >= 200) {
3121 3121
 					$widget_spacer_height = 0;
3122 3122
 				} else {
3123
-					$widget_spacer_height = ( ( 200 - $widget_image->height ) / 2 );
3123
+					$widget_spacer_height = ((200 - $widget_image->height) / 2);
3124 3124
 				}
3125 3125
 
3126
-				$widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:' . $widget_spacer_height . 'px !important;margin:0 auto;" width="100" />';
3126
+				$widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:'.$widget_spacer_height.'px !important;margin:0 auto;" width="100" />';
3127 3127
 
3128 3128
 				$title = '';
3129
-				if ( $show_title ) {
3130
-					$title_html     = '<div class="geodir-slider-title"><a href="' . get_permalink( $post->ID ) . '">' . get_the_title( $post->ID ) . '</a></div>';
3129
+				if ($show_title) {
3130
+					$title_html     = '<div class="geodir-slider-title"><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a></div>';
3131 3131
 					$post_id        = $post->ID;
3132
-					$post_permalink = get_permalink( $post->ID );
3133
-					$post_title     = get_the_title( $post->ID );
3132
+					$post_permalink = get_permalink($post->ID);
3133
+					$post_title     = get_the_title($post->ID);
3134 3134
 					/**
3135 3135
 					 * Filter the listing slider widget title.
3136 3136
 					 *
@@ -3141,12 +3141,12 @@  discard block
 block discarded – undo
3141 3141
 					 * @param string $post_permalink The post permalink url.
3142 3142
 					 * @param string $post_title     The post title text.
3143 3143
 					 */
3144
-					$title = apply_filters( 'geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title );
3144
+					$title = apply_filters('geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title);
3145 3145
 				}
3146 3146
 
3147
-				$widget_main_slides .= $title . '<img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:200px;margin:0 auto;" /></li>';
3148
-				$nav_slides .= '<li><img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
3149
-				$widget_slides ++;
3147
+				$widget_main_slides .= $title.'<img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:200px;margin:0 auto;" /></li>';
3148
+				$nav_slides .= '<li><img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
3149
+				$widget_slides++;
3150 3150
 			}
3151 3151
 		}
3152 3152
 		?>
@@ -3155,7 +3155,7 @@  discard block
 block discarded – undo
3155 3155
 			<div id="geodir_widget_slider" class="geodir_flexslider">
3156 3156
 				<ul class="geodir-slides clearfix"><?php echo $widget_main_slides; ?></ul>
3157 3157
 			</div>
3158
-			<?php if ( $widget_slides > 1 ) { ?>
3158
+			<?php if ($widget_slides > 1) { ?>
3159 3159
 				<div id="geodir_widget_carousel" class="geodir_flexslider">
3160 3160
 					<ul class="geodir-slides clearfix"><?php echo $nav_slides; ?></ul>
3161 3161
 				</div>
@@ -3163,7 +3163,7 @@  discard block
 block discarded – undo
3163 3163
 		</div>
3164 3164
 		<?php
3165 3165
 		$GLOBALS['post'] = $current_post;
3166
-		setup_postdata( $current_post );
3166
+		setup_postdata($current_post);
3167 3167
 	}
3168 3168
 	echo $after_widget;
3169 3169
 }
@@ -3179,46 +3179,46 @@  discard block
 block discarded – undo
3179 3179
  * @param array|string $args     Display arguments including before_title, after_title, before_widget, and after_widget.
3180 3180
  * @param array|string $instance The settings for the particular instance of the widget.
3181 3181
  */
3182
-function geodir_loginwidget_output( $args = '', $instance = '' ) {
3182
+function geodir_loginwidget_output($args = '', $instance = '') {
3183 3183
 	//print_r($args);
3184 3184
 	//print_r($instance);
3185 3185
 	// prints the widget
3186
-	extract( $args, EXTR_SKIP );
3186
+	extract($args, EXTR_SKIP);
3187 3187
 
3188 3188
 	/** This filter is documented in geodirectory_widgets.php */
3189
-	$title = empty( $instance['title'] ) ? __( 'My Dashboard', 'geodirectory' ) : apply_filters( 'my_dashboard_widget_title', __( $instance['title'], 'geodirectory' ) );
3189
+	$title = empty($instance['title']) ? __('My Dashboard', 'geodirectory') : apply_filters('my_dashboard_widget_title', __($instance['title'], 'geodirectory'));
3190 3190
 
3191 3191
 	echo $before_widget;
3192
-	echo $before_title . $title . $after_title;
3192
+	echo $before_title.$title.$after_title;
3193 3193
 
3194
-	if ( is_user_logged_in() ) {
3194
+	if (is_user_logged_in()) {
3195 3195
 		global $current_user;
3196 3196
 
3197
-		$author_link = get_author_posts_url( $current_user->data->ID );
3198
-		$author_link = geodir_getlink( $author_link, array( 'geodir_dashbord' => 'true' ), false );
3197
+		$author_link = get_author_posts_url($current_user->data->ID);
3198
+		$author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);
3199 3199
 
3200 3200
 		echo '<ul class="geodir-loginbox-list">';
3201 3201
 		ob_start();
3202 3202
 		?>
3203 3203
 		<li><a class="signin"
3204
-		       href="<?php echo wp_logout_url( home_url() ); ?>"><?php _e( 'Logout', 'geodirectory' ); ?></a></li>
3204
+		       href="<?php echo wp_logout_url(home_url()); ?>"><?php _e('Logout', 'geodirectory'); ?></a></li>
3205 3205
 		<?php
3206
-		$post_types                           = geodir_get_posttypes( 'object' );
3207
-		$show_add_listing_post_types_main_nav = get_option( 'geodir_add_listing_link_user_dashboard' );
3208
-		$geodir_allow_posttype_frontend       = get_option( 'geodir_allow_posttype_frontend' );
3206
+		$post_types                           = geodir_get_posttypes('object');
3207
+		$show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_user_dashboard');
3208
+		$geodir_allow_posttype_frontend       = get_option('geodir_allow_posttype_frontend');
3209 3209
 
3210
-		if ( ! empty( $show_add_listing_post_types_main_nav ) ) {
3210
+		if (!empty($show_add_listing_post_types_main_nav)) {
3211 3211
 			$addlisting_links = '';
3212
-			foreach ( $post_types as $key => $postobj ) {
3212
+			foreach ($post_types as $key => $postobj) {
3213 3213
 
3214
-				if ( in_array( $key, $show_add_listing_post_types_main_nav ) ) {
3214
+				if (in_array($key, $show_add_listing_post_types_main_nav)) {
3215 3215
 
3216
-					if ( $add_link = geodir_get_addlisting_link( $key ) ) {
3216
+					if ($add_link = geodir_get_addlisting_link($key)) {
3217 3217
 
3218 3218
 						$name = $postobj->labels->name;
3219 3219
 
3220 3220
 						$selected = '';
3221
-						if ( geodir_get_current_posttype() == $key && geodir_is_page( 'add-listing' ) ) {
3221
+						if (geodir_get_current_posttype() == $key && geodir_is_page('add-listing')) {
3222 3222
 							$selected = 'selected="selected"';
3223 3223
 						}
3224 3224
 
@@ -3231,22 +3231,22 @@  discard block
 block discarded – undo
3231 3231
 						 * @param string $key       Add listing array key.
3232 3232
 						 * @param int $current_user ->ID Current user ID.
3233 3233
 						 */
3234
-						$add_link = apply_filters( 'geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID );
3234
+						$add_link = apply_filters('geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID);
3235 3235
 
3236
-						$addlisting_links .= '<option ' . $selected . ' value="' . $add_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3236
+						$addlisting_links .= '<option '.$selected.' value="'.$add_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3237 3237
 
3238 3238
 					}
3239 3239
 				}
3240 3240
 
3241 3241
 			}
3242 3242
 
3243
-			if ( $addlisting_links != '' ) { ?>
3243
+			if ($addlisting_links != '') { ?>
3244 3244
 
3245 3245
 				<li><select id="geodir_add_listing" class="chosen_select" onchange="window.location.href=this.value"
3246 3246
 				            option-autoredirect="1" name="geodir_add_listing" option-ajaxchosen="false"
3247
-				            data-placeholder="<?php echo esc_attr( __( 'Add Listing', 'geodirectory' ) ); ?>">
3247
+				            data-placeholder="<?php echo esc_attr(__('Add Listing', 'geodirectory')); ?>">
3248 3248
 						<option value="" disabled="disabled" selected="selected"
3249
-						        style='display:none;'><?php echo esc_attr( __( 'Add Listing', 'geodirectory' ) ); ?></option>
3249
+						        style='display:none;'><?php echo esc_attr(__('Add Listing', 'geodirectory')); ?></option>
3250 3250
 						<?php echo $addlisting_links; ?>
3251 3251
 					</select></li> <?php
3252 3252
 
@@ -3254,23 +3254,23 @@  discard block
 block discarded – undo
3254 3254
 
3255 3255
 		}
3256 3256
 		// My Favourites in Dashboard
3257
-		$show_favorite_link_user_dashboard = get_option( 'geodir_favorite_link_user_dashboard' );
3257
+		$show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard');
3258 3258
 		$user_favourite                    = geodir_user_favourite_listing_count();
3259 3259
 
3260
-		if ( ! empty( $show_favorite_link_user_dashboard ) && ! empty( $user_favourite ) ) {
3260
+		if (!empty($show_favorite_link_user_dashboard) && !empty($user_favourite)) {
3261 3261
 			$favourite_links = '';
3262 3262
 
3263
-			foreach ( $post_types as $key => $postobj ) {
3264
-				if ( in_array( $key, $show_favorite_link_user_dashboard ) && array_key_exists( $key, $user_favourite ) ) {
3263
+			foreach ($post_types as $key => $postobj) {
3264
+				if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) {
3265 3265
 					$name           = $postobj->labels->name;
3266
-					$post_type_link = geodir_getlink( $author_link, array(
3266
+					$post_type_link = geodir_getlink($author_link, array(
3267 3267
 						'stype' => $key,
3268 3268
 						'list'  => 'favourite'
3269
-					), false );
3269
+					), false);
3270 3270
 
3271 3271
 					$selected = '';
3272 3272
 
3273
-					if ( isset( $_REQUEST['list'] ) && $_REQUEST['list'] == 'favourite' && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key && isset( $_REQUEST['geodir_dashbord'] ) ) {
3273
+					if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key && isset($_REQUEST['geodir_dashbord'])) {
3274 3274
 						$selected = 'selected="selected"';
3275 3275
 					}
3276 3276
 					/**
@@ -3282,20 +3282,20 @@  discard block
 block discarded – undo
3282 3282
 					 * @param string $key            Favorite listing array key.
3283 3283
 					 * @param int $current_user      ->ID Current user ID.
3284 3284
 					 */
3285
-					$post_type_link = apply_filters( 'geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID );
3285
+					$post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID);
3286 3286
 
3287
-					$favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3287
+					$favourite_links .= '<option '.$selected.' value="'.$post_type_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3288 3288
 				}
3289 3289
 			}
3290 3290
 
3291
-			if ( $favourite_links != '' ) {
3291
+			if ($favourite_links != '') {
3292 3292
 				?>
3293 3293
 				<li>
3294 3294
 					<select id="geodir_my_favourites" class="chosen_select" onchange="window.location.href=this.value"
3295 3295
 					        option-autoredirect="1" name="geodir_my_favourites" option-ajaxchosen="false"
3296
-					        data-placeholder="<?php echo esc_attr( __( 'My Favorites', 'geodirectory' ) ); ?>">
3296
+					        data-placeholder="<?php echo esc_attr(__('My Favorites', 'geodirectory')); ?>">
3297 3297
 						<option value="" disabled="disabled" selected="selected"
3298
-						        style='display:none;'><?php echo esc_attr( __( 'My Favorites', 'geodirectory' ) ); ?></option>
3298
+						        style='display:none;'><?php echo esc_attr(__('My Favorites', 'geodirectory')); ?></option>
3299 3299
 						<?php echo $favourite_links; ?>
3300 3300
 					</select>
3301 3301
 				</li>
@@ -3304,19 +3304,19 @@  discard block
 block discarded – undo
3304 3304
 		}
3305 3305
 
3306 3306
 
3307
-		$show_listing_link_user_dashboard = get_option( 'geodir_listing_link_user_dashboard' );
3307
+		$show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard');
3308 3308
 		$user_listing                     = geodir_user_post_listing_count();
3309 3309
 
3310
-		if ( ! empty( $show_listing_link_user_dashboard ) && ! empty( $user_listing ) ) {
3310
+		if (!empty($show_listing_link_user_dashboard) && !empty($user_listing)) {
3311 3311
 			$listing_links = '';
3312 3312
 
3313
-			foreach ( $post_types as $key => $postobj ) {
3314
-				if ( in_array( $key, $show_listing_link_user_dashboard ) && array_key_exists( $key, $user_listing ) ) {
3313
+			foreach ($post_types as $key => $postobj) {
3314
+				if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) {
3315 3315
 					$name         = $postobj->labels->name;
3316
-					$listing_link = geodir_getlink( $author_link, array( 'stype' => $key ), false );
3316
+					$listing_link = geodir_getlink($author_link, array('stype' => $key), false);
3317 3317
 
3318 3318
 					$selected = '';
3319
-					if ( ! isset( $_REQUEST['list'] ) && isset( $_REQUEST['geodir_dashbord'] ) && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key ) {
3319
+					if (!isset($_REQUEST['list']) && isset($_REQUEST['geodir_dashbord']) && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key) {
3320 3320
 						$selected = 'selected="selected"';
3321 3321
 					}
3322 3322
 
@@ -3329,20 +3329,20 @@  discard block
 block discarded – undo
3329 3329
 					 * @param string $key          My listing array key.
3330 3330
 					 * @param int $current_user    ->ID Current user ID.
3331 3331
 					 */
3332
-					$listing_link = apply_filters( 'geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID );
3332
+					$listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID);
3333 3333
 
3334
-					$listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3334
+					$listing_links .= '<option '.$selected.' value="'.$listing_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3335 3335
 				}
3336 3336
 			}
3337 3337
 
3338
-			if ( $listing_links != '' ) {
3338
+			if ($listing_links != '') {
3339 3339
 				?>
3340 3340
 				<li>
3341 3341
 					<select id="geodir_my_listings" class="chosen_select" onchange="window.location.href=this.value"
3342 3342
 					        option-autoredirect="1" name="geodir_my_listings" option-ajaxchosen="false"
3343
-					        data-placeholder="<?php echo esc_attr( __( 'My Listings', 'geodirectory' ) ); ?>">
3343
+					        data-placeholder="<?php echo esc_attr(__('My Listings', 'geodirectory')); ?>">
3344 3344
 						<option value="" disabled="disabled" selected="selected"
3345
-						        style='display:none;'><?php echo esc_attr( __( 'My Listings', 'geodirectory' ) ); ?></option>
3345
+						        style='display:none;'><?php echo esc_attr(__('My Listings', 'geodirectory')); ?></option>
3346 3346
 						<?php echo $listing_links; ?>
3347 3347
 					</select>
3348 3348
 				</li>
@@ -3358,7 +3358,7 @@  discard block
 block discarded – undo
3358 3358
 		 *
3359 3359
 		 * @param string $dashboard_link Dashboard links HTML.
3360 3360
 		 */
3361
-		echo apply_filters( 'geodir_dashboard_links', $dashboard_link );
3361
+		echo apply_filters('geodir_dashboard_links', $dashboard_link);
3362 3362
 		echo '</ul>';
3363 3363
 
3364 3364
 		/**
@@ -3366,7 +3366,7 @@  discard block
 block discarded – undo
3366 3366
 		 *
3367 3367
 		 * @since 1.6.6
3368 3368
 		 */
3369
-		do_action( 'geodir_after_loginwidget_form_logged_in' );
3369
+		do_action('geodir_after_loginwidget_form_logged_in');
3370 3370
 
3371 3371
 
3372 3372
 	} else {
@@ -3381,18 +3381,18 @@  discard block
 block discarded – undo
3381 3381
 		<form name="loginform" class="loginform1"
3382 3382
 		      action="<?php echo geodir_login_url(); ?>"
3383 3383
 		      method="post">
3384
-			<div class="geodir_form_row"><input placeholder="<?php _e( 'Email', 'geodirectory' ); ?>" name="log"
3384
+			<div class="geodir_form_row"><input placeholder="<?php _e('Email', 'geodirectory'); ?>" name="log"
3385 3385
 			                                    type="text" class="textfield user_login1"/> <span
3386 3386
 					class="user_loginInfo"></span></div>
3387
-			<div class="geodir_form_row"><input placeholder="<?php _e( 'Password', 'geodirectory' ); ?>"
3387
+			<div class="geodir_form_row"><input placeholder="<?php _e('Password', 'geodirectory'); ?>"
3388 3388
 			                                    name="pwd" type="password"
3389 3389
 			                                    class="textfield user_pass1 input-text"/><span
3390 3390
 					class="user_passInfo"></span></div>
3391 3391
 
3392
-			<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars( geodir_curPageURL() ); ?>"/>
3392
+			<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars(geodir_curPageURL()); ?>"/>
3393 3393
 			<input type="hidden" name="testcookie" value="1"/>
3394 3394
 
3395
-				<?php do_action( 'login_form' ); ?>
3395
+				<?php do_action('login_form'); ?>
3396 3396
 
3397 3397
 			<div class="geodir_form_row clearfix"><input type="submit" name="submit"
3398 3398
 			                                             value="<?php echo SIGN_IN_BUTTON; ?>" class="b_signin"/>
@@ -3405,7 +3405,7 @@  discard block
 block discarded – undo
3405 3405
 					 * @since 1.0.0
3406 3406
 					 */
3407 3407
 					?>
3408
-					<a href="<?php echo geodir_login_url( array( 'signup' => true ) ); ?>"
3408
+					<a href="<?php echo geodir_login_url(array('signup' => true)); ?>"
3409 3409
 					   class="goedir-newuser-link"><?php echo NEW_USER_TEXT; ?></a>
3410 3410
 
3411 3411
 					<?php
@@ -3415,7 +3415,7 @@  discard block
 block discarded – undo
3415 3415
 					 * @since 1.0.0
3416 3416
 					 */
3417 3417
 					?>
3418
-					<a href="<?php echo geodir_login_url( array( 'forgot' => true ) ); ?>"
3418
+					<a href="<?php echo geodir_login_url(array('forgot' => true)); ?>"
3419 3419
 					   class="goedir-forgot-link"><?php echo FORGOT_PW_TEXT; ?></a></p></div>
3420 3420
 		</form>
3421 3421
 		<?php
@@ -3424,7 +3424,7 @@  discard block
 block discarded – undo
3424 3424
 		 *
3425 3425
 		 * @since 1.6.6
3426 3426
 		 */
3427
-		do_action( 'geodir_after_loginwidget_form_logged_out' );
3427
+		do_action('geodir_after_loginwidget_form_logged_out');
3428 3428
 	}
3429 3429
 
3430 3430
 	echo $after_widget;
@@ -3446,16 +3446,16 @@  discard block
 block discarded – undo
3446 3446
  *                                         after_widget.
3447 3447
  * @param array|string $instance           The settings for the particular instance of the widget.
3448 3448
  */
3449
-function geodir_popular_postview_output( $args = '', $instance = '' ) {
3449
+function geodir_popular_postview_output($args = '', $instance = '') {
3450 3450
 	global $gd_session;
3451 3451
 
3452 3452
 	// prints the widget
3453
-	extract( $args, EXTR_SKIP );
3453
+	extract($args, EXTR_SKIP);
3454 3454
 
3455 3455
 	echo $before_widget;
3456 3456
 
3457 3457
 	/** This filter is documented in geodirectory_widgets.php */
3458
-	$title = empty( $instance['title'] ) ? geodir_ucwords( $instance['category_title'] ) : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
3458
+	$title = empty($instance['title']) ? geodir_ucwords($instance['category_title']) : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
3459 3459
 	/**
3460 3460
 	 * Filter the widget post type.
3461 3461
 	 *
@@ -3463,7 +3463,7 @@  discard block
 block discarded – undo
3463 3463
 	 *
3464 3464
 	 * @param string $instance ['post_type'] Post type of listing.
3465 3465
 	 */
3466
-	$post_type = empty( $instance['post_type'] ) ? 'gd_place' : apply_filters( 'widget_post_type', $instance['post_type'] );
3466
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
3467 3467
 	/**
3468 3468
 	 * Filter the widget's term.
3469 3469
 	 *
@@ -3471,7 +3471,7 @@  discard block
 block discarded – undo
3471 3471
 	 *
3472 3472
 	 * @param string $instance ['category'] Filter by term. Can be any valid term.
3473 3473
 	 */
3474
-	$category = empty( $instance['category'] ) ? '0' : apply_filters( 'widget_category', $instance['category'] );
3474
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
3475 3475
 	/**
3476 3476
 	 * Filter the widget listings limit.
3477 3477
 	 *
@@ -3479,7 +3479,7 @@  discard block
 block discarded – undo
3479 3479
 	 *
3480 3480
 	 * @param string $instance ['post_number'] Number of listings to display.
3481 3481
 	 */
3482
-	$post_number = empty( $instance['post_number'] ) ? '5' : apply_filters( 'widget_post_number', $instance['post_number'] );
3482
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
3483 3483
 	/**
3484 3484
 	 * Filter widget's "layout" type.
3485 3485
 	 *
@@ -3487,7 +3487,7 @@  discard block
 block discarded – undo
3487 3487
 	 *
3488 3488
 	 * @param string $instance ['layout'] Widget layout type.
3489 3489
 	 */
3490
-	$layout = empty( $instance['layout'] ) ? 'gridview_onehalf' : apply_filters( 'widget_layout', $instance['layout'] );
3490
+	$layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']);
3491 3491
 	/**
3492 3492
 	 * Filter widget's "add_location_filter" value.
3493 3493
 	 *
@@ -3495,7 +3495,7 @@  discard block
 block discarded – undo
3495 3495
 	 *
3496 3496
 	 * @param string|bool $instance ['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
3497 3497
 	 */
3498
-	$add_location_filter = empty( $instance['add_location_filter'] ) ? '0' : apply_filters( 'widget_add_location_filter', $instance['add_location_filter'] );
3498
+	$add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
3499 3499
 	/**
3500 3500
 	 * Filter widget's listing width.
3501 3501
 	 *
@@ -3503,7 +3503,7 @@  discard block
 block discarded – undo
3503 3503
 	 *
3504 3504
 	 * @param string $instance ['listing_width'] Listing width.
3505 3505
 	 */
3506
-	$listing_width = empty( $instance['listing_width'] ) ? '' : apply_filters( 'widget_listing_width', $instance['listing_width'] );
3506
+	$listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']);
3507 3507
 	/**
3508 3508
 	 * Filter widget's "list_sort" type.
3509 3509
 	 *
@@ -3511,25 +3511,25 @@  discard block
 block discarded – undo
3511 3511
 	 *
3512 3512
 	 * @param string $instance ['list_sort'] Listing sort by type.
3513 3513
 	 */
3514
-	$list_sort             = empty( $instance['list_sort'] ) ? 'latest' : apply_filters( 'widget_list_sort', $instance['list_sort'] );
3515
-	$use_viewing_post_type = ! empty( $instance['use_viewing_post_type'] ) ? true : false;
3514
+	$list_sort             = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
3515
+	$use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
3516 3516
 
3517 3517
 	// set post type to current viewing post type
3518
-	if ( $use_viewing_post_type ) {
3518
+	if ($use_viewing_post_type) {
3519 3519
 		$current_post_type = geodir_get_current_posttype();
3520
-		if ( $current_post_type != '' && $current_post_type != $post_type ) {
3520
+		if ($current_post_type != '' && $current_post_type != $post_type) {
3521 3521
 			$post_type = $current_post_type;
3522 3522
 			$category  = array(); // old post type category will not work for current changed post type
3523 3523
 		}
3524 3524
 	}
3525 3525
 	// replace widget title dynamically
3526
-	$posttype_plural_label   = __( get_post_type_plural_label( $post_type ), 'geodirectory' );
3527
-	$posttype_singular_label = __( get_post_type_singular_label( $post_type ), 'geodirectory' );
3526
+	$posttype_plural_label   = __(get_post_type_plural_label($post_type), 'geodirectory');
3527
+	$posttype_singular_label = __(get_post_type_singular_label($post_type), 'geodirectory');
3528 3528
 
3529
-	$title = str_replace( "%posttype_plural_label%", $posttype_plural_label, $title );
3530
-	$title = str_replace( "%posttype_singular_label%", $posttype_singular_label, $title );
3529
+	$title = str_replace("%posttype_plural_label%", $posttype_plural_label, $title);
3530
+	$title = str_replace("%posttype_singular_label%", $posttype_singular_label, $title);
3531 3531
 
3532
-	if ( isset( $instance['character_count'] ) ) {
3532
+	if (isset($instance['character_count'])) {
3533 3533
 		/**
3534 3534
 		 * Filter the widget's excerpt character count.
3535 3535
 		 *
@@ -3537,37 +3537,37 @@  discard block
 block discarded – undo
3537 3537
 		 *
3538 3538
 		 * @param int $instance ['character_count'] Excerpt character count.
3539 3539
 		 */
3540
-		$character_count = apply_filters( 'widget_list_character_count', $instance['character_count'] );
3540
+		$character_count = apply_filters('widget_list_character_count', $instance['character_count']);
3541 3541
 	} else {
3542 3542
 		$character_count = '';
3543 3543
 	}
3544 3544
 
3545
-	if ( empty( $title ) || $title == 'All' ) {
3546
-		$title .= ' ' . __( get_post_type_plural_label( $post_type ), 'geodirectory' );
3545
+	if (empty($title) || $title == 'All') {
3546
+		$title .= ' '.__(get_post_type_plural_label($post_type), 'geodirectory');
3547 3547
 	}
3548 3548
 
3549 3549
 	$location_url = array();
3550
-	$city         = get_query_var( 'gd_city' );
3551
-	if ( ! empty( $city ) ) {
3552
-		$country = get_query_var( 'gd_country' );
3553
-		$region  = get_query_var( 'gd_region' );
3550
+	$city         = get_query_var('gd_city');
3551
+	if (!empty($city)) {
3552
+		$country = get_query_var('gd_country');
3553
+		$region  = get_query_var('gd_region');
3554 3554
 
3555
-		$geodir_show_location_url = get_option( 'geodir_show_location_url' );
3555
+		$geodir_show_location_url = get_option('geodir_show_location_url');
3556 3556
 
3557
-		if ( $geodir_show_location_url == 'all' ) {
3558
-			if ( $country != '' ) {
3557
+		if ($geodir_show_location_url == 'all') {
3558
+			if ($country != '') {
3559 3559
 				$location_url[] = $country;
3560 3560
 			}
3561 3561
 
3562
-			if ( $region != '' ) {
3562
+			if ($region != '') {
3563 3563
 				$location_url[] = $region;
3564 3564
 			}
3565
-		} else if ( $geodir_show_location_url == 'country_city' ) {
3566
-			if ( $country != '' ) {
3565
+		} else if ($geodir_show_location_url == 'country_city') {
3566
+			if ($country != '') {
3567 3567
 				$location_url[] = $country;
3568 3568
 			}
3569
-		} else if ( $geodir_show_location_url == 'region_city' ) {
3570
-			if ( $region != '' ) {
3569
+		} else if ($geodir_show_location_url == 'region_city') {
3570
+			if ($region != '') {
3571 3571
 				$location_url[] = $region;
3572 3572
 			}
3573 3573
 		}
@@ -3575,37 +3575,37 @@  discard block
 block discarded – undo
3575 3575
 		$location_url[] = $city;
3576 3576
 	}
3577 3577
 
3578
-	$location_url  = implode( '/', $location_url );
3578
+	$location_url  = implode('/', $location_url);
3579 3579
 	$skip_location = false;
3580
-	if ( ! $add_location_filter && $gd_session->get( 'gd_multi_location' ) ) {
3580
+	if (!$add_location_filter && $gd_session->get('gd_multi_location')) {
3581 3581
 		$skip_location = true;
3582
-		$gd_session->un_set( 'gd_multi_location' );
3582
+		$gd_session->un_set('gd_multi_location');
3583 3583
 	}
3584 3584
 
3585
-	if ( get_option( 'permalink_structure' ) ) {
3586
-		$viewall_url = get_post_type_archive_link( $post_type );
3585
+	if (get_option('permalink_structure')) {
3586
+		$viewall_url = get_post_type_archive_link($post_type);
3587 3587
 	} else {
3588
-		$viewall_url = get_post_type_archive_link( $post_type );
3588
+		$viewall_url = get_post_type_archive_link($post_type);
3589 3589
 	}
3590 3590
 
3591
-	if ( ! empty( $category ) && $category[0] != '0' ) {
3591
+	if (!empty($category) && $category[0] != '0') {
3592 3592
 		global $geodir_add_location_url;
3593 3593
 
3594 3594
 		$geodir_add_location_url = '0';
3595 3595
 
3596
-		if ( $add_location_filter != '0' ) {
3596
+		if ($add_location_filter != '0') {
3597 3597
 			$geodir_add_location_url = '1';
3598 3598
 		}
3599 3599
 
3600
-		$viewall_url = get_term_link( (int) $category[0], $post_type . 'category' );
3600
+		$viewall_url = get_term_link((int) $category[0], $post_type.'category');
3601 3601
 
3602 3602
 		$geodir_add_location_url = null;
3603 3603
 	}
3604
-	if ( $skip_location ) {
3605
-		$gd_session->set( 'gd_multi_location', 1 );
3604
+	if ($skip_location) {
3605
+		$gd_session->set('gd_multi_location', 1);
3606 3606
 	}
3607 3607
 
3608
-	if ( is_wp_error( $viewall_url ) ) {
3608
+	if (is_wp_error($viewall_url)) {
3609 3609
 		$viewall_url = '';
3610 3610
 	}
3611 3611
 
@@ -3617,34 +3617,34 @@  discard block
 block discarded – undo
3617 3617
 		'order_by'       => $list_sort
3618 3618
 	);
3619 3619
 
3620
-	if ( $character_count ) {
3620
+	if ($character_count) {
3621 3621
 		$query_args['excerpt_length'] = $character_count;
3622 3622
 	}
3623 3623
 
3624
-	if ( ! empty( $instance['show_featured_only'] ) ) {
3624
+	if (!empty($instance['show_featured_only'])) {
3625 3625
 		$query_args['show_featured_only'] = 1;
3626 3626
 	}
3627 3627
 
3628
-	if ( ! empty( $instance['show_special_only'] ) ) {
3628
+	if (!empty($instance['show_special_only'])) {
3629 3629
 		$query_args['show_special_only'] = 1;
3630 3630
 	}
3631 3631
 
3632
-	if ( ! empty( $instance['with_pics_only'] ) ) {
3632
+	if (!empty($instance['with_pics_only'])) {
3633 3633
 		$query_args['with_pics_only']      = 0;
3634 3634
 		$query_args['featured_image_only'] = 1;
3635 3635
 	}
3636 3636
 
3637
-	if ( ! empty( $instance['with_videos_only'] ) ) {
3637
+	if (!empty($instance['with_videos_only'])) {
3638 3638
 		$query_args['with_videos_only'] = 1;
3639 3639
 	}
3640
-	$with_no_results = ! empty( $instance['without_no_results'] ) ? false : true;
3640
+	$with_no_results = !empty($instance['without_no_results']) ? false : true;
3641 3641
 
3642
-	if ( ! empty( $category ) && $category[0] != '0' ) {
3643
-		$category_taxonomy = geodir_get_taxonomies( $post_type );
3642
+	if (!empty($category) && $category[0] != '0') {
3643
+		$category_taxonomy = geodir_get_taxonomies($post_type);
3644 3644
 
3645 3645
 		######### WPML #########
3646
-		if ( function_exists( 'icl_object_id' ) ) {
3647
-			$category = gd_lang_object_ids( $category, $category_taxonomy[0] );
3646
+		if (function_exists('icl_object_id')) {
3647
+			$category = gd_lang_object_ids($category, $category_taxonomy[0]);
3648 3648
 		}
3649 3649
 		######### WPML #########
3650 3650
 
@@ -3654,14 +3654,14 @@  discard block
 block discarded – undo
3654 3654
 			'terms'    => $category
3655 3655
 		);
3656 3656
 
3657
-		$query_args['tax_query'] = array( $tax_query );
3657
+		$query_args['tax_query'] = array($tax_query);
3658 3658
 	}
3659 3659
 
3660 3660
 	global $gridview_columns_widget, $geodir_is_widget_listing;
3661 3661
 
3662
-	$widget_listings = geodir_get_widget_listings( $query_args );
3662
+	$widget_listings = geodir_get_widget_listings($query_args);
3663 3663
 
3664
-	if ( ! empty( $widget_listings ) || $with_no_results ) {
3664
+	if (!empty($widget_listings) || $with_no_results) {
3665 3665
 		?>
3666 3666
 		<div class="geodir_locations geodir_location_listing">
3667 3667
 
@@ -3671,11 +3671,11 @@  discard block
 block discarded – undo
3671 3671
 			 *
3672 3672
 			 * @since 1.0.0
3673 3673
 			 */
3674
-			do_action( 'geodir_before_view_all_link_in_widget' ); ?>
3674
+			do_action('geodir_before_view_all_link_in_widget'); ?>
3675 3675
 			<div class="geodir_list_heading clearfix">
3676
-				<?php echo $before_title . $title . $after_title; ?>
3676
+				<?php echo $before_title.$title.$after_title; ?>
3677 3677
 				<a href="<?php echo $viewall_url; ?>"
3678
-				   class="geodir-viewall"><?php _e( 'View all', 'geodirectory' ); ?></a>
3678
+				   class="geodir-viewall"><?php _e('View all', 'geodirectory'); ?></a>
3679 3679
 			</div>
3680 3680
 			<?php
3681 3681
 			/**
@@ -3683,10 +3683,10 @@  discard block
 block discarded – undo
3683 3683
 			 *
3684 3684
 			 * @since 1.0.0
3685 3685
 			 */
3686
-			do_action( 'geodir_after_view_all_link_in_widget' ); ?>
3686
+			do_action('geodir_after_view_all_link_in_widget'); ?>
3687 3687
 			<?php
3688
-			if ( strstr( $layout, 'gridview' ) ) {
3689
-				$listing_view_exp        = explode( '_', $layout );
3688
+			if (strstr($layout, 'gridview')) {
3689
+				$listing_view_exp        = explode('_', $layout);
3690 3690
 				$gridview_columns_widget = $layout;
3691 3691
 				$layout                  = $listing_view_exp[0];
3692 3692
 			} else {
@@ -3698,8 +3698,8 @@  discard block
 block discarded – undo
3698 3698
 			 *
3699 3699
 			 * @since 1.0.0
3700 3700
 			 */
3701
-			$template = apply_filters( "geodir_template_part-widget-listing-listview", geodir_locate_template( 'widget-listing-listview' ) );
3702
-			if ( ! isset( $character_count ) ) {
3701
+			$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
3702
+			if (!isset($character_count)) {
3703 3703
 				/**
3704 3704
 				 * Filter the widget's excerpt character count.
3705 3705
 				 *
@@ -3707,7 +3707,7 @@  discard block
 block discarded – undo
3707 3707
 				 *
3708 3708
 				 * @param int $instance ['character_count'] Excerpt character count.
3709 3709
 				 */
3710
-				$character_count = $character_count == '' ? 50 : apply_filters( 'widget_character_count', $character_count );
3710
+				$character_count = $character_count == '' ? 50 : apply_filters('widget_character_count', $character_count);
3711 3711
 			}
3712 3712
 
3713 3713
 			global $post, $map_jason, $map_canvas_arr;
@@ -3722,13 +3722,13 @@  discard block
 block discarded – undo
3722 3722
 			 *
3723 3723
 			 * @since 1.0.0
3724 3724
 			 */
3725
-			include( $template );
3725
+			include($template);
3726 3726
 
3727 3727
 			$geodir_is_widget_listing = false;
3728 3728
 
3729 3729
 			$GLOBALS['post'] = $current_post;
3730
-			if ( ! empty( $current_post ) ) {
3731
-				setup_postdata( $current_post );
3730
+			if (!empty($current_post)) {
3731
+				setup_postdata($current_post);
3732 3732
 			}
3733 3733
 			$map_jason      = $current_map_jason;
3734 3734
 			$map_canvas_arr = $current_map_canvas_arr;
@@ -3759,12 +3759,12 @@  discard block
 block discarded – undo
3759 3759
  *
3760 3760
  * @return int Reviews count.
3761 3761
  */
3762
-function geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type ) {
3762
+function geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type) {
3763 3763
 	global $wpdb, $plugin_prefix;
3764 3764
 
3765
-	$detail_table = $plugin_prefix . $post_type . '_detail';
3765
+	$detail_table = $plugin_prefix.$post_type.'_detail';
3766 3766
 
3767
-	$sql = "SELECT COALESCE(SUM(rating_count),0) FROM " . $detail_table . " WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(" . $term_id . ", " . $taxonomy . ")";
3767
+	$sql = "SELECT COALESCE(SUM(rating_count),0) FROM ".$detail_table." WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(".$term_id.", ".$taxonomy.")";
3768 3768
 
3769 3769
 	/**
3770 3770
 	 * Filter count review sql query.
@@ -3776,9 +3776,9 @@  discard block
 block discarded – undo
3776 3776
 	 * @param int $taxonomy     The taxonomy Id.
3777 3777
 	 * @param string $post_type The post type.
3778 3778
 	 */
3779
-	$sql = apply_filters( 'geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type );
3779
+	$sql = apply_filters('geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type);
3780 3780
 
3781
-	$count = $wpdb->get_var( $sql );
3781
+	$count = $wpdb->get_var($sql);
3782 3782
 
3783 3783
 	return $count;
3784 3784
 }
@@ -3796,7 +3796,7 @@  discard block
 block discarded – undo
3796 3796
  *
3797 3797
  * @return array Term array data.
3798 3798
  */
3799
-function geodir_count_reviews_by_terms( $force_update = false, $post_ID = 0 ) {
3799
+function geodir_count_reviews_by_terms($force_update = false, $post_ID = 0) {
3800 3800
 	/**
3801 3801
 	 * Filter review count option data.
3802 3802
 	 *
@@ -3806,78 +3806,78 @@  discard block
 block discarded – undo
3806 3806
 	 * @param bool $force_update Force update option value?. Default.false.
3807 3807
 	 * @param int $post_ID       The post id to update if any.
3808 3808
 	 */
3809
-	$option_data = apply_filters( 'geodir_count_reviews_by_terms_before', '', $force_update, $post_ID );
3810
-	if ( ! empty( $option_data ) ) {
3809
+	$option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update, $post_ID);
3810
+	if (!empty($option_data)) {
3811 3811
 		return $option_data;
3812 3812
 	}
3813 3813
 
3814
-	$option_data = get_option( 'geodir_global_review_count' );
3814
+	$option_data = get_option('geodir_global_review_count');
3815 3815
 
3816
-	if ( ! $option_data || $force_update ) {
3817
-		if ( (int) $post_ID > 0 ) { // Update reviews count for specific post categories only.
3816
+	if (!$option_data || $force_update) {
3817
+		if ((int) $post_ID > 0) { // Update reviews count for specific post categories only.
3818 3818
 			global $gd_session;
3819 3819
 			$term_array = (array) $option_data;
3820
-			$post_type  = get_post_type( $post_ID );
3821
-			$taxonomy   = $post_type . 'category';
3822
-			$terms      = wp_get_object_terms( $post_ID, $taxonomy, array( 'fields' => 'ids' ) );
3823
-
3824
-			if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
3825
-				foreach ( $terms as $term_id ) {
3826
-					$count                  = geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type );
3827
-					$children               = get_term_children( $term_id, $taxonomy );
3828
-					$term_array[ $term_id ] = $count;
3820
+			$post_type  = get_post_type($post_ID);
3821
+			$taxonomy   = $post_type.'category';
3822
+			$terms      = wp_get_object_terms($post_ID, $taxonomy, array('fields' => 'ids'));
3823
+
3824
+			if (!empty($terms) && !is_wp_error($terms)) {
3825
+				foreach ($terms as $term_id) {
3826
+					$count                  = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3827
+					$children               = get_term_children($term_id, $taxonomy);
3828
+					$term_array[$term_id] = $count;
3829 3829
 				}
3830 3830
 			}
3831 3831
 
3832
-			$session_listing = $gd_session->get( 'listing' );
3832
+			$session_listing = $gd_session->get('listing');
3833 3833
 
3834 3834
 			$terms = array();
3835
-			if ( isset( $_POST['post_category'][ $taxonomy ] ) ) {
3836
-				$terms = (array) $_POST['post_category'][ $taxonomy ];
3837
-			} else if ( ! empty( $session_listing ) && isset( $session_listing['post_category'][ $taxonomy ] ) ) {
3838
-				$terms = (array) $session_listing['post_category'][ $taxonomy ];
3835
+			if (isset($_POST['post_category'][$taxonomy])) {
3836
+				$terms = (array) $_POST['post_category'][$taxonomy];
3837
+			} else if (!empty($session_listing) && isset($session_listing['post_category'][$taxonomy])) {
3838
+				$terms = (array) $session_listing['post_category'][$taxonomy];
3839 3839
 			}
3840 3840
 
3841
-			if ( ! empty( $terms ) ) {
3842
-				foreach ( $terms as $term_id ) {
3843
-					if ( $term_id > 0 ) {
3844
-						$count                  = geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type );
3845
-						$children               = get_term_children( $term_id, $taxonomy );
3846
-						$term_array[ $term_id ] = $count;
3841
+			if (!empty($terms)) {
3842
+				foreach ($terms as $term_id) {
3843
+					if ($term_id > 0) {
3844
+						$count                  = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3845
+						$children               = get_term_children($term_id, $taxonomy);
3846
+						$term_array[$term_id] = $count;
3847 3847
 					}
3848 3848
 				}
3849 3849
 			}
3850 3850
 		} else { // Update reviews count for all post categories.
3851 3851
 			$term_array = array();
3852 3852
 			$post_types = geodir_get_posttypes();
3853
-			foreach ( $post_types as $post_type ) {
3853
+			foreach ($post_types as $post_type) {
3854 3854
 
3855
-				$taxonomy = geodir_get_taxonomies( $post_type );
3855
+				$taxonomy = geodir_get_taxonomies($post_type);
3856 3856
 				$taxonomy = $taxonomy[0];
3857 3857
 
3858 3858
 				$args = array(
3859 3859
 					'hide_empty' => false
3860 3860
 				);
3861 3861
 
3862
-				$terms = get_terms( $taxonomy, $args );
3862
+				$terms = get_terms($taxonomy, $args);
3863 3863
 
3864
-				foreach ( $terms as $term ) {
3865
-					$count    = geodir_count_reviews_by_term_id( $term->term_id, $taxonomy, $post_type );
3866
-					$children = get_term_children( $term->term_id, $taxonomy );
3864
+				foreach ($terms as $term) {
3865
+					$count    = geodir_count_reviews_by_term_id($term->term_id, $taxonomy, $post_type);
3866
+					$children = get_term_children($term->term_id, $taxonomy);
3867 3867
 					/*if ( is_array( $children ) ) {
3868 3868
                         foreach ( $children as $child_id ) {
3869 3869
                             $child_count = geodir_count_reviews_by_term_id($child_id, $taxonomy, $post_type);
3870 3870
                             $count = $count + $child_count;
3871 3871
                         }
3872 3872
                     }*/
3873
-					$term_array[ $term->term_id ] = $count;
3873
+					$term_array[$term->term_id] = $count;
3874 3874
 				}
3875 3875
 			}
3876 3876
 		}
3877 3877
 
3878
-		update_option( 'geodir_global_review_count', $term_array );
3878
+		update_option('geodir_global_review_count', $term_array);
3879 3879
 		//clear cache
3880
-		wp_cache_delete( 'geodir_global_review_count' );
3880
+		wp_cache_delete('geodir_global_review_count');
3881 3881
 
3882 3882
 		return $term_array;
3883 3883
 	} else {
@@ -3893,39 +3893,39 @@  discard block
 block discarded – undo
3893 3893
  * @package GeoDirectory
3894 3894
  * @return bool
3895 3895
  */
3896
-function geodir_term_review_count_force_update( $new_status, $old_status = '', $post = '' ) {
3897
-	if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'geodir_import_export' ) {
3896
+function geodir_term_review_count_force_update($new_status, $old_status = '', $post = '') {
3897
+	if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'geodir_import_export') {
3898 3898
 		return; // do not run if importing listings
3899 3899
 	}
3900 3900
 
3901
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
3901
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
3902 3902
 		return;
3903 3903
 	}
3904 3904
 
3905 3905
 	$post_ID = 0;
3906
-	if ( ! empty( $post ) ) {
3907
-		if ( isset( $post->post_type ) && strpos( $post->post_type, 'gd_' ) !== 0 ) {
3906
+	if (!empty($post)) {
3907
+		if (isset($post->post_type) && strpos($post->post_type, 'gd_') !== 0) {
3908 3908
 			return;
3909 3909
 		}
3910 3910
 
3911
-		if ( $new_status == 'auto-draft' && $old_status == 'new' ) {
3911
+		if ($new_status == 'auto-draft' && $old_status == 'new') {
3912 3912
 			return;
3913 3913
 		}
3914 3914
 
3915
-		if ( ! empty( $post->ID ) ) {
3915
+		if (!empty($post->ID)) {
3916 3916
 			$post_ID = $post->ID;
3917 3917
 		}
3918 3918
 	}
3919 3919
 
3920
-	if ( $new_status != $old_status ) {
3921
-		geodir_count_reviews_by_terms( true, $post_ID );
3920
+	if ($new_status != $old_status) {
3921
+		geodir_count_reviews_by_terms(true, $post_ID);
3922 3922
 	}
3923 3923
 
3924 3924
 	return true;
3925 3925
 }
3926 3926
 
3927
-function geodir_term_review_count_force_update_single_post( $post_id ) {
3928
-	geodir_count_reviews_by_terms( true, $post_id );
3927
+function geodir_term_review_count_force_update_single_post($post_id) {
3928
+	geodir_count_reviews_by_terms(true, $post_id);
3929 3929
 }
3930 3930
 
3931 3931
 /*-----------------------------------------------------------------------------------*/
@@ -3942,11 +3942,11 @@  discard block
 block discarded – undo
3942 3942
  *
3943 3943
  * @return int Post count.
3944 3944
  */
3945
-function geodir_count_posts_by_term( $data, $term ) {
3945
+function geodir_count_posts_by_term($data, $term) {
3946 3946
 
3947
-	if ( $data ) {
3948
-		if ( isset( $data[ $term->term_id ] ) ) {
3949
-			return $data[ $term->term_id ];
3947
+	if ($data) {
3948
+		if (isset($data[$term->term_id])) {
3949
+			return $data[$term->term_id];
3950 3950
 		} else {
3951 3951
 			return 0;
3952 3952
 		}
@@ -3963,8 +3963,8 @@  discard block
 block discarded – undo
3963 3963
  * param array $terms An array of term objects.
3964 3964
  * @return array Sorted terms array.
3965 3965
  */
3966
-function geodir_sort_terms_by_count( $terms ) {
3967
-	usort( $terms, "geodir_sort_by_count_obj" );
3966
+function geodir_sort_terms_by_count($terms) {
3967
+	usort($terms, "geodir_sort_by_count_obj");
3968 3968
 
3969 3969
 	return $terms;
3970 3970
 }
@@ -3979,8 +3979,8 @@  discard block
 block discarded – undo
3979 3979
  *
3980 3980
  * @return array Sorted terms array.
3981 3981
  */
3982
-function geodir_sort_terms_by_review_count( $terms ) {
3983
-	usort( $terms, "geodir_sort_by_review_count_obj" );
3982
+function geodir_sort_terms_by_review_count($terms) {
3983
+	usort($terms, "geodir_sort_by_review_count_obj");
3984 3984
 
3985 3985
 	return $terms;
3986 3986
 }
@@ -3996,12 +3996,12 @@  discard block
 block discarded – undo
3996 3996
  *
3997 3997
  * @return array Sorted terms array.
3998 3998
  */
3999
-function geodir_sort_terms( $terms, $sort = 'count' ) {
4000
-	if ( $sort == 'count' ) {
4001
-		return geodir_sort_terms_by_count( $terms );
3999
+function geodir_sort_terms($terms, $sort = 'count') {
4000
+	if ($sort == 'count') {
4001
+		return geodir_sort_terms_by_count($terms);
4002 4002
 	}
4003
-	if ( $sort == 'review_count' ) {
4004
-		return geodir_sort_terms_by_review_count( $terms );
4003
+	if ($sort == 'review_count') {
4004
+		return geodir_sort_terms_by_review_count($terms);
4005 4005
 	}
4006 4006
 }
4007 4007
 
@@ -4019,7 +4019,7 @@  discard block
 block discarded – undo
4019 4019
  *
4020 4020
  * @return bool
4021 4021
  */
4022
-function geodir_sort_by_count( $a, $b ) {
4022
+function geodir_sort_by_count($a, $b) {
4023 4023
 	return $a['count'] < $b['count'];
4024 4024
 }
4025 4025
 
@@ -4034,7 +4034,7 @@  discard block
 block discarded – undo
4034 4034
  *
4035 4035
  * @return bool
4036 4036
  */
4037
-function geodir_sort_by_count_obj( $a, $b ) {
4037
+function geodir_sort_by_count_obj($a, $b) {
4038 4038
 	return $a->count < $b->count;
4039 4039
 }
4040 4040
 
@@ -4049,7 +4049,7 @@  discard block
 block discarded – undo
4049 4049
  *
4050 4050
  * @return bool
4051 4051
  */
4052
-function geodir_sort_by_review_count_obj( $a, $b ) {
4052
+function geodir_sort_by_review_count_obj($a, $b) {
4053 4053
 	return $a->review_count < $b->review_count;
4054 4054
 }
4055 4055
 
@@ -4066,35 +4066,35 @@  discard block
 block discarded – undo
4066 4066
 	 * @since   1.4.2
4067 4067
 	 * @package GeoDirectory
4068 4068
 	 */
4069
-	$locale = apply_filters( 'plugin_locale', get_locale(), 'geodirectory' );
4069
+	$locale = apply_filters('plugin_locale', get_locale(), 'geodirectory');
4070 4070
 
4071
-	load_textdomain( 'geodirectory', WP_LANG_DIR . '/' . 'geodirectory' . '/' . 'geodirectory' . '-' . $locale . '.mo' );
4072
-	load_plugin_textdomain( 'geodirectory', false, plugin_basename( dirname( dirname( __FILE__ ) ) ) . '/geodirectory-languages' );
4071
+	load_textdomain('geodirectory', WP_LANG_DIR.'/'.'geodirectory'.'/'.'geodirectory'.'-'.$locale.'.mo');
4072
+	load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))).'/geodirectory-languages');
4073 4073
 
4074 4074
 	/**
4075 4075
 	 * Define language constants.
4076 4076
 	 *
4077 4077
 	 * @since 1.0.0
4078 4078
 	 */
4079
-	require_once( geodir_plugin_path() . '/language.php' );
4079
+	require_once(geodir_plugin_path().'/language.php');
4080 4080
 
4081
-	$language_file = geodir_plugin_path() . '/db-language.php';
4081
+	$language_file = geodir_plugin_path().'/db-language.php';
4082 4082
 
4083 4083
 	// Load language string file if not created yet
4084
-	if ( ! file_exists( $language_file ) ) {
4084
+	if (!file_exists($language_file)) {
4085 4085
 		geodirectory_load_db_language();
4086 4086
 	}
4087 4087
 
4088
-	if ( file_exists( $language_file ) ) {
4088
+	if (file_exists($language_file)) {
4089 4089
 		/**
4090 4090
 		 * Language strings from database.
4091 4091
 		 *
4092 4092
 		 * @since 1.4.2
4093 4093
 		 */
4094 4094
 		try {
4095
-			require_once( $language_file );
4096
-		} catch ( Exception $e ) {
4097
-			error_log( 'Language Error: ' . $e->getMessage() );
4095
+			require_once($language_file);
4096
+		} catch (Exception $e) {
4097
+			error_log('Language Error: '.$e->getMessage());
4098 4098
 		}
4099 4099
 	}
4100 4100
 }
@@ -4111,19 +4111,19 @@  discard block
 block discarded – undo
4111 4111
  */
4112 4112
 function geodirectory_load_db_language() {
4113 4113
 	global $wp_filesystem;
4114
-	if ( empty( $wp_filesystem ) ) {
4115
-		require_once( ABSPATH . '/wp-admin/includes/file.php' );
4114
+	if (empty($wp_filesystem)) {
4115
+		require_once(ABSPATH.'/wp-admin/includes/file.php');
4116 4116
 		WP_Filesystem();
4117 4117
 		global $wp_filesystem;
4118 4118
 	}
4119 4119
 
4120
-	$language_file = geodir_plugin_path() . '/db-language.php';
4120
+	$language_file = geodir_plugin_path().'/db-language.php';
4121 4121
 
4122
-	if ( is_file( $language_file ) && ! is_writable( $language_file ) ) {
4122
+	if (is_file($language_file) && !is_writable($language_file)) {
4123 4123
 		return false;
4124 4124
 	} // Not possible to create.
4125 4125
 
4126
-	if ( ! is_file( $language_file ) && ! is_writable( dirname( $language_file ) ) ) {
4126
+	if (!is_file($language_file) && !is_writable(dirname($language_file))) {
4127 4127
 		return false;
4128 4128
 	} // Not possible to create.
4129 4129
 
@@ -4136,9 +4136,9 @@  discard block
 block discarded – undo
4136 4136
 	 *
4137 4137
 	 * @param array $contents_strings Array of strings.
4138 4138
 	 */
4139
-	$contents_strings = apply_filters( 'geodir_load_db_language', $contents_strings );
4139
+	$contents_strings = apply_filters('geodir_load_db_language', $contents_strings);
4140 4140
 
4141
-	$contents_strings = array_unique( $contents_strings );
4141
+	$contents_strings = array_unique($contents_strings);
4142 4142
 
4143 4143
 	$contents_head   = array();
4144 4144
 	$contents_head[] = "<?php";
@@ -4155,20 +4155,20 @@  discard block
 block discarded – undo
4155 4155
 	$contents_foot[] = "";
4156 4156
 	$contents_foot[] = "";
4157 4157
 
4158
-	$contents = implode( PHP_EOL, $contents_head );
4158
+	$contents = implode(PHP_EOL, $contents_head);
4159 4159
 
4160
-	if ( ! empty( $contents_strings ) ) {
4161
-		foreach ( $contents_strings as $string ) {
4162
-			if ( is_scalar( $string ) && $string != '' ) {
4163
-				$string = str_replace( "'", "\'", $string );
4164
-				$contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');";
4160
+	if (!empty($contents_strings)) {
4161
+		foreach ($contents_strings as $string) {
4162
+			if (is_scalar($string) && $string != '') {
4163
+				$string = str_replace("'", "\'", $string);
4164
+				$contents .= PHP_EOL."__('".$string."', 'geodirectory');";
4165 4165
 			}
4166 4166
 		}
4167 4167
 	}
4168 4168
 
4169
-	$contents .= implode( PHP_EOL, $contents_foot );
4169
+	$contents .= implode(PHP_EOL, $contents_foot);
4170 4170
 
4171
-	if ( $wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE ) ) {
4171
+	if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE)) {
4172 4172
 		return false;
4173 4173
 	} // Failure; could not write file.
4174 4174
 
@@ -4189,49 +4189,49 @@  discard block
 block discarded – undo
4189 4189
  *
4190 4190
  * @return array Translation texts.
4191 4191
  */
4192
-function geodir_load_custom_field_translation( $translation_texts = array() ) {
4192
+function geodir_load_custom_field_translation($translation_texts = array()) {
4193 4193
 	global $wpdb;
4194 4194
 
4195 4195
 	// Custom fields table
4196
-	$sql  = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values, validation_msg FROM " . GEODIR_CUSTOM_FIELDS_TABLE;
4197
-	$rows = $wpdb->get_results( $sql );
4196
+	$sql  = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values, validation_msg FROM ".GEODIR_CUSTOM_FIELDS_TABLE;
4197
+	$rows = $wpdb->get_results($sql);
4198 4198
 
4199
-	if ( ! empty( $rows ) ) {
4200
-		foreach ( $rows as $row ) {
4201
-			if ( ! empty( $row->admin_title ) ) {
4202
-				$translation_texts[] = stripslashes_deep( $row->admin_title );
4199
+	if (!empty($rows)) {
4200
+		foreach ($rows as $row) {
4201
+			if (!empty($row->admin_title)) {
4202
+				$translation_texts[] = stripslashes_deep($row->admin_title);
4203 4203
 			}
4204 4204
 
4205
-			if ( ! empty( $row->admin_desc ) ) {
4206
-				$translation_texts[] = stripslashes_deep( $row->admin_desc );
4205
+			if (!empty($row->admin_desc)) {
4206
+				$translation_texts[] = stripslashes_deep($row->admin_desc);
4207 4207
 			}
4208 4208
 
4209
-			if ( ! empty( $row->site_title ) ) {
4210
-				$translation_texts[] = stripslashes_deep( $row->site_title );
4209
+			if (!empty($row->site_title)) {
4210
+				$translation_texts[] = stripslashes_deep($row->site_title);
4211 4211
 			}
4212 4212
 
4213
-			if ( ! empty( $row->clabels ) ) {
4214
-				$translation_texts[] = stripslashes_deep( $row->clabels );
4213
+			if (!empty($row->clabels)) {
4214
+				$translation_texts[] = stripslashes_deep($row->clabels);
4215 4215
 			}
4216 4216
 
4217
-			if ( ! empty( $row->required_msg ) ) {
4218
-				$translation_texts[] = stripslashes_deep( $row->required_msg );
4217
+			if (!empty($row->required_msg)) {
4218
+				$translation_texts[] = stripslashes_deep($row->required_msg);
4219 4219
 			}
4220 4220
             
4221
-			if ( ! empty( $row->validation_msg ) ) {
4222
-				$translation_texts[] = stripslashes_deep( $row->validation_msg );
4221
+			if (!empty($row->validation_msg)) {
4222
+				$translation_texts[] = stripslashes_deep($row->validation_msg);
4223 4223
 			}
4224 4224
 
4225
-			if ( ! empty( $row->default_value ) ) {
4226
-				$translation_texts[] = stripslashes_deep( $row->default_value );
4225
+			if (!empty($row->default_value)) {
4226
+				$translation_texts[] = stripslashes_deep($row->default_value);
4227 4227
 			}
4228 4228
 
4229
-			if ( ! empty( $row->option_values ) ) {
4230
-				$option_values = geodir_string_values_to_options( stripslashes_deep( $row->option_values ) );
4229
+			if (!empty($row->option_values)) {
4230
+				$option_values = geodir_string_values_to_options(stripslashes_deep($row->option_values));
4231 4231
 
4232
-				if ( ! empty( $option_values ) ) {
4233
-					foreach ( $option_values as $option_value ) {
4234
-						if ( ! empty( $option_value['label'] ) ) {
4232
+				if (!empty($option_values)) {
4233
+					foreach ($option_values as $option_value) {
4234
+						if (!empty($option_value['label'])) {
4235 4235
 							$translation_texts[] = $option_value['label'];
4236 4236
 						}
4237 4237
 					}
@@ -4241,56 +4241,56 @@  discard block
 block discarded – undo
4241 4241
 	}
4242 4242
 
4243 4243
 	// Custom sorting fields table
4244
-	$sql  = "SELECT site_title, asc_title, desc_title FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE;
4245
-	$rows = $wpdb->get_results( $sql );
4244
+	$sql  = "SELECT site_title, asc_title, desc_title FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE;
4245
+	$rows = $wpdb->get_results($sql);
4246 4246
 
4247
-	if ( ! empty( $rows ) ) {
4248
-		foreach ( $rows as $row ) {
4249
-			if ( ! empty( $row->site_title ) ) {
4250
-				$translation_texts[] = stripslashes_deep( $row->site_title );
4247
+	if (!empty($rows)) {
4248
+		foreach ($rows as $row) {
4249
+			if (!empty($row->site_title)) {
4250
+				$translation_texts[] = stripslashes_deep($row->site_title);
4251 4251
 			}
4252 4252
 
4253
-			if ( ! empty( $row->asc_title ) ) {
4254
-				$translation_texts[] = stripslashes_deep( $row->asc_title );
4253
+			if (!empty($row->asc_title)) {
4254
+				$translation_texts[] = stripslashes_deep($row->asc_title);
4255 4255
 			}
4256 4256
 
4257
-			if ( ! empty( $row->desc_title ) ) {
4258
-				$translation_texts[] = stripslashes_deep( $row->desc_title );
4257
+			if (!empty($row->desc_title)) {
4258
+				$translation_texts[] = stripslashes_deep($row->desc_title);
4259 4259
 			}
4260 4260
 		}
4261 4261
 	}
4262 4262
 
4263 4263
 	// Advance search filter fields table
4264
-	if ( defined( 'GEODIR_ADVANCE_SEARCH_TABLE' ) ) {
4265
-		$sql  = "SELECT field_site_name, front_search_title, first_search_text, last_search_text, field_desc FROM " . GEODIR_ADVANCE_SEARCH_TABLE;
4266
-		$rows = $wpdb->get_results( $sql );
4267
-
4268
-		if ( ! empty( $rows ) ) {
4269
-			foreach ( $rows as $row ) {
4270
-				if ( ! empty( $row->field_site_name ) ) {
4271
-					$translation_texts[] = stripslashes_deep( $row->field_site_name );
4264
+	if (defined('GEODIR_ADVANCE_SEARCH_TABLE')) {
4265
+		$sql  = "SELECT field_site_name, front_search_title, first_search_text, last_search_text, field_desc FROM ".GEODIR_ADVANCE_SEARCH_TABLE;
4266
+		$rows = $wpdb->get_results($sql);
4267
+
4268
+		if (!empty($rows)) {
4269
+			foreach ($rows as $row) {
4270
+				if (!empty($row->field_site_name)) {
4271
+					$translation_texts[] = stripslashes_deep($row->field_site_name);
4272 4272
 				}
4273 4273
 
4274
-				if ( ! empty( $row->front_search_title ) ) {
4275
-					$translation_texts[] = stripslashes_deep( $row->front_search_title );
4274
+				if (!empty($row->front_search_title)) {
4275
+					$translation_texts[] = stripslashes_deep($row->front_search_title);
4276 4276
 				}
4277 4277
 
4278
-				if ( ! empty( $row->first_search_text ) ) {
4279
-					$translation_texts[] = stripslashes_deep( $row->first_search_text );
4278
+				if (!empty($row->first_search_text)) {
4279
+					$translation_texts[] = stripslashes_deep($row->first_search_text);
4280 4280
 				}
4281 4281
 
4282
-				if ( ! empty( $row->last_search_text ) ) {
4283
-					$translation_texts[] = stripslashes_deep( $row->last_search_text );
4282
+				if (!empty($row->last_search_text)) {
4283
+					$translation_texts[] = stripslashes_deep($row->last_search_text);
4284 4284
 				}
4285 4285
 
4286
-				if ( ! empty( $row->field_desc ) ) {
4287
-					$translation_texts[] = stripslashes_deep( $row->field_desc );
4286
+				if (!empty($row->field_desc)) {
4287
+					$translation_texts[] = stripslashes_deep($row->field_desc);
4288 4288
 				}
4289 4289
 			}
4290 4290
 		}
4291 4291
 	}
4292 4292
 
4293
-	$translation_texts = ! empty( $translation_texts ) ? array_unique( $translation_texts ) : $translation_texts;
4293
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
4294 4294
 
4295 4295
 	return $translation_texts;
4296 4296
 }
@@ -4312,7 +4312,7 @@  discard block
 block discarded – undo
4312 4312
 	 *
4313 4313
 	 * @param array $geodir_allowed_mime_types and file extensions.
4314 4314
 	 */
4315
-	return apply_filters( 'geodir_allowed_mime_types', array(
4315
+	return apply_filters('geodir_allowed_mime_types', array(
4316 4316
 			'Image'       => array( // Image formats.
4317 4317
 				'jpg'  => 'image/jpeg',
4318 4318
 				'jpe'  => 'image/jpeg',
@@ -4380,18 +4380,18 @@  discard block
 block discarded – undo
4380 4380
  *
4381 4381
  * @return string User display name.
4382 4382
  */
4383
-function geodir_get_client_name( $user_id ) {
4383
+function geodir_get_client_name($user_id) {
4384 4384
 	$client_name = '';
4385 4385
 
4386
-	$user_data = get_userdata( $user_id );
4386
+	$user_data = get_userdata($user_id);
4387 4387
 
4388
-	if ( ! empty( $user_data ) ) {
4389
-		if ( isset( $user_data->display_name ) && trim( $user_data->display_name ) != '' ) {
4390
-			$client_name = trim( $user_data->display_name );
4391
-		} else if ( isset( $user_data->user_nicename ) && trim( $user_data->user_nicename ) != '' ) {
4392
-			$client_name = trim( $user_data->user_nicename );
4388
+	if (!empty($user_data)) {
4389
+		if (isset($user_data->display_name) && trim($user_data->display_name) != '') {
4390
+			$client_name = trim($user_data->display_name);
4391
+		} else if (isset($user_data->user_nicename) && trim($user_data->user_nicename) != '') {
4392
+			$client_name = trim($user_data->user_nicename);
4393 4393
 		} else {
4394
-			$client_name = trim( $user_data->user_login );
4394
+			$client_name = trim($user_data->user_login);
4395 4395
 		}
4396 4396
 	}
4397 4397
 
@@ -4399,19 +4399,19 @@  discard block
 block discarded – undo
4399 4399
 }
4400 4400
 
4401 4401
 
4402
-add_filter( 'wpseo_replacements', 'geodir_wpseo_replacements', 10, 1 );
4402
+add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1);
4403 4403
 /*
4404 4404
  * Add location variables to wpseo replacements.
4405 4405
  *
4406 4406
  * @since 1.5.4
4407 4407
  */
4408
-function geodir_wpseo_replacements( $vars ) {
4408
+function geodir_wpseo_replacements($vars) {
4409 4409
 
4410 4410
 	global $wp;
4411 4411
 	$title = '';
4412 4412
 	// location variables
4413 4413
 	$gd_post_type   = geodir_get_current_posttype();
4414
-	$location_array = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
4414
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4415 4415
 	/**
4416 4416
 	 * Filter the title variables location variables array
4417 4417
 	 *
@@ -4421,105 +4421,105 @@  discard block
 block discarded – undo
4421 4421
 	 * @param array $location_array The array of location variables.
4422 4422
 	 * @param array $vars           The page title variables.
4423 4423
 	 */
4424
-	$location_array  = apply_filters( 'geodir_filter_title_variables_location_arr_seo', $location_array, $vars );
4424
+	$location_array  = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars);
4425 4425
 	$location_titles = array();
4426
-	if ( get_query_var( 'gd_country_full' ) ) {
4427
-		if ( get_query_var( 'gd_country_full' ) ) {
4428
-			$location_array['gd_country'] = get_query_var( 'gd_country_full' );
4426
+	if (get_query_var('gd_country_full')) {
4427
+		if (get_query_var('gd_country_full')) {
4428
+			$location_array['gd_country'] = get_query_var('gd_country_full');
4429 4429
 		}
4430
-		if ( get_query_var( 'gd_region_full' ) ) {
4431
-			$location_array['gd_region'] = get_query_var( 'gd_region_full' );
4430
+		if (get_query_var('gd_region_full')) {
4431
+			$location_array['gd_region'] = get_query_var('gd_region_full');
4432 4432
 		}
4433
-		if ( get_query_var( 'gd_city_full' ) ) {
4434
-			$location_array['gd_city'] = get_query_var( 'gd_city_full' );
4433
+		if (get_query_var('gd_city_full')) {
4434
+			$location_array['gd_city'] = get_query_var('gd_city_full');
4435 4435
 		}
4436 4436
 	}
4437 4437
 	$location_single = '';
4438
-	$gd_country      = ( isset( $wp->query_vars['gd_country'] ) && $wp->query_vars['gd_country'] != '' ) ? $wp->query_vars['gd_country'] : '';
4439
-	$gd_region       = ( isset( $wp->query_vars['gd_region'] ) && $wp->query_vars['gd_region'] != '' ) ? $wp->query_vars['gd_region'] : '';
4440
-	$gd_city         = ( isset( $wp->query_vars['gd_city'] ) && $wp->query_vars['gd_city'] != '' ) ? $wp->query_vars['gd_city'] : '';
4438
+	$gd_country      = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4439
+	$gd_region       = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4440
+	$gd_city         = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4441 4441
 
4442 4442
 	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4443 4443
 
4444
-	if ( function_exists( 'get_actual_location_name' ) ) {
4445
-		$gd_country_actual = $gd_country != '' ? get_actual_location_name( 'country', $gd_country, true ) : $gd_country;
4446
-		$gd_region_actual  = $gd_region != '' ? get_actual_location_name( 'region', $gd_region ) : $gd_region;
4447
-		$gd_city_actual    = $gd_city != '' ? get_actual_location_name( 'city', $gd_city ) : $gd_city;
4444
+	if (function_exists('get_actual_location_name')) {
4445
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4446
+		$gd_region_actual  = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4447
+		$gd_city_actual    = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4448 4448
 	}
4449 4449
 
4450
-	if ( $gd_city != '' ) {
4451
-		if ( $gd_city_actual != '' ) {
4450
+	if ($gd_city != '') {
4451
+		if ($gd_city_actual != '') {
4452 4452
 			$gd_city = $gd_city_actual;
4453 4453
 		} else {
4454
-			$gd_city = preg_replace( '/-(\d+)$/', '', $gd_city );
4455
-			$gd_city = preg_replace( '/[_-]/', ' ', $gd_city );
4456
-			$gd_city = __( geodir_ucwords( $gd_city ), 'geodirectory' );
4454
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4455
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4456
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4457 4457
 		}
4458 4458
 		$location_single = $gd_city;
4459 4459
 
4460
-	} else if ( $gd_region != '' ) {
4461
-		if ( $gd_region_actual != '' ) {
4460
+	} else if ($gd_region != '') {
4461
+		if ($gd_region_actual != '') {
4462 4462
 			$gd_region = $gd_region_actual;
4463 4463
 		} else {
4464
-			$gd_region = preg_replace( '/-(\d+)$/', '', $gd_region );
4465
-			$gd_region = preg_replace( '/[_-]/', ' ', $gd_region );
4466
-			$gd_region = __( geodir_ucwords( $gd_region ), 'geodirectory' );
4464
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4465
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4466
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4467 4467
 		}
4468 4468
 
4469 4469
 		$location_single = $gd_region;
4470
-	} else if ( $gd_country != '' ) {
4471
-		if ( $gd_country_actual != '' ) {
4470
+	} else if ($gd_country != '') {
4471
+		if ($gd_country_actual != '') {
4472 4472
 			$gd_country = $gd_country_actual;
4473 4473
 		} else {
4474
-			$gd_country = preg_replace( '/-(\d+)$/', '', $gd_country );
4475
-			$gd_country = preg_replace( '/[_-]/', ' ', $gd_country );
4476
-			$gd_country = __( geodir_ucwords( $gd_country ), 'geodirectory' );
4474
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4475
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4476
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4477 4477
 		}
4478 4478
 
4479 4479
 		$location_single = $gd_country;
4480 4480
 	}
4481 4481
 
4482
-	if ( ! empty( $location_array ) ) {
4482
+	if (!empty($location_array)) {
4483 4483
 
4484
-		$actual_location_name = function_exists( 'get_actual_location_name' ) ? true : false;
4485
-		$location_array       = array_reverse( $location_array );
4484
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4485
+		$location_array       = array_reverse($location_array);
4486 4486
 
4487
-		foreach ( $location_array as $location_type => $location ) {
4488
-			$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location );
4489
-			$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
4487
+		foreach ($location_array as $location_type => $location) {
4488
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4489
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4490 4490
 
4491
-			$location_name = geodir_ucwords( $gd_location_link_text );
4492
-			$location_name = __( $location_name, 'geodirectory' );
4491
+			$location_name = geodir_ucwords($gd_location_link_text);
4492
+			$location_name = __($location_name, 'geodirectory');
4493 4493
 
4494
-			if ( $actual_location_name ) {
4495
-				$location_type = strpos( $location_type, 'gd_' ) === 0 ? substr( $location_type, 3 ) : $location_type;
4496
-				$location_name = get_actual_location_name( $location_type, $location, true );
4494
+			if ($actual_location_name) {
4495
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4496
+				$location_name = get_actual_location_name($location_type, $location, true);
4497 4497
 			}
4498 4498
 
4499 4499
 			$location_titles[] = $location_name;
4500 4500
 		}
4501
-		if ( ! empty( $location_titles ) ) {
4502
-			$location_titles = array_unique( $location_titles );
4501
+		if (!empty($location_titles)) {
4502
+			$location_titles = array_unique($location_titles);
4503 4503
 		}
4504 4504
 	}
4505 4505
 
4506 4506
 
4507
-	if ( ! empty( $location_titles ) ) {
4508
-		$vars['%%location%%'] = implode( ", ", $location_titles );
4507
+	if (!empty($location_titles)) {
4508
+		$vars['%%location%%'] = implode(", ", $location_titles);
4509 4509
 	}
4510 4510
 
4511 4511
 
4512
-	if ( ! empty( $location_titles ) ) {
4513
-		$vars['%%in_location%%'] = __( 'in ', 'geodirectory' ) . implode( ", ", $location_titles );
4512
+	if (!empty($location_titles)) {
4513
+		$vars['%%in_location%%'] = __('in ', 'geodirectory').implode(", ", $location_titles);
4514 4514
 	}
4515 4515
 
4516 4516
 
4517
-	if ( $location_single ) {
4518
-		$vars['%%in_location_single%%'] = __( 'in', 'geodirectory' ) . ' ' . $location_single;
4517
+	if ($location_single) {
4518
+		$vars['%%in_location_single%%'] = __('in', 'geodirectory').' '.$location_single;
4519 4519
 	}
4520 4520
 
4521 4521
 
4522
-	if ( $location_single ) {
4522
+	if ($location_single) {
4523 4523
 		$vars['%%location_single%%'] = $location_single;
4524 4524
 	}
4525 4525
 
@@ -4532,13 +4532,13 @@  discard block
 block discarded – undo
4532 4532
 	 * @param string $vars          The title with variables.
4533 4533
 	 * @param array $location_array The array of location variables.
4534 4534
 	 */
4535
-	return apply_filters( 'geodir_wpseo_replacements_vars', $vars, $location_array );
4535
+	return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array);
4536 4536
 }
4537 4537
 
4538 4538
 
4539
-add_filter( 'geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3 );
4540
-add_filter( 'geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2 );
4541
-add_filter( 'geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3 );
4539
+add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3);
4540
+add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2);
4541
+add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3);
4542 4542
 
4543 4543
 /**
4544 4544
  * Filter the title variables.
@@ -4580,14 +4580,14 @@  discard block
 block discarded – undo
4580 4580
  *
4581 4581
  * @return string Title after filtered variables.
4582 4582
  */
4583
-function geodir_filter_title_variables( $title, $gd_page, $sep = '' ) {
4583
+function geodir_filter_title_variables($title, $gd_page, $sep = '') {
4584 4584
 	global $wp, $post;
4585 4585
 
4586
-	if ( ! $gd_page || ! $title ) {
4586
+	if (!$gd_page || !$title) {
4587 4587
 		return $title; // if no a GD page then bail.
4588 4588
 	}
4589 4589
 
4590
-	if ( $sep == '' ) {
4590
+	if ($sep == '') {
4591 4591
 		/**
4592 4592
 		 * Filter the page title separator.
4593 4593
 		 *
@@ -4596,100 +4596,100 @@  discard block
 block discarded – undo
4596 4596
 		 *
4597 4597
 		 * @param string $sep The separator, default: `|`.
4598 4598
 		 */
4599
-		$sep = apply_filters( 'geodir_page_title_separator', '|' );
4599
+		$sep = apply_filters('geodir_page_title_separator', '|');
4600 4600
 	}
4601 4601
 
4602
-	if ( strpos( $title, '%%title%%' ) !== false ) {
4603
-		$title = str_replace( "%%title%%", $post->post_title, $title );
4602
+	if (strpos($title, '%%title%%') !== false) {
4603
+		$title = str_replace("%%title%%", $post->post_title, $title);
4604 4604
 	}
4605 4605
 
4606
-	if ( strpos( $title, '%%sitename%%' ) !== false ) {
4607
-		$title = str_replace( "%%sitename%%", get_bloginfo( 'name' ), $title );
4606
+	if (strpos($title, '%%sitename%%') !== false) {
4607
+		$title = str_replace("%%sitename%%", get_bloginfo('name'), $title);
4608 4608
 	}
4609 4609
 
4610
-	if ( strpos( $title, '%%sitedesc%%' ) !== false ) {
4611
-		$title = str_replace( "%%sitedesc%%", get_bloginfo( 'description' ), $title );
4610
+	if (strpos($title, '%%sitedesc%%') !== false) {
4611
+		$title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title);
4612 4612
 	}
4613 4613
 
4614
-	if ( strpos( $title, '%%excerpt%%' ) !== false ) {
4615
-		$title = str_replace( "%%excerpt%%", strip_tags( get_the_excerpt() ), $title );
4614
+	if (strpos($title, '%%excerpt%%') !== false) {
4615
+		$title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title);
4616 4616
 	}
4617 4617
 
4618
-	if ( $gd_page == 'search' || $gd_page == 'author' ) {
4619
-		$post_type = isset( $_REQUEST['stype'] ) ? sanitize_text_field( $_REQUEST['stype'] ) : '';
4620
-	} else if ( $gd_page == 'add-listing' ) {
4621
-		$post_type = ( isset( $_REQUEST['listing_type'] ) ) ? sanitize_text_field( $_REQUEST['listing_type'] ) : '';
4622
-		$post_type = ! $post_type && ! empty( $_REQUEST['pid'] ) ? get_post_type( (int) $_REQUEST['pid'] ) : $post_type;
4623
-	} else if ( isset( $post->post_type ) && $post->post_type && in_array( $post->post_type, geodir_get_posttypes() ) ) {
4618
+	if ($gd_page == 'search' || $gd_page == 'author') {
4619
+		$post_type = isset($_REQUEST['stype']) ? sanitize_text_field($_REQUEST['stype']) : '';
4620
+	} else if ($gd_page == 'add-listing') {
4621
+		$post_type = (isset($_REQUEST['listing_type'])) ? sanitize_text_field($_REQUEST['listing_type']) : '';
4622
+		$post_type = !$post_type && !empty($_REQUEST['pid']) ? get_post_type((int) $_REQUEST['pid']) : $post_type;
4623
+	} else if (isset($post->post_type) && $post->post_type && in_array($post->post_type, geodir_get_posttypes())) {
4624 4624
 		$post_type = $post->post_type;
4625 4625
 	} else {
4626
-		$post_type = get_query_var( 'post_type' );
4626
+		$post_type = get_query_var('post_type');
4627 4627
 	}
4628 4628
 
4629
-	if ( strpos( $title, '%%pt_single%%' ) !== false ) {
4629
+	if (strpos($title, '%%pt_single%%') !== false) {
4630 4630
 		$singular_name = '';
4631
-		if ( $post_type && $singular_name = get_post_type_singular_label( $post_type ) ) {
4632
-			$singular_name = __( $singular_name, 'geodirectory' );
4631
+		if ($post_type && $singular_name = get_post_type_singular_label($post_type)) {
4632
+			$singular_name = __($singular_name, 'geodirectory');
4633 4633
 		}
4634 4634
 
4635
-		$title = str_replace( "%%pt_single%%", $singular_name, $title );
4635
+		$title = str_replace("%%pt_single%%", $singular_name, $title);
4636 4636
 	}
4637 4637
 
4638
-	if ( strpos( $title, '%%pt_plural%%' ) !== false ) {
4638
+	if (strpos($title, '%%pt_plural%%') !== false) {
4639 4639
 		$plural_name = '';
4640
-		if ( $post_type && $plural_name = get_post_type_plural_label( $post_type ) ) {
4641
-			$plural_name = __( $plural_name, 'geodirectory' );
4640
+		if ($post_type && $plural_name = get_post_type_plural_label($post_type)) {
4641
+			$plural_name = __($plural_name, 'geodirectory');
4642 4642
 		}
4643 4643
 
4644
-		$title = str_replace( "%%pt_plural%%", $plural_name, $title );
4644
+		$title = str_replace("%%pt_plural%%", $plural_name, $title);
4645 4645
 	}
4646 4646
 
4647
-	if ( strpos( $title, '%%category%%' ) !== false ) {
4647
+	if (strpos($title, '%%category%%') !== false) {
4648 4648
 		$cat_name = '';
4649 4649
 
4650
-		if ( $gd_page == 'detail' ) {
4651
-			if ( $post->default_category ) {
4652
-				$cat      = get_term( $post->default_category, $post->post_type . 'category' );
4653
-				$cat_name = ( isset( $cat->name ) ) ? $cat->name : '';
4650
+		if ($gd_page == 'detail') {
4651
+			if ($post->default_category) {
4652
+				$cat      = get_term($post->default_category, $post->post_type.'category');
4653
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4654 4654
 			}
4655
-		} else if ( $gd_page == 'listing' ) {
4655
+		} else if ($gd_page == 'listing') {
4656 4656
 			$queried_object = get_queried_object();
4657
-			if ( isset( $queried_object->name ) ) {
4657
+			if (isset($queried_object->name)) {
4658 4658
 				$cat_name = $queried_object->name;
4659 4659
 			}
4660 4660
 		}
4661
-		$title = str_replace( "%%category%%", $cat_name, $title );
4661
+		$title = str_replace("%%category%%", $cat_name, $title);
4662 4662
 	}
4663 4663
 
4664
-	if ( strpos( $title, '%%tag%%' ) !== false ) {
4664
+	if (strpos($title, '%%tag%%') !== false) {
4665 4665
 		$cat_name = '';
4666 4666
 
4667
-		if ( $gd_page == 'detail' ) {
4668
-			if ( $post->default_category ) {
4669
-				$cat      = get_term( $post->default_category, $post->post_type . 'category' );
4670
-				$cat_name = ( isset( $cat->name ) ) ? $cat->name : '';
4667
+		if ($gd_page == 'detail') {
4668
+			if ($post->default_category) {
4669
+				$cat      = get_term($post->default_category, $post->post_type.'category');
4670
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4671 4671
 			}
4672
-		} else if ( $gd_page == 'listing' ) {
4672
+		} else if ($gd_page == 'listing') {
4673 4673
 			$queried_object = get_queried_object();
4674
-			if ( isset( $queried_object->name ) ) {
4674
+			if (isset($queried_object->name)) {
4675 4675
 				$cat_name = $queried_object->name;
4676 4676
 			}
4677 4677
 		}
4678
-		$title = str_replace( "%%tag%%", $cat_name, $title );
4678
+		$title = str_replace("%%tag%%", $cat_name, $title);
4679 4679
 	}
4680 4680
 
4681
-	if ( strpos( $title, '%%id%%' ) !== false ) {
4682
-		$ID    = ( isset( $post->ID ) ) ? $post->ID : '';
4683
-		$title = str_replace( "%%id%%", $ID, $title );
4681
+	if (strpos($title, '%%id%%') !== false) {
4682
+		$ID    = (isset($post->ID)) ? $post->ID : '';
4683
+		$title = str_replace("%%id%%", $ID, $title);
4684 4684
 	}
4685 4685
 
4686
-	if ( strpos( $title, '%%sep%%' ) !== false ) {
4687
-		$title = str_replace( "%%sep%%", $sep, $title );
4686
+	if (strpos($title, '%%sep%%') !== false) {
4687
+		$title = str_replace("%%sep%%", $sep, $title);
4688 4688
 	}
4689 4689
 
4690 4690
 	// location variables
4691 4691
 	$gd_post_type   = geodir_get_current_posttype();
4692
-	$location_array = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
4692
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4693 4693
 	/**
4694 4694
 	 * Filter the title variables location variables array
4695 4695
 	 *
@@ -4701,166 +4701,166 @@  discard block
 block discarded – undo
4701 4701
 	 * @param string $gd_page       The page being filtered.
4702 4702
 	 * @param string $sep           The separator, default: `|`.
4703 4703
 	 */
4704
-	$location_array  = apply_filters( 'geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep );
4704
+	$location_array  = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep);
4705 4705
 	$location_titles = array();
4706
-	if ( $gd_page == 'location' && get_query_var( 'gd_country_full' ) ) {
4707
-		if ( get_query_var( 'gd_country_full' ) ) {
4708
-			$location_array['gd_country'] = get_query_var( 'gd_country_full' );
4706
+	if ($gd_page == 'location' && get_query_var('gd_country_full')) {
4707
+		if (get_query_var('gd_country_full')) {
4708
+			$location_array['gd_country'] = get_query_var('gd_country_full');
4709 4709
 		}
4710
-		if ( get_query_var( 'gd_region_full' ) ) {
4711
-			$location_array['gd_region'] = get_query_var( 'gd_region_full' );
4710
+		if (get_query_var('gd_region_full')) {
4711
+			$location_array['gd_region'] = get_query_var('gd_region_full');
4712 4712
 		}
4713
-		if ( get_query_var( 'gd_city_full' ) ) {
4714
-			$location_array['gd_city'] = get_query_var( 'gd_city_full' );
4713
+		if (get_query_var('gd_city_full')) {
4714
+			$location_array['gd_city'] = get_query_var('gd_city_full');
4715 4715
 		}
4716 4716
 	}
4717 4717
 	$location_single = '';
4718
-	$gd_country      = ( isset( $wp->query_vars['gd_country'] ) && $wp->query_vars['gd_country'] != '' ) ? $wp->query_vars['gd_country'] : '';
4719
-	$gd_region       = ( isset( $wp->query_vars['gd_region'] ) && $wp->query_vars['gd_region'] != '' ) ? $wp->query_vars['gd_region'] : '';
4720
-	$gd_city         = ( isset( $wp->query_vars['gd_city'] ) && $wp->query_vars['gd_city'] != '' ) ? $wp->query_vars['gd_city'] : '';
4718
+	$gd_country      = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4719
+	$gd_region       = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4720
+	$gd_city         = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4721 4721
 
4722 4722
 	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4723 4723
 
4724
-	if ( function_exists( 'get_actual_location_name' ) ) {
4725
-		$gd_country_actual = $gd_country != '' ? get_actual_location_name( 'country', $gd_country, true ) : $gd_country;
4726
-		$gd_region_actual  = $gd_region != '' ? get_actual_location_name( 'region', $gd_region ) : $gd_region;
4727
-		$gd_city_actual    = $gd_city != '' ? get_actual_location_name( 'city', $gd_city ) : $gd_city;
4724
+	if (function_exists('get_actual_location_name')) {
4725
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4726
+		$gd_region_actual  = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4727
+		$gd_city_actual    = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4728 4728
 	}
4729 4729
 
4730
-	if ( $gd_city != '' ) {
4731
-		if ( $gd_city_actual != '' ) {
4730
+	if ($gd_city != '') {
4731
+		if ($gd_city_actual != '') {
4732 4732
 			$gd_city = $gd_city_actual;
4733 4733
 		} else {
4734
-			$gd_city = preg_replace( '/-(\d+)$/', '', $gd_city );
4735
-			$gd_city = preg_replace( '/[_-]/', ' ', $gd_city );
4736
-			$gd_city = __( geodir_ucwords( $gd_city ), 'geodirectory' );
4734
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4735
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4736
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4737 4737
 		}
4738 4738
 		$location_single = $gd_city;
4739 4739
 
4740
-	} else if ( $gd_region != '' ) {
4741
-		if ( $gd_region_actual != '' ) {
4740
+	} else if ($gd_region != '') {
4741
+		if ($gd_region_actual != '') {
4742 4742
 			$gd_region = $gd_region_actual;
4743 4743
 		} else {
4744
-			$gd_region = preg_replace( '/-(\d+)$/', '', $gd_region );
4745
-			$gd_region = preg_replace( '/[_-]/', ' ', $gd_region );
4746
-			$gd_region = __( geodir_ucwords( $gd_region ), 'geodirectory' );
4744
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4745
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4746
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4747 4747
 		}
4748 4748
 
4749 4749
 		$location_single = $gd_region;
4750
-	} else if ( $gd_country != '' ) {
4751
-		if ( $gd_country_actual != '' ) {
4750
+	} else if ($gd_country != '') {
4751
+		if ($gd_country_actual != '') {
4752 4752
 			$gd_country = $gd_country_actual;
4753 4753
 		} else {
4754
-			$gd_country = preg_replace( '/-(\d+)$/', '', $gd_country );
4755
-			$gd_country = preg_replace( '/[_-]/', ' ', $gd_country );
4756
-			$gd_country = __( geodir_ucwords( $gd_country ), 'geodirectory' );
4754
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4755
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4756
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4757 4757
 		}
4758 4758
 
4759 4759
 		$location_single = $gd_country;
4760 4760
 	}
4761 4761
 
4762
-	if ( ! empty( $location_array ) ) {
4762
+	if (!empty($location_array)) {
4763 4763
 
4764
-		$actual_location_name = function_exists( 'get_actual_location_name' ) ? true : false;
4765
-		$location_array       = array_reverse( $location_array );
4764
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4765
+		$location_array       = array_reverse($location_array);
4766 4766
 
4767
-		foreach ( $location_array as $location_type => $location ) {
4768
-			$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location );
4769
-			$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
4767
+		foreach ($location_array as $location_type => $location) {
4768
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4769
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4770 4770
 
4771
-			$location_name = geodir_ucwords( $gd_location_link_text );
4772
-			$location_name = __( $location_name, 'geodirectory' );
4771
+			$location_name = geodir_ucwords($gd_location_link_text);
4772
+			$location_name = __($location_name, 'geodirectory');
4773 4773
 
4774
-			if ( $actual_location_name ) {
4775
-				$location_type = strpos( $location_type, 'gd_' ) === 0 ? substr( $location_type, 3 ) : $location_type;
4776
-				$location_name = get_actual_location_name( $location_type, $location, true );
4774
+			if ($actual_location_name) {
4775
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4776
+				$location_name = get_actual_location_name($location_type, $location, true);
4777 4777
 			}
4778 4778
 
4779 4779
 			$location_titles[] = $location_name;
4780 4780
 		}
4781
-		if ( ! empty( $location_titles ) ) {
4782
-			$location_titles = array_unique( $location_titles );
4781
+		if (!empty($location_titles)) {
4782
+			$location_titles = array_unique($location_titles);
4783 4783
 		}
4784 4784
 	}
4785 4785
 
4786 4786
 
4787
-	if ( strpos( $title, '%%location%%' ) !== false ) {
4787
+	if (strpos($title, '%%location%%') !== false) {
4788 4788
 		$location = '';
4789
-		if ( $location_titles ) {
4790
-			$location = implode( ", ", $location_titles );
4789
+		if ($location_titles) {
4790
+			$location = implode(", ", $location_titles);
4791 4791
 		}
4792
-		$title = str_replace( "%%location%%", $location, $title );
4792
+		$title = str_replace("%%location%%", $location, $title);
4793 4793
 	}
4794 4794
 
4795
-	if ( strpos( $title, '%%in_location%%' ) !== false ) {
4795
+	if (strpos($title, '%%in_location%%') !== false) {
4796 4796
 		$location = '';
4797
-		if ( $location_titles ) {
4798
-			$location = __( 'in ', 'geodirectory' ) . implode( ", ", $location_titles );
4797
+		if ($location_titles) {
4798
+			$location = __('in ', 'geodirectory').implode(", ", $location_titles);
4799 4799
 		}
4800
-		$title = str_replace( "%%in_location%%", $location, $title );
4800
+		$title = str_replace("%%in_location%%", $location, $title);
4801 4801
 	}
4802 4802
 
4803
-	if ( strpos( $title, '%%in_location_single%%' ) !== false ) {
4804
-		if ( $location_single ) {
4805
-			$location_single = __( 'in', 'geodirectory' ) . ' ' . $location_single;
4803
+	if (strpos($title, '%%in_location_single%%') !== false) {
4804
+		if ($location_single) {
4805
+			$location_single = __('in', 'geodirectory').' '.$location_single;
4806 4806
 		}
4807
-		$title = str_replace( "%%in_location_single%%", $location_single, $title );
4807
+		$title = str_replace("%%in_location_single%%", $location_single, $title);
4808 4808
 	}
4809 4809
 
4810
-	if ( strpos( $title, '%%location_single%%' ) !== false ) {
4811
-		$title = str_replace( "%%location_single%%", $location_single, $title );
4810
+	if (strpos($title, '%%location_single%%') !== false) {
4811
+		$title = str_replace("%%location_single%%", $location_single, $title);
4812 4812
 	}
4813 4813
 
4814 4814
 
4815
-	if ( strpos( $title, '%%search_term%%' ) !== false ) {
4815
+	if (strpos($title, '%%search_term%%') !== false) {
4816 4816
 		$search_term = '';
4817
-		if ( isset( $_REQUEST['s'] ) ) {
4818
-			$search_term = esc_attr( $_REQUEST['s'] );
4817
+		if (isset($_REQUEST['s'])) {
4818
+			$search_term = esc_attr($_REQUEST['s']);
4819 4819
 		}
4820
-		$title = str_replace( "%%search_term%%", $search_term, $title );
4820
+		$title = str_replace("%%search_term%%", $search_term, $title);
4821 4821
 	}
4822 4822
 
4823
-	if ( strpos( $title, '%%search_near%%' ) !== false ) {
4823
+	if (strpos($title, '%%search_near%%') !== false) {
4824 4824
 		$search_term = '';
4825
-		if ( isset( $_REQUEST['snear'] ) ) {
4826
-			$search_term = esc_attr( $_REQUEST['snear'] );
4825
+		if (isset($_REQUEST['snear'])) {
4826
+			$search_term = esc_attr($_REQUEST['snear']);
4827 4827
 		}
4828
-		$title = str_replace( "%%search_near%%", $search_term, $title );
4828
+		$title = str_replace("%%search_near%%", $search_term, $title);
4829 4829
 	}
4830 4830
 
4831
-	if ( strpos( $title, '%%name%%' ) !== false ) {
4832
-		if ( is_author() ) {
4833
-			$curauth     = ( get_query_var( 'author_name' ) ) ? get_user_by( 'slug', get_query_var( 'author_name' ) ) : get_userdata( get_query_var( 'author' ) );
4831
+	if (strpos($title, '%%name%%') !== false) {
4832
+		if (is_author()) {
4833
+			$curauth     = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
4834 4834
 			$author_name = $curauth->display_name;
4835 4835
 		} else {
4836 4836
 			$author_name = get_the_author();
4837 4837
 		}
4838
-		if ( ! $author_name || $author_name === '' ) {
4838
+		if (!$author_name || $author_name === '') {
4839 4839
 			$queried_object = get_queried_object();
4840 4840
 
4841
-			if ( isset( $queried_object->data->user_nicename ) ) {
4841
+			if (isset($queried_object->data->user_nicename)) {
4842 4842
 				$author_name = $queried_object->data->display_name;
4843 4843
 			}
4844 4844
 		}
4845
-		$title = str_replace( "%%name%%", $author_name, $title );
4845
+		$title = str_replace("%%name%%", $author_name, $title);
4846 4846
 	}
4847 4847
 
4848
-	if ( strpos( $title, '%%page%%' ) !== false ) {
4849
-		$page  = geodir_title_meta_page( $sep );
4850
-		$title = str_replace( "%%page%%", $page, $title );
4848
+	if (strpos($title, '%%page%%') !== false) {
4849
+		$page  = geodir_title_meta_page($sep);
4850
+		$title = str_replace("%%page%%", $page, $title);
4851 4851
 	}
4852
-	if ( strpos( $title, '%%pagenumber%%' ) !== false ) {
4852
+	if (strpos($title, '%%pagenumber%%') !== false) {
4853 4853
 		$pagenumber = geodir_title_meta_pagenumber();
4854
-		$title      = str_replace( "%%pagenumber%%", $pagenumber, $title );
4854
+		$title      = str_replace("%%pagenumber%%", $pagenumber, $title);
4855 4855
 	}
4856
-	if ( strpos( $title, '%%pagetotal%%' ) !== false ) {
4856
+	if (strpos($title, '%%pagetotal%%') !== false) {
4857 4857
 		$pagetotal = geodir_title_meta_pagetotal();
4858
-		$title     = str_replace( "%%pagetotal%%", $pagetotal, $title );
4858
+		$title     = str_replace("%%pagetotal%%", $pagetotal, $title);
4859 4859
 	}
4860 4860
 
4861
-	$title = wptexturize( $title );
4862
-	$title = convert_chars( $title );
4863
-	$title = esc_html( $title );
4861
+	$title = wptexturize($title);
4862
+	$title = convert_chars($title);
4863
+	$title = esc_html($title);
4864 4864
 
4865 4865
 	/**
4866 4866
 	 * Filter the title variables after standard ones have been filtered.
@@ -4874,7 +4874,7 @@  discard block
 block discarded – undo
4874 4874
 	 * @param string $sep           The separator, default: `|`.
4875 4875
 	 */
4876 4876
 
4877
-	return apply_filters( 'geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep );
4877
+	return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep);
4878 4878
 }
4879 4879
 
4880 4880
 /**
@@ -4887,82 +4887,82 @@  discard block
 block discarded – undo
4887 4887
  *
4888 4888
  * @return array Translation texts.
4889 4889
  */
4890
-function geodir_load_cpt_text_translation( $translation_texts = array() ) {
4891
-	$gd_post_types = geodir_get_posttypes( 'array' );
4890
+function geodir_load_cpt_text_translation($translation_texts = array()) {
4891
+	$gd_post_types = geodir_get_posttypes('array');
4892 4892
 
4893
-	if ( ! empty( $gd_post_types ) ) {
4894
-		foreach ( $gd_post_types as $post_type => $cpt_info ) {
4895
-			$labels      = isset( $cpt_info['labels'] ) ? $cpt_info['labels'] : '';
4896
-			$description = isset( $cpt_info['description'] ) ? $cpt_info['description'] : '';
4897
-			$seo         = isset( $cpt_info['seo'] ) ? $cpt_info['seo'] : '';
4893
+	if (!empty($gd_post_types)) {
4894
+		foreach ($gd_post_types as $post_type => $cpt_info) {
4895
+			$labels      = isset($cpt_info['labels']) ? $cpt_info['labels'] : '';
4896
+			$description = isset($cpt_info['description']) ? $cpt_info['description'] : '';
4897
+			$seo         = isset($cpt_info['seo']) ? $cpt_info['seo'] : '';
4898 4898
 
4899
-			if ( ! empty( $labels ) ) {
4900
-				if ( $labels['name'] != '' && ! in_array( $labels['name'], $translation_texts ) ) {
4899
+			if (!empty($labels)) {
4900
+				if ($labels['name'] != '' && !in_array($labels['name'], $translation_texts)) {
4901 4901
 					$translation_texts[] = $labels['name'];
4902 4902
 				}
4903
-				if ( $labels['singular_name'] != '' && ! in_array( $labels['singular_name'], $translation_texts ) ) {
4903
+				if ($labels['singular_name'] != '' && !in_array($labels['singular_name'], $translation_texts)) {
4904 4904
 					$translation_texts[] = $labels['singular_name'];
4905 4905
 				}
4906
-				if ( $labels['add_new'] != '' && ! in_array( $labels['add_new'], $translation_texts ) ) {
4906
+				if ($labels['add_new'] != '' && !in_array($labels['add_new'], $translation_texts)) {
4907 4907
 					$translation_texts[] = $labels['add_new'];
4908 4908
 				}
4909
-				if ( $labels['add_new_item'] != '' && ! in_array( $labels['add_new_item'], $translation_texts ) ) {
4909
+				if ($labels['add_new_item'] != '' && !in_array($labels['add_new_item'], $translation_texts)) {
4910 4910
 					$translation_texts[] = $labels['add_new_item'];
4911 4911
 				}
4912
-				if ( $labels['edit_item'] != '' && ! in_array( $labels['edit_item'], $translation_texts ) ) {
4912
+				if ($labels['edit_item'] != '' && !in_array($labels['edit_item'], $translation_texts)) {
4913 4913
 					$translation_texts[] = $labels['edit_item'];
4914 4914
 				}
4915
-				if ( $labels['new_item'] != '' && ! in_array( $labels['new_item'], $translation_texts ) ) {
4915
+				if ($labels['new_item'] != '' && !in_array($labels['new_item'], $translation_texts)) {
4916 4916
 					$translation_texts[] = $labels['new_item'];
4917 4917
 				}
4918
-				if ( $labels['view_item'] != '' && ! in_array( $labels['view_item'], $translation_texts ) ) {
4918
+				if ($labels['view_item'] != '' && !in_array($labels['view_item'], $translation_texts)) {
4919 4919
 					$translation_texts[] = $labels['view_item'];
4920 4920
 				}
4921
-				if ( $labels['search_items'] != '' && ! in_array( $labels['search_items'], $translation_texts ) ) {
4921
+				if ($labels['search_items'] != '' && !in_array($labels['search_items'], $translation_texts)) {
4922 4922
 					$translation_texts[] = $labels['search_items'];
4923 4923
 				}
4924
-				if ( $labels['not_found'] != '' && ! in_array( $labels['not_found'], $translation_texts ) ) {
4924
+				if ($labels['not_found'] != '' && !in_array($labels['not_found'], $translation_texts)) {
4925 4925
 					$translation_texts[] = $labels['not_found'];
4926 4926
 				}
4927
-				if ( $labels['not_found_in_trash'] != '' && ! in_array( $labels['not_found_in_trash'], $translation_texts ) ) {
4927
+				if ($labels['not_found_in_trash'] != '' && !in_array($labels['not_found_in_trash'], $translation_texts)) {
4928 4928
 					$translation_texts[] = $labels['not_found_in_trash'];
4929 4929
 				}
4930
-				if ( isset( $labels['label_post_profile'] ) && $labels['label_post_profile'] != '' && ! in_array( $labels['label_post_profile'], $translation_texts ) ) {
4930
+				if (isset($labels['label_post_profile']) && $labels['label_post_profile'] != '' && !in_array($labels['label_post_profile'], $translation_texts)) {
4931 4931
 					$translation_texts[] = $labels['label_post_profile'];
4932 4932
 				}
4933
-				if ( isset( $labels['label_post_info'] ) && $labels['label_post_info'] != '' && ! in_array( $labels['label_post_info'], $translation_texts ) ) {
4933
+				if (isset($labels['label_post_info']) && $labels['label_post_info'] != '' && !in_array($labels['label_post_info'], $translation_texts)) {
4934 4934
 					$translation_texts[] = $labels['label_post_info'];
4935 4935
 				}
4936
-				if ( isset( $labels['label_post_images'] ) && $labels['label_post_images'] != '' && ! in_array( $labels['label_post_images'], $translation_texts ) ) {
4936
+				if (isset($labels['label_post_images']) && $labels['label_post_images'] != '' && !in_array($labels['label_post_images'], $translation_texts)) {
4937 4937
 					$translation_texts[] = $labels['label_post_images'];
4938 4938
 				}
4939
-				if ( isset( $labels['label_post_map'] ) && $labels['label_post_map'] != '' && ! in_array( $labels['label_post_map'], $translation_texts ) ) {
4939
+				if (isset($labels['label_post_map']) && $labels['label_post_map'] != '' && !in_array($labels['label_post_map'], $translation_texts)) {
4940 4940
 					$translation_texts[] = $labels['label_post_map'];
4941 4941
 				}
4942
-				if ( isset( $labels['label_reviews'] ) && $labels['label_reviews'] != '' && ! in_array( $labels['label_reviews'], $translation_texts ) ) {
4942
+				if (isset($labels['label_reviews']) && $labels['label_reviews'] != '' && !in_array($labels['label_reviews'], $translation_texts)) {
4943 4943
 					$translation_texts[] = $labels['label_reviews'];
4944 4944
 				}
4945
-				if ( isset( $labels['label_related_listing'] ) && $labels['label_related_listing'] != '' && ! in_array( $labels['label_related_listing'], $translation_texts ) ) {
4945
+				if (isset($labels['label_related_listing']) && $labels['label_related_listing'] != '' && !in_array($labels['label_related_listing'], $translation_texts)) {
4946 4946
 					$translation_texts[] = $labels['label_related_listing'];
4947 4947
 				}
4948 4948
 			}
4949 4949
 
4950
-			if ( $description != '' && ! in_array( $description, $translation_texts ) ) {
4951
-				$translation_texts[] = normalize_whitespace( $description );
4950
+			if ($description != '' && !in_array($description, $translation_texts)) {
4951
+				$translation_texts[] = normalize_whitespace($description);
4952 4952
 			}
4953 4953
 
4954
-			if ( ! empty( $seo ) ) {
4955
-				if ( isset( $seo['meta_keyword'] ) && $seo['meta_keyword'] != '' && ! in_array( $seo['meta_keyword'], $translation_texts ) ) {
4956
-					$translation_texts[] = normalize_whitespace( $seo['meta_keyword'] );
4954
+			if (!empty($seo)) {
4955
+				if (isset($seo['meta_keyword']) && $seo['meta_keyword'] != '' && !in_array($seo['meta_keyword'], $translation_texts)) {
4956
+					$translation_texts[] = normalize_whitespace($seo['meta_keyword']);
4957 4957
 				}
4958 4958
 
4959
-				if ( isset( $seo['meta_description'] ) && $seo['meta_description'] != '' && ! in_array( $seo['meta_description'], $translation_texts ) ) {
4960
-					$translation_texts[] = normalize_whitespace( $seo['meta_description'] );
4959
+				if (isset($seo['meta_description']) && $seo['meta_description'] != '' && !in_array($seo['meta_description'], $translation_texts)) {
4960
+					$translation_texts[] = normalize_whitespace($seo['meta_description']);
4961 4961
 				}
4962 4962
 			}
4963 4963
 		}
4964 4964
 	}
4965
-	$translation_texts = ! empty( $translation_texts ) ? array_unique( $translation_texts ) : $translation_texts;
4965
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
4966 4966
 
4967 4967
 	return $translation_texts;
4968 4968
 }
@@ -4977,27 +4977,27 @@  discard block
 block discarded – undo
4977 4977
  *
4978 4978
  * @return array Location terms.
4979 4979
  */
4980
-function geodir_remove_location_terms( $location_terms = array() ) {
4981
-	$location_manager = defined( 'POST_LOCATION_TABLE' ) ? true : false;
4980
+function geodir_remove_location_terms($location_terms = array()) {
4981
+	$location_manager = defined('POST_LOCATION_TABLE') ? true : false;
4982 4982
 
4983
-	if ( ! empty( $location_terms ) && $location_manager ) {
4984
-		$hide_country_part = get_option( 'geodir_location_hide_country_part' );
4985
-		$hide_region_part  = get_option( 'geodir_location_hide_region_part' );
4983
+	if (!empty($location_terms) && $location_manager) {
4984
+		$hide_country_part = get_option('geodir_location_hide_country_part');
4985
+		$hide_region_part  = get_option('geodir_location_hide_region_part');
4986 4986
 
4987
-		if ( $hide_region_part && $hide_country_part ) {
4988
-			if ( isset( $location_terms['gd_country'] ) ) {
4989
-				unset( $location_terms['gd_country'] );
4987
+		if ($hide_region_part && $hide_country_part) {
4988
+			if (isset($location_terms['gd_country'])) {
4989
+				unset($location_terms['gd_country']);
4990 4990
 			}
4991
-			if ( isset( $location_terms['gd_region'] ) ) {
4992
-				unset( $location_terms['gd_region'] );
4991
+			if (isset($location_terms['gd_region'])) {
4992
+				unset($location_terms['gd_region']);
4993 4993
 			}
4994
-		} else if ( $hide_region_part && ! $hide_country_part ) {
4995
-			if ( isset( $location_terms['gd_region'] ) ) {
4996
-				unset( $location_terms['gd_region'] );
4994
+		} else if ($hide_region_part && !$hide_country_part) {
4995
+			if (isset($location_terms['gd_region'])) {
4996
+				unset($location_terms['gd_region']);
4997 4997
 			}
4998
-		} else if ( ! $hide_region_part && $hide_country_part ) {
4999
-			if ( isset( $location_terms['gd_country'] ) ) {
5000
-				unset( $location_terms['gd_country'] );
4998
+		} else if (!$hide_region_part && $hide_country_part) {
4999
+			if (isset($location_terms['gd_country'])) {
5000
+				unset($location_terms['gd_country']);
5001 5001
 			}
5002 5002
 		}
5003 5003
 	}
@@ -5015,33 +5015,33 @@  discard block
 block discarded – undo
5015 5015
  * @param WP_Post $post Post object.
5016 5016
  * @param bool $update  Whether this is an existing listing being updated or not.
5017 5017
  */
5018
-function geodir_on_wp_insert_post( $post_ID, $post, $update ) {
5019
-	if ( ! $update ) {
5018
+function geodir_on_wp_insert_post($post_ID, $post, $update) {
5019
+	if (!$update) {
5020 5020
 		return;
5021 5021
 	}
5022 5022
 
5023
-	$action      = isset( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
5024
-	$is_admin    = is_admin() && ( ! defined( 'DOING_AJAX' ) || ( defined( 'DOING_AJAX' ) && ! DOING_AJAX ) ) ? true : false;
5023
+	$action      = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : '';
5024
+	$is_admin    = is_admin() && (!defined('DOING_AJAX') || (defined('DOING_AJAX') && !DOING_AJAX)) ? true : false;
5025 5025
 	$inline_save = $action == 'inline-save' ? true : false;
5026 5026
 
5027
-	if ( empty( $post->post_type ) || $is_admin || $inline_save || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) {
5027
+	if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {
5028 5028
 		return;
5029 5029
 	}
5030 5030
 
5031
-	if ( $action != '' && in_array( $action, array( 'geodir_import_export' ) ) ) {
5031
+	if ($action != '' && in_array($action, array('geodir_import_export'))) {
5032 5032
 		return;
5033 5033
 	}
5034 5034
 
5035 5035
 	$user_id = (int) get_current_user_id();
5036 5036
 
5037
-	if ( $user_id > 0 && get_option( 'geodir_notify_post_edited' ) && ! wp_is_post_revision( $post_ID ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
5038
-		$author_id = ! empty( $post->post_author ) ? $post->post_author : 0;
5037
+	if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) {
5038
+		$author_id = !empty($post->post_author) ? $post->post_author : 0;
5039 5039
 
5040
-		if ( $user_id == $author_id && ! is_super_admin() ) {
5041
-			$from_email   = get_option( 'site_email' );
5040
+		if ($user_id == $author_id && !is_super_admin()) {
5041
+			$from_email   = get_option('site_email');
5042 5042
 			$from_name    = get_site_emailName();
5043
-			$to_email     = get_option( 'admin_email' );
5044
-			$to_name      = get_option( 'name' );
5043
+			$to_email     = get_option('admin_email');
5044
+			$to_name      = get_option('name');
5045 5045
 			$message_type = 'listing_edited';
5046 5046
 
5047 5047
 			$notify_edited = true;
@@ -5053,9 +5053,9 @@  discard block
 block discarded – undo
5053 5053
 			 * @param bool $notify_edited Notify on listing edited by author?
5054 5054
 			 * @param object $post        The current post object.
5055 5055
 			 */
5056
-			$notify_edited = apply_filters( 'geodir_notify_on_listing_edited', $notify_edited, $post );
5056
+			$notify_edited = apply_filters('geodir_notify_on_listing_edited', $notify_edited, $post);
5057 5057
 
5058
-			geodir_sendEmail( $from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID );
5058
+			geodir_sendEmail($from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID);
5059 5059
 		}
5060 5060
 	}
5061 5061
 }
@@ -5070,14 +5070,14 @@  discard block
 block discarded – undo
5070 5070
  *
5071 5071
  * @return string|null The current page start & end numbering.
5072 5072
  */
5073
-function geodir_title_meta_page( $sep ) {
5073
+function geodir_title_meta_page($sep) {
5074 5074
 	$replacement = null;
5075 5075
 
5076
-	$max = geodir_title_meta_pagenumbering( 'max' );
5077
-	$nr  = geodir_title_meta_pagenumbering( 'nr' );
5076
+	$max = geodir_title_meta_pagenumbering('max');
5077
+	$nr  = geodir_title_meta_pagenumbering('nr');
5078 5078
 
5079
-	if ( $max > 1 && $nr > 1 ) {
5080
-		$replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'geodirectory' ), $nr, $max );
5079
+	if ($max > 1 && $nr > 1) {
5080
+		$replacement = sprintf($sep.' '.__('Page %1$d of %2$d', 'geodirectory'), $nr, $max);
5081 5081
 	}
5082 5082
 
5083 5083
 	return $replacement;
@@ -5094,8 +5094,8 @@  discard block
 block discarded – undo
5094 5094
 function geodir_title_meta_pagenumber() {
5095 5095
 	$replacement = null;
5096 5096
 
5097
-	$nr = geodir_title_meta_pagenumbering( 'nr' );
5098
-	if ( isset( $nr ) && $nr > 0 ) {
5097
+	$nr = geodir_title_meta_pagenumbering('nr');
5098
+	if (isset($nr) && $nr > 0) {
5099 5099
 		$replacement = (string) $nr;
5100 5100
 	}
5101 5101
 
@@ -5113,8 +5113,8 @@  discard block
 block discarded – undo
5113 5113
 function geodir_title_meta_pagetotal() {
5114 5114
 	$replacement = null;
5115 5115
 
5116
-	$max = geodir_title_meta_pagenumbering( 'max' );
5117
-	if ( isset( $max ) && $max > 0 ) {
5116
+	$max = geodir_title_meta_pagenumbering('max');
5117
+	if (isset($max) && $max > 0) {
5118 5118
 		$replacement = (string) $max;
5119 5119
 	}
5120 5120
 
@@ -5134,36 +5134,36 @@  discard block
 block discarded – undo
5134 5134
  *
5135 5135
  * @return int|null The current page numbering.
5136 5136
  */
5137
-function geodir_title_meta_pagenumbering( $request = 'nr' ) {
5137
+function geodir_title_meta_pagenumbering($request = 'nr') {
5138 5138
 	global $wp_query, $post;
5139 5139
 	$max_num_pages = null;
5140 5140
 	$page_number   = null;
5141 5141
 
5142 5142
 	$max_num_pages = 1;
5143 5143
 
5144
-	if ( ! is_singular() ) {
5145
-		$page_number = get_query_var( 'paged' );
5146
-		if ( $page_number === 0 || $page_number === '' ) {
5144
+	if (!is_singular()) {
5145
+		$page_number = get_query_var('paged');
5146
+		if ($page_number === 0 || $page_number === '') {
5147 5147
 			$page_number = 1;
5148 5148
 		}
5149 5149
 
5150
-		if ( isset( $wp_query->max_num_pages ) && ( $wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0 ) ) {
5150
+		if (isset($wp_query->max_num_pages) && ($wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0)) {
5151 5151
 			$max_num_pages = $wp_query->max_num_pages;
5152 5152
 		}
5153 5153
 	} else {
5154
-		$page_number = get_query_var( 'page' );
5155
-		if ( $page_number === 0 || $page_number === '' ) {
5154
+		$page_number = get_query_var('page');
5155
+		if ($page_number === 0 || $page_number === '') {
5156 5156
 			$page_number = 1;
5157 5157
 		}
5158 5158
 
5159
-		if ( isset( $post->post_content ) ) {
5160
-			$max_num_pages = ( substr_count( $post->post_content, '<!--nextpage-->' ) + 1 );
5159
+		if (isset($post->post_content)) {
5160
+			$max_num_pages = (substr_count($post->post_content, '<!--nextpage-->') + 1);
5161 5161
 		}
5162 5162
 	}
5163 5163
 
5164 5164
 	$return = null;
5165 5165
 
5166
-	switch ( $request ) {
5166
+	switch ($request) {
5167 5167
 		case 'nr':
5168 5168
 			$return = $page_number;
5169 5169
 			break;
@@ -5184,14 +5184,14 @@  discard block
 block discarded – undo
5184 5184
  *
5185 5185
  * @return array Terms.
5186 5186
  */
5187
-function geodir_filter_empty_terms( $terms ) {
5188
-	if ( empty( $terms ) ) {
5187
+function geodir_filter_empty_terms($terms) {
5188
+	if (empty($terms)) {
5189 5189
 		return $terms;
5190 5190
 	}
5191 5191
 
5192 5192
 	$return = array();
5193
-	foreach ( $terms as $term ) {
5194
-		if ( isset( $term->count ) && $term->count > 0 ) {
5193
+	foreach ($terms as $term) {
5194
+		if (isset($term->count) && $term->count > 0) {
5195 5195
 			$return[] = $term;
5196 5196
 		} else {
5197 5197
 			/**
@@ -5202,7 +5202,7 @@  discard block
 block discarded – undo
5202 5202
 			 * @param array $return The array of terms to return.
5203 5203
 			 * @param object $term  The term object.
5204 5204
 			 */
5205
-			$return = apply_filters( 'geodir_filter_empty_terms_filter', $return, $term );
5205
+			$return = apply_filters('geodir_filter_empty_terms_filter', $return, $term);
5206 5206
 		}
5207 5207
 	}
5208 5208
 
@@ -5219,12 +5219,12 @@  discard block
 block discarded – undo
5219 5219
  *
5220 5220
  * @return array
5221 5221
  */
5222
-function geodir_remove_hentry( $class ) {
5223
-	if ( geodir_is_page( 'detail' ) ) {
5224
-		$class = array_diff( $class, array( 'hentry' ) );
5222
+function geodir_remove_hentry($class) {
5223
+	if (geodir_is_page('detail')) {
5224
+		$class = array_diff($class, array('hentry'));
5225 5225
 	}
5226 5226
 
5227 5227
 	return $class;
5228 5228
 }
5229 5229
 
5230
-add_filter( 'post_class', 'geodir_remove_hentry' );
5231 5230
\ No newline at end of file
5231
+add_filter('post_class', 'geodir_remove_hentry');
5232 5232
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory_template_actions.php 2 patches
Indentation   +1771 added lines, -1771 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,106 +275,106 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
279
-    if (empty($tc)) {
280
-        return;
281
-    }
278
+	$tc = get_option('theme_compatibility_setting');
279
+	if (empty($tc)) {
280
+		return;
281
+	}
282 282
 
283
-    //php
284
-    if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
-    }
283
+	//php
284
+	if (!empty($tc['geodir_theme_compat_code'])) {
285
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+	}
287 287
 
288
-    //geodir_full_page_class
289
-    if (!empty($tc['geodir_full_page_class_filter'])) {
290
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
-    }
288
+	//geodir_full_page_class
289
+	if (!empty($tc['geodir_full_page_class_filter'])) {
290
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
+	}
292 292
 
293
-    //widget before filter
294
-    if (!empty($tc['geodir_before_widget_filter'])) {
295
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
-    }
293
+	//widget before filter
294
+	if (!empty($tc['geodir_before_widget_filter'])) {
295
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
+	}
297 297
 
298
-    //widget after filter
299
-    if (!empty($tc['geodir_after_widget_filter'])) {
300
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
-    }
298
+	//widget after filter
299
+	if (!empty($tc['geodir_after_widget_filter'])) {
300
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
+	}
302 302
 
303
-    //widget before title filter
304
-    if (!empty($tc['geodir_before_title_filter'])) {
305
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
-    }
303
+	//widget before title filter
304
+	if (!empty($tc['geodir_before_title_filter'])) {
305
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
+	}
307 307
 
308
-    //widget before title filter
309
-    if (!empty($tc['geodir_after_title_filter'])) {
310
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
-    }
308
+	//widget before title filter
309
+	if (!empty($tc['geodir_after_title_filter'])) {
310
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
+	}
312 312
 
313
-    //menu li class
314
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
315
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
-    }
313
+	//menu li class
314
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
315
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
+	}
317 317
 
318
-    //menu ul class
319
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
-    }
318
+	//menu ul class
319
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
+	}
322 322
 
323
-    //menu sub li class
324
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
-    }
323
+	//menu sub li class
324
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
+	}
327 327
 
328
-    //menu a class
329
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
330
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
-    }
328
+	//menu a class
329
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
330
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
+	}
332 332
 
333
-    //menu sub a class
334
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
-    }
333
+	//menu sub a class
334
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
+	}
337 337
 
338
-    //location menu li class
339
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
-    }
338
+	//location menu li class
339
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
+	}
342 342
 
343
-    //location menu sub ul class
344
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
-    }
343
+	//location menu sub ul class
344
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
+	}
347 347
 
348
-    //location menu sub li class
349
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
-    }
348
+	//location menu sub li class
349
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
+	}
352 352
 
353
-    //location menu a class
354
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
-    }
353
+	//location menu a class
354
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
+	}
357 357
 
358
-    // compat styles
359
-    if (!empty($tc['geodir_theme_compat_css'])) {
360
-        add_action('wp_head', 'gd_compat_styles');
361
-    }
358
+	// compat styles
359
+	if (!empty($tc['geodir_theme_compat_css'])) {
360
+		add_action('wp_head', 'gd_compat_styles');
361
+	}
362 362
 
363
-    // compat js
364
-    if (!empty($tc['geodir_theme_compat_js'])) {
365
-        add_action('wp_footer', 'gd_compat_script');
366
-    }
363
+	// compat js
364
+	if (!empty($tc['geodir_theme_compat_js'])) {
365
+		add_action('wp_footer', 'gd_compat_script');
366
+	}
367 367
 
368 368
 
369
-    // geodir_top_content_add
370
-    if (!empty($tc['geodir_top_content_add'])) {
371
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
-    }
369
+	// geodir_top_content_add
370
+	if (!empty($tc['geodir_top_content_add'])) {
371
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
+	}
373 373
 
374
-    // geodir_before_main_content_add
375
-    if (!empty($tc['geodir_before_main_content_add'])) {
376
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
-    }
374
+	// geodir_before_main_content_add
375
+	if (!empty($tc['geodir_before_main_content_add'])) {
376
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
+	}
378 378
 
379 379
 
380 380
 }
@@ -397,23 +397,23 @@  discard block
 block discarded – undo
397 397
  */
398 398
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
399 399
 {
400
-    $tc = get_option('theme_compatibility_setting');
401
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
402
-        $text = $tc['geodir_wrapper_open_replace'];
403
-    } else {
404
-        $text = '<div id="[id]" class="[class]">';
405
-    }
400
+	$tc = get_option('theme_compatibility_setting');
401
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
402
+		$text = $tc['geodir_wrapper_open_replace'];
403
+	} else {
404
+		$text = '<div id="[id]" class="[class]">';
405
+	}
406 406
 
407
-    if (!empty($tc['geodir_wrapper_open_id'])) {
408
-        $id = $tc['geodir_wrapper_open_id'];
409
-    }
410
-    if (!empty($tc['geodir_wrapper_open_class'])) {
411
-        $class = $tc['geodir_wrapper_open_class'];
412
-    }
407
+	if (!empty($tc['geodir_wrapper_open_id'])) {
408
+		$id = $tc['geodir_wrapper_open_id'];
409
+	}
410
+	if (!empty($tc['geodir_wrapper_open_class'])) {
411
+		$class = $tc['geodir_wrapper_open_class'];
412
+	}
413 413
 
414
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
414
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415 415
 
416
-    echo $text;
416
+	echo $text;
417 417
 }
418 418
 
419 419
 // action for adding the wrapperdiv closing tag
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
  */
429 429
 function geodir_action_wrapper_close($type = '')
430 430
 {
431
-    $tc = get_option('theme_compatibility_setting');
432
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
433
-        $text = $tc['geodir_wrapper_close_replace'];
434
-    } else {
435
-        $text = '</div><!-- wrapper ends here-->';
436
-    }
431
+	$tc = get_option('theme_compatibility_setting');
432
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
433
+		$text = $tc['geodir_wrapper_close_replace'];
434
+	} else {
435
+		$text = '</div><!-- wrapper ends here-->';
436
+	}
437 437
 
438
-    echo $text;
438
+	echo $text;
439 439
 }
440 440
 
441 441
 // action for adding the content div opening tag
@@ -451,35 +451,35 @@  discard block
 block discarded – undo
451 451
  */
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
456
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
458
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
460
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
462
-    } else {
463
-        $width_css = '';
464
-    }
465
-
466
-    $tc = get_option('theme_compatibility_setting');
467
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
-        $text = $tc['geodir_wrapper_content_open_replace'];
469
-    } else {
470
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
-    }
472
-
473
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
-        $id = $tc['geodir_wrapper_content_open_id'];
475
-    }
476
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
-        $class = $tc['geodir_wrapper_content_open_class'];
478
-    }
479
-
480
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
-
482
-    echo $text;
454
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
+		$width_css = 'style="width:' . $width . '%;"';
456
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
+		$width_css = 'style="width:' . $width . '%;"';
458
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
+		$width_css = 'style="width:' . $width . '%;"';
460
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
+		$width_css = 'style="width:' . $width . '%;"';
462
+	} else {
463
+		$width_css = '';
464
+	}
465
+
466
+	$tc = get_option('theme_compatibility_setting');
467
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
+		$text = $tc['geodir_wrapper_content_open_replace'];
469
+	} else {
470
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
+	}
472
+
473
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
+		$id = $tc['geodir_wrapper_content_open_id'];
475
+	}
476
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
+		$class = $tc['geodir_wrapper_content_open_class'];
478
+	}
479
+
480
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
+
482
+	echo $text;
483 483
 }
484 484
 
485 485
 // action for adding the primary div closing tag
@@ -493,13 +493,13 @@  discard block
 block discarded – undo
493 493
  */
494 494
 function geodir_action_wrapper_content_close($type = '')
495 495
 {
496
-    $tc = get_option('theme_compatibility_setting');
497
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
-        $text = $tc['geodir_wrapper_content_close_replace'];
499
-    } else {
500
-        $text = '</div><!-- content ends here-->';
501
-    }
502
-    echo $text;
496
+	$tc = get_option('theme_compatibility_setting');
497
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
+		$text = $tc['geodir_wrapper_content_close_replace'];
499
+	} else {
500
+		$text = '</div><!-- content ends here-->';
501
+	}
502
+	echo $text;
503 503
 }
504 504
 
505 505
 // action for adding the <article> opening tag
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
  */
518 518
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
519 519
 {
520
-    $class = implode(" ", $class);
521
-    $tc = get_option('theme_compatibility_setting');
522
-    if (!empty($tc['geodir_article_open_replace'])) {
523
-        $text = $tc['geodir_article_open_replace'];
524
-    } else {
525
-        $text = '<article  id="[id]" class="[class]" >';
526
-    }
520
+	$class = implode(" ", $class);
521
+	$tc = get_option('theme_compatibility_setting');
522
+	if (!empty($tc['geodir_article_open_replace'])) {
523
+		$text = $tc['geodir_article_open_replace'];
524
+	} else {
525
+		$text = '<article  id="[id]" class="[class]" >';
526
+	}
527 527
 
528
-    if (!empty($tc['geodir_article_open_id'])) {
529
-        $id = $tc['geodir_article_open_id'];
530
-    }
531
-    if (!empty($tc['geodir_article_open_class'])) {
532
-        $class = $tc['geodir_article_open_class'];
533
-    }
528
+	if (!empty($tc['geodir_article_open_id'])) {
529
+		$id = $tc['geodir_article_open_id'];
530
+	}
531
+	if (!empty($tc['geodir_article_open_class'])) {
532
+		$class = $tc['geodir_article_open_class'];
533
+	}
534 534
 
535
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
535
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536 536
 
537
-    echo $text;
537
+	echo $text;
538 538
 }
539 539
 
540 540
 // action for adding the primary div closing tag
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
  */
549 549
 function geodir_action_article_close($type = '')
550 550
 {
551
-    $tc = get_option('theme_compatibility_setting');
552
-    if (!empty($tc['geodir_article_close_replace'])) {
553
-        $text = $tc['geodir_article_close_replace'];
554
-    } else {
555
-        $text = '</article><!-- article ends here-->';
556
-    }
557
-    echo $text;
551
+	$tc = get_option('theme_compatibility_setting');
552
+	if (!empty($tc['geodir_article_close_replace'])) {
553
+		$text = $tc['geodir_article_close_replace'];
554
+	} else {
555
+		$text = '</article><!-- article ends here-->';
556
+	}
557
+	echo $text;
558 558
 }
559 559
 
560 560
 // action for adding the sidebar opening tag
@@ -571,35 +571,35 @@  discard block
 block discarded – undo
571 571
  */
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
576
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
578
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
580
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
582
-    } else {
583
-        $width_css = '';
584
-    }
585
-
586
-    $tc = get_option('theme_compatibility_setting');
587
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
-        $text = $tc['geodir_sidebar_right_open_replace'];
589
-    } else {
590
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
-    }
592
-
593
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
-        $id = $tc['geodir_sidebar_right_open_id'];
595
-    }
596
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
-        $class = $tc['geodir_sidebar_right_open_class'];
598
-    }
599
-
600
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
-
602
-    echo $text;
574
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
+		$width_css = 'style="width:' . $width . '%;"';
576
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
+		$width_css = 'style="width:' . $width . '%;"';
578
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
+		$width_css = 'style="width:' . $width . '%;"';
580
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
+		$width_css = 'style="width:' . $width . '%;"';
582
+	} else {
583
+		$width_css = '';
584
+	}
585
+
586
+	$tc = get_option('theme_compatibility_setting');
587
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
+		$text = $tc['geodir_sidebar_right_open_replace'];
589
+	} else {
590
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
+	}
592
+
593
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
+		$id = $tc['geodir_sidebar_right_open_id'];
595
+	}
596
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
+		$class = $tc['geodir_sidebar_right_open_class'];
598
+	}
599
+
600
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
+
602
+	echo $text;
603 603
 }
604 604
 
605 605
 // action for adding the primary div closing tag
@@ -613,13 +613,13 @@  discard block
 block discarded – undo
613 613
  */
614 614
 function geodir_action_sidebar_right_close($type = '')
615 615
 {
616
-    $tc = get_option('theme_compatibility_setting');
617
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
-        $text = $tc['geodir_sidebar_right_close_replace'];
619
-    } else {
620
-        $text = '</aside><!-- sidebar ends here-->';
621
-    }
622
-    echo $text;
616
+	$tc = get_option('theme_compatibility_setting');
617
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
+		$text = $tc['geodir_sidebar_right_close_replace'];
619
+	} else {
620
+		$text = '</aside><!-- sidebar ends here-->';
621
+	}
622
+	echo $text;
623 623
 }
624 624
 
625 625
 
@@ -640,121 +640,121 @@  discard block
 block discarded – undo
640 640
  */
641 641
 function geodir_action_geodir_set_preview_post()
642 642
 {
643
-    global $post, $preview, $gd_session;
644
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
-    if (!$preview || $is_backend_preview) {
646
-        return;
647
-    }// bail if not previewing
648
-
649
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
-
651
-    $fields_info = geodir_get_custom_fields_type($listing_type);
652
-
653
-    foreach ($_REQUEST as $pkey => $pval) {
654
-        if ($pkey == 'geodir_video') {
655
-            $tags = '<iframe>';
656
-        } else if ($pkey == 'post_desc') {
657
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
-        } else if (is_array($_REQUEST[$pkey])) {
661
-            $tags = 'skip_field';
662
-        } else {
663
-            $tags = '';
664
-        }
665
-        /**
666
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
-         *
668
-         * @since 1.0.0
669
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
-         */
672
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
-
674
-        if ($tags != 'skip_field') {
675
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
-        }
677
-    }
678
-
679
-    $post = (object)$_REQUEST;
680
-
681
-
682
-    if (isset($post->video)) {
683
-        $post->video = stripslashes($post->video);
684
-    }
685
-
686
-    if (isset($post->Video2)) {
687
-        $post->Video2 = stripslashes($post->Video2);
688
-    }
689
-
690
-    $post_type = $post->listing_type;
691
-    $post_type_info = get_post_type_object($post_type);
692
-
693
-    $listing_label = $post_type_info->labels->singular_name;
694
-
695
-    $term_icon = '';
696
-
697
-    if (!empty($post->post_category)) {
698
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
699
-
700
-            if ($post_term != '' && !is_array($post_term)) {
701
-                $post_term = explode(',', trim($post_term, ','));
702
-            }
643
+	global $post, $preview, $gd_session;
644
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
+	if (!$preview || $is_backend_preview) {
646
+		return;
647
+	}// bail if not previewing
648
+
649
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
+
651
+	$fields_info = geodir_get_custom_fields_type($listing_type);
652
+
653
+	foreach ($_REQUEST as $pkey => $pval) {
654
+		if ($pkey == 'geodir_video') {
655
+			$tags = '<iframe>';
656
+		} else if ($pkey == 'post_desc') {
657
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
+		} else if (is_array($_REQUEST[$pkey])) {
661
+			$tags = 'skip_field';
662
+		} else {
663
+			$tags = '';
664
+		}
665
+		/**
666
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
+		 *
668
+		 * @since 1.0.0
669
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
+		 */
672
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
+
674
+		if ($tags != 'skip_field') {
675
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
+		}
677
+	}
678
+
679
+	$post = (object)$_REQUEST;
680
+
681
+
682
+	if (isset($post->video)) {
683
+		$post->video = stripslashes($post->video);
684
+	}
685
+
686
+	if (isset($post->Video2)) {
687
+		$post->Video2 = stripslashes($post->Video2);
688
+	}
689
+
690
+	$post_type = $post->listing_type;
691
+	$post_type_info = get_post_type_object($post_type);
692
+
693
+	$listing_label = $post_type_info->labels->singular_name;
694
+
695
+	$term_icon = '';
696
+
697
+	if (!empty($post->post_category)) {
698
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
699
+
700
+			if ($post_term != '' && !is_array($post_term)) {
701
+				$post_term = explode(',', trim($post_term, ','));
702
+			}
703 703
 
704
-            if (is_array($post_term)) {
705
-                $post_term = array_unique($post_term);
706
-            }
704
+			if (is_array($post_term)) {
705
+				$post_term = array_unique($post_term);
706
+			}
707 707
 
708
-            if (!empty($post_term)) {
709
-                foreach ($post_term as $cat_id) {
710
-                    $cat_id = trim($cat_id);
711
-
712
-                    if ($cat_id != '') {
713
-                        $term_icon = get_option('geodir_default_marker_icon');
714
-
715
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
719
-                                break;
720
-                            }
721
-                        }
722
-                    }
723
-                }
724
-            }
725
-        }
726
-    }
708
+			if (!empty($post_term)) {
709
+				foreach ($post_term as $cat_id) {
710
+					$cat_id = trim($cat_id);
711
+
712
+					if ($cat_id != '') {
713
+						$term_icon = get_option('geodir_default_marker_icon');
714
+
715
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
+									$term_icon = $term_icon_url['src'];
719
+								break;
720
+							}
721
+						}
722
+					}
723
+				}
724
+			}
725
+		}
726
+	}
727 727
 
728
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
728
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
730 730
 
731
-    $srcharr = array("'", "/", "-", '"', '\\');
732
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
731
+	$srcharr = array("'", "/", "-", '"', '\\');
732
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
733 733
 
734
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
734
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
735 735
 
736
-    $json = '{';
737
-    $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
742
-    $json .= '}';
736
+	$json = '{';
737
+	$json .= '"post_preview": "1",';
738
+	$json .= '"t": "' . $json_title . '",';
739
+	$json .= '"lt": "' . $post_latitude . '",';
740
+	$json .= '"ln": "' . $post_longitude . '",';
741
+	$json .= '"i":"' . $term_icon . '"';
742
+	$json .= '}';
743 743
 
744
-    $post->marker_json = $json;
744
+	$post->marker_json = $json;
745 745
 
746
-    $gd_session->set('listing', $_REQUEST);
746
+	$gd_session->set('listing', $_REQUEST);
747 747
 
748
-    // we need to define a few things to trick the setup_postdata
749
-    if (!isset($post->ID)) {
750
-        $post->ID = '';
751
-        $post->post_author = '';
752
-        $post->post_date = '';
753
-        $post->post_content = '';
754
-        $post->default_category = '';
755
-        $post->post_type = '';
756
-    }
757
-    setup_postdata($post);
748
+	// we need to define a few things to trick the setup_postdata
749
+	if (!isset($post->ID)) {
750
+		$post->ID = '';
751
+		$post->post_author = '';
752
+		$post->post_date = '';
753
+		$post->post_content = '';
754
+		$post->default_category = '';
755
+		$post->post_type = '';
756
+	}
757
+	setup_postdata($post);
758 758
 }
759 759
 
760 760
 /**
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
  */
767 767
 function geodir_action_geodir_preview_code()
768 768
 {
769
-    global $preview;
769
+	global $preview;
770 770
 
771
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
771
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772 772
 
773
-    if (!$preview || $is_backend_preview) {
774
-        return;
775
-    }// bail if not previewing
773
+	if (!$preview || $is_backend_preview) {
774
+		return;
775
+	}// bail if not previewing
776 776
 
777
-    geodir_get_template_part('preview', 'buttons');
777
+	geodir_get_template_part('preview', 'buttons');
778 778
 }
779 779
 
780 780
 // action for adding the details page top widget area
@@ -790,20 +790,20 @@  discard block
 block discarded – undo
790 790
  */
791 791
 function geodir_action_geodir_sidebar_detail_top($class = '')
792 792
 {
793
-    if (get_option('geodir_show_detail_top_section')) { ?>
793
+	if (get_option('geodir_show_detail_top_section')) { ?>
794 794
         <div
795 795
             class="<?php
796
-            /**
797
-             * Filter the div class for the wrapper of the full width widget areas.
798
-             *
799
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
-             *
801
-             * @since 1.0.0
802
-             * @param string $class The class of the div.
803
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
-             */
806
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
796
+			/**
797
+			 * Filter the div class for the wrapper of the full width widget areas.
798
+			 *
799
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
+			 *
801
+			 * @since 1.0.0
802
+			 * @param string $class The class of the div.
803
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
+			 */
806
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
807 807
             <?php dynamic_sidebar('geodir_detail_top'); ?>
808 808
         </div>
809 809
     <?php }
@@ -827,11 +827,11 @@  discard block
 block discarded – undo
827 827
  */
828 828
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
829 829
 {
830
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
830
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
831 831
         <div
832 832
             class="<?php
833
-            /** This action is documented in geodirectory_template_actions.php */
834
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
833
+			/** This action is documented in geodirectory_template_actions.php */
834
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
835 835
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
836 836
         </div><!-- clearfix ends here-->
837 837
     <?php }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
  */
846 846
 function geodir_details_sidebar_widget_area()
847 847
 {
848
-    dynamic_sidebar('geodir_detail_sidebar');
848
+	dynamic_sidebar('geodir_detail_sidebar');
849 849
 }
850 850
 
851 851
 /**
@@ -856,12 +856,12 @@  discard block
 block discarded – undo
856 856
  */
857 857
 function geodir_details_sidebar_place_details()
858 858
 {
859
-    /**
860
-     * Used to add items to the details page sidebar.
861
-     *
862
-     * @since 1.0.0
863
-     */
864
-    do_action('geodir_detail_page_sidebar');
859
+	/**
860
+	 * Used to add items to the details page sidebar.
861
+	 *
862
+	 * @since 1.0.0
863
+	 */
864
+	do_action('geodir_detail_page_sidebar');
865 865
 }
866 866
 
867 867
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -876,68 +876,68 @@  discard block
 block discarded – undo
876 876
  */
877 877
 function geodir_action_details_sidebar()
878 878
 {
879
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
-    if (get_option('geodir_detail_sidebar_left_section')) {
881
-        /**
882
-         * Called before the details page left sidebar is opened.
883
-         *
884
-         * This is used to add opening wrapper HTML to the details page left sidebar.
885
-         *
886
-         * @since 1.0.0
887
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
-         */
892
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
893
-        ?>
879
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
+	if (get_option('geodir_detail_sidebar_left_section')) {
881
+		/**
882
+		 * Called before the details page left sidebar is opened.
883
+		 *
884
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
885
+		 *
886
+		 * @since 1.0.0
887
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
+		 */
892
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
893
+		?>
894 894
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
895
-        /**
896
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
-         *
898
-         * This is used to add all info to the details page sidebars.
899
-         *
900
-         * @since 1.0.0
901
-         */
902
-        do_action('geodir_detail_sidebar_inside');
903
-        ?></div><!-- end geodir-content-left --><?php
904
-        /**
905
-         * Called after the details page left sidebar.
906
-         *
907
-         * This is used to add closing wrapper HTML to the details page left sidebar.
908
-         *
909
-         * @since 1.0.0
910
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
-         */
912
-        do_action('geodir_sidebar_left_close', 'details-page');
913
-    } else {
914
-        /**
915
-         * Called before the details page right sidebar is opened.
916
-         *
917
-         * This is used to add opening wrapper HTML to the details page right sidebar.
918
-         *
919
-         * @since 1.0.0
920
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
-         */
925
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
-        ?>
895
+		/**
896
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
+		 *
898
+		 * This is used to add all info to the details page sidebars.
899
+		 *
900
+		 * @since 1.0.0
901
+		 */
902
+		do_action('geodir_detail_sidebar_inside');
903
+		?></div><!-- end geodir-content-left --><?php
904
+		/**
905
+		 * Called after the details page left sidebar.
906
+		 *
907
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
908
+		 *
909
+		 * @since 1.0.0
910
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
+		 */
912
+		do_action('geodir_sidebar_left_close', 'details-page');
913
+	} else {
914
+		/**
915
+		 * Called before the details page right sidebar is opened.
916
+		 *
917
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
918
+		 *
919
+		 * @since 1.0.0
920
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
+		 */
925
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
+		?>
927 927
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
928
-        /** This action is documented in geodirectory_template_actions.php */
929
-        do_action('geodir_detail_sidebar_inside');
930
-        ?></div><!-- end geodir-content-right --><?php
931
-        /**
932
-         * Called after the details page right sidebar.
933
-         *
934
-         * This is used to add closing wrapper HTML to the details page right sidebar.
935
-         *
936
-         * @since 1.0.0
937
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
-         */
939
-        do_action('geodir_sidebar_right_close', 'details-page');
940
-    }
928
+		/** This action is documented in geodirectory_template_actions.php */
929
+		do_action('geodir_detail_sidebar_inside');
930
+		?></div><!-- end geodir-content-right --><?php
931
+		/**
932
+		 * Called after the details page right sidebar.
933
+		 *
934
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
935
+		 *
936
+		 * @since 1.0.0
937
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
+		 */
939
+		do_action('geodir_sidebar_right_close', 'details-page');
940
+	}
941 941
 }
942 942
 
943 943
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -951,21 +951,21 @@  discard block
 block discarded – undo
951 951
  */
952 952
 function geodir_action_page_title()
953 953
 {
954
-    /**
955
-     * Filter the page title HTML h1 class.
956
-     *
957
-     * @since 1.0.0
958
-     * @param string $class The class to use. Default is 'entry-title fn'.
959
-     */
960
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
-    /**
962
-     * Filter the page title HTML header wrapper class.
963
-     *
964
-     * @since 1.0.0
965
-     * @param string $class The class to use. Default is 'entry-header'.
966
-     */
967
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
954
+	/**
955
+	 * Filter the page title HTML h1 class.
956
+	 *
957
+	 * @since 1.0.0
958
+	 * @param string $class The class to use. Default is 'entry-title fn'.
959
+	 */
960
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
+	/**
962
+	 * Filter the page title HTML header wrapper class.
963
+	 *
964
+	 * @since 1.0.0
965
+	 * @param string $class The class to use. Default is 'entry-header'.
966
+	 */
967
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -982,87 +982,87 @@  discard block
 block discarded – undo
982 982
  */
983 983
 function geodir_action_details_slider()
984 984
 {
985
-    global $preview, $post;
985
+	global $preview, $post;
986 986
 
987
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
987
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988 988
 
989
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
989
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
991 991
 
992
-        $preview_post_images = array();
993
-        if ($preview_get_images) {
994
-            foreach ($preview_get_images as $row) {
995
-                $preview_post_images[] = $row->src;
996
-            }
997
-        }
998
-        if (!empty($preview_post_images)) {
999
-            $post->post_images = implode(',', $preview_post_images);
1000
-        }
1001
-    }
1002
-
1003
-    if ($preview) {
1004
-        $post_images = array();
1005
-        if (isset($post->post_images) && !empty($post->post_images)) {
1006
-            $post->post_images = trim($post->post_images, ",");
1007
-            $post_images = explode(",", $post->post_images);
1008
-        }
1009
-
1010
-        $main_slides = '';
1011
-        $nav_slides = '';
1012
-        $slides = 0;
1013
-
1014
-        if (!empty($post_images)) {
1015
-            foreach ($post_images as $image) {
1016
-                if (!empty($image)) {
1017
-                    $sizes = getimagesize(trim($image));
1018
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
-
1021
-                    if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
-                    }
1024
-
1025
-                    if (isset($image->src)) {
1026
-                        if ($image->height >= 400) {
1027
-                            $spacer_height = 0;
1028
-                        } else {
1029
-                            $spacer_height = ((400 - $image->height) / 2);
1030
-                        }
1031
-
1032
-                        $image_title = isset($image->title) ? $image->title : '';
1033
-
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
-                        $slides++;
1038
-                    }
1039
-                }
1040
-            }// endfore
1041
-        } //end if
1042
-    } else {
1043
-        $main_slides = '';
1044
-        $nav_slides = '';
1045
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
-        $slides = 0;
1047
-
1048
-        if (!empty($post_images)) {
1049
-            foreach ($post_images as $image) {
1050
-                if ($image->height >= 400) {
1051
-                    $spacer_height = 0;
1052
-                } else {
1053
-                    $spacer_height = ((400 - $image->height) / 2);
1054
-                }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
-                $slides++;
1060
-            }
1061
-        }// endfore
1062
-    }
992
+		$preview_post_images = array();
993
+		if ($preview_get_images) {
994
+			foreach ($preview_get_images as $row) {
995
+				$preview_post_images[] = $row->src;
996
+			}
997
+		}
998
+		if (!empty($preview_post_images)) {
999
+			$post->post_images = implode(',', $preview_post_images);
1000
+		}
1001
+	}
1002
+
1003
+	if ($preview) {
1004
+		$post_images = array();
1005
+		if (isset($post->post_images) && !empty($post->post_images)) {
1006
+			$post->post_images = trim($post->post_images, ",");
1007
+			$post_images = explode(",", $post->post_images);
1008
+		}
1009
+
1010
+		$main_slides = '';
1011
+		$nav_slides = '';
1012
+		$slides = 0;
1013
+
1014
+		if (!empty($post_images)) {
1015
+			foreach ($post_images as $image) {
1016
+				if (!empty($image)) {
1017
+					$sizes = getimagesize(trim($image));
1018
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
+
1021
+					if ($image && $width && $height) {
1022
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
+					}
1024
+
1025
+					if (isset($image->src)) {
1026
+						if ($image->height >= 400) {
1027
+							$spacer_height = 0;
1028
+						} else {
1029
+							$spacer_height = ((400 - $image->height) / 2);
1030
+						}
1031
+
1032
+						$image_title = isset($image->title) ? $image->title : '';
1033
+
1034
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
+						$slides++;
1038
+					}
1039
+				}
1040
+			}// endfore
1041
+		} //end if
1042
+	} else {
1043
+		$main_slides = '';
1044
+		$nav_slides = '';
1045
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
+		$slides = 0;
1047
+
1048
+		if (!empty($post_images)) {
1049
+			foreach ($post_images as $image) {
1050
+				if ($image->height >= 400) {
1051
+					$spacer_height = 0;
1052
+				} else {
1053
+					$spacer_height = ((400 - $image->height) / 2);
1054
+				}
1055
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+				$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
+				$slides++;
1060
+			}
1061
+		}// endfore
1062
+	}
1063 1063
 
1064
-    if (!empty($post_images)) {
1065
-        ?>
1064
+	if (!empty($post_images)) {
1065
+		?>
1066 1066
         <div class="geodir_flex-container">
1067 1067
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1068 1068
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
             <?php } ?>
1076 1076
         </div>
1077 1077
     <?php
1078
-    }
1078
+	}
1079 1079
 }
1080 1080
 
1081 1081
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1090,177 +1090,177 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+	global $preview, $post;?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096
-    $taxonomies = array();
1097
-
1098
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
-
1100
-    if ($preview && !$is_backend_preview) {
1101
-        $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1103
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
-    } else {
1105
-        $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1107
-    }
1096
+	$taxonomies = array();
1097
+
1098
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
+
1100
+	if ($preview && !$is_backend_preview) {
1101
+		$post_type = $post->listing_type;
1102
+		$post_taxonomy = $post_type . 'category';
1103
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
+	} else {
1105
+		$post_type = $post->post_type;
1106
+		$post_taxonomy = $post_type . 'category';
1107
+	}
1108 1108
 //{	
1109
-    $post_type_info = get_post_type_object($post_type);
1110
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
-
1112
-    if (!empty($post->post_tags)) {
1113
-
1114
-        if (taxonomy_exists($post_type . '_tags')):
1115
-            $links = array();
1116
-            $terms = array();
1117
-            // to limit post tags
1118
-            $post_tags = trim($post->post_tags, ",");
1119
-            $post_id = isset($post->ID) ? $post->ID : '';
1120
-            /**
1121
-             * Filter the post tags.
1122
-             *
1123
-             * Allows you to filter the post tags output on the details page of a post.
1124
-             *
1125
-             * @since 1.0.0
1126
-             * @param string $post_tags A comma seperated list of tags.
1127
-             * @param int $post_id The current post id.
1128
-             */
1129
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
-
1131
-            $post->post_tags = $post_tags;
1132
-            $post_tags = explode(",", trim($post->post_tags, ","));
1133
-
1134
-
1135
-            foreach ($post_tags as $post_term) {
1136
-
1137
-                // fix slug creation order for tags & location
1138
-                $post_term = trim($post_term);
1139
-
1140
-                $priority_location = false;
1141
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1143
-                } else {
1144
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1146
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1147
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1148
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1149
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150
-                    if ($match_country || $match_region || $match_city) {
1151
-                        $priority_location = true;
1152
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1153
-                    } else {
1154
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1156
-                    }
1157
-                }
1158
-
1159
-                if (!is_wp_error($term) && is_object($term)) {
1160
-
1161
-                    // fix tag link on detail page
1162
-                    if ($priority_location) {
1163
-
1164
-                        $tag_link = "<a href=''>$post_term</a>";
1165
-                        /**
1166
-                         * Filter the tag name on the details page.
1167
-                         *
1168
-                         * @since 1.5.6
1169
-                         * @param string $tag_link The tag link html.
1170
-                         * @param object $term The tag term object.
1171
-                         */
1172
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1173
-                        $links[] = $tag_link;
1174
-                    } else {
1175
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1176
-                        /** This action is documented in geodirectory-template_actions.php */
1177
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1178
-                        $links[] = $tag_link;
1179
-                    }
1180
-                    $terms[] = $term;
1181
-                }
1182
-                //
1183
-            }
1184
-            if (!isset($listing_label)) {
1185
-                $listing_label = '';
1186
-            }
1187
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1188
-        endif;
1189
-
1190
-    }
1191
-
1192
-    if (!empty($post->{$post_taxonomy})) {
1193
-        $links = array();
1194
-        $terms = array();
1195
-        $termsOrdered = array();
1196
-        if (!is_array($post->{$post_taxonomy})) {
1197
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1198
-        } else {
1199
-            $post_term = $post->{$post_taxonomy};
1109
+	$post_type_info = get_post_type_object($post_type);
1110
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
+
1112
+	if (!empty($post->post_tags)) {
1113
+
1114
+		if (taxonomy_exists($post_type . '_tags')):
1115
+			$links = array();
1116
+			$terms = array();
1117
+			// to limit post tags
1118
+			$post_tags = trim($post->post_tags, ",");
1119
+			$post_id = isset($post->ID) ? $post->ID : '';
1120
+			/**
1121
+			 * Filter the post tags.
1122
+			 *
1123
+			 * Allows you to filter the post tags output on the details page of a post.
1124
+			 *
1125
+			 * @since 1.0.0
1126
+			 * @param string $post_tags A comma seperated list of tags.
1127
+			 * @param int $post_id The current post id.
1128
+			 */
1129
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
+
1131
+			$post->post_tags = $post_tags;
1132
+			$post_tags = explode(",", trim($post->post_tags, ","));
1133
+
1134
+
1135
+			foreach ($post_tags as $post_term) {
1136
+
1137
+				// fix slug creation order for tags & location
1138
+				$post_term = trim($post_term);
1139
+
1140
+				$priority_location = false;
1141
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1143
+				} else {
1144
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1146
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1147
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1148
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1149
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150
+					if ($match_country || $match_region || $match_city) {
1151
+						$priority_location = true;
1152
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1153
+					} else {
1154
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1156
+					}
1157
+				}
1158
+
1159
+				if (!is_wp_error($term) && is_object($term)) {
1160
+
1161
+					// fix tag link on detail page
1162
+					if ($priority_location) {
1163
+
1164
+						$tag_link = "<a href=''>$post_term</a>";
1165
+						/**
1166
+						 * Filter the tag name on the details page.
1167
+						 *
1168
+						 * @since 1.5.6
1169
+						 * @param string $tag_link The tag link html.
1170
+						 * @param object $term The tag term object.
1171
+						 */
1172
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1173
+						$links[] = $tag_link;
1174
+					} else {
1175
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1176
+						/** This action is documented in geodirectory-template_actions.php */
1177
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1178
+						$links[] = $tag_link;
1179
+					}
1180
+					$terms[] = $term;
1181
+				}
1182
+				//
1183
+			}
1184
+			if (!isset($listing_label)) {
1185
+				$listing_label = '';
1186
+			}
1187
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1188
+		endif;
1189
+
1190
+	}
1191
+
1192
+	if (!empty($post->{$post_taxonomy})) {
1193
+		$links = array();
1194
+		$terms = array();
1195
+		$termsOrdered = array();
1196
+		if (!is_array($post->{$post_taxonomy})) {
1197
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1198
+		} else {
1199
+			$post_term = $post->{$post_taxonomy};
1200 1200
 			
1201 1201
 			if ($preview && !$is_backend_preview) {
1202 1202
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1203 1203
 			}
1204
-        }
1205
-
1206
-        $post_term = array_unique($post_term);
1207
-        if (!empty($post_term)) {
1208
-            foreach ($post_term as $post_term) {
1209
-                $post_term = trim($post_term);
1210
-
1211
-                if ($post_term != ''):
1212
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1213
-
1214
-                    if (is_object($term)) {
1215
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1216
-                        /**
1217
-                         * Filter the category name on the details page.
1218
-                         *
1219
-                         * @since 1.5.6
1220
-                         * @param string $term_link The link html to the category.
1221
-                         * @param object $term The category term object.
1222
-                         */
1223
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1224
-                        $links[] = $term_link;
1225
-                        $terms[] = $term;
1226
-                    }
1227
-                endif;
1228
-            }
1229
-            // order alphabetically
1230
-            asort($links);
1231
-            foreach (array_keys($links) as $key) {
1232
-                $termsOrdered[$key] = $terms[$key];
1233
-            }
1234
-            $terms = $termsOrdered;
1204
+		}
1205
+
1206
+		$post_term = array_unique($post_term);
1207
+		if (!empty($post_term)) {
1208
+			foreach ($post_term as $post_term) {
1209
+				$post_term = trim($post_term);
1210
+
1211
+				if ($post_term != ''):
1212
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1213
+
1214
+					if (is_object($term)) {
1215
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1216
+						/**
1217
+						 * Filter the category name on the details page.
1218
+						 *
1219
+						 * @since 1.5.6
1220
+						 * @param string $term_link The link html to the category.
1221
+						 * @param object $term The category term object.
1222
+						 */
1223
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1224
+						$links[] = $term_link;
1225
+						$terms[] = $term;
1226
+					}
1227
+				endif;
1228
+			}
1229
+			// order alphabetically
1230
+			asort($links);
1231
+			foreach (array_keys($links) as $key) {
1232
+				$termsOrdered[$key] = $terms[$key];
1233
+			}
1234
+			$terms = $termsOrdered;
1235 1235
 
1236
-        }
1236
+		}
1237 1237
 
1238
-        if (!isset($listing_label)) {
1239
-            $listing_label = '';
1240
-        }
1241
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1238
+		if (!isset($listing_label)) {
1239
+			$listing_label = '';
1240
+		}
1241
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1242 1242
 
1243
-    }
1243
+	}
1244 1244
 
1245
-    /**
1246
-     * Filter the taxonomies array before output.
1247
-     *
1248
-     * @since 1.5.9
1249
-     * @param array $taxonomies The array of cats and tags.
1250
-     * @param string $post_type The post type being output.
1251
-     * @param string $listing_label The post type label.
1252
-     * @param string $listing_label The post type label with ucwords function.
1253
-     */
1254
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1245
+	/**
1246
+	 * Filter the taxonomies array before output.
1247
+	 *
1248
+	 * @since 1.5.9
1249
+	 * @param array $taxonomies The array of cats and tags.
1250
+	 * @param string $post_type The post type being output.
1251
+	 * @param string $listing_label The post type label.
1252
+	 * @param string $listing_label The post type label with ucwords function.
1253
+	 */
1254
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1255 1255
 
1256
-    if (isset($taxonomies[$post_taxonomy])) {
1257
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1258
-    }
1256
+	if (isset($taxonomies[$post_taxonomy])) {
1257
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1258
+	}
1259 1259
 
1260
-    if (isset($taxonomies[$post_type . '_tags']))
1261
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1260
+	if (isset($taxonomies[$post_type . '_tags']))
1261
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1262 1262
 
1263
-    ?>
1263
+	?>
1264 1264
     </p><?php
1265 1265
 }
1266 1266
 
@@ -1282,140 +1282,140 @@  discard block
 block discarded – undo
1282 1282
 function geodir_action_details_micordata($post='')
1283 1283
 {
1284 1284
 
1285
-    global $preview;
1286
-    if(empty($post)){global $post;}
1287
-    if ($preview || !geodir_is_page('detail')) {
1288
-        return;
1289
-    }
1290
-
1291
-    // url
1292
-    $c_url = geodir_curPageURL();
1293
-
1294
-    // post reviews
1295
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1296
-    if (empty($post_reviews)) {
1297
-        $reviews = '';
1298
-    } else {
1299
-        foreach ($post_reviews as $review) {
1300
-            $reviews[] = array(
1301
-                "@type" => "Review",
1302
-                "author" => $review->comment_author,
1303
-                "datePublished" => $review->comment_date,
1304
-                "description" => $review->comment_content,
1305
-                "reviewRating" => array(
1306
-                    "@type" => "Rating",
1307
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1308
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309
-                    "worstRating" => "1"
1310
-                )
1311
-            );
1312
-        }
1313
-
1314
-    }
1315
-
1316
-    // post images
1317
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1318
-    if (empty($post_images)) {
1319
-        $images = '';
1320
-    } else {
1321
-        $i_arr = array();
1322
-        foreach ($post_images as $img) {
1323
-            $i_arr[] = $img->src;
1324
-        }
1325
-
1326
-        if (count($i_arr) == 1) {
1327
-            $images = $i_arr[0];
1328
-        } else {
1329
-            $images = $i_arr;
1330
-        }
1331
-
1332
-    }
1333
-    //print_r($post);
1334
-    // external links
1335
-    $external_links =  array();
1336
-    $external_links[] = $post->geodir_website;
1337
-    $external_links[] = $post->geodir_twitter;
1338
-    $external_links[] = $post->geodir_facebook;
1339
-    $external_links = array_filter($external_links);
1340
-
1341
-    if(!empty($external_links)){
1342
-        $external_links = array_values($external_links);
1343
-    }
1344
-
1345
-    // reviews
1346
-    $comment_count = geodir_get_review_count_total($post->ID);
1347
-    $post_avgratings = geodir_get_post_rating($post->ID);
1348
-
1349
-    // schema type
1350
-    $schema_type = 'LocalBusiness';
1351
-    if(isset($post->default_category) && $post->default_category){
1352
-        $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
-        if($cat_schema){$schema_type = $cat_schema;}
1354
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1355
-    }
1356
-
1357
-    $schema = array();
1358
-    $schema['@context'] = "https://schema.org";
1359
-    $schema['@type'] = $schema_type;
1360
-    $schema['name'] = $post->post_title;
1361
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1362
-    $schema['telephone'] = $post->geodir_contact;
1363
-    $schema['url'] = $c_url;
1364
-    $schema['sameAs'] = $external_links;
1365
-    $schema['image'] = $images;
1366
-    $schema['address'] = array(
1367
-        "@type" => "PostalAddress",
1368
-        "streetAddress" => $post->post_address,
1369
-        "addressLocality" => $post->post_city,
1370
-        "addressRegion" => $post->post_region,
1371
-        "addressCountry" => $post->post_country,
1372
-        "postalCode" => $post->post_zip
1373
-    );
1374
-
1375
-    if($post->post_latitude && $post->post_longitude) {
1376
-        $schema['geo'] = array(
1377
-            "@type" => "GeoCoordinates",
1378
-            "latitude" => $post->post_latitude,
1379
-            "longitude" => $post->post_longitude
1380
-        );
1381
-    }
1382
-
1383
-    if($post_avgratings) {
1384
-        $schema['aggregateRating'] = array(
1385
-            "@type" => "AggregateRating",
1386
-            "ratingValue" => $post_avgratings,
1387
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1388
-            "worstRating" => "1",
1389
-            "ratingCount" => $comment_count
1390
-        );
1391
-    }
1392
-    $schema['review'] = $reviews;
1393
-
1394
-    /**
1395
-     * Allow the schema JSON-LD info to be filtered.
1396
-     *
1397
-     * @since 1.5.4
1398
-     * @since 1.5.7 Added $post variable.
1399
-     * @param array $schema The array of schema data to be filtered.
1400
-     * @param object $post The post object.
1401
-     */
1402
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1403
-
1404
-
1405
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1406
-
1407
-
1408
-    $uploads = wp_upload_dir();
1409
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1410
-
1411
-    /**
1412
-     * Show facebook open graph meta info
1413
-     *
1414
-     * @since 1.6.6
1415
-     * @param string $facebook_og The open graph html to be filtered.
1416
-     * @param object $post The post object.
1417
-     */
1418
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1285
+	global $preview;
1286
+	if(empty($post)){global $post;}
1287
+	if ($preview || !geodir_is_page('detail')) {
1288
+		return;
1289
+	}
1290
+
1291
+	// url
1292
+	$c_url = geodir_curPageURL();
1293
+
1294
+	// post reviews
1295
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1296
+	if (empty($post_reviews)) {
1297
+		$reviews = '';
1298
+	} else {
1299
+		foreach ($post_reviews as $review) {
1300
+			$reviews[] = array(
1301
+				"@type" => "Review",
1302
+				"author" => $review->comment_author,
1303
+				"datePublished" => $review->comment_date,
1304
+				"description" => $review->comment_content,
1305
+				"reviewRating" => array(
1306
+					"@type" => "Rating",
1307
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1308
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309
+					"worstRating" => "1"
1310
+				)
1311
+			);
1312
+		}
1313
+
1314
+	}
1315
+
1316
+	// post images
1317
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1318
+	if (empty($post_images)) {
1319
+		$images = '';
1320
+	} else {
1321
+		$i_arr = array();
1322
+		foreach ($post_images as $img) {
1323
+			$i_arr[] = $img->src;
1324
+		}
1325
+
1326
+		if (count($i_arr) == 1) {
1327
+			$images = $i_arr[0];
1328
+		} else {
1329
+			$images = $i_arr;
1330
+		}
1331
+
1332
+	}
1333
+	//print_r($post);
1334
+	// external links
1335
+	$external_links =  array();
1336
+	$external_links[] = $post->geodir_website;
1337
+	$external_links[] = $post->geodir_twitter;
1338
+	$external_links[] = $post->geodir_facebook;
1339
+	$external_links = array_filter($external_links);
1340
+
1341
+	if(!empty($external_links)){
1342
+		$external_links = array_values($external_links);
1343
+	}
1344
+
1345
+	// reviews
1346
+	$comment_count = geodir_get_review_count_total($post->ID);
1347
+	$post_avgratings = geodir_get_post_rating($post->ID);
1348
+
1349
+	// schema type
1350
+	$schema_type = 'LocalBusiness';
1351
+	if(isset($post->default_category) && $post->default_category){
1352
+		$cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
+		if($cat_schema){$schema_type = $cat_schema;}
1354
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1355
+	}
1356
+
1357
+	$schema = array();
1358
+	$schema['@context'] = "https://schema.org";
1359
+	$schema['@type'] = $schema_type;
1360
+	$schema['name'] = $post->post_title;
1361
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1362
+	$schema['telephone'] = $post->geodir_contact;
1363
+	$schema['url'] = $c_url;
1364
+	$schema['sameAs'] = $external_links;
1365
+	$schema['image'] = $images;
1366
+	$schema['address'] = array(
1367
+		"@type" => "PostalAddress",
1368
+		"streetAddress" => $post->post_address,
1369
+		"addressLocality" => $post->post_city,
1370
+		"addressRegion" => $post->post_region,
1371
+		"addressCountry" => $post->post_country,
1372
+		"postalCode" => $post->post_zip
1373
+	);
1374
+
1375
+	if($post->post_latitude && $post->post_longitude) {
1376
+		$schema['geo'] = array(
1377
+			"@type" => "GeoCoordinates",
1378
+			"latitude" => $post->post_latitude,
1379
+			"longitude" => $post->post_longitude
1380
+		);
1381
+	}
1382
+
1383
+	if($post_avgratings) {
1384
+		$schema['aggregateRating'] = array(
1385
+			"@type" => "AggregateRating",
1386
+			"ratingValue" => $post_avgratings,
1387
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1388
+			"worstRating" => "1",
1389
+			"ratingCount" => $comment_count
1390
+		);
1391
+	}
1392
+	$schema['review'] = $reviews;
1393
+
1394
+	/**
1395
+	 * Allow the schema JSON-LD info to be filtered.
1396
+	 *
1397
+	 * @since 1.5.4
1398
+	 * @since 1.5.7 Added $post variable.
1399
+	 * @param array $schema The array of schema data to be filtered.
1400
+	 * @param object $post The post object.
1401
+	 */
1402
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1403
+
1404
+
1405
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1406
+
1407
+
1408
+	$uploads = wp_upload_dir();
1409
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1410
+
1411
+	/**
1412
+	 * Show facebook open graph meta info
1413
+	 *
1414
+	 * @since 1.6.6
1415
+	 * @param string $facebook_og The open graph html to be filtered.
1416
+	 * @param object $post The post object.
1417
+	 */
1418
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1419 1419
 
1420 1420
 
1421 1421
 
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
  */
1436 1436
 function geodir_action_details_next_prev()
1437 1437
 {
1438
-    ?>
1438
+	?>
1439 1439
     <div class="geodir-pos_navigation clearfix">
1440 1440
     <div
1441 1441
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1453,15 +1453,15 @@  discard block
 block discarded – undo
1453 1453
  */
1454 1454
 function geodir_action_before_single_post()
1455 1455
 {
1456
-    global $post;
1457
-    /**
1458
-     * Called at the very start of the details page output, before the title section.
1459
-     *
1460
-     * @since 1.0.0
1461
-     * @param object $post The current post object.
1462
-     * @global WP_Post|null $post The current post, if available.
1463
-     */
1464
-    do_action('geodir_before_single_post', $post); // extra action	
1456
+	global $post;
1457
+	/**
1458
+	 * Called at the very start of the details page output, before the title section.
1459
+	 *
1460
+	 * @since 1.0.0
1461
+	 * @param object $post The current post object.
1462
+	 * @global WP_Post|null $post The current post, if available.
1463
+	 */
1464
+	do_action('geodir_before_single_post', $post); // extra action	
1465 1465
 }
1466 1466
 
1467 1467
 /**
@@ -1472,13 +1472,13 @@  discard block
 block discarded – undo
1472 1472
  */
1473 1473
 function geodir_action_after_single_post($post)
1474 1474
 {
1475
-    /**
1476
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1477
-     *
1478
-     * @since 1.0.0
1479
-     * @param object $post The current post object.
1480
-     */
1481
-    do_action('geodir_after_single_post', $post); // extra action	
1475
+	/**
1476
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1477
+	 *
1478
+	 * @since 1.0.0
1479
+	 * @param object $post The current post object.
1480
+	 */
1481
+	do_action('geodir_after_single_post', $post); // extra action	
1482 1482
 }
1483 1483
 
1484 1484
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1504,168 +1504,168 @@  discard block
 block discarded – undo
1504 1504
  */
1505 1505
 function geodir_action_listings_title()
1506 1506
 {
1507
-    global $wp, $term;
1507
+	global $wp, $term;
1508 1508
 
1509
-    $gd_post_type = geodir_get_current_posttype();
1510
-    $post_type_info = get_post_type_object($gd_post_type);
1509
+	$gd_post_type = geodir_get_current_posttype();
1510
+	$post_type_info = get_post_type_object($gd_post_type);
1511 1511
 
1512
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1513
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1514
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1515
-    }
1512
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1513
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1514
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1515
+	}
1516 1516
 
1517
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1518
-    $single_name = $post_type_info->labels->singular_name;
1517
+	$list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1518
+	$single_name = $post_type_info->labels->singular_name;
1519 1519
 
1520
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1520
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1521 1521
 
1522
-    $gd_country = get_query_var('gd_country');
1523
-    $gd_region = get_query_var('gd_region');
1524
-    $gd_city = get_query_var('gd_city');
1522
+	$gd_country = get_query_var('gd_country');
1523
+	$gd_region = get_query_var('gd_region');
1524
+	$gd_city = get_query_var('gd_city');
1525 1525
 
1526
-    if (!empty($term)) {
1527
-        $location_name = '';
1528
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1529
-            if ($gd_country != '') {
1530
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1531
-            }
1532
-
1533
-            if ($gd_region != '') {
1534
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1535
-            }
1536
-
1537
-            if ($gd_city != '') {
1538
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1539
-            }
1540
-        }
1541
-
1542
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1543
-        if (!empty($current_term)) {
1544
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1545
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1546
-                $location_last_char = substr($location_name, -1);
1547
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1548
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1549
-            } else {
1550
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1551
-            }
1552
-        } else {
1553
-            if (count($taxonomy) > 1) {
1554
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1555
-
1556
-                if (!empty($current_term)) {
1557
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1558
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1559
-                        $location_last_char = substr($location_name, -1);
1560
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1561
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1562
-                    } else {
1563
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1564
-                    }
1565
-                }
1566
-            }
1567
-        }
1568
-
1569
-    } else {
1570
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1571
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1572
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1573
-
1574
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1575
-
1576
-        if (function_exists('get_actual_location_name')) {
1577
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1578
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1579
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1580
-        }
1581
-
1582
-        if ($gd_city != '') {
1583
-            if ($gd_city_actual != '') {
1584
-                $gd_city = $gd_city_actual;
1585
-            } else {
1586
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1587
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1588
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1589
-            }
1590
-
1591
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1592
-        } else if ($gd_region != '') {
1593
-            if ($gd_region_actual != '') {
1594
-                $gd_region = $gd_region_actual;
1595
-            } else {
1596
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1597
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1598
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1599
-            }
1600
-
1601
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1602
-        } else if ($gd_country != '') {
1603
-            if ($gd_country_actual != '') {
1604
-                $gd_country = $gd_country_actual;
1605
-            } else {
1606
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1607
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1608
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1609
-            }
1610
-
1611
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1612
-        }
1613
-    }
1614
-
1615
-    if (is_search()) {
1616
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1617
-    }
1618
-    /** This action is documented in geodirectory_template_actions.php */
1619
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1620
-    /** This action is documented in geodirectory_template_actions.php */
1621
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1622
-
1623
-
1624
-    $title = $list_title;
1625
-    $gd_page = '';
1626
-    if(geodir_is_page('pt')){
1627
-        $gd_page = 'pt';
1628
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1629
-    }
1630
-    elseif(geodir_is_page('listing')){
1631
-        $gd_page = 'listing';
1632
-        global $wp_query;
1633
-        $current_term = $wp_query->get_queried_object();
1634
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1635
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1636
-        }else{
1637
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1638
-        }
1526
+	if (!empty($term)) {
1527
+		$location_name = '';
1528
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1529
+			if ($gd_country != '') {
1530
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1531
+			}
1639 1532
 
1640
-    }
1641
-    elseif(geodir_is_page('author')){
1642
-        $gd_page = 'author';
1643
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1644
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1645
-        }else{
1646
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1647
-        }
1533
+			if ($gd_region != '') {
1534
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1535
+			}
1648 1536
 
1649
-    }
1537
+			if ($gd_city != '') {
1538
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1539
+			}
1540
+		}
1541
+
1542
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1543
+		if (!empty($current_term)) {
1544
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1545
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1546
+				$location_last_char = substr($location_name, -1);
1547
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1548
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1549
+			} else {
1550
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1551
+			}
1552
+		} else {
1553
+			if (count($taxonomy) > 1) {
1554
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1555
+
1556
+				if (!empty($current_term)) {
1557
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1558
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1559
+						$location_last_char = substr($location_name, -1);
1560
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1561
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1562
+					} else {
1563
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1564
+					}
1565
+				}
1566
+			}
1567
+		}
1568
+
1569
+	} else {
1570
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1571
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1572
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1573
+
1574
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1575
+
1576
+		if (function_exists('get_actual_location_name')) {
1577
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1578
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1579
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1580
+		}
1581
+
1582
+		if ($gd_city != '') {
1583
+			if ($gd_city_actual != '') {
1584
+				$gd_city = $gd_city_actual;
1585
+			} else {
1586
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1587
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1588
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1589
+			}
1650 1590
 
1591
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1592
+		} else if ($gd_region != '') {
1593
+			if ($gd_region_actual != '') {
1594
+				$gd_region = $gd_region_actual;
1595
+			} else {
1596
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1597
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1598
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1599
+			}
1651 1600
 
1652
-    /**
1653
-     * Filter page title to replace variables.
1654
-     *
1655
-     * @since 1.5.4
1656
-     * @param string $title The page title including variables.
1657
-     * @param string $gd_page The GeoDirectory page type if any.
1658
-     */
1659
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1601
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1602
+		} else if ($gd_country != '') {
1603
+			if ($gd_country_actual != '') {
1604
+				$gd_country = $gd_country_actual;
1605
+			} else {
1606
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1607
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1608
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1609
+			}
1660 1610
 
1661
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1662
-        /**
1663
-         * Filter the listing page title.
1664
-         *
1665
-         * @since 1.0.0
1666
-         * @param string $list_title The title for the category page.
1667
-         */
1668
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1611
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1612
+		}
1613
+	}
1614
+
1615
+	if (is_search()) {
1616
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1617
+	}
1618
+	/** This action is documented in geodirectory_template_actions.php */
1619
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1620
+	/** This action is documented in geodirectory_template_actions.php */
1621
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1622
+
1623
+
1624
+	$title = $list_title;
1625
+	$gd_page = '';
1626
+	if(geodir_is_page('pt')){
1627
+		$gd_page = 'pt';
1628
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1629
+	}
1630
+	elseif(geodir_is_page('listing')){
1631
+		$gd_page = 'listing';
1632
+		global $wp_query;
1633
+		$current_term = $wp_query->get_queried_object();
1634
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1635
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1636
+		}else{
1637
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1638
+		}
1639
+
1640
+	}
1641
+	elseif(geodir_is_page('author')){
1642
+		$gd_page = 'author';
1643
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1644
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1645
+		}else{
1646
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1647
+		}
1648
+
1649
+	}
1650
+
1651
+
1652
+	/**
1653
+	 * Filter page title to replace variables.
1654
+	 *
1655
+	 * @since 1.5.4
1656
+	 * @param string $title The page title including variables.
1657
+	 * @param string $gd_page The GeoDirectory page type if any.
1658
+	 */
1659
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1660
+
1661
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1662
+		/**
1663
+		 * Filter the listing page title.
1664
+		 *
1665
+		 * @since 1.0.0
1666
+		 * @param string $list_title The title for the category page.
1667
+		 */
1668
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1669 1669
 }
1670 1670
 
1671 1671
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1678,46 +1678,46 @@  discard block
 block discarded – undo
1678 1678
  */
1679 1679
 function geodir_action_listings_description()
1680 1680
 {
1681
-    global $wp_query;
1682
-    $current_term = $wp_query->get_queried_object();
1681
+	global $wp_query;
1682
+	$current_term = $wp_query->get_queried_object();
1683 1683
 
1684
-    $gd_post_type = geodir_get_current_posttype();
1685
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1684
+	$gd_post_type = geodir_get_current_posttype();
1685
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1686 1686
 
1687
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1688
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1689
-        if ($term_desc && !$saved_data) {
1690
-            $saved_data = $term_desc;
1691
-        }
1687
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1688
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1689
+		if ($term_desc && !$saved_data) {
1690
+			$saved_data = $term_desc;
1691
+		}
1692 1692
 
1693
-        // stop payment manager filtering content length
1694
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1695
-        if ( false !== $filter_priority ) {
1696
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1697
-        }
1693
+		// stop payment manager filtering content length
1694
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1695
+		if ( false !== $filter_priority ) {
1696
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1697
+		}
1698 1698
 
1699
-        /**
1700
-         * Apply the core filter `the_content` filter to the variable string.
1701
-         *
1702
-         * This is a WordPress core filter that does many things.
1703
-         *
1704
-         * @since 1.0.0
1705
-         * @param string $var The string to apply the filter to.
1706
-         */
1707
-        $cat_description = apply_filters('the_content', $saved_data);
1699
+		/**
1700
+		 * Apply the core filter `the_content` filter to the variable string.
1701
+		 *
1702
+		 * This is a WordPress core filter that does many things.
1703
+		 *
1704
+		 * @since 1.0.0
1705
+		 * @param string $var The string to apply the filter to.
1706
+		 */
1707
+		$cat_description = apply_filters('the_content', $saved_data);
1708 1708
 
1709 1709
 
1710
-        if ( false !== $filter_priority ) {
1711
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1712
-        }
1710
+		if ( false !== $filter_priority ) {
1711
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1712
+		}
1713 1713
 
1714
-        if ($cat_description) {
1715
-            ?>
1714
+		if ($cat_description) {
1715
+			?>
1716 1716
 
1717 1717
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1718
-        }
1718
+		}
1719 1719
 
1720
-    }
1720
+	}
1721 1721
 }
1722 1722
 
1723 1723
 // action for adding the listings page top widget area
@@ -1736,11 +1736,11 @@  discard block
 block discarded – undo
1736 1736
  */
1737 1737
 function geodir_action_geodir_sidebar_listings_top()
1738 1738
 {
1739
-    if (get_option('geodir_show_listing_top_section')) { ?>
1739
+	if (get_option('geodir_show_listing_top_section')) { ?>
1740 1740
         <div
1741 1741
             class="<?php
1742
-            /** This action is documented in geodirectory_template_actions.php */
1743
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1742
+			/** This action is documented in geodirectory_template_actions.php */
1743
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1744 1744
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1745 1745
         </div><!-- clearfix ends here-->
1746 1746
     <?php }
@@ -1763,35 +1763,35 @@  discard block
 block discarded – undo
1763 1763
  */
1764 1764
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1765 1765
 {
1766
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1767
-        $width_css = 'style="width:' . $width . '%;"';
1768
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1769
-        $width_css = 'style="width:' . $width . '%;"';
1770
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1771
-        $width_css = 'style="width:' . $width . '%;"';
1772
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1773
-        $width_css = 'style="width:' . $width . '%;"';
1774
-    } else {
1775
-        $width_css = '';
1776
-    }
1777
-
1778
-    $tc = get_option('theme_compatibility_setting');
1779
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1780
-        $text = $tc['geodir_sidebar_left_open_replace'];
1781
-    } else {
1782
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1783
-    }
1784
-
1785
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1786
-        $id = $tc['geodir_sidebar_left_open_id'];
1787
-    }
1788
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1789
-        $class = $tc['geodir_sidebar_left_open_class'];
1790
-    }
1791
-
1792
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1793
-
1794
-    echo $text;
1766
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1767
+		$width_css = 'style="width:' . $width . '%;"';
1768
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1769
+		$width_css = 'style="width:' . $width . '%;"';
1770
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1771
+		$width_css = 'style="width:' . $width . '%;"';
1772
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1773
+		$width_css = 'style="width:' . $width . '%;"';
1774
+	} else {
1775
+		$width_css = '';
1776
+	}
1777
+
1778
+	$tc = get_option('theme_compatibility_setting');
1779
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1780
+		$text = $tc['geodir_sidebar_left_open_replace'];
1781
+	} else {
1782
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1783
+	}
1784
+
1785
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1786
+		$id = $tc['geodir_sidebar_left_open_id'];
1787
+	}
1788
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1789
+		$class = $tc['geodir_sidebar_left_open_class'];
1790
+	}
1791
+
1792
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1793
+
1794
+	echo $text;
1795 1795
 }
1796 1796
 
1797 1797
 // action for adding the primary div closing tag
@@ -1807,13 +1807,13 @@  discard block
 block discarded – undo
1807 1807
  */
1808 1808
 function geodir_action_sidebar_left_close($type = '')
1809 1809
 {
1810
-    $tc = get_option('theme_compatibility_setting');
1811
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1812
-        $text = $tc['geodir_sidebar_left_close_replace'];
1813
-    } else {
1814
-        $text = '</aside><!-- sidebar ends here-->';
1815
-    }
1816
-    echo $text;
1810
+	$tc = get_option('theme_compatibility_setting');
1811
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1812
+		$text = $tc['geodir_sidebar_left_close_replace'];
1813
+	} else {
1814
+		$text = '</aside><!-- sidebar ends here-->';
1815
+	}
1816
+	echo $text;
1817 1817
 }
1818 1818
 
1819 1819
 /**
@@ -1826,7 +1826,7 @@  discard block
 block discarded – undo
1826 1826
  */
1827 1827
 function geodir_listing_left_section()
1828 1828
 {
1829
-    if (get_option('geodir_show_listing_left_section')) { ?>
1829
+	if (get_option('geodir_show_listing_left_section')) { ?>
1830 1830
         <div class="geodir-content-left geodir-sidebar-wrap">
1831 1831
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1832 1832
         </div><!-- end geodir-content-left -->
@@ -1844,20 +1844,20 @@  discard block
 block discarded – undo
1844 1844
  */
1845 1845
 function geodir_action_listings_sidebar_left()
1846 1846
 {
1847
-    if (get_option('geodir_show_listing_left_section')) {
1848
-        /** This action is documented in geodirectory_template_actions.php */
1849
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1850
-        /**
1851
-         * Calls the listings page (category) left sidebar content.
1852
-         *
1853
-         * All the content for the listings page left sidebar is added via this hook.
1854
-         *
1855
-         * @since 1.0.0
1856
-         */
1857
-        do_action('geodir_listings_sidebar_left_inside');
1858
-        /** This action is documented in geodirectory_template_actions.php */
1859
-        do_action('geodir_sidebar_left_close', 'listings-page');
1860
-    }
1847
+	if (get_option('geodir_show_listing_left_section')) {
1848
+		/** This action is documented in geodirectory_template_actions.php */
1849
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1850
+		/**
1851
+		 * Calls the listings page (category) left sidebar content.
1852
+		 *
1853
+		 * All the content for the listings page left sidebar is added via this hook.
1854
+		 *
1855
+		 * @since 1.0.0
1856
+		 */
1857
+		do_action('geodir_listings_sidebar_left_inside');
1858
+		/** This action is documented in geodirectory_template_actions.php */
1859
+		do_action('geodir_sidebar_left_close', 'listings-page');
1860
+	}
1861 1861
 }
1862 1862
 
1863 1863
 /**
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
  */
1871 1871
 function geodir_listing_right_section()
1872 1872
 {
1873
-    if (get_option('geodir_show_listing_right_section')) { ?>
1873
+	if (get_option('geodir_show_listing_right_section')) { ?>
1874 1874
         <div class="geodir-content-right geodir-sidebar-wrap">
1875 1875
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1876 1876
         </div><!-- end geodir-content-right -->
@@ -1888,20 +1888,20 @@  discard block
 block discarded – undo
1888 1888
  */
1889 1889
 function geodir_action_listings_sidebar_right()
1890 1890
 {
1891
-    if (get_option('geodir_show_listing_right_section')) {
1892
-        /** This action is documented in geodirectory_template_actions.php */
1893
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1894
-        /**
1895
-         * Calls the listings page (category) right sidebar content.
1896
-         *
1897
-         * All the content for the listings page right sidebar is added via this hook.
1898
-         *
1899
-         * @since 1.0.0
1900
-         */
1901
-        do_action('geodir_listings_sidebar_right_inside');
1902
-        /** This action is documented in geodirectory_template_actions.php */
1903
-        do_action('geodir_sidebar_right_close', 'listings-page');
1904
-    }
1891
+	if (get_option('geodir_show_listing_right_section')) {
1892
+		/** This action is documented in geodirectory_template_actions.php */
1893
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1894
+		/**
1895
+		 * Calls the listings page (category) right sidebar content.
1896
+		 *
1897
+		 * All the content for the listings page right sidebar is added via this hook.
1898
+		 *
1899
+		 * @since 1.0.0
1900
+		 */
1901
+		do_action('geodir_listings_sidebar_right_inside');
1902
+		/** This action is documented in geodirectory_template_actions.php */
1903
+		do_action('geodir_sidebar_right_close', 'listings-page');
1904
+	}
1905 1905
 }
1906 1906
 
1907 1907
 
@@ -1918,23 +1918,23 @@  discard block
 block discarded – undo
1918 1918
  */
1919 1919
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1920 1920
 {
1921
-    $tc = get_option('theme_compatibility_setting');
1922
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1923
-        $text = $tc['geodir_main_content_open_replace'];
1924
-    } else {
1925
-        $text = '<main id="[id]" class="[class]" role="main">';
1926
-    }
1921
+	$tc = get_option('theme_compatibility_setting');
1922
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1923
+		$text = $tc['geodir_main_content_open_replace'];
1924
+	} else {
1925
+		$text = '<main id="[id]" class="[class]" role="main">';
1926
+	}
1927 1927
 
1928
-    if (!empty($tc['geodir_main_content_open_id'])) {
1929
-        $id = $tc['geodir_main_content_open_id'];
1930
-    }
1931
-    if (!empty($tc['geodir_main_content_open_class'])) {
1932
-        $class = $tc['geodir_main_content_open_class'];
1933
-    }
1928
+	if (!empty($tc['geodir_main_content_open_id'])) {
1929
+		$id = $tc['geodir_main_content_open_id'];
1930
+	}
1931
+	if (!empty($tc['geodir_main_content_open_class'])) {
1932
+		$class = $tc['geodir_main_content_open_class'];
1933
+	}
1934 1934
 
1935
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1935
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1936 1936
 
1937
-    echo $text;
1937
+	echo $text;
1938 1938
 }
1939 1939
 
1940 1940
 // action for adding the primary div closing tag
@@ -1947,13 +1947,13 @@  discard block
 block discarded – undo
1947 1947
  */
1948 1948
 function geodir_action_main_content_close()
1949 1949
 {
1950
-    $tc = get_option('theme_compatibility_setting');
1951
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1952
-        $text = $tc['geodir_main_content_close_replace'];
1953
-    } else {
1954
-        $text = '</main><!-- main ends here-->';
1955
-    }
1956
-    echo $text;
1950
+	$tc = get_option('theme_compatibility_setting');
1951
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1952
+		$text = $tc['geodir_main_content_close_replace'];
1953
+	} else {
1954
+		$text = '</main><!-- main ends here-->';
1955
+	}
1956
+	echo $text;
1957 1957
 }
1958 1958
 
1959 1959
 /**
@@ -1965,14 +1965,14 @@  discard block
 block discarded – undo
1965 1965
  */
1966 1966
 function geodir_action_listings_content_inside()
1967 1967
 {
1968
-    global $gridview_columns;
1969
-    $listing_view = get_option('geodir_listing_view');
1970
-    if (strstr($listing_view, 'gridview')) {
1971
-        $gridview_columns = $listing_view;
1972
-        $listing_view_exp = explode('_', $listing_view);
1973
-        $listing_view = $listing_view_exp[0];
1974
-    }
1975
-    geodir_get_template_part('listing', 'listview');
1968
+	global $gridview_columns;
1969
+	$listing_view = get_option('geodir_listing_view');
1970
+	if (strstr($listing_view, 'gridview')) {
1971
+		$gridview_columns = $listing_view;
1972
+		$listing_view_exp = explode('_', $listing_view);
1973
+		$listing_view = $listing_view_exp[0];
1974
+	}
1975
+	geodir_get_template_part('listing', 'listview');
1976 1976
 }
1977 1977
 
1978 1978
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1988,47 +1988,47 @@  discard block
 block discarded – undo
1988 1988
  */
1989 1989
 function geodir_action_listings_content()
1990 1990
 {
1991
-    /**
1992
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1993
-     *
1994
-     * @since 1.0.0
1995
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1996
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1997
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1998
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1999
-     */
2000
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2001
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2002
-    echo '<div class="clearfix '.$extra_class.'">';
2003
-    /**
2004
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2005
-     *
2006
-     * @since 1.0.0
2007
-     */
2008
-    do_action('geodir_before_listing');
2009
-    echo '</div>';
2010
-
2011
-    /**
2012
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2013
-     *
2014
-     * @since 1.0.0
2015
-     */
2016
-    do_action('geodir_listings_content_inside');
2017
-
2018
-    /**
2019
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2020
-     *
2021
-     * @since 1.0.0
2022
-     */
2023
-    do_action('geodir_after_listing');
2024
-
2025
-    /**
2026
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2027
-     *
2028
-     * @since 1.0.0
2029
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2030
-     */
2031
-    do_action('geodir_main_content_close', 'listings-page');
1991
+	/**
1992
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1993
+	 *
1994
+	 * @since 1.0.0
1995
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1996
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1997
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1998
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1999
+	 */
2000
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2001
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2002
+	echo '<div class="clearfix '.$extra_class.'">';
2003
+	/**
2004
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2005
+	 *
2006
+	 * @since 1.0.0
2007
+	 */
2008
+	do_action('geodir_before_listing');
2009
+	echo '</div>';
2010
+
2011
+	/**
2012
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2013
+	 *
2014
+	 * @since 1.0.0
2015
+	 */
2016
+	do_action('geodir_listings_content_inside');
2017
+
2018
+	/**
2019
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2020
+	 *
2021
+	 * @since 1.0.0
2022
+	 */
2023
+	do_action('geodir_after_listing');
2024
+
2025
+	/**
2026
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2027
+	 *
2028
+	 * @since 1.0.0
2029
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2030
+	 */
2031
+	do_action('geodir_main_content_close', 'listings-page');
2032 2032
 }
2033 2033
 
2034 2034
 
@@ -2043,10 +2043,10 @@  discard block
 block discarded – undo
2043 2043
  */
2044 2044
 function geodir_action_sidebar_listings_bottom_section()
2045 2045
 {
2046
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2046
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2047 2047
         <div class="<?php
2048
-            /** This action is documented in geodirectory_template_actions.php */
2049
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2048
+			/** This action is documented in geodirectory_template_actions.php */
2049
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2050 2050
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2051 2051
         </div><!-- clearfix ends here-->
2052 2052
     <?php }
@@ -2066,38 +2066,38 @@  discard block
 block discarded – undo
2066 2066
  */
2067 2067
 function geodir_action_add_listing_page_title()
2068 2068
 {
2069
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2070
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2071
-    /** This action is documented in geodirectory_template_actions.php */
2072
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2073
-    /** This action is documented in geodirectory_template_actions.php */
2074
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2075
-
2076
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2077
-
2078
-    if(geodir_is_page('add-listing')){
2079
-        $gd_page = 'add-listing';
2080
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2081
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2082
-        }elseif(isset($listing_type)){
2083
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2084
-        }
2069
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2070
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2071
+	/** This action is documented in geodirectory_template_actions.php */
2072
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2073
+	/** This action is documented in geodirectory_template_actions.php */
2074
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2075
+
2076
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2077
+
2078
+	if(geodir_is_page('add-listing')){
2079
+		$gd_page = 'add-listing';
2080
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2081
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2082
+		}elseif(isset($listing_type)){
2083
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2084
+		}
2085 2085
 
2086
-    }
2086
+	}
2087 2087
 
2088 2088
 
2089
-    /**
2090
-     * Filter page title to replace variables.
2091
-     *
2092
-     * @since 1.5.4
2093
-     * @param string $title The page title including variables.
2094
-     * @param string $gd_page The GeoDirectory page type if any.
2095
-     */
2096
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2089
+	/**
2090
+	 * Filter page title to replace variables.
2091
+	 *
2092
+	 * @since 1.5.4
2093
+	 * @param string $title The page title including variables.
2094
+	 * @param string $gd_page The GeoDirectory page type if any.
2095
+	 */
2096
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2097 2097
 
2098
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2099
-    echo $title;
2100
-    echo '</h1></header>';
2098
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2099
+	echo $title;
2100
+	echo '</h1></header>';
2101 2101
 }
2102 2102
 
2103 2103
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2128,59 +2128,59 @@  discard block
 block discarded – undo
2128 2128
  */
2129 2129
 function geodir_action_add_listing_form()
2130 2130
 {
2131
-    global $cat_display, $post_cat, $current_user, $gd_session;
2132
-    $page_id = get_the_ID();
2133
-    $post = '';
2134
-    $title = '';
2135
-    $desc = '';
2136
-    $kw_tags = '';
2137
-    $required_msg = '';
2138
-    $submit_button = '';
2139
-
2140
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2141
-
2142
-    $thumb_img_arr = array();
2143
-    $curImages = '';
2144
-
2145
-    if (isset($_REQUEST['backandedit'])) {
2146
-        global $post;
2147
-        $post = (object)$gd_session->get('listing');
2148
-        $listing_type = $post->listing_type;
2149
-        $title = $post->post_title;
2150
-        $desc = $post->post_desc;
2151
-        $post_cat = $post->post_category;
2152
-
2153
-        $kw_tags = $post->post_tags;
2154
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2155
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2156
-        global $post, $post_images;
2157
-
2158
-        $post = geodir_get_post_info($_REQUEST['pid']);
2159
-        $thumb_img_arr = geodir_get_images($post->ID);
2160
-        if ($thumb_img_arr) {
2161
-            foreach ($thumb_img_arr as $post_img) {
2162
-                $curImages .= $post_img->src . ',';
2163
-            }
2164
-        }
2131
+	global $cat_display, $post_cat, $current_user, $gd_session;
2132
+	$page_id = get_the_ID();
2133
+	$post = '';
2134
+	$title = '';
2135
+	$desc = '';
2136
+	$kw_tags = '';
2137
+	$required_msg = '';
2138
+	$submit_button = '';
2139
+
2140
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2141
+
2142
+	$thumb_img_arr = array();
2143
+	$curImages = '';
2144
+
2145
+	if (isset($_REQUEST['backandedit'])) {
2146
+		global $post;
2147
+		$post = (object)$gd_session->get('listing');
2148
+		$listing_type = $post->listing_type;
2149
+		$title = $post->post_title;
2150
+		$desc = $post->post_desc;
2151
+		$post_cat = $post->post_category;
2152
+
2153
+		$kw_tags = $post->post_tags;
2154
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2155
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2156
+		global $post, $post_images;
2157
+
2158
+		$post = geodir_get_post_info($_REQUEST['pid']);
2159
+		$thumb_img_arr = geodir_get_images($post->ID);
2160
+		if ($thumb_img_arr) {
2161
+			foreach ($thumb_img_arr as $post_img) {
2162
+				$curImages .= $post_img->src . ',';
2163
+			}
2164
+		}
2165 2165
 
2166
-        $listing_type = $post->post_type;
2167
-        $title = $post->post_title;
2168
-        $desc = $post->post_content;
2169
-        $kw_tags = $post->post_tags;
2170
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2171
-    } else {
2172
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2173
-    }
2166
+		$listing_type = $post->post_type;
2167
+		$title = $post->post_title;
2168
+		$desc = $post->post_content;
2169
+		$kw_tags = $post->post_tags;
2170
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2171
+	} else {
2172
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2173
+	}
2174 2174
 
2175
-    if ($current_user->ID != '0') {
2176
-        $user_login = true;
2177
-    }
2175
+	if ($current_user->ID != '0') {
2176
+		$user_login = true;
2177
+	}
2178 2178
 
2179
-    $post_type_info = geodir_get_posttype_info($listing_type);
2179
+	$post_type_info = geodir_get_posttype_info($listing_type);
2180 2180
 
2181
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2181
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2182 2182
 
2183
-    ?>
2183
+	?>
2184 2184
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2185 2185
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2186 2186
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2191,103 +2191,103 @@  discard block
 block discarded – undo
2191 2191
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2192 2192
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2193 2193
         <?php
2194
-        } 
2195
-        /**
2196
-         * Called at the very top of the add listing page form for frontend.
2197
-         *
2198
-         * This is called just before the "Enter Listing Details" text.
2199
-         *
2200
-         * @since 1.0.0
2201
-         */
2202
-        do_action('geodir_before_detail_fields');
2203
-        ?>
2194
+		} 
2195
+		/**
2196
+		 * Called at the very top of the add listing page form for frontend.
2197
+		 *
2198
+		 * This is called just before the "Enter Listing Details" text.
2199
+		 *
2200
+		 * @since 1.0.0
2201
+		 */
2202
+		do_action('geodir_before_detail_fields');
2203
+		?>
2204 2204
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2205 2205
         <?php
2206
-        /**
2207
-         * Called at the top of the add listing page form for frontend.
2208
-         *
2209
-         * This is called after the "Enter Listing Details" text.
2210
-         *
2211
-         * @since 1.0.0
2212
-         */
2213
-        do_action('geodir_before_main_form_fields');
2214
-        ?>
2206
+		/**
2207
+		 * Called at the top of the add listing page form for frontend.
2208
+		 *
2209
+		 * This is called after the "Enter Listing Details" text.
2210
+		 *
2211
+		 * @since 1.0.0
2212
+		 */
2213
+		do_action('geodir_before_main_form_fields');
2214
+		?>
2215 2215
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2216 2216
             <label><?php
2217
-                /**
2218
-                 * Filter the add listing page title input label.
2219
-                 *
2220
-                 * @since 1.6.11
2221
-                 * @param string $title The title to be output.
2222
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2223
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2224
-                 */
2225
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2217
+				/**
2218
+				 * Filter the add listing page title input label.
2219
+				 *
2220
+				 * @since 1.6.11
2221
+				 * @param string $title The title to be output.
2222
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2223
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2224
+				 */
2225
+				echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2226 2226
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2227 2227
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2228 2228
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2229 2229
         </div>
2230 2230
         <?php
2231
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2232
-
2233
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2234
-        $desc_limit = '';
2235
-        /**
2236
-         * Filter the add listing description field character limit number.
2237
-         *
2238
-         * @since 1.0.0
2239
-         * @param int $desc_limit The amount of characters to limit the description to.
2240
-         */
2241
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2242
-        /**
2243
-         * Filter the add listing description field text.
2244
-         *
2245
-         * @since 1.0.0
2246
-         * @param string $desc The text for the description field.
2247
-         * @param int $desc_limit The character limit number if any.
2248
-         */
2249
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2250
-        $desc_limit_msg = '';
2251
-        /**
2252
-         * Filter the add listing description limit message.
2253
-         *
2254
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2255
-         *
2256
-         * @since 1.0.0
2257
-         * @param string $desc_limit_msg The limit message string if any.
2258
-         * @param int $desc_limit The character limit numer if any.
2259
-         */
2260
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2231
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2232
+
2233
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2234
+		$desc_limit = '';
2235
+		/**
2236
+		 * Filter the add listing description field character limit number.
2237
+		 *
2238
+		 * @since 1.0.0
2239
+		 * @param int $desc_limit The amount of characters to limit the description to.
2240
+		 */
2241
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2242
+		/**
2243
+		 * Filter the add listing description field text.
2244
+		 *
2245
+		 * @since 1.0.0
2246
+		 * @param string $desc The text for the description field.
2247
+		 * @param int $desc_limit The character limit number if any.
2248
+		 */
2249
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2250
+		$desc_limit_msg = '';
2251
+		/**
2252
+		 * Filter the add listing description limit message.
2253
+		 *
2254
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2255
+		 *
2256
+		 * @since 1.0.0
2257
+		 * @param string $desc_limit_msg The limit message string if any.
2258
+		 * @param int $desc_limit The character limit numer if any.
2259
+		 */
2260
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2261 2261
         
2262
-        $desc_class = '';
2263
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2264
-            /**
2265
-             * Called on the add listing page form for frontend just before the description field.
2266
-             *
2267
-             * @since 1.0.0
2268
-             */
2269
-            do_action('geodir_before_description_field');
2262
+		$desc_class = '';
2263
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2264
+			/**
2265
+			 * Called on the add listing page form for frontend just before the description field.
2266
+			 *
2267
+			 * @since 1.0.0
2268
+			 */
2269
+			do_action('geodir_before_description_field');
2270 2270
             
2271
-            $desc_class = ' required_field';
2272
-        } else {
2273
-            $desc_class = ' hidden';
2274
-        }
2275
-        ?>
2271
+			$desc_class = ' required_field';
2272
+		} else {
2273
+			$desc_class = ' hidden';
2274
+		}
2275
+		?>
2276 2276
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2277 2277
             <label><?php
2278
-                /**
2279
-                 * Filter the add listing page description input label.
2280
-                 *
2281
-                 * @since 1.6.11
2282
-                 * @param string $title The title to be output.
2283
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2284
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2285
-                 */
2286
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2278
+				/**
2279
+				 * Filter the add listing page description input label.
2280
+				 *
2281
+				 * @since 1.6.11
2282
+				 * @param string $title The title to be output.
2283
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2284
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2285
+				 */
2286
+				echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2287 2287
             <?php
2288
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2289
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2290
-            ?>
2288
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2289
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2290
+			?>
2291 2291
                 <div class="editor" field_id="post_desc" field_type="editor">
2292 2292
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2293 2293
                 </div>
@@ -2301,56 +2301,56 @@  discard block
 block discarded – undo
2301 2301
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2302 2302
         </div>
2303 2303
         <?php
2304
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2305
-            /**
2306
-             * Called on the add listing page form for frontend just after the description field.
2307
-             *
2308
-             * @since 1.0.0
2309
-             */
2310
-            do_action('geodir_after_description_field');
2311
-        }
2304
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2305
+			/**
2306
+			 * Called on the add listing page form for frontend just after the description field.
2307
+			 *
2308
+			 * @since 1.0.0
2309
+			 */
2310
+			do_action('geodir_after_description_field');
2311
+		}
2312 2312
         
2313
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2314
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2315
-        $kw_tags_msg = TAGKW_MSG;
2316
-        /**
2317
-         * Filter the add listing tags character limit.
2318
-         *
2319
-         * @since 1.0.0
2320
-         * @param int $kw_tags_count The character count limit if any.
2321
-         */
2322
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2323
-        /**
2324
-         * Filter the add listing tags field value.
2325
-         *
2326
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2327
-         *
2328
-         * @since 1.0.0
2329
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2330
-         * @param int $kw_tags_count The character count limit if any.
2331
-         */
2332
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2333
-        /**
2334
-         * Filter the add listing tags field message text.
2335
-         *
2336
-         * @since 1.0.0
2337
-         * @param string $kw_tags_msg The message shown under the field.
2338
-         * @param int $kw_tags_count The character count limit if any.
2339
-         */
2340
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2313
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2314
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2315
+		$kw_tags_msg = TAGKW_MSG;
2316
+		/**
2317
+		 * Filter the add listing tags character limit.
2318
+		 *
2319
+		 * @since 1.0.0
2320
+		 * @param int $kw_tags_count The character count limit if any.
2321
+		 */
2322
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2323
+		/**
2324
+		 * Filter the add listing tags field value.
2325
+		 *
2326
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2327
+		 *
2328
+		 * @since 1.0.0
2329
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2330
+		 * @param int $kw_tags_count The character count limit if any.
2331
+		 */
2332
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2333
+		/**
2334
+		 * Filter the add listing tags field message text.
2335
+		 *
2336
+		 * @since 1.0.0
2337
+		 * @param string $kw_tags_msg The message shown under the field.
2338
+		 * @param int $kw_tags_count The character count limit if any.
2339
+		 */
2340
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2341 2341
         
2342
-        $tags_class = '';
2343
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2344
-            /**
2345
-             * Called on the add listing page form for frontend just before the tags field.
2346
-             *
2347
-             * @since 1.0.0
2348
-             */
2349
-            do_action('geodir_before_listing_tags_field');
2350
-        } else {
2351
-            $tags_class = ' hidden';
2352
-        }
2353
-        ?>
2342
+		$tags_class = '';
2343
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2344
+			/**
2345
+			 * Called on the add listing page form for frontend just before the tags field.
2346
+			 *
2347
+			 * @since 1.0.0
2348
+			 */
2349
+			do_action('geodir_before_listing_tags_field');
2350
+		} else {
2351
+			$tags_class = ' hidden';
2352
+		}
2353
+		?>
2354 2354
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2355 2355
             <label><?php echo TAGKW_TEXT; ?></label>
2356 2356
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2358,90 +2358,90 @@  discard block
 block discarded – undo
2358 2358
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2359 2359
         </div>
2360 2360
         <?php
2361
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2362
-            /**
2363
-             * Called on the add listing page form for frontend just after the tags field.
2364
-             *
2365
-             * @since 1.0.0
2366
-             */
2367
-            do_action('geodir_after_listing_tags_field');
2368
-        }
2361
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2362
+			/**
2363
+			 * Called on the add listing page form for frontend just after the tags field.
2364
+			 *
2365
+			 * @since 1.0.0
2366
+			 */
2367
+			do_action('geodir_after_listing_tags_field');
2368
+		}
2369 2369
         
2370
-        $package_info = array();
2371
-        $package_info = geodir_post_package_info($package_info, $post);
2370
+		$package_info = array();
2371
+		$package_info = geodir_post_package_info($package_info, $post);
2372 2372
         
2373
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2373
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2374 2374
         
2375
-        // adjust values here
2376
-        $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
2377
-
2378
-        $multiple = true; // allow multiple files upload
2375
+		// adjust values here
2376
+		$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
2379 2377
 
2380
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2378
+		$multiple = true; // allow multiple files upload
2381 2379
 
2382
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2380
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2383 2381
 
2384
-        $thumb_img_arr = array();
2385
-        $totImg = 0;
2386
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2387
-            $post = (object)$gd_session->get('listing');
2388
-            if (isset($post->post_images))
2389
-                $curImages = trim($post->post_images, ",");
2382
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2390 2383
 
2384
+		$thumb_img_arr = array();
2385
+		$totImg = 0;
2386
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2387
+			$post = (object)$gd_session->get('listing');
2388
+			if (isset($post->post_images))
2389
+				$curImages = trim($post->post_images, ",");
2391 2390
 
2392
-            if ($curImages != '') {
2393
-                $curImages_array = explode(',', $curImages);
2394
-                $totImg = count($curImages_array);
2395
-            }
2396 2391
 
2397
-            $listing_type = $post->listing_type;
2392
+			if ($curImages != '') {
2393
+				$curImages_array = explode(',', $curImages);
2394
+				$totImg = count($curImages_array);
2395
+			}
2398 2396
 
2399
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2400
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2401
-            $listing_type = $post->post_type;
2402
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2397
+			$listing_type = $post->listing_type;
2403 2398
 
2404
-        } else {
2405
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2406
-        }
2399
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2400
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2401
+			$listing_type = $post->post_type;
2402
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2407 2403
 
2404
+		} else {
2405
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2406
+		}
2408 2407
 
2409
-        if (!empty($thumb_img_arr)) {
2410
-            foreach ($thumb_img_arr as $img) {
2411
-                //$curImages = $img->src.",";
2412
-            }
2413 2408
 
2414
-            $totImg = count((array)$thumb_img_arr);
2415
-        }
2409
+		if (!empty($thumb_img_arr)) {
2410
+			foreach ($thumb_img_arr as $img) {
2411
+				//$curImages = $img->src.",";
2412
+			}
2416 2413
 
2417
-        if ($curImages != '')
2418
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2419
-        else
2420
-            $svalue = '';
2421
-
2422
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2423
-        $show_image_input_box = ($image_limit != '0');
2424
-        /**
2425
-         * Filter to be able to show/hide the image upload section of the add listing form.
2426
-         *
2427
-         * @since 1.0.0
2428
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2429
-         * @param string $listing_type The custom post type slug.
2430
-         */
2431
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2432
-        if ($show_image_input_box) {
2433
-            ?>
2414
+			$totImg = count((array)$thumb_img_arr);
2415
+		}
2416
+
2417
+		if ($curImages != '')
2418
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2419
+		else
2420
+			$svalue = '';
2421
+
2422
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2423
+		$show_image_input_box = ($image_limit != '0');
2424
+		/**
2425
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2426
+		 *
2427
+		 * @since 1.0.0
2428
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2429
+		 * @param string $listing_type The custom post type slug.
2430
+		 */
2431
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2432
+		if ($show_image_input_box) {
2433
+			?>
2434 2434
 
2435 2435
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2436 2436
                 <?php if ($image_limit == 1) {
2437
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2438
-                } ?>
2437
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2438
+				} ?>
2439 2439
                 <?php if ($image_limit > 1) {
2440
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2441
-                } ?>
2440
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2441
+				} ?>
2442 2442
                 <?php if ($image_limit == '') {
2443
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2444
-                } ?>
2443
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2444
+				} ?>
2445 2445
             </h5>
2446 2446
 
2447 2447
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2479,12 +2479,12 @@  discard block
 block discarded – undo
2479 2479
         <?php } ?>
2480 2480
 
2481 2481
         <?php
2482
-        /**
2483
-         * Called on the add listing page form for frontend just after the image upload field.
2484
-         *
2485
-         * @since 1.0.0
2486
-         */
2487
-        do_action('geodir_after_main_form_fields');?>
2482
+		/**
2483
+		 * Called on the add listing page form for frontend just after the image upload field.
2484
+		 *
2485
+		 * @since 1.0.0
2486
+		 */
2487
+		do_action('geodir_after_main_form_fields');?>
2488 2488
 
2489 2489
 
2490 2490
         <!-- add captcha code -->
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
 
2514 2514
     </form>
2515 2515
     <?php
2516
-    wp_reset_query();
2516
+	wp_reset_query();
2517 2517
 }
2518 2518
 
2519 2519
 /**
@@ -2524,7 +2524,7 @@  discard block
 block discarded – undo
2524 2524
  */
2525 2525
 function geodir_add_listing_sidebar_widget_area()
2526 2526
 {
2527
-    dynamic_sidebar('geodir_add_listing_sidebar');
2527
+	dynamic_sidebar('geodir_add_listing_sidebar');
2528 2528
 }
2529 2529
 
2530 2530
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2539,16 +2539,16 @@  discard block
 block discarded – undo
2539 2539
  */
2540 2540
 function geodir_action_add_listing_sidebar()
2541 2541
 {
2542
-    /** This action is documented in geodirectory_template_actions.php */
2543
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2544
-    /**
2545
-     * This is used to add the content to the add listing page sidebar.
2546
-     *
2547
-     * @since 1.0.0
2548
-     */
2549
-    do_action('geodir_add_listing_sidebar_inside');
2550
-    /** This action is documented in geodirectory_template_actions.php */
2551
-    do_action('geodir_sidebar_right_close', 'details-page');
2542
+	/** This action is documented in geodirectory_template_actions.php */
2543
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2544
+	/**
2545
+	 * This is used to add the content to the add listing page sidebar.
2546
+	 *
2547
+	 * @since 1.0.0
2548
+	 */
2549
+	do_action('geodir_add_listing_sidebar_inside');
2550
+	/** This action is documented in geodirectory_template_actions.php */
2551
+	do_action('geodir_sidebar_right_close', 'details-page');
2552 2552
 }
2553 2553
 
2554 2554
 ###############################################
@@ -2565,11 +2565,11 @@  discard block
 block discarded – undo
2565 2565
  */
2566 2566
 function geodir_action_geodir_sidebar_signup_top()
2567 2567
 {
2568
-    ?>
2568
+	?>
2569 2569
     <div
2570 2570
         class="<?php
2571
-        /** This action is documented in geodirectory_template_actions.php */
2572
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2571
+		/** This action is documented in geodirectory_template_actions.php */
2572
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2573 2573
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2574 2574
     </div><!-- clearfix ends here-->
2575 2575
 <?php
@@ -2588,9 +2588,9 @@  discard block
 block discarded – undo
2588 2588
 function geodir_action_signup_forms()
2589 2589
 {
2590 2590
 
2591
-    global $user_login;
2591
+	global $user_login;
2592 2592
 
2593
-    ?>
2593
+	?>
2594 2594
     <script type="text/javascript">
2595 2595
         <?php if ( $user_login ) { ?>
2596 2596
         setTimeout(function () {
@@ -2626,65 +2626,65 @@  discard block
 block discarded – undo
2626 2626
         <?php } ?>
2627 2627
     </script><?php
2628 2628
 
2629
-    global $errors;
2630
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2631
-        $errors->add('claim_login', LOGIN_CLAIM);
2632
-
2633
-    if (!empty($errors)) {
2634
-        foreach ($errors as $errorsObj) {
2635
-            foreach ($errorsObj as $key => $val) {
2636
-                for ($i = 0; $i < count($val); $i++) {
2637
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2638
-                    $registration_error_msg = 1;
2639
-                }
2640
-            }
2641
-        }
2642
-    }
2629
+	global $errors;
2630
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2631
+		$errors->add('claim_login', LOGIN_CLAIM);
2632
+
2633
+	if (!empty($errors)) {
2634
+		foreach ($errors as $errorsObj) {
2635
+			foreach ($errorsObj as $key => $val) {
2636
+				for ($i = 0; $i < count($val); $i++) {
2637
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2638
+					$registration_error_msg = 1;
2639
+				}
2640
+			}
2641
+		}
2642
+	}
2643 2643
 
2644
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2645
-        ?>
2644
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2645
+		?>
2646 2646
 
2647 2647
         <div class="login_form">
2648 2648
             <?php
2649
-            /**
2650
-             * Contains login form template.
2651
-             *
2652
-             * @since 1.0.0
2653
-             */
2654
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2649
+			/**
2650
+			 * Contains login form template.
2651
+			 *
2652
+			 * @since 1.0.0
2653
+			 */
2654
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2655 2655
         </div>
2656 2656
 
2657 2657
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2658 2658
 
2659 2659
         <div class="registration_form">
2660 2660
             <?php
2661
-            /**
2662
-             * Contains registration form template.
2663
-             *
2664
-             * @since 1.0.0
2665
-             */
2666
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2661
+			/**
2662
+			 * Contains registration form template.
2663
+			 *
2664
+			 * @since 1.0.0
2665
+			 */
2666
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2667 2667
         </div>
2668 2668
 
2669 2669
     <?php } else { ?>
2670 2670
 
2671 2671
         <div class="login_form_l">
2672 2672
             <?php
2673
-            /**
2674
-             * Contains login form template.
2675
-             *
2676
-             * @since 1.0.0
2677
-             */
2678
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2673
+			/**
2674
+			 * Contains login form template.
2675
+			 *
2676
+			 * @since 1.0.0
2677
+			 */
2678
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2679 2679
         </div>
2680 2680
         <div class="registration_form_r">
2681 2681
             <?php
2682
-            /**
2683
-             * Contains registration form template.
2684
-             *
2685
-             * @since 1.0.0
2686
-             */
2687
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2682
+			/**
2683
+			 * Contains registration form template.
2684
+			 *
2685
+			 * @since 1.0.0
2686
+			 */
2687
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2688 2688
         </div>
2689 2689
 
2690 2690
     <?php }?>
@@ -2715,66 +2715,66 @@  discard block
 block discarded – undo
2715 2715
  */
2716 2716
 function geodir_action_author_page_title()
2717 2717
 {
2718
-    global $term;
2718
+	global $term;
2719 2719
 
2720
-    $gd_post_type = geodir_get_current_posttype();
2721
-    $post_type_info = get_post_type_object($gd_post_type);
2720
+	$gd_post_type = geodir_get_current_posttype();
2721
+	$post_type_info = get_post_type_object($gd_post_type);
2722 2722
 
2723
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2724
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2725
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2726
-    }
2723
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2724
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2725
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2726
+	}
2727 2727
 
2728
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2729
-    $single_name = $post_type_info->labels->singular_name;
2728
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2729
+	$single_name = $post_type_info->labels->singular_name;
2730 2730
 
2731
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2731
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2732 2732
 
2733
-    if (!empty($term)) {
2734
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2735
-        if (!empty($current_term))
2736
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2737
-    }
2733
+	if (!empty($term)) {
2734
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2735
+		if (!empty($current_term))
2736
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2737
+	}
2738 2738
 
2739 2739
 
2740
-    if (is_search()) {
2741
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2740
+	if (is_search()) {
2741
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2742 2742
 
2743
-    }
2744
-    /** This action is documented in geodirectory_template_actions.php */
2745
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2746
-    /** This action is documented in geodirectory_template_actions.php */
2747
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2743
+	}
2744
+	/** This action is documented in geodirectory_template_actions.php */
2745
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2746
+	/** This action is documented in geodirectory_template_actions.php */
2747
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2748 2748
 
2749
-    $title = $list_title;
2750
-    if(geodir_is_page('author')){
2751
-        $gd_page = 'author';
2752
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2753
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2754
-        }else{
2755
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2756
-        }
2749
+	$title = $list_title;
2750
+	if(geodir_is_page('author')){
2751
+		$gd_page = 'author';
2752
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2753
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2754
+		}else{
2755
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2756
+		}
2757 2757
 
2758
-    }
2758
+	}
2759 2759
 
2760 2760
 
2761
-    /**
2762
-     * Filter page title to replace variables.
2763
-     *
2764
-     * @since 1.5.4
2765
-     * @param string $title The page title including variables.
2766
-     * @param string $gd_page The GeoDirectory page type if any.
2767
-     */
2768
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2761
+	/**
2762
+	 * Filter page title to replace variables.
2763
+	 *
2764
+	 * @since 1.5.4
2765
+	 * @param string $title The page title including variables.
2766
+	 * @param string $gd_page The GeoDirectory page type if any.
2767
+	 */
2768
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2769 2769
 
2770
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2771
-        /**
2772
-         * Filter the author page title text.
2773
-         *
2774
-         * @since 1.0.0
2775
-         * @param string $list_title The title for the page.
2776
-         */
2777
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2770
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2771
+		/**
2772
+		 * Filter the author page title text.
2773
+		 *
2774
+		 * @since 1.0.0
2775
+		 * @param string $list_title The title for the page.
2776
+		 */
2777
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2778 2778
 }
2779 2779
 
2780 2780
 
@@ -2792,11 +2792,11 @@  discard block
 block discarded – undo
2792 2792
  */
2793 2793
 function geodir_action_geodir_sidebar_author_top()
2794 2794
 {
2795
-    if (get_option('geodir_show_author_top_section')) { ?>
2795
+	if (get_option('geodir_show_author_top_section')) { ?>
2796 2796
         <div
2797 2797
             class="<?php
2798
-            /** This action is documented in geodirectory_template_actions.php */
2799
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2798
+			/** This action is documented in geodirectory_template_actions.php */
2799
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2800 2800
             <?php dynamic_sidebar('geodir_author_top'); ?>
2801 2801
         </div><!-- clearfix ends here-->
2802 2802
     <?php }
@@ -2812,7 +2812,7 @@  discard block
 block discarded – undo
2812 2812
  */
2813 2813
 function geodir_author_left_section()
2814 2814
 {
2815
-    if (get_option('geodir_show_author_left_section')) { ?>
2815
+	if (get_option('geodir_show_author_left_section')) { ?>
2816 2816
         <div class="geodir-content-left geodir-sidebar-wrap">
2817 2817
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2818 2818
         </div><!-- end geodir-content-left -->
@@ -2833,19 +2833,19 @@  discard block
 block discarded – undo
2833 2833
  */
2834 2834
 function geodir_action_author_sidebar_left()
2835 2835
 {
2836
-    if (get_option('geodir_show_author_left_section')) {
2836
+	if (get_option('geodir_show_author_left_section')) {
2837 2837
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2838
-        /** This action is documented in geodirectory_template_actions.php */
2839
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2840
-        /**
2841
-         * This is used to add the content to the author page left sidebar (if active).
2842
-         *
2843
-         * @since 1.0.0
2844
-         */
2845
-        do_action('geodir_author_sidebar_left_inside');
2846
-        /** This action is documented in geodirectory_template_actions.php */
2847
-        do_action('geodir_sidebar_left_close', 'author-page');
2848
-    }
2838
+		/** This action is documented in geodirectory_template_actions.php */
2839
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2840
+		/**
2841
+		 * This is used to add the content to the author page left sidebar (if active).
2842
+		 *
2843
+		 * @since 1.0.0
2844
+		 */
2845
+		do_action('geodir_author_sidebar_left_inside');
2846
+		/** This action is documented in geodirectory_template_actions.php */
2847
+		do_action('geodir_sidebar_left_close', 'author-page');
2848
+	}
2849 2849
 }
2850 2850
 
2851 2851
 /**
@@ -2858,7 +2858,7 @@  discard block
 block discarded – undo
2858 2858
  */
2859 2859
 function geodir_author_right_section()
2860 2860
 {
2861
-    if (get_option('geodir_show_author_right_section')) { ?>
2861
+	if (get_option('geodir_show_author_right_section')) { ?>
2862 2862
         <div class="geodir-content-right geodir-sidebar-wrap">
2863 2863
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2864 2864
         </div><!-- end geodir-content-right -->
@@ -2878,18 +2878,18 @@  discard block
 block discarded – undo
2878 2878
  */
2879 2879
 function geodir_action_author_sidebar_right()
2880 2880
 {
2881
-    if (get_option('geodir_show_author_right_section')) {
2882
-        /** This action is documented in geodirectory_template_actions.php */
2883
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2884
-        /**
2885
-         * This is used to add the content to the author page right sidebar (if active).
2886
-         *
2887
-         * @since 1.0.0
2888
-         */
2889
-        do_action('geodir_author_sidebar_right_inside');
2890
-        /** This action is documented in geodirectory_template_actions.php */
2891
-        do_action('geodir_sidebar_right_close', 'author-page');
2892
-    }
2881
+	if (get_option('geodir_show_author_right_section')) {
2882
+		/** This action is documented in geodirectory_template_actions.php */
2883
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2884
+		/**
2885
+		 * This is used to add the content to the author page right sidebar (if active).
2886
+		 *
2887
+		 * @since 1.0.0
2888
+		 */
2889
+		do_action('geodir_author_sidebar_right_inside');
2890
+		/** This action is documented in geodirectory_template_actions.php */
2891
+		do_action('geodir_sidebar_right_close', 'author-page');
2892
+	}
2893 2893
 }
2894 2894
 
2895 2895
 /**
@@ -2901,14 +2901,14 @@  discard block
 block discarded – undo
2901 2901
  */
2902 2902
 function geodir_action_author_content_inside()
2903 2903
 {
2904
-    global $gridview_columns;
2905
-    $listing_view = get_option('geodir_author_view');
2906
-    if (strstr($listing_view, 'gridview')) {
2907
-        $gridview_columns = $listing_view;
2908
-        $listing_view_exp = explode('_', $listing_view);
2909
-        $listing_view = $listing_view_exp[0];
2910
-    }
2911
-    geodir_get_template_part('listing', 'listview');
2904
+	global $gridview_columns;
2905
+	$listing_view = get_option('geodir_author_view');
2906
+	if (strstr($listing_view, 'gridview')) {
2907
+		$gridview_columns = $listing_view;
2908
+		$listing_view_exp = explode('_', $listing_view);
2909
+		$listing_view = $listing_view_exp[0];
2910
+	}
2911
+	geodir_get_template_part('listing', 'listview');
2912 2912
 }
2913 2913
 
2914 2914
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2923,22 +2923,22 @@  discard block
 block discarded – undo
2923 2923
  */
2924 2924
 function geodir_action_author_content()
2925 2925
 {
2926
-    /** This action is documented in geodirectory_template_actions.php */
2927
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2928
-    echo '<div class="clearfix">';
2929
-    /** This action is documented in geodirectory_template_actions.php */
2930
-    do_action('geodir_before_listing');
2931
-    echo '</div>';
2932
-    /**
2933
-     * This is used to add the content to the author page main content.
2934
-     *
2935
-     * @since 1.0.0
2936
-     */
2937
-    do_action('geodir_author_content_inside');
2938
-    /** This action is documented in geodirectory_template_actions.php */
2939
-    do_action('geodir_after_listing');
2940
-    /** This action is documented in geodirectory_template_actions.php */
2941
-    do_action('geodir_main_content_close', 'author-page');
2926
+	/** This action is documented in geodirectory_template_actions.php */
2927
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2928
+	echo '<div class="clearfix">';
2929
+	/** This action is documented in geodirectory_template_actions.php */
2930
+	do_action('geodir_before_listing');
2931
+	echo '</div>';
2932
+	/**
2933
+	 * This is used to add the content to the author page main content.
2934
+	 *
2935
+	 * @since 1.0.0
2936
+	 */
2937
+	do_action('geodir_author_content_inside');
2938
+	/** This action is documented in geodirectory_template_actions.php */
2939
+	do_action('geodir_after_listing');
2940
+	/** This action is documented in geodirectory_template_actions.php */
2941
+	do_action('geodir_main_content_close', 'author-page');
2942 2942
 }
2943 2943
 
2944 2944
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2952,11 +2952,11 @@  discard block
 block discarded – undo
2952 2952
  */
2953 2953
 function geodir_action_sidebar_author_bottom_section()
2954 2954
 {
2955
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2955
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2956 2956
         <div
2957 2957
             class="<?php
2958
-            /** This action is documented in geodirectory_template_actions.php */
2959
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2958
+			/** This action is documented in geodirectory_template_actions.php */
2959
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2960 2960
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2961 2961
         </div><!-- clearfix ends here-->
2962 2962
     <?php }
@@ -2975,23 +2975,23 @@  discard block
 block discarded – undo
2975 2975
  */
2976 2976
 function geodir_action_search_page_title()
2977 2977
 {
2978
-    $gd_post_type = geodir_get_current_posttype();
2979
-    $post_type_info = get_post_type_object($gd_post_type);
2978
+	$gd_post_type = geodir_get_current_posttype();
2979
+	$post_type_info = get_post_type_object($gd_post_type);
2980 2980
 
2981
-    $pt_name = '';
2982
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2981
+	$pt_name = '';
2982
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2983 2983
 
2984
-    if (is_search()) {
2985
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2984
+	if (is_search()) {
2985
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2986 2986
 
2987
-    }
2988
-    /** This action is documented in geodirectory_template_actions.php */
2989
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2990
-    /** This action is documented in geodirectory_template_actions.php */
2991
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2992
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2993
-        /** This action is documented in geodirectory_template_actions.php */
2994
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2987
+	}
2988
+	/** This action is documented in geodirectory_template_actions.php */
2989
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2990
+	/** This action is documented in geodirectory_template_actions.php */
2991
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2992
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2993
+		/** This action is documented in geodirectory_template_actions.php */
2994
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2995 2995
 }
2996 2996
 
2997 2997
 // action for adding the listings page top widget area
@@ -3007,11 +3007,11 @@  discard block
 block discarded – undo
3007 3007
  */
3008 3008
 function geodir_action_geodir_sidebar_search_top()
3009 3009
 {
3010
-    if (get_option('geodir_show_search_top_section')) { ?>
3010
+	if (get_option('geodir_show_search_top_section')) { ?>
3011 3011
         <div
3012 3012
             class="<?php
3013
-            /** This action is documented in geodirectory_template_actions.php */
3014
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3013
+			/** This action is documented in geodirectory_template_actions.php */
3014
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3015 3015
             <?php dynamic_sidebar('geodir_search_top'); ?>
3016 3016
         </div><!-- clearfix ends here-->
3017 3017
     <?php }
@@ -3027,7 +3027,7 @@  discard block
 block discarded – undo
3027 3027
  */
3028 3028
 function geodir_search_left_section()
3029 3029
 {
3030
-    if (get_option('geodir_show_search_left_section')) { ?>
3030
+	if (get_option('geodir_show_search_left_section')) { ?>
3031 3031
         <div class="geodir-content-left geodir-sidebar-wrap">
3032 3032
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3033 3033
         </div><!-- end geodir-content-left -->
@@ -3047,19 +3047,19 @@  discard block
 block discarded – undo
3047 3047
  */
3048 3048
 function geodir_action_search_sidebar_left()
3049 3049
 {
3050
-    if (get_option('geodir_show_search_left_section')) {
3050
+	if (get_option('geodir_show_search_left_section')) {
3051 3051
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3052
-        /** This action is documented in geodirectory_template_actions.php */
3053
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3054
-        /**
3055
-         * This is used to add the content to the search page left sidebar (if active).
3056
-         *
3057
-         * @since 1.0.0
3058
-         */
3059
-        do_action('geodir_search_sidebar_left_inside');
3060
-        /** This action is documented in geodirectory_template_actions.php */
3061
-        do_action('geodir_sidebar_left_close', 'search-page');
3062
-    }
3052
+		/** This action is documented in geodirectory_template_actions.php */
3053
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3054
+		/**
3055
+		 * This is used to add the content to the search page left sidebar (if active).
3056
+		 *
3057
+		 * @since 1.0.0
3058
+		 */
3059
+		do_action('geodir_search_sidebar_left_inside');
3060
+		/** This action is documented in geodirectory_template_actions.php */
3061
+		do_action('geodir_sidebar_left_close', 'search-page');
3062
+	}
3063 3063
 }
3064 3064
 
3065 3065
 /**
@@ -3072,7 +3072,7 @@  discard block
 block discarded – undo
3072 3072
  */
3073 3073
 function geodir_search_right_section()
3074 3074
 {
3075
-    if (get_option('geodir_show_search_right_section')) { ?>
3075
+	if (get_option('geodir_show_search_right_section')) { ?>
3076 3076
         <div class="geodir-content-right geodir-sidebar-wrap">
3077 3077
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3078 3078
         </div><!-- end geodir-content-right -->
@@ -3092,18 +3092,18 @@  discard block
 block discarded – undo
3092 3092
  */
3093 3093
 function geodir_action_search_sidebar_right()
3094 3094
 {
3095
-    if (get_option('geodir_show_search_right_section')) {
3096
-        /** This action is documented in geodirectory_template_actions.php */
3097
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3098
-        /**
3099
-         * This is used to add the content to the search page right sidebar (if active).
3100
-         *
3101
-         * @since 1.0.0
3102
-         */
3103
-        do_action('geodir_search_sidebar_right_inside');
3104
-        /** This action is documented in geodirectory_template_actions.php */
3105
-        do_action('geodir_sidebar_right_close', 'search-page');
3106
-    }
3095
+	if (get_option('geodir_show_search_right_section')) {
3096
+		/** This action is documented in geodirectory_template_actions.php */
3097
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3098
+		/**
3099
+		 * This is used to add the content to the search page right sidebar (if active).
3100
+		 *
3101
+		 * @since 1.0.0
3102
+		 */
3103
+		do_action('geodir_search_sidebar_right_inside');
3104
+		/** This action is documented in geodirectory_template_actions.php */
3105
+		do_action('geodir_sidebar_right_close', 'search-page');
3106
+	}
3107 3107
 }
3108 3108
 
3109 3109
 
@@ -3118,11 +3118,11 @@  discard block
 block discarded – undo
3118 3118
  */
3119 3119
 function geodir_action_sidebar_search_bottom_section()
3120 3120
 {
3121
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3121
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3122 3122
         <div
3123 3123
             class="<?php
3124
-            /** This action is documented in geodirectory_template_actions.php */
3125
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3124
+			/** This action is documented in geodirectory_template_actions.php */
3125
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3126 3126
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3127 3127
         </div><!-- clearfix ends here-->
3128 3128
     <?php }
@@ -3137,14 +3137,14 @@  discard block
 block discarded – undo
3137 3137
  */
3138 3138
 function geodir_action_search_content_inside()
3139 3139
 {
3140
-    global $gridview_columns;
3141
-    $listing_view = get_option('geodir_search_view');
3142
-    if (strstr($listing_view, 'gridview')) {
3143
-        $gridview_columns = $listing_view;
3144
-        $listing_view_exp = explode('_', $listing_view);
3145
-        $listing_view = $listing_view_exp[0];
3146
-    }
3147
-    geodir_get_template_part('listing', 'listview');
3140
+	global $gridview_columns;
3141
+	$listing_view = get_option('geodir_search_view');
3142
+	if (strstr($listing_view, 'gridview')) {
3143
+		$gridview_columns = $listing_view;
3144
+		$listing_view_exp = explode('_', $listing_view);
3145
+		$listing_view = $listing_view_exp[0];
3146
+	}
3147
+	geodir_get_template_part('listing', 'listview');
3148 3148
 }
3149 3149
 
3150 3150
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3160,22 +3160,22 @@  discard block
 block discarded – undo
3160 3160
  */
3161 3161
 function geodir_action_search_content()
3162 3162
 {
3163
-    /** This action is documented in geodirectory_template_actions.php */
3164
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3165
-    echo '<div class="clearfix">';
3166
-    /** This action is documented in geodirectory_template_actions.php */
3167
-    do_action('geodir_before_listing');
3168
-    echo '</div>';
3169
-    /**
3170
-     * This is used to add the content to the search page main content.
3171
-     *
3172
-     * @since 1.0.0
3173
-     */
3174
-    do_action('geodir_search_content_inside');
3175
-    /** This action is documented in geodirectory_template_actions.php */
3176
-    do_action('geodir_after_listing');
3177
-    /** This action is documented in geodirectory_template_actions.php */
3178
-    do_action('geodir_main_content_close', 'search-page');
3163
+	/** This action is documented in geodirectory_template_actions.php */
3164
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3165
+	echo '<div class="clearfix">';
3166
+	/** This action is documented in geodirectory_template_actions.php */
3167
+	do_action('geodir_before_listing');
3168
+	echo '</div>';
3169
+	/**
3170
+	 * This is used to add the content to the search page main content.
3171
+	 *
3172
+	 * @since 1.0.0
3173
+	 */
3174
+	do_action('geodir_search_content_inside');
3175
+	/** This action is documented in geodirectory_template_actions.php */
3176
+	do_action('geodir_after_listing');
3177
+	/** This action is documented in geodirectory_template_actions.php */
3178
+	do_action('geodir_main_content_close', 'search-page');
3179 3179
 }
3180 3180
 
3181 3181
 ###############################################
@@ -3198,11 +3198,11 @@  discard block
 block discarded – undo
3198 3198
  */
3199 3199
 function geodir_action_geodir_sidebar_home_top()
3200 3200
 {
3201
-    if (get_option('geodir_show_home_top_section')) { ?>
3201
+	if (get_option('geodir_show_home_top_section')) { ?>
3202 3202
         <div
3203 3203
             class="<?php
3204
-            /** This action is documented in geodirectory_template_actions.php */
3205
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3204
+			/** This action is documented in geodirectory_template_actions.php */
3205
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3206 3206
             <?php dynamic_sidebar('geodir_home_top'); ?>
3207 3207
         </div><!-- clearfix ends here-->
3208 3208
     <?php }
@@ -3218,7 +3218,7 @@  discard block
 block discarded – undo
3218 3218
  */
3219 3219
 function geodir_home_left_section()
3220 3220
 {
3221
-    if (get_option('geodir_show_home_left_section')) { ?>
3221
+	if (get_option('geodir_show_home_left_section')) { ?>
3222 3222
         <div class="geodir-content-left geodir-sidebar-wrap">
3223 3223
             <?php dynamic_sidebar('geodir_home_left'); ?>
3224 3224
         </div><!-- end geodir-content-left -->
@@ -3240,19 +3240,19 @@  discard block
 block discarded – undo
3240 3240
  */
3241 3241
 function geodir_action_home_sidebar_left()
3242 3242
 {
3243
-    if (get_option('geodir_show_home_left_section')) {
3243
+	if (get_option('geodir_show_home_left_section')) {
3244 3244
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3245
-        /** This action is documented in geodirectory_template_actions.php */
3246
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3247
-        /**
3248
-         * This is used to add the content to the home page left sidebar (if active).
3249
-         *
3250
-         * @since 1.0.0
3251
-         */
3252
-        do_action('geodir_home_sidebar_left_inside');
3253
-        /** This action is documented in geodirectory_template_actions.php */
3254
-        do_action('geodir_sidebar_left_close', 'home-page');
3255
-    }
3245
+		/** This action is documented in geodirectory_template_actions.php */
3246
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3247
+		/**
3248
+		 * This is used to add the content to the home page left sidebar (if active).
3249
+		 *
3250
+		 * @since 1.0.0
3251
+		 */
3252
+		do_action('geodir_home_sidebar_left_inside');
3253
+		/** This action is documented in geodirectory_template_actions.php */
3254
+		do_action('geodir_sidebar_left_close', 'home-page');
3255
+	}
3256 3256
 }
3257 3257
 
3258 3258
 /**
@@ -3265,7 +3265,7 @@  discard block
 block discarded – undo
3265 3265
  */
3266 3266
 function geodir_home_right_section()
3267 3267
 {
3268
-    if (get_option('geodir_show_home_right_section')) { ?>
3268
+	if (get_option('geodir_show_home_right_section')) { ?>
3269 3269
         <div class="geodir-content-right geodir-sidebar-wrap">
3270 3270
             <?php dynamic_sidebar('geodir_home_right'); ?>
3271 3271
         </div><!-- end geodir-content-right -->
@@ -3286,18 +3286,18 @@  discard block
 block discarded – undo
3286 3286
  */
3287 3287
 function geodir_action_home_sidebar_right()
3288 3288
 {
3289
-    if (get_option('geodir_show_home_right_section')) {
3290
-        /** This action is documented in geodirectory_template_actions.php */
3291
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3292
-        /**
3293
-         * This is used to add the content to the home page right sidebar (if active).
3294
-         *
3295
-         * @since 1.0.0
3296
-         */
3297
-        do_action('geodir_home_sidebar_right_inside');
3298
-        /** This action is documented in geodirectory_template_actions.php */
3299
-        do_action('geodir_sidebar_right_close', 'home-page');
3300
-    }
3289
+	if (get_option('geodir_show_home_right_section')) {
3290
+		/** This action is documented in geodirectory_template_actions.php */
3291
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3292
+		/**
3293
+		 * This is used to add the content to the home page right sidebar (if active).
3294
+		 *
3295
+		 * @since 1.0.0
3296
+		 */
3297
+		do_action('geodir_home_sidebar_right_inside');
3298
+		/** This action is documented in geodirectory_template_actions.php */
3299
+		do_action('geodir_sidebar_right_close', 'home-page');
3300
+	}
3301 3301
 }
3302 3302
 
3303 3303
 /**
@@ -3308,7 +3308,7 @@  discard block
 block discarded – undo
3308 3308
  */
3309 3309
 function geodir_action_home_content_inside()
3310 3310
 {
3311
-    dynamic_sidebar('geodir_home_content');
3311
+	dynamic_sidebar('geodir_home_content');
3312 3312
 }
3313 3313
 
3314 3314
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3323,28 +3323,28 @@  discard block
 block discarded – undo
3323 3323
  */
3324 3324
 function geodir_action_home_content()
3325 3325
 {
3326
-    /** This action is documented in geodirectory_template_actions.php */
3327
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3328
-    /**
3329
-     * This called before the home page main content.
3330
-     *
3331
-     * @since 1.0.0
3332
-     */
3333
-    do_action('geodir_before_home_content');
3334
-    /**
3335
-     * This is used to add the content to the home page main content.
3336
-     *
3337
-     * @since 1.0.0
3338
-     */
3339
-    do_action('geodir_home_content_inside');
3340
-    /**
3341
-     * This is called after the homepage main content.
3342
-     *
3343
-     * @since 1.0.0
3344
-     */
3345
-    do_action('geodir_after_home_content');
3346
-    /** This action is documented in geodirectory_template_actions.php */
3347
-    do_action('geodir_main_content_close', 'home-page');
3326
+	/** This action is documented in geodirectory_template_actions.php */
3327
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3328
+	/**
3329
+	 * This called before the home page main content.
3330
+	 *
3331
+	 * @since 1.0.0
3332
+	 */
3333
+	do_action('geodir_before_home_content');
3334
+	/**
3335
+	 * This is used to add the content to the home page main content.
3336
+	 *
3337
+	 * @since 1.0.0
3338
+	 */
3339
+	do_action('geodir_home_content_inside');
3340
+	/**
3341
+	 * This is called after the homepage main content.
3342
+	 *
3343
+	 * @since 1.0.0
3344
+	 */
3345
+	do_action('geodir_after_home_content');
3346
+	/** This action is documented in geodirectory_template_actions.php */
3347
+	do_action('geodir_main_content_close', 'home-page');
3348 3348
 }
3349 3349
 
3350 3350
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3359,11 +3359,11 @@  discard block
 block discarded – undo
3359 3359
  */
3360 3360
 function geodir_action_sidebar_home_bottom_section()
3361 3361
 {
3362
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3362
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3363 3363
         <div
3364 3364
             class="<?php
3365
-            /** This action is documented in geodirectory_template_actions.php */
3366
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3365
+			/** This action is documented in geodirectory_template_actions.php */
3366
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3367 3367
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3368 3368
         </div><!-- clearfix ends here-->
3369 3369
     <?php }
@@ -3391,13 +3391,13 @@  discard block
 block discarded – undo
3391 3391
  */
3392 3392
 function geodir_filter_listing_page_title($list_title)
3393 3393
 {
3394
-    if (is_search() && trim(get_search_query()) == '') {
3395
-        $gd_post_type = geodir_get_current_posttype();
3396
-        $post_type_info = get_post_type_object($gd_post_type);
3394
+	if (is_search() && trim(get_search_query()) == '') {
3395
+		$gd_post_type = geodir_get_current_posttype();
3396
+		$post_type_info = get_post_type_object($gd_post_type);
3397 3397
 
3398
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3399
-    }
3400
-    return $list_title;
3398
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3399
+	}
3400
+	return $list_title;
3401 3401
 }
3402 3402
 
3403 3403
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3412,62 +3412,62 @@  discard block
 block discarded – undo
3412 3412
  * @param string $gd_page The geodirectory page type. Default null.
3413 3413
  */
3414 3414
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3415
-    global $post;
3416
-
3417
-    $gd_page_id = NULL;
3418
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3419
-        $gd_page_id = geodir_home_page_id();
3420
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3421
-        $gd_page_id = geodir_preview_page_id();
3422
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3423
-        $gd_page_id = geodir_add_listing_page_id();
3424
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3425
-        $gd_page_id = geodir_success_page_id();
3426
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3427
-        $gd_page_id = geodir_location_page_id();
3428
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3429
-        $gd_page_id = geodir_info_page_id();
3430
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3431
-        $gd_page_id = geodir_login_page_id();
3432
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3433
-        $gd_page_id = geodir_payment_checkout_page_id();
3434
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3435
-        $gd_page_id = geodir_payment_invoices_page_id();
3436
-    }
3437
-
3438
-    if (!$gd_page_id > 0) {
3439
-        return;
3440
-    }
3415
+	global $post;
3416
+
3417
+	$gd_page_id = NULL;
3418
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3419
+		$gd_page_id = geodir_home_page_id();
3420
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3421
+		$gd_page_id = geodir_preview_page_id();
3422
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3423
+		$gd_page_id = geodir_add_listing_page_id();
3424
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3425
+		$gd_page_id = geodir_success_page_id();
3426
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3427
+		$gd_page_id = geodir_location_page_id();
3428
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3429
+		$gd_page_id = geodir_info_page_id();
3430
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3431
+		$gd_page_id = geodir_login_page_id();
3432
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3433
+		$gd_page_id = geodir_payment_checkout_page_id();
3434
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3435
+		$gd_page_id = geodir_payment_invoices_page_id();
3436
+	}
3437
+
3438
+	if (!$gd_page_id > 0) {
3439
+		return;
3440
+	}
3441 3441
     
3442
-    $display = 'before';
3443
-    /**
3444
-     * Filter the position to display the page content.
3445
-     *
3446
-     * @since 1.6.3
3447
-     *
3448
-     * @param string $display Position to add the post content.
3449
-     * @param string $gd_page The geodirectory page type.
3450
-     */
3451
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3452
-
3453
-    if ($position !== $display) {
3454
-        return;
3455
-    }
3456
-
3457
-    $gd_post = $post;
3442
+	$display = 'before';
3443
+	/**
3444
+	 * Filter the position to display the page content.
3445
+	 *
3446
+	 * @since 1.6.3
3447
+	 *
3448
+	 * @param string $display Position to add the post content.
3449
+	 * @param string $gd_page The geodirectory page type.
3450
+	 */
3451
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3452
+
3453
+	if ($position !== $display) {
3454
+		return;
3455
+	}
3456
+
3457
+	$gd_post = $post;
3458 3458
     
3459
-    setup_postdata(get_post($gd_page_id));
3459
+	setup_postdata(get_post($gd_page_id));
3460 3460
 
3461
-    if (get_the_content()) {
3462
-        ?>
3461
+	if (get_the_content()) {
3462
+		?>
3463 3463
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3464 3464
         <?php
3465
-    }
3465
+	}
3466 3466
 
3467
-    $post = $gd_post;
3468
-    if (!empty($gd_post) && is_object($gd_post)) {
3469
-        setup_postdata($gd_post);
3470
-    }
3467
+	$post = $gd_post;
3468
+	if (!empty($gd_post) && is_object($gd_post)) {
3469
+		setup_postdata($gd_post);
3470
+	}
3471 3471
 
3472 3472
 }
3473 3473
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3474 3474
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
     //php
284 284
     if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
285
+        include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php');
286 286
     }
287 287
 
288 288
     //geodir_full_page_class
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454 454
     if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
455
+        $width_css = 'style="width:'.$width.'%;"';
456 456
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
457
+        $width_css = 'style="width:'.$width.'%;"';
458 458
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
459
+        $width_css = 'style="width:'.$width.'%;"';
460 460
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
461
+        $width_css = 'style="width:'.$width.'%;"';
462 462
     } else {
463 463
         $width_css = '';
464 464
     }
@@ -572,13 +572,13 @@  discard block
 block discarded – undo
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574 574
     if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
575
+        $width_css = 'style="width:'.$width.'%;"';
576 576
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
577
+        $width_css = 'style="width:'.$width.'%;"';
578 578
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
579
+        $width_css = 'style="width:'.$width.'%;"';
580 580
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
581
+        $width_css = 'style="width:'.$width.'%;"';
582 582
     } else {
583 583
         $width_css = '';
584 584
     }
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
         }
677 677
     }
678 678
 
679
-    $post = (object)$_REQUEST;
679
+    $post = (object) $_REQUEST;
680 680
 
681 681
 
682 682
     if (isset($post->video)) {
@@ -735,10 +735,10 @@  discard block
 block discarded – undo
735 735
 
736 736
     $json = '{';
737 737
     $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
738
+    $json .= '"t": "'.$json_title.'",';
739
+    $json .= '"lt": "'.$post_latitude.'",';
740
+    $json .= '"ln": "'.$post_longitude.'",';
741
+    $json .= '"i":"'.$term_icon.'"';
742 742
     $json .= '}';
743 743
 
744 744
     $post->marker_json = $json;
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
      * @param string $class The class to use. Default is 'entry-header'.
966 966
      */
967 967
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
968
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
                     $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020 1020
 
1021 1021
                     if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1022
+                        $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
1023 1023
                     }
1024 1024
 
1025 1025
                     if (isset($image->src)) {
@@ -1031,9 +1031,9 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
                         $image_title = isset($image->title) ? $image->title : '';
1033 1033
 
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1034
+                        $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1035
+                        $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>';
1036
+                        $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>';
1037 1037
                         $slides++;
1038 1038
                     }
1039 1039
                 }
@@ -1052,10 +1052,10 @@  discard block
 block discarded – undo
1052 1052
                 } else {
1053 1053
                     $spacer_height = ((400 - $image->height) / 2);
1054 1054
                 }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1055
+                $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+                $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1057
+                $main_slides .= '<img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+                $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
1059 1059
                 $slides++;
1060 1060
             }
1061 1061
         }// endfore
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+    global $preview, $post; ?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096 1096
     $taxonomies = array();
@@ -1099,11 +1099,11 @@  discard block
 block discarded – undo
1099 1099
 
1100 1100
     if ($preview && !$is_backend_preview) {
1101 1101
         $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1102
+        $post_taxonomy = $post_type.'category';
1103 1103
         $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104 1104
     } else {
1105 1105
         $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1106
+        $post_taxonomy = $post_type.'category';
1107 1107
     }
1108 1108
 //{	
1109 1109
     $post_type_info = get_post_type_object($post_type);
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 
1112 1112
     if (!empty($post->post_tags)) {
1113 1113
 
1114
-        if (taxonomy_exists($post_type . '_tags')):
1114
+        if (taxonomy_exists($post_type.'_tags')):
1115 1115
             $links = array();
1116 1116
             $terms = array();
1117 1117
             // to limit post tags
@@ -1138,8 +1138,8 @@  discard block
 block discarded – undo
1138 1138
                 $post_term = trim($post_term);
1139 1139
 
1140 1140
                 $priority_location = false;
1141
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1141
+                if ($insert_term = term_exists($post_term, $post_type.'_tags')) {
1142
+                    $term = get_term_by('id', $insert_term['term_id'], $post_type.'_tags');
1143 1143
                 } else {
1144 1144
                     $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145 1145
                     $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
@@ -1149,10 +1149,10 @@  discard block
 block discarded – undo
1149 1149
                     $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150 1150
                     if ($match_country || $match_region || $match_city) {
1151 1151
                         $priority_location = true;
1152
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1152
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1153 1153
                     } else {
1154
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1154
+                        $insert_term = wp_insert_term($post_term, $post_type.'_tags');
1155
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1156 1156
                     }
1157 1157
                 }
1158 1158
 
@@ -1169,12 +1169,12 @@  discard block
 block discarded – undo
1169 1169
                          * @param string $tag_link The tag link html.
1170 1170
                          * @param object $term The tag term object.
1171 1171
                          */
1172
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1173 1173
                         $links[] = $tag_link;
1174 1174
                     } else {
1175
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
+                        $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>";
1176 1176
                         /** This action is documented in geodirectory-template_actions.php */
1177
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1178 1178
                         $links[] = $tag_link;
1179 1179
                     }
1180 1180
                     $terms[] = $term;
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
             if (!isset($listing_label)) {
1185 1185
                 $listing_label = '';
1186 1186
             }
1187
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
+            $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1188 1188
         endif;
1189 1189
 
1190 1190
     }
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
                     $term = get_term_by('id', $post_term, $post_taxonomy);
1213 1213
 
1214 1214
                     if (is_object($term)) {
1215
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
+                        $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>";
1216 1216
                         /**
1217 1217
                          * Filter the category name on the details page.
1218 1218
                          *
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
                          * @param string $term_link The link html to the category.
1221 1221
                          * @param object $term The category term object.
1222 1222
                          */
1223
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
+                        $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
1224 1224
                         $links[] = $term_link;
1225 1225
                         $terms[] = $term;
1226 1226
                     }
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
         if (!isset($listing_label)) {
1239 1239
             $listing_label = '';
1240 1240
         }
1241
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1241
+        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1242 1242
 
1243 1243
     }
1244 1244
 
@@ -1251,14 +1251,14 @@  discard block
 block discarded – undo
1251 1251
      * @param string $listing_label The post type label.
1252 1252
      * @param string $listing_label The post type label with ucwords function.
1253 1253
      */
1254
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1254
+    $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
1255 1255
 
1256 1256
     if (isset($taxonomies[$post_taxonomy])) {
1257
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
+        echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>';
1258 1258
     }
1259 1259
 
1260
-    if (isset($taxonomies[$post_type . '_tags']))
1261
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1260
+    if (isset($taxonomies[$post_type.'_tags']))
1261
+        echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>';
1262 1262
 
1263 1263
     ?>
1264 1264
     </p><?php
@@ -1279,11 +1279,11 @@  discard block
 block discarded – undo
1279 1279
  * @param object $post Optional. The post object or blank.
1280 1280
  * @package GeoDirectory
1281 1281
  */
1282
-function geodir_action_details_micordata($post='')
1282
+function geodir_action_details_micordata($post = '')
1283 1283
 {
1284 1284
 
1285 1285
     global $preview;
1286
-    if(empty($post)){global $post;}
1286
+    if (empty($post)) {global $post; }
1287 1287
     if ($preview || !geodir_is_page('detail')) {
1288 1288
         return;
1289 1289
     }
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
                 "description" => $review->comment_content,
1305 1305
                 "reviewRating" => array(
1306 1306
                     "@type" => "Rating",
1307
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
+                    "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1308 1308
                     "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309 1309
                     "worstRating" => "1"
1310 1310
                 )
@@ -1332,13 +1332,13 @@  discard block
 block discarded – undo
1332 1332
     }
1333 1333
     //print_r($post);
1334 1334
     // external links
1335
-    $external_links =  array();
1335
+    $external_links = array();
1336 1336
     $external_links[] = $post->geodir_website;
1337 1337
     $external_links[] = $post->geodir_twitter;
1338 1338
     $external_links[] = $post->geodir_facebook;
1339 1339
     $external_links = array_filter($external_links);
1340 1340
 
1341
-    if(!empty($external_links)){
1341
+    if (!empty($external_links)) {
1342 1342
         $external_links = array_values($external_links);
1343 1343
     }
1344 1344
 
@@ -1348,17 +1348,17 @@  discard block
 block discarded – undo
1348 1348
 
1349 1349
     // schema type
1350 1350
     $schema_type = 'LocalBusiness';
1351
-    if(isset($post->default_category) && $post->default_category){
1351
+    if (isset($post->default_category) && $post->default_category) {
1352 1352
         $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
-        if($cat_schema){$schema_type = $cat_schema;}
1354
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1353
+        if ($cat_schema) {$schema_type = $cat_schema; }
1354
+        if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
1355 1355
     }
1356 1356
 
1357 1357
     $schema = array();
1358 1358
     $schema['@context'] = "https://schema.org";
1359 1359
     $schema['@type'] = $schema_type;
1360 1360
     $schema['name'] = $post->post_title;
1361
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1361
+    $schema['description'] = wp_strip_all_tags($post->post_content, true);
1362 1362
     $schema['telephone'] = $post->geodir_contact;
1363 1363
     $schema['url'] = $c_url;
1364 1364
     $schema['sameAs'] = $external_links;
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
         "postalCode" => $post->post_zip
1373 1373
     );
1374 1374
 
1375
-    if($post->post_latitude && $post->post_longitude) {
1375
+    if ($post->post_latitude && $post->post_longitude) {
1376 1376
         $schema['geo'] = array(
1377 1377
             "@type" => "GeoCoordinates",
1378 1378
             "latitude" => $post->post_latitude,
@@ -1380,7 +1380,7 @@  discard block
 block discarded – undo
1380 1380
         );
1381 1381
     }
1382 1382
 
1383
-    if($post_avgratings) {
1383
+    if ($post_avgratings) {
1384 1384
         $schema['aggregateRating'] = array(
1385 1385
             "@type" => "AggregateRating",
1386 1386
             "ratingValue" => $post_avgratings,
@@ -1399,10 +1399,10 @@  discard block
 block discarded – undo
1399 1399
      * @param array $schema The array of schema data to be filtered.
1400 1400
      * @param object $post The post object.
1401 1401
      */
1402
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1402
+    $schema = apply_filters('geodir_details_schema', $schema, $post);
1403 1403
 
1404 1404
 
1405
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1405
+    echo '<script type="application/ld+json">'.json_encode($schema).'</script>';
1406 1406
 
1407 1407
 
1408 1408
     $uploads = wp_upload_dir();
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
      * @param string $facebook_og The open graph html to be filtered.
1416 1416
      * @param object $post The post object.
1417 1417
      */
1418
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1418
+    echo apply_filters('geodir_details_facebook_og', $facebook_og, $post);
1419 1419
 
1420 1420
 
1421 1421
 
@@ -1438,9 +1438,9 @@  discard block
 block discarded – undo
1438 1438
     ?>
1439 1439
     <div class="geodir-pos_navigation clearfix">
1440 1440
     <div
1441
-        class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
1441
+        class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div>
1442 1442
     <div
1443
-        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div>
1443
+        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div>
1444 1444
     </div><?php
1445 1445
 }
1446 1446
 
@@ -1509,12 +1509,12 @@  discard block
 block discarded – undo
1509 1509
     $gd_post_type = geodir_get_current_posttype();
1510 1510
     $post_type_info = get_post_type_object($gd_post_type);
1511 1511
 
1512
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1512
+    $add_string_in_title = __('All', 'geodirectory').' ';
1513 1513
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1514
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1514
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
1515 1515
     }
1516 1516
 
1517
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1517
+    $list_title = $add_string_in_title.__(ucfirst($post_type_info->labels->name), 'geodirectory');
1518 1518
     $single_name = $post_type_info->labels->singular_name;
1519 1519
 
1520 1520
     $taxonomy = geodir_get_taxonomies($gd_post_type, true);
@@ -1542,12 +1542,12 @@  discard block
 block discarded – undo
1542 1542
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
1543 1543
         if (!empty($current_term)) {
1544 1544
             $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1545
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1545
+            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1546 1546
                 $location_last_char = substr($location_name, -1);
1547 1547
                 $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1548
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1548
+                $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1549 1549
             } else {
1550
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1550
+                $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1551 1551
             }
1552 1552
         } else {
1553 1553
             if (count($taxonomy) > 1) {
@@ -1555,12 +1555,12 @@  discard block
 block discarded – undo
1555 1555
 
1556 1556
                 if (!empty($current_term)) {
1557 1557
                     $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1558
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1558
+                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1559 1559
                         $location_last_char = substr($location_name, -1);
1560 1560
                         $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1561
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1561
+                        $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1562 1562
                     } else {
1563
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1563
+                        $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1564 1564
                     }
1565 1565
                 }
1566 1566
             }
@@ -1588,7 +1588,7 @@  discard block
 block discarded – undo
1588 1588
                 $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1589 1589
             }
1590 1590
 
1591
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1591
+            $list_title .= __(' in', 'geodirectory')." '".$gd_city."'";
1592 1592
         } else if ($gd_region != '') {
1593 1593
             if ($gd_region_actual != '') {
1594 1594
                 $gd_region = $gd_region_actual;
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
                 $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1599 1599
             }
1600 1600
 
1601
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1601
+            $list_title .= __(' in', 'geodirectory')." '".$gd_region."'";
1602 1602
         } else if ($gd_country != '') {
1603 1603
             if ($gd_country_actual != '') {
1604 1604
                 $gd_country = $gd_country_actual;
@@ -1608,12 +1608,12 @@  discard block
 block discarded – undo
1608 1608
                 $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1609 1609
             }
1610 1610
 
1611
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1611
+            $list_title .= __(' in', 'geodirectory')." '".$gd_country."'";
1612 1612
         }
1613 1613
     }
1614 1614
 
1615 1615
     if (is_search()) {
1616
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1616
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
1617 1617
     }
1618 1618
     /** This action is documented in geodirectory_template_actions.php */
1619 1619
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
@@ -1623,26 +1623,26 @@  discard block
 block discarded – undo
1623 1623
 
1624 1624
     $title = $list_title;
1625 1625
     $gd_page = '';
1626
-    if(geodir_is_page('pt')){
1626
+    if (geodir_is_page('pt')) {
1627 1627
         $gd_page = 'pt';
1628
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1628
+        $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1629 1629
     }
1630
-    elseif(geodir_is_page('listing')){
1630
+    elseif (geodir_is_page('listing')) {
1631 1631
         $gd_page = 'listing';
1632 1632
         global $wp_query;
1633 1633
         $current_term = $wp_query->get_queried_object();
1634
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1634
+        if (strpos($current_term->taxonomy, '_tags') !== false) {
1635 1635
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1636
-        }else{
1636
+        } else {
1637 1637
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1638 1638
         }
1639 1639
 
1640 1640
     }
1641
-    elseif(geodir_is_page('author')){
1641
+    elseif (geodir_is_page('author')) {
1642 1642
         $gd_page = 'author';
1643
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1643
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1644 1644
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1645
-        }else{
1645
+        } else {
1646 1646
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1647 1647
         }
1648 1648
 
@@ -1656,16 +1656,16 @@  discard block
 block discarded – undo
1656 1656
      * @param string $title The page title including variables.
1657 1657
      * @param string $gd_page The GeoDirectory page type if any.
1658 1658
      */
1659
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1659
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1660 1660
 
1661
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1661
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
1662 1662
         /**
1663 1663
          * Filter the listing page title.
1664 1664
          *
1665 1665
          * @since 1.0.0
1666 1666
          * @param string $list_title The title for the category page.
1667 1667
          */
1668
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1668
+        apply_filters('geodir_listing_page_title', $title).'</h1></header>';
1669 1669
 }
1670 1670
 
1671 1671
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1684,16 +1684,16 @@  discard block
 block discarded – undo
1684 1684
     $gd_post_type = geodir_get_current_posttype();
1685 1685
     if (isset($current_term->term_id) && $current_term->term_id != '') {
1686 1686
 
1687
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1687
+        $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags');
1688 1688
         $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1689 1689
         if ($term_desc && !$saved_data) {
1690 1690
             $saved_data = $term_desc;
1691 1691
         }
1692 1692
 
1693 1693
         // stop payment manager filtering content length
1694
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1695
-        if ( false !== $filter_priority ) {
1696
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1694
+        $filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1695
+        if (false !== $filter_priority) {
1696
+            remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1697 1697
         }
1698 1698
 
1699 1699
         /**
@@ -1707,14 +1707,14 @@  discard block
 block discarded – undo
1707 1707
         $cat_description = apply_filters('the_content', $saved_data);
1708 1708
 
1709 1709
 
1710
-        if ( false !== $filter_priority ) {
1711
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1710
+        if (false !== $filter_priority) {
1711
+            add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1712 1712
         }
1713 1713
 
1714 1714
         if ($cat_description) {
1715 1715
             ?>
1716 1716
 
1717
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1717
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1718 1718
         }
1719 1719
 
1720 1720
     }
@@ -1764,13 +1764,13 @@  discard block
 block discarded – undo
1764 1764
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1765 1765
 {
1766 1766
     if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1767
-        $width_css = 'style="width:' . $width . '%;"';
1767
+        $width_css = 'style="width:'.$width.'%;"';
1768 1768
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1769
-        $width_css = 'style="width:' . $width . '%;"';
1769
+        $width_css = 'style="width:'.$width.'%;"';
1770 1770
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1771
-        $width_css = 'style="width:' . $width . '%;"';
1771
+        $width_css = 'style="width:'.$width.'%;"';
1772 1772
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1773
-        $width_css = 'style="width:' . $width . '%;"';
1773
+        $width_css = 'style="width:'.$width.'%;"';
1774 1774
     } else {
1775 1775
         $width_css = '';
1776 1776
     }
@@ -2075,11 +2075,11 @@  discard block
 block discarded – undo
2075 2075
 
2076 2076
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2077 2077
 
2078
-    if(geodir_is_page('add-listing')){
2078
+    if (geodir_is_page('add-listing')) {
2079 2079
         $gd_page = 'add-listing';
2080
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2080
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2081 2081
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2082
-        }elseif(isset($listing_type)){
2082
+        }elseif (isset($listing_type)) {
2083 2083
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2084 2084
         }
2085 2085
 
@@ -2093,9 +2093,9 @@  discard block
 block discarded – undo
2093 2093
      * @param string $title The page title including variables.
2094 2094
      * @param string $gd_page The GeoDirectory page type if any.
2095 2095
      */
2096
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2096
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2097 2097
 
2098
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2098
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">';
2099 2099
     echo $title;
2100 2100
     echo '</h1></header>';
2101 2101
 }
@@ -2109,7 +2109,7 @@  discard block
 block discarded – undo
2109 2109
  */
2110 2110
 function geodir_action_add_listing_page_mandatory()
2111 2111
 {?>
2112
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2112
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2113 2113
 <?php
2114 2114
 }
2115 2115
 
@@ -2144,7 +2144,7 @@  discard block
 block discarded – undo
2144 2144
 
2145 2145
     if (isset($_REQUEST['backandedit'])) {
2146 2146
         global $post;
2147
-        $post = (object)$gd_session->get('listing');
2147
+        $post = (object) $gd_session->get('listing');
2148 2148
         $listing_type = $post->listing_type;
2149 2149
         $title = $post->post_title;
2150 2150
         $desc = $post->post_desc;
@@ -2159,7 +2159,7 @@  discard block
 block discarded – undo
2159 2159
         $thumb_img_arr = geodir_get_images($post->ID);
2160 2160
         if ($thumb_img_arr) {
2161 2161
             foreach ($thumb_img_arr as $post_img) {
2162
-                $curImages .= $post_img->src . ',';
2162
+                $curImages .= $post_img->src.',';
2163 2163
             }
2164 2164
         }
2165 2165
 
@@ -2167,7 +2167,7 @@  discard block
 block discarded – undo
2167 2167
         $title = $post->post_title;
2168 2168
         $desc = $post->post_content;
2169 2169
         $kw_tags = $post->post_tags;
2170
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2170
+        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
2171 2171
     } else {
2172 2172
         $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2173 2173
     }
@@ -2178,18 +2178,18 @@  discard block
 block discarded – undo
2178 2178
 
2179 2179
     $post_type_info = geodir_get_posttype_info($listing_type);
2180 2180
 
2181
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2181
+    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing', 'geodirectory');
2182 2182
 
2183 2183
     ?>
2184
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2185
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2186
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2184
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2185
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2186
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2187 2187
         <?php if ($page_id) { ?>
2188
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2188
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2189 2189
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2190
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2190
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2191 2191
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2192
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2192
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2193 2193
         <?php
2194 2194
         } 
2195 2195
         /**
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
          */
2202 2202
         do_action('geodir_before_detail_fields');
2203 2203
         ?>
2204
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2204
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2205 2205
         <?php
2206 2206
         /**
2207 2207
          * Called at the top of the add listing page form for frontend.
@@ -2222,10 +2222,10 @@  discard block
 block discarded – undo
2222 2222
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2223 2223
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2224 2224
                  */
2225
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2225
+                echo apply_filters('geodir_add_listing_title_label', sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span>*</span> </label>
2226 2226
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2227 2227
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2228
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2228
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2229 2229
         </div>
2230 2230
         <?php
2231 2231
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2260,7 +2260,7 @@  discard block
 block discarded – undo
2260 2260
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2261 2261
         
2262 2262
         $desc_class = '';
2263
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2263
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2264 2264
             /**
2265 2265
              * Called on the add listing page form for frontend just before the description field.
2266 2266
              *
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
             $desc_class = ' hidden';
2274 2274
         }
2275 2275
         ?>
2276
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2276
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2277 2277
             <label><?php
2278 2278
                 /**
2279 2279
                  * Filter the add listing page description input label.
@@ -2283,7 +2283,7 @@  discard block
 block discarded – undo
2283 2283
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2284 2284
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2285 2285
                  */
2286
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2286
+                echo apply_filters('geodir_add_listing_description_label', sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2287 2287
             <?php
2288 2288
             if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2289 2289
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2292,16 +2292,16 @@  discard block
 block discarded – undo
2292 2292
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2293 2293
                 </div>
2294 2294
             <?php if ($desc_limit != '') { ?>
2295
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2295
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2296 2296
             <?php } } else { ?>
2297 2297
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2298 2298
             <?php } if ($desc_limit_msg != '') { ?>
2299 2299
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2300 2300
             <?php } ?>
2301
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2301
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2302 2302
         </div>
2303 2303
         <?php
2304
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2304
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2305 2305
             /**
2306 2306
              * Called on the add listing page form for frontend just after the description field.
2307 2307
              *
@@ -2340,7 +2340,7 @@  discard block
 block discarded – undo
2340 2340
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2341 2341
         
2342 2342
         $tags_class = '';
2343
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2343
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2344 2344
             /**
2345 2345
              * Called on the add listing page form for frontend just before the tags field.
2346 2346
              *
@@ -2351,14 +2351,14 @@  discard block
 block discarded – undo
2351 2351
             $tags_class = ' hidden';
2352 2352
         }
2353 2353
         ?>
2354
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2354
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2355 2355
             <label><?php echo TAGKW_TEXT; ?></label>
2356 2356
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2357
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2358
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2357
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2358
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2359 2359
         </div>
2360 2360
         <?php
2361
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2361
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2362 2362
             /**
2363 2363
              * Called on the add listing page form for frontend just after the tags field.
2364 2364
              *
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
         $thumb_img_arr = array();
2385 2385
         $totImg = 0;
2386 2386
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2387
-            $post = (object)$gd_session->get('listing');
2387
+            $post = (object) $gd_session->get('listing');
2388 2388
             if (isset($post->post_images))
2389 2389
                 $curImages = trim($post->post_images, ",");
2390 2390
 
@@ -2397,7 +2397,7 @@  discard block
 block discarded – undo
2397 2397
             $listing_type = $post->listing_type;
2398 2398
 
2399 2399
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2400
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2400
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2401 2401
             $listing_type = $post->post_type;
2402 2402
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2403 2403
 
@@ -2411,7 +2411,7 @@  discard block
 block discarded – undo
2411 2411
                 //$curImages = $img->src.",";
2412 2412
             }
2413 2413
 
2414
-            $totImg = count((array)$thumb_img_arr);
2414
+            $totImg = count((array) $thumb_img_arr);
2415 2415
         }
2416 2416
 
2417 2417
         if ($curImages != '')
@@ -2432,15 +2432,15 @@  discard block
 block discarded – undo
2432 2432
         if ($show_image_input_box) {
2433 2433
             ?>
2434 2434
 
2435
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2435
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2436 2436
                 <?php if ($image_limit == 1) {
2437
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2437
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
2438 2438
                 } ?>
2439 2439
                 <?php if ($image_limit > 1) {
2440
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2440
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
2441 2441
                 } ?>
2442 2442
                 <?php if ($image_limit == '') {
2443
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2443
+                    echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
2444 2444
                 } ?>
2445 2445
             </h5>
2446 2446
 
@@ -2455,11 +2455,11 @@  discard block
 block discarded – undo
2455 2455
                 <div
2456 2456
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2457 2457
                     id="<?php echo $id; ?>plupload-upload-ui">
2458
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2458
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2459 2459
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2460 2460
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2461 2461
                     <span class="ajaxnonceplu"
2462
-                          id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span>
2462
+                          id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span>
2463 2463
                     <?php if ($width && $height): ?>
2464 2464
                         <span class="plupload-resize"></span>
2465 2465
                         <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span>
@@ -2472,7 +2472,7 @@  discard block
 block discarded – undo
2472 2472
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2473 2473
                 </div>
2474 2474
                 <span
2475
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2475
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2476 2476
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2477 2477
             </div>
2478 2478
 
@@ -2484,7 +2484,7 @@  discard block
 block discarded – undo
2484 2484
          *
2485 2485
          * @since 1.0.0
2486 2486
          */
2487
-        do_action('geodir_after_main_form_fields');?>
2487
+        do_action('geodir_after_main_form_fields'); ?>
2488 2488
 
2489 2489
 
2490 2490
         <!-- add captcha code -->
@@ -2495,7 +2495,7 @@  discard block
 block discarded – undo
2495 2495
         </script>
2496 2496
         <noscript>
2497 2497
             <div>
2498
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2498
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2499 2499
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2500 2500
             </div>
2501 2501
         </noscript>
@@ -2505,10 +2505,10 @@  discard block
 block discarded – undo
2505 2505
         <!-- end captcha code -->
2506 2506
 
2507 2507
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2508
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2509
-                   class="geodir_button" <?php echo $submit_button;?>/>
2508
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2509
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2510 2510
             <span class="geodir_message_note"
2511
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2511
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2512 2512
         </div>
2513 2513
 
2514 2514
     </form>
@@ -2570,7 +2570,7 @@  discard block
 block discarded – undo
2570 2570
         class="<?php
2571 2571
         /** This action is documented in geodirectory_template_actions.php */
2572 2572
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2573
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2573
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2574 2574
     </div><!-- clearfix ends here-->
2575 2575
 <?php
2576 2576
 }
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 
2593 2593
     ?>
2594 2594
     <script type="text/javascript">
2595
-        <?php if ( $user_login ) { ?>
2595
+        <?php if ($user_login) { ?>
2596 2596
         setTimeout(function () {
2597 2597
             try {
2598 2598
                 d = document.getElementById('user_pass');
@@ -2609,7 +2609,7 @@  discard block
 block discarded – undo
2609 2609
         <?php } ?>
2610 2610
     </script>
2611 2611
     <script type="text/javascript">
2612
-        <?php if ( $user_login ) { ?>
2612
+        <?php if ($user_login) { ?>
2613 2613
         setTimeout(function () {
2614 2614
             try {
2615 2615
                 d = document.getElementById('user_pass');
@@ -2634,7 +2634,7 @@  discard block
 block discarded – undo
2634 2634
         foreach ($errors as $errorsObj) {
2635 2635
             foreach ($errorsObj as $key => $val) {
2636 2636
                 for ($i = 0; $i < count($val); $i++) {
2637
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2637
+                    echo "<div class=error_msg_fix>".$val[$i].'</div>';
2638 2638
                     $registration_error_msg = 1;
2639 2639
                 }
2640 2640
             }
@@ -2651,7 +2651,7 @@  discard block
 block discarded – undo
2651 2651
              *
2652 2652
              * @since 1.0.0
2653 2653
              */
2654
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2654
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2655 2655
         </div>
2656 2656
 
2657 2657
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
@@ -2663,7 +2663,7 @@  discard block
 block discarded – undo
2663 2663
              *
2664 2664
              * @since 1.0.0
2665 2665
              */
2666
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2666
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2667 2667
         </div>
2668 2668
 
2669 2669
     <?php } else { ?>
@@ -2675,7 +2675,7 @@  discard block
 block discarded – undo
2675 2675
              *
2676 2676
              * @since 1.0.0
2677 2677
              */
2678
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2678
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2679 2679
         </div>
2680 2680
         <div class="registration_form_r">
2681 2681
             <?php
@@ -2684,7 +2684,7 @@  discard block
 block discarded – undo
2684 2684
              *
2685 2685
              * @since 1.0.0
2686 2686
              */
2687
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2687
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2688 2688
         </div>
2689 2689
 
2690 2690
     <?php }?>
@@ -2720,12 +2720,12 @@  discard block
 block discarded – undo
2720 2720
     $gd_post_type = geodir_get_current_posttype();
2721 2721
     $post_type_info = get_post_type_object($gd_post_type);
2722 2722
 
2723
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2723
+    $add_string_in_title = __('All', 'geodirectory').' ';
2724 2724
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2725
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2725
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
2726 2726
     }
2727 2727
 
2728
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2728
+    $list_title = $add_string_in_title.$post_type_info->labels->name;
2729 2729
     $single_name = $post_type_info->labels->singular_name;
2730 2730
 
2731 2731
     $taxonomy = geodir_get_taxonomies($gd_post_type);
@@ -2733,12 +2733,12 @@  discard block
 block discarded – undo
2733 2733
     if (!empty($term)) {
2734 2734
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2735 2735
         if (!empty($current_term))
2736
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2736
+            $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
2737 2737
     }
2738 2738
 
2739 2739
 
2740 2740
     if (is_search()) {
2741
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2741
+        $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2742 2742
 
2743 2743
     }
2744 2744
     /** This action is documented in geodirectory_template_actions.php */
@@ -2747,11 +2747,11 @@  discard block
 block discarded – undo
2747 2747
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2748 2748
 
2749 2749
     $title = $list_title;
2750
-    if(geodir_is_page('author')){
2750
+    if (geodir_is_page('author')) {
2751 2751
         $gd_page = 'author';
2752
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2752
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2753 2753
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2754
-        }else{
2754
+        } else {
2755 2755
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2756 2756
         }
2757 2757
 
@@ -2765,16 +2765,16 @@  discard block
 block discarded – undo
2765 2765
      * @param string $title The page title including variables.
2766 2766
      * @param string $gd_page The GeoDirectory page type if any.
2767 2767
      */
2768
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2768
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2769 2769
 
2770
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2770
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2771 2771
         /**
2772 2772
          * Filter the author page title text.
2773 2773
          *
2774 2774
          * @since 1.0.0
2775 2775
          * @param string $list_title The title for the page.
2776 2776
          */
2777
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2777
+        apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
2778 2778
 }
2779 2779
 
2780 2780
 
@@ -2979,19 +2979,19 @@  discard block
 block discarded – undo
2979 2979
     $post_type_info = get_post_type_object($gd_post_type);
2980 2980
 
2981 2981
     $pt_name = '';
2982
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2982
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
2983 2983
 
2984 2984
     if (is_search()) {
2985
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2985
+        $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2986 2986
 
2987 2987
     }
2988 2988
     /** This action is documented in geodirectory_template_actions.php */
2989 2989
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2990 2990
     /** This action is documented in geodirectory_template_actions.php */
2991 2991
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2992
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2992
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2993 2993
         /** This action is documented in geodirectory_template_actions.php */
2994
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2994
+        apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
2995 2995
 }
2996 2996
 
2997 2997
 // action for adding the listings page top widget area
@@ -3395,7 +3395,7 @@  discard block
 block discarded – undo
3395 3395
         $gd_post_type = geodir_get_current_posttype();
3396 3396
         $post_type_info = get_post_type_object($gd_post_type);
3397 3397
 
3398
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3398
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
3399 3399
     }
3400 3400
     return $list_title;
3401 3401
 }
@@ -3411,7 +3411,7 @@  discard block
 block discarded – undo
3411 3411
  * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'.
3412 3412
  * @param string $gd_page The geodirectory page type. Default null.
3413 3413
  */
3414
-function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3414
+function geodir_add_page_content($position = 'before', $gd_page = '') {
3415 3415
     global $post;
3416 3416
 
3417 3417
     $gd_page_id = NULL;
Please login to merge, or discard this patch.
geodirectory_template_tags.php 2 patches
Indentation   +329 added lines, -329 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function geodir_core_dequeue_script()
24 24
 {
25
-    wp_dequeue_script('flexslider');
25
+	wp_dequeue_script('flexslider');
26 26
 }
27 27
 
28 28
 add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100);
@@ -35,168 +35,168 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_templates_scripts()
37 37
 {
38
-    $is_detail_page = false;
39
-    $geodir_map_name = geodir_map_name();
38
+	$is_detail_page = false;
39
+	$geodir_map_name = geodir_map_name();
40 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');
41
+	if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
+		$is_detail_page = true;
43
+	}
49 44
 
50
-    $geodir_vars_data = array(
51
-        'siteurl' => get_option('siteurl'),
52
-        'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
-        'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
-        'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
-    );
45
+	wp_enqueue_script('jquery');
46
+
47
+	wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
+	wp_enqueue_script('geodirectory-script');
49
+
50
+	$geodir_vars_data = array(
51
+		'siteurl' => get_option('siteurl'),
52
+		'geodir_plugin_url' => geodir_plugin_url(),
53
+		'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
+		'geodir_ajax_url' => geodir_get_ajax_url(),
55
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
+		'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
+	);
58
+
59
+	/**
60
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
+	 *
62
+	 * This is used by addons to add JS translatable variables.
63
+	 *
64
+	 * @since 1.4.4
65
+	 * @param array $geodir_vars_data {
66
+	 *    geodir var data used by addons to add JS translatable variables.
67
+	 *
68
+	 *    @type string $siteurl Site url.
69
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
+	 *    @type int $is_rtl Checks if current locale is RTL.
73
+	 *
74
+	 * }
75
+	 */
76
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
+
78
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
+
80
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
+
83
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
+	wp_enqueue_script('geodirectory-lightbox-jquery');
85
+
86
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
+	if ($is_detail_page) {
88
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
89
+	}
58 90
 
59
-    /**
60
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
-     *
62
-     * This is used by addons to add JS translatable variables.
63
-     *
64
-     * @since 1.4.4
65
-     * @param array $geodir_vars_data {
66
-     *    geodir var data used by addons to add JS translatable variables.
67
-     *
68
-     *    @type string $siteurl Site url.
69
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
-     *    @type int $is_rtl Checks if current locale is RTL.
73
-     *
74
-     * }
75
-     */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
-
78
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
-
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
-
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
-    wp_enqueue_script('geodirectory-lightbox-jquery');
85
-
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
-    if ($is_detail_page) {
88
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
89
-    }
90
-
91
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        $map_key = "&key=" . geodir_get_map_api_key();
94
-        /**
95
-         * Filter the variables that are added to the end of the google maps script call.
96
-         *
97
-         * This i used to change things like google maps language etc.
98
-         *
99
-         * @since 1.0.0
100
-         * @param string $var The string to filter, default is empty string.
101
-         */
102
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
-        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
104
-    }
91
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
92
+		$map_lang = "&language=" . geodir_get_map_default_language();
93
+		$map_key = "&key=" . geodir_get_map_api_key();
94
+		/**
95
+		 * Filter the variables that are added to the end of the google maps script call.
96
+		 *
97
+		 * This i used to change things like google maps language etc.
98
+		 *
99
+		 * @since 1.0.0
100
+		 * @param string $var The string to filter, default is empty string.
101
+		 */
102
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
+		wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
104
+	}
105 105
     
106
-    if ($geodir_map_name == 'osm') {
107
-        // Leaflet OpenStreetMap
108
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109
-        wp_enqueue_style('geodirectory-leaflet-style');
106
+	if ($geodir_map_name == 'osm') {
107
+		// Leaflet OpenStreetMap
108
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109
+		wp_enqueue_style('geodirectory-leaflet-style');
110 110
             
111
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112
-        wp_enqueue_script('geodirectory-leaflet-script');
111
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112
+		wp_enqueue_script('geodirectory-leaflet-script');
113 113
         
114
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
114
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
116 116
         
117
-        if ($is_detail_page) {
118
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119
-            wp_enqueue_style('geodirectory-leaflet-routing-style');
117
+		if ($is_detail_page) {
118
+			wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119
+			wp_enqueue_style('geodirectory-leaflet-routing-style');
120 120
                 
121
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122
-            wp_enqueue_script('geodirectory-leaflet-routing-script');
123
-        }
124
-    }
125
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
121
+			wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122
+			wp_enqueue_script('geodirectory-leaflet-routing-script');
123
+		}
124
+	}
125
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
126 126
     
127
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
128
-    wp_enqueue_script('geodirectory-goMap-script');
129
-
130
-
131
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132
-    wp_enqueue_script('chosen');
133
-
134
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135
-    wp_enqueue_script('geodirectory-choose-ajax');
136
-
137
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138
-
139
-    if (is_page() && geodir_is_page('add-listing')) {
140
-        // SCRIPT FOR UPLOAD
141
-        wp_enqueue_script('plupload-all');
142
-        wp_enqueue_script('jquery-ui-sortable');
143
-
144
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
145
-        wp_enqueue_script('geodirectory-plupload-script');
146
-        // SCRIPT FOR UPLOAD END
147
-
148
-        // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
149
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
150
-            $ajax_url = admin_url('admin-ajax.php');
151
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
152
-            $ajax_url = admin_url('admin-ajax.php');
153
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
154
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
155
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
156
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
157
-        } else {
158
-            $ajax_url = admin_url('admin-ajax.php');
159
-        }
127
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
128
+	wp_enqueue_script('geodirectory-goMap-script');
129
+
130
+
131
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132
+	wp_enqueue_script('chosen');
133
+
134
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135
+	wp_enqueue_script('geodirectory-choose-ajax');
136
+
137
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138
+
139
+	if (is_page() && geodir_is_page('add-listing')) {
140
+		// SCRIPT FOR UPLOAD
141
+		wp_enqueue_script('plupload-all');
142
+		wp_enqueue_script('jquery-ui-sortable');
143
+
144
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
145
+		wp_enqueue_script('geodirectory-plupload-script');
146
+		// SCRIPT FOR UPLOAD END
147
+
148
+		// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
149
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
150
+			$ajax_url = admin_url('admin-ajax.php');
151
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
152
+			$ajax_url = admin_url('admin-ajax.php');
153
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
154
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
155
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
156
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
157
+		} else {
158
+			$ajax_url = admin_url('admin-ajax.php');
159
+		}
160 160
 
161
-        // place js config array for plupload
162
-        $plupload_init = array(
163
-            'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
164
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
165
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
166
-            'drop_element' => 'dropbox', // will be adjusted per uploader
167
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
168
-            'multiple_queues' => true,
169
-            'max_file_size' => geodir_max_upload_size(),
170
-            'url' => $ajax_url,
171
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
172
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
173
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
174
-            'multipart' => true,
175
-            'urlstream_upload' => true,
176
-            'multi_selection' => false, // will be added per uploader
177
-            // additional post data to send to our ajax hook
178
-            'multipart_params' => array(
179
-                '_ajax_nonce' => "", // will be added per uploader
180
-                'action' => 'plupload_action', // the ajax action name
181
-                'imgid' => 0 // will be added per uploader
182
-            )
183
-        );
184
-        $base_plupload_config = json_encode($plupload_init);
185
-
186
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
187
-            'upload_img_size' => geodir_max_upload_size());
188
-
189
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190
-
191
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
192
-    } // End if for add place page
193
-
194
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195
-    if ($is_detail_page) {
161
+		// place js config array for plupload
162
+		$plupload_init = array(
163
+			'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
164
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
165
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
166
+			'drop_element' => 'dropbox', // will be adjusted per uploader
167
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
168
+			'multiple_queues' => true,
169
+			'max_file_size' => geodir_max_upload_size(),
170
+			'url' => $ajax_url,
171
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
172
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
173
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
174
+			'multipart' => true,
175
+			'urlstream_upload' => true,
176
+			'multi_selection' => false, // will be added per uploader
177
+			// additional post data to send to our ajax hook
178
+			'multipart_params' => array(
179
+				'_ajax_nonce' => "", // will be added per uploader
180
+				'action' => 'plupload_action', // the ajax action name
181
+				'imgid' => 0 // will be added per uploader
182
+			)
183
+		);
184
+		$base_plupload_config = json_encode($plupload_init);
185
+
186
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
187
+			'upload_img_size' => geodir_max_upload_size());
188
+
189
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190
+
191
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
192
+	} // End if for add place page
193
+
194
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195
+	if ($is_detail_page) {
196 196
 		wp_enqueue_script('geodirectory-post-custom-js');
197 197
 	}
198 198
 
199
-    // font awesome rating script
199
+	// font awesome rating script
200 200
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
201 201
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
202 202
 		wp_enqueue_script('geodir-barrating-js');
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
 		wp_enqueue_script('geodir-jRating-js');
206 206
 	}
207 207
 
208
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209
-    wp_enqueue_script('geodir-on-document-load');
208
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209
+	wp_enqueue_script('geodir-on-document-load');
210 210
 
211
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212
-    wp_enqueue_script('google-geometa');
211
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212
+	wp_enqueue_script('google-geometa');
213 213
 }
214 214
 
215 215
 /**
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
  */
224 224
 function geodir_header_scripts()
225 225
 {
226
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
227
-    echo stripslashes(get_option('geodir_header_scripts'));
226
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
227
+	echo stripslashes(get_option('geodir_header_scripts'));
228 228
 }
229 229
 
230 230
 
@@ -240,16 +240,16 @@  discard block
 block discarded – undo
240 240
 function geodir_footer_scripts()
241 241
 {	
242 242
 	echo stripslashes(get_option('geodir_ga_tracking_code'));
243
-    echo stripslashes(get_option('geodir_footer_scripts'));
243
+	echo stripslashes(get_option('geodir_footer_scripts'));
244 244
 
245
-    /*
245
+	/*
246 246
      * Apple suck and can't/won't fix bugs: https://bugs.webkit.org/show_bug.cgi?id=136041
247 247
      *
248 248
      * Flexbox wont wrap on ios for search form items
249 249
      */
250
-    if (preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
251
-        echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
252
-    }
250
+	if (preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
251
+		echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
252
+	}
253 253
 }
254 254
 
255 255
 
@@ -263,12 +263,12 @@  discard block
 block discarded – undo
263 263
  */
264 264
 function geodir_add_async_forscript($url)
265 265
 {
266
-    if (strpos($url, '#asyncload')===false)
267
-        return $url;
268
-    else if (is_admin())
269
-        return str_replace('#asyncload', '', $url);
270
-    else
271
-        return str_replace('#asyncload', '', $url)."' async='async";
266
+	if (strpos($url, '#asyncload')===false)
267
+		return $url;
268
+	else if (is_admin())
269
+		return str_replace('#asyncload', '', $url);
270
+	else
271
+		return str_replace('#asyncload', '', $url)."' async='async";
272 272
 }
273 273
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
274 274
 
@@ -281,17 +281,17 @@  discard block
 block discarded – undo
281 281
 function geodir_templates_styles()
282 282
 {
283 283
 
284
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
285
-    wp_enqueue_style('geodir-core-scss');
286
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
284
+	wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
285
+	wp_enqueue_style('geodir-core-scss');
286
+	wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
287 287
 
288
-    if(is_rtl()){
289
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
290
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
291
-    }
288
+	if(is_rtl()){
289
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
290
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
291
+	}
292 292
 
293
-    wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
294
-    wp_enqueue_style('font-awesome');
293
+	wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
294
+	wp_enqueue_style('font-awesome');
295 295
 
296 296
 
297 297
 }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
  */
306 306
 function geodir_get_sidebar()
307 307
 {
308
-    get_sidebar('geodirectory');
308
+	get_sidebar('geodirectory');
309 309
 }
310 310
 
311 311
 /**
@@ -324,122 +324,122 @@  discard block
 block discarded – undo
324 324
  * @param bool $always_show Do you want to show the pagination always? Default: false.
325 325
  */
326 326
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
327
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
327
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
328 328
 
329
-    if (empty($prelabel)) {
330
-        $prelabel = '<strong>&laquo;</strong>';
331
-    }
329
+	if (empty($prelabel)) {
330
+		$prelabel = '<strong>&laquo;</strong>';
331
+	}
332 332
 
333
-    if (empty($nxtlabel)) {
334
-        $nxtlabel = '<strong>&raquo;</strong>';
335
-    }
333
+	if (empty($nxtlabel)) {
334
+		$nxtlabel = '<strong>&raquo;</strong>';
335
+	}
336 336
 
337
-    $half_pages_to_show = round($pages_to_show / 2);
337
+	$half_pages_to_show = round($pages_to_show / 2);
338 338
 
339
-    if (geodir_is_page('home')) // dont apply default  pagination for geodirectory home page.
340
-        return;
339
+	if (geodir_is_page('home')) // dont apply default  pagination for geodirectory home page.
340
+		return;
341 341
 
342
-    if (!is_single()) {
343
-        if (function_exists('geodir_location_geo_home_link')) {
344
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
345
-        }
346
-        $numposts = $wp_query->found_posts;
342
+	if (!is_single()) {
343
+		if (function_exists('geodir_location_geo_home_link')) {
344
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
345
+		}
346
+		$numposts = $wp_query->found_posts;
347 347
 
348
-        $max_page = ceil($numposts / $posts_per_page);
348
+		$max_page = ceil($numposts / $posts_per_page);
349 349
 
350
-        if (empty($paged)) {
351
-            $paged = 1;
352
-        }
350
+		if (empty($paged)) {
351
+			$paged = 1;
352
+		}
353 353
         
354
-        $post_type = geodir_get_current_posttype();
355
-        $listing_type_name = get_post_type_plural_label($post_type);
356
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
357
-            $term = array();
354
+		$post_type = geodir_get_current_posttype();
355
+		$listing_type_name = get_post_type_plural_label($post_type);
356
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
357
+			$term = array();
358 358
             
359
-            if (is_tax()) {
360
-                $term_id = get_queried_object_id();
361
-                $taxonomy = get_query_var('taxonomy');
359
+			if (is_tax()) {
360
+				$term_id = get_queried_object_id();
361
+				$taxonomy = get_query_var('taxonomy');
362 362
 
363
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
364
-                    $term = get_term($term_id, $post_type . 'category');
365
-                }
366
-            }
363
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
364
+					$term = get_term($term_id, $post_type . 'category');
365
+				}
366
+			}
367 367
             
368
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
369
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
368
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
369
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
370 370
                 
371
-                if (!is_array($taxonomy_search)) {
372
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
373
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
374
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
375
-                }
376
-            }
371
+				if (!is_array($taxonomy_search)) {
372
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
373
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
374
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
375
+				}
376
+			}
377 377
             
378
-            if (!empty($term) && !is_wp_error($term)) {
379
-                $listing_type_name = $term->name;
380
-            }
381
-        }
378
+			if (!empty($term) && !is_wp_error($term)) {
379
+				$listing_type_name = $term->name;
380
+			}
381
+		}
382 382
 
383
-        if ($max_page > 1 || $always_show) {            
384
-            // Extra pagination info
385
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
386
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
387
-            $end_no = min($paged * $posts_per_page, $numposts);
383
+		if ($max_page > 1 || $always_show) {            
384
+			// Extra pagination info
385
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
386
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
387
+			$end_no = min($paged * $posts_per_page, $numposts);
388 388
 
389
-            if ($geodir_pagination_more_info != '') {
390
-                if ($listing_type_name) {
391
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
392
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
393
-                } else {
394
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
395
-                }
396
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
397
-                /**
398
-                 * Adds an extra pagination info above/under pagination.
399
-                 *
400
-                 * @since 1.5.9
401
-                 *
402
-                 * @param string $pagination_info Extra pagination info content.
403
-                 * @param string $listing_type_name Listing results type.
404
-                 * @param string $start_no First result number.
405
-                 * @param string $end_no Last result number.
406
-                 * @param string $numposts Total number of listings.
407
-                 * @param string $post_type The post type.
408
-                 */
409
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
389
+			if ($geodir_pagination_more_info != '') {
390
+				if ($listing_type_name) {
391
+					$listing_type_name = __($listing_type_name, 'geodirectory');
392
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
393
+				} else {
394
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
395
+				}
396
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
397
+				/**
398
+				 * Adds an extra pagination info above/under pagination.
399
+				 *
400
+				 * @since 1.5.9
401
+				 *
402
+				 * @param string $pagination_info Extra pagination info content.
403
+				 * @param string $listing_type_name Listing results type.
404
+				 * @param string $start_no First result number.
405
+				 * @param string $end_no Last result number.
406
+				 * @param string $numposts Total number of listings.
407
+				 * @param string $post_type The post type.
408
+				 */
409
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
410 410
                 
411
-                if ($geodir_pagination_more_info == 'before') {
412
-                    $before = $before . $pagination_info;
413
-                } else if ($geodir_pagination_more_info == 'after') {
414
-                    $after = $pagination_info . $after;
415
-                }
416
-            }
411
+				if ($geodir_pagination_more_info == 'before') {
412
+					$before = $before . $pagination_info;
413
+				} else if ($geodir_pagination_more_info == 'after') {
414
+					$after = $pagination_info . $after;
415
+				}
416
+			}
417 417
             
418
-            echo "$before <div class='Navi gd-navi'>";
419
-            if ($paged >= ($pages_to_show - 1)) {
420
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
421
-            }
422
-            previous_posts_link($prelabel);
423
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
424
-                if ($i >= 1 && $i <= $max_page) {
425
-                    if ($i == $paged) {
426
-                        echo "<strong class='on'>$i</strong>";
427
-                    } else {
428
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
429
-                    }
430
-                }
431
-            }
432
-            next_posts_link($nxtlabel, $max_page);
433
-            if (($paged + $half_pages_to_show) < ($max_page)) {
434
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
435
-            }
436
-            echo "</div> $after";
437
-        }
418
+			echo "$before <div class='Navi gd-navi'>";
419
+			if ($paged >= ($pages_to_show - 1)) {
420
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
421
+			}
422
+			previous_posts_link($prelabel);
423
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
424
+				if ($i >= 1 && $i <= $max_page) {
425
+					if ($i == $paged) {
426
+						echo "<strong class='on'>$i</strong>";
427
+					} else {
428
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
429
+					}
430
+				}
431
+			}
432
+			next_posts_link($nxtlabel, $max_page);
433
+			if (($paged + $half_pages_to_show) < ($max_page)) {
434
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
435
+			}
436
+			echo "</div> $after";
437
+		}
438 438
         
439
-        if (function_exists('geodir_location_geo_home_link')) {
440
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
441
-        }
442
-    }
439
+		if (function_exists('geodir_location_geo_home_link')) {
440
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
441
+		}
442
+	}
443 443
 }
444 444
 
445 445
 /**
@@ -450,20 +450,20 @@  discard block
 block discarded – undo
450 450
  */
451 451
 function geodir_listingsearch_scripts()
452 452
 {
453
-    if (get_option('gd_search_dist') != '') {
454
-        $dist = get_option('gd_search_dist');
455
-    } else {
456
-        $dist = 500;
457
-    }
458
-    $dist_dif = 1000;
459
-
460
-    if ($dist <= 5000) $dist_dif = 500;
461
-    if ($dist <= 1000) $dist_dif = 100;
462
-    if ($dist <= 500) $dist_dif = 50;
463
-    if ($dist <= 100) $dist_dif = 10;
464
-    if ($dist <= 50) $dist_dif = 5;
465
-
466
-    ?>
453
+	if (get_option('gd_search_dist') != '') {
454
+		$dist = get_option('gd_search_dist');
455
+	} else {
456
+		$dist = 500;
457
+	}
458
+	$dist_dif = 1000;
459
+
460
+	if ($dist <= 5000) $dist_dif = 500;
461
+	if ($dist <= 1000) $dist_dif = 100;
462
+	if ($dist <= 500) $dist_dif = 50;
463
+	if ($dist <= 100) $dist_dif = 10;
464
+	if ($dist <= 50) $dist_dif = 5;
465
+
466
+	?>
467 467
     <script type="text/javascript">
468 468
 
469 469
         jQuery(function ($) {
@@ -522,15 +522,15 @@  discard block
 block discarded – undo
522 522
 function geodir_add_sharelocation_scripts()
523 523
 {
524 524
 
525
-    $default_search_for_text = SEARCH_FOR_TEXT;
526
-    if (get_option('geodir_search_field_default_text'))
527
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
525
+	$default_search_for_text = SEARCH_FOR_TEXT;
526
+	if (get_option('geodir_search_field_default_text'))
527
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
528 528
 
529
-    $default_near_text = NEAR_TEXT;
530
-    if (get_option('geodir_near_field_default_text'))
531
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
529
+	$default_near_text = NEAR_TEXT;
530
+	if (get_option('geodir_near_field_default_text'))
531
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
532 532
 
533
-    ?>
533
+	?>
534 534
 
535 535
 
536 536
     <script type="text/javascript">
@@ -613,14 +613,14 @@  discard block
 block discarded – undo
613 613
                     initialise2();
614 614
                 } else {
615 615
                     <?php
616
-                    $near_add = get_option('geodir_search_near_addition');
617
-                    /**
618
-                     * Adds any extra info to the near search box query when trying to geolocate it via google api.
619
-                     *
620
-                     * @since 1.0.0
621
-                     */
622
-                    $near_add2 = apply_filters('geodir_search_near_addition', '');
623
-                    ?>
616
+					$near_add = get_option('geodir_search_near_addition');
617
+					/**
618
+					 * Adds any extra info to the near search box query when trying to geolocate it via google api.
619
+					 *
620
+					 * @since 1.0.0
621
+					 */
622
+					$near_add2 = apply_filters('geodir_search_near_addition', '');
623
+					?>
624 624
                     if (window.gdMaps === 'google') {
625 625
                         Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
626 626
                             function (results, status) {
@@ -723,30 +723,30 @@  discard block
 block discarded – undo
723 723
  */
724 724
 function geodir_show_badges_on_image($which, $post, $link)
725 725
 {
726
-    $return = '';
727
-    switch ($which) {
728
-        case 'featured':
729
-            /**
730
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
731
-             *
732
-             * @since 1.0.0
733
-             * @param object $post The post object.
734
-             * @param string $link The link to the post.
735
-             */
736
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
737
-            break;
738
-        case 'new' :
739
-            /**
740
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
741
-             *
742
-             * @since 1.0.0
743
-             * @param object $post The post object.
744
-             * @param string $link The link to the post.
745
-             */
746
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
747
-            break;
748
-
749
-    }
726
+	$return = '';
727
+	switch ($which) {
728
+		case 'featured':
729
+			/**
730
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
731
+			 *
732
+			 * @since 1.0.0
733
+			 * @param object $post The post object.
734
+			 * @param string $link The link to the post.
735
+			 */
736
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
737
+			break;
738
+		case 'new' :
739
+			/**
740
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
741
+			 *
742
+			 * @since 1.0.0
743
+			 * @param object $post The post object.
744
+			 * @param string $link The link to the post.
745
+			 */
746
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
747
+			break;
748
+
749
+	}
750 750
     
751
-    return $return;
751
+	return $return;
752 752
 }
Please login to merge, or discard this patch.
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
     $is_detail_page = false;
39 39
     $geodir_map_name = geodir_map_name();
40 40
 
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
41
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
42 42
         $is_detail_page = true;
43 43
     }
44 44
 
45 45
     wp_enqueue_script('jquery');
46 46
 
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
47
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48 48
     wp_enqueue_script('geodirectory-script');
49 49
 
50 50
     $geodir_vars_data = array(
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
53
+        'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
54 54
         'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
56 56
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57 57
     );
58 58
 
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * }
75 75
      */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
77 77
 
78 78
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79 79
 
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
80
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
81
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
82 82
 
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
84 84
     wp_enqueue_script('geodirectory-lightbox-jquery');
85 85
 
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
87 87
     if ($is_detail_page) {
88 88
         wp_enqueue_script('geodirectory-jquery-simplemodal');
89 89
     }
90 90
 
91 91
     if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        $map_key = "&key=" . geodir_get_map_api_key();
92
+        $map_lang = "&language=".geodir_get_map_default_language();
93
+        $map_key = "&key=".geodir_get_map_api_key();
94 94
         /**
95 95
          * Filter the variables that are added to the end of the google maps script call.
96 96
          *
@@ -100,48 +100,48 @@  discard block
 block discarded – undo
100 100
          * @param string $var The string to filter, default is empty string.
101 101
          */
102 102
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
-        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
103
+        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
104 104
     }
105 105
     
106 106
     if ($geodir_map_name == 'osm') {
107 107
         // Leaflet OpenStreetMap
108
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
108
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109 109
         wp_enqueue_style('geodirectory-leaflet-style');
110 110
             
111
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
111
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112 112
         wp_enqueue_script('geodirectory-leaflet-script');
113 113
         
114
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
114
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115 115
         wp_enqueue_script('geodirectory-leaflet-geo-script');
116 116
         
117 117
         if ($is_detail_page) {
118
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
118
+            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119 119
             wp_enqueue_style('geodirectory-leaflet-routing-style');
120 120
                 
121
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
121
+            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122 122
             wp_enqueue_script('geodirectory-leaflet-routing-script');
123 123
         }
124 124
     }
125
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
125
+    wp_enqueue_script('jquery-ui-autocomplete');
126 126
     
127
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
127
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
128 128
     wp_enqueue_script('geodirectory-goMap-script');
129 129
 
130 130
 
131
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
131
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132 132
     wp_enqueue_script('chosen');
133 133
 
134
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
134
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135 135
     wp_enqueue_script('geodirectory-choose-ajax');
136 136
 
137
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
137
+    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138 138
 
139 139
     if (is_page() && geodir_is_page('add-listing')) {
140 140
         // SCRIPT FOR UPLOAD
141 141
         wp_enqueue_script('plupload-all');
142 142
         wp_enqueue_script('jquery-ui-sortable');
143 143
 
144
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
144
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
145 145
         wp_enqueue_script('geodirectory-plupload-script');
146 146
         // SCRIPT FOR UPLOAD END
147 147
 
@@ -188,27 +188,27 @@  discard block
 block discarded – undo
188 188
 
189 189
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190 190
 
191
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
191
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
192 192
     } // End if for add place page
193 193
 
194
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
194
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195 195
     if ($is_detail_page) {
196 196
 		wp_enqueue_script('geodirectory-post-custom-js');
197 197
 	}
198 198
 
199 199
     // font awesome rating script
200 200
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
201
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
201
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
202 202
 		wp_enqueue_script('geodir-barrating-js');
203 203
 	} else { // default rating script
204
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
204
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
205 205
 		wp_enqueue_script('geodir-jRating-js');
206 206
 	}
207 207
 
208
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
208
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209 209
     wp_enqueue_script('geodir-on-document-load');
210 210
 
211
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
211
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212 212
     wp_enqueue_script('google-geometa');
213 213
 }
214 214
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
  */
224 224
 function geodir_header_scripts()
225 225
 {
226
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
226
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
227 227
     echo stripslashes(get_option('geodir_header_scripts'));
228 228
 }
229 229
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      *
248 248
      * Flexbox wont wrap on ios for search form items
249 249
      */
250
-    if (preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
250
+    if (preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) {
251 251
         echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
252 252
     }
253 253
 }
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
  */
264 264
 function geodir_add_async_forscript($url)
265 265
 {
266
-    if (strpos($url, '#asyncload')===false)
266
+    if (strpos($url, '#asyncload') === false)
267 267
         return $url;
268 268
     else if (is_admin())
269 269
         return str_replace('#asyncload', '', $url);
@@ -281,12 +281,12 @@  discard block
 block discarded – undo
281 281
 function geodir_templates_styles()
282 282
 {
283 283
 
284
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
284
+    wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
285 285
     wp_enqueue_style('geodir-core-scss');
286
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
286
+    wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
287 287
 
288
-    if(is_rtl()){
289
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
288
+    if (is_rtl()) {
289
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
290 290
     wp_enqueue_style('geodirectory-frontend-rtl-style');
291 291
     }
292 292
 
@@ -360,18 +360,18 @@  discard block
 block discarded – undo
360 360
                 $term_id = get_queried_object_id();
361 361
                 $taxonomy = get_query_var('taxonomy');
362 362
 
363
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
364
-                    $term = get_term($term_id, $post_type . 'category');
363
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
364
+                    $term = get_term($term_id, $post_type.'category');
365 365
                 }
366 366
             }
367 367
             
368
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
369
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
368
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
369
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
370 370
                 
371 371
                 if (!is_array($taxonomy_search)) {
372
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
373
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
374
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
372
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
373
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
374
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
375 375
                 }
376 376
             }
377 377
             
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         if ($max_page > 1 || $always_show) {            
384 384
             // Extra pagination info
385 385
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
386
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
386
+            $start_no = ($paged - 1) * $posts_per_page + 1;
387 387
             $end_no = min($paged * $posts_per_page, $numposts);
388 388
 
389 389
             if ($geodir_pagination_more_info != '') {
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                 } else {
394 394
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
395 395
                 }
396
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
396
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
397 397
                 /**
398 398
                  * Adds an extra pagination info above/under pagination.
399 399
                  *
@@ -409,15 +409,15 @@  discard block
 block discarded – undo
409 409
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
410 410
                 
411 411
                 if ($geodir_pagination_more_info == 'before') {
412
-                    $before = $before . $pagination_info;
412
+                    $before = $before.$pagination_info;
413 413
                 } else if ($geodir_pagination_more_info == 'after') {
414
-                    $after = $pagination_info . $after;
414
+                    $after = $pagination_info.$after;
415 415
                 }
416 416
             }
417 417
             
418 418
             echo "$before <div class='Navi gd-navi'>";
419 419
             if ($paged >= ($pages_to_show - 1)) {
420
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
420
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
421 421
             }
422 422
             previous_posts_link($prelabel);
423 423
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -425,13 +425,13 @@  discard block
 block discarded – undo
425 425
                     if ($i == $paged) {
426 426
                         echo "<strong class='on'>$i</strong>";
427 427
                     } else {
428
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
428
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
429 429
                     }
430 430
                 }
431 431
             }
432 432
             next_posts_link($nxtlabel, $max_page);
433 433
             if (($paged + $half_pages_to_show) < ($max_page)) {
434
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
434
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
435 435
             }
436 436
             echo "</div> $after";
437 437
         }
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
         jQuery(function ($) {
470 470
             $("#distance_slider").slider({
471 471
                 range: true,
472
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
472
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
473 473
                 min: 0,
474 474
                 max: <?php echo $dist; ?>,
475 475
                 step: <?php echo $dist_dif; ?>,
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 
535 535
 
536 536
     <script type="text/javascript">
537
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
537
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
538 538
         var latlng;
539 539
         var address;
540 540
         var dist = 0;
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 				var $form = jQuery(this).closest('form');
551 551
 
552 552
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
553
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
553
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
554 554
 				
555 555
 				// Disable location based search for disabled location post type.
556 556
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
 					}
565 565
 				}
566 566
 				
567
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
567
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
568 568
 					geodir_setsearch($form);
569 569
 				} else {
570 570
 					jQuery(".snear", $form).val('');
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
         });
583 583
         
584 584
 		function geodir_setsearch($form) {
585
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
585
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
586 586
 			geocodeAddress($form);
587 587
 		}
588 588
 
@@ -601,15 +601,15 @@  discard block
 block discarded – undo
601 601
             // Call the geocode function
602 602
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
603 603
 
604
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
605
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
604
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
605
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
606 606
                     jQuery(".snear", $form).val('');
607 607
                 }
608 608
                 jQuery($form).submit();
609 609
             } else {
610 610
                 var address = jQuery(".snear", $form).val();
611 611
 
612
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
612
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
613 613
                     initialise2();
614 614
                 } else {
615 615
                     <?php
@@ -622,12 +622,12 @@  discard block
 block discarded – undo
622 622
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
623 623
                     ?>
624 624
                     if (window.gdMaps === 'google') {
625
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
625
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
626 626
                             function (results, status) {
627 627
                                 if (status == google.maps.GeocoderStatus.OK) {
628 628
                                     updateSearchPosition(results[0].geometry.location, $form);
629 629
                                 } else {
630
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status);
630
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status);
631 631
                                 }
632 632
                             });
633 633
                     } else if (window.gdMaps === 'osm') {
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
637 637
                                     updateSearchPosition(geo, $form);
638 638
                                 } else {
639
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
639
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
640 640
                                 }
641 641
                             });
642 642
                     } else {
@@ -682,19 +682,19 @@  discard block
 block discarded – undo
682 682
             var msg;
683 683
             switch (err.code) {
684 684
                 case err.UNKNOWN_ERROR:
685
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
685
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
686 686
                     break;
687 687
                 case err.PERMISSION_DENINED:
688
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
688
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
689 689
                     break;
690 690
                 case err.POSITION_UNAVAILABLE:
691
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
691
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
692 692
                     break;
693 693
                 case err.BREAK:
694
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
694
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
695 695
                     break;
696 696
                 default:
697
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
697
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
698 698
             }
699 699
             jQuery('#info').html(msg);
700 700
         }
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
              * @param object $post The post object.
734 734
              * @param string $link The link to the post.
735 735
              */
736
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
736
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
737 737
             break;
738 738
         case 'new' :
739 739
             /**
@@ -743,7 +743,7 @@  discard block
 block discarded – undo
743 743
              * @param object $post The post object.
744 744
              * @param string $link The link to the post.
745 745
              */
746
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
746
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
747 747
             break;
748 748
 
749 749
     }
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 2 patches
Indentation   +1113 added lines, -1113 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
 
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
-    if ($geodir_theme_location) {
227
-        update_option('geodir_theme_location_nav', $geodir_theme_location);
228
-    } else {
229
-        update_option('geodir_theme_location_nav', '');
230
-    }
225
+	$geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
+	if ($geodir_theme_location) {
227
+		update_option('geodir_theme_location_nav', $geodir_theme_location);
228
+	} else {
229
+		update_option('geodir_theme_location_nav', '');
230
+	}
231 231
 }
232 232
 
233 233
 /// add action for theme switch to blank previous theme navigation location setting
@@ -248,32 +248,32 @@  discard block
 block discarded – undo
248 248
  */
249 249
 function geodir_add_post_filters()
250 250
 {
251
-    /**
252
-     * Contains all function for filtering listing.
253
-     *
254
-     * @since 1.0.0
255
-     * @package GeoDirectory
256
-     */
257
-    include_once('geodirectory-functions/listing_filters.php');
251
+	/**
252
+	 * Contains all function for filtering listing.
253
+	 *
254
+	 * @since 1.0.0
255
+	 * @package GeoDirectory
256
+	 */
257
+	include_once('geodirectory-functions/listing_filters.php');
258 258
 }
259 259
 
260 260
 
261 261
 if (!function_exists('geodir_init_defaults')) {
262
-    /**
263
-     * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
-     *
265
-     * @since 1.0.0
266
-     * @package GeoDirectory
267
-     */
268
-    function geodir_init_defaults()
269
-    {
270
-        if (function_exists('geodir_register_defaults')) {
262
+	/**
263
+	 * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
+	 *
265
+	 * @since 1.0.0
266
+	 * @package GeoDirectory
267
+	 */
268
+	function geodir_init_defaults()
269
+	{
270
+		if (function_exists('geodir_register_defaults')) {
271 271
 
272
-            geodir_register_defaults();
272
+			geodir_register_defaults();
273 273
 
274
-        }
274
+		}
275 275
 
276
-    }
276
+	}
277 277
 }
278 278
 
279 279
 
@@ -295,26 +295,26 @@  discard block
 block discarded – undo
295 295
 // CALLED ON 'sidebars_widgets' FILTER
296 296
 
297 297
 if (!function_exists('geodir_restrict_widget')) {
298
-    /**
299
-     * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
-     *
301
-     * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
-     * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
-     * @since 1.0.0
304
-     * @package GeoDirectory
305
-     */
306
-    function geodir_restrict_widget()
307
-    {
308
-        global $is_listing, $is_single_place;
298
+	/**
299
+	 * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
+	 *
301
+	 * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
+	 * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
+	 * @since 1.0.0
304
+	 * @package GeoDirectory
305
+	 */
306
+	function geodir_restrict_widget()
307
+	{
308
+		global $is_listing, $is_single_place;
309 309
 
310
-        // set is listing	
311
-        (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
310
+		// set is listing	
311
+		(geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
312 312
 
313
-        // set is single place
314
-        (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
313
+		// set is single place
314
+		(geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
315 315
 
316 316
 
317
-    }
317
+	}
318 318
 }
319 319
 
320 320
 
@@ -335,32 +335,32 @@  discard block
 block discarded – undo
335 335
  */
336 336
 function geodir_detail_page_sidebar_content_sorting()
337 337
 {
338
-    $arr_detail_page_sidebar_content =
339
-        /**
340
-         * An array of functions to be called to be displayed on the details (post) page sidebar.
341
-         *
342
-         * This filter can be used to remove sections of the details page sidebar,
343
-         * add new sections or rearrange the order of the sections.
344
-         *
345
-         * @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.
346
-         * @since 1.0.0
347
-         */
348
-        apply_filters('geodir_detail_page_sidebar_content',
349
-            array('geodir_social_sharing_buttons',
350
-                'geodir_share_this_button',
351
-                'geodir_detail_page_google_analytics',
352
-                'geodir_edit_post_link',
353
-                'geodir_detail_page_review_rating',
354
-                'geodir_detail_page_more_info'
355
-            ) // end of array 
356
-        ); // end of apply filter
357
-    if (!empty($arr_detail_page_sidebar_content)) {
358
-        foreach ($arr_detail_page_sidebar_content as $content_function) {
359
-            if (function_exists($content_function)) {
360
-                add_action('geodir_detail_page_sidebar', $content_function);
361
-            }
362
-        }
363
-    }
338
+	$arr_detail_page_sidebar_content =
339
+		/**
340
+		 * An array of functions to be called to be displayed on the details (post) page sidebar.
341
+		 *
342
+		 * This filter can be used to remove sections of the details page sidebar,
343
+		 * add new sections or rearrange the order of the sections.
344
+		 *
345
+		 * @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.
346
+		 * @since 1.0.0
347
+		 */
348
+		apply_filters('geodir_detail_page_sidebar_content',
349
+			array('geodir_social_sharing_buttons',
350
+				'geodir_share_this_button',
351
+				'geodir_detail_page_google_analytics',
352
+				'geodir_edit_post_link',
353
+				'geodir_detail_page_review_rating',
354
+				'geodir_detail_page_more_info'
355
+			) // end of array 
356
+		); // end of apply filter
357
+	if (!empty($arr_detail_page_sidebar_content)) {
358
+		foreach ($arr_detail_page_sidebar_content as $content_function) {
359
+			if (function_exists($content_function)) {
360
+				add_action('geodir_detail_page_sidebar', $content_function);
361
+			}
362
+		}
363
+	}
364 364
 }
365 365
 
366 366
 add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1);
@@ -375,14 +375,14 @@  discard block
 block discarded – undo
375 375
  */
376 376
 function geodir_add_to_favourite_link()
377 377
 {
378
-    global $post, $preview;
379
-    if (!$preview && geodir_is_page('detail')) {
380
-        ?>
378
+	global $post, $preview;
379
+	if (!$preview && geodir_is_page('detail')) {
380
+		?>
381 381
         <p class="edit_link">
382 382
             <?php geodir_favourite_html($post->post_author, $post->ID); ?>
383 383
         </p>
384 384
     <?php
385
-    }
385
+	}
386 386
 }
387 387
 
388 388
 /**
@@ -396,41 +396,41 @@  discard block
 block discarded – undo
396 396
  */
397 397
 function geodir_social_sharing_buttons()
398 398
 {
399
-    global $preview;
400
-    ob_start(); // Start  buffering;
401
-    /**
402
-     * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
403
-     *
404
-     * @since 1.0.0
405
-     */
406
-    do_action('geodir_before_social_sharing_buttons');
407
-    if (!$preview) {
408
-        ?>
399
+	global $preview;
400
+	ob_start(); // Start  buffering;
401
+	/**
402
+	 * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
403
+	 *
404
+	 * @since 1.0.0
405
+	 */
406
+	do_action('geodir_before_social_sharing_buttons');
407
+	if (!$preview) {
408
+		?>
409 409
         <div class="likethis">
410 410
             <?php geodir_twitter_tweet_button(); ?>
411 411
             <?php geodir_fb_like_button(); ?>
412 412
             <?php geodir_google_plus_button(); ?>
413 413
         </div>
414 414
     <?php
415
-    }// end of if, if its a preview or not
416
-
417
-    /**
418
-     * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
419
-     *
420
-     * @since 1.0.0
421
-     */
422
-    do_action('geodir_after_social_sharing_buttons');
423
-    $content_html = ob_get_clean();
424
-    if (trim($content_html) != '')
425
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
427
-        /**
428
-         * Filter the geodir_social_sharing_buttons() function content.
429
-         *
430
-         * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
431
-         */
432
-        echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
433
-    }
415
+	}// end of if, if its a preview or not
416
+
417
+	/**
418
+	 * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
419
+	 *
420
+	 * @since 1.0.0
421
+	 */
422
+	do_action('geodir_after_social_sharing_buttons');
423
+	$content_html = ob_get_clean();
424
+	if (trim($content_html) != '')
425
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
+	if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
427
+		/**
428
+		 * Filter the geodir_social_sharing_buttons() function content.
429
+		 *
430
+		 * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
431
+		 */
432
+		echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
433
+	}
434 434
 
435 435
 
436 436
 }
@@ -446,39 +446,39 @@  discard block
 block discarded – undo
446 446
  */
447 447
 function geodir_share_this_button()
448 448
 {
449
-    global $preview;
450
-    ob_start(); // Start buffering;
451
-    /**
452
-     * This is called before the share this html in the function geodir_share_this_button()
453
-     *
454
-     * @since 1.0.0
455
-     */
456
-    do_action('geodir_before_share_this_button');
457
-    if (!$preview) {
458
-        ?>
449
+	global $preview;
450
+	ob_start(); // Start buffering;
451
+	/**
452
+	 * This is called before the share this html in the function geodir_share_this_button()
453
+	 *
454
+	 * @since 1.0.0
455
+	 */
456
+	do_action('geodir_before_share_this_button');
457
+	if (!$preview) {
458
+		?>
459 459
         <div class="share clearfix">
460 460
             <?php geodir_share_this_button_code(); ?>
461 461
         </div>
462 462
     <?php
463
-    }// end of if, if its a preview or not
464
-    /**
465
-     * This is called after the share this html in the function geodir_share_this_button()
466
-     *
467
-     * @since 1.0.0
468
-     */
469
-    do_action('geodir_after_share_this_button');
470
-    $content_html = ob_get_clean();
471
-    if (trim($content_html) != '')
472
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
474
-        /**
475
-         * Filter the geodir_share_this_button() function content.
476
-         *
477
-         * @param string $content_html The output html of the geodir_share_this_button() function.
478
-         * @since 1.0.0
479
-         */
480
-        echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
481
-    }
463
+	}// end of if, if its a preview or not
464
+	/**
465
+	 * This is called after the share this html in the function geodir_share_this_button()
466
+	 *
467
+	 * @since 1.0.0
468
+	 */
469
+	do_action('geodir_after_share_this_button');
470
+	$content_html = ob_get_clean();
471
+	if (trim($content_html) != '')
472
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
+	if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
474
+		/**
475
+		 * Filter the geodir_share_this_button() function content.
476
+		 *
477
+		 * @param string $content_html The output html of the geodir_share_this_button() function.
478
+		 * @since 1.0.0
479
+		 */
480
+		echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
481
+	}
482 482
 
483 483
 }
484 484
 
@@ -494,46 +494,46 @@  discard block
 block discarded – undo
494 494
  */
495 495
 function geodir_edit_post_link()
496 496
 {
497
-    global $post, $preview;
498
-    ob_start(); // Start buffering;
499
-    /**
500
-     * This is called before the edit post link html in the function geodir_edit_post_link()
501
-     *
502
-     * @since 1.0.0
503
-     */
504
-    do_action('geodir_before_edit_post_link');
505
-    if (!$preview) {
506
-        $is_current_user_owner = geodir_listing_belong_to_current_user();
497
+	global $post, $preview;
498
+	ob_start(); // Start buffering;
499
+	/**
500
+	 * This is called before the edit post link html in the function geodir_edit_post_link()
501
+	 *
502
+	 * @since 1.0.0
503
+	 */
504
+	do_action('geodir_before_edit_post_link');
505
+	if (!$preview) {
506
+		$is_current_user_owner = geodir_listing_belong_to_current_user();
507 507
         
508
-        if ($is_current_user_owner) {
509
-            $post_id = $post->ID;
508
+		if ($is_current_user_owner) {
509
+			$post_id = $post->ID;
510 510
             
511
-            if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
-                $post_id = (int)$_REQUEST['pid'];
513
-            }
511
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
+				$post_id = (int)$_REQUEST['pid'];
513
+			}
514 514
 
515
-            $postlink = get_permalink(geodir_add_listing_page_id());
516
-            $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
518
-        }
519
-    }// end of if, if its a preview or not
520
-    /**
521
-     * This is called after the edit post link html in the function geodir_edit_post_link()
522
-     *
523
-     * @since 1.0.0
524
-     */
525
-    do_action('geodir_after_edit_post_link');
526
-    $content_html = ob_get_clean();
527
-    if (trim($content_html) != '')
528
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
530
-        /**
531
-         * Filter the geodir_edit_post_link() function content.
532
-         *
533
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
534
-         */
535
-        echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
536
-    }
515
+			$postlink = get_permalink(geodir_add_listing_page_id());
516
+			$editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
+			echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
518
+		}
519
+	}// end of if, if its a preview or not
520
+	/**
521
+	 * This is called after the edit post link html in the function geodir_edit_post_link()
522
+	 *
523
+	 * @since 1.0.0
524
+	 */
525
+	do_action('geodir_after_edit_post_link');
526
+	$content_html = ob_get_clean();
527
+	if (trim($content_html) != '')
528
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
+	if ((int)get_option('geodir_disable_user_links_section') != 1) {
530
+		/**
531
+		 * Filter the geodir_edit_post_link() function content.
532
+		 *
533
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
534
+		 */
535
+		echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
536
+	}
537 537
 }
538 538
 
539 539
 /**
@@ -547,41 +547,41 @@  discard block
 block discarded – undo
547 547
  */
548 548
 function geodir_detail_page_google_analytics()
549 549
 {
550
-    global $post;
551
-    $package_info = array();
552
-    $package_info = geodir_post_package_info($package_info, $post);
550
+	global $post;
551
+	$package_info = array();
552
+	$package_info = geodir_post_package_info($package_info, $post);
553 553
 
554
-    $id = trim(get_option('geodir_ga_id'));
554
+	$id = trim(get_option('geodir_ga_id'));
555 555
 
556
-    if (!$id) {
557
-        return; //if no Google Analytics ID then bail.
558
-    }
556
+	if (!$id) {
557
+		return; //if no Google Analytics ID then bail.
558
+	}
559 559
 
560
-    ob_start(); // Start buffering;
561
-    /**
562
-     * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
563
-     *
564
-     * @since 1.0.0
565
-     */
566
-    do_action('geodir_before_google_analytics');
560
+	ob_start(); // Start buffering;
561
+	/**
562
+	 * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
563
+	 *
564
+	 * @since 1.0.0
565
+	 */
566
+	do_action('geodir_before_google_analytics');
567 567
     
568
-    $refresh_time = get_option('geodir_ga_refresh_time', 5);
569
-    /**
570
-     * Filter the time interval to check & refresh new users results.
571
-     *
572
-     * @since 1.5.9
573
-     *
574
-     * @param int $refresh_time Time interval to check & refresh new users results.
575
-     */
576
-    $refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
577
-    $refresh_time = absint($refresh_time * 1000);
568
+	$refresh_time = get_option('geodir_ga_refresh_time', 5);
569
+	/**
570
+	 * Filter the time interval to check & refresh new users results.
571
+	 *
572
+	 * @since 1.5.9
573
+	 *
574
+	 * @param int $refresh_time Time interval to check & refresh new users results.
575
+	 */
576
+	$refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
577
+	$refresh_time = absint($refresh_time * 1000);
578 578
     
579
-    $hide_refresh = get_option('geodir_ga_auto_refresh');
579
+	$hide_refresh = get_option('geodir_ga_auto_refresh');
580 580
     
581
-    $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
-    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' )) ) {
583
-        $page_url = urlencode($_SERVER['REQUEST_URI']);
584
-        ?>
581
+	$auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
+	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' )) ) {
583
+		$page_url = urlencode($_SERVER['REQUEST_URI']);
584
+		?>
585 585
         <script type="text/javascript">
586 586
             var gd_gaTimeOut;
587 587
             var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
@@ -833,15 +833,15 @@  discard block
 block discarded – undo
833 833
                     var labels = results[1].rows.map(function(row) { return +row[0]; });
834 834
 
835 835
                     <?php
836
-                    // Here we list the shorthand days of the week so it can be used in translation.
837
-                    __("Mon",'geodirectory');
838
-                    __("Tue",'geodirectory');
839
-                    __("Wed",'geodirectory');
840
-                    __("Thu",'geodirectory');
841
-                    __("Fri",'geodirectory');
842
-                    __("Sat",'geodirectory');
843
-                    __("Sun",'geodirectory');
844
-                    ?>
836
+					// Here we list the shorthand days of the week so it can be used in translation.
837
+					__("Mon",'geodirectory');
838
+					__("Tue",'geodirectory');
839
+					__("Wed",'geodirectory');
840
+					__("Thu",'geodirectory');
841
+					__("Fri",'geodirectory');
842
+					__("Sat",'geodirectory');
843
+					__("Sun",'geodirectory');
844
+					?>
845 845
 
846 846
                     labels = [
847 847
                         "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
@@ -1090,24 +1090,24 @@  discard block
 block discarded – undo
1090 1090
         </span>
1091 1091
 
1092 1092
     <?php
1093
-    }
1094
-    /**
1095
-     * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1096
-     *
1097
-     * @since 1.0.0
1098
-     */
1099
-    do_action('geodir_after_google_analytics');
1100
-    $content_html = ob_get_clean();
1101
-    if (trim($content_html) != '')
1102
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1104
-        /**
1105
-         * Filter the geodir_edit_post_link() function content.
1106
-         *
1107
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
1108
-         */
1109
-        echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1110
-    }
1093
+	}
1094
+	/**
1095
+	 * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1096
+	 *
1097
+	 * @since 1.0.0
1098
+	 */
1099
+	do_action('geodir_after_google_analytics');
1100
+	$content_html = ob_get_clean();
1101
+	if (trim($content_html) != '')
1102
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
+	if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1104
+		/**
1105
+		 * Filter the geodir_edit_post_link() function content.
1106
+		 *
1107
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
1108
+		 */
1109
+		echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1110
+	}
1111 1111
 }
1112 1112
 
1113 1113
 /**
@@ -1123,90 +1123,90 @@  discard block
 block discarded – undo
1123 1123
  */
1124 1124
 function geodir_detail_page_review_rating()
1125 1125
 {
1126
-    global $post, $preview, $post_images;
1127
-    ob_start(); // Start  buffering;
1128
-    /**
1129
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1130
-     *
1131
-     * This is called outside the check for an actual rating and the check for preview page.
1132
-     *
1133
-     * @since 1.0.0
1134
-     */
1135
-    do_action('geodir_before_detail_page_review_rating');
1136
-
1137
-    $comment_count = geodir_get_review_count_total($post->ID);
1138
-    $post_avgratings = geodir_get_post_rating($post->ID);
1139
-
1140
-    if ($post_avgratings != 0 && !$preview) {
1141
-        /**
1142
-         * This is called before the rating html in the function geodir_detail_page_review_rating().
1143
-         *
1144
-         * This is called inside the check for an actual rating and the check for preview page.
1145
-         *
1146
-         * @since 1.0.0
1147
-         * @param float $post_avgratings Average rating for the surrent post.
1148
-         * @param int $post->ID Current post ID.
1149
-         */
1150
-        do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1151
-
1152
-        $html = '<p style=" float:left;">';
1153
-        $html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1154
-        $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1155
-        $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1126
+	global $post, $preview, $post_images;
1127
+	ob_start(); // Start  buffering;
1128
+	/**
1129
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1130
+	 *
1131
+	 * This is called outside the check for an actual rating and the check for preview page.
1132
+	 *
1133
+	 * @since 1.0.0
1134
+	 */
1135
+	do_action('geodir_before_detail_page_review_rating');
1136
+
1137
+	$comment_count = geodir_get_review_count_total($post->ID);
1138
+	$post_avgratings = geodir_get_post_rating($post->ID);
1139
+
1140
+	if ($post_avgratings != 0 && !$preview) {
1141
+		/**
1142
+		 * This is called before the rating html in the function geodir_detail_page_review_rating().
1143
+		 *
1144
+		 * This is called inside the check for an actual rating and the check for preview page.
1145
+		 *
1146
+		 * @since 1.0.0
1147
+		 * @param float $post_avgratings Average rating for the surrent post.
1148
+		 * @param int $post->ID Current post ID.
1149
+		 */
1150
+		do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1151
+
1152
+		$html = '<p style=" float:left;">';
1153
+		$html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1154
+		$html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1155
+		$post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1156 1156
        
1157 1157
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1158 1158
 	   
1159 1159
 	   $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 />';
1160 1160
 
1161
-        $html .= '<span class="item">';
1162
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1161
+		$html .= '<span class="item">';
1162
+		$html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1163 1163
 
1164
-        if ($post_images) {
1165
-            foreach ($post_images as $img) {
1166
-                $post_img = $img->src;
1167
-                break;
1168
-            }
1169
-        }
1170
-
1171
-        if (isset($post_img) && $post_img) {
1172
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1173
-        }
1174
-
1175
-        $html .= '</span>';
1176
-
1177
-        echo $html .= '</div>';
1178
-        /**
1179
-         * This is called after the rating html in the function geodir_detail_page_review_rating().
1180
-         *
1181
-         * This is called inside the check for an actual rating and the check for preview page.
1182
-         *
1183
-         * @since 1.0.0
1184
-         * @param float $post_avgratings Average rating for the surrent post.
1185
-         * @param int $post->ID Current post ID.
1186
-         */
1187
-        do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1188
-    }
1189
-    /**
1190
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1191
-     *
1192
-     * This is called outside the check for an actual rating and the check for preview page.
1193
-     *
1194
-     * @since 1.0.0
1195
-     */
1196
-    do_action('geodir_after_detail_page_review_rating');
1197
-    $content_html = ob_get_clean();
1198
-    if (trim($content_html) != '') {
1199
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1200
-    }
1201
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1202
-        /**
1203
-         * Filter the geodir_detail_page_review_rating() function content.
1204
-         *
1205
-         * @since 1.0.0
1206
-         * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1207
-         */
1208
-        echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1209
-    }
1164
+		if ($post_images) {
1165
+			foreach ($post_images as $img) {
1166
+				$post_img = $img->src;
1167
+				break;
1168
+			}
1169
+		}
1170
+
1171
+		if (isset($post_img) && $post_img) {
1172
+			$html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1173
+		}
1174
+
1175
+		$html .= '</span>';
1176
+
1177
+		echo $html .= '</div>';
1178
+		/**
1179
+		 * This is called after the rating html in the function geodir_detail_page_review_rating().
1180
+		 *
1181
+		 * This is called inside the check for an actual rating and the check for preview page.
1182
+		 *
1183
+		 * @since 1.0.0
1184
+		 * @param float $post_avgratings Average rating for the surrent post.
1185
+		 * @param int $post->ID Current post ID.
1186
+		 */
1187
+		do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1188
+	}
1189
+	/**
1190
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1191
+	 *
1192
+	 * This is called outside the check for an actual rating and the check for preview page.
1193
+	 *
1194
+	 * @since 1.0.0
1195
+	 */
1196
+	do_action('geodir_after_detail_page_review_rating');
1197
+	$content_html = ob_get_clean();
1198
+	if (trim($content_html) != '') {
1199
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1200
+	}
1201
+	if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1202
+		/**
1203
+		 * Filter the geodir_detail_page_review_rating() function content.
1204
+		 *
1205
+		 * @since 1.0.0
1206
+		 * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1207
+		 */
1208
+		echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1209
+	}
1210 1210
 }
1211 1211
 
1212 1212
 /**
@@ -1218,35 +1218,35 @@  discard block
 block discarded – undo
1218 1218
  */
1219 1219
 function geodir_detail_page_more_info()
1220 1220
 {
1221
-    ob_start(); // Start  buffering;
1222
-    /**
1223
-     * This is called before the info section html.
1224
-     *
1225
-     * @since 1.0.0
1226
-     */
1227
-    do_action('geodir_before_detail_page_more_info');
1228
-    if ($geodir_post_detail_fields = geodir_show_listing_info('detail')) {
1229
-        echo $geodir_post_detail_fields;
1230
-    }
1231
-    /**
1232
-     * This is called after the info section html.
1233
-     *
1234
-     * @since 1.0.0
1235
-     */
1236
-    do_action('geodir_after_detail_page_more_info');
1237
-
1238
-    $content_html = ob_get_clean();
1239
-    if (trim($content_html) != '')
1240
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1242
-        /**
1243
-         * Filter the output html for function geodir_detail_page_more_info().
1244
-         *
1245
-         * @since 1.0.0
1246
-         * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1247
-         */
1248
-        echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1249
-    }
1221
+	ob_start(); // Start  buffering;
1222
+	/**
1223
+	 * This is called before the info section html.
1224
+	 *
1225
+	 * @since 1.0.0
1226
+	 */
1227
+	do_action('geodir_before_detail_page_more_info');
1228
+	if ($geodir_post_detail_fields = geodir_show_listing_info('detail')) {
1229
+		echo $geodir_post_detail_fields;
1230
+	}
1231
+	/**
1232
+	 * This is called after the info section html.
1233
+	 *
1234
+	 * @since 1.0.0
1235
+	 */
1236
+	do_action('geodir_after_detail_page_more_info');
1237
+
1238
+	$content_html = ob_get_clean();
1239
+	if (trim($content_html) != '')
1240
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
+	if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1242
+		/**
1243
+		 * Filter the output html for function geodir_detail_page_more_info().
1244
+		 *
1245
+		 * @since 1.0.0
1246
+		 * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1247
+		 */
1248
+		echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1249
+	}
1250 1250
 }
1251 1251
 
1252 1252
 
@@ -1260,15 +1260,15 @@  discard block
 block discarded – undo
1260 1260
  */
1261 1261
 function geodir_localize_all_js_msg()
1262 1262
 {// 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
1263
-    if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1264
-        $ajax_url = admin_url('admin-ajax.php');
1265
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1266
-        $ajax_url = admin_url('admin-ajax.php');
1267
-    } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1268
-        $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1269
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1270
-        $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1271
-    }
1263
+	if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1264
+		$ajax_url = admin_url('admin-ajax.php');
1265
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1266
+		$ajax_url = admin_url('admin-ajax.php');
1267
+	} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1268
+		$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1269
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1270
+		$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1271
+	}
1272 1272
 	
1273 1273
 	/**
1274 1274
 	 * Filter the allowed image type extensions for post images.
@@ -1278,60 +1278,60 @@  discard block
 block discarded – undo
1278 1278
 	 */
1279 1279
 	$allowed_img_types = apply_filters('geodir_allowed_post_image_exts', array('jpg', 'jpeg', 'jpe', 'gif', 'png'));
1280 1280
 	
1281
-    $default_marker_icon = get_option('geodir_default_marker_icon');
1282
-    $default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1283
-    $default_marker_width = $default_marker_size['w'];
1284
-    $default_marker_height = $default_marker_size['h'];
1281
+	$default_marker_icon = get_option('geodir_default_marker_icon');
1282
+	$default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1283
+	$default_marker_width = $default_marker_size['w'];
1284
+	$default_marker_height = $default_marker_size['h'];
1285 1285
     
1286
-    $arr_alert_msg = array(
1287
-        'geodir_plugin_url' => geodir_plugin_url(),
1288
-        'geodir_admin_ajax_url' => $ajax_url,
1289
-        'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1290
-        'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1291
-        'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1292
-        'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1293
-        //start not show alert msg
1294
-        'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1295
-        'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1296
-        'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1297
-        'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1298
-        'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1299
-        // end not show alert msg
1300
-        'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1301
-        'my_main_listing_del' => __('Deleting the main listing of a franchise will turn all franchises in regular listings. Are you sure wish to delete this main listing?', 'geodirectory'),
1302
-        //start not show alert msg
1303
-        'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1304
-        'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1305
-        'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1306
-        'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1307
-        'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1308
-        'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1309
-        'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1310
-        'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1311
-        'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1312
-        'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1313
-        'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1314
-        'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1315
-        'geodir_default_marker_icon' => $default_marker_icon,
1316
-        'geodir_default_marker_w' => $default_marker_width,
1317
-        'geodir_default_marker_h' => $default_marker_height,
1318
-        'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1319
-        'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1320
-        'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1321
-        'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1322
-        'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1323
-        'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1324
-        'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1325
-        'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1326
-        /* on/off dragging for phone devices */
1327
-        'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1328
-        'geodir_is_mobile' => wp_is_mobile() ? true : false,
1329
-        'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1330
-        'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1331
-        'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1332
-        'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1333
-        'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1334
-        'geodir_action_remove' => __('Remove', 'geodirectory'),
1286
+	$arr_alert_msg = array(
1287
+		'geodir_plugin_url' => geodir_plugin_url(),
1288
+		'geodir_admin_ajax_url' => $ajax_url,
1289
+		'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1290
+		'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1291
+		'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1292
+		'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1293
+		//start not show alert msg
1294
+		'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1295
+		'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1296
+		'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1297
+		'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1298
+		'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1299
+		// end not show alert msg
1300
+		'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1301
+		'my_main_listing_del' => __('Deleting the main listing of a franchise will turn all franchises in regular listings. Are you sure wish to delete this main listing?', 'geodirectory'),
1302
+		//start not show alert msg
1303
+		'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1304
+		'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1305
+		'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1306
+		'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1307
+		'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1308
+		'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1309
+		'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1310
+		'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1311
+		'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1312
+		'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1313
+		'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1314
+		'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1315
+		'geodir_default_marker_icon' => $default_marker_icon,
1316
+		'geodir_default_marker_w' => $default_marker_width,
1317
+		'geodir_default_marker_h' => $default_marker_height,
1318
+		'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1319
+		'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1320
+		'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1321
+		'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1322
+		'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1323
+		'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1324
+		'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1325
+		'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1326
+		/* on/off dragging for phone devices */
1327
+		'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1328
+		'geodir_is_mobile' => wp_is_mobile() ? true : false,
1329
+		'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1330
+		'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1331
+		'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1332
+		'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1333
+		'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1334
+		'geodir_action_remove' => __('Remove', 'geodirectory'),
1335 1335
 		'geodir_txt_all_files' => __('Allowed files', 'geodirectory'),
1336 1336
 		'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'),
1337 1337
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
@@ -1339,33 +1339,33 @@  discard block
 block discarded – undo
1339 1339
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1340 1340
 		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1341 1341
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1342
-        'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1343
-        'geodir_map_name' => geodir_map_name(),
1344
-        'osmStart' => __('Start', 'geodirectory'),
1345
-        'osmVia' => __('Via {viaNumber}', 'geodirectory'),
1346
-        'osmEnd' => __('Enter Your Location', 'geodirectory'),
1347
-    );
1348
-
1349
-    /**
1350
-     * Filters the translated JS strings from function geodir_localize_all_js_msg().
1351
-     *
1352
-     * With this filter you can add, remove or change translated JS strings.
1353
-     * You should add your own translations to this if you are building an addon rather than adding another script block.
1354
-     *
1355
-     * @since 1.0.0
1356
-     */
1357
-    $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1358
-
1359
-    foreach ($arr_alert_msg as $key => $value) {
1360
-        if (!is_scalar($value))
1361
-            continue;
1362
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1363
-    }
1342
+		'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1343
+		'geodir_map_name' => geodir_map_name(),
1344
+		'osmStart' => __('Start', 'geodirectory'),
1345
+		'osmVia' => __('Via {viaNumber}', 'geodirectory'),
1346
+		'osmEnd' => __('Enter Your Location', 'geodirectory'),
1347
+	);
1348
+
1349
+	/**
1350
+	 * Filters the translated JS strings from function geodir_localize_all_js_msg().
1351
+	 *
1352
+	 * With this filter you can add, remove or change translated JS strings.
1353
+	 * You should add your own translations to this if you are building an addon rather than adding another script block.
1354
+	 *
1355
+	 * @since 1.0.0
1356
+	 */
1357
+	$arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1364 1358
 
1365
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1366
-    echo '<script>';
1367
-    echo $script;
1368
-    echo '</script>';
1359
+	foreach ($arr_alert_msg as $key => $value) {
1360
+		if (!is_scalar($value))
1361
+			continue;
1362
+		$arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1363
+	}
1364
+
1365
+	$script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1366
+	echo '<script>';
1367
+	echo $script;
1368
+	echo '</script>';
1369 1369
 }
1370 1370
 
1371 1371
 add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31);
@@ -1381,11 +1381,11 @@  discard block
 block discarded – undo
1381 1381
  */
1382 1382
 function geodir_admin_bar_site_menu($wp_admin_bar)
1383 1383
 {
1384
-    if (get_option("geodir_installed")) {
1385
-        if (current_user_can('manage_options')) {
1386
-            $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1387
-        }
1388
-    }
1384
+	if (get_option("geodir_installed")) {
1385
+		if (current_user_can('manage_options')) {
1386
+			$wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1387
+		}
1388
+	}
1389 1389
 }
1390 1390
 
1391 1391
 add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/
@@ -1411,25 +1411,25 @@  discard block
 block discarded – undo
1411 1411
  */
1412 1412
 function geodir_store_sidebars()
1413 1413
 {
1414
-    global $geodir_sidebars;
1415
-    global $sidebars_widgets;
1416
-
1417
-    if (!is_array($sidebars_widgets))
1418
-        $sidebars_widgets = wp_get_sidebars_widgets();
1419
-    $geodir_old_sidebars = array();
1420
-
1421
-    if (is_array($geodir_sidebars)) {
1422
-        foreach ($geodir_sidebars as $val) {
1423
-            if (is_array($sidebars_widgets)) {
1424
-                if (array_key_exists($val, $sidebars_widgets))
1425
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1426
-                else
1427
-                    $geodir_old_sidebars[$val] = array();
1428
-            }
1429
-        }
1430
-    }
1431
-    update_option('geodir_sidebars', $geodir_old_sidebars);
1432
-    geodir_option_version_backup('geodir_sidebars');
1414
+	global $geodir_sidebars;
1415
+	global $sidebars_widgets;
1416
+
1417
+	if (!is_array($sidebars_widgets))
1418
+		$sidebars_widgets = wp_get_sidebars_widgets();
1419
+	$geodir_old_sidebars = array();
1420
+
1421
+	if (is_array($geodir_sidebars)) {
1422
+		foreach ($geodir_sidebars as $val) {
1423
+			if (is_array($sidebars_widgets)) {
1424
+				if (array_key_exists($val, $sidebars_widgets))
1425
+					$geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1426
+				else
1427
+					$geodir_old_sidebars[$val] = array();
1428
+			}
1429
+		}
1430
+	}
1431
+	update_option('geodir_sidebars', $geodir_old_sidebars);
1432
+	geodir_option_version_backup('geodir_sidebars');
1433 1433
 
1434 1434
 }
1435 1435
 
@@ -1443,28 +1443,28 @@  discard block
 block discarded – undo
1443 1443
  */
1444 1444
 function geodir_restore_sidebars()
1445 1445
 {
1446
-    global $sidebars_widgets;
1447
-
1448
-    if (!is_array($sidebars_widgets))
1449
-        $sidebars_widgets = wp_get_sidebars_widgets();
1450
-
1451
-    if (is_array($sidebars_widgets)) {
1452
-        $geodir_old_sidebars = get_option('geodir_sidebars');
1453
-        if (is_array($geodir_old_sidebars)) {
1454
-            foreach ($geodir_old_sidebars as $key => $val) {
1455
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1456
-                {
1457
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1458
-                }
1446
+	global $sidebars_widgets;
1459 1447
 
1448
+	if (!is_array($sidebars_widgets))
1449
+		$sidebars_widgets = wp_get_sidebars_widgets();
1460 1450
 
1461
-            }
1462
-        }
1451
+	if (is_array($sidebars_widgets)) {
1452
+		$geodir_old_sidebars = get_option('geodir_sidebars');
1453
+		if (is_array($geodir_old_sidebars)) {
1454
+			foreach ($geodir_old_sidebars as $key => $val) {
1455
+				if(0 === strpos($key, 'geodir_'))// if gd widget
1456
+				{
1457
+					$sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1458
+				}
1463 1459
 
1464
-    }
1465 1460
 
1466
-    update_option('sidebars_widgets', $sidebars_widgets);
1467
-    update_option('geodir_sidebars', '');
1461
+			}
1462
+		}
1463
+
1464
+	}
1465
+
1466
+	update_option('sidebars_widgets', $sidebars_widgets);
1467
+	update_option('geodir_sidebars', '');
1468 1468
 }
1469 1469
 
1470 1470
 add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview');
@@ -1477,9 +1477,9 @@  discard block
 block discarded – undo
1477 1477
  */
1478 1478
 function geodir_after_listing_post_gridview()
1479 1479
 {
1480
-    global $gridview_columns;
1480
+	global $gridview_columns;
1481 1481
 
1482
-    $gridview_columns = '';
1482
+	$gridview_columns = '';
1483 1483
 
1484 1484
 }
1485 1485
 
@@ -1507,11 +1507,11 @@  discard block
 block discarded – undo
1507 1507
  */
1508 1508
 function so_handle_038($url, $original_url, $_context)
1509 1509
 {
1510
-    if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1511
-        $url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1512
-    }
1510
+	if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1511
+		$url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1512
+	}
1513 1513
 
1514
-    return $url;
1514
+	return $url;
1515 1515
 }
1516 1516
 
1517 1517
 
@@ -1527,34 +1527,34 @@  discard block
 block discarded – undo
1527 1527
 function geodir_after_main_form_fields() {
1528 1528
 	global $gd_session;
1529 1529
 	
1530
-    if (get_option('geodir_accept_term_condition')) {
1531
-        global $post;
1532
-        $term_condition = '';
1533
-        if (isset($_REQUEST['backandedit'])) {
1534
-            $post = (object)$gd_session->get('listing');
1535
-            $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1536
-        }
1537
-
1538
-        ?>
1530
+	if (get_option('geodir_accept_term_condition')) {
1531
+		global $post;
1532
+		$term_condition = '';
1533
+		if (isset($_REQUEST['backandedit'])) {
1534
+			$post = (object)$gd_session->get('listing');
1535
+			$term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1536
+		}
1537
+
1538
+		?>
1539 1539
         <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix">
1540 1540
             <label>&nbsp;</label>
1541 1541
 
1542 1542
             <div class="geodir_taxonomy_field" style="float:left; width:70%;">
1543 1543
 				<span style="display:block"> 
1544 1544
 				<input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') {
1545
-                    echo 'checked="checked"';
1546
-                } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1545
+					echo 'checked="checked"';
1546
+				} ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1547 1547
                        class="geodir_textfield" value="1"
1548 1548
                        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>
1549 1549
 				</span>
1550 1550
             </div>
1551 1551
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
1552
-                    _e($required_msg, 'geodirectory');
1553
-                } ?></span>
1552
+					_e($required_msg, 'geodirectory');
1553
+				} ?></span>
1554 1554
         </div>
1555 1555
     <?php
1556 1556
 
1557
-    }
1557
+	}
1558 1558
 }
1559 1559
 
1560 1560
 
@@ -1579,42 +1579,42 @@  discard block
 block discarded – undo
1579 1579
  */
1580 1580
 function geodir_detail_page_tab_is_display($is_display, $tab)
1581 1581
 {
1582
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1582
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1583 1583
 
1584
-    if ($tab == 'post_profile') {
1585
-        /** This action is documented in geodirectory_template_actions.php */
1586
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1584
+	if ($tab == 'post_profile') {
1585
+		/** This action is documented in geodirectory_template_actions.php */
1586
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1587 1587
         
1588
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1589
-            $is_display = false;
1590
-        }
1591
-    }
1588
+		if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1589
+			$is_display = false;
1590
+		}
1591
+	}
1592 1592
     
1593
-    if ($tab == 'post_info')
1594
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1593
+	if ($tab == 'post_info')
1594
+		$is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1595 1595
     
1596
-    if ($tab == 'post_images')
1597
-        $is_display = (!empty($post_images)) ? true : false;
1596
+	if ($tab == 'post_images')
1597
+		$is_display = (!empty($post_images)) ? true : false;
1598 1598
 
1599
-    if ($tab == 'post_video')
1600
-        $is_display = (!empty($video)) ? true : false;
1599
+	if ($tab == 'post_video')
1600
+		$is_display = (!empty($video)) ? true : false;
1601 1601
 
1602
-    if ($tab == 'special_offers')
1603
-        $is_display = (!empty($special_offers)) ? true : false;
1602
+	if ($tab == 'special_offers')
1603
+		$is_display = (!empty($special_offers)) ? true : false;
1604 1604
 
1605
-    if ($tab == 'reviews')
1606
-        $is_display = (geodir_is_page('detail')) ? true : false;
1605
+	if ($tab == 'reviews')
1606
+		$is_display = (geodir_is_page('detail')) ? true : false;
1607 1607
 
1608
-    if ($tab == 'related_listing') {
1609
-       $message = __('No listings found which match your selection.', 'geodirectory');
1608
+	if ($tab == 'related_listing') {
1609
+	   $message = __('No listings found which match your selection.', 'geodirectory');
1610 1610
        
1611
-       /** This action is documented in geodirectory-functions/template_functions.php */
1612
-       $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1611
+	   /** This action is documented in geodirectory-functions/template_functions.php */
1612
+	   $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1613 1613
        
1614
-       $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1615
-    }
1614
+	   $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1615
+	}
1616 1616
 
1617
-    return $is_display;
1617
+	return $is_display;
1618 1618
 }
1619 1619
 
1620 1620
 
@@ -1630,69 +1630,69 @@  discard block
 block discarded – undo
1630 1630
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1631 1631
  */
1632 1632
 function geodir_changes_in_custom_fields_table() {
1633
-    global $wpdb, $plugin_prefix;
1633
+	global $wpdb, $plugin_prefix;
1634 1634
 	
1635 1635
 	// Remove unused virtual page
1636 1636
 	$listings_page_id = (int)get_option('geodir_listing_page');
1637 1637
 	if ($listings_page_id) {
1638 1638
 		$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')));
1639
-        delete_option('geodir_listing_page');
1639
+		delete_option('geodir_listing_page');
1640 1640
 	}
1641 1641
 
1642
-    if (!get_option('geodir_changes_in_custom_fields_table')) {
1643
-        $wpdb->query(
1644
-            $wpdb->prepare(
1645
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1646
-                array('1', '1', 'admin')
1647
-            )
1648
-        );
1642
+	if (!get_option('geodir_changes_in_custom_fields_table')) {
1643
+		$wpdb->query(
1644
+			$wpdb->prepare(
1645
+				"UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1646
+				array('1', '1', 'admin')
1647
+			)
1648
+		);
1649 1649
 
1650 1650
 
1651
-        /* --- terms meta value set --- */
1651
+		/* --- terms meta value set --- */
1652 1652
 
1653
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1653
+		update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1654 1654
 
1655
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1655
+		$options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1656 1656
 
1657
-        if (!empty($options_data)) {
1657
+		if (!empty($options_data)) {
1658 1658
 
1659
-            foreach ($options_data as $optobj) {
1659
+			foreach ($options_data as $optobj) {
1660 1660
 
1661
-                $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1661
+				$option_val = str_replace('tax_meta_', '', $optobj->option_name);
1662 1662
 
1663
-                $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)));
1663
+				$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)));
1664 1664
 
1665
-                if (!empty($taxonomies_data)) {
1665
+				if (!empty($taxonomies_data)) {
1666 1666
 
1667
-                    foreach ($taxonomies_data as $taxobj) {
1667
+					foreach ($taxonomies_data as $taxobj) {
1668 1668
 
1669
-                        $taxObject = get_taxonomy($taxobj->taxonomy);
1670
-                        $post_type = $taxObject->object_type[0];
1669
+						$taxObject = get_taxonomy($taxobj->taxonomy);
1670
+						$post_type = $taxObject->object_type[0];
1671 1671
 
1672
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1672
+						$opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1673 1673
 
1674
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1674
+						$duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1675 1675
 
1676
-                        if ($duplicate_data) {
1676
+						if ($duplicate_data) {
1677 1677
 
1678
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1678
+							$wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1679 1679
 
1680
-                        } else {
1680
+						} else {
1681 1681
 
1682
-                            $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)));
1682
+							$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)));
1683 1683
 
1684
-                        }
1684
+						}
1685 1685
 
1686
-                    }
1686
+					}
1687 1687
 
1688
-                }
1688
+				}
1689 1689
 
1690
-            }
1691
-        }
1690
+			}
1691
+		}
1692 1692
 
1693
-        update_option('geodir_changes_in_custom_fields_table', '1');
1693
+		update_option('geodir_changes_in_custom_fields_table', '1');
1694 1694
 
1695
-    }
1695
+	}
1696 1696
 
1697 1697
 }
1698 1698
 
@@ -1711,24 +1711,24 @@  discard block
 block discarded – undo
1711 1711
 function geodir_location_slug_check($slug)
1712 1712
 {
1713 1713
 
1714
-    global $wpdb, $table_prefix;
1714
+	global $wpdb, $table_prefix;
1715 1715
 
1716
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1716
+	$slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1717 1717
 
1718
-    if ($slug_exists) {
1718
+	if ($slug_exists) {
1719 1719
 
1720
-        $suffix = 1;
1721
-        do {
1722
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1723
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1724
-            $suffix++;
1725
-        } while ($location_slug_check && $suffix < 100);
1720
+		$suffix = 1;
1721
+		do {
1722
+			$alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1723
+			$location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1724
+			$suffix++;
1725
+		} while ($location_slug_check && $suffix < 100);
1726 1726
 
1727
-        $slug = $alt_location_name;
1727
+		$slug = $alt_location_name;
1728 1728
 
1729
-    }
1729
+	}
1730 1730
 
1731
-    return $slug;
1731
+	return $slug;
1732 1732
 
1733 1733
 }
1734 1734
 
@@ -1753,42 +1753,42 @@  discard block
 block discarded – undo
1753 1753
 function geodir_update_term_slug($term_id, $tt_id, $taxonomy)
1754 1754
 {
1755 1755
 
1756
-    global $wpdb, $plugin_prefix, $table_prefix;
1756
+	global $wpdb, $plugin_prefix, $table_prefix;
1757 1757
 
1758
-    $tern_data = get_term_by('id', $term_id, $taxonomy);
1758
+	$tern_data = get_term_by('id', $term_id, $taxonomy);
1759 1759
 
1760
-    $slug = $tern_data->slug;
1760
+	$slug = $tern_data->slug;
1761 1761
 
1762
-    /**
1763
-     * Filter if a term slug exists.
1764
-     *
1765
-     * @since 1.0.0
1766
-     * @package GeoDirectory
1767
-     * @param bool $bool Default: false.
1768
-     * @param string $slug The term slug.
1769
-     * @param int $term_id The term ID.
1770
-     */
1771
-    $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1762
+	/**
1763
+	 * Filter if a term slug exists.
1764
+	 *
1765
+	 * @since 1.0.0
1766
+	 * @package GeoDirectory
1767
+	 * @param bool $bool Default: false.
1768
+	 * @param string $slug The term slug.
1769
+	 * @param int $term_id The term ID.
1770
+	 */
1771
+	$slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1772 1772
 
1773
-    if ($slug_exists) {
1773
+	if ($slug_exists) {
1774 1774
 
1775
-        $suffix = 1;
1776
-        do {
1777
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1775
+		$suffix = 1;
1776
+		do {
1777
+			$new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1778 1778
 
1779
-            /** This action is documented in geodirectory_hooks_actions.php */
1780
-            $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1779
+			/** This action is documented in geodirectory_hooks_actions.php */
1780
+			$term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1781 1781
 
1782
-            $suffix++;
1783
-        } while ($term_slug_check && $suffix < 100);
1782
+			$suffix++;
1783
+		} while ($term_slug_check && $suffix < 100);
1784 1784
 
1785
-        $slug = $new_slug;
1785
+		$slug = $new_slug;
1786 1786
 
1787
-        //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1787
+		//wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1788 1788
 
1789
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1789
+		$wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1790 1790
 
1791
-    }
1791
+	}
1792 1792
 	
1793 1793
 	// Update tag in detail table.
1794 1794
 	$taxonomy_obj = get_taxonomy($taxonomy);
@@ -1829,21 +1829,21 @@  discard block
 block discarded – undo
1829 1829
 function geodir_term_slug_is_exists($slug_exists, $slug, $term_id)
1830 1830
 {
1831 1831
 
1832
-    global $wpdb, $table_prefix;
1832
+	global $wpdb, $table_prefix;
1833 1833
 
1834
-    $default_location = geodir_get_default_location();
1834
+	$default_location = geodir_get_default_location();
1835 1835
 
1836
-    $country_slug = $default_location->country_slug;
1837
-    $region_slug = $default_location->region_slug;
1838
-    $city_slug = $default_location->city_slug;
1836
+	$country_slug = $default_location->country_slug;
1837
+	$region_slug = $default_location->region_slug;
1838
+	$city_slug = $default_location->city_slug;
1839 1839
 
1840
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1841
-        return $slug_exists = true;
1840
+	if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1841
+		return $slug_exists = true;
1842 1842
 
1843
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1844
-        return $slug_exists = true;
1843
+	if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1844
+		return $slug_exists = true;
1845 1845
 
1846
-    return $slug_exists;
1846
+	return $slug_exists;
1847 1847
 }
1848 1848
 
1849 1849
 
@@ -1862,75 +1862,75 @@  discard block
 block discarded – undo
1862 1862
  */
1863 1863
 function geodir_custom_page_title($title = '', $sep = '')
1864 1864
 {
1865
-    global $wp;
1866
-    if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1867
-        return $title;
1868
-    }
1865
+	global $wp;
1866
+	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1867
+		return $title;
1868
+	}
1869 1869
 
1870
-    if ($sep == '') {
1871
-        /**
1872
-         * Filter the page title separator.
1873
-         *
1874
-         * @since 1.0.0
1875
-         * @package GeoDirectory
1876
-         * @param string $sep The separator, default: `|`.
1877
-         */
1878
-        $sep = apply_filters('geodir_page_title_separator', '|');
1879
-    }
1870
+	if ($sep == '') {
1871
+		/**
1872
+		 * Filter the page title separator.
1873
+		 *
1874
+		 * @since 1.0.0
1875
+		 * @package GeoDirectory
1876
+		 * @param string $sep The separator, default: `|`.
1877
+		 */
1878
+		$sep = apply_filters('geodir_page_title_separator', '|');
1879
+	}
1880 1880
 
1881 1881
 
1882
-    $gd_page = '';
1883
-    if(geodir_is_page('home')){
1884
-        $gd_page = 'home';
1885
-        $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1886
-    }
1887
-    elseif(geodir_is_page('detail')){
1888
-        $gd_page = 'detail';
1889
-        $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1890
-    }
1891
-    elseif(geodir_is_page('pt')){
1892
-        $gd_page = 'pt';
1893
-        $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1894
-    }
1895
-    elseif(geodir_is_page('listing')){
1896
-        $gd_page = 'listing';
1897
-        $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1898
-    }
1899
-    elseif(geodir_is_page('location')){
1900
-        $gd_page = 'location';
1901
-        $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1902
-    }
1903
-    elseif(geodir_is_page('search')){
1904
-        $gd_page = 'search';
1905
-        $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1906
-    }
1907
-    elseif(geodir_is_page('add-listing')){
1908
-        $gd_page = 'add-listing';
1909
-        $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1910
-    }
1911
-    elseif(geodir_is_page('author')){
1912
-        $gd_page = 'author';
1913
-        $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1914
-    }
1915
-    elseif(geodir_is_page('login')){
1916
-        $gd_page = 'login';
1917
-        $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1918
-    }
1919
-    elseif(geodir_is_page('listing-success')){
1920
-        $gd_page = 'listing-success';
1921
-        $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1922
-    }
1882
+	$gd_page = '';
1883
+	if(geodir_is_page('home')){
1884
+		$gd_page = 'home';
1885
+		$title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1886
+	}
1887
+	elseif(geodir_is_page('detail')){
1888
+		$gd_page = 'detail';
1889
+		$title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1890
+	}
1891
+	elseif(geodir_is_page('pt')){
1892
+		$gd_page = 'pt';
1893
+		$title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1894
+	}
1895
+	elseif(geodir_is_page('listing')){
1896
+		$gd_page = 'listing';
1897
+		$title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1898
+	}
1899
+	elseif(geodir_is_page('location')){
1900
+		$gd_page = 'location';
1901
+		$title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1902
+	}
1903
+	elseif(geodir_is_page('search')){
1904
+		$gd_page = 'search';
1905
+		$title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1906
+	}
1907
+	elseif(geodir_is_page('add-listing')){
1908
+		$gd_page = 'add-listing';
1909
+		$title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1910
+	}
1911
+	elseif(geodir_is_page('author')){
1912
+		$gd_page = 'author';
1913
+		$title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1914
+	}
1915
+	elseif(geodir_is_page('login')){
1916
+		$gd_page = 'login';
1917
+		$title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1918
+	}
1919
+	elseif(geodir_is_page('listing-success')){
1920
+		$gd_page = 'listing-success';
1921
+		$title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1922
+	}
1923 1923
 
1924 1924
 
1925
-    /**
1926
-     * Filter page meta title to replace variables.
1927
-     *
1928
-     * @since 1.5.4
1929
-     * @param string $title The page title including variables.
1930
-     * @param string $gd_page The GeoDirectory page type if any.
1931
-     * @param string $sep The title separator symbol.
1932
-     */
1933
-    return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1925
+	/**
1926
+	 * Filter page meta title to replace variables.
1927
+	 *
1928
+	 * @since 1.5.4
1929
+	 * @param string $title The page title including variables.
1930
+	 * @param string $gd_page The GeoDirectory page type if any.
1931
+	 * @param string $sep The title separator symbol.
1932
+	 */
1933
+	return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1934 1934
 
1935 1935
 }
1936 1936
 
@@ -1946,36 +1946,36 @@  discard block
 block discarded – undo
1946 1946
 function geodir_set_post_attachment()
1947 1947
 {
1948 1948
 
1949
-    if (!get_option('geodir_set_post_attachments')) {
1949
+	if (!get_option('geodir_set_post_attachments')) {
1950 1950
 
1951
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1952
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1951
+		require_once(ABSPATH . 'wp-admin/includes/image.php');
1952
+		require_once(ABSPATH . 'wp-admin/includes/file.php');
1953 1953
 
1954
-        $all_postypes = geodir_get_posttypes();
1954
+		$all_postypes = geodir_get_posttypes();
1955 1955
 
1956
-        foreach($all_postypes as $post_type){
1957
-            $args = array(
1958
-                'posts_per_page' => -1,
1959
-                'post_type' => $post_type,
1960
-                'post_status' => 'publish');
1956
+		foreach($all_postypes as $post_type){
1957
+			$args = array(
1958
+				'posts_per_page' => -1,
1959
+				'post_type' => $post_type,
1960
+				'post_status' => 'publish');
1961 1961
 
1962
-            $posts_array = get_posts($args);
1962
+			$posts_array = get_posts($args);
1963 1963
 
1964
-            if (!empty($posts_array)) {
1964
+			if (!empty($posts_array)) {
1965 1965
 
1966
-                foreach ($posts_array as $post) {
1966
+				foreach ($posts_array as $post) {
1967 1967
 
1968
-                    geodir_set_wp_featured_image($post->ID);
1968
+					geodir_set_wp_featured_image($post->ID);
1969 1969
 
1970
-                }
1970
+				}
1971 1971
 
1972
-            }
1973
-        }
1972
+			}
1973
+		}
1974 1974
 
1975 1975
 
1976
-        update_option('geodir_set_post_attachments', '1');
1976
+		update_option('geodir_set_post_attachments', '1');
1977 1977
 
1978
-    }
1978
+	}
1979 1979
 
1980 1980
 }
1981 1981
 
@@ -1992,19 +1992,19 @@  discard block
 block discarded – undo
1992 1992
 function geodir_remove_url_seperator()
1993 1993
 {
1994 1994
 
1995
-    if (!get_option('geodir_remove_url_seperator')) {
1995
+	if (!get_option('geodir_remove_url_seperator')) {
1996 1996
 
1997
-        if (get_option('geodir_listingurl_separator'))
1998
-            delete_option('geodir_listingurl_separator');
1997
+		if (get_option('geodir_listingurl_separator'))
1998
+			delete_option('geodir_listingurl_separator');
1999 1999
 
2000
-        if (get_option('geodir_detailurl_separator'))
2001
-            delete_option('geodir_detailurl_separator');
2000
+		if (get_option('geodir_detailurl_separator'))
2001
+			delete_option('geodir_detailurl_separator');
2002 2002
 
2003
-        flush_rewrite_rules(false);
2003
+		flush_rewrite_rules(false);
2004 2004
 
2005
-        update_option('geodir_remove_url_seperator', '1');
2005
+		update_option('geodir_remove_url_seperator', '1');
2006 2006
 
2007
-    }
2007
+	}
2008 2008
 
2009 2009
 }
2010 2010
 
@@ -2020,19 +2020,19 @@  discard block
 block discarded – undo
2020 2020
  */
2021 2021
 function geodir_remove_url_seperator_form_permalink_settings($permalink_arr)
2022 2022
 {
2023
-    foreach ($permalink_arr as $key => $value) {
2023
+	foreach ($permalink_arr as $key => $value) {
2024 2024
 
2025
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2026
-            unset($permalink_arr[$key]);
2025
+		if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2026
+			unset($permalink_arr[$key]);
2027 2027
 
2028
-    }
2028
+	}
2029 2029
 
2030
-    return $permalink_arr;
2030
+	return $permalink_arr;
2031 2031
 
2032 2032
 }
2033 2033
 
2034 2034
 if (!is_admin()) {
2035
-    add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2035
+	add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2036 2036
 }
2037 2037
 /**
2038 2038
  * Set status from draft to publish.
@@ -2045,16 +2045,16 @@  discard block
 block discarded – undo
2045 2045
  */
2046 2046
 function geodir_set_status_draft_to_publish_for_own_post($post)
2047 2047
 {
2048
-    $user_id = get_current_user_id();
2048
+	$user_id = get_current_user_id();
2049 2049
 
2050
-    if(!$user_id){return $post;}
2050
+	if(!$user_id){return $post;}
2051 2051
 
2052
-    $gd_post_types = geodir_get_posttypes();
2052
+	$gd_post_types = geodir_get_posttypes();
2053 2053
 
2054
-    if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2055
-        $post[0]->post_status = 'publish';
2056
-    }
2057
-    return $post;
2054
+	if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2055
+		$post[0]->post_status = 'publish';
2056
+	}
2057
+	return $post;
2058 2058
 }
2059 2059
 
2060 2060
 
@@ -2146,33 +2146,33 @@  discard block
 block discarded – undo
2146 2146
  */
2147 2147
 function geodir_detail_page_tab_headings_change($tabs_arr)
2148 2148
 {
2149
-    global $wpdb;
2149
+	global $wpdb;
2150 2150
 
2151
-    $post_type = geodir_get_current_posttype();
2151
+	$post_type = geodir_get_current_posttype();
2152 2152
 
2153
-    $all_postypes = geodir_get_posttypes();
2153
+	$all_postypes = geodir_get_posttypes();
2154 2154
 
2155
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2155
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2156 2156
 
2157
-        if (array_key_exists('post_video', $tabs_arr)) {
2157
+		if (array_key_exists('post_video', $tabs_arr)) {
2158 2158
 
2159
-            $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)));
2159
+			$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)));
2160 2160
 
2161
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2162
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2163
-        }
2161
+			if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2162
+				$tabs_arr['post_video']['heading_text'] = $field_title;
2163
+		}
2164 2164
 
2165
-        if (array_key_exists('special_offers', $tabs_arr)) {
2165
+		if (array_key_exists('special_offers', $tabs_arr)) {
2166 2166
 
2167
-            $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)));
2167
+			$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)));
2168 2168
 
2169
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2170
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2171
-        }
2169
+			if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2170
+				$tabs_arr['special_offers']['heading_text'] = $field_title;
2171
+		}
2172 2172
 
2173
-    }
2173
+	}
2174 2174
 
2175
-    return $tabs_arr;
2175
+	return $tabs_arr;
2176 2176
 
2177 2177
 }
2178 2178
 
@@ -2185,10 +2185,10 @@  discard block
 block discarded – undo
2185 2185
  */
2186 2186
 function geodir_remove_template_redirect_actions()
2187 2187
 {
2188
-    if (geodir_is_page('login')){
2189
-        remove_all_actions('template_redirect');
2190
-        remove_action('init', 'avia_modify_front', 10);
2191
-    }
2188
+	if (geodir_is_page('login')){
2189
+		remove_all_actions('template_redirect');
2190
+		remove_action('init', 'avia_modify_front', 10);
2191
+	}
2192 2192
 }
2193 2193
 
2194 2194
 
@@ -2210,51 +2210,51 @@  discard block
 block discarded – undo
2210 2210
 function geodirectory_before_featured_image_delete($attachment_id)
2211 2211
 {
2212 2212
 
2213
-    global $wpdb, $plugin_prefix;
2213
+	global $wpdb, $plugin_prefix;
2214 2214
 
2215
-    $post_id = get_post_field('post_parent', $attachment_id);
2215
+	$post_id = get_post_field('post_parent', $attachment_id);
2216 2216
 
2217
-    $attachment_url = wp_get_attachment_url($attachment_id);
2217
+	$attachment_url = wp_get_attachment_url($attachment_id);
2218 2218
 
2219
-    if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2219
+	if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2220 2220
 
2221
-        $post_type = get_post_type($post_id);
2221
+		$post_type = get_post_type($post_id);
2222 2222
 
2223
-        $all_postypes = geodir_get_posttypes();
2223
+		$all_postypes = geodir_get_posttypes();
2224 2224
 
2225
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2226
-            return false;
2225
+		if (!in_array($post_type, $all_postypes) || !is_admin())
2226
+			return false;
2227 2227
 
2228
-        $uploads = wp_upload_dir();
2228
+		$uploads = wp_upload_dir();
2229 2229
 
2230
-        $split_img_path = explode($uploads['baseurl'], $attachment_url);
2230
+		$split_img_path = explode($uploads['baseurl'], $attachment_url);
2231 2231
 
2232
-        $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2232
+		$split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2233 2233
 
2234
-        $wpdb->query(
2235
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2236
-                array($post_id, $split_img_file_path)
2237
-            )
2238
-        );
2234
+		$wpdb->query(
2235
+			$wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2236
+				array($post_id, $split_img_file_path)
2237
+			)
2238
+		);
2239 2239
 
2240
-        $attachment_data = $wpdb->get_row(
2241
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2242
-                array($post_id)
2243
-            )
2244
-        );
2240
+		$attachment_data = $wpdb->get_row(
2241
+			$wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2242
+				array($post_id)
2243
+			)
2244
+		);
2245 2245
 
2246
-        if (!empty($attachment_data)) {
2247
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2248
-        }
2246
+		if (!empty($attachment_data)) {
2247
+			$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2248
+		}
2249 2249
 
2250 2250
 
2251
-        $table_name = $plugin_prefix . $post_type . '_detail';
2251
+		$table_name = $plugin_prefix . $post_type . '_detail';
2252 2252
 
2253
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2253
+		$wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2254 2254
 
2255
-        geodir_set_wp_featured_image($post_id);
2255
+		geodir_set_wp_featured_image($post_id);
2256 2256
 
2257
-    }
2257
+	}
2258 2258
 
2259 2259
 }
2260 2260
 
@@ -2272,79 +2272,79 @@  discard block
 block discarded – undo
2272 2272
 function geodir_temp_set_post_attachment()
2273 2273
 {
2274 2274
 
2275
-    global $wpdb, $plugin_prefix;
2275
+	global $wpdb, $plugin_prefix;
2276 2276
 
2277
-    $all_postypes = geodir_get_posttypes();
2277
+	$all_postypes = geodir_get_posttypes();
2278 2278
 
2279
-    foreach ($all_postypes as $posttype) {
2279
+	foreach ($all_postypes as $posttype) {
2280 2280
 
2281
-        $tablename = $plugin_prefix . $posttype . '_detail';
2281
+		$tablename = $plugin_prefix . $posttype . '_detail';
2282 2282
 
2283
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2283
+		$get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2284 2284
 
2285
-        if (!empty($get_post_data)) {
2285
+		if (!empty($get_post_data)) {
2286 2286
 
2287
-            foreach ($get_post_data as $data) {
2287
+			foreach ($get_post_data as $data) {
2288 2288
 
2289
-                $post_id = $data->post_id;
2289
+				$post_id = $data->post_id;
2290 2290
 
2291
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2291
+				$attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2292 2292
 
2293
-                if (!empty($attachment_data)) {
2293
+				if (!empty($attachment_data)) {
2294 2294
 
2295
-                    foreach ($attachment_data as $attach) {
2295
+					foreach ($attachment_data as $attach) {
2296 2296
 
2297
-                        $file_info = pathinfo($attach->file);
2297
+						$file_info = pathinfo($attach->file);
2298 2298
 
2299
-                        $sub_dir = '';
2300
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2301
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2299
+						$sub_dir = '';
2300
+						if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2301
+							$sub_dir = stripslashes_deep($file_info['dirname']);
2302 2302
 
2303
-                        $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2304
-                        $uploads_path = $uploads['basedir'];
2303
+						$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2304
+						$uploads_path = $uploads['basedir'];
2305 2305
 
2306
-                        $file_name = $file_info['basename'];
2306
+						$file_name = $file_info['basename'];
2307 2307
 
2308
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2308
+						$img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2309 2309
 
2310
-                        if (!file_exists($img_arr['path'])) {
2310
+						if (!file_exists($img_arr['path'])) {
2311 2311
 
2312
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2312
+							$wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2313 2313
 
2314
-                        }
2314
+						}
2315 2315
 
2316
-                    }
2316
+					}
2317 2317
 
2318
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2318
+					$attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2319 2319
 
2320
-                    if (!empty($attachment_data)) {
2320
+					if (!empty($attachment_data)) {
2321 2321
 
2322
-                        if ($attachment_data->ID)
2323
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2322
+						if ($attachment_data->ID)
2323
+							$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2324 2324
 
2325
-                    } else {
2325
+					} else {
2326 2326
 
2327
-                        if (has_post_thumbnail($post_id)) {
2327
+						if (has_post_thumbnail($post_id)) {
2328 2328
 
2329
-                            $post_thumbnail_id = get_post_thumbnail_id($post_id);
2329
+							$post_thumbnail_id = get_post_thumbnail_id($post_id);
2330 2330
 
2331
-                            wp_delete_attachment($post_thumbnail_id);
2331
+							wp_delete_attachment($post_thumbnail_id);
2332 2332
 
2333
-                        }
2333
+						}
2334 2334
 
2335
-                    }
2335
+					}
2336 2336
 
2337
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2337
+					$wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2338 2338
 
2339
-                    geodir_set_wp_featured_image($post_id);
2339
+					geodir_set_wp_featured_image($post_id);
2340 2340
 
2341
-                }
2341
+				}
2342 2342
 
2343
-            }
2343
+			}
2344 2344
 
2345
-        }
2345
+		}
2346 2346
 
2347
-    }
2347
+	}
2348 2348
 
2349 2349
 }
2350 2350
 
@@ -2362,9 +2362,9 @@  discard block
 block discarded – undo
2362 2362
 function geodir_default_rating_star_icon()
2363 2363
 {
2364 2364
 
2365
-    if (!get_option('geodir_default_rating_star_icon')) {
2366
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2367
-    }
2365
+	if (!get_option('geodir_default_rating_star_icon')) {
2366
+		update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2367
+	}
2368 2368
 
2369 2369
 }
2370 2370
 
@@ -2382,27 +2382,27 @@  discard block
 block discarded – undo
2382 2382
  */
2383 2383
 function geodir_user_post_listing_count($user_id=null)
2384 2384
 {
2385
-    global $wpdb, $plugin_prefix, $current_user;
2386
-    if(!$user_id){
2387
-        $user_id = $current_user->ID;
2388
-    }
2385
+	global $wpdb, $plugin_prefix, $current_user;
2386
+	if(!$user_id){
2387
+		$user_id = $current_user->ID;
2388
+	}
2389 2389
 
2390
-    $user_id = $current_user->ID;
2391
-    $all_postypes = geodir_get_posttypes();
2392
-    $all_posts = get_option('geodir_listing_link_user_dashboard');
2390
+	$user_id = $current_user->ID;
2391
+	$all_postypes = geodir_get_posttypes();
2392
+	$all_posts = get_option('geodir_listing_link_user_dashboard');
2393 2393
 
2394
-    $user_listing = array();
2395
-    if (is_array($all_posts) && !empty($all_posts)) {
2396
-        foreach ($all_posts as $ptype) {
2397
-            $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' )");
2394
+	$user_listing = array();
2395
+	if (is_array($all_posts) && !empty($all_posts)) {
2396
+		foreach ($all_posts as $ptype) {
2397
+			$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' )");
2398 2398
 
2399
-            if ($total_posts > 0) {
2400
-                $user_listing[$ptype] = $total_posts;
2401
-            }
2402
-        }
2403
-    }
2399
+			if ($total_posts > 0) {
2400
+				$user_listing[$ptype] = $total_posts;
2401
+			}
2402
+		}
2403
+	}
2404 2404
 
2405
-    return $user_listing;
2405
+	return $user_listing;
2406 2406
 }
2407 2407
 
2408 2408
 
@@ -2422,192 +2422,192 @@  discard block
 block discarded – undo
2422 2422
  */
2423 2423
 function geodir_detail_page_custom_field_tab($tabs_arr)
2424 2424
 {
2425
-    global $post;
2426
-
2427
-    $post_type = geodir_get_current_posttype();
2428
-    $all_postypes = geodir_get_posttypes();
2429
-
2430
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2431
-        $package_info = array();
2432
-        $package_info = geodir_post_package_info($package_info, $post);
2433
-        $post_package_id = !empty($package_info->pid) ? $package_info->pid : '';
2434
-        $fields_location = 'owntab';
2435
-
2436
-        $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2437
-
2438
-        //remove video and special offers if it is already set to show
2439
-        if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2440
-            $unset_video = true;
2441
-        }
2442
-
2443
-        if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2444
-            $unset_special_offers = true;
2445
-        }
2446
-        if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2447
-            foreach($custom_fields as $key => $custom_field){
2448
-                if($custom_field['name']=='geodir_video' && isset($unset_video)){
2449
-                    unset($custom_fields[$key]);
2450
-                }
2451
-                if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2452
-                    unset($custom_fields[$key]);
2453
-                }
2454
-            }
2455
-        }
2456
-
2457
-
2425
+	global $post;
2458 2426
 
2459
-        if (!empty($custom_fields)) {
2460
-            $parse_custom_fields = array();
2461
-            foreach ($custom_fields as $field) {
2462
-                $field = stripslashes_deep($field); // strip slashes
2463
-                
2464
-                $type = $field;
2465
-                $field_name = $field['htmlvar_name'];
2466
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2467
-                    $post->{$field_name} = $_REQUEST[$field_name];
2468
-                }
2469
-
2470
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((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'))) {
2471
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2472
-                        continue;
2473
-                    }
2427
+	$post_type = geodir_get_current_posttype();
2428
+	$all_postypes = geodir_get_posttypes();
2474 2429
 
2475
-                    $parse_custom_fields[] = $field;
2476
-                }
2477
-            }
2478
-            $custom_fields = $parse_custom_fields;
2479
-        }
2480
-        //print_r($custom_fields);
2481
-        if (!empty($custom_fields)) {
2430
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2431
+		$package_info = array();
2432
+		$package_info = geodir_post_package_info($package_info, $post);
2433
+		$post_package_id = !empty($package_info->pid) ? $package_info->pid : '';
2434
+		$fields_location = 'owntab';
2482 2435
 
2483
-            global $field_set_start;
2436
+		$custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2484 2437
 
2485
-            $post = stripslashes_deep($post); // strip slashes
2486
-            
2487
-            $field_set_start = 0;
2488
-            $fieldset_count = 0;
2489
-            $fieldset = '';
2490
-            $total_fields = count($custom_fields);
2491
-            $count_field = 0;
2492
-            $fieldset_arr = array();
2493
-            $i = 0;
2494
-            $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2495
-
2496
-            foreach ($custom_fields as $field) {
2497
-                $count_field++;
2498
-                $field_name = $field['htmlvar_name'];
2499
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2500
-                    $post->{$field_name} = $_REQUEST[$field_name];
2501
-                }
2438
+		//remove video and special offers if it is already set to show
2439
+		if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2440
+			$unset_video = true;
2441
+		}
2502 2442
 
2503
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((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'))) {
2504
-                    $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2505
-                    $site_title = trim($field['site_title']);
2506
-                    $type = $field;
2507
-                    $variables_array = array();
2443
+		if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2444
+			$unset_special_offers = true;
2445
+		}
2446
+		if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2447
+			foreach($custom_fields as $key => $custom_field){
2448
+				if($custom_field['name']=='geodir_video' && isset($unset_video)){
2449
+					unset($custom_fields[$key]);
2450
+				}
2451
+				if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2452
+					unset($custom_fields[$key]);
2453
+				}
2454
+			}
2455
+		}
2508 2456
 
2509
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2510
-                        continue;
2511
-                    }
2512 2457
 
2513
-                    if ($type['type'] != 'fieldset') {
2514
-                        $i++;
2515
-                        $variables_array['post_id'] = $post->ID;
2516
-                        $variables_array['label'] = __($type['site_title'], 'geodirectory');
2517
-                        $variables_array['value'] = '';
2518
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
2519
-                    }else{
2520
-                        $i = 0;
2521
-                        $fieldset_count++;
2522
-                        $field_set_start = 1;
2523
-                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2524
-                        $fieldset_arr[$fieldset_count]['label'] = $label;
2525
-                    }
2526 2458
 
2459
+		if (!empty($custom_fields)) {
2460
+			$parse_custom_fields = array();
2461
+			foreach ($custom_fields as $field) {
2462
+				$field = stripslashes_deep($field); // strip slashes
2463
+                
2464
+				$type = $field;
2465
+				$field_name = $field['htmlvar_name'];
2466
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2467
+					$post->{$field_name} = $_REQUEST[$field_name];
2468
+				}
2469
+
2470
+				if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((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'))) {
2471
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2472
+						continue;
2473
+					}
2474
+
2475
+					$parse_custom_fields[] = $field;
2476
+				}
2477
+			}
2478
+			$custom_fields = $parse_custom_fields;
2479
+		}
2480
+		//print_r($custom_fields);
2481
+		if (!empty($custom_fields)) {
2527 2482
 
2528
-                    if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2529
-                    $type = stripslashes_deep($type); // strip slashes
2530
-                    if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2531
-                    $html = '';
2532
-                    $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2533
-                    if($html_var=='post'){$html_var='post_address';}
2534
-                    $field_icon = geodir_field_icon_proccess($type);
2535
-                    $filed_type = $type['type'];
2536
-
2537
-                    /**
2538
-                     * Filter the output for custom fields.
2539
-                     *
2540
-                     * Here we can remove or add new functions depending on the field type.
2541
-                     *
2542
-                     * @param string $html The html to be filtered (blank).
2543
-                     * @param string $fields_location The location the field is to be show.
2544
-                     * @param array $type The array of field values.
2545
-                     */
2546
-                    $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2547
-
2548
-
2549
-                    /**
2550
-                     * Filter custom field output in tab.
2551
-                     *
2552
-                     * @since 1.5.6
2553
-                     *
2554
-                     * @param string $html_var The HTML variable name for the field.
2555
-                     * @param string $html Custom field unfiltered HTML.
2556
-                     * @param array $variables_array Custom field variables array.
2557
-                     */
2558
-                    $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2559
-
2560
-                    $fieldset_html = '';
2561
-                    if ($field_set_start == 1) {
2562
-                        $add_html = false;
2563
-                        if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2564
-                            if ($fieldset != '') {
2565
-                                $add_html = true;
2566
-                                $label = $fieldset_arr[$fieldset_count - 1]['label'];
2567
-                                $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2568
-                            }
2569
-                            $fieldset_html = $fieldset;
2570
-                            $fieldset = '';
2571
-                        } else {
2572
-                            $fieldset .= $html;
2573
-                            if ($total_fields == $count_field && $fieldset != '') {
2574
-                                $add_html = true;
2575
-                                $label = $fieldset_arr[$fieldset_count]['label'];
2576
-                                $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2577
-                                $fieldset_html = $fieldset;
2578
-                            }
2579
-                        }
2483
+			global $field_set_start;
2580 2484
 
2581
-                        if ($add_html) {
2582
-                            $tabs_arr[$htmlvar_name] = array(
2583
-                                'heading_text' => __($label, 'geodirectory'),
2584
-                                'is_active_tab' => false,
2585
-                                /**
2586
-                                 * Filter if a custom field should be displayed on the details page tab.
2587
-                                 *
2588
-                                 * @since 1.0.0
2589
-                                 * @param string $htmlvar_name The field HTML var name.
2590
-                                 */
2591
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2592
-                                'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2593
-                            );
2594
-                        }
2595
-                    } else {
2596
-                        if ($html != '') {
2597
-                            $tabs_arr[$field['htmlvar_name']] = array(
2598
-                                'heading_text' => __($label, 'geodirectory'),
2599
-                                'is_active_tab' => false,
2600
-                                /** This action is documented in geodirectory_hooks_actions.php */
2601
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2602
-                                'tab_content' => $html
2603
-                            );
2604
-                        }
2605
-                    }
2606
-                }
2607
-            }
2608
-        }
2609
-    }
2610
-    return $tabs_arr;
2485
+			$post = stripslashes_deep($post); // strip slashes
2486
+            
2487
+			$field_set_start = 0;
2488
+			$fieldset_count = 0;
2489
+			$fieldset = '';
2490
+			$total_fields = count($custom_fields);
2491
+			$count_field = 0;
2492
+			$fieldset_arr = array();
2493
+			$i = 0;
2494
+			$geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2495
+
2496
+			foreach ($custom_fields as $field) {
2497
+				$count_field++;
2498
+				$field_name = $field['htmlvar_name'];
2499
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2500
+					$post->{$field_name} = $_REQUEST[$field_name];
2501
+				}
2502
+
2503
+				if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((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'))) {
2504
+					$label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2505
+					$site_title = trim($field['site_title']);
2506
+					$type = $field;
2507
+					$variables_array = array();
2508
+
2509
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2510
+						continue;
2511
+					}
2512
+
2513
+					if ($type['type'] != 'fieldset') {
2514
+						$i++;
2515
+						$variables_array['post_id'] = $post->ID;
2516
+						$variables_array['label'] = __($type['site_title'], 'geodirectory');
2517
+						$variables_array['value'] = '';
2518
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
2519
+					}else{
2520
+						$i = 0;
2521
+						$fieldset_count++;
2522
+						$field_set_start = 1;
2523
+						$fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2524
+						$fieldset_arr[$fieldset_count]['label'] = $label;
2525
+					}
2526
+
2527
+
2528
+					if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2529
+					$type = stripslashes_deep($type); // strip slashes
2530
+					if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2531
+					$html = '';
2532
+					$html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2533
+					if($html_var=='post'){$html_var='post_address';}
2534
+					$field_icon = geodir_field_icon_proccess($type);
2535
+					$filed_type = $type['type'];
2536
+
2537
+					/**
2538
+					 * Filter the output for custom fields.
2539
+					 *
2540
+					 * Here we can remove or add new functions depending on the field type.
2541
+					 *
2542
+					 * @param string $html The html to be filtered (blank).
2543
+					 * @param string $fields_location The location the field is to be show.
2544
+					 * @param array $type The array of field values.
2545
+					 */
2546
+					$html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2547
+
2548
+
2549
+					/**
2550
+					 * Filter custom field output in tab.
2551
+					 *
2552
+					 * @since 1.5.6
2553
+					 *
2554
+					 * @param string $html_var The HTML variable name for the field.
2555
+					 * @param string $html Custom field unfiltered HTML.
2556
+					 * @param array $variables_array Custom field variables array.
2557
+					 */
2558
+					$html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2559
+
2560
+					$fieldset_html = '';
2561
+					if ($field_set_start == 1) {
2562
+						$add_html = false;
2563
+						if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2564
+							if ($fieldset != '') {
2565
+								$add_html = true;
2566
+								$label = $fieldset_arr[$fieldset_count - 1]['label'];
2567
+								$htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2568
+							}
2569
+							$fieldset_html = $fieldset;
2570
+							$fieldset = '';
2571
+						} else {
2572
+							$fieldset .= $html;
2573
+							if ($total_fields == $count_field && $fieldset != '') {
2574
+								$add_html = true;
2575
+								$label = $fieldset_arr[$fieldset_count]['label'];
2576
+								$htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2577
+								$fieldset_html = $fieldset;
2578
+							}
2579
+						}
2580
+
2581
+						if ($add_html) {
2582
+							$tabs_arr[$htmlvar_name] = array(
2583
+								'heading_text' => __($label, 'geodirectory'),
2584
+								'is_active_tab' => false,
2585
+								/**
2586
+								 * Filter if a custom field should be displayed on the details page tab.
2587
+								 *
2588
+								 * @since 1.0.0
2589
+								 * @param string $htmlvar_name The field HTML var name.
2590
+								 */
2591
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2592
+								'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2593
+							);
2594
+						}
2595
+					} else {
2596
+						if ($html != '') {
2597
+							$tabs_arr[$field['htmlvar_name']] = array(
2598
+								'heading_text' => __($label, 'geodirectory'),
2599
+								'is_active_tab' => false,
2600
+								/** This action is documented in geodirectory_hooks_actions.php */
2601
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2602
+								'tab_content' => $html
2603
+							);
2604
+						}
2605
+					}
2606
+				}
2607
+			}
2608
+		}
2609
+	}
2610
+	return $tabs_arr;
2611 2611
 }
2612 2612
 
2613 2613
 /* display add listing page for wpml */
@@ -2631,37 +2631,37 @@  discard block
 block discarded – undo
2631 2631
  */
2632 2632
 function geodir_add_post_status_author_page()
2633 2633
 {
2634
-    global $wpdb, $post;
2635
-
2636
-    $html = '';
2637
-    if (get_current_user_id()) {
2638
-        if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
2639
-
2640
-            // 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.
2641
-            $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
2642
-            $status = "<strong>(";
2643
-            $status_icon = '<i class="fa fa-play"></i>';
2644
-            if ($real_status == 'publish') {
2645
-                $status .= __('Published', 'geodirectory');
2646
-            } else {
2647
-                $status .= __('Not published', 'geodirectory');
2648
-                $status_icon = '<i class="fa fa-pause"></i>';
2649
-            }
2650
-            $status .= ")</strong>";
2634
+	global $wpdb, $post;
2635
+
2636
+	$html = '';
2637
+	if (get_current_user_id()) {
2638
+		if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
2639
+
2640
+			// 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.
2641
+			$real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
2642
+			$status = "<strong>(";
2643
+			$status_icon = '<i class="fa fa-play"></i>';
2644
+			if ($real_status == 'publish') {
2645
+				$status .= __('Published', 'geodirectory');
2646
+			} else {
2647
+				$status .= __('Not published', 'geodirectory');
2648
+				$status_icon = '<i class="fa fa-pause"></i>';
2649
+			}
2650
+			$status .= ")</strong>";
2651 2651
 
2652
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2653
-        }
2654
-    }
2652
+			$html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2653
+		}
2654
+	}
2655 2655
 
2656
-    if ($html != '') {
2657
-        /**
2658
-         * Filter the post status text on the author page.
2659
-         *
2660
-         * @since 1.0.0
2661
-         * @param string $html The HTML of the status.
2662
-         */
2663
-        echo apply_filters('geodir_filter_status_text_on_author_page', $html);
2664
-    }
2656
+	if ($html != '') {
2657
+		/**
2658
+		 * Filter the post status text on the author page.
2659
+		 *
2660
+		 * @since 1.0.0
2661
+		 * @param string $html The HTML of the status.
2662
+		 */
2663
+		echo apply_filters('geodir_filter_status_text_on_author_page', $html);
2664
+	}
2665 2665
 
2666 2666
 
2667 2667
 }
@@ -2675,21 +2675,21 @@  discard block
 block discarded – undo
2675 2675
  */
2676 2676
 function geodir_init_no_rating()
2677 2677
 {
2678
-    if (get_option('geodir_disable_rating')) {
2679
-        remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
2680
-        remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
2681
-        remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
2682
-        remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
2683
-        remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
2684
-        remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
2685
-        remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
2686
-
2687
-        add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
2688
-        add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
2689
-        add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
2690
-        add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
2691
-        add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
2692
-    }
2678
+	if (get_option('geodir_disable_rating')) {
2679
+		remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
2680
+		remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
2681
+		remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
2682
+		remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
2683
+		remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
2684
+		remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
2685
+		remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
2686
+
2687
+		add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
2688
+		add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
2689
+		add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
2690
+		add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
2691
+		add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
2692
+	}
2693 2693
 }
2694 2694
 
2695 2695
 /**
@@ -2701,24 +2701,24 @@  discard block
 block discarded – undo
2701 2701
  */
2702 2702
 function geodir_no_rating_rating_fields()
2703 2703
 {
2704
-    global $post;
2704
+	global $post;
2705 2705
 
2706
-    $post_types = geodir_get_posttypes();
2706
+	$post_types = geodir_get_posttypes();
2707 2707
 
2708
-    if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
2709
-        if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
2710
-            if (get_option('geodir_reviewrating_enable_rating')) {
2711
-                echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
2712
-            } else {
2713
-                echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2714
-            }
2715
-            if (get_option('geodir_reviewrating_enable_images')) {
2716
-                geodir_reviewrating_rating_img_html();
2717
-            }
2718
-        } else {
2719
-            echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2720
-        }
2721
-    }
2708
+	if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
2709
+		if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
2710
+			if (get_option('geodir_reviewrating_enable_rating')) {
2711
+				echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
2712
+			} else {
2713
+				echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2714
+			}
2715
+			if (get_option('geodir_reviewrating_enable_images')) {
2716
+				geodir_reviewrating_rating_img_html();
2717
+			}
2718
+		} else {
2719
+			echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2720
+		}
2721
+	}
2722 2722
 }
2723 2723
 
2724 2724
 /**
@@ -2732,11 +2732,11 @@  discard block
 block discarded – undo
2732 2732
  */
2733 2733
 function geodir_no_rating_comment_text($content, $comment = '')
2734 2734
 {
2735
-    if (!is_admin()) {
2736
-        return '<div class="description">' . $content . '</div>';
2737
-    } else {
2738
-        return $content;
2739
-    }
2735
+	if (!is_admin()) {
2736
+		return '<div class="description">' . $content . '</div>';
2737
+	} else {
2738
+		return $content;
2739
+	}
2740 2740
 }
2741 2741
 
2742 2742
 /**
@@ -2749,7 +2749,7 @@  discard block
 block discarded – undo
2749 2749
  */
2750 2750
 function geodir_no_rating_review_rating_html($content = '')
2751 2751
 {
2752
-    return NULL;
2752
+	return NULL;
2753 2753
 }
2754 2754
 
2755 2755
 /**
@@ -2763,19 +2763,19 @@  discard block
 block discarded – undo
2763 2763
  */
2764 2764
 function geodir_no_rating_get_sort_options($options, $post_type = '')
2765 2765
 {
2766
-    $new_options = array();
2767
-    if (!empty($options)) {
2768
-        foreach ($options as $option) {
2769
-            if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
2770
-                continue;
2771
-            }
2772
-            $new_options[] = $option;
2773
-        }
2766
+	$new_options = array();
2767
+	if (!empty($options)) {
2768
+		foreach ($options as $option) {
2769
+			if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
2770
+				continue;
2771
+			}
2772
+			$new_options[] = $option;
2773
+		}
2774 2774
 
2775
-        $options = $new_options;
2776
-    }
2775
+		$options = $new_options;
2776
+	}
2777 2777
 
2778
-    return $options;
2778
+	return $options;
2779 2779
 }
2780 2780
 
2781 2781
 add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100);
@@ -2789,11 +2789,11 @@  discard block
 block discarded – undo
2789 2789
  */
2790 2790
 function geodir_all_js_msg_no_rating($msg = array())
2791 2791
 {
2792
-    if (get_option('geodir_disable_rating')) {
2793
-        $msg['gd_cmt_no_rating'] = true;
2794
-    }
2792
+	if (get_option('geodir_disable_rating')) {
2793
+		$msg['gd_cmt_no_rating'] = true;
2794
+	}
2795 2795
 
2796
-    return $msg;
2796
+	return $msg;
2797 2797
 }
2798 2798
 
2799 2799
 add_filter('body_class', 'geodir_body_class_no_rating', 100);
@@ -2807,13 +2807,13 @@  discard block
 block discarded – undo
2807 2807
  */
2808 2808
 function geodir_body_class_no_rating($classes = array())
2809 2809
 {
2810
-    if (get_option('geodir_disable_rating')) {
2811
-        $classes[] = 'gd-no-rating';
2812
-    }
2810
+	if (get_option('geodir_disable_rating')) {
2811
+		$classes[] = 'gd-no-rating';
2812
+	}
2813 2813
     
2814
-    $classes[] = 'gd-map-' . geodir_map_name();
2814
+	$classes[] = 'gd-map-' . geodir_map_name();
2815 2815
 
2816
-    return $classes;
2816
+	return $classes;
2817 2817
 }
2818 2818
 
2819 2819
 add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100);
@@ -2827,13 +2827,13 @@  discard block
 block discarded – undo
2827 2827
  */
2828 2828
 function geodir_admin_body_class_no_rating($class = '')
2829 2829
 {
2830
-    if (get_option('geodir_disable_rating')) {
2831
-        $class .= ' gd-no-rating';
2832
-    }
2830
+	if (get_option('geodir_disable_rating')) {
2831
+		$class .= ' gd-no-rating';
2832
+	}
2833 2833
     
2834
-    $class .= ' gd-map-' . geodir_map_name();
2834
+	$class .= ' gd-map-' . geodir_map_name();
2835 2835
 
2836
-    return $class;
2836
+	return $class;
2837 2837
 }
2838 2838
 
2839 2839
 add_action('wp_head', 'geodir_wp_head_no_rating');
@@ -2846,10 +2846,10 @@  discard block
 block discarded – undo
2846 2846
  */
2847 2847
 function geodir_wp_head_no_rating()
2848 2848
 {
2849
-    if (get_option('geodir_disable_rating')) {
2850
-        echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
2851
-        echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
2852
-    }
2849
+	if (get_option('geodir_disable_rating')) {
2850
+		echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
2851
+		echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
2852
+	}
2853 2853
 }
2854 2854
 
2855 2855
 add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation');
@@ -2866,36 +2866,36 @@  discard block
 block discarded – undo
2866 2866
  * @return array Translation texts.
2867 2867
  */
2868 2868
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
2869
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2870
-
2871
-    $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');
2872
-
2873
-    /**
2874
-     * Filters the geodirectory option names that requires to add for translation.
2875
-     *
2876
-     * @since 1.5.7
2877
-     * @package GeoDirectory
2878
-     *
2879
-     * @param  array $gd_options Array of option names.
2880
-     */
2881
-    $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
2882
-    $gd_options = array_unique($gd_options);
2883
-
2884
-    if (!empty($gd_options)) {
2885
-        foreach ($gd_options as $gd_option) {
2886
-            if ($gd_option != '' && $option_value = get_option($gd_option)) {
2887
-                $option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
2869
+	$translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2870
+
2871
+	$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');
2872
+
2873
+	/**
2874
+	 * Filters the geodirectory option names that requires to add for translation.
2875
+	 *
2876
+	 * @since 1.5.7
2877
+	 * @package GeoDirectory
2878
+	 *
2879
+	 * @param  array $gd_options Array of option names.
2880
+	 */
2881
+	$gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
2882
+	$gd_options = array_unique($gd_options);
2883
+
2884
+	if (!empty($gd_options)) {
2885
+		foreach ($gd_options as $gd_option) {
2886
+			if ($gd_option != '' && $option_value = get_option($gd_option)) {
2887
+				$option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
2888 2888
                 
2889
-                if ($option_value != '' && !in_array($option_value, $translation_texts)) {
2890
-                    $translation_texts[] = stripslashes_deep($option_value);
2891
-                }
2892
-            }
2893
-        }
2894
-    }
2889
+				if ($option_value != '' && !in_array($option_value, $translation_texts)) {
2890
+					$translation_texts[] = stripslashes_deep($option_value);
2891
+				}
2892
+			}
2893
+		}
2894
+	}
2895 2895
 
2896
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
2896
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
2897 2897
 
2898
-    return $translation_texts;
2898
+	return $translation_texts;
2899 2899
 }
2900 2900
 
2901 2901
 add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation');
@@ -2909,15 +2909,15 @@  discard block
 block discarded – undo
2909 2909
 
2910 2910
 add_filter('get_comments_link', 'gd_get_comments_link', 10, 2);
2911 2911
 function gd_get_comments_link($comments_link, $post_id) {
2912
-    $post_type = get_post_type($post_id);
2912
+	$post_type = get_post_type($post_id);
2913 2913
 
2914
-    $all_postypes = geodir_get_posttypes();
2915
-    if (in_array($post_type, $all_postypes)) {
2916
-        $comments_link = str_replace('#comments', '#reviews', $comments_link);
2917
-        $comments_link = str_replace('#respond', '#reviews', $comments_link);
2918
-    }
2914
+	$all_postypes = geodir_get_posttypes();
2915
+	if (in_array($post_type, $all_postypes)) {
2916
+		$comments_link = str_replace('#comments', '#reviews', $comments_link);
2917
+		$comments_link = str_replace('#respond', '#reviews', $comments_link);
2918
+	}
2919 2919
 
2920
-    return $comments_link;
2920
+	return $comments_link;
2921 2921
 }
2922 2922
 
2923 2923
 
@@ -2935,11 +2935,11 @@  discard block
 block discarded – undo
2935 2935
 function geodir_add_nav_menu_class( $args )
2936 2936
 {
2937 2937
 
2938
-        if(isset($args['menu_class'])){
2939
-            $args['menu_class'] = $args['menu_class']." gd-menu-z";
2940
-        }
2938
+		if(isset($args['menu_class'])){
2939
+			$args['menu_class'] = $args['menu_class']." gd-menu-z";
2940
+		}
2941 2941
     
2942
-    return $args;
2942
+	return $args;
2943 2943
 }
2944 2944
 
2945 2945
 add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
2946 2946
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 /* WP REVIEW COUNT ACTIONS */
177 177
 ////////////////////////
178 178
 
179
-add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1);
179
+add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1);
180 180
 //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
181
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
181
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
182 182
 //add_action('created_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
184 184
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
+    $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
226 226
     if ($geodir_theme_location) {
227 227
         update_option('geodir_theme_location_nav', $geodir_theme_location);
228 228
     } else {
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 
321 321
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
322 322
 
323
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
324
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
323
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
324
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
325 325
 
326 326
 // Detail page sidebar content 
327 327
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -422,8 +422,8 @@  discard block
 block discarded – undo
422 422
     do_action('geodir_after_social_sharing_buttons');
423 423
     $content_html = ob_get_clean();
424 424
     if (trim($content_html) != '')
425
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
425
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>';
426
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
427 427
         /**
428 428
          * Filter the geodir_social_sharing_buttons() function content.
429 429
          *
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
     do_action('geodir_after_share_this_button');
470 470
     $content_html = ob_get_clean();
471 471
     if (trim($content_html) != '')
472
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
472
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">'.$content_html.'</div>';
473
+    if ((int) get_option('geodir_disable_sharethis_button_section') != 1) {
474 474
         /**
475 475
          * Filter the geodir_share_this_button() function content.
476 476
          *
@@ -509,12 +509,12 @@  discard block
 block discarded – undo
509 509
             $post_id = $post->ID;
510 510
             
511 511
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
-                $post_id = (int)$_REQUEST['pid'];
512
+                $post_id = (int) $_REQUEST['pid'];
513 513
             }
514 514
 
515 515
             $postlink = get_permalink(geodir_add_listing_page_id());
516 516
             $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
517
+            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
518 518
         }
519 519
     }// end of if, if its a preview or not
520 520
     /**
@@ -525,8 +525,8 @@  discard block
 block discarded – undo
525 525
     do_action('geodir_after_edit_post_link');
526 526
     $content_html = ob_get_clean();
527 527
     if (trim($content_html) != '')
528
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
528
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>';
529
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
530 530
         /**
531 531
          * Filter the geodir_edit_post_link() function content.
532 532
          *
@@ -579,14 +579,14 @@  discard block
 block discarded – undo
579 579
     $hide_refresh = get_option('geodir_ga_auto_refresh');
580 580
     
581 581
     $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
-    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
+    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'))) {
583 583
         $page_url = urlencode($_SERVER['REQUEST_URI']);
584 584
         ?>
585 585
         <script type="text/javascript">
586 586
             var gd_gaTimeOut;
587
-            var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
588
-            var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>;
589
-            var gd_gaAutoRefresh = <?php echo $auto_refresh;?>;
587
+            var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
588
+            var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>;
589
+            var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>;
590 590
             ga_data1 = false;
591 591
             ga_data2 = false;
592 592
             ga_data3 = false;
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
             }
728 728
 
729 729
             function gdga_noResults() {
730
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
730
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
731 731
                 jQuery('#gdga-legend-container').html('');
732 732
             }
733 733
 
@@ -759,18 +759,18 @@  discard block
 block discarded – undo
759 759
                     var data2 = results[1].rows.map(function(row) { return +row[2]; });
760 760
                     //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
761 761
 
762
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
763
-                        '<?php _e('Feb', 'geodirectory');?>',
764
-                        '<?php _e('Mar', 'geodirectory');?>',
765
-                        '<?php _e('Apr', 'geodirectory');?>',
766
-                        '<?php _e('May', 'geodirectory');?>',
767
-                        '<?php _e('Jun', 'geodirectory');?>',
768
-                        '<?php _e('Jul', 'geodirectory');?>',
769
-                        '<?php _e('Aug', 'geodirectory');?>',
770
-                        '<?php _e('Sep', 'geodirectory');?>',
771
-                        '<?php _e('Oct', 'geodirectory');?>',
772
-                        '<?php _e('Nov', 'geodirectory');?>',
773
-                        '<?php _e('Dec', 'geodirectory');?>'];
762
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
763
+                        '<?php _e('Feb', 'geodirectory'); ?>',
764
+                        '<?php _e('Mar', 'geodirectory'); ?>',
765
+                        '<?php _e('Apr', 'geodirectory'); ?>',
766
+                        '<?php _e('May', 'geodirectory'); ?>',
767
+                        '<?php _e('Jun', 'geodirectory'); ?>',
768
+                        '<?php _e('Jul', 'geodirectory'); ?>',
769
+                        '<?php _e('Aug', 'geodirectory'); ?>',
770
+                        '<?php _e('Sep', 'geodirectory'); ?>',
771
+                        '<?php _e('Oct', 'geodirectory'); ?>',
772
+                        '<?php _e('Nov', 'geodirectory'); ?>',
773
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
774 774
 
775 775
                     // Ensure the data arrays are at least as long as the labels array.
776 776
                     // Chart.js bar charts don't (yet) accept sparse datasets.
@@ -783,13 +783,13 @@  discard block
 block discarded – undo
783 783
                         labels : labels,
784 784
                         datasets : [
785 785
                             {
786
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
786
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
787 787
                                 fillColor : "rgba(220,220,220,0.5)",
788 788
                                 strokeColor : "rgba(220,220,220,1)",
789 789
                                 data : data2
790 790
                             },
791 791
                             {
792
-                                label: '<?php _e('This Year', 'geodirectory');?>',
792
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
793 793
                                 fillColor : "rgba(151,187,205,0.5)",
794 794
                                 strokeColor : "rgba(151,187,205,1)",
795 795
                                 data : data1
@@ -834,30 +834,30 @@  discard block
 block discarded – undo
834 834
 
835 835
                     <?php
836 836
                     // Here we list the shorthand days of the week so it can be used in translation.
837
-                    __("Mon",'geodirectory');
838
-                    __("Tue",'geodirectory');
839
-                    __("Wed",'geodirectory');
840
-                    __("Thu",'geodirectory');
841
-                    __("Fri",'geodirectory');
842
-                    __("Sat",'geodirectory');
843
-                    __("Sun",'geodirectory');
837
+                    __("Mon", 'geodirectory');
838
+                    __("Tue", 'geodirectory');
839
+                    __("Wed", 'geodirectory');
840
+                    __("Thu", 'geodirectory');
841
+                    __("Fri", 'geodirectory');
842
+                    __("Sat", 'geodirectory');
843
+                    __("Sun", 'geodirectory');
844 844
                     ?>
845 845
 
846 846
                     labels = [
847
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
848
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
849
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
850
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
851
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
852
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
853
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
847
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
848
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
849
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
850
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
851
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
852
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
853
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
854 854
                     ];
855 855
 
856 856
                     var data = {
857 857
                         labels : labels,
858 858
                         datasets : [
859 859
                             {
860
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
860
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
861 861
                                 fillColor : "rgba(220,220,220,0.5)",
862 862
                                 strokeColor : "rgba(220,220,220,1)",
863 863
                                 pointColor : "rgba(220,220,220,1)",
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
                                 data : data2
866 866
                             },
867 867
                             {
868
-                                label: '<?php _e('This Week', 'geodirectory');?>',
868
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
869 869
                                 fillColor : "rgba(151,187,205,0.5)",
870 870
                                 strokeColor : "rgba(151,187,205,1)",
871 871
                                 pointColor : "rgba(151,187,205,1)",
@@ -1072,18 +1072,18 @@  discard block
 block discarded – undo
1072 1072
         </style>
1073 1073
         <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
1074 1074
         <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
1075
-        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
1075
+        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
1076 1076
         <span id="ga_stats" class="gdga-analytics-box" style="display:none">
1077
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1077
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1078 1078
             <div id="gd-active-users-container">
1079
-                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
1079
+                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
1080 1080
                     <b class="gd-ActiveUsers-value">0</b>
1081 1081
                 </div>
1082 1082
             </div>
1083 1083
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1084
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1085
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1086
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1084
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1085
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1086
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1087 1087
             </select>
1088 1088
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
1089 1089
             <ol class="Chartjs-legend" id="gdga-legend-container"></ol>
@@ -1099,8 +1099,8 @@  discard block
 block discarded – undo
1099 1099
     do_action('geodir_after_google_analytics');
1100 1100
     $content_html = ob_get_clean();
1101 1101
     if (trim($content_html) != '')
1102
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1102
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>';
1103
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1104 1104
         /**
1105 1105
          * Filter the geodir_edit_post_link() function content.
1106 1106
          *
@@ -1156,10 +1156,10 @@  discard block
 block discarded – undo
1156 1156
        
1157 1157
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1158 1158
 	   
1159
-	   $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 />';
1159
+	   $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 />';
1160 1160
 
1161 1161
         $html .= '<span class="item">';
1162
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1162
+        $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>';
1163 1163
 
1164 1164
         if ($post_images) {
1165 1165
             foreach ($post_images as $img) {
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
         }
1170 1170
 
1171 1171
         if (isset($post_img) && $post_img) {
1172
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1172
+            $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />';
1173 1173
         }
1174 1174
 
1175 1175
         $html .= '</span>';
@@ -1196,9 +1196,9 @@  discard block
 block discarded – undo
1196 1196
     do_action('geodir_after_detail_page_review_rating');
1197 1197
     $content_html = ob_get_clean();
1198 1198
     if (trim($content_html) != '') {
1199
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1199
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>';
1200 1200
     }
1201
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1201
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1202 1202
         /**
1203 1203
          * Filter the geodir_detail_page_review_rating() function content.
1204 1204
          *
@@ -1237,8 +1237,8 @@  discard block
 block discarded – undo
1237 1237
 
1238 1238
     $content_html = ob_get_clean();
1239 1239
     if (trim($content_html) != '')
1240
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1240
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>';
1241
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1242 1242
         /**
1243 1243
          * Filter the output html for function geodir_detail_page_more_info().
1244 1244
          *
@@ -1337,7 +1337,7 @@  discard block
 block discarded – undo
1337 1337
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1338 1338
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1339 1339
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1340
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1340
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1341 1341
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1342 1342
         'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1343 1343
         'geodir_map_name' => geodir_map_name(),
@@ -1359,10 +1359,10 @@  discard block
 block discarded – undo
1359 1359
     foreach ($arr_alert_msg as $key => $value) {
1360 1360
         if (!is_scalar($value))
1361 1361
             continue;
1362
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1362
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1363 1363
     }
1364 1364
 
1365
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1365
+    $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';';
1366 1366
     echo '<script>';
1367 1367
     echo $script;
1368 1368
     echo '</script>';
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
         $geodir_old_sidebars = get_option('geodir_sidebars');
1453 1453
         if (is_array($geodir_old_sidebars)) {
1454 1454
             foreach ($geodir_old_sidebars as $key => $val) {
1455
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1455
+                if (0 === strpos($key, 'geodir_'))// if gd widget
1456 1456
                 {
1457 1457
                     $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1458 1458
                 }
@@ -1531,7 +1531,7 @@  discard block
 block discarded – undo
1531 1531
         global $post;
1532 1532
         $term_condition = '';
1533 1533
         if (isset($_REQUEST['backandedit'])) {
1534
-            $post = (object)$gd_session->get('listing');
1534
+            $post = (object) $gd_session->get('listing');
1535 1535
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1536 1536
         }
1537 1537
 
@@ -1545,7 +1545,7 @@  discard block
 block discarded – undo
1545 1545
                     echo 'checked="checked"';
1546 1546
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1547 1547
                        class="geodir_textfield" value="1"
1548
-                       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>
1548
+                       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>
1549 1549
 				</span>
1550 1550
             </div>
1551 1551
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1585,7 +1585,7 @@  discard block
 block discarded – undo
1585 1585
         /** This action is documented in geodirectory_template_actions.php */
1586 1586
         $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1587 1587
         
1588
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1588
+        if (!($desc_limit === '' || (int) $desc_limit > 0)) {
1589 1589
             $is_display = false;
1590 1590
         }
1591 1591
     }
@@ -1633,16 +1633,16 @@  discard block
 block discarded – undo
1633 1633
     global $wpdb, $plugin_prefix;
1634 1634
 	
1635 1635
 	// Remove unused virtual page
1636
-	$listings_page_id = (int)get_option('geodir_listing_page');
1636
+	$listings_page_id = (int) get_option('geodir_listing_page');
1637 1637
 	if ($listings_page_id) {
1638
-		$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')));
1638
+		$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')));
1639 1639
         delete_option('geodir_listing_page');
1640 1640
 	}
1641 1641
 
1642 1642
     if (!get_option('geodir_changes_in_custom_fields_table')) {
1643 1643
         $wpdb->query(
1644 1644
             $wpdb->prepare(
1645
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1645
+                "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s",
1646 1646
                 array('1', '1', 'admin')
1647 1647
             )
1648 1648
         );
@@ -1650,9 +1650,9 @@  discard block
 block discarded – undo
1650 1650
 
1651 1651
         /* --- terms meta value set --- */
1652 1652
 
1653
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1653
+        update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
1654 1654
 
1655
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1655
+        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
1656 1656
 
1657 1657
         if (!empty($options_data)) {
1658 1658
 
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
 
1661 1661
                 $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1662 1662
 
1663
-                $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)));
1663
+                $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)));
1664 1664
 
1665 1665
                 if (!empty($taxonomies_data)) {
1666 1666
 
@@ -1669,17 +1669,17 @@  discard block
 block discarded – undo
1669 1669
                         $taxObject = get_taxonomy($taxobj->taxonomy);
1670 1670
                         $post_type = $taxObject->object_type[0];
1671 1671
 
1672
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1672
+                        $opt_value = 'tax_meta_'.$post_type.'_'.$option_val;
1673 1673
 
1674
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1674
+                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
1675 1675
 
1676 1676
                         if ($duplicate_data) {
1677 1677
 
1678
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1678
+                            $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1679 1679
 
1680 1680
                         } else {
1681 1681
 
1682
-                            $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)));
1682
+                            $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)));
1683 1683
 
1684 1684
                         }
1685 1685
 
@@ -1713,14 +1713,14 @@  discard block
 block discarded – undo
1713 1713
 
1714 1714
     global $wpdb, $table_prefix;
1715 1715
 
1716
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1716
+    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
1717 1717
 
1718 1718
     if ($slug_exists) {
1719 1719
 
1720 1720
         $suffix = 1;
1721 1721
         do {
1722
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1723
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1722
+            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1723
+            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
1724 1724
             $suffix++;
1725 1725
         } while ($location_slug_check && $suffix < 100);
1726 1726
 
@@ -1774,7 +1774,7 @@  discard block
 block discarded – undo
1774 1774
 
1775 1775
         $suffix = 1;
1776 1776
         do {
1777
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1777
+            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1778 1778
 
1779 1779
             /** This action is documented in geodirectory_hooks_actions.php */
1780 1780
             $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
 
1787 1787
         //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1788 1788
 
1789
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1789
+        $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1790 1790
 
1791 1791
     }
1792 1792
 	
@@ -1795,18 +1795,18 @@  discard block
 block discarded – undo
1795 1795
 	$post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL;
1796 1796
 	
1797 1797
 	$post_types = geodir_get_posttypes();
1798
-	if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {		
1799
-		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
1798
+	if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {		
1799
+		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
1800 1800
 		
1801 1801
 		if (!empty($posts_obj)) {
1802 1802
 			foreach ($posts_obj as $post_obj) {
1803 1803
 				$post_id = $post_obj->object_id;
1804 1804
 				
1805
-				$raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
1805
+				$raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
1806 1806
 				$post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
1807 1807
 				
1808
-				$listing_table = $plugin_prefix . $post_type . '_detail';
1809
-				$wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1808
+				$listing_table = $plugin_prefix.$post_type.'_detail';
1809
+				$wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1810 1810
 			}
1811 1811
 		}
1812 1812
 	}
@@ -1840,7 +1840,7 @@  discard block
 block discarded – undo
1840 1840
     if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1841 1841
         return $slug_exists = true;
1842 1842
 
1843
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1843
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1844 1844
         return $slug_exists = true;
1845 1845
 
1846 1846
     return $slug_exists;
@@ -1880,43 +1880,43 @@  discard block
 block discarded – undo
1880 1880
 
1881 1881
 
1882 1882
     $gd_page = '';
1883
-    if(geodir_is_page('home')){
1883
+    if (geodir_is_page('home')) {
1884 1884
         $gd_page = 'home';
1885 1885
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1886 1886
     }
1887
-    elseif(geodir_is_page('detail')){
1887
+    elseif (geodir_is_page('detail')) {
1888 1888
         $gd_page = 'detail';
1889 1889
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1890 1890
     }
1891
-    elseif(geodir_is_page('pt')){
1891
+    elseif (geodir_is_page('pt')) {
1892 1892
         $gd_page = 'pt';
1893 1893
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1894 1894
     }
1895
-    elseif(geodir_is_page('listing')){
1895
+    elseif (geodir_is_page('listing')) {
1896 1896
         $gd_page = 'listing';
1897 1897
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1898 1898
     }
1899
-    elseif(geodir_is_page('location')){
1899
+    elseif (geodir_is_page('location')) {
1900 1900
         $gd_page = 'location';
1901 1901
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1902 1902
     }
1903
-    elseif(geodir_is_page('search')){
1903
+    elseif (geodir_is_page('search')) {
1904 1904
         $gd_page = 'search';
1905 1905
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1906 1906
     }
1907
-    elseif(geodir_is_page('add-listing')){
1907
+    elseif (geodir_is_page('add-listing')) {
1908 1908
         $gd_page = 'add-listing';
1909 1909
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1910 1910
     }
1911
-    elseif(geodir_is_page('author')){
1911
+    elseif (geodir_is_page('author')) {
1912 1912
         $gd_page = 'author';
1913 1913
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1914 1914
     }
1915
-    elseif(geodir_is_page('login')){
1915
+    elseif (geodir_is_page('login')) {
1916 1916
         $gd_page = 'login';
1917 1917
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1918 1918
     }
1919
-    elseif(geodir_is_page('listing-success')){
1919
+    elseif (geodir_is_page('listing-success')) {
1920 1920
         $gd_page = 'listing-success';
1921 1921
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1922 1922
     }
@@ -1948,12 +1948,12 @@  discard block
 block discarded – undo
1948 1948
 
1949 1949
     if (!get_option('geodir_set_post_attachments')) {
1950 1950
 
1951
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1952
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1951
+        require_once(ABSPATH.'wp-admin/includes/image.php');
1952
+        require_once(ABSPATH.'wp-admin/includes/file.php');
1953 1953
 
1954 1954
         $all_postypes = geodir_get_posttypes();
1955 1955
 
1956
-        foreach($all_postypes as $post_type){
1956
+        foreach ($all_postypes as $post_type) {
1957 1957
             $args = array(
1958 1958
                 'posts_per_page' => -1,
1959 1959
                 'post_type' => $post_type,
@@ -2047,7 +2047,7 @@  discard block
 block discarded – undo
2047 2047
 {
2048 2048
     $user_id = get_current_user_id();
2049 2049
 
2050
-    if(!$user_id){return $post;}
2050
+    if (!$user_id) {return $post; }
2051 2051
 
2052 2052
     $gd_post_types = geodir_get_posttypes();
2053 2053
 
@@ -2156,7 +2156,7 @@  discard block
 block discarded – undo
2156 2156
 
2157 2157
         if (array_key_exists('post_video', $tabs_arr)) {
2158 2158
 
2159
-            $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)));
2159
+            $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)));
2160 2160
 
2161 2161
             if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2162 2162
                 $tabs_arr['post_video']['heading_text'] = $field_title;
@@ -2164,7 +2164,7 @@  discard block
 block discarded – undo
2164 2164
 
2165 2165
         if (array_key_exists('special_offers', $tabs_arr)) {
2166 2166
 
2167
-            $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)));
2167
+            $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)));
2168 2168
 
2169 2169
             if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2170 2170
                 $tabs_arr['special_offers']['heading_text'] = $field_title;
@@ -2185,7 +2185,7 @@  discard block
 block discarded – undo
2185 2185
  */
2186 2186
 function geodir_remove_template_redirect_actions()
2187 2187
 {
2188
-    if (geodir_is_page('login')){
2188
+    if (geodir_is_page('login')) {
2189 2189
         remove_all_actions('template_redirect');
2190 2190
         remove_action('init', 'avia_modify_front', 10);
2191 2191
     }
@@ -2232,25 +2232,25 @@  discard block
 block discarded – undo
2232 2232
         $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2233 2233
 
2234 2234
         $wpdb->query(
2235
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2235
+            $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
2236 2236
                 array($post_id, $split_img_file_path)
2237 2237
             )
2238 2238
         );
2239 2239
 
2240 2240
         $attachment_data = $wpdb->get_row(
2241
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2241
+            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
2242 2242
                 array($post_id)
2243 2243
             )
2244 2244
         );
2245 2245
 
2246 2246
         if (!empty($attachment_data)) {
2247
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2247
+            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2248 2248
         }
2249 2249
 
2250 2250
 
2251
-        $table_name = $plugin_prefix . $post_type . '_detail';
2251
+        $table_name = $plugin_prefix.$post_type.'_detail';
2252 2252
 
2253
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2253
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
2254 2254
 
2255 2255
         geodir_set_wp_featured_image($post_id);
2256 2256
 
@@ -2278,9 +2278,9 @@  discard block
 block discarded – undo
2278 2278
 
2279 2279
     foreach ($all_postypes as $posttype) {
2280 2280
 
2281
-        $tablename = $plugin_prefix . $posttype . '_detail';
2281
+        $tablename = $plugin_prefix.$posttype.'_detail';
2282 2282
 
2283
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2283
+        $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
2284 2284
 
2285 2285
         if (!empty($get_post_data)) {
2286 2286
 
@@ -2288,7 +2288,7 @@  discard block
 block discarded – undo
2288 2288
 
2289 2289
                 $post_id = $data->post_id;
2290 2290
 
2291
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2291
+                $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
2292 2292
 
2293 2293
                 if (!empty($attachment_data)) {
2294 2294
 
@@ -2305,22 +2305,22 @@  discard block
 block discarded – undo
2305 2305
 
2306 2306
                         $file_name = $file_info['basename'];
2307 2307
 
2308
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2308
+                        $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name;
2309 2309
 
2310 2310
                         if (!file_exists($img_arr['path'])) {
2311 2311
 
2312
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2312
+                            $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
2313 2313
 
2314 2314
                         }
2315 2315
 
2316 2316
                     }
2317 2317
 
2318
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2318
+                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
2319 2319
 
2320 2320
                     if (!empty($attachment_data)) {
2321 2321
 
2322 2322
                         if ($attachment_data->ID)
2323
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2323
+                            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2324 2324
 
2325 2325
                     } else {
2326 2326
 
@@ -2334,7 +2334,7 @@  discard block
 block discarded – undo
2334 2334
 
2335 2335
                     }
2336 2336
 
2337
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2337
+                    $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
2338 2338
 
2339 2339
                     geodir_set_wp_featured_image($post_id);
2340 2340
 
@@ -2363,7 +2363,7 @@  discard block
 block discarded – undo
2363 2363
 {
2364 2364
 
2365 2365
     if (!get_option('geodir_default_rating_star_icon')) {
2366
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2366
+        update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
2367 2367
     }
2368 2368
 
2369 2369
 }
@@ -2380,10 +2380,10 @@  discard block
 block discarded – undo
2380 2380
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2381 2381
  * @return array User listing count for each post type.
2382 2382
  */
2383
-function geodir_user_post_listing_count($user_id=null)
2383
+function geodir_user_post_listing_count($user_id = null)
2384 2384
 {
2385 2385
     global $wpdb, $plugin_prefix, $current_user;
2386
-    if(!$user_id){
2386
+    if (!$user_id) {
2387 2387
         $user_id = $current_user->ID;
2388 2388
     }
2389 2389
 
@@ -2394,7 +2394,7 @@  discard block
 block discarded – undo
2394 2394
     $user_listing = array();
2395 2395
     if (is_array($all_posts) && !empty($all_posts)) {
2396 2396
         foreach ($all_posts as $ptype) {
2397
-            $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' )");
2397
+            $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' )");
2398 2398
 
2399 2399
             if ($total_posts > 0) {
2400 2400
                 $user_listing[$ptype] = $total_posts;
@@ -2436,19 +2436,19 @@  discard block
 block discarded – undo
2436 2436
         $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2437 2437
 
2438 2438
         //remove video and special offers if it is already set to show
2439
-        if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2439
+        if (isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']) {
2440 2440
             $unset_video = true;
2441 2441
         }
2442 2442
 
2443
-        if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2443
+        if (isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']) {
2444 2444
             $unset_special_offers = true;
2445 2445
         }
2446
-        if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2447
-            foreach($custom_fields as $key => $custom_field){
2448
-                if($custom_field['name']=='geodir_video' && isset($unset_video)){
2446
+        if (isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)) {
2447
+            foreach ($custom_fields as $key => $custom_field) {
2448
+                if ($custom_field['name'] == 'geodir_video' && isset($unset_video)) {
2449 2449
                     unset($custom_fields[$key]);
2450 2450
                 }
2451
-                if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2451
+                if ($custom_field['name'] == 'geodir_special_offers' && isset($unset_special_offers)) {
2452 2452
                     unset($custom_fields[$key]);
2453 2453
                 }
2454 2454
             }
@@ -2467,7 +2467,7 @@  discard block
 block discarded – undo
2467 2467
                     $post->{$field_name} = $_REQUEST[$field_name];
2468 2468
                 }
2469 2469
 
2470
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((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'))) {
2470
+                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((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'))) {
2471 2471
                     if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2472 2472
                         continue;
2473 2473
                     }
@@ -2516,21 +2516,21 @@  discard block
 block discarded – undo
2516 2516
                         $variables_array['label'] = __($type['site_title'], 'geodirectory');
2517 2517
                         $variables_array['value'] = '';
2518 2518
                         $variables_array['value'] = $post->{$type['htmlvar_name']};
2519
-                    }else{
2519
+                    } else {
2520 2520
                         $i = 0;
2521 2521
                         $fieldset_count++;
2522 2522
                         $field_set_start = 1;
2523
-                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2523
+                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count;
2524 2524
                         $fieldset_arr[$fieldset_count]['label'] = $label;
2525 2525
                     }
2526 2526
 
2527 2527
 
2528
-                    if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2528
+                    if (isset($type['extra_fields'])) {$extra_fields = $type['extra_fields']; }
2529 2529
                     $type = stripslashes_deep($type); // strip slashes
2530
-                    if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2530
+                    if (isset($type['extra_fields'])) {$type['extra_fields'] = $extra_fields; }
2531 2531
                     $html = '';
2532 2532
                     $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2533
-                    if($html_var=='post'){$html_var='post_address';}
2533
+                    if ($html_var == 'post') {$html_var = 'post_address'; }
2534 2534
                     $field_icon = geodir_field_icon_proccess($type);
2535 2535
                     $filed_type = $type['type'];
2536 2536
 
@@ -2543,7 +2543,7 @@  discard block
 block discarded – undo
2543 2543
                      * @param string $fields_location The location the field is to be show.
2544 2544
                      * @param array $type The array of field values.
2545 2545
                      */
2546
-                    $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2546
+                    $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
2547 2547
 
2548 2548
 
2549 2549
                     /**
@@ -2589,7 +2589,7 @@  discard block
 block discarded – undo
2589 2589
                                  * @param string $htmlvar_name The field HTML var name.
2590 2590
                                  */
2591 2591
                                 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2592
-                                'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2592
+                                'tab_content' => '<div class="geodir-company_info field-group xxx">'.$fieldset_html.'</div>'
2593 2593
                             );
2594 2594
                         }
2595 2595
                     } else {
@@ -2649,7 +2649,7 @@  discard block
 block discarded – undo
2649 2649
             }
2650 2650
             $status .= ")</strong>";
2651 2651
 
2652
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2652
+            $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
2653 2653
         }
2654 2654
     }
2655 2655
 
@@ -2733,7 +2733,7 @@  discard block
 block discarded – undo
2733 2733
 function geodir_no_rating_comment_text($content, $comment = '')
2734 2734
 {
2735 2735
     if (!is_admin()) {
2736
-        return '<div class="description">' . $content . '</div>';
2736
+        return '<div class="description">'.$content.'</div>';
2737 2737
     } else {
2738 2738
         return $content;
2739 2739
     }
@@ -2811,7 +2811,7 @@  discard block
 block discarded – undo
2811 2811
         $classes[] = 'gd-no-rating';
2812 2812
     }
2813 2813
     
2814
-    $classes[] = 'gd-map-' . geodir_map_name();
2814
+    $classes[] = 'gd-map-'.geodir_map_name();
2815 2815
 
2816 2816
     return $classes;
2817 2817
 }
@@ -2831,7 +2831,7 @@  discard block
 block discarded – undo
2831 2831
         $class .= ' gd-no-rating';
2832 2832
     }
2833 2833
     
2834
-    $class .= ' gd-map-' . geodir_map_name();
2834
+    $class .= ' gd-map-'.geodir_map_name();
2835 2835
 
2836 2836
     return $class;
2837 2837
 }
@@ -2866,7 +2866,7 @@  discard block
 block discarded – undo
2866 2866
  * @return array Translation texts.
2867 2867
  */
2868 2868
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
2869
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2869
+    $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
2870 2870
 
2871 2871
     $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');
2872 2872
 
@@ -2932,14 +2932,14 @@  discard block
 block discarded – undo
2932 2932
  * @param array $args The array of menu arguments.
2933 2933
  * @return array The modified arguments.
2934 2934
  */
2935
-function geodir_add_nav_menu_class( $args )
2935
+function geodir_add_nav_menu_class($args)
2936 2936
 {
2937 2937
 
2938
-        if(isset($args['menu_class'])){
2938
+        if (isset($args['menu_class'])) {
2939 2939
             $args['menu_class'] = $args['menu_class']." gd-menu-z";
2940 2940
         }
2941 2941
     
2942 2942
     return $args;
2943 2943
 }
2944 2944
 
2945
-add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
2946 2945
\ No newline at end of file
2946
+add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class');
2947 2947
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-admin/admin_hooks_actions.php 1 patch
Spacing   +224 added lines, -224 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
  */
63 63
 function geodir_get_admin_option_form($current_tab)
64 64
 {
65
-    geodir_admin_option_form($current_tab);// defined in admin template tags.php
65
+    geodir_admin_option_form($current_tab); // defined in admin template tags.php
66 66
 }
67 67
 
68 68
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 add_action('geodir_update_options_compatibility_settings', 'geodir_update_options_compatibility_settings');
71 71
 add_action('geodir_update_options_default_location_settings', 'geodir_location_form_submit');
72 72
 add_action('geodir_before_admin_panel', 'geodir_before_admin_panel'); // this function is in admin_functions.php
73
-add_action('geodir_before_update_options', 'geodir_before_update_options',10,2);
73
+add_action('geodir_before_update_options', 'geodir_before_update_options', 10, 2);
74 74
 
75 75
 //add_action('geodir_before_admin_panel', 'geodir_autoinstall_admin_header');
76 76
 
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
 add_action('admin_panel_init', 'geodir_admin_list_columns', 2);
121 121
 
122 122
 /* --- insert dummy post action ---*/
123
-add_action('geodir_insert_dummy_posts', 'geodir_insert_dummy_posts', 1,3);
124
-add_action('geodir_delete_dummy_posts', 'geodir_delete_dummy_posts', 1,3);
123
+add_action('geodir_insert_dummy_posts', 'geodir_insert_dummy_posts', 1, 3);
124
+add_action('geodir_delete_dummy_posts', 'geodir_delete_dummy_posts', 1, 3);
125 125
 
126 126
 
127 127
 /**
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
 
230 230
         // Filter-Payment-Manager
231 231
 
232
-        add_meta_box('geodir_post_images', $post_typename . ' ' . __('Attachments', 'geodirectory'), 'geodir_post_attachments', $geodir_posttype, 'side');
232
+        add_meta_box('geodir_post_images', $post_typename.' '.__('Attachments', 'geodirectory'), 'geodir_post_attachments', $geodir_posttype, 'side');
233 233
 
234
-        add_meta_box('geodir_post_info', $post_typename . ' ' . __('Information', 'geodirectory'), 'geodir_post_info_setting', $geodir_posttype, 'normal', 'high');
234
+        add_meta_box('geodir_post_info', $post_typename.' '.__('Information', 'geodirectory'), 'geodir_post_info_setting', $geodir_posttype, 'normal', 'high');
235 235
 
236 236
         // no need of this box as all fields moved to main information box
237 237
         //add_meta_box( 'geodir_post_addinfo', $post_typename. ' ' .__('Additional Information' , 'geodirectory'), 'geodir_post_addinfo_setting', $geodir_posttype,'normal', 'high' );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
 }
242 242
 
243
-add_action('save_post', 'geodir_post_information_save',10,2);
243
+add_action('save_post', 'geodir_post_information_save', 10, 2);
244 244
 
245 245
 
246 246
 
@@ -267,10 +267,10 @@  discard block
 block discarded – undo
267 267
 
268 268
             $gd_taxonomy = geodir_get_taxonomies($geodir_post_type);
269 269
 
270
-            if(!empty($gd_taxonomy)) {
270
+            if (!empty($gd_taxonomy)) {
271 271
                 foreach ($gd_taxonomy as $tax) {
272 272
 
273
-                    remove_meta_box($tax . 'div', $geodir_post_type, 'normal');
273
+                    remove_meta_box($tax.'div', $geodir_post_type, 'normal');
274 274
 
275 275
                 }
276 276
             }
@@ -356,14 +356,14 @@  discard block
 block discarded – undo
356 356
 add_action('geodir_manage_available_fields_predefined', 'geodir_manage_available_fields_predefined');
357 357
 add_action('geodir_manage_available_fields_custom', 'geodir_manage_available_fields_custom');
358 358
 
359
-function geodir_manage_available_fields_predefined($sub_tab){
360
-    if($sub_tab=='custom_fields'){
359
+function geodir_manage_available_fields_predefined($sub_tab) {
360
+    if ($sub_tab == 'custom_fields') {
361 361
         geodir_custom_available_fields('predefined');
362 362
     }
363 363
 }
364 364
 
365
-function geodir_manage_available_fields_custom($sub_tab){
366
-    if($sub_tab=='custom_fields'){
365
+function geodir_manage_available_fields_custom($sub_tab) {
366
+    if ($sub_tab == 'custom_fields') {
367 367
         geodir_custom_available_fields('custom');
368 368
     }
369 369
 }
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
     global $wpdb;
434 434
     $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
435 435
     ?>
436
-    <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/>
436
+    <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type; ?>"/>
437 437
     <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>"/>
438 438
     <ul>
439 439
     <?php
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 
445 445
             $check_html_variable = $wpdb->get_var(
446 446
                 $wpdb->prepare(
447
-                    "SELECT htmlvar_name FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name = %s AND post_type = %s AND field_type=%s",
447
+                    "SELECT htmlvar_name FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE htmlvar_name = %s AND post_type = %s AND field_type=%s",
448 448
                     array($val['htmlvar_name'], $listing_type, $val['field_type'])
449 449
                 )
450 450
             );
@@ -452,23 +452,23 @@  discard block
 block discarded – undo
452 452
             $display = $check_html_variable ? ' style="display:none;"' : '';
453 453
            ?>
454 454
 
455
-            <li   class="gd-cf-tooltip-wrap" <?php echo $display;?>>
455
+            <li   class="gd-cf-tooltip-wrap" <?php echo $display; ?>>
456 456
                 <?php
457
-                if(isset($val['description']) && $val['description']){
457
+                if (isset($val['description']) && $val['description']) {
458 458
                     echo '<div class="gdcf-tooltip">'.$val['description'].'</div>';
459 459
                 }?>
460 460
 
461
-                <a id="gd-<?php echo $val['field_type'];?>-_-<?php echo $val['htmlvar_name'];?>" data-field-type-key="<?php echo $val['htmlvar_name'];?>"  data-field-type="<?php echo $val['field_type'];?>"
462
-                   title="<?php echo $val['site_title'];?>"
463
-                   class="gd-draggable-form-items  gd-<?php echo $val['field_type'];?> geodir-sort-<?php echo $val['htmlvar_name'];?>" href="javascript:void(0);">
461
+                <a id="gd-<?php echo $val['field_type']; ?>-_-<?php echo $val['htmlvar_name']; ?>" data-field-type-key="<?php echo $val['htmlvar_name']; ?>"  data-field-type="<?php echo $val['field_type']; ?>"
462
+                   title="<?php echo $val['site_title']; ?>"
463
+                   class="gd-draggable-form-items  gd-<?php echo $val['field_type']; ?> geodir-sort-<?php echo $val['htmlvar_name']; ?>" href="javascript:void(0);">
464 464
                     <?php if (isset($val['field_icon']) && strpos($val['field_icon'], 'fa fa-') !== false) {
465 465
                         echo '<i class="'.$val['field_icon'].'" aria-hidden="true"></i>';
466
-                    }elseif(isset($val['field_icon']) && $val['field_icon'] ){
466
+                    }elseif (isset($val['field_icon']) && $val['field_icon']) {
467 467
                         echo '<b style="background-image: url("'.$val['field_icon'].'")"></b>';
468
-                    }else{
468
+                    } else {
469 469
                         echo '<i class="fa fa-cog" aria-hidden="true"></i>';
470 470
                     }?>
471
-                    <?php echo $val['site_title'];?>
471
+                    <?php echo $val['site_title']; ?>
472 472
                 </a>
473 473
             </li>
474 474
 
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
     <?php 
497 497
         global $wpdb;
498 498
         
499
-        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type = %s AND field_type != 'address' ORDER BY sort_order ASC", array($listing_type)));
499
+        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE post_type = %s AND field_type != 'address' ORDER BY sort_order ASC", array($listing_type)));
500 500
 
501 501
         if (!empty($fields)) {
502 502
             foreach ($fields as $field) {
@@ -521,14 +521,14 @@  discard block
 block discarded – undo
521 521
  * @since 1.6.9
522 522
  * @package GeoDirectory
523 523
  */
524
-function geodir_custom_fields_custom($post_type=''){
524
+function geodir_custom_fields_custom($post_type = '') {
525 525
 
526 526
     $custom_fields = array();
527 527
 
528 528
     /**
529 529
      * @see `geodir_custom_fields`
530 530
      */
531
-    return apply_filters('geodir_custom_fields_custom',$custom_fields,$post_type);
531
+    return apply_filters('geodir_custom_fields_custom', $custom_fields, $post_type);
532 532
 }
533 533
 
534 534
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
  * @since 1.6.6
540 540
  * @package GeoDirectory
541 541
  */
542
-function geodir_custom_fields($post_type=''){
542
+function geodir_custom_fields($post_type = '') {
543 543
     
544 544
     $custom_fields = array(
545 545
         'text' => array(
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
      * }
675 675
      * @param string $post_type The post type requested.
676 676
      */
677
-    return apply_filters('geodir_custom_fields',$custom_fields,$post_type);
677
+    return apply_filters('geodir_custom_fields', $custom_fields, $post_type);
678 678
 }
679 679
 
680 680
 /**
@@ -685,25 +685,25 @@  discard block
 block discarded – undo
685 685
  * @param string $type The custom field type, predefined, custom or blank for default
686 686
  * @package GeoDirectory
687 687
  */
688
-function geodir_custom_available_fields($type='')
688
+function geodir_custom_available_fields($type = '')
689 689
 {
690 690
     $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
691 691
     ?>
692
-    <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/>
692
+    <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type; ?>"/>
693 693
     <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>" />
694 694
 
695 695
         <?php
696
-        if($type=='predefined'){
696
+        if ($type == 'predefined') {
697 697
             $cfs = geodir_custom_fields_predefined($listing_type);
698
-        }elseif($type=='custom'){
698
+        }elseif ($type == 'custom') {
699 699
             $cfs = geodir_custom_fields_custom($listing_type);
700
-        }else{
700
+        } else {
701 701
             $cfs = geodir_custom_fields($listing_type);
702 702
             ?>
703 703
             <ul class="full gd-cf-tooltip-wrap">
704 704
                 <li>
705 705
                     <div class="gdcf-tooltip">
706
-                        <?php _e('This adds a section separator with a title.', 'geodirectory');?>
706
+                        <?php _e('This adds a section separator with a title.', 'geodirectory'); ?>
707 707
                     </div>
708 708
                     <a id="gt-fieldset"
709 709
                        class="gd-draggable-form-items gt-fieldset"
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 
715 715
                         <i class="fa fa-long-arrow-left " aria-hidden="true"></i>
716 716
                         <i class="fa fa-long-arrow-right " aria-hidden="true"></i>
717
-                        <?php _e('Fieldset (section separator)', 'geodirectory');?>
717
+                        <?php _e('Fieldset (section separator)', 'geodirectory'); ?>
718 718
                     </a>
719 719
                 </li>
720 720
             </ul>
@@ -722,15 +722,15 @@  discard block
 block discarded – undo
722 722
             <?php
723 723
         }
724 724
 
725
-    if(!empty($cfs)) {
725
+    if (!empty($cfs)) {
726 726
 
727
-        foreach ( $cfs as $id => $cf ) {
727
+        foreach ($cfs as $id => $cf) {
728 728
             ?>
729 729
             <ul>
730 730
             <li class="gd-cf-tooltip-wrap">
731 731
                 <?php
732
-                if ( isset( $cf['description'] ) && $cf['description'] ) {
733
-                    echo '<div class="gdcf-tooltip">' . $cf['description'] . '</div>';
732
+                if (isset($cf['description']) && $cf['description']) {
733
+                    echo '<div class="gdcf-tooltip">'.$cf['description'].'</div>';
734 734
                 } ?>
735 735
 
736 736
                 <a id="gd-<?php echo $id; ?>"
@@ -740,10 +740,10 @@  discard block
 block discarded – undo
740 740
                    class="gd-draggable-form-items <?php echo $cf['class']; ?>"
741 741
                    href="javascript:void(0);">
742 742
 
743
-                    <?php if ( isset( $cf['icon'] ) && strpos( $cf['icon'], 'fa fa-' ) !== false ) {
744
-                        echo '<i class="' . $cf['icon'] . '" aria-hidden="true"></i>';
745
-                    } elseif ( isset( $cf['icon'] ) && $cf['icon'] ) {
746
-                        echo '<b style="background-image: url("' . $cf['icon'] . '")"></b>';
743
+                    <?php if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) {
744
+                        echo '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
745
+                    } elseif (isset($cf['icon']) && $cf['icon']) {
746
+                        echo '<b style="background-image: url("'.$cf['icon'].'")"></b>';
747 747
                     } else {
748 748
                         echo '<i class="fa fa-cog" aria-hidden="true"></i>';
749 749
                     } ?>
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
             </li>
753 753
             <?php
754 754
         }
755
-    }else{
755
+    } else {
756 756
         _e('There are no custom fields here yet.', 'geodirectory');
757 757
     }
758 758
         ?>
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
     <ul class="core">
781 781
     <?php 
782 782
         global $wpdb;
783
-        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type = %s ORDER BY sort_order ASC", array($listing_type)));
783
+        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type = %s ORDER BY sort_order ASC", array($listing_type)));
784 784
 
785 785
         if (!empty($fields)) {
786 786
             foreach ($fields as $field) {
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
                 $field_type_key = $field->field_type_key;
791 791
                 $field_ins_upd = 'display';
792 792
 
793
-                geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd,$field_type_key);
793
+                geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd, $field_type_key);
794 794
             }
795 795
         }
796 796
         ?></ul>
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 
869 869
     switch ($sub_tab) {
870 870
         case 'custom_fields':
871
-            $note = sprintf(__('Click on any box below to add a field of that type to the add %s listing form. You can use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type));;
871
+            $note = sprintf(__('Click on any box below to add a field of that type to the add %s listing form. You can use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type)); ;
872 872
             break;
873 873
 
874 874
         case 'sorting_options':
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
 
923 923
     switch ($sub_tab) {
924 924
         case 'custom_fields':
925
-            $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type));;
925
+            $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type)); ;
926 926
             break;
927 927
 
928 928
         case 'sorting_options':
@@ -949,8 +949,8 @@  discard block
 block discarded – undo
949 949
 
950 950
     if (!get_option('geodir_remove_unnecessary_fields')) {
951 951
 
952
-        if ($wpdb->get_var("SHOW COLUMNS FROM " . $plugin_prefix . "gd_place_detail WHERE field = 'categories'"))
953
-            $wpdb->query("ALTER TABLE `" . $plugin_prefix . "gd_place_detail` DROP `categories`");
952
+        if ($wpdb->get_var("SHOW COLUMNS FROM ".$plugin_prefix."gd_place_detail WHERE field = 'categories'"))
953
+            $wpdb->query("ALTER TABLE `".$plugin_prefix."gd_place_detail` DROP `categories`");
954 954
 
955 955
         update_option('geodir_remove_unnecessary_fields', '1');
956 956
 
@@ -978,14 +978,14 @@  discard block
 block discarded – undo
978 978
             case 'diagnosis' :
979 979
                 if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '')
980 980
                     $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']);
981
-                call_user_func('geodir_diagnose_' . $diagnose_this);
981
+                call_user_func('geodir_diagnose_'.$diagnose_this);
982 982
                 exit();
983 983
                 break;
984 984
 
985 985
             case 'diagnosis-fix' :
986 986
                 if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '')
987 987
                     $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']);
988
-                call_user_func('geodir_diagnose_' . $diagnose_this);
988
+                call_user_func('geodir_diagnose_'.$diagnose_this);
989 989
                 exit();
990 990
                 break;
991 991
         }
@@ -1010,50 +1010,50 @@  discard block
 block discarded – undo
1010 1010
 {
1011 1011
     global $wpdb;
1012 1012
     //$filter_arr['output_str'] .='###'.$table.'###';
1013
-    if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0) {
1014
-        $filter_arr['output_str'] .= "<li>" . __('ERROR: You did not follow instructions! Now you will need to contact support to manually fix things.', 'geodirectory') . "</li>";
1013
+    if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak2'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") > 0) {
1014
+        $filter_arr['output_str'] .= "<li>".__('ERROR: You did not follow instructions! Now you will need to contact support to manually fix things.', 'geodirectory')."</li>";
1015 1015
         $filter_arr['is_error_during_diagnose'] = true;
1016 1016
 
1017
-    } elseif ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) {
1018
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s_ms_bak table found', 'geodirectory'), $tabel_name) . "</li>";
1017
+    } elseif ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") > 0) {
1018
+        $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: %s_ms_bak table found', 'geodirectory'), $tabel_name)."</li>";
1019 1019
         $filter_arr['is_error_during_diagnose'] = true;
1020
-        $filter_arr['output_str'] .= "<li>" . __('IMPORTANT: This can be caused by out of date core or addons, please update core + addons before trying the fix OR YOU WILL HAVE A BAD TIME!', 'geodirectory') . "</li>";
1020
+        $filter_arr['output_str'] .= "<li>".__('IMPORTANT: This can be caused by out of date core or addons, please update core + addons before trying the fix OR YOU WILL HAVE A BAD TIME!', 'geodirectory')."</li>";
1021 1021
         $filter_arr['is_error_during_diagnose'] = true;
1022 1022
 
1023 1023
         if ($fix) {
1024
-            $ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $table . "_ms_bak");// get backup table count
1025
-            $new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table");// get new table count
1024
+            $ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$table."_ms_bak"); // get backup table count
1025
+            $new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."$table"); // get new table count
1026 1026
 
1027 1027
             if ($ms_bak_count == $new_table_count) {// if they are the same count rename to bak2
1028 1028
                 //$filter_arr['output_str'] .= "<li>".sprintf( __('-->PROBLEM: %s table count is the same as new table, contact support' , 'geodirectory'), $table )."</li>" ;
1029 1029
 
1030
-                $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename bak table to new table
1030
+                $wpdb->query("RENAME TABLE ".$table."_ms_bak TO ".$table."_ms_bak2"); // rename bak table to new table
1031 1031
 
1032
-                if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
1033
-                    $filter_arr['output_str'] .= "<li>" . __('-->FIXED: Renamed and backed up the tables', 'geodirectory') . "</li>";
1032
+                if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") == 0) {
1033
+                    $filter_arr['output_str'] .= "<li>".__('-->FIXED: Renamed and backed up the tables', 'geodirectory')."</li>";
1034 1034
                 } else {
1035
-                    $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
1035
+                    $filter_arr['output_str'] .= "<li>".__('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory')."</li>";
1036 1036
                 }
1037 1037
 
1038 1038
             } elseif ($ms_bak_count > $new_table_count) {//if backup is greater then restore it
1039 1039
 
1040
-                $wpdb->query("RENAME TABLE " . $wpdb->prefix . "$table TO " . $table . "_ms_bak2");// rename new table to bak2
1041
-                $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $wpdb->prefix . "$table");// rename bak table to new table
1040
+                $wpdb->query("RENAME TABLE ".$wpdb->prefix."$table TO ".$table."_ms_bak2"); // rename new table to bak2
1041
+                $wpdb->query("RENAME TABLE ".$table."_ms_bak TO ".$wpdb->prefix."$table"); // rename bak table to new table
1042 1042
 
1043
-                if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") && $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1044
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: restored largest table %s', 'geodirectory'), $table) . "</li>";
1043
+                if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") && $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1044
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: restored largest table %s', 'geodirectory'), $table)."</li>";
1045 1045
                 } else {
1046
-                    $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
1046
+                    $filter_arr['output_str'] .= "<li>".__('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory')."</li>";
1047 1047
                 }
1048 1048
 
1049 1049
             } elseif ($new_table_count > $ms_bak_count) {// we cant do much so rename the table to stop errors
1050 1050
 
1051
-                $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename ms_bak table to ms_bak2
1051
+                $wpdb->query("RENAME TABLE ".$table."_ms_bak TO ".$table."_ms_bak2"); // rename ms_bak table to ms_bak2
1052 1052
 
1053
-                if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
1054
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: table %s_ms_bak renamed and backed up', 'geodirectory'), $table) . "</li>";
1053
+                if ($wpdb->query("SHOW TABLES LIKE '".$table."_ms_bak'") == 0) {
1054
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: table %s_ms_bak renamed and backed up', 'geodirectory'), $table)."</li>";
1055 1055
                 } else {
1056
-                    $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
1056
+                    $filter_arr['output_str'] .= "<li>".__('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory')."</li>";
1057 1057
                 }
1058 1058
 
1059 1059
             }
@@ -1061,54 +1061,54 @@  discard block
 block discarded – undo
1061 1061
         }
1062 1062
 
1063 1063
 
1064
-    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) {
1065
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: Two %s tables found', 'geodirectory'), $tabel_name) . "</li>";
1064
+    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") > 0) {
1065
+        $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: Two %s tables found', 'geodirectory'), $tabel_name)."</li>";
1066 1066
         $filter_arr['is_error_during_diagnose'] = true;
1067 1067
 
1068 1068
         if ($fix) {
1069 1069
             if ($wpdb->get_var("SELECT COUNT(*) FROM $table") == 0) {// if first table is empty just delete it
1070 1070
                 if ($wpdb->query("DROP TABLE IF EXISTS $table")) {
1071
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $table) . "</li>";
1071
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $table)."</li>";
1072 1072
                 } else {
1073
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $table) . "</li>";
1073
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $table)."</li>";
1074 1074
                 }
1075 1075
 
1076
-            } elseif ($wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table") == 0) {// if main table is empty but original is not, delete main and rename original
1077
-                if ($wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "$table")) {
1078
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $wpdb->prefix . $table) . "</li>";
1076
+            } elseif ($wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."$table") == 0) {// if main table is empty but original is not, delete main and rename original
1077
+                if ($wpdb->query("DROP TABLE IF EXISTS ".$wpdb->prefix."$table")) {
1078
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $wpdb->prefix.$table)."</li>";
1079 1079
                 } else {
1080
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $wpdb->prefix . $table) . "</li>";
1080
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $wpdb->prefix.$table)."</li>";
1081 1081
                 }
1082
-                if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1083
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
1082
+                if ($wpdb->query("RENAME TABLE $table TO ".$wpdb->prefix."$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1083
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>";
1084 1084
                 } else {
1085
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
1085
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>";
1086 1086
                 }
1087 1087
             } else {// else rename the original table to _ms_bak
1088
-                if ($wpdb->query("RENAME TABLE $table TO " . $table . "_ms_bak") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1089
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table contained info so we renamed %s to %s incase it is needed in future', 'geodirectory'), $table, $table . "_ms_bak") . "</li>";
1088
+                if ($wpdb->query("RENAME TABLE $table TO ".$table."_ms_bak") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1089
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Table contained info so we renamed %s to %s incase it is needed in future', 'geodirectory'), $table, $table."_ms_bak")."</li>";
1090 1090
                 } else {
1091
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Table %s could not be renamed to %s, this table has info so may need to be reviewed manually in the DB', 'geodirectory'), $table, $table . "_ms_bak") . "</li>";
1091
+                    $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Table %s could not be renamed to %s, this table has info so may need to be reviewed manually in the DB', 'geodirectory'), $table, $table."_ms_bak")."</li>";
1092 1092
                 }
1093 1093
             }
1094 1094
         }
1095 1095
 
1096
-    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) {
1097
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table not converted', 'geodirectory'), $tabel_name) . "</li>";
1096
+    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") == 0) {
1097
+        $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: %s table not converted', 'geodirectory'), $tabel_name)."</li>";
1098 1098
         $filter_arr['is_error_during_diagnose'] = true;
1099 1099
 
1100 1100
         if ($fix) {
1101 1101
             // if original table exists but new does not, rename
1102
-            if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1103
-                $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
1102
+            if ($wpdb->query("RENAME TABLE $table TO ".$wpdb->prefix."$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
1103
+                $filter_arr['output_str'] .= "<li>".sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>";
1104 1104
             } else {
1105
-                $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
1105
+                $filter_arr['output_str'] .= "<li>".sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix.$table)."</li>";
1106 1106
             }
1107 1107
 
1108 1108
         }
1109 1109
 
1110
-    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") == 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) {
1111
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table does not exist', 'geodirectory'), $tabel_name) . "</li>";
1110
+    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") == 0 && $wpdb->query("SHOW TABLES LIKE '".$wpdb->prefix."$table'") == 0) {
1111
+        $filter_arr['output_str'] .= "<li>".sprintf(__('ERROR: %s table does not exist', 'geodirectory'), $tabel_name)."</li>";
1112 1112
         $filter_arr['is_error_during_diagnose'] = true;
1113 1113
 
1114 1114
         if ($fix) {
@@ -1122,11 +1122,11 @@  discard block
 block discarded – undo
1122 1122
             delete_option('geodir_custom_posts_db_version');
1123 1123
             delete_option('geodir_reviewratings_db_version');
1124 1124
             delete_option('geodiradvancesearch_db_version');
1125
-            $filter_arr['output_str'] .= "<li>" . __('-->TRY: Please refresh page to run table install functions', 'geodirectory') . "</li>";
1125
+            $filter_arr['output_str'] .= "<li>".__('-->TRY: Please refresh page to run table install functions', 'geodirectory')."</li>";
1126 1126
         }
1127 1127
 
1128 1128
     } else {
1129
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('%s table converted correctly', 'geodirectory'), $tabel_name) . "</li>";
1129
+        $filter_arr['output_str'] .= "<li>".sprintf(__('%s table converted correctly', 'geodirectory'), $tabel_name)."</li>";
1130 1130
     }
1131 1131
     return $filter_arr;
1132 1132
 }
@@ -1155,23 +1155,23 @@  discard block
 block discarded – undo
1155 1155
     if (!empty($all_postypes)) {
1156 1156
         foreach ($all_postypes as $key) {
1157 1157
             // update each GD CPT
1158
-            $posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
1158
+            $posts = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."geodir_".$key."_detail d");
1159 1159
 
1160 1160
             if (!empty($posts)) {
1161 1161
 
1162 1162
                 foreach ($posts as $p) {
1163 1163
                     $p->post_type = $key;
1164
-                    $raw_tags = wp_get_object_terms($p->post_id, $p->post_type . '_tags', array('fields' => 'names'));
1164
+                    $raw_tags = wp_get_object_terms($p->post_id, $p->post_type.'_tags', array('fields' => 'names'));
1165 1165
                     if (empty($raw_tags)) {
1166 1166
                         $post_tags = '';
1167 1167
                     } else {
1168 1168
                         $post_tags = implode(",", $raw_tags);
1169 1169
                     }
1170
-                    $tablename = $plugin_prefix . $p->post_type . '_detail';
1171
-                    $wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET post_tags=%s WHERE post_id =%d", $post_tags, $p->post_id));
1170
+                    $tablename = $plugin_prefix.$p->post_type.'_detail';
1171
+                    $wpdb->query($wpdb->prepare("UPDATE ".$tablename." SET post_tags=%s WHERE post_id =%d", $post_tags, $p->post_id));
1172 1172
 
1173 1173
                 }
1174
-                $output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>";
1174
+                $output_str .= "<li>".$key.__(': Done', 'geodirectory')."</li>";
1175 1175
             }
1176 1176
 
1177 1177
         }
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 
1181 1181
     if ($is_error_during_diagnose) {
1182 1182
         $info_div_class = "geodir_problem_info";
1183
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1183
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1184 1184
     } else {
1185 1185
         $info_div_class = "geodir_noproblem_info";
1186 1186
         $fix_button_txt = '';
@@ -1217,29 +1217,29 @@  discard block
 block discarded – undo
1217 1217
     if (!empty($all_postypes)) {
1218 1218
         foreach ($all_postypes as $key) {
1219 1219
             // update each GD CTP
1220
-            $posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d WHERE d." . $key . "category='' ");
1220
+            $posts = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."geodir_".$key."_detail d WHERE d.".$key."category='' ");
1221 1221
 
1222 1222
             if (!empty($posts)) {
1223 1223
 
1224 1224
                 foreach ($posts as $p) {
1225 1225
                     $p->post_type = $key;
1226
-                    $raw_cats = wp_get_object_terms($p->post_id, $p->post_type . 'category', array('fields' => 'ids'));
1226
+                    $raw_cats = wp_get_object_terms($p->post_id, $p->post_type.'category', array('fields' => 'ids'));
1227 1227
 
1228 1228
                     if (empty($raw_cats)) {
1229 1229
                         $post_categories = get_post_meta($p->post_id, 'post_categories', true);
1230 1230
 
1231
-                        if (!empty($post_categories) && !empty($post_categories[$p->post_type . 'category'])) {
1232
-                            $post_categories[$p->post_type . 'category'] = str_replace("d:", "", $post_categories[$p->post_type . 'category']);
1233
-                            foreach (explode(",", $post_categories[$p->post_type . 'category']) as $cat_part) {
1231
+                        if (!empty($post_categories) && !empty($post_categories[$p->post_type.'category'])) {
1232
+                            $post_categories[$p->post_type.'category'] = str_replace("d:", "", $post_categories[$p->post_type.'category']);
1233
+                            foreach (explode(",", $post_categories[$p->post_type.'category']) as $cat_part) {
1234 1234
                                 if (is_numeric($cat_part)) {
1235
-                                    $raw_cats[] = (int)$cat_part;
1235
+                                    $raw_cats[] = (int) $cat_part;
1236 1236
                                 }
1237 1237
                             }
1238 1238
 
1239 1239
                         }
1240 1240
 
1241 1241
                         if (!empty($raw_cats)) {
1242
-                            $term_taxonomy_ids = wp_set_object_terms($p->post_id, $raw_cats, $p->post_type . 'category');
1242
+                            $term_taxonomy_ids = wp_set_object_terms($p->post_id, $raw_cats, $p->post_type.'category');
1243 1243
 
1244 1244
                         }
1245 1245
 
@@ -1249,14 +1249,14 @@  discard block
 block discarded – undo
1249 1249
                     if (empty($raw_cats)) {
1250 1250
                         $post_cats = '';
1251 1251
                     } else {
1252
-                        $post_cats = ',' . implode(",", $raw_cats) . ',';
1252
+                        $post_cats = ','.implode(",", $raw_cats).',';
1253 1253
                     }
1254
-                    $tablename = $plugin_prefix . $p->post_type . '_detail';
1255
-                    $wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET " . $p->post_type . "category=%s WHERE post_id =%d", $post_cats, $p->post_id));
1254
+                    $tablename = $plugin_prefix.$p->post_type.'_detail';
1255
+                    $wpdb->query($wpdb->prepare("UPDATE ".$tablename." SET ".$p->post_type."category=%s WHERE post_id =%d", $post_cats, $p->post_id));
1256 1256
                 }
1257 1257
 
1258 1258
             }
1259
-            $output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>";
1259
+            $output_str .= "<li>".$key.__(': Done', 'geodirectory')."</li>";
1260 1260
 
1261 1261
         }
1262 1262
 
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
 
1265 1265
     if ($is_error_during_diagnose) {
1266 1266
         $info_div_class = "geodir_problem_info";
1267
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1267
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1268 1268
     } else {
1269 1269
         $info_div_class = "geodir_noproblem_info";
1270 1270
         $fix_button_txt = '';
@@ -1317,15 +1317,15 @@  discard block
 block discarded – undo
1317 1317
     if (!empty($ver_arr)) {
1318 1318
         foreach ($ver_arr as $key => $val) {
1319 1319
             if (delete_option($val)) {
1320
-                $output_str .= "<li>" . $key . __(' Version: Deleted', 'geodirectory') . "</li>";
1320
+                $output_str .= "<li>".$key.__(' Version: Deleted', 'geodirectory')."</li>";
1321 1321
             } else {
1322
-                $output_str .= "<li>" . $key . __(' Version: Not Found', 'geodirectory') . "</li>";
1322
+                $output_str .= "<li>".$key.__(' Version: Not Found', 'geodirectory')."</li>";
1323 1323
             }
1324 1324
 
1325 1325
         }
1326 1326
 
1327 1327
         if ($output_str) {
1328
-            $output_str .= "<li><strong>" . __(' Upgrade/install scripts will run on next page reload.', 'geodirectory') . "</strong></li>";
1328
+            $output_str .= "<li><strong>".__(' Upgrade/install scripts will run on next page reload.', 'geodirectory')."</strong></li>";
1329 1329
         }
1330 1330
 
1331 1331
     }
@@ -1362,43 +1362,43 @@  discard block
 block discarded – undo
1362 1362
     $output_str = '';
1363 1363
 
1364 1364
     // check review locations
1365
-    if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE post_city='' OR post_city IS NULL OR post_latitude='' OR post_latitude IS NULL")) {
1366
-        $output_str .= "<li>" . __('Review locations missing or broken', 'geodirectory') . "</li>";
1365
+    if ($wpdb->get_results("SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE post_city='' OR post_city IS NULL OR post_latitude='' OR post_latitude IS NULL")) {
1366
+        $output_str .= "<li>".__('Review locations missing or broken', 'geodirectory')."</li>";
1367 1367
         $is_error_during_diagnose = true;
1368 1368
 
1369 1369
         if ($fix) {
1370 1370
             if (geodir_fix_review_location()) {
1371
-                $output_str .= "<li><strong>" . __('-->FIXED: Review locations fixed', 'geodirectory') . "</strong></li>";
1371
+                $output_str .= "<li><strong>".__('-->FIXED: Review locations fixed', 'geodirectory')."</strong></li>";
1372 1372
             } else {
1373
-                $output_str .= "<li><strong>" . __('-->FAILED: Review locations fix failed', 'geodirectory') . "</strong></li>";
1373
+                $output_str .= "<li><strong>".__('-->FAILED: Review locations fix failed', 'geodirectory')."</strong></li>";
1374 1374
             }
1375 1375
         }
1376 1376
 
1377 1377
     } else {
1378
-        $output_str .= "<li>" . __('Review locations ok', 'geodirectory') . "</li>";
1378
+        $output_str .= "<li>".__('Review locations ok', 'geodirectory')."</li>";
1379 1379
     }
1380 1380
 
1381 1381
     // check review content
1382
-    if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_content IS NULL")) {
1383
-        $output_str .= "<li>" . __('Review content missing or broken', 'geodirectory') . "</li>";
1382
+    if ($wpdb->get_results("SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE comment_content IS NULL")) {
1383
+        $output_str .= "<li>".__('Review content missing or broken', 'geodirectory')."</li>";
1384 1384
         $is_error_during_diagnose = true;
1385 1385
 
1386 1386
         if ($fix) {
1387 1387
             if (geodir_fix_review_content()) {
1388
-                $output_str .= "<li><strong>" . __('-->FIXED: Review content fixed', 'geodirectory') . "</strong></li>";
1388
+                $output_str .= "<li><strong>".__('-->FIXED: Review content fixed', 'geodirectory')."</strong></li>";
1389 1389
             } else {
1390
-                $output_str .= "<li><strong>" . __('-->FAILED: Review content fix failed', 'geodirectory') . "</strong></li>";
1390
+                $output_str .= "<li><strong>".__('-->FAILED: Review content fix failed', 'geodirectory')."</strong></li>";
1391 1391
             }
1392 1392
         }
1393 1393
 
1394 1394
     } else {
1395
-        $output_str .= "<li>" . __('Review content ok', 'geodirectory') . "</li>";
1395
+        $output_str .= "<li>".__('Review content ok', 'geodirectory')."</li>";
1396 1396
     }
1397 1397
 
1398 1398
 
1399 1399
     if ($is_error_during_diagnose) {
1400 1400
         $info_div_class = "geodir_problem_info";
1401
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1401
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1402 1402
     } else {
1403 1403
         $info_div_class = "geodir_noproblem_info";
1404 1404
         $fix_button_txt = '';
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
 
1463 1463
     if ($is_error_during_diagnose) {
1464 1464
         $info_div_class = "geodir_problem_info";
1465
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='multisite_conversion' />";
1465
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='multisite_conversion' />";
1466 1466
     } else {
1467 1467
         $info_div_class = "geodir_noproblem_info";
1468 1468
         $fix_button_txt = '';
@@ -1496,7 +1496,7 @@  discard block
 block discarded – undo
1496 1496
     else {
1497 1497
         $page_found = $wpdb->get_var(
1498 1498
             $wpdb->prepare(
1499
-                "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;",
1499
+                "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s LIMIT 1;",
1500 1500
                 array($slug)
1501 1501
             )
1502 1502
         );
@@ -1542,18 +1542,18 @@  discard block
 block discarded – undo
1542 1542
     //////////////////////////////////
1543 1543
     $option_value = get_option('geodir_home_page');
1544 1544
     $page = get_post($option_value);
1545
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1545
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1546 1546
 
1547
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1548
-        $output_str .= "<li>" . __('GD Home page exists with proper setting.', 'geodirectory') . "</li>";
1547
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1548
+        $output_str .= "<li>".__('GD Home page exists with proper setting.', 'geodirectory')."</li>";
1549 1549
     else {
1550 1550
         $is_error_during_diagnose = true;
1551
-        $output_str .= "<li><strong>" . __('GD Home page is missing.', 'geodirectory') . "</strong></li>";
1551
+        $output_str .= "<li><strong>".__('GD Home page is missing.', 'geodirectory')."</strong></li>";
1552 1552
         if ($fix) {
1553 1553
             if (geodir_fix_virtual_page('gd-home', __('GD Home page', 'geodirectory'), $page_found, 'geodir_home_page')) {
1554
-                $output_str .= "<li><strong>" . __('-->FIXED: GD Home page fixed', 'geodirectory') . "</strong></li>";
1554
+                $output_str .= "<li><strong>".__('-->FIXED: GD Home page fixed', 'geodirectory')."</strong></li>";
1555 1555
             } else {
1556
-                $output_str .= "<li><strong>" . __('-->FAILED: GD Home page fix failed', 'geodirectory') . "</strong></li>";
1556
+                $output_str .= "<li><strong>".__('-->FAILED: GD Home page fix failed', 'geodirectory')."</strong></li>";
1557 1557
             }
1558 1558
         }
1559 1559
     }
@@ -1567,18 +1567,18 @@  discard block
 block discarded – undo
1567 1567
     //////////////////////////////////
1568 1568
     $option_value = get_option('geodir_add_listing_page');
1569 1569
     $page = get_post($option_value);
1570
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1570
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1571 1571
 
1572
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1573
-        $output_str .= "<li>" . __('Add Listing page exists with proper setting.', 'geodirectory') . "</li>";
1572
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1573
+        $output_str .= "<li>".__('Add Listing page exists with proper setting.', 'geodirectory')."</li>";
1574 1574
     else {
1575 1575
         $is_error_during_diagnose = true;
1576
-        $output_str .= "<li><strong>" . __('Add Listing page is missing.', 'geodirectory') . "</strong></li>";
1576
+        $output_str .= "<li><strong>".__('Add Listing page is missing.', 'geodirectory')."</strong></li>";
1577 1577
         if ($fix) {
1578 1578
             if (geodir_fix_virtual_page('add-listing', __('Add Listing', 'geodirectory'), $page_found, 'geodir_add_listing_page')) {
1579
-                $output_str .= "<li><strong>" . __('-->FIXED: Add Listing page fixed', 'geodirectory') . "</strong></li>";
1579
+                $output_str .= "<li><strong>".__('-->FIXED: Add Listing page fixed', 'geodirectory')."</strong></li>";
1580 1580
             } else {
1581
-                $output_str .= "<li><strong>" . __('-->FAILED: Add Listing page fix failed', 'geodirectory') . "</strong></li>";
1581
+                $output_str .= "<li><strong>".__('-->FAILED: Add Listing page fix failed', 'geodirectory')."</strong></li>";
1582 1582
             }
1583 1583
         }
1584 1584
     }
@@ -1593,18 +1593,18 @@  discard block
 block discarded – undo
1593 1593
     //////////////////////////////////
1594 1594
     $option_value = get_option('geodir_preview_page');
1595 1595
     $page = get_post($option_value);
1596
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1596
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1597 1597
 
1598
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1599
-        $output_str .= "<li>" . __('Listing Preview page exists with proper setting.', 'geodirectory') . "</li>";
1598
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1599
+        $output_str .= "<li>".__('Listing Preview page exists with proper setting.', 'geodirectory')."</li>";
1600 1600
     else {
1601 1601
         $is_error_during_diagnose = true;
1602
-        $output_str .= "<li><strong>" . __('Listing Preview page is missing.', 'geodirectory') . "</strong></li>";
1602
+        $output_str .= "<li><strong>".__('Listing Preview page is missing.', 'geodirectory')."</strong></li>";
1603 1603
         if ($fix) {
1604 1604
             if (geodir_fix_virtual_page('listing-preview', __('Listing Preview', 'geodirectory'), $page_found, 'geodir_preview_page')) {
1605
-                $output_str .= "<li><strong>" . __('-->FIXED: Listing Preview page fixed', 'geodirectory') . "</strong></li>";
1605
+                $output_str .= "<li><strong>".__('-->FIXED: Listing Preview page fixed', 'geodirectory')."</strong></li>";
1606 1606
             } else {
1607
-                $output_str .= "<li><strong>" . __('-->FAILED: Listing Preview page fix failed', 'geodirectory') . "</strong></li>";
1607
+                $output_str .= "<li><strong>".__('-->FAILED: Listing Preview page fix failed', 'geodirectory')."</strong></li>";
1608 1608
             }
1609 1609
         }
1610 1610
     }
@@ -1618,18 +1618,18 @@  discard block
 block discarded – undo
1618 1618
     //////////////////////////////////
1619 1619
     $option_value = get_option('geodir_success_page');
1620 1620
     $page = get_post($option_value);
1621
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1621
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1622 1622
 
1623
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1624
-        $output_str .= "<li>" . __('Listing Success page exists with proper setting.', 'geodirectory') . "</li>";
1623
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1624
+        $output_str .= "<li>".__('Listing Success page exists with proper setting.', 'geodirectory')."</li>";
1625 1625
     else {
1626 1626
         $is_error_during_diagnose = true;
1627
-        $output_str .= "<li><strong>" . __('Listing Success page is missing.', 'geodirectory') . "</strong></li>";
1627
+        $output_str .= "<li><strong>".__('Listing Success page is missing.', 'geodirectory')."</strong></li>";
1628 1628
         if ($fix) {
1629 1629
             if (geodir_fix_virtual_page('listing-success', __('Listing Success', 'geodirectory'), $page_found, 'geodir_success_page')) {
1630
-                $output_str .= "<li><strong>" . __('-->FIXED: Listing Success page fixed', 'geodirectory') . "</strong></li>";
1630
+                $output_str .= "<li><strong>".__('-->FIXED: Listing Success page fixed', 'geodirectory')."</strong></li>";
1631 1631
             } else {
1632
-                $output_str .= "<li><strong>" . __('-->FAILED: Listing Success page fix failed', 'geodirectory') . "</strong></li>";
1632
+                $output_str .= "<li><strong>".__('-->FAILED: Listing Success page fix failed', 'geodirectory')."</strong></li>";
1633 1633
             }
1634 1634
         }
1635 1635
     }
@@ -1643,18 +1643,18 @@  discard block
 block discarded – undo
1643 1643
     //////////////////////////////////
1644 1644
     $option_value = get_option('geodir_info_page');
1645 1645
     $page = get_post($option_value);
1646
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1646
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1647 1647
 
1648
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1649
-        $output_str .= "<li>" . __('Info page exists with proper setting.', 'geodirectory') . "</li>";
1648
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1649
+        $output_str .= "<li>".__('Info page exists with proper setting.', 'geodirectory')."</li>";
1650 1650
     else {
1651 1651
         $is_error_during_diagnose = true;
1652
-        $output_str .= "<li><strong>" . __('Info page is missing.', 'geodirectory') . "</strong></li>";
1652
+        $output_str .= "<li><strong>".__('Info page is missing.', 'geodirectory')."</strong></li>";
1653 1653
         if ($fix) {
1654 1654
             if (geodir_fix_virtual_page('gd-info', __('Info', 'geodirectory'), $page_found, 'geodir_info_page')) {
1655
-                $output_str .= "<li><strong>" . __('-->FIXED: Info page fixed', 'geodirectory') . "</strong></li>";
1655
+                $output_str .= "<li><strong>".__('-->FIXED: Info page fixed', 'geodirectory')."</strong></li>";
1656 1656
             } else {
1657
-                $output_str .= "<li><strong>" . __('-->FAILED: Info page fix failed', 'geodirectory') . "</strong></li>";
1657
+                $output_str .= "<li><strong>".__('-->FAILED: Info page fix failed', 'geodirectory')."</strong></li>";
1658 1658
             }
1659 1659
         }
1660 1660
     }
@@ -1668,18 +1668,18 @@  discard block
 block discarded – undo
1668 1668
     //////////////////////////////////
1669 1669
     $option_value = get_option('geodir_login_page');
1670 1670
     $page = get_post($option_value);
1671
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1671
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1672 1672
 
1673
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1674
-        $output_str .= "<li>" . __('Login page exists with proper setting.', 'geodirectory') . "</li>";
1673
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1674
+        $output_str .= "<li>".__('Login page exists with proper setting.', 'geodirectory')."</li>";
1675 1675
     else {
1676 1676
         $is_error_during_diagnose = true;
1677
-        $output_str .= "<li><strong>" . __('Login page is missing.', 'geodirectory') . "</strong></li>";
1677
+        $output_str .= "<li><strong>".__('Login page is missing.', 'geodirectory')."</strong></li>";
1678 1678
         if ($fix) {
1679 1679
             if (geodir_fix_virtual_page('gd-login', __('Login', 'geodirectory'), $page_found, 'geodir_login_page')) {
1680
-                $output_str .= "<li><strong>" . __('-->FIXED: Login page fixed', 'geodirectory') . "</strong></li>";
1680
+                $output_str .= "<li><strong>".__('-->FIXED: Login page fixed', 'geodirectory')."</strong></li>";
1681 1681
             } else {
1682
-                $output_str .= "<li><strong>" . __('-->FAILED: Login page fix failed', 'geodirectory') . "</strong></li>";
1682
+                $output_str .= "<li><strong>".__('-->FAILED: Login page fix failed', 'geodirectory')."</strong></li>";
1683 1683
             }
1684 1684
         }
1685 1685
     }
@@ -1693,18 +1693,18 @@  discard block
 block discarded – undo
1693 1693
     //////////////////////////////////
1694 1694
     $option_value = get_option('geodir_location_page');
1695 1695
     $page = get_post($option_value);
1696
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1696
+    if (!empty($page)) {$page_found = $page->ID; } else {$page_found = ''; }
1697 1697
 
1698
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1699
-        $output_str .= "<li>" . __('Location page exists with proper setting.', 'geodirectory') . "</li>";
1698
+    if (!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status == 'publish')
1699
+        $output_str .= "<li>".__('Location page exists with proper setting.', 'geodirectory')."</li>";
1700 1700
     else {
1701 1701
         $is_error_during_diagnose = true;
1702
-        $output_str .= "<li><strong>" . __('Location page is missing.', 'geodirectory') . "</strong></li>";
1702
+        $output_str .= "<li><strong>".__('Location page is missing.', 'geodirectory')."</strong></li>";
1703 1703
         if ($fix) {
1704 1704
             if (geodir_fix_virtual_page('location', __('Location', 'geodirectory'), $page_found, 'geodir_location_page')) {
1705
-                $output_str .= "<li><strong>" . __('-->FIXED: Location page fixed', 'geodirectory') . "</strong></li>";
1705
+                $output_str .= "<li><strong>".__('-->FIXED: Location page fixed', 'geodirectory')."</strong></li>";
1706 1706
             } else {
1707
-                $output_str .= "<li><strong>" . __('-->FAILED: Location page fix failed', 'geodirectory') . "</strong></li>";
1707
+                $output_str .= "<li><strong>".__('-->FAILED: Location page fix failed', 'geodirectory')."</strong></li>";
1708 1708
             }
1709 1709
         }
1710 1710
     }
@@ -1713,13 +1713,13 @@  discard block
 block discarded – undo
1713 1713
     /* Diagnose Location Page Ends */
1714 1714
     ////////////////////////////////
1715 1715
 
1716
-    $page_chk_arr = array('output_str'=>$output_str,'is_error_during_diagnose'=>$is_error_during_diagnose );
1716
+    $page_chk_arr = array('output_str'=>$output_str, 'is_error_during_diagnose'=>$is_error_during_diagnose);
1717 1717
     /**
1718 1718
      * This action is called at the end of the GD Tools page check function.
1719 1719
      *
1720 1720
      * @since 1.5.2
1721 1721
      */
1722
-    $page_chk_arr = apply_filters('geodir_diagnose_default_pages',$page_chk_arr);
1722
+    $page_chk_arr = apply_filters('geodir_diagnose_default_pages', $page_chk_arr);
1723 1723
 
1724 1724
     $output_str = $page_chk_arr['output_str'];
1725 1725
     $is_error_during_diagnose = $page_chk_arr['is_error_during_diagnose'];
@@ -1729,7 +1729,7 @@  discard block
 block discarded – undo
1729 1729
             flush_rewrite_rules();
1730 1730
         }
1731 1731
         $info_div_class = "geodir_problem_info";
1732
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='default_pages' />";
1732
+        $fix_button_txt = "<input type='button' value='".__('Fix', 'geodirectory')."' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='default_pages' />";
1733 1733
     } else {
1734 1734
         $info_div_class = "geodir_noproblem_info";
1735 1735
         $fix_button_txt = '';
@@ -1757,10 +1757,10 @@  discard block
 block discarded – undo
1757 1757
     $fix_button_txt = '';
1758 1758
 
1759 1759
     if ($is_error_during_diagnose) {
1760
-        $output_str .= "<li>" . __('Fail to load custom fields in to file for translation, please check file permission:', 'geodirectory') . ' ' . geodir_plugin_path() . '/db-language.php' . "</li>";
1760
+        $output_str .= "<li>".__('Fail to load custom fields in to file for translation, please check file permission:', 'geodirectory').' '.geodir_plugin_path().'/db-language.php'."</li>";
1761 1761
 		$info_div_class = "geodir_problem_info";
1762 1762
     } else {
1763
-        $output_str .= "<li>" . __('Load custom fields in to file for translation: ok', 'geodirectory') . "</li>";
1763
+        $output_str .= "<li>".__('Load custom fields in to file for translation: ok', 'geodirectory')."</li>";
1764 1764
 		$info_div_class = "geodir_noproblem_info";
1765 1765
         $fix_button_txt = '';
1766 1766
     }
@@ -1802,17 +1802,17 @@  discard block
 block discarded – undo
1802 1802
     global $wpdb, $wp_query, $plugin_prefix;
1803 1803
 
1804 1804
     if (is_admin() && !empty($wp_query->query_vars) && !empty($wp_query->query_vars['is_geodir_loop']) && !empty($wp_query->query_vars['orderby']) && $wp_query->query_vars['orderby'] == 'expire' && !empty($wp_query->query_vars['post_type']) && in_array($wp_query->query_vars['post_type'], geodir_get_posttypes()) && !empty($wp_query->query_vars['orderby']) && isset($clauses['join']) && isset($clauses['orderby']) && isset($clauses['fields'])) {
1805
-        $table = $plugin_prefix . $wp_query->query_vars['post_type'] . '_detail';
1805
+        $table = $plugin_prefix.$wp_query->query_vars['post_type'].'_detail';
1806 1806
 
1807
-        $join = $clauses['join'] . ' INNER JOIN ' . $table . ' AS gd_posts ON (gd_posts.post_id = ' . $wpdb->posts . '.ID)';
1807
+        $join = $clauses['join'].' INNER JOIN '.$table.' AS gd_posts ON (gd_posts.post_id = '.$wpdb->posts.'.ID)';
1808 1808
         $clauses['join'] = $join;
1809 1809
 
1810
-        $fields = $clauses['fields'] != '' ? $clauses['fields'] . ', ' : '';
1810
+        $fields = $clauses['fields'] != '' ? $clauses['fields'].', ' : '';
1811 1811
         $fields .= 'IF(UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), 253402300799) AS gd_expire';
1812 1812
         $clauses['fields'] = $fields;
1813 1813
 
1814 1814
         $order = !empty($wp_query->query_vars['order']) ? $wp_query->query_vars['order'] : 'ASC';
1815
-        $orderby = 'gd_expire ' . $order;
1815
+        $orderby = 'gd_expire '.$order;
1816 1816
         $clauses['orderby'] = $orderby;
1817 1817
     }
1818 1818
     return $clauses;
@@ -1855,7 +1855,7 @@  discard block
 block discarded – undo
1855 1855
         global $current_user;
1856 1856
         $upload_dir = wp_upload_dir();
1857 1857
 
1858
-        $file = $upload_dir['path'] . '/temp_' . $current_user->data->ID . '/geodir_tmp.csv';
1858
+        $file = $upload_dir['path'].'/temp_'.$current_user->data->ID.'/geodir_tmp.csv';
1859 1859
         $handle = fopen($file, 'w');
1860 1860
 
1861 1861
         fwrite($handle, $input);
@@ -1900,7 +1900,7 @@  discard block
 block discarded – undo
1900 1900
     $uploads_dir = $uploads['path'];
1901 1901
     $image_name_arr = explode('/', $filename);
1902 1902
     $filename = end($image_name_arr);
1903
-    $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1903
+    $target_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1904 1904
     $return = array();
1905 1905
     $return['file'] = $uploadedFile;
1906 1906
     $return['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory');
@@ -1917,8 +1917,8 @@  discard block
 block discarded – undo
1917 1917
 
1918 1918
                 if (($handle = fopen($target_path, "r")) !== FALSE) {
1919 1919
                     while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
1920
-                        if(is_array($data) && !empty($data)) {
1921
-                            $file[] = '"' . implode('","', $data) . '"';
1920
+                        if (is_array($data) && !empty($data)) {
1921
+                            $file[] = '"'.implode('","', $data).'"';
1922 1922
                         }
1923 1923
                     }
1924 1924
                     fclose($handle);
@@ -2035,10 +2035,10 @@  discard block
 block discarded – undo
2035 2035
                     $tag_arr = explode(',', $post_tags);
2036 2036
                 }
2037 2037
 
2038
-                $table = $plugin_prefix . $buffer[5] . '_detail'; // check table in database
2038
+                $table = $plugin_prefix.$buffer[5].'_detail'; // check table in database
2039 2039
 
2040 2040
                 $error = '';
2041
-                if ($wpdb->get_var("SHOW TABLES LIKE '" . $table . "'") != $table) {
2041
+                if ($wpdb->get_var("SHOW TABLES LIKE '".$table."'") != $table) {
2042 2042
                     $invalid_post_type++;
2043 2043
                     continue;
2044 2044
                 }
@@ -2064,7 +2064,7 @@  discard block
 block discarded – undo
2064 2064
                             if ($buffer[$c] != '0' && $buffer[$c] != '') {
2065 2065
                                 $submitdata = date('Y-m-d');
2066 2066
 
2067
-                                $gd_post_info['expire_date'] = date('Y-m-d', strtotime($submitdata . "+" . addslashes($buffer[$c]) . " days"));
2067
+                                $gd_post_info['expire_date'] = date('Y-m-d', strtotime($submitdata."+".addslashes($buffer[$c])." days"));
2068 2068
                             } else {
2069 2069
                                 $gd_post_info['expire_date'] = 'Never';
2070 2070
                             }
@@ -2092,7 +2092,7 @@  discard block
 block discarded – undo
2092 2092
 						
2093 2093
 						// Post status
2094 2094
 						if ($customKeyarray[$c] == 'post_status') {
2095
-                            $post_status = sanitize_key( $buffer[$c] );
2095
+                            $post_status = sanitize_key($buffer[$c]);
2096 2096
                         }
2097 2097
                     }
2098 2098
 
@@ -2110,8 +2110,8 @@  discard block
 block discarded – undo
2110 2110
 					
2111 2111
 					// Default post status
2112 2112
 					$default_status = 'publish';
2113
-					$post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status;
2114
-					$post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status;
2113
+					$post_status = !empty($post_status) ? sanitize_key($post_status) : $default_status;
2114
+					$post_status = !empty($wp_post_statuses) && !isset($wp_post_statuses[$post_status]) ? $default_status : $post_status;
2115 2115
 
2116 2116
                     $my_post['post_title'] = $post_title;
2117 2117
                     $my_post['post_content'] = $post_desc;
@@ -2155,7 +2155,7 @@  discard block
 block discarded – undo
2155 2155
                     $payment_info = array();
2156 2156
                     $package_info = array();
2157 2157
 
2158
-                    $package_info = (array)geodir_post_package_info($package_info, '', $buffer[5]);
2158
+                    $package_info = (array) geodir_post_package_info($package_info, '', $buffer[5]);
2159 2159
                     $package_id = '';
2160 2160
                     if (isset($gd_post_info['package_id']) && $gd_post_info['package_id'] != '') {
2161 2161
                         $package_id = $gd_post_info['package_id'];
@@ -2165,7 +2165,7 @@  discard block
 block discarded – undo
2165 2165
                         $payment_info['package_id'] = $package_info['pid'];
2166 2166
 
2167 2167
                         if (isset($package_info['alive_days']) && $package_info['alive_days'] != 0) {
2168
-                            $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['alive_days'] . " days"));
2168
+                            $payment_info['expire_date'] = date('Y-m-d', strtotime("+".$package_info['alive_days']." days"));
2169 2169
                         } else {
2170 2170
                             $payment_info['expire_date'] = 'Never';
2171 2171
                         }
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
 
2178 2178
                     $post_type = get_post_type($last_postid);
2179 2179
 
2180
-                    $table = $plugin_prefix . $post_type . '_detail';
2180
+                    $table = $plugin_prefix.$post_type.'_detail';
2181 2181
 
2182 2182
                     geodir_save_post_info($last_postid, $gd_post_info);
2183 2183
 
@@ -2198,7 +2198,7 @@  discard block
 block discarded – undo
2198 2198
                             $attachment['post_id'] = $last_postid;
2199 2199
                             $attachment['title'] = $img_name_arr[0];
2200 2200
                             $attachment['content'] = '';
2201
-                            $attachment['file'] = $sub_dir . '/' . $image_name;
2201
+                            $attachment['file'] = $sub_dir.'/'.$image_name;
2202 2202
                             $attachment['mime_type'] = $uploaded_file_type;
2203 2203
                             $attachment['menu_order'] = $menu_order;
2204 2204
                             $attachment['is_featured'] = 0;
@@ -2207,15 +2207,15 @@  discard block
 block discarded – undo
2207 2207
 
2208 2208
                             foreach ($attachment as $key => $val) {
2209 2209
                                 if ($val != '')
2210
-                                    $attachment_set .= $key . " = '" . $val . "', ";
2210
+                                    $attachment_set .= $key." = '".$val."', ";
2211 2211
                             }
2212 2212
                             $attachment_set = trim($attachment_set, ", ");
2213 2213
 
2214
-                            $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
2214
+                            $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set);
2215 2215
 
2216 2216
                             if ($menu_order == 1) {
2217 2217
                                 $post_type = get_post_type($last_postid);
2218
-                                $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($sub_dir . '/' . $image_name, $last_postid)));
2218
+                                $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($sub_dir.'/'.$image_name, $last_postid)));
2219 2219
                             }
2220 2220
                             $menu_order++;
2221 2221
                         }
@@ -2256,11 +2256,11 @@  discard block
 block discarded – undo
2256 2256
 }
2257 2257
 
2258 2258
 // Add the tab in left sidebar menu fro import & export page.
2259
-add_filter( 'geodir_settings_tabs_array', 'geodir_import_export_tab', 94 );
2259
+add_filter('geodir_settings_tabs_array', 'geodir_import_export_tab', 94);
2260 2260
 
2261 2261
 // Handle ajax request for import/export.
2262
-add_action( 'wp_ajax_geodir_import_export', 'geodir_ajax_import_export' );
2263
-add_action( 'wp_ajax_nopriv_geodir_import_exportn', 'geodir_ajax_import_export' );
2262
+add_action('wp_ajax_geodir_import_export', 'geodir_ajax_import_export');
2263
+add_action('wp_ajax_nopriv_geodir_import_exportn', 'geodir_ajax_import_export');
2264 2264
 
2265 2265
 
2266 2266
 /**
@@ -2271,40 +2271,40 @@  discard block
 block discarded – undo
2271 2271
  * @param $post_id int $post_id The post ID of the post being saved.
2272 2272
  * @param $post object $post The post object of the post being saved.
2273 2273
  */
2274
-function geodir_update_location_prefix($post_id,$post){
2275
-    if($post->post_type=='page' && $post->post_name && $post_id==get_option('geodir_location_page')){
2276
-        update_option('geodir_location_prefix',$post->post_name);
2274
+function geodir_update_location_prefix($post_id, $post) {
2275
+    if ($post->post_type == 'page' && $post->post_name && $post_id == get_option('geodir_location_page')) {
2276
+        update_option('geodir_location_prefix', $post->post_name);
2277 2277
     }
2278 2278
 
2279 2279
 }
2280 2280
 
2281
-add_action('save_post', 'geodir_update_location_prefix',10,2);
2281
+add_action('save_post', 'geodir_update_location_prefix', 10, 2);
2282 2282
 
2283
-add_action( 'wp_ajax_geodir_ga_callback', 'geodir_ga_callback' );
2283
+add_action('wp_ajax_geodir_ga_callback', 'geodir_ga_callback');
2284 2284
 
2285
-function geodir_ga_callback(){
2285
+function geodir_ga_callback() {
2286 2286
 
2287
-if(isset($_REQUEST['code']) && $_REQUEST['code']) {
2287
+if (isset($_REQUEST['code']) && $_REQUEST['code']) {
2288 2288
     $oAuthURL = "https://www.googleapis.com/oauth2/v3/token?";
2289 2289
     $code = "code=".$_REQUEST['code'];
2290 2290
     $grant_type = "&grant_type=authorization_code";
2291
-    $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
2291
+    $redirect_uri = "&redirect_uri=".admin_url('admin-ajax.php')."?action=geodir_ga_callback";
2292 2292
     $client_id = "&client_id=".get_option('geodir_ga_client_id');
2293 2293
     $client_secret = "&client_secret=".get_option('geodir_ga_client_secret');
2294 2294
 
2295
-    $auth_url = $oAuthURL . $code . $redirect_uri .  $grant_type . $client_id .$client_secret;
2295
+    $auth_url = $oAuthURL.$code.$redirect_uri.$grant_type.$client_id.$client_secret;
2296 2296
 
2297 2297
     $response = wp_remote_post($auth_url, array('timeout' => 15));
2298 2298
 
2299 2299
     //print_r($response);
2300 2300
 
2301
-    $error_msg =  __('Something went wrong','geodirectory');
2302
-    if(!empty($response['response']['code']) && $response['response']['code']==200){
2301
+    $error_msg = __('Something went wrong', 'geodirectory');
2302
+    if (!empty($response['response']['code']) && $response['response']['code'] == 200) {
2303 2303
 
2304 2304
         $parts = json_decode($response['body']);
2305 2305
         //print_r($parts);
2306
-        if(!isset($parts->access_token)){echo $error_msg." - #1";exit;}
2307
-        else{
2306
+        if (!isset($parts->access_token)) {echo $error_msg." - #1"; exit; }
2307
+        else {
2308 2308
 
2309 2309
             update_option('gd_ga_access_token', $parts->access_token);
2310 2310
             update_option('gd_ga_refresh_token', $parts->refresh_token);
@@ -2313,25 +2313,25 @@  discard block
 block discarded – undo
2313 2313
 
2314 2314
 
2315 2315
     }
2316
-    elseif(!empty($response['response']['code'])) {
2316
+    elseif (!empty($response['response']['code'])) {
2317 2317
         $parts = json_decode($response['body']);
2318 2318
 
2319
-        if(isset($parts->error)){
2320
-            echo $parts->error.": ".$parts->error_description;exit;
2321
-        }else{
2322
-            echo $error_msg." - #2";exit;
2319
+        if (isset($parts->error)) {
2320
+            echo $parts->error.": ".$parts->error_description; exit;
2321
+        } else {
2322
+            echo $error_msg." - #2"; exit;
2323 2323
         }
2324 2324
 
2325
-    }else{
2325
+    } else {
2326 2326
 
2327
-        echo $error_msg." - #3";exit;
2327
+        echo $error_msg." - #3"; exit;
2328 2328
 
2329 2329
     }
2330 2330
 }
2331 2331
     exit;
2332 2332
 }
2333 2333
 
2334
-add_filter( 'icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4 );
2334
+add_filter('icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4);
2335 2335
 
2336 2336
 if (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'permalink_settings') {
2337 2337
 	add_action('geodir_before_admin_panel', 'geodir_wpml_permalink_setting_notice');
@@ -2348,7 +2348,7 @@  discard block
 block discarded – undo
2348 2348
 function geodir_uninstall_settings($general_settings) {
2349 2349
     $settings   = array();
2350 2350
     $settings[] = array('type' => 'title', 'id' => 'uninstall_settings', 'name' => __('Uninstall Settings', 'geodirectory'));
2351
-    $settings[] = array('type' => 'sectionstart', 'id' => 'uninstall_settings_main', 'name' => __('Remove Data on Uninstall?', 'geodirectory' ));
2351
+    $settings[] = array('type' => 'sectionstart', 'id' => 'uninstall_settings_main', 'name' => __('Remove Data on Uninstall?', 'geodirectory'));
2352 2352
     
2353 2353
     $plugins    = get_plugins();
2354 2354
     $un_plugins = apply_filters('geodir_plugins_uninstall_settings', array());
@@ -2360,7 +2360,7 @@  discard block
 block discarded – undo
2360 2360
             if (in_array($plugin_name, $un_plugins)) {
2361 2361
                 $settings[] = array(
2362 2362
                     'type' => 'checkbox',
2363
-                    'id' => 'geodir_un_' . $plugin_name,
2363
+                    'id' => 'geodir_un_'.$plugin_name,
2364 2364
                     'name' => $data['Name'],
2365 2365
                     'desc' => __('Remove all data when deleted?', 'geodirectory'),
2366 2366
                     'std' => '0'
@@ -2394,7 +2394,7 @@  discard block
 block discarded – undo
2394 2394
  * @since 1.6.9
2395 2395
  */
2396 2396
 function geodir_uninstall_settings_desc() {
2397
-    echo '<p class="gd-un-settings-desc">' . __('Select the plugins that you would like to completely remove all of its data when the plugin is deleted.', 'geodirectory') . '</p>';
2397
+    echo '<p class="gd-un-settings-desc">'.__('Select the plugins that you would like to completely remove all of its data when the plugin is deleted.', 'geodirectory').'</p>';
2398 2398
 }
2399 2399
 add_action('geodir_settings_uninstall_settings_main_start', 'geodir_uninstall_settings_desc');
2400 2400
 
Please login to merge, or discard this patch.
geodirectory-admin/dummy-data/property_rent.php 3 patches
Indentation   +628 added lines, -628 removed lines patch added patch discarded remove patch
@@ -7,212 +7,212 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){
10
-    $fields = array();
11
-    $package = ($package_id=='') ? '' : array($package_id);
12
-
13
-    // price
14
-    $fields[] = array('listing_type' => $post_type,
15
-                      'field_type'          =>  'text',
16
-                      'data_type'           =>  'FLOAT',
17
-                      'decimal_point'       =>  '2',
18
-                      'admin_title'         =>  __('Price', 'geodirectory'),
19
-                      'site_title'          =>  __('Price', 'geodirectory'),
20
-                      'admin_desc'          =>  __('Enter the price per calendar month (PCM)in $ (no currency symbol)', 'geodirectory'),
21
-                      'htmlvar_name'        =>  'price',
22
-                      'is_active'           =>  true,
23
-                      'for_admin_use'       =>  false,
24
-                      'default_value'       =>  '',
25
-                      'show_in' 	        =>  '[detail],[listing]',
26
-                      'is_required'         =>  false,
27
-                      'validation_pattern'  =>  '\d+(\.\d{2})?',
28
-                      'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
-                      'required_msg'        =>  '',
30
-                      'field_icon'          =>  'fa fa-usd',
31
-                      'css_class'           =>  '',
32
-                      'cat_sort'            =>  true,
33
-                      'cat_filter'	        =>  true,
34
-                      'extra'        =>  array(
35
-                          'is_price'                  =>  1,
36
-                          'thousand_separator'        =>  'comma',
37
-                          'decimal_separator'         =>  'period',
38
-                          'decimal_display'           =>  'if',
39
-                          'currency_symbol'           =>  '$',
40
-                          'currency_symbol_placement' =>  'left'
41
-                      )
42
-    );
43
-
44
-    // property status
45
-    $fields[] = array('listing_type' => $post_type,
46
-                      'data_type' => 'VARCHAR',
47
-                      'field_type' => 'select',
48
-                      'field_type_key' => 'property_status',
49
-                      'is_active' => 1,
50
-                      'for_admin_use' => 0,
51
-                      'is_default' => 0,
52
-                      'admin_title' => __('Property Status', 'geodirectory'),
53
-                      'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
-                      'site_title' => __('Property Status', 'geodirectory'),
55
-                      'htmlvar_name' => 'property_status',
56
-                      'default_value' => '',
57
-                      'is_required' => '1',
58
-                      'required_msg' => '',
59
-                      'show_in'   =>  '[detail],[listing]',
60
-                      'show_on_pkg' => $package,
61
-                      'option_values' => 'Select Status/,For Rent,Let,Under Offer',
62
-                      'field_icon' => 'fa fa-home',
63
-                      'css_class' => '',
64
-                      'cat_sort' => 1,
65
-                      'cat_filter' => 1,
66
-    );
67
-
68
-    // property furnishing
69
-    $fields[] = array('listing_type' => $post_type,
70
-                      'field_type'          =>  'select',
71
-                      'data_type'           =>  'VARCHAR',
72
-                      'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
-                      'site_title'          =>  __('Furnishing', 'geodirectory'),
74
-                      'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
-                      'htmlvar_name'        =>  'property_furnishing',
76
-                      'is_active'           =>  true,
77
-                      'for_admin_use'       =>  false,
78
-                      'default_value'       =>  '',
79
-                      'show_in' 	        =>  '[detail],[listing]',
80
-                      'is_required'         =>  true,
81
-                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
-                      'validation_pattern'  =>  '',
83
-                      'validation_msg'      =>  '',
84
-                      'required_msg'        =>  '',
85
-                      'field_icon'          =>  'fa fa-th-large',
86
-                      'css_class'           =>  '',
87
-                      'cat_sort'            =>  true,
88
-                      'cat_filter'	        =>  true
89
-    );
90
-
91
-    // property type
92
-    $fields[] = array('listing_type' => $post_type,
93
-                      'field_type'          =>  'select',
94
-                      'data_type'           =>  'VARCHAR',
95
-                      'admin_title'         =>  __('Property Type', 'geodirectory'),
96
-                      'site_title'          =>  __('Property Type', 'geodirectory'),
97
-                      'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
-                      'htmlvar_name'        =>  'property_type',
99
-                      'is_active'           =>  true,
100
-                      'for_admin_use'       =>  false,
101
-                      'default_value'       =>  '',
102
-                      'show_in' 	        =>  '[detail],[listing]',
103
-                      'is_required'         =>  true,
104
-                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
-                      'validation_pattern'  =>  '',
106
-                      'validation_msg'      =>  '',
107
-                      'required_msg'        =>  '',
108
-                      'field_icon'          =>  'fa fa-home',
109
-                      'css_class'           =>  '',
110
-                      'cat_sort'            =>  true,
111
-                      'cat_filter'	        =>  true
112
-    );
113
-
114
-    // property bedrooms
115
-    $fields[] = array('listing_type' => $post_type,
116
-                      'field_type'          =>  'select',
117
-                      'data_type'           =>  'VARCHAR',
118
-                      'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
-                      'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
-                      'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
-                      'htmlvar_name'        =>  'property_bedrooms',
122
-                      'is_active'           =>  true,
123
-                      'for_admin_use'       =>  false,
124
-                      'default_value'       =>  '',
125
-                      'show_in' 	        =>  '[detail],[listing]',
126
-                      'is_required'         =>  true,
127
-                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
-                      'validation_pattern'  =>  '',
129
-                      'validation_msg'      =>  '',
130
-                      'required_msg'        =>  '',
131
-                      'field_icon'          =>  'fa fa-bed',
132
-                      'css_class'           =>  '',
133
-                      'cat_sort'            =>  true,
134
-                      'cat_filter'	        =>  true
135
-    );
136
-
137
-    // property bathrooms
138
-    $fields[] = array('listing_type' => $post_type,
139
-                      'field_type'          =>  'select',
140
-                      'data_type'           =>  'VARCHAR',
141
-                      'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
-                      'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
-                      'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
-                      'htmlvar_name'        =>  'property_bathrooms',
145
-                      'is_active'           =>  true,
146
-                      'for_admin_use'       =>  false,
147
-                      'default_value'       =>  '',
148
-                      'show_in' 	        =>  '[detail],[listing]',
149
-                      'is_required'         =>  true,
150
-                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
-                      'validation_pattern'  =>  '',
152
-                      'validation_msg'      =>  '',
153
-                      'required_msg'        =>  '',
154
-                      'field_icon'          =>  'fa fa-bold',
155
-                      'css_class'           =>  '',
156
-                      'cat_sort'            =>  true,
157
-                      'cat_filter'	        =>  true
158
-    );
159
-
160
-    // property area
161
-    $fields[] = array('listing_type' => $post_type,
162
-                      'field_type'          =>  'text',
163
-                      'data_type'           =>  'FLOAT',
164
-                      'admin_title'         =>  __('Property Area', 'geodirectory'),
165
-                      'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
-                      'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
-                      'htmlvar_name'        =>  'property_area',
168
-                      'is_active'           =>  true,
169
-                      'for_admin_use'       =>  false,
170
-                      'default_value'       =>  '',
171
-                      'show_in' 	        =>  '[detail],[listing]',
172
-                      'is_required'         =>  false,
173
-                      'validation_pattern'  =>  '\d+(\.\d{2})?',
174
-                      'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
-                      'required_msg'        =>  '',
176
-                      'field_icon'          =>  'fa fa-area-chart',
177
-                      'css_class'           =>  '',
178
-                      'cat_sort'            =>  true,
179
-                      'cat_filter'	        =>  true
180
-    );
181
-
182
-    // property features
183
-    $fields[] = array('listing_type' => $post_type,
184
-                      'field_type'          =>  'multiselect',
185
-                      'data_type'           =>  'VARCHAR',
186
-                      'admin_title'         =>  __('Property Features', 'geodirectory'),
187
-                      'site_title'          =>  __('Features', 'geodirectory'),
188
-                      'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
-                      'htmlvar_name'        =>  'property_features',
190
-                      'is_active'           =>  true,
191
-                      'for_admin_use'       =>  false,
192
-                      'default_value'       =>  '',
193
-                      'show_in' 	        =>  '[detail],[listing]',
194
-                      'is_required'         =>  true,
195
-                      'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
-                      'validation_pattern'  =>  '',
197
-                      'validation_msg'      =>  '',
198
-                      'required_msg'        =>  '',
199
-                      'field_icon'          =>  'fa fa-plus-square',
200
-                      'css_class'           =>  'gd-comma-list',
201
-                      'cat_sort'            =>  true,
202
-                      'cat_filter'	        =>  true
203
-    );
204
-
205
-
206
-
207
-    /**
208
-     * Filter the array of default custom fields DB table data.
209
-     *
210
-     * @since 1.6.6
211
-     * @param string $fields The default custom fields as an array.
212
-     */
213
-    $fields = apply_filters('geodir_property_sale_custom_fields', $fields);
214
-
215
-    return  $fields;
10
+	$fields = array();
11
+	$package = ($package_id=='') ? '' : array($package_id);
12
+
13
+	// price
14
+	$fields[] = array('listing_type' => $post_type,
15
+					  'field_type'          =>  'text',
16
+					  'data_type'           =>  'FLOAT',
17
+					  'decimal_point'       =>  '2',
18
+					  'admin_title'         =>  __('Price', 'geodirectory'),
19
+					  'site_title'          =>  __('Price', 'geodirectory'),
20
+					  'admin_desc'          =>  __('Enter the price per calendar month (PCM)in $ (no currency symbol)', 'geodirectory'),
21
+					  'htmlvar_name'        =>  'price',
22
+					  'is_active'           =>  true,
23
+					  'for_admin_use'       =>  false,
24
+					  'default_value'       =>  '',
25
+					  'show_in' 	        =>  '[detail],[listing]',
26
+					  'is_required'         =>  false,
27
+					  'validation_pattern'  =>  '\d+(\.\d{2})?',
28
+					  'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
+					  'required_msg'        =>  '',
30
+					  'field_icon'          =>  'fa fa-usd',
31
+					  'css_class'           =>  '',
32
+					  'cat_sort'            =>  true,
33
+					  'cat_filter'	        =>  true,
34
+					  'extra'        =>  array(
35
+						  'is_price'                  =>  1,
36
+						  'thousand_separator'        =>  'comma',
37
+						  'decimal_separator'         =>  'period',
38
+						  'decimal_display'           =>  'if',
39
+						  'currency_symbol'           =>  '$',
40
+						  'currency_symbol_placement' =>  'left'
41
+					  )
42
+	);
43
+
44
+	// property status
45
+	$fields[] = array('listing_type' => $post_type,
46
+					  'data_type' => 'VARCHAR',
47
+					  'field_type' => 'select',
48
+					  'field_type_key' => 'property_status',
49
+					  'is_active' => 1,
50
+					  'for_admin_use' => 0,
51
+					  'is_default' => 0,
52
+					  'admin_title' => __('Property Status', 'geodirectory'),
53
+					  'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
+					  'site_title' => __('Property Status', 'geodirectory'),
55
+					  'htmlvar_name' => 'property_status',
56
+					  'default_value' => '',
57
+					  'is_required' => '1',
58
+					  'required_msg' => '',
59
+					  'show_in'   =>  '[detail],[listing]',
60
+					  'show_on_pkg' => $package,
61
+					  'option_values' => 'Select Status/,For Rent,Let,Under Offer',
62
+					  'field_icon' => 'fa fa-home',
63
+					  'css_class' => '',
64
+					  'cat_sort' => 1,
65
+					  'cat_filter' => 1,
66
+	);
67
+
68
+	// property furnishing
69
+	$fields[] = array('listing_type' => $post_type,
70
+					  'field_type'          =>  'select',
71
+					  'data_type'           =>  'VARCHAR',
72
+					  'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
+					  'site_title'          =>  __('Furnishing', 'geodirectory'),
74
+					  'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
+					  'htmlvar_name'        =>  'property_furnishing',
76
+					  'is_active'           =>  true,
77
+					  'for_admin_use'       =>  false,
78
+					  'default_value'       =>  '',
79
+					  'show_in' 	        =>  '[detail],[listing]',
80
+					  'is_required'         =>  true,
81
+					  'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
+					  'validation_pattern'  =>  '',
83
+					  'validation_msg'      =>  '',
84
+					  'required_msg'        =>  '',
85
+					  'field_icon'          =>  'fa fa-th-large',
86
+					  'css_class'           =>  '',
87
+					  'cat_sort'            =>  true,
88
+					  'cat_filter'	        =>  true
89
+	);
90
+
91
+	// property type
92
+	$fields[] = array('listing_type' => $post_type,
93
+					  'field_type'          =>  'select',
94
+					  'data_type'           =>  'VARCHAR',
95
+					  'admin_title'         =>  __('Property Type', 'geodirectory'),
96
+					  'site_title'          =>  __('Property Type', 'geodirectory'),
97
+					  'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
+					  'htmlvar_name'        =>  'property_type',
99
+					  'is_active'           =>  true,
100
+					  'for_admin_use'       =>  false,
101
+					  'default_value'       =>  '',
102
+					  'show_in' 	        =>  '[detail],[listing]',
103
+					  'is_required'         =>  true,
104
+					  'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
+					  'validation_pattern'  =>  '',
106
+					  'validation_msg'      =>  '',
107
+					  'required_msg'        =>  '',
108
+					  'field_icon'          =>  'fa fa-home',
109
+					  'css_class'           =>  '',
110
+					  'cat_sort'            =>  true,
111
+					  'cat_filter'	        =>  true
112
+	);
113
+
114
+	// property bedrooms
115
+	$fields[] = array('listing_type' => $post_type,
116
+					  'field_type'          =>  'select',
117
+					  'data_type'           =>  'VARCHAR',
118
+					  'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
+					  'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
+					  'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
+					  'htmlvar_name'        =>  'property_bedrooms',
122
+					  'is_active'           =>  true,
123
+					  'for_admin_use'       =>  false,
124
+					  'default_value'       =>  '',
125
+					  'show_in' 	        =>  '[detail],[listing]',
126
+					  'is_required'         =>  true,
127
+					  'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
+					  'validation_pattern'  =>  '',
129
+					  'validation_msg'      =>  '',
130
+					  'required_msg'        =>  '',
131
+					  'field_icon'          =>  'fa fa-bed',
132
+					  'css_class'           =>  '',
133
+					  'cat_sort'            =>  true,
134
+					  'cat_filter'	        =>  true
135
+	);
136
+
137
+	// property bathrooms
138
+	$fields[] = array('listing_type' => $post_type,
139
+					  'field_type'          =>  'select',
140
+					  'data_type'           =>  'VARCHAR',
141
+					  'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
+					  'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
+					  'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
+					  'htmlvar_name'        =>  'property_bathrooms',
145
+					  'is_active'           =>  true,
146
+					  'for_admin_use'       =>  false,
147
+					  'default_value'       =>  '',
148
+					  'show_in' 	        =>  '[detail],[listing]',
149
+					  'is_required'         =>  true,
150
+					  'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
+					  'validation_pattern'  =>  '',
152
+					  'validation_msg'      =>  '',
153
+					  'required_msg'        =>  '',
154
+					  'field_icon'          =>  'fa fa-bold',
155
+					  'css_class'           =>  '',
156
+					  'cat_sort'            =>  true,
157
+					  'cat_filter'	        =>  true
158
+	);
159
+
160
+	// property area
161
+	$fields[] = array('listing_type' => $post_type,
162
+					  'field_type'          =>  'text',
163
+					  'data_type'           =>  'FLOAT',
164
+					  'admin_title'         =>  __('Property Area', 'geodirectory'),
165
+					  'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
+					  'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
+					  'htmlvar_name'        =>  'property_area',
168
+					  'is_active'           =>  true,
169
+					  'for_admin_use'       =>  false,
170
+					  'default_value'       =>  '',
171
+					  'show_in' 	        =>  '[detail],[listing]',
172
+					  'is_required'         =>  false,
173
+					  'validation_pattern'  =>  '\d+(\.\d{2})?',
174
+					  'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
+					  'required_msg'        =>  '',
176
+					  'field_icon'          =>  'fa fa-area-chart',
177
+					  'css_class'           =>  '',
178
+					  'cat_sort'            =>  true,
179
+					  'cat_filter'	        =>  true
180
+	);
181
+
182
+	// property features
183
+	$fields[] = array('listing_type' => $post_type,
184
+					  'field_type'          =>  'multiselect',
185
+					  'data_type'           =>  'VARCHAR',
186
+					  'admin_title'         =>  __('Property Features', 'geodirectory'),
187
+					  'site_title'          =>  __('Features', 'geodirectory'),
188
+					  'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
+					  'htmlvar_name'        =>  'property_features',
190
+					  'is_active'           =>  true,
191
+					  'for_admin_use'       =>  false,
192
+					  'default_value'       =>  '',
193
+					  'show_in' 	        =>  '[detail],[listing]',
194
+					  'is_required'         =>  true,
195
+					  'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
+					  'validation_pattern'  =>  '',
197
+					  'validation_msg'      =>  '',
198
+					  'required_msg'        =>  '',
199
+					  'field_icon'          =>  'fa fa-plus-square',
200
+					  'css_class'           =>  'gd-comma-list',
201
+					  'cat_sort'            =>  true,
202
+					  'cat_filter'	        =>  true
203
+	);
204
+
205
+
206
+
207
+	/**
208
+	 * Filter the array of default custom fields DB table data.
209
+	 *
210
+	 * @since 1.6.6
211
+	 * @param string $fields The default custom fields as an array.
212
+	 */
213
+	$fields = apply_filters('geodir_property_sale_custom_fields', $fields);
214
+
215
+	return  $fields;
216 216
 }
217 217
 
218 218
 global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
@@ -222,37 +222,37 @@  discard block
 block discarded – undo
222 222
 $category_array = array('Apartments', 'Houses', 'Commercial', 'Land');
223 223
 
224 224
 if($dummy_post_index==1){
225
-    // add the dummy categories
226
-    geodir_dummy_data_taxonomies($post_type,$category_array );
227
-
228
-    // add the dummy custom fields
229
-    $fields = geodir_property_sale_custom_fields($post_type);
230
-    geodir_create_dummy_fields($fields);
231
-    // update the type currently installed
232
-    update_option($post_type.'_dummy_data_type','property_rent');
225
+	// add the dummy categories
226
+	geodir_dummy_data_taxonomies($post_type,$category_array );
227
+
228
+	// add the dummy custom fields
229
+	$fields = geodir_property_sale_custom_fields($post_type);
230
+	geodir_create_dummy_fields($fields);
231
+	// update the type currently installed
232
+	update_option($post_type.'_dummy_data_type','property_rent');
233 233
 }
234 234
 
235 235
 if (geodir_dummy_folder_exists())
236
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
236
+	$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
237 237
 else
238
-    $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
238
+	$dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
239 239
 
240 240
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
241 241
 
242 242
 switch ($dummy_post_index) {
243 243
 
244
-    case(1):
245
-        $image_array[] = "$dummy_image_url/ps/psf1.jpg";
246
-        $image_array[] = "$dummy_image_url/ps/psl1.jpg";
247
-        $image_array[] = "$dummy_image_url/ps/psb1.jpg";
248
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
249
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
244
+	case(1):
245
+		$image_array[] = "$dummy_image_url/ps/psf1.jpg";
246
+		$image_array[] = "$dummy_image_url/ps/psl1.jpg";
247
+		$image_array[] = "$dummy_image_url/ps/psb1.jpg";
248
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
249
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
250 250
 
251 251
 
252
-        $post_info[] = array(
253
-            "listing_type" => $post_type,
254
-            "post_title" => 'Eastern Lodge',
255
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
252
+		$post_info[] = array(
253
+			"listing_type" => $post_type,
254
+			"post_title" => 'Eastern Lodge',
255
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
256 256
 
257 257
 Aliquam ut odio ullamcorper, posuere enim sed, venenatis tortor. Donec justo elit, aliquam sed cursus sed, semper eget libero. Mauris consequat lorem sed fringilla tincidunt. Phasellus suscipit velit et elit tristique, ac commodo metus scelerisque. Vivamus finibus ipsum placerat pulvinar aliquet. Maecenas augue orci, blandit at nibh pharetra, condimentum congue ligula. Duis non ante sagittis odio convallis lacinia in quis sapien.
258 258
 
@@ -261,42 +261,42 @@  discard block
 block discarded – undo
261 261
 Vestibulum tristique quam eget bibendum pulvinar. Mauris sit amet magna ut arcu rutrum pellentesque feugiat et ipsum. Proin porta quam sed risus accumsan pharetra. Nulla quis semper nisl. Nulla facilisi. Nulla facilisi. Pellentesque euismod sollicitudin lacus vel ultricies. Vestibulum ut sem ut nulla ultricies convallis in at mi. Nunc vitae nibh arcu. Maecenas nunc enim, tempus a rhoncus eget, pellentesque ut erat.
262 262
 
263 263
 Suspendisse interdum accumsan magna et tempor. Suspendisse scelerisque at lorem sit amet faucibus. Aenean quis consectetur enim. Duis aliquet tristique tempus. Suspendisse id ullamcorper mauris. Aliquam in libero eu justo porttitor pulvinar. Nulla semper placerat lectus. Nulla mollis suscipit lacus, a blandit purus cursus non. Maecenas id tellus mi. Pellentesque sollicitudin nibh eget magna scelerisque consequat. Aliquam convallis orci arcu, et euismod dui cursus et. Donec nec pellentesque nulla, ac pretium massa. In gravida bibendum ornare.',
264
-            "post_images" => $image_array,
265
-            "post_category" => array($post_type.'category' => array($category_array[1])),
266
-            "post_tags" => array('Tags', 'Sample Tags'),
267
-            "geodir_video" => '',
268
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
269
-            "geodir_contact" => '(111) 677-4444',
270
-            "geodir_email" => '[email protected]',
271
-            "geodir_website" => 'http://example.com/',
272
-            "geodir_twitter" => 'http://example.com/',
273
-            "geodir_facebook" => 'http://example.com/',
274
-            "geodir_price" => '1750',
275
-            "geodir_property_status" => 'For Sale',
276
-            'geodir_property_furnishing' => 'Furnished',
277
-            'geodir_property_type' => 'Detached house',
278
-            'geodir_property_bedrooms' => '3',
279
-            'geodir_property_bathrooms' => '2',
280
-            'geodir_property_area' => '1850',
281
-            'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
282
-            "post_dummy" => '1'
283
-        );
284
-
285
-
286
-        break;
287
-    case 2:
288
-        $image_array = array();
289
-        $post_meta = array();
290
-        $image_array[] = "$dummy_image_url/ps/psf2.jpg";
291
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
292
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
293
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
294
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
295
-
296
-        $post_info[] = array(
297
-            "listing_type" => $post_type,
298
-            "post_title" => 'Daisy Street',
299
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
264
+			"post_images" => $image_array,
265
+			"post_category" => array($post_type.'category' => array($category_array[1])),
266
+			"post_tags" => array('Tags', 'Sample Tags'),
267
+			"geodir_video" => '',
268
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
269
+			"geodir_contact" => '(111) 677-4444',
270
+			"geodir_email" => '[email protected]',
271
+			"geodir_website" => 'http://example.com/',
272
+			"geodir_twitter" => 'http://example.com/',
273
+			"geodir_facebook" => 'http://example.com/',
274
+			"geodir_price" => '1750',
275
+			"geodir_property_status" => 'For Sale',
276
+			'geodir_property_furnishing' => 'Furnished',
277
+			'geodir_property_type' => 'Detached house',
278
+			'geodir_property_bedrooms' => '3',
279
+			'geodir_property_bathrooms' => '2',
280
+			'geodir_property_area' => '1850',
281
+			'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
282
+			"post_dummy" => '1'
283
+		);
284
+
285
+
286
+		break;
287
+	case 2:
288
+		$image_array = array();
289
+		$post_meta = array();
290
+		$image_array[] = "$dummy_image_url/ps/psf2.jpg";
291
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
292
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
293
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
294
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
295
+
296
+		$post_info[] = array(
297
+			"listing_type" => $post_type,
298
+			"post_title" => 'Daisy Street',
299
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
300 300
 
301 301
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
302 302
 
@@ -306,42 +306,42 @@  discard block
 block discarded – undo
306 306
 
307 307
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
308 308
 
309
-            "post_images" => $image_array,
310
-            "post_category" => array($post_type.'category' => array($category_array[1])),
311
-            "post_tags" => array('Garage'),
312
-            "geodir_video" => '',
313
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
314
-            "geodir_contact" => '(222) 777-1111',
315
-            "geodir_email" => '[email protected]',
316
-            "geodir_website" => 'http://example.com/',
317
-            "geodir_twitter" => 'http://example.com/',
318
-            "geodir_facebook" => 'http://example.com/',
319
-            "geodir_price" => '1150',
320
-            "geodir_property_status" => 'Sold',
321
-            'geodir_property_furnishing' => 'Unfurnished',
322
-            'geodir_property_type' => 'Detached house',
323
-            'geodir_property_bedrooms' => '5',
324
-            'geodir_property_bathrooms' => '3',
325
-            'geodir_property_area' => '2650',
326
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
327
-            "post_dummy" => '1'
328
-        );
329
-
330
-        break;
331
-
332
-    case 3:
333
-        $image_array = array();
334
-        $post_meta = array();
335
-        $image_array[] = "$dummy_image_url/ps/psf3.jpg";
336
-        $image_array[] = "$dummy_image_url/ps/psl3.jpg";
337
-        $image_array[] = "$dummy_image_url/ps/psb3.jpg";
338
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
339
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
340
-
341
-        $post_info[] = array(
342
-            "listing_type" => $post_type,
343
-            "post_title" => 'Northbay House',
344
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
309
+			"post_images" => $image_array,
310
+			"post_category" => array($post_type.'category' => array($category_array[1])),
311
+			"post_tags" => array('Garage'),
312
+			"geodir_video" => '',
313
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
314
+			"geodir_contact" => '(222) 777-1111',
315
+			"geodir_email" => '[email protected]',
316
+			"geodir_website" => 'http://example.com/',
317
+			"geodir_twitter" => 'http://example.com/',
318
+			"geodir_facebook" => 'http://example.com/',
319
+			"geodir_price" => '1150',
320
+			"geodir_property_status" => 'Sold',
321
+			'geodir_property_furnishing' => 'Unfurnished',
322
+			'geodir_property_type' => 'Detached house',
323
+			'geodir_property_bedrooms' => '5',
324
+			'geodir_property_bathrooms' => '3',
325
+			'geodir_property_area' => '2650',
326
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
327
+			"post_dummy" => '1'
328
+		);
329
+
330
+		break;
331
+
332
+	case 3:
333
+		$image_array = array();
334
+		$post_meta = array();
335
+		$image_array[] = "$dummy_image_url/ps/psf3.jpg";
336
+		$image_array[] = "$dummy_image_url/ps/psl3.jpg";
337
+		$image_array[] = "$dummy_image_url/ps/psb3.jpg";
338
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
339
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
340
+
341
+		$post_info[] = array(
342
+			"listing_type" => $post_type,
343
+			"post_title" => 'Northbay House',
344
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
345 345
 
346 346
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
347 347
 
@@ -351,43 +351,43 @@  discard block
 block discarded – undo
351 351
 
352 352
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
353 353
 
354
-            "post_images" => $image_array,
355
-            "post_category" => array($post_type.'category' => array($category_array[1])),
356
-            "post_tags" => array('Tags', 'Sample Tags'),
357
-            "geodir_video" => '',
358
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
359
-            "geodir_contact" => '(222) 777-1111',
360
-            "geodir_email" => '[email protected]',
361
-            "geodir_website" => 'http://example.com/',
362
-            "geodir_twitter" => 'http://example.com/',
363
-            "geodir_facebook" => 'http://example.com/',
364
-            "geodir_price" => '1300',
365
-            "geodir_property_status" => 'Under Offer',
366
-            'geodir_property_furnishing' => 'Unfurnished',
367
-            'geodir_property_type' => 'Detached house',
368
-            'geodir_property_bedrooms' => '6',
369
-            'geodir_property_bathrooms' => '6',
370
-            'geodir_property_area' => '1650',
371
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
372
-            "post_dummy" => '1'
373
-        );
374
-
375
-        break;
376
-
377
-
378
-    case 4:
379
-        $image_array = array();
380
-        $post_meta = array();
381
-        $image_array[] = "$dummy_image_url/ps/psf4.jpg";
382
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
383
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
384
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
385
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
386
-
387
-        $post_info[] = array(
388
-            "listing_type" => $post_type,
389
-            "post_title" => 'Jesmond Mansion',
390
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
354
+			"post_images" => $image_array,
355
+			"post_category" => array($post_type.'category' => array($category_array[1])),
356
+			"post_tags" => array('Tags', 'Sample Tags'),
357
+			"geodir_video" => '',
358
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
359
+			"geodir_contact" => '(222) 777-1111',
360
+			"geodir_email" => '[email protected]',
361
+			"geodir_website" => 'http://example.com/',
362
+			"geodir_twitter" => 'http://example.com/',
363
+			"geodir_facebook" => 'http://example.com/',
364
+			"geodir_price" => '1300',
365
+			"geodir_property_status" => 'Under Offer',
366
+			'geodir_property_furnishing' => 'Unfurnished',
367
+			'geodir_property_type' => 'Detached house',
368
+			'geodir_property_bedrooms' => '6',
369
+			'geodir_property_bathrooms' => '6',
370
+			'geodir_property_area' => '1650',
371
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
372
+			"post_dummy" => '1'
373
+		);
374
+
375
+		break;
376
+
377
+
378
+	case 4:
379
+		$image_array = array();
380
+		$post_meta = array();
381
+		$image_array[] = "$dummy_image_url/ps/psf4.jpg";
382
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
383
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
384
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
385
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
386
+
387
+		$post_info[] = array(
388
+			"listing_type" => $post_type,
389
+			"post_title" => 'Jesmond Mansion',
390
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
391 391
 
392 392
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
393 393
 
@@ -397,42 +397,42 @@  discard block
 block discarded – undo
397 397
 
398 398
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
399 399
 
400
-            "post_images" => $image_array,
401
-            "post_category" => array($post_type.'category' => array($category_array[1])),
402
-            "post_tags" => array('Tags', 'Sample Tags'),
403
-            "geodir_video" => '',
404
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
405
-            "geodir_contact" => '(222) 777-1111',
406
-            "geodir_email" => '[email protected]',
407
-            "geodir_website" => 'http://example.com/',
408
-            "geodir_twitter" => 'http://example.com/',
409
-            "geodir_facebook" => 'http://example.com/',
410
-            "geodir_price" => '13000',
411
-            "geodir_property_status" => 'Under Offer',
412
-            'geodir_property_furnishing' => 'Partially furnished',
413
-            'geodir_property_type' => 'Detached house',
414
-            'geodir_property_bedrooms' => '10',
415
-            'geodir_property_bathrooms' => '7',
416
-            'geodir_property_area' => '6600',
417
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
418
-            "post_dummy" => '1'
419
-        );
420
-
421
-        break;
422
-
423
-    case 5:
424
-        $image_array = array();
425
-        $post_meta = array();
426
-        $image_array[] = "$dummy_image_url/ps/psf5.jpg";
427
-        $image_array[] = "$dummy_image_url/ps/psl5.jpg";
428
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
429
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
430
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
431
-
432
-        $post_info[] = array(
433
-            "listing_type" => $post_type,
434
-            "post_title" => 'Springfield Lodge',
435
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
400
+			"post_images" => $image_array,
401
+			"post_category" => array($post_type.'category' => array($category_array[1])),
402
+			"post_tags" => array('Tags', 'Sample Tags'),
403
+			"geodir_video" => '',
404
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
405
+			"geodir_contact" => '(222) 777-1111',
406
+			"geodir_email" => '[email protected]',
407
+			"geodir_website" => 'http://example.com/',
408
+			"geodir_twitter" => 'http://example.com/',
409
+			"geodir_facebook" => 'http://example.com/',
410
+			"geodir_price" => '13000',
411
+			"geodir_property_status" => 'Under Offer',
412
+			'geodir_property_furnishing' => 'Partially furnished',
413
+			'geodir_property_type' => 'Detached house',
414
+			'geodir_property_bedrooms' => '10',
415
+			'geodir_property_bathrooms' => '7',
416
+			'geodir_property_area' => '6600',
417
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
418
+			"post_dummy" => '1'
419
+		);
420
+
421
+		break;
422
+
423
+	case 5:
424
+		$image_array = array();
425
+		$post_meta = array();
426
+		$image_array[] = "$dummy_image_url/ps/psf5.jpg";
427
+		$image_array[] = "$dummy_image_url/ps/psl5.jpg";
428
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
429
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
430
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
431
+
432
+		$post_info[] = array(
433
+			"listing_type" => $post_type,
434
+			"post_title" => 'Springfield Lodge',
435
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
436 436
 
437 437
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
438 438
 
@@ -442,42 +442,42 @@  discard block
 block discarded – undo
442 442
 
443 443
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
444 444
 
445
-            "post_images" => $image_array,
446
-            "post_category" => array($post_type.'category' => array($category_array[1])),
447
-            "post_tags" => array('Tags', 'Sample Tags'),
448
-            "geodir_video" => '',
449
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
450
-            "geodir_contact" => '(222) 777-1111',
451
-            "geodir_email" => '[email protected]',
452
-            "geodir_website" => 'http://example.com/',
453
-            "geodir_twitter" => 'http://example.com/',
454
-            "geodir_facebook" => 'http://example.com/',
455
-            "geodir_price" => '1800',
456
-            "geodir_property_status" => 'For Sale',
457
-            'geodir_property_furnishing' => 'Optional',
458
-            'geodir_property_type' => 'Detached house',
459
-            'geodir_property_bedrooms' => '4',
460
-            'geodir_property_bathrooms' => '3',
461
-            'geodir_property_area' => '3700',
462
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
463
-            "post_dummy" => '1'
464
-        );
465
-
466
-        break;
467
-
468
-    case 6:
469
-        $image_array = array();
470
-        $post_meta = array();
471
-        $image_array[] = "$dummy_image_url/ps/psf6.jpg";
472
-        $image_array[] = "$dummy_image_url/ps/psl6.jpg";
473
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
474
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
475
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
476
-
477
-        $post_info[] = array(
478
-            "listing_type" => $post_type,
479
-            "post_title" => 'Forrest Park',
480
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
445
+			"post_images" => $image_array,
446
+			"post_category" => array($post_type.'category' => array($category_array[1])),
447
+			"post_tags" => array('Tags', 'Sample Tags'),
448
+			"geodir_video" => '',
449
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
450
+			"geodir_contact" => '(222) 777-1111',
451
+			"geodir_email" => '[email protected]',
452
+			"geodir_website" => 'http://example.com/',
453
+			"geodir_twitter" => 'http://example.com/',
454
+			"geodir_facebook" => 'http://example.com/',
455
+			"geodir_price" => '1800',
456
+			"geodir_property_status" => 'For Sale',
457
+			'geodir_property_furnishing' => 'Optional',
458
+			'geodir_property_type' => 'Detached house',
459
+			'geodir_property_bedrooms' => '4',
460
+			'geodir_property_bathrooms' => '3',
461
+			'geodir_property_area' => '3700',
462
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
463
+			"post_dummy" => '1'
464
+		);
465
+
466
+		break;
467
+
468
+	case 6:
469
+		$image_array = array();
470
+		$post_meta = array();
471
+		$image_array[] = "$dummy_image_url/ps/psf6.jpg";
472
+		$image_array[] = "$dummy_image_url/ps/psl6.jpg";
473
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
474
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
475
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
476
+
477
+		$post_info[] = array(
478
+			"listing_type" => $post_type,
479
+			"post_title" => 'Forrest Park',
480
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
481 481
 
482 482
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
483 483
 
@@ -487,42 +487,42 @@  discard block
 block discarded – undo
487 487
 
488 488
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
489 489
 
490
-            "post_images" => $image_array,
491
-            "post_category" => array($post_type.'category' => array($category_array[1])),
492
-            "post_tags" => array('Tags', 'Sample Tags'),
493
-            "geodir_video" => '',
494
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
495
-            "geodir_contact" => '(222) 777-1111',
496
-            "geodir_email" => '[email protected]',
497
-            "geodir_website" => 'http://example.com/',
498
-            "geodir_twitter" => 'http://example.com/',
499
-            "geodir_facebook" => 'http://example.com/',
500
-            "geodir_price" => '2700',
501
-            "geodir_property_status" => 'For Sale',
502
-            'geodir_property_furnishing' => 'Unfurnished',
503
-            'geodir_property_type' => 'Detached house',
504
-            'geodir_property_bedrooms' => '5',
505
-            'geodir_property_bathrooms' => '4',
506
-            'geodir_property_area' => '2250',
507
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
508
-            "post_dummy" => '1'
509
-        );
510
-
511
-        break;
512
-
513
-    case 7:
514
-        $image_array = array();
515
-        $post_meta = array();
516
-        $image_array[] = "$dummy_image_url/ps/psf7.jpg";
517
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
518
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
519
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
520
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
521
-
522
-        $post_info[] = array(
523
-            "listing_type" => $post_type,
524
-            "post_title" => 'Fraser Suites',
525
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
490
+			"post_images" => $image_array,
491
+			"post_category" => array($post_type.'category' => array($category_array[1])),
492
+			"post_tags" => array('Tags', 'Sample Tags'),
493
+			"geodir_video" => '',
494
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
495
+			"geodir_contact" => '(222) 777-1111',
496
+			"geodir_email" => '[email protected]',
497
+			"geodir_website" => 'http://example.com/',
498
+			"geodir_twitter" => 'http://example.com/',
499
+			"geodir_facebook" => 'http://example.com/',
500
+			"geodir_price" => '2700',
501
+			"geodir_property_status" => 'For Sale',
502
+			'geodir_property_furnishing' => 'Unfurnished',
503
+			'geodir_property_type' => 'Detached house',
504
+			'geodir_property_bedrooms' => '5',
505
+			'geodir_property_bathrooms' => '4',
506
+			'geodir_property_area' => '2250',
507
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
508
+			"post_dummy" => '1'
509
+		);
510
+
511
+		break;
512
+
513
+	case 7:
514
+		$image_array = array();
515
+		$post_meta = array();
516
+		$image_array[] = "$dummy_image_url/ps/psf7.jpg";
517
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
518
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
519
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
520
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
521
+
522
+		$post_info[] = array(
523
+			"listing_type" => $post_type,
524
+			"post_title" => 'Fraser Suites',
525
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
526 526
 
527 527
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
528 528
 
@@ -532,42 +532,42 @@  discard block
 block discarded – undo
532 532
 
533 533
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
534 534
 
535
-            "post_images" => $image_array,
536
-            "post_category" => array($post_type.'category' => array($category_array[0])),
537
-            "post_tags" => array('Tags', 'Sample Tags'),
538
-            "geodir_video" => '',
539
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
540
-            "geodir_contact" => '(222) 777-1111',
541
-            "geodir_email" => '[email protected]',
542
-            "geodir_website" => 'http://example.com/',
543
-            "geodir_twitter" => 'http://example.com/',
544
-            "geodir_facebook" => 'http://example.com/',
545
-            "geodir_price" => '1450',
546
-            "geodir_property_status" => 'For Sale',
547
-            'geodir_property_furnishing' => 'Unfurnished',
548
-            'geodir_property_type' => 'Apartment',
549
-            'geodir_property_bedrooms' => '3',
550
-            'geodir_property_bathrooms' => '2',
551
-            'geodir_property_area' => '1250',
552
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
553
-            "post_dummy" => '1'
554
-        );
555
-
556
-        break;
557
-
558
-    case 8:
559
-        $image_array = array();
560
-        $post_meta = array();
561
-        $image_array[] = "$dummy_image_url/ps/psf8.jpg";
562
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
563
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
564
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
565
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
566
-
567
-        $post_info[] = array(
568
-            "listing_type" => $post_type,
569
-            "post_title" => 'Richmore Apartments',
570
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
535
+			"post_images" => $image_array,
536
+			"post_category" => array($post_type.'category' => array($category_array[0])),
537
+			"post_tags" => array('Tags', 'Sample Tags'),
538
+			"geodir_video" => '',
539
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
540
+			"geodir_contact" => '(222) 777-1111',
541
+			"geodir_email" => '[email protected]',
542
+			"geodir_website" => 'http://example.com/',
543
+			"geodir_twitter" => 'http://example.com/',
544
+			"geodir_facebook" => 'http://example.com/',
545
+			"geodir_price" => '1450',
546
+			"geodir_property_status" => 'For Sale',
547
+			'geodir_property_furnishing' => 'Unfurnished',
548
+			'geodir_property_type' => 'Apartment',
549
+			'geodir_property_bedrooms' => '3',
550
+			'geodir_property_bathrooms' => '2',
551
+			'geodir_property_area' => '1250',
552
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
553
+			"post_dummy" => '1'
554
+		);
555
+
556
+		break;
557
+
558
+	case 8:
559
+		$image_array = array();
560
+		$post_meta = array();
561
+		$image_array[] = "$dummy_image_url/ps/psf8.jpg";
562
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
563
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
564
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
565
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
566
+
567
+		$post_info[] = array(
568
+			"listing_type" => $post_type,
569
+			"post_title" => 'Richmore Apartments',
570
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
571 571
 
572 572
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
573 573
 
@@ -577,43 +577,43 @@  discard block
 block discarded – undo
577 577
 
578 578
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
579 579
 
580
-            "post_images" => $image_array,
581
-            "post_category" => array($post_type.'category' => array($category_array[0])),
582
-            "post_tags" => array('Tags', 'Sample Tags'),
583
-            "geodir_video" => '',
584
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
585
-            "geodir_contact" => '(222) 777-1111',
586
-            "geodir_email" => '[email protected]',
587
-            "geodir_website" => 'http://example.com/',
588
-            "geodir_twitter" => 'http://example.com/',
589
-            "geodir_facebook" => 'http://example.com/',
590
-            "geodir_price" => '2000',
591
-            "geodir_property_status" => 'For Sale',
592
-            'geodir_property_furnishing' => 'Unfurnished',
593
-            'geodir_property_type' => 'Apartment',
594
-            'geodir_property_bedrooms' => '2',
595
-            'geodir_property_bathrooms' => '2',
596
-            'geodir_property_area' => '1750',
597
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
598
-            "post_dummy" => '1'
599
-        );
600
-
601
-        break;
602
-
603
-
604
-    case 9:
605
-        $image_array = array();
606
-        $post_meta = array();
607
-        $image_array[] = "$dummy_image_url/ps/psf9.jpg";
608
-        $image_array[] = "$dummy_image_url/ps/psc9.jpg";
609
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
610
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
611
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
612
-
613
-        $post_info[] = array(
614
-            "listing_type" => $post_type,
615
-            "post_title" => 'Hotel Alpina',
616
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
580
+			"post_images" => $image_array,
581
+			"post_category" => array($post_type.'category' => array($category_array[0])),
582
+			"post_tags" => array('Tags', 'Sample Tags'),
583
+			"geodir_video" => '',
584
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
585
+			"geodir_contact" => '(222) 777-1111',
586
+			"geodir_email" => '[email protected]',
587
+			"geodir_website" => 'http://example.com/',
588
+			"geodir_twitter" => 'http://example.com/',
589
+			"geodir_facebook" => 'http://example.com/',
590
+			"geodir_price" => '2000',
591
+			"geodir_property_status" => 'For Sale',
592
+			'geodir_property_furnishing' => 'Unfurnished',
593
+			'geodir_property_type' => 'Apartment',
594
+			'geodir_property_bedrooms' => '2',
595
+			'geodir_property_bathrooms' => '2',
596
+			'geodir_property_area' => '1750',
597
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
598
+			"post_dummy" => '1'
599
+		);
600
+
601
+		break;
602
+
603
+
604
+	case 9:
605
+		$image_array = array();
606
+		$post_meta = array();
607
+		$image_array[] = "$dummy_image_url/ps/psf9.jpg";
608
+		$image_array[] = "$dummy_image_url/ps/psc9.jpg";
609
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
610
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
611
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
612
+
613
+		$post_info[] = array(
614
+			"listing_type" => $post_type,
615
+			"post_title" => 'Hotel Alpina',
616
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
617 617
 
618 618
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
619 619
 
@@ -623,39 +623,39 @@  discard block
 block discarded – undo
623 623
 
624 624
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
625 625
 
626
-            "post_images" => $image_array,
627
-            "post_category" => array($post_type.'category' => array($category_array[2])),
628
-            "post_tags" => array('Tags', 'Sample Tags'),
629
-            "geodir_video" => '',
630
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
631
-            "geodir_contact" => '(222) 777-1111',
632
-            "geodir_email" => '[email protected]',
633
-            "geodir_website" => 'http://example.com/',
634
-            "geodir_twitter" => 'http://example.com/',
635
-            "geodir_facebook" => 'http://example.com/',
636
-            "geodir_price" => '60000',
637
-            "geodir_property_status" => 'For Sale',
638
-            'geodir_property_furnishing' => 'Furnished',
639
-            'geodir_property_type' => 'Hotel',
640
-            'geodir_property_bedrooms' => '120',
641
-            'geodir_property_bathrooms' => '133',
642
-            'geodir_property_area' => '35000',
643
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
644
-            "post_dummy" => '1'
645
-        );
646
-
647
-        break;
648
-
649
-    case 10:
650
-        $image_array = array();
651
-        $post_meta = array();
652
-        $image_array[] = "$dummy_image_url/ps/psf10.jpg";
653
-        $image_array[] = "$dummy_image_url/ps/psf102.jpg";
654
-
655
-        $post_info[] = array(
656
-            "listing_type" => $post_type,
657
-            "post_title" => 'Development Land',
658
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
626
+			"post_images" => $image_array,
627
+			"post_category" => array($post_type.'category' => array($category_array[2])),
628
+			"post_tags" => array('Tags', 'Sample Tags'),
629
+			"geodir_video" => '',
630
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
631
+			"geodir_contact" => '(222) 777-1111',
632
+			"geodir_email" => '[email protected]',
633
+			"geodir_website" => 'http://example.com/',
634
+			"geodir_twitter" => 'http://example.com/',
635
+			"geodir_facebook" => 'http://example.com/',
636
+			"geodir_price" => '60000',
637
+			"geodir_property_status" => 'For Sale',
638
+			'geodir_property_furnishing' => 'Furnished',
639
+			'geodir_property_type' => 'Hotel',
640
+			'geodir_property_bedrooms' => '120',
641
+			'geodir_property_bathrooms' => '133',
642
+			'geodir_property_area' => '35000',
643
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
644
+			"post_dummy" => '1'
645
+		);
646
+
647
+		break;
648
+
649
+	case 10:
650
+		$image_array = array();
651
+		$post_meta = array();
652
+		$image_array[] = "$dummy_image_url/ps/psf10.jpg";
653
+		$image_array[] = "$dummy_image_url/ps/psf102.jpg";
654
+
655
+		$post_info[] = array(
656
+			"listing_type" => $post_type,
657
+			"post_title" => 'Development Land',
658
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
659 659
 
660 660
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
661 661
 
@@ -665,93 +665,93 @@  discard block
 block discarded – undo
665 665
 
666 666
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
667 667
 
668
-            "post_images" => $image_array,
669
-            "post_category" => array($post_type.'category' => array($category_array[3])),
670
-            "post_tags" => array('Tags', 'Sample Tags'),
671
-            "geodir_video" => '',
672
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
673
-            "geodir_contact" => '(222) 777-1111',
674
-            "geodir_email" => '[email protected]',
675
-            "geodir_website" => 'http://example.com/',
676
-            "geodir_twitter" => 'http://example.com/',
677
-            "geodir_facebook" => 'http://example.com/',
678
-            "geodir_price" => '800',
679
-            "geodir_property_status" => 'For Sale',
680
-            'geodir_property_furnishing' => '',
681
-            'geodir_property_type' => 'Land',
682
-            'geodir_property_bedrooms' => '',
683
-            'geodir_property_bathrooms' => '',
684
-            'geodir_property_area' => '250000',
685
-            'geodir_property_features' => '',
686
-            "post_dummy" => '1'
687
-        );
688
-
689
-        break;
668
+			"post_images" => $image_array,
669
+			"post_category" => array($post_type.'category' => array($category_array[3])),
670
+			"post_tags" => array('Tags', 'Sample Tags'),
671
+			"geodir_video" => '',
672
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
673
+			"geodir_contact" => '(222) 777-1111',
674
+			"geodir_email" => '[email protected]',
675
+			"geodir_website" => 'http://example.com/',
676
+			"geodir_twitter" => 'http://example.com/',
677
+			"geodir_facebook" => 'http://example.com/',
678
+			"geodir_price" => '800',
679
+			"geodir_property_status" => 'For Sale',
680
+			'geodir_property_furnishing' => '',
681
+			'geodir_property_type' => 'Land',
682
+			'geodir_property_bedrooms' => '',
683
+			'geodir_property_bathrooms' => '',
684
+			'geodir_property_area' => '250000',
685
+			'geodir_property_features' => '',
686
+			"post_dummy" => '1'
687
+		);
688
+
689
+		break;
690 690
 
691 691
 } // end of switch
692 692
 
693 693
 foreach ($post_info as $post_info) {
694
-    $default_location = geodir_get_default_location();
695
-    if ($city_bound_lat1 > $city_bound_lat2)
696
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
697
-    else
698
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
694
+	$default_location = geodir_get_default_location();
695
+	if ($city_bound_lat1 > $city_bound_lat2)
696
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
697
+	else
698
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
699 699
 
700 700
 
701
-    if ($city_bound_lng1 > $city_bound_lng2)
702
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
703
-    else
704
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
701
+	if ($city_bound_lng1 > $city_bound_lng2)
702
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
703
+	else
704
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
705 705
 
706
-    $load_map = get_option('geodir_load_map');
706
+	$load_map = get_option('geodir_load_map');
707 707
     
708
-    if ($load_map == 'osm') {
709
-        $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
710
-    } else {
711
-        $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
712
-    }
713
-
714
-    $postal_code = '';
715
-    if (!empty($post_address)) {
716
-        if ($load_map == 'osm') {
717
-            $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
718
-            $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
719
-        } else {
720
-            $addresses = array();
721
-            $addresses_default = array();
708
+	if ($load_map == 'osm') {
709
+		$post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
710
+	} else {
711
+		$post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
712
+	}
713
+
714
+	$postal_code = '';
715
+	if (!empty($post_address)) {
716
+		if ($load_map == 'osm') {
717
+			$address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
718
+			$postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
719
+		} else {
720
+			$addresses = array();
721
+			$addresses_default = array();
722 722
             
723
-            foreach ($post_address as $add_key => $add_value) {
724
-                if ($add_key < 2 && !empty($add_value->long_name)) {
725
-                    $addresses_default[] = $add_value->long_name;
726
-                }
727
-                if ($add_value->types[0] == 'postal_code') {
728
-                    $postal_code = $add_value->long_name;
729
-                }
730
-                if ($add_value->types[0] == 'street_number') {
731
-                    $addresses[] = $add_value->long_name;
732
-                }
733
-                if ($add_value->types[0] == 'route') {
734
-                    $addresses[] = $add_value->long_name;
735
-                }
736
-                if ($add_value->types[0] == 'neighborhood') {
737
-                    $addresses[] = $add_value->long_name;
738
-                }
739
-                if ($add_value->types[0] == 'sublocality') {
740
-                    $addresses[] = $add_value->long_name;
741
-                }
742
-            }
743
-            $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
744
-        }
745
-
746
-        $post_info['post_address'] = !empty($address) ? $address : $default_location->city;
747
-        $post_info['post_city'] = $default_location->city;
748
-        $post_info['post_region'] = $default_location->region;
749
-        $post_info['post_country'] = $default_location->country;
750
-        $post_info['post_zip'] = $postal_code;
751
-        $post_info['post_latitude'] = $dummy_post_latitude;
752
-        $post_info['post_longitude'] = $dummy_post_longitude;
753
-    }
723
+			foreach ($post_address as $add_key => $add_value) {
724
+				if ($add_key < 2 && !empty($add_value->long_name)) {
725
+					$addresses_default[] = $add_value->long_name;
726
+				}
727
+				if ($add_value->types[0] == 'postal_code') {
728
+					$postal_code = $add_value->long_name;
729
+				}
730
+				if ($add_value->types[0] == 'street_number') {
731
+					$addresses[] = $add_value->long_name;
732
+				}
733
+				if ($add_value->types[0] == 'route') {
734
+					$addresses[] = $add_value->long_name;
735
+				}
736
+				if ($add_value->types[0] == 'neighborhood') {
737
+					$addresses[] = $add_value->long_name;
738
+				}
739
+				if ($add_value->types[0] == 'sublocality') {
740
+					$addresses[] = $add_value->long_name;
741
+				}
742
+			}
743
+			$address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
744
+		}
745
+
746
+		$post_info['post_address'] = !empty($address) ? $address : $default_location->city;
747
+		$post_info['post_city'] = $default_location->city;
748
+		$post_info['post_region'] = $default_location->region;
749
+		$post_info['post_country'] = $default_location->country;
750
+		$post_info['post_zip'] = $postal_code;
751
+		$post_info['post_latitude'] = $dummy_post_latitude;
752
+		$post_info['post_longitude'] = $dummy_post_longitude;
753
+	}
754 754
     
755
-    geodir_save_listing($post_info, true);
756
-    echo 1;
755
+	geodir_save_listing($post_info, true);
756
+	echo 1;
757 757
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
  * @package GeoDirectory
7 7
  */
8 8
 
9
-function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){
9
+function geodir_property_sale_custom_fields($post_type = 'gd_place', $package_id = '') {
10 10
     $fields = array();
11
-    $package = ($package_id=='') ? '' : array($package_id);
11
+    $package = ($package_id == '') ? '' : array($package_id);
12 12
 
13 13
     // price
14 14
     $fields[] = array('listing_type' => $post_type,
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                       'default_value'       =>  '',
79 79
                       'show_in' 	        =>  '[detail],[listing]',
80 80
                       'is_required'         =>  true,
81
-                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
81
+                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'),
82 82
                       'validation_pattern'  =>  '',
83 83
                       'validation_msg'      =>  '',
84 84
                       'required_msg'        =>  '',
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                       'default_value'       =>  '',
102 102
                       'show_in' 	        =>  '[detail],[listing]',
103 103
                       'is_required'         =>  true,
104
-                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
104
+                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land', 'geodirectory'),
105 105
                       'validation_pattern'  =>  '',
106 106
                       'validation_msg'      =>  '',
107 107
                       'required_msg'        =>  '',
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                       'default_value'       =>  '',
125 125
                       'show_in' 	        =>  '[detail],[listing]',
126 126
                       'is_required'         =>  true,
127
-                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
127
+                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
128 128
                       'validation_pattern'  =>  '',
129 129
                       'validation_msg'      =>  '',
130 130
                       'required_msg'        =>  '',
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                       'default_value'       =>  '',
148 148
                       'show_in' 	        =>  '[detail],[listing]',
149 149
                       'is_required'         =>  true,
150
-                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
150
+                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
151 151
                       'validation_pattern'  =>  '',
152 152
                       'validation_msg'      =>  '',
153 153
                       'required_msg'        =>  '',
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                       'default_value'       =>  '',
193 193
                       'show_in' 	        =>  '[detail],[listing]',
194 194
                       'is_required'         =>  true,
195
-                      'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
195
+                      'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'),
196 196
                       'validation_pattern'  =>  '',
197 197
                       'validation_msg'      =>  '',
198 198
                       'required_msg'        =>  '',
@@ -215,25 +215,25 @@  discard block
 block discarded – undo
215 215
     return  $fields;
216 216
 }
217 217
 
218
-global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
218
+global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2, $wpdb, $current_user, $dummy_post_index;
219 219
 $post_info = array();
220 220
 $image_array = array();
221 221
 $post_meta = array();
222 222
 $category_array = array('Apartments', 'Houses', 'Commercial', 'Land');
223 223
 
224
-if($dummy_post_index==1){
224
+if ($dummy_post_index == 1) {
225 225
     // add the dummy categories
226
-    geodir_dummy_data_taxonomies($post_type,$category_array );
226
+    geodir_dummy_data_taxonomies($post_type, $category_array);
227 227
 
228 228
     // add the dummy custom fields
229 229
     $fields = geodir_property_sale_custom_fields($post_type);
230 230
     geodir_create_dummy_fields($fields);
231 231
     // update the type currently installed
232
-    update_option($post_type.'_dummy_data_type','property_rent');
232
+    update_option($post_type.'_dummy_data_type', 'property_rent');
233 233
 }
234 234
 
235 235
 if (geodir_dummy_folder_exists())
236
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
236
+    $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy";
237 237
 else
238 238
     $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
239 239
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -232,10 +232,11 @@  discard block
 block discarded – undo
232 232
     update_option($post_type.'_dummy_data_type','property_rent');
233 233
 }
234 234
 
235
-if (geodir_dummy_folder_exists())
235
+if (geodir_dummy_folder_exists()) {
236 236
     $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
237
-else
237
+} else {
238 238
     $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
239
+}
239 240
 
240 241
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
241 242
 
@@ -692,16 +693,18 @@  discard block
 block discarded – undo
692 693
 
693 694
 foreach ($post_info as $post_info) {
694 695
     $default_location = geodir_get_default_location();
695
-    if ($city_bound_lat1 > $city_bound_lat2)
696
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
697
-    else
698
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
696
+    if ($city_bound_lat1 > $city_bound_lat2) {
697
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
698
+    } else {
699
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
700
+    }
699 701
 
700 702
 
701
-    if ($city_bound_lng1 > $city_bound_lng2)
702
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
703
-    else
704
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
703
+    if ($city_bound_lng1 > $city_bound_lng2) {
704
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
705
+    } else {
706
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
707
+    }
705 708
 
706 709
     $load_map = get_option('geodir_load_map');
707 710
     
Please login to merge, or discard this patch.
geodirectory-admin/dummy-data/property_sale.php 3 patches
Indentation   +626 added lines, -626 removed lines patch added patch discarded remove patch
@@ -7,212 +7,212 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){
10
-    $fields = array();
11
-    $package = ($package_id=='') ? '' : array($package_id);
12
-
13
-    // price
14
-    $fields[] = array('listing_type' => $post_type,
15
-                      'field_type'          =>  'text',
16
-                      'data_type'           =>  'FLOAT',
17
-                      'decimal_point'       =>  '2',
18
-                      'admin_title'         =>  __('Price', 'geodirectory'),
19
-                      'site_title'          =>  __('Price', 'geodirectory'),
20
-                      'admin_desc'          =>  __('Enter the price in $ (no currency symbol)', 'geodirectory'),
21
-                      'htmlvar_name'        =>  'price',
22
-                      'is_active'           =>  true,
23
-                      'for_admin_use'       =>  false,
24
-                      'default_value'       =>  '',
25
-                      'show_in' 	        =>  '[detail],[listing]',
26
-                      'is_required'         =>  false,
27
-                      'validation_pattern'  =>  '\d+(\.\d{2})?',
28
-                      'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
-                      'required_msg'        =>  '',
30
-                      'field_icon'          =>  'fa fa-usd',
31
-                      'css_class'           =>  '',
32
-                      'cat_sort'            =>  true,
33
-                      'cat_filter'	        =>  true,
34
-                      'extra'        =>  array(
35
-                          'is_price'                  =>  1,
36
-                          'thousand_separator'        =>  'comma',
37
-                          'decimal_separator'         =>  'period',
38
-                          'decimal_display'           =>  'if',
39
-                          'currency_symbol'           =>  '$',
40
-                          'currency_symbol_placement' =>  'left'
41
-                      )
42
-    );
43
-
44
-    // property status
45
-    $fields[] = array('listing_type' => $post_type,
46
-                      'data_type' => 'VARCHAR',
47
-                      'field_type' => 'select',
48
-                      'field_type_key' => 'property_status',
49
-                      'is_active' => 1,
50
-                      'for_admin_use' => 0,
51
-                      'is_default' => 0,
52
-                      'admin_title' => __('Property Status', 'geodirectory'),
53
-                      'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
-                      'site_title' => __('Property Status', 'geodirectory'),
55
-                      'htmlvar_name' => 'property_status',
56
-                      'default_value' => '',
57
-                      'is_required' => '1',
58
-                      'required_msg' => '',
59
-                      'show_in'   =>  '[detail],[listing]',
60
-                      'show_on_pkg' => $package,
61
-                      'option_values' => 'Select Status/,For Sale,Sold,Under Offer',
62
-                      'field_icon' => 'fa fa-home',
63
-                      'css_class' => '',
64
-                      'cat_sort' => 1,
65
-                      'cat_filter' => 1,
66
-    );
67
-
68
-    // property furnishing
69
-    $fields[] = array('listing_type' => $post_type,
70
-                      'field_type'          =>  'select',
71
-                      'data_type'           =>  'VARCHAR',
72
-                      'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
-                      'site_title'          =>  __('Furnishing', 'geodirectory'),
74
-                      'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
-                      'htmlvar_name'        =>  'property_furnishing',
76
-                      'is_active'           =>  true,
77
-                      'for_admin_use'       =>  false,
78
-                      'default_value'       =>  '',
79
-                      'show_in' 	        =>  '[detail],[listing]',
80
-                      'is_required'         =>  true,
81
-                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
-                      'validation_pattern'  =>  '',
83
-                      'validation_msg'      =>  '',
84
-                      'required_msg'        =>  '',
85
-                      'field_icon'          =>  'fa fa-th-large',
86
-                      'css_class'           =>  '',
87
-                      'cat_sort'            =>  true,
88
-                      'cat_filter'	        =>  true
89
-    );
90
-
91
-    // property type
92
-    $fields[] = array('listing_type' => $post_type,
93
-                      'field_type'          =>  'select',
94
-                      'data_type'           =>  'VARCHAR',
95
-                      'admin_title'         =>  __('Property Type', 'geodirectory'),
96
-                      'site_title'          =>  __('Property Type', 'geodirectory'),
97
-                      'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
-                      'htmlvar_name'        =>  'property_type',
99
-                      'is_active'           =>  true,
100
-                      'for_admin_use'       =>  false,
101
-                      'default_value'       =>  '',
102
-                      'show_in' 	        =>  '[detail],[listing]',
103
-                      'is_required'         =>  true,
104
-                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
-                      'validation_pattern'  =>  '',
106
-                      'validation_msg'      =>  '',
107
-                      'required_msg'        =>  '',
108
-                      'field_icon'          =>  'fa fa-home',
109
-                      'css_class'           =>  '',
110
-                      'cat_sort'            =>  true,
111
-                      'cat_filter'	        =>  true
112
-    );
113
-
114
-    // property bedrooms
115
-    $fields[] = array('listing_type' => $post_type,
116
-                      'field_type'          =>  'select',
117
-                      'data_type'           =>  'VARCHAR',
118
-                      'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
-                      'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
-                      'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
-                      'htmlvar_name'        =>  'property_bedrooms',
122
-                      'is_active'           =>  true,
123
-                      'for_admin_use'       =>  false,
124
-                      'default_value'       =>  '',
125
-                      'show_in' 	        =>  '[detail],[listing]',
126
-                      'is_required'         =>  true,
127
-                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
-                      'validation_pattern'  =>  '',
129
-                      'validation_msg'      =>  '',
130
-                      'required_msg'        =>  '',
131
-                      'field_icon'          =>  'fa fa-bed',
132
-                      'css_class'           =>  '',
133
-                      'cat_sort'            =>  true,
134
-                      'cat_filter'	        =>  true
135
-    );
136
-
137
-    // property bathrooms
138
-    $fields[] = array('listing_type' => $post_type,
139
-                      'field_type'          =>  'select',
140
-                      'data_type'           =>  'VARCHAR',
141
-                      'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
-                      'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
-                      'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
-                      'htmlvar_name'        =>  'property_bathrooms',
145
-                      'is_active'           =>  true,
146
-                      'for_admin_use'       =>  false,
147
-                      'default_value'       =>  '',
148
-                      'show_in' 	        =>  '[detail],[listing]',
149
-                      'is_required'         =>  true,
150
-                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
-                      'validation_pattern'  =>  '',
152
-                      'validation_msg'      =>  '',
153
-                      'required_msg'        =>  '',
154
-                      'field_icon'          =>  'fa fa-bold',
155
-                      'css_class'           =>  '',
156
-                      'cat_sort'            =>  true,
157
-                      'cat_filter'	        =>  true
158
-    );
159
-
160
-    // property area
161
-    $fields[] = array('listing_type' => $post_type,
162
-                      'field_type'          =>  'text',
163
-                      'data_type'           =>  'FLOAT',
164
-                      'admin_title'         =>  __('Property Area', 'geodirectory'),
165
-                      'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
-                      'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
-                      'htmlvar_name'        =>  'property_area',
168
-                      'is_active'           =>  true,
169
-                      'for_admin_use'       =>  false,
170
-                      'default_value'       =>  '',
171
-                      'show_in' 	        =>  '[detail],[listing]',
172
-                      'is_required'         =>  false,
173
-                      'validation_pattern'  =>  '\d+(\.\d{2})?',
174
-                      'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
-                      'required_msg'        =>  '',
176
-                      'field_icon'          =>  'fa fa-area-chart',
177
-                      'css_class'           =>  '',
178
-                      'cat_sort'            =>  true,
179
-                      'cat_filter'	        =>  true
180
-    );
181
-
182
-    // property features
183
-    $fields[] = array('listing_type' => $post_type,
184
-                      'field_type'          =>  'multiselect',
185
-                      'data_type'           =>  'VARCHAR',
186
-                      'admin_title'         =>  __('Property Features', 'geodirectory'),
187
-                      'site_title'          =>  __('Features', 'geodirectory'),
188
-                      'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
-                      'htmlvar_name'        =>  'property_features',
190
-                      'is_active'           =>  true,
191
-                      'for_admin_use'       =>  false,
192
-                      'default_value'       =>  '',
193
-                      'show_in' 	        =>  '[detail],[listing]',
194
-                      'is_required'         =>  true,
195
-                      'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
-                      'validation_pattern'  =>  '',
197
-                      'validation_msg'      =>  '',
198
-                      'required_msg'        =>  '',
199
-                      'field_icon'          =>  'fa fa-plus-square',
200
-                      'css_class'           =>  'gd-comma-list',
201
-                      'cat_sort'            =>  true,
202
-                      'cat_filter'	        =>  true
203
-    );
204
-
205
-
206
-
207
-    /**
208
-     * Filter the array of default custom fields DB table data.
209
-     *
210
-     * @since 1.6.6
211
-     * @param string $fields The default custom fields as an array.
212
-     */
213
-    $fields = apply_filters('geodir_property_sale_custom_fields', $fields);
214
-
215
-    return  $fields;
10
+	$fields = array();
11
+	$package = ($package_id=='') ? '' : array($package_id);
12
+
13
+	// price
14
+	$fields[] = array('listing_type' => $post_type,
15
+					  'field_type'          =>  'text',
16
+					  'data_type'           =>  'FLOAT',
17
+					  'decimal_point'       =>  '2',
18
+					  'admin_title'         =>  __('Price', 'geodirectory'),
19
+					  'site_title'          =>  __('Price', 'geodirectory'),
20
+					  'admin_desc'          =>  __('Enter the price in $ (no currency symbol)', 'geodirectory'),
21
+					  'htmlvar_name'        =>  'price',
22
+					  'is_active'           =>  true,
23
+					  'for_admin_use'       =>  false,
24
+					  'default_value'       =>  '',
25
+					  'show_in' 	        =>  '[detail],[listing]',
26
+					  'is_required'         =>  false,
27
+					  'validation_pattern'  =>  '\d+(\.\d{2})?',
28
+					  'validation_msg'      =>  'Please enter number and decimal only ie: 100.50',
29
+					  'required_msg'        =>  '',
30
+					  'field_icon'          =>  'fa fa-usd',
31
+					  'css_class'           =>  '',
32
+					  'cat_sort'            =>  true,
33
+					  'cat_filter'	        =>  true,
34
+					  'extra'        =>  array(
35
+						  'is_price'                  =>  1,
36
+						  'thousand_separator'        =>  'comma',
37
+						  'decimal_separator'         =>  'period',
38
+						  'decimal_display'           =>  'if',
39
+						  'currency_symbol'           =>  '$',
40
+						  'currency_symbol_placement' =>  'left'
41
+					  )
42
+	);
43
+
44
+	// property status
45
+	$fields[] = array('listing_type' => $post_type,
46
+					  'data_type' => 'VARCHAR',
47
+					  'field_type' => 'select',
48
+					  'field_type_key' => 'property_status',
49
+					  'is_active' => 1,
50
+					  'for_admin_use' => 0,
51
+					  'is_default' => 0,
52
+					  'admin_title' => __('Property Status', 'geodirectory'),
53
+					  'admin_desc' => __('Enter the status of the property.', 'geodirectory'),
54
+					  'site_title' => __('Property Status', 'geodirectory'),
55
+					  'htmlvar_name' => 'property_status',
56
+					  'default_value' => '',
57
+					  'is_required' => '1',
58
+					  'required_msg' => '',
59
+					  'show_in'   =>  '[detail],[listing]',
60
+					  'show_on_pkg' => $package,
61
+					  'option_values' => 'Select Status/,For Sale,Sold,Under Offer',
62
+					  'field_icon' => 'fa fa-home',
63
+					  'css_class' => '',
64
+					  'cat_sort' => 1,
65
+					  'cat_filter' => 1,
66
+	);
67
+
68
+	// property furnishing
69
+	$fields[] = array('listing_type' => $post_type,
70
+					  'field_type'          =>  'select',
71
+					  'data_type'           =>  'VARCHAR',
72
+					  'admin_title'         =>  __('Furnishing', 'geodirectory'),
73
+					  'site_title'          =>  __('Furnishing', 'geodirectory'),
74
+					  'admin_desc'          =>  __('Enter the furnishing status of the property.', 'geodirectory'),
75
+					  'htmlvar_name'        =>  'property_furnishing',
76
+					  'is_active'           =>  true,
77
+					  'for_admin_use'       =>  false,
78
+					  'default_value'       =>  '',
79
+					  'show_in' 	        =>  '[detail],[listing]',
80
+					  'is_required'         =>  true,
81
+					  'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
82
+					  'validation_pattern'  =>  '',
83
+					  'validation_msg'      =>  '',
84
+					  'required_msg'        =>  '',
85
+					  'field_icon'          =>  'fa fa-th-large',
86
+					  'css_class'           =>  '',
87
+					  'cat_sort'            =>  true,
88
+					  'cat_filter'	        =>  true
89
+	);
90
+
91
+	// property type
92
+	$fields[] = array('listing_type' => $post_type,
93
+					  'field_type'          =>  'select',
94
+					  'data_type'           =>  'VARCHAR',
95
+					  'admin_title'         =>  __('Property Type', 'geodirectory'),
96
+					  'site_title'          =>  __('Property Type', 'geodirectory'),
97
+					  'admin_desc'          =>  __('Select the property type.', 'geodirectory'),
98
+					  'htmlvar_name'        =>  'property_type',
99
+					  'is_active'           =>  true,
100
+					  'for_admin_use'       =>  false,
101
+					  'default_value'       =>  '',
102
+					  'show_in' 	        =>  '[detail],[listing]',
103
+					  'is_required'         =>  true,
104
+					  'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
105
+					  'validation_pattern'  =>  '',
106
+					  'validation_msg'      =>  '',
107
+					  'required_msg'        =>  '',
108
+					  'field_icon'          =>  'fa fa-home',
109
+					  'css_class'           =>  '',
110
+					  'cat_sort'            =>  true,
111
+					  'cat_filter'	        =>  true
112
+	);
113
+
114
+	// property bedrooms
115
+	$fields[] = array('listing_type' => $post_type,
116
+					  'field_type'          =>  'select',
117
+					  'data_type'           =>  'VARCHAR',
118
+					  'admin_title'         =>  __('Property Bedrooms', 'geodirectory'),
119
+					  'site_title'          =>  __('Bedrooms', 'geodirectory'),
120
+					  'admin_desc'          =>  __('Select the number of bedrooms', 'geodirectory'),
121
+					  'htmlvar_name'        =>  'property_bedrooms',
122
+					  'is_active'           =>  true,
123
+					  'for_admin_use'       =>  false,
124
+					  'default_value'       =>  '',
125
+					  'show_in' 	        =>  '[detail],[listing]',
126
+					  'is_required'         =>  true,
127
+					  'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
128
+					  'validation_pattern'  =>  '',
129
+					  'validation_msg'      =>  '',
130
+					  'required_msg'        =>  '',
131
+					  'field_icon'          =>  'fa fa-bed',
132
+					  'css_class'           =>  '',
133
+					  'cat_sort'            =>  true,
134
+					  'cat_filter'	        =>  true
135
+	);
136
+
137
+	// property bathrooms
138
+	$fields[] = array('listing_type' => $post_type,
139
+					  'field_type'          =>  'select',
140
+					  'data_type'           =>  'VARCHAR',
141
+					  'admin_title'         =>  __('Property Bathrooms', 'geodirectory'),
142
+					  'site_title'          =>  __('Bathrooms', 'geodirectory'),
143
+					  'admin_desc'          =>  __('Select the number of bathrooms', 'geodirectory'),
144
+					  'htmlvar_name'        =>  'property_bathrooms',
145
+					  'is_active'           =>  true,
146
+					  'for_admin_use'       =>  false,
147
+					  'default_value'       =>  '',
148
+					  'show_in' 	        =>  '[detail],[listing]',
149
+					  'is_required'         =>  true,
150
+					  'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
151
+					  'validation_pattern'  =>  '',
152
+					  'validation_msg'      =>  '',
153
+					  'required_msg'        =>  '',
154
+					  'field_icon'          =>  'fa fa-bold',
155
+					  'css_class'           =>  '',
156
+					  'cat_sort'            =>  true,
157
+					  'cat_filter'	        =>  true
158
+	);
159
+
160
+	// property area
161
+	$fields[] = array('listing_type' => $post_type,
162
+					  'field_type'          =>  'text',
163
+					  'data_type'           =>  'FLOAT',
164
+					  'admin_title'         =>  __('Property Area', 'geodirectory'),
165
+					  'site_title'          =>  __('Area (Sq Ft)', 'geodirectory'),
166
+					  'admin_desc'          =>  __('Enter the Sq Ft value for the property', 'geodirectory'),
167
+					  'htmlvar_name'        =>  'property_area',
168
+					  'is_active'           =>  true,
169
+					  'for_admin_use'       =>  false,
170
+					  'default_value'       =>  '',
171
+					  'show_in' 	        =>  '[detail],[listing]',
172
+					  'is_required'         =>  false,
173
+					  'validation_pattern'  =>  '\d+(\.\d{2})?',
174
+					  'validation_msg'      =>  'Please enter the property area in numbers only: 1500',
175
+					  'required_msg'        =>  '',
176
+					  'field_icon'          =>  'fa fa-area-chart',
177
+					  'css_class'           =>  '',
178
+					  'cat_sort'            =>  true,
179
+					  'cat_filter'	        =>  true
180
+	);
181
+
182
+	// property features
183
+	$fields[] = array('listing_type' => $post_type,
184
+					  'field_type'          =>  'multiselect',
185
+					  'data_type'           =>  'VARCHAR',
186
+					  'admin_title'         =>  __('Property Features', 'geodirectory'),
187
+					  'site_title'          =>  __('Features', 'geodirectory'),
188
+					  'admin_desc'          =>  __('Select the property features.', 'geodirectory'),
189
+					  'htmlvar_name'        =>  'property_features',
190
+					  'is_active'           =>  true,
191
+					  'for_admin_use'       =>  false,
192
+					  'default_value'       =>  '',
193
+					  'show_in' 	        =>  '[detail],[listing]',
194
+					  'is_required'         =>  true,
195
+					  'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
196
+					  'validation_pattern'  =>  '',
197
+					  'validation_msg'      =>  '',
198
+					  'required_msg'        =>  '',
199
+					  'field_icon'          =>  'fa fa-plus-square',
200
+					  'css_class'           =>  'gd-comma-list',
201
+					  'cat_sort'            =>  true,
202
+					  'cat_filter'	        =>  true
203
+	);
204
+
205
+
206
+
207
+	/**
208
+	 * Filter the array of default custom fields DB table data.
209
+	 *
210
+	 * @since 1.6.6
211
+	 * @param string $fields The default custom fields as an array.
212
+	 */
213
+	$fields = apply_filters('geodir_property_sale_custom_fields', $fields);
214
+
215
+	return  $fields;
216 216
 }
217 217
 
218 218
 global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
@@ -222,36 +222,36 @@  discard block
 block discarded – undo
222 222
 $category_array = array('Apartments', 'Houses', 'Commercial', 'Land');
223 223
 
224 224
 if($dummy_post_index==1){
225
-    // add the dummy categories
226
-    geodir_dummy_data_taxonomies($post_type,$category_array );
225
+	// add the dummy categories
226
+	geodir_dummy_data_taxonomies($post_type,$category_array );
227 227
 
228
-    // add the dummy custom fields
229
-    $fields = geodir_property_sale_custom_fields($post_type);
230
-    geodir_create_dummy_fields($fields);
231
-    update_option($post_type.'_dummy_data_type','property_sale');
228
+	// add the dummy custom fields
229
+	$fields = geodir_property_sale_custom_fields($post_type);
230
+	geodir_create_dummy_fields($fields);
231
+	update_option($post_type.'_dummy_data_type','property_sale');
232 232
 }
233 233
 
234 234
 if (geodir_dummy_folder_exists())
235
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
235
+	$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
236 236
 else
237
-    $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
237
+	$dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
238 238
 
239 239
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
240 240
 
241 241
 switch ($dummy_post_index) {
242 242
 
243
-    case(1):
244
-        $image_array[] = "$dummy_image_url/ps/psf1.jpg";
245
-        $image_array[] = "$dummy_image_url/ps/psl1.jpg";
246
-        $image_array[] = "$dummy_image_url/ps/psb1.jpg";
247
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
248
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
243
+	case(1):
244
+		$image_array[] = "$dummy_image_url/ps/psf1.jpg";
245
+		$image_array[] = "$dummy_image_url/ps/psl1.jpg";
246
+		$image_array[] = "$dummy_image_url/ps/psb1.jpg";
247
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
248
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
249 249
 
250 250
 
251
-        $post_info[] = array(
252
-            "listing_type" => $post_type,
253
-            "post_title" => 'Eastern Lodge',
254
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
251
+		$post_info[] = array(
252
+			"listing_type" => $post_type,
253
+			"post_title" => 'Eastern Lodge',
254
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa.
255 255
 
256 256
 Aliquam ut odio ullamcorper, posuere enim sed, venenatis tortor. Donec justo elit, aliquam sed cursus sed, semper eget libero. Mauris consequat lorem sed fringilla tincidunt. Phasellus suscipit velit et elit tristique, ac commodo metus scelerisque. Vivamus finibus ipsum placerat pulvinar aliquet. Maecenas augue orci, blandit at nibh pharetra, condimentum congue ligula. Duis non ante sagittis odio convallis lacinia in quis sapien.
257 257
 
@@ -260,42 +260,42 @@  discard block
 block discarded – undo
260 260
 Vestibulum tristique quam eget bibendum pulvinar. Mauris sit amet magna ut arcu rutrum pellentesque feugiat et ipsum. Proin porta quam sed risus accumsan pharetra. Nulla quis semper nisl. Nulla facilisi. Nulla facilisi. Pellentesque euismod sollicitudin lacus vel ultricies. Vestibulum ut sem ut nulla ultricies convallis in at mi. Nunc vitae nibh arcu. Maecenas nunc enim, tempus a rhoncus eget, pellentesque ut erat.
261 261
 
262 262
 Suspendisse interdum accumsan magna et tempor. Suspendisse scelerisque at lorem sit amet faucibus. Aenean quis consectetur enim. Duis aliquet tristique tempus. Suspendisse id ullamcorper mauris. Aliquam in libero eu justo porttitor pulvinar. Nulla semper placerat lectus. Nulla mollis suscipit lacus, a blandit purus cursus non. Maecenas id tellus mi. Pellentesque sollicitudin nibh eget magna scelerisque consequat. Aliquam convallis orci arcu, et euismod dui cursus et. Donec nec pellentesque nulla, ac pretium massa. In gravida bibendum ornare.',
263
-            "post_images" => $image_array,
264
-            "post_category" => array($post_type.'category' => array($category_array[1])),
265
-            "post_tags" => array('Tags', 'Sample Tags'),
266
-            "geodir_video" => '',
267
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
268
-            "geodir_contact" => '(111) 677-4444',
269
-            "geodir_email" => '[email protected]',
270
-            "geodir_website" => 'http://example.com/',
271
-            "geodir_twitter" => 'http://example.com/',
272
-            "geodir_facebook" => 'http://example.com/',
273
-            "geodir_price" => '350000',
274
-            "geodir_property_status" => 'For Sale',
275
-            'geodir_property_furnishing' => 'Furnished',
276
-            'geodir_property_type' => 'Detached house',
277
-            'geodir_property_bedrooms' => '3',
278
-            'geodir_property_bathrooms' => '2',
279
-            'geodir_property_area' => '1850',
280
-            'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
281
-            "post_dummy" => '1'
282
-        );
283
-
284
-
285
-        break;
286
-    case 2:
287
-        $image_array = array();
288
-        $post_meta = array();
289
-        $image_array[] = "$dummy_image_url/ps/psf2.jpg";
290
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
291
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
292
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
293
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
294
-
295
-        $post_info[] = array(
296
-            "listing_type" => $post_type,
297
-            "post_title" => 'Daisy Street',
298
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
263
+			"post_images" => $image_array,
264
+			"post_category" => array($post_type.'category' => array($category_array[1])),
265
+			"post_tags" => array('Tags', 'Sample Tags'),
266
+			"geodir_video" => '',
267
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
268
+			"geodir_contact" => '(111) 677-4444',
269
+			"geodir_email" => '[email protected]',
270
+			"geodir_website" => 'http://example.com/',
271
+			"geodir_twitter" => 'http://example.com/',
272
+			"geodir_facebook" => 'http://example.com/',
273
+			"geodir_price" => '350000',
274
+			"geodir_property_status" => 'For Sale',
275
+			'geodir_property_furnishing' => 'Furnished',
276
+			'geodir_property_type' => 'Detached house',
277
+			'geodir_property_bedrooms' => '3',
278
+			'geodir_property_bathrooms' => '2',
279
+			'geodir_property_area' => '1850',
280
+			'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace',
281
+			"post_dummy" => '1'
282
+		);
283
+
284
+
285
+		break;
286
+	case 2:
287
+		$image_array = array();
288
+		$post_meta = array();
289
+		$image_array[] = "$dummy_image_url/ps/psf2.jpg";
290
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
291
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
292
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
293
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
294
+
295
+		$post_info[] = array(
296
+			"listing_type" => $post_type,
297
+			"post_title" => 'Daisy Street',
298
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
299 299
 
300 300
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
301 301
 
@@ -305,42 +305,42 @@  discard block
 block discarded – undo
305 305
 
306 306
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
307 307
 
308
-            "post_images" => $image_array,
309
-            "post_category" => array($post_type.'category' => array($category_array[1])),
310
-            "post_tags" => array('Garage'),
311
-            "geodir_video" => '',
312
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
313
-            "geodir_contact" => '(222) 777-1111',
314
-            "geodir_email" => '[email protected]',
315
-            "geodir_website" => 'http://example.com/',
316
-            "geodir_twitter" => 'http://example.com/',
317
-            "geodir_facebook" => 'http://example.com/',
318
-            "geodir_price" => '230000',
319
-            "geodir_property_status" => 'Sold',
320
-            'geodir_property_furnishing' => 'Unfurnished',
321
-            'geodir_property_type' => 'Detached house',
322
-            'geodir_property_bedrooms' => '5',
323
-            'geodir_property_bathrooms' => '3',
324
-            'geodir_property_area' => '2650',
325
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
326
-            "post_dummy" => '1'
327
-        );
328
-
329
-        break;
330
-
331
-    case 3:
332
-        $image_array = array();
333
-        $post_meta = array();
334
-        $image_array[] = "$dummy_image_url/ps/psf3.jpg";
335
-        $image_array[] = "$dummy_image_url/ps/psl3.jpg";
336
-        $image_array[] = "$dummy_image_url/ps/psb3.jpg";
337
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
338
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
339
-
340
-        $post_info[] = array(
341
-            "listing_type" => $post_type,
342
-            "post_title" => 'Northbay House',
343
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
308
+			"post_images" => $image_array,
309
+			"post_category" => array($post_type.'category' => array($category_array[1])),
310
+			"post_tags" => array('Garage'),
311
+			"geodir_video" => '',
312
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
313
+			"geodir_contact" => '(222) 777-1111',
314
+			"geodir_email" => '[email protected]',
315
+			"geodir_website" => 'http://example.com/',
316
+			"geodir_twitter" => 'http://example.com/',
317
+			"geodir_facebook" => 'http://example.com/',
318
+			"geodir_price" => '230000',
319
+			"geodir_property_status" => 'Sold',
320
+			'geodir_property_furnishing' => 'Unfurnished',
321
+			'geodir_property_type' => 'Detached house',
322
+			'geodir_property_bedrooms' => '5',
323
+			'geodir_property_bathrooms' => '3',
324
+			'geodir_property_area' => '2650',
325
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace',
326
+			"post_dummy" => '1'
327
+		);
328
+
329
+		break;
330
+
331
+	case 3:
332
+		$image_array = array();
333
+		$post_meta = array();
334
+		$image_array[] = "$dummy_image_url/ps/psf3.jpg";
335
+		$image_array[] = "$dummy_image_url/ps/psl3.jpg";
336
+		$image_array[] = "$dummy_image_url/ps/psb3.jpg";
337
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
338
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
339
+
340
+		$post_info[] = array(
341
+			"listing_type" => $post_type,
342
+			"post_title" => 'Northbay House',
343
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
344 344
 
345 345
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
346 346
 
@@ -350,43 +350,43 @@  discard block
 block discarded – undo
350 350
 
351 351
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
352 352
 
353
-            "post_images" => $image_array,
354
-            "post_category" => array($post_type.'category' => array($category_array[1])),
355
-            "post_tags" => array('Tags', 'Sample Tags'),
356
-            "geodir_video" => '',
357
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
358
-            "geodir_contact" => '(222) 777-1111',
359
-            "geodir_email" => '[email protected]',
360
-            "geodir_website" => 'http://example.com/',
361
-            "geodir_twitter" => 'http://example.com/',
362
-            "geodir_facebook" => 'http://example.com/',
363
-            "geodir_price" => '260000',
364
-            "geodir_property_status" => 'Under Offer',
365
-            'geodir_property_furnishing' => 'Unfurnished',
366
-            'geodir_property_type' => 'Detached house',
367
-            'geodir_property_bedrooms' => '6',
368
-            'geodir_property_bathrooms' => '6',
369
-            'geodir_property_area' => '1650',
370
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
371
-            "post_dummy" => '1'
372
-        );
373
-
374
-        break;
375
-
376
-
377
-    case 4:
378
-        $image_array = array();
379
-        $post_meta = array();
380
-        $image_array[] = "$dummy_image_url/ps/psf4.jpg";
381
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
382
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
383
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
384
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
385
-
386
-        $post_info[] = array(
387
-            "listing_type" => $post_type,
388
-            "post_title" => 'Jesmond Mansion',
389
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
353
+			"post_images" => $image_array,
354
+			"post_category" => array($post_type.'category' => array($category_array[1])),
355
+			"post_tags" => array('Tags', 'Sample Tags'),
356
+			"geodir_video" => '',
357
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
358
+			"geodir_contact" => '(222) 777-1111',
359
+			"geodir_email" => '[email protected]',
360
+			"geodir_website" => 'http://example.com/',
361
+			"geodir_twitter" => 'http://example.com/',
362
+			"geodir_facebook" => 'http://example.com/',
363
+			"geodir_price" => '260000',
364
+			"geodir_property_status" => 'Under Offer',
365
+			'geodir_property_furnishing' => 'Unfurnished',
366
+			'geodir_property_type' => 'Detached house',
367
+			'geodir_property_bedrooms' => '6',
368
+			'geodir_property_bathrooms' => '6',
369
+			'geodir_property_area' => '1650',
370
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace',
371
+			"post_dummy" => '1'
372
+		);
373
+
374
+		break;
375
+
376
+
377
+	case 4:
378
+		$image_array = array();
379
+		$post_meta = array();
380
+		$image_array[] = "$dummy_image_url/ps/psf4.jpg";
381
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
382
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
383
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
384
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
385
+
386
+		$post_info[] = array(
387
+			"listing_type" => $post_type,
388
+			"post_title" => 'Jesmond Mansion',
389
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
390 390
 
391 391
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
392 392
 
@@ -396,42 +396,42 @@  discard block
 block discarded – undo
396 396
 
397 397
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
398 398
 
399
-            "post_images" => $image_array,
400
-            "post_category" => array($post_type.'category' => array($category_array[1])),
401
-            "post_tags" => array('Tags', 'Sample Tags'),
402
-            "geodir_video" => '',
403
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
404
-            "geodir_contact" => '(222) 777-1111',
405
-            "geodir_email" => '[email protected]',
406
-            "geodir_website" => 'http://example.com/',
407
-            "geodir_twitter" => 'http://example.com/',
408
-            "geodir_facebook" => 'http://example.com/',
409
-            "geodir_price" => '2300000',
410
-            "geodir_property_status" => 'Under Offer',
411
-            'geodir_property_furnishing' => 'Partially furnished',
412
-            'geodir_property_type' => 'Detached house',
413
-            'geodir_property_bedrooms' => '10',
414
-            'geodir_property_bathrooms' => '7',
415
-            'geodir_property_area' => '6600',
416
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
417
-            "post_dummy" => '1'
418
-        );
419
-
420
-        break;
421
-
422
-    case 5:
423
-        $image_array = array();
424
-        $post_meta = array();
425
-        $image_array[] = "$dummy_image_url/ps/psf5.jpg";
426
-        $image_array[] = "$dummy_image_url/ps/psl5.jpg";
427
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
428
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
429
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
430
-
431
-        $post_info[] = array(
432
-            "listing_type" => $post_type,
433
-            "post_title" => 'Springfield Lodge',
434
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
399
+			"post_images" => $image_array,
400
+			"post_category" => array($post_type.'category' => array($category_array[1])),
401
+			"post_tags" => array('Tags', 'Sample Tags'),
402
+			"geodir_video" => '',
403
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
404
+			"geodir_contact" => '(222) 777-1111',
405
+			"geodir_email" => '[email protected]',
406
+			"geodir_website" => 'http://example.com/',
407
+			"geodir_twitter" => 'http://example.com/',
408
+			"geodir_facebook" => 'http://example.com/',
409
+			"geodir_price" => '2300000',
410
+			"geodir_property_status" => 'Under Offer',
411
+			'geodir_property_furnishing' => 'Partially furnished',
412
+			'geodir_property_type' => 'Detached house',
413
+			'geodir_property_bedrooms' => '10',
414
+			'geodir_property_bathrooms' => '7',
415
+			'geodir_property_area' => '6600',
416
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace',
417
+			"post_dummy" => '1'
418
+		);
419
+
420
+		break;
421
+
422
+	case 5:
423
+		$image_array = array();
424
+		$post_meta = array();
425
+		$image_array[] = "$dummy_image_url/ps/psf5.jpg";
426
+		$image_array[] = "$dummy_image_url/ps/psl5.jpg";
427
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
428
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
429
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
430
+
431
+		$post_info[] = array(
432
+			"listing_type" => $post_type,
433
+			"post_title" => 'Springfield Lodge',
434
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
435 435
 
436 436
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
437 437
 
@@ -441,42 +441,42 @@  discard block
 block discarded – undo
441 441
 
442 442
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
443 443
 
444
-            "post_images" => $image_array,
445
-            "post_category" => array($post_type.'category' => array($category_array[1])),
446
-            "post_tags" => array('Tags', 'Sample Tags'),
447
-            "geodir_video" => '',
448
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
449
-            "geodir_contact" => '(222) 777-1111',
450
-            "geodir_email" => '[email protected]',
451
-            "geodir_website" => 'http://example.com/',
452
-            "geodir_twitter" => 'http://example.com/',
453
-            "geodir_facebook" => 'http://example.com/',
454
-            "geodir_price" => '330000',
455
-            "geodir_property_status" => 'For Sale',
456
-            'geodir_property_furnishing' => 'Optional',
457
-            'geodir_property_type' => 'Detached house',
458
-            'geodir_property_bedrooms' => '4',
459
-            'geodir_property_bathrooms' => '3',
460
-            'geodir_property_area' => '3700',
461
-            'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
462
-            "post_dummy" => '1'
463
-        );
464
-
465
-        break;
466
-
467
-    case 6:
468
-        $image_array = array();
469
-        $post_meta = array();
470
-        $image_array[] = "$dummy_image_url/ps/psf6.jpg";
471
-        $image_array[] = "$dummy_image_url/ps/psl6.jpg";
472
-        $image_array[] = "$dummy_image_url/ps/psb5.jpg";
473
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
474
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
475
-
476
-        $post_info[] = array(
477
-            "listing_type" => $post_type,
478
-            "post_title" => 'Forrest Park',
479
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
444
+			"post_images" => $image_array,
445
+			"post_category" => array($post_type.'category' => array($category_array[1])),
446
+			"post_tags" => array('Tags', 'Sample Tags'),
447
+			"geodir_video" => '',
448
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
449
+			"geodir_contact" => '(222) 777-1111',
450
+			"geodir_email" => '[email protected]',
451
+			"geodir_website" => 'http://example.com/',
452
+			"geodir_twitter" => 'http://example.com/',
453
+			"geodir_facebook" => 'http://example.com/',
454
+			"geodir_price" => '330000',
455
+			"geodir_property_status" => 'For Sale',
456
+			'geodir_property_furnishing' => 'Optional',
457
+			'geodir_property_type' => 'Detached house',
458
+			'geodir_property_bedrooms' => '4',
459
+			'geodir_property_bathrooms' => '3',
460
+			'geodir_property_area' => '3700',
461
+			'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden',
462
+			"post_dummy" => '1'
463
+		);
464
+
465
+		break;
466
+
467
+	case 6:
468
+		$image_array = array();
469
+		$post_meta = array();
470
+		$image_array[] = "$dummy_image_url/ps/psf6.jpg";
471
+		$image_array[] = "$dummy_image_url/ps/psl6.jpg";
472
+		$image_array[] = "$dummy_image_url/ps/psb5.jpg";
473
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
474
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
475
+
476
+		$post_info[] = array(
477
+			"listing_type" => $post_type,
478
+			"post_title" => 'Forrest Park',
479
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
480 480
 
481 481
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
482 482
 
@@ -486,42 +486,42 @@  discard block
 block discarded – undo
486 486
 
487 487
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
488 488
 
489
-            "post_images" => $image_array,
490
-            "post_category" => array($post_type.'category' => array($category_array[1])),
491
-            "post_tags" => array('Tags', 'Sample Tags'),
492
-            "geodir_video" => '',
493
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
494
-            "geodir_contact" => '(222) 777-1111',
495
-            "geodir_email" => '[email protected]',
496
-            "geodir_website" => 'http://example.com/',
497
-            "geodir_twitter" => 'http://example.com/',
498
-            "geodir_facebook" => 'http://example.com/',
499
-            "geodir_price" => '530000',
500
-            "geodir_property_status" => 'For Sale',
501
-            'geodir_property_furnishing' => 'Unfurnished',
502
-            'geodir_property_type' => 'Detached house',
503
-            'geodir_property_bedrooms' => '5',
504
-            'geodir_property_bathrooms' => '4',
505
-            'geodir_property_area' => '2250',
506
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
507
-            "post_dummy" => '1'
508
-        );
509
-
510
-        break;
511
-
512
-    case 7:
513
-        $image_array = array();
514
-        $post_meta = array();
515
-        $image_array[] = "$dummy_image_url/ps/psf7.jpg";
516
-        $image_array[] = "$dummy_image_url/ps/psl4.jpg";
517
-        $image_array[] = "$dummy_image_url/ps/psb4.jpg";
518
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
519
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
520
-
521
-        $post_info[] = array(
522
-            "listing_type" => $post_type,
523
-            "post_title" => 'Fraser Suites',
524
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
489
+			"post_images" => $image_array,
490
+			"post_category" => array($post_type.'category' => array($category_array[1])),
491
+			"post_tags" => array('Tags', 'Sample Tags'),
492
+			"geodir_video" => '',
493
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
494
+			"geodir_contact" => '(222) 777-1111',
495
+			"geodir_email" => '[email protected]',
496
+			"geodir_website" => 'http://example.com/',
497
+			"geodir_twitter" => 'http://example.com/',
498
+			"geodir_facebook" => 'http://example.com/',
499
+			"geodir_price" => '530000',
500
+			"geodir_property_status" => 'For Sale',
501
+			'geodir_property_furnishing' => 'Unfurnished',
502
+			'geodir_property_type' => 'Detached house',
503
+			'geodir_property_bedrooms' => '5',
504
+			'geodir_property_bathrooms' => '4',
505
+			'geodir_property_area' => '2250',
506
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway',
507
+			"post_dummy" => '1'
508
+		);
509
+
510
+		break;
511
+
512
+	case 7:
513
+		$image_array = array();
514
+		$post_meta = array();
515
+		$image_array[] = "$dummy_image_url/ps/psf7.jpg";
516
+		$image_array[] = "$dummy_image_url/ps/psl4.jpg";
517
+		$image_array[] = "$dummy_image_url/ps/psb4.jpg";
518
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
519
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
520
+
521
+		$post_info[] = array(
522
+			"listing_type" => $post_type,
523
+			"post_title" => 'Fraser Suites',
524
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
525 525
 
526 526
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
527 527
 
@@ -531,42 +531,42 @@  discard block
 block discarded – undo
531 531
 
532 532
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
533 533
 
534
-            "post_images" => $image_array,
535
-            "post_category" => array($post_type.'category' => array($category_array[0])),
536
-            "post_tags" => array('Tags', 'Sample Tags'),
537
-            "geodir_video" => '',
538
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
539
-            "geodir_contact" => '(222) 777-1111',
540
-            "geodir_email" => '[email protected]',
541
-            "geodir_website" => 'http://example.com/',
542
-            "geodir_twitter" => 'http://example.com/',
543
-            "geodir_facebook" => 'http://example.com/',
544
-            "geodir_price" => '245000',
545
-            "geodir_property_status" => 'For Sale',
546
-            'geodir_property_furnishing' => 'Unfurnished',
547
-            'geodir_property_type' => 'Apartment',
548
-            'geodir_property_bedrooms' => '3',
549
-            'geodir_property_bathrooms' => '2',
550
-            'geodir_property_area' => '1250',
551
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
552
-            "post_dummy" => '1'
553
-        );
554
-
555
-        break;
556
-
557
-    case 8:
558
-        $image_array = array();
559
-        $post_meta = array();
560
-        $image_array[] = "$dummy_image_url/ps/psf8.jpg";
561
-        $image_array[] = "$dummy_image_url/ps/psl2.jpg";
562
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
563
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
564
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
565
-
566
-        $post_info[] = array(
567
-            "listing_type" => $post_type,
568
-            "post_title" => 'Richmore Apartments',
569
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
534
+			"post_images" => $image_array,
535
+			"post_category" => array($post_type.'category' => array($category_array[0])),
536
+			"post_tags" => array('Tags', 'Sample Tags'),
537
+			"geodir_video" => '',
538
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
539
+			"geodir_contact" => '(222) 777-1111',
540
+			"geodir_email" => '[email protected]',
541
+			"geodir_website" => 'http://example.com/',
542
+			"geodir_twitter" => 'http://example.com/',
543
+			"geodir_facebook" => 'http://example.com/',
544
+			"geodir_price" => '245000',
545
+			"geodir_property_status" => 'For Sale',
546
+			'geodir_property_furnishing' => 'Unfurnished',
547
+			'geodir_property_type' => 'Apartment',
548
+			'geodir_property_bedrooms' => '3',
549
+			'geodir_property_bathrooms' => '2',
550
+			'geodir_property_area' => '1250',
551
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing',
552
+			"post_dummy" => '1'
553
+		);
554
+
555
+		break;
556
+
557
+	case 8:
558
+		$image_array = array();
559
+		$post_meta = array();
560
+		$image_array[] = "$dummy_image_url/ps/psf8.jpg";
561
+		$image_array[] = "$dummy_image_url/ps/psl2.jpg";
562
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
563
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
564
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
565
+
566
+		$post_info[] = array(
567
+			"listing_type" => $post_type,
568
+			"post_title" => 'Richmore Apartments',
569
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
570 570
 
571 571
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
572 572
 
@@ -576,43 +576,43 @@  discard block
 block discarded – undo
576 576
 
577 577
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
578 578
 
579
-            "post_images" => $image_array,
580
-            "post_category" => array($post_type.'category' => array($category_array[0])),
581
-            "post_tags" => array('Tags', 'Sample Tags'),
582
-            "geodir_video" => '',
583
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
584
-            "geodir_contact" => '(222) 777-1111',
585
-            "geodir_email" => '[email protected]',
586
-            "geodir_website" => 'http://example.com/',
587
-            "geodir_twitter" => 'http://example.com/',
588
-            "geodir_facebook" => 'http://example.com/',
589
-            "geodir_price" => '395000',
590
-            "geodir_property_status" => 'For Sale',
591
-            'geodir_property_furnishing' => 'Unfurnished',
592
-            'geodir_property_type' => 'Apartment',
593
-            'geodir_property_bedrooms' => '2',
594
-            'geodir_property_bathrooms' => '2',
595
-            'geodir_property_area' => '1750',
596
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
597
-            "post_dummy" => '1'
598
-        );
599
-
600
-        break;
601
-
602
-
603
-    case 9:
604
-        $image_array = array();
605
-        $post_meta = array();
606
-        $image_array[] = "$dummy_image_url/ps/psf9.jpg";
607
-        $image_array[] = "$dummy_image_url/ps/psc9.jpg";
608
-        $image_array[] = "$dummy_image_url/ps/psb2.jpg";
609
-        $image_array[] = "$dummy_image_url/ps/psk.jpg";
610
-        $image_array[] = "$dummy_image_url/ps/psbr.jpg";
611
-
612
-        $post_info[] = array(
613
-            "listing_type" => $post_type,
614
-            "post_title" => 'Hotel Alpina',
615
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
579
+			"post_images" => $image_array,
580
+			"post_category" => array($post_type.'category' => array($category_array[0])),
581
+			"post_tags" => array('Tags', 'Sample Tags'),
582
+			"geodir_video" => '',
583
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
584
+			"geodir_contact" => '(222) 777-1111',
585
+			"geodir_email" => '[email protected]',
586
+			"geodir_website" => 'http://example.com/',
587
+			"geodir_twitter" => 'http://example.com/',
588
+			"geodir_facebook" => 'http://example.com/',
589
+			"geodir_price" => '395000',
590
+			"geodir_property_status" => 'For Sale',
591
+			'geodir_property_furnishing' => 'Unfurnished',
592
+			'geodir_property_type' => 'Apartment',
593
+			'geodir_property_bedrooms' => '2',
594
+			'geodir_property_bathrooms' => '2',
595
+			'geodir_property_area' => '1750',
596
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
597
+			"post_dummy" => '1'
598
+		);
599
+
600
+		break;
601
+
602
+
603
+	case 9:
604
+		$image_array = array();
605
+		$post_meta = array();
606
+		$image_array[] = "$dummy_image_url/ps/psf9.jpg";
607
+		$image_array[] = "$dummy_image_url/ps/psc9.jpg";
608
+		$image_array[] = "$dummy_image_url/ps/psb2.jpg";
609
+		$image_array[] = "$dummy_image_url/ps/psk.jpg";
610
+		$image_array[] = "$dummy_image_url/ps/psbr.jpg";
611
+
612
+		$post_info[] = array(
613
+			"listing_type" => $post_type,
614
+			"post_title" => 'Hotel Alpina',
615
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
616 616
 
617 617
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
618 618
 
@@ -622,39 +622,39 @@  discard block
 block discarded – undo
622 622
 
623 623
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
624 624
 
625
-            "post_images" => $image_array,
626
-            "post_category" => array($post_type.'category' => array($category_array[2])),
627
-            "post_tags" => array('Tags', 'Sample Tags'),
628
-            "geodir_video" => '',
629
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
630
-            "geodir_contact" => '(222) 777-1111',
631
-            "geodir_email" => '[email protected]',
632
-            "geodir_website" => 'http://example.com/',
633
-            "geodir_twitter" => 'http://example.com/',
634
-            "geodir_facebook" => 'http://example.com/',
635
-            "geodir_price" => '12500000',
636
-            "geodir_property_status" => 'For Sale',
637
-            'geodir_property_furnishing' => 'Furnished',
638
-            'geodir_property_type' => 'Hotel',
639
-            'geodir_property_bedrooms' => '120',
640
-            'geodir_property_bathrooms' => '133',
641
-            'geodir_property_area' => '35000',
642
-            'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
643
-            "post_dummy" => '1'
644
-        );
645
-
646
-        break;
647
-
648
-    case 10:
649
-        $image_array = array();
650
-        $post_meta = array();
651
-        $image_array[] = "$dummy_image_url/ps/psf10.jpg";
652
-        $image_array[] = "$dummy_image_url/ps/psf102.jpg";
653
-
654
-        $post_info[] = array(
655
-            "listing_type" => $post_type,
656
-            "post_title" => 'Development Land',
657
-            "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
625
+			"post_images" => $image_array,
626
+			"post_category" => array($post_type.'category' => array($category_array[2])),
627
+			"post_tags" => array('Tags', 'Sample Tags'),
628
+			"geodir_video" => '',
629
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
630
+			"geodir_contact" => '(222) 777-1111',
631
+			"geodir_email" => '[email protected]',
632
+			"geodir_website" => 'http://example.com/',
633
+			"geodir_twitter" => 'http://example.com/',
634
+			"geodir_facebook" => 'http://example.com/',
635
+			"geodir_price" => '12500000',
636
+			"geodir_property_status" => 'For Sale',
637
+			'geodir_property_furnishing' => 'Furnished',
638
+			'geodir_property_type' => 'Hotel',
639
+			'geodir_property_bedrooms' => '120',
640
+			'geodir_property_bathrooms' => '133',
641
+			'geodir_property_area' => '35000',
642
+			'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage',
643
+			"post_dummy" => '1'
644
+		);
645
+
646
+		break;
647
+
648
+	case 10:
649
+		$image_array = array();
650
+		$post_meta = array();
651
+		$image_array[] = "$dummy_image_url/ps/psf10.jpg";
652
+		$image_array[] = "$dummy_image_url/ps/psf102.jpg";
653
+
654
+		$post_info[] = array(
655
+			"listing_type" => $post_type,
656
+			"post_title" => 'Development Land',
657
+			"post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna.
658 658
 
659 659
 Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel.
660 660
 
@@ -664,93 +664,93 @@  discard block
 block discarded – undo
664 664
 
665 665
 Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.',
666 666
 
667
-            "post_images" => $image_array,
668
-            "post_category" => array($post_type.'category' => array($category_array[3])),
669
-            "post_tags" => array('Tags', 'Sample Tags'),
670
-            "geodir_video" => '',
671
-            "geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
672
-            "geodir_contact" => '(222) 777-1111',
673
-            "geodir_email" => '[email protected]',
674
-            "geodir_website" => 'http://example.com/',
675
-            "geodir_twitter" => 'http://example.com/',
676
-            "geodir_facebook" => 'http://example.com/',
677
-            "geodir_price" => '80000',
678
-            "geodir_property_status" => 'For Sale',
679
-            'geodir_property_furnishing' => '',
680
-            'geodir_property_type' => 'Land',
681
-            'geodir_property_bedrooms' => '',
682
-            'geodir_property_bathrooms' => '',
683
-            'geodir_property_area' => '250000',
684
-            'geodir_property_features' => '',
685
-            "post_dummy" => '1'
686
-        );
687
-
688
-        break;
667
+			"post_images" => $image_array,
668
+			"post_category" => array($post_type.'category' => array($category_array[3])),
669
+			"post_tags" => array('Tags', 'Sample Tags'),
670
+			"geodir_video" => '',
671
+			"geodir_timing" => 'Viewing Sunday 10 am to 9 pm',
672
+			"geodir_contact" => '(222) 777-1111',
673
+			"geodir_email" => '[email protected]',
674
+			"geodir_website" => 'http://example.com/',
675
+			"geodir_twitter" => 'http://example.com/',
676
+			"geodir_facebook" => 'http://example.com/',
677
+			"geodir_price" => '80000',
678
+			"geodir_property_status" => 'For Sale',
679
+			'geodir_property_furnishing' => '',
680
+			'geodir_property_type' => 'Land',
681
+			'geodir_property_bedrooms' => '',
682
+			'geodir_property_bathrooms' => '',
683
+			'geodir_property_area' => '250000',
684
+			'geodir_property_features' => '',
685
+			"post_dummy" => '1'
686
+		);
687
+
688
+		break;
689 689
 
690 690
 } // end of switch
691 691
 
692 692
 foreach ($post_info as $post_info) {
693
-    $default_location = geodir_get_default_location();
694
-    if ($city_bound_lat1 > $city_bound_lat2)
695
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
696
-    else
697
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
693
+	$default_location = geodir_get_default_location();
694
+	if ($city_bound_lat1 > $city_bound_lat2)
695
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
696
+	else
697
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
698 698
 
699 699
 
700
-    if ($city_bound_lng1 > $city_bound_lng2)
701
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
702
-    else
703
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
700
+	if ($city_bound_lng1 > $city_bound_lng2)
701
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
702
+	else
703
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
704 704
 
705
-    $load_map = get_option('geodir_load_map');
705
+	$load_map = get_option('geodir_load_map');
706 706
     
707
-    if ($load_map == 'osm') {
708
-        $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
709
-    } else {
710
-        $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
711
-    }
712
-
713
-    $postal_code = '';
714
-    if (!empty($post_address)) {
715
-        if ($load_map == 'osm') {
716
-            $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
717
-            $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
718
-        } else {
719
-            $addresses = array();
720
-            $addresses_default = array();
707
+	if ($load_map == 'osm') {
708
+		$post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
709
+	} else {
710
+		$post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
711
+	}
712
+
713
+	$postal_code = '';
714
+	if (!empty($post_address)) {
715
+		if ($load_map == 'osm') {
716
+			$address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
717
+			$postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
718
+		} else {
719
+			$addresses = array();
720
+			$addresses_default = array();
721 721
             
722
-            foreach ($post_address as $add_key => $add_value) {
723
-                if ($add_key < 2 && !empty($add_value->long_name)) {
724
-                    $addresses_default[] = $add_value->long_name;
725
-                }
726
-                if ($add_value->types[0] == 'postal_code') {
727
-                    $postal_code = $add_value->long_name;
728
-                }
729
-                if ($add_value->types[0] == 'street_number') {
730
-                    $addresses[] = $add_value->long_name;
731
-                }
732
-                if ($add_value->types[0] == 'route') {
733
-                    $addresses[] = $add_value->long_name;
734
-                }
735
-                if ($add_value->types[0] == 'neighborhood') {
736
-                    $addresses[] = $add_value->long_name;
737
-                }
738
-                if ($add_value->types[0] == 'sublocality') {
739
-                    $addresses[] = $add_value->long_name;
740
-                }
741
-            }
742
-            $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
743
-        }
744
-
745
-        $post_info['post_address'] = !empty($address) ? $address : $default_location->city;
746
-        $post_info['post_city'] = $default_location->city;
747
-        $post_info['post_region'] = $default_location->region;
748
-        $post_info['post_country'] = $default_location->country;
749
-        $post_info['post_zip'] = $postal_code;
750
-        $post_info['post_latitude'] = $dummy_post_latitude;
751
-        $post_info['post_longitude'] = $dummy_post_longitude;
752
-    }
722
+			foreach ($post_address as $add_key => $add_value) {
723
+				if ($add_key < 2 && !empty($add_value->long_name)) {
724
+					$addresses_default[] = $add_value->long_name;
725
+				}
726
+				if ($add_value->types[0] == 'postal_code') {
727
+					$postal_code = $add_value->long_name;
728
+				}
729
+				if ($add_value->types[0] == 'street_number') {
730
+					$addresses[] = $add_value->long_name;
731
+				}
732
+				if ($add_value->types[0] == 'route') {
733
+					$addresses[] = $add_value->long_name;
734
+				}
735
+				if ($add_value->types[0] == 'neighborhood') {
736
+					$addresses[] = $add_value->long_name;
737
+				}
738
+				if ($add_value->types[0] == 'sublocality') {
739
+					$addresses[] = $add_value->long_name;
740
+				}
741
+			}
742
+			$address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
743
+		}
744
+
745
+		$post_info['post_address'] = !empty($address) ? $address : $default_location->city;
746
+		$post_info['post_city'] = $default_location->city;
747
+		$post_info['post_region'] = $default_location->region;
748
+		$post_info['post_country'] = $default_location->country;
749
+		$post_info['post_zip'] = $postal_code;
750
+		$post_info['post_latitude'] = $dummy_post_latitude;
751
+		$post_info['post_longitude'] = $dummy_post_longitude;
752
+	}
753 753
     
754
-    geodir_save_listing($post_info, true);
755
-    echo 1;
754
+	geodir_save_listing($post_info, true);
755
+	echo 1;
756 756
 }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
  * @package GeoDirectory
7 7
  */
8 8
 
9
-function geodir_property_sale_custom_fields($post_type='gd_place',$package_id=''){
9
+function geodir_property_sale_custom_fields($post_type = 'gd_place', $package_id = '') {
10 10
     $fields = array();
11
-    $package = ($package_id=='') ? '' : array($package_id);
11
+    $package = ($package_id == '') ? '' : array($package_id);
12 12
 
13 13
     // price
14 14
     $fields[] = array('listing_type' => $post_type,
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                       'default_value'       =>  '',
79 79
                       'show_in' 	        =>  '[detail],[listing]',
80 80
                       'is_required'         =>  true,
81
-                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'),
81
+                      'option_values'       =>  __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'),
82 82
                       'validation_pattern'  =>  '',
83 83
                       'validation_msg'      =>  '',
84 84
                       'required_msg'        =>  '',
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                       'default_value'       =>  '',
102 102
                       'show_in' 	        =>  '[detail],[listing]',
103 103
                       'is_required'         =>  true,
104
-                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'),
104
+                      'option_values'       =>  __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land', 'geodirectory'),
105 105
                       'validation_pattern'  =>  '',
106 106
                       'validation_msg'      =>  '',
107 107
                       'required_msg'        =>  '',
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                       'default_value'       =>  '',
125 125
                       'show_in' 	        =>  '[detail],[listing]',
126 126
                       'is_required'         =>  true,
127
-                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
127
+                      'option_values'       =>  __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
128 128
                       'validation_pattern'  =>  '',
129 129
                       'validation_msg'      =>  '',
130 130
                       'required_msg'        =>  '',
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                       'default_value'       =>  '',
148 148
                       'show_in' 	        =>  '[detail],[listing]',
149 149
                       'is_required'         =>  true,
150
-                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'),
150
+                      'option_values'       =>  __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'),
151 151
                       'validation_pattern'  =>  '',
152 152
                       'validation_msg'      =>  '',
153 153
                       'required_msg'        =>  '',
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                       'default_value'       =>  '',
193 193
                       'show_in' 	        =>  '[detail],[listing]',
194 194
                       'is_required'         =>  true,
195
-                      'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'),
195
+                      'option_values'       =>  __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'),
196 196
                       'validation_pattern'  =>  '',
197 197
                       'validation_msg'      =>  '',
198 198
                       'required_msg'        =>  '',
@@ -215,24 +215,24 @@  discard block
 block discarded – undo
215 215
     return  $fields;
216 216
 }
217 217
 
218
-global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index;
218
+global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2, $wpdb, $current_user, $dummy_post_index;
219 219
 $post_info = array();
220 220
 $image_array = array();
221 221
 $post_meta = array();
222 222
 $category_array = array('Apartments', 'Houses', 'Commercial', 'Land');
223 223
 
224
-if($dummy_post_index==1){
224
+if ($dummy_post_index == 1) {
225 225
     // add the dummy categories
226
-    geodir_dummy_data_taxonomies($post_type,$category_array );
226
+    geodir_dummy_data_taxonomies($post_type, $category_array);
227 227
 
228 228
     // add the dummy custom fields
229 229
     $fields = geodir_property_sale_custom_fields($post_type);
230 230
     geodir_create_dummy_fields($fields);
231
-    update_option($post_type.'_dummy_data_type','property_sale');
231
+    update_option($post_type.'_dummy_data_type', 'property_sale');
232 232
 }
233 233
 
234 234
 if (geodir_dummy_folder_exists())
235
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
235
+    $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy";
236 236
 else
237 237
     $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
238 238
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -231,10 +231,11 @@  discard block
 block discarded – undo
231 231
     update_option($post_type.'_dummy_data_type','property_sale');
232 232
 }
233 233
 
234
-if (geodir_dummy_folder_exists())
234
+if (geodir_dummy_folder_exists()) {
235 235
     $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
236
-else
236
+} else {
237 237
     $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
238
+}
238 239
 
239 240
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
240 241
 
@@ -691,16 +692,18 @@  discard block
 block discarded – undo
691 692
 
692 693
 foreach ($post_info as $post_info) {
693 694
     $default_location = geodir_get_default_location();
694
-    if ($city_bound_lat1 > $city_bound_lat2)
695
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
696
-    else
697
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
695
+    if ($city_bound_lat1 > $city_bound_lat2) {
696
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
697
+    } else {
698
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
699
+    }
698 700
 
699 701
 
700
-    if ($city_bound_lng1 > $city_bound_lng2)
701
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
702
-    else
703
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
702
+    if ($city_bound_lng1 > $city_bound_lng2) {
703
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
704
+    } else {
705
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
706
+    }
704 707
 
705 708
     $load_map = get_option('geodir_load_map');
706 709
     
Please login to merge, or discard this patch.